diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/cw_site/CwSiteDeviceDriver.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/cw_site/CwSiteDeviceDriver.java index 091f295..05e9766 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/cw_site/CwSiteDeviceDriver.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/cw_site/CwSiteDeviceDriver.java @@ -155,6 +155,20 @@ public class CwSiteDeviceDriver extends AbstractOpcDeviceDriver implements Devic } } if (move != last_move) { + //点位数量变更后通知lms + FeedBackTaskStatusRequest request = new FeedBackTaskStatusRequest(); + request.setState(String.valueOf(move)); + request.setDevice_code(this.getDeviceCode()); + request.setType("2"); + acsToWmsService.notify(); + } + if (tier != last_tier&&move!=0) { + //高度数量变更后通知lms + FeedBackTaskStatusRequest request = new FeedBackTaskStatusRequest(); + request.setState(String.valueOf(tier)); + request.setDevice_code(this.getDeviceCode()); + request.setType("2"); + acsToWmsService.notify(); } if (error != last_error) { } diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/feedBackTaskStatus/FeedBackTaskStatusRequest.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/feedBackTaskStatus/FeedBackTaskStatusRequest.java index bd0dfd0..1d174b5 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/feedBackTaskStatus/FeedBackTaskStatusRequest.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/feedBackTaskStatus/FeedBackTaskStatusRequest.java @@ -46,5 +46,10 @@ public class FeedBackTaskStatusRequest extends BaseRequest { */ private String material_type; + /** + * 层数 + */ + private String tier; + } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java index 93a1057..d22c289 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java @@ -166,15 +166,20 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { String requestNo = param.getString("requestNo"); log.info("notifyAcs - 请求参数 {}", param); Integer type=param.getInteger("type"); + String device_code = param.getString("device_code"); + String state = param.getString("state"); switch(type) { case 1: //自动门反馈设备状态,将对应十个固化室工位的状态修改为传入状态 - String device_code = param.getString("device_code"); String ghs_device_code="GHS"+device_code.substring(device_code.length()-2); - String state = param.getString("state"); pointMapper.updatePointStatus(ghs_device_code,state); break; case 2: + //正极板对接位反馈设备有无货 + if("ZJBDJW0101".equals(device_code)||"ZJBDJW0201".equals(device_code)){ + device_code=device_code.substring(0,device_code.length()-2); + } + pointMapper.updatePointVehicleQty(device_code,state); break; default: break; diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/BPSLTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/BPSLTask.java index acb62ee..c7ad69d 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/BPSLTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/BPSLTask.java @@ -116,7 +116,7 @@ public class BPSLTask extends AbstractTask { String regionCode = ""; String materialType = extGroupData.getString("material_type"); if("1".equals(materialType)){ - regionCode="ZJBDDW"; + regionCode="ZJB"; }else if("2".equals(materialType)){ regionCode="HCQ2"; }else if ("3".equals(materialType)){ diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KGHJRKTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KGHJRKTask.java index 750aa3e..46467eb 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KGHJRKTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KGHJRKTask.java @@ -90,9 +90,9 @@ public class KGHJRKTask extends AbstractTask { task.setRemark(""); taskService.update(task); - //发起任务时先把点位占用,防止发起重复任务 - point.setIng_task_code(task.getTask_code()); - pointService.update(point); +// //发起任务时先把点位占用,防止发起重复任务 +// point.setIng_task_code(task.getTask_code()); +// pointService.update(point); //下发 this.renotifyAcs(task); @@ -173,7 +173,10 @@ public class KGHJRKTask extends AbstractTask { if (status.equals(TaskStatus.FINISHED)) { // 完成 // 终点解锁,库存增加 startPointObj.setIng_task_code(""); - startPointObj.setVehicle_qty(startPointObj.getVehicle_qty()+1); + //正极板对接位通过plc信号同步,任务完成不增加 + if(!"ZJBKGHJDJW".equals(startPointObj.getRegion_code())) { + startPointObj.setVehicle_qty(startPointObj.getVehicle_qty() + 1); + } pointService.update(endPointObj); // 任务完成 @@ -204,6 +207,21 @@ public class KGHJRKTask extends AbstractTask { @Override protected void feedbackTaskState(JSONObject param,SchBaseTask schBaseTask, BaseResponse result) { - //todo 重算最优点 + //重新计算固化室放货点位 + JSONObject extGroupData = JSONObject.parseObject(schBaseTask.getExt_group_data()); + SchBasePoint startPoint = pointService.getOne(new LambdaQueryWrapper() + .eq(SchBasePoint::getPoint_code, schBaseTask.getPoint_code1())); + SchBasePoint point = findNextPoint(startPoint, schBaseTask.getVehicle_type()); + if("ZJBKGHJDJW".equals(point.getRegion_code())) { + schBaseTask.setPoint_code2(point.getPoint_code() + "0" + (point.getVehicle_qty() + 1)); + }else{ + schBaseTask.setPoint_code2(point.getPoint_code()); + if(ObjectUtil.isNotEmpty(point.getIng_task_code())&&!schBaseTask.getTask_code().equals(point.getIng_task_code())){ + throw new BadRequestException("当前空架点位有任务,暂不反馈!"); + } + //重算点位时把点位占用 + point.setIng_task_code(schBaseTask.getTask_code()); + pointService.update(point); + } } } \ No newline at end of file diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/mapper/PointMapper.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/mapper/PointMapper.java index 6c3d260..fe5b8e1 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/mapper/PointMapper.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/mapper/PointMapper.java @@ -19,4 +19,6 @@ public interface PointMapper { void updateVehicleType(String device_code,String vehicle_type); void updatePointType(String device_code,String point_type); + + void updatePointVehicleQty(String device_code,String state); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/mapper/PointMapper.xml b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/mapper/PointMapper.xml index ffe5dc5..5174c46 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/mapper/PointMapper.xml +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/mapper/PointMapper.xml @@ -34,4 +34,9 @@ update sch_base_point set point_type = #{point_type} where point_code like CONCAT('%', #{device_code}, '%') + + + update sch_base_point set vehicle_qty = #{state} + where point_code like CONCAT('%', #{device_code}, '%') +