add:大屏、看板、弹窗接口完善
This commit is contained in:
@@ -1244,26 +1244,45 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
@Override
|
@Override
|
||||||
public JSONObject getDeviceStatus(JSONArray param) {
|
public JSONObject getDeviceStatus(JSONArray param) {
|
||||||
log.info("getDeviceStatus - 请求参数 {}", param);
|
log.info("getDeviceStatus - 请求参数 {}", param);
|
||||||
if (ObjectUtil.isNotEmpty(param)) {
|
if (ObjectUtil.isEmpty(param)) {
|
||||||
for (int i = 0; i < param.size(); i++) {
|
JSONObject result = new JSONObject();
|
||||||
JSONObject status = param.getJSONObject(i);
|
result.put("status", HttpStatus.OK.value());
|
||||||
if (ObjectUtil.isEmpty(status)) {
|
result.put("message", "查询成功!");
|
||||||
|
result.put("data", null);
|
||||||
|
log.info("getDeviceStatus - 返回参数 {}", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
JSONArray jsonArray = param.getJSONArray(0);
|
||||||
|
List<String> list = JSONArray.parseArray(jsonArray.toString(), String.class);
|
||||||
|
if (ObjectUtil.isEmpty(list)) {
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
result.put("status", HttpStatus.OK.value());
|
||||||
|
result.put("message", "查询成功!");
|
||||||
|
result.put("data", null);
|
||||||
|
log.info("getDeviceStatus - 返回参数 {}", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
JSONArray res = new JSONArray();
|
||||||
|
for (String deviceCode : list) {
|
||||||
|
JSONObject status = new JSONObject();
|
||||||
|
status.put("device_code", deviceCode);
|
||||||
|
if (StrUtil.isBlank(deviceCode)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Device device = DeviceAppService.findDeviceByCode(deviceCode);
|
||||||
String device_code = status.getString("device_code");
|
|
||||||
if (StrUtil.isBlank(device_code)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
Device device = DeviceAppService.findDeviceByCode(device_code);
|
|
||||||
if (ObjectUtil.isEmpty(device)) {
|
if (ObjectUtil.isEmpty(device)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (device.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) {
|
||||||
|
LnshPalletizingManipulatorSiteDeviceDriver driver = (LnshPalletizingManipulatorSiteDeviceDriver) device.getDeviceDriver();
|
||||||
|
status.put("mode", driver.getMode());
|
||||||
|
status.put("error", driver.getError());
|
||||||
|
status.put("move", driver.getMove());
|
||||||
|
status.put("encoder_qty", driver.getEncoder_qty());
|
||||||
|
status.put("barcode", driver.getBarcode());
|
||||||
|
}
|
||||||
if (device.getDeviceDriver() instanceof LnshMixingMillDeviceDriver) {
|
if (device.getDeviceDriver() instanceof LnshMixingMillDeviceDriver) {
|
||||||
LnshMixingMillDeviceDriver driver = (LnshMixingMillDeviceDriver) device.getDeviceDriver();
|
LnshMixingMillDeviceDriver driver = (LnshMixingMillDeviceDriver) device.getDeviceDriver();
|
||||||
|
|
||||||
status.put("device_status", driver.getStatus());
|
status.put("device_status", driver.getStatus());
|
||||||
status.put("error", driver.getError());
|
status.put("error", driver.getError());
|
||||||
status.put("open_time", driver.getOpen_time());
|
status.put("open_time", driver.getOpen_time());
|
||||||
@@ -1272,9 +1291,9 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
status.put("error_time", driver.getError_time() / 3600);
|
status.put("error_time", driver.getError_time() / 3600);
|
||||||
status.put("real_qty", driver.getWeight());
|
status.put("real_qty", driver.getWeight());
|
||||||
status.put("mix_num", driver.getMix_num());
|
status.put("mix_num", driver.getMix_num());
|
||||||
} else if (device.getDeviceDriver() instanceof LnshPressDeviceDriver) {
|
}
|
||||||
|
if (device.getDeviceDriver() instanceof LnshPressDeviceDriver) {
|
||||||
LnshPressDeviceDriver driver = (LnshPressDeviceDriver) device.getDeviceDriver();
|
LnshPressDeviceDriver driver = (LnshPressDeviceDriver) device.getDeviceDriver();
|
||||||
|
|
||||||
status.put("device_status", driver.getStatus());
|
status.put("device_status", driver.getStatus());
|
||||||
status.put("error", driver.getError());
|
status.put("error", driver.getError());
|
||||||
status.put("open_time", driver.getOpen_time());
|
status.put("open_time", driver.getOpen_time());
|
||||||
@@ -1283,9 +1302,9 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
status.put("error_time", driver.getError_time() / 3600);
|
status.put("error_time", driver.getError_time() / 3600);
|
||||||
status.put("real_qty", driver.getQty());
|
status.put("real_qty", driver.getQty());
|
||||||
status.put("current_weight", driver.getWeight());
|
status.put("current_weight", driver.getWeight());
|
||||||
} else if (device.getDeviceDriver() instanceof LnshPackagePalletManipulatorDeviceDriver) {
|
}
|
||||||
|
if (device.getDeviceDriver() instanceof LnshPackagePalletManipulatorDeviceDriver) {
|
||||||
LnshPackagePalletManipulatorDeviceDriver driver = (LnshPackagePalletManipulatorDeviceDriver) device.getDeviceDriver();
|
LnshPackagePalletManipulatorDeviceDriver driver = (LnshPackagePalletManipulatorDeviceDriver) device.getDeviceDriver();
|
||||||
|
|
||||||
status.put("device_status", driver.getStatus());
|
status.put("device_status", driver.getStatus());
|
||||||
status.put("error", driver.getError());
|
status.put("error", driver.getError());
|
||||||
status.put("open_time", driver.getOpen_time());
|
status.put("open_time", driver.getOpen_time());
|
||||||
@@ -1293,63 +1312,63 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
status.put("work_time", driver.getProduction_time() / 3600);
|
status.put("work_time", driver.getProduction_time() / 3600);
|
||||||
status.put("error_time", driver.getError_time() / 3600);
|
status.put("error_time", driver.getError_time() / 3600);
|
||||||
status.put("real_qty", driver.getQty());
|
status.put("real_qty", driver.getQty());
|
||||||
} else if (device.getDeviceDriver() instanceof LnshPalletizingManipulatorDeviceDriver) {
|
}
|
||||||
|
if (device.getDeviceDriver() instanceof LnshPalletizingManipulatorDeviceDriver) {
|
||||||
LnshPalletizingManipulatorDeviceDriver driver = (LnshPalletizingManipulatorDeviceDriver) device.getDeviceDriver();
|
LnshPalletizingManipulatorDeviceDriver driver = (LnshPalletizingManipulatorDeviceDriver) device.getDeviceDriver();
|
||||||
|
|
||||||
status.put("device_status", driver.getStatus());
|
status.put("device_status", driver.getStatus());
|
||||||
status.put("error", driver.getError());
|
status.put("error", driver.getError());
|
||||||
status.put("open_time", driver.getOpen_time());
|
status.put("open_time", driver.getOpen_time());
|
||||||
status.put("stand_time", driver.getStandby_time() / 3600);
|
status.put("stand_time", driver.getStandby_time() / 3600);
|
||||||
status.put("work_time", driver.getProduction_time() / 3600);
|
status.put("work_time", driver.getProduction_time() / 3600);
|
||||||
status.put("error_time", driver.getError_time() / 3600);
|
status.put("error_time", driver.getError_time() / 3600);
|
||||||
} else if (device.getDeviceDriver() instanceof LnshKilnTrussDeviceDriver) {
|
}
|
||||||
|
if (device.getDeviceDriver() instanceof LnshKilnTrussDeviceDriver) {
|
||||||
LnshKilnTrussDeviceDriver driver = (LnshKilnTrussDeviceDriver) device.getDeviceDriver();
|
LnshKilnTrussDeviceDriver driver = (LnshKilnTrussDeviceDriver) device.getDeviceDriver();
|
||||||
|
|
||||||
status.put("device_status", driver.getStatus());
|
status.put("device_status", driver.getStatus());
|
||||||
status.put("error", driver.getError());
|
status.put("error", driver.getError());
|
||||||
status.put("open_time", driver.getOpen_time());
|
status.put("open_time", driver.getOpen_time());
|
||||||
status.put("stand_time", driver.getStandby_time() / 3600);
|
status.put("stand_time", driver.getStandby_time() / 3600);
|
||||||
status.put("work_time", driver.getProduction_time() / 3600);
|
status.put("work_time", driver.getProduction_time() / 3600);
|
||||||
status.put("error_time", driver.getError_time() / 3600);
|
status.put("error_time", driver.getError_time() / 3600);
|
||||||
} else if (device.getDeviceDriver() instanceof LnshKilnLaneDeviceDriver) {
|
}
|
||||||
|
if (device.getDeviceDriver() instanceof LnshKilnLaneDeviceDriver) {
|
||||||
LnshKilnLaneDeviceDriver driver = (LnshKilnLaneDeviceDriver) device.getDeviceDriver();
|
LnshKilnLaneDeviceDriver driver = (LnshKilnLaneDeviceDriver) device.getDeviceDriver();
|
||||||
|
|
||||||
status.put("device_status", driver.getStatus());
|
status.put("device_status", driver.getStatus());
|
||||||
status.put("error", driver.getError());
|
status.put("error", driver.getError());
|
||||||
status.put("open_time", driver.getOpen_time());
|
status.put("open_time", driver.getOpen_time());
|
||||||
status.put("stand_time", driver.getStandby_time() / 3600);
|
status.put("stand_time", driver.getStandby_time() / 3600);
|
||||||
status.put("work_time", driver.getProduction_time() / 3600);
|
status.put("work_time", driver.getProduction_time() / 3600);
|
||||||
status.put("error_time", driver.getError_time() / 3600);
|
status.put("error_time", driver.getError_time() / 3600);
|
||||||
} else if (device.getDeviceDriver() instanceof LnshOutKilnTrussDeviceDriver) {
|
}
|
||||||
|
if (device.getDeviceDriver() instanceof LnshOutKilnTrussDeviceDriver) {
|
||||||
LnshOutKilnTrussDeviceDriver driver = (LnshOutKilnTrussDeviceDriver) device.getDeviceDriver();
|
LnshOutKilnTrussDeviceDriver driver = (LnshOutKilnTrussDeviceDriver) device.getDeviceDriver();
|
||||||
|
|
||||||
status.put("device_status", driver.getStatus());
|
status.put("device_status", driver.getStatus());
|
||||||
status.put("error", driver.getError());
|
status.put("error", driver.getError());
|
||||||
status.put("open_time", driver.getOpen_time());
|
status.put("open_time", driver.getOpen_time());
|
||||||
status.put("stand_time", driver.getStandby_time() / 3600);
|
status.put("stand_time", driver.getStandby_time() / 3600);
|
||||||
status.put("work_time", driver.getProduction_time() / 3600);
|
status.put("work_time", driver.getProduction_time() / 3600);
|
||||||
status.put("error_time", driver.getError_time() / 3600);
|
status.put("error_time", driver.getError_time() / 3600);
|
||||||
} else if (device.getDeviceDriver() instanceof LnshRGVDeviceDriver) {
|
}
|
||||||
|
if (device.getDeviceDriver() instanceof LnshRGVDeviceDriver) {
|
||||||
LnshRGVDeviceDriver driver = (LnshRGVDeviceDriver) device.getDeviceDriver();
|
LnshRGVDeviceDriver driver = (LnshRGVDeviceDriver) device.getDeviceDriver();
|
||||||
|
|
||||||
status.put("device_status", driver.getStatus());
|
status.put("device_status", driver.getStatus());
|
||||||
status.put("error", driver.getError());
|
status.put("error", driver.getError());
|
||||||
status.put("open_time", driver.getOpen_time());
|
status.put("open_time", driver.getOpen_time());
|
||||||
status.put("stand_time", driver.getStandby_time() / 3600);
|
status.put("stand_time", driver.getStandby_time() / 3600);
|
||||||
status.put("work_time", driver.getProduction_time() / 3600);
|
status.put("work_time", driver.getProduction_time() / 3600);
|
||||||
status.put("error_time", driver.getError_time() / 3600);
|
status.put("error_time", driver.getError_time() / 3600);
|
||||||
} else if (device.getDeviceDriver() instanceof LnshPackageLineDeviceDriver) {
|
}
|
||||||
|
if (device.getDeviceDriver() instanceof LnshPackageLineDeviceDriver) {
|
||||||
LnshPackageLineDeviceDriver driver = (LnshPackageLineDeviceDriver) device.getDeviceDriver();
|
LnshPackageLineDeviceDriver driver = (LnshPackageLineDeviceDriver) device.getDeviceDriver();
|
||||||
|
|
||||||
status.put("device_status", driver.getStatus());
|
status.put("device_status", driver.getStatus());
|
||||||
status.put("error", driver.getError());
|
status.put("error", driver.getError());
|
||||||
status.put("open_time", driver.getOpen_time());
|
status.put("open_time", driver.getOpen_time());
|
||||||
status.put("stand_time", driver.getStandby_time() / 3600);
|
status.put("stand_time", driver.getStandby_time() / 3600);
|
||||||
status.put("work_time", driver.getProduction_time() / 3600);
|
status.put("work_time", driver.getProduction_time() / 3600);
|
||||||
status.put("error_time", driver.getError_time() / 3600);
|
status.put("error_time", driver.getError_time() / 3600);
|
||||||
} else if (device.getDeviceDriver() instanceof LnshFoldDiscSiteDeviceDriver) {
|
}
|
||||||
|
if (device.getDeviceDriver() instanceof LnshFoldDiscSiteDeviceDriver) {
|
||||||
LnshFoldDiscSiteDeviceDriver driver = (LnshFoldDiscSiteDeviceDriver) device.getDeviceDriver();
|
LnshFoldDiscSiteDeviceDriver driver = (LnshFoldDiscSiteDeviceDriver) device.getDeviceDriver();
|
||||||
|
|
||||||
status.put("device_status", driver.getStatus());
|
status.put("device_status", driver.getStatus());
|
||||||
status.put("error", driver.getError());
|
status.put("error", driver.getError());
|
||||||
status.put("open_time", driver.getOpen_time());
|
status.put("open_time", driver.getOpen_time());
|
||||||
@@ -1357,13 +1376,12 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
status.put("work_time", driver.getProduction_time() / 3600);
|
status.put("work_time", driver.getProduction_time() / 3600);
|
||||||
status.put("error_time", driver.getError_time() / 3600);
|
status.put("error_time", driver.getError_time() / 3600);
|
||||||
}
|
}
|
||||||
|
res.add(status);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
result.put("status", HttpStatus.OK.value());
|
result.put("status", HttpStatus.OK.value());
|
||||||
result.put("message", "查询成功!");
|
result.put("message", "查询成功!");
|
||||||
result.put("data", param);
|
result.put("data", res);
|
||||||
log.info("getDeviceStatus - 返回参数 {}", result);
|
log.info("getDeviceStatus - 返回参数 {}", result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class CockPitController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private CockpitService cockpitService;
|
private CockpitService cockpitService;
|
||||||
|
|
||||||
@PostMapping("/press")
|
@GetMapping("/press")
|
||||||
@Log("压制看板")
|
@Log("压制看板")
|
||||||
@ApiOperation("压制看板")
|
@ApiOperation("压制看板")
|
||||||
public ResponseEntity<Object> pressedMonitor(){
|
public ResponseEntity<Object> pressedMonitor(){
|
||||||
@@ -46,15 +46,15 @@ public class CockPitController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/screenTableData")
|
@GetMapping("/screenTableData")
|
||||||
@Log("大屏")
|
@Log("大屏-两侧图表")
|
||||||
@ApiOperation("大屏")
|
@ApiOperation("大屏-两侧图表")
|
||||||
public ResponseEntity<Object> screenLeftData(){
|
public ResponseEntity<Object> screenLeftData(){
|
||||||
return new ResponseEntity<>(cockpitService.screenTableData(), HttpStatus.OK);
|
return new ResponseEntity<>(cockpitService.screenTableData(), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/deviceCondition")
|
@GetMapping("/deviceCondition")
|
||||||
@Log("设备运行情况")
|
@Log("大屏-中间设备运行情况")
|
||||||
@ApiOperation("设备运行情况")
|
@ApiOperation("大屏-中间设备运行情况")
|
||||||
public ResponseEntity<Object> deviceCondition(){
|
public ResponseEntity<Object> deviceCondition(){
|
||||||
return new ResponseEntity<>(cockpitService.deviceCondition(), HttpStatus.OK);
|
return new ResponseEntity<>(cockpitService.deviceCondition(), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
@@ -67,8 +67,8 @@ public class CockPitController {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
@GetMapping("/inOutKilnDetail")
|
@GetMapping("/inOutKilnDetail")
|
||||||
@Log("出、入窑输送线")
|
@Log("出、入窑输送线弹窗")
|
||||||
@ApiOperation("出、入窑输送线")
|
@ApiOperation("出、入窑输送线弹窗")
|
||||||
public ResponseEntity<Object> selectInOutKilnDetail(){
|
public ResponseEntity<Object> selectInOutKilnDetail(){
|
||||||
return new ResponseEntity<>(cockpitService.selectInOutKilnDetail(), HttpStatus.OK);
|
return new ResponseEntity<>(cockpitService.selectInOutKilnDetail(), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,14 +29,7 @@ public interface CockpitService {
|
|||||||
|
|
||||||
ConcurrentHashMap<String,Object> screenTableData();
|
ConcurrentHashMap<String,Object> screenTableData();
|
||||||
|
|
||||||
// List<DeviceErrorVo> getDeviceErrorList();
|
ConcurrentHashMap<String, Object> deviceCondition();
|
||||||
//
|
|
||||||
// IPage<DasDeviceErrorRecord> getDeviceErrorInfoList(PageQuery page);
|
|
||||||
//
|
|
||||||
// DeviceRunStatVo selectDeviceRunStatNum();
|
|
||||||
Object deviceCondition();
|
|
||||||
//
|
|
||||||
// MixingDetailVo selectMixingDetail(Map whereJson);
|
|
||||||
|
|
||||||
List<InOutKilnVo> selectInOutKilnDetail();
|
List<InOutKilnVo> selectInOutKilnDetail();
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package org.nl.wms.cockpit.service.dao;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Administrator
|
||||||
|
* 混碾机对接位
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MixingRelativeVo {
|
||||||
|
private String pointStatus;
|
||||||
|
private String pointName;
|
||||||
|
private String pointCode;
|
||||||
|
}
|
||||||
@@ -7,11 +7,7 @@ import lombok.Data;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class MixingVo {
|
public class MixingVo {
|
||||||
private String workorderCode;
|
private String materialName;
|
||||||
private String pointName;
|
private String planWeight;
|
||||||
private String customer;
|
private String realWeight;
|
||||||
private String material;
|
|
||||||
private String materialSpec;
|
|
||||||
private String planQty;
|
|
||||||
private String realQty;
|
|
||||||
}
|
}
|
||||||
@@ -2,15 +2,20 @@ package org.nl.wms.cockpit.service.dao;
|
|||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: lyd
|
* @author Administrator
|
||||||
* @Description: 当前班次、计划生产、已生产、不合格产品数
|
* 压制看板顶部Vo
|
||||||
* @Date: 2023/9/25
|
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class PressProductHeaderVo {
|
public class PressProductHeaderVo {
|
||||||
private String plan_qty;
|
private String planQty;
|
||||||
private String real_qty;
|
private String realQty;
|
||||||
private String unqualified_qty;
|
private String unqualifiedQty;
|
||||||
private String qualified_qty;
|
private String qualifiedQty;
|
||||||
|
private String team;
|
||||||
|
|
||||||
|
public String getaTeam() {
|
||||||
|
return "白班";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,11 +4,16 @@ import lombok.Data;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Administrator
|
* @author Administrator
|
||||||
|
* 当日成品图表Vo
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class PressProductVo {
|
public class PressProductVo {
|
||||||
|
//物料名称
|
||||||
private String materialName;
|
private String materialName;
|
||||||
|
//需生产
|
||||||
private String requiredNum;
|
private String requiredNum;
|
||||||
|
//已压制
|
||||||
private String suppressedNum;
|
private String suppressedNum;
|
||||||
|
//已完成
|
||||||
private String finishedNum;
|
private String finishedNum;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,4 +22,8 @@ public class ProductTaskVo {
|
|||||||
private String operator;
|
private String operator;
|
||||||
private String realproducestartDate;
|
private String realproducestartDate;
|
||||||
private String realproduceendDate;
|
private String realproduceendDate;
|
||||||
|
|
||||||
|
public String getTeam() {
|
||||||
|
return "白班";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ public class SortingLineVo {
|
|||||||
private String workorderCode;
|
private String workorderCode;
|
||||||
private String pointName;
|
private String pointName;
|
||||||
private String customer;
|
private String customer;
|
||||||
private String material;
|
private String materialName;
|
||||||
private String materialSpec;
|
private String materialSpec;
|
||||||
private String planQty;
|
private String planQty;
|
||||||
private String realQty;
|
private String realQty;
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package org.nl.wms.cockpit.service.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum ColorEnum {
|
||||||
|
GREY(0, "灰色"),
|
||||||
|
GREEN(2, "绿色"),
|
||||||
|
RED(3, "红色"),
|
||||||
|
YELLOW(1, "黄色");
|
||||||
|
|
||||||
|
private final Integer index;
|
||||||
|
private final String colorName;
|
||||||
|
|
||||||
|
public static ColorEnum getColorEnumByIndex(int index) {
|
||||||
|
ColorEnum[] enums = ColorEnum.values();
|
||||||
|
for (ColorEnum colorEnum : enums) {
|
||||||
|
if (colorEnum.getIndex() == index) {
|
||||||
|
return colorEnum;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null; // 如果没有找到对应的枚举常量,可以根据需要返回null或者抛出异常
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,6 +7,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.nl.config.thread.ThreadPoolExecutorUtil;
|
import org.nl.config.thread.ThreadPoolExecutorUtil;
|
||||||
import org.nl.wms.cockpit.service.CockpitService;
|
import org.nl.wms.cockpit.service.CockpitService;
|
||||||
import org.nl.wms.cockpit.service.dao.*;
|
import org.nl.wms.cockpit.service.dao.*;
|
||||||
|
import org.nl.wms.cockpit.service.enums.ColorEnum;
|
||||||
import org.nl.wms.cockpit.service.enums.DeviceEnum;
|
import org.nl.wms.cockpit.service.enums.DeviceEnum;
|
||||||
import org.nl.wms.cockpit.service.mapper.CockPitMapper;
|
import org.nl.wms.cockpit.service.mapper.CockPitMapper;
|
||||||
import org.nl.wms.das.device.record.service.IDasDeviceErrorRecordService;
|
import org.nl.wms.das.device.record.service.IDasDeviceErrorRecordService;
|
||||||
@@ -39,9 +40,6 @@ public class CockpitServiceImpl implements CockpitService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IDasDeviceErrorRecordService dasDeviceErrorRecordService;
|
private IDasDeviceErrorRecordService dasDeviceErrorRecordService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ISchBasePointService schBasePointService;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ConcurrentHashMap<String, Object> pressedMonitor() {
|
public ConcurrentHashMap<String, Object> pressedMonitor() {
|
||||||
ThreadPoolExecutor pool = ThreadPoolExecutorUtil.getPoll();
|
ThreadPoolExecutor pool = ThreadPoolExecutorUtil.getPoll();
|
||||||
@@ -66,7 +64,7 @@ public class CockpitServiceImpl implements CockpitService {
|
|||||||
map.put("ShiftProductionList", null);
|
map.put("ShiftProductionList", null);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
// 2、当日订单
|
// 3、当日订单
|
||||||
CompletableFuture<List<PressOrderVo>> pressOrderFuture = CompletableFuture.supplyAsync(
|
CompletableFuture<List<PressOrderVo>> pressOrderFuture = CompletableFuture.supplyAsync(
|
||||||
() -> cockPitMapper.getPressOrderVoList(), pool);
|
() -> cockPitMapper.getPressOrderVoList(), pool);
|
||||||
pressOrderFuture.thenAccept(result -> {
|
pressOrderFuture.thenAccept(result -> {
|
||||||
@@ -231,10 +229,10 @@ public class CockpitServiceImpl implements CockpitService {
|
|||||||
return res;
|
return res;
|
||||||
}, pool);
|
}, pool);
|
||||||
deviceRunStatCompletableFuture.thenAccept(result -> {
|
deviceRunStatCompletableFuture.thenAccept(result -> {
|
||||||
resultMap.put("deviceRunStatList", result);
|
resultMap.put("deviceRunStat", result);
|
||||||
}).exceptionally((e) -> {
|
}).exceptionally((e) -> {
|
||||||
log.error("设备运行统计: {}", e.getMessage(), e);
|
log.error("设备运行统计: {}", e.getMessage(), e);
|
||||||
resultMap.put("deviceRunStatList", null);
|
resultMap.put("deviceRunStat", null);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -277,47 +275,194 @@ public class CockpitServiceImpl implements CockpitService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object deviceCondition() {
|
public ConcurrentHashMap<String, Object> deviceCondition() {
|
||||||
List<DeviceConditionVo> res = new ArrayList<>();
|
ThreadPoolExecutor pool = ThreadPoolExecutorUtil.getPoll();
|
||||||
// 获取所有设备
|
ConcurrentHashMap<String, Object> map = new ConcurrentHashMap<>();
|
||||||
List<String> allDevice = cockPitMapper.selectAllDevice();
|
|
||||||
if (allDevice.isEmpty()) {
|
//压制码垛位情况显示
|
||||||
return null;
|
CompletableFuture<JSONArray> stackingPositionTask = CompletableFuture.supplyAsync(() -> {
|
||||||
|
List<String> points = cockPitMapper.selectYzPoint();
|
||||||
|
if (points.isEmpty()) {
|
||||||
|
throw new RuntimeException("压制码垛位点位为空");
|
||||||
}
|
}
|
||||||
JSONArray param = new JSONArray(Collections.singletonList(allDevice));
|
JSONArray param = new JSONArray(Collections.singletonList(points));
|
||||||
AcsResponse devicesStatus = wmsToAcsService.getDeviceStatus(param);
|
AcsResponse deviceStatus = wmsToAcsService.getDeviceStatus(param);
|
||||||
JSONArray data = ObjectUtil.isNotEmpty(devicesStatus) ? devicesStatus.getData() : param;
|
JSONArray data = ObjectUtil.isNotEmpty(deviceStatus) ? deviceStatus.getData() : param;
|
||||||
// JSONObject devicesStatus = null;
|
|
||||||
// 初始化数据 数组下标:0关机 1待机 2生产中 3故障
|
|
||||||
JSONObject total = new JSONObject();
|
|
||||||
DeviceEnum[] values = DeviceEnum.values();
|
|
||||||
for (DeviceEnum deviceEnum : values) {
|
|
||||||
total.put(deviceEnum.getCode(), new int[4]);
|
|
||||||
}
|
|
||||||
// 遍历判断
|
|
||||||
for (int i = 0; i < data.size(); i++) {
|
for (int i = 0; i < data.size(); i++) {
|
||||||
JSONObject device = data.getJSONObject(i);
|
JSONObject jsonObject = data.getJSONObject(i);
|
||||||
Integer devicesStatus1 = ObjectUtil.isNotEmpty(device.getInteger("status"))
|
if (jsonObject.getInteger("move") != 0
|
||||||
? device.getInteger("status")
|
&& ObjectUtil.isNotEmpty(jsonObject.getInteger("encoder_qty"))
|
||||||
: 0;
|
&& jsonObject.getInteger("encoder_qty") > 0) {
|
||||||
String regionCode = device.getString("region_code");
|
// 绿色
|
||||||
DeviceEnum deviceEnumByCode = DeviceEnum.getDeviceEnumByCode(regionCode); // 获取属于哪种设备
|
jsonObject.put("color_status", ColorEnum.GREEN.getIndex());
|
||||||
int[] ints = (int[]) total.get(deviceEnumByCode.getCode());
|
} else if (jsonObject.getInteger("move") != 0
|
||||||
ints[devicesStatus1] = ints[devicesStatus1] + 1;
|
&& ObjectUtil.isNotEmpty(jsonObject.getInteger("encoder_qty"))
|
||||||
total.put(deviceEnumByCode.getCode(), ints);
|
&& jsonObject.getInteger("encoder_qty") == 0) {
|
||||||
|
// 黄色
|
||||||
|
jsonObject.put("color_status", ColorEnum.YELLOW.getIndex());
|
||||||
|
} else if (jsonObject.getInteger("move") == 0) {
|
||||||
|
// 红色
|
||||||
|
jsonObject.put("color_status", ColorEnum.RED.getIndex());
|
||||||
|
} else { // 有托盘人工
|
||||||
|
jsonObject.put("color_status", ColorEnum.GREEN.getIndex());
|
||||||
}
|
}
|
||||||
// 返回输出值
|
|
||||||
for (DeviceEnum value : values) { // 4个
|
|
||||||
int[] ints = (int[]) total.get(value.getCode());
|
|
||||||
DeviceConditionVo dto = new DeviceConditionVo();
|
|
||||||
dto.setDeviceName(value.getDevice_name()); // 列名
|
|
||||||
dto.setShutdown(ints[0]);
|
|
||||||
dto.setStandby(ints[1]);
|
|
||||||
dto.setRunning(ints[2]);
|
|
||||||
dto.setFailure(ints[3]);
|
|
||||||
res.add(dto);
|
|
||||||
}
|
}
|
||||||
return res;
|
return data;
|
||||||
|
}, pool);
|
||||||
|
stackingPositionTask.thenAccept(result -> {
|
||||||
|
map.put("StackingPositionList", result);
|
||||||
|
}).exceptionally((e) -> {
|
||||||
|
log.error("压制码垛位情况显示: {}", e.getMessage(), e);
|
||||||
|
map.put("StackingPositionList", e);
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 压机信息显示
|
||||||
|
CompletableFuture<JSONArray> pressMachineTask = CompletableFuture.supplyAsync(() -> {
|
||||||
|
List<String> yjPoints = cockPitMapper.selectYjPoint();
|
||||||
|
if (yjPoints.isEmpty()) {
|
||||||
|
throw new RuntimeException("压机点位为空");
|
||||||
|
}
|
||||||
|
JSONArray yjPointsParam = new JSONArray(Collections.singletonList(yjPoints));
|
||||||
|
AcsResponse yjStatus = wmsToAcsService.getDeviceStatus(yjPointsParam);
|
||||||
|
JSONArray yjData = ObjectUtil.isNotEmpty(yjStatus) ? yjStatus.getData() : yjPointsParam;
|
||||||
|
for (int i = 0; i < yjData.size(); i++) {
|
||||||
|
JSONObject object = yjData.getJSONObject(i);
|
||||||
|
String realQty = object.getString("real_qty");
|
||||||
|
if (ObjectUtil.isNotEmpty(realQty)) {
|
||||||
|
object.put("now_capacity", realQty);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return yjData;
|
||||||
|
}, pool);
|
||||||
|
pressMachineTask.thenAccept(result -> {
|
||||||
|
map.put("PressMachineList", result);
|
||||||
|
}).exceptionally((e) -> {
|
||||||
|
log.error("压机信息显示: {}", e.getMessage(), e);
|
||||||
|
map.put("PressMachineList", e.getMessage());
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
|
||||||
|
//混碾机信息显示
|
||||||
|
CompletableFuture<JSONArray> mixMachineTask = CompletableFuture.supplyAsync(() -> {
|
||||||
|
List<String> hnjPoints = cockPitMapper.selectHnjPoints();
|
||||||
|
if (hnjPoints.isEmpty()) {
|
||||||
|
throw new RuntimeException("设备点位为空");
|
||||||
|
}
|
||||||
|
JSONArray hnjPointsParam = new JSONArray(Collections.singletonList(hnjPoints));
|
||||||
|
AcsResponse hnjStatus = wmsToAcsService.getDeviceStatus(hnjPointsParam);
|
||||||
|
JSONArray hnjData = ObjectUtil.isNotEmpty(hnjStatus) ? hnjStatus.getData() : hnjPointsParam;
|
||||||
|
for (int i = 0; i < hnjData.size(); i++) {
|
||||||
|
JSONObject jsonObject = hnjData.getJSONObject(i);
|
||||||
|
String openTime = jsonObject.getString("open_time");
|
||||||
|
jsonObject.put("open_time", openTime.substring(openTime.indexOf('-') + 1));
|
||||||
|
}
|
||||||
|
return hnjData;
|
||||||
|
}, pool);
|
||||||
|
mixMachineTask.thenAccept(result -> {
|
||||||
|
map.put("MixMachineList", result);
|
||||||
|
}).exceptionally((e) -> {
|
||||||
|
log.error("混料机信息显示: {}", e.getMessage(), e);
|
||||||
|
map.put("MixMachineList", null);
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
// 困料货架的信息显示 TODO
|
||||||
|
CompletableFuture<JSONArray> trappedMaterialShelfTask = CompletableFuture.supplyAsync(() -> {
|
||||||
|
// return cockPitMapper.selectKlhwInfo();
|
||||||
|
return null;
|
||||||
|
}, pool);
|
||||||
|
trappedMaterialShelfTask.thenAccept(result -> {
|
||||||
|
map.put("TrappedMaterialShelfList", result);
|
||||||
|
}).exceptionally((e) -> {
|
||||||
|
log.error("困料货架 - 40 货位的信息显示: {}", e.getMessage(), e);
|
||||||
|
map.put("TrappedMaterialShelfList", null);
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
// 混碾机对接位
|
||||||
|
CompletableFuture<List<MixingRelativeVo>> mixBlankingTask = CompletableFuture.supplyAsync(() -> {
|
||||||
|
return cockPitMapper.selectMixingRelativeInfo();
|
||||||
|
}, pool);
|
||||||
|
mixBlankingTask.thenAccept(result -> {
|
||||||
|
map.put("MixBlankingList", result);
|
||||||
|
}).exceptionally((e) -> {
|
||||||
|
log.error("混料机下料位显示: {}", e.getMessage(), e);
|
||||||
|
map.put("MixBlankingList", null);
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
//压制、分拣机械手
|
||||||
|
CompletableFuture<JSONArray> manipulatorInfoTask = CompletableFuture.supplyAsync(() -> {
|
||||||
|
List<String> jxsPoints = cockPitMapper.selectJxsPoints();
|
||||||
|
if (jxsPoints.isEmpty()) {
|
||||||
|
throw new RuntimeException("设备点位为空");
|
||||||
|
}
|
||||||
|
JSONArray jxsPointsParam = new JSONArray(Collections.singletonList(jxsPoints));
|
||||||
|
AcsResponse jxsStatus = wmsToAcsService.getDeviceStatus(jxsPointsParam);
|
||||||
|
JSONArray jxsData = ObjectUtil.isNotEmpty(jxsStatus) ? jxsStatus.getData() : jxsPointsParam;
|
||||||
|
for (int i = 0; i < jxsData.size(); i++) {
|
||||||
|
JSONObject object = jxsData.getJSONObject(i);
|
||||||
|
object.put("color_status", object.getInteger("device_status"));
|
||||||
|
}
|
||||||
|
return jxsData;
|
||||||
|
}, pool);
|
||||||
|
manipulatorInfoTask.thenAccept(result -> {
|
||||||
|
map.put("ManipulatorInfoList", result);
|
||||||
|
}).exceptionally((e) -> {
|
||||||
|
log.error("机械手: {}", e.getMessage(), e);
|
||||||
|
map.put("ManipulatorInfoList", null);
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
//分拣拆码垛对接位
|
||||||
|
CompletableFuture<JSONArray> sortAndPalletizingTask = CompletableFuture.supplyAsync(() -> {
|
||||||
|
List<String> fjcmdPoints = new ArrayList<>();
|
||||||
|
fjcmdPoints.add("FJ01CDW01");
|
||||||
|
fjcmdPoints.add("FJ01CDW02");
|
||||||
|
JSONArray fjcmdPointsParam = new JSONArray(Collections.singletonList(fjcmdPoints));
|
||||||
|
AcsResponse fjcmdStatus = wmsToAcsService.getDeviceStatus(fjcmdPointsParam);
|
||||||
|
JSONArray fjcmdData = ObjectUtil.isNotEmpty(fjcmdStatus) ? fjcmdStatus.getData() : fjcmdPointsParam;
|
||||||
|
for (int i = 0; i < fjcmdData.size(); i++) {
|
||||||
|
JSONObject jsonObject = fjcmdData.getJSONObject(i);
|
||||||
|
if (jsonObject.getInteger("move") != 0
|
||||||
|
&& ObjectUtil.isNotEmpty(jsonObject.getInteger("encoder_qty"))
|
||||||
|
&& jsonObject.getInteger("encoder_qty") > 0) {
|
||||||
|
// 绿色
|
||||||
|
jsonObject.put("color_status", ColorEnum.GREEN.getIndex());
|
||||||
|
} else if (jsonObject.getInteger("move") != 0
|
||||||
|
&& ObjectUtil.isNotEmpty(jsonObject.getInteger("encoder_qty"))
|
||||||
|
&& jsonObject.getInteger("encoder_qty") == 0) {
|
||||||
|
// 黄色
|
||||||
|
jsonObject.put("color_status", ColorEnum.YELLOW.getIndex());
|
||||||
|
} else if (jsonObject.getInteger("move") == 0) {
|
||||||
|
// 红色
|
||||||
|
jsonObject.put("color_status", ColorEnum.RED.getIndex());
|
||||||
|
} else { // 有托盘人工
|
||||||
|
jsonObject.put("color_status", ColorEnum.GREEN.getIndex());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fjcmdData;
|
||||||
|
}, pool);
|
||||||
|
sortAndPalletizingTask.thenAccept(result -> {
|
||||||
|
map.put("SortAndPalletizingList", result);
|
||||||
|
}).exceptionally((e) -> {
|
||||||
|
log.error("分拣拆码垛: {}", e.getMessage(), e);
|
||||||
|
map.put("SortAndPalletizingList", e);
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
CompletableFuture<Void> allQuery = CompletableFuture.allOf(
|
||||||
|
stackingPositionTask,
|
||||||
|
pressMachineTask,
|
||||||
|
trappedMaterialShelfTask,
|
||||||
|
mixMachineTask,
|
||||||
|
sortAndPalletizingTask,
|
||||||
|
manipulatorInfoTask,
|
||||||
|
mixBlankingTask
|
||||||
|
);
|
||||||
|
CompletableFuture<ConcurrentHashMap<String, Object>> future
|
||||||
|
= allQuery.thenApply((result) -> map).exceptionally((e) -> {
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
future.join();
|
||||||
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.nl.wms.cockpit.service.mapper;
|
package org.nl.wms.cockpit.service.mapper;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import org.nl.wms.cockpit.service.dao.*;
|
import org.nl.wms.cockpit.service.dao.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -39,4 +40,14 @@ public interface CockPitMapper {
|
|||||||
List<KilnMaterialInfo> selectKilnMaterialInfo();
|
List<KilnMaterialInfo> selectKilnMaterialInfo();
|
||||||
|
|
||||||
|
|
||||||
|
List<String> selectYzPoint();
|
||||||
|
|
||||||
|
List<String> selectYjPoint();
|
||||||
|
|
||||||
|
List<String> selectHnjPoints();
|
||||||
|
|
||||||
|
List<MixingRelativeVo> selectMixingRelativeInfo();
|
||||||
|
|
||||||
|
List<String> selectJxsPoints();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="org.nl.wms.cockpit.service.mapper.CockPitMapper">
|
<mapper namespace="org.nl.wms.cockpit.service.mapper.CockPitMapper">
|
||||||
<select id="getPressProductHeaderList" resultType="org.nl.wms.cockpit.service.dao.PressProductHeaderVo">
|
<select id="getPressProductHeaderList" resultType="org.nl.wms.cockpit.service.dao.PressProductHeaderVo">
|
||||||
SELECT SUM(w.plan_qty) AS plan_qty,
|
SELECT SUM(w.plan_qty) AS planQty,
|
||||||
SUM(w.real_qty) AS real_qty,
|
SUM(w.real_qty) AS realQty,
|
||||||
SUM(w.qualified_qty) AS qualified_qty,
|
SUM(w.qualified_qty) AS qualifiedQty,
|
||||||
SUM(w.unqualified_qty) AS unqualified_qty
|
SUM(w.unqualified_qty) AS unqualifiedQty
|
||||||
FROM pdm_bd_workorder w
|
FROM pdm_bd_workorder w
|
||||||
WHERE
|
WHERE w.region_code = 'YZ'
|
||||||
DATE ( w.produce_date ) = CURDATE()
|
AND DATE ( w.produce_date ) = CURDATE()
|
||||||
</select>
|
</select>
|
||||||
<select id="getShiftProductionList" resultType="org.nl.wms.cockpit.service.dao.ShiftProductionVo">
|
<select id="getShiftProductionList" resultType="org.nl.wms.cockpit.service.dao.ShiftProductionVo">
|
||||||
SELECT w.point_name AS columnName,
|
SELECT w.point_name AS columnName,
|
||||||
@@ -16,10 +16,12 @@
|
|||||||
SUM(w.unqualified_qty) AS unqualifiedQty,
|
SUM(w.unqualified_qty) AS unqualifiedQty,
|
||||||
SUM(w.plan_qty - w.qualified_qty - w.unqualified_qty) AS lastQty
|
SUM(w.plan_qty - w.qualified_qty - w.unqualified_qty) AS lastQty
|
||||||
FROM `pdm_bd_workorder` w
|
FROM `pdm_bd_workorder` w
|
||||||
WHERE
|
WHERE w.region_code = 'YZ'
|
||||||
DATE ( w.produce_date ) = CURDATE()
|
AND DATE ( w.produce_date ) = CURDATE()
|
||||||
GROUP BY w.point_name
|
GROUP BY
|
||||||
order by w.point_name
|
w.point_name
|
||||||
|
ORDER BY
|
||||||
|
w.point_name
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getPressOrderVoList" resultType="org.nl.wms.cockpit.service.dao.PressOrderVo">
|
<select id="getPressOrderVoList" resultType="org.nl.wms.cockpit.service.dao.PressOrderVo">
|
||||||
@@ -33,8 +35,8 @@
|
|||||||
m.order_number as orderNumber
|
m.order_number as orderNumber
|
||||||
FROM pdm_bd_workorder w
|
FROM pdm_bd_workorder w
|
||||||
LEFT JOIN md_base_material m ON m.material_id = w.material_id
|
LEFT JOIN md_base_material m ON m.material_id = w.material_id
|
||||||
WHERE
|
WHERE w.region_code = 'YZ'
|
||||||
DATE ( w.produce_date ) = CURDATE()
|
AND DATE ( w.produce_date ) = CURDATE()
|
||||||
GROUP BY
|
GROUP BY
|
||||||
m.order_number
|
m.order_number
|
||||||
</select>
|
</select>
|
||||||
@@ -66,35 +68,38 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getSortingLine" resultType="org.nl.wms.cockpit.service.dao.SortingLineVo">
|
<select id="getSortingLine" resultType="org.nl.wms.cockpit.service.dao.SortingLineVo">
|
||||||
SELECT w.workorder_code as workorderCode,
|
SELECT
|
||||||
w.point_name as pointName,
|
w.workorder_code AS workorderCode,
|
||||||
w.plan_qty as planQty,
|
w.point_name AS pointName,
|
||||||
w.real_qty as realQty,
|
w.plan_qty AS planQty,
|
||||||
w.customer,
|
w.real_qty AS realQty,
|
||||||
m.material_name as materialName,
|
c.cust_name AS customer,
|
||||||
m.material_spec as materialSpec
|
m.material_name AS materialName,
|
||||||
FROM pdm_bd_workorder w
|
m.material_spec AS materialSpec
|
||||||
|
FROM
|
||||||
|
pdm_bd_workorder w
|
||||||
LEFT JOIN md_base_material m ON m.material_id = w.material_id
|
LEFT JOIN md_base_material m ON m.material_id = w.material_id
|
||||||
WHERE w.region_code = 'FJ'
|
LEFT JOIN md_cs_customerbase c ON w.customer = c.cust_id
|
||||||
and w.workorder_status = '3'
|
WHERE
|
||||||
order by w.create_time
|
w.region_code in ('FJ','RGFJ')
|
||||||
|
AND w.workorder_status = '3'
|
||||||
|
ORDER BY
|
||||||
|
w.create_time
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getUnstackingList" resultType="org.nl.wms.cockpit.service.dao.StackVo">
|
<select id="getUnstackingList" resultType="org.nl.wms.cockpit.service.dao.StackVo">
|
||||||
SELECT
|
SELECT t.create_time AS createTime,
|
||||||
t.create_time AS createTime,
|
|
||||||
t.vehicle_code AS vehicleCode,
|
t.vehicle_code AS vehicleCode,
|
||||||
m.material_name AS materialName,
|
m.material_name AS materialName,
|
||||||
g.material_qty AS materialQty,
|
g.material_qty AS materialQty,
|
||||||
g.material_weight AS materialWeight
|
g.material_weight AS materialWeight
|
||||||
FROM
|
FROM `sch_base_task` t
|
||||||
`sch_base_task` t
|
|
||||||
LEFT JOIN sch_base_vehiclematerialgroup g ON t.group_id = g.group_id
|
LEFT JOIN sch_base_vehiclematerialgroup g ON t.group_id = g.group_id
|
||||||
LEFT JOIN md_base_material m ON g.material_id = m.material_id
|
LEFT JOIN md_base_material m ON g.material_id = m.material_id
|
||||||
WHERE
|
WHERE t.config_code = 'FJQLTask'
|
||||||
t.config_code ='FJQLTask'
|
|
||||||
AND t.task_status = '5'
|
AND t.task_status = '5'
|
||||||
order by create_time desc
|
AND DATE (t.create_time) = CURDATE()
|
||||||
|
order by t.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getLastWorkOrderList" resultType="org.nl.wms.cockpit.service.dao.WorkOrderVo">
|
<select id="getLastWorkOrderList" resultType="org.nl.wms.cockpit.service.dao.WorkOrderVo">
|
||||||
@@ -104,11 +109,12 @@
|
|||||||
w.plan_qty as planQty,
|
w.plan_qty as planQty,
|
||||||
w.plan_weight as planWeight,
|
w.plan_weight as planWeight,
|
||||||
w.produce_order as produceOrder,
|
w.produce_order as produceOrder,
|
||||||
w.customer,
|
c.cust_name as customer,
|
||||||
w.vehicle_type as vehicleType,
|
w.vehicle_type as vehicleType,
|
||||||
w.create_time as createTime
|
w.create_time as createTime
|
||||||
FROM pdm_bd_workorder w
|
FROM pdm_bd_workorder w
|
||||||
LEFT JOIN md_base_material m ON m.material_id = w.material_id
|
LEFT JOIN md_base_material m ON m.material_id = w.material_id
|
||||||
|
LEFT JOIN md_cs_customerbase c ON w.customer = c.cust_id
|
||||||
WHERE w.region_code = 'FJ'
|
WHERE w.region_code = 'FJ'
|
||||||
AND w.workorder_status <![CDATA[ <> ]]> '5'
|
AND w.workorder_status <![CDATA[ <> ]]> '5'
|
||||||
ORDER BY w.create_time
|
ORDER BY w.create_time
|
||||||
@@ -116,8 +122,8 @@
|
|||||||
|
|
||||||
<select id="getMixingList" resultType="org.nl.wms.cockpit.service.dao.MixingVo">
|
<select id="getMixingList" resultType="org.nl.wms.cockpit.service.dao.MixingVo">
|
||||||
SELECT m.material_name AS materialName,
|
SELECT m.material_name AS materialName,
|
||||||
SUM(w.plan_qty) AS planQty,
|
SUM(w.plan_weight) AS planWeight,
|
||||||
SUM(w.real_qty) AS realQty
|
SUM(w.real_weight) AS realWeight
|
||||||
FROM pdm_bd_workorder w
|
FROM pdm_bd_workorder w
|
||||||
LEFT JOIN md_base_material m ON m.material_id = w.material_id
|
LEFT JOIN md_base_material m ON m.material_id = w.material_id
|
||||||
WHERE w.region_code = 'HN'
|
WHERE w.region_code = 'HN'
|
||||||
@@ -129,33 +135,30 @@
|
|||||||
<select id="getPressWorkerOrder" resultType="org.nl.wms.cockpit.service.dao.PressProductVo">
|
<select id="getPressWorkerOrder" resultType="org.nl.wms.cockpit.service.dao.PressProductVo">
|
||||||
SELECT m.material_name as materialName,
|
SELECT m.material_name as materialName,
|
||||||
SUM(w.plan_qty) as requiredNum,
|
SUM(w.plan_qty) as requiredNum,
|
||||||
SUM(CASE WHEN w.workorder_status = '5' THEN w.plan_qty ELSE 0 END) AS finishedNum,
|
SUM(w.real_qty) as suppressedNum,
|
||||||
SUM(CASE
|
SUM(CASE WHEN w.workorder_status = '5' THEN w.real_qty ELSE 0 END) AS finishedNum
|
||||||
WHEN w.workorder_status = '3' or w.workorder_status = '4'
|
|
||||||
THEN w.plan_qty
|
|
||||||
ELSE 0 END) AS suppressedNum
|
|
||||||
FROM pdm_bd_workorder w
|
FROM pdm_bd_workorder w
|
||||||
LEFT JOIN md_base_material m ON w.material_id = m.material_id
|
LEFT JOIN md_base_material m ON w.material_id = m.material_id
|
||||||
WHERE w.region_code = 'YZ'
|
WHERE w.region_code = 'YZ'
|
||||||
AND w.workorder_status IN ('2', '3', '4', '5')
|
|
||||||
AND w.produce_date = DATE_FORMAT(CURRENT_DATE (), '%Y%m%d')
|
AND w.produce_date = DATE_FORMAT(CURRENT_DATE (), '%Y%m%d')
|
||||||
group by m.material_name
|
group by m.material_name
|
||||||
order by m.material_name
|
order by m.material_name
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getHistoryList" resultType="org.nl.wms.cockpit.service.dao.HistoryVo">
|
<select id="getHistoryList" resultType="org.nl.wms.cockpit.service.dao.HistoryVo">
|
||||||
SELECT DATE_FORMAT(produce_date, '%m-%d') as produceDate,
|
SELECT
|
||||||
SUM(CASE WHEN workorder_status = '5' THEN plan_qty ELSE 0 END) AS finishedNum,
|
DATE_FORMAT( produce_date, '%m-%d' ) AS produceDate,
|
||||||
SUM(CASE
|
SUM( CASE WHEN workorder_status = '5' THEN real_qty ELSE 0 END ) AS finishedNum,
|
||||||
WHEN workorder_status = '3' or workorder_status = '4'
|
SUM( qualified_qty ) AS suppressedNum
|
||||||
THEN plan_qty
|
FROM
|
||||||
ELSE 0 END) AS suppressedNum
|
pdm_bd_workorder
|
||||||
FROM pdm_bd_workorder
|
WHERE
|
||||||
WHERE region_code = 'YZ'
|
region_code = 'YZ'
|
||||||
AND workorder_status IN ('2', '3', '4', '5')
|
|
||||||
AND produce_date >= CURDATE() - INTERVAL 7 DAY
|
AND produce_date >= CURDATE() - INTERVAL 7 DAY
|
||||||
group by produceDate
|
GROUP BY
|
||||||
order by produce_date desc
|
produceDate
|
||||||
|
ORDER BY
|
||||||
|
produceDate DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectAllDevice" resultType="java.lang.String">
|
<select id="selectAllDevice" resultType="java.lang.String">
|
||||||
@@ -218,4 +221,45 @@
|
|||||||
GROUP BY
|
GROUP BY
|
||||||
m.material_code, c.cust_name
|
m.material_code, c.cust_name
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectYzPoint" resultType="java.lang.String">
|
||||||
|
SELECT point_code AS device_code
|
||||||
|
FROM `sch_base_point`
|
||||||
|
WHERE point_type = '2'
|
||||||
|
and region_code = 'YZ'
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectYjPoint" resultType="java.lang.String">
|
||||||
|
SELECT point_code AS device_code
|
||||||
|
FROM `sch_base_point`
|
||||||
|
WHERE point_type = '1'
|
||||||
|
and region_code = 'YZ'
|
||||||
|
and LENGTH(point_code) = 4
|
||||||
|
</select>
|
||||||
|
<select id="selectHnjPoints" resultType="java.lang.String">
|
||||||
|
SELECT point_code AS device_code
|
||||||
|
FROM `sch_base_point`
|
||||||
|
WHERE point_type = '1'
|
||||||
|
and region_code = 'HN'
|
||||||
|
</select>
|
||||||
|
<select id="selectMixingRelativeInfo" resultType="org.nl.wms.cockpit.service.dao.MixingRelativeVo">
|
||||||
|
SELECT p.point_code as pointCode,
|
||||||
|
p.point_name as pointName,
|
||||||
|
p.point_status as pointStatus
|
||||||
|
FROM `sch_base_point` p
|
||||||
|
WHERE p.region_code = 'HN'
|
||||||
|
AND P.point_type = '2'
|
||||||
|
ORDER BY p.point_code
|
||||||
|
</select>
|
||||||
|
<select id="selectJxsPoints" resultType="java.lang.String">
|
||||||
|
SELECT p.point_code as pointCode,
|
||||||
|
p.point_name as pointName,
|
||||||
|
p.point_status as pointStatus
|
||||||
|
FROM `sch_base_point` p
|
||||||
|
WHERE p.region_code in( 'YZ','FJ')
|
||||||
|
AND P.point_type = '1'
|
||||||
|
and LENGTH(point_code) <![CDATA[ > ]]> 4
|
||||||
|
ORDER BY p.point_code
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<select id="queryErrorVo" resultType="org.nl.wms.cockpit.service.dao.DeviceErrorVo">
|
<select id="queryErrorVo" resultType="org.nl.wms.cockpit.service.dao.DeviceErrorVo">
|
||||||
select p.point_name as deviceName,
|
select p.point_name as deviceName,
|
||||||
count(*) as errorNum
|
count(*) as errorNum
|
||||||
from das_device_check_record r
|
from das_device_error_record r
|
||||||
left join sch_base_point p on r.device_code = p.point_code
|
left join sch_base_point p on r.device_code = p.point_code
|
||||||
where STR_TO_DATE(r.record_time, '%Y-%m-%d') > NOW() - INTERVAL 30 DAY
|
where STR_TO_DATE(r.record_time, '%Y-%m-%d') > NOW() - INTERVAL 30 DAY
|
||||||
group by deviceName
|
group by deviceName
|
||||||
|
|||||||
Reference in New Issue
Block a user