| | |
| | | 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; |
| | |
| | | Date now = new Date(); |
| | | for (LocDetlAdjustParam.LocDetlAdjust locDetlAdjust : param.getList()) { |
| | | ManLocDetl manLocDetl = this.baseMapper.selectItem(param.getLocNo(), locDetlAdjust.getMatnr(), locDetlAdjust.getBatch()); |
| | | |
| | | 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); |
| | | } |
| | | |
| | | } |