|
|
|
@ -1,14 +1,22 @@
|
|
|
|
|
package com.hzya.frame.plugin.lets.util;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
|
|
import com.hzya.frame.plugin.lets.constant.OverallConstant;
|
|
|
|
|
import com.hzya.frame.plugin.lets.dao.*;
|
|
|
|
|
import com.hzya.frame.plugin.lets.entity.*;
|
|
|
|
|
import com.hzya.frame.plugin.lets.resultvo.CacheTocMapVoV2;
|
|
|
|
|
import com.hzya.frame.split.SplitListByCountUtil;
|
|
|
|
|
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.DetailsDto;
|
|
|
|
|
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDto;
|
|
|
|
|
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
|
|
|
|
|
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.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 档案类缓存,TOC销售订单转换
|
|
|
|
@ -169,20 +177,45 @@ public class TocReturnBasicArchivesCacheUtil {
|
|
|
|
|
* @author liuyang
|
|
|
|
|
*/
|
|
|
|
|
// public static Map<String, BdCubasdocEntity> stringBdCubasdocEntityHashMap = new HashMap<>();
|
|
|
|
|
private Map<String, BdCubasdocEntity> initBdCubasdoc() {
|
|
|
|
|
Map<String, BdCubasdocEntity> stringBdCubasdocEntityHashMap = new HashMap<>();
|
|
|
|
|
// private Map<String, BdCubasdocEntity> initBdCubasdoc() {
|
|
|
|
|
// Map<String, BdCubasdocEntity> stringBdCubasdocEntityHashMap = new HashMap<>();
|
|
|
|
|
//
|
|
|
|
|
// BdCubasdocEntity bdCubasdocEntity = new BdCubasdocEntity();
|
|
|
|
|
// bdCubasdocEntity.setDataSourceCode("lets_u8c");
|
|
|
|
|
// bdCubasdocEntity.setDr(0L);
|
|
|
|
|
// List<BdCubasdocEntity> bdCumandocEntityList = iBdCubasdocDao.query(bdCubasdocEntity);
|
|
|
|
|
// if (bdCumandocEntityList != null && bdCumandocEntityList.size() > 0) {
|
|
|
|
|
// for (int i = 0; i < bdCumandocEntityList.size(); i++) {
|
|
|
|
|
// BdCubasdocEntity bdCubasdocEntity1 = bdCumandocEntityList.get(i);
|
|
|
|
|
// stringBdCubasdocEntityHashMap.put(bdCubasdocEntity1.getCustname(), bdCubasdocEntity1);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// return stringBdCubasdocEntityHashMap;
|
|
|
|
|
// }
|
|
|
|
|
private Map<String, BdCubasdocEntity> initBdCubasdocV2(List<StockinOrderSearchResponse.StockinOrder.StockinH> headerDtoList) {
|
|
|
|
|
Map<String, BdCubasdocEntity> stringBdCubasdocEntityMap = new HashMap<>();
|
|
|
|
|
List<BdCubasdocEntity> allBdCumandocEntityList = new ArrayList<>();
|
|
|
|
|
if (headerDtoList != null && headerDtoList.size() > 0) {
|
|
|
|
|
List<List<StockinOrderSearchResponse.StockinOrder.StockinH>> lists = SplitListByCountUtil.splitListByCount(headerDtoList, 500);
|
|
|
|
|
for (int i = 0; i < lists.size(); i++) {
|
|
|
|
|
List<StockinOrderSearchResponse.StockinOrder.StockinH> stockinHList = lists.get(i);
|
|
|
|
|
String codesStr = stockinHList.stream().map(StockinOrderSearchResponse.StockinOrder.StockinH::getStoreCode).map(id -> "'" + id + "'").collect(Collectors.joining(","));
|
|
|
|
|
|
|
|
|
|
BdCubasdocEntity bdCubasdocEntity = new BdCubasdocEntity();
|
|
|
|
|
bdCubasdocEntity.setDataSourceCode("lets_u8c");
|
|
|
|
|
bdCubasdocEntity.setDr(0L);
|
|
|
|
|
bdCubasdocEntity.setCustcodes(codesStr);
|
|
|
|
|
List<BdCubasdocEntity> bdCumandocEntityList = iBdCubasdocDao.query(bdCubasdocEntity);
|
|
|
|
|
if (bdCumandocEntityList != null && bdCumandocEntityList.size() > 0) {
|
|
|
|
|
for (int i = 0; i < bdCumandocEntityList.size(); i++) {
|
|
|
|
|
BdCubasdocEntity bdCubasdocEntity1 = bdCumandocEntityList.get(i);
|
|
|
|
|
stringBdCubasdocEntityHashMap.put(bdCubasdocEntity1.getCustname(), bdCubasdocEntity1);
|
|
|
|
|
allBdCumandocEntityList.addAll(bdCumandocEntityList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return stringBdCubasdocEntityHashMap;
|
|
|
|
|
if (allBdCumandocEntityList.size() > 0) {
|
|
|
|
|
for (int i = 0; i < allBdCumandocEntityList.size(); i++) {
|
|
|
|
|
BdCubasdocEntity bdCubasdocEntity = allBdCumandocEntityList.get(i);
|
|
|
|
|
stringBdCubasdocEntityMap.put(bdCubasdocEntity.getCustcode(), bdCubasdocEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return stringBdCubasdocEntityMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -191,17 +224,49 @@ public class TocReturnBasicArchivesCacheUtil {
|
|
|
|
|
* @author liuyang
|
|
|
|
|
*/
|
|
|
|
|
// public static Map<String, BdCumandocEntity> stringBdCumandocEntityMap = new HashMap<>();
|
|
|
|
|
private Map<String, BdCumandocEntity> initBdCumandoc() {
|
|
|
|
|
Map<String, BdCumandocEntity> stringBdCumandocEntityMap = new HashMap<>();
|
|
|
|
|
// private Map<String, BdCumandocEntity> initBdCumandoc() {
|
|
|
|
|
// Map<String, BdCumandocEntity> stringBdCumandocEntityMap = new HashMap<>();
|
|
|
|
|
//
|
|
|
|
|
// BdCumandocEntity bdCumandocEntity1 = new BdCumandocEntity();
|
|
|
|
|
// bdCumandocEntity1.setDataSourceCode("lets_u8c");
|
|
|
|
|
// bdCumandocEntity1.setDr(0L);
|
|
|
|
|
//// bdCumandocEntity1.setCustflags(ProfilesActiveConstant.CUSTOMER);//客商:2客户
|
|
|
|
|
// List<BdCumandocEntity> bdCumandocEntityList = iBdCumandocDao.query(bdCumandocEntity1);
|
|
|
|
|
// if (bdCumandocEntityList != null && bdCumandocEntityList.size() > 0) {
|
|
|
|
|
// for (int i = 0; i < bdCumandocEntityList.size(); i++) {
|
|
|
|
|
// BdCumandocEntity bdCumandocEntity = bdCumandocEntityList.get(i);
|
|
|
|
|
// stringBdCumandocEntityMap.put(bdCumandocEntity.getPkCubasdoc() + bdCumandocEntity.getPkCorp(), bdCumandocEntity);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// return stringBdCumandocEntityMap;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
BdCumandocEntity bdCumandocEntity1 = new BdCumandocEntity();
|
|
|
|
|
bdCumandocEntity1.setDataSourceCode("lets_u8c");
|
|
|
|
|
bdCumandocEntity1.setDr(0L);
|
|
|
|
|
// bdCumandocEntity1.setCustflags(ProfilesActiveConstant.CUSTOMER);//客商:2客户
|
|
|
|
|
List<BdCumandocEntity> bdCumandocEntityList = iBdCumandocDao.query(bdCumandocEntity1);
|
|
|
|
|
if (bdCumandocEntityList != null && bdCumandocEntityList.size() > 0) {
|
|
|
|
|
for (int i = 0; i < bdCumandocEntityList.size(); i++) {
|
|
|
|
|
BdCumandocEntity bdCumandocEntity = bdCumandocEntityList.get(i);
|
|
|
|
|
/**
|
|
|
|
|
* 查询客商管理档案
|
|
|
|
|
*
|
|
|
|
|
* @author liuyang
|
|
|
|
|
*/
|
|
|
|
|
private Map<String, BdCumandocEntity> initBdCumandocV2(List<StockinOrderSearchResponse.StockinOrder.StockinH> headerDtoList) throws Exception {
|
|
|
|
|
Map<String, BdCumandocEntity> stringBdCumandocEntityMap = new HashMap<>();
|
|
|
|
|
List<BdCumandocEntity> allBdCumandocEntityList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
if (headerDtoList != null && headerDtoList.size() > 0) {
|
|
|
|
|
List<List<StockinOrderSearchResponse.StockinOrder.StockinH>> lists = SplitListByCountUtil.splitListByCount(headerDtoList, 500);
|
|
|
|
|
for (int i = 0; i < lists.size(); i++) {
|
|
|
|
|
List<StockinOrderSearchResponse.StockinOrder.StockinH> stockinHList = lists.get(i);
|
|
|
|
|
String codesStr = stockinHList.stream().map(StockinOrderSearchResponse.StockinOrder.StockinH::getStoreCode).map(id -> "'" + id + "'").collect(Collectors.joining(","));
|
|
|
|
|
|
|
|
|
|
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) {
|
|
|
|
|
for (int i = 0; i < allBdCumandocEntityList.size(); i++) {
|
|
|
|
|
BdCumandocEntity bdCumandocEntity = allBdCumandocEntityList.get(i);
|
|
|
|
|
stringBdCumandocEntityMap.put(bdCumandocEntity.getPkCubasdoc() + bdCumandocEntity.getPkCorp(), bdCumandocEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -212,18 +277,42 @@ public class TocReturnBasicArchivesCacheUtil {
|
|
|
|
|
* 初始化存货管理档案
|
|
|
|
|
*/
|
|
|
|
|
// public static Map<String, BdInvmandocEntity> stringBdInvmandocEntityMap = new HashMap<>();
|
|
|
|
|
private Map<String, BdInvmandocEntity> initInventoryFile() throws Exception {
|
|
|
|
|
// private Map<String, BdInvmandocEntity> initInventoryFile() throws Exception {
|
|
|
|
|
// Map<String, BdInvmandocEntity> stringBdInvmandocEntityMap = new HashMap<>();
|
|
|
|
|
//
|
|
|
|
|
// BdInvmandocEntity bdInvmandocEntity = new BdInvmandocEntity();
|
|
|
|
|
//// bdInvmandocEntity.setInvcode(copyRowDetailsListVo.getSpec_no());
|
|
|
|
|
//// bdInvmandocEntity.setPkCorp(shippingCompanyBdCorpEntity.getPkCorp());
|
|
|
|
|
// List<BdInvmandocEntity> bdInvmandocEntity2 = iBdInvmandocDao.queryBdInvmandocByInvcodeList(bdInvmandocEntity);
|
|
|
|
|
// if (bdInvmandocEntity2 != null && bdInvmandocEntity2.size() > 0) {
|
|
|
|
|
// for (int i = 0; i < bdInvmandocEntity2.size(); i++) {
|
|
|
|
|
// BdInvmandocEntity bdInvmandocEntity1 = bdInvmandocEntity2.get(i);
|
|
|
|
|
// //2024年8月6日 14:27:45 通过存货编码+公司缓存
|
|
|
|
|
// stringBdInvmandocEntityMap.put(bdInvmandocEntity1.getInvcode() + bdInvmandocEntity1.getPkCorp(), bdInvmandocEntity1);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// return stringBdInvmandocEntityMap;
|
|
|
|
|
// }
|
|
|
|
|
public Map<String, BdInvmandocEntity> initInventoryFileV2(List<StockinOrderSearchResponse.StockinOrder.StockinB> detailsDtos) throws Exception {
|
|
|
|
|
List<BdInvmandocEntity> allBdInvmandocEntity = new ArrayList<>();
|
|
|
|
|
Map<String, BdInvmandocEntity> stringBdInvmandocEntityMap = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
if (detailsDtos != null && detailsDtos.size() > 0) {
|
|
|
|
|
List<List<StockinOrderSearchResponse.StockinOrder.StockinB>> lists = SplitListByCountUtil.splitListByCount(detailsDtos, 500);
|
|
|
|
|
for (int i = 0; i < lists.size(); i++) {
|
|
|
|
|
List<StockinOrderSearchResponse.StockinOrder.StockinB> stockinBList = lists.get(i);
|
|
|
|
|
String idsStr = stockinBList.stream().map(StockinOrderSearchResponse.StockinOrder.StockinB::getSkuCode).map(id -> "'" + id + "'").collect(Collectors.joining(","));
|
|
|
|
|
|
|
|
|
|
BdInvmandocEntity bdInvmandocEntity = new BdInvmandocEntity();
|
|
|
|
|
// bdInvmandocEntity.setInvcode(copyRowDetailsListVo.getSpec_no());
|
|
|
|
|
// bdInvmandocEntity.setPkCorp(shippingCompanyBdCorpEntity.getPkCorp());
|
|
|
|
|
bdInvmandocEntity.setInvcodes(idsStr);
|
|
|
|
|
List<BdInvmandocEntity> bdInvmandocEntity2 = iBdInvmandocDao.queryBdInvmandocByInvcodeList(bdInvmandocEntity);
|
|
|
|
|
if (bdInvmandocEntity2 != null && bdInvmandocEntity2.size() > 0) {
|
|
|
|
|
for (int i = 0; i < bdInvmandocEntity2.size(); i++) {
|
|
|
|
|
BdInvmandocEntity bdInvmandocEntity1 = bdInvmandocEntity2.get(i);
|
|
|
|
|
//2024年8月6日 14:27:45 通过存货编码+公司缓存
|
|
|
|
|
stringBdInvmandocEntityMap.put(bdInvmandocEntity1.getInvcode() + bdInvmandocEntity1.getPkCorp(), bdInvmandocEntity1);
|
|
|
|
|
allBdInvmandocEntity.addAll(bdInvmandocEntity2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (allBdInvmandocEntity.size() > 0) {
|
|
|
|
|
for (int i = 0; i < allBdInvmandocEntity.size(); i++) {
|
|
|
|
|
BdInvmandocEntity bdInvmandocEntity = allBdInvmandocEntity.get(i);
|
|
|
|
|
stringBdInvmandocEntityMap.put(bdInvmandocEntity.getInvcode() + bdInvmandocEntity.getPkCorp(), bdInvmandocEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return stringBdInvmandocEntityMap;
|
|
|
|
@ -234,20 +323,47 @@ public class TocReturnBasicArchivesCacheUtil {
|
|
|
|
|
* 2024年8月7日 10:57:55
|
|
|
|
|
*/
|
|
|
|
|
// public static Map<String, BdInvbasdocEntity> stringBdInvbasdocEntityHashMap = new HashMap<>();
|
|
|
|
|
private Map<String, BdInvbasdocEntity> initBasicInventoryFile() throws Exception {
|
|
|
|
|
Map<String, BdInvbasdocEntity> stringBdInvbasdocEntityHashMap = new HashMap<>();
|
|
|
|
|
// private Map<String, BdInvbasdocEntity> initBasicInventoryFile() throws Exception {
|
|
|
|
|
// Map<String, BdInvbasdocEntity> stringBdInvbasdocEntityHashMap = new HashMap<>();
|
|
|
|
|
//
|
|
|
|
|
// BdInvbasdocEntity bdInvbasdocEntity = new BdInvbasdocEntity();
|
|
|
|
|
//// bdInvbasdocEntity.setPk_invmandoc(bdInvmandocEntity1.getPkInvmandoc());
|
|
|
|
|
//// bdInvbasdocEntity.setPk_corp(shippingCompanyBdCorpEntity.getPkCorp());
|
|
|
|
|
// List<BdInvbasdocEntity> bdInvbasdocEntity2 = iBdInvbasdocDao.queryBdInvbasdocByPkInvmandocV2(bdInvbasdocEntity);
|
|
|
|
|
// if (bdInvbasdocEntity2 != null && bdInvbasdocEntity2.size() > 0) {
|
|
|
|
|
// for (int i = 0; i < bdInvbasdocEntity2.size(); i++) {
|
|
|
|
|
// BdInvbasdocEntity bdInvbasdocEntity1 = bdInvbasdocEntity2.get(i);
|
|
|
|
|
// stringBdInvbasdocEntityHashMap.put(bdInvbasdocEntity1.getPk_invmandoc() + bdInvbasdocEntity1.getPk_corp_man(), bdInvbasdocEntity1);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// return stringBdInvbasdocEntityHashMap;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据O存货商家编码初始化存货基本档案
|
|
|
|
|
*
|
|
|
|
|
* @author liuyang
|
|
|
|
|
*/
|
|
|
|
|
private Map<String, BdInvbasdocEntity> initBasicInventoryFileV2(List<StockinOrderSearchResponse.StockinOrder.StockinB> detailsDtoList) throws Exception {
|
|
|
|
|
List<BdInvbasdocEntity> allBdInvbasdocEntityList = new ArrayList<>();
|
|
|
|
|
if (detailsDtoList != null && detailsDtoList.size() > 0) {
|
|
|
|
|
List<List<StockinOrderSearchResponse.StockinOrder.StockinB>> lists = SplitListByCountUtil.splitListByCount(detailsDtoList, 500);
|
|
|
|
|
for (int i = 0; i < lists.size(); i++) {
|
|
|
|
|
List<StockinOrderSearchResponse.StockinOrder.StockinB> stockinBList = lists.get(i);
|
|
|
|
|
String idsStr = stockinBList.stream().map(StockinOrderSearchResponse.StockinOrder.StockinB::getSkuCode).map(id -> "'" + id + "'").collect(Collectors.joining(","));
|
|
|
|
|
|
|
|
|
|
BdInvbasdocEntity bdInvbasdocEntity = new BdInvbasdocEntity();
|
|
|
|
|
// bdInvbasdocEntity.setPk_invmandoc(bdInvmandocEntity1.getPkInvmandoc());
|
|
|
|
|
// bdInvbasdocEntity.setPk_corp(shippingCompanyBdCorpEntity.getPkCorp());
|
|
|
|
|
List<BdInvbasdocEntity> bdInvbasdocEntity2 = iBdInvbasdocDao.queryBdInvbasdocByPkInvmandocV2(bdInvbasdocEntity);
|
|
|
|
|
if (bdInvbasdocEntity2 != null && bdInvbasdocEntity2.size() > 0) {
|
|
|
|
|
for (int i = 0; i < bdInvbasdocEntity2.size(); i++) {
|
|
|
|
|
BdInvbasdocEntity bdInvbasdocEntity1 = bdInvbasdocEntity2.get(i);
|
|
|
|
|
stringBdInvbasdocEntityHashMap.put(bdInvbasdocEntity1.getPk_invmandoc() + bdInvbasdocEntity1.getPk_corp_man(), bdInvbasdocEntity1);
|
|
|
|
|
bdInvbasdocEntity.setInvcodes(idsStr);
|
|
|
|
|
List<BdInvbasdocEntity> bdInvbasdocEntities = iBdInvbasdocDao.queryBdInvbasdocByPkInvmandocV3(bdInvbasdocEntity);
|
|
|
|
|
allBdInvbasdocEntityList.addAll(bdInvbasdocEntities);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return stringBdInvbasdocEntityHashMap;
|
|
|
|
|
Map<String, BdInvbasdocEntity> stringBdInvbasdocEntityMap = new HashMap<>();
|
|
|
|
|
for (int i = 0; i < allBdInvbasdocEntityList.size(); i++) {
|
|
|
|
|
BdInvbasdocEntity bdInvbasdocEntity = allBdInvbasdocEntityList.get(i);
|
|
|
|
|
stringBdInvbasdocEntityMap.put(bdInvbasdocEntity.getInvcode(), bdInvbasdocEntity);
|
|
|
|
|
}
|
|
|
|
|
return stringBdInvbasdocEntityMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -257,18 +373,41 @@ public class TocReturnBasicArchivesCacheUtil {
|
|
|
|
|
* @author liuyang
|
|
|
|
|
*/
|
|
|
|
|
// public static Map<String, BdTaxitemsEntity> stringBdTaxitemsEntityHashMap = new HashMap<>();
|
|
|
|
|
private Map<String, BdTaxitemsEntity> initBdTaxitemsEntity() throws Exception {
|
|
|
|
|
Map<String, BdTaxitemsEntity> stringBdTaxitemsEntityHashMap = new HashMap<>();
|
|
|
|
|
// private Map<String, BdTaxitemsEntity> initBdTaxitemsEntity() throws Exception {
|
|
|
|
|
// Map<String, BdTaxitemsEntity> stringBdTaxitemsEntityHashMap = new HashMap<>();
|
|
|
|
|
//
|
|
|
|
|
// BdTaxitemsEntity bdTaxitemsEntity = new BdTaxitemsEntity();
|
|
|
|
|
// List<BdTaxitemsEntity> bdTaxitemsEntityList = iBdTaxitemsDao.queryBdInvbasdocByInvcodeV2(bdTaxitemsEntity);
|
|
|
|
|
// if (bdTaxitemsEntityList != null && bdTaxitemsEntityList.size() > 0) {
|
|
|
|
|
// for (int i = 0; i < bdTaxitemsEntityList.size(); i++) {
|
|
|
|
|
// BdTaxitemsEntity bdTaxitemsEntity1 = bdTaxitemsEntityList.get(i);
|
|
|
|
|
// stringBdTaxitemsEntityHashMap.put(bdTaxitemsEntity1.getInvcode(), bdTaxitemsEntity1);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// return stringBdTaxitemsEntityHashMap;
|
|
|
|
|
// }
|
|
|
|
|
private Map<String, BdTaxitemsEntity> initBdTaxitemsEntityV2(List<StockinOrderSearchResponse.StockinOrder.StockinB> detailsDtos) throws Exception {
|
|
|
|
|
List<BdTaxitemsEntity> allBdTaxitemsEntityList = new ArrayList<>();
|
|
|
|
|
Map<String, BdTaxitemsEntity> stringBdTaxitemsEntityMap = new HashMap<>();
|
|
|
|
|
if (detailsDtos != null && detailsDtos.size() > 0) {
|
|
|
|
|
List<List<StockinOrderSearchResponse.StockinOrder.StockinB>> lists = SplitListByCountUtil.splitListByCount(detailsDtos, 500);
|
|
|
|
|
for (int i = 0; i < lists.size(); i++) {
|
|
|
|
|
List<StockinOrderSearchResponse.StockinOrder.StockinB> stockinBList = lists.get(i);
|
|
|
|
|
String codesStr = stockinBList.stream().map(StockinOrderSearchResponse.StockinOrder.StockinB::getSkuCode).map(id -> "'" + id + "'").collect(Collectors.joining(","));
|
|
|
|
|
|
|
|
|
|
BdTaxitemsEntity bdTaxitemsEntity = new BdTaxitemsEntity();
|
|
|
|
|
bdTaxitemsEntity.setInvcodes(codesStr);
|
|
|
|
|
List<BdTaxitemsEntity> bdTaxitemsEntityList = iBdTaxitemsDao.queryBdInvbasdocByInvcodeV2(bdTaxitemsEntity);
|
|
|
|
|
if (bdTaxitemsEntityList != null && bdTaxitemsEntityList.size() > 0) {
|
|
|
|
|
for (int i = 0; i < bdTaxitemsEntityList.size(); i++) {
|
|
|
|
|
BdTaxitemsEntity bdTaxitemsEntity1 = bdTaxitemsEntityList.get(i);
|
|
|
|
|
stringBdTaxitemsEntityHashMap.put(bdTaxitemsEntity1.getInvcode(), bdTaxitemsEntity1);
|
|
|
|
|
allBdTaxitemsEntityList.addAll(bdTaxitemsEntityList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return stringBdTaxitemsEntityHashMap;
|
|
|
|
|
if (allBdTaxitemsEntityList.size() > 0) {
|
|
|
|
|
for (int i = 0; i < allBdTaxitemsEntityList.size(); i++) {
|
|
|
|
|
BdTaxitemsEntity bdTaxitemsEntity = allBdTaxitemsEntityList.get(i);
|
|
|
|
|
stringBdTaxitemsEntityMap.put(bdTaxitemsEntity.getInvcode(), bdTaxitemsEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return stringBdTaxitemsEntityMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -280,8 +419,10 @@ public class TocReturnBasicArchivesCacheUtil {
|
|
|
|
|
private Map<String, BdDefdocEntity> initSourcePlatform() {
|
|
|
|
|
Map<String, BdDefdocEntity> stringBdDefdocEntityHashMap = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
String platformZdyId2 = OverallConstant.getOverAllValue("u8c自定义项档案-平台主键");
|
|
|
|
|
BdDefdocEntity bdDefdocEntity = new BdDefdocEntity();
|
|
|
|
|
bdDefdocEntity.setPkDefdoclist("0001A210000000000JUD");
|
|
|
|
|
// bdDefdocEntity.setPkDefdoclist("0001A210000000000JUD");
|
|
|
|
|
bdDefdocEntity.setPkDefdoclist(platformZdyId2);
|
|
|
|
|
bdDefdocEntity.setDr(0);
|
|
|
|
|
bdDefdocEntity.setDataSourceCode("lets_u8c");
|
|
|
|
|
List<BdDefdocEntity> bdDefdocEntityList = iBdDefdocDao.query(bdDefdocEntity);
|
|
|
|
@ -301,8 +442,10 @@ public class TocReturnBasicArchivesCacheUtil {
|
|
|
|
|
private Map<String, BdDefdocEntity> initShopDiy() {
|
|
|
|
|
Map<String, BdDefdocEntity> shopDefdocEntityHashMap = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
String platformZdyId2 = OverallConstant.getOverAllValue("u8c自定义项档案-店铺主键");
|
|
|
|
|
BdDefdocEntity bdDefdocEntity = new BdDefdocEntity();
|
|
|
|
|
bdDefdocEntity.setPkDefdoclist("0001A210000000000XZX");
|
|
|
|
|
// bdDefdocEntity.setPkDefdoclist("0001A210000000000XZX");
|
|
|
|
|
bdDefdocEntity.setPkDefdoclist(platformZdyId2);
|
|
|
|
|
bdDefdocEntity.setDr(0);
|
|
|
|
|
bdDefdocEntity.setDataSourceCode("lets_u8c");
|
|
|
|
|
List<BdDefdocEntity> bdDefdocEntityList = iBdDefdocDao.query(bdDefdocEntity);
|
|
|
|
@ -360,20 +503,26 @@ public class TocReturnBasicArchivesCacheUtil {
|
|
|
|
|
/**
|
|
|
|
|
* 初始化缓存
|
|
|
|
|
*
|
|
|
|
|
* @param returnGoodHeaderDetailsDataDtoList OFS售后入库单
|
|
|
|
|
* @author liuyang
|
|
|
|
|
*/
|
|
|
|
|
public CacheTocMapVoV2 initCache() throws Exception {
|
|
|
|
|
public CacheTocMapVoV2 initCache(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoList) throws Exception {
|
|
|
|
|
Assert.notNull(returnGoodHeaderDetailsDataDtoList, "returnGoodHeaderDetailsDataDtoList不能为空!");
|
|
|
|
|
|
|
|
|
|
List<StockinOrderSearchResponse.StockinOrder.StockinB> stockinBList = initOfsDetailsDto(returnGoodHeaderDetailsDataDtoList);
|
|
|
|
|
List<StockinOrderSearchResponse.StockinOrder.StockinH> stockinHList = initOFsHeadDto(returnGoodHeaderDetailsDataDtoList);
|
|
|
|
|
|
|
|
|
|
// clearCache();
|
|
|
|
|
Map<String, BdCorpEntity> stringBdCorpEntityMap = initShop();
|
|
|
|
|
Map<String, BdStordocEntity> stringBdStordocEntityMap = initBdStordoc();
|
|
|
|
|
Map<String, BdCalbodyEntity> stringBdCalbodyEntityMap = initBdCalbody();
|
|
|
|
|
Map<String, BdSalestruEntity> stringBdSalestruEntityMap = initBdSalestru();
|
|
|
|
|
Map<String, BdDeptdocEntity> stringBdDeptdocEntityMap = initDept();
|
|
|
|
|
Map<String, BdCubasdocEntity> stringBdCubasdocEntityMap = initBdCubasdoc();
|
|
|
|
|
Map<String, BdCumandocEntity> stringBdCumandocEntityMap = initBdCumandoc();
|
|
|
|
|
Map<String, BdInvmandocEntity> stringBdInvmandocEntityMap = initInventoryFile();
|
|
|
|
|
Map<String, BdInvbasdocEntity> stringBdInvbasdocEntityMap = initBasicInventoryFile();
|
|
|
|
|
Map<String, BdTaxitemsEntity> stringBdTaxitemsEntityMap = initBdTaxitemsEntity();
|
|
|
|
|
Map<String, BdCubasdocEntity> stringBdCubasdocEntityMap = initBdCubasdocV2(stockinHList);
|
|
|
|
|
Map<String, BdCumandocEntity> stringBdCumandocEntityMap = initBdCumandocV2(stockinHList);
|
|
|
|
|
Map<String, BdInvmandocEntity> stringBdInvmandocEntityMap = initInventoryFileV2(stockinBList);
|
|
|
|
|
Map<String, BdInvbasdocEntity> stringBdInvbasdocEntityMap = initBasicInventoryFileV2(stockinBList);
|
|
|
|
|
Map<String, BdTaxitemsEntity> stringBdTaxitemsEntityMap = initBdTaxitemsEntityV2(stockinBList);
|
|
|
|
|
Map<String, BdDefdocEntity> stringBdDefdocEntityMap = initSourcePlatform();
|
|
|
|
|
Map<String, BdDefdocEntity> stringBdDefdocEntityMap1 = initShopDiy();
|
|
|
|
|
Map<String, BdRdclEntity> stringBdRdclEntityMap = initBdRdcl();
|
|
|
|
@ -394,4 +543,44 @@ public class TocReturnBasicArchivesCacheUtil {
|
|
|
|
|
cacheTocMapVoV2.setStringBdRdclEntityMap(stringBdRdclEntityMap);
|
|
|
|
|
return cacheTocMapVoV2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 整理出明细集合
|
|
|
|
|
*
|
|
|
|
|
* @author liuyang
|
|
|
|
|
*/
|
|
|
|
|
private List<StockinOrderSearchResponse.StockinOrder.StockinB> initOfsDetailsDto(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoLis) {
|
|
|
|
|
List<StockinOrderSearchResponse.StockinOrder.StockinB> stockinBList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
if (returnGoodHeaderDetailsDataDtoLis != null && returnGoodHeaderDetailsDataDtoLis.size() > 0) {
|
|
|
|
|
for (int i = 0; i < returnGoodHeaderDetailsDataDtoLis.size(); i++) {
|
|
|
|
|
StockinOrderSearchResponse.StockinOrder stockinOrder = returnGoodHeaderDetailsDataDtoLis.get(i);
|
|
|
|
|
StockinOrderSearchResponse.StockinOrder.StockinH header = stockinOrder.getHeader();
|
|
|
|
|
List<StockinOrderSearchResponse.StockinOrder.StockinB> details = stockinOrder.getDetails();
|
|
|
|
|
|
|
|
|
|
stockinBList.addAll(details);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return stockinBList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 整理出表头集合
|
|
|
|
|
*
|
|
|
|
|
* @author liuyang
|
|
|
|
|
*/
|
|
|
|
|
private List<StockinOrderSearchResponse.StockinOrder.StockinH> initOFsHeadDto(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoLis) throws Exception {
|
|
|
|
|
List<StockinOrderSearchResponse.StockinOrder.StockinH> stockinHList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
if (returnGoodHeaderDetailsDataDtoLis != null && returnGoodHeaderDetailsDataDtoLis.size() > 0) {
|
|
|
|
|
for (int i = 0; i < returnGoodHeaderDetailsDataDtoLis.size(); i++) {
|
|
|
|
|
StockinOrderSearchResponse.StockinOrder stockinOrder = returnGoodHeaderDetailsDataDtoLis.get(i);
|
|
|
|
|
List<StockinOrderSearchResponse.StockinOrder.StockinB> details = stockinOrder.getDetails();
|
|
|
|
|
StockinOrderSearchResponse.StockinOrder.StockinH header = stockinOrder.getHeader();
|
|
|
|
|
stockinHList.add(header);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return stockinHList;
|
|
|
|
|
}
|
|
|
|
|
}
|