| | |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.MatUtils; |
| | | import com.zy.common.model.DetlDto; |
| | | import com.zy.common.model.enums.WorkNoType; |
| | | import com.zy.common.utils.NodeUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private TestMastService testMastService; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | | private WorkService workService; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | @Transactional |
| | | public void infoReview(Review review) { |
| | | Wrapper wrapper = new EntityWrapper<TestMast>() |
| | | .eq("loc_no", review.getLocNo()); |
| | | .eq("loc_no", review.getLocNo()) |
| | | .eq("barcode", review.getBarcode()) |
| | | .eq("user_Id", review.getUserId()); |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", review.getLocNo())); |
| | | if (locMast.getPackStatus()!=1){ |
| | | if (locMast.getPackStatus()!=1) { |
| | | throw new CoolException("产品状态不是 1:待测试"); |
| | | } |
| | | TestMast testMast = testMastService.selectOne(wrapper); |
| | | if(null != testMast){ |
| | | if (testMast.getStatus()==1){ |
| | | testMast.setStatus(2); |
| | | testMast.setStatus(3); |
| | | testMast.setModiTime(new Date()); |
| | | if (!testMastService.update(testMast,wrapper)){ |
| | | |
| | | throw new CoolException("更新测试状态失败"); |
| | | } |
| | | locMast.setPackStatus(2); |
| | | if (!locMastService.update(locMast,new EntityWrapper<LocMast>().eq("loc_no", review.getLocNo()))){ |
| | | throw new CoolException("更新产品状态失败"); |
| | | } |
| | | }else if (Cools.isEmpty(testMast.getStatus())){ |
| | | throw new CoolException("状态异常"); |
| | |
| | | throw new CoolException("测试申请失败"); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional |
| | | public Boolean testFinish(Review review) { |
| | | Boolean success=true; |
| | | Wrapper wrapper = new EntityWrapper<TestMast>() |
| | | .eq("loc_no", review.getLocNo()) |
| | | .eq("barcode", review.getBarcode()) |
| | | .eq("user_Id", review.getUserId()); |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", review.getLocNo())); |
| | | if (locMast.getPackStatus()!=2){ |
| | | throw new CoolException("产品状态不是 2:测试中"); |
| | | } |
| | | TestMast testMast = testMastService.selectOne(wrapper); |
| | | if(null != testMast){ |
| | | if (testMast.getStatus()==3){ |
| | | testMast.setStatus(4); |
| | | testMast.setModiTime(new Date()); |
| | | if (!testMastService.update(testMast,wrapper)){ |
| | | throw new CoolException("更改测试状态失败"); |
| | | } |
| | | }else if (Cools.isEmpty(testMast.getStatus())){ |
| | | throw new CoolException("状态异常"); |
| | | }else { |
| | | throw new CoolException("状态不是 2:测试中"); |
| | | } |
| | | } else { |
| | | throw new CoolException("状态异常"); |
| | | } |
| | | LocMast targetLocNo = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("row1",2) |
| | | .eq("loc_sts","O") |
| | | .eq("fire_status", 0) |
| | | .eq("pack_status",0)); |
| | | if (targetLocNo != null){ |
| | | workService.locMove(review.getLocNo(),targetLocNo.getLocNo(),(long)Integer.parseInt(review.getUserId())); |
| | | }else { |
| | | throw new CoolException("没有空库位"); |
| | | } |
| | | return success; |
| | | } |
| | | |
| | | /*...........................赣州新增..............以上.............赣州新增...........................*/ |
| | | |
| | | } |