|  |  | 
 |  |  | import com.zy.asrs.utils.SaasUtils; | 
 |  |  | import com.zy.common.model.LocDto; | 
 |  |  | import com.zy.system.entity.User; | 
 |  |  | import org.springframework.beans.BeanUtils; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.stereotype.Service; | 
 |  |  | import org.springframework.transaction.annotation.Transactional; | 
 |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public ManLocDetl selectItem(String locNo, String matnr, String batch) { | 
 |  |  |         return this.baseMapper.selectItem(locNo, matnr, batch); | 
 |  |  |     public ManLocDetl selectItem(String locNo, String matnr, String batch, String csocode, String isoseq, String containerCode) { | 
 |  |  |         return this.baseMapper.selectItem(locNo, matnr, batch,csocode,isoseq,containerCode); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  | 
 |  |  |     public void adjustLocDetl(LocDetlAdjustParam param, Long userId, User user) { | 
 |  |  |         Date now = new Date(); | 
 |  |  |         for (LocDetlAdjustParam.LocDetlAdjust locDetlAdjust : param.getList()) { | 
 |  |  |             ManLocDetl manLocDetl = this.baseMapper.selectItem(param.getLocNo(), locDetlAdjust.getMatnr(), locDetlAdjust.getBatch()); | 
 |  |  |             ManLocDetl manLocDetl = this.baseMapper.selectItem(param.getLocNo(), locDetlAdjust.getMatnr(), locDetlAdjust.getBatch(),locDetlAdjust.getThreeCode(),locDetlAdjust.getDeadTime(),locDetlAdjust.getSuppCode()); | 
 |  |  |  | 
 |  |  |             if(Cools.isEmpty(manLocDetl)){ | 
 |  |  |                 addManlocDetl(locDetlAdjust,param.getLocNo()); | 
 |  |  |                 continue; | 
 |  |  |             } | 
 |  |  |  | 
 |  |  |             this.baseMapper.delete(new EntityWrapper<ManLocDetl>() | 
 |  |  |                     .eq("loc_no", param.getLocNo()).eq("matnr",locDetlAdjust.getMatnr())); | 
 |  |  |             Mat mat = matService.selectOne(new EntityWrapper<Mat>() | 
 |  |  | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     private void addManlocDetl(LocDetlAdjustParam.LocDetlAdjust param, String locNo){ | 
 |  |  |         Date now = new Date(); | 
 |  |  |         ManLocDetl manLocDetl = new ManLocDetl(); | 
 |  |  |         Node node = nodeService.selectOne(new EntityWrapper<Node>().eq("name", locNo)); | 
 |  |  |         Mat mat = matService.selectByMatnr(param.getMatnr()); | 
 |  |  |         BeanUtils.copyProperties(mat,manLocDetl); | 
 |  |  |         manLocDetl.setNodeId(node.getId()); | 
 |  |  |         manLocDetl.setBatch(param.getBatch()); | 
 |  |  |         manLocDetl.setAnfme(param.getCount()); | 
 |  |  |         manLocDetl.setContainerCode(param.getSuppCode()); | 
 |  |  |         manLocDetl.setCsocode(param.getThreeCode()); | 
 |  |  |         manLocDetl.setIsoseq(param.getDeadTime()); | 
 |  |  |         manLocDetl.setCreateTime(now); | 
 |  |  |         manLocDetl.setModiTime(now); | 
 |  |  |         manLocDetl.setLocNo(locNo); | 
 |  |  |         manLocDetl.setStatus(1); | 
 |  |  |         this.insert(manLocDetl); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } |