|
@@ -1193,25 +1193,14 @@ public class TEquipmentController {
|
|
public ResponseEntity<?> onOff(@RequestBody StatisticsParam param) {
|
|
public ResponseEntity<?> onOff(@RequestBody StatisticsParam param) {
|
|
String equipmentId = param.getEquipmentId();
|
|
String equipmentId = param.getEquipmentId();
|
|
Long id = Long.valueOf(equipmentId);
|
|
Long id = Long.valueOf(equipmentId);
|
|
-// TEquipment equipments = tEquipmentService.selectEntityById(id);
|
|
|
|
-// PushUtils.push(equipments.getGtClientId(), "", "", PushUtils.buildJson("onoffstatus", "0").toString());
|
|
|
|
TEquipment equipment = tEquipmentService.getById(id);
|
|
TEquipment equipment = tEquipmentService.getById(id);
|
|
if (equipment == null) {
|
|
if (equipment == null) {
|
|
// return ERROR_MESSAGE;
|
|
// return ERROR_MESSAGE;
|
|
}
|
|
}
|
|
|
|
+ String machineType = equipment.getMachineType();
|
|
String eqeStatus = "1";
|
|
String eqeStatus = "1";
|
|
String code = param.getEqeStatus();
|
|
String code = param.getEqeStatus();
|
|
//开机为1,关机为0
|
|
//开机为1,关机为0
|
|
- Integer intcode = Integer.valueOf(code);
|
|
|
|
- Integer eqeStatus1 = equipment.getEqeStatus();
|
|
|
|
-// if(intcode==eqeStatus1){
|
|
|
|
-// return ResponseEntity
|
|
|
|
-// .status(HttpStatus.OK)
|
|
|
|
-// .body(new ResultMessage()
|
|
|
|
-// .setCode(false)
|
|
|
|
-// .setData("ERROT")
|
|
|
|
-// .setMessage("操作异常"));
|
|
|
|
-// }
|
|
|
|
if (code.equals("0")) {
|
|
if (code.equals("0")) {
|
|
eqeStatus = "0";
|
|
eqeStatus = "0";
|
|
equipment.setEqeStatus(0);
|
|
equipment.setEqeStatus(0);
|
|
@@ -1226,11 +1215,11 @@ public class TEquipmentController {
|
|
time = System.currentTimeMillis();
|
|
time = System.currentTimeMillis();
|
|
}
|
|
}
|
|
if (time != null) {
|
|
if (time != null) {
|
|
-// System.out.println("time=="+time);
|
|
|
|
- tEquipmentService.sentMessage(equipment.getClientId(), PushUtils.buildJson("eqeStatus", eqeStatus, String.valueOf(time), "http://time.tianqi.com").toString());
|
|
|
|
-// PushUtils.push(equipment.getGtClientId(), "", "", PushUtils.buildJson("eqeStatus", eqeStatus,String.valueOf(time),"http://time.tianqi.com").toString());
|
|
|
|
-
|
|
|
|
-// tEquipmentService.updateById(equipment);
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(machineType) && machineType.equals("2")) {
|
|
|
|
+ tEquipmentService.sentMessage(equipment.getClientId(), PushUtils.buildJson("machineReset", "machineReset").toString());
|
|
|
|
+ } else {
|
|
|
|
+ tEquipmentService.sentMessage(equipment.getClientId(), PushUtils.buildJson("eqeStatus", eqeStatus, String.valueOf(time), "http://time.tianqi.com").toString());
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
return ResponseEntity
|
|
return ResponseEntity
|
|
.status(HttpStatus.OK)
|
|
.status(HttpStatus.OK)
|