feat(plugin): 新增 TOC退货业务处理功能
- 在 TocofsReturngoodsDetailedEntity 和 TocofsReturngoodsEntity 中添加新的查询条件字段 - 实现根据不同推送场景类型查询和处理 TOC 退货数据的方法 -优化库存同步和交易同步的逻辑,支持多种推送场景 - 新增 queryTocofsReturngoodsDetailed 方法查询底表数据并转换为 StockinOrder 对象
This commit is contained in:
parent
18867cda59
commit
3e9d43f337
buildpackage/src
main/java/com/hzya/frame/plugin/lets
ofs/entity
TocofsReturngoodsDetailedEntity.javaTocofsReturngoodsDetailedEntity.xmlTocofsReturngoodsEntity.javaTocofsReturngoodsEntity.xml
plugin/sales
test/java/com/hzya/frame/plugin/lets/plugin/sales
|
@ -384,5 +384,21 @@ public class TocofsReturngoodsDetailedEntity extends BaseEntity {
|
||||||
* 补充的查询条件
|
* 补充的查询条件
|
||||||
*/
|
*/
|
||||||
private String ids;
|
private String ids;
|
||||||
|
/**
|
||||||
|
* 入库日期-范围开始
|
||||||
|
*/
|
||||||
|
private String businessDateStart;
|
||||||
|
/**
|
||||||
|
* 入库日期-范围结束
|
||||||
|
*/
|
||||||
|
private String businessDateEnd;
|
||||||
|
/**
|
||||||
|
* 到账完成日期-开始 refundedAt
|
||||||
|
*/
|
||||||
|
private String refundedAtStart;
|
||||||
|
/**
|
||||||
|
* 到账完成日期-结束 refundedAt
|
||||||
|
*/
|
||||||
|
private String refundedAtEnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -299,6 +299,18 @@
|
||||||
<if test="ids!=null and ids!=''">
|
<if test="ids!=null and ids!=''">
|
||||||
and id in (${ids})
|
and id in (${ids})
|
||||||
</if>
|
</if>
|
||||||
|
<if test="businessDateStart!=null and businessDateStart!=''">
|
||||||
|
and businessDate >= #{businessDateStart}
|
||||||
|
</if>
|
||||||
|
<if test="businessDateEnd!=null and businessDateEnd!=''">
|
||||||
|
and businessDate <= #{businessDateEnd}
|
||||||
|
</if>
|
||||||
|
<if test="refundedAtStart!=null and refundedAtStart!=''">
|
||||||
|
and refundedAt >= #{refundedAtStart}
|
||||||
|
</if>
|
||||||
|
<if test="refunderAtEnd!=null and refunderAtEnd!=''">
|
||||||
|
and refundedAt <= #{refunderAtEnd}
|
||||||
|
</if>
|
||||||
-- and sts='Y'
|
-- and sts='Y'
|
||||||
</trim>
|
</trim>
|
||||||
<!-- <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>-->
|
<!-- <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>-->
|
||||||
|
|
|
@ -3,6 +3,8 @@ package com.hzya.frame.plugin.lets.ofs.entity;
|
||||||
import com.hzya.frame.web.entity.BaseEntity;
|
import com.hzya.frame.web.entity.BaseEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OFS售后入库单(TocofsReturngoods)实体类
|
* OFS售后入库单(TocofsReturngoods)实体类
|
||||||
*
|
*
|
||||||
|
@ -134,5 +136,14 @@ public class TocofsReturngoodsEntity extends BaseEntity {
|
||||||
* 2024-12-26 10:38:00
|
* 2024-12-26 10:38:00
|
||||||
*/
|
*/
|
||||||
private String modified;
|
private String modified;
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多个id批量查询
|
||||||
|
*/
|
||||||
|
private String ids;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* O售后入库单明细行
|
||||||
|
*/
|
||||||
|
private List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList;
|
||||||
|
}
|
|
@ -180,6 +180,7 @@
|
||||||
<if test="refundedat != null and refundedat != ''"> and refundedAt = #{refundedat} </if>
|
<if test="refundedat != null and refundedat != ''"> and refundedAt = #{refundedat} </if>
|
||||||
<if test="refundstatus != null and refundstatus != ''"> and refundStatus = #{refundstatus} </if>
|
<if test="refundstatus != null and refundstatus != ''"> and refundStatus = #{refundstatus} </if>
|
||||||
<if test="modified != null and modified != ''"> and modified = #{modified} </if>
|
<if test="modified != null and modified != ''"> and modified = #{modified} </if>
|
||||||
|
<if test="ids!=null and ids!=''">and id in (${ids})</if>
|
||||||
-- and sts='Y'
|
-- and sts='Y'
|
||||||
</trim>
|
</trim>
|
||||||
<!-- <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>-->
|
<!-- <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>-->
|
||||||
|
|
|
@ -4026,7 +4026,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntityList1 = splitListByCount.get(i);
|
List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntityList1 = splitListByCount.get(i);
|
||||||
Set<String> mainTableIdSet = tocofsSaleoutDetailedEntityList1.stream().map(TocofsSaleoutDetailedEntity::getMaintableid).collect(Collectors.toSet());
|
Set<String> mainTableIdSet = tocofsSaleoutDetailedEntityList1.stream().map(TocofsSaleoutDetailedEntity::getMaintableid).collect(Collectors.toSet());
|
||||||
String mainTableIds = mainTableIdSet.stream().map(id -> "'" + id + "'").collect(Collectors.joining(","));
|
String mainTableIds = mainTableIdSet.stream().map(id -> "'" + id + "'").collect(Collectors.joining(","));
|
||||||
//查询对应的O销售订单
|
//查询对应的O销售出库单表头
|
||||||
TocofsSaleoutEntity tocofsSaleoutEntity = new TocofsSaleoutEntity();
|
TocofsSaleoutEntity tocofsSaleoutEntity = new TocofsSaleoutEntity();
|
||||||
tocofsSaleoutEntity.setIds(mainTableIds);
|
tocofsSaleoutEntity.setIds(mainTableIds);
|
||||||
List<TocofsSaleoutEntity> tocofsSaleoutEntityList = iTocofsSaleoutDao.query(tocofsSaleoutEntity);
|
List<TocofsSaleoutEntity> tocofsSaleoutEntityList = iTocofsSaleoutDao.query(tocofsSaleoutEntity);
|
||||||
|
|
|
@ -32,7 +32,6 @@ import com.hzya.frame.ttxofs.dto.returngoodordersearch.RerturnGoodsOrderSearchDe
|
||||||
import com.hzya.frame.ttxofs.dto.returngoodordersearch.RerturnGoodsOrderSearchHeader;
|
import com.hzya.frame.ttxofs.dto.returngoodordersearch.RerturnGoodsOrderSearchHeader;
|
||||||
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
|
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
|
||||||
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
|
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
|
||||||
import com.hzya.frame.u8c.ax.entity.Ass;
|
|
||||||
import com.hzya.frame.web.entity.BaseResult;
|
import com.hzya.frame.web.entity.BaseResult;
|
||||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
@ -124,6 +123,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
try {
|
try {
|
||||||
String param = String.valueOf(requestJson.get("param"));
|
String param = String.valueOf(requestJson.get("param"));
|
||||||
String sceneType = String.valueOf(requestJson.get("sceneType"));//sceneType:stock、tran
|
String sceneType = String.valueOf(requestJson.get("sceneType"));//sceneType:stock、tran
|
||||||
|
String pushScenarioType = String.valueOf(requestJson.get("pushScenarioType"));
|
||||||
if (ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
|
if (ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
|
||||||
//按单号
|
//按单号
|
||||||
if (param != null && !"".equals(param)) {
|
if (param != null && !"".equals(param)) {
|
||||||
|
@ -133,15 +133,15 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
//前台页面功能日期推送,或者接口调用也行
|
//前台页面功能日期推送,或者接口调用也行
|
||||||
String craeteDateStr = computingTime(param);
|
String craeteDateStr = computingTime(param);
|
||||||
if (craeteDateStr != null && !"".equals(craeteDateStr)) {
|
if (craeteDateStr != null && !"".equals(craeteDateStr)) {
|
||||||
splitDateAndPush(craeteDateStr, sceneType);
|
splitDateAndPush(craeteDateStr, sceneType, pushScenarioType);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(PROD_FILED)) {
|
if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(PROD_FILED)) {
|
||||||
//默认被定时器执行,每天晚上凌晨0点5分
|
//默认被定时器执行,每天晚上凌晨0点5分
|
||||||
//暂定先同步TOC销售库存、再推送TOC销售确认收入
|
//暂定先同步TOC销售库存、再推送TOC销售确认收入
|
||||||
List<StartAndEndVo> startAndEndVos = calculateCalculateEntireDayPeriod(null);
|
List<StartAndEndVo> startAndEndVos = calculateCalculateEntireDayPeriod(null);
|
||||||
startImplementStockByTime(startAndEndVos.get(0).getStart_time(), startAndEndVos.get(0).getEnd_time());
|
startImplementStockByTime(startAndEndVos.get(0).getStart_time(), startAndEndVos.get(0).getEnd_time(), "0");
|
||||||
startImplementByTradeTime(startAndEndVos.get(0).getStart_time(), startAndEndVos.get(0).getEnd_time());
|
startImplementByTradeTime(startAndEndVos.get(0).getStart_time(), startAndEndVos.get(0).getEnd_time(), "0");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -206,7 +206,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
*
|
*
|
||||||
* @author liuyang
|
* @author liuyang
|
||||||
*/
|
*/
|
||||||
public void startImplementStockByTime(String startTime, String endTime) throws Exception {
|
public void startImplementStockByTime(String startTime, String endTime, String pushScenarioType) throws Exception {
|
||||||
try {
|
try {
|
||||||
long startMillis = System.currentTimeMillis();
|
long startMillis = System.currentTimeMillis();
|
||||||
String threadNameStrStart = StrUtil.format("开始-OFS销售出库(TOC)同步U8C销售订单 开始时间:{} 结束时间:{}", startTime, endTime);
|
String threadNameStrStart = StrUtil.format("开始-OFS销售出库(TOC)同步U8C销售订单 开始时间:{} 结束时间:{}", startTime, endTime);
|
||||||
|
@ -214,11 +214,11 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
|
|
||||||
Assert.notNull(startTime, "开始时间不能为空");
|
Assert.notNull(startTime, "开始时间不能为空");
|
||||||
Assert.notNull(endTime, "结束时间不能为空");
|
Assert.notNull(endTime, "结束时间不能为空");
|
||||||
|
Assert.notNull(pushScenarioType, "pushScenarioType不能为空");
|
||||||
String tocShop = shopTobOrToCUtil.getCommaShop("TOC");
|
|
||||||
// CalculateDateVo calculateDateVo = DateStrUtil.calculateCalculateEntireDayPeriod(dateStr);
|
// CalculateDateVo calculateDateVo = DateStrUtil.calculateCalculateEntireDayPeriod(dateStr);
|
||||||
|
|
||||||
List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>();
|
List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>();
|
||||||
|
if (ProfilesActiveConstant.PUSH_SCENE_TYPE_0.equals(pushScenarioType) || ProfilesActiveConstant.PUSH_SCENE_TYPE_2.equals(pushScenarioType)) {
|
||||||
|
String tocShop = shopTobOrToCUtil.getCommaShop("TOC");
|
||||||
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
|
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
|
||||||
queryOfsSoSaleOutVo.setClosedAt_start(startTime);
|
queryOfsSoSaleOutVo.setClosedAt_start(startTime);
|
||||||
queryOfsSoSaleOutVo.setClosedAt_end(endTime);
|
queryOfsSoSaleOutVo.setClosedAt_end(endTime);
|
||||||
|
@ -233,6 +233,15 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
queryOfsSoSaleOutVo.setInternalInstructionType("RETURN");
|
queryOfsSoSaleOutVo.setInternalInstructionType("RETURN");
|
||||||
// queryOfsSoSaleOutVo.setCode("LETS-RE2024071600000001");
|
// queryOfsSoSaleOutVo.setCode("LETS-RE2024071600000001");
|
||||||
ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search");
|
ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search");
|
||||||
|
} else if (ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType)) {
|
||||||
|
TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity = new TocofsReturngoodsDetailedEntity();
|
||||||
|
tocofsReturngoodsDetailedEntity.setBusinessDateStart(startTime);
|
||||||
|
tocofsReturngoodsDetailedEntity.setBusinessDateEnd(endTime);
|
||||||
|
tocofsReturngoodsDetailedEntity.setBusinesstype("TOC_RETURN");
|
||||||
|
returnGoodHeaderDetailsDataDtoArrayList = queryTocofsReturngoodsDetailed(tocofsReturngoodsDetailedEntity);
|
||||||
|
} else {
|
||||||
|
Assert.state(false, "未知的场景类型!");
|
||||||
|
}
|
||||||
logger.info("TOC退货数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size());
|
logger.info("TOC退货数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size());
|
||||||
if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
|
if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
|
||||||
returnGoodHeaderDetailsDataDtoArrayList.removeIf(new Predicate<StockinOrderSearchResponse.StockinOrder>() {
|
returnGoodHeaderDetailsDataDtoArrayList.removeIf(new Predicate<StockinOrderSearchResponse.StockinOrder>() {
|
||||||
|
@ -247,11 +256,10 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
getSetStock(returnGoodHeaderDetailsDataDtoArrayList);
|
getSetStock(returnGoodHeaderDetailsDataDtoArrayList, pushScenarioType);
|
||||||
} else {
|
} else {
|
||||||
logger.info("没有查询到任何数据!不需要同步");
|
logger.info("没有查询到任何数据!不需要同步");
|
||||||
}
|
}
|
||||||
|
|
||||||
long endMillis = System.currentTimeMillis();
|
long endMillis = System.currentTimeMillis();
|
||||||
String threadNameStrEnd = StrUtil.format("结束-OFS销售出库(TOC)同步U8C销售订单 开始时间:{} 结束时间:{} 耗时:{}", startTime, endTime, (endMillis - startMillis));
|
String threadNameStrEnd = StrUtil.format("结束-OFS销售出库(TOC)同步U8C销售订单 开始时间:{} 结束时间:{} 耗时:{}", startTime, endTime, (endMillis - startMillis));
|
||||||
logger.info(threadNameStrEnd);
|
logger.info(threadNameStrEnd);
|
||||||
|
@ -302,9 +310,9 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (sceneType.equals("stock")) {
|
if (sceneType.equals("stock")) {
|
||||||
getSetStock(returnGoodHeaderDetailsDataDtoList);
|
getSetStock(returnGoodHeaderDetailsDataDtoList, "2");
|
||||||
} else if (sceneType.equals("tran")) {
|
} else if (sceneType.equals("tran")) {
|
||||||
getSetTran(returnGoodHeaderDetailsDataDtoList);
|
getSetTran(returnGoodHeaderDetailsDataDtoList, "2");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.info("没有查询到任何数据!不需要同步");
|
logger.info("没有查询到任何数据!不需要同步");
|
||||||
|
@ -320,7 +328,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
*
|
*
|
||||||
* @author liuyang
|
* @author liuyang
|
||||||
*/
|
*/
|
||||||
public void startImplementByTradeTime(String startTime, String endTime) throws Exception {
|
public void startImplementByTradeTime(String startTime, String endTime, String pushScenarioType) throws Exception {
|
||||||
try {
|
try {
|
||||||
long startMillis = System.currentTimeMillis();
|
long startMillis = System.currentTimeMillis();
|
||||||
String threadNameStrStart = StrUtil.format("OFS售后入库(TOB)同步U8C销售订单(库存同步) 开始时间:{} 结束时间:{}", startTime, endTime);
|
String threadNameStrStart = StrUtil.format("OFS售后入库(TOB)同步U8C销售订单(库存同步) 开始时间:{} 结束时间:{}", startTime, endTime);
|
||||||
|
@ -328,12 +336,13 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
|
|
||||||
Assert.notNull(startTime, "startTime不能为空");
|
Assert.notNull(startTime, "startTime不能为空");
|
||||||
Assert.notNull(endTime, "endTime不能为空");
|
Assert.notNull(endTime, "endTime不能为空");
|
||||||
|
List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>();
|
||||||
|
|
||||||
|
if (ProfilesActiveConstant.PUSH_SCENE_TYPE_0.equals(pushScenarioType) || ProfilesActiveConstant.PUSH_SCENE_TYPE_2.equals(pushScenarioType)) {
|
||||||
//生成一个时间范围
|
//生成一个时间范围
|
||||||
// StartAndEndVo startAndEndVo = offsetTimeTime.offsetTime();
|
// StartAndEndVo startAndEndVo = offsetTimeTime.offsetTime();
|
||||||
//2024年8月19日 15:47:51 查询出U8C里标记的店铺TOB属性
|
//2024年8月19日 15:47:51 查询出U8C里标记的店铺TOB属性
|
||||||
String tocShop = shopTobOrToCUtil.getCommaShop("TOC");
|
String tocShop = shopTobOrToCUtil.getCommaShop("TOC");
|
||||||
|
|
||||||
List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>();
|
|
||||||
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
|
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
|
||||||
queryOfsSoSaleOutVo.setRefundedAt_start(startTime);
|
queryOfsSoSaleOutVo.setRefundedAt_start(startTime);
|
||||||
queryOfsSoSaleOutVo.setRefundedAt_end(endTime);
|
queryOfsSoSaleOutVo.setRefundedAt_end(endTime);
|
||||||
|
@ -345,7 +354,15 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
queryOfsSoSaleOutVo.setRefundStatus("900");
|
queryOfsSoSaleOutVo.setRefundStatus("900");
|
||||||
// queryOfsSoSaleOutVo.setCode("LETS-RE2024081900000001");
|
// queryOfsSoSaleOutVo.setCode("LETS-RE2024081900000001");
|
||||||
ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search");
|
ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search");
|
||||||
logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size());
|
} else if (ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType)) {
|
||||||
|
TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity = new TocofsReturngoodsDetailedEntity();
|
||||||
|
tocofsReturngoodsDetailedEntity.setRefundedAtStart(startTime);
|
||||||
|
tocofsReturngoodsDetailedEntity.setRefundedAtEnd(endTime);
|
||||||
|
tocofsReturngoodsDetailedEntity.setBusinesstype("TOC_RETURN");
|
||||||
|
returnGoodHeaderDetailsDataDtoArrayList = queryTocofsReturngoodsDetailed(tocofsReturngoodsDetailedEntity);
|
||||||
|
} else {
|
||||||
|
Assert.state(false, "未知的场景类型!");
|
||||||
|
} logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size());
|
||||||
if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
|
if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
|
||||||
returnGoodHeaderDetailsDataDtoArrayList.removeIf(new Predicate<StockinOrderSearchResponse.StockinOrder>() {
|
returnGoodHeaderDetailsDataDtoArrayList.removeIf(new Predicate<StockinOrderSearchResponse.StockinOrder>() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -359,7 +376,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
getSetTran(returnGoodHeaderDetailsDataDtoArrayList);
|
getSetTran(returnGoodHeaderDetailsDataDtoArrayList, pushScenarioType);
|
||||||
} else {
|
} else {
|
||||||
logger.info("没有查询到任何数据!不需要同步");
|
logger.info("没有查询到任何数据!不需要同步");
|
||||||
}
|
}
|
||||||
|
@ -377,15 +394,17 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
*
|
*
|
||||||
* @author liuyang
|
* @author liuyang
|
||||||
*/
|
*/
|
||||||
private void getSetStock(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList) throws Exception {
|
private void getSetStock(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList, String pushScenarioType) throws Exception {
|
||||||
LOCK1.lock();
|
LOCK1.lock();
|
||||||
try {
|
try {
|
||||||
//过滤成功的数据
|
//过滤成功的数据
|
||||||
List<StockinOrderSearchResponse.StockinOrder> stockinOrderList = filterDataStock(returnGoodHeaderDetailsDataDtoArrayList);
|
List<StockinOrderSearchResponse.StockinOrder> stockinOrderList = filterDataStock(returnGoodHeaderDetailsDataDtoArrayList);
|
||||||
//保存到mysql
|
//保存到mysql
|
||||||
|
if (!ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType)) {
|
||||||
batchInsert(stockinOrderList);
|
batchInsert(stockinOrderList);
|
||||||
|
}
|
||||||
//执行推送主逻辑
|
//执行推送主逻辑
|
||||||
implementStock(stockinOrderList);
|
implementStock(stockinOrderList, pushScenarioType);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("TOC退货-库存:getSetStock方法抛出异常", e);
|
logger.error("TOC退货-库存:getSetStock方法抛出异常", e);
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -398,15 +417,17 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
*
|
*
|
||||||
* @author liuyang
|
* @author liuyang
|
||||||
*/
|
*/
|
||||||
private void getSetTran(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList) throws Exception {
|
private void getSetTran(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList, String pushScenarioType) throws Exception {
|
||||||
LOCK2.lock();
|
LOCK2.lock();
|
||||||
try {
|
try {
|
||||||
//过滤成功的数据
|
//过滤成功的数据
|
||||||
List<StockinOrderSearchResponse.StockinOrder> stockinOrderList = filterDataTran(returnGoodHeaderDetailsDataDtoArrayList);
|
List<StockinOrderSearchResponse.StockinOrder> stockinOrderList = filterDataTran(returnGoodHeaderDetailsDataDtoArrayList);
|
||||||
//保存到mysql
|
//保存到mysql
|
||||||
|
if (!ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType)) {
|
||||||
batchInsert(stockinOrderList);
|
batchInsert(stockinOrderList);
|
||||||
|
}
|
||||||
//执行推送主逻辑
|
//执行推送主逻辑
|
||||||
implementTran(stockinOrderList);
|
implementTran(stockinOrderList, pushScenarioType);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("TOC退货-确认收入:getSetTran方法抛出异常", e);
|
logger.error("TOC退货-确认收入:getSetTran方法抛出异常", e);
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -641,9 +662,11 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
* 库存同步,代码同步逻辑
|
* 库存同步,代码同步逻辑
|
||||||
*
|
*
|
||||||
* @param returnGoodHeaderDetailsDataDtoList1 查询得到的O售后入库单对象
|
* @param returnGoodHeaderDetailsDataDtoList1 查询得到的O售后入库单对象
|
||||||
|
* @param pushScenarioType 推送阶段场景
|
||||||
* @author liuyang
|
* @author liuyang
|
||||||
*/
|
*/
|
||||||
private void implementStock(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoList1) throws Exception {
|
private void implementStock(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoList1, String pushScenarioType) throws Exception {
|
||||||
|
Assert.notNull(pushScenarioType, "pushScenarioType不能为空");
|
||||||
if (returnGoodHeaderDetailsDataDtoList1 != null) {
|
if (returnGoodHeaderDetailsDataDtoList1 != null) {
|
||||||
logger.info("TOC退货业务:{}行需要进行数据转换", returnGoodHeaderDetailsDataDtoList1.size());
|
logger.info("TOC退货业务:{}行需要进行数据转换", returnGoodHeaderDetailsDataDtoList1.size());
|
||||||
}
|
}
|
||||||
|
@ -875,31 +898,36 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
queryAdditionUtil.additional(saleorderRequestChildrenDtoList, bdInvmandocEntity1, bdInvbasdocEntity1, negativeValue, "-1", bdTaxitemsEntity);
|
queryAdditionUtil.additional(saleorderRequestChildrenDtoList, bdInvmandocEntity1, bdInvbasdocEntity1, negativeValue, "-1", bdTaxitemsEntity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType) || ProfilesActiveConstant.PUSH_SCENE_TYPE_2.equals(pushScenarioType)) {
|
||||||
//销售订单单据推送到u8c
|
//推送u8c
|
||||||
// List<SaleorderRequestDto> saleorderRequestDtoList = new ArrayList<>();
|
List<SaleorderRequestDto> saleorderRequestDtoList = new ArrayList<>();
|
||||||
// saleorderRequestDtoList.add(saleorderRequestDto);
|
saleorderRequestDtoList.add(saleorderRequestDto);
|
||||||
// Map<String, List<SaleorderRequestDto>> stringStringMap = new HashMap<>();
|
Map<String, List<SaleorderRequestDto>> stringStringMap = new HashMap<>();
|
||||||
// stringStringMap.put("saleorder", saleorderRequestDtoList);
|
stringStringMap.put("saleorder", saleorderRequestDtoList);
|
||||||
// SoSaleResultRootDto soSaleResultRootDto = sendU8CTOCOrder(JSON.toJSONString(stringStringMap));
|
SoSaleResultRootDto soSaleResultRootDto = sendU8CTOCOrder(JSON.toJSONString(stringStringMap));
|
||||||
String vreceiptcode = null;
|
String vreceiptcode = null;
|
||||||
String pk_corp = null;
|
String pk_corp = null;
|
||||||
String csaleid = null;
|
String csaleid = null;
|
||||||
// if (soSaleResultRootDto != null && soSaleResultRootDto.getParentvo() != null) {
|
if (soSaleResultRootDto != null && soSaleResultRootDto.getParentvo() != null) {
|
||||||
// vreceiptcode = soSaleResultRootDto.getParentvo().getVreceiptcode();
|
vreceiptcode = soSaleResultRootDto.getParentvo().getVreceiptcode();
|
||||||
// pk_corp = soSaleResultRootDto.getParentvo().getPk_corp();
|
pk_corp = soSaleResultRootDto.getParentvo().getPk_corp();
|
||||||
// csaleid = soSaleResultRootDto.getParentvo().getCsaleid();
|
csaleid = soSaleResultRootDto.getParentvo().getCsaleid();
|
||||||
// }
|
}
|
||||||
// logger.info("TOC销售订单编号:{} 主键:{} 销售公司:{}", vreceiptcode, csaleid, pk_corp);
|
logger.info("TOC销售订单编号:{} 主键:{} 销售公司:{}", vreceiptcode, csaleid, pk_corp);
|
||||||
// TODO 临时方案
|
updateSuccessOrFail1(oldValue, "Y", "success", vreceiptcode, csaleid);
|
||||||
vreceiptcode = "暂存";
|
} else if (ProfilesActiveConstant.PUSH_SCENE_TYPE_0.equals(pushScenarioType)) {
|
||||||
csaleid = "暂存";
|
//选择暂存等待下次发起
|
||||||
updateSuccessOrFail1(oldValue, "S", "暂存", vreceiptcode, csaleid);
|
String vreceiptcode = "暂存";
|
||||||
//记录成功
|
String csaleid = "暂存";
|
||||||
// updateSuccessOrFail1(oldValue, "Y", "success", vreceiptcode, csaleid);
|
String newstate = "S";
|
||||||
|
String newTransmitInfo = "暂存";
|
||||||
|
updateSuccessOrFail1(oldValue, newstate, newTransmitInfo, vreceiptcode, csaleid);
|
||||||
|
} else {
|
||||||
|
Assert.state(false, "未知的场景类型 pushScenarioType={}", pushScenarioType);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("TOC退货业务转换成U8C对象过程中、或者单据推送到U8C出现异常!", e);
|
|
||||||
//记录失败
|
//记录失败
|
||||||
|
logger.error("TOC退货业务转换成U8C对象过程中、或者单据推送到U8C出现异常!", e);
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
if (message == null) {
|
if (message == null) {
|
||||||
message = "未知错误";
|
message = "未知错误";
|
||||||
|
@ -913,7 +941,6 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("外层转换逻辑抛出异常", e);
|
logger.error("外层转换逻辑抛出异常", e);
|
||||||
// 记录失败
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -924,7 +951,8 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
* @param returnGoodHeaderDetailsDataDtoList1 查询得到的O售后入库单对象
|
* @param returnGoodHeaderDetailsDataDtoList1 查询得到的O售后入库单对象
|
||||||
* @author liuyang
|
* @author liuyang
|
||||||
*/
|
*/
|
||||||
private void implementTran(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoList1) throws Exception {
|
private void implementTran(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoList1, String pushScenarioType) throws Exception {
|
||||||
|
Assert.notNull(pushScenarioType, "pushScenarioType不能为空");
|
||||||
if (returnGoodHeaderDetailsDataDtoList1 != null && returnGoodHeaderDetailsDataDtoList1.size() > 0) {
|
if (returnGoodHeaderDetailsDataDtoList1 != null && returnGoodHeaderDetailsDataDtoList1.size() > 0) {
|
||||||
logger.info("TOC退货业务:{}行需要进行数据转换", returnGoodHeaderDetailsDataDtoList1.size());
|
logger.info("TOC退货业务:{}行需要进行数据转换", returnGoodHeaderDetailsDataDtoList1.size());
|
||||||
|
|
||||||
|
@ -1155,28 +1183,33 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//销售订单单据推送到u8c
|
if (ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType) || ProfilesActiveConstant.PUSH_SCENE_TYPE_2.equals(pushScenarioType)) {
|
||||||
// List<SaleorderRequestDto> saleorderRequestDtoList = new ArrayList<>();
|
//推送U8C
|
||||||
// saleorderRequestDtoList.add(saleorderRequestDto);
|
List<SaleorderRequestDto> saleorderRequestDtoList = new ArrayList<>();
|
||||||
// Map<String, List<SaleorderRequestDto>> stringStringMap = new HashMap<>();
|
saleorderRequestDtoList.add(saleorderRequestDto);
|
||||||
// stringStringMap.put("saleorder", saleorderRequestDtoList);
|
Map<String, List<SaleorderRequestDto>> stringStringMap = new HashMap<>();
|
||||||
// SoSaleResultRootDto soSaleResultRootDto = sendU8CTOCOrder(JSON.toJSONString(stringStringMap));
|
stringStringMap.put("saleorder", saleorderRequestDtoList);
|
||||||
|
SoSaleResultRootDto soSaleResultRootDto = sendU8CTOCOrder(JSON.toJSONString(stringStringMap));
|
||||||
String vreceiptcode = null;
|
String vreceiptcode = null;
|
||||||
String pk_corp = null;
|
String pk_corp = null;
|
||||||
String csaleid = null;
|
String csaleid = null;
|
||||||
// if (soSaleResultRootDto != null && soSaleResultRootDto.getParentvo() != null) {
|
if (soSaleResultRootDto != null && soSaleResultRootDto.getParentvo() != null) {
|
||||||
// vreceiptcode = soSaleResultRootDto.getParentvo().getVreceiptcode();
|
vreceiptcode = soSaleResultRootDto.getParentvo().getVreceiptcode();
|
||||||
// pk_corp = soSaleResultRootDto.getParentvo().getPk_corp();
|
pk_corp = soSaleResultRootDto.getParentvo().getPk_corp();
|
||||||
// csaleid = soSaleResultRootDto.getParentvo().getCsaleid();
|
csaleid = soSaleResultRootDto.getParentvo().getCsaleid();
|
||||||
// }
|
}
|
||||||
// logger.info("TOC销售订单编号:{} 销售订单主键:{} 销售公司:{}", vreceiptcode, csaleid, pk_corp);
|
logger.info("TOC销售订单编号:{} 销售订单主键:{} 销售公司:{}", vreceiptcode, csaleid, pk_corp);
|
||||||
// TODO 临时方案
|
updateSuccessOrFail2(oldValue, "Y", "success", vreceiptcode, csaleid);
|
||||||
vreceiptcode = "暂存";
|
} else if (ProfilesActiveConstant.PUSH_SCENE_TYPE_0.equals(pushScenarioType)) {
|
||||||
csaleid = "暂存";
|
//不推送U8C,单据暂存
|
||||||
//记录成功
|
String vreceiptcode = "暂存";
|
||||||
updateSuccessOrFail2(oldValue, "S", "暂存", vreceiptcode, csaleid);
|
String csaleid = "暂存";
|
||||||
// updateSuccessOrFail2(oldValue, "Y", "success", vreceiptcode, csaleid);
|
String newstate = "S";
|
||||||
|
String newTransmitInfo = "暂存";
|
||||||
|
updateSuccessOrFail2(oldValue, newstate, newTransmitInfo, vreceiptcode, csaleid);
|
||||||
|
} else {
|
||||||
|
Assert.state(false, "未知的场景类型 pushScenarioType={}", pushScenarioType);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("TOC退货业务转换成U8C对象过程中、或者单据推送到U8C出现异常!", e);
|
logger.error("TOC退货业务转换成U8C对象过程中、或者单据推送到U8C出现异常!", e);
|
||||||
//记录失败
|
//记录失败
|
||||||
|
@ -1193,7 +1226,6 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("外层转换逻辑抛出异常", e);
|
logger.error("外层转换逻辑抛出异常", e);
|
||||||
// 记录失败
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2540,7 +2572,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
*
|
*
|
||||||
* @author liuyang
|
* @author liuyang
|
||||||
*/
|
*/
|
||||||
public void splitDateAndPush(String param, String sceneType) throws Exception {
|
public void splitDateAndPush(String param, String sceneType, String pushScenarioType) throws Exception {
|
||||||
try {
|
try {
|
||||||
Assert.notNull(param, "param不能为空!");
|
Assert.notNull(param, "param不能为空!");
|
||||||
Assert.state(!"".equals(param), "param不能为空!");
|
Assert.state(!"".equals(param), "param不能为空!");
|
||||||
|
@ -2548,6 +2580,9 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
Assert.notNull(sceneType, "sceneType不能为空!");
|
Assert.notNull(sceneType, "sceneType不能为空!");
|
||||||
Assert.state(!"".equals(sceneType), "sceneType不能为空!");
|
Assert.state(!"".equals(sceneType), "sceneType不能为空!");
|
||||||
|
|
||||||
|
Assert.notNull(pushScenarioType, "pushScenarioType不能为空!");
|
||||||
|
Assert.state(!"".equals(pushScenarioType), "pushScenarioType不能为空!");
|
||||||
|
|
||||||
if (param.contains("*")) {
|
if (param.contains("*")) {
|
||||||
String[] params = param.split("\\*");
|
String[] params = param.split("\\*");
|
||||||
if (params.length > 0) {
|
if (params.length > 0) {
|
||||||
|
@ -2556,9 +2591,9 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
String[] split = indexStr.split(",");
|
String[] split = indexStr.split(",");
|
||||||
logger.info("splitDateAndPush方法正在执行主要的逻辑 开始时间:{} 结束时间:{}", split[0], split[1]);
|
logger.info("splitDateAndPush方法正在执行主要的逻辑 开始时间:{} 结束时间:{}", split[0], split[1]);
|
||||||
if (sceneType.equals(STOCK)) {
|
if (sceneType.equals(STOCK)) {
|
||||||
startImplementStockByTime(split[0], split[1]);
|
startImplementStockByTime(split[0], split[1], pushScenarioType);
|
||||||
} else if (sceneType.equals(TRAN)) {
|
} else if (sceneType.equals(TRAN)) {
|
||||||
startImplementByTradeTime(split[0], split[1]);
|
startImplementByTradeTime(split[0], split[1], pushScenarioType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2566,9 +2601,9 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
String[] split = param.split(",");
|
String[] split = param.split(",");
|
||||||
logger.info("splitDateAndPush方法正在执行主要的逻辑 开始时间:{} 结束时间:{}", split[0], split[1]);
|
logger.info("splitDateAndPush方法正在执行主要的逻辑 开始时间:{} 结束时间:{}", split[0], split[1]);
|
||||||
if (sceneType.equals(STOCK)) {
|
if (sceneType.equals(STOCK)) {
|
||||||
startImplementStockByTime(split[0], split[1]);
|
startImplementStockByTime(split[0], split[1], pushScenarioType);
|
||||||
} else if (sceneType.equals(TRAN)) {
|
} else if (sceneType.equals(TRAN)) {
|
||||||
startImplementByTradeTime(split[0], split[1]);
|
startImplementByTradeTime(split[0], split[1], pushScenarioType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -3014,4 +3049,78 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
calculationFormulaStr.append(format);
|
calculationFormulaStr.append(format);
|
||||||
return amountOfMoney.stripTrailingZeros().toPlainString();
|
return amountOfMoney.stripTrailingZeros().toPlainString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询OFS底表的O售后入库单数据
|
||||||
|
*
|
||||||
|
* @author liuyang
|
||||||
|
*/
|
||||||
|
public List<StockinOrderSearchResponse.StockinOrder> queryTocofsReturngoodsDetailed(TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity) throws Exception {
|
||||||
|
Assert.notNull(tocofsReturngoodsDetailedEntity, "tocofsReturngoodsDetailedEntity不能为空");
|
||||||
|
|
||||||
|
//底表O售后入库单表头对象
|
||||||
|
List<TocofsReturngoodsEntity> allTocofsReturngoodsEntityList = new ArrayList<>();
|
||||||
|
//底表O售后入库单明细行
|
||||||
|
List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList = iTocofsReturngoodsDetailedDao.query(tocofsReturngoodsDetailedEntity);
|
||||||
|
|
||||||
|
if (tocofsReturngoodsDetailedEntityList != null && tocofsReturngoodsDetailedEntityList.size() > 0) {
|
||||||
|
List<List<TocofsReturngoodsDetailedEntity>> splitListByCount = SplitListByCountUtil.splitListByCount(tocofsReturngoodsDetailedEntityList, 1000);
|
||||||
|
for (int i = 0; i < splitListByCount.size(); i++) {
|
||||||
|
List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList1 = splitListByCount.get(i);
|
||||||
|
Set<String> mainTableIdSet = tocofsReturngoodsDetailedEntityList1.stream().map(TocofsReturngoodsDetailedEntity::getMaintableid).collect(Collectors.toSet());
|
||||||
|
String mainTableIds = mainTableIdSet.stream().map(id -> "'" + id + "'").collect(Collectors.joining(","));
|
||||||
|
//查询对应的O售后入库单表头
|
||||||
|
TocofsReturngoodsEntity tocofsReturngoodsEntity = new TocofsReturngoodsEntity();
|
||||||
|
tocofsReturngoodsEntity.setIds(mainTableIds);
|
||||||
|
List<TocofsReturngoodsEntity> tocofsReturngoodsEntityList = iTocofsReturngoodsDao.query(tocofsReturngoodsEntity);
|
||||||
|
allTocofsReturngoodsEntityList.addAll(tocofsReturngoodsEntityList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//通过「O售后入库单表头」匹配「O售后入库单明细」
|
||||||
|
if (allTocofsReturngoodsEntityList.size() > 0) {
|
||||||
|
for (int i = 0; i < allTocofsReturngoodsEntityList.size(); i++) {
|
||||||
|
TocofsReturngoodsEntity tocofsReturngoodsEntity = allTocofsReturngoodsEntityList.get(i);
|
||||||
|
List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList1 = new ArrayList<>();
|
||||||
|
for (int j = 0; j < tocofsReturngoodsDetailedEntityList.size(); j++) {
|
||||||
|
TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity1 = tocofsReturngoodsDetailedEntityList.get(j);
|
||||||
|
if (tocofsReturngoodsDetailedEntity.getMaintableid().equals(tocofsReturngoodsEntity.getId())) {
|
||||||
|
tocofsReturngoodsDetailedEntityList1.add(tocofsReturngoodsDetailedEntity1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tocofsReturngoodsEntity.setTocofsReturngoodsDetailedEntityList(tocofsReturngoodsDetailedEntityList1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//转换为OFS售后入库单对象
|
||||||
|
List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>();
|
||||||
|
if (allTocofsReturngoodsEntityList.size() > 0) {
|
||||||
|
for (int i = 0; i < allTocofsReturngoodsEntityList.size(); i++) {
|
||||||
|
|
||||||
|
StockinOrderSearchResponse.StockinOrder stockinOrder = new StockinOrderSearchResponse.StockinOrder();
|
||||||
|
returnGoodHeaderDetailsDataDtoArrayList.add(stockinOrder);
|
||||||
|
|
||||||
|
//处理表头
|
||||||
|
TocofsReturngoodsEntity tocofsReturngoodsEntity = allTocofsReturngoodsEntityList.get(i);
|
||||||
|
StockinOrderSearchResponse.StockinOrder.StockinH stockinH = new StockinOrderSearchResponse.StockinOrder.StockinH();
|
||||||
|
stockinH.setId(tocofsReturngoodsEntity.getId());
|
||||||
|
BeanUtil.copyPropertiesV2(tocofsReturngoodsEntity, stockinH);
|
||||||
|
stockinOrder.setHeader(stockinH);
|
||||||
|
|
||||||
|
//处理明细行
|
||||||
|
List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList1 = tocofsReturngoodsEntity.getTocofsReturngoodsDetailedEntityList();
|
||||||
|
List<StockinOrderSearchResponse.StockinOrder.StockinB> stockinB = new ArrayList<>();
|
||||||
|
stockinOrder.setDetails(stockinB);
|
||||||
|
for (int j = 0; j < tocofsReturngoodsDetailedEntityList1.size(); j++) {
|
||||||
|
TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity1 = tocofsReturngoodsDetailedEntityList1.get(j);
|
||||||
|
|
||||||
|
StockinOrderSearchResponse.StockinOrder.StockinB stockinB1 = new StockinOrderSearchResponse.StockinOrder.StockinB();
|
||||||
|
BeanUtil.copyPropertiesV2(tocofsReturngoodsDetailedEntity1, stockinB1);
|
||||||
|
stockinB1.setId(tocofsReturngoodsDetailedEntity1.getId());
|
||||||
|
stockinB.add(stockinB1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return returnGoodHeaderDetailsDataDtoArrayList;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -118,7 +118,7 @@ class SoSaleOutPluginInitializerToCTest {
|
||||||
// soSaleOutPluginInitializerToC.startImplementStockByCode(aaa, "tran");
|
// soSaleOutPluginInitializerToC.startImplementStockByCode(aaa, "tran");
|
||||||
|
|
||||||
// String aaa = "LETS-SH2024102800021196";
|
// String aaa = "LETS-SH2024102800021196";
|
||||||
// soSaleOutPluginInitializerToC.startImplementStockByTime("2024-12-06 09:25:39", "2024-12-06 09:25:39");
|
soSaleOutPluginInitializerToC.startImplementTranByTime("2024-11-13 11:30:41", "2024-11-13 11:30:41", "0");
|
||||||
|
|
||||||
// soSaleOutPluginInitializerToC.startImplementStockByTime("2024-12-24 21:53:57", "2024-12-24 21:53:57", "2");
|
// soSaleOutPluginInitializerToC.startImplementStockByTime("2024-12-24 21:53:57", "2024-12-24 21:53:57", "2");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -129,7 +129,7 @@ class SoSaleOutPluginInitializerToCTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024110200030366", "stock");
|
// soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024110200030366", "stock");
|
||||||
soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024121200024676", "tran");
|
// soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024121200024676", "tran");
|
||||||
|
|
||||||
// soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024111700013756", "tran");
|
// soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024111700013756", "tran");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
Loading…
Reference in New Issue