Merge branch 'master' of http://121.40.234.130:8899/lyd/nd_hh
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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import java.util.Map;
|
|||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "看板接口")
|
@Api(tags = "大屏接口")
|
||||||
@RequestMapping("/api/cockpit")
|
@RequestMapping("/api/cockpit")
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
public class CockPitController {
|
public class CockPitController {
|
||||||
@@ -38,23 +38,23 @@ public class CockPitController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/sorting")
|
@PostMapping("/sorting")
|
||||||
@Log("分拣看板")
|
@Log("分拣看板")
|
||||||
@ApiOperation("分拣看板")
|
@ApiOperation("分拣看板")
|
||||||
public ResponseEntity<Object> sortingMonitor(){
|
public ResponseEntity<Object> sortingMonitor(){
|
||||||
return new ResponseEntity<>(cockpitService.sortingMonitor(), HttpStatus.OK);
|
return new ResponseEntity<>(cockpitService.sortingMonitor(), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/screenTableData")
|
@PostMapping("/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")
|
@PostMapping("/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);
|
||||||
}
|
}
|
||||||
@@ -66,13 +66,13 @@ public class CockPitController {
|
|||||||
// return new ResponseEntity<>(cockpitService.selectMixingDetail(whereJson), HttpStatus.OK);
|
// return new ResponseEntity<>(cockpitService.selectMixingDetail(whereJson), HttpStatus.OK);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@GetMapping("/inOutKilnDetail")
|
@PostMapping("/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);
|
||||||
}
|
}
|
||||||
@GetMapping("/kilnDetail")
|
@PostMapping("/kilnDetail")
|
||||||
@Log("窑弹出框")
|
@Log("窑弹出框")
|
||||||
@ApiOperation("窑弹出框")
|
@ApiOperation("窑弹出框")
|
||||||
public ResponseEntity<Object> selectKilnDetail(){
|
public ResponseEntity<Object> selectKilnDetail(){
|
||||||
|
|||||||
@@ -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,15 @@
|
|||||||
|
package org.nl.wms.cockpit.service.dao;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Administrator
|
||||||
|
* 设备报警信息
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ErrorRecordVo {
|
||||||
|
private String deviceCode;
|
||||||
|
private String deviceName;
|
||||||
|
private String errorInfo;
|
||||||
|
private String errorTime;
|
||||||
|
}
|
||||||
@@ -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 customer;
|
|
||||||
private String material;
|
|
||||||
private String materialSpec;
|
|
||||||
private String planQty;
|
private String planQty;
|
||||||
private String realQty;
|
private String realQty;
|
||||||
}
|
}
|
||||||
@@ -2,15 +2,21 @@ 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 getTeam() {
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ public class ProductTaskVo {
|
|||||||
private String workorderCode;
|
private String workorderCode;
|
||||||
private String team;
|
private String team;
|
||||||
private String materialName;
|
private String materialName;
|
||||||
|
private String customer;
|
||||||
private String planproducestartDate;
|
private String planproducestartDate;
|
||||||
private String planQty;
|
private String planQty;
|
||||||
private String realQty;
|
private String realQty;
|
||||||
@@ -22,4 +23,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();
|
||||||
@@ -50,10 +48,10 @@ public class CockpitServiceImpl implements CockpitService {
|
|||||||
CompletableFuture<List<PressProductHeaderVo>> listCompletableFuture = CompletableFuture.supplyAsync(
|
CompletableFuture<List<PressProductHeaderVo>> listCompletableFuture = CompletableFuture.supplyAsync(
|
||||||
() -> cockPitMapper.getPressProductHeaderList(), pool);
|
() -> cockPitMapper.getPressProductHeaderList(), pool);
|
||||||
listCompletableFuture.thenAccept(result -> {
|
listCompletableFuture.thenAccept(result -> {
|
||||||
map.put("DayShiftList", result);
|
map.put("DayShiftInfo", result);
|
||||||
}).exceptionally((e) -> {
|
}).exceptionally((e) -> {
|
||||||
log.error("获取当班信息: {}", e.getMessage(), e);
|
log.error("获取当班信息: {}", e.getMessage(), e);
|
||||||
map.put("DayShiftList", null);
|
map.put("DayShiftInfo", null);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
// 2、当班生产
|
// 2、当班生产
|
||||||
@@ -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;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -250,8 +248,8 @@ public class CockpitServiceImpl implements CockpitService {
|
|||||||
});
|
});
|
||||||
|
|
||||||
//设备报警信息
|
//设备报警信息
|
||||||
CompletableFuture<List<DasDeviceErrorRecord>> errorRecordCompletableFuture = CompletableFuture.supplyAsync(
|
CompletableFuture<List<ErrorRecordVo>> errorRecordCompletableFuture = CompletableFuture.supplyAsync(
|
||||||
() -> dasDeviceErrorRecordService.queryRecord(), pool);
|
() -> cockPitMapper.queryRecord(), pool);
|
||||||
errorRecordCompletableFuture.thenAccept(result -> {
|
errorRecordCompletableFuture.thenAccept(result -> {
|
||||||
resultMap.put("deviceErrorRecordList", result);
|
resultMap.put("deviceErrorRecordList", result);
|
||||||
}).exceptionally((e) -> {
|
}).exceptionally((e) -> {
|
||||||
@@ -277,47 +275,196 @@ 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()) {
|
//压制码垛位情况显示
|
||||||
|
CompletableFuture<JSONArray> stackingPositionTask = CompletableFuture.supplyAsync(() -> {
|
||||||
|
List<String> points = cockPitMapper.selectYzPoint();
|
||||||
|
if (points.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
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()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
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()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
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()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
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");
|
||||||
|
fjcmdPoints.add("FJ01MDW01");
|
||||||
|
fjcmdPoints.add("FJ01MDW02");
|
||||||
|
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
|
||||||
@@ -338,6 +485,12 @@ public class CockpitServiceImpl implements CockpitService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<InOutKilnVo> selectInOutKilnDetail() {
|
public List<InOutKilnVo> selectInOutKilnDetail() {
|
||||||
|
// List<String> points = new ArrayList<>();
|
||||||
|
// points.add("RYHCX01");
|
||||||
|
// points.add("CYHCX01");
|
||||||
|
// JSONArray pointsParam = new JSONArray(Collections.singletonList(points));
|
||||||
|
// AcsResponse response = wmsToAcsService.getDeviceStatus(pointsParam);
|
||||||
|
// JSONArray data = ObjectUtil.isNotEmpty(response) ? response.getData() : pointsParam;
|
||||||
//todo 确定每托盘数量
|
//todo 确定每托盘数量
|
||||||
List<InOutKilnVo> res = new ArrayList<>();
|
List<InOutKilnVo> res = new ArrayList<>();
|
||||||
InOutKilnVo in = cockPitMapper.selectInKilnInfo();
|
InOutKilnVo in = cockPitMapper.selectInKilnInfo();
|
||||||
|
|||||||
@@ -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,15 @@ public interface CockPitMapper {
|
|||||||
List<KilnMaterialInfo> selectKilnMaterialInfo();
|
List<KilnMaterialInfo> selectKilnMaterialInfo();
|
||||||
|
|
||||||
|
|
||||||
|
List<String> selectYzPoint();
|
||||||
|
|
||||||
|
List<String> selectYjPoint();
|
||||||
|
|
||||||
|
List<String> selectHnjPoints();
|
||||||
|
|
||||||
|
List<MixingRelativeVo> selectMixingRelativeInfo();
|
||||||
|
|
||||||
|
List<String> selectJxsPoints();
|
||||||
|
|
||||||
|
List<ErrorRecordVo> queryRecord();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -58,43 +60,44 @@
|
|||||||
END AS workorderStatus,
|
END AS workorderStatus,
|
||||||
w.operator,
|
w.operator,
|
||||||
IF(LENGTH(w.realproducestart_date) > 0, w.realproducestart_date, '-') AS realproducestartDate,
|
IF(LENGTH(w.realproducestart_date) > 0, w.realproducestart_date, '-') AS realproducestartDate,
|
||||||
IF(LENGTH(w.realproduceend_date) > 0, w.realproduceend_date, '-') AS realproduceendDate
|
IF(LENGTH(w.realproduceend_date) > 0, w.realproduceend_date, '-') AS realproduceendDate,
|
||||||
|
c.cust_name as customer
|
||||||
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 = 'YZ'
|
WHERE w.region_code = 'YZ'
|
||||||
ORDER BY w.team DESC, w.workorder_status
|
ORDER BY w.team DESC, w.workorder_status
|
||||||
</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.workorder_code AS workorderCode,
|
||||||
w.point_name as pointName,
|
w.point_name AS pointName,
|
||||||
w.plan_qty as planQty,
|
w.plan_qty AS planQty,
|
||||||
w.real_qty as realQty,
|
w.real_qty AS realQty,
|
||||||
w.customer,
|
c.cust_name AS customer,
|
||||||
m.material_name as materialName,
|
m.material_name AS materialName,
|
||||||
m.material_spec as materialSpec
|
m.material_spec AS materialSpec
|
||||||
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 = 'FJ'
|
LEFT JOIN md_cs_customerbase c ON w.customer = c.cust_id
|
||||||
and w.workorder_status = '3'
|
WHERE w.region_code in ('FJ', 'RGFJ')
|
||||||
order by w.create_time
|
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">
|
||||||
@@ -103,12 +106,16 @@
|
|||||||
m.material_spec as materialSpec,
|
m.material_spec as materialSpec,
|
||||||
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,
|
m.order_number as produceOrder,
|
||||||
w.customer,
|
c.cust_name as customer,
|
||||||
w.vehicle_type as vehicleType,
|
(SELECT label
|
||||||
|
FROM sys_dict s
|
||||||
|
WHERE CODE = 'vehicle_type'
|
||||||
|
AND s.`value` = 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
|
||||||
@@ -129,33 +136,27 @@
|
|||||||
<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 DATE_FORMAT(produce_date, '%m-%d') AS produceDate,
|
||||||
SUM(CASE WHEN workorder_status = '5' THEN plan_qty ELSE 0 END) AS finishedNum,
|
SUM(CASE WHEN workorder_status = '5' THEN real_qty ELSE 0 END) AS finishedNum,
|
||||||
SUM(CASE
|
SUM(qualified_qty) AS suppressedNum
|
||||||
WHEN workorder_status = '3' or workorder_status = '4'
|
|
||||||
THEN plan_qty
|
|
||||||
ELSE 0 END) AS suppressedNum
|
|
||||||
FROM pdm_bd_workorder
|
FROM pdm_bd_workorder
|
||||||
WHERE region_code = 'YZ'
|
WHERE 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">
|
||||||
@@ -203,19 +204,66 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectKilnMaterialInfo" resultType="org.nl.wms.cockpit.service.dao.KilnMaterialInfo">
|
<select id="selectKilnMaterialInfo" resultType="org.nl.wms.cockpit.service.dao.KilnMaterialInfo">
|
||||||
SELECT
|
SELECT sum(vg.material_qty) as producedNum,
|
||||||
sum(vg.material_qty) as producedNum,
|
m.material_code as materialCode,
|
||||||
m.material_code as producedNum,
|
|
||||||
c.cust_name as customer
|
c.cust_name as customer
|
||||||
FROM
|
FROM `sch_base_vehiclematerialgroup` vg
|
||||||
`sch_base_vehiclematerialgroup` vg
|
|
||||||
LEFT JOIN md_base_material m ON m.material_id = vg.material_id
|
LEFT JOIN md_base_material m ON m.material_id = vg.material_id
|
||||||
LEFT JOIN md_cs_customerbase c ON vg.customer = c.cust_id
|
LEFT JOIN md_cs_customerbase c ON vg.customer = c.cust_id
|
||||||
WHERE
|
WHERE vg.into_kiln_time IS NOT NULL
|
||||||
vg.into_kiln_time IS NOT NULL
|
|
||||||
AND vg.out_kiln_time IS NULL
|
AND vg.out_kiln_time IS NULL
|
||||||
and DATE ( vg.create_time ) = CURDATE()
|
and DATE ( vg.create_time ) = CURDATE()
|
||||||
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>
|
||||||
|
<select id="queryRecord" resultType="org.nl.wms.cockpit.service.dao.ErrorRecordVo">
|
||||||
|
SELECT r.device_code as deviceCode,
|
||||||
|
r.error as errorInfo,
|
||||||
|
r.record_time as errorTime,
|
||||||
|
p.point_name as deviceName
|
||||||
|
FROM `das_device_error_record` r
|
||||||
|
LEFT JOIN sch_base_point p ON r.device_code = p.point_code
|
||||||
|
ORDER BY r.record_time desc limit 100
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.wms.cockpit.service.dao.DeviceErrorVo;
|
import org.nl.wms.cockpit.service.dao.DeviceErrorVo;
|
||||||
|
import org.nl.wms.cockpit.service.dao.ErrorRecordVo;
|
||||||
import org.nl.wms.das.device.check.service.dao.DasDeviceCheckRecord;
|
import org.nl.wms.das.device.check.service.dao.DasDeviceCheckRecord;
|
||||||
import org.nl.wms.das.device.record.service.dao.DasDeviceErrorRecord;
|
import org.nl.wms.das.device.record.service.dao.DasDeviceErrorRecord;
|
||||||
import org.nl.wms.pda.service.dao.vo.PdaResponseVo;
|
import org.nl.wms.pda.service.dao.vo.PdaResponseVo;
|
||||||
@@ -29,5 +30,4 @@ public interface IDasDeviceErrorRecordService extends IService<DasDeviceErrorRec
|
|||||||
|
|
||||||
List<DeviceErrorVo> queryErrorVo();
|
List<DeviceErrorVo> queryErrorVo();
|
||||||
|
|
||||||
List<DasDeviceErrorRecord> queryRecord();
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -51,11 +51,4 @@ public class IDasDeviceErrorRecordServiceImpl extends ServiceImpl<DasDeviceError
|
|||||||
return dasDeviceCheckRecordMapper.queryErrorVo();
|
return dasDeviceCheckRecordMapper.queryErrorVo();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<DasDeviceErrorRecord> queryRecord() {
|
|
||||||
LambdaQueryWrapper<DasDeviceErrorRecord> lam = new LambdaQueryWrapper<>();
|
|
||||||
lam.orderByDesc(DasDeviceErrorRecord::getRecord_time);
|
|
||||||
lam.last("LIMIT 100");
|
|
||||||
return dasDeviceCheckRecordMapper.selectList(lam);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ spring:
|
|||||||
# password: ${DB_PWD:123456}
|
# password: ${DB_PWD:123456}
|
||||||
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:ndhh_lms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:ndhh_lms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||||
username: ${DB_USER:root}
|
username: ${DB_USER:root}
|
||||||
password: ${DB_PWD:12356}
|
password: ${DB_PWD:123456}
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
redis:
|
redis:
|
||||||
#数据库索引
|
#数据库索引
|
||||||
|
|||||||
Reference in New Issue
Block a user