返回值优化:多个插件执行成功时返回统一成功消息
更改内容: - 在多个插件初始化器中修改executeBusiness方法的返回值为BaseResult.getSuccessMessageEntity("插件执行成功") -参与修改的插件包括:CustdocAutoAllotPluginInitializer, ShopPluginInitializer, SupplierPluginInitializer等 影响: - 优化了插件执行成功的反馈机制,统一了返回的成功消息格式
This commit is contained in:
parent
fa895c85e7
commit
955e840eb2
|
@ -24,6 +24,7 @@ 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.ofsBaseSearch.OfsShopDto;
|
import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OfsShopDto;
|
||||||
|
import com.hzya.frame.web.entity.BaseResult;
|
||||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -113,7 +114,7 @@ public class CustdocAutoAllotPluginInitializer extends PluginBaseEntity {
|
||||||
} else if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(prod)) {
|
} else if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(prod)) {
|
||||||
start();
|
start();
|
||||||
}
|
}
|
||||||
return null;
|
return BaseResult.getSuccessMessageEntity("插件执行成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ import com.hzya.frame.ttxofs.dto.InterfaceParamByU8CApiDto;
|
||||||
import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OfsShopDto;
|
import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OfsShopDto;
|
||||||
import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OfsShopReturnMessageDto;
|
import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OfsShopReturnMessageDto;
|
||||||
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
|
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
|
||||||
|
import com.hzya.frame.web.entity.BaseResult;
|
||||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -126,7 +127,7 @@ public class ShopPluginInitializer extends PluginBaseEntity {
|
||||||
} else if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(prod)) {
|
} else if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(prod)) {
|
||||||
startImplement();
|
startImplement();
|
||||||
}
|
}
|
||||||
return null;
|
return BaseResult.getSuccessMessageEntity("插件执行成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -217,7 +218,7 @@ public class ShopPluginInitializer extends PluginBaseEntity {
|
||||||
Assert.notNull(shopEntityList, "shopEntityList不能为空");
|
Assert.notNull(shopEntityList, "shopEntityList不能为空");
|
||||||
String businessFormat = null;
|
String businessFormat = null;
|
||||||
for (OfsShopDto shopEntity : shopEntityList) {
|
for (OfsShopDto shopEntity : shopEntityList) {
|
||||||
businessFormat=shopEntity.getLastUpdated();
|
businessFormat = shopEntity.getLastUpdated();
|
||||||
String response = "";
|
String response = "";
|
||||||
try {
|
try {
|
||||||
String lastUpdated = shopEntity.getLastUpdated();
|
String lastUpdated = shopEntity.getLastUpdated();
|
||||||
|
@ -301,7 +302,7 @@ public class ShopPluginInitializer extends PluginBaseEntity {
|
||||||
String businessFormat = null;
|
String businessFormat = null;
|
||||||
for (OfsShopDto shopEntity : shopEntityList) {
|
for (OfsShopDto shopEntity : shopEntityList) {
|
||||||
String response = "";
|
String response = "";
|
||||||
businessFormat=shopEntity.getLastUpdated();
|
businessFormat = shopEntity.getLastUpdated();
|
||||||
try {
|
try {
|
||||||
|
|
||||||
DefdocRequestVo defdocRequestVo = new DefdocRequestVo();
|
DefdocRequestVo defdocRequestVo = new DefdocRequestVo();
|
||||||
|
@ -352,7 +353,7 @@ public class ShopPluginInitializer extends PluginBaseEntity {
|
||||||
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
|
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
|
||||||
integrationTaskLivingDetailsEntity.setBusinessDate(businessFormat);
|
integrationTaskLivingDetailsEntity.setBusinessDate(businessFormat);
|
||||||
integrationTaskLivingDetailsEntity.setRootAppPk("defdoc_" + shopEntity.getBizCode());
|
integrationTaskLivingDetailsEntity.setRootAppPk("defdoc_" + shopEntity.getBizCode());
|
||||||
integrationTaskLivingDetailsEntity.setRootAppBill("defdoc_" +shopEntity.getBizCode());
|
integrationTaskLivingDetailsEntity.setRootAppBill("defdoc_" + shopEntity.getBizCode());
|
||||||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||||
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
||||||
|
|
||||||
|
@ -367,7 +368,7 @@ public class ShopPluginInitializer extends PluginBaseEntity {
|
||||||
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
|
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
|
||||||
integrationTaskLivingDetailsEntity.setBusinessDate(businessFormat);
|
integrationTaskLivingDetailsEntity.setBusinessDate(businessFormat);
|
||||||
integrationTaskLivingDetailsEntity.setRootAppPk("defdoc_" + shopEntity.getBizCode());
|
integrationTaskLivingDetailsEntity.setRootAppPk("defdoc_" + shopEntity.getBizCode());
|
||||||
integrationTaskLivingDetailsEntity.setRootAppBill("defdoc_" +shopEntity.getBizCode());
|
integrationTaskLivingDetailsEntity.setRootAppBill("defdoc_" + shopEntity.getBizCode());
|
||||||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||||
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ import com.hzya.frame.ttxofs.dto.InterfaceParamByU8CApiDto;
|
||||||
import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OfsSupplierDto;
|
import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OfsSupplierDto;
|
||||||
import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OfsSupplierReturnMessageDto;
|
import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OfsSupplierReturnMessageDto;
|
||||||
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
|
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
|
||||||
|
import com.hzya.frame.web.entity.BaseResult;
|
||||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -125,7 +126,7 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
|
||||||
} else if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(prod)) {
|
} else if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(prod)) {
|
||||||
startImplement();
|
startImplement();
|
||||||
}
|
}
|
||||||
return null;
|
return BaseResult.getSuccessMessageEntity("插件执行成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -211,7 +212,7 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
|
||||||
//业务时间
|
//业务时间
|
||||||
String businessFormat = null;
|
String businessFormat = null;
|
||||||
for (OfsSupplierDto supplierEntity : shopEntityList) {
|
for (OfsSupplierDto supplierEntity : shopEntityList) {
|
||||||
businessFormat=supplierEntity.getLastUpdated();
|
businessFormat = supplierEntity.getLastUpdated();
|
||||||
CustdocEntityDto parentvo = new CustdocEntityDto();
|
CustdocEntityDto parentvo = new CustdocEntityDto();
|
||||||
BankVo bankVo = new BankVo();
|
BankVo bankVo = new BankVo();
|
||||||
CustdocRequestVo CustdocEntityDto = new CustdocRequestVo();
|
CustdocRequestVo CustdocEntityDto = new CustdocRequestVo();
|
||||||
|
|
|
@ -24,6 +24,7 @@ import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderData;
|
||||||
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderDetails;
|
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderDetails;
|
||||||
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderHeader;
|
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderHeader;
|
||||||
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
|
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
|
||||||
|
import com.hzya.frame.web.entity.BaseResult;
|
||||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -187,7 +188,7 @@ public class ConsignmachiningIn extends PluginBaseEntity {
|
||||||
logger.error("thread.join();抛出异常", e);
|
logger.error("thread.join();抛出异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return BaseResult.getSuccessMessageEntity("插件执行成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -29,6 +29,7 @@ import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.DetailsDto;
|
||||||
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto;
|
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto;
|
||||||
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDto;
|
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDto;
|
||||||
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
|
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
|
||||||
|
import com.hzya.frame.web.entity.BaseResult;
|
||||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -189,7 +190,7 @@ public class ConsignmachiningInReturn extends PluginBaseEntity {
|
||||||
logger.error("thread.join();抛出异常", e);
|
logger.error("thread.join();抛出异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return BaseResult.getSuccessMessageEntity("插件执行成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -29,6 +29,7 @@ import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto;
|
||||||
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDto;
|
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDto;
|
||||||
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
|
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
|
||||||
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
|
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
|
||||||
|
import com.hzya.frame.web.entity.BaseResult;
|
||||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
import com.hzya.frame.web.exception.BaseSystemException;
|
import com.hzya.frame.web.exception.BaseSystemException;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
@ -185,7 +186,7 @@ public class ProxyPurchaseReturn extends PluginBaseEntity {
|
||||||
logger.error("thread.join();抛出异常", e);
|
logger.error("thread.join();抛出异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return BaseResult.getSuccessMessageEntity("插件执行成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -25,6 +25,7 @@ import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderDetails;
|
||||||
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderHeader;
|
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderHeader;
|
||||||
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
|
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
|
||||||
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
|
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
|
||||||
|
import com.hzya.frame.web.entity.BaseResult;
|
||||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -180,7 +181,7 @@ public class ProxyPurchaseWarehousOrder extends PluginBaseEntity {
|
||||||
logger.error("thread.join();抛出异常", e);
|
logger.error("thread.join();抛出异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return BaseResult.getSuccessMessageEntity("插件执行成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -23,6 +23,7 @@ import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderDetails;
|
||||||
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderHeader;
|
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderHeader;
|
||||||
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
|
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
|
||||||
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
|
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
|
||||||
|
import com.hzya.frame.web.entity.BaseResult;
|
||||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -183,7 +184,7 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
||||||
logger.error("thread.join();抛出异常", e);
|
logger.error("thread.join();抛出异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return BaseResult.getSuccessMessageEntity("插件执行成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -34,6 +34,7 @@ import com.hzya.frame.ttxofs.dto.returngoodordersearch.RerturnGoodsOrderSearchDe
|
||||||
import com.hzya.frame.ttxofs.dto.returngoodordersearch.RerturnGoodsOrderSearchHeader;
|
import com.hzya.frame.ttxofs.dto.returngoodordersearch.RerturnGoodsOrderSearchHeader;
|
||||||
import com.hzya.frame.ttxofs.dto.returngoodordersearch.RerturnGoodsOrderSearchJsonRootBean;
|
import com.hzya.frame.ttxofs.dto.returngoodordersearch.RerturnGoodsOrderSearchJsonRootBean;
|
||||||
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
|
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
|
||||||
|
import com.hzya.frame.web.entity.BaseResult;
|
||||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -145,7 +146,7 @@ public class RefundOnlyPluginInitializer extends PluginBaseEntity {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.error("executeBusiness方法抛出异常", e);
|
logger.error("executeBusiness方法抛出异常", e);
|
||||||
}
|
}
|
||||||
return null;
|
return BaseResult.getSuccessMessageEntity("插件执行成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void start() {
|
public void start() {
|
||||||
|
@ -250,13 +251,13 @@ public class RefundOnlyPluginInitializer extends PluginBaseEntity {
|
||||||
RerturnGoodsOrderSearchHeader header = returnGoodsOrder.getHeader();
|
RerturnGoodsOrderSearchHeader header = returnGoodsOrder.getHeader();
|
||||||
|
|
||||||
|
|
||||||
List<RerturnGoodsOrderSearchDetails> filterDetails=new ArrayList<>();
|
List<RerturnGoodsOrderSearchDetails> filterDetails = new ArrayList<>();
|
||||||
List<RerturnGoodsOrderSearchDetails> details = returnGoodsOrder.getDetails();
|
List<RerturnGoodsOrderSearchDetails> details = returnGoodsOrder.getDetails();
|
||||||
for (RerturnGoodsOrderSearchDetails detail : details) {
|
for (RerturnGoodsOrderSearchDetails detail : details) {
|
||||||
if(detail.getTotalAmount()==null||"0".equals(detail.getTotalAmount())||0==Double.parseDouble(detail.getTotalAmount())){
|
if (detail.getTotalAmount() == null || "0".equals(detail.getTotalAmount()) || 0 == Double.parseDouble(detail.getTotalAmount())) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
String rootAppPk = header.getCode()+"_"+detail.getSkuCode();
|
String rootAppPk = header.getCode() + "_" + detail.getSkuCode();
|
||||||
boolean isExis = true;
|
boolean isExis = true;
|
||||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||||
integrationTaskLivingDetailsEntity.setRootAppPk(rootAppPk);
|
integrationTaskLivingDetailsEntity.setRootAppPk(rootAppPk);
|
||||||
|
@ -270,9 +271,9 @@ public class RefundOnlyPluginInitializer extends PluginBaseEntity {
|
||||||
filterDetails.add(detail);
|
filterDetails.add(detail);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(filterDetails.size()==0){
|
if (filterDetails.size() == 0) {
|
||||||
continue;
|
continue;
|
||||||
}else {
|
} else {
|
||||||
returnGoodsOrder.setDetails(filterDetails);
|
returnGoodsOrder.setDetails(filterDetails);
|
||||||
filterReturnGoodsOrders.add(returnGoodsOrder);
|
filterReturnGoodsOrders.add(returnGoodsOrder);
|
||||||
}
|
}
|
||||||
|
@ -301,7 +302,7 @@ public class RefundOnlyPluginInitializer extends PluginBaseEntity {
|
||||||
String deptCode = "002";
|
String deptCode = "002";
|
||||||
if (ofsSaleOrder != null) {
|
if (ofsSaleOrder != null) {
|
||||||
// Assert.state(false,"根据仅退款:{},查询销售订单:{},失败!未查询到对应销售订单",filterReturnGoodsOrder.getHeader().getCode(),refOrderCode);
|
// Assert.state(false,"根据仅退款:{},查询销售订单:{},失败!未查询到对应销售订单",filterReturnGoodsOrder.getHeader().getCode(),refOrderCode);
|
||||||
if(ofsSaleOrder.getData().get(0).getHeader().getDepartmentType()!=null&&!"".equals((ofsSaleOrder.getData().get(0).getHeader().getDepartmentType()))){
|
if (ofsSaleOrder.getData().get(0).getHeader().getDepartmentType() != null && !"".equals((ofsSaleOrder.getData().get(0).getHeader().getDepartmentType()))) {
|
||||||
deptCode = ofsSaleOrder.getData().get(0).getHeader().getDepartmentType();
|
deptCode = ofsSaleOrder.getData().get(0).getHeader().getDepartmentType();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -311,8 +312,7 @@ public class RefundOnlyPluginInitializer extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
//分组:公司+店铺+部门+单据日期,仅退款没有仓库,固不去
|
//分组:公司+店铺+部门+单据日期,仅退款没有仓库,固不去
|
||||||
Map<String, List<RerturnGoodsOrderSearchHeader>> collect =
|
Map<String, List<RerturnGoodsOrderSearchHeader>> collect = allHeader.stream().collect(Collectors.groupingBy(index -> index.getCompanyCode() + "_" + index.getStoreCode() + "_" + index.getSaleDeptCode() + "_" + index.getCreated().substring(0, 10)));
|
||||||
allHeader.stream().collect(Collectors.groupingBy(index -> index.getCompanyCode() + "_" + index.getStoreCode() + "_" + index.getSaleDeptCode() + "_" + index.getCreated().substring(0,10)));
|
|
||||||
|
|
||||||
collect.forEach((k, v) -> {
|
collect.forEach((k, v) -> {
|
||||||
String[] split = k.split("_");//[0]公司 [1]店铺 [2]部门 [3]单据日期
|
String[] split = k.split("_");//[0]公司 [1]店铺 [2]部门 [3]单据日期
|
||||||
|
@ -324,7 +324,7 @@ public class RefundOnlyPluginInitializer extends PluginBaseEntity {
|
||||||
// String ofsCode = v.get(0).getCode();
|
// String ofsCode = v.get(0).getCode();
|
||||||
// String ofsId = v.get(0).getId();
|
// String ofsId = v.get(0).getId();
|
||||||
//日志记录使用
|
//日志记录使用
|
||||||
List<RerturnGoodsOrderSearchDetails> logDetails=new ArrayList<>();
|
List<RerturnGoodsOrderSearchDetails> logDetails = new ArrayList<>();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ArapDjzbVO arapDjzbVO = new ArapDjzbVO();
|
ArapDjzbVO arapDjzbVO = new ArapDjzbVO();
|
||||||
|
@ -366,11 +366,11 @@ public class RefundOnlyPluginInitializer extends PluginBaseEntity {
|
||||||
parentvo.setZyx3("SALES");
|
parentvo.setZyx3("SALES");
|
||||||
|
|
||||||
//子表,需要通过多个主表的id找到多个子表,且退货金额==0的不要
|
//子表,需要通过多个主表的id找到多个子表,且退货金额==0的不要
|
||||||
List<ArapDjzbVO.Childrenn> children=new ArrayList<>();
|
List<ArapDjzbVO.Childrenn> children = new ArrayList<>();
|
||||||
List<RerturnGoodsOrderSearchDetails> ofsDetails=new ArrayList<>();
|
List<RerturnGoodsOrderSearchDetails> ofsDetails = new ArrayList<>();
|
||||||
for (RerturnGoodsOrderSearchHeader rerturnGoodsOrderSearchHeader : v) {
|
for (RerturnGoodsOrderSearchHeader rerturnGoodsOrderSearchHeader : v) {
|
||||||
allDetail.stream().forEach(index->{
|
allDetail.stream().forEach(index -> {
|
||||||
if(rerturnGoodsOrderSearchHeader.getCode().equals(index.getReturnOrderCode())&&index.getTotalAmount()!=null&&!"0".equals(index.getTotalAmount())){
|
if (rerturnGoodsOrderSearchHeader.getCode().equals(index.getReturnOrderCode()) && index.getTotalAmount() != null && !"0".equals(index.getTotalAmount())) {
|
||||||
ofsDetails.add(index);
|
ofsDetails.add(index);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -383,16 +383,16 @@ public class RefundOnlyPluginInitializer extends PluginBaseEntity {
|
||||||
//cinventoryid 存货
|
//cinventoryid 存货
|
||||||
childrenn.setCinventoryid(ofsDetail.getSkuCode());
|
childrenn.setCinventoryid(ofsDetail.getSkuCode());
|
||||||
//jfbbje jfybje 借方本币金额/借方原币金额
|
//jfbbje jfybje 借方本币金额/借方原币金额
|
||||||
childrenn.setJfbbje("-"+ofsDetail.getTotalAmount());
|
childrenn.setJfbbje("-" + ofsDetail.getTotalAmount());
|
||||||
childrenn.setJfybje("-"+ofsDetail.getTotalAmount());
|
childrenn.setJfybje("-" + ofsDetail.getTotalAmount());
|
||||||
//jfbbsj jfybsj 借方本币税金/借方原币税金 默认(0.13)
|
//jfbbsj jfybsj 借方本币税金/借方原币税金 默认(0.13)
|
||||||
BigDecimal sj=new BigDecimal(ofsDetail.getTotalAmount()).multiply(new BigDecimal(0.13)).setScale(2, RoundingMode.FLOOR);
|
BigDecimal sj = new BigDecimal(ofsDetail.getTotalAmount()).multiply(new BigDecimal(0.13)).setScale(2, RoundingMode.FLOOR);
|
||||||
childrenn.setJfbbsj("-"+String.valueOf(sj));
|
childrenn.setJfbbsj("-" + String.valueOf(sj));
|
||||||
childrenn.setJfybsj("-"+String.valueOf(sj));
|
childrenn.setJfybsj("-" + String.valueOf(sj));
|
||||||
//wbfbbje jfybwsje 借方本币无税金额/借方原币无税金额
|
//wbfbbje jfybwsje 借方本币无税金额/借方原币无税金额
|
||||||
BigDecimal ws=new BigDecimal(ofsDetail.getTotalAmount()).subtract(sj);
|
BigDecimal ws = new BigDecimal(ofsDetail.getTotalAmount()).subtract(sj);
|
||||||
childrenn.setWbfbbje("-"+ws);
|
childrenn.setWbfbbje("-" + ws);
|
||||||
childrenn.setJfybwsje("-"+ws);
|
childrenn.setJfybwsje("-" + ws);
|
||||||
//zyx4 平台优惠
|
//zyx4 平台优惠
|
||||||
childrenn.setZyx4(String.valueOf(ofsDetail.getShareTargetPlatformDiscounts()));
|
childrenn.setZyx4(String.valueOf(ofsDetail.getShareTargetPlatformDiscounts()));
|
||||||
//zyx5 支付优惠
|
//zyx5 支付优惠
|
||||||
|
@ -407,7 +407,7 @@ public class RefundOnlyPluginInitializer extends PluginBaseEntity {
|
||||||
arapDjzbVO.setParentvo(parentvo);
|
arapDjzbVO.setParentvo(parentvo);
|
||||||
arapDjzbVO.setChildren(children);
|
arapDjzbVO.setChildren(children);
|
||||||
System.out.println(arapDjzbVO);
|
System.out.println(arapDjzbVO);
|
||||||
mapStr="{\"djzbvo\":["+ JSONUtil.toJsonStr(arapDjzbVO) +"]}";
|
mapStr = "{\"djzbvo\":[" + JSONUtil.toJsonStr(arapDjzbVO) + "]}";
|
||||||
System.out.println(mapStr);
|
System.out.println(mapStr);
|
||||||
|
|
||||||
//推送
|
//推送
|
||||||
|
@ -443,7 +443,7 @@ public class RefundOnlyPluginInitializer extends PluginBaseEntity {
|
||||||
integrationTaskLivingDetailsEntity.setNewTransmitInfo(response);
|
integrationTaskLivingDetailsEntity.setNewTransmitInfo(response);
|
||||||
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
|
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
|
||||||
integrationTaskLivingDetailsEntity.setBusinessDate(format);
|
integrationTaskLivingDetailsEntity.setBusinessDate(format);
|
||||||
integrationTaskLivingDetailsEntity.setRootAppPk(ofsDetail.getReturnOrderCode()+"_"+ofsDetail.getSkuCode());
|
integrationTaskLivingDetailsEntity.setRootAppPk(ofsDetail.getReturnOrderCode() + "_" + ofsDetail.getSkuCode());
|
||||||
integrationTaskLivingDetailsEntity.setRootAppBill(ofsDetail.getReturnOrderCode());//仅退款单号
|
integrationTaskLivingDetailsEntity.setRootAppBill(ofsDetail.getReturnOrderCode());//仅退款单号
|
||||||
integrationTaskLivingDetailsEntity.setNewSystemNumber(djbh);
|
integrationTaskLivingDetailsEntity.setNewSystemNumber(djbh);
|
||||||
integrationTaskLivingDetailsEntity.setNewSystemPrimary(vouchid);
|
integrationTaskLivingDetailsEntity.setNewSystemPrimary(vouchid);
|
||||||
|
@ -456,10 +456,10 @@ public class RefundOnlyPluginInitializer extends PluginBaseEntity {
|
||||||
//失败
|
//失败
|
||||||
|
|
||||||
ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class);
|
ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class);
|
||||||
String ErrMessage="";
|
String ErrMessage = "";
|
||||||
if (reusltStrDto != null) {
|
if (reusltStrDto != null) {
|
||||||
ErrMessage = "推送U8C,丽知:OFS调整入库(组装入库)--->U8C组装订单失败,失败原因:" + reusltStrDto.getErrormsg();
|
ErrMessage = "推送U8C,丽知:OFS调整入库(组装入库)--->U8C组装订单失败,失败原因:" + reusltStrDto.getErrormsg();
|
||||||
}else {
|
} else {
|
||||||
ErrMessage = "推送U8C,丽知:OFS调整入库(组装入库)--->U8C组装订单失败,失败原因:" + e.getMessage();
|
ErrMessage = "推送U8C,丽知:OFS调整入库(组装入库)--->U8C组装订单失败,失败原因:" + e.getMessage();
|
||||||
}
|
}
|
||||||
//失败 批量新增 ofsDetails
|
//失败 批量新增 ofsDetails
|
||||||
|
@ -470,7 +470,7 @@ public class RefundOnlyPluginInitializer extends PluginBaseEntity {
|
||||||
integrationTaskLivingDetailsEntity.setNewTransmitInfo(ErrMessage);
|
integrationTaskLivingDetailsEntity.setNewTransmitInfo(ErrMessage);
|
||||||
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
|
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
|
||||||
integrationTaskLivingDetailsEntity.setBusinessDate(format);
|
integrationTaskLivingDetailsEntity.setBusinessDate(format);
|
||||||
integrationTaskLivingDetailsEntity.setRootAppPk(logDetail.getReturnOrderCode()+"_"+logDetail.getSkuCode());
|
integrationTaskLivingDetailsEntity.setRootAppPk(logDetail.getReturnOrderCode() + "_" + logDetail.getSkuCode());
|
||||||
integrationTaskLivingDetailsEntity.setRootAppBill(logDetail.getReturnOrderCode());
|
integrationTaskLivingDetailsEntity.setRootAppBill(logDetail.getReturnOrderCode());
|
||||||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||||
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
||||||
|
@ -642,6 +642,7 @@ public class RefundOnlyPluginInitializer extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
return all;
|
return all;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ArapDjzb resultDataHandle(String resultData) {
|
private ArapDjzb resultDataHandle(String resultData) {
|
||||||
try {
|
try {
|
||||||
if (resultData != null && !"".equals(resultData)) {
|
if (resultData != null && !"".equals(resultData)) {
|
||||||
|
|
|
@ -29,6 +29,7 @@ import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto;
|
||||||
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDto;
|
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDto;
|
||||||
import com.hzya.frame.ttxofs.dto.ofssalesordersearch.SaleOrderMessageDto;
|
import com.hzya.frame.ttxofs.dto.ofssalesordersearch.SaleOrderMessageDto;
|
||||||
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
|
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
|
||||||
|
import com.hzya.frame.web.entity.BaseResult;
|
||||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -160,7 +161,7 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
||||||
logger.error("thread.join();抛出异常", e);
|
logger.error("thread.join();抛出异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return BaseResult.getSuccessMessageEntity("插件执行成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
|
@ -33,6 +33,7 @@ import com.hzya.frame.ttxofs.dto.ofssalesordersearch.SaleOrderMessageDto;
|
||||||
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
|
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
|
||||||
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
|
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
|
||||||
import com.hzya.frame.u8c.ax.entity.Ass;
|
import com.hzya.frame.u8c.ax.entity.Ass;
|
||||||
|
import com.hzya.frame.web.entity.BaseResult;
|
||||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
import com.hzya.frame.web.exception.BaseSystemException;
|
import com.hzya.frame.web.exception.BaseSystemException;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
@ -154,7 +155,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
logger.error("thread.join();抛出异常", e);
|
logger.error("thread.join();抛出异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return BaseResult.getSuccessMessageEntity("插件执行成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
|
@ -35,6 +35,7 @@ import com.hzya.frame.ttxofs.dto.returngoodordersearch.RerturnGoodsOrderSearchDe
|
||||||
import com.hzya.frame.ttxofs.dto.returngoodordersearch.RerturnGoodsOrderSearchHeader;
|
import com.hzya.frame.ttxofs.dto.returngoodordersearch.RerturnGoodsOrderSearchHeader;
|
||||||
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
|
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
|
||||||
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
|
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
|
||||||
|
import com.hzya.frame.web.entity.BaseResult;
|
||||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -150,7 +151,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
|
||||||
logger.error("thread.join();抛出异常", e);
|
logger.error("thread.join();抛出异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return BaseResult.getSuccessMessageEntity("插件执行成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -321,7 +322,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
|
||||||
long startMillis = System.currentTimeMillis();
|
long startMillis = System.currentTimeMillis();
|
||||||
String threadNameStrStart = StrUtil.format("OFS售后入库(TOB)同步U8C销售订单(库存同步) 售后入库单号:{}", code);
|
String threadNameStrStart = StrUtil.format("OFS售后入库(TOB)同步U8C销售订单(库存同步) 售后入库单号:{}", code);
|
||||||
logger.info(threadNameStrStart);
|
logger.info(threadNameStrStart);
|
||||||
|
|
||||||
Assert.notNull(code, "code不能为空");
|
Assert.notNull(code, "code不能为空");
|
||||||
//生成一个时间范围
|
//生成一个时间范围
|
||||||
// StartAndEndVo startAndEndVo = offsetTimeTime.offsetTime();
|
// StartAndEndVo startAndEndVo = offsetTimeTime.offsetTime();
|
||||||
|
|
|
@ -33,6 +33,7 @@ import com.hzya.frame.ttxofs.dto.returngoodordersearch.RerturnGoodsOrderSearchHe
|
||||||
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
|
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
|
||||||
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
|
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
|
||||||
import com.hzya.frame.u8c.ax.entity.Ass;
|
import com.hzya.frame.u8c.ax.entity.Ass;
|
||||||
|
import com.hzya.frame.web.entity.BaseResult;
|
||||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -145,7 +146,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
logger.error("thread.join();抛出异常", e);
|
logger.error("thread.join();抛出异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return BaseResult.getSuccessMessageEntity("插件执行成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
Loading…
Reference in New Issue