| | |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.MatCodeCountDto; |
| | | import com.zy.asrs.entity.WrkDetl; |
| | | import com.zy.asrs.mapper.WrkDetlMapper; |
| | | import com.zy.asrs.service.MatService; |
| | |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void createWorkDetail(Integer workNo, List<DetlDto> detlDtos, String barcode, Long userId) { |
| | | public void createWorkDetail(Integer workNo, List<DetlDto> detlDtos, String barcode, Long userId, Date now) { |
| | | if (detlDtos.isEmpty()){ |
| | | return; |
| | | } |
| | | Date now = new Date(); |
| | | for (DetlDto dto : detlDtos) { |
| | | Mat mat = matService.selectByMatnr(dto.getMatnr()); |
| | | if (Cools.isEmpty(mat)){ |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void createWorkDetail2(Integer workNo, List<MatCodeCountDto> matCodeCountDtos, String barcode, Long userId) { |
| | | if (matCodeCountDtos.isEmpty()){ |
| | | return; |
| | | } |
| | | for (MatCodeCountDto dto : matCodeCountDtos) { |
| | | Mat mat = matService.selectByMatnr(dto.getMatNo()); |
| | | if (Cools.isEmpty(mat)){ |
| | | throw new CoolException(dto.getMatNo() + "商品维护失败"); |
| | | } |
| | | // 保持工作档明细 |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | wrkDetl.sync(mat); |
| | | wrkDetl.setWrkNo(workNo); |
| | | wrkDetl.setIoTime(new Date()); |
| | | wrkDetl.setAnfme(dto.getCount()); // 数量 |
| | | wrkDetl.setMemo(""); |
| | | wrkDetl.setBatch(dto.getBatch()); |
| | | // VersionUtils.setWrkDetl(wrkDetl, matCode); // 版本控制 |
| | | // wrkDetl.setBname(dto.getStr4()); |
| | | wrkDetl.setZpallet(barcode); // 托盘条码 |
| | | wrkDetl.setAppeUser(userId); |
| | | wrkDetl.setAppeTime(new Date()); |
| | | wrkDetl.setModiUser(userId); |
| | | wrkDetl.setModiTime(new Date()); |
| | | if (!this.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作明细失败"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<WrkDetl> selectByWrkNo(Integer wrkNo) { |
| | | return this.baseMapper.selectByWrkNo(wrkNo); |
| | | } |
| | |
| | | return baseMapper.updateAnfme(anfme, wrkNo, matnr, batch) > 0; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<WrkDetl> selectAndLogByOrderNo(String orderNo) { |
| | | return this.baseMapper.selectAndLogByOrderNo(orderNo); |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateInspect(Integer wrkNo, String matnr, String batch) { |
| | | return this.baseMapper.updateInspect(wrkNo, matnr, batch) > 0; |
| | | } |
| | | |
| | | @Override |
| | | public List<WrkDetl> selectPakoutQuery(Integer staNo, String matnr) { |
| | | return this.baseMapper.selectPakoutQuery(staNo, matnr); |
| | | } |
| | | |
| | | @Override |
| | | public Double getBomQty(String bomCode,String matnr) { |
| | | return this.baseMapper.getBomQty(bomCode,matnr); |
| | | } |
| | | } |