丽知:调整入库,调整出库修改
This commit is contained in:
parent
a58eeba470
commit
2707259d5b
|
@ -14,9 +14,13 @@ import com.hzya.frame.plugin.lets.entity.BdRdclEntity;
|
||||||
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsStockinOrderRequestVO;
|
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsStockinOrderRequestVO;
|
||||||
import com.hzya.frame.plugin.lets.u8cdto.BillVO;
|
import com.hzya.frame.plugin.lets.u8cdto.BillVO;
|
||||||
import com.hzya.frame.plugin.lets.u8cdto.GeneralBillVO_4ADto;
|
import com.hzya.frame.plugin.lets.u8cdto.GeneralBillVO_4ADto;
|
||||||
|
import com.hzya.frame.plugin.lets.u8cdto.GeneralBillVO_4IDto;
|
||||||
import com.hzya.frame.plugin.lets.u8cdto.ReusltStrDto;
|
import com.hzya.frame.plugin.lets.u8cdto.ReusltStrDto;
|
||||||
import com.hzya.frame.plugin.lets.util.PushDataByU8cUtil;
|
import com.hzya.frame.plugin.lets.util.PushDataByU8cUtil;
|
||||||
import com.hzya.frame.plugin.lets.util.SaveOrUpdateBusinessLogUtil;
|
import com.hzya.frame.plugin.lets.util.SaveOrUpdateBusinessLogUtil;
|
||||||
|
import com.hzya.frame.plugin.lets.util.pushData.Attribute;
|
||||||
|
import com.hzya.frame.plugin.lets.util.pushData.PushU8CByApiCode;
|
||||||
|
import com.hzya.frame.plugin.lets.util.pushData.ZTResult;
|
||||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao;
|
import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao;
|
||||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
|
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
|
||||||
import com.hzya.frame.ttxofs.dto.InterfaceParamDto;
|
import com.hzya.frame.ttxofs.dto.InterfaceParamDto;
|
||||||
|
@ -73,6 +77,8 @@ public class AdjustInPluginInitializer extends PluginBaseEntity {
|
||||||
@Autowired
|
@Autowired
|
||||||
private PushDataByU8cUtil pushDataByU8cUtil;
|
private PushDataByU8cUtil pushDataByU8cUtil;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
private PushU8CByApiCode pushU8CByApiCode;
|
||||||
|
@Autowired
|
||||||
private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil;
|
private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -174,12 +180,12 @@ public class AdjustInPluginInitializer extends PluginBaseEntity {
|
||||||
System.out.println(stockinOrders);
|
System.out.println(stockinOrders);
|
||||||
|
|
||||||
if (stockinOrders.size() == 0) {
|
if (stockinOrders.size() == 0) {
|
||||||
Assert.state(false, "丽知:OFS调整入库--->U8C其它入库根据单据号[入库完成]:{},未查询到调整出库单",stockinNo);
|
Assert.state(false, "丽知:OFS调整入库--->U8C其它入库根据单据号[入库完成]:{},未查询到调整出库单", stockinNo);
|
||||||
}
|
}
|
||||||
//过滤日志
|
//过滤日志
|
||||||
List<StockinOrderSearchResponse.StockinOrder> filterStockinOrders = filterData(stockinOrders);
|
List<StockinOrderSearchResponse.StockinOrder> filterStockinOrders = filterData(stockinOrders);
|
||||||
if (filterStockinOrders.size() == 0) {
|
if (filterStockinOrders.size() == 0) {
|
||||||
Assert.state(false, "丽知:OFS调整入库--->U8C其它入库根据单据号[入库完成]:{},该调整出库单已被推送成功,请勿重新推送",stockinNo);
|
Assert.state(false, "丽知:OFS调整入库--->U8C其它入库根据单据号[入库完成]:{},该调整出库单已被推送成功,请勿重新推送", stockinNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
//推送
|
//推送
|
||||||
|
@ -211,12 +217,12 @@ public class AdjustInPluginInitializer extends PluginBaseEntity {
|
||||||
System.out.println(stockinOrders);
|
System.out.println(stockinOrders);
|
||||||
|
|
||||||
if (stockinOrders.size() == 0) {
|
if (stockinOrders.size() == 0) {
|
||||||
Assert.state(false, "丽知:OFS调整入库--->U8C其它入库根据日期期间[开始时间]-[结束时间]:{}-{},未查询到调整入库单[入库完成]",startTime,endTime);
|
Assert.state(false, "丽知:OFS调整入库--->U8C其它入库根据日期期间[开始时间]-[结束时间]:{}-{},未查询到调整入库单[入库完成]", startTime, endTime);
|
||||||
}
|
}
|
||||||
//过滤日志
|
//过滤日志
|
||||||
List<StockinOrderSearchResponse.StockinOrder> filterStockinOrders = filterData(stockinOrders);
|
List<StockinOrderSearchResponse.StockinOrder> filterStockinOrders = filterData(stockinOrders);
|
||||||
if (filterStockinOrders.size() == 0) {
|
if (filterStockinOrders.size() == 0) {
|
||||||
Assert.state(false, "丽知:OFS调整入库--->U8C其它入库根据日期期间[开始时间]-[结束时间]:{}-{},该调期间整入库单[入库完成]已被推送成功,请勿重新推送",startTime,endTime);
|
Assert.state(false, "丽知:OFS调整入库--->U8C其它入库根据日期期间[开始时间]-[结束时间]:{}-{},该调期间整入库单[入库完成]已被推送成功,请勿重新推送", startTime, endTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
//推送
|
//推送
|
||||||
|
@ -256,22 +262,23 @@ public class AdjustInPluginInitializer extends PluginBaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 推送U8C其它入库单
|
* 推送U8C其它入库单
|
||||||
|
*
|
||||||
* @param filterStockinOrders
|
* @param filterStockinOrders
|
||||||
*/
|
*/
|
||||||
public void implement(List<StockinOrderSearchResponse.StockinOrder> filterStockinOrders){
|
public void implement(List<StockinOrderSearchResponse.StockinOrder> filterStockinOrders) {
|
||||||
for (StockinOrderSearchResponse.StockinOrder stockinOrder : filterStockinOrders) {
|
for (StockinOrderSearchResponse.StockinOrder stockinOrder : filterStockinOrders) {
|
||||||
String mapStr = "";
|
String mapStr = "";
|
||||||
String format="";
|
String format = "";
|
||||||
String response="";
|
String response = "";
|
||||||
String ofsCode="";
|
String ofsCode = "";
|
||||||
try{
|
try {
|
||||||
//主表
|
//主表
|
||||||
StockinOrderSearchResponse.StockinOrder.StockinH ofsHeader = stockinOrder.getHeader();
|
StockinOrderSearchResponse.StockinOrder.StockinH ofsHeader = stockinOrder.getHeader();
|
||||||
GeneralBillVO_4ADto generalBillVO_4A = new GeneralBillVO_4ADto();
|
GeneralBillVO_4ADto generalBillVO_4A = new GeneralBillVO_4ADto();
|
||||||
GeneralBillVO_4ADto.Parentvo parentvo = new GeneralBillVO_4ADto.Parentvo();
|
GeneralBillVO_4ADto.Parentvo parentvo = new GeneralBillVO_4ADto.Parentvo();
|
||||||
|
|
||||||
//ofs订单号,自定义项19
|
//ofs订单号,自定义项19
|
||||||
ofsCode=ofsHeader.getCode();
|
ofsCode = ofsHeader.getCode();
|
||||||
parentvo.setVuserdef19(ofsCode);
|
parentvo.setVuserdef19(ofsCode);
|
||||||
|
|
||||||
//pk_corp--公司
|
//pk_corp--公司
|
||||||
|
@ -286,13 +293,13 @@ public class AdjustInPluginInitializer extends PluginBaseEntity {
|
||||||
//dbilldate--单据日期--oms入库时间
|
//dbilldate--单据日期--oms入库时间
|
||||||
// Date created = ofsHeader.getCreated();
|
// Date created = ofsHeader.getCreated();
|
||||||
// format = DateUtil.format(created, "yyyy-MM-dd HH:mm:ss");
|
// format = DateUtil.format(created, "yyyy-MM-dd HH:mm:ss");
|
||||||
format = ofsHeader.getCreated();
|
format = ofsHeader.getCreated();
|
||||||
parentvo.setDbilldate(StringUtils.substring(format,0,10));
|
parentvo.setDbilldate(StringUtils.substring(format, 0, 10));
|
||||||
//coperatorid--制单人
|
//coperatorid--制单人
|
||||||
String createdBy = ofsHeader.getCreatedBy();
|
String createdBy = ofsHeader.getCreatedBy();
|
||||||
parentvo.setCoperatorid("tbadmin");
|
parentvo.setCoperatorid("tbadmin");
|
||||||
//审核时间dauditdate
|
//审核时间dauditdate
|
||||||
parentvo.setDauditdate(StringUtils.substring(format,0,10));
|
parentvo.setDauditdate(StringUtils.substring(format, 0, 10));
|
||||||
|
|
||||||
//cdispatcherid--收发类别,ofs过来的写死,20240813(妮姐+万万),就是调整出库,调整入库
|
//cdispatcherid--收发类别,ofs过来的写死,20240813(妮姐+万万),就是调整出库,调整入库
|
||||||
BdRdclEntity bdRdclEntity = new BdRdclEntity();
|
BdRdclEntity bdRdclEntity = new BdRdclEntity();
|
||||||
|
@ -300,14 +307,14 @@ public class AdjustInPluginInitializer extends PluginBaseEntity {
|
||||||
bdRdclEntity.setDr(0);
|
bdRdclEntity.setDr(0);
|
||||||
bdRdclEntity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE);
|
bdRdclEntity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE);
|
||||||
List<BdRdclEntity> BdRdclEntityList = iBdRdclDao.query(bdRdclEntity);
|
List<BdRdclEntity> BdRdclEntityList = iBdRdclDao.query(bdRdclEntity);
|
||||||
if(BdRdclEntityList.size()==0){
|
if (BdRdclEntityList.size() == 0) {
|
||||||
Assert.state(false,"查询U8C收发类型:调整入库失败。未查询到U8C收发类型。");
|
Assert.state(false, "查询U8C收发类型:调整入库失败。未查询到U8C收发类型。");
|
||||||
}
|
}
|
||||||
String RdclCode = BdRdclEntityList.get(0).getRdcode();//收发类别编码
|
String RdclCode = BdRdclEntityList.get(0).getRdcode();//收发类别编码
|
||||||
parentvo.setCdispatcherid(RdclCode);
|
parentvo.setCdispatcherid(RdclCode);
|
||||||
|
|
||||||
//子表
|
//子表
|
||||||
List<GeneralBillVO_4ADto.Childrenvo> childrenvo=new ArrayList<>();
|
List<GeneralBillVO_4ADto.Childrenvo> childrenvo = new ArrayList<>();
|
||||||
for (StockinOrderSearchResponse.StockinOrder.StockinB ofsDetail : stockinOrder.getDetails()) {
|
for (StockinOrderSearchResponse.StockinOrder.StockinB ofsDetail : stockinOrder.getDetails()) {
|
||||||
System.out.println(ofsDetail);
|
System.out.println(ofsDetail);
|
||||||
GeneralBillVO_4ADto.Childrenvo children = new GeneralBillVO_4ADto.Childrenvo();
|
GeneralBillVO_4ADto.Childrenvo children = new GeneralBillVO_4ADto.Childrenvo();
|
||||||
|
@ -332,19 +339,25 @@ public class AdjustInPluginInitializer extends PluginBaseEntity {
|
||||||
mapStr = "{\"GeneralBillVO_4A\":[" + dataJson + "]}";
|
mapStr = "{\"GeneralBillVO_4A\":[" + dataJson + "]}";
|
||||||
|
|
||||||
//推送
|
//推送
|
||||||
response = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("otherinqz"), mapStr);
|
// response = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("otherinqz"), mapStr);
|
||||||
System.out.println(response);
|
ZTResult ztResult = pushU8CByApiCode.pushByCode(OverallConstant.getOverAllValue("otherinqzCode"), mapStr);
|
||||||
|
|
||||||
|
//两层判断,一层中台转发,一层u8c返回
|
||||||
|
if ("false".equals(ztResult.getFlag())) {
|
||||||
|
//转发失败
|
||||||
|
Assert.state(false, "丽知:OFS调整入库--->U8C其它入库.中台转发失败,失败原因:{}", ztResult.getMsg());
|
||||||
|
}
|
||||||
|
Attribute attribute = ztResult.getAttribute();
|
||||||
|
System.out.println(attribute);
|
||||||
|
|
||||||
boolean isSuccess = false;
|
boolean isSuccess = false;
|
||||||
String vbillcode="";
|
String vbillcode = "";
|
||||||
if (response != null && !"".equals(response)) {
|
if ("success".equals(attribute.getStatus())) {
|
||||||
ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class);
|
isSuccess = true;
|
||||||
if ("success".equals(reusltStrDto.getStatus())) {
|
String data = attribute.getData();
|
||||||
isSuccess = true;
|
GeneralBillVO_4ADto resGeneralBillVO = resultDataHandle(data);
|
||||||
String data = reusltStrDto.getData();
|
System.out.println(resGeneralBillVO);
|
||||||
GeneralBillVO_4ADto resGeneralBillVO = resultDataHandle(data);
|
vbillcode = resGeneralBillVO.getParentvo().getVbillcode();
|
||||||
System.out.println(resGeneralBillVO);
|
|
||||||
vbillcode = resGeneralBillVO.getParentvo().getVbillcode();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!isSuccess) {
|
if (!isSuccess) {
|
||||||
Assert.state(false, "推送U8C--> 丽知:OFS调整入库--->U8C其它入库 失败 接口返回结果:{} 接口入参:{}", response, mapStr);
|
Assert.state(false, "推送U8C--> 丽知:OFS调整入库--->U8C其它入库 失败 接口返回结果:{} 接口入参:{}", response, mapStr);
|
||||||
|
@ -360,16 +373,17 @@ public class AdjustInPluginInitializer extends PluginBaseEntity {
|
||||||
integrationTaskLivingDetailsEntity.setRootAppPk(ofsCode);
|
integrationTaskLivingDetailsEntity.setRootAppPk(ofsCode);
|
||||||
integrationTaskLivingDetailsEntity.setRootAppBill(ofsCode);
|
integrationTaskLivingDetailsEntity.setRootAppBill(ofsCode);
|
||||||
integrationTaskLivingDetailsEntity.setRootAppBill(vbillcode);
|
integrationTaskLivingDetailsEntity.setRootAppBill(vbillcode);
|
||||||
|
integrationTaskLivingDetailsEntity.setDef1(vbillcode);
|
||||||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||||
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
||||||
|
|
||||||
}catch (Exception e){
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.error("推送U8C,丽知:OFS调整入库--->U8C其它入库失败,失败原因:" + e);
|
logger.error("推送U8C,丽知:OFS调整入库--->U8C其它入库失败,失败原因:" + e);
|
||||||
|
|
||||||
ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class);
|
ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class);
|
||||||
|
|
||||||
String ErrMessage ="推送U8C,丽知:OFS调整入库--->U8C其它入库失败,失败原因:"+ reusltStrDto.getErrormsg();
|
String ErrMessage = "推送U8C,丽知:OFS调整入库--->U8C其它入库失败,失败原因:" + reusltStrDto.getErrormsg();
|
||||||
//失败
|
//失败
|
||||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||||
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N);
|
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N);
|
||||||
|
|
|
@ -18,6 +18,9 @@ import com.hzya.frame.plugin.lets.u8cdto.GeneralBillVO_4IDto;
|
||||||
import com.hzya.frame.plugin.lets.u8cdto.ReusltStrDto;
|
import com.hzya.frame.plugin.lets.u8cdto.ReusltStrDto;
|
||||||
import com.hzya.frame.plugin.lets.util.PushDataByU8cUtil;
|
import com.hzya.frame.plugin.lets.util.PushDataByU8cUtil;
|
||||||
import com.hzya.frame.plugin.lets.util.SaveOrUpdateBusinessLogUtil;
|
import com.hzya.frame.plugin.lets.util.SaveOrUpdateBusinessLogUtil;
|
||||||
|
import com.hzya.frame.plugin.lets.util.pushData.Attribute;
|
||||||
|
import com.hzya.frame.plugin.lets.util.pushData.PushU8CByApiCode;
|
||||||
|
import com.hzya.frame.plugin.lets.util.pushData.ZTResult;
|
||||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao;
|
import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao;
|
||||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
|
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
|
||||||
import com.hzya.frame.ttxofs.dto.InterfaceParamDto;
|
import com.hzya.frame.ttxofs.dto.InterfaceParamDto;
|
||||||
|
@ -81,6 +84,8 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
|
||||||
@Autowired
|
@Autowired
|
||||||
private PushDataByU8cUtil pushDataByU8cUtil;
|
private PushDataByU8cUtil pushDataByU8cUtil;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
private PushU8CByApiCode pushU8CByApiCode;
|
||||||
|
@Autowired
|
||||||
private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil;
|
private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -176,12 +181,12 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
|
||||||
queryOfsStockoutOrderRequestVO.setPageSize(500L);
|
queryOfsStockoutOrderRequestVO.setPageSize(500L);
|
||||||
List<StockoutOrderSearchResponse.StockoutOrder> stockoutOrders = queryOfsStockoutOrder(queryOfsStockoutOrderRequestVO);
|
List<StockoutOrderSearchResponse.StockoutOrder> stockoutOrders = queryOfsStockoutOrder(queryOfsStockoutOrderRequestVO);
|
||||||
if (stockoutOrders == null || stockoutOrders.size() == 0) {
|
if (stockoutOrders == null || stockoutOrders.size() == 0) {
|
||||||
Assert.state(false, "丽知:OFS调整出库--->U8C其它出库根据单据号[出库完成]:{},未查询到调整出库单",stockoutNo);
|
Assert.state(false, "丽知:OFS调整出库--->U8C其它出库根据单据号[出库完成]:{},未查询到调整出库单", stockoutNo);
|
||||||
}
|
}
|
||||||
//过滤日志
|
//过滤日志
|
||||||
List<StockoutOrderSearchResponse.StockoutOrder> filterStockoutOrders = filterData(stockoutOrders);
|
List<StockoutOrderSearchResponse.StockoutOrder> filterStockoutOrders = filterData(stockoutOrders);
|
||||||
if (filterStockoutOrders == null || filterStockoutOrders.size() == 0) {
|
if (filterStockoutOrders == null || filterStockoutOrders.size() == 0) {
|
||||||
Assert.state(false, "丽知:OFS调整出库--->U8C其它出库根据单据号[出库完成]:{},该调整出库单已被推送成功,请勿重新推送",stockoutNo);
|
Assert.state(false, "丽知:OFS调整出库--->U8C其它出库根据单据号[出库完成]:{},该调整出库单已被推送成功,请勿重新推送", stockoutNo);
|
||||||
}
|
}
|
||||||
//推送
|
//推送
|
||||||
implement(filterStockoutOrders);
|
implement(filterStockoutOrders);
|
||||||
|
@ -211,13 +216,13 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
|
||||||
queryOfsStockoutOrderRequestVO.setPageSize(500L);
|
queryOfsStockoutOrderRequestVO.setPageSize(500L);
|
||||||
List<StockoutOrderSearchResponse.StockoutOrder> stockoutOrders = queryOfsStockoutOrder(queryOfsStockoutOrderRequestVO);
|
List<StockoutOrderSearchResponse.StockoutOrder> stockoutOrders = queryOfsStockoutOrder(queryOfsStockoutOrderRequestVO);
|
||||||
if (stockoutOrders == null || stockoutOrders.size() == 0) {
|
if (stockoutOrders == null || stockoutOrders.size() == 0) {
|
||||||
Assert.state(false, "丽知:OFS调整出库--->U8C其它出库根据日期期间[开始时间]-[结束时间]:{}-{},未查询到调整出库单[出库完成]",startTime,endTime);
|
Assert.state(false, "丽知:OFS调整出库--->U8C其它出库根据日期期间[开始时间]-[结束时间]:{}-{},未查询到调整出库单[出库完成]", startTime, endTime);
|
||||||
|
|
||||||
}
|
}
|
||||||
//过滤日志
|
//过滤日志
|
||||||
List<StockoutOrderSearchResponse.StockoutOrder> filterStockoutOrders = filterData(stockoutOrders);
|
List<StockoutOrderSearchResponse.StockoutOrder> filterStockoutOrders = filterData(stockoutOrders);
|
||||||
if (filterStockoutOrders == null || filterStockoutOrders.size() == 0) {
|
if (filterStockoutOrders == null || filterStockoutOrders.size() == 0) {
|
||||||
Assert.state(false, "丽知:OFS调整出库--->U8C其它出库根据日期期间[开始时间]-[结束时间]:{}-{},该调期间整出库单[出库完成]已被推送成功,请勿重新推送",startTime,endTime);
|
Assert.state(false, "丽知:OFS调整出库--->U8C其它出库根据日期期间[开始时间]-[结束时间]:{}-{},该调期间整出库单[出库完成]已被推送成功,请勿重新推送", startTime, endTime);
|
||||||
}
|
}
|
||||||
//推送
|
//推送
|
||||||
implement(filterStockoutOrders);
|
implement(filterStockoutOrders);
|
||||||
|
@ -232,8 +237,8 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
|
||||||
/**
|
/**
|
||||||
* 过滤成功日志
|
* 过滤成功日志
|
||||||
*/
|
*/
|
||||||
public List<StockoutOrderSearchResponse.StockoutOrder> filterData(List<StockoutOrderSearchResponse.StockoutOrder> stockoutOrders){
|
public List<StockoutOrderSearchResponse.StockoutOrder> filterData(List<StockoutOrderSearchResponse.StockoutOrder> stockoutOrders) {
|
||||||
List<StockoutOrderSearchResponse.StockoutOrder> filterStockoutOrders=new ArrayList<>();
|
List<StockoutOrderSearchResponse.StockoutOrder> filterStockoutOrders = new ArrayList<>();
|
||||||
for (StockoutOrderSearchResponse.StockoutOrder stockoutOrder : stockoutOrders) {
|
for (StockoutOrderSearchResponse.StockoutOrder stockoutOrder : stockoutOrders) {
|
||||||
StockoutOrderSearchResponse.StockoutOrder.StockoutH header = stockoutOrder.getHeader();
|
StockoutOrderSearchResponse.StockoutOrder.StockoutH header = stockoutOrder.getHeader();
|
||||||
String rootAppPk = header.getCode();
|
String rootAppPk = header.getCode();
|
||||||
|
@ -256,14 +261,15 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 丽知:OFS调整出库--->U8C其它出库
|
* 丽知:OFS调整出库--->U8C其它出库
|
||||||
|
*
|
||||||
* @param filterStockoutOrders
|
* @param filterStockoutOrders
|
||||||
*/
|
*/
|
||||||
public void implement(List<StockoutOrderSearchResponse.StockoutOrder> filterStockoutOrders){
|
public void implement(List<StockoutOrderSearchResponse.StockoutOrder> filterStockoutOrders) {
|
||||||
for (StockoutOrderSearchResponse.StockoutOrder stockoutOrder : filterStockoutOrders) {
|
for (StockoutOrderSearchResponse.StockoutOrder stockoutOrder : filterStockoutOrders) {
|
||||||
String mapStr = "";
|
String mapStr = "";
|
||||||
String format="";
|
String format = "";
|
||||||
String response="";
|
String response = "";
|
||||||
String ofsCode="";
|
String ofsCode = "";
|
||||||
try {
|
try {
|
||||||
GeneralBillVO_4IDto generalBillVO_4I = new GeneralBillVO_4IDto();
|
GeneralBillVO_4IDto generalBillVO_4I = new GeneralBillVO_4IDto();
|
||||||
|
|
||||||
|
@ -274,7 +280,7 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
|
||||||
|
|
||||||
|
|
||||||
//ofs订单号,自定义项19
|
//ofs订单号,自定义项19
|
||||||
ofsCode=ofsHeader.getCode();
|
ofsCode = ofsHeader.getCode();
|
||||||
parentvo.setVuserdef19(ofsCode);
|
parentvo.setVuserdef19(ofsCode);
|
||||||
|
|
||||||
//pk_corp--公司
|
//pk_corp--公司
|
||||||
|
@ -291,11 +297,11 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
|
||||||
// Date created = ofsHeader.getCreated();
|
// Date created = ofsHeader.getCreated();
|
||||||
// format = DateUtil.format(created, "yyyy-MM-dd HH:mm:ss");
|
// format = DateUtil.format(created, "yyyy-MM-dd HH:mm:ss");
|
||||||
format = created1;
|
format = created1;
|
||||||
parentvo.setDbilldate(StringUtils.substring(format,0,10));
|
parentvo.setDbilldate(StringUtils.substring(format, 0, 10));
|
||||||
//coperatorid--制单人
|
//coperatorid--制单人
|
||||||
parentvo.setCoperatorid("tbadmin");
|
parentvo.setCoperatorid("tbadmin");
|
||||||
//审核时间dauditdate
|
//审核时间dauditdate
|
||||||
parentvo.setDauditdate(StringUtils.substring(format,0,10));
|
parentvo.setDauditdate(StringUtils.substring(format, 0, 10));
|
||||||
|
|
||||||
//cdispatcherid--收发类别,ofs过来的写死,20240813(妮姐+万万),就是调整出库,调整入库
|
//cdispatcherid--收发类别,ofs过来的写死,20240813(妮姐+万万),就是调整出库,调整入库
|
||||||
BdRdclEntity bdRdclEntity = new BdRdclEntity();
|
BdRdclEntity bdRdclEntity = new BdRdclEntity();
|
||||||
|
@ -303,8 +309,8 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
|
||||||
bdRdclEntity.setDr(0);
|
bdRdclEntity.setDr(0);
|
||||||
bdRdclEntity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE);
|
bdRdclEntity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE);
|
||||||
List<BdRdclEntity> BdRdclEntityList = iBdRdclDao.query(bdRdclEntity);
|
List<BdRdclEntity> BdRdclEntityList = iBdRdclDao.query(bdRdclEntity);
|
||||||
if(BdRdclEntityList.size()==0){
|
if (BdRdclEntityList.size() == 0) {
|
||||||
Assert.state(false,"查询U8C收发类型:调整出库失败。未查询到U8C收发类型。");
|
Assert.state(false, "查询U8C收发类型:调整出库失败。未查询到U8C收发类型。");
|
||||||
}
|
}
|
||||||
String RdclCode = BdRdclEntityList.get(0).getRdcode();//收发类别编码
|
String RdclCode = BdRdclEntityList.get(0).getRdcode();//收发类别编码
|
||||||
parentvo.setCdispatcherid(RdclCode);
|
parentvo.setCdispatcherid(RdclCode);
|
||||||
|
@ -313,7 +319,7 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
|
||||||
// parentvo.setIsautopick("Y");
|
// parentvo.setIsautopick("Y");
|
||||||
|
|
||||||
//子表
|
//子表
|
||||||
List<GeneralBillVO_4IDto.Childrenvo> childrenvo=new ArrayList<>();
|
List<GeneralBillVO_4IDto.Childrenvo> childrenvo = new ArrayList<>();
|
||||||
for (StockoutOrderSearchResponse.StockoutOrder.StockoutB ofsDetail : stockoutOrder.getDetails()) {
|
for (StockoutOrderSearchResponse.StockoutOrder.StockoutB ofsDetail : stockoutOrder.getDetails()) {
|
||||||
System.out.println(ofsDetail);
|
System.out.println(ofsDetail);
|
||||||
GeneralBillVO_4IDto.Childrenvo children = new GeneralBillVO_4IDto.Childrenvo();
|
GeneralBillVO_4IDto.Childrenvo children = new GeneralBillVO_4IDto.Childrenvo();
|
||||||
|
@ -338,22 +344,28 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
|
||||||
generalBillVO_4I.setChildrenvo(childrenvo);
|
generalBillVO_4I.setChildrenvo(childrenvo);
|
||||||
String dataJson = JSONUtil.toJsonStr(generalBillVO_4I);
|
String dataJson = JSONUtil.toJsonStr(generalBillVO_4I);
|
||||||
mapStr = "{\"GeneralBillVO_4I\":[" + dataJson + "]}";
|
mapStr = "{\"GeneralBillVO_4I\":[" + dataJson + "]}";
|
||||||
response = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("otheroutqz"), mapStr);
|
// response = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("otheroutqz"), mapStr);
|
||||||
System.out.println(response);
|
ZTResult ztResult = pushU8CByApiCode.pushByCode(OverallConstant.getOverAllValue("otheroutqzCode"), mapStr);
|
||||||
|
|
||||||
|
//两层判断,一层中台转发,一层u8c返回
|
||||||
|
if ("false".equals(ztResult.getFlag())) {
|
||||||
|
//转发失败
|
||||||
|
Assert.state(false, "丽知:OFS调整出库--->U8C其它出库.中台转发失败,失败原因:{}", ztResult.getMsg());
|
||||||
|
}
|
||||||
|
Attribute attribute = ztResult.getAttribute();
|
||||||
|
System.out.println(attribute);
|
||||||
|
|
||||||
boolean isSuccess = false;
|
boolean isSuccess = false;
|
||||||
String vbillcode="";
|
String vbillcode = "";
|
||||||
if (response != null && !"".equals(response)) {
|
if ("success".equals(attribute.getStatus())) {
|
||||||
ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class);
|
isSuccess = true;
|
||||||
if ("success".equals(reusltStrDto.getStatus())) {
|
String data = attribute.getData();
|
||||||
isSuccess = true;
|
GeneralBillVO_4IDto resGeneralBillVO = resultDataHandle(data);
|
||||||
String data = reusltStrDto.getData();
|
System.out.println(resGeneralBillVO);
|
||||||
GeneralBillVO_4IDto resGeneralBillVO = resultDataHandle(data);
|
vbillcode = resGeneralBillVO.getParentvo().getVbillcode();
|
||||||
System.out.println(resGeneralBillVO);
|
|
||||||
vbillcode = resGeneralBillVO.getParentvo().getVbillcode();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!isSuccess) {
|
if (!isSuccess) {
|
||||||
Assert.state(false, "推送U8C--> 丽知:OFS调整入库--->U8C其它入库 失败 接口返回结果:{} 接口入参:{}", response, mapStr);
|
Assert.state(false, "推送U8C--> 丽知:OFS调整出库--->U8C其它出库 失败 接口返回结果:{} 接口入参:{}", response, mapStr);
|
||||||
}
|
}
|
||||||
//成功
|
//成功
|
||||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||||
|
@ -363,18 +375,17 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
|
||||||
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
|
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
|
||||||
integrationTaskLivingDetailsEntity.setBusinessDate(format);
|
integrationTaskLivingDetailsEntity.setBusinessDate(format);
|
||||||
integrationTaskLivingDetailsEntity.setRootAppPk(ofsCode);
|
integrationTaskLivingDetailsEntity.setRootAppPk(ofsCode);
|
||||||
integrationTaskLivingDetailsEntity.setRootAppBill(ofsCode);//u8c其他出库单号
|
integrationTaskLivingDetailsEntity.setRootAppBill(ofsCode);
|
||||||
// integrationTaskLivingDetailsEntity.setRootAppBill(vbillcode);//u8c其他出库单号
|
integrationTaskLivingDetailsEntity.setDef1(vbillcode);//u8c其他出库单号
|
||||||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||||
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
||||||
|
|
||||||
}catch (Exception e){
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.error("推送U8C,丽知:OFS调整出库--->U8C其它出库失败,失败原因:" + e);
|
logger.error("推送U8C,丽知:OFS调整出库--->U8C其它出库失败,失败原因:" + e);
|
||||||
ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class);
|
ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class);
|
||||||
|
|
||||||
String ErrMessage ="推送U8C,丽知:OFS调整入库--->U8C其它入库失败,失败原因:"+ reusltStrDto.getErrormsg();
|
String ErrMessage = "推送U8C,丽知:OFS调整出库--->U8C其它出库失败,失败原因:" + reusltStrDto.getErrormsg();
|
||||||
|
|
||||||
|
|
||||||
//失败
|
//失败
|
||||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||||
|
@ -404,7 +415,7 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
|
||||||
StockoutOrderSearchResponse stockoutOrderSearchResponse = SaleOutReturnMessageDto2StockoutOrderSearchResponse(saleOutReturnMessageDto);
|
StockoutOrderSearchResponse stockoutOrderSearchResponse = SaleOutReturnMessageDto2StockoutOrderSearchResponse(saleOutReturnMessageDto);
|
||||||
System.out.println(stockoutOrderSearchResponse);
|
System.out.println(stockoutOrderSearchResponse);
|
||||||
|
|
||||||
if(stockoutOrderSearchResponse.getData()==null||stockoutOrderSearchResponse.getData().size()==0){
|
if (stockoutOrderSearchResponse.getData() == null || stockoutOrderSearchResponse.getData().size() == 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return stockoutOrderSearchResponse.getData();
|
return stockoutOrderSearchResponse.getData();
|
||||||
|
@ -412,21 +423,22 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 只是命名不一样,为了方便区分,顾转换为stockout
|
* 只是命名不一样,为了方便区分,顾转换为stockout
|
||||||
|
*
|
||||||
* @param saleOutReturnMessageDto
|
* @param saleOutReturnMessageDto
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public StockoutOrderSearchResponse SaleOutReturnMessageDto2StockoutOrderSearchResponse(SaleOutReturnMessageDto saleOutReturnMessageDto){
|
public StockoutOrderSearchResponse SaleOutReturnMessageDto2StockoutOrderSearchResponse(SaleOutReturnMessageDto saleOutReturnMessageDto) {
|
||||||
StockoutOrderSearchResponse stockoutOrderSearchResponse = new StockoutOrderSearchResponse();
|
StockoutOrderSearchResponse stockoutOrderSearchResponse = new StockoutOrderSearchResponse();
|
||||||
List<StockoutOrderSearchResponse.StockoutOrder> data=new ArrayList<>();
|
List<StockoutOrderSearchResponse.StockoutOrder> data = new ArrayList<>();
|
||||||
BeanUtils.copyProperties(saleOutReturnMessageDto,stockoutOrderSearchResponse);
|
BeanUtils.copyProperties(saleOutReturnMessageDto, stockoutOrderSearchResponse);
|
||||||
for (HeaderDetailsDto saleOutData : saleOutReturnMessageDto.getData()) {
|
for (HeaderDetailsDto saleOutData : saleOutReturnMessageDto.getData()) {
|
||||||
HeaderDto saleOutHeader = saleOutData.getHeader();
|
HeaderDto saleOutHeader = saleOutData.getHeader();
|
||||||
StockoutOrderSearchResponse.StockoutOrder stockoutOrder = new StockoutOrderSearchResponse.StockoutOrder();
|
StockoutOrderSearchResponse.StockoutOrder stockoutOrder = new StockoutOrderSearchResponse.StockoutOrder();
|
||||||
StockoutOrderSearchResponse.StockoutOrder.StockoutH stockoutH = new StockoutOrderSearchResponse.StockoutOrder.StockoutH();
|
StockoutOrderSearchResponse.StockoutOrder.StockoutH stockoutH = new StockoutOrderSearchResponse.StockoutOrder.StockoutH();
|
||||||
List<StockoutOrderSearchResponse.StockoutOrder.StockoutB> stockoutBList=new ArrayList<>();
|
List<StockoutOrderSearchResponse.StockoutOrder.StockoutB> stockoutBList = new ArrayList<>();
|
||||||
for (DetailsDto saleOutDetail : saleOutData.getDetails()) {
|
for (DetailsDto saleOutDetail : saleOutData.getDetails()) {
|
||||||
StockoutOrderSearchResponse.StockoutOrder.StockoutB stockoutB = new StockoutOrderSearchResponse.StockoutOrder.StockoutB();
|
StockoutOrderSearchResponse.StockoutOrder.StockoutB stockoutB = new StockoutOrderSearchResponse.StockoutOrder.StockoutB();
|
||||||
BeanUtils.copyProperties(saleOutDetail,stockoutB);
|
BeanUtils.copyProperties(saleOutDetail, stockoutB);
|
||||||
stockoutBList.add(stockoutB);
|
stockoutBList.add(stockoutB);
|
||||||
}
|
}
|
||||||
//创建时间,修改时间,创建人,修改人,赋给表头
|
//创建时间,修改时间,创建人,修改人,赋给表头
|
||||||
|
@ -436,7 +448,7 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
|
||||||
stockoutH.setLastUpdated(stockoutB.getLastUpdated());
|
stockoutH.setLastUpdated(stockoutB.getLastUpdated());
|
||||||
stockoutH.setLastUpdatedBy(stockoutB.getLastUpdatedBy());
|
stockoutH.setLastUpdatedBy(stockoutB.getLastUpdatedBy());
|
||||||
|
|
||||||
BeanUtils.copyProperties(saleOutHeader,stockoutH);
|
BeanUtils.copyProperties(saleOutHeader, stockoutH);
|
||||||
stockoutOrder.setHeader(stockoutH);
|
stockoutOrder.setHeader(stockoutH);
|
||||||
stockoutOrder.setDetails(stockoutBList);
|
stockoutOrder.setDetails(stockoutBList);
|
||||||
data.add(stockoutOrder);
|
data.add(stockoutOrder);
|
||||||
|
|
Loading…
Reference in New Issue