|
@@ -117,8 +117,8 @@ public class IndexController {
|
|
|
|
|
|
String clientId = equipmentVo.getClientId();
|
|
|
Date lastUpdateTime = equipmentVo.getLastUpdateTime();
|
|
|
- Double longitude = equipmentVo.getLongitude();
|
|
|
- Double latitude = equipmentVo.getLatitude();
|
|
|
+// Double longitude = equipmentVo.getLongitude();
|
|
|
+// Double latitude = equipmentVo.getLatitude();
|
|
|
String cabinetHd = equipmentVo.getCabinetHd();
|
|
|
String cabinetTm = equipmentVo.getCabinetTm();
|
|
|
String furnaceSp = equipmentVo.getFurnaceSp();
|
|
@@ -132,6 +132,7 @@ public class IndexController {
|
|
|
String candyGeneratorTm = equipmentVo.getCandyGeneratorTm();
|
|
|
String outsideTm = equipmentVo.getOutsideTm();
|
|
|
String outsideHd = equipmentVo.getOutsideHd();
|
|
|
+ Integer workingMode = equipmentVo.getWorkingMode();
|
|
|
|
|
|
//有记录,则进行修改
|
|
|
LambdaQueryWrapper<TEquipment> query = Wrappers.lambdaQuery();
|
|
@@ -213,15 +214,12 @@ public class IndexController {
|
|
|
equipmentDesc.setCupQuantity(Long.parseLong(furnaceTm));
|
|
|
}
|
|
|
}
|
|
|
-// if (equipmentVo.getCupQuantity() != null) {
|
|
|
-// equipmentDesc.setCupQuantity(equipmentVo.getCupQuantity());
|
|
|
-// }
|
|
|
-// if (StringUtils.isNotEmpty(equipmentVo.getStirTm())) {
|
|
|
-// equipmentDesc.setStirTm(equipmentVo.getStirTm());
|
|
|
-// }
|
|
|
-// if (StringUtils.isNotEmpty(equipmentVo.getCornGeneratorTm())) {
|
|
|
-// equipmentDesc.setCornGeneratorTm(equipmentVo.getCornGeneratorTm());
|
|
|
-// }
|
|
|
+ // 如果是雪糕机
|
|
|
+ if (StringUtils.isNotEmpty(machineType) && newEquipment.getMachineType().equals("2")) {
|
|
|
+ if (workingMode!= null) {
|
|
|
+ equipmentDesc.setWorkingMode(workingMode);
|
|
|
+ }
|
|
|
+ }
|
|
|
if (StringUtils.isNotEmpty(numberOne)) {
|
|
|
equipmentDesc.setNumberOne(numberOne);
|
|
|
}
|
|
@@ -938,6 +936,9 @@ public class IndexController {
|
|
|
if (equipment != null) {
|
|
|
Long id = equipment.getId();
|
|
|
//修改花型记录数目
|
|
|
+ equipment.setFlowers(number);
|
|
|
+ equipmentService.updateById(equipment);
|
|
|
+ //修改设备描述表中的花型记录数目
|
|
|
TEquipmentDesc equipmentDesc = equipmentDescService.getById(id);
|
|
|
if (equipmentDesc != null) {
|
|
|
equipmentDesc.setFlowers(number);
|
|
@@ -962,21 +963,6 @@ public class IndexController {
|
|
|
}
|
|
|
//创建花型
|
|
|
saveGoodsData(id, machineType, Integer.parseInt(number));
|
|
|
-// if (number.equals("18")) {
|
|
|
-// saveProduct(id);
|
|
|
-// }
|
|
|
-// if (number.equals("22")) {
|
|
|
-// saveProductMG22(id);
|
|
|
-// }
|
|
|
-// if (number.equals("26")) {
|
|
|
-// saveProductMG26(id);
|
|
|
-// }
|
|
|
-// if (number.equals("30")) {
|
|
|
-// saveProductMG1(id);
|
|
|
-// }
|
|
|
-// if (number.equals("42")) {
|
|
|
-// saveProductMG42(id);
|
|
|
-// }
|
|
|
return "success";
|
|
|
} else {
|
|
|
return "error";
|
|
@@ -1173,46 +1159,6 @@ public class IndexController {
|
|
|
@RequestMapping(value = "/sendLog.htm", method = RequestMethod.POST, produces = "text/html;charset=utf-8")
|
|
|
@ResponseBody
|
|
|
public String uploadFile(HttpServletRequest request, HttpServletResponse response, String fileName) throws Exception {
|
|
|
-// String fileFullPath = "/home/hboxs/log/" + fileName + ".txt";
|
|
|
-//// String fileFullPath = "/root/uploadfile/apache-tomcat-8.5.42/" + fileName;
|
|
|
-//
|
|
|
-// InputStream input = null;
|
|
|
-// FileOutputStream fos = null;
|
|
|
-// try {
|
|
|
-// input = request.getInputStream();
|
|
|
-// File file = new File("/home/hboxs/log/");
|
|
|
-// if (!file.exists()) {
|
|
|
-// file.mkdirs();
|
|
|
-// }
|
|
|
-// fos = new FileOutputStream(fileFullPath);
|
|
|
-// int size = 0;
|
|
|
-// byte[] buffer = new byte[1024];
|
|
|
-// while ((size = input.read(buffer, 0, 1024)) != -1) {
|
|
|
-// fos.write(buffer, 0, size);
|
|
|
-// }
|
|
|
-//
|
|
|
-// //响应信息 json字符串格式
|
|
|
-// Map<String, Object> responseMap = new HashMap<String, Object>();
|
|
|
-// responseMap.put("flag", true);
|
|
|
-//
|
|
|
-// //生成响应的json字符串
|
|
|
-// String jsonResponse = JSONObject.toJSONString(responseMap);
|
|
|
-// sendResponse(jsonResponse, response);
|
|
|
-// } catch (IOException e) {
|
|
|
-// //响应信息 json字符串格式
|
|
|
-// Map<String, Object> responseMap = new HashMap<String, Object>();
|
|
|
-// responseMap.put("flag", false);
|
|
|
-// responseMap.put("errorMsg", e.getMessage());
|
|
|
-// String jsonResponse = JSONObject.toJSONString(responseMap) ;
|
|
|
-// sendResponse(jsonResponse, response);
|
|
|
-// } finally {
|
|
|
-// if (input != null) {
|
|
|
-// input.close();
|
|
|
-// }
|
|
|
-// if (fos != null) {
|
|
|
-// fos.close();
|
|
|
-// }
|
|
|
-// }
|
|
|
//构造一个带指定 Region 对象的配置类
|
|
|
Configuration cfg = new Configuration(Region.region2());
|
|
|
cfg.resumableUploadAPIVersion = Configuration.ResumableUploadAPIVersion.V2;// 指定分片上传版本
|
|
@@ -2353,5 +2299,20 @@ public class IndexController {
|
|
|
return diyPassword;
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "更新雪糕机工作模式")
|
|
|
+ @RequestMapping(value = "/upWorkingMode", method = RequestMethod.GET, produces = "text/html;charset=utf-8")
|
|
|
+ @ResponseBody
|
|
|
+ public String upWorkingMode(String clientId, Integer workingMode) {
|
|
|
+ if (workingMode != null) {
|
|
|
+ LambdaQueryWrapper<TEquipment> query = Wrappers.lambdaQuery();
|
|
|
+ query.eq(TEquipment::getClientId, clientId);
|
|
|
+ TEquipment equipment = equipmentService.getOne(query);
|
|
|
+ TEquipmentDesc equipmentDesc = equipmentDescService.getById(equipment.getId());
|
|
|
+ equipmentDesc.setWorkingMode(workingMode);
|
|
|
+ equipmentDescService.updateById(equipmentDesc);
|
|
|
+ return "success";
|
|
|
+ }
|
|
|
+ return "fail";
|
|
|
+ }
|
|
|
}
|
|
|
|