| | |
| | | import com.zy.common.model.MesCombParam; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.third.entity.ExdInstockSource; |
| | | import com.zy.third.entity.ExdStock; |
| | | import com.zy.third.entity.ExdvYanbu; |
| | | import com.zy.third.mapper.ExdMaterialMapper; |
| | | import com.zy.third.mapper.ExdStockMapper; |
| | | import com.zy.third.service.ExdInstockSourceService; |
| | | import com.zy.third.service.ExdMaterialService; |
| | | import com.zy.third.service.ExdStockService; |
| | | import lombok.Data; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private OrderService orderService; |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | @Autowired |
| | | private OrderDetl1Service orderDetl1Service; |
| | | @Autowired |
| | | private BasDevpService basDevpService; |
| | | @Autowired |
| | |
| | | private ManLocDetlService manLocDetlService; |
| | | @Autowired |
| | | private ManLocDetlMapper manLocDetlMapper; |
| | | @Autowired |
| | | private ExdMaterialMapper exdMaterialMapper; |
| | | @Autowired |
| | | private ExdStockMapper exdStockMapper; |
| | | @Autowired |
| | | private ExdStockService exdStockService; |
| | | @Autowired |
| | | private ExdInstockSourceService exdInstockSourceService; |
| | | |
| | | |
| | | @Override |
| | |
| | | //进行批号筛选,批号只能唯一 |
| | | Set<String> batchs = new HashSet<>(); |
| | | List<String> strings = new ArrayList<>(); |
| | | |
| | | |
| | | long time = new Date().getTime(); |
| | | //生产入库对一坨物料进行绑定。唯一值 |
| | | String fbillno = param.getBarcode()+"--"+time; |
| | | for (CombParam.CombMat mat : param.getCombMats()) { |
| | | if (Cools.isEmpty(mat.getBatch())) { |
| | | continue; |
| | |
| | | waitPakin.setModiUser(userId); |
| | | waitPakin.setColor(userId+""); |
| | | waitPakin.setModiTime(now); |
| | | waitPakin.setBrand(param.getCk());//仓库 |
| | | //生产入库对一坨物料进行绑定。唯一值 |
| | | waitPakin.setOrigin(fbillno); |
| | | ExdvYanbu barcode1 = exdMaterialMapper.getBacode(detlDto.getBc()); |
| | | String pid="03.98"; |
| | | if(!Cools.isEmpty(barcode1)&&!Cools.isEmpty(barcode1.getProdinkind())){ |
| | | pid=barcode1.getProdinkind(); |
| | | } |
| | | ExdStock id = exdStockService.selectOne(new EntityWrapper<ExdStock>().eq("Fnumber", pid)); |
| | | waitPakin.setBrand(id.getFname());//仓库 |
| | | waitPakin.setInspect(param.isType() ? 1 : 0); |
| | | if (i == 1) { |
| | | // 0:不需要补空托盘 |
| | |
| | | * 3:AGV任务完成 |
| | | * 4:给输送线下发入库指令 |
| | | */ |
| | | waitPakin.setBeBatch(param.getBeBatch()); |
| | | waitPakin.setBeBatch(Cools.isEmpty(param.getRsta())?0:1); |
| | | waitPakin.setSuppCode(param.getBarcode()); |
| | | } |
| | | i++; |
| | |
| | | throw new CoolException(orderDetl.getMatnr() + "入库数量不合法"); |
| | | } |
| | | // 修改订单作业数量 |
| | | if (!orderDetlService.increaseWorkQty2(order.getId(), elem.getMatnr(), elem.getBatch(), elem.getAnfme(), fxId)) { |
| | | if (!orderDetlService.increaseWorkQty2(order.getId(), elem.getMatnr(), elem.getBatch(), elem.getAnfme(), userId)) { |
| | | throw new CoolException("修改单据作业数量失败"); |
| | | } |
| | | // 修改子单订单作业数量 |
| | | if (!orderDetl1Service.increaseWorkQty2(order.getId(), elem.getMatnr(), elem.getBatch(), elem.getAnfme(), userId)) { |
| | | throw new CoolException("修改单据作业数量失败"); |
| | | } |
| | | |
| | |
| | | waitPakin.setModiUser(userId); |
| | | waitPakin.setModiTime(now); |
| | | waitPakin.setColor(userId+""); |
| | | waitPakin.setBrand(param.getCk());//仓库 |
| | | |
| | | OrderDetl orderDetl = orderDetlService.selectOne(new EntityWrapper<OrderDetl>() |
| | | .eq("matnr", detlDto.getMatnr()).eq("order_no", order.getOrderNo()) |
| | | .eq("batch", detlDto.getBatch())); |
| | | waitPakin.setBrand(orderDetl.getBrand());//仓库 |
| | | waitPakin.setInspect(param.isType() ? 1 : 0); |
| | | if (i == 1) { |
| | | // 0:不需要补空托盘 |
| | |
| | | } |
| | | } |
| | | orderService.updateSettle(order.getId(), 2L, userId); |
| | | List<ExdInstockSource> fBillNo = exdInstockSourceService.selectList(new EntityWrapper<ExdInstockSource>().eq("FBillNo", order.getOrderNo())); |
| | | if(fBillNo != null){ |
| | | for(ExdInstockSource exdInstockSource : fBillNo){ |
| | | exdInstockSource.setStatus(10); |
| | | exdInstockSourceService.updateById(exdInstockSource); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |