| | |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.CombParam; |
| | | import com.zy.asrs.entity.param.MobileAdjustNewParam; |
| | | import com.zy.asrs.entity.param.MobileAdjustParam; |
| | | import com.zy.asrs.entity.param.OffSaleParam; |
| | | import com.zy.asrs.entity.param.*; |
| | | import com.zy.asrs.mapper.ManLocDetlMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.SaasUtils; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.model.DetlDto; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.common.utils.Synchro; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.service.SaasLogService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private LocOwnerService locOwnerService; |
| | | @Autowired |
| | | private PlaService plaService; |
| | | @Autowired |
| | | private PlaQtyService plaQtyService; |
| | | @Autowired |
| | | private SaasLogService saasLogService; |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void plaPakin(String locNo, String batch, String packageNo) { |
| | | public void plaPakin(String locNo, String batch, String packageNo,User user) { |
| | | Pla pla = plaService.selectByBatchAndPackageNo(batch, packageNo); |
| | | if("已入库".equals(pla.getStatus())){ |
| | | throw new CoolException("该物料已入库"); |
| | | if(Cools.isEmpty(pla)){ |
| | | throw new CoolException("系统未检测到该包物料信息,请重新录入"); |
| | | } |
| | | pla.setStatus("已入库"); |
| | | |
| | | if(!pla.getStatus().equals(GlobleParameter.PLA_STATUS_0)){ |
| | | throw new CoolException("该物料状态不为待入库,无法入库"); |
| | | } |
| | | |
| | | pla.setStatus(GlobleParameter.PLA_STATUS_1); |
| | | pla.setModifyTime(new Date()); |
| | | pla.setPakinTime(new Date()); |
| | | |
| | | Node node = nodeService.selectByUuid(locNo); |
| | | if(Cools.isEmpty(node)){ |
| | | throw new CoolException("库位信息不正确"); |
| | | } |
| | | |
| | | pla.setStash(node.getParentName()); |
| | | pla.setLocNo(node.getUuid()); |
| | | |
| | | plaService.updateById(pla); |
| | | SaasUtils.insertLog(0,locNo,batch+","+packageNo,pla.getWeightAnfme(),user.getUsername()); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void plaPakout(String locNo, String batch, String packageNo, String orderNo, String orderDetlId, String wrkNo, Double anfme) { |
| | | Pla pla = plaService.selectByBatchAndPackageNo(batch, packageNo); |
| | | //Order order = orderService.selectByNo(orderNo); |
| | | OrderDetl orderDetl = orderDetlService.selectById(orderDetlId); |
| | | |
| | | ManPakOut manPakOut = manPakOutService.selectById(wrkNo); |
| | | |
| | | PlaQty plaQty = plaQtyService.selectById(orderDetlId); |
| | | |
| | | //更新拣货单信息 |
| | | if(manPakOut.getCount() + anfme > manPakOut.getAnfme()){ |
| | | throw new CoolException("拣货重量大于拣货单所需拣货重量,请重新分配拣货重量"); |
| | | } |
| | | if(manPakOut.getStatus() == 1){ |
| | | throw new CoolException("该拣料单已出库"); |
| | | } |
| | | manPakOut.setCount(manPakOut.getCount() + anfme); |
| | | if (manPakOut.getAnfme().equals(manPakOut.getCount())){ |
| | |
| | | manPakOutService.updateById(manPakOut); |
| | | } |
| | | |
| | | //更新单据明细 |
| | | orderDetl.setQty(orderDetl.getQty() + anfme); |
| | | orderDetlService.updateById(orderDetl); |
| | | |
| | | //更新单据信息 |
| | | orderService.checkComplete(orderNo); |
| | | //更新plaQty信息 |
| | | plaQty.setPakoutTime(Utils.getDateStr(new Date())); |
| | | plaQtyService.updateById(plaQty); |
| | | |
| | | //更新pla明细 |
| | | pla.setWeightAnfme(pla.getWeightAnfme() - anfme); |
| | | pla.setQtyAnfme(pla.getQtyAnfme() - anfme); |
| | | if(pla.getWeightAnfme() <= 0){ |
| | | pla.setStatus("全部出库"); |
| | | pla.setStatus(GlobleParameter.PLA_STATUS_4); |
| | | }else { |
| | | pla.setStatus("部分出库"); |
| | | pla.setStatus(GlobleParameter.PLA_STATUS_3); |
| | | } |
| | | plaService.updateById(pla); |
| | | SaasUtils.insertLog(1,locNo,batch+","+packageNo,anfme,null); |
| | | |
| | | //更新订单明细 |
| | | Order order = orderService.selectByNo(orderNo); |
| | | OrderDetl orderDetl = orderDetlService.selectById(plaQty.getOrderDetlId()); |
| | | |
| | | orderDetl.setQty(orderDetl.getQty() + anfme); |
| | | orderDetlService.updateById(orderDetl); |
| | | |
| | | orderService.checkComplete(orderNo); |
| | | |
| | | } |
| | | } |