| | |
| | | |
| | | @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)){ |
| | |
| | | if (anfme <= 0) { |
| | | return this.baseMapper.deleteItem(wrkNo, matnr, batch) > 0; |
| | | } else { |
| | | return baseMapper.updateAnfme(anfme, wrkNo, matnr, batch) > 0; |
| | | boolean result = baseMapper.updateAnfme(anfme, wrkNo, matnr, batch) > 0; |
| | | if (!result) { |
| | | return false; |
| | | } |
| | | |
| | | //更新辅料 |
| | | Mat mat = matService.selectByMatnr(matnr); |
| | | if (mat == null) { |
| | | return false; |
| | | } |
| | | |
| | | //转换关系 |
| | | String origin = mat.getOrigin(); |
| | | if (Cools.isEmpty(origin)) { |
| | | return true; |
| | | } |
| | | String[] split = origin.split("/"); |
| | | //辅单位 |
| | | Double weight = (anfme / Double.parseDouble(split[1])) / Double.parseDouble(split[0]); |
| | | return baseMapper.updateWeight(weight, wrkNo, matnr, batch) > 0; |
| | | } |
| | | } |
| | | |
| | |
| | | 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 List<WrkDetl> selectAndLogByOrderNoGroupByMatnrOfSum(String orderNo) { |
| | | return this.baseMapper.selectAndLogByOrderNoGroupByMatnrOfSum(orderNo); |
| | | } |
| | | } |