|
@@ -1715,6 +1715,37 @@ public class TEquipmentController {
|
|
return R.ok();
|
|
return R.ok();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 上传日志
|
|
|
|
+ *
|
|
|
|
+ * @param equipmentId
|
|
|
|
+ * @param day
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation(value = "上传日志")
|
|
|
|
+ @GetMapping("/uploadLog")
|
|
|
|
+ public ResponseModel<?> uploadLog(String equipmentId, String day) {
|
|
|
|
+ if (StringUtils.isEmpty(equipmentId)) {
|
|
|
|
+ return R.fail(A0001);
|
|
|
|
+ }
|
|
|
|
+ TEquipment tEquipment = tEquipmentService.getById(equipmentId);
|
|
|
|
+ if (tEquipment == null) {
|
|
|
|
+ return R.fail(A0001, "该设备不存在");
|
|
|
|
+ }
|
|
|
|
+ String clientId = tEquipment.getClientId();
|
|
|
|
+ String kind = day + "-" + clientId;
|
|
|
|
+ String channel = tEquipment.getChannel();
|
|
|
|
+ String equimentType = tEquipment.getEquimentType();
|
|
|
|
+ if (StringUtils.isEmpty(channel) || channel.equals("1") || StringUtils.isEmpty(equimentType)) {
|
|
|
|
+ //用个推
|
|
|
|
+ PushUtils.push(tEquipment.getGtClientId(), "", "", PushUtils.buildJson("log", kind).toString());
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isNotEmpty(channel) && channel.equals("2") && StringUtils.isNotEmpty(equimentType)) {
|
|
|
|
+ //用Mq
|
|
|
|
+ tEquipmentService.sentMessage(tEquipment.getClientId(), PushUtils.buildJson("log", kind).toString());
|
|
|
|
+ }
|
|
|
|
+ return R.ok();
|
|
|
|
+ }
|
|
|
|
+
|
|
@ApiOperation(value = "查询日志是否上传成功")
|
|
@ApiOperation(value = "查询日志是否上传成功")
|
|
@GetMapping("/queryLog")
|
|
@GetMapping("/queryLog")
|
|
public ResponseModel<?> queryLog(String equipmentId, String day) {
|
|
public ResponseModel<?> queryLog(String equipmentId, String day) {
|