Commit 84575675 by wjg

init

parent e2914fbc
......@@ -12,6 +12,11 @@ public class ConfirmOrder implements Serializable {
private String machineCode;
/**
* 机器编码
*/
private String seqNo;
/**
* 点单屏编码
*/
private String screenNo;
......@@ -44,4 +49,12 @@ public class ConfirmOrder implements Serializable {
public void setGoods(List<ConfirmGoods> goods) {
this.goods = goods;
}
public String getSeqNo() {
return seqNo;
}
public void setSeqNo(String seqNo) {
this.seqNo = seqNo;
}
}
......@@ -14,4 +14,14 @@ public class RandomUtils {
}
return val;
}
public static Integer nextInt(List<Integer> ints) {
Integer val = new Random().nextInt();
if (CollectionUtils.isEmpty(ints)) {
return val;
}
if (ints.contains(val)) {
return nextInt(ints);
}
return val;
}
}
......@@ -32,9 +32,11 @@ import com.ihaoin.hooloo.device.data.po.ConfirmOrder;
import com.ihaoin.hooloo.device.data.vo.Goods;
import com.ihaoin.hooloo.device.data.vo.Sku;
import com.ihaoin.hooloo.device.network.HttpUtil;
import com.ihaoin.hooloo.device.util.RandomUtils;
import com.ihaoin.hooloo.device.util.Utils;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -184,6 +186,7 @@ public class ConfirmOrderDialog extends Dialog {
ConfirmOrder confirmOrder = new ConfirmOrder();
confirmOrder.setMachineCode(AppConfig.MACHINE_CODE);
confirmOrder.setScreenNo(AppConfig.SCREEN_NO);
confirmOrder.setSeqNo(genSeqNo());
confirmOrder.setGoods(goods);
return JSON.toJSONString(confirmOrder);
} catch (Exception e) {
......@@ -192,6 +195,10 @@ public class ConfirmOrderDialog extends Dialog {
return null;
}
private String genSeqNo() {
return new Date().getTime() + "-" + RandomUtils.nextInt(null);
}
OnDismissListener dismissListener = new OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment