From f9fa5dbc3ea17487769ca48358761cbdeec6c5fa Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期三, 11 六月 2025 15:15:28 +0800
Subject: [PATCH] 代码初始化
---
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/WmsServiceImpl.java | 101 ++++++++++++++++++++++++++++++++------------------
1 files changed, 65 insertions(+), 36 deletions(-)
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/WmsServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/WmsServiceImpl.java
index fc38bc6..43ba7ce 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/WmsServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/WmsServiceImpl.java
@@ -28,6 +28,7 @@
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
+import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -83,7 +84,6 @@
@Override
public WmsBaseResponse<WmsBaseDataResponse> orderPlatformBind(PlatformJob job) {
if(StringUtils.isBlank(job.getBillCode()) || StringUtils.isBlank(job.getPlatformWmsCode())){
-
return null;
}
int type = 0;
@@ -98,51 +98,79 @@
}else{
return null;
}
- WmsOrderPlatformRequest param = new WmsOrderPlatformRequest();
- param.setData(new ArrayList<>());
-
List<PlatformWmsDetail> platformWmsDetailList = platformWmsDetailMapper.selectList(new QueryWrapper<PlatformWmsDetail>().lambda()
.eq(PlatformWmsDetail::getJobId,job.getId())
.eq(PlatformWmsDetail::getIsdeleted,Constants.ZERO)
);
+ String url = type == 0?systemDictDataBiz.queryByCode(Constants.WMS_PARAM,Constants.WMS_INBOUND_PLATFROM_URL).getCode():
+ systemDictDataBiz.queryByCode(Constants.WMS_PARAM,Constants.WMS_OUTBOUND_PLATFROM_URL).getCode();;
+ String name = type ==0?"銆怶MS銆戝叆搴撲綔涓氬崟鍒嗛厤鏈堝彴":"銆怶MS銆戝嚭搴撲綔涓氱殑鍒嗛厤鏈堝彴";
+// int sendSuccess = 0;
+// int sendError = 0;
+ List<String> errorMassge = new ArrayList<>();
+ List<String> successMassge = new ArrayList<>();
+ WmsBaseResponse<WmsBaseDataResponse> response = null;
if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(platformWmsDetailList)){
for (PlatformWmsDetail platformWmsDetail:platformWmsDetailList) {
if(StringUtils.isNotBlank(platformWmsDetail.getIocode())){
+ //鍙鐞嗘湭鍙戦�佺殑璇锋眰
+ WmsOrderPlatformRequest param = new WmsOrderPlatformRequest();
+ param.setData(new ArrayList<>());
WmsOrderPlatformInfoRequest o = new WmsOrderPlatformInfoRequest();
o.setCarrierBillCode(platformWmsDetail.getIocode());
o.setRailwayNo(job.getPlatformWmsCode());
param.getData().add(o);
+ response = sendHttpRequest(url,name,JSONObject.toJSONString(param),new TypeReference< WmsBaseResponse<WmsBaseDataResponse>>(){});
+ if(response!=null && response.getData() !=null
+ && response.getData().size()>0 && StringUtils.equals(response.getData().get(0).getSuccess(),WmsBaseResponse.CODE_SUCCESS)){
+ //濡傛灉鎴愬姛
+ successMassge.add(o.getRailwayNo());
+ }else{
+ //濡傛灉澶辫触
+ errorMassge.add(o.getRailwayNo());
+ }
}
}
}
+ if(successMassge.size()>0 || errorMassge.size()>0){
+ PlatformJob update = new PlatformJob();
+ update.setId(job.getId());
+ update.setWmsSendDate(new Date());
+ if(Objects.isNull(job.getWmsSendNum())){
+ job.setWmsSendNum(1);
+ }else{
+ update.setWmsSendNum(job.getWmsSendNum() + 1);
+ }
+ update.setWmsSendPlatformCode(job.getPlatformWmsCode());
+ if(successMassge.size()>0 && errorMassge.size() ==0){
+ //濡傛灉鎴愬姛
+ update.setWmsSendStatus(Constants.ONE);
+ }else if(successMassge.size()==0 && errorMassge.size() >1){
+ //濡傛灉澶辫触
+ update.setWmsSendStatus(Constants.TWO);
+ }
+ Map<String ,Object> info= new HashMap<>();
+ info.put("success", successMassge);
+ info.put("error", errorMassge);
+ update.setWmsSendInfo(JSONObject.toJSONString(info));
+ platformJobMapper.updateById(update);
+ }
- String url = type == 0?systemDictDataBiz.queryByCode(Constants.WMS_PARAM,Constants.WMS_INBOUND_PLATFROM_URL).getCode():
- systemDictDataBiz.queryByCode(Constants.WMS_PARAM,Constants.WMS_OUTBOUND_PLATFROM_URL).getCode();;
- String name = type ==0?"銆怶MS銆戝叆搴撲綔涓氬崟鍒嗛厤鏈堝彴":"銆怶MS銆戝嚭搴撲綔涓氱殑鍒嗛厤鏈堝彴";
- WmsBaseResponse<WmsBaseDataResponse> response = sendHttpRequest(url,name,JSONObject.toJSONString(param),new TypeReference< WmsBaseResponse<WmsBaseDataResponse>>(){});
- PlatformJob update = new PlatformJob();
- update.setId(job.getId());
- update.setWmsSendDate(new Date());
- if(Objects.isNull(job.getWmsSendNum())){
- job.setWmsSendNum(1);
- }else{
- update.setWmsSendNum(job.getWmsSendNum() + 1);
- }
- update.setWmsSendPlatformCode(job.getPlatformWmsCode());
- if(response!=null && response.getData() !=null
- && response.getData().size()>0 && StringUtils.equals(response.getData().get(0).getSuccess(),WmsBaseResponse.CODE_SUCCESS)){
- //濡傛灉鎴愬姛
- update.setWmsSendStatus(Constants.ONE);
- update.setWmsSendInfo("閫氱煡WMS浣滀笟鍗曞垎閰嶆湀鍙版垚鍔�");
- }else{
- //濡傛灉澶辫触
- update.setWmsSendStatus(Constants.TWO);
- update.setWmsSendInfo("閫氱煡WMS浣滀笟鍗曞垎閰嶆湀鍙板け璐�:"+(response!=null?JSONObject.toJSONString(response):"鎺ュ彛璋冪敤澶辫触"));
- }
- platformJobMapper.updateById(update);
return response;
}
+
+ private boolean notSendedCode(String iocode, List<String> doneIoCode) {
+ if(doneIoCode!=null){
+ for(String s : doneIoCode){
+ if(StringUtils.equals(iocode,s)){
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
/**
* 鍏ュ簱閫氱煡浠诲姟涓氬姟澶勭悊
* @return
@@ -268,6 +296,7 @@
job.setIsdeleted(Constants.ZERO);
job.setIsNew(Constants.ONE);
job.setStatus(Constants.ONE);
+ job.setContractNum(param.getContractNum());
job.setCarryBillCode(param.getCarrierBillCode());
job.setIocode(param.getIoCode());
job.setCarrierName(param.getCarrierName());
@@ -289,10 +318,11 @@
entity.setIsdeleted(Constants.ZERO);
entity.setIocode(d.getIoCode());
entity.setJobId(job.getJobId());
+ entity.setContractNum(param.getContractNum());
entity.setWmsJobId(job.getId());
- entity.setIoQty(d.getIoQty());
entity.setStatus(Constants.ZERO);
- entity.setRate(d.getRate());
+ entity.setIoQty(Constants.formatBigdecimal(d.getIoQty()).multiply(Constants.formatBigdecimal( d.getRate())));
+ entity.setRate(Constants.formatBigdecimal(d.getRate()).doubleValue()+"");
entity.setMaterialName(d.getMaterialName());
entity.setInRepertotyCode(d.getInRepertotyCode());
iocodeList.add(d.getIoCode());
@@ -345,7 +375,6 @@
wxPlatNotice.sendWmsTemplateNotice(systemDictDataBiz,
wxNoticeConfigMapper,job,
WxPlatConstants.platformJobContent.platformJobNewJob,
- systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(),
Arrays.asList(driver.getOpenid().split(","))
);
}
@@ -525,11 +554,13 @@
entity.setJobId(job.getJobId());
entity.setWmsJobId(job.getId());
entity.setContractNum(param.getContractNum());
- entity.setIoQty(d.getIoQty());
entity.setRepertotyAddress(job.getRepertotyAddress());
entity.setWmsJobId(job.getId());
entity.setStatus(Constants.ZERO);
- entity.setRate(d.getRate());
+ entity.setIoQty(Constants.formatBigdecimal(d.getIoQty()).multiply(Constants.formatBigdecimal( d.getRate())));
+ entity.setRate(Constants.formatBigdecimal(d.getRate()).doubleValue()+"");
+// entity.setIoQty(d.getIoQty());
+// entity.setRate(d.getRate());
entity.setMaterialName(d.getMaterialName());
iocodeList.add(d.getIoCode());
details.add(entity);
@@ -626,8 +657,7 @@
WxPlatNotice wxPlatNotice = new WxPlatNotice();
wxPlatNotice.sendWmsCancelTemplateNotice(systemDictDataBiz,
wxNoticeConfigMapper,job,
- WxPlatConstants.platformJobContent.platformJobCancel,
- systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(),
+ WxPlatConstants.platformJobContent.platformJobCancel,
Arrays.asList(driver.getOpenid().split(","))
);
}
@@ -707,7 +737,6 @@
wxPlatNotice.sendWmsCancelTemplateNotice(systemDictDataBiz,
wxNoticeConfigMapper,job,
WxPlatConstants.platformJobContent.platformJobCancel,
- systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(),
Arrays.asList(driver.getOpenid().split(","))
);
}
--
Gitblit v1.9.3