|
|
@@ -45,14 +45,15 @@ public class ERPServiceImpl implements ERPService {
|
|
|
Map<String,Object> retMap = new HashMap<>();
|
|
|
retMap.put("success",true);
|
|
|
logger.info("sendProd-Begin:master {} ids {}",master,ids);
|
|
|
+ vwmsConfig.setEv(docCommonService.getMasterEv(master));
|
|
|
// SpObserver.putSp(master);//没有用
|
|
|
// 执行查询
|
|
|
SqlRowList docMsg = baseDao.queryForRowSet(" select pr_id,pr_code,pr_ycxh,pr_ycxhin,pr_detail,pr_orispeccode,pr_brand,pr_unit,pr_zxbzs,nvl(pr_sendwmsflag,0) pr_sendwmsflag " +
|
|
|
- " from DATACENTER_P.product left join DATACENTER_P.productbrand on pb_name = pr_brand where pr_id in ("+ids+") and pb_sendwms = -1 ");
|
|
|
+ " from "+vwmsConfig.getDC_MASTER()+".product left join "+vwmsConfig.getDC_MASTER()+".productbrand on pb_name = pr_brand where pr_id in ("+ids+") and pb_sendwms = -1 ");
|
|
|
if(!docMsg.hasNext()){
|
|
|
- baseDao.execute("update DATACENTER_P.product set pr_sendwmsstatus='同步失败',pr_sendwmserr='没有需要同步的商品(品牌需设置对接MWS)。' where pr_id IN ("+ids+")");
|
|
|
+ baseDao.execute("update "+vwmsConfig.getDC_MASTER()+".product set pr_sendwmsstatus='同步失败',pr_sendwmserr='没有需要同步的商品(品牌需设置对接WMS)。' where pr_id IN ("+ids+")");
|
|
|
retMap.put("success",false);
|
|
|
- retMap.put("message","没有需要同步的商品(品牌需设置对接MWS)。");
|
|
|
+ retMap.put("message","没有需要同步的商品(品牌需设置对接WMS)。");
|
|
|
return retMap;
|
|
|
}
|
|
|
List<Map<String, Object>> docMsgResultList = docMsg.getResultList();
|
|
|
@@ -107,10 +108,9 @@ public class ERPServiceImpl implements ERPService {
|
|
|
Map<String, Object> retMap = new HashMap<>();
|
|
|
if(CollectionUtil.isEmpty(list)){
|
|
|
retMap.put("success",false);
|
|
|
- retMap.put("message","没有需要同步的商品(品牌需设置对接MWS)。");
|
|
|
+ retMap.put("message","没有需要同步的商品(品牌需设置对接WMS)。");
|
|
|
return retMap;
|
|
|
}
|
|
|
- vwmsConfig.setEv(docCommonService.getMasterEv(master));
|
|
|
String outBizCode = "sendProd-"+System.currentTimeMillis();
|
|
|
for (Map<String, Object> map : list) {
|
|
|
// 创建ProductReq对象
|
|
|
@@ -242,6 +242,7 @@ public class ERPServiceImpl implements ERPService {
|
|
|
Map<String,Object> retMap = new HashMap<>();
|
|
|
retMap.put("success",true);
|
|
|
logger.info("sendVend-Begin:master {} ids {}",master,ids);
|
|
|
+ vwmsConfig.setEv(docCommonService.getMasterEv(master));
|
|
|
// 执行查询
|
|
|
SqlRowList docMsg = baseDao.queryForRowSet(" select nvl(ve_sendwmsflag,0) sendwmsflag,ve_id,ve_code,ve_name,ve_shortname,ve_add1," +
|
|
|
"vc_id,(case when nvl(vc_isvendor,0) = 0 then 0 else 1 end ) vc_isvendor,vc_name,vc_officeemail,vc_mobile " +
|
|
|
@@ -340,10 +341,9 @@ public class ERPServiceImpl implements ERPService {
|
|
|
Map<String, Object> retMap = new HashMap<>();
|
|
|
if(CollectionUtil.isEmpty(list)){
|
|
|
retMap.put("success",false);
|
|
|
- retMap.put("message","没有需要同步的商品(品牌需设置对接MWS)。");
|
|
|
+ retMap.put("message","没有需要同步的商品(品牌需设置对接WMS)。");
|
|
|
return retMap;
|
|
|
}
|
|
|
- vwmsConfig.setEv(docCommonService.getMasterEv(master));
|
|
|
String outBizCode = "sendVend-"+System.currentTimeMillis();
|
|
|
for (Vendor vend : list) {
|
|
|
// 创建Req对象
|
|
|
@@ -482,6 +482,7 @@ public class ERPServiceImpl implements ERPService {
|
|
|
Map<String,Object> retMap = new HashMap<>();
|
|
|
retMap.put("success",true);
|
|
|
logger.info("sendCust-Begin:master {} ids {}",master,ids);
|
|
|
+ vwmsConfig.setEv(docCommonService.getMasterEv(master));
|
|
|
// 执行查询
|
|
|
SqlRowList docMsg = baseDao.queryForRowSet(" select nvl(cu_sendwmsflag,0) sendwmsflag,cu_id,cu_code,cu_name,cu_shortname," +
|
|
|
"ca_id,(case when nvl(ca_remark,' ') = '是' then 1 else 0 end ) isDefault,ca_person,ca_phone,ca_address " +
|
|
|
@@ -578,7 +579,6 @@ public class ERPServiceImpl implements ERPService {
|
|
|
retMap.put("message","没有需要同步的客户。");
|
|
|
return retMap;
|
|
|
}
|
|
|
- vwmsConfig.setEv(docCommonService.getMasterEv(master));
|
|
|
String outBizCode = "sendCust-"+System.currentTimeMillis();
|
|
|
for (Customer cust : list) {
|
|
|
// 创建Req对象
|
|
|
@@ -715,8 +715,9 @@ public class ERPServiceImpl implements ERPService {
|
|
|
Map<String,Object> retMap = new HashMap<>();
|
|
|
retMap.put("success",true);
|
|
|
logger.info("sendIO-Begin:master {} id {}",master,id);
|
|
|
+ vwmsConfig.setEv(docCommonService.getMasterEv(master));
|
|
|
// 执行查询
|
|
|
- if(!baseDao.checkIf(master+".prodiodetail left join DATACENTER_P.product on pr_code = pd_prodcode left join DATACENTER_P.productbrand on pb_name = pr_brand "
|
|
|
+ if(!baseDao.checkIf(master+".prodiodetail left join "+vwmsConfig.getDC_MASTER()+".product on pr_code = pd_prodcode left join "+vwmsConfig.getDC_MASTER()+".productbrand on pb_name = pr_brand "
|
|
|
,"pd_piid = "+id+" and pb_sendwms = -1"
|
|
|
)){
|
|
|
logger.info("sendIO-End:master {} id {} res {}",master,id,"没有需要对接的明细。");
|
|
|
@@ -745,7 +746,6 @@ public class ERPServiceImpl implements ERPService {
|
|
|
retMap.put("message","WMS单据类型为空或异常,不允许同步。");
|
|
|
return retMap;
|
|
|
}
|
|
|
- vwmsConfig.setEv(docCommonService.getMasterEv(master));
|
|
|
//构建请求主体
|
|
|
String masterName = prodInOut.getCurrentMasterName();
|
|
|
Long piId = prodInOut.getPiId();
|
|
|
@@ -784,6 +784,7 @@ public class ERPServiceImpl implements ERPService {
|
|
|
retMap.put("success",true);
|
|
|
String eMsg = null;
|
|
|
logger.info("sendIO-cancel-Begin:master {} id {} cancelReason {}",master,id,cancelReason);
|
|
|
+ vwmsConfig.setEv(docCommonService.getMasterEv(master));
|
|
|
// 执行查询
|
|
|
if(!baseDao.checkIf(master+".prodinout","pi_id = "+id+" and nvl(pi_sendwmsflag,0) = -1")){
|
|
|
logger.info("sendIO-cancel-End:master {} id {} res {}",master,id,"单据不存在或尚未同步到WMS。");
|
|
|
@@ -797,7 +798,6 @@ public class ERPServiceImpl implements ERPService {
|
|
|
retMap.put("message","单据已确认采集,不允许取消。");
|
|
|
return retMap;
|
|
|
}
|
|
|
- vwmsConfig.setEv(docCommonService.getMasterEv(master));
|
|
|
Long piId = prodInOut.getPiId();
|
|
|
BaseReq<OrderVastRequest<OrderCancel>> req = new BaseReq();
|
|
|
OrderVastRequest<OrderCancel> cancelReq = new OrderVastRequest();
|
|
|
@@ -858,11 +858,11 @@ public class ERPServiceImpl implements ERPService {
|
|
|
Map<String, Object> resMap = new HashMap<>();
|
|
|
resMap.put("success",true);
|
|
|
logger.info("sendStockData-Begin master {} emCode {} ",master,emCode);
|
|
|
- List<StockData> stockDataList = baseDao.getJdbcTemplate().query("SELECT * FROM "+master+".SCM_KCZLB_WMS_VIEW ",
|
|
|
+ vwmsConfig.setEv(docCommonService.getMasterEv(master));
|
|
|
+ List<StockData> stockDataList = baseDao.getJdbcTemplate().query("SELECT * FROM "+vwmsConfig.getDC_MASTER()+".SCM_KCZLB_WMS_VIEW ",
|
|
|
new BeanPropertyRowMapper<>(StockData.class));
|
|
|
String dataNo = "";
|
|
|
if(!CollectionUtil.isEmpty(stockDataList)){
|
|
|
- vwmsConfig.setEv(docCommonService.getMasterEv(master));
|
|
|
// 每1000条分批处理
|
|
|
int batchSize = 1000;
|
|
|
int totalSize = stockDataList.size();
|