| | |
| | | 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; |
| | |
| | | private TestMastService testMastService; |
| | | @Autowired |
| | | private WorkService workService; |
| | | @Autowired |
| | | private UserService userService;//只查询 无修改操作 |
| | | |
| | | @Value("${mes.url}") |
| | | private String mesUrl; |
| | |
| | | @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); |
| | |
| | | if (!locMastService.update(locMast,new EntityWrapper<LocMast>().eq("loc_no", testMast.getLocNo()))){ |
| | | throw new CoolException("申请测试失败"); |
| | | } |
| | | // throw new CoolException("异常!!!请规范使用或联系管理员"); |
| | | |
| | | } |
| | | @Override |
| | | @Transactional |