From 77db84d63aa23dfa63bdc667f73ee6507369fd9a Mon Sep 17 00:00:00 2001 From: LSH Date: 星期四, 03 十一月 2022 10:57:40 +0800 Subject: [PATCH] #pda同步优化 根据用户编号查询用户码 --- src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java | 22 ++++++++++++++++++++-- 1 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java index 024a4bb..2f210a5 100644 --- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java @@ -24,6 +24,8 @@ import com.zy.common.model.MesCombParam; import com.zy.common.service.CommonService; import com.zy.common.utils.HttpHandler; +import com.zy.system.entity.User; +import com.zy.system.service.UserService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -83,6 +85,8 @@ private TestMastService testMastService; @Autowired private WorkService workService; + @Autowired + private UserService userService;//鍙煡璇� 鏃犱慨鏀规搷浣� @Value("${mes.url}") private String mesUrl; @@ -632,13 +636,25 @@ @Override @Transactional public void startUpTestPACK(TestMast testMast) { - + if(Cools.isEmpty(testMast.getLocNo())){ + throw new CoolException("搴撲綅鍙蜂负绌�"); + }else if(Cools.isEmpty(testMast.getChannel())){ + throw new CoolException("鐢ㄦ埛缂栫爜涓虹┖"); + }else if(Cools.isEmpty(testMast.getBarcode())){ + throw new CoolException("PACK鐮佷负绌�"); + } + User user = userService.selectOne(new EntityWrapper<User>().eq("username", testMast.getChannel().toString())); + if (!Cools.isEmpty(user)){ + testMast.setUserId(user.getMobile()); + }else { + throw new CoolException("鏈煡鍒扮敤鎴风紪鍙凤細"+testMast.getChannel()+"鎵�灞炵敤鎴风爜"); + } LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>() .eq("loc_no", testMast.getLocNo()) .eq("loc_sts","F") ); if (Cools.isEmpty(locMast)) { - throw new CoolException(BaseRes.PARAM); + throw new CoolException("鏈煡璇㈠埌搴撲綅鍙凤細"+testMast.getLocNo()+" 璇锋鏌ュ簱浣嶅彿鎴栬�呮鏌ュ簱浣嶇姸鎬佹槸鍚︽湭鍦ㄥ簱"); } Date now = new Date(); testMast.setStatus(1); @@ -688,6 +704,8 @@ if (!locMastService.update(locMast,new EntityWrapper<LocMast>().eq("loc_no", testMast.getLocNo()))){ throw new CoolException("鐢宠娴嬭瘯澶辫触"); } +// throw new CoolException("寮傚父锛侊紒锛佽瑙勮寖浣跨敤鎴栬仈绯荤鐞嗗憳"); + } @Override @Transactional -- Gitblit v1.9.1