|
@@ -53,6 +53,9 @@ public class WarehousingServiceImpl implements WarehousingService {
|
|
|
@Autowired
|
|
|
private ReceiveGoodsMapper receiveGoodsMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private DeliveryMapper deliveryMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public Map<String, Object> getRecommend(String wllbCode, String suppId, String num, String unique, String producDate, String warehouseWhere, String wbs, String accountSleeve) {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
@@ -1047,6 +1050,105 @@ public class WarehousingServiceImpl implements WarehousingService {
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @Description: 产成品报工单处理
|
|
|
+ * @Param: Notice
|
|
|
+ * @return: Map<String, Object>
|
|
|
+ * @Author: XiaoChen
|
|
|
+ * @Date: 2023/4/28
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public Map<String, Object> addDisposeNotice(Notice notice) {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ try {
|
|
|
+ //新增返回gs信息
|
|
|
+ String removalCode = codeGenerateRk();
|
|
|
+ //新增产成品入库流水
|
|
|
+ //入库流水
|
|
|
+ Notice notice1 = warehousingMapper.getNoticeId(notice);
|
|
|
+ WarehousingVirtual warehousingVirtual = new WarehousingVirtual()
|
|
|
+ .setWllbCode(notice1.getMaterialCode())
|
|
|
+ .setUserId(notice.getUserId())
|
|
|
+ .setStorageLocationCode(notice.getStorageLocationCode())
|
|
|
+ .setProducDate(notice.getProducBatch())
|
|
|
+ .setNum(notice.getWarehousingNum())
|
|
|
+ .setSerial(notice.getSerial())
|
|
|
+ .setSeq(notice.getSeq())
|
|
|
+ .setAttribute(notice.getAttribute())
|
|
|
+ .setStorageCode(removalCode)
|
|
|
+ .setWbs(notice.getWbs())
|
|
|
+ .setAccountSleeve(notice1.getCompanyNumber())
|
|
|
+ .setProductionCode(notice1.getProductionCode());
|
|
|
+ warehousingMapper.addHalf(warehousingVirtual);//入库流水 产成品
|
|
|
+ //新增gs返回信息 入库
|
|
|
+ ReturnWarehousing returnWarehousing = new ReturnWarehousing()
|
|
|
+ .setStorageCode(removalCode)//入库编号
|
|
|
+ .setSourceType(notice1.getSourceType())//来源类型
|
|
|
+ .setMoveType(notice1.getMoveType())//移动类型
|
|
|
+ .setOrderNumber(notice1.getNoticeId())//通知单id
|
|
|
+ .setWbs(notice1.getWbs())//wbs
|
|
|
+ .setEntryNumber(notice1.getEntryNumber())//gs分录号
|
|
|
+ .setMaterialId(notice1.getMaterialId())//物料id
|
|
|
+ .setId(notice1.getId())//分录单id
|
|
|
+ .setWarehousingNum(warehousingVirtual.getNum())//入库数量
|
|
|
+ .setUserName(notice.getUserName())//用户名称
|
|
|
+ .setStorageLocationCode(warehousingVirtual.getStorageLocationCode());//入库库位
|
|
|
+ warehousingMapper.addReturnWarehousing(returnWarehousing);
|
|
|
+
|
|
|
+ // 出库
|
|
|
+ String removalCodes = codeGenerateCk();
|
|
|
+ for (AskGoods askGoodsGs : askGoodsMapper.getAskGoodsVitrual(notice.getUniqueCode(), notice.getType())) {
|
|
|
+ askGoodsGs.setStorageCode(removalCodes);
|
|
|
+ askGoodsGs.setCompanyNumber(askGoodsGs.getAccountSleeve());
|
|
|
+ //判断物料是否录入
|
|
|
+ MaterialClass materialClass = warehousingMapper.getMateriaIsExist(askGoodsGs.getWllbCode());
|
|
|
+ //查询销售单部分信息
|
|
|
+ Delivery delivery = new Delivery().setDeliveryId(notice.getDeliveryId()).setMaterialId(materialClass.getTldId());
|
|
|
+ List<Delivery> list = deliveryMapper.getDelivery(delivery);
|
|
|
+ if (materialClass.getPartType().equals("产成品")) {
|
|
|
+ //产成品销售流水
|
|
|
+ Delivery delivery1 = new Delivery()
|
|
|
+ .setMaterialCode(askGoodsGs.getWllbCode()) //物料code
|
|
|
+ .setOutNum(askGoodsGs.getNum()) //出库数量
|
|
|
+ .setUserId(askGoodsGs.getUserId()) //用户id
|
|
|
+ .setDeliveryId(notice.getDeliveryId()) //销售单id
|
|
|
+ .setCompanyNumber(list.get(0).getCompanyNumber()) //公司编号
|
|
|
+ .setCustomerCode(list.get(0).getCustomerCode())//客户编号
|
|
|
+ .setStorageCode(removalCodes) //出库流水
|
|
|
+ .setWbs(list.get(0).getWbs());// wbs
|
|
|
+ deliveryMapper.addRemovalHalf(delivery1); //流水录入
|
|
|
+ }
|
|
|
+ ReturRemoval returRemoval = new ReturRemoval()
|
|
|
+ .setMaterialId(materialClass.getTldId())
|
|
|
+ .setDocumentId(notice.getDeliveryId())
|
|
|
+ .setWbs(list.get(0).getWbs())
|
|
|
+ .setNum(askGoodsGs.getNum())
|
|
|
+ .setEntryNumber(list.get(0).getEntryNumber())
|
|
|
+ .setDocumentPointsId(list.get(0).getId())
|
|
|
+ .setStorageLocationCode(askGoodsGs.getStorageLocationCode());
|
|
|
+ askGoodsMapper.addReturnGsRemoval(returRemoval);//新增返回gs数据子表信息
|
|
|
+ }
|
|
|
+ //新增销售单出库父表信息
|
|
|
+ Delivery delivery = deliveryMapper.getDeliveryF(notice.getDeliveryId());
|
|
|
+ ReturRemoval returRemoval1 = new ReturRemoval()
|
|
|
+ .setDocumentId(delivery.getDeliveryId())
|
|
|
+ .setRemovalCode(removalCodes)
|
|
|
+ .setSourceType(delivery.getSourceType())
|
|
|
+ .setMoveType(delivery.getMoveType())
|
|
|
+ .setDeliveryType(delivery.getDeliveryType());
|
|
|
+ askGoodsMapper.addReturnGsRemovalF(returRemoval1);//新增返回gs数据父表信息
|
|
|
+ map.put("dataAgo", removalCode);//入库
|
|
|
+ map.put("dataBack", removalCodes);//出库
|
|
|
+ map.put("msg", "200");
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ map.put("msg", "500");
|
|
|
+ map.put("errMsg", "服务器请求异常,请稍后再试");
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 入库单生成
|