|
@@ -1175,16 +1175,25 @@ public class TEquipmentController {
|
|
|
return R.ok();
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "雪糕机机器复位")
|
|
|
+ @PostMapping("/machineReset")
|
|
|
+ public ResponseModel<?> machineReset(@RequestBody StatisticsParam param) {
|
|
|
+ String equipmentId = param.getEquipmentId();
|
|
|
+ Long id = Long.valueOf(equipmentId);
|
|
|
+ TEquipment equipment = tEquipmentService.getById(id);
|
|
|
+ if (equipment == null) {
|
|
|
+ return R.fail(F0002,"设备不存在");
|
|
|
+ }
|
|
|
+ tEquipmentService.sentMessage(equipment.getClientId(), PushUtils.buildJson("machineReset", "machineReset").toString());
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "机器开关机")
|
|
|
@PostMapping("/onOff")
|
|
|
public ResponseEntity<?> onOff(@RequestBody StatisticsParam param) {
|
|
|
String equipmentId = param.getEquipmentId();
|
|
|
Long id = Long.valueOf(equipmentId);
|
|
|
TEquipment equipment = tEquipmentService.getById(id);
|
|
|
-// if (equipment == null) {
|
|
|
-// return ERROR_MESSAGE;
|
|
|
-// }
|
|
|
- String machineType = equipment.getMachineType();
|
|
|
String eqeStatus = "1";
|
|
|
String code = param.getEqeStatus();
|
|
|
//开机为1,关机为0
|
|
@@ -1202,11 +1211,7 @@ public class TEquipmentController {
|
|
|
time = System.currentTimeMillis();
|
|
|
}
|
|
|
if (time != null) {
|
|
|
- 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());
|
|
|
- }
|
|
|
+ tEquipmentService.sentMessage(equipment.getClientId(), PushUtils.buildJson("eqeStatus", eqeStatus, String.valueOf(time), "http://time.tianqi.com").toString());
|
|
|
} else {
|
|
|
return ResponseEntity
|
|
|
.status(HttpStatus.OK)
|