From 0f57cf39b8702d2795d0ee00d00cae36ab8daa0a Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期四, 16 十一月 2023 13:46:34 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/service/impl/TaskWrkServiceImpl.java |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/TaskWrkServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/TaskWrkServiceImpl.java
index fddea75..50eb0da 100644
--- a/src/main/java/com/zy/asrs/service/impl/TaskWrkServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/TaskWrkServiceImpl.java
@@ -3,8 +3,10 @@
 import com.core.exception.CoolException;
 import com.zy.asrs.domain.enums.TaskStatusType;
 import com.zy.asrs.domain.enums.WorkNoType;
+import com.zy.asrs.entity.StaDesc;
 import com.zy.asrs.mapper.TaskWrkMapper;
 import com.zy.asrs.entity.TaskWrk;
+import com.zy.asrs.service.StaDescService;
 import com.zy.asrs.service.TaskWrkService;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import com.zy.common.service.CommonService;
@@ -20,6 +22,8 @@
 
     @Autowired
     private CommonService commonService;
+    @Autowired
+    private StaDescService staDescService;
 
     @Override
     public TaskWrk selectByTaskNo(String taskNo) {
@@ -64,11 +68,16 @@
     @Override
     public void startup(TaskWrk taskWrk, Long userId) {
         //鍏ュ簱浠诲姟娲惧彂
+        StaDesc staDesc = staDescService.queryCrn(taskWrk.getIoType(), Integer.parseInt(taskWrk.getStartPoint()));
+        if (staDesc == null) {
+            return;//涓嶅瓨鍦ㄨ矾寰�
+        }
         int workNo = commonService.getWorkNo(WorkNoType.PAKIN.type);//鑾峰彇鍏ュ簱宸ヤ綔鍙�
         taskWrk.setWrkNo(workNo);//宸ヤ綔鍙�
         taskWrk.setStatus(TaskStatusType.DISTRIBUTE.id);//娲惧彂鐘舵��
         taskWrk.setAssignTime(new Date());//娲惧彂鏃堕棿
         taskWrk.setWrkSts(2);//宸ヤ綔鐘舵�� 2.璁惧涓婅蛋
+        taskWrk.setCrnNo(staDesc.getCrnNo());//鍫嗗灈鏈哄彿
         taskWrk.setModiTime(new Date());
         taskWrk.setModiUser(userId);
         updateById(taskWrk);
@@ -77,11 +86,16 @@
     @Override
     public void stockOut(TaskWrk taskWrk, Long userId) {
         //鍑哄簱浠诲姟娲惧彂
+        StaDesc staDesc = staDescService.queryCrn(taskWrk.getIoType(), Integer.parseInt(taskWrk.getTargetPoint()));
+        if (staDesc == null) {
+            return;//涓嶅瓨鍦ㄨ矾寰�
+        }
         int workNo = commonService.getWorkNo(WorkNoType.PAKOUT.type);//鑾峰彇鍑哄簱宸ヤ綔鍙�
         taskWrk.setWrkNo(workNo);//宸ヤ綔鍙�
         taskWrk.setStatus(TaskStatusType.DISTRIBUTE.id);//娲惧彂鐘舵��
         taskWrk.setAssignTime(new Date());//娲惧彂鏃堕棿
         taskWrk.setWrkSts(11);//宸ヤ綔鐘舵�� 11.鐢熸垚鍑哄簱ID
+        taskWrk.setCrnNo(staDesc.getCrnNo());//鍫嗗灈鏈哄彿
         taskWrk.setModiTime(new Date());
         taskWrk.setModiUser(userId);
         updateById(taskWrk);
@@ -90,11 +104,16 @@
     @Override
     public void locMove(TaskWrk taskWrk, Long userId) {
         //搴撴牸绉昏浇浠诲姟娲惧彂
+        StaDesc staDesc = staDescService.queryCrn(taskWrk.getIoType(), Integer.parseInt(taskWrk.getTargetPoint()));
+        if (staDesc == null) {
+            return;//涓嶅瓨鍦ㄨ矾寰�
+        }
         int workNo = commonService.getWorkNo(WorkNoType.OTHER.type);//鑾峰彇宸ヤ綔鍙�
         taskWrk.setWrkNo(workNo);//宸ヤ綔鍙�
         taskWrk.setStatus(TaskStatusType.DISTRIBUTE.id);//娲惧彂鐘舵��
         taskWrk.setAssignTime(new Date());//娲惧彂鏃堕棿
         taskWrk.setWrkSts(11);//宸ヤ綔鐘舵�� 11.鐢熸垚鍑哄簱ID
+        taskWrk.setCrnNo(staDesc.getCrnNo());//鍫嗗灈鏈哄彿
         taskWrk.setModiTime(new Date());
         taskWrk.setModiUser(userId);
         updateById(taskWrk);

--
Gitblit v1.9.1