|
@@ -586,14 +586,14 @@ public class TEquipmentController {
|
|
|
oldEquipment.setMessageReceiver(message[0] + "," + message[1] + "," + message[2]);
|
|
|
}
|
|
|
tEquipmentService.updateById(oldEquipment);
|
|
|
- String channel = oldEquipment.getChannel();
|
|
|
- String equimentType = oldEquipment.getEquimentType();
|
|
|
- String clientId = oldEquipment.getClientId();
|
|
|
+// String channel = oldEquipment.getChannel();
|
|
|
+// String equimentType = oldEquipment.getEquimentType();
|
|
|
+// String clientId = oldEquipment.getClientId();
|
|
|
if (equipment.getPayType() != null) {
|
|
|
tEquipmentService.sentMessage(oldEquipment.getClientId(), PushUtils.buildJson("payType", oldEquipment.getPayType().toString() + ":" + oldEquipment.getTimeRuleId()).toString());
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(oldEquipment.getContactName()) && StringUtils.isNotEmpty(oldEquipment.getContactPhone())) {
|
|
|
- tEquipmentService.sentMessage(oldEquipment.getClientId(), PushUtils.buildJson("phone", oldEquipment.getContactName() + ":" + oldEquipment.getContactPhone().toString()).toString());
|
|
|
+ tEquipmentService.sentMessage(oldEquipment.getClientId(), PushUtils.buildJson("phone", oldEquipment.getContactName() + ":" + oldEquipment.getContactPhone()).toString());
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(oldEquipment.getCompanyPhone())) {
|
|
|
tEquipmentService.sentMessage(oldEquipment.getClientId(), PushUtils.buildJson("companyPhone", oldEquipment.getCompanyPhone()).toString());
|
|
@@ -705,11 +705,7 @@ public class TEquipmentController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if (i > 0) {
|
|
|
- equipmentDTO.setHasTodayAlarm(true);
|
|
|
- } else {
|
|
|
- equipmentDTO.setHasTodayAlarm(false);
|
|
|
- }
|
|
|
+ equipmentDTO.setHasTodayAlarm(i > 0);
|
|
|
}
|
|
|
return equipmentDTO;
|
|
|
}).collect(Collectors.toList());
|
|
@@ -788,7 +784,7 @@ public class TEquipmentController {
|
|
|
equipment1.setMessageReceiver(equipment.getMessageReceiver());
|
|
|
}
|
|
|
Boolean t = tEquipmentService.updateById(equipment1);
|
|
|
- if (t == true) {
|
|
|
+ if (t) {
|
|
|
return ResponseEntity.status(HttpStatus.OK)
|
|
|
.body(new ResultMessage().setCode(true).setData(equipment1).setMessage("修改成功"));
|
|
|
} else {
|
|
@@ -1091,9 +1087,9 @@ public class TEquipmentController {
|
|
|
String equipmentId = param.getEquipmentId();
|
|
|
Long id = Long.valueOf(equipmentId);
|
|
|
TEquipment equipment = tEquipmentService.getById(id);
|
|
|
- if (equipment == null) {
|
|
|
+// if (equipment == null) {
|
|
|
// return ERROR_MESSAGE;
|
|
|
- }
|
|
|
+// }
|
|
|
String eqeStatus = "0";
|
|
|
String code = param.getEqeStatus();
|
|
|
if (code.equals("1")) {
|
|
@@ -1185,9 +1181,9 @@ public class TEquipmentController {
|
|
|
String equipmentId = param.getEquipmentId();
|
|
|
Long id = Long.valueOf(equipmentId);
|
|
|
TEquipment equipment = tEquipmentService.getById(id);
|
|
|
- if (equipment == null) {
|
|
|
+// if (equipment == null) {
|
|
|
// return ERROR_MESSAGE;
|
|
|
- }
|
|
|
+// }
|
|
|
String machineType = equipment.getMachineType();
|
|
|
String eqeStatus = "1";
|
|
|
String code = param.getEqeStatus();
|
|
@@ -1576,9 +1572,9 @@ public class TEquipmentController {
|
|
|
/**
|
|
|
* 下载日志
|
|
|
*
|
|
|
- * @param equipmentId
|
|
|
- * @param day
|
|
|
- * @param response
|
|
|
+ * @param equipmentId 设备id
|
|
|
+ * @param day 日期
|
|
|
+ * @param response 响应
|
|
|
*/
|
|
|
@ApiOperation(value = "下载日志")
|
|
|
@GetMapping("/downloadLog")
|
|
@@ -1651,23 +1647,23 @@ public class TEquipmentController {
|
|
|
}
|
|
|
|
|
|
// 从服务器下载文件
|
|
|
- public void downloadFile(String filepath, HttpServletResponse response) throws IOException {
|
|
|
- File logFile = new File(filepath);
|
|
|
- response.setHeader("Content-Disposition", "attachment; filename=\"" + logFile.getName() + "\"");
|
|
|
-
|
|
|
- FileInputStream fis = new FileInputStream(logFile);
|
|
|
- OutputStream os = response.getOutputStream();
|
|
|
-
|
|
|
- byte[] buffer = new byte[4096];
|
|
|
- int length;
|
|
|
- while ((length = fis.read(buffer)) > 0) {
|
|
|
- os.write(buffer, 0, length);
|
|
|
- os.flush();
|
|
|
- }
|
|
|
- os.close();
|
|
|
- fis.close();
|
|
|
- response.flushBuffer();
|
|
|
- }
|
|
|
+// public void downloadFile(String filepath, HttpServletResponse response) throws IOException {
|
|
|
+// File logFile = new File(filepath);
|
|
|
+// response.setHeader("Content-Disposition", "attachment; filename=\"" + logFile.getName() + "\"");
|
|
|
+//
|
|
|
+// FileInputStream fis = new FileInputStream(logFile);
|
|
|
+// OutputStream os = response.getOutputStream();
|
|
|
+//
|
|
|
+// byte[] buffer = new byte[4096];
|
|
|
+// int length;
|
|
|
+// while ((length = fis.read(buffer)) > 0) {
|
|
|
+// os.write(buffer, 0, length);
|
|
|
+// os.flush();
|
|
|
+// }
|
|
|
+// os.close();
|
|
|
+// fis.close();
|
|
|
+// response.flushBuffer();
|
|
|
+// }
|
|
|
|
|
|
//查找设备
|
|
|
@ApiOperation(value = "获取对应的机器编号")
|