| | |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.entity.Pla; |
| | | import com.zy.asrs.entity.PlaQty; |
| | | import com.zy.asrs.entity.param.GlobleParameter; |
| | | import com.zy.asrs.mapper.PlaMapper; |
| | | import com.zy.asrs.service.PlaQtyService; |
| | | import com.zy.asrs.service.PlaService; |
| | | import com.zy.asrs.utils.SaasUtils; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.system.entity.User; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | if(!Cools.isEmpty(orderDetl.getBrand())){ |
| | | wrapper.eq("package_no",orderDetl.getBrand()); |
| | | } |
| | | wrapper.eq("status","已入库"); |
| | | wrapper.eq("status", GlobleParameter.PLA_STATUS_1); |
| | | wrapper.ge("finger_melting", orderDetl.getFingerMeltingMin()).le("finger_melting", orderDetl.getFingerMeltingMax()); |
| | | wrapper.ge("fusing_point", orderDetl.getFusingPointMin()).le("fusing_point", orderDetl.getFusingPointMax()); |
| | | wrapper.ge("yellowness", orderDetl.getYellownessMin()).le("yellowness", orderDetl.getYellownessMax()); |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | //退回 |
| | | public void returned(List<PlaQty> plaQties, User user) { |
| | | plaQties.forEach(plaQty -> { |
| | | PlaQty plaQtyOut = plaQtyService.selectById(plaQty.getId()); |
| | | if(Cools.isEmpty(plaQtyOut.getReturned())){ |
| | | plaQtyOut.setReturned(plaQty.getOrderWeight()); |
| | | }else { |
| | | plaQtyOut.setReturned(plaQty.getOrderWeight()+plaQtyOut.getReturned()); |
| | | } |
| | | plaQtyService.updateById(plaQtyOut); |
| | | |
| | | PlaQty plaQtyReturned = new PlaQty(); |
| | | plaQtyReturned.setBatch(plaQtyOut.getBatch()); |
| | | plaQtyReturned.setPackageNo(plaQtyOut.getPackageNo()); |
| | | plaQtyReturned.setCreateTime(new Date()); |
| | | plaQtyReturned.setLocNo(plaQtyOut.getLocNo()); |
| | | plaQtyReturned.setOrderNo(plaQtyOut.getOrderNo()); |
| | | plaQtyReturned.setPakoutTime(Utils.getDateStr(new Date())); |
| | | plaQtyReturned.setOrderWeight(plaQty.getOrderWeight()); |
| | | plaQtyReturned.setTransfer("退回入库"); |
| | | plaQtyReturned.setHandlerBy(user.getUsername()); |
| | | plaQtyReturned.setCustomer(plaQtyOut.getCustomer()); |
| | | plaQtyReturned.setMemo(plaQty.getMemo()); |
| | | plaQtyService.insert(plaQtyReturned); |
| | | |
| | | //直接更新pla的库存 |
| | | Pla pla = this.selectByBatchAndPackageNo(plaQty.getBatch(), plaQty.getPackageNo()); |
| | | //pla.setStatus(GlobleParameter.PLA_STATUS_0); |
| | | |
| | | pla.setWeightAnfme(plaQty.getOrderWeight()); |
| | | pla.setStatus(GlobleParameter.PLA_STATUS_1); |
| | | this.updateById(pla); |
| | | |
| | | SaasUtils.insertLog(0,pla.getLocNo(),pla.getBatch()+","+pla.getPackageNo(),plaQty.getOrderWeight(),user.getUsername()); |
| | | |
| | | }); |
| | | } |
| | | } |