Commit 84575675 by wjg

init

parent e2914fbc
...@@ -12,6 +12,11 @@ public class ConfirmOrder implements Serializable { ...@@ -12,6 +12,11 @@ public class ConfirmOrder implements Serializable {
private String machineCode; private String machineCode;
/** /**
* 机器编码
*/
private String seqNo;
/**
* 点单屏编码 * 点单屏编码
*/ */
private String screenNo; private String screenNo;
...@@ -44,4 +49,12 @@ public class ConfirmOrder implements Serializable { ...@@ -44,4 +49,12 @@ public class ConfirmOrder implements Serializable {
public void setGoods(List<ConfirmGoods> goods) { public void setGoods(List<ConfirmGoods> goods) {
this.goods = goods; this.goods = goods;
} }
public String getSeqNo() {
return seqNo;
}
public void setSeqNo(String seqNo) {
this.seqNo = seqNo;
}
} }
...@@ -14,4 +14,14 @@ public class RandomUtils { ...@@ -14,4 +14,14 @@ public class RandomUtils {
} }
return val; 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; ...@@ -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.Goods;
import com.ihaoin.hooloo.device.data.vo.Sku; import com.ihaoin.hooloo.device.data.vo.Sku;
import com.ihaoin.hooloo.device.network.HttpUtil; import com.ihaoin.hooloo.device.network.HttpUtil;
import com.ihaoin.hooloo.device.util.RandomUtils;
import com.ihaoin.hooloo.device.util.Utils; import com.ihaoin.hooloo.device.util.Utils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -184,6 +186,7 @@ public class ConfirmOrderDialog extends Dialog { ...@@ -184,6 +186,7 @@ public class ConfirmOrderDialog extends Dialog {
ConfirmOrder confirmOrder = new ConfirmOrder(); ConfirmOrder confirmOrder = new ConfirmOrder();
confirmOrder.setMachineCode(AppConfig.MACHINE_CODE); confirmOrder.setMachineCode(AppConfig.MACHINE_CODE);
confirmOrder.setScreenNo(AppConfig.SCREEN_NO); confirmOrder.setScreenNo(AppConfig.SCREEN_NO);
confirmOrder.setSeqNo(genSeqNo());
confirmOrder.setGoods(goods); confirmOrder.setGoods(goods);
return JSON.toJSONString(confirmOrder); return JSON.toJSONString(confirmOrder);
} catch (Exception e) { } catch (Exception e) {
...@@ -192,6 +195,10 @@ public class ConfirmOrderDialog extends Dialog { ...@@ -192,6 +195,10 @@ public class ConfirmOrderDialog extends Dialog {
return null; return null;
} }
private String genSeqNo() {
return new Date().getTime() + "-" + RandomUtils.nextInt(null);
}
OnDismissListener dismissListener = new OnDismissListener() { OnDismissListener dismissListener = new OnDismissListener() {
@Override @Override
public void onDismiss(DialogInterface dialog) { 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