自动化立体仓库 - WMS系统
LSH
2022-11-03 77db84d63aa23dfa63bdc667f73ee6507369fd9a
#pda同步优化   根据用户编号查询用户码
1个文件已修改
22 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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