数据库查询和日志优化,修复采购流程问题
- 优化数据库查询逻辑,采用更高效的条件查询方式。 - 修复采购流程中的供应商编码映射问题,确保与U8C系统的客商档案匹配。- 更新业务流程名称,以反映正确的采购流程。 - 日志记录中添加更多上下文信息,方便调试和跟踪。
This commit is contained in:
parent
c850f9a226
commit
bab87f833d
|
@ -53,6 +53,7 @@
|
|||
,verifyrule
|
||||
,ystype
|
||||
</sql>
|
||||
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-BdBusitypeEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.BdBusitypeEntity">
|
||||
select
|
||||
|
@ -82,6 +83,7 @@
|
|||
<if test="ts != null and ts != ''"> and ts = #{ts} </if>
|
||||
<if test="verifyrule != null and verifyrule != ''"> and verifyrule = #{verifyrule} </if>
|
||||
<if test="ystype != null and ystype != ''"> and ystype = #{ystype} </if>
|
||||
|
||||
-- and sts='Y'
|
||||
</trim>
|
||||
<!-- <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>-->
|
||||
|
|
|
@ -325,12 +325,12 @@ public class ConsignmachiningIn extends PluginBaseEntity {
|
|||
StringBuilder result = new StringBuilder();
|
||||
for (StockinOrderSearchResponse.StockinOrder obj : headerDetailsDtoList1) {
|
||||
StockinOrderSearchResponse.StockinOrder.StockinH header = obj.getHeader();
|
||||
if (result.length() > 0) {
|
||||
result.append(",");
|
||||
}
|
||||
result.append("'").append(header.getId()).append("'");
|
||||
// if (result.length() > 0) {
|
||||
// result.append(",");
|
||||
// }
|
||||
result.append("'").append(header.getId()).append("'").append(",");
|
||||
}
|
||||
return result.substring(0, result.length());
|
||||
return result.substring(0, result.length() - 1);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -322,10 +322,10 @@ public class ConsignmachiningInReturn extends PluginBaseEntity {
|
|||
StringBuilder result = new StringBuilder();
|
||||
for (HeaderDetailsDto obj : headerDetailsDtos) {
|
||||
HeaderDto header = obj.getHeader();
|
||||
if (result.length() > 0) {
|
||||
result.append(",");
|
||||
}
|
||||
result.append("'").append(header.getId()).append("'");
|
||||
// if (result.length() > 0) {
|
||||
// result.append(",");
|
||||
// }
|
||||
result.append("'").append(header.getId()).append("'").append(",");
|
||||
}
|
||||
return result.substring(0, result.length() - 1);
|
||||
}
|
||||
|
|
|
@ -359,10 +359,10 @@ public class ProxyPurchaseReturn extends PluginBaseEntity {
|
|||
StringBuilder result = new StringBuilder();
|
||||
for (HeaderDetailsDto obj : headerDetailsDtoList) {
|
||||
HeaderDto header = obj.getHeader();
|
||||
if (result.length() > 0) {
|
||||
result.append(",");
|
||||
}
|
||||
result.append("'").append(header.getId()).append("'");
|
||||
// if (result.length() > 0) {
|
||||
// result.append(",");
|
||||
// }
|
||||
result.append("'").append(header.getId()).append("'").append(",");
|
||||
}
|
||||
return result.substring(0, result.length() - 1);
|
||||
}
|
||||
|
|
|
@ -226,7 +226,7 @@ public class ProxyPurchaseWarehousOrder extends PluginBaseEntity {
|
|||
queryOfsSoSaleOutVo.setPageNo(1L);
|
||||
queryOfsSoSaleOutVo.setPageSize(50L);
|
||||
queryOfsSoSaleOutVo.setCode(code);
|
||||
queryOfsSoSaleOutVo.setStatus(900L);
|
||||
// queryOfsSoSaleOutVo.setStatus(900L);
|
||||
ofsStandardUtil.queryOfsPoOrder(queryOfsSoSaleOutVo, allOfsPoOrderList, 1L);
|
||||
logger.info("数据返回行数:{}", allOfsPoOrderList.size());
|
||||
if (allOfsPoOrderList.size() > 0) {
|
||||
|
@ -355,10 +355,10 @@ public class ProxyPurchaseWarehousOrder extends PluginBaseEntity {
|
|||
StringBuilder result = new StringBuilder();
|
||||
for (OfsPoOrderData obj : ofsPoOrderDataList) {
|
||||
OfsPoOrderHeader header = obj.getHeader();
|
||||
if (result.length() > 0) {
|
||||
result.append(",");
|
||||
}
|
||||
result.append("'").append(header.getId()).append("'");
|
||||
// if (result.length() > 0) {
|
||||
// result.append(",");
|
||||
// }
|
||||
result.append("'").append(header.getId()).append("'").append(",");
|
||||
}
|
||||
return result.substring(0, result.length() - 1);
|
||||
}
|
||||
|
@ -441,7 +441,7 @@ public class ProxyPurchaseWarehousOrder extends PluginBaseEntity {
|
|||
//2024年8月20日 16:02:21 已经和妮姐、万万确认,采购公司和收货公司目前是一致的,暂时不用区分取数逻辑
|
||||
BdInvmandocEntity bdInvmandocEntity = queryInventoryMan(ofsPoOrderDetails, bdCorpEntity.getPkCorp());
|
||||
String receivedQty = ofsPoOrderDetails.getRequestQty();//请求数量
|
||||
String buyPrice = ofsPoOrderDetails.getBuyPrice();//TODO 目前还不确定,实际进价
|
||||
String buyPrice = ofsPoOrderDetails.getDiscountPrice();//实际进价
|
||||
|
||||
//原币含税单价
|
||||
// BigDecimal noriginalcurprice = null;
|
||||
|
@ -488,7 +488,7 @@ public class ProxyPurchaseWarehousOrder extends PluginBaseEntity {
|
|||
if (childrenvo != null) {
|
||||
vordercode = parentvo.getVordercode();
|
||||
}
|
||||
logger.info("推送U8C代理品牌采购订单采购!U8C采购订单主键:{} U8C采购订单编码:{}", corderid, vordercode);
|
||||
logger.info("推送U8C代理品牌采购订单采购!U8C采购订单主键:{} 采购公司编码:{} 采购公司名称:{} U8C采购订单编码:{}", corderid, bdCorpEntity.getUnitcode(), bdCorpEntity.getUnitname(), vordercode);
|
||||
|
||||
// 成功记录日志
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||
|
@ -573,7 +573,7 @@ public class ProxyPurchaseWarehousOrder extends PluginBaseEntity {
|
|||
Assert.state(false, "根据O货主编码{},匹配到U8C销售公司{}个", companyCode, bdCorpEntityList.size());
|
||||
}
|
||||
|
||||
//采购部门:其他
|
||||
//采购部门:业务部门
|
||||
String deptName = "业务部门";
|
||||
BdDeptdocEntity bdDeptdocEntity = new BdDeptdocEntity();
|
||||
bdDeptdocEntity.setDataSourceCode("lets_u8c");
|
||||
|
@ -603,6 +603,8 @@ public class ProxyPurchaseWarehousOrder extends PluginBaseEntity {
|
|||
//2024年8月20日 14:47:55 丽知商城、OFS 供应商客商档案、传递到U8C的客商,
|
||||
//其中自定义项1作为原系统编码,因此统一传到自定义项一,已经和大家确认好了,没有关系的,放心大胆传吧,宝贝
|
||||
String shipFromCode = header.getVendorName();
|
||||
//TODO 测试
|
||||
shipFromCode = "dy-off";
|
||||
Assert.notNull(shipFromCode, "O供应商编码不能为空,没有办法完成业务逻辑,请配置供应商编码(采购)");
|
||||
Assert.state(!"".equals(shipFromCode.trim()), "O供应商编码不能为空,没有办法完成业务逻辑,请配置供应商编码(采购)!");
|
||||
BdCubasdocEntity bdCubasdocEntity = new BdCubasdocEntity();
|
||||
|
@ -709,7 +711,7 @@ public class ProxyPurchaseWarehousOrder extends PluginBaseEntity {
|
|||
private BdBusitypeEntity u8cOperationFlow() throws Exception {
|
||||
//查询业务流程
|
||||
//2024年8月6日 11:33:07 具体的业务流程名称,还需要实施提供
|
||||
String processName = "代理品牌采购";
|
||||
String processName = "渠道品牌采购";
|
||||
BdBusitypeEntity bdBusitypeEntity = queryBdBusitypeUtil.queryBdBusitype(processName);
|
||||
Assert.notNull(bdBusitypeEntity, "根据业务流程名称({})没有查询到业务流程", processName);
|
||||
return bdBusitypeEntity;
|
||||
|
|
|
@ -18,13 +18,9 @@ import com.hzya.frame.plugin.lets.u8cdto.*;
|
|||
import com.hzya.frame.plugin.lets.util.*;
|
||||
import com.hzya.frame.split.SplitListByCountUtil;
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
|
||||
import com.hzya.frame.ttxofs.dto.InterfaceParamDto;
|
||||
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderBean;
|
||||
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderData;
|
||||
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderDetails;
|
||||
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderHeader;
|
||||
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto;
|
||||
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDto;
|
||||
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
|
||||
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
@ -36,7 +32,7 @@ import java.math.BigDecimal;
|
|||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 代理品牌采购业务:(代理品牌采购)OFS采购入库单生成U8C采购订单,根据业务流程,自动生成U8C采购入库单
|
||||
* 代理品牌采购业务:(代理品牌采购)OFS采购入库单生成U8C采购入库单,关联原采购订单
|
||||
*
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.plugin.lets.plugin.purchase
|
||||
|
@ -45,9 +41,9 @@ import java.util.*;
|
|||
* @Date:2024/8/19 18:01
|
||||
* @Filename:ProxyPurchase
|
||||
*/
|
||||
public class ProxyPurchaseWarehous extends PluginBaseEntity {
|
||||
public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
||||
|
||||
Logger logger = LoggerFactory.getLogger(ProxyPurchaseWarehous.class);
|
||||
Logger logger = LoggerFactory.getLogger(ProxyPurchaseWarehousWarehouse.class);
|
||||
|
||||
@Autowired
|
||||
private OfsUnifiedService ofsUnifiedService;
|
||||
|
@ -350,10 +346,10 @@ public class ProxyPurchaseWarehous extends PluginBaseEntity {
|
|||
StringBuilder result = new StringBuilder();
|
||||
for (StockinOrderSearchResponse.StockinOrder obj : stockinOrderList) {
|
||||
StockinOrderSearchResponse.StockinOrder.StockinH header = obj.getHeader();
|
||||
if (result.length() > 0) {
|
||||
result.append(",");
|
||||
}
|
||||
result.append("'").append(header.getId()).append("'");
|
||||
// if (result.length() > 0) {
|
||||
// result.append(",");
|
||||
// }
|
||||
result.append("'").append(header.getId()).append("'").append(",");
|
||||
}
|
||||
return result.substring(0, result.length() - 1);
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
package com.hzya.frame.plugin.lets.util;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.hzya.frame.plugin.lets.plugin.purchase.ProxyPurchaseWarehous;
|
||||
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderData;
|
||||
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderDetails;
|
||||
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderHeader;
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
<bean name="soSaleOutPluginInitializerToB" class="com.hzya.frame.plugin.lets.plugin.sales.SoSaleOutPluginInitializerToB"/>
|
||||
<bean name="soSaleReturnPluginInitializerToB" class="com.hzya.frame.plugin.lets.plugin.sales.SoSaleReturnPluginInitializerToB"/>
|
||||
<bean name="proxyPurchaseWarehous" class="com.hzya.frame.plugin.lets.plugin.purchase.ProxyPurchaseWarehous"/>
|
||||
<bean name="proxyPurchaseWarehous" class="com.hzya.frame.plugin.lets.plugin.purchase.ProxyPurchaseWarehousWarehouse"/>
|
||||
|
||||
<bean name="proxyPurchaseReturn" class="com.hzya.frame.plugin.lets.plugin.purchase.ProxyPurchaseReturn"/>
|
||||
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
package com.hzya.frame.plugin.lets.plugin.purchase;
|
||||
|
||||
import com.hzya.frame.WebappApplication;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.plugin.lets.plugin.purchase
|
||||
* @Project:kangarooDataCenterV3
|
||||
* @name:ProxyPurchaseWarehousOrderTest
|
||||
* @Date:2024/9/19 11:49
|
||||
* @Filename:ProxyPurchaseWarehousOrderTest
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = WebappApplication.class)
|
||||
public class ProxyPurchaseWarehousOrderTest {
|
||||
|
||||
@Autowired
|
||||
private ProxyPurchaseWarehousOrder proxyPurchaseWarehousOrder;
|
||||
|
||||
@Test
|
||||
public void startImplementByCode() {
|
||||
try {
|
||||
proxyPurchaseWarehousOrder.startImplementByCode("LETS-PO2024091800000002");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -7,8 +7,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.plugin.lets.plugin.purchase
|
||||
|
@ -22,7 +20,7 @@ import static org.junit.Assert.*;
|
|||
public class ProxyPurchaseWarehousTest {
|
||||
|
||||
@Autowired
|
||||
private ProxyPurchaseWarehous proxyPurchaseWarehous;
|
||||
private ProxyPurchaseWarehousWarehouse proxyPurchaseWarehous;
|
||||
|
||||
@Test
|
||||
public void startImplement() {
|
||||
|
|
Loading…
Reference in New Issue