优化数据处理性能和批处理大小
- 增加单次查询的数量限制,减少数据库查询次数 - 使用多线程处理数据插入,提高处理速度 -优化数据结构,使用Map替代List以减少循环遍历 -调整批处理大小以适应更大的数据量
This commit is contained in:
parent
7c0daa89a7
commit
1979075bcb
|
@ -371,7 +371,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
|||
// List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList1 = new ArrayList<>();
|
||||
List<TocofsSaleoutDetailedEntity> allTocofsSaleoutDetailedEntityList = new ArrayList<>();
|
||||
if (headerDetailsDtoList != null && headerDetailsDtoList.size() > 0) {
|
||||
List<List<HeaderDetailsDto>> splitListByCount = SplitListByCountUtil.splitListByCount(headerDetailsDtoList, 100);
|
||||
List<List<HeaderDetailsDto>> splitListByCount = SplitListByCountUtil.splitListByCount(headerDetailsDtoList, 800);
|
||||
for (int i = 0; i < splitListByCount.size(); i++) {
|
||||
List<HeaderDetailsDto> headerDetailsDtoList2 = splitListByCount.get(i);
|
||||
String idStr = commaConcatenatedPrimaryKeyStock(headerDetailsDtoList2);
|
||||
|
@ -455,6 +455,14 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
|||
private List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> filterDataRowsAsPushOrFailedStock(List<TocofsSaleoutDetailedEntity> allTocofsSaleoutDetailedEntityList, List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList) throws Exception {
|
||||
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> targetHeaderDetailsDtoList = new ArrayList<>();
|
||||
if (headerDetailsDtoList != null && headerDetailsDtoList.size() > 0) {
|
||||
List<TocofsSaleoutDetailedEntity> resultList = allTocofsSaleoutDetailedEntityList.stream().map(obj -> {
|
||||
if (obj.getNewstate() == null) {
|
||||
obj.setNewstate("");
|
||||
}
|
||||
return obj;
|
||||
}).collect(Collectors.toList());
|
||||
Map<String, String> no2NameMap = resultList.stream().collect(Collectors.toMap(TocofsSaleoutDetailedEntity::getId, TocofsSaleoutDetailedEntity::getNewstate));
|
||||
|
||||
//字段Y(成功)或者为H(待处理)可以视为成功,完成了小段业务闭环的数据行
|
||||
String succeseeY = "Y";
|
||||
String succeseeH = "H";
|
||||
|
@ -468,17 +476,24 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
|||
DetailsDto detailsDto = details.get(j);
|
||||
Boolean isSuccess = false;
|
||||
String newstate = null;
|
||||
if (allTocofsSaleoutDetailedEntityList.size() > 0) {
|
||||
for (int k = 0; k < allTocofsSaleoutDetailedEntityList.size(); k++) {
|
||||
TocofsSaleoutDetailedEntity tocofsSaleoutDetailedEntity = allTocofsSaleoutDetailedEntityList.get(k);
|
||||
if (tocofsSaleoutDetailedEntity.getId().equals(detailsDto.getId())) {
|
||||
newstate = tocofsSaleoutDetailedEntity.getNewstate();
|
||||
if (succeseeY.equals(newstate) || succeseeH.equals(newstate)) {
|
||||
isSuccess = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// if (allTocofsSaleoutDetailedEntityList.size() > 0) {
|
||||
// for (int k = 0; k < allTocofsSaleoutDetailedEntityList.size(); k++) {
|
||||
// TocofsSaleoutDetailedEntity tocofsSaleoutDetailedEntity = allTocofsSaleoutDetailedEntityList.get(k);
|
||||
// if (tocofsSaleoutDetailedEntity.getId().equals(detailsDto.getId())) {
|
||||
// newstate = tocofsSaleoutDetailedEntity.getNewstate();
|
||||
// if (succeseeY.equals(newstate) || succeseeH.equals(newstate)) {
|
||||
// isSuccess = true;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
//进一步优化性能,使用Map
|
||||
newstate = no2NameMap.get(detailsDto.getId());
|
||||
if (newstate != null && (succeseeY.equals(newstate) || succeseeH.equals(newstate))) {
|
||||
isSuccess = true;
|
||||
}
|
||||
|
||||
if (!isSuccess) {
|
||||
detailsDto.setNewState(newstate);
|
||||
targetDetails.add(detailsDto);
|
||||
|
@ -598,28 +613,58 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
|||
}
|
||||
|
||||
//每50作为一个批次插入主表,根据主键(id)判断是否重复,如果重复的,则不进行插入
|
||||
List<List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDto>> ofssaleorderoutsearchList = SplitListByCountUtil.splitListByCount(headerDetailsDtoList1, 50);
|
||||
List<List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDto>> ofssaleorderoutsearchList = SplitListByCountUtil.splitListByCount(headerDetailsDtoList1, 800);
|
||||
for (int i = 0; i < ofssaleorderoutsearchList.size(); i++) {
|
||||
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDto> headerDtoList = ofssaleorderoutsearchList.get(i);
|
||||
List<TocofsSaleoutEntity> tocofsSaleoutEntityList = copyHeaderDto(headerDtoList);
|
||||
if (tocofsSaleoutEntityList != null && tocofsSaleoutEntityList.size() > 0) {
|
||||
logger.info("TocofsSaleoutEntity:插入底表{}个对象(表头)", tocofsSaleoutEntityList.size());
|
||||
iTocofsSaleoutDao.entityInsertOrUpdateBatch(tocofsSaleoutEntityList);
|
||||
} else {
|
||||
logger.info("TocofsSaleoutEntity:TOC业务没有对象被插入表头底表");
|
||||
Thread thread = new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
List<TocofsSaleoutEntity> tocofsSaleoutEntityList = copyHeaderDto(headerDtoList);
|
||||
if (tocofsSaleoutEntityList != null && tocofsSaleoutEntityList.size() > 0) {
|
||||
logger.info("TocofsSaleoutEntity:插入底表{}个对象(表头)", tocofsSaleoutEntityList.size());
|
||||
iTocofsSaleoutDao.entityInsertOrUpdateBatch(tocofsSaleoutEntityList);
|
||||
} else {
|
||||
logger.info("TocofsSaleoutEntity:TOC业务没有对象被插入表头底表");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("线程保存TOC销售表头抛出异常", e);
|
||||
}
|
||||
}
|
||||
});
|
||||
thread.start();
|
||||
try {
|
||||
thread.join();
|
||||
} catch (Exception e) {
|
||||
logger.error("堵塞线程抛出异常", e);
|
||||
}
|
||||
}
|
||||
|
||||
//插入明细表
|
||||
List<List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.DetailsDto>> detailsDtoList = SplitListByCountUtil.splitListByCount(headerDetailsDtoList2, 50);
|
||||
List<List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.DetailsDto>> detailsDtoList = SplitListByCountUtil.splitListByCount(headerDetailsDtoList2, 800);
|
||||
for (int i = 0; i < detailsDtoList.size(); i++) {
|
||||
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.DetailsDto> detailsDtos = detailsDtoList.get(i);
|
||||
List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities = copyDetailsDto(detailsDtos);
|
||||
if (tocofsSaleoutDetailedEntities.size() > 0) {
|
||||
logger.info("TocofsSaleoutDetailedEntity:插入底表{}个对象(表体)", tocofsSaleoutDetailedEntities.size());
|
||||
iTocofsSaleoutDetailedDao.entityInsertOrUpdateBatch(tocofsSaleoutDetailedEntities);
|
||||
} else {
|
||||
logger.info("TocofsSaleoutDetailedEntity:没有对象被插入表头底表");
|
||||
Thread thread = new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities = copyDetailsDto(detailsDtos);
|
||||
if (tocofsSaleoutDetailedEntities.size() > 0) {
|
||||
logger.info("TocofsSaleoutDetailedEntity:插入底表{}个对象(表体)", tocofsSaleoutDetailedEntities.size());
|
||||
iTocofsSaleoutDetailedDao.entityInsertOrUpdateBatch(tocofsSaleoutDetailedEntities);
|
||||
} else {
|
||||
logger.info("TocofsSaleoutDetailedEntity:没有对象被插入表头底表");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("线程保存TOC销售明细抛出异常", e);
|
||||
}
|
||||
}
|
||||
});
|
||||
thread.start();
|
||||
try {
|
||||
thread.join();
|
||||
} catch (Exception e) {
|
||||
logger.error("堵塞线程抛出异常", e);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
@ -1034,7 +1079,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
|||
String facilityCode = header.getFacilityCode();
|
||||
Assert.notNull(facilityCode, "O仓库编码不能为空");
|
||||
BdStordocEntity bdStordocEntity = cacheTocMapVo.getStringBdStordocEntityMap().get(facilityCode + bdCalbodyEntity.getPkCalbody());
|
||||
Assert.notNull(bdStordocEntity, "没有匹配到发货仓库 发货库存组织主键:{} O库存地点编码:{}", facilityCode, bdCalbodyEntity.getPkCalbody());
|
||||
Assert.notNull(bdStordocEntity, "没有匹配到发货仓库 O库存地点编码:{} 发货库存组织主键:{}", facilityCode, bdCalbodyEntity.getPkCalbody());
|
||||
|
||||
//2024年8月5日 15:25:07 收货库存组织、收货仓库、默认和发货库存组织、发货仓库一致,已经和佳妮确认
|
||||
//收货库存组织:速网来看收货库存组织对应表头工具
|
||||
|
|
|
@ -1082,7 +1082,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|||
String facilityCode = header.getFacilityCode();
|
||||
Assert.notNull(facilityCode, "O仓库编码不能为空");
|
||||
BdStordocEntity bdStordocEntity = cacheTocMapVoV2.getStringBdStordocEntityMap().get(facilityCode + bdCalbodyEntity.getPkCalbody());
|
||||
Assert.notNull(bdStordocEntity, "没有匹配到发货仓库 发货库存组织主键:{} O库存地点编码:{}", facilityCode, bdCalbodyEntity.getPkCalbody());
|
||||
Assert.notNull(bdStordocEntity, "没有匹配到发货仓库 O库存地点编码:{} 发货库存组织主键:{} ", facilityCode, bdCalbodyEntity.getPkCalbody());
|
||||
|
||||
//2024年8月5日 15:25:07 收货库存组织、收货仓库、默认和发货库存组织、发货仓库一致,已经和佳妮确认
|
||||
//收货库存组织:速网来看收货库存组织对应表头工具
|
||||
|
|
|
@ -55,7 +55,7 @@ public class OfsStandardUtil {
|
|||
Assert.notNull(pageNo, "pageNo不能为空");
|
||||
Assert.notNull(api, "api不能为空");
|
||||
|
||||
Long pageSize = 200L;
|
||||
Long pageSize = 400L;
|
||||
queryOfsSoSaleOutVo.setPageNo(pageNo);
|
||||
queryOfsSoSaleOutVo.setPageSize(pageSize);
|
||||
|
||||
|
|
|
@ -15,10 +15,7 @@ import org.slf4j.LoggerFactory;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
@ -224,18 +221,22 @@ public class TocOrderBasicArchivesCacheUtil {
|
|||
Map<String, BdCubasdocEntity> stringBdCubasdocEntityMap = new HashMap<>();
|
||||
List<BdCubasdocEntity> allBdCumandocEntityList = new ArrayList<>();
|
||||
if (headerDtoList != null && headerDtoList.size() > 0) {
|
||||
List<List<HeaderDto>> splitListByCount = SplitListByCountUtil.splitListByCount(headerDtoList, 500);
|
||||
List<List<HeaderDto>> splitListByCount = SplitListByCountUtil.splitListByCount(headerDtoList, 900);
|
||||
for (int i = 0; i < splitListByCount.size(); i++) {
|
||||
List<HeaderDto> headerDtoList1 = splitListByCount.get(i);
|
||||
String codesStr = headerDtoList1.stream().map(HeaderDto::getStoreCode).map(id -> "'" + id + "'").collect(Collectors.joining(","));
|
||||
Set<String> storeCodeHashSet = headerDtoList1.stream().map(HeaderDto::getStoreCode).collect(Collectors.toSet());
|
||||
String codesStr = storeCodeHashSet.stream().map(s -> "'" + s + "'").collect(Collectors.joining(","));
|
||||
// String codesStr = headerDtoList1.stream().map(HeaderDto::getStoreCode).map(id -> "'" + id + "'").collect(Collectors.joining(","));
|
||||
//测试
|
||||
// codesStr = "'dy-off-01'";
|
||||
BdCubasdocEntity bdCubasdocEntity = new BdCubasdocEntity();
|
||||
bdCubasdocEntity.setDataSourceCode("lets_u8c");
|
||||
bdCubasdocEntity.setDr(0L);
|
||||
bdCubasdocEntity.setCustcodes(codesStr);
|
||||
List<BdCubasdocEntity> bdCumandocEntityList = iBdCubasdocDao.query(bdCubasdocEntity);
|
||||
allBdCumandocEntityList.addAll(bdCumandocEntityList);
|
||||
if (codesStr != null && codesStr.length() > 0) {
|
||||
BdCubasdocEntity bdCubasdocEntity = new BdCubasdocEntity();
|
||||
bdCubasdocEntity.setDataSourceCode("lets_u8c");
|
||||
bdCubasdocEntity.setDr(0L);
|
||||
bdCubasdocEntity.setCustcodes(codesStr);
|
||||
List<BdCubasdocEntity> bdCumandocEntityList = iBdCubasdocDao.query(bdCubasdocEntity);
|
||||
allBdCumandocEntityList.addAll(bdCumandocEntityList);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (allBdCumandocEntityList.size() > 0) {
|
||||
|
@ -278,19 +279,23 @@ public class TocOrderBasicArchivesCacheUtil {
|
|||
List<BdCumandocEntity> allBdCumandocEntityList = new ArrayList<>();
|
||||
|
||||
if (headerDtoList != null && headerDtoList.size() > 0) {
|
||||
List<List<HeaderDto>> splitListByCount = SplitListByCountUtil.splitListByCount(headerDtoList, 500);
|
||||
List<List<HeaderDto>> splitListByCount = SplitListByCountUtil.splitListByCount(headerDtoList, 900);
|
||||
for (int i = 0; i < splitListByCount.size(); i++) {
|
||||
List<HeaderDto> headerDtoList1 = splitListByCount.get(i);
|
||||
String codesStr = headerDtoList1.stream().map(HeaderDto::getStoreCode).map(id -> "'" + id + "'").collect(Collectors.joining(","));
|
||||
Set<String> storeCodeHashSet = headerDtoList1.stream().map(HeaderDto::getStoreCode).collect(Collectors.toSet());
|
||||
String codesStr = storeCodeHashSet.stream().map(s -> "'" + s + "'").collect(Collectors.joining(","));
|
||||
// String codesStr = headerDtoList1.stream().map(HeaderDto::getStoreCode).map(id -> "'" + id + "'").collect(Collectors.joining(","));
|
||||
//测试
|
||||
// codesStr = "'dy-off-01'";
|
||||
|
||||
BdCumandocEntity bdCumandocEntity = new BdCumandocEntity();
|
||||
bdCumandocEntity.setDataSourceCode("lets_u8c");
|
||||
bdCumandocEntity.setDr(0L);
|
||||
bdCumandocEntity.setCustcodes(codesStr);
|
||||
List<BdCumandocEntity> bdCumandocEntityList = iBdCumandocDao.query(bdCumandocEntity);
|
||||
allBdCumandocEntityList.addAll(bdCumandocEntityList);
|
||||
if (codesStr != null && codesStr.length() > 0) {
|
||||
BdCumandocEntity bdCumandocEntity = new BdCumandocEntity();
|
||||
bdCumandocEntity.setDataSourceCode("lets_u8c");
|
||||
bdCumandocEntity.setDr(0L);
|
||||
bdCumandocEntity.setCustcodes(codesStr);
|
||||
List<BdCumandocEntity> bdCumandocEntityList = iBdCumandocDao.query(bdCumandocEntity);
|
||||
allBdCumandocEntityList.addAll(bdCumandocEntityList);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (allBdCumandocEntityList.size() > 0) {
|
||||
|
@ -327,15 +332,19 @@ public class TocOrderBasicArchivesCacheUtil {
|
|||
Map<String, BdInvmandocEntity> stringBdInvmandocEntityMap = new HashMap<>();
|
||||
|
||||
if (detailsDtos != null && detailsDtos.size() > 0) {
|
||||
List<List<DetailsDto>> lists = SplitListByCountUtil.splitListByCount(detailsDtos, 500);
|
||||
List<List<DetailsDto>> lists = SplitListByCountUtil.splitListByCount(detailsDtos, 900);
|
||||
for (int i = 0; i < lists.size(); i++) {
|
||||
List<DetailsDto> detailsDtos1 = lists.get(i);
|
||||
String idsStr = detailsDtos1.stream().map(DetailsDto::getSkuCode).map(id -> "'" + id + "'").collect(Collectors.joining(","));
|
||||
Set<String> storeCodeHashSet = detailsDtos1.stream().map(DetailsDto::getSkuCode).collect(Collectors.toSet());
|
||||
String codesStr = storeCodeHashSet.stream().map(s -> "'" + s + "'").collect(Collectors.joining(","));
|
||||
// String idsStr = detailsDtos1.stream().map(DetailsDto::getSkuCode).map(id -> "'" + id + "'").collect(Collectors.joining(","));
|
||||
|
||||
BdInvmandocEntity bdInvmandocEntity = new BdInvmandocEntity();
|
||||
bdInvmandocEntity.setInvcodes(idsStr);
|
||||
List<BdInvmandocEntity> bdInvmandocEntity2 = iBdInvmandocDao.queryBdInvmandocByInvcodeList(bdInvmandocEntity);
|
||||
allBdInvmandocEntity.addAll(bdInvmandocEntity2);
|
||||
if (codesStr != null && codesStr.length() > 0) {
|
||||
BdInvmandocEntity bdInvmandocEntity = new BdInvmandocEntity();
|
||||
bdInvmandocEntity.setInvcodes(codesStr);
|
||||
List<BdInvmandocEntity> bdInvmandocEntity2 = iBdInvmandocDao.queryBdInvmandocByInvcodeList(bdInvmandocEntity);
|
||||
allBdInvmandocEntity.addAll(bdInvmandocEntity2);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (allBdInvmandocEntity.size() > 0) {
|
||||
|
@ -376,15 +385,19 @@ public class TocOrderBasicArchivesCacheUtil {
|
|||
private Map<String, BdInvbasdocEntity> initBasicInventoryFileV2(List<DetailsDto> detailsDtoList) throws Exception {
|
||||
List<BdInvbasdocEntity> allBdInvbasdocEntityList = new ArrayList<>();
|
||||
if (detailsDtoList != null && detailsDtoList.size() > 0) {
|
||||
List<List<DetailsDto>> lists = SplitListByCountUtil.splitListByCount(detailsDtoList, 500);
|
||||
List<List<DetailsDto>> lists = SplitListByCountUtil.splitListByCount(detailsDtoList, 900);
|
||||
for (int i = 0; i < lists.size(); i++) {
|
||||
List<DetailsDto> detailsDtos = lists.get(i);
|
||||
String idsStr = detailsDtos.stream().map(DetailsDto::getSkuCode).map(id -> "'" + id + "'").collect(Collectors.joining(","));
|
||||
// String idsStr = detailsDtos.stream().map(DetailsDto::getSkuCode).map(id -> "'" + id + "'").collect(Collectors.joining(","));
|
||||
Set<String> storeCodeHashSet = detailsDtos.stream().map(DetailsDto::getSkuCode).collect(Collectors.toSet());
|
||||
String codesStr = storeCodeHashSet.stream().map(s -> "'" + s + "'").collect(Collectors.joining(","));
|
||||
|
||||
BdInvbasdocEntity bdInvbasdocEntity = new BdInvbasdocEntity();
|
||||
bdInvbasdocEntity.setInvcodes(idsStr);
|
||||
List<BdInvbasdocEntity> bdInvbasdocEntities = iBdInvbasdocDao.queryBdInvbasdocByPkInvmandocV3(bdInvbasdocEntity);
|
||||
allBdInvbasdocEntityList.addAll(bdInvbasdocEntities);
|
||||
if (codesStr != null && codesStr.length() > 0) {
|
||||
BdInvbasdocEntity bdInvbasdocEntity = new BdInvbasdocEntity();
|
||||
bdInvbasdocEntity.setInvcodes(codesStr);
|
||||
List<BdInvbasdocEntity> bdInvbasdocEntities = iBdInvbasdocDao.queryBdInvbasdocByPkInvmandocV3(bdInvbasdocEntity);
|
||||
allBdInvbasdocEntityList.addAll(bdInvbasdocEntities);
|
||||
}
|
||||
}
|
||||
}
|
||||
Map<String, BdInvbasdocEntity> stringBdInvbasdocEntityMap = new HashMap<>();
|
||||
|
@ -422,15 +435,19 @@ public class TocOrderBasicArchivesCacheUtil {
|
|||
List<BdTaxitemsEntity> allBdTaxitemsEntityList = new ArrayList<>();
|
||||
Map<String, BdTaxitemsEntity> stringBdTaxitemsEntityMap = new HashMap<>();
|
||||
if (detailsDtos != null && detailsDtos.size() > 0) {
|
||||
List<List<DetailsDto>> lists = SplitListByCountUtil.splitListByCount(detailsDtos, 500);
|
||||
List<List<DetailsDto>> lists = SplitListByCountUtil.splitListByCount(detailsDtos, 900);
|
||||
for (int i = 0; i < lists.size(); i++) {
|
||||
List<DetailsDto> detailsDtos1 = lists.get(i);
|
||||
String codesStr = detailsDtos1.stream().map(DetailsDto::getSkuCode).map(id -> "'" + id + "'").collect(Collectors.joining(","));
|
||||
// String codesStr = detailsDtos1.stream().map(DetailsDto::getSkuCode).map(id -> "'" + id + "'").collect(Collectors.joining(","));
|
||||
Set<String> storeCodeHashSet = detailsDtos1.stream().map(DetailsDto::getSkuCode).collect(Collectors.toSet());
|
||||
String codesStr = storeCodeHashSet.stream().map(s -> "'" + s + "'").collect(Collectors.joining(","));
|
||||
|
||||
BdTaxitemsEntity bdTaxitemsEntity = new BdTaxitemsEntity();
|
||||
bdTaxitemsEntity.setInvcodes(codesStr);
|
||||
List<BdTaxitemsEntity> bdTaxitemsEntityList = iBdTaxitemsDao.queryBdInvbasdocByInvcodeV2(bdTaxitemsEntity);
|
||||
allBdTaxitemsEntityList.addAll(bdTaxitemsEntityList);
|
||||
if (codesStr != null && codesStr.length() > 0) {
|
||||
BdTaxitemsEntity bdTaxitemsEntity = new BdTaxitemsEntity();
|
||||
bdTaxitemsEntity.setInvcodes(codesStr);
|
||||
List<BdTaxitemsEntity> bdTaxitemsEntityList = iBdTaxitemsDao.queryBdInvbasdocByInvcodeV2(bdTaxitemsEntity);
|
||||
allBdTaxitemsEntityList.addAll(bdTaxitemsEntityList);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (allBdTaxitemsEntityList.size() > 0) {
|
||||
|
|
|
@ -77,5 +77,11 @@ public class SoSaleOutPluginInitializerToBTest {
|
|||
// System.out.println(tobShop);
|
||||
|
||||
// soSaleOutPluginInitializerToB.startImplementByCode("LETS-SH2024101700000270");
|
||||
|
||||
try {
|
||||
soSaleOutPluginInitializerToB.startImplementByCode("LETS-SH2024101800000739", "stock");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -77,7 +77,6 @@ class SoSaleOutPluginInitializerToCTest {
|
|||
// String aaa = "{\"barcode\":\"01031000084\",\"brand_name\":\"护童\",\"brand_no\":\"1\",\"cost_price\":\"0.00\",\"discount\":\"0.00\",\"from_mask\":\"0\",\"gift_type\":\"1\",\"good_prop1\":\"\",\"good_prop2\":\"\",\"good_prop3\":\"\",\"good_prop4\":\"\",\"good_prop5\":\"\",\"good_prop6\":\"\",\"goods_amount\":\"0.0000\",\"goods_count\":\"1.0000\",\"goods_id\":\"4662\",\"goods_name\":\"G501_椅套_奶油桃\",\"goods_no\":\"01031000084\",\"goods_type\":\"1\",\"is_package\":\"false\",\"market_price\":\"0.00\",\"paid\":\"0.00\",\"platform_id\":\"0\",\"position_details_list\":[{\"batch_no\":\"\",\"expire_date\":\"\",\"position_goods_count\":\"1.0000\",\"position_id\":\"-6\",\"position_no\":\"其它未上架\",\"rec_id\":\"644060\",\"stockout_detail_id\":\"830189\"}],\"prop1\":\"\",\"prop2\":\"\",\"prop3\":\"\",\"prop4\":\"\",\"prop5\":\"\",\"prop6\":\"\",\"rec_id\":\"830189\",\"refund_status\":\"0\",\"remark\":\"赠品策略编号:ZP24080204,规则名称:G501 奶油桃,原始单号:4032308235772095218\",\"sale_order_id\":\"1251671\",\"sell_price\":\"0.00\",\"share_amount\":\"0.00\",\"share_post_amount\":\"0.00\",\"share_price\":\"0.00\",\"spec_code\":\"\",\"spec_id\":\"4526\",\"spec_name\":\"G501_椅套_奶油桃\",\"spec_no\":\"01031000084\",\"src_oid\":\"AD202409050010\",\"src_order_detail_id\":\"1251671\",\"src_tid\":\"4032308235772095218\",\"stockout_id\":\"630492\",\"suite_no\":\"\",\"tax_rate\":\"0.00\",\"total_amount\":\"0.00\",\"weight\":\"0.0000\"}";
|
||||
// System.out.println(aaa.length());
|
||||
|
||||
|
||||
// String computingTime = soSaleOutPluginInitializerToC.computingTime("2024-01-01/2024-01-01");
|
||||
// soSaleOutPluginInitializerToC.splitDateAndPush(computingTime, "tran");
|
||||
|
||||
|
@ -92,8 +91,14 @@ class SoSaleOutPluginInitializerToCTest {
|
|||
// queryOfsSoSaleOutVo.setCode("LETS-SO2024092500000018");
|
||||
// ofsStandardUtil.getOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoArrayList, 1L);
|
||||
// System.out.println(headerDetailsDtoArrayList.get(0).getHeader().getDepartmentType());
|
||||
|
||||
String s = "LETS-SH2024101700000270";
|
||||
soSaleOutPluginInitializerToC.startImplementStockByCode(s, "stock");
|
||||
|
||||
// String s = "LETS-SH2024101700000270";
|
||||
// soSaleOutPluginInitializerToC.startImplementStockByCode(s, "stock");
|
||||
|
||||
try {
|
||||
soSaleOutPluginInitializerToC.startImplementStockByTime("2024-10-17 00:00:00", "2024-10-17 23:59:59");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -29,7 +29,7 @@ public class BeanUtil {
|
|||
public static <T> T copyProperties(Object source, Object target) {
|
||||
Map<String, Field> sourceMap = CacheFieldMap.getFieldMap(source.getClass());
|
||||
CacheFieldMap.getFieldMap(target.getClass()).values().forEach((it) -> {
|
||||
logger.info(it.getName());
|
||||
// logger.info(it.getName());
|
||||
Field field = sourceMap.get(it.getName().toLowerCase().replace("_", ""));
|
||||
if (field != null) {
|
||||
it.setAccessible(true);
|
||||
|
@ -69,7 +69,7 @@ public class BeanUtil {
|
|||
Map<String, Field> sourceMap = CacheFieldMap.getFieldMap(source.getClass());
|
||||
|
||||
targetFieldMap.values().forEach((it) -> {
|
||||
logger.info(it.getName());
|
||||
// logger.info(it.getName());
|
||||
Field field = sourceMap.get(it.getName().toLowerCase().replace("_", ""));
|
||||
if (field != null) {
|
||||
it.setAccessible(true);
|
||||
|
|
Loading…
Reference in New Issue