From 019d5cf4aad692585b63b7b25643ecc1a4ad48fc Mon Sep 17 00:00:00 2001 From: liyongde <1419499670@qq.com> Date: Thu, 16 Nov 2023 14:24:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=87=AA=E5=8A=A8=E4=B8=8B=E5=8F=91?= =?UTF-8?q?=E5=B7=A5=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/nl/config/mybatis/MyStdOutImpl.java | 50 +++++++++++++++++++ .../ext/acs/autotask/AutoIssueWorkOrder.java | 10 ++-- .../acs/service/impl/AcsToWmsServiceImpl.java | 3 ++ .../service/IPdmBdWorkorderService.java | 6 +++ .../dao/mapper/PdmBdWorkorderMapper.java | 2 + .../dao/mapper/PdmBdWorkorderMapper.xml | 16 +++++- .../impl/PdmBdWorkorderServiceImpl.java | 7 ++- .../point/service/ISchBasePointService.java | 5 ++ .../dao/mapper/SchBasePointMapper.java | 7 +++ .../service/dao/mapper/SchBasePointMapper.xml | 8 +++ .../service/impl/SchBasePointServiceImpl.java | 5 ++ .../task_manage/task/tasks/fj/FJSLTask.java | 3 -- .../task_manage/task/tasks/yz/YZQKTask.java | 5 +- .../task_manage/task/tasks/yz/YZSLTask.java | 1 - .../main/java/org/nl/wms/util/TaskUtils.java | 6 ++- .../src/main/resources/logback-spring.xml | 7 ++- 16 files changed, 126 insertions(+), 15 deletions(-) create mode 100644 lms/nladmin-system/nlsso-server/src/main/java/org/nl/config/mybatis/MyStdOutImpl.java diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/config/mybatis/MyStdOutImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/config/mybatis/MyStdOutImpl.java new file mode 100644 index 0000000..0b1d8dc --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/config/mybatis/MyStdOutImpl.java @@ -0,0 +1,50 @@ +package org.nl.config.mybatis; + +import lombok.extern.slf4j.Slf4j; +import org.apache.ibatis.logging.Log; + +/** + * @Author: lyd + * @Description: + * @Date: 2023/11/16 + */ +@Slf4j +public class MyStdOutImpl implements Log { + public MyStdOutImpl(String clazz) { + } + @Override + public boolean isDebugEnabled() { + return true; + } + + @Override + public boolean isTraceEnabled() { + return true; + } + + @Override + public void error(String s, Throwable e) { + log.error(s); + e.printStackTrace(System.err); + } + + @Override + public void error(String s) { + log.error(s); + } + + @Override + public void debug(String s) { + log.debug(s); + } + + @Override + public void trace(String s) { + log.trace(s); + } + + @Override + public void warn(String s) { + log.warn(s); + } +} 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 969a355..6523e2a 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 @@ -47,15 +47,19 @@ public class AutoIssueWorkOrder { try { if (tryLock) { // 获取每台设备的第一条工单 - List workorderList = workorderService.getNeedCallMaterial(); + List workorderList = workorderService.getNotIssueOrder(); // 查找该设备未生产的工单去下发 workorderList.forEach(s -> { // 判断是否有工单 List lists = workorderService.getTheDayProducedWorkOrderByDevice(s.getPoint_code()); - if (lists.size() > 0) return; + if (lists.size() > 0) { + return; + } // 已生产就退出 if (s.getWorkorder_status().equals(WorkOrderStatusEnum.PRODUCING.getCode()) - || s.getWorkorder_code().equals(WorkOrderStatusEnum.ISSUED.getCode())) return; + || s.getWorkorder_code().equals(WorkOrderStatusEnum.ISSUED.getCode())) { + return; + } AcsWorkOrderVo acsWorkOrderVo = workorderService.toAcsWorkOrderById(s.getWorkorder_id()); // 获取一个下发 List list = new CopyOnWriteArrayList<>(); 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 a154301..80c09c3 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 @@ -509,6 +509,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { .append(baseMaterial.getMaterial_spec() + "~" + baseMaterial.getMaterial_model()).append("##") .append(baseMaterial.getMaterial_name()).append("##") .append(custer.getCuster_name()).append("**"); + log.info("打印的唛头信息:{}", sb); return ApplyTaskResponse.responseOk(requestNo, sb.toString()); } @@ -540,6 +541,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { bdWorkorder.setRealproducestart_date(DateUtil.now()); TaskUtils.setWorkOrderUpdateByAcs(bdWorkorder); workorderService.updateById(bdWorkorder); + log.info("人工排产确认:{}", bdWorkorder); return BaseResponse.responseOk(requestNo); } @@ -566,6 +568,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { bdWorkorder.setQualified_qty(qualified_qty); bdWorkorder.setUnqualified_qty(unqualified_qty); workorderService.updateById(bdWorkorder); + log.info("工单完成: {}", bdWorkorder); try { // todo: 统计当前设备的不合格位置的数量作为不合格数,并上报给mes wmsToMesService.reportPressUnusedMaterial(bdWorkorder); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/IPdmBdWorkorderService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/IPdmBdWorkorderService.java index 872dfae..4bfc679 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/IPdmBdWorkorderService.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/IPdmBdWorkorderService.java @@ -127,4 +127,10 @@ public interface IPdmBdWorkorderService extends IService { * @return */ AcsWorkOrderVo toAcsWorkOrderById(String workorderId); + + /** + * 获取未生产 + * @return + */ + List getNotIssueOrder(); } 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 7ce469b..c95f630 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 @@ -55,4 +55,6 @@ public interface PdmBdWorkorderMapper extends BaseMapper { * @return */ List getNeedCallMaterial(); + + List getNotIssueOrder(); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dao/mapper/PdmBdWorkorderMapper.xml b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dao/mapper/PdmBdWorkorderMapper.xml index 2e8104c..dbc6c15 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dao/mapper/PdmBdWorkorderMapper.xml +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dao/mapper/PdmBdWorkorderMapper.xml @@ -124,7 +124,7 @@ FROM `pdm_bd_workorder` w WHERE w.point_code = #{s} - AND w.workorder_status != '5' AND w.workorder_status != '1' + AND w.workorder_status IN ('2', '3') + 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 53bbfda..95edd55 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 @@ -219,7 +219,7 @@ public class PdmBdWorkorderServiceImpl extends ServiceImpl getNotIssueOrder() { + return pdmBdWorkorderMapper.getNotIssueOrder(); + } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/ISchBasePointService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/ISchBasePointService.java index 5e52fb6..f35c624 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/ISchBasePointService.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/ISchBasePointService.java @@ -67,4 +67,9 @@ public interface ISchBasePointService extends IService { * @return */ List getAllUnlockAbnormalPoints(); + /** + * 行锁获取对应点位 + * @return + */ + SchBasePoint selectByIdLock(String id); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.java index 24f867f..78176b3 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.java @@ -19,4 +19,11 @@ public interface SchBasePointMapper extends BaseMapper { void batchChangeUsed(List pointCodes, Boolean used); List getAllUnlockAbnormalPoints(); + + /** + * 行锁获取id的点位 + * @param id + * @return + */ + SchBasePoint selectByIdLock(String id); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.xml b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.xml index dd9be54..dd6f73c 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.xml +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.xml @@ -20,4 +20,12 @@ LEFT JOIN sch_base_task t ON t.task_code = p.ing_task_code WHERE p.ing_task_code IS NOT NULL AND p.ing_task_code != '' AND (t.task_status = '5' OR t.task_status = '6') + diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java index f962a1c..141db38 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java @@ -208,4 +208,9 @@ public class SchBasePointServiceImpl extends ServiceImpl - + @@ -108,9 +108,12 @@ https://juejin.cn/post/6844903775631572999 - + + + +