|
|
|
@ -18,6 +18,7 @@ import com.hzya.frame.plugin.lets.u8cdto.*;
|
|
|
|
|
import com.hzya.frame.plugin.lets.util.*;
|
|
|
|
|
import com.hzya.frame.split.SplitListByCountUtil;
|
|
|
|
|
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
|
|
|
|
|
import com.hzya.frame.ttxofs.dto.ofsReceiptConfirmSearch.OFSReceiptConfirmSearchResponse;
|
|
|
|
|
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderData;
|
|
|
|
|
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderDetails;
|
|
|
|
|
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderHeader;
|
|
|
|
@ -37,6 +38,12 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 代理品牌采购业务:(代理品牌采购)OFS采购入库单生成U8C采购入库单(关联原采购订单)
|
|
|
|
|
* <p>
|
|
|
|
|
* 2025 年 3 月 11 日 14:49:52
|
|
|
|
|
* 调整为:
|
|
|
|
|
* OFS采购入库确认单(成品、代理)生成U8C采购入库单(关联原采购订单)
|
|
|
|
|
* 2025 年 3 月 11 日 17:11:30
|
|
|
|
|
* 和妮姐确认过了,推送到 U8C 采购入库单符合业务要求,没有字段缺失
|
|
|
|
|
*
|
|
|
|
|
* @Author:liuyang
|
|
|
|
|
* @Package:com.hzya.frame.plugin.lets.plugin.purchase
|
|
|
|
@ -127,12 +134,12 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String getPluginName() {
|
|
|
|
|
return "OFS采购入库单生成U8C采购入库单(代理品牌)";
|
|
|
|
|
return "OFS采购入库确认单(成品、代理)生成U8C采购入库单(关联原采购订单)";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String getPluginLabel() {
|
|
|
|
|
return "OFS采购入库单生成U8C采购入库单(代理品牌)";
|
|
|
|
|
return "OFS采购入库确认单(成品、代理)生成U8C采购入库单(关联原采购订单)";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -207,31 +214,31 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
*/
|
|
|
|
|
public void startImplementByTime(String startTime, String endTime) {
|
|
|
|
|
long startMillis = System.currentTimeMillis();
|
|
|
|
|
String threadNameStrStart = StrUtil.format("开始(代理品牌采购)OFS采购入库单生成U8C采购订单 开始时间:{} 结束时间:{}", startTime, endTime);
|
|
|
|
|
String threadNameStrStart = StrUtil.format("开始(代理、成品采购)OFS采购入库单生成U8C采购订单 开始时间:{} 结束时间:{}", startTime, endTime);
|
|
|
|
|
logger.info(threadNameStrStart);
|
|
|
|
|
|
|
|
|
|
Thread thread = new Thread(new Runnable() {
|
|
|
|
|
@Override
|
|
|
|
|
public void run() {
|
|
|
|
|
try {
|
|
|
|
|
List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>();
|
|
|
|
|
List<OFSReceiptConfirmSearchResponse.Order> ofsWareConfirmaDataArrayList = new ArrayList<>();
|
|
|
|
|
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
|
|
|
|
|
queryOfsSoSaleOutVo.setClosedAt_start(startTime);
|
|
|
|
|
queryOfsSoSaleOutVo.setClosedAt_end(endTime);
|
|
|
|
|
queryOfsSoSaleOutVo.setReceivedAt_start(startTime);
|
|
|
|
|
queryOfsSoSaleOutVo.setReceivedAt_end(endTime);
|
|
|
|
|
queryOfsSoSaleOutVo.setClientCode("LETS");
|
|
|
|
|
queryOfsSoSaleOutVo.setPageNo(1L);
|
|
|
|
|
queryOfsSoSaleOutVo.setPageSize(50L);
|
|
|
|
|
queryOfsSoSaleOutVo.setInternalInstructionType("PURCHASE");
|
|
|
|
|
queryOfsSoSaleOutVo.setStatus(900L);
|
|
|
|
|
ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search");
|
|
|
|
|
logger.info("插件:{} O接口返回行数:{} 时间段:{} {}", getPluginName(), returnGoodHeaderDetailsDataDtoArrayList.size(), startTime, endTime);
|
|
|
|
|
printOfsDocCode(returnGoodHeaderDetailsDataDtoArrayList, startTime, endTime);
|
|
|
|
|
ofsStandardUtil.queryOfsWarehouseConfirOrder(queryOfsSoSaleOutVo, ofsWareConfirmaDataArrayList, 1L, "ofs.receipt.confirm.search");
|
|
|
|
|
logger.info("插件:{} O接口返回行数:{} 时间段:{} {}", getPluginName(), ofsWareConfirmaDataArrayList.size(), startTime, endTime);
|
|
|
|
|
printOfsDocCode(ofsWareConfirmaDataArrayList, startTime, endTime);
|
|
|
|
|
|
|
|
|
|
if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
|
|
|
|
|
returnGoodHeaderDetailsDataDtoArrayList.removeIf(new Predicate<StockinOrderSearchResponse.StockinOrder>() {
|
|
|
|
|
if (ofsWareConfirmaDataArrayList.size() > 0) {
|
|
|
|
|
ofsWareConfirmaDataArrayList.removeIf(new Predicate<OFSReceiptConfirmSearchResponse.Order>() {
|
|
|
|
|
@Override
|
|
|
|
|
public boolean test(StockinOrderSearchResponse.StockinOrder headerDetailsDto) {
|
|
|
|
|
StockinOrderSearchResponse.StockinOrder.StockinH header = headerDetailsDto.getHeader();
|
|
|
|
|
public boolean test(OFSReceiptConfirmSearchResponse.Order headerDetailsDto) {
|
|
|
|
|
OFSReceiptConfirmSearchResponse.Header header = headerDetailsDto.getHeader();
|
|
|
|
|
if (header != null && header.getCompanyCode() != null) {
|
|
|
|
|
if (ProfilesActiveConstant.FILTER_COMPANY.contains(header.getCompanyCode().trim())) {
|
|
|
|
|
return true;
|
|
|
|
@ -240,7 +247,7 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
getSet(returnGoodHeaderDetailsDataDtoArrayList);
|
|
|
|
|
getSet(ofsWareConfirmaDataArrayList);
|
|
|
|
|
} else {
|
|
|
|
|
logger.info("没有查询到任何数据!不需要同步");
|
|
|
|
|
}
|
|
|
|
@ -256,7 +263,7 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
logger.error("thread.join()异常", e);
|
|
|
|
|
}
|
|
|
|
|
long endMillis = System.currentTimeMillis();
|
|
|
|
|
String threadNameStrEnd = StrUtil.format("结束(代理品牌采购)OFS采购入库单生成U8C采购订单 开始时间:{} 结束时间:{} 耗时:{}", startTime, endTime, (endMillis - startMillis));
|
|
|
|
|
String threadNameStrEnd = StrUtil.format("结束(代理、产品采购)OFS采购入库单生成U8C采购订单 开始时间:{} 结束时间:{} 耗时:{}", startTime, endTime, (endMillis - startMillis));
|
|
|
|
|
logger.info(threadNameStrEnd);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -267,28 +274,30 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
*/
|
|
|
|
|
public void startImplementByCode(String code) {
|
|
|
|
|
long startTime = System.currentTimeMillis();
|
|
|
|
|
String threadNameStrStart = StrUtil.format("(代理品牌采购)OFS采购入库单生成U8C采购订单开始 采购入库单号:{}", code);
|
|
|
|
|
String threadNameStrStart = StrUtil.format("(代理、成品采购)OFS采购入库确认单生成U8C采购入库单开始 采购入库确认单号:{}", code);
|
|
|
|
|
logger.info(threadNameStrStart);
|
|
|
|
|
|
|
|
|
|
Thread thread = new Thread(new Runnable() {
|
|
|
|
|
@Override
|
|
|
|
|
public void run() {
|
|
|
|
|
try {
|
|
|
|
|
List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>();
|
|
|
|
|
List<OFSReceiptConfirmSearchResponse.Order> ofsWareConfirmaDataArrayList = new ArrayList<>();
|
|
|
|
|
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
|
|
|
|
|
queryOfsSoSaleOutVo.setClientCode("LETS");
|
|
|
|
|
queryOfsSoSaleOutVo.setPageNo(1L);
|
|
|
|
|
queryOfsSoSaleOutVo.setPageSize(50L);
|
|
|
|
|
queryOfsSoSaleOutVo.setCode(code);
|
|
|
|
|
queryOfsSoSaleOutVo.setInternalInstructionType("PURCHASE");
|
|
|
|
|
queryOfsSoSaleOutVo.setStatus(900L);
|
|
|
|
|
ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search");
|
|
|
|
|
logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size());
|
|
|
|
|
if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
|
|
|
|
|
returnGoodHeaderDetailsDataDtoArrayList.removeIf(new Predicate<StockinOrderSearchResponse.StockinOrder>() {
|
|
|
|
|
queryOfsSoSaleOutVo.setCode(code);
|
|
|
|
|
// queryOfsSoSaleOutVo.setStatus(900L);
|
|
|
|
|
ofsStandardUtil.queryOfsWarehouseConfirOrder(queryOfsSoSaleOutVo, ofsWareConfirmaDataArrayList, 1L, "ofs.receipt.confirm.search");
|
|
|
|
|
logger.info("插件:{} O接口返回行数:{} 编码:{}", getPluginName(), ofsWareConfirmaDataArrayList.size(), code);
|
|
|
|
|
printOfsDocCode(ofsWareConfirmaDataArrayList, code);
|
|
|
|
|
|
|
|
|
|
if (ofsWareConfirmaDataArrayList.size() > 0) {
|
|
|
|
|
ofsWareConfirmaDataArrayList.removeIf(new Predicate<OFSReceiptConfirmSearchResponse.Order>() {
|
|
|
|
|
@Override
|
|
|
|
|
public boolean test(StockinOrderSearchResponse.StockinOrder headerDetailsDto) {
|
|
|
|
|
StockinOrderSearchResponse.StockinOrder.StockinH header = headerDetailsDto.getHeader();
|
|
|
|
|
public boolean test(OFSReceiptConfirmSearchResponse.Order headerDetailsDto) {
|
|
|
|
|
OFSReceiptConfirmSearchResponse.Header header = headerDetailsDto.getHeader();
|
|
|
|
|
if (header != null && header.getCompanyCode() != null) {
|
|
|
|
|
if (ProfilesActiveConstant.FILTER_COMPANY.contains(header.getCompanyCode().trim())) {
|
|
|
|
|
return true;
|
|
|
|
@ -297,7 +306,7 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
getSet(returnGoodHeaderDetailsDataDtoArrayList);
|
|
|
|
|
getSet(ofsWareConfirmaDataArrayList);
|
|
|
|
|
} else {
|
|
|
|
|
logger.info("没有查询到任何数据!不需要同步");
|
|
|
|
|
}
|
|
|
|
@ -313,7 +322,7 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
logger.error("thread.join()异常", e);
|
|
|
|
|
}
|
|
|
|
|
long endTime = System.currentTimeMillis();
|
|
|
|
|
String threadNameStrEnd = StrUtil.format("(代理品牌采购)OFS采购入库单生成U8C采购订单结束 采购入库单号:{} 耗时:{}", code, (endTime - startTime));
|
|
|
|
|
String threadNameStrEnd = StrUtil.format("(代理、成品采购)OFS采购入库确认单生成U8C采购入库单结束 采购入库确认单号:{} 耗时:{}", code, (endTime - startTime));
|
|
|
|
|
logger.info(threadNameStrEnd);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -352,16 +361,16 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
/**
|
|
|
|
|
* 环境预配置
|
|
|
|
|
*
|
|
|
|
|
* @param returnGoodHeaderDetailsDataDtoArrayList 采购入库单
|
|
|
|
|
* @param ofsReceiptConfirmSearchResponse 采购入库确认单
|
|
|
|
|
* @author liuyang
|
|
|
|
|
*/
|
|
|
|
|
private void getSet(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList) throws Exception {
|
|
|
|
|
private void getSet(List<OFSReceiptConfirmSearchResponse.Order> ofsReceiptConfirmSearchResponse) throws Exception {
|
|
|
|
|
LOCK1.lock();
|
|
|
|
|
try {
|
|
|
|
|
//过滤成功的数据
|
|
|
|
|
List<StockinOrderSearchResponse.StockinOrder> stockinOrderList = filterData(returnGoodHeaderDetailsDataDtoArrayList);
|
|
|
|
|
List<OFSReceiptConfirmSearchResponse.Order> orders = filterData(ofsReceiptConfirmSearchResponse);
|
|
|
|
|
//执行推送主逻辑
|
|
|
|
|
implement(stockinOrderList);
|
|
|
|
|
implement(orders);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("getSet抛出异常", e);
|
|
|
|
|
} finally {
|
|
|
|
@ -374,36 +383,36 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
*
|
|
|
|
|
* @author liuyang
|
|
|
|
|
*/
|
|
|
|
|
private List<StockinOrderSearchResponse.StockinOrder> filterData(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList) {
|
|
|
|
|
List<StockinOrderSearchResponse.StockinOrder> headerDetailsDtoList1 = new ArrayList<>();
|
|
|
|
|
private List<OFSReceiptConfirmSearchResponse.Order> filterData(List<OFSReceiptConfirmSearchResponse.Order> returnGoodHeaderDetailsDataDtoArrayList) {
|
|
|
|
|
List<OFSReceiptConfirmSearchResponse.Order> headerDetailsDtoList1 = new ArrayList<>();
|
|
|
|
|
//查询得到已经成功的日志,成功或者已处理
|
|
|
|
|
List<IntegrationTaskLivingDetailsEntity> successIntegrationTaskLivingDetails = new ArrayList<>();
|
|
|
|
|
try {
|
|
|
|
|
if (returnGoodHeaderDetailsDataDtoArrayList != null && returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
|
|
|
|
|
//每100个开始拆分
|
|
|
|
|
List<List<StockinOrderSearchResponse.StockinOrder>> splitListByCount = SplitListByCountUtil.splitListByCount(returnGoodHeaderDetailsDataDtoArrayList, 100);
|
|
|
|
|
for (int i = 0; i < splitListByCount.size(); i++) {
|
|
|
|
|
List<StockinOrderSearchResponse.StockinOrder> stockinOrderList = splitListByCount.get(i);
|
|
|
|
|
String primaryKey = fieldConcaten(stockinOrderList);
|
|
|
|
|
List<List<OFSReceiptConfirmSearchResponse.Order>> lists = SplitListByCountUtil.splitListByCount(returnGoodHeaderDetailsDataDtoArrayList, 100);
|
|
|
|
|
for (int i = 0; i < lists.size(); i++) {
|
|
|
|
|
List<OFSReceiptConfirmSearchResponse.Order> orders = lists.get(i);
|
|
|
|
|
String primaryKey = fieldConcaten(orders);
|
|
|
|
|
|
|
|
|
|
List<IntegrationTaskLivingDetailsEntity> integrationTaskLivingDetailsEntities = integrationTaskLivingDetailsUtil.queryIntegrationTaskLivingDetails(primaryKey, getPluginId());
|
|
|
|
|
successIntegrationTaskLivingDetails.addAll(integrationTaskLivingDetailsEntities);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < returnGoodHeaderDetailsDataDtoArrayList.size(); i++) {
|
|
|
|
|
StockinOrderSearchResponse.StockinOrder stockinOrder = returnGoodHeaderDetailsDataDtoArrayList.get(i);
|
|
|
|
|
StockinOrderSearchResponse.StockinOrder.StockinH header = stockinOrder.getHeader();
|
|
|
|
|
List<StockinOrderSearchResponse.StockinOrder.StockinB> details = stockinOrder.getDetails();
|
|
|
|
|
OFSReceiptConfirmSearchResponse.Order order = returnGoodHeaderDetailsDataDtoArrayList.get(i);
|
|
|
|
|
OFSReceiptConfirmSearchResponse.Header header = order.getHeader();
|
|
|
|
|
List<OFSReceiptConfirmSearchResponse.Detail> details = order.getDetails();
|
|
|
|
|
|
|
|
|
|
boolean isExi = false;
|
|
|
|
|
for (int j = 0; j < successIntegrationTaskLivingDetails.size(); j++) {
|
|
|
|
|
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = successIntegrationTaskLivingDetails.get(j);
|
|
|
|
|
if (integrationTaskLivingDetailsEntity.getRootAppPk().equals(header.getId())) {
|
|
|
|
|
if (integrationTaskLivingDetailsEntity.getRootAppPk() != null && integrationTaskLivingDetailsEntity.getRootAppPk().equals(header.getId())) {
|
|
|
|
|
isExi = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!isExi) {
|
|
|
|
|
headerDetailsDtoList1.add(stockinOrder);
|
|
|
|
|
headerDetailsDtoList1.add(order);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -415,15 +424,14 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 字段拼接
|
|
|
|
|
*
|
|
|
|
|
* @author liuyang
|
|
|
|
|
*/
|
|
|
|
|
private String fieldConcaten(List<StockinOrderSearchResponse.StockinOrder> stockinOrderList) {
|
|
|
|
|
private String fieldConcaten(List<OFSReceiptConfirmSearchResponse.Order> stockinOrderList) {
|
|
|
|
|
if (stockinOrderList != null && stockinOrderList.size() > 0) {
|
|
|
|
|
StringBuilder result = new StringBuilder();
|
|
|
|
|
for (StockinOrderSearchResponse.StockinOrder obj : stockinOrderList) {
|
|
|
|
|
StockinOrderSearchResponse.StockinOrder.StockinH header = obj.getHeader();
|
|
|
|
|
// if (result.length() > 0) {
|
|
|
|
|
// result.append(",");
|
|
|
|
|
// }
|
|
|
|
|
for (OFSReceiptConfirmSearchResponse.Order obj : stockinOrderList) {
|
|
|
|
|
OFSReceiptConfirmSearchResponse.Header header = obj.getHeader();
|
|
|
|
|
result.append("'").append(header.getId()).append("'").append(",");
|
|
|
|
|
}
|
|
|
|
|
return result.substring(0, result.length() - 1);
|
|
|
|
@ -436,11 +444,11 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
*
|
|
|
|
|
* @author liuyang
|
|
|
|
|
*/
|
|
|
|
|
private void implement(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoList) throws Exception {
|
|
|
|
|
if (returnGoodHeaderDetailsDataDtoList != null && returnGoodHeaderDetailsDataDtoList.size() > 0) {
|
|
|
|
|
private void implement(List<OFSReceiptConfirmSearchResponse.Order> orderList) throws Exception {
|
|
|
|
|
if (orderList != null && orderList.size() > 0) {
|
|
|
|
|
try {
|
|
|
|
|
// 查询基本档案
|
|
|
|
|
List<PoOrderSonDto> poOrderSonDtos = queryBasicArchives(returnGoodHeaderDetailsDataDtoList);
|
|
|
|
|
List<PoOrderSonDto> poOrderSonDtos = queryBasicArchives(orderList);
|
|
|
|
|
// 代理品牌采购业务流程
|
|
|
|
|
// BdBusitypeEntity bdBusitypeEntity = u8cOperationFlow();
|
|
|
|
|
// 查询采购收发类别
|
|
|
|
@ -449,7 +457,7 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
if (poOrderSonDtos != null && poOrderSonDtos.size() > 0) {
|
|
|
|
|
for (int i = 0; i < poOrderSonDtos.size(); i++) {
|
|
|
|
|
PoOrderSonDto poOrderSonDto = poOrderSonDtos.get(i);
|
|
|
|
|
List<StockinOrderSearchResponse.StockinOrder.StockinB> details = poOrderSonDto.getDetails();
|
|
|
|
|
List<OFSReceiptConfirmSearchResponse.Detail> details = poOrderSonDto.getDetails();
|
|
|
|
|
|
|
|
|
|
String generateBusinessDate = null;
|
|
|
|
|
try {
|
|
|
|
@ -502,24 +510,33 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
List<PurchaseReceiptBodyDto> purchaseReceiptBodyDtos = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
for (int j = 0; j < details.size(); j++) {
|
|
|
|
|
StockinOrderSearchResponse.StockinOrder.StockinB stockinB = details.get(j);
|
|
|
|
|
|
|
|
|
|
OFSReceiptConfirmSearchResponse.Detail detail = details.get(j);
|
|
|
|
|
//OFS采购订单明细行
|
|
|
|
|
OfsPoOrderDetails ofsPoOrderDetail = findOfsPoOrderDetail(ofsPoOrderDataDetails, stockinB);
|
|
|
|
|
OfsPoOrderDetails ofsPoOrderDetail = findOfsPoOrderDetail(ofsPoOrderDataDetails, detail);
|
|
|
|
|
//U8C采购订单明细行
|
|
|
|
|
PoOrderBEntity poOrderBEntity = findPoOrderBEntity(stockinB, poOrderBEntityList);
|
|
|
|
|
PoOrderBEntity poOrderBEntity = findPoOrderBEntity(detail, poOrderBEntityList);
|
|
|
|
|
|
|
|
|
|
//2024年8月20日 16:02:21 已经和妮姐、万万确认,采购公司和收货公司目前是一致的,暂时不用区分取数逻辑
|
|
|
|
|
BdInvmandocEntity bdInvmandocEntity = queryInventoryMan(stockinB, bdCorpEntity.getPkCorp());
|
|
|
|
|
String receivedQty = stockinB.getReceivedQty();//实收数量
|
|
|
|
|
String discountPrice = ofsPoOrderDetail.getDiscountPrice();//实际进价
|
|
|
|
|
BdInvmandocEntity bdInvmandocEntity = queryInventoryMan(detail, bdCorpEntity.getPkCorp());
|
|
|
|
|
|
|
|
|
|
//实收数量
|
|
|
|
|
String receivedQty = detail.getReceivedQty();
|
|
|
|
|
if (receivedQty == null || "".equals(receivedQty)) {
|
|
|
|
|
Assert.state(false, "实收数量不能为空!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//实际进价
|
|
|
|
|
String discountPrice = ofsPoOrderDetail.getDiscountPrice();
|
|
|
|
|
if (discountPrice == null || "".equals(discountPrice)) {
|
|
|
|
|
Assert.state(false, "实际进价不能为空!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//含税单价
|
|
|
|
|
BigDecimal noriginalcurprice = null;
|
|
|
|
|
//含税金额=含税单价*数量
|
|
|
|
|
BigDecimal ntaxmny = null;
|
|
|
|
|
try {
|
|
|
|
|
noriginalcurprice = new BigDecimal(discountPrice);
|
|
|
|
|
noriginalcurprice = new BigDecimal(discountPrice).setScale(4, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
ntaxmny = noriginalcurprice.multiply(new BigDecimal(receivedQty)).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("计算采购入库单原币含税单价失败", e);
|
|
|
|
@ -581,7 +598,7 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
cgeneralhid = parentvo.getCgeneralhid();
|
|
|
|
|
vbillcode = parentvo.getVbillcode();
|
|
|
|
|
}
|
|
|
|
|
logger.info("推送U8C代理品牌采购入库单成功!U8C采购订单主键:{} U8C采购订单编码:{}", cgeneralhid, vbillcode);
|
|
|
|
|
logger.info("推送U8C代理、成品采购入库单成功!U8C采购订单主键:{} U8C采购订单编码:{}", cgeneralhid, vbillcode);
|
|
|
|
|
|
|
|
|
|
// 成功记录日志
|
|
|
|
|
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
|
|
|
@ -597,7 +614,7 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
integrationTaskLivingDetailsEntity.setNewSystemPrimary(cgeneralhid);//下游单据主键
|
|
|
|
|
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("推送U8C代理品牌采购入库单失败", e);
|
|
|
|
|
logger.error("推送U8C代理、成品采购入库单失败", e);
|
|
|
|
|
|
|
|
|
|
// 失败记录日志
|
|
|
|
|
String message = e.getMessage();
|
|
|
|
@ -628,21 +645,23 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
/**
|
|
|
|
|
* 档案转换
|
|
|
|
|
*
|
|
|
|
|
* @param returnGoodHeaderDetailsDataDtoList 查询OFS采购入库确认单
|
|
|
|
|
* @author liuyang
|
|
|
|
|
*/
|
|
|
|
|
private List<PoOrderSonDto> queryBasicArchives(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoList) {
|
|
|
|
|
private List<PoOrderSonDto> queryBasicArchives(List<OFSReceiptConfirmSearchResponse.Order> returnGoodHeaderDetailsDataDtoList) {
|
|
|
|
|
List<PoOrderSonDto> poOrderSonDtoArrayList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
if (returnGoodHeaderDetailsDataDtoList != null && returnGoodHeaderDetailsDataDtoList.size() > 0) {
|
|
|
|
|
try {
|
|
|
|
|
for (int i = 0; i < returnGoodHeaderDetailsDataDtoList.size(); i++) {
|
|
|
|
|
StockinOrderSearchResponse.StockinOrder stockinOrder = returnGoodHeaderDetailsDataDtoList.get(i);
|
|
|
|
|
StockinOrderSearchResponse.StockinOrder.StockinH header = stockinOrder.getHeader();
|
|
|
|
|
List<StockinOrderSearchResponse.StockinOrder.StockinB> details = stockinOrder.getDetails();
|
|
|
|
|
OFSReceiptConfirmSearchResponse.Order order = returnGoodHeaderDetailsDataDtoList.get(i);
|
|
|
|
|
OFSReceiptConfirmSearchResponse.Header header = order.getHeader();
|
|
|
|
|
List<OFSReceiptConfirmSearchResponse.Detail> details = order.getDetails();
|
|
|
|
|
|
|
|
|
|
String generateBusinessDate = null;
|
|
|
|
|
try {
|
|
|
|
|
generateBusinessDate = createGenerateBusinessDate(stockinOrder);
|
|
|
|
|
//生成业务日期
|
|
|
|
|
generateBusinessDate = createGenerateBusinessDate(header);
|
|
|
|
|
|
|
|
|
|
//查询OFS采购订单
|
|
|
|
|
OfsPoOrderData ofsPoOrderData = ofsStandardUtil.queryOfsPoOrder(header.getRefOrderCode());
|
|
|
|
@ -651,6 +670,8 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
if (!checkResult) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
OfsPoOrderHeader header1 = ofsPoOrderData.getHeader();
|
|
|
|
|
List<OfsPoOrderDetails> details1 = ofsPoOrderData.getDetails();
|
|
|
|
|
|
|
|
|
|
//采购公司
|
|
|
|
|
String companyCode = header.getCompanyCode();
|
|
|
|
@ -698,7 +719,7 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
//客商基本档案(供应商类型)
|
|
|
|
|
//2024年8月20日 14:47:55 丽知商城、OFS 供应商客商档案、传递到U8C的客商,
|
|
|
|
|
//其中自定义项1作为原系统编码,因此统一传到自定义项一,已经和大家确认好了,没有关系的,放心大胆传吧,宝贝
|
|
|
|
|
String shipFromCode = header.getShipFromCode();
|
|
|
|
|
String shipFromCode = header1.getVendorCode();
|
|
|
|
|
//测试
|
|
|
|
|
// shipFromCode = "dy-off";
|
|
|
|
|
Assert.notNull(shipFromCode, "O供应商编码不能为空,没有办法完成业务逻辑,请配置供应商编码(采购)");
|
|
|
|
@ -805,7 +826,7 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
//失败
|
|
|
|
|
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
|
|
|
|
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N);
|
|
|
|
|
integrationTaskLivingDetailsEntity.setRootAppNewData(JSON.toJSONString(stockinOrder));//原始数据json
|
|
|
|
|
integrationTaskLivingDetailsEntity.setRootAppNewData(JSON.toJSONString(order));//原始数据json
|
|
|
|
|
integrationTaskLivingDetailsEntity.setNewTransmitInfo(JSON.toJSONString(message));//返回结果
|
|
|
|
|
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
|
|
|
|
|
integrationTaskLivingDetailsEntity.setBusinessDate(generateBusinessDate);
|
|
|
|
@ -817,7 +838,7 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
}
|
|
|
|
|
//成功
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("代理品牌采购入库单档案转换失败", e);
|
|
|
|
|
logger.error("代理、成品采购入库单档案转换失败", e);
|
|
|
|
|
//失败
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
@ -831,35 +852,35 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
*
|
|
|
|
|
* @author liuyang
|
|
|
|
|
*/
|
|
|
|
|
private BdBusitypeEntity u8cOperationFlow() throws Exception {
|
|
|
|
|
//查询业务流程
|
|
|
|
|
//2024年8月6日 11:33:07 具体的业务流程名称,还需要实施提供
|
|
|
|
|
String processName = "渠道品牌采购";
|
|
|
|
|
BdBusitypeEntity bdBusitypeEntity = queryBdBusitypeUtil.queryBdBusitype(processName);
|
|
|
|
|
Assert.notNull(bdBusitypeEntity, "根据业务流程名称({})没有查询到业务流程", processName);
|
|
|
|
|
return bdBusitypeEntity;
|
|
|
|
|
}
|
|
|
|
|
// private BdBusitypeEntity u8cOperationFlow() throws Exception {
|
|
|
|
|
// //查询业务流程
|
|
|
|
|
// //2024年8月6日 11:33:07 具体的业务流程名称,还需要实施提供
|
|
|
|
|
// String processName = "渠道品牌采购";
|
|
|
|
|
// BdBusitypeEntity bdBusitypeEntity = queryBdBusitypeUtil.queryBdBusitype(processName);
|
|
|
|
|
// Assert.notNull(bdBusitypeEntity, "根据业务流程名称({})没有查询到业务流程", processName);
|
|
|
|
|
// return bdBusitypeEntity;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 2024年8月20日 15:46:10
|
|
|
|
|
* 生成业务日期,以发货时间作为业务日期
|
|
|
|
|
* 生成业务日期,已入库确认时间为准
|
|
|
|
|
*
|
|
|
|
|
* @author liuyang
|
|
|
|
|
*/
|
|
|
|
|
private String createGenerateBusinessDate(PoOrderSonDto poOrderSonDto) {
|
|
|
|
|
if (poOrderSonDto != null && poOrderSonDto.getClosedAt() != null) {
|
|
|
|
|
String closedAt = poOrderSonDto.getClosedAt();
|
|
|
|
|
private String createGenerateBusinessDate(OFSReceiptConfirmSearchResponse.Header header) {
|
|
|
|
|
if (header != null && header.getReceivedAt() != null) {
|
|
|
|
|
String receivedAt = header.getReceivedAt();
|
|
|
|
|
String businessFormat = null;
|
|
|
|
|
try {
|
|
|
|
|
Date dbill = DateUtil.parse(closedAt);
|
|
|
|
|
Date dbill = DateUtil.parse(receivedAt);
|
|
|
|
|
businessFormat = DateUtil.format(dbill, "yyyy-MM-dd");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("业务日期生成失败", e);
|
|
|
|
|
}
|
|
|
|
|
return businessFormat;
|
|
|
|
|
} else {
|
|
|
|
|
logger.error("closedAt为空! json:{}", JSON.toJSON(poOrderSonDto));
|
|
|
|
|
Assert.state(false, "closedAt为空! json:{}", JSON.toJSON(poOrderSonDto));
|
|
|
|
|
logger.error("receivedAt为空! json:{}", JSON.toJSON(header));
|
|
|
|
|
Assert.state(false, "receivedAt为空! json:{}", JSON.toJSON(header));
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -870,33 +891,33 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
*
|
|
|
|
|
* @author liuyang
|
|
|
|
|
*/
|
|
|
|
|
private String createGenerateBusinessDate(StockinOrderSearchResponse.StockinOrder stockinOrder) {
|
|
|
|
|
if (stockinOrder != null) {
|
|
|
|
|
StockinOrderSearchResponse.StockinOrder.StockinH header = stockinOrder.getHeader();
|
|
|
|
|
String closedAt = header.getClosedAt();
|
|
|
|
|
String businessFormat = null;
|
|
|
|
|
try {
|
|
|
|
|
Date dbill = DateUtil.parse(closedAt);
|
|
|
|
|
businessFormat = DateUtil.format(dbill, "yyyy-MM-dd");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("业务日期生成失败", e);
|
|
|
|
|
}
|
|
|
|
|
return businessFormat;
|
|
|
|
|
} else {
|
|
|
|
|
logger.error("生成采购订单入库日期失败,或者shipAt为空! json:{}", JSON.toJSON(stockinOrder));
|
|
|
|
|
Assert.state(false, "生成采购订单入库日期失败,或者shipAt为空! json:{}", JSON.toJSON(stockinOrder));
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// private String createGenerateBusinessDate(StockinOrderSearchResponse.StockinOrder stockinOrder) {
|
|
|
|
|
// if (stockinOrder != null) {
|
|
|
|
|
// StockinOrderSearchResponse.StockinOrder.StockinH header = stockinOrder.getHeader();
|
|
|
|
|
// String closedAt = header.getClosedAt();
|
|
|
|
|
// String businessFormat = null;
|
|
|
|
|
// try {
|
|
|
|
|
// Date dbill = DateUtil.parse(closedAt);
|
|
|
|
|
// businessFormat = DateUtil.format(dbill, "yyyy-MM-dd");
|
|
|
|
|
// } catch (Exception e) {
|
|
|
|
|
// logger.error("业务日期生成失败", e);
|
|
|
|
|
// }
|
|
|
|
|
// return businessFormat;
|
|
|
|
|
// } else {
|
|
|
|
|
// logger.error("生成采购订单入库日期失败,或者shipAt为空! json:{}", JSON.toJSON(stockinOrder));
|
|
|
|
|
// Assert.state(false, "生成采购订单入库日期失败,或者shipAt为空! json:{}", JSON.toJSON(stockinOrder));
|
|
|
|
|
// return null;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询存货管理档案
|
|
|
|
|
*
|
|
|
|
|
* @param pkCorp 发货公司主键
|
|
|
|
|
* @param stockinB 采购入库单明细行
|
|
|
|
|
* @param stockinB 采购入库确认单明细行
|
|
|
|
|
* @author liuyang
|
|
|
|
|
*/
|
|
|
|
|
private BdInvmandocEntity queryInventoryMan(StockinOrderSearchResponse.StockinOrder.StockinB stockinB, String pkCorp) throws Exception {
|
|
|
|
|
private BdInvmandocEntity queryInventoryMan(OFSReceiptConfirmSearchResponse.Detail stockinB, String pkCorp) throws Exception {
|
|
|
|
|
Assert.notNull(stockinB, "sonDetailsDto不能为空");
|
|
|
|
|
Assert.notNull(stockinB.getSkuCode(), "O存货商家编码不能为空");
|
|
|
|
|
Assert.notNull(pkCorp, "发货公司主键不能为空");
|
|
|
|
@ -919,16 +940,19 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
* 2024年8月20日 17:42:15
|
|
|
|
|
* 应该通过明细行主键匹配,但是只能根据sku匹配目前的实现逻辑
|
|
|
|
|
* 查找OFS采购订单明细行,主要是为了带出实付金额,通过实付金额/实收数量=含税单价
|
|
|
|
|
* 2025 年 3 月 11 日 15:38:43
|
|
|
|
|
* 最新调整为:采购入库确认单明细行 关联 采购订单明细行
|
|
|
|
|
*
|
|
|
|
|
* @param ofsPoOrderDataDetails OFS采购订单明细行所有对象
|
|
|
|
|
* @param stockinB OFS采购入库单明细行对象
|
|
|
|
|
* @param stockinB OFS采购入库确认单明细行对象
|
|
|
|
|
* @author liuyang
|
|
|
|
|
*/
|
|
|
|
|
private OfsPoOrderDetails findOfsPoOrderDetail(List<OfsPoOrderDetails> ofsPoOrderDataDetails, StockinOrderSearchResponse.StockinOrder.StockinB stockinB) {
|
|
|
|
|
private OfsPoOrderDetails findOfsPoOrderDetail(List<OfsPoOrderDetails> ofsPoOrderDataDetails, OFSReceiptConfirmSearchResponse.Detail stockinB) throws Exception {
|
|
|
|
|
if (ofsPoOrderDataDetails != null && ofsPoOrderDataDetails.size() > 0 && stockinB != null) {
|
|
|
|
|
// 2024年8月20日 23:33:11 先使用sku验证,然后O接口更新明细id,使用明细id匹配!
|
|
|
|
|
// 2024年8月20日 23:36:04 使用sku匹配,在某种角度来说是错误的
|
|
|
|
|
// 2024年8月21日 14:23:02 O接口已经返回明细行主键,根据这个匹配
|
|
|
|
|
// 2025 年 3 月 11 日 15:40:27 根据 OFS 入库确认单明细行的采购订单明细行 id,得到采购订单明细行
|
|
|
|
|
for (int i = 0; i < ofsPoOrderDataDetails.size(); i++) {
|
|
|
|
|
Assert.notNull(ofsPoOrderDataDetails.get(i).getId(), "采购订单明细行主键不能为空!");
|
|
|
|
|
Assert.notNull(stockinB.getRefOrderDetailId(), "采购入库单明细行对应的关联采购订单的明细行主键不能为空!");
|
|
|
|
@ -952,7 +976,7 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
*/
|
|
|
|
|
public PoOrderResultDto sendU8CPoOrder(String param) throws Exception {
|
|
|
|
|
long startLong = System.currentTimeMillis();
|
|
|
|
|
logger.info("代理品牌采购入库推送开始,推送参数:" + param + ",U8C_URL:" + OverallConstant.getOverAllValue("u8c_url"));
|
|
|
|
|
logger.info("代理、成品采购入库推送开始,推送参数:" + param + ",U8C_URL:" + OverallConstant.getOverAllValue("u8c_url"));
|
|
|
|
|
String apiCode = "8000370035";
|
|
|
|
|
String result = HttpRequest.post(OverallConstant.getOverAllValue("u8c_url")).header("appId", OverallConstant.getOverAllValue("appId"))//头信息,多个头信息多次调用此方法即可
|
|
|
|
|
.header("usercode", OverallConstant.getOverAllValue("u8cApiUsercodePK")).header("password", OverallConstant.getOverAllValue("u8cApiPasswordPK")).header("system", OverallConstant.getOverAllValue("u8cApiSystemPK")).header("trantype", OverallConstant.getOverAllValue("u8cApiTrantypePK")).header("apiCode", apiCode)//头信息,多个头信息多次调用此方法即可
|
|
|
|
@ -961,7 +985,7 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
.body(param)//表单内容
|
|
|
|
|
.timeout(600000)//超时,毫秒
|
|
|
|
|
.execute().body();
|
|
|
|
|
logger.info("代理品牌采购入库推送结束,返回参数:" + result);
|
|
|
|
|
logger.info("代理、成品采购入库推送结束,返回参数:" + result);
|
|
|
|
|
long endLong = System.currentTimeMillis();
|
|
|
|
|
logger.info("U8C采购入库接口请求耗时:" + (endLong - startLong));
|
|
|
|
|
|
|
|
|
@ -983,7 +1007,7 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!isSuccess) {
|
|
|
|
|
Assert.state(false, "代理品牌采购业务推送U8C采购订单失败 接口返回结果:{}", result);
|
|
|
|
|
Assert.state(false, "代理、成品采购业务推送U8C采购订单失败 接口返回结果:{}", result);
|
|
|
|
|
}
|
|
|
|
|
return poOrderResultDto;
|
|
|
|
|
}
|
|
|
|
@ -1039,15 +1063,17 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
/**
|
|
|
|
|
* 查找U8C表体明细行
|
|
|
|
|
*
|
|
|
|
|
* @param stockinB O采购入库确认单明细行
|
|
|
|
|
* @param poOrderBEntityList U8C采购订单表体明细行
|
|
|
|
|
* @author liuyang
|
|
|
|
|
*/
|
|
|
|
|
private PoOrderBEntity findPoOrderBEntity(StockinOrderSearchResponse.StockinOrder.StockinB stockinB, List<PoOrderBEntity> poOrderBEntityList) throws Exception {
|
|
|
|
|
private PoOrderBEntity findPoOrderBEntity(OFSReceiptConfirmSearchResponse.Detail stockinB, List<PoOrderBEntity> poOrderBEntityList) throws Exception {
|
|
|
|
|
Assert.notNull(stockinB, "stockinB不能为空");
|
|
|
|
|
Assert.notNull(poOrderBEntityList, "poOrderBEntityList不能为空");
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < poOrderBEntityList.size(); i++) {
|
|
|
|
|
PoOrderBEntity poOrderBEntity = poOrderBEntityList.get(i);
|
|
|
|
|
if (poOrderBEntity.getVdef20() != null) {
|
|
|
|
|
if (poOrderBEntity != null && poOrderBEntity.getVdef20() != null) {
|
|
|
|
|
if (poOrderBEntity.getVdef20().equals(stockinB.getRefOrderDetailId())) {
|
|
|
|
|
return poOrderBEntity;
|
|
|
|
|
}
|
|
|
|
@ -1058,11 +1084,13 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 打印OFS单号
|
|
|
|
|
* 打印OFS拉取到的单据号
|
|
|
|
|
*
|
|
|
|
|
* @author liuyang
|
|
|
|
|
* @param returnGoodHeaderDetailsDataDtoArrayList 拉取到的入库确认单封装
|
|
|
|
|
* @param startTime 开始时间
|
|
|
|
|
* @param endTime 结束时间
|
|
|
|
|
*/
|
|
|
|
|
private void printOfsDocCode(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList, String startTime, String endTime) {
|
|
|
|
|
private void printOfsDocCode(List<OFSReceiptConfirmSearchResponse.Order> returnGoodHeaderDetailsDataDtoArrayList, String startTime, String endTime) {
|
|
|
|
|
Assert.notNull(returnGoodHeaderDetailsDataDtoArrayList, "returnGoodHeaderDetailsDataDtoArrayList不能为空");
|
|
|
|
|
Assert.notNull(startTime, "startTime不能为空");
|
|
|
|
|
Assert.notNull(endTime, "endTime不能为空");
|
|
|
|
@ -1075,6 +1103,8 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
|
|
|
|
|
stringBuffer.append("开始时间:");
|
|
|
|
|
stringBuffer.append(startTime);
|
|
|
|
|
stringBuffer.append(" ");
|
|
|
|
|
|
|
|
|
|
stringBuffer.append("结束时间:");
|
|
|
|
|
stringBuffer.append(endTime);
|
|
|
|
|
stringBuffer.append(" ");
|
|
|
|
@ -1087,4 +1117,33 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|
|
|
|
logger.error("插件:{},打印拉取到的单据号出错", getPluginName(), e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 打印OFS拉取到的单据号
|
|
|
|
|
*
|
|
|
|
|
* @param returnGoodHeaderDetailsDataDtoArrayList 拉取到的入库确认单封装
|
|
|
|
|
* @param code OFS采购入库确认单单据号
|
|
|
|
|
*/
|
|
|
|
|
private void printOfsDocCode(List<OFSReceiptConfirmSearchResponse.Order> returnGoodHeaderDetailsDataDtoArrayList, String code) {
|
|
|
|
|
Assert.notNull(returnGoodHeaderDetailsDataDtoArrayList, "returnGoodHeaderDetailsDataDtoArrayList不能为空");
|
|
|
|
|
Assert.notNull(code, "startTime不能为空");
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
StringBuffer stringBuffer = new StringBuffer();
|
|
|
|
|
stringBuffer.append("插件:");
|
|
|
|
|
stringBuffer.append(getPluginName());
|
|
|
|
|
stringBuffer.append(" ");
|
|
|
|
|
|
|
|
|
|
stringBuffer.append("OFS单据号:");
|
|
|
|
|
stringBuffer.append(code);
|
|
|
|
|
stringBuffer.append(" ");
|
|
|
|
|
|
|
|
|
|
stringBuffer.append("获取到的单号:");
|
|
|
|
|
String codes = returnGoodHeaderDetailsDataDtoArrayList.stream().map(returnGoodHeaderDetailsDataDto -> returnGoodHeaderDetailsDataDto.getHeader().getCode()).collect(Collectors.joining(","));
|
|
|
|
|
stringBuffer.append(codes);
|
|
|
|
|
logger.info(stringBuffer.toString());
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("插件:{},打印拉取到的单据号出错", getPluginName(), e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|