| | |
| | | import com.zy.asrs.mapper.WrkDetlMapper; |
| | | import com.zy.asrs.service.MatCodeService; |
| | | import com.zy.asrs.service.WrkDetlService; |
| | | import com.zy.asrs.utils.VersionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void createWorkDetail(Integer workNo, List<MatCodeCountDto> matCodeCountDtos, Long userId) { |
| | | public void createWorkDetail(Integer workNo, List<MatCodeCountDto> matCodeCountDtos, String barcode, Long userId) { |
| | | if (matCodeCountDtos.isEmpty()){ |
| | | return; |
| | | } |
| | | for (MatCodeCountDto dto : matCodeCountDtos) { |
| | | MatCode matCode = matCodeService.selectById(dto.getMatNo()); |
| | | if (Cools.isEmpty(matCode)){ |
| | | throw new CoolException("物料条码数据为空"); |
| | | throw new CoolException("产品条码数据为空"); |
| | | } |
| | | // 保持工作档明细 |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | wrkDetl.setWrkNo(workNo); |
| | | wrkDetl.setIoTime(new Date()); |
| | | wrkDetl.setMatnr(matCode.getMatNo()); // 物料编号 |
| | | wrkDetl.setAnfme((double) dto.getCount()); // 数量 |
| | | wrkDetl.setQty(dto.getCount()); // 数量 |
| | | VersionUtils.setWrkDetl(wrkDetl, matCode); // 版本控制 |
| | | wrkDetl.setBillNo("0"); |
| | | wrkDetl.setSeqNo(0); |
| | | wrkDetl.setZpallet(barcode); // 托盘条码 |
| | | wrkDetl.setAppeUser(userId); |
| | | wrkDetl.setAppeTime(new Date()); |
| | | wrkDetl.setModiUser(userId); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public List<WrkDetl> queryWrkDetl(String matNo, String locNo) { |
| | | return baseMapper.queryWrkDetl(matNo, locNo); |
| | | } |
| | | } |