diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/autotask/AutoCallMaterials.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/autotask/AutoCallMaterials.java index e9b947a..20b1a10 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/autotask/AutoCallMaterials.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/autotask/AutoCallMaterials.java @@ -12,9 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; -import java.math.BigDecimal; import java.util.List; -import java.util.function.Consumer; /** * @Author: lyd @@ -51,7 +49,8 @@ public class AutoCallMaterials { } try { // 记录数据 - requestMaterialRecordService.recordData(workorder); + PdmBdRequestMaterialRecord requestMaterialRecord = requestMaterialRecordService.recordData(workorder); + log.info("记录自动要料信息:{}", requestMaterialRecord); } catch (Exception e) { log.error("插入LMS数据库失败,{}", e.getMessage()); log.error("插入LMS数据库失败数据:{}", workorder); @@ -61,6 +60,7 @@ public class AutoCallMaterials { try { // 下发混碾 wmsToMmsService.addRequestMaterial(workorder); + log.info("自动下发混碾: {}", workorder); } catch (Exception e) { log.error("下发混碾失败,{}", e.getMessage()); log.error("下发混碾失败数据:{}", workorder); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/autotask/AutoIssueWorkOrder.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/autotask/AutoIssueWorkOrder.java index 6523e2a..a5df9d3 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/autotask/AutoIssueWorkOrder.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/autotask/AutoIssueWorkOrder.java @@ -38,112 +38,90 @@ public class AutoIssueWorkOrder { private WmsToAcsService wmsToAcsService; @Autowired private ISysNoticeService noticeService; - @Autowired - private RedissonClient redissonClient; @SneakyThrows public void run() { - RLock lock = redissonClient.getLock(this.getClass().getName()); - boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS); - try { - if (tryLock) { - // 获取每台设备的第一条工单 - List workorderList = workorderService.getNotIssueOrder(); - // 查找该设备未生产的工单去下发 - workorderList.forEach(s -> { - // 判断是否有工单 - List lists = workorderService.getTheDayProducedWorkOrderByDevice(s.getPoint_code()); - if (lists.size() > 0) { - return; - } - // 已生产就退出 - if (s.getWorkorder_status().equals(WorkOrderStatusEnum.PRODUCING.getCode()) - || s.getWorkorder_code().equals(WorkOrderStatusEnum.ISSUED.getCode())) { - return; - } - AcsWorkOrderVo acsWorkOrderVo = workorderService.toAcsWorkOrderById(s.getWorkorder_id()); - // 获取一个下发 - List list = new CopyOnWriteArrayList<>(); - list.add(acsWorkOrderVo); - AcsResponse resultForAcs; - try { - resultForAcs = wmsToAcsService.order(list); - log.info("自动下发工单:{}", list); - } catch (Exception e) { - log.error("工单下发异常:" + e.getMessage()); - // 通知 - noticeService.createNotice("工单下发失败: " + e.getMessage(), "工单下发失败: " - + acsWorkOrderVo.getWorkorder_code(), NoticeTypeEnum.EXCEPTION.getCode()); - return; - } - if (resultForAcs.getCode() != HttpStatus.HTTP_OK) { - // 不成功 - noticeService.createNotice(resultForAcs.getMessage(), "工单下发失败: " + acsWorkOrderVo.getWorkorder_code(), - NoticeTypeEnum.EXCEPTION.getCode()); - return; - } - // 修改工单数据 - PdmBdWorkorder pdmBdWorkorder = workorderService.getByCode(acsWorkOrderVo.getWorkorder_code()); - pdmBdWorkorder.setWorkorder_status(WorkOrderStatusEnum.ISSUED.getCode()); - TaskUtils.setWorkOrderUpdateByAcs(pdmBdWorkorder); - workorderService.updateById(pdmBdWorkorder); - }); + // 获取每台设备的第一条工单 + List workorderList = workorderService.getNotIssueOrder(); + // 查找该设备未生产的工单去下发 + workorderList.forEach(s -> { + // 判断是否有工单 + List lists = workorderService.getTheDayProducedWorkOrderByDevice(s.getPoint_code()); + if (lists.size() > 0) { + return; + } + // 已生产就退出 + if (s.getWorkorder_status().equals(WorkOrderStatusEnum.PRODUCING.getCode()) + || s.getWorkorder_code().equals(WorkOrderStatusEnum.ISSUED.getCode())) { + return; + } + AcsWorkOrderVo acsWorkOrderVo = workorderService.toAcsWorkOrderById(s.getWorkorder_id()); + // 获取一个下发 + List list = new ArrayList<>(); + list.add(acsWorkOrderVo); + AcsResponse resultForAcs; + try { + resultForAcs = wmsToAcsService.order(list); + log.info("自动下发工单:{}", list); + } catch (Exception e) { + log.error("工单下发异常:" + e.getMessage()); + // 通知 + noticeService.createNotice("工单下发失败: " + e.getMessage(), "工单下发失败: " + + acsWorkOrderVo.getWorkorder_code(), NoticeTypeEnum.EXCEPTION.getCode()); + return; } - } finally { - if (tryLock) { - lock.unlock(); + if (resultForAcs.getCode() != HttpStatus.HTTP_OK) { + // 不成功 + noticeService.createNotice(resultForAcs.getMessage(), "工单下发失败: " + acsWorkOrderVo.getWorkorder_code(), + NoticeTypeEnum.EXCEPTION.getCode()); + return; } - } + // 修改工单数据 + PdmBdWorkorder pdmBdWorkorder = workorderService.getByCode(acsWorkOrderVo.getWorkorder_code()); + pdmBdWorkorder.setWorkorder_status(WorkOrderStatusEnum.ISSUED.getCode()); + TaskUtils.setWorkOrderUpdateByAcs(pdmBdWorkorder); + workorderService.updateById(pdmBdWorkorder); + }); } @SneakyThrows public void run_backup() { - RLock lock = redissonClient.getLock(this.getClass().getName()); - boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS); - try { - if (tryLock) { - // todo: 获取每台设备的第一条工单 - // 获取所有设备号 - List deviceCodes = workorderService.getTheDayUnProducedDevice(); - // 查找该设备未生产的工单去下发 - deviceCodes.forEach(s -> { - // 判断是否有工单 - List lists = workorderService.getTheDayProducedWorkOrderByDevice(s); - if (lists.size() > 0) return; - List acsWorkOrderVoList = workorderService.getAcsWorkOrderVos(s); - if (acsWorkOrderVoList.size() == 0) return; - AcsWorkOrderVo acsWorkOrderVo = acsWorkOrderVoList.get(0); - // 获取一个下发 - List list = new CopyOnWriteArrayList<>(); - list.add(acsWorkOrderVo); - AcsResponse resultForAcs; - try { - resultForAcs = wmsToAcsService.order(list); - } catch (Exception e) { - log.error("工单下发异常:" + e.getMessage()); - // 通知 - noticeService.createNotice("工单下发失败: " + e.getMessage(), "工单下发失败: " - + acsWorkOrderVo.getWorkorder_code(), NoticeTypeEnum.EXCEPTION.getCode()); - return; - } - if (resultForAcs.getCode() != HttpStatus.HTTP_OK) { - // 不成功 - noticeService.createNotice(resultForAcs.getMessage(), "工单下发失败: " + acsWorkOrderVo.getWorkorder_code(), - NoticeTypeEnum.EXCEPTION.getCode()); - return; - } - // 修改工单数据 - PdmBdWorkorder pdmBdWorkorder = workorderService.getByCode(acsWorkOrderVo.getWorkorder_code()); - pdmBdWorkorder.setWorkorder_status(WorkOrderStatusEnum.ISSUED.getCode()); - TaskUtils.setWorkOrderUpdateByAcs(pdmBdWorkorder); - workorderService.updateById(pdmBdWorkorder); - }); + // todo: 获取每台设备的第一条工单 + // 获取所有设备号 + List deviceCodes = workorderService.getTheDayUnProducedDevice(); + // 查找该设备未生产的工单去下发 + deviceCodes.forEach(s -> { + // 判断是否有工单 + List lists = workorderService.getTheDayProducedWorkOrderByDevice(s); + if (lists.size() > 0) return; + List acsWorkOrderVoList = workorderService.getAcsWorkOrderVos(s); + if (acsWorkOrderVoList.size() == 0) return; + AcsWorkOrderVo acsWorkOrderVo = acsWorkOrderVoList.get(0); + // 获取一个下发 + List list = new CopyOnWriteArrayList<>(); + list.add(acsWorkOrderVo); + AcsResponse resultForAcs; + try { + resultForAcs = wmsToAcsService.order(list); + } catch (Exception e) { + log.error("工单下发异常:" + e.getMessage()); + // 通知 + noticeService.createNotice("工单下发失败: " + e.getMessage(), "工单下发失败: " + + acsWorkOrderVo.getWorkorder_code(), NoticeTypeEnum.EXCEPTION.getCode()); + return; } - } finally { - if (tryLock) { - lock.unlock(); + if (resultForAcs.getCode() != HttpStatus.HTTP_OK) { + // 不成功 + noticeService.createNotice(resultForAcs.getMessage(), "工单下发失败: " + acsWorkOrderVo.getWorkorder_code(), + NoticeTypeEnum.EXCEPTION.getCode()); + return; } - } + // 修改工单数据 + PdmBdWorkorder pdmBdWorkorder = workorderService.getByCode(acsWorkOrderVo.getWorkorder_code()); + pdmBdWorkorder.setWorkorder_status(WorkOrderStatusEnum.ISSUED.getCode()); + TaskUtils.setWorkOrderUpdateByAcs(pdmBdWorkorder); + workorderService.updateById(pdmBdWorkorder); + }); } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/AcsToWmsService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/AcsToWmsService.java index bfbaf37..d8c1b67 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/AcsToWmsService.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/AcsToWmsService.java @@ -57,5 +57,5 @@ public interface AcsToWmsService { /** 实时修改点位状态 */ BaseResponse realTimeSetPoint(JSONObject param); /** 布料记录 - 上传MES */ -// BaseResponse applyOneGrab(JSONObject param); + BaseResponse applyOneCloth(JSONObject param); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/acs/ApplyTaskResponse.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/acs/ApplyTaskResponse.java index eca6842..99997ea 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/acs/ApplyTaskResponse.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/acs/ApplyTaskResponse.java @@ -21,6 +21,7 @@ public class ApplyTaskResponse extends BaseResponse { private String label_message; // 特殊业务-无具体含义:目前是是否满足码满规定托盘数 private int is_satisfy; + private String mudBatch; public static ApplyTaskResponse responseOk(String requestNo) { ApplyTaskResponse response = new ApplyTaskResponse(); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/wms/ClothRequest.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/wms/ClothRequest.java new file mode 100644 index 0000000..78671ae --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/wms/ClothRequest.java @@ -0,0 +1,22 @@ +package org.nl.wms.ext.acs.service.dto.to.wms; + +import lombok.Data; +import org.nl.wms.ext.acs.service.dto.to.BaseRequest; + +@Data +public class ClothRequest extends BaseRequest { + /** + * 泥料批次 + */ + private String slip; + + /** + * 设定重量 + */ + private String set_weight; + + /** + * 称量重量 + */ + private String weight; +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java index 80c09c3..adfe420 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java @@ -25,6 +25,7 @@ import org.nl.wms.ext.acs.service.dto.to.wms.*; import org.nl.wms.ext.mes.service.WmsToMesService; import org.nl.wms.ext.mes.service.dto.CusterDo; import org.nl.wms.ext.mes.service.dto.MesMudConsumptionDto; +import org.nl.wms.ext.mes.service.dto.SpreaderDto; import org.nl.wms.ext.mms.service.WmsToMmsService; import org.nl.wms.ext.record.service.ISysInteractRecordService; import org.nl.wms.pdm.consumption.service.IPdmBdMudConsumptionService; @@ -314,7 +315,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { return ApplyTaskResponse.responseOk(requestNo, "任务创建成功", handling); } - // todo: 特殊处理 + // mark: 特殊处理 protected int specialHandling(String regionCode, JSONObject param) { int torus = 0; // 无业务:0,分拣剩余0托:1 if (regionCode.equals("FJ")) { // 判断是否够码满 @@ -362,7 +363,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } /** - * 任务:申请强制满托入缓存 todo: 暂时=分拣剩料回库 + * 任务:申请强制满托入缓存 mark: 暂时=分拣剩料回库 * * @param param: ApplyTaskRequest的json形式 * @return @@ -570,7 +571,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { workorderService.updateById(bdWorkorder); log.info("工单完成: {}", bdWorkorder); try { - // todo: 统计当前设备的不合格位置的数量作为不合格数,并上报给mes + // mark: 统计当前设备的不合格位置的数量作为不合格数,并上报给mes wmsToMesService.reportPressUnusedMaterial(bdWorkorder); } catch (Exception e) { log.info("调用mes异常:{}", e.getMessage()); @@ -613,7 +614,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { /** * 扫码成功申请 - 判断是否静置完成 - * todo: 需要返回泥料重量 + * mark: 需要返回泥料重量 */ @Override public ApplyTaskResponse isStandingFinish(ApplyTaskRequest baseRequest) { @@ -683,6 +684,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { taskResponse.setIs_standing_finish(GeneralDefinition.YES); taskResponse.setMessage("静置完成"); taskResponse.setWeight(one.getMaterial_weight().toString()); + taskResponse.setMudBatch(one.getPcsn()); // 泥料数据删除 List list = requestMaterialRecordService.list(new LambdaQueryWrapper() .eq(PdmBdRequestMaterialRecord::getDevice_code, productionTask.getPoint_code()) @@ -716,16 +718,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { throw new BadRequestException("载具编码不能为空"); } baseRequest.setVehicle_code(TaskUtils.defaultVehicleCode(baseRequest.getVehicle_code())); - if (ObjectUtil.isEmpty(baseRequest.getVehicle_type())) { - baseRequest.setVehicle_type(GeneralDefinition.STEEL_TRAY); - } + baseRequest.setVehicle_type(GeneralDefinition.STEEL_TRAY); SchBasePoint basePoint = pointService.getById(baseRequest.getDevice_code()); // 入窑记录时间 SchBaseVehiclematerialgroup groupInfo = vehiclematerialgroupService.getGroupInfo(baseRequest.getVehicle_code(), baseRequest.getVehicle_type(), GroupBindMaterialStatusEnum.BOUND.getValue()); - if (ObjectUtil.isNotEmpty(groupInfo.getInto_kiln_time())) { - // 如果已经记录就跳过 - return ApplyTaskResponse.responseOk(baseRequest.getRequestNo()); + if (ObjectUtil.isEmpty(groupInfo)) { + throw new BadRequestException("入窑失败:载具["+baseRequest.getVehicle_code()+"]组盘信息不存在!"); } groupInfo.setInto_kiln_time(DateUtil.now()); if (ObjectUtil.isNotEmpty(basePoint)) { @@ -772,7 +771,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { if (ObjectUtil.isEmpty(deviceProductionTask)) { throw new BadRequestException("压机" + deviceCode + "暂无生产的工单"); } - // todo: 2、通知混碾机生产泥料 - 直接存入混碾系统的数据库中 + // mark: 2、通知混碾机生产泥料 - 直接存入混碾系统的数据库中 try { wmsToMmsService.addRequestMaterial(deviceProductionTask); } catch (Exception e) { @@ -951,4 +950,31 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } return BaseResponse.responseOk(actionRequest.getRequestNo()); } + + @Override + public BaseResponse applyOneCloth(JSONObject param) { + // mark: 上传mes数据 + ClothRequest actionRequest = param.toJavaObject(ClothRequest.class); + // 获取工单 + PdmBdWorkorder productionTask = workorderService.getDeviceDockingProductionTask(actionRequest.getDevice_code()); + MdBaseMaterial mdBaseMaterial = materialService.getById(productionTask.getMaterial_id()); + SpreaderDto spreaderDto = new SpreaderDto(); + spreaderDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr()); + spreaderDto.setTIM(DateUtil.now()); + BigDecimal bigDecimalValue = new BigDecimal(ObjectUtil.isEmpty(actionRequest.getWeight()) + ? "0" : actionRequest.getWeight()); + spreaderDto.setACT_WEIGHT(bigDecimalValue); + BigDecimal bigDecimal = new BigDecimal(ObjectUtil.isEmpty(actionRequest.getSet_weight()) + ? "0" : actionRequest.getSet_weight()); + spreaderDto.setTHEO_WEIGHT(bigDecimal); + spreaderDto.setMATERIAL_ID(mdBaseMaterial.getMaterial_id()); + spreaderDto.setMATERIAL_NAME(mdBaseMaterial.getMaterial_name()); + spreaderDto.setMATERIAL_SPEC(mdBaseMaterial.getMaterial_spec()); + spreaderDto.setMATERIAL_MODEL(mdBaseMaterial.getMaterial_model()); + spreaderDto.setFPROBATCH(actionRequest.getSlip()); + spreaderDto.setCREATE_TM(DateUtil.now()); + spreaderDto.setOP_FLAG(GeneralDefinition.NO); + wmsToMesService.reportSpreaderInfoToMes(spreaderDto); + return BaseResponse.responseOk(actionRequest.getRequestNo()); + } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/autotask/AutoSynMaterialInfo.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/autotask/AutoSynMaterialInfo.java index 23db376..c39b48b 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/autotask/AutoSynMaterialInfo.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/autotask/AutoSynMaterialInfo.java @@ -3,14 +3,10 @@ package org.nl.wms.ext.mes.autotask; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.nl.wms.ext.mes.service.WmsToMesService; -import org.redisson.api.RLock; -import org.redisson.api.RedissonClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; -import java.util.concurrent.TimeUnit; - /** * @Author: lyd * @Description: 自动同步物料 @@ -22,20 +18,8 @@ import java.util.concurrent.TimeUnit; public class AutoSynMaterialInfo { @Autowired private WmsToMesService wmsToMesService; - @Autowired - private RedissonClient redissonClient; @SneakyThrows public void run() { - RLock lock = redissonClient.getLock(this.getClass().getName()); - boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS); - try { - if (tryLock) { - wmsToMesService.synchronizeMaterialInfo(); - } - } finally { - if (tryLock) { - lock.unlock(); - } - } + wmsToMesService.synchronizeMaterialInfo(); } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/autotask/AutoSynWorkOrderInfo.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/autotask/AutoSynWorkOrderInfo.java index 369acf6..d773ddb 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/autotask/AutoSynWorkOrderInfo.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/autotask/AutoSynWorkOrderInfo.java @@ -23,21 +23,8 @@ public class AutoSynWorkOrderInfo { @Autowired private WmsToMesService wmsToMesService; - @Autowired - private RedissonClient redissonClient; - @SneakyThrows public void run() { - RLock lock = redissonClient.getLock(this.getClass().getName()); - boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS); - try { - if (tryLock) { - wmsToMesService.synchronizeWorkOrderInfo(); - } - } finally { - if (tryLock) { - lock.unlock(); - } - } + wmsToMesService.synchronizeWorkOrderInfo(); } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/WmsToMesService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/WmsToMesService.java index 35aabbe..2a3f046 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/WmsToMesService.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/WmsToMesService.java @@ -134,4 +134,10 @@ public interface WmsToMesService { int getTotal(String materialId); CusterDo getCusterByName(String custerName); + + /** + * 上报布料机数据 + * @param spreaderDto + */ + void reportSpreaderInfoToMes(SpreaderDto spreaderDto); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.java index b1b1de3..1710513 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.java @@ -66,7 +66,6 @@ public interface MesRequestMapper { CusterDo getCusterByNo(String custerNo); @DS("oracle") List selectPageMesOrder(String materialId, int currentPage, int currentSize); - /** * 获取当前物料的订单总数 * @param materialId @@ -76,4 +75,6 @@ public interface MesRequestMapper { int getOrderTotalByMaterial(String materialId); @DS("oracle") CusterDo getCusterByName(String custerName); + @DS("oracle") + void reportSpreaderInfoToMes(SpreaderDto spreaderDto); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.xml b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.xml index 6db42cb..113926d 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.xml +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.xml @@ -90,6 +90,12 @@ , #{GROUP_BIND_MATERIAL_STATUS}, #{MOVE_WAY}, #{REMARK}, #{UPDATE_TIME}, #{OUT_KILN_TIME}, #{INTO_KILN_TIME} , #{CREATE_TM}, #{OP_FLAG}) + + INSERT INTO "LMSTELCOM"."RECEIVE_MUDLAYOUT_RECORD"(MSGID, TIM, ACT_WEIGHT, THEO_WEIGHT, MATERIAL_ID, MATERIAL_NAME + , MATERIAL_SPEC, MATERIAL_MODEL, FPROBATCH, CREATE_TM, OP_FLAG) + VALUES (#{MSGID}, #{TIM}, #{ACT_WEIGHT}, #{THEO_WEIGHT}, #{MATERIAL_ID}, #{MATERIAL_NAME}, #{MATERIAL_SPEC} + , #{MATERIAL_MODEL}, #{FPROBATCH}, #{CREATE_TM}, #{OP_FLAG}) + UPDATE "LMSTELCOM"."SEND_POP_SCHEDULE_PRESS" SET OP_FLAG = '1' diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/SpreaderDto.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/SpreaderDto.java new file mode 100644 index 0000000..a5eef1e --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/SpreaderDto.java @@ -0,0 +1,35 @@ +package org.nl.wms.ext.mes.service.dto; + +import lombok.Data; + +import java.math.BigDecimal; + +/** + * @Author: lyd + * @Description: 布料机信息DO + * @Date: 2023/11/16 + * 唯一ID + * 时间 + * 称量重量 + * 设定重量 + * 当前生产产品编码 + * 当前生产产品名称 + * 当前生产砖型 + * 当前生产型号 + * 配料批次号 + */ +@Data +public class SpreaderDto { + private String MSGID; + private String TIM; + private BigDecimal ACT_WEIGHT; + private BigDecimal THEO_WEIGHT; + private String MATERIAL_ID; + private String MATERIAL_NAME; + private String MATERIAL_SPEC; + private String MATERIAL_MODEL; + private String FPROBATCH; + private String CREATE_TM; + private String OP_FLAG; + private String OP_TM; +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/impl/WmsToMesServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/impl/WmsToMesServiceImpl.java index 1167188..561e67c 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/impl/WmsToMesServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/impl/WmsToMesServiceImpl.java @@ -64,7 +64,6 @@ public class WmsToMesServiceImpl implements WmsToMesService { } catch (Exception e) { log.error("上报mes消耗泥料记录的数据:{}", mudObject); log.error("上报mes消耗泥料记录失败:{}", e.getMessage()); - // todo:发送通知 noticeService.createNotice("上报mes消耗泥料数据失败", "消耗泥料数据" + mudObject.getPWORKSCHE_ID(), NoticeTypeEnum.EXCEPTION.getCode()); } @@ -198,7 +197,6 @@ public class WmsToMesServiceImpl implements WmsToMesService { log.error("半成品入库-获取MES给的工单数据:{}", mesWorkOrderDto); log.error("半成品入库返给MES的数据:{}", semiProductionInfoInDto); log.error("半成品入库插入mes数据库失败:{}", e.getMessage()); - // todo:发送通知 noticeService.createNotice("半成品入库插入mes数据库失败", "半成品入库" + semiProductionInfoInDto.getMSGID(), NoticeTypeEnum.EXCEPTION.getCode()); } @@ -242,7 +240,6 @@ public class WmsToMesServiceImpl implements WmsToMesService { log.error("半成品出库-获取MES给的工单数据:{}", mesWorkOrderDto); log.error("半成品出库返给MES的数据:{}", semiProductionInfoOutDto); log.error("半成品出库插入mes数据库失败:{}", e.getMessage()); - // todo:发送通知 noticeService.createNotice("半成品出库插入mes数据库失败", "半成品出库" + semiProductionInfoOutDto.getMSGID(), NoticeTypeEnum.EXCEPTION.getCode()); } @@ -284,7 +281,6 @@ public class WmsToMesServiceImpl implements WmsToMesService { log.error("入窑-获取MES给的工单数据:{}", mesWorkOrderDto); log.error("入窑返给MES的数据:{}", gdyMaterialInDto); log.error("入窑插入mes数据库失败:{}", e.getMessage()); - // todo:发送通知 noticeService.createNotice("入窑插入mes数据库失败", "入窑" + gdyMaterialInDto.getMSGID(), NoticeTypeEnum.EXCEPTION.getCode()); } @@ -326,7 +322,6 @@ public class WmsToMesServiceImpl implements WmsToMesService { log.error("出窑-获取MES给的工单数据:{}", mesWorkOrderDto); log.error("出窑返给MES的数据:{}", gdyMaterialOutDto); log.error("出窑插入mes数据库失败:{}", e.getMessage()); - // todo:发送通知 noticeService.createNotice("出窑插入mes数据库失败", "出窑" + gdyMaterialOutDto.getMSGID(), NoticeTypeEnum.EXCEPTION.getCode()); } @@ -380,7 +375,6 @@ public class WmsToMesServiceImpl implements WmsToMesService { log.error("统计到设备:{} 不合格砖数:{}", orderObj.getPoint_name(), number); log.error("插入mes机口判废数据库的数据:{}", mesUnusedDto); log.error("插入机口判废失败:{}", e.getMessage()); - // todo:发送通知 noticeService.createNotice("机口判废插入mes数据库失败", "机口判废" + mesUnusedDto.getMSGID(), NoticeTypeEnum.EXCEPTION.getCode()); } @@ -402,7 +396,6 @@ public class WmsToMesServiceImpl implements WmsToMesService { } catch (Exception e) { log.error("插入压机检测数据:{}", mesQSPressMonitorData); log.error("插入压机检测失败:{}", e.getMessage()); - // todo:发送通知 noticeService.createNotice("压机检测插入mes数据库失败", "压机检测" + mesQSPressMonitorData.getBRICK_ID(), NoticeTypeEnum.EXCEPTION.getCode()); } @@ -443,6 +436,11 @@ public class WmsToMesServiceImpl implements WmsToMesService { return mesRequestMapper.getCusterByName(custerName); } + @Override + public void reportSpreaderInfoToMes(SpreaderDto spreaderDto) { + mesRequestMapper.reportSpreaderInfoToMes(spreaderDto); + } + /** * 转换 * diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/controller/SysInteractRecordController.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/controller/SysInteractRecordController.java index c1e0931..39ebfb6 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/controller/SysInteractRecordController.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/controller/SysInteractRecordController.java @@ -63,4 +63,10 @@ public class SysInteractRecordController { sysInteractRecordService.deleteAll(ids); return new ResponseEntity<>(HttpStatus.OK); } + + //@SaCheckPermission("@el.check('sysInteractRecord:del')") + @GetMapping("/getAllName") + public ResponseEntity getAllName() { + return new ResponseEntity<>(sysInteractRecordService.getAllInteractName(), HttpStatus.OK); + } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/ISysInteractRecordService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/ISysInteractRecordService.java index d29a92a..f01f4ac 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/ISysInteractRecordService.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/ISysInteractRecordService.java @@ -11,6 +11,7 @@ import org.nl.wms.ext.record.service.dao.SysInteractRecord; import org.nl.wms.pdm.workorder.service.dao.PdmBdWorkorder; import org.nl.wms.pdm.workorder.service.dao.vo.AcsWorkOrderVo; +import java.util.List; import java.util.Map; import java.util.Set; @@ -77,4 +78,9 @@ public interface ISysInteractRecordService extends IService { * @param maxRowsToDelete 最大删除数 */ void deleteByRows(Param maxRowsToKeep, Param maxRowsToDelete); + + /** + * 获取所有标题 + */ + List getAllInteractName(); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dao/mapper/SysInteractRecordMapper.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dao/mapper/SysInteractRecordMapper.java index a2655a4..5d24081 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dao/mapper/SysInteractRecordMapper.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dao/mapper/SysInteractRecordMapper.java @@ -3,6 +3,8 @@ package org.nl.wms.ext.record.service.dao.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.nl.wms.ext.record.service.dao.SysInteractRecord; +import java.util.List; + /** * @author lyd * @date 2023-07-19 @@ -12,4 +14,6 @@ public interface SysInteractRecordMapper extends BaseMapper { void deleteByDay(String day); void deleteByRows(String maxRowsToKeep, String maxRowsToDelete); + + List getAllInteractName(); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dao/mapper/SysInteractRecordMapper.xml b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dao/mapper/SysInteractRecordMapper.xml index af5b747..9a16974 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dao/mapper/SysInteractRecordMapper.xml +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dao/mapper/SysInteractRecordMapper.xml @@ -9,4 +9,11 @@ CALL DeleteRowsIfNeeded(#{maxRowsToKeep}, #{maxRowsToDelete}) + diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/impl/SysInteractRecordServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/impl/SysInteractRecordServiceImpl.java index 5a527c2..c5381e9 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/impl/SysInteractRecordServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/impl/SysInteractRecordServiceImpl.java @@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.Date; +import java.util.List; import java.util.Map; import java.util.Set; @@ -42,10 +43,15 @@ public class SysInteractRecordServiceImpl extends ServiceImpl queryAll(Map whereJson, PageQuery page){ - String blurry = ObjectUtil.isNotEmpty(whereJson.get("blurry")) ? whereJson.get("blurry").toString() : null; - String interactDirection = ObjectUtil.isNotEmpty(whereJson.get("interact_direction")) ? whereJson.get("interact_direction").toString() : null; + String blurry = ObjectUtil.isNotEmpty(whereJson.get("blurry")) + ? whereJson.get("blurry").toString() : null; + String interactDirection = ObjectUtil.isNotEmpty(whereJson.get("interact_direction")) + ? whereJson.get("interact_direction").toString() : null; + String interactName = ObjectUtil.isNotEmpty(whereJson.get("interact_name")) + ? whereJson.get("interact_name").toString() : null; LambdaQueryWrapper lam = new LambdaQueryWrapper<>(); lam.eq(interactDirection!=null, SysInteractRecord::getDirection, interactDirection) + .eq(ObjectUtil.isNotEmpty(interactName), SysInteractRecord::getInteract_name, interactName) .and(blurry != null, s -> s.like(SysInteractRecord::getInteract_name, blurry) .or() .like(SysInteractRecord::getMessage, blurry) @@ -155,4 +161,9 @@ public class SysInteractRecordServiceImpl extends ServiceImpl getAllInteractName() { + return sysInteractRecordMapper.getAllInteractName(); + } + } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java index ea7dfa9..7eee48f 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java @@ -196,6 +196,7 @@ public class PdaServiceImpl implements PdaService { } // 开工 bdWorkorder.setOperator(manualSortingDto.getUsername()); + bdWorkorder.setRealproducestart_date(DateUtil.now()); bdWorkorder.setWorkorder_status(WorkOrderStatusEnum.PRODUCING.getCode()); TaskUtils.setWorkOrderUpdateByPC(bdWorkorder); workorderService.updateById(bdWorkorder); @@ -216,6 +217,7 @@ public class PdaServiceImpl implements PdaService { throw new BadRequestException("工单:[" + bdWorkorder.getWorkorder_code() + "]已完工"); } TaskUtils.setWorkOrderUpdateByPC(bdWorkorder); + bdWorkorder.setRealproduceend_date(DateUtil.now()); bdWorkorder.setWorkorder_status(WorkOrderStatusEnum.COMPLETE.getCode()); workorderService.updateById(bdWorkorder); return PdaResponseVo.pdaResultOk("工单:[" + bdWorkorder.getWorkorder_code() + "]完工成功"); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dao/mapper/PdmBdWorkorderMapper.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dao/mapper/PdmBdWorkorderMapper.java index c95f630..021e42a 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dao/mapper/PdmBdWorkorderMapper.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dao/mapper/PdmBdWorkorderMapper.java @@ -30,7 +30,7 @@ public interface PdmBdWorkorderMapper extends BaseMapper { List getTheDayUnProducedWorkOrder(); /** - * todo: 获取当天需要下发的工单 + * mark: 获取当天需要下发的工单 * @return */ List getTheDayIssueWorkOrderList(); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/impl/PdmBdWorkorderServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/impl/PdmBdWorkorderServiceImpl.java index 95edd55..796f1d7 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/impl/PdmBdWorkorderServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/impl/PdmBdWorkorderServiceImpl.java @@ -32,6 +32,7 @@ import org.nl.wms.pdm.workorder.service.dto.PdmBdWorkorderQuery; import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService; import org.nl.wms.sch.point.service.ISchBasePointService; import org.nl.wms.sch.point.service.dao.SchBasePoint; +import org.nl.wms.sch.task.service.ISchBaseTaskService; import org.nl.wms.sch.task_manage.GeneralDefinition; import org.nl.wms.sch.task_manage.enums.NoticeTypeEnum; import org.nl.wms.sch.task_manage.enums.WorkOrderStatusEnum; @@ -41,9 +42,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.math.BigDecimal; +import java.util.ArrayList; import java.util.List; import java.util.Set; -import java.util.concurrent.CopyOnWriteArrayList; /** * @author lyd @@ -70,6 +71,8 @@ public class PdmBdWorkorderServiceImpl extends ServiceImpl queryAll(PdmBdWorkorderQuery query, PageQuery page) { @@ -197,7 +200,7 @@ public class PdmBdWorkorderServiceImpl extends ServiceImpl list = new CopyOnWriteArrayList<>(); + List list = new ArrayList<>(); // 重装数据回ACS,重新根据id找一遍,省的改动以上代码 AcsWorkOrderVo acsWorkOrderVo = pdmBdWorkorderMapper.toAcsWorkOrderById(pdmBdWorkorder.getWorkorder_id()); list.add(acsWorkOrderVo); @@ -253,8 +256,12 @@ public class PdmBdWorkorderServiceImpl extends ServiceImpl selectOne = vehiclematerialgroupMapper.selectList(lambda); return selectOne.size() > 0 ? selectOne.get(0) : null; } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/ISchBaseTaskService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/ISchBaseTaskService.java index 74daf38..3730e83 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/ISchBaseTaskService.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/ISchBaseTaskService.java @@ -102,4 +102,11 @@ public interface ISchBaseTaskService extends IService { void operation(Map param); SchBaseTask getByCode(String taskCode); + + /** + * 返回当前设备搬运木控盘的任务数量 + * @param deviceCode + * @return + */ + int getEmptyVehicleCarryingByDevice(String deviceCode); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/dao/mapper/SchBaseTaskMapper.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/dao/mapper/SchBaseTaskMapper.java index a898965..d9ac744 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/dao/mapper/SchBaseTaskMapper.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/dao/mapper/SchBaseTaskMapper.java @@ -9,4 +9,5 @@ import org.nl.wms.sch.task.service.dao.SchBaseTask; **/ public interface SchBaseTaskMapper extends BaseMapper { + int getEmptyVehicleCarryingByDevice(String deviceCode); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/dao/mapper/SchBaseTaskMapper.xml b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/dao/mapper/SchBaseTaskMapper.xml index 9544698..d5978e5 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/dao/mapper/SchBaseTaskMapper.xml +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/dao/mapper/SchBaseTaskMapper.xml @@ -2,4 +2,16 @@ + diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/impl/SchBaseTaskServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/impl/SchBaseTaskServiceImpl.java index b11ed3c..6dc0ac9 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/impl/SchBaseTaskServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/impl/SchBaseTaskServiceImpl.java @@ -243,4 +243,9 @@ public class SchBaseTaskServiceImpl extends ServiceImpl list = new CopyOnWriteArrayList<>(); + List list = new ArrayList<>(); for (SchBaseTask task : taskList) { AcsTaskDto taskDto = new AcsTaskDto(); String responseParam = task.getResponse_param(); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AutoRestorePoint.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AutoRestorePoint.java index d049ac3..2be2e78 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AutoRestorePoint.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AutoRestorePoint.java @@ -27,5 +27,6 @@ public class AutoRestorePoint { List pointList = pointService.getAllUnlockAbnormalPoints(); pointList.forEach(point -> point.setIng_task_code("")); pointService.updateBatchById(pointList); + log.info("自动恢复异常点位:{}", pointList); } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/dtk/CTQKTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/dtk/CTQKTask.java index 809fab5..ab1b51d 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/dtk/CTQKTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/dtk/CTQKTask.java @@ -105,11 +105,11 @@ public class CTQKTask extends AbstractTask { task.setPoint_code1(point.getPoint_code()); task.setRemark(""); task.setVehicle_qty(point.getVehicle_qty()); + task.setVehicle_type(GeneralDefinition.STEEL_TRAY); task.setTask_status(TaskStatus.CREATED.getCode()); taskService.save(task); // 点位更新 point.setIng_task_code(task.getTask_code()); - pointService.update(point); PointUtils.setUpdateByAcs(point); pointService.updateById(point); } @@ -186,7 +186,6 @@ public class CTQKTask extends AbstractTask { // 任务完成 taskObj.setTask_status(TaskStatus.FINISHED.getCode()); taskObj.setRemark(GeneralDefinition.TASK_FINISH); - taskObj.setTask_status(TaskStatus.FINISHED.getCode()); taskObj.setFinished_type(taskFinishedType.getCode()); TaskUtils.setUpdateByType(taskObj, taskFinishedType); taskService.updateById(taskObj); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/dtk/DTSKTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/dtk/DTSKTask.java index cac94d3..d3e6c63 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/dtk/DTSKTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/dtk/DTSKTask.java @@ -197,7 +197,6 @@ public class DTSKTask extends AbstractTask { } taskObj.setTask_status(TaskStatus.CANCELED.getCode()); taskObj.setRemark(GeneralDefinition.TASK_CANCEL); - taskObj.setTask_status(TaskStatus.CANCELED.getCode()); taskObj.setFinished_type(taskFinishedType.getCode()); TaskUtils.setUpdateByType(taskObj, taskFinishedType); taskService.updateById(taskObj); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJMKTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJMKTask.java index 396c6e2..5d2e93b 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJMKTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJMKTask.java @@ -163,7 +163,7 @@ public class FJMKTask extends AbstractTask { // 设置组盘 - 需要的话由子类自行实现 task.setGroup_id(setGroupPlate(jsonObject)); task.setPoint_code2(packagePoint.getPoint_code()); - // 大于等于2就可以码 + // 为0就呼叫 if (jsonObject.getInteger("special_param") == 0) { /** 覆膜机木托盘位 */ SchBasePoint LaminatePoint = findStartPoint(startRegionStr, jsonObject); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJQKTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJQKTask.java index 6077316..ae8fdb4 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJQKTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJQKTask.java @@ -5,13 +5,8 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.nl.common.exception.BadRequestException; -import org.nl.common.utils.CodeUtil; -import org.nl.config.MapOf; import org.nl.system.service.notice.ISysNoticeService; import org.nl.wms.ext.acs.service.WmsToAcsService; -import org.nl.wms.ext.acs.service.dto.SignalData; -import org.nl.wms.ext.acs.service.dto.to.BaseRequest; -import org.nl.wms.ext.acs.service.dto.to.acs.PutActionRequest; import org.nl.wms.pdm.workorder.service.IPdmBdWorkorderService; import org.nl.wms.pdm.workorder.service.dao.PdmBdWorkorder; import org.nl.wms.sch.point.service.ISchBasePointService; @@ -25,11 +20,9 @@ import org.nl.wms.sch.task_manage.GeneralDefinition; import org.nl.wms.sch.task_manage.enums.NoticeTypeEnum; import org.nl.wms.sch.task_manage.enums.PointStatusEnum; import org.nl.wms.sch.task_manage.enums.TaskFinishedTypeEnum; -import org.nl.wms.sch.task_manage.task.AcsUtil; import org.nl.wms.sch.task_manage.task.TaskType; import org.nl.wms.sch.task_manage.task.core.TaskStatus; import org.nl.wms.sch.task_manage.task.tasks.fj.mapper.FJMapper; -import org.nl.wms.util.CommonUtils; import org.nl.wms.util.PointUtils; import org.nl.wms.util.TaskUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -37,7 +30,6 @@ import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import java.math.BigDecimal; -import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; @@ -100,7 +92,7 @@ public class FJQKTask extends AbstractTask { // 设置起点并修改创建成功状态 task.setPoint_code1(point.getParent_point_code()); task.setTask_status(TaskStatus.CREATED.getCode()); - // todo: 未确认是否放在1还是2,目前规定四点任务空盘的载具编码是2 + // mark: 未确认是否放在1还是2,目前规定四点任务空盘的载具编码是2 task.setRemark(""); task.setGroup_id(point.getGroup_id()); task.setResponse_param(param.toJSONString()); @@ -132,7 +124,7 @@ public class FJQKTask extends AbstractTask { // 判断工单是否够 boolean enoughCallEmpty = workorderService.isEnoughCallEmpty(task.getPoint_code2()); if (!enoughCallEmpty) { - throw new BadRequestException("数量不足,不呼叫空盘"); + throw new BadRequestException("所需数量已足够,不呼叫空盘"); } SchBasePoint point = findStartPoint(startRegionStr, extGroupData); if (ObjectUtil.isEmpty(point)) { @@ -153,7 +145,7 @@ public class FJQKTask extends AbstractTask { task.setPoint_code1(point.getParent_point_code()); task.setTask_status(TaskStatus.CREATED.getCode()); task.setResponse_param(param.toJSONString()); - // todo: 未确认是否放在1还是2,目前规定四点任务空盘的载具编码是2 + // mark: 未确认是否放在1还是2,目前规定四点任务空盘的载具编码是2 task.setRemark(""); task.setGroup_id(point.getGroup_id()); taskService.save(task); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJSLTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJSLTask.java index c61a301..4b903bc 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJSLTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJSLTask.java @@ -119,6 +119,7 @@ public class FJSLTask extends AbstractTask { task.setPoint_code2(point.getPoint_code()); task.setTask_status(TaskStatus.CREATED.getCode()); task.setRemark(""); + task.setVehicle_type(GeneralDefinition.STEEL_TRAY); TaskUtils.setUpdateByAcs(task); taskService.save(task); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yao/CYZCTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yao/CYZCTask.java index 351cca3..18e88f8 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yao/CYZCTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yao/CYZCTask.java @@ -95,9 +95,6 @@ public class CYZCTask extends AbstractTask { point.setIng_task_code(task.getTask_code()); PointUtils.setUpdateByAcs(point); pointService.updateById(point); - - //下发 - //this.renotifyAcs(task); } } @@ -138,16 +135,16 @@ public class CYZCTask extends AbstractTask { public String setGroupPlate(JSONObject param) { // 查找组盘表信息,不做修改 String vehicleCode = TaskUtils.defaultVehicleCode(param.getString("vehicle_code")); - String vehicleType = param.getString("vehicle_type"); + String vehicleType = GeneralDefinition.STEEL_TRAY; if (ObjectUtil.isEmpty(vehicleCode)) { throw new BadRequestException("载具号不能为空"); } - if (vehicleCode == null) { - vehicleType = GeneralDefinition.STEEL_TRAY; - } SchBaseVehiclematerialgroup one = vehiclematerialgroupService.getGroupInfo(vehicleCode, vehicleType, GroupBindMaterialStatusEnum.BOUND.getValue()); - return ObjectUtil.isNotEmpty(one) ? one.getGroup_id() : ""; + if (ObjectUtil.isEmpty(one)) { + throw new BadRequestException("载具号[" + vehicleCode + "]的组盘信息不存在"); + } + return one.getGroup_id(); } /** diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yao/GZYQLTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yao/GZYQLTask.java index 4e112b7..152b518 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yao/GZYQLTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yao/GZYQLTask.java @@ -80,6 +80,7 @@ public class GZYQLTask extends AbstractTask { task.setPoint_code1(point.getPoint_code()); task.setTask_status(TaskStatus.CREATED.getCode()); task.setRemark(""); + task.setVehicle_type(GeneralDefinition.STEEL_TRAY); TaskUtils.setUpdateByAcs(task); taskService.updateById(task); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZSLTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZSLTask.java index b86e9dc..a010391 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZSLTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZSLTask.java @@ -216,12 +216,12 @@ public class YZSLTask extends AbstractTask { taskObj.setRemark("执行中"); TaskUtils.setUpdateByAcs(taskObj); taskService.updateById(taskObj); - // todo:暂时现在执行中的时候将满托上给mes + // mark:暂时现在执行中的时候将满托上给mes wmsToMesService.reportProductData(taskObj.getGroup_id()); } if (status.equals(TaskStatus.FINISHED)) { // 完成 this.finishTask(taskObj, TaskFinishedTypeEnum.AUTO_ACS); - // todo: 完成后上报给MES + // mark: 完成后上报给MES wmsToMesService.reportSemiProductionInfoIn(taskObj.getGroup_id()); } if (status.equals(TaskStatus.CANCELED)) { // 取消 diff --git a/lms/nladmin-system/nlsso-server/src/main/resources/config/application.yml b/lms/nladmin-system/nlsso-server/src/main/resources/config/application.yml index a9a7233..b9ac791 100644 --- a/lms/nladmin-system/nlsso-server/src/main/resources/config/application.yml +++ b/lms/nladmin-system/nlsso-server/src/main/resources/config/application.yml @@ -123,7 +123,7 @@ mybatis-plus: configuration: map-underscore-to-camel-case: false jdbc-type-for-null: null - log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + log-impl: org.nl.config.mybatis.MyStdOutImpl mapper-locations: - classpath:org.nl.**.mapper/*.xml global-config: diff --git a/lms/nladmin-system/nlsso-server/src/test/java/org/nl/point/PointCreate.java b/lms/nladmin-system/nlsso-server/src/test/java/org/nl/point/PointCreate.java index b0b172e..24cacd2 100644 --- a/lms/nladmin-system/nlsso-server/src/test/java/org/nl/point/PointCreate.java +++ b/lms/nladmin-system/nlsso-server/src/test/java/org/nl/point/PointCreate.java @@ -232,4 +232,28 @@ public class PointCreate { } pointService.saveBatch(pointList); } + + @Test + void BLJ() { + List pointList = new ArrayList<>(); + for (int i = 1; i <= 8; i++) { + String pointName = "布料机0"; + String pointCode = "BLJ0"; + pointName = pointName + i; + pointCode = pointCode + i; + SchBasePoint point = new SchBasePoint(); + point.setPoint_code(pointCode); + point.setPoint_name(pointName); + point.setRegion_code("YZ"); + point.setRegion_name("压制区域"); + point.setParent_point_code("YJ0" + i); + point.setIs_has_workder(false); + point.setIs_auto(false); + point.setCreate_id("1"); + point.setCreate_name("管理员"); + point.setCreate_time(DateUtil.now()); + pointList.add(point); + } + pointService.saveBatch(pointList); + } } diff --git a/lms/nladmin-ui/src/views/wms/ext/record/index.vue b/lms/nladmin-ui/src/views/wms/ext/record/index.vue index 3a0ebd1..2209f50 100644 --- a/lms/nladmin-ui/src/views/wms/ext/record/index.vue +++ b/lms/nladmin-ui/src/views/wms/ext/record/index.vue @@ -19,6 +19,16 @@ @keyup.enter.native="crud.toQuery" /> + + + + + + { + this.interact_name_list = res + }) } } } diff --git a/lms/nladmin-ui/src/views/wms/ext/record/sysInteractRecord.js b/lms/nladmin-ui/src/views/wms/ext/record/sysInteractRecord.js index 9f6d776..8d66d13 100644 --- a/lms/nladmin-ui/src/views/wms/ext/record/sysInteractRecord.js +++ b/lms/nladmin-ui/src/views/wms/ext/record/sysInteractRecord.js @@ -23,5 +23,12 @@ export function edit(data) { data }) } +export function getAllName(params) { + return request({ + url: 'api/sysInteractRecord/getAllName', + method: 'get', + params + }) +} -export default { add, edit, del } +export default { add, edit, del, getAllName }