提交本地代码

This commit is contained in:
liuy 2024-08-08 16:00:16 +08:00
parent 913889998e
commit dd75e2cecc
7 changed files with 162 additions and 33 deletions

View File

@ -2,7 +2,6 @@ package com.hzya.frame.plugin.lets.constant;
/** /**
* lets项目公共参数 * lets项目公共参数
*
*/ */
public class ProfilesActiveConstant { public class ProfilesActiveConstant {
@ -23,4 +22,6 @@ public class ProfilesActiveConstant {
public static final String TYPE_TIME_FRAME = "time_frame"; public static final String TYPE_TIME_FRAME = "time_frame";
public static final String TYPE_OTHER = "other"; public static final String TYPE_OTHER = "other";
public static final String U8C_URL = "http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface";
} }

View File

@ -17,7 +17,7 @@ import java.util.List;
//@Repository("BdInvbasdocDaoImpl") //@Repository("BdInvbasdocDaoImpl")
public class BdInvbasdocDaoImpl extends MybatisGenericDao<BdInvbasdocEntity, String> implements IBdInvbasdocDao { public class BdInvbasdocDaoImpl extends MybatisGenericDao<BdInvbasdocEntity, String> implements IBdInvbasdocDao {
@DS("sowow_sqlserver_test") @DS("lets_u8c")
@Override @Override
public BdInvbasdocEntity queryBdInvbasdocByPkInvmandoc(BdInvbasdocEntity bdInvbasdocEntity) throws Exception { public BdInvbasdocEntity queryBdInvbasdocByPkInvmandoc(BdInvbasdocEntity bdInvbasdocEntity) throws Exception {
Assert.notNull(bdInvbasdocEntity, "BdInvmandocEntity不可为空"); Assert.notNull(bdInvbasdocEntity, "BdInvmandocEntity不可为空");
@ -27,6 +27,7 @@ public class BdInvbasdocDaoImpl extends MybatisGenericDao<BdInvbasdocEntity, Str
return query(bdInvbasdocEntity, "com.hzya.frame.plugin.lets.dao.impl.BdInvbasdocDaoImpl.queryBdInvbasdocByPkInvmandoc"); return query(bdInvbasdocEntity, "com.hzya.frame.plugin.lets.dao.impl.BdInvbasdocDaoImpl.queryBdInvbasdocByPkInvmandoc");
} }
@DS("lets_u8c")
@Override @Override
public List<BdInvbasdocEntity> queryBdInvbasdocByPkInvmandocV2(BdInvbasdocEntity bdInvbasdocEntity) throws Exception { public List<BdInvbasdocEntity> queryBdInvbasdocByPkInvmandocV2(BdInvbasdocEntity bdInvbasdocEntity) throws Exception {
Assert.notNull(bdInvbasdocEntity, "BdInvmandocEntity不可为空"); Assert.notNull(bdInvbasdocEntity, "BdInvmandocEntity不可为空");

View File

@ -112,7 +112,20 @@ public class BdInvbasdocEntity extends BaseEntity {
* createtime结束时间 * createtime结束时间
*/ */
private String createtime_end_time; private String createtime_end_time;
/**
* 管理档案公司主键
*/
private String pk_corp_man;
public String getPk_corp_man() {
return pk_corp_man;
}
public void setPk_corp_man(String pk_corp_man) {
this.pk_corp_man = pk_corp_man;
}
public String getCreatetime_start_time() { public String getCreatetime_start_time() {
return createtime_start_time; return createtime_start_time;
} }

View File

@ -83,6 +83,9 @@
<result property="unitweight" column="unitweight" jdbcType="VARCHAR"/> <result property="unitweight" column="unitweight" jdbcType="VARCHAR"/>
<result property="weitunitnum" column="weitunitnum" jdbcType="VARCHAR"/> <result property="weitunitnum" column="weitunitnum" jdbcType="VARCHAR"/>
<result property="width" column="width" jdbcType="VARCHAR"/> <result property="width" column="width" jdbcType="VARCHAR"/>
<result property="pk_invmandoc" column="pk_invmandoc" jdbcType="VARCHAR"/>
<result property="pk_corp_man" column="pk_corp_man" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<!-- 查询的字段--> <!-- 查询的字段-->
<sql id = "BdInvbasdocEntity_Base_Column_List"> <sql id = "BdInvbasdocEntity_Base_Column_List">
@ -989,11 +992,16 @@ update bd_invbasdoc set sts= 'N'
<!-- 存货档案查询:存货管理档案关联存货档案,--> <!-- 存货档案查询:存货管理档案关联存货档案,-->
<select id="queryBdInvbasdocByPkInvmandoc" parameterType="com.hzya.frame.plugin.lets.entity.BdInvbasdocEntity" resultMap="get-BdInvbasdocEntity-result"> <select id="queryBdInvbasdocByPkInvmandoc" parameterType="com.hzya.frame.plugin.lets.entity.BdInvbasdocEntity" resultMap="get-BdInvbasdocEntity-result">
select bia.* from bd_invmandoc bim SELECT
left join bd_invbasdoc bia bia.*,
on bim.pk_invbasdoc = bia.pk_invbasdoc bim.pk_invmandoc,
where bim.pk_corp pk_corp_man
FROM
bd_invmandoc bim
LEFT JOIN bd_invbasdoc bia ON bim.pk_invbasdoc = bia.pk_invbasdoc
WHERE
bim.dr = 0 bim.dr = 0
AND bia.dr = 0
<if test="pk_invmandoc!=null and pk_invmandoc!=''"> <if test="pk_invmandoc!=null and pk_invmandoc!=''">
and bim.pk_invmandoc = #{pk_invmandoc} and bim.pk_invmandoc = #{pk_invmandoc}
</if> </if>

View File

@ -3,10 +3,12 @@ package com.hzya.frame.plugin.lets.plugin.sales;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Assert; import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity; import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.beanutil.BeanUtil; import com.hzya.frame.beanutil.BeanUtil;
import com.hzya.frame.plugin.lets.constant.ProfilesActiveConstant;
import com.hzya.frame.plugin.lets.entity.*; import com.hzya.frame.plugin.lets.entity.*;
import com.hzya.frame.plugin.lets.ofs.dao.ITocofsSaleoutDao; import com.hzya.frame.plugin.lets.ofs.dao.ITocofsSaleoutDao;
import com.hzya.frame.plugin.lets.ofs.dao.ITocofsSaleoutDetailedDao; import com.hzya.frame.plugin.lets.ofs.dao.ITocofsSaleoutDetailedDao;
@ -15,10 +17,7 @@ import com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutEntity;
import com.hzya.frame.plugin.lets.ofs.service.ITocofsSaleoutService; import com.hzya.frame.plugin.lets.ofs.service.ITocofsSaleoutService;
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo; import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo;
import com.hzya.frame.plugin.lets.resultvo.CalculateDateVo; import com.hzya.frame.plugin.lets.resultvo.CalculateDateVo;
import com.hzya.frame.plugin.lets.u8cdto.SaleorderRequestChildrenDto; import com.hzya.frame.plugin.lets.u8cdto.*;
import com.hzya.frame.plugin.lets.u8cdto.SaleorderRequestDto;
import com.hzya.frame.plugin.lets.u8cdto.SaleorderRequestParentDto;
import com.hzya.frame.plugin.lets.u8cdto.SonDetailsDto;
import com.hzya.frame.plugin.lets.util.BasicArchivesCacheUtil; import com.hzya.frame.plugin.lets.util.BasicArchivesCacheUtil;
import com.hzya.frame.plugin.lets.util.DateStrUtil; import com.hzya.frame.plugin.lets.util.DateStrUtil;
import com.hzya.frame.plugin.lets.util.QueryBdBusitypeUtil; import com.hzya.frame.plugin.lets.util.QueryBdBusitypeUtil;
@ -151,6 +150,11 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
} catch (Exception e) { } catch (Exception e) {
logger.error("startImplement方法抛出异常", e); logger.error("startImplement方法抛出异常", e);
} finally { } finally {
try {
basicArchivesCacheUtil.clearCache();
} catch (Exception e) {
logger.info("清理档案缓存失败", e);
}
LOCK.unlock(); LOCK.unlock();
} }
} }
@ -301,7 +305,8 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
BdStordocEntity bdStordocEntity1 = oldValue.get(0).getBdStordocEntity1();//收货仓库 BdStordocEntity bdStordocEntity1 = oldValue.get(0).getBdStordocEntity1();//收货仓库
BdSalestruEntity bdSalestruEntity = oldValue.get(0).getBdSalestruEntity();//销售组织 BdSalestruEntity bdSalestruEntity = oldValue.get(0).getBdSalestruEntity();//销售组织
BdDeptdocEntity bdDeptdocEntity = oldValue.get(0).getBdDeptdocEntity();//业务部门 BdDeptdocEntity bdDeptdocEntity = oldValue.get(0).getBdDeptdocEntity();//业务部门
BdCumandocEntity bdCumandocEntity = oldValue.get(0).getBdCumandocEntity();//客商档案 BdCumandocEntity bdCumandocEntity = oldValue.get(0).getBdCumandocEntity();//客商管理档案
BdCubasdocEntity bdCubasdocEntity = oldValue.get(0).getBdCubasdocEntity();//客商基本档案
try { try {
checkArchives(oldValue.get(0)); checkArchives(oldValue.get(0));
@ -394,9 +399,13 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
// saleorderRequestChildrenDto.setCrecwareid(bdStordocEntity1.getPkStordoc());//收货仓库 // saleorderRequestChildrenDto.setCrecwareid(bdStordocEntity1.getPkStordoc());//收货仓库
saleorderRequestChildrenDtoList.add(saleorderRequestChildrenDto); saleorderRequestChildrenDtoList.add(saleorderRequestChildrenDto);
//推送到U8C接口 //销售订单单据推送到u8c
List<SaleorderRequestDto> saleorderRequestDtoList = new ArrayList<>();
saleorderRequestDtoList.add(saleorderRequestDto);
Map<String, List<SaleorderRequestDto>> stringStringMap = new HashMap<>();
stringStringMap.put("saleorder", saleorderRequestDtoList);
SoSaleResultRootDto soSaleResultRootDto = sendU8CTOCOrder(JSON.toJSONString(stringStringMap));
//记录成功 //记录成功
} catch (Exception e) { } catch (Exception e) {
logger.error("TOC业务转换成U8C对象过程中、或者单据推送到U8C出现异常", e); logger.error("TOC业务转换成U8C对象过程中、或者单据推送到U8C出现异常", e);
@ -459,7 +468,9 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.DetailsDto> details = headerDetailsDto.getDetails(); List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.DetailsDto> details = headerDetailsDto.getDetails();
//表头公司通过名称匹配U8C公司 //表头公司通过名称匹配U8C公司
BdCorpEntity bdCorpEntity = BasicArchivesCacheUtil.stringBdCorpEntityMap.get("上海丽知品牌管理有限公司管理员"); String corpName = "上海丽知品牌管理有限公司";
BdCorpEntity bdCorpEntity = BasicArchivesCacheUtil.stringBdCorpEntityMap.get(corpName);
Assert.notNull(bdCorpEntity, "根据公司名称({})没有匹配到U8C公司档案", corpName);
//发货库存组织 //发货库存组织
BdCalbodyEntity bdCalbodyEntity = BasicArchivesCacheUtil.stringBdCalbodyEntityMap.get(bdCorpEntity.getPkCorp()); BdCalbodyEntity bdCalbodyEntity = BasicArchivesCacheUtil.stringBdCalbodyEntityMap.get(bdCorpEntity.getPkCorp());
@ -479,17 +490,23 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
//收货仓库通过收货库存组织+仓库编码确定收货仓库 //收货仓库通过收货库存组织+仓库编码确定收货仓库
//销售组织2024年8月5日 15:33:40 和妮姐确认销售组织和表头公司作为一对一的关系 //销售组织2024年8月5日 15:33:40 和妮姐确认销售组织和表头公司作为一对一的关系
BdSalestruEntity bdSalestruEntity = BasicArchivesCacheUtil.stringBdSalestruEntityMap.get(bdCorpEntity.getPkCorp()); BdSalestruEntity bdSalestruEntity = BasicArchivesCacheUtil.stringBdSalestruEntityMap.get(bdCorpEntity.getUnitname());
Assert.notNull(bdSalestruEntity, "无匹配到销售组织 公司名称:{}", bdCorpEntity.getPkCorp()); Assert.notNull(bdSalestruEntity, "无匹配到销售组织 表头公司名称:{}", bdCorpEntity.getUnitname());
//业务部门暂定的部门名称其他2024年8月5日 15:39:42 已经和妮姐确认 //业务部门暂定的部门名称其他2024年8月5日 15:39:42 已经和妮姐确认
BdDeptdocEntity bdDeptdocEntity = BasicArchivesCacheUtil.stringBdDeptdocEntityMap.get(bdCorpEntity.getPkCorp()); BdDeptdocEntity bdDeptdocEntity = BasicArchivesCacheUtil.stringBdDeptdocEntityMap.get(bdCorpEntity.getPkCorp());
Assert.notNull(bdDeptdocEntity, "无法匹配到业务部门 部门名称:其他 对应公司名称:{}", bdCorpEntity.getPkCorp()); Assert.notNull(bdDeptdocEntity, "无法匹配到业务部门 部门名称:其他 对应公司名称:{}", bdCorpEntity.getPkCorp());
//客商档案2024年8月5日 15:41:54 TOC店铺名称查询U8C客商档案已经和妮姐确认 //客商基本档案
//TODO 2024年8月8日 12:05:10 O店铺的业务编码=U8C客商自定义项1O没有店铺信息查询接口因此无法通过出库单的店铺编码查询到O店铺档案对应的业务编码接口上线之后需要补充这一部分逻辑
String custName = "天猫intoyou旗舰店-自营";
BdCubasdocEntity bdCubasdocEntity = BasicArchivesCacheUtil.stringBdCubasdocEntityHashMap.get(custName);
Assert.notNull(bdCubasdocEntity, "无法匹配到客户档案 客商名称:{}", custName);
//客商管理档案2024年8月5日 15:41:54 TOC店铺名称查询U8C客商档案已经和妮姐确认
//2024年8月5日 15:49:49 先根据O店铺编码得到店铺档案信息取到名称通过U8C接口查询出来 //2024年8月5日 15:49:49 先根据O店铺编码得到店铺档案信息取到名称通过U8C接口查询出来
//目前O店铺信息查询接口还没有等待开发所以我这里先写所一个名字 //目前O店铺信息查询接口还没有等待开发所以我这里先写所一个名字
BdCumandocEntity bdCumandocEntity = BasicArchivesCacheUtil.stringBdCumandocEntityMap.get("天猫intoyou旗舰店-自营"); BdCumandocEntity bdCumandocEntity = BasicArchivesCacheUtil.stringBdCumandocEntityMap.get(bdCubasdocEntity.getPkCubasdoc() + bdCorpEntity.getPkCorp());
Assert.notNull(bdCumandocEntity, "无法匹配到客商档案 店铺名称:{}", "天猫intoyou旗舰店-自营"); Assert.notNull(bdCumandocEntity, "无法匹配到客商档案 店铺名称:{}", "天猫intoyou旗舰店-自营");
//字段拷贝 //字段拷贝
@ -509,6 +526,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
sonDetailsDto.setBdSalestruEntity(bdSalestruEntity); sonDetailsDto.setBdSalestruEntity(bdSalestruEntity);
sonDetailsDto.setBdDeptdocEntity(bdDeptdocEntity); sonDetailsDto.setBdDeptdocEntity(bdDeptdocEntity);
sonDetailsDto.setBdCumandocEntity(bdCumandocEntity); sonDetailsDto.setBdCumandocEntity(bdCumandocEntity);
sonDetailsDto.setBdCubasdocEntity(bdCubasdocEntity);
BeanUtil.copyPropertiesV2(detailsDto, sonDetailsDto); BeanUtil.copyPropertiesV2(detailsDto, sonDetailsDto);
sonDetailsDtoList.add(sonDetailsDto); sonDetailsDtoList.add(sonDetailsDto);
@ -518,12 +536,6 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
} catch (Exception e) { } catch (Exception e) {
logger.error("OFS销售出库单关联查询U8C档案失败", e); logger.error("OFS销售出库单关联查询U8C档案失败", e);
//失败 //失败
} finally {
try {
basicArchivesCacheUtil.clearCache();
} catch (Exception e) {
logger.info("清理档案缓存失败", e);
}
} }
} else { } else {
logger.info("queryBasicArchives方法headerDetailsDtoList.size为0"); logger.info("queryBasicArchives方法headerDetailsDtoList.size为0");
@ -588,7 +600,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
//SKU //SKU
String skuCode = sonDetailsDto.getSkuCode(); String skuCode = sonDetailsDto.getSkuCode();
//出库类型 //出库类型
String shipmentType = header.getShipmentType(); String refOrderType = header.getRefOrderType();
StringBuffer summaryDimensionStr = new StringBuffer(); StringBuffer summaryDimensionStr = new StringBuffer();
if (bdCorpEntity != null && bdCorpEntity.getPkCorp() != null) { if (bdCorpEntity != null && bdCorpEntity.getPkCorp() != null) {
@ -619,8 +631,8 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
} }
summaryDimensionStr.append(ADD); summaryDimensionStr.append(ADD);
if (shipmentType != null && !"".equals(shipmentType)) { if (refOrderType != null && !"".equals(refOrderType)) {
summaryDimensionStr.append(shipmentType); summaryDimensionStr.append(refOrderType);
} else { } else {
summaryDimensionStr.append(NOTHING); summaryDimensionStr.append(NOTHING);
} }
@ -642,7 +654,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
private BdBusitypeEntity u8cOperationFlow() throws Exception { private BdBusitypeEntity u8cOperationFlow() throws Exception {
//查询业务流程 //查询业务流程
//2024年8月6日 11:33:07 具体的业务流程名称还需要实施提供 //2024年8月6日 11:33:07 具体的业务流程名称还需要实施提供
String processName = "TOC"; String processName = "TOC售业务流程";
BdBusitypeEntity bdBusitypeEntity = queryBdBusitypeUtil.queryBdBusitype(processName); BdBusitypeEntity bdBusitypeEntity = queryBdBusitypeUtil.queryBdBusitype(processName);
Assert.notNull(bdBusitypeEntity, "根据业务流程名称({})没有查询到业务流程", processName); Assert.notNull(bdBusitypeEntity, "根据业务流程名称({})没有查询到业务流程", processName);
return bdBusitypeEntity; return bdBusitypeEntity;
@ -744,4 +756,60 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
Assert.notNull(bdTaxitemsEntity, "根据存货编码({}),无法匹配到税率!", invcode); Assert.notNull(bdTaxitemsEntity, "根据存货编码({}),无法匹配到税率!", invcode);
return bdTaxitemsEntity; return bdTaxitemsEntity;
} }
/**
* 2024年8月8日 10:54:48
* 推送U8C销售订单方法
*
* @author liuyang
*/
public SoSaleResultRootDto sendU8CTOCOrder(String param) {
long startLong = System.currentTimeMillis();
logger.info("TOC推送开始推送参数" + param + ",U8C_URL:" + ProfilesActiveConstant.U8C_URL);
String result = HttpRequest.post(ProfilesActiveConstant.U8C_URL).header("appId", "800037")//头信息多个头信息多次调用此方法即可
.header("usercode", "admin").header("password", "21232f297a57a5a743894a0e4a801fc3").header("system", "lz").header("trantype", "PK").header("apiCode", "8000370006")//头信息多个头信息多次调用此方法即可
.header("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj")//头信息多个头信息多次调用此方法即可
.header("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息多个头信息多次调用此方法即可
.body(param)//表单内容
.timeout(20000)//超时毫秒
.execute().body();
logger.info("TOC推送结束返回参数" + result);
long endLong = System.currentTimeMillis();
logger.info("TOC接口请求耗时" + (endLong - startLong));
boolean isSuccess = false;
SoSaleResultRootDto soSaleResultRootDto = null;
if (result != null && !"".equals(result)) {
ReusltStrDto reusltStrDto = JSON.parseObject(result, ReusltStrDto.class);
if ("success".equals(reusltStrDto.getStatus())) {
soSaleResultRootDto = resultDataHandle(reusltStrDto.getData());
isSuccess = true;
}
}
if (!isSuccess) {
Assert.state(false, "TOC业务O出库单推送U8C销售订单失败 接口返回结果:{}", result);
}
return soSaleResultRootDto;
}
/**
* 返回结果解析处理在确认了success后调用
*
* @author liuyang
*/
private SoSaleResultRootDto resultDataHandle(String resultData) {
try {
if (resultData != null && !"".equals(resultData)) {
if (resultData.contains("[")) {
resultData = resultData.substring(1, resultData.length() - 1);
}
return JSON.parseObject(resultData, SoSaleResultRootDto.class);
}
} catch (Exception e) {
e.printStackTrace();
logger.error("解析返回参数失败的错误", e);
//如果解析失败记录原因但是不能影响结果的记录
}
return null;
}
} }

View File

@ -57,10 +57,15 @@ public class SonDetailsDto extends DetailsDto {
private BdDeptdocEntity bdDeptdocEntity; private BdDeptdocEntity bdDeptdocEntity;
/** /**
* 客商档案 * 客商管理档案
*/ */
private BdCumandocEntity bdCumandocEntity; private BdCumandocEntity bdCumandocEntity;
/**
* 客商基本档案
*/
private BdCubasdocEntity bdCubasdocEntity;
/** /**
* 生成汇总维度字符串 * 生成汇总维度字符串
*/ */
@ -184,4 +189,12 @@ public class SonDetailsDto extends DetailsDto {
public void setHeader(HeaderDto header) { public void setHeader(HeaderDto header) {
this.header = header; this.header = header;
} }
public BdCubasdocEntity getBdCubasdocEntity() {
return bdCubasdocEntity;
}
public void setBdCubasdocEntity(BdCubasdocEntity bdCubasdocEntity) {
this.bdCubasdocEntity = bdCubasdocEntity;
}
} }

View File

@ -49,6 +49,9 @@ public class BasicArchivesCacheUtil {
@Autowired @Autowired
private IBdTaxitemsDao iBdTaxitemsDao; private IBdTaxitemsDao iBdTaxitemsDao;
@Autowired
private IBdCubasdocDao iBdCubasdocDao;
/** /**
* 初始化公司档案-表头公司 * 初始化公司档案-表头公司
* 2024年7月31日 11:16:23 * 2024年7月31日 11:16:23
@ -119,7 +122,7 @@ public class BasicArchivesCacheUtil {
if (bdSalestruEntityList != null && bdSalestruEntityList.size() > 0) { if (bdSalestruEntityList != null && bdSalestruEntityList.size() > 0) {
for (int i = 0; i < bdSalestruEntityList.size(); i++) { for (int i = 0; i < bdSalestruEntityList.size(); i++) {
BdSalestruEntity bdSalestruEntity1 = bdSalestruEntityList.get(i); BdSalestruEntity bdSalestruEntity1 = bdSalestruEntityList.get(i);
stringBdSalestruEntityMap.put(bdSalestruEntity1.getPkCorp(), bdSalestruEntity1); stringBdSalestruEntityMap.put(bdSalestruEntity1.getVsalestruname(), bdSalestruEntity1);
} }
} }
} }
@ -135,7 +138,7 @@ public class BasicArchivesCacheUtil {
BdDeptdocEntity bdDeptdocEntity = new BdDeptdocEntity(); BdDeptdocEntity bdDeptdocEntity = new BdDeptdocEntity();
bdDeptdocEntity.setDataSourceCode("lets_u8c"); bdDeptdocEntity.setDataSourceCode("lets_u8c");
bdDeptdocEntity.setDr(0); bdDeptdocEntity.setDr(0);
bdDeptdocEntity.setDeptname("其他"); bdDeptdocEntity.setDeptname("其他部门");
List<BdDeptdocEntity> bdDeptdocEntityList = iBdDeptdocDao.query(bdDeptdocEntity); List<BdDeptdocEntity> bdDeptdocEntityList = iBdDeptdocDao.query(bdDeptdocEntity);
if (bdDeptdocEntityList != null && bdDeptdocEntityList.size() > 0) { if (bdDeptdocEntityList != null && bdDeptdocEntityList.size() > 0) {
for (int i = 0; i < bdDeptdocEntityList.size(); i++) { for (int i = 0; i < bdDeptdocEntityList.size(); i++) {
@ -145,6 +148,26 @@ public class BasicArchivesCacheUtil {
} }
} }
/**
* 初始化客商基本档案
*
* @author liuyang
*/
public static Map<String, BdCubasdocEntity> stringBdCubasdocEntityHashMap = new HashMap<>();
private void initBdCubasdoc() {
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);
}
}
}
/** /**
* 初始化客商管理档案 * 初始化客商管理档案
* *
@ -199,7 +222,7 @@ public class BasicArchivesCacheUtil {
if (bdInvbasdocEntity2 != null && bdInvbasdocEntity2.size() > 0) { if (bdInvbasdocEntity2 != null && bdInvbasdocEntity2.size() > 0) {
for (int i = 0; i < bdInvbasdocEntity2.size(); i++) { for (int i = 0; i < bdInvbasdocEntity2.size(); i++) {
BdInvbasdocEntity bdInvbasdocEntity1 = bdInvbasdocEntity2.get(i); BdInvbasdocEntity bdInvbasdocEntity1 = bdInvbasdocEntity2.get(i);
stringBdInvbasdocEntityHashMap.put(bdInvbasdocEntity1.getPk_invmandoc() + bdInvbasdocEntity1.getPkCorp(), bdInvbasdocEntity1); stringBdInvbasdocEntityHashMap.put(bdInvbasdocEntity1.getPk_invmandoc() + bdInvbasdocEntity1.getPk_corp_man(), bdInvbasdocEntity1);
} }
} }
} }
@ -238,6 +261,7 @@ public class BasicArchivesCacheUtil {
stringBdInvmandocEntityMap.clear(); stringBdInvmandocEntityMap.clear();
stringBdInvbasdocEntityHashMap.clear(); stringBdInvbasdocEntityHashMap.clear();
stringBdTaxitemsEntityHashMap.clear(); stringBdTaxitemsEntityHashMap.clear();
stringBdCubasdocEntityHashMap.clear();
} }
/** /**
@ -257,6 +281,7 @@ public class BasicArchivesCacheUtil {
initInventoryFile(); initInventoryFile();
initBasicInventoryFile(); initBasicInventoryFile();
initBdTaxitemsEntity(); initBdTaxitemsEntity();
initBdCubasdoc();
} }
} }