|
|
@@ -1,6 +1,7 @@
|
|
|
package com.github.zuihou.business.controller.externalApi;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
@@ -27,8 +28,12 @@ import com.github.zuihou.business.operationManagementCenter.dto.PlanPageDTO;
|
|
|
import com.github.zuihou.business.operationManagementCenter.entity.*;
|
|
|
import com.github.zuihou.business.operationManagementCenter.service.*;
|
|
|
import com.github.zuihou.business.productionReadyCenter.entity.AAutoNodeLog;
|
|
|
+import com.github.zuihou.business.productionReadyCenter.entity.DeviceRateLog;
|
|
|
+import com.github.zuihou.business.productionReadyCenter.entity.DeviceStatusLog;
|
|
|
import com.github.zuihou.business.productionReadyCenter.entity.MMeterial;
|
|
|
import com.github.zuihou.business.productionReadyCenter.service.AAutoNodeLogService;
|
|
|
+import com.github.zuihou.business.productionReadyCenter.service.DeviceRateLogService;
|
|
|
+import com.github.zuihou.business.productionReadyCenter.service.DeviceStatusLogService;
|
|
|
import com.github.zuihou.business.productionReadyCenter.service.MMeterialService;
|
|
|
import com.github.zuihou.business.productionResourceCenter.entity.Productionresource;
|
|
|
import com.github.zuihou.business.productionResourceCenter.entity.ZZone;
|
|
|
@@ -127,6 +132,12 @@ public class ProductionTasksController {
|
|
|
@Autowired
|
|
|
private ProductionresourceBizService productionresourceBizService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private DeviceStatusLogService deviceStatusLogService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private DeviceRateLogService deviceRateLogService;
|
|
|
+
|
|
|
|
|
|
//MES->产线
|
|
|
@ApiOperation(value = "任务下发通知接口", notes = "任务下发通知接口")
|
|
|
@@ -633,4 +644,49 @@ public class ProductionTasksController {
|
|
|
}
|
|
|
return instance;
|
|
|
}
|
|
|
+
|
|
|
+ //MES->产线
|
|
|
+ @ApiOperation(value = "产线机床对应事件查询接口", notes = "产线机床对应事件查询接口")
|
|
|
+ @PostMapping("/deviceStatusLog/queryMachineEventDetail")
|
|
|
+ public R2 queryMachineEventDetail(@RequestBody Map<String, Object> map) {
|
|
|
+ BaseContextHandler.setTenant("0000");
|
|
|
+ Map params = (Map) map.get("model");
|
|
|
+ LbqWrapper<DeviceStatusLog> lbqWrapper = new LbqWrapper<DeviceStatusLog>();
|
|
|
+ lbqWrapper.eq(ObjectUtil.isNotEmpty(params.get("status")),DeviceStatusLog::getStatus, params.get("status").toString()).eq(ObjectUtil.isNotEmpty(params.get("date")),DeviceStatusLog::getCurrDate, params.get("date").toString())
|
|
|
+ .eq(ObjectUtil.isNotEmpty(params.get("code")),DeviceStatusLog::getCode, params.get("code"));
|
|
|
+ List<DeviceStatusLog> returnData = deviceStatusLogService.list(lbqWrapper);
|
|
|
+ return R2.success(returnData);
|
|
|
+ }
|
|
|
+
|
|
|
+ //MES->产线
|
|
|
+ @ApiOperation(value = "产线机床对应事件统计查询接口", notes = "产线机床对应事件统计查询接口")
|
|
|
+ @PostMapping("/deviceStatusLog/queryMachineEvent")
|
|
|
+ public R2 queryMachineEvent(@RequestBody Map<String, Object> map) {
|
|
|
+ BaseContextHandler.setTenant("0000");
|
|
|
+
|
|
|
+ Map params = (Map) map.get("model");
|
|
|
+ LbqWrapper<DeviceStatusLog> lbqWrapper = new LbqWrapper<DeviceStatusLog>();
|
|
|
+ lbqWrapper.eq(ObjectUtil.isNotEmpty(params.get("status")),DeviceStatusLog::getStatus, params.get("status").toString()).eq(ObjectUtil.isNotEmpty(params.get("date")),DeviceStatusLog::getCurrDate, params.get("date").toString())
|
|
|
+ .eq(ObjectUtil.isNotEmpty(params.get("date")),DeviceStatusLog::getCurrDate, params.get("date").toString())
|
|
|
+ .eq(ObjectUtil.isNotEmpty(params.get("code")),DeviceStatusLog::getCode, params.get("code"))
|
|
|
+ .eq(ObjectUtil.isNotEmpty(params.get("preStatus")),DeviceStatusLog::getPreStatus, params.get("preStatus").toString())
|
|
|
+ .eq(ObjectUtil.isNotEmpty(params.get("changeStatus")),DeviceStatusLog::getChangeStatus, params.get("changeStatus").toString());
|
|
|
+ Map resultMap = deviceStatusLogService.queryMachineEvent(lbqWrapper);
|
|
|
+ return R2.success(resultMap);
|
|
|
+ }
|
|
|
+
|
|
|
+ //MES->产线
|
|
|
+ @ApiOperation(value = "产线机床设备利用率查询接口", notes = "产线机床设备利用率查询接口")
|
|
|
+ @PostMapping("/deviceStatusLog/queryDeviceRate")
|
|
|
+ public R2 queryDeviceRate(@RequestBody Map<String, Object> params) {
|
|
|
+ BaseContextHandler.setTenant("0000");
|
|
|
+
|
|
|
+ LbqWrapper<DeviceRateLog> lbqWrapper = new LbqWrapper<DeviceRateLog>();
|
|
|
+ lbqWrapper.eq(ObjectUtil.isNotEmpty(params.get("date")),DeviceRateLog::getDate, params.get("date").toString())
|
|
|
+ .eq(ObjectUtil.isNotEmpty(params.get("code")),DeviceRateLog::getCode, params.get("code"));
|
|
|
+ //List<DeviceStatusLog> returnData = deviceStatusLogService.list(lbqWrapper);
|
|
|
+ List<DeviceRateLog> returnData = deviceRateLogService.list(lbqWrapper);
|
|
|
+
|
|
|
+ return R2.success(returnData);
|
|
|
+ }
|
|
|
}
|