文档更新和异常处理优化

- 在QueryOfsSoSaleOutVo类中添加审核时间字段,优化销售订单查询逻辑。
- 统一 logger.error 输出格式,在ConsignmachiningIn、ConsignmachiningInReturn、ProxyPurchaseReturn、ProxyPurchaseWarehousOrder 和 ProxyPurchaseWarehousWarehouse 类中修正异常记录方法名称。
- 在SoSaleOutPluginInitializerToB类中增加同步方法的参数校验,并优化日志记录和异常处理。
- 在SoSaleOutPluginInitializerToC类中进行类似的日志和异常处理优化。
- 以上修改增强了代码的健壮性和可读性,同时提高了系统的错误处理能力。
This commit is contained in:
liuy 2024-09-23 11:41:52 +08:00
parent 66f63ec31e
commit f99eace325
15 changed files with 373 additions and 191 deletions

View File

@ -40,22 +40,20 @@ public class QueryOfsSoSaleOutVo {
private String closedAt_end; private String closedAt_end;
private String storeCode; private String storeCode;
//审核开始
private String auditAt_start;
//审核结束
private String auditAt_end;
//交易成功时间开始 //交易成功时间开始
private String tradeSuccessAt_start; private String tradeSuccessAt_start;
//交易成功时间结束 //交易成功时间结束
private String tradeSuccessAt_end; private String tradeSuccessAt_end;
//交易成功状态 //交易成功状态
private String sourceOrderStatus; private String sourceOrderStatus;
//退款成功时间 //退款成功时间
private String refundedAt_start; private String refundedAt_start;
//退款成功时间 //退款成功时间
private String refundedAt_end; private String refundedAt_end;
//退款成功状态 //退款成功状态
private String refundStatus; private String refundStatus;
} }

View File

@ -161,10 +161,10 @@ public class ConsignmachiningIn extends PluginBaseEntity {
} }
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("executeBusiness方法异常", e); logger.error("executeBusiness-方法异常", e);
} }
long endMillis = System.currentTimeMillis(); long endMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用结束:" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis)); logger.info("executeBusiness-方法调用结束:" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis));
return null; return null;
} }
@ -199,7 +199,7 @@ public class ConsignmachiningIn extends PluginBaseEntity {
logger.info("没有查询到任何数据!不需要同步"); logger.info("没有查询到任何数据!不需要同步");
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("startImplement方法抛出异常", e); logger.error("startImplement-方法抛出异常", e);
} }
} }
}, threadNameStrStart); }, threadNameStrStart);
@ -244,7 +244,7 @@ public class ConsignmachiningIn extends PluginBaseEntity {
logger.info("没有查询到任何数据!不需要同步"); logger.info("没有查询到任何数据!不需要同步");
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("startImplement方法抛出异常", e); logger.error("startImplement-方法抛出异常", e);
} }
} }
}, threadNameStrStart); }, threadNameStrStart);

View File

@ -157,7 +157,7 @@ public class ConsignmachiningInReturn extends PluginBaseEntity {
} }
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("executeBusiness方法异常", e); logger.error("executeBusiness-方法异常", e);
} }
long endMillis = System.currentTimeMillis(); long endMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用结束" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis)); logger.info("executeBusiness方法调用结束" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis));

View File

@ -160,7 +160,7 @@ public class ProxyPurchaseReturn extends PluginBaseEntity {
} }
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("executeBusiness方法异常", e); logger.error("executeBusiness-方法异常", e);
} }
long endMillis = System.currentTimeMillis(); long endMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用结束" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis)); logger.info("executeBusiness方法调用结束" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis));

View File

@ -154,7 +154,7 @@ public class ProxyPurchaseWarehousOrder extends PluginBaseEntity {
} }
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("executeBusiness方法异常", e); logger.error("executeBusiness-方法抛出异常", e);
} }
long endMillis = System.currentTimeMillis(); long endMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用结束" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis)); logger.info("executeBusiness方法调用结束" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis));
@ -164,6 +164,8 @@ public class ProxyPurchaseWarehousOrder extends PluginBaseEntity {
/** /**
* 根据时间范围查询 * 根据时间范围查询
* *
* @param startTime 开始时间
* @param endTime 结束时间
* @author liuyang * @author liuyang
*/ */
public void startImplementByTime(String startTime, String endTime) { public void startImplementByTime(String startTime, String endTime) {
@ -175,11 +177,13 @@ public class ProxyPurchaseWarehousOrder extends PluginBaseEntity {
@Override @Override
public void run() { public void run() {
try { try {
Assert.notNull(startTime, "startTime不能为空");
Assert.notNull(endTime, "endTime不能为空");
//不需要采购订单对应的状态放在接口里查询和杨运确认过如果采购订单在订单池那么不会有审核时间除了订单池+订单关闭状态其他状态都可以理解为审批状态
List<OfsPoOrderData> allOfsPoOrderList = new ArrayList<>(); List<OfsPoOrderData> allOfsPoOrderList = new ArrayList<>();
//TODO 测试这个查询条件是假的目前O还没有根据审批时间范围+审批状态查询的接口
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
queryOfsSoSaleOutVo.setClosedAt_start(startTime); queryOfsSoSaleOutVo.setAuditAt_start(startTime);
queryOfsSoSaleOutVo.setClosedAt_end(endTime); queryOfsSoSaleOutVo.setAuditAt_end(endTime);
queryOfsSoSaleOutVo.setClientCode("LETS"); queryOfsSoSaleOutVo.setClientCode("LETS");
queryOfsSoSaleOutVo.setPageNo(1L); queryOfsSoSaleOutVo.setPageNo(1L);
queryOfsSoSaleOutVo.setStatus(900L); queryOfsSoSaleOutVo.setStatus(900L);
@ -191,7 +195,7 @@ public class ProxyPurchaseWarehousOrder extends PluginBaseEntity {
logger.info("没有查询到任何数据!不需要同步"); logger.info("没有查询到任何数据!不需要同步");
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("startImplement方法抛出异常", e); logger.error("startImplementByTime-方法抛出异常", e);
} }
} }
}, threadNameStrStart); }, threadNameStrStart);
@ -220,6 +224,7 @@ public class ProxyPurchaseWarehousOrder extends PluginBaseEntity {
@Override @Override
public void run() { public void run() {
try { try {
Assert.notNull(code, "code不能为空");
List<OfsPoOrderData> allOfsPoOrderList = new ArrayList<>(); List<OfsPoOrderData> allOfsPoOrderList = new ArrayList<>();
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
queryOfsSoSaleOutVo.setClientCode("LETS"); queryOfsSoSaleOutVo.setClientCode("LETS");
@ -235,7 +240,7 @@ public class ProxyPurchaseWarehousOrder extends PluginBaseEntity {
logger.info("没有查询到任何数据!不需要同步"); logger.info("没有查询到任何数据!不需要同步");
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("startImplement方法抛出异常", e); logger.error("startImplementByCode-方法抛出异常", e);
} }
} }
}, threadNameStrStart); }, threadNameStrStart);

View File

@ -195,7 +195,7 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
logger.info("没有查询到任何数据!不需要同步"); logger.info("没有查询到任何数据!不需要同步");
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("startImplement方法抛出异常", e); logger.error("startImplementByTime-方法抛出异常", e);
} }
} }
}, threadNameStrStart); }, threadNameStrStart);
@ -240,7 +240,7 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
logger.info("没有查询到任何数据!不需要同步"); logger.info("没有查询到任何数据!不需要同步");
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("startImplement方法抛出异常", e); logger.error("startImplement-方法抛出异常", e);
} }
} }
}, threadNameStrStart); }, threadNameStrStart);

View File

@ -137,7 +137,7 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
} }
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("executeBusiness方法异常", e); logger.error("executeBusiness-方法异常", e);
} }
long endMillis = System.currentTimeMillis(); long endMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用结束" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis)); logger.info("executeBusiness方法调用结束" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis));
@ -206,6 +206,10 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
private static final String VNOTETYPE = "SALE"; private static final String VNOTETYPE = "SALE";
private static final Object PUSH_LOCK1 = new Object();
private static final Object PUSH_LOCK2 = new Object();
/** /**
* 库存同步按指定时间拉取 * 库存同步按指定时间拉取
* *
@ -246,7 +250,7 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
logger.info("没有查询到任何数据!不需要同步"); logger.info("没有查询到任何数据!不需要同步");
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("startImplementByStockTime方法抛出异常", e); logger.error("startImplementByStockTime-方法抛出异常", e);
} }
} }
}, threadNameStr); }, threadNameStr);
@ -301,7 +305,7 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
logger.info("没有查询到任何数据!不需要同步"); logger.info("没有查询到任何数据!不需要同步");
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("startImplementByTranTime方法抛出异常", e); logger.error("startImplementByTranTime-方法抛出异常", e);
} }
} }
}, threadNameStrStart); }, threadNameStrStart);
@ -824,29 +828,31 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
List<SaleorderRequestDto> saleorderRequestDtoList = new ArrayList<>(); List<SaleorderRequestDto> saleorderRequestDtoList = new ArrayList<>();
saleorderRequestDtoList.add(saleorderRequestDto); saleorderRequestDtoList.add(saleorderRequestDto);
Boolean aBoolean = checkTobOrder(header.getId(), header.getCode()); synchronized (PUSH_LOCK1) {
if (aBoolean) { Boolean aBoolean = checkTobOrder(header.getId(), header.getCode());
logger.error("经过SQL查询判断在U8C销售订单已经存在OFS入库单号为{} OFS入库主键为{}的单据为了避免造成单据重复不推送到U8C", header.getCode(), header.getId()); if (aBoolean) {
} else { logger.error("经过SQL查询判断在U8C销售订单已经存在OFS入库单号为{} OFS入库主键为{}的单据为了避免造成单据重复不推送到U8C", header.getCode(), header.getId());
logger.error("经过SQL查询判断在U8C销售订单不存在OFS入库单号为{} OFS入库主键为{}的单据将调用U8C接口执行推送", header.getCode(), header.getId()); } else {
Map<String, List<SaleorderRequestDto>> stringStringMap = new HashMap<>(); logger.error("经过SQL查询判断在U8C销售订单不存在OFS入库单号为{} OFS入库主键为{}的单据将调用U8C接口执行推送", header.getCode(), header.getId());
stringStringMap.put("saleorder", saleorderRequestDtoList); Map<String, List<SaleorderRequestDto>> stringStringMap = new HashMap<>();
SoSaleResultRootDto soSaleResultRootDto = sendU8CTOCOrder(JSON.toJSONString(stringStringMap)); stringStringMap.put("saleorder", saleorderRequestDtoList);
String vreceiptcode = null; SoSaleResultRootDto soSaleResultRootDto = sendU8CTOCOrder(JSON.toJSONString(stringStringMap));
String pk_corp = null; String vreceiptcode = null;
String csaleid = null; String pk_corp = null;
//成功 String csaleid = null;
if (soSaleResultRootDto != null) { //成功
SoSaleResultHeadDto parentvo = soSaleResultRootDto.getParentvo(); if (soSaleResultRootDto != null) {
List<SoSaleResultBodyDto> childrenvo = soSaleResultRootDto.getChildrenvo(); SoSaleResultHeadDto parentvo = soSaleResultRootDto.getParentvo();
List<SoSaleResultBodyDto> childrenvo = soSaleResultRootDto.getChildrenvo();
vreceiptcode = parentvo.getVreceiptcode(); vreceiptcode = parentvo.getVreceiptcode();
pk_corp = parentvo.getPk_corp(); pk_corp = parentvo.getPk_corp();
csaleid = parentvo.getCsaleid(); csaleid = parentvo.getCsaleid();
}
logger.info("TOB销售订单编号{} 主键:{} 公司:{}", vreceiptcode, csaleid, pk_corp);
//记录成功
updateSuccessOrFail2(details, "Y", "success", vreceiptcode, csaleid);
} }
logger.info("TOB销售订单编号{} 主键:{} 公司:{}", vreceiptcode, csaleid, pk_corp);
//记录成功
updateSuccessOrFail2(details, "Y", "success", vreceiptcode, csaleid);
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("推送TOB销售订单失败", e); logger.error("推送TOB销售订单失败", e);
@ -957,22 +963,30 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
Assert.state(false, "查询销售订单错误,失败原因:{}", e.getMessage()); Assert.state(false, "查询销售订单错误,失败原因:{}", e.getMessage());
} }
List<com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDetailsDto> headerDetailsDtoList1 = saleOrderMessageDto.getData();
if (headerDetailsDtoList1 == null || headerDetailsDtoList1.size() == 0) {
Assert.state(false, "根据OFS销售订单编码{},无法查询到对应的档案信息!", header.getRefOrderCode());
}
com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDetailsDto headerDetailsDto1 = headerDetailsDtoList1.get(0);
com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDto header2 = headerDetailsDto1.getHeader();
List<com.hzya.frame.ttxofs.dto.ofssalesordersearch.DetailsDto> details1 = headerDetailsDto1.getDetails();
if (saleOrderMessageDto == null) { if (saleOrderMessageDto == null) {
Assert.state(false, "没有匹配到售后订单,系统业务无法完成"); Assert.state(false, "没有匹配到售后订单,系统业务无法完成");
} }
com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDto header1 = saleOrderMessageDto.getData().get(0).getHeader(); // com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDto header1 = saleOrderMessageDto.getData().get(0).getHeader();
String memberId = header1.getMemberId(); String memberId = header2.getMemberId();
//测试 //测试
// memberId = "hzz"; // memberId = "hzz";
Assert.notNull(memberId, "TOB销售订单(OFS)表头会员id不能为空否则无法匹配U8C客商档案"); Assert.notNull(memberId, "TOB销售订单(OFS)表头会员id不能为空否则无法匹配U8C客商档案");
Assert.state(!"".equals(memberId.trim()), "TOB销售订单(OFS)表头会员id不能为空否则无法匹配U8C客商档案"); Assert.state(!"".equals(memberId.trim()), "TOB销售订单(OFS)表头会员id不能为空否则无法匹配U8C客商档案");
//如果没有O单据名称则默认为销售 //如果没有O单据名称则默认为销售
if (header1.getSubOrderType() == null || "".equals(header1.getSubOrderType().trim())) { if (header2.getSubOrderType() == null || "".equals(header2.getSubOrderType().trim())) {
header1.setSubOrderType("SALES"); header2.setSubOrderType("SALES");
} }
//查询对应的收发类别 //查询对应的收发类别
BdRdclEntity bdRdclEntity = rdclUtil.queryRdClObject(header1.getSubOrderType()); BdRdclEntity bdRdclEntity = rdclUtil.queryRdClObject(header2.getSubOrderType());
Assert.notNull(bdRdclEntity, "根据收发类别编码:{} 无法匹配到U8C收发类别"); Assert.notNull(bdRdclEntity, "根据收发类别编码:{} 无法匹配到U8C收发类别");
// 销售公司发货公司 // 销售公司发货公司
@ -1032,17 +1046,37 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
//业务部门 //业务部门
//2024年8月14日 10:38:37 已经和佳妮确认 //2024年8月14日 10:38:37 已经和佳妮确认
String deptName = "业务部门"; List<BdDeptdocEntity> bdDeptdocEntityList = null;
BdDeptdocEntity bdDeptdocEntity = new BdDeptdocEntity(); if (header2.getDepartmentType() == null || "".equals(header2.getDepartmentType().trim())) {
bdDeptdocEntity.setDataSourceCode("lets_u8c"); //如果O销售订单字段不存在默认用U8C业务部门
bdDeptdocEntity.setDr(0); logger.info("OFS销售订单号{} 不存在部门字段!", header2.getCode());
bdDeptdocEntity.setDeptname(deptName); String deptName = "业务部门";
bdDeptdocEntity.setPkCorp(bdCorpEntityList.get(0).getPkCorp()); BdDeptdocEntity bdDeptdocEntity = new BdDeptdocEntity();
List<BdDeptdocEntity> bdDeptdocEntityList = iBdDeptdocDao.query(bdDeptdocEntity); bdDeptdocEntity.setDataSourceCode("lets_u8c");
if (bdDeptdocEntityList.size() == 0) { bdDeptdocEntity.setDr(0);
Assert.state(false, "根据部门名称:{} 公司id{}无法匹配到U8C销售组织", deptName, bdCorpEntityList.get(0).getPkCorp()); bdDeptdocEntity.setDeptname(deptName);
} else if (bdDeptdocEntityList.size() >= 2) { bdDeptdocEntity.setPkCorp(bdCorpEntityList.get(0).getPkCorp());
Assert.state(false, "根据部门名称:{} 公司id{}匹配到U8C销售组织{}个", deptName, bdCorpEntityList.get(0).getPkCorp()); bdDeptdocEntityList = iBdDeptdocDao.query(bdDeptdocEntity);
if (bdDeptdocEntityList.size() == 0) {
Assert.state(false, "默认部门:根据部门名称:{} 公司id{}无法匹配到U8C销售组织", deptName, bdCorpEntityList.get(0).getPkCorp());
} else if (bdDeptdocEntityList.size() >= 2) {
Assert.state(false, "默认部门:根据部门名称:{} 公司id{}匹配到U8C销售组织{}个", deptName, bdCorpEntityList.get(0).getPkCorp());
}
} else {
//如果部门存在则用O指定的部门字段
logger.info("OFS销售订单号{} 存在部门字段:{}", header2.getCode(), header2.getDepartmentType());
String departmentTypeCode = header2.getDepartmentType().trim();
BdDeptdocEntity bdDeptdocEntity = new BdDeptdocEntity();
bdDeptdocEntity.setDataSourceCode("lets_u8c");
bdDeptdocEntity.setDr(0);
bdDeptdocEntity.setDeptcode(departmentTypeCode);
bdDeptdocEntity.setPkCorp(bdCorpEntityList.get(0).getPkCorp());
bdDeptdocEntityList = iBdDeptdocDao.query(bdDeptdocEntity);
if (bdDeptdocEntityList.size() == 0) {
Assert.state(false, "指定部门:根据部门编码:{} 公司id{}无法匹配到U8C销售组织", header2.getDepartmentType(), bdCorpEntityList.get(0).getPkCorp());
} else if (bdDeptdocEntityList.size() >= 2) {
Assert.state(false, "指定部门:根据部门编码:{} 公司id{}匹配到U8C销售组织{}个", header2.getDepartmentType(), bdCorpEntityList.get(0).getPkCorp());
}
} }
//客商基本档案 //客商基本档案
@ -1421,10 +1455,17 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
logger.error("查询销售订单错误,失败原因:{}", e.getMessage()); logger.error("查询销售订单错误,失败原因:{}", e.getMessage());
Assert.state(false, "查询销售订单错误,失败原因:{}", e.getMessage()); Assert.state(false, "查询销售订单错误,失败原因:{}", e.getMessage());
} }
List<com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDetailsDto> headerDetailsDtoList1 = saleOrderMessageDto.getData();
if (headerDetailsDtoList1 == null || headerDetailsDtoList1.size() == 0) {
Assert.state(false, "无法查询到OFS销售订单 OFS销售订单编码{}", header.getRefOrderCode());
}
com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDetailsDto headerDetailsDto1 = headerDetailsDtoList1.get(0);
com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDto header2 = headerDetailsDto1.getHeader();
List<com.hzya.frame.ttxofs.dto.ofssalesordersearch.DetailsDto> details1 = headerDetailsDto1.getDetails();
if (saleOrderMessageDto == null) { if (saleOrderMessageDto == null) {
Assert.state(false, "根据单号:{},没有匹配到销售订单,系统业务无法完成", header.getRefOrderCode()); Assert.state(false, "根据单号:{},没有匹配到销售订单,系统业务无法完成", header.getRefOrderCode());
} }
com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDto header1 = saleOrderMessageDto.getData().get(0).getHeader(); com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDto header1 = saleOrderMessageDto.getData().get(0).getHeader();
String memberId = header1.getMemberId(); String memberId = header1.getMemberId();
// 测试 // 测试
@ -1554,17 +1595,36 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
//业务部门 //业务部门
//2024年8月14日 10:38:37 已经和佳妮确认 //2024年8月14日 10:38:37 已经和佳妮确认
String deptName = "其他部门"; List<BdDeptdocEntity> bdDeptdocEntityList = null;
BdDeptdocEntity bdDeptdocEntity = new BdDeptdocEntity(); if (header2.getDepartmentType() == null || "".equals(header2.getDepartmentType().trim())) {
bdDeptdocEntity.setDataSourceCode("lets_u8c"); logger.info("OFS销售订单号{} 不存在部门字段!", header2.getCode());
bdDeptdocEntity.setDr(0); String deptName = "业务部门";
bdDeptdocEntity.setDeptname(deptName); BdDeptdocEntity bdDeptdocEntity = new BdDeptdocEntity();
bdDeptdocEntity.setPkCorp(bdCorpEntityList.get(0).getPkCorp()); bdDeptdocEntity.setDataSourceCode("lets_u8c");
List<BdDeptdocEntity> bdDeptdocEntityList = iBdDeptdocDao.query(bdDeptdocEntity); bdDeptdocEntity.setDr(0);
if (bdDeptdocEntityList.size() == 0) { bdDeptdocEntity.setDeptname(deptName);
Assert.state(false, "根据部门名称:{} 公司id{}无法匹配到U8C销售组织", deptName, bdCorpEntityList.get(0).getPkCorp()); bdDeptdocEntity.setPkCorp(bdCorpEntityList.get(0).getPkCorp());
} else if (bdDeptdocEntityList.size() >= 2) { bdDeptdocEntityList = iBdDeptdocDao.query(bdDeptdocEntity);
Assert.state(false, "根据部门名称:{} 公司id{}匹配到U8C销售组织{}个", deptName, bdCorpEntityList.get(0).getPkCorp()); if (bdDeptdocEntityList.size() == 0) {
Assert.state(false, "默认部门:根据部门名称:{} 公司id{}无法匹配到U8C销售组织", deptName, bdCorpEntityList.get(0).getPkCorp());
} else if (bdDeptdocEntityList.size() >= 2) {
Assert.state(false, "默认部门:根据部门名称:{} 公司id{}匹配到U8C销售组织{}个", deptName, bdCorpEntityList.get(0).getPkCorp());
}
} else {
//如果部门存在则用O指定的部门字段
logger.info("OFS销售订单号{} 存在部门字段:{}", header2.getCode(), header2.getDepartmentType());
String departmentTypeCode = header2.getDepartmentType().trim();
BdDeptdocEntity bdDeptdocEntity = new BdDeptdocEntity();
bdDeptdocEntity.setDataSourceCode("lets_u8c");
bdDeptdocEntity.setDr(0);
bdDeptdocEntity.setDeptcode(departmentTypeCode);
bdDeptdocEntity.setPkCorp(bdCorpEntityList.get(0).getPkCorp());
bdDeptdocEntityList = iBdDeptdocDao.query(bdDeptdocEntity);
if (bdDeptdocEntityList.size() == 0) {
Assert.state(false, "指定部门:根据部门编码:{} 公司id{}无法匹配到U8C销售组织", header2.getDepartmentType(), bdCorpEntityList.get(0).getPkCorp());
} else if (bdDeptdocEntityList.size() >= 2) {
Assert.state(false, "指定部门:根据部门编码:{} 公司id{}匹配到U8C销售组织{}个", header2.getDepartmentType(), bdCorpEntityList.get(0).getPkCorp());
}
} }
//客商基本档案 //客商基本档案
@ -1846,26 +1906,28 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
stringListMap.put("billvos", salesInvoiceDtoList); stringListMap.put("billvos", salesInvoiceDtoList);
//推送到U8C之前再次验证在U8C是否已经存在 //推送到U8C之前再次验证在U8C是否已经存在
Boolean aBoolean = checkTobSalesInvoice(header.getId(), header.getCode()); synchronized (PUSH_LOCK2) {
if (aBoolean) { Boolean aBoolean = checkTobSalesInvoice(header.getId(), header.getCode());
logger.error("经过SQL查询判断在U8C销售发票中已经存在OFS入库单号为{} OFS入库主键为{}的单据为了避免造成单据重复不推送到U8C", header.getCode(), header.getId()); if (aBoolean) {
} else { logger.error("经过SQL查询判断在U8C销售发票中已经存在OFS入库单号为{} OFS入库主键为{}的单据为了避免造成单据重复不推送到U8C", header.getCode(), header.getId());
logger.error("经过SQL查询判断在U8C销售发票中不存在OFS入库单号为{} OFS入库主键为{}的单据将调用U8C接口执行推送", header.getCode(), header.getId()); } else {
SaleinvoiceDto saleinvoiceDto = sendU8CTOCSoSaleinvoiceB(JSON.toJSONString(stringListMap)); logger.error("经过SQL查询判断在U8C销售发票中不存在OFS入库单号为{} OFS入库主键为{}的单据将调用U8C接口执行推送", header.getCode(), header.getId());
//成功 SaleinvoiceDto saleinvoiceDto = sendU8CTOCSoSaleinvoiceB(JSON.toJSONString(stringListMap));
String vreceiptcode = null; //成功
String csaleid = null; String vreceiptcode = null;
String pk_corp = null; String csaleid = null;
if (saleinvoiceDto != null && saleinvoiceDto.getParentvo() != null && saleinvoiceDto.getChildrenvo() != null) { String pk_corp = null;
SaleinvoiceHeadDto parentvo = saleinvoiceDto.getParentvo(); if (saleinvoiceDto != null && saleinvoiceDto.getParentvo() != null && saleinvoiceDto.getChildrenvo() != null) {
List<SaleinvoiceBodyDto> childrenvo = saleinvoiceDto.getChildrenvo(); SaleinvoiceHeadDto parentvo = saleinvoiceDto.getParentvo();
vreceiptcode = parentvo.getVreceiptcode(); List<SaleinvoiceBodyDto> childrenvo = saleinvoiceDto.getChildrenvo();
csaleid = parentvo.getCsaleid(); vreceiptcode = parentvo.getVreceiptcode();
pk_corp = parentvo.getPk_corp(); csaleid = parentvo.getCsaleid();
pk_corp = parentvo.getPk_corp();
}
logger.info("TOB销售发票生成成功 编码:{} 主键:{} 发票公司:{}", vreceiptcode, csaleid, pk_corp);
//记录成功
updateSuccessOrFail3(details, "Y", "success", vreceiptcode, csaleid);
} }
logger.info("TOB销售发票生成成功 编码:{} 主键:{} 发票公司:{}", vreceiptcode, csaleid, pk_corp);
//记录成功
updateSuccessOrFail3(details, "Y", "success", vreceiptcode, csaleid);
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("TOB的销售发票传输失败抛出异常", e); logger.error("TOB的销售发票传输失败抛出异常", e);

View File

@ -276,7 +276,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
logger.info("没有查询到任何数据!不需要同步"); logger.info("没有查询到任何数据!不需要同步");
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("startImplement方法抛出异常", e); logger.error("startImplementStockByCode-方法抛出异常", e);
} finally { } finally {
// try { // try {
// basicArchivesCacheUtil.clearCache(); // basicArchivesCacheUtil.clearCache();
@ -343,7 +343,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
logger.info("TOC没有查询到任何数据不需要同步"); logger.info("TOC没有查询到任何数据不需要同步");
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("startImplement方法抛出异常", e); logger.error("startImplementTranByTime-方法抛出异常", e);
} finally { } finally {
// try { // try {
// basicArchivesCacheUtil.clearCache(); // basicArchivesCacheUtil.clearCache();
@ -990,9 +990,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
//查询对应的OFS销售订单 //查询对应的OFS销售订单
List<com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDetailsDto> headerDetailsDtos = queryOfsOrder(headerDetailsDtoList); List<com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDetailsDto> headerDetailsDtos = queryOfsOrder(headerDetailsDtoList);
findMatchingOfsOrder(headerDetailsDtos, headerDetailsDtoList); findMatchingOfsOrder(headerDetailsDtos, headerDetailsDtoList);
//TOC金额分摊
for (int i = 0; i < headerDetailsDtoList.size(); i++) { for (int i = 0; i < headerDetailsDtoList.size(); i++) {
HeaderDetailsDto headerDetailsDto = headerDetailsDtoList.get(i); HeaderDetailsDto headerDetailsDto = headerDetailsDtoList.get(i);
HeaderDto header = headerDetailsDto.getHeader(); HeaderDto header = headerDetailsDto.getHeader();
@ -1016,7 +1014,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
//表头公司通过名称匹配U8C公司 //表头公司通过名称匹配U8C公司
// String corpName = "上海丽知品牌管理有限公司"; // String corpName = "上海丽知品牌管理有限公司";
String companyCode = header.getCompanyCode(); String companyCode = header.getCompanyCode();
//TODO 测试 //测试
// companyCode = "SHLZ"; // companyCode = "SHLZ";
Assert.notNull(companyCode, "O出库单表头货主不能为空"); Assert.notNull(companyCode, "O出库单表头货主不能为空");
BdCorpEntity bdCorpEntity = cacheTocMapVo.getStringBdCorpEntityMap().get(companyCode); BdCorpEntity bdCorpEntity = cacheTocMapVo.getStringBdCorpEntityMap().get(companyCode);
@ -1043,9 +1041,20 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
BdSalestruEntity bdSalestruEntity = cacheTocMapVo.getStringBdSalestruEntityMap().get(bdCorpEntity.getUnitname()); BdSalestruEntity bdSalestruEntity = cacheTocMapVo.getStringBdSalestruEntityMap().get(bdCorpEntity.getUnitname());
Assert.notNull(bdSalestruEntity, "无匹配到销售组织 表头公司名称:{}", bdCorpEntity.getUnitname()); Assert.notNull(bdSalestruEntity, "无匹配到销售组织 表头公司名称:{}", bdCorpEntity.getUnitname());
//业务部门暂定的部门名称其他2024年8月5日 15:39:42 已经和妮姐确认 //业务部门暂定的部门名称业务部门2024年8月5日 15:39:42 已经和妮姐确认
BdDeptdocEntity bdDeptdocEntity = cacheTocMapVo.getStringBdDeptdocEntityMap().get(bdCorpEntity.getPkCorp()); BdDeptdocEntity bdDeptdocEntity = null;
Assert.notNull(bdDeptdocEntity, "无法匹配到业务部门 部门名称:其他 对应公司名称:{}", bdCorpEntity.getPkCorp()); if (header2.getDepartmentType() == null || "".equals(header2.getDepartmentType().trim())) {
//默认业务部门
logger.info("OFS销售订单号{} 不存在部门字段!", header2.getCode());
bdDeptdocEntity = cacheTocMapVo.getStringBdDeptdocEntityMap().get(bdCorpEntity.getPkCorp());
Assert.notNull(bdDeptdocEntity, "无法匹配到业务部门 部门名称:业务部门 对应公司主键:{}", bdCorpEntity.getPkCorp());
} else {
//使用O选定的部门字段
logger.info("OFS销售订单号{} 存在部门字段:{}", header2.getCode(), header2.getDepartmentType());
String deptCode = header2.getDepartmentType().trim();
bdDeptdocEntity = cacheTocMapVo.getStringBdDeptdocEntityMapByDeptCode().get(deptCode);
Assert.notNull(bdDeptdocEntity, "无法匹配到U8C部门档案 OFS销售订单-部门编码:{}", deptCode);
}
//客商基本档案 //客商基本档案
// 2024年8月8日 12:05:10 O店铺的业务编码=U8C客商自定义项1O没有店铺信息查询接口因此无法通过出库单的店铺编码查询到O店铺档案对应的业务编码接口上线之后需要补充这一部分逻辑 // 2024年8月8日 12:05:10 O店铺的业务编码=U8C客商自定义项1O没有店铺信息查询接口因此无法通过出库单的店铺编码查询到O店铺档案对应的业务编码接口上线之后需要补充这一部分逻辑

View File

@ -26,7 +26,7 @@ import com.hzya.frame.plugin.lets.u8cdto.*;
import com.hzya.frame.plugin.lets.util.*; import com.hzya.frame.plugin.lets.util.*;
import com.hzya.frame.split.SplitListByCountUtil; import com.hzya.frame.split.SplitListByCountUtil;
import com.hzya.frame.ttxofs.dto.InterfaceParamDto; import com.hzya.frame.ttxofs.dto.InterfaceParamDto;
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.DetailsDto; import com.hzya.frame.ttxofs.dto.ofssalesordersearch.DetailsDto;
import com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDetailsDto; import com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDetailsDto;
import com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDto; import com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDto;
import com.hzya.frame.ttxofs.dto.ofssalesordersearch.SaleOrderMessageDto; import com.hzya.frame.ttxofs.dto.ofssalesordersearch.SaleOrderMessageDto;
@ -97,6 +97,10 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
return "3"; return "3";
} }
private static final Object PUSH_LOCK1 = new Object();
private static final Object PUSH_LOCK2 = new Object();
@Override @Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
long startMillis = System.currentTimeMillis(); long startMillis = System.currentTimeMillis();
@ -250,7 +254,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
logger.info("没有查询到任何数据!不需要同步"); logger.info("没有查询到任何数据!不需要同步");
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("startImplement方法抛出异常", e); logger.error("startImplementByStockTime-方法抛出异常", e);
} }
} }
}, threadNameStrStart); }, threadNameStrStart);
@ -306,7 +310,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
logger.info("没有查询到任何数据!不需要同步"); logger.info("没有查询到任何数据!不需要同步");
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("startImplement方法抛出异常", e); logger.error("startImplementByTradeTime-方法抛出异常", e);
} }
} }
}, threadNameStrStart); }, threadNameStrStart);
@ -364,7 +368,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
logger.info("没有查询到任何数据!不需要同步"); logger.info("没有查询到任何数据!不需要同步");
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("startImplement方法抛出异常", e); logger.error("startImplementByCode-方法抛出异常", e);
} }
} }
}, threadNameStrStart); }, threadNameStrStart);
@ -818,27 +822,29 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
List<SaleorderRequestDto> saleorderRequestDtoList = new ArrayList<>(); List<SaleorderRequestDto> saleorderRequestDtoList = new ArrayList<>();
saleorderRequestDtoList.add(saleorderRequestDto); saleorderRequestDtoList.add(saleorderRequestDto);
Boolean aBoolean = checkTobOrder(header.getId(), header.getCode()); synchronized (PUSH_LOCK1) {
if (!aBoolean) { Boolean aBoolean = checkTobOrder(header.getId(), header.getCode());
logger.error("经过SQL查询判断在U8C(红字)销售订单不存在OFS入库单号为{} OFS入库主键为{}的单据将调用U8C接口执行推送", header.getCode(), header.getId()); if (!aBoolean) {
Map<String, List<SaleorderRequestDto>> stringStringMap = new HashMap<>(); logger.error("经过SQL查询判断在U8C(红字)销售订单不存在OFS入库单号为{} OFS入库主键为{}的单据将调用U8C接口执行推送", header.getCode(), header.getId());
stringStringMap.put("saleorder", saleorderRequestDtoList); Map<String, List<SaleorderRequestDto>> stringStringMap = new HashMap<>();
SoSaleResultRootDto soSaleResultRootDto = sendU8CTOCOrder(JSON.toJSONString(stringStringMap)); stringStringMap.put("saleorder", saleorderRequestDtoList);
String vreceiptcode = null; SoSaleResultRootDto soSaleResultRootDto = sendU8CTOCOrder(JSON.toJSONString(stringStringMap));
String csaleid = null; String vreceiptcode = null;
String pk_corp = null; String csaleid = null;
if (soSaleResultRootDto != null) { String pk_corp = null;
SoSaleResultHeadDto parentvo = soSaleResultRootDto.getParentvo(); if (soSaleResultRootDto != null) {
List<SoSaleResultBodyDto> childrenvo = soSaleResultRootDto.getChildrenvo(); SoSaleResultHeadDto parentvo = soSaleResultRootDto.getParentvo();
vreceiptcode = parentvo.getVreceiptcode(); List<SoSaleResultBodyDto> childrenvo = soSaleResultRootDto.getChildrenvo();
csaleid = parentvo.getCsaleid(); vreceiptcode = parentvo.getVreceiptcode();
pk_corp = parentvo.getPk_corp(); csaleid = parentvo.getCsaleid();
pk_corp = parentvo.getPk_corp();
}
logger.info("TOB红字销售订单编号{} 销售订单主键:{} 销售公司:{}", vreceiptcode, csaleid, pk_corp);
//记录成功
updateSuccessOrFail1(details, "Y", "success", vreceiptcode, csaleid);
} else {
logger.error("经过SQL查询判断在U8C(红字)销售订单存在OFS入库单号为{} OFS入库主键为{}的单据为了避免造成单据重复不推送到U8C", header.getCode(), header.getId());
} }
logger.info("TOB红字销售订单编号{} 销售订单主键:{} 销售公司:{}", vreceiptcode, csaleid, pk_corp);
//记录成功
updateSuccessOrFail1(details, "Y", "success", vreceiptcode, csaleid);
} else {
logger.error("经过SQL查询判断在U8C(红字)销售订单存在OFS入库单号为{} OFS入库主键为{}的单据为了避免造成单据重复不推送到U8C", header.getCode(), header.getId());
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("TOB售后收入推送U8C失败", e); logger.error("TOB售后收入推送U8C失败", e);
@ -900,11 +906,11 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
List<StockinOrderSearchResponse.StockinOrder.StockinB> details = stockinOrder.getDetails(); List<StockinOrderSearchResponse.StockinOrder.StockinB> details = stockinOrder.getDetails();
try { try {
//查询售后订单 //查询OFS售后订单
RerturnGoodsOrderSearchData ofsRertunOrder = afterSalesOrderUtil.getOfsRertunOrder(header.getRefOrderCode()); RerturnGoodsOrderSearchData ofsRertunOrder = afterSalesOrderUtil.getOfsRertunOrder(header.getRefOrderCode());
Assert.notNull(ofsRertunOrder, "无法查询到OFS售后订单 编码:{}", header.getRefOrderCode()); Assert.notNull(ofsRertunOrder, "无法查询到OFS售后订单 编码:{}", header.getRefOrderCode());
//查询销售订单 //查询OFS销售订单
SaleOrderMessageDto saleOrderMessageDto = null; SaleOrderMessageDto saleOrderMessageDto = null;
try { try {
saleOrderMessageDto = afterSalesOrderUtil.getOfsOrder(ofsRertunOrder.getHeader().getRefOrderCode()); saleOrderMessageDto = afterSalesOrderUtil.getOfsOrder(ofsRertunOrder.getHeader().getRefOrderCode());
@ -912,13 +918,20 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
logger.error("查询出售后订单错误,失败原因:{}", e.getMessage()); logger.error("查询出售后订单错误,失败原因:{}", e.getMessage());
Assert.state(false, "查询出售后订单错误,失败原因:{}", e.getMessage()); Assert.state(false, "查询出售后订单错误,失败原因:{}", e.getMessage());
} }
List<HeaderDetailsDto> headerDetailsDtoList = saleOrderMessageDto.getData();
if (headerDetailsDtoList == null || headerDetailsDtoList.size() == 0) {
Assert.state(false, "无法查询到OFS销售订单查询路径OFS销售出库单 -> OFS售后订单 -> OFS销售订单 OFS售后订单{}", ofsRertunOrder.getHeader().getCode());
}
HeaderDetailsDto headerDetailsDto = headerDetailsDtoList.get(0);
HeaderDto header2 = headerDetailsDto.getHeader();
List<DetailsDto> details1 = headerDetailsDto.getDetails();
if (saleOrderMessageDto == null) { if (saleOrderMessageDto == null) {
Assert.state(false, "没有匹配到售后订单,系统业务无法完成"); Assert.state(false, "没有匹配到售后订单,系统业务无法完成");
} }
HeaderDto header1 = saleOrderMessageDto.getData().get(0).getHeader(); HeaderDto header1 = saleOrderMessageDto.getData().get(0).getHeader();
String memberId = header1.getMemberId(); String memberId = header1.getMemberId();
//TODO 会员id //会员id
// memberId = "GYS00002"; // memberId = "GYS00002";
Assert.notNull(memberId, "TOB销售订单(OFS)表头会员id不能为空否则无法匹配U8C客商档案"); Assert.notNull(memberId, "TOB销售订单(OFS)表头会员id不能为空否则无法匹配U8C客商档案");
Assert.state(!"".equals(memberId.trim()), "TOB销售订单(OFS)表头会员id不能为空否则无法匹配U8C客商档案"); Assert.state(!"".equals(memberId.trim()), "TOB销售订单(OFS)表头会员id不能为空否则无法匹配U8C客商档案");
@ -932,7 +945,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
// 销售公司发货公司 // 销售公司发货公司
String companyCode = header.getCompanyCode(); String companyCode = header.getCompanyCode();
//TODO 测试 //测试
// companyCode = "SHLZ"; // companyCode = "SHLZ";
Assert.notNull(companyCode, "O表头公司不能为空"); Assert.notNull(companyCode, "O表头公司不能为空");
BdCorpEntity bdCorpEntity = new BdCorpEntity(); BdCorpEntity bdCorpEntity = new BdCorpEntity();
@ -988,17 +1001,35 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
//业务部门 //业务部门
//2024年8月14日 10:38:37 已经和佳妮确认 //2024年8月14日 10:38:37 已经和佳妮确认
String deptName = "业务部门"; List<BdDeptdocEntity> bdDeptdocEntityList = null;
BdDeptdocEntity bdDeptdocEntity = new BdDeptdocEntity(); if (header2.getDepartmentType() == null || "".equals(header2.getDepartmentType().trim())) {
bdDeptdocEntity.setDataSourceCode("lets_u8c"); logger.info("OFS销售订单号{} 不存在部门字段!", header2.getCode());
bdDeptdocEntity.setDr(0); String deptName = "业务部门";
bdDeptdocEntity.setDeptname(deptName); BdDeptdocEntity bdDeptdocEntity = new BdDeptdocEntity();
bdDeptdocEntity.setPkCorp(bdCorpEntityList.get(0).getPkCorp()); bdDeptdocEntity.setDataSourceCode("lets_u8c");
List<BdDeptdocEntity> bdDeptdocEntityList = iBdDeptdocDao.query(bdDeptdocEntity); bdDeptdocEntity.setDr(0);
if (bdDeptdocEntityList.size() == 0) { bdDeptdocEntity.setDeptname(deptName);
Assert.state(false, "根据部门名称:{} 公司id{}无法匹配到U8C销售组织", deptName, bdCorpEntityList.get(0).getPkCorp()); bdDeptdocEntity.setPkCorp(bdCorpEntityList.get(0).getPkCorp());
} else if (bdDeptdocEntityList.size() >= 2) { bdDeptdocEntityList = iBdDeptdocDao.query(bdDeptdocEntity);
Assert.state(false, "根据部门名称:{} 公司id{}匹配到U8C销售组织{}个", deptName, bdCorpEntityList.get(0).getPkCorp()); if (bdDeptdocEntityList.size() == 0) {
Assert.state(false, "默认部门:根据部门名称:{} 公司id{}无法匹配到U8C销售组织", deptName, bdCorpEntityList.get(0).getPkCorp());
} else if (bdDeptdocEntityList.size() >= 2) {
Assert.state(false, "默认部门:根据部门名称:{} 公司id{}匹配到U8C销售组织{}个", deptName, bdCorpEntityList.get(0).getPkCorp());
}
} else {
logger.info("OFS销售订单号{} 存在部门字段:{}", header2.getCode(), header2.getDepartmentType());
String departmentType = header2.getDepartmentType();
BdDeptdocEntity bdDeptdocEntity = new BdDeptdocEntity();
bdDeptdocEntity.setDataSourceCode("lets_u8c");
bdDeptdocEntity.setDr(0);
bdDeptdocEntity.setDeptcode(departmentType);
bdDeptdocEntity.setPkCorp(bdCorpEntityList.get(0).getPkCorp());
bdDeptdocEntityList = iBdDeptdocDao.query(bdDeptdocEntity);
if (bdDeptdocEntityList.size() == 0) {
Assert.state(false, "指定部门:根据部门编码:{} 公司id{}无法匹配到U8C销售组织", header2.getDepartmentType(), bdCorpEntityList.get(0).getPkCorp());
} else if (bdDeptdocEntityList.size() >= 2) {
Assert.state(false, "指定部门:根据部门编码:{} 公司id{}匹配到U8C销售组织{}个", header2.getDepartmentType(), bdCorpEntityList.get(0).getPkCorp());
}
} }
//客商基本档案 //客商基本档案
@ -1136,13 +1167,20 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
logger.error("查询出售后订单错误,失败原因:{}", e.getMessage()); logger.error("查询出售后订单错误,失败原因:{}", e.getMessage());
Assert.state(false, "查询出售后订单错误,失败原因:{}", e.getMessage()); Assert.state(false, "查询出售后订单错误,失败原因:{}", e.getMessage());
} }
List<HeaderDetailsDto> headerDetailsDtoList = saleOrderMessageDto.getData();
if (headerDetailsDtoList == null || headerDetailsDtoList.size() == 0) {
Assert.state(false, "无法匹配到OFS销售订单 售后订单号:{}", ofsRertunOrder.getHeader().getCode());
}
HeaderDetailsDto headerDetailsDto = headerDetailsDtoList.get(0);
HeaderDto header2 = headerDetailsDto.getHeader();
List<DetailsDto> details1 = headerDetailsDto.getDetails();
if (saleOrderMessageDto == null) { if (saleOrderMessageDto == null) {
Assert.state(false, "没有匹配到售后订单,系统业务无法完成"); Assert.state(false, "没有匹配到售后订单,系统业务无法完成");
} }
HeaderDto header1 = saleOrderMessageDto.getData().get(0).getHeader(); HeaderDto header1 = saleOrderMessageDto.getData().get(0).getHeader();
String memberId = header1.getMemberId(); String memberId = header1.getMemberId();
//TODO 测试 //测试
// memberId = "GYS00002"; // memberId = "GYS00002";
Assert.notNull(memberId, "TOB销售订单(OFS)表头会员id不能为空否则无法匹配U8C客商档案"); Assert.notNull(memberId, "TOB销售订单(OFS)表头会员id不能为空否则无法匹配U8C客商档案");
Assert.state(!"".equals(memberId.trim()), "TOB销售订单(OFS)表头会员id不能为空否则无法匹配U8C客商档案"); Assert.state(!"".equals(memberId.trim()), "TOB销售订单(OFS)表头会员id不能为空否则无法匹配U8C客商档案");
@ -1212,7 +1250,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
// 销售公司发货公司 // 销售公司发货公司
String companyCode = header.getCompanyCode(); String companyCode = header.getCompanyCode();
//TODO 测试 //测试
// companyCode = "SHLZ"; // companyCode = "SHLZ";
Assert.notNull(companyCode, "O表头公司不能为空"); Assert.notNull(companyCode, "O表头公司不能为空");
BdCorpEntity bdCorpEntity = new BdCorpEntity(); BdCorpEntity bdCorpEntity = new BdCorpEntity();
@ -1268,17 +1306,35 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
//业务部门 //业务部门
//2024年8月14日 10:38:37 已经和佳妮确认 //2024年8月14日 10:38:37 已经和佳妮确认
String deptName = "其他部门"; List<BdDeptdocEntity> bdDeptdocEntityList = null;
BdDeptdocEntity bdDeptdocEntity = new BdDeptdocEntity(); if (header2.getDepartmentType() == null || "".equals(header2.getDepartmentType().trim())) {
bdDeptdocEntity.setDataSourceCode("lets_u8c"); logger.info("OFS销售订单号{} 不存在部门字段!", header2.getCode());
bdDeptdocEntity.setDr(0); String deptName = "业务部门";
bdDeptdocEntity.setDeptname(deptName); BdDeptdocEntity bdDeptdocEntity = new BdDeptdocEntity();
bdDeptdocEntity.setPkCorp(bdCorpEntityList.get(0).getPkCorp()); bdDeptdocEntity.setDataSourceCode("lets_u8c");
List<BdDeptdocEntity> bdDeptdocEntityList = iBdDeptdocDao.query(bdDeptdocEntity); bdDeptdocEntity.setDr(0);
if (bdDeptdocEntityList.size() == 0) { bdDeptdocEntity.setDeptname(deptName);
Assert.state(false, "根据部门名称:{} 公司id{}无法匹配到U8C销售组织", deptName, bdCorpEntityList.get(0).getPkCorp()); bdDeptdocEntity.setPkCorp(bdCorpEntityList.get(0).getPkCorp());
} else if (bdDeptdocEntityList.size() >= 2) { bdDeptdocEntityList = iBdDeptdocDao.query(bdDeptdocEntity);
Assert.state(false, "根据部门名称:{} 公司id{}匹配到U8C销售组织{}个", deptName, bdCorpEntityList.get(0).getPkCorp()); if (bdDeptdocEntityList.size() == 0) {
Assert.state(false, "根据部门名称:{} 公司id{}无法匹配到U8C销售组织", deptName, bdCorpEntityList.get(0).getPkCorp());
} else if (bdDeptdocEntityList.size() >= 2) {
Assert.state(false, "根据部门名称:{} 公司id{}匹配到U8C销售组织{}个", deptName, bdCorpEntityList.get(0).getPkCorp());
}
} else {
logger.info("OFS销售订单号{} 存在部门字段:{}", header2.getCode(), header2.getDepartmentType());
String departmentType = header2.getDepartmentType();
BdDeptdocEntity bdDeptdocEntity = new BdDeptdocEntity();
bdDeptdocEntity.setDataSourceCode("lets_u8c");
bdDeptdocEntity.setDr(0);
bdDeptdocEntity.setDeptcode(departmentType);
bdDeptdocEntity.setPkCorp(bdCorpEntityList.get(0).getPkCorp());
bdDeptdocEntityList = iBdDeptdocDao.query(bdDeptdocEntity);
if (bdDeptdocEntityList.size() == 0) {
Assert.state(false, "指定部门:根据部门编码:{} 公司id{}无法匹配到U8C销售组织", header2.getDepartmentType(), bdCorpEntityList.get(0).getPkCorp());
} else if (bdDeptdocEntityList.size() >= 2) {
Assert.state(false, "指定部门:根据部门编码:{} 公司id{}匹配到U8C销售组织{}个", header2.getDepartmentType(), bdCorpEntityList.get(0).getPkCorp());
}
} }
//客商基本档案 //客商基本档案
@ -1788,25 +1844,27 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
stringListMap.put("billvos", salesInvoiceDtoList); stringListMap.put("billvos", salesInvoiceDtoList);
//推送到U8C生成销售发票 //推送到U8C生成销售发票
Boolean aBoolean = checkTobSalesInvoice(header.getId(), header.getCode()); synchronized (PUSH_LOCK2) {
if (!aBoolean) { Boolean aBoolean = checkTobSalesInvoice(header.getId(), header.getCode());
logger.error("经过SQL查询判断在U8C红字销售发票中不存在OFS入库单号为{} OFS入库主键为{}的单据将调用U8C接口执行推送", header.getCode(), header.getId()); if (!aBoolean) {
SaleinvoiceDto saleinvoiceDto = sendU8CTOCSoSaleinvoiceB(JSON.toJSONString(stringListMap)); logger.error("经过SQL查询判断在U8C红字销售发票中不存在OFS入库单号为{} OFS入库主键为{}的单据将调用U8C接口执行推送", header.getCode(), header.getId());
String vreceiptcode = null; SaleinvoiceDto saleinvoiceDto = sendU8CTOCSoSaleinvoiceB(JSON.toJSONString(stringListMap));
String csaleid = null; String vreceiptcode = null;
String pk_corp = null; String csaleid = null;
if (saleinvoiceDto != null && saleinvoiceDto.getParentvo() != null && saleinvoiceDto.getChildrenvo() != null) { String pk_corp = null;
SaleinvoiceHeadDto parentvo = saleinvoiceDto.getParentvo(); if (saleinvoiceDto != null && saleinvoiceDto.getParentvo() != null && saleinvoiceDto.getChildrenvo() != null) {
List<SaleinvoiceBodyDto> childrenvo = saleinvoiceDto.getChildrenvo(); SaleinvoiceHeadDto parentvo = saleinvoiceDto.getParentvo();
vreceiptcode = parentvo.getVreceiptcode(); List<SaleinvoiceBodyDto> childrenvo = saleinvoiceDto.getChildrenvo();
csaleid = parentvo.getCsaleid(); vreceiptcode = parentvo.getVreceiptcode();
pk_corp = parentvo.getPk_corp(); csaleid = parentvo.getCsaleid();
pk_corp = parentvo.getPk_corp();
}
logger.info("TOB销售发票(红字)生成成功 编码:{} 主键:{} 发票公司:{}", vreceiptcode, csaleid, pk_corp);
//记录成功
updateSuccessOrFail2(details, "Y", "success", vreceiptcode, csaleid);
} else {
logger.error("经过SQL查询判断在U8C红字销售发票中已经存在OFS入库单号为{} OFS入库主键为{}的单据为了避免造成单据重复不推送到U8C", header.getCode(), header.getId());
} }
logger.info("TOB销售发票(红字)生成成功 编码:{} 主键:{} 发票公司:{}", vreceiptcode, csaleid, pk_corp);
//记录成功
updateSuccessOrFail2(details, "Y", "success", vreceiptcode, csaleid);
} else {
logger.error("经过SQL查询判断在U8C红字销售发票中已经存在OFS入库单号为{} OFS入库主键为{}的单据为了避免造成单据重复不推送到U8C", header.getCode(), header.getId());
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("TOB售后到账完成推送U8C抛出异常", e); logger.error("TOB售后到账完成推送U8C抛出异常", e);

View File

@ -207,7 +207,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
logger.info("没有查询到任何数据!不需要同步"); logger.info("没有查询到任何数据!不需要同步");
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("startImplement方法抛出异常", e); logger.error("startImplementStockByTime-方法抛出异常", e);
} finally { } finally {
// try { // try {
// tocReturnBasicArchivesCacheUtil.clearCache(); // tocReturnBasicArchivesCacheUtil.clearCache();
@ -273,7 +273,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
logger.info("没有查询到任何数据!不需要同步"); logger.info("没有查询到任何数据!不需要同步");
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("startImplement方法抛出异常", e); logger.error("startImplementByCode-方法抛出异常", e);
} finally { } finally {
// try { // try {
// tocReturnBasicArchivesCacheUtil.clearCache(); // tocReturnBasicArchivesCacheUtil.clearCache();
@ -335,7 +335,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
logger.info("没有查询到任何数据!不需要同步"); logger.info("没有查询到任何数据!不需要同步");
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("startImplement方法抛出异常", e); logger.error("startImplementByTradeTime-方法抛出异常", e);
} }
} }
}, threadNameStrStart); }, threadNameStrStart);
@ -1033,8 +1033,8 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
//表头公司通过名称匹配U8C公司 //表头公司通过名称匹配U8C公司
// String corpName = "上海丽知品牌管理有限公司"; // String corpName = "上海丽知品牌管理有限公司";
//TODO 测试SHOF //测试SHOF
header.setCompanyCode("SHOF"); // header.setCompanyCode("SHOF");
Assert.notNull(header.getCompanyCode(), "O货主编码不能为空"); Assert.notNull(header.getCompanyCode(), "O货主编码不能为空");
BdCorpEntity bdCorpEntity = cacheTocMapVoV2.getStringBdCorpEntityMap().get(header.getCompanyCode()); BdCorpEntity bdCorpEntity = cacheTocMapVoV2.getStringBdCorpEntityMap().get(header.getCompanyCode());
Assert.notNull(bdCorpEntity, "根据O公司编码(货主编码)({})没有匹配到U8C公司档案", header.getCompanyCode()); Assert.notNull(bdCorpEntity, "根据O公司编码(货主编码)({})没有匹配到U8C公司档案", header.getCompanyCode());
@ -1061,8 +1061,17 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
Assert.notNull(bdSalestruEntity, "无匹配到销售组织 表头公司名称:{}", bdCorpEntity.getUnitname()); Assert.notNull(bdSalestruEntity, "无匹配到销售组织 表头公司名称:{}", bdCorpEntity.getUnitname());
//业务部门暂定的部门名称其他2024年8月5日 15:39:42 已经和妮姐确认 //业务部门暂定的部门名称其他2024年8月5日 15:39:42 已经和妮姐确认
BdDeptdocEntity bdDeptdocEntity = cacheTocMapVoV2.getStringBdDeptdocEntityMap().get(bdCorpEntity.getPkCorp()); BdDeptdocEntity bdDeptdocEntity = null;
Assert.notNull(bdDeptdocEntity, "无法匹配到业务部门 部门名称:其他 对应公司名称:{}", bdCorpEntity.getPkCorp()); if (header1.getDepartmentType() == null || "".equals(header1.getDepartmentType().trim())) {
//默认业务部门
logger.info("OFS销售订单号{} 不存在部门字段!", header1.getCode());
bdDeptdocEntity = cacheTocMapVoV2.getStringBdDeptdocEntityMap().get(bdCorpEntity.getPkCorp());
Assert.notNull(bdDeptdocEntity, "无法匹配到业务部门 部门名称:其他 对应公司名称:{}", bdCorpEntity.getPkCorp());
} else {
logger.info("OFS销售订单号{} 存在部门字段:{}", header1.getCode(), header1.getDepartmentType());
String deptCode = header1.getDepartmentType().trim();
bdDeptdocEntity = cacheTocMapVoV2.getStringBdDeptdocEntityMapByDeptCode().get(deptCode);
}
//客商基本档案 //客商基本档案
//2024年8月8日 12:05:10 O店铺的业务编码=U8C客商自定义项1O没有店铺信息查询接口因此无法通过出库单的店铺编码查询到O店铺档案对应的业务编码接口上线之后需要补充这一部分逻辑 //2024年8月8日 12:05:10 O店铺的业务编码=U8C客商自定义项1O没有店铺信息查询接口因此无法通过出库单的店铺编码查询到O店铺档案对应的业务编码接口上线之后需要补充这一部分逻辑

View File

@ -20,6 +20,7 @@ public class CacheTocMapVo {
private Map<String, BdCalbodyEntity> stringBdCalbodyEntityMap; private Map<String, BdCalbodyEntity> stringBdCalbodyEntityMap;
private Map<String, BdSalestruEntity> stringBdSalestruEntityMap; private Map<String, BdSalestruEntity> stringBdSalestruEntityMap;
private Map<String, BdDeptdocEntity> stringBdDeptdocEntityMap; private Map<String, BdDeptdocEntity> stringBdDeptdocEntityMap;
private Map<String, BdDeptdocEntity> stringBdDeptdocEntityMapByDeptCode;
private Map<String, BdCumandocEntity> stringBdCumandocEntityMap; private Map<String, BdCumandocEntity> stringBdCumandocEntityMap;
private Map<String, BdInvmandocEntity> stringBdInvmandocEntityMap; private Map<String, BdInvmandocEntity> stringBdInvmandocEntityMap;
private Map<String, BdInvbasdocEntity> stringBdInvbasdocEntityMap; private Map<String, BdInvbasdocEntity> stringBdInvbasdocEntityMap;

View File

@ -20,6 +20,7 @@ public class CacheTocMapVoV2 {
private Map<String, BdCalbodyEntity> stringBdCalbodyEntityMap; private Map<String, BdCalbodyEntity> stringBdCalbodyEntityMap;
private Map<String, BdSalestruEntity> stringBdSalestruEntityMap; private Map<String, BdSalestruEntity> stringBdSalestruEntityMap;
private Map<String, BdDeptdocEntity> stringBdDeptdocEntityMap; private Map<String, BdDeptdocEntity> stringBdDeptdocEntityMap;
private Map<String, BdDeptdocEntity> stringBdDeptdocEntityMapByDeptCode;
private Map<String, BdCubasdocEntity> stringBdCubasdocEntityMap; private Map<String, BdCubasdocEntity> stringBdCubasdocEntityMap;
private Map<String, BdCumandocEntity> stringBdCumandocEntityMap; private Map<String, BdCumandocEntity> stringBdCumandocEntityMap;
private Map<String, BdInvmandocEntity> stringBdInvmandocEntityMap; private Map<String, BdInvmandocEntity> stringBdInvmandocEntityMap;

View File

@ -161,21 +161,38 @@ public class TocOrderBasicArchivesCacheUtil {
* @author liuyang * @author liuyang
*/ */
// public static Map<String, BdDeptdocEntity> stringBdDeptdocEntityMap = new HashMap<>(); // public static Map<String, BdDeptdocEntity> stringBdDeptdocEntityMap = new HashMap<>();
private Map<String, BdDeptdocEntity> initDept() { private List<Map<String, BdDeptdocEntity>> initDept() {
Map<String, BdDeptdocEntity> stringBdDeptdocEntityMap = new HashMap<>(); List<Map<String, BdDeptdocEntity>> bddeptdocEntityList = new ArrayList<>();
Map<String, BdDeptdocEntity> stringBdDeptdocEntityMap1 = new HashMap<>();
Map<String, BdDeptdocEntity> stringBdDeptdocEntityMap2 = new HashMap<>();
bddeptdocEntityList.add(stringBdDeptdocEntityMap1);
bddeptdocEntityList.add(stringBdDeptdocEntityMap2);
String deptName = "业务部门";
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(deptName);
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++) {
BdDeptdocEntity bdDeptdocEntity1 = bdDeptdocEntityList.get(i); BdDeptdocEntity bdDeptdocEntity1 = bdDeptdocEntityList.get(i);
stringBdDeptdocEntityMap.put(bdDeptdocEntity1.getPkCorp(), bdDeptdocEntity1); stringBdDeptdocEntityMap1.put(bdDeptdocEntity1.getPkCorp(), bdDeptdocEntity1);
} }
} }
return stringBdDeptdocEntityMap;
BdDeptdocEntity bdDeptdocEntity2 = new BdDeptdocEntity();
bdDeptdocEntity2.setDataSourceCode("lets_u8c");
bdDeptdocEntity2.setDr(0);
List<BdDeptdocEntity> bdDeptdocEntityList2 = iBdDeptdocDao.query(bdDeptdocEntity2);
if (bdDeptdocEntityList2 != null && bdDeptdocEntityList2.size() > 0) {
for (int i = 0; i < bdDeptdocEntityList2.size(); i++) {
BdDeptdocEntity bdDeptdocEntity1 = bdDeptdocEntityList2.get(i);
stringBdDeptdocEntityMap2.put(bdDeptdocEntity1.getDeptcode(), bdDeptdocEntity1);
}
}
return bddeptdocEntityList;
} }
/** /**
@ -525,7 +542,7 @@ public class TocOrderBasicArchivesCacheUtil {
Map<String, BdStordocEntity> stringBdStordocEntityMap = initBdStordoc(); Map<String, BdStordocEntity> stringBdStordocEntityMap = initBdStordoc();
Map<String, BdCalbodyEntity> stringBdCalbodyEntityMap = initBdCalbody(); Map<String, BdCalbodyEntity> stringBdCalbodyEntityMap = initBdCalbody();
Map<String, BdSalestruEntity> stringBdSalestruEntityMap = initBdSalestru(); Map<String, BdSalestruEntity> stringBdSalestruEntityMap = initBdSalestru();
Map<String, BdDeptdocEntity> stringBdDeptdocEntityMap = initDept(); List<Map<String, BdDeptdocEntity>> maps = initDept();
Map<String, BdCumandocEntity> stringBdCumandocEntityMap = initBdCumandocV2(headerDtoList); Map<String, BdCumandocEntity> stringBdCumandocEntityMap = initBdCumandocV2(headerDtoList);
Map<String, BdInvmandocEntity> stringBdInvmandocEntityMap = initInventoryFileV2(detailsDtos); Map<String, BdInvmandocEntity> stringBdInvmandocEntityMap = initInventoryFileV2(detailsDtos);
Map<String, BdInvbasdocEntity> stringBdInvbasdocEntityMap = initBasicInventoryFileV2(detailsDtos); Map<String, BdInvbasdocEntity> stringBdInvbasdocEntityMap = initBasicInventoryFileV2(detailsDtos);
@ -542,7 +559,8 @@ public class TocOrderBasicArchivesCacheUtil {
cacheTocMapVo.setStringBdStordocEntityMap(stringBdStordocEntityMap); cacheTocMapVo.setStringBdStordocEntityMap(stringBdStordocEntityMap);
cacheTocMapVo.setStringBdCalbodyEntityMap(stringBdCalbodyEntityMap); cacheTocMapVo.setStringBdCalbodyEntityMap(stringBdCalbodyEntityMap);
cacheTocMapVo.setStringBdSalestruEntityMap(stringBdSalestruEntityMap); cacheTocMapVo.setStringBdSalestruEntityMap(stringBdSalestruEntityMap);
cacheTocMapVo.setStringBdDeptdocEntityMap(stringBdDeptdocEntityMap); cacheTocMapVo.setStringBdDeptdocEntityMap(maps.get(0));
cacheTocMapVo.setStringBdDeptdocEntityMapByDeptCode(maps.get(1));
cacheTocMapVo.setStringBdCumandocEntityMap(stringBdCumandocEntityMap); cacheTocMapVo.setStringBdCumandocEntityMap(stringBdCumandocEntityMap);
cacheTocMapVo.setStringBdInvmandocEntityMap(stringBdInvmandocEntityMap); cacheTocMapVo.setStringBdInvmandocEntityMap(stringBdInvmandocEntityMap);
cacheTocMapVo.setStringBdInvbasdocEntityMap(stringBdInvbasdocEntityMap); cacheTocMapVo.setStringBdInvbasdocEntityMap(stringBdInvbasdocEntityMap);

View File

@ -154,21 +154,38 @@ public class TocReturnBasicArchivesCacheUtil {
* @author liuyang * @author liuyang
*/ */
// public static Map<String, BdDeptdocEntity> stringBdDeptdocEntityMap = new HashMap<>(); // public static Map<String, BdDeptdocEntity> stringBdDeptdocEntityMap = new HashMap<>();
private Map<String, BdDeptdocEntity> initDept() { private List<Map<String, BdDeptdocEntity>> initDept() {
Map<String, BdDeptdocEntity> stringBdDeptdocEntityMap = new HashMap<>(); List<Map<String, BdDeptdocEntity>> bddeptdocEntityList = new ArrayList<>();
Map<String, BdDeptdocEntity> stringBdDeptdocEntityMap1 = new HashMap<>();
Map<String, BdDeptdocEntity> stringBdDeptdocEntityMap2 = new HashMap<>();
bddeptdocEntityList.add(stringBdDeptdocEntityMap1);
bddeptdocEntityList.add(stringBdDeptdocEntityMap2);
String deptName = "业务部门";
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(deptName);
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++) {
BdDeptdocEntity bdDeptdocEntity1 = bdDeptdocEntityList.get(i); BdDeptdocEntity bdDeptdocEntity1 = bdDeptdocEntityList.get(i);
stringBdDeptdocEntityMap.put(bdDeptdocEntity1.getPkCorp(), bdDeptdocEntity1); stringBdDeptdocEntityMap1.put(bdDeptdocEntity1.getPkCorp(), bdDeptdocEntity1);
} }
} }
return stringBdDeptdocEntityMap;
BdDeptdocEntity bdDeptdocEntity2 = new BdDeptdocEntity();
bdDeptdocEntity2.setDataSourceCode("lets_u8c");
bdDeptdocEntity2.setDr(0);
List<BdDeptdocEntity> bdDeptdocEntityList2 = iBdDeptdocDao.query(bdDeptdocEntity2);
if (bdDeptdocEntityList2 != null && bdDeptdocEntityList2.size() > 0) {
for (int i = 0; i < bdDeptdocEntityList2.size(); i++) {
BdDeptdocEntity bdDeptdocEntity1 = bdDeptdocEntityList2.get(i);
stringBdDeptdocEntityMap2.put(bdDeptdocEntity1.getDeptcode(), bdDeptdocEntity1);
}
}
return bddeptdocEntityList;
} }
/** /**
@ -517,7 +534,7 @@ public class TocReturnBasicArchivesCacheUtil {
Map<String, BdStordocEntity> stringBdStordocEntityMap = initBdStordoc(); Map<String, BdStordocEntity> stringBdStordocEntityMap = initBdStordoc();
Map<String, BdCalbodyEntity> stringBdCalbodyEntityMap = initBdCalbody(); Map<String, BdCalbodyEntity> stringBdCalbodyEntityMap = initBdCalbody();
Map<String, BdSalestruEntity> stringBdSalestruEntityMap = initBdSalestru(); Map<String, BdSalestruEntity> stringBdSalestruEntityMap = initBdSalestru();
Map<String, BdDeptdocEntity> stringBdDeptdocEntityMap = initDept(); List<Map<String, BdDeptdocEntity>> maps = initDept();
Map<String, BdCubasdocEntity> stringBdCubasdocEntityMap = initBdCubasdocV2(stockinHList); Map<String, BdCubasdocEntity> stringBdCubasdocEntityMap = initBdCubasdocV2(stockinHList);
Map<String, BdCumandocEntity> stringBdCumandocEntityMap = initBdCumandocV2(stockinHList); Map<String, BdCumandocEntity> stringBdCumandocEntityMap = initBdCumandocV2(stockinHList);
Map<String, BdInvmandocEntity> stringBdInvmandocEntityMap = initInventoryFileV2(stockinBList); Map<String, BdInvmandocEntity> stringBdInvmandocEntityMap = initInventoryFileV2(stockinBList);
@ -532,7 +549,8 @@ public class TocReturnBasicArchivesCacheUtil {
cacheTocMapVoV2.setStringBdStordocEntityMap(stringBdStordocEntityMap); cacheTocMapVoV2.setStringBdStordocEntityMap(stringBdStordocEntityMap);
cacheTocMapVoV2.setStringBdCalbodyEntityMap(stringBdCalbodyEntityMap); cacheTocMapVoV2.setStringBdCalbodyEntityMap(stringBdCalbodyEntityMap);
cacheTocMapVoV2.setStringBdSalestruEntityMap(stringBdSalestruEntityMap); cacheTocMapVoV2.setStringBdSalestruEntityMap(stringBdSalestruEntityMap);
cacheTocMapVoV2.setStringBdDeptdocEntityMap(stringBdDeptdocEntityMap); cacheTocMapVoV2.setStringBdDeptdocEntityMap(maps.get(0));
cacheTocMapVoV2.setStringBdDeptdocEntityMapByDeptCode(maps.get(1));
cacheTocMapVoV2.setStringBdCubasdocEntityMap(stringBdCubasdocEntityMap); cacheTocMapVoV2.setStringBdCubasdocEntityMap(stringBdCubasdocEntityMap);
cacheTocMapVoV2.setStringBdCumandocEntityMap(stringBdCumandocEntityMap); cacheTocMapVoV2.setStringBdCumandocEntityMap(stringBdCumandocEntityMap);
cacheTocMapVoV2.setStringBdInvmandocEntityMap(stringBdInvmandocEntityMap); cacheTocMapVoV2.setStringBdInvmandocEntityMap(stringBdInvmandocEntityMap);

View File

@ -116,4 +116,7 @@ public class HeaderDto {
//支付优惠 //支付优惠
private String payDiscounts; private String payDiscounts;
//部门字段
private String departmentType;
} }