feat(ofs): 新增批量插入接口并优化实体类

- 在 ITocofsSaleoutDao 和 ITocofsSaleoutDetailedDao 接口中新增了批量插入方法
- 在 TocofsSaleoutDetailedEntity 和 TocofsSaleoutEntity 类中添加了新字段
-优化了 TocofsSaleoutDetailedEntity 的 SQL 映射文件
This commit is contained in:
liuy 2024-12-25 13:55:09 +08:00
parent eb93b202bb
commit 8b6c665d4f
12 changed files with 563 additions and 206 deletions

View File

@ -38,4 +38,11 @@ public class ProfilesActiveConstant {
public static final String sourceSystem2 = "丽知商城"; public static final String sourceSystem2 = "丽知商城";
public static final String FILTER_COMPANY = "NMNS,YNS,HJ"; public static final String FILTER_COMPANY = "NMNS,YNS,HJ";
//0:o->中台
public static final String PUSH_SCENE_TYPE_0 = "0";
//1:中台->u8c
public static final String PUSH_SCENE_TYPE_1 = "1";
//2:o->中台->u8c
public static final String PUSH_SCENE_TYPE_2 = "2";
} }

View File

@ -14,10 +14,17 @@ import java.util.List;
public interface ITocofsSaleoutDao extends IBaseDao<TocofsSaleoutEntity, String> { public interface ITocofsSaleoutDao extends IBaseDao<TocofsSaleoutEntity, String> {
/** /**
* 批量查询或者更新 * 批量插入或者更新
* *
* @author liuyang * @author liuyang
*/ */
void entityInsertOrUpdateBatch(List<TocofsSaleoutEntity> tocofsSaleoutEntityList) throws Exception; void entityInsertOrUpdateBatch(List<TocofsSaleoutEntity> tocofsSaleoutEntityList) throws Exception;
/**
* 批量插入
*
* @author liuyang
*/
void entityInsertBatch(List<TocofsSaleoutEntity> tocofsSaleoutEntityList) throws Exception;
} }

View File

@ -19,6 +19,13 @@ public interface ITocofsSaleoutDetailedDao extends IBaseDao<TocofsSaleoutDetaile
*/ */
void entityInsertOrUpdateBatch(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception; void entityInsertOrUpdateBatch(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception;
/**
* 批量插入
*
* @author liuyang
*/
void entityInsertBatch(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception;
/** /**
* 更新出库状态的日志(适合档案转换部分的日志处理) * 更新出库状态的日志(适合档案转换部分的日志处理)
* *

View File

@ -18,5 +18,10 @@ public class TocofsSaleoutDaoImpl extends MybatisGenericDao<TocofsSaleoutEntity,
public void entityInsertOrUpdateBatch(List<TocofsSaleoutEntity> tocofsSaleoutEntityList) throws Exception { public void entityInsertOrUpdateBatch(List<TocofsSaleoutEntity> tocofsSaleoutEntityList) throws Exception {
insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsSaleoutDaoImpl.entityInsertOrUpdateBatch", tocofsSaleoutEntityList); insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsSaleoutDaoImpl.entityInsertOrUpdateBatch", tocofsSaleoutEntityList);
} }
@Override
public void entityInsertBatch(List<TocofsSaleoutEntity> tocofsSaleoutEntityList) throws Exception {
insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsSaleoutDaoImpl.entityInsertBatch", tocofsSaleoutEntityList);
}
} }

View File

@ -19,11 +19,16 @@ public class TocofsSaleoutDetailedDaoImpl extends MybatisGenericDao<TocofsSaleou
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 entityInsertBatch(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception {
insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsSaleoutDetailedDaoImpl.entityInsertBatch", tocofsSaleoutDetailedEntities);
}
@Override @Override
public void entityInsertOrUpdateBatchStock1(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception { public void entityInsertOrUpdateBatchStock1(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception {
insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsSaleoutDetailedDaoImpl.entityInsertOrUpdateBatchStock", tocofsSaleoutDetailedEntities); insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsSaleoutDetailedDaoImpl.entityInsertOrUpdateBatchStock", tocofsSaleoutDetailedEntities);
} }
@Override @Override
public void entityInsertOrUpdateBatchStock1V2(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception { public void entityInsertOrUpdateBatchStock1V2(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception {
insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsSaleoutDetailedDaoImpl.entityInsertOrUpdateBatchStockV2", tocofsSaleoutDetailedEntities); insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsSaleoutDetailedDaoImpl.entityInsertOrUpdateBatchStockV2", tocofsSaleoutDetailedEntities);

View File

@ -364,4 +364,26 @@ public class TocofsSaleoutDetailedEntity extends BaseEntity {
* 额外参数查询条件 * 额外参数查询条件
*/ */
private String ids; private String ids;
/**
* 12-24新增字段 sourceOrderStatus
*/
private String sourceorderstatus;
/**
* 查询条件出库日期-开始
*/
private String businessDateStart;
/**
* 查询条件出库日期-结束
*/
private String businessDateEnd;
/**
* 查询条件交易成功时间-开始
*/
private String successfultradedateStart;
/**
* 查询条件交易成功时间-结束
*/
private String successfultradedateEnd;
} }

View File

@ -51,6 +51,7 @@
<result property="businessdate" column="businessDate" jdbcType="VARCHAR"/> <result property="businessdate" column="businessDate" jdbcType="VARCHAR"/>
<result property="successfultradedate" column="successfulTradeDate" jdbcType="VARCHAR"/> <result property="successfultradedate" column="successfulTradeDate" jdbcType="VARCHAR"/>
<result property="businesstype" column="businessType" jdbcType="VARCHAR"/> <result property="businesstype" column="businessType" jdbcType="VARCHAR"/>
<result property="sourceorderstatus" column="sourceorderstatus" jdbcType="VARCHAR"/>
<result property="def1" column="def1" jdbcType="VARCHAR"/> <result property="def1" column="def1" jdbcType="VARCHAR"/>
<result property="def2" column="def2" jdbcType="VARCHAR"/> <result property="def2" column="def2" jdbcType="VARCHAR"/>
<result property="def3" column="def3" jdbcType="VARCHAR"/> <result property="def3" column="def3" jdbcType="VARCHAR"/>
@ -143,6 +144,7 @@
,businessDate ,businessDate
,successfulTradeDate ,successfulTradeDate
,businessType ,businessType
,sourceOrderStatus
,def1 ,def1
,def2 ,def2
,def3 ,def3
@ -184,6 +186,7 @@
,def39 ,def39
,def40 ,def40
</sql> </sql>
<!-- 查询 采用==查询 --> <!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-TocofsSaleoutDetailedEntity-result" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity"> <select id="entity_list_base" resultMap="get-TocofsSaleoutDetailedEntity-result" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity">
select select
@ -239,6 +242,9 @@
<if test="businessdate != null and businessdate != ''"> and businessDate = #{businessdate} </if> <if test="businessdate != null and businessdate != ''"> and businessDate = #{businessdate} </if>
<if test="successfultradedate != null and successfultradedate != ''"> and successfulTradeDate = #{successfultradedate} </if> <if test="successfultradedate != null and successfultradedate != ''"> and successfulTradeDate = #{successfultradedate} </if>
<if test="businesstype != null and businesstype != ''"> and businessType = #{businesstype} </if> <if test="businesstype != null and businesstype != ''"> and businessType = #{businesstype} </if>
<if test="sourceorderstatus != null and sourceorderstatus != ''"> and sourceOrderStatus = #{sourceorderstatus} </if>
<if test="def1 != null and def1 != ''"> and def1 = #{def1} </if> <if test="def1 != null and def1 != ''"> and def1 = #{def1} </if>
<if test="def2 != null and def2 != ''"> and def2 = #{def2} </if> <if test="def2 != null and def2 != ''"> and def2 = #{def2} </if>
<if test="def3 != null and def3 != ''"> and def3 = #{def3} </if> <if test="def3 != null and def3 != ''"> and def3 = #{def3} </if>
@ -281,6 +287,10 @@
<if test="def40 != null and def40 != ''"> and def40 = #{def40} </if> <if test="def40 != null and def40 != ''"> and def40 = #{def40} </if>
<if test="ids!=null and ids!=''">and id in (${ids})</if> <if test="ids!=null and ids!=''">and id in (${ids})</if>
-- and sts='Y' -- and sts='Y'
<if test="businessDateStart != null and businessDateStart != ''"> and businessDate >= #{businessDateStart} </if>
<if test="businessDateEnd != null and businessDateEnd != ''"> and businessDate &lt;= #{businessDateEnd} </if>
<if test="successfultradedateStart != null and successfultradedateStart != ''"> and successfulTradeDate >= #{successfultradedateStart} </if>
<if test="successfultradedateEnd != null and successfultradedateEnd != ''"> and successfulTradeDate &lt;= #{successfultradedateEnd} </if>
</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>-->
@ -339,6 +349,9 @@
<if test="businessdate != null and businessdate != ''"> and businessDate = #{businessdate} </if> <if test="businessdate != null and businessdate != ''"> and businessDate = #{businessdate} </if>
<if test="successfultradedate != null and successfultradedate != ''"> and successfulTradeDate = #{successfultradedate} </if> <if test="successfultradedate != null and successfultradedate != ''"> and successfulTradeDate = #{successfultradedate} </if>
<if test="businesstype != null and businesstype != ''"> and businessType = #{businesstype} </if> <if test="businesstype != null and businesstype != ''"> and businessType = #{businesstype} </if>
<if test="sourceorderstatus != null and sourceorderstatus != ''"> and sourceOrderStatus = #{sourceorderstatus} </if>
<if test="def1 != null and def1 != ''"> and def1 = #{def1} </if> <if test="def1 != null and def1 != ''"> and def1 = #{def1} </if>
<if test="def2 != null and def2 != ''"> and def2 = #{def2} </if> <if test="def2 != null and def2 != ''"> and def2 = #{def2} </if>
<if test="def3 != null and def3 != ''"> and def3 = #{def3} </if> <if test="def3 != null and def3 != ''"> and def3 = #{def3} </if>
@ -440,6 +453,9 @@
<if test="businessdate != null and businessdate != ''"> and businessDate like concat('%',#{businessdate},'%') </if> <if test="businessdate != null and businessdate != ''"> and businessDate like concat('%',#{businessdate},'%') </if>
<if test="successfultradedate != null and successfultradedate != ''"> and successfulTradeDate like concat('%',#{successfultradedate},'%') </if> <if test="successfultradedate != null and successfultradedate != ''"> and successfulTradeDate like concat('%',#{successfultradedate},'%') </if>
<if test="businesstype != null and businesstype != ''"> and businessType like concat('%',#{businesstype},'%') </if> <if test="businesstype != null and businesstype != ''"> and businessType like concat('%',#{businesstype},'%') </if>
<if test="sourceorderstatus != null and sourceorderstatus != ''"> and sourceOrderStatus like concat('%',#{sourceorderstatus},'%') </if>
<if test="def1 != null and def1 != ''"> and def1 like concat('%',#{def1},'%') </if> <if test="def1 != null and def1 != ''"> and def1 like concat('%',#{def1},'%') </if>
<if test="def2 != null and def2 != ''"> and def2 like concat('%',#{def2},'%') </if> <if test="def2 != null and def2 != ''"> and def2 like concat('%',#{def2},'%') </if>
<if test="def3 != null and def3 != ''"> and def3 like concat('%',#{def3},'%') </if> <if test="def3 != null and def3 != ''"> and def3 like concat('%',#{def3},'%') </if>
@ -541,6 +557,9 @@
<if test="businessdate != null and businessdate != ''"> or businessDate = #{businessdate} </if> <if test="businessdate != null and businessdate != ''"> or businessDate = #{businessdate} </if>
<if test="successfultradedate != null and successfultradedate != ''"> or successfulTradeDate = #{successfultradedate} </if> <if test="successfultradedate != null and successfultradedate != ''"> or successfulTradeDate = #{successfultradedate} </if>
<if test="businesstype != null and businesstype != ''"> or businessType = #{businesstype} </if> <if test="businesstype != null and businesstype != ''"> or businessType = #{businesstype} </if>
<if test="sourceorderstatus != null and sourceorderstatus != ''"> or sourceOrderStatus = #{sourceorderstatus} </if>
<if test="def1 != null and def1 != ''"> or def1 = #{def1} </if> <if test="def1 != null and def1 != ''"> or def1 = #{def1} </if>
<if test="def2 != null and def2 != ''"> or def2 = #{def2} </if> <if test="def2 != null and def2 != ''"> or def2 = #{def2} </if>
<if test="def3 != null and def3 != ''"> or def3 = #{def3} </if> <if test="def3 != null and def3 != ''"> or def3 = #{def3} </if>
@ -640,6 +659,9 @@
<if test="businessdate != null and businessdate != ''"> businessDate , </if> <if test="businessdate != null and businessdate != ''"> businessDate , </if>
<if test="successfultradedate != null and successfultradedate != ''"> successfulTradeDate , </if> <if test="successfultradedate != null and successfultradedate != ''"> successfulTradeDate , </if>
<if test="businesstype != null and businesstype != ''"> businessType , </if> <if test="businesstype != null and businesstype != ''"> businessType , </if>
<if test="sourceorderstatus != null and sourceorderstatus != ''"> sourceOrderStatus , </if>
<if test="def1 != null and def1 != ''"> def1 , </if> <if test="def1 != null and def1 != ''"> def1 , </if>
<if test="def2 != null and def2 != ''"> def2 , </if> <if test="def2 != null and def2 != ''"> def2 , </if>
<if test="def3 != null and def3 != ''"> def3 , </if> <if test="def3 != null and def3 != ''"> def3 , </if>
@ -734,6 +756,9 @@
<if test="businessdate != null and businessdate != ''"> #{businessdate} ,</if> <if test="businessdate != null and businessdate != ''"> #{businessdate} ,</if>
<if test="successfultradedate != null and successfultradedate != ''"> #{successfultradedate} ,</if> <if test="successfultradedate != null and successfultradedate != ''"> #{successfultradedate} ,</if>
<if test="businesstype != null and businesstype != ''"> #{businesstype} ,</if> <if test="businesstype != null and businesstype != ''"> #{businesstype} ,</if>
<if test="sourceorderstatus != null and sourceorderstatus != ''"> #{sourceOrderStatus} ,</if>
<if test="def1 != null and def1 != ''"> #{def1} ,</if> <if test="def1 != null and def1 != ''"> #{def1} ,</if>
<if test="def2 != null and def2 != ''"> #{def2} ,</if> <if test="def2 != null and def2 != ''"> #{def2} ,</if>
<if test="def3 != null and def3 != ''"> #{def3} ,</if> <if test="def3 != null and def3 != ''"> #{def3} ,</if>
@ -779,20 +804,22 @@
</trim> </trim>
) )
</insert> </insert>
<!-- 批量新增 --> <!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true"> <insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into tocofs_saleout_detailed(clientCode, companyCode, facilityCode, shipmentCode, refOrderId, refOrderDetailId, refOrderCode, allocInvId, skuCode, skuName, sourceOrderCode, sourceLineNum, inventorySts, isGift, requestQty, shipQty, shipAt, quantityUM, listPrice, itemTotalAmount, totalPayAmount, totalWeight, totalVolume, totalVolumeWeight, weightUM, volumeUM, created, createdBy, lastUpdated, lastUpdatedBy, mainTableId, newPushDate, newTransmitInfo, newState, newState2, newState3, newState4, newSystemNumber, newSystemPrimary, newSystemNumber2, newSystemPrimary2, newSystemNumber3, newSystemPrimary3, newSystemNumber4, newSystemPrimary4, businessDate, successfulTradeDate, businessType, def1, def2, def3, def4, def5, def6, def7, def8, def9, def10, def11, def12, def13, def14, def15, def16, def17, def18, def19, def20, def21, def22, def23, def24, def25, def26, def27, def28, def29, def30, def31, def32, def33, def34, def35, def36, def37, def38, def39, def40, sts) insert IGNORE into tocofs_saleout_detailed(clientCode, companyCode, facilityCode, shipmentCode, refOrderId, refOrderDetailId, refOrderCode, allocInvId, skuCode, skuName, sourceOrderCode, sourceLineNum, inventorySts, isGift, requestQty, shipQty, shipAt, quantityUM, listPrice, itemTotalAmount, totalPayAmount, totalWeight, totalVolume, totalVolumeWeight, weightUM, volumeUM, created, createdBy, lastUpdated, lastUpdatedBy, mainTableId, newPushDate, newTransmitInfo, newState, newState2, newState3, newState4, newSystemNumber, newSystemPrimary, newSystemNumber2, newSystemPrimary2, newSystemNumber3, newSystemPrimary3, newSystemNumber4, newSystemPrimary4, businessDate, successfulTradeDate, businessType,sourceOrderStatus)
values values
<foreach collection="entities" item="entity" separator=","> <foreach collection="entities" item="entity" separator=",">
(#{entity.clientcode},#{entity.companycode},#{entity.facilitycode},#{entity.shipmentcode},#{entity.reforderid},#{entity.reforderdetailid},#{entity.refordercode},#{entity.allocinvid},#{entity.skucode},#{entity.skuname},#{entity.sourceordercode},#{entity.sourcelinenum},#{entity.inventorysts},#{entity.isgift},#{entity.requestqty},#{entity.shipqty},#{entity.shipat},#{entity.quantityum},#{entity.listprice},#{entity.itemtotalamount},#{entity.totalpayamount},#{entity.totalweight},#{entity.totalvolume},#{entity.totalvolumeweight},#{entity.weightum},#{entity.volumeum},#{entity.created},#{entity.createdby},#{entity.lastupdated},#{entity.lastupdatedby},#{entity.maintableid},#{entity.newpushdate},#{entity.newtransmitinfo},#{entity.newstate},#{entity.newstate2},#{entity.newstate3},#{entity.newstate4},#{entity.newsystemnumber},#{entity.newsystemprimary},#{entity.newsystemnumber2},#{entity.newsystemprimary2},#{entity.newsystemnumber3},#{entity.newsystemprimary3},#{entity.newsystemnumber4},#{entity.newsystemprimary4},#{entity.businessdate},#{entity.successfultradedate},#{entity.businesstype},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.def11},#{entity.def12},#{entity.def13},#{entity.def14},#{entity.def15},#{entity.def16},#{entity.def17},#{entity.def18},#{entity.def19},#{entity.def20},#{entity.def21},#{entity.def22},#{entity.def23},#{entity.def24},#{entity.def25},#{entity.def26},#{entity.def27},#{entity.def28},#{entity.def29},#{entity.def30},#{entity.def31},#{entity.def32},#{entity.def33},#{entity.def34},#{entity.def35},#{entity.def36},#{entity.def37},#{entity.def38},#{entity.def39},#{entity.def40}, 'Y') (#{entity.clientcode},#{entity.companycode},#{entity.facilitycode},#{entity.shipmentcode},#{entity.reforderid},#{entity.reforderdetailid},#{entity.refordercode},#{entity.allocinvid},#{entity.skucode},#{entity.skuname},#{entity.sourceordercode},#{entity.sourcelinenum},#{entity.inventorysts},#{entity.isgift},#{entity.requestqty},#{entity.shipqty},#{entity.shipat},#{entity.quantityum},#{entity.listprice},#{entity.itemtotalamount},#{entity.totalpayamount},#{entity.totalweight},#{entity.totalvolume},#{entity.totalvolumeweight},#{entity.weightum},#{entity.volumeum},#{entity.created},#{entity.createdby},#{entity.lastupdated},#{entity.lastupdatedby},#{entity.maintableid},#{entity.newpushdate},#{entity.newtransmitinfo},#{entity.newstate},#{entity.newstate2},#{entity.newstate3},#{entity.newstate4},#{entity.newsystemnumber},#{entity.newsystemprimary},#{entity.newsystemnumber2},#{entity.newsystemprimary2},#{entity.newsystemnumber3},#{entity.newsystemprimary3},#{entity.newsystemnumber4},#{entity.newsystemprimary4},#{entity.businessdate},#{entity.successfultradedate},#{entity.businesstype},#{entity.sourceorderstatus})
</foreach> </foreach>
</insert> </insert>
<!-- 批量新增或者修改--> <!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true"> <insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into tocofs_saleout_detailed(id,clientCode, companyCode, facilityCode, shipmentCode, refOrderId, refOrderDetailId, refOrderCode, allocInvId, skuCode, skuName, sourceOrderCode, sourceLineNum, inventorySts, isGift, requestQty, shipQty, shipAt, quantityUM, listPrice, itemTotalAmount, totalPayAmount, totalWeight, totalVolume, totalVolumeWeight, weightUM, volumeUM, created, createdBy, lastUpdated, lastUpdatedBy, mainTableId, businessDate, successfulTradeDate, businessType) insert into tocofs_saleout_detailed(id,clientCode, companyCode, facilityCode, shipmentCode, refOrderId, refOrderDetailId, refOrderCode, allocInvId, skuCode, skuName, sourceOrderCode, sourceLineNum, inventorySts, isGift, requestQty, shipQty, shipAt, quantityUM, listPrice, itemTotalAmount, totalPayAmount, totalWeight, totalVolume, totalVolumeWeight, weightUM, volumeUM, created, createdBy, lastUpdated, lastUpdatedBy, mainTableId, businessDate, successfulTradeDate, businessType,sourceOrderStatus)
values values
<foreach collection="list" item="entity" separator=","> <foreach collection="list" item="entity" separator=",">
(#{entity.id},#{entity.clientcode},#{entity.companycode},#{entity.facilitycode},#{entity.shipmentcode},#{entity.reforderid},#{entity.reforderdetailid},#{entity.refordercode},#{entity.allocinvid},#{entity.skucode},#{entity.skuname},#{entity.sourceordercode},#{entity.sourcelinenum},#{entity.inventorysts},#{entity.isgift},#{entity.requestqty},#{entity.shipqty},#{entity.shipat},#{entity.quantityum},#{entity.listprice},#{entity.itemtotalamount},#{entity.totalpayamount},#{entity.totalweight},#{entity.totalvolume},#{entity.totalvolumeweight},#{entity.weightum},#{entity.volumeum},#{entity.created},#{entity.createdby},#{entity.lastupdated},#{entity.lastupdatedby},#{entity.maintableid},#{entity.businessdate},#{entity.successfultradedate},#{entity.businesstype}) (#{entity.id},#{entity.clientcode},#{entity.companycode},#{entity.facilitycode},#{entity.shipmentcode},#{entity.reforderid},#{entity.reforderdetailid},#{entity.refordercode},#{entity.allocinvid},#{entity.skucode},#{entity.skuname},#{entity.sourceordercode},#{entity.sourcelinenum},#{entity.inventorysts},#{entity.isgift},#{entity.requestqty},#{entity.shipqty},#{entity.shipat},#{entity.quantityum},#{entity.listprice},#{entity.itemtotalamount},#{entity.totalpayamount},#{entity.totalweight},#{entity.totalvolume},#{entity.totalvolumeweight},#{entity.weightum},#{entity.volumeum},#{entity.created},#{entity.createdby},#{entity.lastupdated},#{entity.lastupdatedby},#{entity.maintableid},#{entity.businessdate},#{entity.successfultradedate},#{entity.businesstype},#{entity.sourceorderstatus})
</foreach> </foreach>
on duplicate key update on duplicate key update
id = values(id), id = values(id),
@ -829,10 +856,10 @@
mainTableId = values(mainTableId), mainTableId = values(mainTableId),
businessDate = values(businessDate), businessDate = values(businessDate),
successfulTradeDate = values(successfulTradeDate), successfulTradeDate = values(successfulTradeDate),
businessType = values(businessType) businessType = values(businessType),
sourceOrderStatus = values(sourceOrderStatus)
</insert> </insert>
<!-- 出库成功,更新推送状态(适合档案转啊)--> <!-- 出库成功,更新推送状态(适合档案转啊)-->
<insert id="entityInsertOrUpdateBatchStock" keyProperty="id" useGeneratedKeys="true" parameterType="com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity"> <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) insert into tocofs_saleout_detailed(id,newPushDate,newTransmitInfo,newState)
@ -852,7 +879,6 @@
newState = values(newState) newState = values(newState)
</insert> </insert>
<!-- 出库成功更新推送状态适合档案转啊V2--> <!-- 出库成功更新推送状态适合档案转啊V2-->
<insert id="entityInsertOrUpdateBatchStockV2" keyProperty="id" useGeneratedKeys="true" parameterType="com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity"> <insert id="entityInsertOrUpdateBatchStockV2" keyProperty="id" useGeneratedKeys="true" parameterType="com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity">
insert into tocofs_saleout_detailed(id,def1,def2,newState2) insert into tocofs_saleout_detailed(id,def1,def2,newState2)
@ -907,7 +933,6 @@
def12 = values(def12) def12 = values(def12)
</insert> </insert>
<!-- TOC更新推送状态适合确认收入红字--> <!-- TOC更新推送状态适合确认收入红字-->
<insert id="entityInsertOrUpdateBatchStock3" keyProperty="id" useGeneratedKeys="true"> <insert id="entityInsertOrUpdateBatchStock3" keyProperty="id" useGeneratedKeys="true">
insert into tocofs_saleout_detailed(id,def1,def2,newState2,newSystemNumber2,newSystemPrimary2,def7,def8,def9,def10,def11,def12) insert into tocofs_saleout_detailed(id,def1,def2,newState2,newSystemNumber2,newSystemPrimary2,def7,def8,def9,def10,def11,def12)
@ -943,7 +968,6 @@
def12 = values(def12) def12 = values(def12)
</insert> </insert>
<!-- TOC更新推送状态适合确认收入蓝字--> <!-- TOC更新推送状态适合确认收入蓝字-->
<insert id="entityInsertOrUpdateBatchStock4" keyProperty="id" useGeneratedKeys="true"> <insert id="entityInsertOrUpdateBatchStock4" keyProperty="id" useGeneratedKeys="true">
insert into tocofs_saleout_detailed(id,def3,def4,newState3,newSystemNumber3,newSystemPrimary3,def7,def8,def9,def10,def11,def12) insert into tocofs_saleout_detailed(id,def3,def4,newState3,newSystemNumber3,newSystemPrimary3,def7,def8,def9,def10,def11,def12)
@ -979,8 +1003,6 @@
def12 = values(def12) def12 = values(def12)
</insert> </insert>
<!-- TOB更新推送状态适合确认收入蓝字--> <!-- TOB更新推送状态适合确认收入蓝字-->
<insert id="entityInsertOrUpdateBatchStock5" keyProperty="id" useGeneratedKeys="true"> <insert id="entityInsertOrUpdateBatchStock5" keyProperty="id" useGeneratedKeys="true">
insert into tocofs_saleout_detailed(id,newPushDate,newTransmitInfo,newState4,newSystemNumber,newSystemPrimary) insert into tocofs_saleout_detailed(id,newPushDate,newTransmitInfo,newState4,newSystemNumber,newSystemPrimary)
@ -1004,9 +1026,6 @@
newSystemPrimary = values(newSystemPrimary) newSystemPrimary = values(newSystemPrimary)
</insert> </insert>
<!-- TOB更新推送状态适合确认收入蓝字--> <!-- TOB更新推送状态适合确认收入蓝字-->
<insert id="entityInsertOrUpdateBatchStock6" keyProperty="id" useGeneratedKeys="true"> <insert id="entityInsertOrUpdateBatchStock6" keyProperty="id" useGeneratedKeys="true">
insert into tocofs_saleout_detailed(id,newPushDate,newTransmitInfo,newState,newSystemNumber,newSystemPrimary,def7,def8) insert into tocofs_saleout_detailed(id,newPushDate,newTransmitInfo,newState,newSystemNumber,newSystemPrimary,def7,def8)
@ -1132,6 +1151,7 @@
<if test="businessdate != null and businessdate != ''"> businessDate = #{businessdate},</if> <if test="businessdate != null and businessdate != ''"> businessDate = #{businessdate},</if>
<if test="successfultradedate != null and successfultradedate != ''"> successfulTradeDate = #{successfultradedate},</if> <if test="successfultradedate != null and successfultradedate != ''"> successfulTradeDate = #{successfultradedate},</if>
<if test="businesstype != null and businesstype != ''"> businessType = #{businesstype},</if> <if test="businesstype != null and businesstype != ''"> businessType = #{businesstype},</if>
<if test="sourceorderstatus != null and sourceorderstatus != ''"> sourceOrderStatus = #{sourceorderstatus},</if>
<if test="def1 != null and def1 != ''"> def1 = #{def1},</if> <if test="def1 != null and def1 != ''"> def1 = #{def1},</if>
<if test="def2 != null and def2 != ''"> def2 = #{def2},</if> <if test="def2 != null and def2 != ''"> def2 = #{def2},</if>
<if test="def3 != null and def3 != ''"> def3 = #{def3},</if> <if test="def3 != null and def3 != ''"> def3 = #{def3},</if>
@ -1175,11 +1195,13 @@
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
<!-- 逻辑删除 --> <!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity" > <update id="entity_logicDelete" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity" >
update tocofs_saleout_detailed set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} update tocofs_saleout_detailed set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where id = #{id} where id = #{id}
</update> </update>
<!-- 多条件逻辑删除 --> <!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity" > <update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity" >
update tocofs_saleout_detailed set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} update tocofs_saleout_detailed set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
@ -1233,6 +1255,7 @@
<if test="businessdate != null and businessdate != ''"> and businessDate = #{businessdate} </if> <if test="businessdate != null and businessdate != ''"> and businessDate = #{businessdate} </if>
<if test="successfultradedate != null and successfultradedate != ''"> and successfulTradeDate = #{successfultradedate} </if> <if test="successfultradedate != null and successfultradedate != ''"> and successfulTradeDate = #{successfultradedate} </if>
<if test="businesstype != null and businesstype != ''"> and businessType = #{businesstype} </if> <if test="businesstype != null and businesstype != ''"> and businessType = #{businesstype} </if>
<if test="sourceorderstatus != null and sourceorderstatus != ''"> and sourceOrderStatus = #{sourceorderstatus} </if>
<if test="def1 != null and def1 != ''"> and def1 = #{def1} </if> <if test="def1 != null and def1 != ''"> and def1 = #{def1} </if>
<if test="def2 != null and def2 != ''"> and def2 = #{def2} </if> <if test="def2 != null and def2 != ''"> and def2 = #{def2} </if>
<if test="def3 != null and def3 != ''"> and def3 = #{def3} </if> <if test="def3 != null and def3 != ''"> and def3 = #{def3} </if>
@ -1276,6 +1299,7 @@
and sts='Y' and sts='Y'
</trim> </trim>
</update> </update>
<!--通过主键删除--> <!--通过主键删除-->
<delete id="entity_delete"> <delete id="entity_delete">
delete from tocofs_saleout_detailed where id = #{id} delete from tocofs_saleout_detailed where id = #{id}

View File

@ -4,6 +4,7 @@ import com.hzya.frame.web.entity.BaseEntity;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List;
/** /**
* O出库单表头(TOCTOB业务底表)(TocofsSaleout)实体类 * O出库单表头(TOCTOB业务底表)(TocofsSaleout)实体类
@ -409,4 +410,40 @@ public class TocofsSaleoutEntity extends BaseEntity {
* 自定义项 * 自定义项
*/ */
private String def40; private String def40;
/**
* 12-24新增字段 shipToPostalCode
*/
private String shiptopostalcode;
/**
* 12-24新增字段 shipToEmail
*/
private String shiptoemail;
/**
* 12-24新增字段 platformDiscounts
*/
private String platformdiscounts;
/**
* 12-24新增字段 merchantDiscounts
*/
private String merchantdiscounts;
/**
* 12-24新增字段 expertDiscounts
*/
private String expertdiscounts;
/**
* 12-24新增字段 payDiscounts
*/
private String paydiscounts;
/**
* 12-24新增字段 modified
*/
private String modified;
/**
* 查询条件根据多个id通过id方式查询
*/
private String ids;
/**
* O底表-销售出库单明细行对象
*/
private List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntityList;
} }

View File

@ -71,6 +71,15 @@
<result property="shiptocityname" column="shipToCityName" jdbcType="VARCHAR"/> <result property="shiptocityname" column="shipToCityName" jdbcType="VARCHAR"/>
<result property="shiptodistrictname" column="shipToDistrictName" jdbcType="VARCHAR"/> <result property="shiptodistrictname" column="shipToDistrictName" jdbcType="VARCHAR"/>
<result property="shipmenttype" column="shipmentType" jdbcType="VARCHAR"/> <result property="shipmenttype" column="shipmentType" jdbcType="VARCHAR"/>
<!--12-24新增-->
<result property="shiptopostalcode" column="shipToPostalCode" jdbcType="VARCHAR"/>
<result property="shiptoemail" column="shipToEmail" jdbcType="VARCHAR"/>
<result property="platformdiscounts" column="platformDiscounts" jdbcType="VARCHAR"/>
<result property="merchantdiscounts" column="merchantDiscounts" jdbcType="VARCHAR"/>
<result property="expertdiscounts" column="expertDiscounts" jdbcType="VARCHAR"/>
<result property="paydiscounts" column="payDiscounts" jdbcType="VARCHAR"/>
<result property="modified" column="modified" jdbcType="VARCHAR"/>
<result property="def1" column="def1" jdbcType="VARCHAR"/> <result property="def1" column="def1" jdbcType="VARCHAR"/>
<result property="def2" column="def2" jdbcType="VARCHAR"/> <result property="def2" column="def2" jdbcType="VARCHAR"/>
<result property="def3" column="def3" jdbcType="VARCHAR"/> <result property="def3" column="def3" jdbcType="VARCHAR"/>
@ -184,6 +193,15 @@
,shipToCityName ,shipToCityName
,shipToDistrictName ,shipToDistrictName
,shipmentType ,shipmentType
,shipToPostalCode
,shipToEmail
,platformDiscounts
,merchantDiscounts
,expertDiscounts
,payDiscounts
,modified
,def1 ,def1
,def2 ,def2
,def3 ,def3
@ -300,6 +318,15 @@
<if test="shiptocityname != null and shiptocityname != ''"> and shipToCityName = #{shiptocityname} </if> <if test="shiptocityname != null and shiptocityname != ''"> and shipToCityName = #{shiptocityname} </if>
<if test="shiptodistrictname != null and shiptodistrictname != ''"> and shipToDistrictName = #{shiptodistrictname} </if> <if test="shiptodistrictname != null and shiptodistrictname != ''"> and shipToDistrictName = #{shiptodistrictname} </if>
<if test="shipmenttype != null and shipmenttype != ''"> and shipmentType = #{shipmenttype} </if> <if test="shipmenttype != null and shipmenttype != ''"> and shipmentType = #{shipmenttype} </if>
<if test="shiptopostalcode != null and shiptopostalcode != ''"> and shipToPostalCode = #{shiptopostalcode} </if>
<if test="shiptoemail != null and shiptoemail != ''"> and shipToEmail = #{shiptoemail} </if>
<if test="platformdiscounts != null and platformdiscounts != ''"> and platformDiscounts = #{platformdiscounts} </if>
<if test="merchantdiscounts != null and merchantdiscounts != ''"> and merchantDiscounts = #{merchantdiscounts} </if>
<if test="expertdiscounts != null and expertdiscounts != ''"> and expertDiscounts = #{expertdiscounts} </if>
<if test="paydiscounts != null and paydiscounts != ''"> and payDiscounts = #{paydiscounts} </if>
<if test="modified != null and modified != ''"> and modified = #{modified} </if>
<if test="def1 != null and def1 != ''"> and def1 = #{def1} </if> <if test="def1 != null and def1 != ''"> and def1 = #{def1} </if>
<if test="def2 != null and def2 != ''"> and def2 = #{def2} </if> <if test="def2 != null and def2 != ''"> and def2 = #{def2} </if>
<if test="def3 != null and def3 != ''"> and def3 = #{def3} </if> <if test="def3 != null and def3 != ''"> and def3 = #{def3} </if>
@ -340,7 +367,10 @@
<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>
@ -419,6 +449,15 @@
<if test="shiptocityname != null and shiptocityname != ''"> and shipToCityName = #{shiptocityname} </if> <if test="shiptocityname != null and shiptocityname != ''"> and shipToCityName = #{shiptocityname} </if>
<if test="shiptodistrictname != null and shiptodistrictname != ''"> and shipToDistrictName = #{shiptodistrictname} </if> <if test="shiptodistrictname != null and shiptodistrictname != ''"> and shipToDistrictName = #{shiptodistrictname} </if>
<if test="shipmenttype != null and shipmenttype != ''"> and shipmentType = #{shipmenttype} </if> <if test="shipmenttype != null and shipmenttype != ''"> and shipmentType = #{shipmenttype} </if>
<if test="shiptopostalcode != null and shiptopostalcode != ''"> and shipToPostalCode = #{shiptopostalcode} </if>
<if test="shiptoemail != null and shiptoemail != ''"> and shipToEmail = #{shiptoemail} </if>
<if test="platformdiscounts != null and platformdiscounts != ''"> and platformDiscounts = #{platformdiscounts} </if>
<if test="merchantdiscounts != null and merchantdiscounts != ''"> and merchantDiscounts = #{merchantdiscounts} </if>
<if test="expertdiscounts != null and expertdiscounts != ''"> and expertDiscounts = #{expertdiscounts} </if>
<if test="paydiscounts != null and paydiscounts != ''"> and payDiscounts = #{paydiscounts} </if>
<if test="modified != null and modified != ''"> and modified = #{modified} </if>
<if test="def1 != null and def1 != ''"> and def1 = #{def1} </if> <if test="def1 != null and def1 != ''"> and def1 = #{def1} </if>
<if test="def2 != null and def2 != ''"> and def2 = #{def2} </if> <if test="def2 != null and def2 != ''"> and def2 = #{def2} </if>
<if test="def3 != null and def3 != ''"> and def3 = #{def3} </if> <if test="def3 != null and def3 != ''"> and def3 = #{def3} </if>
@ -540,6 +579,15 @@
<if test="shiptocityname != null and shiptocityname != ''"> and shipToCityName like concat('%',#{shiptocityname},'%') </if> <if test="shiptocityname != null and shiptocityname != ''"> and shipToCityName like concat('%',#{shiptocityname},'%') </if>
<if test="shiptodistrictname != null and shiptodistrictname != ''"> and shipToDistrictName like concat('%',#{shiptodistrictname},'%') </if> <if test="shiptodistrictname != null and shiptodistrictname != ''"> and shipToDistrictName like concat('%',#{shiptodistrictname},'%') </if>
<if test="shipmenttype != null and shipmenttype != ''"> and shipmentType like concat('%',#{shipmenttype},'%') </if> <if test="shipmenttype != null and shipmenttype != ''"> and shipmentType like concat('%',#{shipmenttype},'%') </if>
<if test="shiptopostalcode != null and shiptopostalcode != ''"> and shipToPostalCode like concat('%',#{shiptopostalcode},'%') </if>
<if test="shiptoemail != null and shiptoemail != ''"> and shipToEmail like concat('%',#{shiptoemail},'%') </if>
<if test="platformdiscounts != null and platformdiscounts != ''"> and platformDiscounts like concat('%',#{platformdiscounts},'%') </if>
<if test="merchantdiscounts != null and merchantdiscounts != ''"> and merchantDiscounts like concat('%',#{merchantdiscounts},'%') </if>
<if test="expertdiscounts != null and expertdiscounts != ''"> and expertDiscounts like concat('%',#{expertdiscounts},'%') </if>
<if test="paydiscounts != null and paydiscounts != ''"> and payDiscounts like concat('%',#{paydiscounts},'%') </if>
<if test="modified != null and modified != ''"> and modified like concat('%',#{modified},'%') </if>
<if test="def1 != null and def1 != ''"> and def1 like concat('%',#{def1},'%') </if> <if test="def1 != null and def1 != ''"> and def1 like concat('%',#{def1},'%') </if>
<if test="def2 != null and def2 != ''"> and def2 like concat('%',#{def2},'%') </if> <if test="def2 != null and def2 != ''"> and def2 like concat('%',#{def2},'%') </if>
<if test="def3 != null and def3 != ''"> and def3 like concat('%',#{def3},'%') </if> <if test="def3 != null and def3 != ''"> and def3 like concat('%',#{def3},'%') </if>
@ -661,6 +709,15 @@
<if test="shiptocityname != null and shiptocityname != ''"> or shipToCityName = #{shiptocityname} </if> <if test="shiptocityname != null and shiptocityname != ''"> or shipToCityName = #{shiptocityname} </if>
<if test="shiptodistrictname != null and shiptodistrictname != ''"> or shipToDistrictName = #{shiptodistrictname} </if> <if test="shiptodistrictname != null and shiptodistrictname != ''"> or shipToDistrictName = #{shiptodistrictname} </if>
<if test="shipmenttype != null and shipmenttype != ''"> or shipmentType = #{shipmenttype} </if> <if test="shipmenttype != null and shipmenttype != ''"> or shipmentType = #{shipmenttype} </if>
<if test="shiptopostalcode != null and shiptopostalcode != ''"> or shipToPostalCode = #{shiptopostalcode} </if>
<if test="shiptoemail != null and shiptoemail != ''"> or shipToEmail = #{shiptoemail} </if>
<if test="platformdiscounts != null and platformdiscounts != ''"> or platformDiscounts = #{platformdiscounts} </if>
<if test="merchantdiscounts != null and merchantdiscounts != ''"> or merchantDiscounts = #{merchantdiscounts} </if>
<if test="expertdiscounts != null and expertdiscounts != ''"> or expertDiscounts = #{expertdiscounts} </if>
<if test="paydiscounts != null and paydiscounts != ''"> or payDiscounts = #{paydiscounts} </if>
<if test="modified != null and modified != ''"> or modified = #{modified} </if>
<if test="def1 != null and def1 != ''"> or def1 = #{def1} </if> <if test="def1 != null and def1 != ''"> or def1 = #{def1} </if>
<if test="def2 != null and def2 != ''"> or def2 = #{def2} </if> <if test="def2 != null and def2 != ''"> or def2 = #{def2} </if>
<if test="def3 != null and def3 != ''"> or def3 = #{def3} </if> <if test="def3 != null and def3 != ''"> or def3 = #{def3} </if>
@ -780,6 +837,15 @@
<if test="shiptocityname != null and shiptocityname != ''"> shipToCityName , </if> <if test="shiptocityname != null and shiptocityname != ''"> shipToCityName , </if>
<if test="shiptodistrictname != null and shiptodistrictname != ''"> shipToDistrictName , </if> <if test="shiptodistrictname != null and shiptodistrictname != ''"> shipToDistrictName , </if>
<if test="shipmenttype != null and shipmenttype != ''"> shipmentType , </if> <if test="shipmenttype != null and shipmenttype != ''"> shipmentType , </if>
<if test="shiptopostalcode != null and shiptopostalcode != ''"> shipToPostalCode , </if>
<if test="shiptoemail != null and shiptoemail != ''"> shipToEmail , </if>
<if test="platformdiscounts != null and platformdiscounts != ''"> platformDiscounts , </if>
<if test="merchantdiscounts != null and merchantdiscounts != ''"> merchantDiscounts , </if>
<if test="expertdiscounts != null and expertdiscounts != ''"> expertDiscounts , </if>
<if test="paydiscounts != null and paydiscounts != ''"> payDiscounts , </if>
<if test="modified != null and modified != ''"> modified , </if>
<if test="def1 != null and def1 != ''"> def1 , </if> <if test="def1 != null and def1 != ''"> def1 , </if>
<if test="def2 != null and def2 != ''"> def2 , </if> <if test="def2 != null and def2 != ''"> def2 , </if>
<if test="def3 != null and def3 != ''"> def3 , </if> <if test="def3 != null and def3 != ''"> def3 , </if>
@ -894,6 +960,15 @@
<if test="shiptocityname != null and shiptocityname != ''"> #{shiptocityname} ,</if> <if test="shiptocityname != null and shiptocityname != ''"> #{shiptocityname} ,</if>
<if test="shiptodistrictname != null and shiptodistrictname != ''"> #{shiptodistrictname} ,</if> <if test="shiptodistrictname != null and shiptodistrictname != ''"> #{shiptodistrictname} ,</if>
<if test="shipmenttype != null and shipmenttype != ''"> #{shipmenttype} ,</if> <if test="shipmenttype != null and shipmenttype != ''"> #{shipmenttype} ,</if>
<if test="shiptopostalcode != null and shiptopostalcode != ''"> #{shipToPostalCode} ,</if>
<if test="shiptoemail != null and shiptoemail != ''"> #{shipToEmail} ,</if>
<if test="platformdiscounts != null and platformdiscounts != ''"> #{platformDiscounts} ,</if>
<if test="merchantdiscounts != null and merchantdiscounts != ''"> #{merchantDiscounts} ,</if>
<if test="expertdiscounts != null and expertdiscounts != ''"> #{expertDiscounts} ,</if>
<if test="paydiscounts != null and paydiscounts != ''"> #{payDiscounts} ,</if>
<if test="modified != null and modified != ''"> #{modified} ,</if>
<if test="def1 != null and def1 != ''"> #{def1} ,</if> <if test="def1 != null and def1 != ''"> #{def1} ,</if>
<if test="def2 != null and def2 != ''"> #{def2} ,</if> <if test="def2 != null and def2 != ''"> #{def2} ,</if>
<if test="def3 != null and def3 != ''"> #{def3} ,</if> <if test="def3 != null and def3 != ''"> #{def3} ,</if>
@ -939,20 +1014,22 @@
</trim> </trim>
) )
</insert> </insert>
<!-- 批量新增 --> <!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true"> <insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into tocofs_saleout(clientCode, companyCode, storeCode, facilityCode, code, refOrderId, refOrderCode, refOrderType, status, consolidated, internalInstructionType, bizChannel, sourcePlatformCode, processType, sourceOrderId, sourceOrderCode, shipToAttentionTo, sourceUserAccount, shipToAddress, shipToCountry, shipToState, shipToCity, shipToDistrict, shipToMobile, totalLines, totalQty, totalContainers, totalCases, totalWeight, totalVolume, totalVolumeWeight, weightUM, volumeUM, totalAmount, totalPayAmount, postageAmount, itemTotalAmount, totalFulfillQty, totalFulfillWeight, totalFulfillVolume, totalFulfillVolumeWeight, shipAt, carrierCode, primaryWaybillCode, paymentStatus, codRequired, invoiceRequired, paidAt, shipFromAttentionTo, shipFromAddress, shipFromDistrict, shipFromCity, shipFromState, shipFromCountry, shipFromPostalCode, shipFromPhone, shipFromMobile, shipFromFax, shipFromEmail, codAmount, tax, taxPaid, tradeSuccessAt, sourceOrderStatus, shipToStateName, shipToCityName, shipToDistrictName, shipmentType, def1, def2, def3, def4, def5, def6, def7, def8, def9, def10, def11, def12, def13, def14, def15, def16, def17, def18, def19, def20, def21, def22, def23, def24, def25, def26, def27, def28, def29, def30, def31, def32, def33, def34, def35, def36, def37, def38, def39, def40, sts) insert IGNORE into tocofs_saleout(clientCode, companyCode, storeCode, facilityCode, code, refOrderId, refOrderCode, refOrderType, status, consolidated, internalInstructionType, bizChannel, sourcePlatformCode, processType, sourceOrderId, sourceOrderCode, shipToAttentionTo, sourceUserAccount, shipToAddress, shipToCountry, shipToState, shipToCity, shipToDistrict, shipToMobile, totalLines, totalQty, totalContainers, totalCases, totalWeight, totalVolume, totalVolumeWeight, weightUM, volumeUM, totalAmount, totalPayAmount, postageAmount, itemTotalAmount, totalFulfillQty, totalFulfillWeight, totalFulfillVolume, totalFulfillVolumeWeight, shipAt, carrierCode, primaryWaybillCode, paymentStatus, codRequired, invoiceRequired, paidAt, shipFromAttentionTo, shipFromAddress, shipFromDistrict, shipFromCity, shipFromState, shipFromCountry, shipFromPostalCode, shipFromPhone, shipFromMobile, shipFromFax, shipFromEmail, codAmount, tax, taxPaid, tradeSuccessAt, sourceOrderStatus, shipToStateName, shipToCityName, shipToDistrictName, shipmentType, def1, def2, def3, def4, def5, def6, def7, def8, def9, def10, def11, def12, def13, def14, def15, def16, def17, def18, def19, def20, def21, def22, def23, def24, def25, def26, def27, def28, def29, def30, def31, def32, def33, def34, def35, def36, def37, def38, def39, def40,shipToPostalCode,shipToEmail,platformDiscounts,merchantDiscounts,expertDiscounts,payDiscounts,modified)
values values
<foreach collection="entities" item="entity" separator=","> <foreach collection="entities" item="entity" separator=",">
(#{entity.clientcode},#{entity.companycode},#{entity.storecode},#{entity.facilitycode},#{entity.code},#{entity.reforderid},#{entity.refordercode},#{entity.refordertype},#{entity.status},#{entity.consolidated},#{entity.internalinstructiontype},#{entity.bizchannel},#{entity.sourceplatformcode},#{entity.processtype},#{entity.sourceorderid},#{entity.sourceordercode},#{entity.shiptoattentionto},#{entity.sourceuseraccount},#{entity.shiptoaddress},#{entity.shiptocountry},#{entity.shiptostate},#{entity.shiptocity},#{entity.shiptodistrict},#{entity.shiptomobile},#{entity.totallines},#{entity.totalqty},#{entity.totalcontainers},#{entity.totalcases},#{entity.totalweight},#{entity.totalvolume},#{entity.totalvolumeweight},#{entity.weightum},#{entity.volumeum},#{entity.totalamount},#{entity.totalpayamount},#{entity.postageamount},#{entity.itemtotalamount},#{entity.totalfulfillqty},#{entity.totalfulfillweight},#{entity.totalfulfillvolume},#{entity.totalfulfillvolumeweight},#{entity.shipat},#{entity.carriercode},#{entity.primarywaybillcode},#{entity.paymentstatus},#{entity.codrequired},#{entity.invoicerequired},#{entity.paidat},#{entity.shipfromattentionto},#{entity.shipfromaddress},#{entity.shipfromdistrict},#{entity.shipfromcity},#{entity.shipfromstate},#{entity.shipfromcountry},#{entity.shipfrompostalcode},#{entity.shipfromphone},#{entity.shipfrommobile},#{entity.shipfromfax},#{entity.shipfromemail},#{entity.codamount},#{entity.tax},#{entity.taxpaid},#{entity.tradesuccessat},#{entity.sourceorderstatus},#{entity.shiptostatename},#{entity.shiptocityname},#{entity.shiptodistrictname},#{entity.shipmenttype},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.def11},#{entity.def12},#{entity.def13},#{entity.def14},#{entity.def15},#{entity.def16},#{entity.def17},#{entity.def18},#{entity.def19},#{entity.def20},#{entity.def21},#{entity.def22},#{entity.def23},#{entity.def24},#{entity.def25},#{entity.def26},#{entity.def27},#{entity.def28},#{entity.def29},#{entity.def30},#{entity.def31},#{entity.def32},#{entity.def33},#{entity.def34},#{entity.def35},#{entity.def36},#{entity.def37},#{entity.def38},#{entity.def39},#{entity.def40}, 'Y') (#{entity.clientcode},#{entity.companycode},#{entity.storecode},#{entity.facilitycode},#{entity.code},#{entity.reforderid},#{entity.refordercode},#{entity.refordertype},#{entity.status},#{entity.consolidated},#{entity.internalinstructiontype},#{entity.bizchannel},#{entity.sourceplatformcode},#{entity.processtype},#{entity.sourceorderid},#{entity.sourceordercode},#{entity.shiptoattentionto},#{entity.sourceuseraccount},#{entity.shiptoaddress},#{entity.shiptocountry},#{entity.shiptostate},#{entity.shiptocity},#{entity.shiptodistrict},#{entity.shiptomobile},#{entity.totallines},#{entity.totalqty},#{entity.totalcontainers},#{entity.totalcases},#{entity.totalweight},#{entity.totalvolume},#{entity.totalvolumeweight},#{entity.weightum},#{entity.volumeum},#{entity.totalamount},#{entity.totalpayamount},#{entity.postageamount},#{entity.itemtotalamount},#{entity.totalfulfillqty},#{entity.totalfulfillweight},#{entity.totalfulfillvolume},#{entity.totalfulfillvolumeweight},#{entity.shipat},#{entity.carriercode},#{entity.primarywaybillcode},#{entity.paymentstatus},#{entity.codrequired},#{entity.invoicerequired},#{entity.paidat},#{entity.shipfromattentionto},#{entity.shipfromaddress},#{entity.shipfromdistrict},#{entity.shipfromcity},#{entity.shipfromstate},#{entity.shipfromcountry},#{entity.shipfrompostalcode},#{entity.shipfromphone},#{entity.shipfrommobile},#{entity.shipfromfax},#{entity.shipfromemail},#{entity.codamount},#{entity.tax},#{entity.taxpaid},#{entity.tradesuccessat},#{entity.sourceorderstatus},#{entity.shiptostatename},#{entity.shiptocityname},#{entity.shiptodistrictname},#{entity.shipmenttype},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.def11},#{entity.def12},#{entity.def13},#{entity.def14},#{entity.def15},#{entity.def16},#{entity.def17},#{entity.def18},#{entity.def19},#{entity.def20},#{entity.def21},#{entity.def22},#{entity.def23},#{entity.def24},#{entity.def25},#{entity.def26},#{entity.def27},#{entity.def28},#{entity.def29},#{entity.def30},#{entity.def31},#{entity.def32},#{entity.def33},#{entity.def34},#{entity.def35},#{entity.def36},#{entity.def37},#{entity.def38},#{entity.def39},#{entity.def40},#{entity.shiptopostalcode},#{entity.shiptoemail},#{entity.platformdiscounts},#{entity.merchantdiscounts},#{entity.expertdiscounts},#{entity.paydiscounts},#{entity.modified})
</foreach> </foreach>
</insert> </insert>
<!-- 批量新增或者修改--> <!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true"> <insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into tocofs_saleout(id,clientCode, companyCode, storeCode, facilityCode, code, refOrderId, refOrderCode, refOrderType, status, consolidated, internalInstructionType, bizChannel, sourcePlatformCode, processType, sourceOrderId, sourceOrderCode, shipToAttentionTo, sourceUserAccount, shipToAddress, shipToCountry, shipToState, shipToCity, shipToDistrict, shipToMobile, totalLines, totalQty, totalContainers, totalCases, totalWeight, totalVolume, totalVolumeWeight, weightUM, volumeUM, totalAmount, totalPayAmount, postageAmount, itemTotalAmount, totalFulfillQty, totalFulfillWeight, totalFulfillVolume, totalFulfillVolumeWeight, shipAt, carrierCode, primaryWaybillCode, paymentStatus, codRequired, invoiceRequired, paidAt, shipFromAttentionTo, shipFromAddress, shipFromDistrict, shipFromCity, shipFromState, shipFromCountry, shipFromPostalCode, shipFromPhone, shipFromMobile, shipFromFax, shipFromEmail, codAmount, tax, taxPaid, tradeSuccessAt, sourceOrderStatus, shipToStateName, shipToCityName, shipToDistrictName, shipmentType, def1, def2, def3, def4, def5, def6, def7, def8, def9, def10, def11, def12, def13, def14, def15, def16, def17, def18, def19, def20, def21, def22, def23, def24, def25, def26, def27, def28, def29, def30, def31, def32, def33, def34, def35, def36, def37, def38, def39, def40) insert into tocofs_saleout(id,clientCode, companyCode, storeCode, facilityCode, code, refOrderId, refOrderCode, refOrderType, status, consolidated, internalInstructionType, bizChannel, sourcePlatformCode, processType, sourceOrderId, sourceOrderCode, shipToAttentionTo, sourceUserAccount, shipToAddress, shipToCountry, shipToState, shipToCity, shipToDistrict, shipToMobile, totalLines, totalQty, totalContainers, totalCases, totalWeight, totalVolume, totalVolumeWeight, weightUM, volumeUM, totalAmount, totalPayAmount, postageAmount, itemTotalAmount, totalFulfillQty, totalFulfillWeight, totalFulfillVolume, totalFulfillVolumeWeight, shipAt, carrierCode, primaryWaybillCode, paymentStatus, codRequired, invoiceRequired, paidAt, shipFromAttentionTo, shipFromAddress, shipFromDistrict, shipFromCity, shipFromState, shipFromCountry, shipFromPostalCode, shipFromPhone, shipFromMobile, shipFromFax, shipFromEmail, codAmount, tax, taxPaid, tradeSuccessAt, sourceOrderStatus, shipToStateName, shipToCityName, shipToDistrictName, shipmentType, def1, def2, def3, def4, def5, def6, def7, def8, def9, def10, def11, def12, def13, def14, def15, def16, def17, def18, def19, def20, def21, def22, def23, def24, def25, def26, def27, def28, def29, def30, def31, def32, def33, def34, def35, def36, def37, def38, def39, def40,shipToPostalCode,shipToEmail,platformDiscounts,merchantDiscounts,expertDiscounts,payDiscounts,modified)
values values
<foreach collection="list" item="entity" separator=","> <foreach collection="list" item="entity" separator=",">
(#{entity.id},#{entity.clientcode},#{entity.companycode},#{entity.storecode},#{entity.facilitycode},#{entity.code},#{entity.reforderid},#{entity.refordercode},#{entity.refordertype},#{entity.status},#{entity.consolidated},#{entity.internalinstructiontype},#{entity.bizchannel},#{entity.sourceplatformcode},#{entity.processtype},#{entity.sourceorderid},#{entity.sourceordercode},#{entity.shiptoattentionto},#{entity.sourceuseraccount},#{entity.shiptoaddress},#{entity.shiptocountry},#{entity.shiptostate},#{entity.shiptocity},#{entity.shiptodistrict},#{entity.shiptomobile},#{entity.totallines},#{entity.totalqty},#{entity.totalcontainers},#{entity.totalcases},#{entity.totalweight},#{entity.totalvolume},#{entity.totalvolumeweight},#{entity.weightum},#{entity.volumeum},#{entity.totalamount},#{entity.totalpayamount},#{entity.postageamount},#{entity.itemtotalamount},#{entity.totalfulfillqty},#{entity.totalfulfillweight},#{entity.totalfulfillvolume},#{entity.totalfulfillvolumeweight},#{entity.shipat},#{entity.carriercode},#{entity.primarywaybillcode},#{entity.paymentstatus},#{entity.codrequired},#{entity.invoicerequired},#{entity.paidat},#{entity.shipfromattentionto},#{entity.shipfromaddress},#{entity.shipfromdistrict},#{entity.shipfromcity},#{entity.shipfromstate},#{entity.shipfromcountry},#{entity.shipfrompostalcode},#{entity.shipfromphone},#{entity.shipfrommobile},#{entity.shipfromfax},#{entity.shipfromemail},#{entity.codamount},#{entity.tax},#{entity.taxpaid},#{entity.tradesuccessat},#{entity.sourceorderstatus},#{entity.shiptostatename},#{entity.shiptocityname},#{entity.shiptodistrictname},#{entity.shipmenttype},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.def11},#{entity.def12},#{entity.def13},#{entity.def14},#{entity.def15},#{entity.def16},#{entity.def17},#{entity.def18},#{entity.def19},#{entity.def20},#{entity.def21},#{entity.def22},#{entity.def23},#{entity.def24},#{entity.def25},#{entity.def26},#{entity.def27},#{entity.def28},#{entity.def29},#{entity.def30},#{entity.def31},#{entity.def32},#{entity.def33},#{entity.def34},#{entity.def35},#{entity.def36},#{entity.def37},#{entity.def38},#{entity.def39},#{entity.def40}) (#{entity.id},#{entity.clientcode},#{entity.companycode},#{entity.storecode},#{entity.facilitycode},#{entity.code},#{entity.reforderid},#{entity.refordercode},#{entity.refordertype},#{entity.status},#{entity.consolidated},#{entity.internalinstructiontype},#{entity.bizchannel},#{entity.sourceplatformcode},#{entity.processtype},#{entity.sourceorderid},#{entity.sourceordercode},#{entity.shiptoattentionto},#{entity.sourceuseraccount},#{entity.shiptoaddress},#{entity.shiptocountry},#{entity.shiptostate},#{entity.shiptocity},#{entity.shiptodistrict},#{entity.shiptomobile},#{entity.totallines},#{entity.totalqty},#{entity.totalcontainers},#{entity.totalcases},#{entity.totalweight},#{entity.totalvolume},#{entity.totalvolumeweight},#{entity.weightum},#{entity.volumeum},#{entity.totalamount},#{entity.totalpayamount},#{entity.postageamount},#{entity.itemtotalamount},#{entity.totalfulfillqty},#{entity.totalfulfillweight},#{entity.totalfulfillvolume},#{entity.totalfulfillvolumeweight},#{entity.shipat},#{entity.carriercode},#{entity.primarywaybillcode},#{entity.paymentstatus},#{entity.codrequired},#{entity.invoicerequired},#{entity.paidat},#{entity.shipfromattentionto},#{entity.shipfromaddress},#{entity.shipfromdistrict},#{entity.shipfromcity},#{entity.shipfromstate},#{entity.shipfromcountry},#{entity.shipfrompostalcode},#{entity.shipfromphone},#{entity.shipfrommobile},#{entity.shipfromfax},#{entity.shipfromemail},#{entity.codamount},#{entity.tax},#{entity.taxpaid},#{entity.tradesuccessat},#{entity.sourceorderstatus},#{entity.shiptostatename},#{entity.shiptocityname},#{entity.shiptodistrictname},#{entity.shipmenttype},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.def11},#{entity.def12},#{entity.def13},#{entity.def14},#{entity.def15},#{entity.def16},#{entity.def17},#{entity.def18},#{entity.def19},#{entity.def20},#{entity.def21},#{entity.def22},#{entity.def23},#{entity.def24},#{entity.def25},#{entity.def26},#{entity.def27},#{entity.def28},#{entity.def29},#{entity.def30},#{entity.def31},#{entity.def32},#{entity.def33},#{entity.def34},#{entity.def35},#{entity.def36},#{entity.def37},#{entity.def38},#{entity.def39},#{entity.def40},#{entity.shiptopostalcode},#{entity.shiptoemail},#{entity.platformdiscounts},#{entity.merchantdiscounts},#{entity.expertdiscounts},#{entity.paydiscounts},#{entity.modified})
</foreach> </foreach>
on duplicate key update on duplicate key update
id = values(id), id = values(id),
@ -1063,7 +1140,16 @@
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),
shipToPostalCode = values(shipToPostalCode),
shipToEmail = values(shipToEmail),
platformDiscounts = values(platformDiscounts),
merchantDiscounts = values(merchantDiscounts),
expertDiscounts = values(expertDiscounts),
payDiscounts = values(payDiscounts),
modified = values(modified)
</insert>
<!--通过主键修改方法--> <!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutEntity" > <update id="entity_update" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutEntity" >
update tocofs_saleout set update tocofs_saleout set
@ -1176,14 +1262,24 @@
<if test="def38 != null and def38 != ''"> def38 = #{def38},</if> <if test="def38 != null and def38 != ''"> def38 = #{def38},</if>
<if test="def39 != null and def39 != ''"> def39 = #{def39},</if> <if test="def39 != null and def39 != ''"> def39 = #{def39},</if>
<if test="def40 != null and def40 != ''"> def40 = #{def40},</if> <if test="def40 != null and def40 != ''"> def40 = #{def40},</if>
<if test="shiptopostalcode != null and shiptopostalcode != ''"> shipToPostalCode = #{shiptopostalcode},</if>
<if test="shiptoemail != null and shiptoemail != ''"> shipToEmail = #{shiptoemail},</if>
<if test="platformdiscounts != null and platformdiscounts != ''"> platformDiscounts = #{platformdiscounts},</if>
<if test="merchantdiscounts != null and merchantdiscounts != ''"> merchantDiscounts = #{merchantdiscounts},</if>
<if test="expertdiscounts != null and expertdiscounts != ''"> expertDiscounts = #{expertdiscounts},</if>
<if test="paydiscounts != null and paydiscounts != ''"> payDiscounts = #{paydiscounts},</if>
<if test="modified != null and modified != ''"> modified = #{modified},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
<!-- 逻辑删除 --> <!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutEntity" > <update id="entity_logicDelete" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutEntity" >
update tocofs_saleout set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} update tocofs_saleout set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where id = #{id} where id = #{id}
</update> </update>
<!-- 多条件逻辑删除 --> <!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutEntity" > <update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutEntity" >
update tocofs_saleout set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} update tocofs_saleout set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
@ -1257,6 +1353,15 @@
<if test="shiptocityname != null and shiptocityname != ''"> and shipToCityName = #{shiptocityname} </if> <if test="shiptocityname != null and shiptocityname != ''"> and shipToCityName = #{shiptocityname} </if>
<if test="shiptodistrictname != null and shiptodistrictname != ''"> and shipToDistrictName = #{shiptodistrictname} </if> <if test="shiptodistrictname != null and shiptodistrictname != ''"> and shipToDistrictName = #{shiptodistrictname} </if>
<if test="shipmenttype != null and shipmenttype != ''"> and shipmentType = #{shipmenttype} </if> <if test="shipmenttype != null and shipmenttype != ''"> and shipmentType = #{shipmenttype} </if>
<if test="shiptopostalcode != null and shiptopostalcode != ''"> and shipToPostalCode = #{shiptopostalcode} </if>
<if test="shiptoemail != null and shiptoemail != ''"> and shipToEmail = #{shiptoemail} </if>
<if test="platformdiscounts != null and platformdiscounts != ''"> and platformDiscounts = #{platformdiscounts} </if>
<if test="merchantdiscounts != null and merchantdiscounts != ''"> and merchantDiscounts = #{merchantdiscounts} </if>
<if test="expertdiscounts != null and expertdiscounts != ''"> and expertDiscounts = #{expertdiscounts} </if>
<if test="paydiscounts != null and paydiscounts != ''"> and payDiscounts = #{paydiscounts} </if>
<if test="modified != null and modified != ''"> and modified = #{modified} </if>
<if test="def1 != null and def1 != ''"> and def1 = #{def1} </if> <if test="def1 != null and def1 != ''"> and def1 = #{def1} </if>
<if test="def2 != null and def2 != ''"> and def2 = #{def2} </if> <if test="def2 != null and def2 != ''"> and def2 = #{def2} </if>
<if test="def3 != null and def3 != ''"> and def3 = #{def3} </if> <if test="def3 != null and def3 != ''"> and def3 = #{def3} </if>
@ -1300,6 +1405,7 @@
and sts='Y' and sts='Y'
</trim> </trim>
</update> </update>
<!--通过主键删除--> <!--通过主键删除-->
<delete id="entity_delete"> <delete id="entity_delete">
delete from tocofs_saleout where id = #{id} delete from tocofs_saleout where id = #{id}

View File

@ -137,6 +137,7 @@ public class SoSaleOutPluginInitializerToC 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"));//sceneTypestocktran String sceneType = String.valueOf(requestJson.get("sceneType"));//sceneTypestocktran
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)) {
@ -146,15 +147,15 @@ public class SoSaleOutPluginInitializerToC 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");
startImplementTranByTime(startAndEndVos.get(0).getStart_time(), startAndEndVos.get(0).getEnd_time()); startImplementTranByTime(startAndEndVos.get(0).getStart_time(), startAndEndVos.get(0).getEnd_time(), "0");
} }
} }
} catch (Exception e) { } catch (Exception e) {
@ -220,11 +221,12 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
/** /**
* 库存同步按指定时间拉取 * 库存同步按指定时间拉取
* *
* @param startTime O出库开始时间 * @param startTime O出库开始时间
* @param endTime O出库结束时间 * @param endTime O出库结束时间
* @param pushScenarioType 推送纬度场景值
* @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);
@ -232,22 +234,38 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
Assert.notNull(startTime, "查询条件,开始时间不能为空!"); Assert.notNull(startTime, "查询条件,开始时间不能为空!");
Assert.notNull(endTime, "查询条件,结束时间不能为空!"); Assert.notNull(endTime, "查询条件,结束时间不能为空!");
Assert.notNull(pushScenarioType, "推送场景不能为空!");
String tocShop = shopTobOrToCUtil.getCommaShop("TOC");
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList = new ArrayList<>(); List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList = new ArrayList<>();
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); if (ProfilesActiveConstant.PUSH_SCENE_TYPE_0.equals(pushScenarioType) || ProfilesActiveConstant.PUSH_SCENE_TYPE_2.equals(pushScenarioType)) {
queryOfsSoSaleOutVo.setShipAt_start(startTime); //满足以下两个场景时触发查询
queryOfsSoSaleOutVo.setShipAt_end(endTime); //0:o->中台
queryOfsSoSaleOutVo.setClientCode("LETS"); //2:o->中台->u8c
queryOfsSoSaleOutVo.setInternalInstructionType("SALES,EXCHANGE,REISSUE,NEIBULINGYONG,INPURCHASE,HUOFAN"); String tocShop = shopTobOrToCUtil.getCommaShop("TOC");
queryOfsSoSaleOutVo.setStatus(900L); QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
queryOfsSoSaleOutVo.setPageNo(1L); queryOfsSoSaleOutVo.setShipAt_start(startTime);
queryOfsSoSaleOutVo.setPageSize(100L); queryOfsSoSaleOutVo.setShipAt_end(endTime);
queryOfsSoSaleOutVo.setStoreCode(tocShop); queryOfsSoSaleOutVo.setClientCode("LETS");
queryOfsSoSaleOutVo.setInternalInstructionType("SALES,EXCHANGE,REISSUE,NEIBULINGYONG,INPURCHASE,HUOFAN");
ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L, "ofs.shipment.search"); queryOfsSoSaleOutVo.setStatus(900L);
logger.info("数据返回行数:{}", headerDetailsDtoList.size()); queryOfsSoSaleOutVo.setPageNo(1L);
if (headerDetailsDtoList.size() > 0) { queryOfsSoSaleOutVo.setPageSize(100L);
queryOfsSoSaleOutVo.setStoreCode(tocShop);
ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L, "ofs.shipment.search");
logger.info("数据返回行数:{}", headerDetailsDtoList.size());
} else if (ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType)) {
//满足以下两个场景时触发Mysql还原O销售出库的对象
//1:中台->u8c
TocofsSaleoutDetailedEntity tocofsSaleoutDetailedEntity = new TocofsSaleoutDetailedEntity();
tocofsSaleoutDetailedEntity.setBusinessDateStart(startTime);
tocofsSaleoutDetailedEntity.setBusinessDateEnd(endTime);
tocofsSaleoutDetailedEntity.setBusinesstype("TOC_ORDER");
headerDetailsDtoList = queryTocOfsSaleoutDetailed(tocofsSaleoutDetailedEntity);
} else {
Assert.state(false, "未知的场景类型!");
}
//执行主逻辑,并且过滤掉不需要的公司
if (headerDetailsDtoList != null && headerDetailsDtoList.size() > 0) {
headerDetailsDtoList.removeIf(new Predicate<HeaderDetailsDto>() { headerDetailsDtoList.removeIf(new Predicate<HeaderDetailsDto>() {
@Override @Override
public boolean test(HeaderDetailsDto headerDetailsDto) { public boolean test(HeaderDetailsDto headerDetailsDto) {
@ -260,10 +278,10 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
return false; return false;
} }
}); });
getSetStock(headerDetailsDtoList);
} else { } else {
logger.info("TOC没有查询到任何数据不需要同步"); logger.info("TOC没有查询到任何数据不需要同步");
} }
getSetStock(headerDetailsDtoList, pushScenarioType);
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));
@ -280,58 +298,58 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
* @param endTime O出库结束时间 * @param endTime O出库结束时间
* @author liuyang * @author liuyang
*/ */
public void startImplementStockByTimeAndTran(String startTime, String endTime) throws Exception { // public void startImplementStockByTimeAndTran(String startTime, String endTime) 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);
logger.info(threadNameStrStart); // logger.info(threadNameStrStart);
//
Assert.notNull(startTime, "查询条件,开始时间不能为空!"); // Assert.notNull(startTime, "查询条件,开始时间不能为空!");
Assert.notNull(endTime, "查询条件,结束时间不能为空!"); // Assert.notNull(endTime, "查询条件,结束时间不能为空!");
//
// CalculateDateVo calculateDateVo = DateStrUtil.calculateCalculateEntireDayPeriod(dateStr); //// CalculateDateVo calculateDateVo = DateStrUtil.calculateCalculateEntireDayPeriod(dateStr);
String tobShop = shopTobOrToCUtil.getCommaShop("TOC"); // String tobShop = shopTobOrToCUtil.getCommaShop("TOC");
//
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList = new ArrayList<>(); // List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList = new ArrayList<>();
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); // QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
// queryOfsSoSaleOutVo.setShipAt_start(calculateDateVo.getStart_time()); //// queryOfsSoSaleOutVo.setShipAt_start(calculateDateVo.getStart_time());
// queryOfsSoSaleOutVo.setShipAt_end(calculateDateVo.getEnd_time()); //// queryOfsSoSaleOutVo.setShipAt_end(calculateDateVo.getEnd_time());
queryOfsSoSaleOutVo.setShipAt_start(startTime); // queryOfsSoSaleOutVo.setShipAt_start(startTime);
queryOfsSoSaleOutVo.setShipAt_end(endTime); // queryOfsSoSaleOutVo.setShipAt_end(endTime);
queryOfsSoSaleOutVo.setClientCode("LETS"); // queryOfsSoSaleOutVo.setClientCode("LETS");
queryOfsSoSaleOutVo.setInternalInstructionType("SALES,EXCHANGE,REISSUE,NEIBULINGYONG,INPURCHASE,HUOFAN"); // queryOfsSoSaleOutVo.setInternalInstructionType("SALES,EXCHANGE,REISSUE,NEIBULINGYONG,INPURCHASE,HUOFAN");
queryOfsSoSaleOutVo.setStatus(900L); // queryOfsSoSaleOutVo.setStatus(900L);
queryOfsSoSaleOutVo.setPageNo(1L); // queryOfsSoSaleOutVo.setPageNo(1L);
queryOfsSoSaleOutVo.setPageSize(100L); // queryOfsSoSaleOutVo.setPageSize(100L);
queryOfsSoSaleOutVo.setStoreCode(tobShop); // queryOfsSoSaleOutVo.setStoreCode(tobShop);
// queryOfsSoSaleOutVo.setCode("LETS-SH2024070500000003"); //// queryOfsSoSaleOutVo.setCode("LETS-SH2024070500000003");
ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L, "ofs.shipment.search"); // ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L, "ofs.shipment.search");
logger.info("数据返回行数:{}", headerDetailsDtoList.size()); // logger.info("数据返回行数:{}", headerDetailsDtoList.size());
if (headerDetailsDtoList.size() > 0) { // if (headerDetailsDtoList.size() > 0) {
headerDetailsDtoList.removeIf(new Predicate<HeaderDetailsDto>() { // headerDetailsDtoList.removeIf(new Predicate<HeaderDetailsDto>() {
@Override // @Override
public boolean test(HeaderDetailsDto headerDetailsDto) { // public boolean test(HeaderDetailsDto headerDetailsDto) {
HeaderDto header = headerDetailsDto.getHeader(); // HeaderDto header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { // if (header != null && header.getCompanyCode() != null) {
if (ProfilesActiveConstant.FILTER_COMPANY.contains(header.getCompanyCode().trim())) { // if (ProfilesActiveConstant.FILTER_COMPANY.contains(header.getCompanyCode().trim())) {
return true; // return true;
} // }
} // }
return false; // return false;
} // }
}); // });
getSetStock(headerDetailsDtoList); // getSetStock(headerDetailsDtoList);
} else { // } else {
logger.info("TOC没有查询到任何数据不需要同步"); // logger.info("TOC没有查询到任何数据不需要同步");
} // }
//
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);
} catch (Exception e) { // } catch (Exception e) {
logger.error("startImplementStockByTime方法抛出异常", e); // logger.error("startImplementStockByTime方法抛出异常", e);
} // }
} // }
/** /**
* 根据出库单编码拉取 * 根据出库单编码拉取
@ -375,9 +393,9 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
} }
}); });
if (sceneType.equals("stock")) { if (sceneType.equals("stock")) {
getSetStock(headerDetailsDtoList); getSetStock(headerDetailsDtoList, "2");
} else if (sceneType.equals("tran")) { } else if (sceneType.equals("tran")) {
getSetTran(headerDetailsDtoList); getSetTran(headerDetailsDtoList, "2");
} }
} else { } else {
logger.info("没有查询到任何数据!不需要同步"); logger.info("没有查询到任何数据!不需要同步");
@ -398,7 +416,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
* @param endTime O交易完成结束时间 * @param endTime O交易完成结束时间
* @author liuyang * @author liuyang
*/ */
public void startImplementTranByTime(String startTime, String endTime) throws Exception { public void startImplementTranByTime(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);
@ -406,25 +424,39 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
Assert.notNull(startTime, "查询条件,开始时间不能为空!"); Assert.notNull(startTime, "查询条件,开始时间不能为空!");
Assert.notNull(endTime, "查询条件,结束时间不能为空!"); Assert.notNull(endTime, "查询条件,结束时间不能为空!");
Assert.notNull(pushScenarioType, "推送场景不能为空!");
String tocShop = shopTobOrToCUtil.getCommaShop("TOC");
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList = new ArrayList<>(); List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList = new ArrayList<>();
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); if (ProfilesActiveConstant.PUSH_SCENE_TYPE_0.equals(pushScenarioType) || ProfilesActiveConstant.PUSH_SCENE_TYPE_2.equals(pushScenarioType)) {
queryOfsSoSaleOutVo.setTradeSuccessAt_start(startTime); String tocShop = shopTobOrToCUtil.getCommaShop("TOC");
queryOfsSoSaleOutVo.setTradeSuccessAt_end(endTime); QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
queryOfsSoSaleOutVo.setClientCode("LETS"); queryOfsSoSaleOutVo.setTradeSuccessAt_start(startTime);
queryOfsSoSaleOutVo.setInternalInstructionType("SALES,EXCHANGE,REISSUE,NEIBULINGYONG,INPURCHASE,HUOFAN"); queryOfsSoSaleOutVo.setTradeSuccessAt_end(endTime);
queryOfsSoSaleOutVo.setSourceOrderStatus("TRADE_FINISHED");//交易成功状态 queryOfsSoSaleOutVo.setClientCode("LETS");
queryOfsSoSaleOutVo.setPageNo(1L); queryOfsSoSaleOutVo.setInternalInstructionType("SALES,EXCHANGE,REISSUE,NEIBULINGYONG,INPURCHASE,HUOFAN");
queryOfsSoSaleOutVo.setPageSize(100L); queryOfsSoSaleOutVo.setSourceOrderStatus("TRADE_FINISHED");//交易成功状态
queryOfsSoSaleOutVo.setStoreCode(tocShop); queryOfsSoSaleOutVo.setPageNo(1L);
ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L, "ofs.shipment.search"); queryOfsSoSaleOutVo.setPageSize(100L);
//测试 queryOfsSoSaleOutVo.setStoreCode(tocShop);
ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L, "ofs.shipment.search");
//测试
// for (int i = 0; i < headerDetailsDtoList.size(); i++) { // for (int i = 0; i < headerDetailsDtoList.size(); i++) {
// HeaderDetailsDto headerDetailsDto = headerDetailsDtoList.get(i); // HeaderDetailsDto headerDetailsDto = headerDetailsDtoList.get(i);
// HeaderDto header = headerDetailsDto.getHeader(); // HeaderDto header = headerDetailsDto.getHeader();
// logger.info("CODE" + header.getCode()); // logger.info("CODE" + header.getCode());
// } // }
} else if (ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType)) {
//满足以下两个场景时触发Mysql还原O销售出库的对象
//1:中台->u8c
TocofsSaleoutDetailedEntity tocofsSaleoutDetailedEntity = new TocofsSaleoutDetailedEntity();
tocofsSaleoutDetailedEntity.setSuccessfultradedateStart(startTime);
tocofsSaleoutDetailedEntity.setSuccessfultradedateEnd(endTime);
tocofsSaleoutDetailedEntity.setBusinesstype("TOC_ORDER");
headerDetailsDtoList = queryTocOfsSaleoutDetailed(tocofsSaleoutDetailedEntity);
} else {
logger.info("TOC没有查询到任何数据不需要同步");
}
logger.info("TOC数据返回行数{}", headerDetailsDtoList.size()); logger.info("TOC数据返回行数{}", headerDetailsDtoList.size());
if (headerDetailsDtoList.size() > 0) { if (headerDetailsDtoList.size() > 0) {
headerDetailsDtoList.removeIf(new Predicate<HeaderDetailsDto>() { headerDetailsDtoList.removeIf(new Predicate<HeaderDetailsDto>() {
@ -439,11 +471,10 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
return false; return false;
} }
}); });
getSetTran(headerDetailsDtoList); getSetTran(headerDetailsDtoList, pushScenarioType);
} else { } else {
logger.info("TOC没有查询到任何数据不需要同步"); logger.info("TOC没有查询到任何数据不需要同步");
} }
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);
@ -454,18 +485,26 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
/** /**
* 库存同步触发数据转换之前的预备逻辑 * 库存同步触发数据转换之前的预备逻辑
* 推送场景类型
* 0:o->中台状态暂存
* 1:中台->u8c成功或失败
* 2->o->中台->u8c成功或失败
* *
* @param headerDetailsDtoList 原始查询得出的O销售出库数据
* @param pushScenarioType 推送场景类型 0:o->中台1:中台->u8c2:o->中台->u8c
* @author liuyang * @author liuyang
*/ */
private void getSetStock(List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList) throws Exception { private void getSetStock(List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList, String pushScenarioType) throws Exception {
LOCK1.lock(); LOCK1.lock();
try { try {
//过滤成功的数据 //过滤成功的数据
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtos = filterDataStock(headerDetailsDtoList); List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtos = filterDataStock(headerDetailsDtoList);
//保存到mysql底表 //保存到mysql底表
batchInsert(headerDetailsDtos); if (!ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType)) {
batchInsert(headerDetailsDtos);
}
//执行推送主逻辑 //执行推送主逻辑
implementStock(headerDetailsDtos); implementStock(headerDetailsDtos, pushScenarioType);
} catch (Exception e) { } catch (Exception e) {
logger.error("TOC销售-库存getSetStock方法抛出异常", e); logger.error("TOC销售-库存getSetStock方法抛出异常", e);
} finally { } finally {
@ -478,16 +517,18 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
* *
* @author liuyang * @author liuyang
*/ */
private void getSetTran(List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList) throws Exception { private void getSetTran(List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList, String pushScenarioType) throws Exception {
LOCK2.lock(); LOCK2.lock();
try { try {
//先过滤成功的数据再保存到低表 //先过滤成功的数据再保存到低表
//headerDetailsDtos携带红蓝单据推送成功与否的明细行 //headerDetailsDtos携带红蓝单据推送成功与否的明细行
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtos = filterDataTran(headerDetailsDtoList); List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtos = filterDataTran(headerDetailsDtoList);
//保存到mysql底表 if (!ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType)) {
batchInsert(headerDetailsDtos); //保存到mysql底表
batchInsert(headerDetailsDtos);
}
//执行推送主逻辑 //执行推送主逻辑
implementTran(headerDetailsDtos); implementTran(headerDetailsDtos, pushScenarioType);
} catch (Exception e) { } catch (Exception e) {
logger.error("TOC销售-交易成功getSetTran方法抛出异常", e); logger.error("TOC销售-交易成功getSetTran方法抛出异常", e);
} finally { } finally {
@ -599,7 +640,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
}).collect(Collectors.toList()); }).collect(Collectors.toList());
Map<String, String> no2NameMap = resultList.stream().collect(Collectors.toMap(TocofsSaleoutDetailedEntity::getId, TocofsSaleoutDetailedEntity::getNewstate)); Map<String, String> no2NameMap = resultList.stream().collect(Collectors.toMap(TocofsSaleoutDetailedEntity::getId, TocofsSaleoutDetailedEntity::getNewstate));
//字段Y(成功)或者为H(处理)可以视为成功完成了小段业务闭环的数据行 //字段Y(成功)或者为H(手工处理)可以视为成功完成了小段业务闭环的数据行
String succeseeY = "Y"; String succeseeY = "Y";
String succeseeH = "H"; String succeseeH = "H";
for (int i = 0; i < headerDetailsDtoList.size(); i++) { for (int i = 0; i < headerDetailsDtoList.size(); i++) {
@ -778,7 +819,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
List<TocofsSaleoutEntity> tocofsSaleoutEntityList = copyHeaderDto(headerDtoList); List<TocofsSaleoutEntity> tocofsSaleoutEntityList = copyHeaderDto(headerDtoList);
if (tocofsSaleoutEntityList != null && tocofsSaleoutEntityList.size() > 0) { if (tocofsSaleoutEntityList != null && tocofsSaleoutEntityList.size() > 0) {
logger.info("TocofsSaleoutEntity插入底表{}个对象(表头)", tocofsSaleoutEntityList.size()); logger.info("TocofsSaleoutEntity插入底表{}个对象(表头)", tocofsSaleoutEntityList.size());
iTocofsSaleoutDao.entityInsertOrUpdateBatch(tocofsSaleoutEntityList); iTocofsSaleoutDao.entityInsertBatch(tocofsSaleoutEntityList);
} else { } else {
logger.info("TocofsSaleoutEntityTOC业务没有对象被插入表头底表"); logger.info("TocofsSaleoutEntityTOC业务没有对象被插入表头底表");
} }
@ -809,7 +850,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities = copyDetailsDto(detailsDtos); List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities = copyDetailsDto(detailsDtos);
if (tocofsSaleoutDetailedEntities.size() > 0) { if (tocofsSaleoutDetailedEntities.size() > 0) {
logger.info("TocofsSaleoutDetailedEntity插入底表{}个对象(表体)", tocofsSaleoutDetailedEntities.size()); logger.info("TocofsSaleoutDetailedEntity插入底表{}个对象(表体)", tocofsSaleoutDetailedEntities.size());
iTocofsSaleoutDetailedDao.entityInsertOrUpdateBatch(tocofsSaleoutDetailedEntities); iTocofsSaleoutDetailedDao.entityInsertBatch(tocofsSaleoutDetailedEntities);
} else { } else {
logger.info("TocofsSaleoutDetailedEntity没有对象被插入表头底表"); logger.info("TocofsSaleoutDetailedEntity没有对象被插入表头底表");
} }
@ -890,9 +931,11 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
* 库存同步代码同步逻辑 * 库存同步代码同步逻辑
* *
* @param headerDetailsDtos 查询得到的O出库单对象 * @param headerDetailsDtos 查询得到的O出库单对象
* @param pushScenarioType 推送场景类型
* @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, String pushScenarioType) throws Exception {
Assert.notNull(pushScenarioType, "pushScenarioType推送场景类型");
if (headerDetailsDtos != null) { if (headerDetailsDtos != null) {
logger.info("TOC销售库存业务{}行需要进行数据转换", headerDetailsDtos.size()); logger.info("TOC销售库存业务{}行需要进行数据转换", headerDetailsDtos.size());
} }
@ -1199,30 +1242,41 @@ public class SoSaleOutPluginInitializerToC 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<>();
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);
updateSuccessOrFail1(oldValue, "Y", "success", vreceiptcode, csaleid);
} else if (ProfilesActiveConstant.PUSH_SCENE_TYPE_0.equals(pushScenarioType)) {
//不推送U8C仅发起记录
String vreceiptcode = "暂存";
String csaleid = "暂存";
String newstate = "S";
String newTransmitInfo = "暂存";
updateSuccessOrFail1(oldValue, newstate, newTransmitInfo, vreceiptcode, csaleid);
} else {
Assert.state(false, "未知的场景类型 pushScenarioType={}", pushScenarioType);
}
//记录成功 //记录成功
//日志推送的详情两种方法是推送U8C成功之后记录还是整理推送完毕后再记录 //日志推送的详情两种方法是推送U8C成功之后记录还是整理推送完毕后再记录
//护童项目之前是整体推送之前记录后来抛出链接失效的异常而且只有程序执行完毕后才能体现结果执行过程中无法发现结果 //护童项目之前是整体推送之前记录后来抛出链接失效的异常而且只有程序执行完毕后才能体现结果执行过程中无法发现结果
//所以还是需要等待U8C接口推送成功之后马上发生信息的记录时间下来这样足够稳定同步速度上没有大的问题 //所以还是需要等待U8C接口推送成功之后马上发生信息的记录时间下来这样足够稳定同步速度上没有大的问题
//TODO 测试解决方案 //测试解决方案
vreceiptcode = "暂存"; // vreceiptcode = "暂存";
csaleid = "暂存"; // csaleid = "暂存";
updateSuccessOrFail1(oldValue, "S", "暂存", vreceiptcode, csaleid); // updateSuccessOrFail1(oldValue, "S", "暂存", vreceiptcode, csaleid);
// updateSuccessOrFail1(oldValue, "Y", "success", vreceiptcode, csaleid); // updateSuccessOrFail1(oldValue, "Y", "success", vreceiptcode, csaleid);
} catch (Exception e) { } catch (Exception e) {
logger.error("TOC业务转换成U8C对象过程中、或者单据推送到U8C出现异常", e); logger.error("TOC业务转换成U8C对象过程中、或者单据推送到U8C出现异常", e);
@ -2069,7 +2123,9 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
* @param headerDetailsDtos 查询得到的O出库单对象 * @param headerDetailsDtos 查询得到的O出库单对象
* @author liuyang * @author liuyang
*/ */
private void implementTran(List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtos) throws Exception { private void implementTran(List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtos, String pushScenarioType) throws Exception {
Assert.notNull(pushScenarioType, "pushScenarioType不能为空");
if (headerDetailsDtos != null && headerDetailsDtos.size() > 0) { if (headerDetailsDtos != null && headerDetailsDtos.size() > 0) {
logger.info("TOC销售库存业务{}行需要进行数据转换", headerDetailsDtos.size()); logger.info("TOC销售库存业务{}行需要进行数据转换", headerDetailsDtos.size());
try { try {
@ -2374,37 +2430,40 @@ public class SoSaleOutPluginInitializerToC 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<>();
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) { SoSaleResultHeadDto parentvo = soSaleResultRootDto.getParentvo();
// SoSaleResultHeadDto parentvo = soSaleResultRootDto.getParentvo(); vreceiptcode = parentvo.getVreceiptcode();
// vreceiptcode = parentvo.getVreceiptcode(); pk_corp = parentvo.getPk_corp();
// pk_corp = parentvo.getPk_corp(); csaleid = parentvo.getCsaleid();
// csaleid = parentvo.getCsaleid(); } else {
// } else { logger.error("第一阶段推送令人匪夷所思的错误正常来说是不可能执行到这里的sendU8CTOCOrder方法的错误会向上抛出! json{}", JSON.toJSON(soSaleResultRootDto));
// logger.error("第一阶段推送令人匪夷所思的错误正常来说是不可能执行到这里的sendU8CTOCOrder方法的错误会向上抛出! json{}", JSON.toJSON(soSaleResultRootDto)); }
// } logger.info("第一阶段:负数销售订单->(自动生成) 负数销售出库单抛出成功,销售订单编号:{} 销售订单主键:{} 销售公司:{}", vreceiptcode, csaleid, pk_corp);
// logger.info("第一阶段:负数销售订单->(自动生成) 负数销售出库单抛出成功,销售订单编号:{} 销售订单主键:{} 销售公司:{}", vreceiptcode, csaleid, pk_corp); updateSuccessOrFail2(oldValue, "Y", "success", vreceiptcode, csaleid);
isOneSuccess = true; } else if (ProfilesActiveConstant.PUSH_SCENE_TYPE_0.equals(pushScenarioType)) {
//第一阶段记录成功 //不推送到U8C暂存
//TODO 临时方案 String vreceiptcode = "暂存";
vreceiptcode = "暂存"; String csaleid = "暂存";
csaleid = "暂存"; String newstate = "S";
updateSuccessOrFail2(oldValue, "S", "暂存", vreceiptcode, csaleid); String newTransmitInfo = "暂存";
// updateSuccessOrFail2(oldValue, "Y", "success", vreceiptcode, csaleid); updateSuccessOrFail2(oldValue, newstate, newTransmitInfo, vreceiptcode, csaleid);
} else {
Assert.state(false, "无法判断的业务类型");
}
} else { } else {
isOneSuccess = true;
logger.info("交易成功-红 业务日期:{} 汇总维度:{} 已经推送成功,不需要重新推送", header.getTradeSuccessAt(), keyGroup); logger.info("交易成功-红 业务日期:{} 汇总维度:{} 已经推送成功,不需要重新推送", header.getTradeSuccessAt(), keyGroup);
} }
isOneSuccess = true;
} catch (Exception e) { } catch (Exception e) {
logger.error("第一阶段:负数销售订单->(自动生成) 负数销售出库单抛出异常", e); logger.error("第一阶段:负数销售订单->(自动生成) 负数销售出库单抛出异常", e);
//第一阶段记录失败 //第一阶段记录失败
@ -2643,31 +2702,34 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
} }
//销售订单单据推送到u8c //销售订单单据推送到u8c
List<SaleorderRequestDto> saleorderRequestDtoList = new ArrayList<>(); if (ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType) || ProfilesActiveConstant.PUSH_SCENE_TYPE_2.equals(pushScenarioType)) {
saleorderRequestDtoList.add(saleorderRequestDto); List<SaleorderRequestDto> saleorderRequestDtoList = new ArrayList<>();
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) { SoSaleResultHeadDto parentvo = soSaleResultRootDto.getParentvo();
// SoSaleResultHeadDto parentvo = soSaleResultRootDto.getParentvo(); vreceiptcode = parentvo.getVreceiptcode();
// vreceiptcode = parentvo.getVreceiptcode(); pk_corp = parentvo.getPk_corp();
// pk_corp = parentvo.getPk_corp(); csaleid = parentvo.getCsaleid();
// csaleid = parentvo.getCsaleid(); } else {
// } else { logger.error("第二阶段推送令人匪夷所思的错误正常来说是不可能执行到这里的sendU8CTOCOrder方法的错误会向上抛出! json{}", JSON.toJSON(soSaleResultRootDto));
// logger.error("第二阶段推送令人匪夷所思的错误正常来说是不可能执行到这里的sendU8CTOCOrder方法的错误会向上抛出! json{}", JSON.toJSON(soSaleResultRootDto)); }
// } logger.info("第二阶段:负数销售订单->(自动生成) 负数销售出库单抛出成功,销售订单编号:{} 销售订单主键:{} 销售公司:{}", vreceiptcode, csaleid, pk_corp);
// logger.info("第二阶段:负数销售订单->(自动生成) 负数销售出库单抛出成功,销售订单编号:{} 销售订单主键:{} 销售公司:{}", vreceiptcode, csaleid, pk_corp); updateSuccessOrFail3(oldValue, "Y", "success", vreceiptcode, csaleid);
//TODO 临时方案 } else if (ProfilesActiveConstant.PUSH_SCENE_TYPE_0.equals(pushScenarioType)) {
vreceiptcode = "暂存"; String vreceiptcode = "暂存";
csaleid = "暂存"; String csaleid = "暂存";
//第二阶段记录成功 String newstate = "S";
updateSuccessOrFail3(oldValue, "S", "暂存", vreceiptcode, csaleid); String newTransmitInfo = "暂存";
// updateSuccessOrFail3(oldValue, "Y", "success", vreceiptcode, csaleid); updateSuccessOrFail3(oldValue, newstate, newTransmitInfo, vreceiptcode, csaleid);
} else {
Assert.state(false, "无法确定的业务类型");
}
} catch (Exception e) { } catch (Exception e) {
logger.error("第二阶段:销售订单 ->(自动生成) 销售出库单 ->(自动生成) 销售发票失败", e); logger.error("第二阶段:销售订单 ->(自动生成) 销售出库单 ->(自动生成) 销售发票失败", e);
String message = e.getMessage(); String message = e.getMessage();
@ -2688,7 +2750,6 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("外层转换逻辑抛出异常", e); logger.error("外层转换逻辑抛出异常", e);
// 记录失败
} }
} else { } else {
logger.error("确认收入部分没有需要推送到U8C的数据行"); logger.error("确认收入部分没有需要推送到U8C的数据行");
@ -3143,7 +3204,7 @@ public class SoSaleOutPluginInitializerToC 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不能为空");
@ -3151,6 +3212,9 @@ public class SoSaleOutPluginInitializerToC 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) {
@ -3159,9 +3223,9 @@ public class SoSaleOutPluginInitializerToC 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)) {
startImplementTranByTime(split[0], split[1]); startImplementTranByTime(split[0], split[1], pushScenarioType);
} }
} }
} }
@ -3169,9 +3233,9 @@ public class SoSaleOutPluginInitializerToC 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)) {
startImplementTranByTime(split[0], split[1]); startImplementTranByTime(split[0], split[1], pushScenarioType);
} }
} }
} catch (Exception e) { } catch (Exception e) {
@ -3938,4 +4002,78 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
// saleorderRequestChildrenDtoList.add(saleorderRequestChildrenDto1); // saleorderRequestChildrenDtoList.add(saleorderRequestChildrenDto1);
// } // }
// } // }
/**
* 查询OFS底表的O销售出库数据
*
* @param tocofsSaleoutDetailedEntity O销售出库查询条件
* @author liuyang
*/
public List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> queryTocOfsSaleoutDetailed(TocofsSaleoutDetailedEntity tocofsSaleoutDetailedEntity) {
Assert.notNull(tocofsSaleoutDetailedEntity, "tocofsSaleoutDetailedEntity不能为空");
// TocofsSaleoutDetailedEntity tocofsSaleoutDetailedEntity = new TocofsSaleoutDetailedEntity();
// tocofsSaleoutDetailedEntity.setBusinessDateStart();
// tocofsSaleoutDetailedEntity.setBusinessDateEnd();
// tocofsSaleoutDetailedEntity.setBusinesstype("TOC_ORDER");
//底表O销售出库单表头对象
List<TocofsSaleoutEntity> allTocofsSaleoutEntityList = new ArrayList<>();
//底表O销售出库单明细行
List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntityList = iTocofsSaleoutDetailedDao.query(tocofsSaleoutDetailedEntity);
if (tocofsSaleoutDetailedEntityList != null && tocofsSaleoutDetailedEntityList.size() > 0) {
List<List<TocofsSaleoutDetailedEntity>> splitListByCount = SplitListByCountUtil.splitListByCount(tocofsSaleoutDetailedEntityList, 1000);
for (int i = 0; i < splitListByCount.size(); i++) {
List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntityList1 = splitListByCount.get(i);
Set<String> mainTableIdSet = tocofsSaleoutDetailedEntityList1.stream().map(TocofsSaleoutDetailedEntity::getMaintableid).collect(Collectors.toSet());
String mainTableIds = mainTableIdSet.stream().map(id -> "'" + id + "'").collect(Collectors.joining(","));
//查询对应的O销售订单
TocofsSaleoutEntity tocofsSaleoutEntity = new TocofsSaleoutEntity();
tocofsSaleoutEntity.setIds(mainTableIds);
List<TocofsSaleoutEntity> tocofsSaleoutEntityList = iTocofsSaleoutDao.query(tocofsSaleoutEntity);
allTocofsSaleoutEntityList.addAll(tocofsSaleoutEntityList);
}
}
//通过O销售出库单表头匹配底表O销售出库单明细行
if (allTocofsSaleoutEntityList.size() > 0) {
for (int i = 0; i < allTocofsSaleoutEntityList.size(); i++) {
TocofsSaleoutEntity tocofsSaleoutEntity = allTocofsSaleoutEntityList.get(i);
List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntityList1 = new ArrayList<>();
for (int j = 0; j < tocofsSaleoutDetailedEntityList.size(); j++) {
TocofsSaleoutDetailedEntity tocofsSaleoutDetailedEntity1 = tocofsSaleoutDetailedEntityList.get(j);
if (tocofsSaleoutDetailedEntity1.getMaintableid().equals(tocofsSaleoutEntity.getId())) {
tocofsSaleoutDetailedEntityList1.add(tocofsSaleoutDetailedEntity1);
}
}
tocofsSaleoutEntity.setTocofsSaleoutDetailedEntityList(tocofsSaleoutDetailedEntityList1);
}
}
//转换为OFS销售出库单对象
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList = new ArrayList<>();
if (allTocofsSaleoutEntityList.size() > 0) {
for (int i = 0; i < allTocofsSaleoutEntityList.size(); i++) {
com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto headerDetailsDto = new HeaderDetailsDto();
headerDetailsDtoList.add(headerDetailsDto);
TocofsSaleoutEntity tocofsSaleoutEntity = allTocofsSaleoutEntityList.get(i);
HeaderDto headerDto = new HeaderDto();
BeanUtil.copyPropertiesV2(tocofsSaleoutEntity, headerDto);
headerDetailsDto.setHeader(headerDto);
List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntityList1 = tocofsSaleoutEntity.getTocofsSaleoutDetailedEntityList();
List<DetailsDto> detailsDtoList = new ArrayList<>();
headerDetailsDto.setDetails(detailsDtoList);
for (int j = 0; j < tocofsSaleoutDetailedEntityList1.size(); j++) {
TocofsSaleoutDetailedEntity tocofsSaleoutDetailedEntity1 = tocofsSaleoutDetailedEntityList1.get(j);
DetailsDto detailsDto = new DetailsDto();
BeanUtil.copyPropertiesV2(tocofsSaleoutDetailedEntity1, detailsDto);
detailsDtoList.add(detailsDto);
}
}
}
return headerDetailsDtoList;
}
} }

View File

@ -120,7 +120,7 @@ class SoSaleOutPluginInitializerToCTest {
// String aaa = "LETS-SH2024102800021196"; // String aaa = "LETS-SH2024102800021196";
// soSaleOutPluginInitializerToC.startImplementStockByTime("2024-12-06 09:25:39", "2024-12-06 09:25:39"); // soSaleOutPluginInitializerToC.startImplementStockByTime("2024-12-06 09:25:39", "2024-12-06 09:25:39");
soSaleOutPluginInitializerToC.startImplementStockByTime("2024-11-27 17:44:19", "2024-11-27 17:44:19"); soSaleOutPluginInitializerToC.startImplementStockByTime("2024-11-02 17:09:02", "2024-11-02 17:09:02", "0");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -128,7 +128,7 @@ class SoSaleOutPluginInitializerToCTest {
// soSaleOutPluginInitializerToC.sendU8CTOCOrder("123446"); // soSaleOutPluginInitializerToC.sendU8CTOCOrder("123446");
try { try {
// soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024101500002500", "stock"); // soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024110200030366", "stock");
// soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024110500013375", "tran"); // soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024110500013375", "tran");
// soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024111700013756", "tran"); // soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024111700013756", "tran");

View File

@ -4,7 +4,6 @@ import lombok.Data;
@Data @Data
public class HeaderDto { public class HeaderDto {
private String id; private String id;
private String clientCode; private String clientCode;
private String companyCode; private String companyCode;