优化TOC业务流程代码
This commit is contained in:
parent
4d2e275cd8
commit
4083c58dda
|
@ -6,6 +6,7 @@ package com.hzya.frame.plugin.lets.constant;
|
||||||
public class ProfilesActiveConstant {
|
public class ProfilesActiveConstant {
|
||||||
|
|
||||||
public static final String LETS_DATE_SOURCE = "lets_u8c";
|
public static final String LETS_DATE_SOURCE = "lets_u8c";
|
||||||
|
|
||||||
public static final String LETS_PROFILES_ACTIVE = "dev";
|
public static final String LETS_PROFILES_ACTIVE = "dev";
|
||||||
|
|
||||||
public static final String LOG_STATUS_Y = "Y";
|
public static final String LOG_STATUS_Y = "Y";
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
package com.hzya.frame.plugin.lets.ofs.dao;
|
|
||||||
|
|
||||||
import com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutEntity;
|
|
||||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* root(tocofs_saleout: table)表数据库访问层
|
|
||||||
*
|
|
||||||
* @author makejava
|
|
||||||
* @since 2024-08-01 17:01:32
|
|
||||||
*/
|
|
||||||
public interface ITocofsSaleoutDao extends IBaseDao<TocofsSaleoutEntity, String> {
|
|
||||||
/**
|
|
||||||
* 批量插入主表信息
|
|
||||||
*
|
|
||||||
* @author liuyang
|
|
||||||
*/
|
|
||||||
void entityInsertBatchV2(List<TocofsSaleoutEntity> tocofsSaleoutEntityList) throws Exception;
|
|
||||||
}
|
|
|
@ -12,12 +12,39 @@ import java.util.List;
|
||||||
* @since 2024-09-04 17:48:28
|
* @since 2024-09-04 17:48:28
|
||||||
*/
|
*/
|
||||||
public interface ITocofsSaleoutDetailedDao extends IBaseDao<TocofsSaleoutDetailedEntity, String> {
|
public interface ITocofsSaleoutDetailedDao extends IBaseDao<TocofsSaleoutDetailedEntity, String> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量插入或者更新
|
* 批量插入或者更新
|
||||||
*
|
*
|
||||||
* @author liuyang
|
* @author liuyang
|
||||||
*/
|
*/
|
||||||
void entityInsertOrUpdateBatch(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception;
|
void entityInsertOrUpdateBatch(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新出库状态的日志(适合档案转换部分的日志处理)
|
||||||
|
*
|
||||||
|
* @author liuyang
|
||||||
|
*/
|
||||||
|
void entityInsertOrUpdateBatchStock1(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新出库状态的日志(适用库存推送)
|
||||||
|
*
|
||||||
|
* @author liuyang
|
||||||
|
*/
|
||||||
|
void entityInsertOrUpdateBatchStock2(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新出库状态的日志(适用库存推送)
|
||||||
|
*
|
||||||
|
* @author liuyang
|
||||||
|
*/
|
||||||
|
void entityInsertOrUpdateBatchStock3(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新出库状态的日志(适用库存推送)
|
||||||
|
*
|
||||||
|
* @author liuyang
|
||||||
|
*/
|
||||||
|
void entityInsertOrUpdateBatchStock4(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,4 +18,24 @@ public class TocofsSaleoutDetailedDaoImpl extends MybatisGenericDao<TocofsSaleou
|
||||||
public void entityInsertOrUpdateBatch(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception {
|
public void entityInsertOrUpdateBatch(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception {
|
||||||
insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsSaleoutDetailedDaoImpl.entityInsertOrUpdateBatch", tocofsSaleoutDetailedEntities);
|
insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsSaleoutDetailedDaoImpl.entityInsertOrUpdateBatch", tocofsSaleoutDetailedEntities);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void entityInsertOrUpdateBatchStock1(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception {
|
||||||
|
insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsSaleoutDetailedDaoImpl.entityInsertOrUpdateBatchStock", tocofsSaleoutDetailedEntities);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void entityInsertOrUpdateBatchStock2(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception {
|
||||||
|
insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsSaleoutDetailedDaoImpl.entityInsertOrUpdateBatchStock2", tocofsSaleoutDetailedEntities);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void entityInsertOrUpdateBatchStock3(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception {
|
||||||
|
insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsSaleoutDetailedDaoImpl.entityInsertOrUpdateBatchStock3", tocofsSaleoutDetailedEntities);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void entityInsertOrUpdateBatchStock4(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception {
|
||||||
|
insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsSaleoutDetailedDaoImpl.entityInsertOrUpdateBatchStock4", tocofsSaleoutDetailedEntities);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -360,4 +360,8 @@ public class TocofsSaleoutDetailedEntity extends BaseEntity {
|
||||||
* 自定义项
|
* 自定义项
|
||||||
*/
|
*/
|
||||||
private String def40;
|
private String def40;
|
||||||
|
/**
|
||||||
|
* 额外参数:查询条件
|
||||||
|
*/
|
||||||
|
private String ids;
|
||||||
}
|
}
|
|
@ -279,10 +279,11 @@
|
||||||
<if test="def38 != null and def38 != ''"> and def38 = #{def38} </if>
|
<if test="def38 != null and def38 != ''"> and def38 = #{def38} </if>
|
||||||
<if test="def39 != null and def39 != ''"> and def39 = #{def39} </if>
|
<if test="def39 != null and def39 != ''"> and def39 = #{def39} </if>
|
||||||
<if test="def40 != null and def40 != ''"> and def40 = #{def40} </if>
|
<if test="def40 != null and def40 != ''"> and def40 = #{def40} </if>
|
||||||
and sts='Y'
|
<if test="ids!=null and ids!=''">and id in (${ids})</if>
|
||||||
|
-- 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>-->
|
||||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
<!-- <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>-->
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 查询符合条件的数量 -->
|
<!-- 查询符合条件的数量 -->
|
||||||
|
@ -882,7 +883,102 @@
|
||||||
def37 = values(def37),
|
def37 = values(def37),
|
||||||
def38 = values(def38),
|
def38 = values(def38),
|
||||||
def39 = values(def39),
|
def39 = values(def39),
|
||||||
def40 = values(def40)</insert>
|
def40 = values(def40)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 出库成功,更新推送状态(适合档案转啊)-->
|
||||||
|
<insert id="entityInsertOrUpdateBatchStock" keyProperty="id" useGeneratedKeys="true" parameterType="com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity">
|
||||||
|
insert into tocofs_saleout_detailed(id,newPushDate,newTransmitInfo,newState)
|
||||||
|
values
|
||||||
|
<foreach collection="list" item="entity" separator=",">
|
||||||
|
(
|
||||||
|
#{entity.id},
|
||||||
|
#{entity.newpushdate},
|
||||||
|
#{entity.newtransmitinfo},
|
||||||
|
#{entity.newstate}
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
on duplicate key update
|
||||||
|
id = values(id),
|
||||||
|
newPushDate = values(newPushDate),
|
||||||
|
newTransmitInfo = values(newTransmitInfo),
|
||||||
|
newState = values(newState)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- TOC更新推送状态(适合库存同步)-->
|
||||||
|
<insert id="entityInsertOrUpdateBatchStock2" keyProperty="id" useGeneratedKeys="true" parameterType="com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity">
|
||||||
|
insert into tocofs_saleout_detailed(id,newPushDate,newTransmitInfo,newState,newSystemNumber,newSystemPrimary)
|
||||||
|
values
|
||||||
|
<foreach collection="list" item="entity" separator=",">
|
||||||
|
(
|
||||||
|
#{entity.id},
|
||||||
|
#{entity.newpushdate},
|
||||||
|
#{entity.newtransmitinfo},
|
||||||
|
#{entity.newstate},
|
||||||
|
#{entity.newsystemnumber},
|
||||||
|
#{entity.newsystemprimary}
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
on duplicate key update
|
||||||
|
id = values(id),
|
||||||
|
newPushDate = values(newPushDate),
|
||||||
|
newTransmitInfo = values(newTransmitInfo),
|
||||||
|
newState = values(newState),
|
||||||
|
newSystemNumber = values(newSystemNumber),
|
||||||
|
newSystemPrimary = values(newSystemPrimary)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- TOC更新推送状态(适合确认收入红字)-->
|
||||||
|
<insert id="entityInsertOrUpdateBatchStock3" keyProperty="id" useGeneratedKeys="true">
|
||||||
|
insert into tocofs_saleout_detailed(id,def1,def2,newState2,newSystemNumber2,newSystemPrimary2)
|
||||||
|
values
|
||||||
|
<foreach collection="list" item="entity" separator=",">
|
||||||
|
(
|
||||||
|
#{entity.id},
|
||||||
|
#{entity.def1},
|
||||||
|
#{entity.def2},
|
||||||
|
#{entity.newstate2},
|
||||||
|
#{entity.newsystemnumber2},
|
||||||
|
#{entity.newsystemprimary2}
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
on duplicate key update
|
||||||
|
id = values(id),
|
||||||
|
def1 = values(def1),
|
||||||
|
def2 = values(def2),
|
||||||
|
newState2 = values(newState2),
|
||||||
|
newSystemNumber2 = values(newSystemNumber2),
|
||||||
|
newSystemPrimary2 = values(newSystemPrimary2)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- TOC更新推送状态(适合确认收入蓝字)-->
|
||||||
|
<insert id="entityInsertOrUpdateBatchStock4" keyProperty="id" useGeneratedKeys="true">
|
||||||
|
insert into tocofs_saleout_detailed(id,def3,def4,newState3,newSystemNumber3,newSystemPrimary3)
|
||||||
|
values
|
||||||
|
<foreach collection="list" item="entity" separator=",">
|
||||||
|
(
|
||||||
|
#{entity.id},
|
||||||
|
#{entity.def3},
|
||||||
|
#{entity.def4},
|
||||||
|
#{entity.newstate3},
|
||||||
|
#{entity.newsystemnumber3},
|
||||||
|
#{entity.newsystemprimary3}
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
on duplicate key update
|
||||||
|
id = values(id),
|
||||||
|
def3 = values(def3),
|
||||||
|
def4 = values(def4),
|
||||||
|
newState3 = values(newState3),
|
||||||
|
newSystemNumber3 = values(newSystemNumber3),
|
||||||
|
newSystemPrimary3 = values(newSystemPrimary3)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
<!--通过主键修改方法-->
|
<!--通过主键修改方法-->
|
||||||
<update id="entity_update" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity" >
|
<update id="entity_update" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity" >
|
||||||
update tocofs_saleout_detailed set
|
update tocofs_saleout_detailed set
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.hzya.frame.plugin.lets.plugin.sales;
|
package com.hzya.frame.plugin.lets.plugin.sales;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.lang.Assert;
|
import cn.hutool.core.lang.Assert;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
@ -16,6 +17,7 @@ import com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity;
|
||||||
import com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutEntity;
|
import com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutEntity;
|
||||||
import com.hzya.frame.plugin.lets.ofs.service.ITocofsSaleoutService;
|
import com.hzya.frame.plugin.lets.ofs.service.ITocofsSaleoutService;
|
||||||
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo;
|
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo;
|
||||||
|
import com.hzya.frame.plugin.lets.queryvo.StartAndEndVo;
|
||||||
import com.hzya.frame.plugin.lets.resultvo.CacheTocMapVo;
|
import com.hzya.frame.plugin.lets.resultvo.CacheTocMapVo;
|
||||||
import com.hzya.frame.plugin.lets.resultvo.CalculateDateVo;
|
import com.hzya.frame.plugin.lets.resultvo.CalculateDateVo;
|
||||||
import com.hzya.frame.plugin.lets.u8cdto.*;
|
import com.hzya.frame.plugin.lets.u8cdto.*;
|
||||||
|
@ -28,11 +30,15 @@ import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDto;
|
||||||
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.SaleOutReturnMessageDto;
|
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.SaleOutReturnMessageDto;
|
||||||
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
|
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
|
||||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
|
import com.hzya.frame.web.exception.BaseSystemException;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.locks.ReentrantLock;
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
@ -49,6 +55,8 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
|
|
||||||
private static final ReentrantLock LOCK = new ReentrantLock(true);
|
private static final ReentrantLock LOCK = new ReentrantLock(true);
|
||||||
|
|
||||||
|
private static final String PROD_FILED = "prod";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
logger.info(getPluginLabel() + "執行初始化方法initialize()");
|
logger.info(getPluginLabel() + "執行初始化方法initialize()");
|
||||||
|
@ -81,6 +89,37 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
||||||
|
long startMillis = System.currentTimeMillis();
|
||||||
|
logger.info("executeBusiness方法调用开始:" + getPluginName() + "-插件");
|
||||||
|
|
||||||
|
if (ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
|
||||||
|
throw new BaseSystemException("TOC退货业务,无法按单行推送!需要根据天的维度推送");
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
String param = String.valueOf(requestJson.get("param"));
|
||||||
|
if (ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
|
||||||
|
//按单号
|
||||||
|
if (param != null && !"".equals(param)) {
|
||||||
|
startImplementStockByCode(param);
|
||||||
|
}
|
||||||
|
} else if (ProfilesActiveConstant.TYPE_TIME_FRAME.equals(requestJson.get("type"))) {
|
||||||
|
//前台页面功能日期推送,或者接口调用也行
|
||||||
|
String craeteDateStr = computingTime(param);
|
||||||
|
if (craeteDateStr != null && !"".equals(craeteDateStr)) {
|
||||||
|
splitDateAndPush(craeteDateStr);
|
||||||
|
}
|
||||||
|
} else if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(PROD_FILED)) {
|
||||||
|
//默认被定时器执行,每天晚上凌晨0点5分
|
||||||
|
List<StartAndEndVo> startAndEndVos = calculateCalculateEntireDayPeriod(null);
|
||||||
|
startImplementStockByTime(startAndEndVos.get(0).getStart_time(), startAndEndVos.get(0).getEnd_time());
|
||||||
|
startImplementTranByTime(startAndEndVos.get(0).getStart_time(), startAndEndVos.get(0).getEnd_time());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("executeBusiness方法异常", e);
|
||||||
|
}
|
||||||
|
long endMillis = System.currentTimeMillis();
|
||||||
|
logger.info("executeBusiness方法调用结束:" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis));
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,7 +152,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
private RdclUtil rdclUtil;
|
private RdclUtil rdclUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 按指定时间拉取
|
* 库存同步,按指定时间拉取
|
||||||
*
|
*
|
||||||
* @param startTime O出库开始时间
|
* @param startTime O出库开始时间
|
||||||
* @param endTime O出库结束时间
|
* @param endTime O出库结束时间
|
||||||
|
@ -179,7 +218,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 按指定时间拉取
|
* 根据出库单编码拉取
|
||||||
*
|
*
|
||||||
* @param code O销售出库单编码
|
* @param code O销售出库单编码
|
||||||
* @author liuyang
|
* @author liuyang
|
||||||
|
@ -304,7 +343,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 触发数据转换之前的预备逻辑
|
* 库存同步:触发数据转换之前的预备逻辑
|
||||||
*
|
*
|
||||||
* @author liuyang
|
* @author liuyang
|
||||||
*/
|
*/
|
||||||
|
@ -312,13 +351,13 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
//保存到mysql底表
|
//保存到mysql底表
|
||||||
batchInsert(headerDetailsDtoList);
|
batchInsert(headerDetailsDtoList);
|
||||||
//过滤成功的数据
|
//过滤成功的数据
|
||||||
// List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtos = filterDataStock(headerDetailsDtoList);
|
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtos = filterDataStock(headerDetailsDtoList);
|
||||||
//执行推送主逻辑
|
//执行推送主逻辑
|
||||||
// implementStock(headerDetailsDtos);
|
implementStock(headerDetailsDtos);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 触发数据转换之前的预备逻辑
|
* 交易成功:触发数据转换之前的预备逻辑
|
||||||
*
|
*
|
||||||
* @author liuyang
|
* @author liuyang
|
||||||
*/
|
*/
|
||||||
|
@ -326,9 +365,10 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
//保存到mysql底表
|
//保存到mysql底表
|
||||||
batchInsert(headerDetailsDtoList);
|
batchInsert(headerDetailsDtoList);
|
||||||
//过滤成功的数据
|
//过滤成功的数据
|
||||||
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtos = filterDataSTran(headerDetailsDtoList);
|
//headerDetailsDtos携带红、蓝单据推送成功与否的明细行
|
||||||
//执行推送主逻辑
|
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtos = filterDataTran(headerDetailsDtoList);
|
||||||
implementStock(headerDetailsDtos);
|
//执行推送采购主逻辑
|
||||||
|
implementTran(headerDetailsDtos);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -336,13 +376,191 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
*
|
*
|
||||||
* @author liuyang
|
* @author liuyang
|
||||||
*/
|
*/
|
||||||
private List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> filterDataStock(List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList) {
|
private List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> filterDataStock(List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList) throws Exception {
|
||||||
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList1 = new ArrayList<>();
|
// List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList1 = new ArrayList<>();
|
||||||
|
List<TocofsSaleoutDetailedEntity> allTocofsSaleoutDetailedEntityList = new ArrayList<>();
|
||||||
if (headerDetailsDtoList != null && headerDetailsDtoList.size() > 0) {
|
if (headerDetailsDtoList != null && headerDetailsDtoList.size() > 0) {
|
||||||
//TODO 出库单明细主键,需要O返回,目前没有,已经提需求
|
List<List<HeaderDetailsDto>> splitListByCount = SplitListByCountUtil.splitListByCount(headerDetailsDtoList, 100);
|
||||||
headerDetailsDtoList1.addAll(headerDetailsDtoList);
|
for (int i = 0; i < splitListByCount.size(); i++) {
|
||||||
|
List<HeaderDetailsDto> headerDetailsDtoList2 = splitListByCount.get(i);
|
||||||
|
String idStr = commaConcatenatedPrimaryKeyStock(headerDetailsDtoList2);
|
||||||
|
List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntityList = queryStockTocOutLog(idStr);
|
||||||
|
allTocofsSaleoutDetailedEntityList.addAll(tocofsSaleoutDetailedEntityList);
|
||||||
}
|
}
|
||||||
return headerDetailsDtoList1;
|
}
|
||||||
|
if (allTocofsSaleoutDetailedEntityList.size() > 0) {
|
||||||
|
return filterDataRowsAsPushOrFailedStock(allTocofsSaleoutDetailedEntityList, headerDetailsDtoList);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 交易成功业务:过滤掉成功的数据
|
||||||
|
*
|
||||||
|
* @author liuyang
|
||||||
|
*/
|
||||||
|
private List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> filterDataTran(List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList) throws Exception {
|
||||||
|
List<TocofsSaleoutDetailedEntity> allTocofsSaleoutDetailedEntityList = new ArrayList<>();
|
||||||
|
if (headerDetailsDtoList != null && headerDetailsDtoList.size() > 0) {
|
||||||
|
List<List<HeaderDetailsDto>> splitListByCount = SplitListByCountUtil.splitListByCount(headerDetailsDtoList, 100);
|
||||||
|
for (int i = 0; i < splitListByCount.size(); i++) {
|
||||||
|
List<HeaderDetailsDto> headerDetailsDtoList2 = splitListByCount.get(i);
|
||||||
|
String idStr = commaConcatenatedPrimaryKeyStock(headerDetailsDtoList2);
|
||||||
|
List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntityList = queryStockTocOutLog(idStr);
|
||||||
|
allTocofsSaleoutDetailedEntityList.addAll(tocofsSaleoutDetailedEntityList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (allTocofsSaleoutDetailedEntityList.size() > 0) {
|
||||||
|
return filterDataRowsAsPushOrFailedTran(allTocofsSaleoutDetailedEntityList, headerDetailsDtoList);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 逗号拼接字符串主键,作为批处理的一部分,方便下一步的批量查询操作
|
||||||
|
*
|
||||||
|
* @author liuyang
|
||||||
|
*/
|
||||||
|
private String commaConcatenatedPrimaryKeyStock(List<HeaderDetailsDto> headerDetailsDtoList2) throws Exception {
|
||||||
|
StringBuffer idStr = new StringBuffer();
|
||||||
|
if (headerDetailsDtoList2 != null && headerDetailsDtoList2.size() > 0) {
|
||||||
|
for (int i = 0; i < headerDetailsDtoList2.size(); i++) {
|
||||||
|
HeaderDetailsDto headerDetailsDto = headerDetailsDtoList2.get(i);
|
||||||
|
HeaderDto header = headerDetailsDto.getHeader();
|
||||||
|
List<DetailsDto> details = headerDetailsDto.getDetails();
|
||||||
|
for (int j = 0; j < details.size(); j++) {
|
||||||
|
DetailsDto detailsDto = details.get(j);
|
||||||
|
Assert.notNull(detailsDto.getId(), "O明细主键不能为空!");
|
||||||
|
Assert.state(!"".equals(detailsDto.getId()), "O明细主键不能为空!");
|
||||||
|
idStr.append(detailsDto.getId());
|
||||||
|
idStr.append(",");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (idStr.length() > 0) {
|
||||||
|
return idStr.substring(0, idStr.length());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批查询toc出库日志,查询的量由splitListByCount方法控制
|
||||||
|
*
|
||||||
|
* @author liuyang
|
||||||
|
*/
|
||||||
|
private List<TocofsSaleoutDetailedEntity> queryStockTocOutLog(String idStr) throws Exception {
|
||||||
|
List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntityList = null;
|
||||||
|
if (idStr != null && !"".equals(idStr.trim())) {
|
||||||
|
TocofsSaleoutDetailedEntity tocofsSaleoutDetailedEntity = new TocofsSaleoutDetailedEntity();
|
||||||
|
tocofsSaleoutDetailedEntity.setIds(idStr);
|
||||||
|
tocofsSaleoutDetailedEntityList = iTocofsSaleoutDetailedDao.query(tocofsSaleoutDetailedEntity);
|
||||||
|
} else {
|
||||||
|
logger.error("idStr为空,无法查询数据!");
|
||||||
|
}
|
||||||
|
return tocofsSaleoutDetailedEntityList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 筛选出未推送、或者失败的数据行
|
||||||
|
*
|
||||||
|
* @param allTocofsSaleoutDetailedEntityList 日志行状态
|
||||||
|
* @param headerDetailsDtoList 返回结果
|
||||||
|
* @author liuyang
|
||||||
|
*/
|
||||||
|
private List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> filterDataRowsAsPushOrFailedStock(List<TocofsSaleoutDetailedEntity> allTocofsSaleoutDetailedEntityList, List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList) throws Exception {
|
||||||
|
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> targetHeaderDetailsDtoList = new ArrayList<>();
|
||||||
|
if (allTocofsSaleoutDetailedEntityList != null && allTocofsSaleoutDetailedEntityList.size() > 0 && headerDetailsDtoList != null && headerDetailsDtoList.size() > 0) {
|
||||||
|
//字段Y(成功)或者为H(待处理)可以视为成功,完成了小段业务闭环的数据行
|
||||||
|
String succeseeY = "Y";
|
||||||
|
String succeseeH = "H";
|
||||||
|
for (int i = 0; i < headerDetailsDtoList.size(); i++) {
|
||||||
|
HeaderDetailsDto headerDetailsDto = headerDetailsDtoList.get(i);
|
||||||
|
HeaderDto header = headerDetailsDto.getHeader();
|
||||||
|
List<DetailsDto> details = headerDetailsDto.getDetails();
|
||||||
|
|
||||||
|
List<DetailsDto> targetDetails = new ArrayList<>();
|
||||||
|
for (int j = 0; j < details.size(); j++) {
|
||||||
|
DetailsDto detailsDto = details.get(j);
|
||||||
|
Boolean isSuccess = false;
|
||||||
|
String newstate = null;
|
||||||
|
for (int k = 0; k < allTocofsSaleoutDetailedEntityList.size(); k++) {
|
||||||
|
TocofsSaleoutDetailedEntity tocofsSaleoutDetailedEntity = allTocofsSaleoutDetailedEntityList.get(k);
|
||||||
|
if (tocofsSaleoutDetailedEntity.getId().equals(detailsDto.getId())) {
|
||||||
|
newstate = tocofsSaleoutDetailedEntity.getNewstate();
|
||||||
|
if (succeseeY.equals(newstate) || succeseeH.equals(newstate)) {
|
||||||
|
isSuccess = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!isSuccess) {
|
||||||
|
detailsDto.setNewState(newstate);
|
||||||
|
targetDetails.add(detailsDto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (targetDetails.size() > 0) {
|
||||||
|
//如果明细行中,还存在未推送或者失败的数据,则需要更新明细行
|
||||||
|
headerDetailsDto.setDetails(targetDetails);
|
||||||
|
targetHeaderDetailsDtoList.add(headerDetailsDto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return targetHeaderDetailsDtoList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 筛选出未推送、或者失败的数据行
|
||||||
|
*
|
||||||
|
* @param allTocofsSaleoutDetailedEntityList 日志行状态
|
||||||
|
* @param headerDetailsDtoList 返回结果
|
||||||
|
* @author liuyang
|
||||||
|
*/
|
||||||
|
private List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> filterDataRowsAsPushOrFailedTran(List<TocofsSaleoutDetailedEntity> allTocofsSaleoutDetailedEntityList, List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList) throws Exception {
|
||||||
|
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> targetHeaderDetailsDtoList = new ArrayList<>();
|
||||||
|
if (allTocofsSaleoutDetailedEntityList != null && allTocofsSaleoutDetailedEntityList.size() > 0 && headerDetailsDtoList != null && headerDetailsDtoList.size() > 0) {
|
||||||
|
//字段Y(成功)或者为H(待处理)可以视为成功,完成了小段业务闭环的数据行
|
||||||
|
String succeseeY = "Y";
|
||||||
|
String succeseeH = "H";
|
||||||
|
for (int i = 0; i < headerDetailsDtoList.size(); i++) {
|
||||||
|
HeaderDetailsDto headerDetailsDto = headerDetailsDtoList.get(i);
|
||||||
|
HeaderDto header = headerDetailsDto.getHeader();
|
||||||
|
List<DetailsDto> details = headerDetailsDto.getDetails();
|
||||||
|
|
||||||
|
List<DetailsDto> targetDetails = new ArrayList<>();
|
||||||
|
for (int j = 0; j < details.size(); j++) {
|
||||||
|
DetailsDto detailsDto = details.get(j);
|
||||||
|
|
||||||
|
Boolean isSuccess = false;
|
||||||
|
String newstate2 = null;
|
||||||
|
String newstate3 = null;
|
||||||
|
// TocofsSaleoutDetailedEntity targetTocofsSaleoutDetailedEntity = null;
|
||||||
|
for (int k = 0; k < allTocofsSaleoutDetailedEntityList.size(); k++) {
|
||||||
|
TocofsSaleoutDetailedEntity tocofsSaleoutDetailedEntity = allTocofsSaleoutDetailedEntityList.get(k);
|
||||||
|
if (tocofsSaleoutDetailedEntity.getId().equals(detailsDto.getId())) {
|
||||||
|
newstate2 = tocofsSaleoutDetailedEntity.getNewstate2();
|
||||||
|
newstate3 = tocofsSaleoutDetailedEntity.getNewstate3();
|
||||||
|
// targetTocofsSaleoutDetailedEntity = tocofsSaleoutDetailedEntity;
|
||||||
|
//验证交易成功(红)是否成功、(销售)交易成功(蓝)是否成功 两者如果都成功,则过滤掉,如果其中一个不能成功,则还是需要进行补推!
|
||||||
|
//验证红或蓝单据是否推送成功的代码,在implementTran中实现
|
||||||
|
if ((succeseeY.equals(newstate2) || succeseeH.equals(newstate2)) && (succeseeY.equals(newstate3) || succeseeH.equals(newstate3))) {
|
||||||
|
isSuccess = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!isSuccess) {
|
||||||
|
//拷贝推送状态参数,方便推送是进行判断
|
||||||
|
detailsDto.setNewState2(newstate2);
|
||||||
|
detailsDto.setNewState3(newstate3);
|
||||||
|
targetDetails.add(detailsDto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (targetDetails.size() > 0) {
|
||||||
|
//如果明细行中,还存在未推送或者失败的数据,则需要更新明细行
|
||||||
|
headerDetailsDto.setDetails(targetDetails);
|
||||||
|
targetHeaderDetailsDtoList.add(headerDetailsDto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return targetHeaderDetailsDtoList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -365,6 +583,15 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
* @param headerDetailsDtoList 数据行
|
* @param headerDetailsDtoList 数据行
|
||||||
*/
|
*/
|
||||||
private void batchInsert(List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList) throws Exception {
|
private void batchInsert(List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList) throws Exception {
|
||||||
|
if (headerDetailsDtoList != null) {
|
||||||
|
logger.error("需要保存或者更新到mysql底表的数量为:{}", headerDetailsDtoList.size());
|
||||||
|
}
|
||||||
|
// 测试对象字段更新
|
||||||
|
// headerDetailsDtoList.get(0).getHeader().setClientCode("LETS2");
|
||||||
|
// headerDetailsDtoList.get(0).getHeader().setInternalInstructionType("SALES22");
|
||||||
|
// headerDetailsDtoList.get(0).getDetails().get(0).setSkuName("22222");
|
||||||
|
// headerDetailsDtoList.get(0).getDetails().get(0).setIsGift("11111");
|
||||||
|
// headerDetailsDtoList.get(0).getDetails().get(0).setQuantityUM("33333");
|
||||||
if (headerDetailsDtoList != null && headerDetailsDtoList.size() > 0) {
|
if (headerDetailsDtoList != null && headerDetailsDtoList.size() > 0) {
|
||||||
try {
|
try {
|
||||||
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDto> headerDetailsDtoList1 = new ArrayList<>();
|
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDto> headerDetailsDtoList1 = new ArrayList<>();
|
||||||
|
@ -407,7 +634,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("TOC业务保存到Mysql底表失败!", e);
|
logger.error("TOC业务保存到Mysql底表失败!TocofsSaleoutEntity、TocofsSaleoutDetailedEntity保存失败", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -472,7 +699,9 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
* @author liuyang
|
* @author liuyang
|
||||||
*/
|
*/
|
||||||
private void implementStock(List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtos) throws Exception {
|
private void implementStock(List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtos) throws Exception {
|
||||||
|
if (headerDetailsDtos != null) {
|
||||||
logger.info("TOC销售库存业务:{}行需要进行数据转换", headerDetailsDtos.size());
|
logger.info("TOC销售库存业务:{}行需要进行数据转换", headerDetailsDtos.size());
|
||||||
|
}
|
||||||
if (headerDetailsDtos != null && headerDetailsDtos.size() > 0) {
|
if (headerDetailsDtos != null && headerDetailsDtos.size() > 0) {
|
||||||
try {
|
try {
|
||||||
// 查询基本档案
|
// 查询基本档案
|
||||||
|
@ -622,11 +851,28 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
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));
|
||||||
logger.info("销售订单编号:{} 销售公司:{}", soSaleResultRootDto.getParentvo().getVreceiptcode(), soSaleResultRootDto.getParentvo().getPk_corp());
|
String vreceiptcode = null;
|
||||||
|
String pk_corp = null;
|
||||||
|
String csaleid = null;
|
||||||
|
if (soSaleResultRootDto != null && soSaleResultRootDto.getParentvo() != null) {
|
||||||
|
vreceiptcode = soSaleResultRootDto.getParentvo().getVreceiptcode();
|
||||||
|
pk_corp = soSaleResultRootDto.getParentvo().getPk_corp();
|
||||||
|
csaleid = soSaleResultRootDto.getParentvo().getCsaleid();
|
||||||
|
}
|
||||||
|
logger.info("销售订单编号:{} 主键:{} 销售公司:{}", vreceiptcode, csaleid, pk_corp);
|
||||||
//记录成功
|
//记录成功
|
||||||
|
//日志推送的详情,两种方法,是推送U8C成功之后记录,还是整理推送完毕后再记录?
|
||||||
|
//护童项目之前是整体推送之前记录,后来抛出链接失效的异常,而且只有程序执行完毕后,才能体现结果,执行过程中无法发现结果
|
||||||
|
//所以还是需要等待U8C接口推送成功之后,马上发生信息的记录,时间下来这样足够稳定,同步速度上没有大的问题
|
||||||
|
updateSuccessOrFail1(oldValue, "Y", "success", vreceiptcode, csaleid);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("TOC业务转换成U8C对象过程中、或者单据推送到U8C出现异常!", e);
|
logger.error("TOC业务转换成U8C对象过程中、或者单据推送到U8C出现异常!", e);
|
||||||
//记录失败
|
//记录失败
|
||||||
|
String message = e.getMessage();
|
||||||
|
if (message == null) {
|
||||||
|
message = "未知错误";
|
||||||
|
}
|
||||||
|
updateSuccessOrFail1(oldValue, "N", message, null, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -703,6 +949,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
*/
|
*/
|
||||||
private List<SonDetailsDto> queryBasicArchivesStock(List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList) {
|
private List<SonDetailsDto> queryBasicArchivesStock(List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList) {
|
||||||
List<SonDetailsDto> sonDetailsDtoList = new ArrayList<>();
|
List<SonDetailsDto> sonDetailsDtoList = new ArrayList<>();
|
||||||
|
List<ErrorHeaderDetailsDtoDto> errorHeaderDetailsDtoDtoList = new ArrayList<>();
|
||||||
|
|
||||||
if (headerDetailsDtoList != null && headerDetailsDtoList.size() > 0) {
|
if (headerDetailsDtoList != null && headerDetailsDtoList.size() > 0) {
|
||||||
try {
|
try {
|
||||||
|
@ -713,7 +960,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
HeaderDetailsDto headerDetailsDto = headerDetailsDtoList.get(i);
|
HeaderDetailsDto headerDetailsDto = headerDetailsDtoList.get(i);
|
||||||
HeaderDto header = headerDetailsDto.getHeader();
|
HeaderDto header = headerDetailsDto.getHeader();
|
||||||
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.DetailsDto> details = headerDetailsDto.getDetails();
|
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.DetailsDto> details = headerDetailsDto.getDetails();
|
||||||
|
try {
|
||||||
//表头公司:通过名称匹配U8C公司
|
//表头公司:通过名称匹配U8C公司
|
||||||
// String corpName = "上海丽知品牌管理有限公司";
|
// String corpName = "上海丽知品牌管理有限公司";
|
||||||
String companyCode = header.getCompanyCode();
|
String companyCode = header.getCompanyCode();
|
||||||
|
@ -775,11 +1022,13 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
|
|
||||||
//存货管理档案,是发货公司的存货档案
|
//存货管理档案,是发货公司的存货档案
|
||||||
BdInvmandocEntity bdInvmandocEntity = cacheTocMapVo.getStringBdInvmandocEntityMap().get(detailsDto.getSkuCode() + bdCorpEntity.getPkCorp());
|
BdInvmandocEntity bdInvmandocEntity = cacheTocMapVo.getStringBdInvmandocEntityMap().get(detailsDto.getSkuCode() + bdCorpEntity.getPkCorp());
|
||||||
|
Assert.notNull(bdInvmandocEntity, "无法匹配到存货管理档案 货品sku:{} 公司:{}", detailsDto.getSkuCode(), bdCorpEntity.getPkCorp());
|
||||||
//存货基本档案
|
//存货基本档案
|
||||||
BdInvbasdocEntity bdInvbasdocEntity = cacheTocMapVo.getStringBdInvbasdocEntityMap().get(bdInvmandocEntity.getPkInvmandoc() + bdCorpEntity.getPkCorp());
|
BdInvbasdocEntity bdInvbasdocEntity = cacheTocMapVo.getStringBdInvbasdocEntityMap().get(bdInvmandocEntity.getPkInvmandoc() + bdCorpEntity.getPkCorp());
|
||||||
|
Assert.notNull(bdInvbasdocEntity, "无法匹配到存货基本档案 存货管理主键:{} 公司:{}", bdInvmandocEntity.getPkInvmandoc(), bdCorpEntity.getPkCorp());
|
||||||
//存货税率
|
//存货税率
|
||||||
BdTaxitemsEntity bdTaxitemsEntity = cacheTocMapVo.getStringBdTaxitemsEntityMap().get(bdInvmandocEntity.getInvcode());
|
BdTaxitemsEntity bdTaxitemsEntity = cacheTocMapVo.getStringBdTaxitemsEntityMap().get(bdInvmandocEntity.getInvcode());
|
||||||
|
Assert.notNull(bdTaxitemsEntity, "无法匹配到存货税率 存货编码:{}", bdInvmandocEntity.getInvcode());
|
||||||
|
|
||||||
//2024年8月6日 10:16:22 通过O出库单的表头,查询得出U8C档案,放在表体的原因是方便分组汇总
|
//2024年8月6日 10:16:22 通过O出库单的表头,查询得出U8C档案,放在表体的原因是方便分组汇总
|
||||||
//下一个步骤的分组汇总,是通过表体明细完成的
|
//下一个步骤的分组汇总,是通过表体明细完成的
|
||||||
|
@ -801,19 +1050,38 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
sonDetailsDto.setBdInvbasdocEntity(bdInvbasdocEntity);
|
sonDetailsDto.setBdInvbasdocEntity(bdInvbasdocEntity);
|
||||||
sonDetailsDto.setBdTaxitemsEntity(bdTaxitemsEntity);
|
sonDetailsDto.setBdTaxitemsEntity(bdTaxitemsEntity);
|
||||||
|
|
||||||
|
|
||||||
BeanUtil.copyPropertiesV2(detailsDto, sonDetailsDto);
|
BeanUtil.copyPropertiesV2(detailsDto, sonDetailsDto);
|
||||||
sonDetailsDtoList.add(sonDetailsDto);
|
sonDetailsDtoList.add(sonDetailsDto);
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("档案转换抛出异常", e);
|
||||||
|
String message = e.getMessage();
|
||||||
|
if (message == null) {
|
||||||
|
message = "未知错误";
|
||||||
|
}
|
||||||
|
//失败
|
||||||
|
ErrorHeaderDetailsDtoDto errorHeaderDetailsDtoDto = new ErrorHeaderDetailsDtoDto();
|
||||||
|
errorHeaderDetailsDtoDto.setNewPushDate(getNewDateStr());
|
||||||
|
errorHeaderDetailsDtoDto.setNewTransmitInfo(message);
|
||||||
|
errorHeaderDetailsDtoDto.setNewstate("N");
|
||||||
|
errorHeaderDetailsDtoDto.setHeader(header);
|
||||||
|
errorHeaderDetailsDtoDto.setDetails(details);
|
||||||
|
errorHeaderDetailsDtoDtoList.add(errorHeaderDetailsDtoDto);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//成功
|
//成功
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
//失败,这一块逻辑,前期稳定后,不需要太关注,主要是一些基础档案的查询生成Map
|
||||||
logger.error("OFS销售出库单关联查询U8C档案失败", e);
|
logger.error("OFS销售出库单关联查询U8C档案失败", e);
|
||||||
//失败
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.info("queryBasicArchives方法headerDetailsDtoList.size为0");
|
logger.info("queryBasicArchives方法headerDetailsDtoList.size为0");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//批量把错误写入到日志信息表
|
||||||
|
if (errorHeaderDetailsDtoDtoList.size() > 0) {
|
||||||
|
updateFailOrSuccessTocofsSaleoutDetailedArchiveInquiry(errorHeaderDetailsDtoDtoList);
|
||||||
|
}
|
||||||
return sonDetailsDtoList;
|
return sonDetailsDtoList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -860,10 +1128,20 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
/**
|
/**
|
||||||
* 分组汇总:公司+店铺+仓库+SKU+出库类型,数量合并相加
|
* 分组汇总:公司+店铺+仓库+SKU+出库类型,数量合并相加
|
||||||
*
|
*
|
||||||
|
* @param sonDetailsDtoList 整理好的数据
|
||||||
|
* filterType 0或者其他、不过滤,1 过滤交易成功红、2过滤交易成功蓝
|
||||||
* @author liuyang
|
* @author liuyang
|
||||||
*/
|
*/
|
||||||
private Map<String, List<SonDetailsDto>> groupSummaryStock(List<SonDetailsDto> sonDetailsDtoList) {
|
private Map<String, List<SonDetailsDto>> groupSummaryStock(List<SonDetailsDto> sonDetailsDtoList) {
|
||||||
if (sonDetailsDtoList != null && sonDetailsDtoList.size() > 0) {
|
if (sonDetailsDtoList != null && sonDetailsDtoList.size() > 0) {
|
||||||
|
// switch (filterType) {
|
||||||
|
// case "1":
|
||||||
|
// sonDetailsDtoList = sonDetailsDtoList.stream().filter(sonDetailsDto -> "Y".equals(sonDetailsDto.getNewState2())).collect(Collectors.toList());
|
||||||
|
// break;
|
||||||
|
// case "2":
|
||||||
|
// sonDetailsDtoList = sonDetailsDtoList.stream().filter(sonDetailsDto -> "Y".equals(sonDetailsDto.getNewState3())).collect(Collectors.toList());
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
for (int i = 0; i < sonDetailsDtoList.size(); i++) {
|
for (int i = 0; i < sonDetailsDtoList.size(); i++) {
|
||||||
SonDetailsDto sonDetailsDto = sonDetailsDtoList.get(i);
|
SonDetailsDto sonDetailsDto = sonDetailsDtoList.get(i);
|
||||||
//2024年8月6日 10:35:25表头对象用于带出表头相关的分组汇总信息
|
//2024年8月6日 10:35:25表头对象用于带出表头相关的分组汇总信息
|
||||||
|
@ -1154,8 +1432,11 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
try {
|
try {
|
||||||
//查询基本档案
|
//查询基本档案
|
||||||
List<SonDetailsDto> sonDetailsDtoList = queryBasicArchivesStock(headerDetailsDtos);
|
List<SonDetailsDto> sonDetailsDtoList = queryBasicArchivesStock(headerDetailsDtos);
|
||||||
//分组汇总
|
//分组汇总:红蓝
|
||||||
Map<String, List<SonDetailsDto>> summaryDimensionMap = groupSummaryStock(sonDetailsDtoList);
|
Map<String, List<SonDetailsDto>> summaryDimensionMap = groupSummaryStock(sonDetailsDtoList);
|
||||||
|
//分组汇总:蓝
|
||||||
|
// Map<String, List<SonDetailsDto>> summaryDimensionMap2 = groupSummaryStock(sonDetailsDtoList, "2");
|
||||||
|
|
||||||
//TOC业务流程-TOC冲回发出商品
|
//TOC业务流程-TOC冲回发出商品
|
||||||
BdBusitypeEntity bdBusitypeEntity = u8cOperationFlowV2();
|
BdBusitypeEntity bdBusitypeEntity = u8cOperationFlowV2();
|
||||||
//TOC业务流程-TOC确认收入
|
//TOC业务流程-TOC确认收入
|
||||||
|
@ -1163,7 +1444,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
//查询销售收发类别
|
//查询销售收发类别
|
||||||
BdRdclEntity bdRdclEntity = rdclUtil.queryRdClObject("202");
|
BdRdclEntity bdRdclEntity = rdclUtil.queryRdClObject("202");
|
||||||
|
|
||||||
if (bdBusitypeEntity != null && bdBusitypeEntity2 != null && summaryDimensionMap != null) {
|
if (bdBusitypeEntity != null && summaryDimensionMap != null) {
|
||||||
Iterator<Map.Entry<String, List<SonDetailsDto>>> iterator = summaryDimensionMap.entrySet().iterator();
|
Iterator<Map.Entry<String, List<SonDetailsDto>>> iterator = summaryDimensionMap.entrySet().iterator();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
Map.Entry<String, List<SonDetailsDto>> entry = iterator.next();
|
Map.Entry<String, List<SonDetailsDto>> entry = iterator.next();
|
||||||
|
@ -1182,6 +1463,8 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
BdCubasdocEntity bdCubasdocEntity = oldValue.get(0).getBdCubasdocEntity();//客商基本档案
|
BdCubasdocEntity bdCubasdocEntity = oldValue.get(0).getBdCubasdocEntity();//客商基本档案
|
||||||
BdDefdocEntity platformArchives = oldValue.get(0).getPlatformArchives();//U8C平台档案
|
BdDefdocEntity platformArchives = oldValue.get(0).getPlatformArchives();//U8C平台档案
|
||||||
BdDefdocEntity shopArchives = oldValue.get(0).getShopArchives();//U8C店铺档案
|
BdDefdocEntity shopArchives = oldValue.get(0).getShopArchives();//U8C店铺档案
|
||||||
|
String newState2 = oldValue.get(0).getNewState2();//交易成功-红 是否成功
|
||||||
|
String newState3 = oldValue.get(0).getNewState3();//交易成功-蓝 是否成功
|
||||||
SonDetailsDto sonDetailsDto = groupMergeDetailedRows(oldValue);//把汇总好的出库单明细行合并成一行
|
SonDetailsDto sonDetailsDto = groupMergeDetailedRows(oldValue);//把汇总好的出库单明细行合并成一行
|
||||||
// BdInvmandocEntity bdInvmandocEntity = queryInventoryMan(sonDetailsDto, bdCalbodyEntity.getPkCorp());
|
// BdInvmandocEntity bdInvmandocEntity = queryInventoryMan(sonDetailsDto, bdCalbodyEntity.getPkCorp());
|
||||||
BdInvmandocEntity bdInvmandocEntity = sonDetailsDto.getBdInvmandocEntity();//存货管理档案:取发货公司的存货管理档案
|
BdInvmandocEntity bdInvmandocEntity = sonDetailsDto.getBdInvmandocEntity();//存货管理档案:取发货公司的存货管理档案
|
||||||
|
@ -1190,11 +1473,18 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
// BdTaxitemsEntity bdTaxitemsEntity1 = queryBdTaxitems(bdInvbasdocEntity.getInvcode());
|
// BdTaxitemsEntity bdTaxitemsEntity1 = queryBdTaxitems(bdInvbasdocEntity.getInvcode());
|
||||||
BdTaxitemsEntity bdTaxitemsEntity1 = sonDetailsDto.getBdTaxitemsEntity();//根据存货基础档案编码,查询当前存货的税率
|
BdTaxitemsEntity bdTaxitemsEntity1 = sonDetailsDto.getBdTaxitemsEntity();//根据存货基础档案编码,查询当前存货的税率
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 先要确保红字销售订单生成后再生成蓝字销售订单,否则很有可能出现库存不足的问题,所以才共用了同一个summaryDimensionMap,
|
||||||
|
* 这样导致的问题是不好独立判断newState2、newState3的状态,独立判断这个状态有利于防止单据重新推送
|
||||||
|
*/
|
||||||
logger.info("开始第一阶段:负数销售订单->(自动生成) 负数销售出库单");
|
logger.info("开始第一阶段:负数销售订单->(自动生成) 负数销售出库单");
|
||||||
Boolean isOneSuccess = false;
|
Boolean isOneSuccess = false;
|
||||||
try {
|
try {
|
||||||
|
//如果这个汇总集合,已经全部推送成功,那么就不需要推送红字销售订单,把isOneSuccess标识修改为true即可
|
||||||
|
if (!"Y".equals(newState2)) {
|
||||||
//验证数据完整性
|
//验证数据完整性
|
||||||
// checkArchives(oldValue.get(0));
|
// checkArchives(oldValue.get(0));
|
||||||
|
checkAllFail(oldValue, newState2, "1");
|
||||||
//取交易成功时间,生成业务日期
|
//取交易成功时间,生成业务日期
|
||||||
String generateBusinessDate = createGenerateBusinessDateTran(header);
|
String generateBusinessDate = createGenerateBusinessDateTran(header);
|
||||||
|
|
||||||
|
@ -1301,17 +1591,29 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
logger.info("第一阶段:负数销售订单->(自动生成) 负数销售出库单抛出成功,销售订单编号:{} 销售订单主键:{} 销售公司:{}", vreceiptcode, csaleid, pk_corp);
|
logger.info("第一阶段:负数销售订单->(自动生成) 负数销售出库单抛出成功,销售订单编号:{} 销售订单主键:{} 销售公司:{}", vreceiptcode, csaleid, pk_corp);
|
||||||
isOneSuccess = true;
|
isOneSuccess = true;
|
||||||
//第一阶段记录成功
|
//第一阶段记录成功!
|
||||||
|
updateSuccessOrFail2(oldValue, "Y", "success", vreceiptcode, csaleid);
|
||||||
|
} else {
|
||||||
|
isOneSuccess = true;
|
||||||
|
logger.info("交易成功-红 业务日期:{} 汇总维度:{} 已经推送成功,不需要重新推送", header.getTradeSuccessAt(), keyGroup);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("第一阶段:负数销售订单->(自动生成) 负数销售出库单抛出异常", e);
|
logger.error("第一阶段:负数销售订单->(自动生成) 负数销售出库单抛出异常", e);
|
||||||
//第一阶段记录失败
|
//第一阶段记录失败!
|
||||||
|
String message = e.getMessage();
|
||||||
|
if (message == null) {
|
||||||
|
message = "未知异常";
|
||||||
|
}
|
||||||
|
updateSuccessOrFail2(oldValue, "N", message, null, null);
|
||||||
}
|
}
|
||||||
logger.info("结束第一阶段:负数销售订单->(自动生成) 负数销售出库单");
|
logger.info("结束第一阶段:负数销售订单->(自动生成) 负数销售出库单");
|
||||||
|
|
||||||
if (isOneSuccess) {
|
if (isOneSuccess && !"Y".equals(newState3)) {
|
||||||
//2024年9月4日 14:30:31 第一阶段推送成功,才能执行第二阶段,否则不能执行以下代码
|
//2024年9月4日 14:30:31 第一阶段推送成功,才能执行第二阶段,否则不能执行以下代码
|
||||||
logger.info("开始第二阶段:销售订单 ->(自动生成) 销售出库单 ->(自动生成) 销售发票");
|
logger.info("开始第二阶段:销售订单 ->(自动生成) 销售出库单 ->(自动生成) 销售发票");
|
||||||
try {
|
try {
|
||||||
|
//验证数据完整性
|
||||||
|
checkAllFail(oldValue, newState3, "2");
|
||||||
//取交易成功时间,生成业务日期
|
//取交易成功时间,生成业务日期
|
||||||
String generateBusinessDate = createGenerateBusinessDateTran(header);
|
String generateBusinessDate = createGenerateBusinessDateTran(header);
|
||||||
|
|
||||||
|
@ -1416,11 +1718,19 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
logger.info("第二阶段:负数销售订单->(自动生成) 负数销售出库单抛出成功,销售订单编号:{} 销售订单主键:{} 销售公司:{}", vreceiptcode, csaleid, pk_corp);
|
logger.info("第二阶段:负数销售订单->(自动生成) 负数销售出库单抛出成功,销售订单编号:{} 销售订单主键:{} 销售公司:{}", vreceiptcode, csaleid, pk_corp);
|
||||||
//第二阶段记录成功
|
//第二阶段记录成功
|
||||||
|
updateSuccessOrFail3(oldValue, "Y", "success", vreceiptcode, csaleid);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("第二阶段:销售订单 ->(自动生成) 销售出库单 ->(自动生成) 销售发票失败", e);
|
logger.error("第二阶段:销售订单 ->(自动生成) 销售出库单 ->(自动生成) 销售发票失败", e);
|
||||||
|
String message = e.getMessage();
|
||||||
|
if (message == null) {
|
||||||
|
message = "未知错误";
|
||||||
|
}
|
||||||
//第二阶段记录失败
|
//第二阶段记录失败
|
||||||
|
updateSuccessOrFail3(oldValue, "N", message, null, null);
|
||||||
}
|
}
|
||||||
logger.info("结束第二阶段:销售订单 ->(自动生成) 销售出库单 ->(自动生成) 销售发票");
|
logger.info("结束第二阶段:销售订单 ->(自动生成) 销售出库单 ->(自动生成) 销售发票");
|
||||||
|
} else {
|
||||||
|
logger.info("交易成功-蓝 业务日期:{} 汇总维度:{}", header.getTradeSuccessAt(), keyGroup);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -1433,4 +1743,385 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量修改成功、或者失败,适合档案查询的部分
|
||||||
|
*
|
||||||
|
* @author liuyang
|
||||||
|
*/
|
||||||
|
private void updateFailOrSuccessTocofsSaleoutDetailedArchiveInquiry(List<ErrorHeaderDetailsDtoDto> errorHeaderDetailsDtoDtoList) {
|
||||||
|
|
||||||
|
Thread thread = new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
if (errorHeaderDetailsDtoDtoList != null && errorHeaderDetailsDtoDtoList.size() > 0) {
|
||||||
|
List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntityList = new ArrayList<>();
|
||||||
|
for (int i = 0; i < errorHeaderDetailsDtoDtoList.size(); i++) {
|
||||||
|
ErrorHeaderDetailsDtoDto errorHeaderDetailsDtoDto = errorHeaderDetailsDtoDtoList.get(i);
|
||||||
|
HeaderDto header = errorHeaderDetailsDtoDto.getHeader();
|
||||||
|
List<DetailsDto> details = errorHeaderDetailsDtoDto.getDetails();
|
||||||
|
String newstate = errorHeaderDetailsDtoDto.getNewstate();
|
||||||
|
String newPushDate = errorHeaderDetailsDtoDto.getNewPushDate();
|
||||||
|
String newTransmitInfo = errorHeaderDetailsDtoDto.getNewTransmitInfo();
|
||||||
|
|
||||||
|
//如果报错内容太长了,则仅保留500个长度
|
||||||
|
if (newTransmitInfo != null && !"".equals(newTransmitInfo.trim()) && newTransmitInfo.length() >= 400) {
|
||||||
|
newTransmitInfo = newTransmitInfo.substring(0, 400);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int j = 0; j < details.size(); j++) {
|
||||||
|
DetailsDto detailsDto = details.get(j);
|
||||||
|
|
||||||
|
TocofsSaleoutDetailedEntity tocofsSaleoutDetailedEntity = new TocofsSaleoutDetailedEntity();
|
||||||
|
tocofsSaleoutDetailedEntity.setId(detailsDto.getId());
|
||||||
|
tocofsSaleoutDetailedEntity.setNewpushdate(newPushDate);
|
||||||
|
tocofsSaleoutDetailedEntity.setNewtransmitinfo(newTransmitInfo);
|
||||||
|
tocofsSaleoutDetailedEntity.setNewstate(newstate);
|
||||||
|
tocofsSaleoutDetailedEntityList.add(tocofsSaleoutDetailedEntity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//以50行为一个批次更新状态
|
||||||
|
if (tocofsSaleoutDetailedEntityList.size() > 0) {
|
||||||
|
List<List<TocofsSaleoutDetailedEntity>> splitListByCount = SplitListByCountUtil.splitListByCount(tocofsSaleoutDetailedEntityList, 50);
|
||||||
|
for (int i = 0; i < splitListByCount.size(); i++) {
|
||||||
|
List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntityList1 = splitListByCount.get(i);
|
||||||
|
iTocofsSaleoutDetailedDao.entityInsertOrUpdateBatchStock1(tocofsSaleoutDetailedEntityList1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("填充出库明细日志抛出异常", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
thread.start();
|
||||||
|
try {
|
||||||
|
thread.join();
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("updateFailOrSuccessTocofsSaleoutDetailedArchiveInquiry方法现场抛出异常", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理调用U8C接口,抛出的异常,或者调用成功的记录
|
||||||
|
*
|
||||||
|
* @author liuyang
|
||||||
|
*/
|
||||||
|
private void updateSuccessOrFail1(List<SonDetailsDto> sonDetailsDtoList, String newstate, String newTransmitInfo, String newsystemnumber, String newsystemprimary) {
|
||||||
|
if (newTransmitInfo != null && !"".equals(newTransmitInfo.trim()) && newTransmitInfo.length() >= 400) {
|
||||||
|
newTransmitInfo = newTransmitInfo.substring(0, 400);
|
||||||
|
}
|
||||||
|
|
||||||
|
String finalNewTransmitInfo = newTransmitInfo;
|
||||||
|
Thread thread = new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
String successY = "Y";
|
||||||
|
if (sonDetailsDtoList != null && sonDetailsDtoList.size() > 0) {
|
||||||
|
List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntityList = new ArrayList<>();
|
||||||
|
for (int i = 0; i < sonDetailsDtoList.size(); i++) {
|
||||||
|
SonDetailsDto sonDetailsDto = sonDetailsDtoList.get(i);
|
||||||
|
TocofsSaleoutDetailedEntity tocofsSaleoutDetailedEntity = new TocofsSaleoutDetailedEntity();
|
||||||
|
tocofsSaleoutDetailedEntity.setId(sonDetailsDto.getId());
|
||||||
|
tocofsSaleoutDetailedEntity.setNewpushdate(getNewDateStr());
|
||||||
|
tocofsSaleoutDetailedEntity.setNewtransmitinfo(finalNewTransmitInfo);
|
||||||
|
tocofsSaleoutDetailedEntity.setNewstate(newstate);
|
||||||
|
if (successY.equals(newstate)) {
|
||||||
|
tocofsSaleoutDetailedEntity.setNewsystemnumber(newsystemnumber);
|
||||||
|
tocofsSaleoutDetailedEntity.setNewsystemprimary(newsystemprimary);
|
||||||
|
}
|
||||||
|
tocofsSaleoutDetailedEntityList.add(tocofsSaleoutDetailedEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
//以50行为一个批次,推送到Mysql
|
||||||
|
if (tocofsSaleoutDetailedEntityList.size() > 0) {
|
||||||
|
List<List<TocofsSaleoutDetailedEntity>> splitListByCount = SplitListByCountUtil.splitListByCount(tocofsSaleoutDetailedEntityList, 50);
|
||||||
|
for (int i = 0; i < splitListByCount.size(); i++) {
|
||||||
|
List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntityList1 = splitListByCount.get(i);
|
||||||
|
iTocofsSaleoutDetailedDao.entityInsertOrUpdateBatchStock2(tocofsSaleoutDetailedEntityList1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("处理调用U8C接口,抛出的异常,或者调用成功的记录对应的方法抛出异常", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
thread.start();
|
||||||
|
try {
|
||||||
|
thread.join();
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("updateSuccessOrFail1方法现场抛出异常", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理调用U8C接口,抛出的异常,或者调用成功的记录
|
||||||
|
*
|
||||||
|
* @author liuyang
|
||||||
|
*/
|
||||||
|
private void updateSuccessOrFail2(List<SonDetailsDto> sonDetailsDtoList, String newstate, String newTransmitInfo, String newsystemnumber, String newsystemprimary) {
|
||||||
|
if (newTransmitInfo != null && !"".equals(newTransmitInfo.trim()) && newTransmitInfo.length() >= 400) {
|
||||||
|
newTransmitInfo = newTransmitInfo.substring(0, 400);
|
||||||
|
}
|
||||||
|
|
||||||
|
String finalNewTransmitInfo = newTransmitInfo;
|
||||||
|
Thread thread = new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
String successY = "Y";
|
||||||
|
if (sonDetailsDtoList != null && sonDetailsDtoList.size() > 0) {
|
||||||
|
List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntityList = new ArrayList<>();
|
||||||
|
for (int i = 0; i < sonDetailsDtoList.size(); i++) {
|
||||||
|
SonDetailsDto sonDetailsDto = sonDetailsDtoList.get(i);
|
||||||
|
TocofsSaleoutDetailedEntity tocofsSaleoutDetailedEntity = new TocofsSaleoutDetailedEntity();
|
||||||
|
tocofsSaleoutDetailedEntity.setId(sonDetailsDto.getId());
|
||||||
|
tocofsSaleoutDetailedEntity.setDef1(getNewDateStr());
|
||||||
|
tocofsSaleoutDetailedEntity.setDef2(finalNewTransmitInfo);
|
||||||
|
tocofsSaleoutDetailedEntity.setNewstate2(newstate);
|
||||||
|
if (successY.equals(newstate)) {
|
||||||
|
tocofsSaleoutDetailedEntity.setNewsystemnumber2(newsystemnumber);
|
||||||
|
tocofsSaleoutDetailedEntity.setNewsystemprimary2(newsystemprimary);
|
||||||
|
}
|
||||||
|
tocofsSaleoutDetailedEntityList.add(tocofsSaleoutDetailedEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
//以50行为一个批次,推送到Mysql
|
||||||
|
if (tocofsSaleoutDetailedEntityList.size() > 0) {
|
||||||
|
List<List<TocofsSaleoutDetailedEntity>> splitListByCount = SplitListByCountUtil.splitListByCount(tocofsSaleoutDetailedEntityList, 50);
|
||||||
|
for (int i = 0; i < splitListByCount.size(); i++) {
|
||||||
|
List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntityList1 = splitListByCount.get(i);
|
||||||
|
iTocofsSaleoutDetailedDao.entityInsertOrUpdateBatchStock3(tocofsSaleoutDetailedEntityList1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("处理调用U8C接口,抛出的异常,或者调用成功的记录对应的方法抛出异常", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
thread.start();
|
||||||
|
try {
|
||||||
|
thread.join();
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("updateSuccessOrFail2方法抛出异常", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理调用U8C接口,抛出的异常,或者调用成功的记录
|
||||||
|
*
|
||||||
|
* @author liuyang
|
||||||
|
*/
|
||||||
|
private void updateSuccessOrFail3(List<SonDetailsDto> sonDetailsDtoList, String newstate, String newTransmitInfo, String newsystemnumber, String newsystemprimary) {
|
||||||
|
if (newTransmitInfo != null && !"".equals(newTransmitInfo.trim()) && newTransmitInfo.length() >= 400) {
|
||||||
|
newTransmitInfo = newTransmitInfo.substring(0, 400);
|
||||||
|
}
|
||||||
|
|
||||||
|
String finalNewTransmitInfo = newTransmitInfo;
|
||||||
|
Thread thread = new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
String successY = "Y";
|
||||||
|
if (sonDetailsDtoList != null && sonDetailsDtoList.size() > 0) {
|
||||||
|
List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntityList = new ArrayList<>();
|
||||||
|
for (int i = 0; i < sonDetailsDtoList.size(); i++) {
|
||||||
|
SonDetailsDto sonDetailsDto = sonDetailsDtoList.get(i);
|
||||||
|
TocofsSaleoutDetailedEntity tocofsSaleoutDetailedEntity = new TocofsSaleoutDetailedEntity();
|
||||||
|
tocofsSaleoutDetailedEntity.setId(sonDetailsDto.getId());
|
||||||
|
tocofsSaleoutDetailedEntity.setDef3(getNewDateStr());
|
||||||
|
tocofsSaleoutDetailedEntity.setDef4(finalNewTransmitInfo);
|
||||||
|
tocofsSaleoutDetailedEntity.setNewstate3(newstate);
|
||||||
|
if (successY.equals(newstate)) {
|
||||||
|
tocofsSaleoutDetailedEntity.setNewsystemnumber3(newsystemnumber);
|
||||||
|
tocofsSaleoutDetailedEntity.setNewsystemprimary3(newsystemprimary);
|
||||||
|
}
|
||||||
|
tocofsSaleoutDetailedEntityList.add(tocofsSaleoutDetailedEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
//以50行为一个批次,推送到Mysql
|
||||||
|
if (tocofsSaleoutDetailedEntityList.size() > 0) {
|
||||||
|
List<List<TocofsSaleoutDetailedEntity>> splitListByCount = SplitListByCountUtil.splitListByCount(tocofsSaleoutDetailedEntityList, 50);
|
||||||
|
for (int i = 0; i < splitListByCount.size(); i++) {
|
||||||
|
List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntityList1 = splitListByCount.get(i);
|
||||||
|
iTocofsSaleoutDetailedDao.entityInsertOrUpdateBatchStock4(tocofsSaleoutDetailedEntityList1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("updateSuccessOrFail3:处理调用U8C接口,抛出的异常,或者调用成功的记录对应的方法抛出异常", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
thread.start();
|
||||||
|
try {
|
||||||
|
thread.join();
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("updateSuccessOrFail3方法抛出异常", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成当前日期
|
||||||
|
*
|
||||||
|
* @author liuyang
|
||||||
|
*/
|
||||||
|
private String getNewDateStr() {
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
|
return now.format(formatter);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否全部失败、或者全部成功
|
||||||
|
*
|
||||||
|
* @author liuyang
|
||||||
|
*/
|
||||||
|
private void checkAllFail(List<SonDetailsDto> oldValue, String newstate, String type) {
|
||||||
|
if (oldValue != null && oldValue.size() > 0) {
|
||||||
|
if (newstate == null || "".equals(newstate)) {
|
||||||
|
newstate = "N";
|
||||||
|
}
|
||||||
|
for (int i = 0; i < oldValue.size(); i++) {
|
||||||
|
SonDetailsDto sonDetailsDto = oldValue.get(i);
|
||||||
|
String newstate2 = sonDetailsDto.getNewState2();
|
||||||
|
String newState3 = sonDetailsDto.getNewState3();
|
||||||
|
if (newstate2 == null) {
|
||||||
|
newstate2 = "N";
|
||||||
|
}
|
||||||
|
if (newState3 == null) {
|
||||||
|
newState3 = "N";
|
||||||
|
}
|
||||||
|
if (type.equals("1")) {//红
|
||||||
|
if (!newstate2.equals(newstate)) {
|
||||||
|
Assert.state(false, "业务逻辑错误,标识为:{} 出库明细主键为:{}的数据行存在异常!", newstate2, sonDetailsDto.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (type.equals("2")) {//蓝
|
||||||
|
if (!newState3.equals(newstate)) {
|
||||||
|
Assert.state(false, "业务逻辑错误,标识为:{} 出库明细主键为:{}的数据行存在异常!", newState3, sonDetailsDto.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算时间间隔
|
||||||
|
*
|
||||||
|
* @author liuyang
|
||||||
|
*/
|
||||||
|
public String computingTime(String param) {
|
||||||
|
if (param != null && !"".equals(param)) {
|
||||||
|
String[] split = param.split("/");
|
||||||
|
if (!(split.length == 2)) {
|
||||||
|
Assert.state(false, "传递的日期格式不完整 格式参考:2024-04-01/2024-04-30");
|
||||||
|
}
|
||||||
|
|
||||||
|
LocalDate startDate = LocalDate.parse(split[0]);
|
||||||
|
LocalDate endDate = LocalDate.parse(split[1]);
|
||||||
|
|
||||||
|
List<String> stringArrayList = new ArrayList<>();
|
||||||
|
List<String> dateRange = getDateRange(startDate, endDate);
|
||||||
|
if (dateRange != null && dateRange.size() > 0) {
|
||||||
|
for (int i = 0; i < dateRange.size(); i++) {
|
||||||
|
String dateStr = dateRange.get(i);
|
||||||
|
StringBuffer stringBuffer = new StringBuffer();
|
||||||
|
stringBuffer.append(dateStr);
|
||||||
|
stringBuffer.append(" 00:00:00");
|
||||||
|
stringBuffer.append(",");
|
||||||
|
stringBuffer.append(dateStr);
|
||||||
|
stringBuffer.append(" 23:59:59");
|
||||||
|
stringArrayList.add(stringBuffer.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String collectDateStr = stringArrayList.stream().collect(Collectors.joining("*"));
|
||||||
|
logger.info("类型:time_frame 生成的日期范围:" + collectDateStr);
|
||||||
|
return collectDateStr;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<String> getDateRange(LocalDate startDate, LocalDate endDate) {
|
||||||
|
List<String> dateRange = new ArrayList<>();
|
||||||
|
LocalDate currentDate = startDate;
|
||||||
|
while (!currentDate.isAfter(endDate)) {
|
||||||
|
dateRange.add(currentDate.format(DateTimeFormatter.ISO_DATE));
|
||||||
|
currentDate = currentDate.plusDays(1);
|
||||||
|
}
|
||||||
|
return dateRange;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算全天时间段
|
||||||
|
*
|
||||||
|
* @author liuyang
|
||||||
|
*/
|
||||||
|
public List<StartAndEndVo> calculateCalculateEntireDayPeriod(String dateStr) {
|
||||||
|
List<StartAndEndVo> startAndEnd = new ArrayList<>();
|
||||||
|
|
||||||
|
String calculateYesterdayStr = null;
|
||||||
|
if (dateStr != null) {
|
||||||
|
calculateYesterdayStr = dateStr;
|
||||||
|
} else {
|
||||||
|
calculateYesterdayStr = calculateYesterdayDate();//拉取'昨天'的日期
|
||||||
|
}
|
||||||
|
logger.info("OFS销售出库单同步U8C销售订单,目标拉取时间:" + calculateYesterdayStr);
|
||||||
|
|
||||||
|
for (int i = 0; i <= 23; i++) {
|
||||||
|
String iStr = null;
|
||||||
|
if (i <= 9) {
|
||||||
|
iStr = "0" + i;
|
||||||
|
} else {
|
||||||
|
iStr = String.valueOf(i);
|
||||||
|
}
|
||||||
|
String startTime = calculateYesterdayStr + " " + iStr + ":00:00";
|
||||||
|
String endTime = calculateYesterdayStr + " " + iStr + ":59:59";
|
||||||
|
|
||||||
|
StartAndEndVo startAndEndVo = new StartAndEndVo();
|
||||||
|
startAndEndVo.setStart_time(startTime);
|
||||||
|
startAndEndVo.setEnd_time(endTime);
|
||||||
|
startAndEnd.add(startAndEndVo);
|
||||||
|
}
|
||||||
|
return startAndEnd;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算昨天的单据日期,基于定时器在凌晨5分执行的情况下
|
||||||
|
*
|
||||||
|
* @author liuyang
|
||||||
|
*/
|
||||||
|
public String calculateYesterdayDate() {
|
||||||
|
DateTime yesterdayDate = DateUtil.yesterday();
|
||||||
|
return DateUtil.format(yesterdayDate, "yyyy-MM-dd");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分割日期之后,再进行推送
|
||||||
|
*
|
||||||
|
* @author liuyang
|
||||||
|
*/
|
||||||
|
private void splitDateAndPush(String param) throws Exception {
|
||||||
|
Assert.notNull(param, "param不能为空!");
|
||||||
|
Assert.state(!"".equals(param), "param不能为空!");
|
||||||
|
|
||||||
|
if (param.contains("*")) {
|
||||||
|
String[] params = param.split("\\*");
|
||||||
|
if (params.length > 0) {
|
||||||
|
for (int i = 0; i < params.length; i++) {
|
||||||
|
String indexStr = params[i];
|
||||||
|
String[] split = indexStr.split(",");
|
||||||
|
startImplementStockByTime(split[0], split[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
String[] split = param.split(",");
|
||||||
|
startImplementStockByTime(split[0], split[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.hzya.frame.plugin.lets.u8cdto;
|
||||||
|
|
||||||
|
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.plugin.lets.u8cdto
|
||||||
|
* @Project:kangarooDataCenterV3
|
||||||
|
* @name:ErrorHeaderDetailsDtoDto
|
||||||
|
* @Date:2024/9/5 15:48
|
||||||
|
* @Filename:ErrorHeaderDetailsDtoDto
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ErrorHeaderDetailsDtoDto extends HeaderDetailsDto {
|
||||||
|
//(销售)推送时间
|
||||||
|
private String newPushDate;
|
||||||
|
//(销售)报错详情
|
||||||
|
private String newTransmitInfo;
|
||||||
|
//(销售)出库同步是否成功
|
||||||
|
private String newstate;
|
||||||
|
}
|
|
@ -1,13 +1,19 @@
|
||||||
package com.hzya.frame.plugin.lets.plugin.sales;
|
package com.hzya.frame.plugin.lets.plugin.sales;
|
||||||
|
|
||||||
import com.hzya.frame.WebappApplication;
|
import com.hzya.frame.WebappApplication;
|
||||||
|
import com.hzya.frame.plugin.lets.ofs.dao.ITocofsSaleoutDetailedDao;
|
||||||
|
import com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity;
|
||||||
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo;
|
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo;
|
||||||
|
import com.hzya.frame.plugin.lets.u8cdto.ErrorHeaderDetailsDtoDto;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.test.context.junit4.SpringRunner;
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -25,6 +31,9 @@ class SoSaleOutPluginInitializerToCTest {
|
||||||
@Autowired
|
@Autowired
|
||||||
private SoSaleOutPluginInitializerToC soSaleOutPluginInitializerToC;
|
private SoSaleOutPluginInitializerToC soSaleOutPluginInitializerToC;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ITocofsSaleoutDetailedDao iTocofsSaleoutDetailedDao;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void startImplement() throws Exception {
|
void startImplement() throws Exception {
|
||||||
// soSaleOutPluginInitializerToC.startImplement(null, null);
|
// soSaleOutPluginInitializerToC.startImplement(null, null);
|
||||||
|
@ -32,12 +41,39 @@ class SoSaleOutPluginInitializerToCTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
|
// QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
|
||||||
soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024081500000001");
|
// soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024081500000001");
|
||||||
// soSaleOutPluginInitializerToC.getOfsOrder(queryOfsSoSaleOutVo, 1L);
|
// soSaleOutPluginInitializerToC.getOfsOrder(queryOfsSoSaleOutVo, 1L);
|
||||||
|
|
||||||
// soSaleOutPluginInitializerToC.startImplement("2024-04-28 00:00:00", "2024-04-28 23:59:59");
|
// soSaleOutPluginInitializerToC.startImplement("2024-04-28 00:00:00", "2024-04-28 23:59:59");
|
||||||
|
|
||||||
|
// ErrorHeaderDetailsDtoDto errorHeaderDetailsDtoDto = new ErrorHeaderDetailsDtoDto();
|
||||||
|
// errorHeaderDetailsDtoDto.setNewPushDate(getNewDateStr());
|
||||||
|
// errorHeaderDetailsDtoDto.setNewTransmitInfo(message);
|
||||||
|
// errorHeaderDetailsDtoDto.setNewstate("N");
|
||||||
|
// errorHeaderDetailsDtoDto.setHeader(header);
|
||||||
|
// errorHeaderDetailsDtoDto.setDetails(details);
|
||||||
|
// errorHeaderDetailsDtoDto.
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// try {
|
||||||
|
// List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities = new ArrayList<>();
|
||||||
|
// TocofsSaleoutDetailedEntity tocofsSaleoutDetailedEntity = new TocofsSaleoutDetailedEntity();
|
||||||
|
// tocofsSaleoutDetailedEntity.setNewpushdate("2024-09-05 00:00:03");
|
||||||
|
// tocofsSaleoutDetailedEntity.setNewtransmitinfo("错误消息22");
|
||||||
|
// tocofsSaleoutDetailedEntity.setNewstate("Y");
|
||||||
|
// tocofsSaleoutDetailedEntity.setId("80822338");
|
||||||
|
// tocofsSaleoutDetailedEntities.add(tocofsSaleoutDetailedEntity);
|
||||||
|
// iTocofsSaleoutDetailedDao.entityInsertOrUpdateBatchStock1(tocofsSaleoutDetailedEntities);
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// e.printStackTrace();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// String aaa = "{\"barcode\":\"01031000084\",\"brand_name\":\"护童\",\"brand_no\":\"1\",\"cost_price\":\"0.00\",\"discount\":\"0.00\",\"from_mask\":\"0\",\"gift_type\":\"1\",\"good_prop1\":\"\",\"good_prop2\":\"\",\"good_prop3\":\"\",\"good_prop4\":\"\",\"good_prop5\":\"\",\"good_prop6\":\"\",\"goods_amount\":\"0.0000\",\"goods_count\":\"1.0000\",\"goods_id\":\"4662\",\"goods_name\":\"G501_椅套_奶油桃\",\"goods_no\":\"01031000084\",\"goods_type\":\"1\",\"is_package\":\"false\",\"market_price\":\"0.00\",\"paid\":\"0.00\",\"platform_id\":\"0\",\"position_details_list\":[{\"batch_no\":\"\",\"expire_date\":\"\",\"position_goods_count\":\"1.0000\",\"position_id\":\"-6\",\"position_no\":\"其它未上架\",\"rec_id\":\"644060\",\"stockout_detail_id\":\"830189\"}],\"prop1\":\"\",\"prop2\":\"\",\"prop3\":\"\",\"prop4\":\"\",\"prop5\":\"\",\"prop6\":\"\",\"rec_id\":\"830189\",\"refund_status\":\"0\",\"remark\":\"赠品策略编号:ZP24080204,规则名称:G501 奶油桃,原始单号:4032308235772095218\",\"sale_order_id\":\"1251671\",\"sell_price\":\"0.00\",\"share_amount\":\"0.00\",\"share_post_amount\":\"0.00\",\"share_price\":\"0.00\",\"spec_code\":\"\",\"spec_id\":\"4526\",\"spec_name\":\"G501_椅套_奶油桃\",\"spec_no\":\"01031000084\",\"src_oid\":\"AD202409050010\",\"src_order_detail_id\":\"1251671\",\"src_tid\":\"4032308235772095218\",\"stockout_id\":\"630492\",\"suite_no\":\"\",\"tax_rate\":\"0.00\",\"total_amount\":\"0.00\",\"weight\":\"0.0000\"}";
|
||||||
|
// System.out.println(aaa.length());
|
||||||
|
|
||||||
|
|
||||||
|
soSaleOutPluginInitializerToC.computingTime("2024-01-01/2024-01-25");
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -4,7 +4,6 @@ import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class DetailsDto {
|
public class DetailsDto {
|
||||||
|
|
||||||
private String id;
|
private String id;
|
||||||
private String clientCode;
|
private String clientCode;
|
||||||
private String companyCode;
|
private String companyCode;
|
||||||
|
@ -34,6 +33,20 @@ public class DetailsDto {
|
||||||
private String createdBy;
|
private String createdBy;
|
||||||
private String lastUpdated;
|
private String lastUpdated;
|
||||||
private String lastUpdatedBy;
|
private String lastUpdatedBy;
|
||||||
//表头对象
|
/**
|
||||||
|
* 额外参数:表头对象
|
||||||
|
*/
|
||||||
private HeaderDto headerDto;
|
private HeaderDto headerDto;
|
||||||
|
/**
|
||||||
|
* 额外参数:(销售)出库同步是否成功
|
||||||
|
*/
|
||||||
|
private String newState;
|
||||||
|
/**
|
||||||
|
* 额外参数:(销售)交易成功(红)是否成功
|
||||||
|
*/
|
||||||
|
private String newState2;
|
||||||
|
/**
|
||||||
|
* 额外参数:(销售)交易成功(蓝)是否成功
|
||||||
|
*/
|
||||||
|
private String newState3;
|
||||||
}
|
}
|
|
@ -1,5 +1,7 @@
|
||||||
package com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch;
|
package com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -8,25 +10,8 @@ import java.util.List;
|
||||||
* @author lzltool.com
|
* @author lzltool.com
|
||||||
* @website https://www.lzltool.com/JsonToJava
|
* @website https://www.lzltool.com/JsonToJava
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
public class HeaderDetailsDto {
|
public class HeaderDetailsDto {
|
||||||
|
|
||||||
private HeaderDto header;
|
private HeaderDto header;
|
||||||
private List<DetailsDto> details;
|
private List<DetailsDto> details;
|
||||||
|
|
||||||
public void setHeader(HeaderDto header) {
|
|
||||||
this.header = header;
|
|
||||||
}
|
|
||||||
|
|
||||||
public HeaderDto getHeader() {
|
|
||||||
return this.header;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDetails(List<DetailsDto> details) {
|
|
||||||
this.details = details;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<DetailsDto> getDetails() {
|
|
||||||
return this.details;
|
|
||||||
}
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue