|  |  |  | 
|---|
|  |  |  | import com.zy.asrs.mapper.WrkDetlMapper; | 
|---|
|  |  |  | import com.zy.asrs.service.MatService; | 
|---|
|  |  |  | import com.zy.asrs.service.WrkDetlService; | 
|---|
|  |  |  | import com.zy.asrs.utils.MatUtils; | 
|---|
|  |  |  | import com.zy.common.model.DetlDto; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @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; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //计算辅单位 | 
|---|
|  |  |  | Double weight = MatUtils.calcWeight(matnr, anfme); | 
|---|
|  |  |  | 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); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public boolean updateBarcode(Integer wrkNo, String barcode) { | 
|---|
|  |  |  | return this.baseMapper.updateBarcode(wrkNo, barcode) > 0; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|