|
@@ -2,10 +2,16 @@ package com.ruoyi.ams.erp.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.ruoyi.ams.asn.domain.WmsDocAsnDetails;
|
|
|
|
+import com.ruoyi.ams.asn.domain.WmsDocAsnHeader;
|
|
|
|
+import com.ruoyi.ams.asn.service.IWmsDocAsnDetailsService;
|
|
import com.ruoyi.ams.asn.service.IWmsDocAsnHeaderService;
|
|
import com.ruoyi.ams.asn.service.IWmsDocAsnHeaderService;
|
|
import com.ruoyi.ams.erp.domain.ErpBarCodeList;
|
|
import com.ruoyi.ams.erp.domain.ErpBarCodeList;
|
|
import com.ruoyi.ams.erp.domain.ErpOrderList;
|
|
import com.ruoyi.ams.erp.domain.ErpOrderList;
|
|
import com.ruoyi.ams.erp.service.ISyncService;
|
|
import com.ruoyi.ams.erp.service.ISyncService;
|
|
|
|
+import com.ruoyi.ams.order.domain.WmsDocOrderDetails;
|
|
|
|
+import com.ruoyi.ams.order.domain.WmsDocOrderHeader;
|
|
|
|
+import com.ruoyi.ams.order.service.IWmsDocOrderDetailsService;
|
|
import com.ruoyi.ams.order.service.IWmsDocOrderHeaderService;
|
|
import com.ruoyi.ams.order.service.IWmsDocOrderHeaderService;
|
|
import com.ruoyi.base.constant.Constant;
|
|
import com.ruoyi.base.constant.Constant;
|
|
import com.ruoyi.base.domain.BaseSku;
|
|
import com.ruoyi.base.domain.BaseSku;
|
|
@@ -47,6 +53,10 @@ public class SyncServiceImpl implements ISyncService {
|
|
private IWmsDocAsnHeaderService wmsDocAsnHeaderService;
|
|
private IWmsDocAsnHeaderService wmsDocAsnHeaderService;
|
|
@Autowired
|
|
@Autowired
|
|
private IWmsDocOrderHeaderService wmsDocOrderHeaderService;
|
|
private IWmsDocOrderHeaderService wmsDocOrderHeaderService;
|
|
|
|
+ @Autowired
|
|
|
|
+ IWmsDocAsnDetailsService wmsDocAsnDetailsService;
|
|
|
|
+ @Autowired
|
|
|
|
+ IWmsDocOrderDetailsService wmsDocOrderDetailsService;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void syncSkuType() {
|
|
public void syncSkuType() {
|
|
@@ -162,16 +172,58 @@ public class SyncServiceImpl implements ISyncService {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public void callBackAsn() {
|
|
|
|
|
|
+ public void callBackAsn() throws Exception {
|
|
// 查出入库单(单头状态为99,edi_send_flag为空或者为0)
|
|
// 查出入库单(单头状态为99,edi_send_flag为空或者为0)
|
|
- // 查出所有明细
|
|
|
|
- // 循环明细调updateErpOrderStatus方法 setOrderState setOrderName setOrderNo
|
|
|
|
- // 成功之后修改edi_send_flag为1
|
|
|
|
|
|
+ WmsDocAsnHeader wmsDocAsnHeader = new WmsDocAsnHeader();
|
|
|
|
+ wmsDocAsnHeader.setAsnStatus(Constant.ASN_STS.STS99.getValue());
|
|
|
|
+ wmsDocAsnHeader.setEdiSendFlag("N");
|
|
|
|
+ List<WmsDocAsnHeader> wmsDocAsnHeaders = wmsDocAsnHeaderService.selectWmsDocAsnHeaderList(wmsDocAsnHeader);
|
|
|
|
+ for (WmsDocAsnHeader wmsDocAsnHeader1 : wmsDocAsnHeaders) {
|
|
|
|
+ String asnNo = wmsDocAsnHeader1.getAsnNo();
|
|
|
|
+ WmsDocAsnDetails wmsDocAsnDetails = new WmsDocAsnDetails();
|
|
|
|
+ wmsDocAsnDetails.setAsnNo(asnNo);
|
|
|
|
+ // 查出所有明细
|
|
|
|
+ List<WmsDocAsnDetails> wmsDocAsnDetails1 = wmsDocAsnDetailsService.selectWmsDocAsnDetailsList(wmsDocAsnDetails);
|
|
|
|
+ // 循环明细调updateErpOrderStatus方法 setOrderState setOrderName setOrderNo
|
|
|
|
+ for (WmsDocAsnDetails wmsDocAsnDetails2:wmsDocAsnDetails1) {
|
|
|
|
+ ErpOrderList erpOrderList = new ErpOrderList();
|
|
|
|
+ erpOrderList.setOrderNo(wmsDocAsnDetails2.getAsnLineNo().intValue());
|
|
|
|
+ erpOrderList.setOrderName(wmsDocAsnDetails2.getAsnNo());
|
|
|
|
+ erpOrderList.setOrderState("2");
|
|
|
|
+ boolean b = updateErpOrderStatus(erpOrderList);
|
|
|
|
+ // 成功之后修改edi_send_flag为Y
|
|
|
|
+ if (b = true){
|
|
|
|
+ wmsDocAsnHeader1.setEdiSendFlag("Y");
|
|
|
|
+ wmsDocAsnHeaderService.updateWmsDocAsnHeader(wmsDocAsnHeader1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public void callBackOrder() {
|
|
|
|
- // 同入库
|
|
|
|
|
|
+ public void callBackOrder() throws Exception {
|
|
|
|
+ WmsDocOrderHeader wmsDocOrderHeader = new WmsDocOrderHeader();
|
|
|
|
+ wmsDocOrderHeader.setOrderStatus(Constant.ASN_STS.STS99.getValue());
|
|
|
|
+ wmsDocOrderHeader.setEdiSendFlag("N");
|
|
|
|
+ List<WmsDocOrderHeader> wmsDocOrderHeaders = wmsDocOrderHeaderService.selectWmsDocOrderHeaderList(wmsDocOrderHeader);
|
|
|
|
+ for (WmsDocOrderHeader wmsDocOrderHeader1 : wmsDocOrderHeaders) {
|
|
|
|
+ String orderNo = wmsDocOrderHeader1.getOrderNo();
|
|
|
|
+ WmsDocOrderDetails wmsDocOrderDetails = new WmsDocOrderDetails();
|
|
|
|
+ wmsDocOrderDetails.setOrderNo(orderNo);
|
|
|
|
+ List<WmsDocOrderDetails> list = wmsDocOrderDetailsService.selectWmsDocOrderDetailsList(wmsDocOrderDetails);
|
|
|
|
+ for (WmsDocOrderDetails wmsDocOrderDetails1:list) {
|
|
|
|
+ ErpOrderList erpOrderList = new ErpOrderList();
|
|
|
|
+ erpOrderList.setOrderNo(wmsDocOrderDetails1.getOrderLineNo().intValue());
|
|
|
|
+ erpOrderList.setOrderName(wmsDocOrderDetails1.getOrderNo());
|
|
|
|
+ erpOrderList.setOrderState("2");
|
|
|
|
+ boolean b = updateErpOrderStatus(erpOrderList);
|
|
|
|
+ // 成功之后修改edi_send_flag为Y
|
|
|
|
+ if (b = true){
|
|
|
|
+ wmsDocOrderHeader1.setEdiSendFlag("Y");
|
|
|
|
+ wmsDocOrderHeaderService.updateWmsDocOrderHeader(wmsDocOrderHeader1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+}
|