|
@@ -383,9 +383,14 @@ public class IndexController {
|
|
|
equipmentApply.setAdminId(adminId);
|
|
|
equipmentApply.setAdminUserName(username);
|
|
|
equipmentApply.setEquimentType(equimentType);
|
|
|
+ // 如果是爆米花
|
|
|
if (equimentType.equals("P30")) {
|
|
|
machineType = "1";
|
|
|
}
|
|
|
+ // 如果是冰淇淋
|
|
|
+ if (equimentType.equals("SI320")) {
|
|
|
+ machineType = "2";
|
|
|
+ }
|
|
|
equipmentApply.setMachineType(machineType);
|
|
|
equipmentApply.setCreateDate(new Date());
|
|
|
equipmentApply.setModifyDate(new Date());
|
|
@@ -471,13 +476,18 @@ public class IndexController {
|
|
|
}
|
|
|
}
|
|
|
equipment.setEquimentType("MG320");
|
|
|
- }
|
|
|
- if (equipmentApply.getEquimentType().equals("MG330")) {
|
|
|
- equipment.setEquimentType("MG330");
|
|
|
- }
|
|
|
- if (equipmentApply.getEquimentType().equals("P30")) {
|
|
|
+ } else {
|
|
|
equipment.setEquimentType(equipmentApply.getEquimentType());
|
|
|
}
|
|
|
+// if (equipmentApply.getEquimentType().equals("MG330")) {
|
|
|
+// equipment.setEquimentType("MG330");
|
|
|
+// }
|
|
|
+// if (equipmentApply.getEquimentType().equals("P30")) {
|
|
|
+// equipment.setEquimentType(equipmentApply.getEquimentType());
|
|
|
+// }
|
|
|
+// if (equipmentApply.getEquimentType().equals("SI320")) {
|
|
|
+// equipment.setEquimentType(equipmentApply.getEquimentType());
|
|
|
+// }
|
|
|
equipmentService.updateById(equipment);
|
|
|
LambdaQueryWrapper<TProportion> queryProportion = Wrappers.lambdaQuery();
|
|
|
queryProportion.eq(TProportion::getEquipmentId, equipment.getId());
|
|
@@ -495,9 +505,12 @@ public class IndexController {
|
|
|
if (StringUtils.isEmpty(machineType) || machineType.equals("0")) {
|
|
|
equipmentService.sentMessage(clientId, PushUtils.buildJson("statusType", "agreed" + old).toString());
|
|
|
PushUtils.push(equipmentApply.getGtClientId(), "【棉花糖】设备初始化申请", "同意", PushUtils.buildJson("statusType", "agreed" + old).toString());
|
|
|
- } else {
|
|
|
+ } else if (StringUtils.isNotEmpty(machineType) && machineType.equals("1")){
|
|
|
equipmentService.sentMessage(clientId, PushUtils.buildJson("statusType", "agreed" + old).toString());
|
|
|
PushUtils.push(equipmentApply.getGtClientId(), "【爆米花】设备初始化申请", "同意", PushUtils.buildJson("statusType", "agreed" + old).toString());
|
|
|
+ } else if (StringUtils.isNotEmpty(machineType) && machineType.equals("2")){
|
|
|
+ equipmentService.sentMessage(clientId, PushUtils.buildJson("statusType", "agreed" + old).toString());
|
|
|
+ PushUtils.push(equipmentApply.getGtClientId(), "【冰淇淋】设备初始化申请", "同意", PushUtils.buildJson("statusType", "agreed" + old).toString());
|
|
|
}
|
|
|
if (equipment.getEquimentType().equals("280")) {
|
|
|
equipmentService.sentMessage(clientId, PushUtils.buildJson("endDate", String.valueOf(equipment.getEndDate().getTime())).toString());
|
|
@@ -511,7 +524,6 @@ public class IndexController {
|
|
|
equipmentDesc.setEquipmentId(equipment.getId());
|
|
|
equipmentDescService.save(equipmentDesc);
|
|
|
}
|
|
|
-
|
|
|
} else {
|
|
|
|
|
|
TEquipment equipment = new TEquipment();
|
|
@@ -555,9 +567,12 @@ public class IndexController {
|
|
|
if (StringUtils.isEmpty(machineType) || machineType.equals("0")) {
|
|
|
equipmentService.sentMessage(clientId, PushUtils.buildJson("statusType", "agreed" + old).toString());
|
|
|
PushUtils.push(equipmentApply.getGtClientId(), "【棉花糖】设备初始化申请", "同意", PushUtils.buildJson("statusType", "agreed" + old).toString());
|
|
|
- } else {
|
|
|
+ } else if (StringUtils.isNotEmpty(machineType) && machineType.equals("1")){
|
|
|
equipmentService.sentMessage(clientId, PushUtils.buildJson("statusType", "agreed" + old).toString());
|
|
|
PushUtils.push(equipmentApply.getGtClientId(), "【爆米花】设备初始化申请", "同意", PushUtils.buildJson("statusType", "agreed" + old).toString());
|
|
|
+ } else if (StringUtils.isNotEmpty(machineType) && machineType.equals("2")){
|
|
|
+ equipmentService.sentMessage(clientId, PushUtils.buildJson("statusType", "agreed" + old).toString());
|
|
|
+ PushUtils.push(equipmentApply.getGtClientId(), "【冰淇淋】设备初始化申请", "同意", PushUtils.buildJson("statusType", "agreed" + old).toString());
|
|
|
}
|
|
|
LambdaQueryWrapper<TEquipment> query3 = Wrappers.lambdaQuery();
|
|
|
query3.eq(TEquipment::getClientId, clientId);
|
|
@@ -595,10 +610,14 @@ public class IndexController {
|
|
|
} else {
|
|
|
saveProduct(equipmentId);
|
|
|
}
|
|
|
- } else {
|
|
|
+ } else if (StringUtils.isNotEmpty(machineType) && machineType.equals("1")){
|
|
|
if (equimentType.equals("P30")) {
|
|
|
saveProductP30(equipmentId);
|
|
|
}
|
|
|
+ } else if (StringUtils.isNotEmpty(machineType) && machineType.equals("2")){
|
|
|
+ if (equimentType.equals("SI320")) {
|
|
|
+ saveProductSI320(equipmentId);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (String.valueOf(adminId).equals("3") || String.valueOf(adminId).equals("31") || String.valueOf(adminId).equals("506") || String.valueOf(adminId).equals("1090")) {
|
|
@@ -831,7 +850,28 @@ public class IndexController {
|
|
|
product.setCodePrice(BigDecimal.ZERO);
|
|
|
productService.save(product);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 添加冰淇淋产品
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ */
|
|
|
+ private void saveProductSI320(Long id) {
|
|
|
+ String[] str = {"冰淇淋-I01", "草莓酱-J01", "蓝莓酱-J02", "菠萝酱-J03", "榛子碎-C01", "花生碎-C02", "腰果碎-C03"};
|
|
|
+
|
|
|
+ for (int i = 0; i < str.length; i++) {
|
|
|
+ TProduct product = new TProduct();
|
|
|
+ product.setCreateDate(new Date());
|
|
|
+ product.setModifyDate(new Date());
|
|
|
+ product.setEquipmentId(id);
|
|
|
+ String[] split = str[i].split("-");
|
|
|
+ product.setProductName(split[0]);
|
|
|
+ product.setNo(split[1]);
|
|
|
+ product.setRmbPrice(BigDecimal.ZERO);
|
|
|
+ product.setCodePrice(BigDecimal.ZERO);
|
|
|
+ productService.save(product);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|