优化TOC业务流程代码

This commit is contained in:
liuy 2024-09-09 13:38:20 +08:00
parent 4d2e275cd8
commit 4083c58dda
12 changed files with 1113 additions and 239 deletions

View File

@ -6,6 +6,7 @@ package com.hzya.frame.plugin.lets.constant;
public class ProfilesActiveConstant {
public static final String LETS_DATE_SOURCE = "lets_u8c";
public static final String LETS_PROFILES_ACTIVE = "dev";
public static final String LOG_STATUS_Y = "Y";

View File

@ -1,21 +0,0 @@
package com.hzya.frame.plugin.lets.ofs.dao;
import com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
import java.util.List;
/**
* root(tocofs_saleout: table)表数据库访问层
*
* @author makejava
* @since 2024-08-01 17:01:32
*/
public interface ITocofsSaleoutDao extends IBaseDao<TocofsSaleoutEntity, String> {
/**
* 批量插入主表信息
*
* @author liuyang
*/
void entityInsertBatchV2(List<TocofsSaleoutEntity> tocofsSaleoutEntityList) throws Exception;
}

View File

@ -12,12 +12,39 @@ import java.util.List;
* @since 2024-09-04 17:48:28
*/
public interface ITocofsSaleoutDetailedDao extends IBaseDao<TocofsSaleoutDetailedEntity, String> {
/**
* 批量插入或者更新
*
* @author liuyang
*/
void entityInsertOrUpdateBatch(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception;
/**
* 更新出库状态的日志(适合档案转换部分的日志处理)
*
* @author liuyang
*/
void entityInsertOrUpdateBatchStock1(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception;
/**
* 更新出库状态的日志(适用库存推送)
*
* @author liuyang
*/
void entityInsertOrUpdateBatchStock2(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception;
/**
* 更新出库状态的日志(适用库存推送)
*
* @author liuyang
*/
void entityInsertOrUpdateBatchStock3(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception;
/**
* 更新出库状态的日志(适用库存推送)
*
* @author liuyang
*/
void entityInsertOrUpdateBatchStock4(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception;
}

View File

@ -18,4 +18,24 @@ public class TocofsSaleoutDetailedDaoImpl extends MybatisGenericDao<TocofsSaleou
public void entityInsertOrUpdateBatch(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception {
insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsSaleoutDetailedDaoImpl.entityInsertOrUpdateBatch", tocofsSaleoutDetailedEntities);
}
@Override
public void entityInsertOrUpdateBatchStock1(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception {
insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsSaleoutDetailedDaoImpl.entityInsertOrUpdateBatchStock", tocofsSaleoutDetailedEntities);
}
@Override
public void entityInsertOrUpdateBatchStock2(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception {
insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsSaleoutDetailedDaoImpl.entityInsertOrUpdateBatchStock2", tocofsSaleoutDetailedEntities);
}
@Override
public void entityInsertOrUpdateBatchStock3(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception {
insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsSaleoutDetailedDaoImpl.entityInsertOrUpdateBatchStock3", tocofsSaleoutDetailedEntities);
}
@Override
public void entityInsertOrUpdateBatchStock4(List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities) throws Exception {
insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsSaleoutDetailedDaoImpl.entityInsertOrUpdateBatchStock4", tocofsSaleoutDetailedEntities);
}
}

View File

@ -360,4 +360,8 @@ public class TocofsSaleoutDetailedEntity extends BaseEntity {
* 自定义项
*/
private String def40;
/**
* 额外参数查询条件
*/
private String ids;
}

View File

@ -279,10 +279,11 @@
<if test="def38 != null and def38 != ''"> and def38 = #{def38} </if>
<if test="def39 != null and def39 != ''"> and def39 = #{def39} </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>
<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 == 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>-->
</select>
<!-- 查询符合条件的数量 -->
@ -882,7 +883,102 @@
def37 = values(def37),
def38 = values(def38),
def39 = values(def39),
def40 = values(def40)</insert>
def40 = values(def40)
</insert>
<!-- 出库成功,更新推送状态(适合档案转啊)-->
<insert id="entityInsertOrUpdateBatchStock" keyProperty="id" useGeneratedKeys="true" parameterType="com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity">
insert into tocofs_saleout_detailed(id,newPushDate,newTransmitInfo,newState)
values
<foreach collection="list" item="entity" separator=",">
(
#{entity.id},
#{entity.newpushdate},
#{entity.newtransmitinfo},
#{entity.newstate}
)
</foreach>
on duplicate key update
id = values(id),
newPushDate = values(newPushDate),
newTransmitInfo = values(newTransmitInfo),
newState = values(newState)
</insert>
<!-- TOC更新推送状态适合库存同步-->
<insert id="entityInsertOrUpdateBatchStock2" keyProperty="id" useGeneratedKeys="true" parameterType="com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity">
insert into tocofs_saleout_detailed(id,newPushDate,newTransmitInfo,newState,newSystemNumber,newSystemPrimary)
values
<foreach collection="list" item="entity" separator=",">
(
#{entity.id},
#{entity.newpushdate},
#{entity.newtransmitinfo},
#{entity.newstate},
#{entity.newsystemnumber},
#{entity.newsystemprimary}
)
</foreach>
on duplicate key update
id = values(id),
newPushDate = values(newPushDate),
newTransmitInfo = values(newTransmitInfo),
newState = values(newState),
newSystemNumber = values(newSystemNumber),
newSystemPrimary = values(newSystemPrimary)
</insert>
<!-- TOC更新推送状态适合确认收入红字-->
<insert id="entityInsertOrUpdateBatchStock3" keyProperty="id" useGeneratedKeys="true">
insert into tocofs_saleout_detailed(id,def1,def2,newState2,newSystemNumber2,newSystemPrimary2)
values
<foreach collection="list" item="entity" separator=",">
(
#{entity.id},
#{entity.def1},
#{entity.def2},
#{entity.newstate2},
#{entity.newsystemnumber2},
#{entity.newsystemprimary2}
)
</foreach>
on duplicate key update
id = values(id),
def1 = values(def1),
def2 = values(def2),
newState2 = values(newState2),
newSystemNumber2 = values(newSystemNumber2),
newSystemPrimary2 = values(newSystemPrimary2)
</insert>
<!-- TOC更新推送状态适合确认收入蓝字-->
<insert id="entityInsertOrUpdateBatchStock4" keyProperty="id" useGeneratedKeys="true">
insert into tocofs_saleout_detailed(id,def3,def4,newState3,newSystemNumber3,newSystemPrimary3)
values
<foreach collection="list" item="entity" separator=",">
(
#{entity.id},
#{entity.def3},
#{entity.def4},
#{entity.newstate3},
#{entity.newsystemnumber3},
#{entity.newsystemprimary3}
)
</foreach>
on duplicate key update
id = values(id),
def3 = values(def3),
def4 = values(def4),
newState3 = values(newState3),
newSystemNumber3 = values(newSystemNumber3),
newSystemPrimary3 = values(newSystemPrimary3)
</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity" >
update tocofs_saleout_detailed set

View File

@ -0,0 +1,22 @@
package com.hzya.frame.plugin.lets.u8cdto;
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto;
import lombok.Data;
/**
* @Authorliuyang
* @Packagecom.hzya.frame.plugin.lets.u8cdto
* @ProjectkangarooDataCenterV3
* @nameErrorHeaderDetailsDtoDto
* @Date2024/9/5 15:48
* @FilenameErrorHeaderDetailsDtoDto
*/
@Data
public class ErrorHeaderDetailsDtoDto extends HeaderDetailsDto {
//(销售)推送时间
private String newPushDate;
//(销售)报错详情
private String newTransmitInfo;
//(销售)出库同步是否成功
private String newstate;
}

View File

@ -95,11 +95,11 @@ public class SaveOrUpdateBusinessLogUtil {
//2024年9月2日 17:09:07 如果失败仅保留500个字符用于平衡数据库性能
//2024年9月2日 17:15:19 如果该单据判断为失败则integration_task_living_details表的root_app_new_datanew_transmit_info字段仅保留500个长度的字符用于平衡性能速网珍视名项目这一块性能很差
String rootAppNewData = integrationTaskLivingDetailsEntity.getRootAppNewData();
if (integrationTaskLivingDetailsEntity.getRootAppNewData() != null && !integrationTaskLivingDetailsEntity.getRootAppNewData().trim().equals("") && integrationTaskLivingDetailsEntity.getRootAppNewData().length()>=500) {
if (integrationTaskLivingDetailsEntity.getRootAppNewData() != null && !integrationTaskLivingDetailsEntity.getRootAppNewData().trim().equals("") && integrationTaskLivingDetailsEntity.getRootAppNewData().length() >= 500) {
rootAppNewData = integrationTaskLivingDetailsEntity.getRootAppNewData().substring(0, 500);
}
String newTransmitInfo = integrationTaskLivingDetailsEntity.getNewTransmitInfo();
if (integrationTaskLivingDetailsEntity.getNewTransmitInfo() != null && !integrationTaskLivingDetailsEntity.getNewTransmitInfo().trim().equals("") && integrationTaskLivingDetailsEntity.getNewTransmitInfo().length()>=500) {
if (integrationTaskLivingDetailsEntity.getNewTransmitInfo() != null && !integrationTaskLivingDetailsEntity.getNewTransmitInfo().trim().equals("") && integrationTaskLivingDetailsEntity.getNewTransmitInfo().length() >= 500) {
newTransmitInfo = integrationTaskLivingDetailsEntity.getNewTransmitInfo().substring(0, 500);
}
integrationTaskLivingDetailsEntity.setRootAppNewData(rootAppNewData);

View File

@ -1,13 +1,19 @@
package com.hzya.frame.plugin.lets.plugin.sales;
import com.hzya.frame.WebappApplication;
import com.hzya.frame.plugin.lets.ofs.dao.ITocofsSaleoutDetailedDao;
import com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity;
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo;
import com.hzya.frame.plugin.lets.u8cdto.ErrorHeaderDetailsDtoDto;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.ArrayList;
import java.util.List;
import static org.junit.jupiter.api.Assertions.*;
/**
@ -25,6 +31,9 @@ class SoSaleOutPluginInitializerToCTest {
@Autowired
private SoSaleOutPluginInitializerToC soSaleOutPluginInitializerToC;
@Autowired
private ITocofsSaleoutDetailedDao iTocofsSaleoutDetailedDao;
@Test
void startImplement() throws Exception {
// soSaleOutPluginInitializerToC.startImplement(null, null);
@ -32,12 +41,39 @@ class SoSaleOutPluginInitializerToCTest {
try {
// QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024081500000001");
// soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024081500000001");
// soSaleOutPluginInitializerToC.getOfsOrder(queryOfsSoSaleOutVo, 1L);
// soSaleOutPluginInitializerToC.startImplement("2024-04-28 00:00:00", "2024-04-28 23:59:59");
// ErrorHeaderDetailsDtoDto errorHeaderDetailsDtoDto = new ErrorHeaderDetailsDtoDto();
// errorHeaderDetailsDtoDto.setNewPushDate(getNewDateStr());
// errorHeaderDetailsDtoDto.setNewTransmitInfo(message);
// errorHeaderDetailsDtoDto.setNewstate("N");
// errorHeaderDetailsDtoDto.setHeader(header);
// errorHeaderDetailsDtoDto.setDetails(details);
// errorHeaderDetailsDtoDto.
} catch (Exception e) {
e.printStackTrace();
}
// try {
// List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities = new ArrayList<>();
// TocofsSaleoutDetailedEntity tocofsSaleoutDetailedEntity = new TocofsSaleoutDetailedEntity();
// tocofsSaleoutDetailedEntity.setNewpushdate("2024-09-05 00:00:03");
// tocofsSaleoutDetailedEntity.setNewtransmitinfo("错误消息22");
// tocofsSaleoutDetailedEntity.setNewstate("Y");
// tocofsSaleoutDetailedEntity.setId("80822338");
// tocofsSaleoutDetailedEntities.add(tocofsSaleoutDetailedEntity);
// iTocofsSaleoutDetailedDao.entityInsertOrUpdateBatchStock1(tocofsSaleoutDetailedEntities);
// } catch (Exception e) {
// e.printStackTrace();
// }
// String aaa = "{\"barcode\":\"01031000084\",\"brand_name\":\"护童\",\"brand_no\":\"1\",\"cost_price\":\"0.00\",\"discount\":\"0.00\",\"from_mask\":\"0\",\"gift_type\":\"1\",\"good_prop1\":\"\",\"good_prop2\":\"\",\"good_prop3\":\"\",\"good_prop4\":\"\",\"good_prop5\":\"\",\"good_prop6\":\"\",\"goods_amount\":\"0.0000\",\"goods_count\":\"1.0000\",\"goods_id\":\"4662\",\"goods_name\":\"G501_椅套_奶油桃\",\"goods_no\":\"01031000084\",\"goods_type\":\"1\",\"is_package\":\"false\",\"market_price\":\"0.00\",\"paid\":\"0.00\",\"platform_id\":\"0\",\"position_details_list\":[{\"batch_no\":\"\",\"expire_date\":\"\",\"position_goods_count\":\"1.0000\",\"position_id\":\"-6\",\"position_no\":\"其它未上架\",\"rec_id\":\"644060\",\"stockout_detail_id\":\"830189\"}],\"prop1\":\"\",\"prop2\":\"\",\"prop3\":\"\",\"prop4\":\"\",\"prop5\":\"\",\"prop6\":\"\",\"rec_id\":\"830189\",\"refund_status\":\"0\",\"remark\":\"赠品策略编号:ZP24080204,规则名称:G501 奶油桃原始单号4032308235772095218\",\"sale_order_id\":\"1251671\",\"sell_price\":\"0.00\",\"share_amount\":\"0.00\",\"share_post_amount\":\"0.00\",\"share_price\":\"0.00\",\"spec_code\":\"\",\"spec_id\":\"4526\",\"spec_name\":\"G501_椅套_奶油桃\",\"spec_no\":\"01031000084\",\"src_oid\":\"AD202409050010\",\"src_order_detail_id\":\"1251671\",\"src_tid\":\"4032308235772095218\",\"stockout_id\":\"630492\",\"suite_no\":\"\",\"tax_rate\":\"0.00\",\"total_amount\":\"0.00\",\"weight\":\"0.0000\"}";
// System.out.println(aaa.length());
soSaleOutPluginInitializerToC.computingTime("2024-01-01/2024-01-25");
}
}

View File

@ -4,7 +4,6 @@ import lombok.Data;
@Data
public class DetailsDto {
private String id;
private String clientCode;
private String companyCode;
@ -34,6 +33,20 @@ public class DetailsDto {
private String createdBy;
private String lastUpdated;
private String lastUpdatedBy;
//表头对象
/**
* 额外参数表头对象
*/
private HeaderDto headerDto;
/**
* 额外参数(销售)出库同步是否成功
*/
private String newState;
/**
* 额外参数(销售)交易成功()是否成功
*/
private String newState2;
/**
* 额外参数(销售)交易成功()是否成功
*/
private String newState3;
}

View File

@ -1,5 +1,7 @@
package com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch;
import lombok.Data;
import java.util.List;
/**
@ -8,25 +10,8 @@ import java.util.List;
* @author lzltool.com
* @website https://www.lzltool.com/JsonToJava
*/
@Data
public class HeaderDetailsDto {
private HeaderDto header;
private List<DetailsDto> details;
public void setHeader(HeaderDto header) {
this.header = header;
}
public HeaderDto getHeader() {
return this.header;
}
public void setDetails(List<DetailsDto> details) {
this.details = details;
}
public List<DetailsDto> getDetails() {
return this.details;
}
}