Merge remote-tracking branch 'origin/lets' into lets

This commit is contained in:
sx 2024-08-20 14:49:55 +08:00
commit 209bb100b0
34 changed files with 1778 additions and 552 deletions

View File

@ -38,6 +38,7 @@ public class OverallConstant {
prodOverPublic.put("bdinvclUnseal", "/u8cloud/api/uapbd/invbasdoc/unseal");//存货基本档案取消封存 prodOverPublic.put("bdinvclUnseal", "/u8cloud/api/uapbd/invbasdoc/unseal");//存货基本档案取消封存
prodOverPublic.put("bdinvclAllot", "/u8cloud/api/uapbd/invbasdoc/assign");//存货基本档案自动分配 prodOverPublic.put("bdinvclAllot", "/u8cloud/api/uapbd/invbasdoc/assign");//存货基本档案自动分配
//调拨 //调拨
prodOverPublic.put("approveqzCode", "8000370009");//调拨订单保存即审批
prodOverPublic.put("approveqz", "/u8cloud/api/to/transorder/saveapprove");//调拨订单保存即审批 prodOverPublic.put("approveqz", "/u8cloud/api/to/transorder/saveapprove");//调拨订单保存即审批
//其他出入库 //其他出入库

View File

@ -27,4 +27,11 @@ public class ProfilesActiveConstant {
public static final String U8C_URL = "http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface"; public static final String U8C_URL = "http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface";
public static final String OFS_URL_TEST = "http://39.98.58.229/api/edi/ofs/in"; public static final String OFS_URL_TEST = "http://39.98.58.229/api/edi/ofs/in";
public static final String SUPPLIER = "'1','3'";
public static final String CUSTOMER = "'0','2'";
public static final String sourceSystem1 = "OFS订单系统";
public static final String sourceSystem2 = "丽知商城";
} }

View File

@ -38,4 +38,7 @@ public class QueryOfsSoSaleOutVo {
private String closedAt_start; private String closedAt_start;
private String closedAt_end; private String closedAt_end;
private String storeCode;
} }

View File

@ -121,21 +121,22 @@ public class GoodsAutoAllotPluginInitializer extends PluginBaseEntity {
} }
/** /**
* 按存货基本档案主键 * 按存货基本档案code
*/ */
public void start(String pkInvbasdoc) { public void start(String invcode) {
try { try {
BdInvbasdocEntity bdInvbasdocEntity = new BdInvbasdocEntity(); BdInvbasdocEntity bdInvbasdocEntity = new BdInvbasdocEntity();
bdInvbasdocEntity.setPkInvbasdoc(pkInvbasdoc); // bdInvbasdocEntity.setPkInvbasdoc(invcode);
bdInvbasdocEntity.setInvcode(invcode);
bdInvbasdocEntity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE); bdInvbasdocEntity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE);
List<BdInvbasdocEntity> bdInvbasdocEntityList = bdInvbasdocDao.query(bdInvbasdocEntity); List<BdInvbasdocEntity> bdInvbasdocEntityList = bdInvbasdocDao.query(bdInvbasdocEntity);
if (bdInvbasdocEntityList.size() == 0) { if (bdInvbasdocEntityList.size() == 0) {
Assert.state(false, "U8C->存货基本档案自动分配全公司,存货基本档案主键:{},不存在。", pkInvbasdoc); Assert.state(false, "U8C->存货基本档案自动分配全公司,存货基本档案编码:{},不存在。", invcode);
} }
//过滤日志 //过滤日志
List<BdInvbasdocEntity> filterInvbasdocList = filter(bdInvbasdocEntityList); List<BdInvbasdocEntity> filterInvbasdocList = filter(bdInvbasdocEntityList);
if (filterInvbasdocList.size() == 0 || filterInvbasdocList == null) { if (filterInvbasdocList.size() == 0 || filterInvbasdocList == null) {
Assert.state(false, "U8C->存货基本档案自动分配全公司,存货基本档案主键:{},已被分配,请检查。", pkInvbasdoc); Assert.state(false, "U8C->存货基本档案自动分配全公司,存货基本档案编码:{},已被分配,请检查。", invcode);
} }
//推送自动分配 //推送自动分配
implement(filterInvbasdocList); implement(filterInvbasdocList);
@ -185,7 +186,7 @@ public class GoodsAutoAllotPluginInitializer extends PluginBaseEntity {
public List<BdInvbasdocEntity> filter(List<BdInvbasdocEntity> bdInvbasdocEntityList) { public List<BdInvbasdocEntity> filter(List<BdInvbasdocEntity> bdInvbasdocEntityList) {
List<BdInvbasdocEntity> filterInvbasdocList = new ArrayList<>(); List<BdInvbasdocEntity> filterInvbasdocList = new ArrayList<>();
for (BdInvbasdocEntity bdInvbasdocEntity : bdInvbasdocEntityList) { for (BdInvbasdocEntity bdInvbasdocEntity : bdInvbasdocEntityList) {
String rootAppPk = bdInvbasdocEntity.getPkInvbasdoc(); String rootAppPk = bdInvbasdocEntity.getInvcode();
boolean isExis = true; boolean isExis = true;
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
integrationTaskLivingDetailsEntity.setRootAppPk(rootAppPk); integrationTaskLivingDetailsEntity.setRootAppPk(rootAppPk);

View File

@ -0,0 +1,115 @@
//package com.hzya.frame.plugin.lets.plugin.purchase;
//
//import cn.hutool.core.util.StrUtil;
//import com.alibaba.fastjson.JSONObject;
//import com.hzya.frame.base.PluginBaseEntity;
//import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo;
//import com.hzya.frame.plugin.lets.plugin.sales.SoSaleOutPluginInitializerToB;
//import com.hzya.frame.plugin.lets.resultvo.CalculateDateVo;
//import com.hzya.frame.plugin.lets.util.DateStrUtil;
//import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto;
//import com.hzya.frame.web.entity.JsonResultEntity;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//
//import java.util.ArrayList;
//import java.util.List;
//
///**
// * 代理品牌采购业务代理品牌采购OFS采购入库单生成U8C采购订单
// *
// * @Authorliuyang
// * @Packagecom.hzya.frame.plugin.lets.plugin.purchase
// * @ProjectkangarooDataCenterV3
// * @nameProxyPurchase
// * @Date2024/8/19 18:01
// * @FilenameProxyPurchase
// */
//public class ProxyPurchaseWarehous extends PluginBaseEntity {
//
// Logger logger = LoggerFactory.getLogger(ProxyPurchaseWarehous.class);
//
// @Override
// public void initialize() {
// logger.info(getPluginLabel() + "執行初始化方法initialize()");
// }
//
// @Override
// public void destroy() {
// logger.info(getPluginLabel() + "執行銷毀方法destroy()");
// }
//
// @Override
// public String getPluginId() {
// return "com.hzya.frame.plugin.lets.plugin.purchase.ProxyPurchaseWarehous";
// }
//
// @Override
// public String getPluginName() {
// return "OFS采购入库单生成U8C采购订单(代理品牌)";
// }
//
// @Override
// public String getPluginLabel() {
// return "OFS采购入库单生成U8C采购订单(代理品牌)";
// }
//
// @Override
// public String getPluginType() {
// return "3";
// }
//
// @Override
// public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
// return null;
// }
//
// /**
// * 根据指定时间范围拉取
// *
// * @author liuyang
// */
// public void startImplement(String startTime, String endTime) {
// String threadNameStr = StrUtil.format("代理品牌采购OFS采购入库单生成U8C采购订单 开始时间:{} 结束时间:{}", dateStr, summaryOrderNumber);
// logger.info(threadNameStr);
//
// Thread thread = new Thread(new Runnable() {
// @Override
// public void run() {
// try {
// CalculateDateVo calculateDateVo = DateStrUtil.calculateCalculateEntireDayPeriod(dateStr);
// String tobShop = shopTobOrToCUtil.getCommaShop("TOB");
//
// List<HeaderDetailsDto> headerDetailsDtoList = new ArrayList<>();
// QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
// queryOfsSoSaleOutVo.setShipAt_start(calculateDateVo.getStart_time());
// queryOfsSoSaleOutVo.setShipAt_end(calculateDateVo.getEnd_time());
// queryOfsSoSaleOutVo.setClientCode("LETS");
// queryOfsSoSaleOutVo.setInternalInstructionType("SALES");
//// queryOfsSoSaleOutVo.setCompanyCode("SHLZ");
// queryOfsSoSaleOutVo.setStatus(900L);
// queryOfsSoSaleOutVo.setPageNo(1L);
// queryOfsSoSaleOutVo.setPageSize(50L);
// queryOfsSoSaleOutVo.setStoreCode(tobShop);
//// queryOfsSoSaleOutVo.setCode("LETS-SH2024010200000004");
// queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L);
// logger.info("数据返回行数:{}", headerDetailsDtoList.size());
// if (headerDetailsDtoList.size() > 0) {
// getSet(headerDetailsDtoList);
// } else {
// logger.info("没有查询到任何数据!不需要同步");
// }
// } catch (Exception e) {
// logger.error("startImplement方法抛出异常", e);
// }
// }
// }, threadNameStr);
// thread.start();
// try {
// thread.join();
// } catch (Exception e) {
// logger.error("thread.join()异常", e);
// }
// }
//
//}

View File

@ -20,9 +20,7 @@ import com.hzya.frame.plugin.lets.ofs.service.ITocofsSaleoutService;
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo; import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo;
import com.hzya.frame.plugin.lets.resultvo.CalculateDateVo; import com.hzya.frame.plugin.lets.resultvo.CalculateDateVo;
import com.hzya.frame.plugin.lets.u8cdto.*; import com.hzya.frame.plugin.lets.u8cdto.*;
import com.hzya.frame.plugin.lets.util.DateStrUtil; import com.hzya.frame.plugin.lets.util.*;
import com.hzya.frame.plugin.lets.util.QueryBdBusitypeUtil;
import com.hzya.frame.plugin.lets.util.TocOrderBasicArchivesCacheUtil;
import com.hzya.frame.split.SplitListByCountUtil; import com.hzya.frame.split.SplitListByCountUtil;
import com.hzya.frame.ttxofs.dto.InterfaceParamDto; import com.hzya.frame.ttxofs.dto.InterfaceParamDto;
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.DetailsDto; import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.DetailsDto;
@ -131,6 +129,12 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
@Autowired @Autowired
private IBdInvmandocDao iBdInvmandocDao; private IBdInvmandocDao iBdInvmandocDao;
@Autowired
private AfterSalesOrderUtil afterSalesOrderUtil;
@Autowired
private ShopTobOrToCUtil shopTobOrToCUtil;
/** /**
* 按指定时间拉取 * 按指定时间拉取
* *
@ -144,29 +148,25 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
@Override @Override
public void run() { public void run() {
try { try {
// TODO 注意过滤TOB店铺
CalculateDateVo calculateDateVo = DateStrUtil.calculateCalculateEntireDayPeriod(dateStr); CalculateDateVo calculateDateVo = DateStrUtil.calculateCalculateEntireDayPeriod(dateStr);
String tobShop = shopTobOrToCUtil.getCommaShop("TOB");
List<HeaderDetailsDto> headerDetailsDtoList = new ArrayList<>(); List<HeaderDetailsDto> headerDetailsDtoList = new ArrayList<>();
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
queryOfsSoSaleOutVo.setShipAt_start("2024-07-05 16:38:00"); queryOfsSoSaleOutVo.setShipAt_start(calculateDateVo.getStart_time());
queryOfsSoSaleOutVo.setShipAt_end("2024-07-05 16:50:30"); queryOfsSoSaleOutVo.setShipAt_end(calculateDateVo.getEnd_time());
queryOfsSoSaleOutVo.setClientCode("LETS"); queryOfsSoSaleOutVo.setClientCode("LETS");
queryOfsSoSaleOutVo.setInternalInstructionType("SALES"); queryOfsSoSaleOutVo.setInternalInstructionType("SALES");
// queryOfsSoSaleOutVo.setCompanyCode("SHLZ"); // queryOfsSoSaleOutVo.setCompanyCode("SHLZ");
queryOfsSoSaleOutVo.setStatus(900L); queryOfsSoSaleOutVo.setStatus(900L);
queryOfsSoSaleOutVo.setPageNo(1L); queryOfsSoSaleOutVo.setPageNo(1L);
queryOfsSoSaleOutVo.setPageSize(50L); queryOfsSoSaleOutVo.setPageSize(50L);
queryOfsSoSaleOutVo.setStoreCode(tobShop);
// queryOfsSoSaleOutVo.setCode("LETS-SH2024010200000004"); // queryOfsSoSaleOutVo.setCode("LETS-SH2024010200000004");
queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L); queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L);
logger.info("数据返回行数:{}", headerDetailsDtoList.size()); logger.info("数据返回行数:{}", headerDetailsDtoList.size());
if (headerDetailsDtoList.size() > 0) { if (headerDetailsDtoList.size() > 0) {
//保存到mysql getSet(headerDetailsDtoList);
batchInsert(headerDetailsDtoList);
//过滤成功的数据
List<HeaderDetailsDto> headerDetailsDtos = filterData(headerDetailsDtoList);
//执行推送主逻辑
implement(headerDetailsDtos);
} else { } else {
logger.info("没有查询到任何数据!不需要同步"); logger.info("没有查询到任何数据!不需要同步");
} }
@ -183,6 +183,60 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
} }
} }
/**
* 根据出库单单号拉取
*
* @author liuyang
*/
public void startImplement(String date) {
String threadNameStr = StrUtil.format("OFS销售出库(TOB)同步U8C销售订单 出库单单号:{}", date);
logger.info(threadNameStr);
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
try {
String tobShop = shopTobOrToCUtil.getCommaShop("TOB");
List<HeaderDetailsDto> headerDetailsDtoList = new ArrayList<>();
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
queryOfsSoSaleOutVo.setClientCode("LETS");
queryOfsSoSaleOutVo.setInternalInstructionType("SALES");
queryOfsSoSaleOutVo.setStatus(900L);
queryOfsSoSaleOutVo.setPageNo(1L);
queryOfsSoSaleOutVo.setPageSize(50L);
queryOfsSoSaleOutVo.setStoreCode(tobShop);
queryOfsSoSaleOutVo.setCode(date);
queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L);
logger.info("根据根据号拉群:数据返回行数:{}", headerDetailsDtoList.size());
if (headerDetailsDtoList.size() > 0) {
getSet(headerDetailsDtoList);
} else {
logger.info("没有查询到任何数据!不需要同步");
}
} catch (Exception e) {
logger.error("startImplement方法抛出异常", e);
}
}
}, threadNameStr);
thread.start();
try {
thread.join();
} catch (Exception e) {
logger.error("thread.join()异常", e);
}
}
private void getSet(List<HeaderDetailsDto> headerDetailsDtoList) throws Exception {
//保存到mysql
batchInsert(headerDetailsDtoList);
//过滤成功的数据
List<HeaderDetailsDto> headerDetailsDtos = filterData(headerDetailsDtoList);
//执行推送主逻辑
implement(headerDetailsDtos);
}
/** /**
* 过滤掉成功的数据 * 过滤掉成功的数据
* *
@ -506,6 +560,23 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
HeaderDto header = headerDetailsDto.getHeader(); HeaderDto header = headerDetailsDto.getHeader();
List<DetailsDto> details = headerDetailsDto.getDetails(); List<DetailsDto> details = headerDetailsDto.getDetails();
//根据销售出库单查询得到销售订单
SaleOrderMessageDto saleOrderMessageDto = null;
try {
saleOrderMessageDto = afterSalesOrderUtil.getOfsOrder(header.getRefOrderCode());
} catch (Exception e) {
logger.error("查询销售订单错误,失败原因:{}", e.getMessage());
Assert.state(false, "查询销售订单错误,失败原因:{}", e.getMessage());
}
if (saleOrderMessageDto == null) {
Assert.state(false, "没有匹配到售后订单,系统业务无法完成");
}
com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDto header1 = saleOrderMessageDto.getData().get(0).getHeader();
String memberId = header1.getMemberId();
Assert.notNull(memberId, "TOB销售订单(OFS)表头会员id不能为空否则无法匹配U8C客商档案");
Assert.state(!"".equals(memberId.trim()), "TOB销售订单(OFS)表头会员id不能为空否则无法匹配U8C客商档案");
// 销售公司发货公司 // 销售公司发货公司
String companyCode = header.getCompanyCode(); String companyCode = header.getCompanyCode();
Assert.notNull(companyCode, "O表头公司不能为空"); Assert.notNull(companyCode, "O表头公司不能为空");
@ -577,24 +648,32 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
//客商基本档案 //客商基本档案
//查询OFS对应的销售订单得到会员id //查询OFS对应的销售订单得到会员id
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); // QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
// queryOfsSoSaleOutVo.setCode(); // queryOfsSoSaleOutVo.setCode();
SaleOrderMessageDto ofsOrder = getOfsOrder(queryOfsSoSaleOutVo, 1L); // SaleOrderMessageDto ofsOrder = getOfsOrder(queryOfsSoSaleOutVo, 1L);
String custName = "天猫intoyou旗舰店-自营"; // String custName = "天猫intoyou旗舰店-自营";
BdCubasdocEntity bdCubasdocEntity = new BdCubasdocEntity(); BdCubasdocEntity bdCubasdocEntity = new BdCubasdocEntity();
bdCubasdocEntity.setDataSourceCode("lets_u8c"); bdCubasdocEntity.setDataSourceCode("lets_u8c");
bdCubasdocEntity.setDr(0L); bdCubasdocEntity.setDr(0L);
bdCubasdocEntity.setCustname(custName); bdCubasdocEntity.setDef1(memberId);
List<BdCubasdocEntity> bdCubasdocEntityList = iBdCubasdocDao.query(bdCubasdocEntity); List<BdCubasdocEntity> bdCubasdocEntityList = iBdCubasdocDao.query(bdCubasdocEntity);
if (bdCubasdocEntityList == null || bdCubasdocEntityList.size() == 0) {
Assert.state(false, "根据OFS会员id{}无法查询到U8C客商基本档案", memberId);
} else if (bdCubasdocEntityList.size() >= 2) {
Assert.state(false, "根据OFS会员id{}查询到U8C多个客商基本档案", memberId);
}
//客商管理档案 //客商管理档案
BdCumandocEntity bdCumandocEntity1 = new BdCumandocEntity(); BdCumandocEntity bdCumandocEntity1 = new BdCumandocEntity();
bdCumandocEntity1.setDataSourceCode("lets_u8c"); bdCumandocEntity1.setDataSourceCode("lets_u8c");
bdCumandocEntity1.setDr(0L); bdCumandocEntity1.setDr(0L);
bdCumandocEntity1.setPkCorp(bdCorpEntityList.get(0).getPkCorp()); bdCumandocEntity1.setPkCorp(bdCorpEntityList.get(0).getPkCorp());
// bdCumandocEntity1.setPkCubasdoc(bdCubasdocEntityList.get(0).getPkCubasdoc()); bdCumandocEntity1.setCustflags(ProfilesActiveConstant.CUSTOMER);
List<BdCumandocEntity> bdCumandocEntityList = iBdCumandocDao.query(bdCumandocEntity1); List<BdCumandocEntity> bdCumandocEntityList = iBdCumandocDao.query(bdCumandocEntity1);
if (bdCumandocEntityList == null || bdCumandocEntityList.size() == 0) {
Assert.state(false, "根据客商基本档案主键{},没有办法查询到客商管理档案", bdCubasdocEntityList.get(0).getPkCubasdoc());
}
//查找平台 //查找平台
String platformZdyId = "0001A210000000000JUD"; String platformZdyId = "0001A210000000000JUD";
@ -637,7 +716,7 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
orderOutTobHeaderDto.setDeliverGoodsCorp(bdCorpEntityList.get(0)); orderOutTobHeaderDto.setDeliverGoodsCorp(bdCorpEntityList.get(0));
orderOutTobHeaderDto.setPlatformArchives(bdDefdocEntityList.get(0)); orderOutTobHeaderDto.setPlatformArchives(bdDefdocEntityList.get(0));
orderOutTobHeaderDto.setShopArchives(bdDefdocEntityList2.get(0)); orderOutTobHeaderDto.setShopArchives(bdDefdocEntityList2.get(0));
orderOutTobHeaderDto.setOfsOrder(ofsOrder); orderOutTobHeaderDto.setSaleOrderMessageDto(saleOrderMessageDto);
orderOutTobHeaderDto.setHeader(header); orderOutTobHeaderDto.setHeader(header);
orderOutTobHeaderDto.setDetails(details); orderOutTobHeaderDto.setDetails(details);

View File

@ -18,6 +18,7 @@ import com.hzya.frame.plugin.lets.ofs.service.ITocofsSaleoutService;
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo; import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo;
import com.hzya.frame.plugin.lets.resultvo.CalculateDateVo; import com.hzya.frame.plugin.lets.resultvo.CalculateDateVo;
import com.hzya.frame.plugin.lets.u8cdto.*; import com.hzya.frame.plugin.lets.u8cdto.*;
import com.hzya.frame.plugin.lets.util.ShopTobOrToCUtil;
import com.hzya.frame.plugin.lets.util.TocOrderBasicArchivesCacheUtil; import com.hzya.frame.plugin.lets.util.TocOrderBasicArchivesCacheUtil;
import com.hzya.frame.plugin.lets.util.DateStrUtil; import com.hzya.frame.plugin.lets.util.DateStrUtil;
import com.hzya.frame.plugin.lets.util.QueryBdBusitypeUtil; import com.hzya.frame.plugin.lets.util.QueryBdBusitypeUtil;
@ -27,7 +28,6 @@ import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.DetailsDto;
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto; import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto;
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDto; import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDto;
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.SaleOutReturnMessageDto; import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.SaleOutReturnMessageDto;
import com.hzya.frame.ttxofs.dto.ofssalesordersearch.SaleOrderMessageDto;
import com.hzya.frame.ttxofs.service.OfsUnifiedService; import com.hzya.frame.ttxofs.service.OfsUnifiedService;
import com.hzya.frame.web.entity.JsonResultEntity; import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -92,9 +92,6 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
@Autowired @Autowired
private TocOrderBasicArchivesCacheUtil basicArchivesCacheUtil; private TocOrderBasicArchivesCacheUtil basicArchivesCacheUtil;
@Autowired
private ITocofsSaleoutService iTocofsSaleoutService;
@Autowired @Autowired
private ITocofsSaleoutDao iTocofsSaleoutDao; private ITocofsSaleoutDao iTocofsSaleoutDao;
@ -108,6 +105,9 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
private static final String ADD = "+"; private static final String ADD = "+";
@Autowired
private ShopTobOrToCUtil shopTobOrToCUtil;
/** /**
* 按指定时间拉取 * 按指定时间拉取
* *
@ -122,29 +122,24 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
public void run() { public void run() {
LOCK.lock(); LOCK.lock();
try { try {
// TODO 注意过滤TOC店铺
CalculateDateVo calculateDateVo = DateStrUtil.calculateCalculateEntireDayPeriod(dateStr); CalculateDateVo calculateDateVo = DateStrUtil.calculateCalculateEntireDayPeriod(dateStr);
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("2024-07-05 16:38:00"); queryOfsSoSaleOutVo.setShipAt_start(calculateDateVo.getStart_time());
queryOfsSoSaleOutVo.setShipAt_end("2024-07-05 16:50:30"); queryOfsSoSaleOutVo.setShipAt_end(calculateDateVo.getEnd_time());
queryOfsSoSaleOutVo.setClientCode("LETS"); queryOfsSoSaleOutVo.setClientCode("LETS");
queryOfsSoSaleOutVo.setInternalInstructionType("SALES"); queryOfsSoSaleOutVo.setInternalInstructionType("SALES");
// queryOfsSoSaleOutVo.setCompanyCode("SHLZ");
queryOfsSoSaleOutVo.setStatus(900L); queryOfsSoSaleOutVo.setStatus(900L);
queryOfsSoSaleOutVo.setPageNo(1L); queryOfsSoSaleOutVo.setPageNo(1L);
queryOfsSoSaleOutVo.setPageSize(50L); queryOfsSoSaleOutVo.setPageSize(50L);
queryOfsSoSaleOutVo.setStoreCode(tobShop);
// queryOfsSoSaleOutVo.setCode("LETS-SH2024070500000003"); // queryOfsSoSaleOutVo.setCode("LETS-SH2024070500000003");
queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L); queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L);
logger.info("数据返回行数:{}", headerDetailsDtoList.size()); logger.info("数据返回行数:{}", headerDetailsDtoList.size());
if (headerDetailsDtoList.size() > 0) { if (headerDetailsDtoList.size() > 0) {
//保存到mysql getSet(headerDetailsDtoList);
batchInsert(headerDetailsDtoList);
//过滤成功的数据
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtos = filterData(headerDetailsDtoList);
//执行推送主逻辑
implement(headerDetailsDtos);
} else { } else {
logger.info("没有查询到任何数据!不需要同步"); logger.info("没有查询到任何数据!不需要同步");
} }
@ -168,6 +163,67 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
} }
} }
/**
* 按指定时间拉取
*
* @author liuyang
*/
public void startImplement(String code) {
String threadNameStr = StrUtil.format("OFS销售出库(TOC)同步U8C销售订单 出库单单据号:{}", code);
logger.info(threadNameStr);
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
LOCK.lock();
try {
String tobShop = shopTobOrToCUtil.getCommaShop("TOC");
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList = new ArrayList<>();
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
queryOfsSoSaleOutVo.setClientCode("LETS");
queryOfsSoSaleOutVo.setInternalInstructionType("SALES");
queryOfsSoSaleOutVo.setStatus(900L);
queryOfsSoSaleOutVo.setPageNo(1L);
queryOfsSoSaleOutVo.setPageSize(50L);
queryOfsSoSaleOutVo.setStoreCode(tobShop);
queryOfsSoSaleOutVo.setCode(code);
queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L);
logger.info("数据返回行数:{}", headerDetailsDtoList.size());
if (headerDetailsDtoList.size() > 0) {
getSet(headerDetailsDtoList);
} else {
logger.info("没有查询到任何数据!不需要同步");
}
} catch (Exception e) {
logger.error("startImplement方法抛出异常", e);
} finally {
try {
basicArchivesCacheUtil.clearCache();
} catch (Exception e) {
logger.info("清理档案缓存失败", e);
}
LOCK.unlock();
}
}
}, threadNameStr);
thread.start();
try {
thread.join();
} catch (Exception e) {
logger.error("thread.join()异常", e);
}
}
private void getSet(List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList) throws Exception {
//保存到mysql
batchInsert(headerDetailsDtoList);
//过滤成功的数据
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtos = filterData(headerDetailsDtoList);
//执行推送主逻辑
implement(headerDetailsDtos);
}
/** /**
* 过滤掉成功的数据 * 过滤掉成功的数据
* *

View File

@ -14,20 +14,17 @@ import com.hzya.frame.plugin.lets.dao.*;
import com.hzya.frame.plugin.lets.entity.*; import com.hzya.frame.plugin.lets.entity.*;
import com.hzya.frame.plugin.lets.ofs.dao.ITocofsReturngoodsDao; import com.hzya.frame.plugin.lets.ofs.dao.ITocofsReturngoodsDao;
import com.hzya.frame.plugin.lets.ofs.dao.ITocofsReturngoodsDetailedDao; import com.hzya.frame.plugin.lets.ofs.dao.ITocofsReturngoodsDetailedDao;
import com.hzya.frame.plugin.lets.ofs.dao.ITocofsSaleoutDetailedDao;
import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsDetailedEntity; import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsDetailedEntity;
import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity; import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity;
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo; import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo;
import com.hzya.frame.plugin.lets.queryvo.StartAndEndVo;
import com.hzya.frame.plugin.lets.resultvo.CalculateDateVo; import com.hzya.frame.plugin.lets.resultvo.CalculateDateVo;
import com.hzya.frame.plugin.lets.u8cdto.*; import com.hzya.frame.plugin.lets.u8cdto.*;
import com.hzya.frame.plugin.lets.util.DateStrUtil; import com.hzya.frame.plugin.lets.util.*;
import com.hzya.frame.plugin.lets.util.QueryBdBusitypeUtil;
import com.hzya.frame.split.SplitListByCountUtil; import com.hzya.frame.split.SplitListByCountUtil;
import com.hzya.frame.ttxofs.dto.InterfaceParamDto; import com.hzya.frame.ttxofs.dto.InterfaceParamDto;
import com.hzya.frame.ttxofs.dto.returngoodsearch.RertunGoodsRootBean; import com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDto;
import com.hzya.frame.ttxofs.dto.returngoodsearch.ReturnGoodHeaderDetailsDataDto; import com.hzya.frame.ttxofs.dto.ofssalesordersearch.SaleOrderMessageDto;
import com.hzya.frame.ttxofs.dto.returngoodsearch.ReturnGoodSearchDetailsDto;
import com.hzya.frame.ttxofs.dto.returngoodsearch.ReturnGoodSearchHeaderDto;
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse; import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
import com.hzya.frame.ttxofs.service.OfsUnifiedService; import com.hzya.frame.ttxofs.service.OfsUnifiedService;
import com.hzya.frame.web.entity.JsonResultEntity; import com.hzya.frame.web.entity.JsonResultEntity;
@ -98,9 +95,6 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
@Autowired @Autowired
private IBdCalbodyDao iBdCalbodyDao; private IBdCalbodyDao iBdCalbodyDao;
@Autowired
private ITocofsSaleoutDetailedDao iTocofsSaleoutDetailedDao;
@Autowired @Autowired
private QueryBdBusitypeUtil queryBdBusitypeUtil; private QueryBdBusitypeUtil queryBdBusitypeUtil;
@ -110,10 +104,6 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
@Autowired @Autowired
private IBdSalestruDao iBdSalestruDao; private IBdSalestruDao iBdSalestruDao;
private static final String NOTHING = "";
private static final String ADD = "+";
@Autowired @Autowired
private IBdCumandocDao iBdCumandocDao; private IBdCumandocDao iBdCumandocDao;
@ -135,6 +125,15 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
@Autowired @Autowired
private ITocofsReturngoodsDetailedDao iTocofsReturngoodsDetailedDao; private ITocofsReturngoodsDetailedDao iTocofsReturngoodsDetailedDao;
@Autowired
private AfterSalesOrderUtil afterSalesOrderUtil;
@Autowired
private ShopTobOrToCUtil shopTobOrToCUtil;
@Autowired
private OffsetTimeTime offsetTimeTime;
/** /**
* 按指定时间拉取 * 按指定时间拉取
* *
@ -148,29 +147,24 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
@Override @Override
public void run() { public void run() {
try { try {
// TODO 注意过滤TOB店铺 //生成一个时间范围
CalculateDateVo calculateDateVo = DateStrUtil.calculateCalculateEntireDayPeriod(dateStr); StartAndEndVo startAndEndVo = offsetTimeTime.offsetTime();
//2024年8月19日 15:47:51 查询出U8C里标记的店铺TOB属性
String tobShop = shopTobOrToCUtil.getCommaShop("TOB");
List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>(); List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>();
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
queryOfsSoSaleOutVo.setClosedAt_start("2024-07-16 16:44:00"); queryOfsSoSaleOutVo.setClosedAt_start(startAndEndVo.getStart_time());
queryOfsSoSaleOutVo.setClosedAt_end("2024-07-16 16:44:02"); queryOfsSoSaleOutVo.setClosedAt_end(startAndEndVo.getEnd_time());
queryOfsSoSaleOutVo.setClientCode("LETS"); queryOfsSoSaleOutVo.setClientCode("LETS");
// queryOfsSoSaleOutVo.setInternalInstructionType("SALES");
queryOfsSoSaleOutVo.setCompanyCode("SHLZ");
// queryOfsSoSaleOutVo.setStatus(900L);
queryOfsSoSaleOutVo.setPageNo(1L); queryOfsSoSaleOutVo.setPageNo(1L);
queryOfsSoSaleOutVo.setPageSize(50L); queryOfsSoSaleOutVo.setPageSize(50L);
// queryOfsSoSaleOutVo.setCode("LETS-RE2024071600000001"); queryOfsSoSaleOutVo.setStoreCode(tobShop);
// queryOfsSoSaleOutVo.setCode("LETS-RE2024081900000001");
queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L); queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L);
logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size()); logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size());
if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) { if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
//保存到mysql getSet(returnGoodHeaderDetailsDataDtoArrayList);
batchInsert(returnGoodHeaderDetailsDataDtoArrayList);
//过滤成功的数据
List<StockinOrderSearchResponse.StockinOrder> stockinOrderList = filterData(returnGoodHeaderDetailsDataDtoArrayList);
//执行推送主逻辑
implement(stockinOrderList);
} else { } else {
logger.info("没有查询到任何数据!不需要同步"); logger.info("没有查询到任何数据!不需要同步");
} }
@ -187,6 +181,67 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
} }
} }
/**
* 按指定时间拉取
*
* @author liuyang
*/
public void startImplement(String code) {
String threadNameStr = StrUtil.format("OFS售后入库(TOB)同步U8C销售订单 售后入库单号:{}", code);
logger.info(threadNameStr);
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
try {
//生成一个时间范围
// StartAndEndVo startAndEndVo = offsetTimeTime.offsetTime();
//2024年8月19日 15:47:51 查询出U8C里标记的店铺TOB属性
String tobShop = shopTobOrToCUtil.getCommaShop("TOB");
List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>();
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
// queryOfsSoSaleOutVo.setClosedAt_start("2002-01-01 00:00:00");// 2024年8月19日 17:13:35 仅作为接口参数验证O口头反馈根据单号查询不会启用时间范围搜索
// queryOfsSoSaleOutVo.setClosedAt_end("2002-01-01 23:59:59");
queryOfsSoSaleOutVo.setClientCode("LETS");
queryOfsSoSaleOutVo.setPageNo(1L);
queryOfsSoSaleOutVo.setPageSize(50L);
queryOfsSoSaleOutVo.setStoreCode(tobShop);
queryOfsSoSaleOutVo.setCode(code);
queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L);
logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size());
if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
getSet(returnGoodHeaderDetailsDataDtoArrayList);
} else {
logger.info("没有查询到任何数据!不需要同步");
}
} catch (Exception e) {
logger.error("startImplement方法抛出异常", e);
}
}
}, threadNameStr);
thread.start();
try {
thread.join();
} catch (Exception e) {
logger.error("thread.join()异常", e);
}
}
/**
* 环境预配置
*
* @author liuyang
*/
private void getSet(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList) throws Exception {
//保存到mysql
batchInsert(returnGoodHeaderDetailsDataDtoArrayList);
//过滤成功的数据
List<StockinOrderSearchResponse.StockinOrder> stockinOrderList = filterData(returnGoodHeaderDetailsDataDtoArrayList);
//执行推送主逻辑
implement(stockinOrderList);
}
/** /**
* 过滤掉成功的数据 * 过滤掉成功的数据
* *
@ -486,6 +541,23 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
StockinOrderSearchResponse.StockinOrder.StockinH header = stockinOrder.getHeader(); StockinOrderSearchResponse.StockinOrder.StockinH header = stockinOrder.getHeader();
List<StockinOrderSearchResponse.StockinOrder.StockinB> details = stockinOrder.getDetails(); List<StockinOrderSearchResponse.StockinOrder.StockinB> details = stockinOrder.getDetails();
//通过售后订单查询销售订单
SaleOrderMessageDto saleOrderMessageDto = null;
try {
saleOrderMessageDto = afterSalesOrderUtil.queryAfterSalesOrder(header);
} catch (Exception e) {
logger.error("查询出售后订单错误,失败原因:{}", e.getMessage());
Assert.state(false, "查询出售后订单错误,失败原因:{}", e.getMessage());
}
if (saleOrderMessageDto == null) {
Assert.state(false, "没有匹配到售后订单,系统业务无法完成");
}
HeaderDto header1 = saleOrderMessageDto.getData().get(0).getHeader();
String memberId = header1.getMemberId();
Assert.notNull(memberId, "TOB销售订单(OFS)表头会员id不能为空否则无法匹配U8C客商档案");
Assert.state(!"".equals(memberId.trim()), "TOB销售订单(OFS)表头会员id不能为空否则无法匹配U8C客商档案");
// 销售公司发货公司 // 销售公司发货公司
String companyCode = header.getCompanyCode(); String companyCode = header.getCompanyCode();
Assert.notNull(companyCode, "O表头公司不能为空"); Assert.notNull(companyCode, "O表头公司不能为空");
@ -556,12 +628,17 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
} }
//客商基本档案 //客商基本档案
String custName = "天猫intoyou旗舰店-自营"; // String custName = "天猫intoyou旗舰店-自营";
BdCubasdocEntity bdCubasdocEntity = new BdCubasdocEntity(); BdCubasdocEntity bdCubasdocEntity = new BdCubasdocEntity();
bdCubasdocEntity.setDataSourceCode("lets_u8c"); bdCubasdocEntity.setDataSourceCode("lets_u8c");
bdCubasdocEntity.setDr(0L); bdCubasdocEntity.setDr(0L);
bdCubasdocEntity.setCustname(custName); bdCubasdocEntity.setDef1(memberId);
List<BdCubasdocEntity> bdCubasdocEntityList = iBdCubasdocDao.query(bdCubasdocEntity); List<BdCubasdocEntity> bdCubasdocEntityList = iBdCubasdocDao.query(bdCubasdocEntity);
if (bdCubasdocEntityList == null || bdCubasdocEntityList.size() == 0) {
Assert.state(false, "根据OFS会员id{}无法查询到U8C客商基本档案", memberId);
} else if (bdCubasdocEntityList.size() >= 2) {
Assert.state(false, "根据OFS会员id{}无法查询到U8C客商基本档案", memberId);
}
//客商管理档案 //客商管理档案
BdCumandocEntity bdCumandocEntity1 = new BdCumandocEntity(); BdCumandocEntity bdCumandocEntity1 = new BdCumandocEntity();
@ -569,7 +646,11 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
bdCumandocEntity1.setDr(0L); bdCumandocEntity1.setDr(0L);
bdCumandocEntity1.setPkCorp(bdCorpEntityList.get(0).getPkCorp()); bdCumandocEntity1.setPkCorp(bdCorpEntityList.get(0).getPkCorp());
bdCumandocEntity1.setPkCubasdoc(bdCubasdocEntityList.get(0).getPkCubasdoc()); bdCumandocEntity1.setPkCubasdoc(bdCubasdocEntityList.get(0).getPkCubasdoc());
bdCumandocEntity1.setCustflags(ProfilesActiveConstant.CUSTOMER);
List<BdCumandocEntity> bdCumandocEntityList = iBdCumandocDao.query(bdCumandocEntity1); List<BdCumandocEntity> bdCumandocEntityList = iBdCumandocDao.query(bdCumandocEntity1);
if (bdCumandocEntityList == null || bdCumandocEntityList.size() == 0) {
Assert.state(false, "根据客商基本档案主键{},没有办法查询到客商管理档案", bdCubasdocEntityList.get(0).getPkCubasdoc());
}
//查找平台 //查找平台
String platformZdyId = "0001A210000000000JUD"; String platformZdyId = "0001A210000000000JUD";
@ -612,6 +693,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
orderOutTobHeaderDto.setDeliverGoodsCorp(bdCorpEntityList.get(0)); orderOutTobHeaderDto.setDeliverGoodsCorp(bdCorpEntityList.get(0));
orderOutTobHeaderDto.setPlatformArchives(bdDefdocEntityList.get(0)); orderOutTobHeaderDto.setPlatformArchives(bdDefdocEntityList.get(0));
orderOutTobHeaderDto.setShopArchives(bdDefdocEntityList2.get(0)); orderOutTobHeaderDto.setShopArchives(bdDefdocEntityList2.get(0));
orderOutTobHeaderDto.setSaleOrderMessageDto(saleOrderMessageDto);
orderOutTobHeaderDto.setHeader(header); orderOutTobHeaderDto.setHeader(header);
orderOutTobHeaderDto.setDetails(details); orderOutTobHeaderDto.setDetails(details);
@ -701,6 +783,9 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
Assert.notNull(detailsDto.getSkuCode(), "O存货商家编码不能为空"); Assert.notNull(detailsDto.getSkuCode(), "O存货商家编码不能为空");
Assert.notNull(pkCorp, "发货公司主键不能为空"); Assert.notNull(pkCorp, "发货公司主键不能为空");
//TODO 测试
detailsDto.setSkuCode("6973391730617");
BdInvmandocEntity bdInvmandocEntity = new BdInvmandocEntity(); BdInvmandocEntity bdInvmandocEntity = new BdInvmandocEntity();
bdInvmandocEntity.setInvcode(detailsDto.getSkuCode()); bdInvmandocEntity.setInvcode(detailsDto.getSkuCode());
bdInvmandocEntity.setPkCorp(pkCorp); bdInvmandocEntity.setPkCorp(pkCorp);
@ -732,7 +817,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
} else if (bdInvbasdocEntity2.size() >= 2) { } else if (bdInvbasdocEntity2.size() >= 2) {
Assert.state(false, "根据存货管理档案主键{}和公司档案主键{}没有查询到U8C基础档案", pkInvmandoc, pkCorp); Assert.state(false, "根据存货管理档案主键{}和公司档案主键{}没有查询到U8C基础档案", pkInvmandoc, pkCorp);
} }
return bdInvbasdocEntity; return bdInvbasdocEntity2.get(0);
} }
/** /**
@ -822,7 +907,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
if (tocofsReturngoodsDetailedEntity != null && returnGoodSearchHeaderDto != null) { if (tocofsReturngoodsDetailedEntity != null && returnGoodSearchHeaderDto != null) {
tocofsReturngoodsDetailedEntity.setPrimaryKey(returnGoodSearchHeaderDto.getId());//主表主键 tocofsReturngoodsDetailedEntity.setPrimaryKey(returnGoodSearchHeaderDto.getId());//主表主键
tocofsReturngoodsDetailedEntity.setBusinessDate(returnGoodSearchHeaderDto.getCheckInFrom());//业务日期 tocofsReturngoodsDetailedEntity.setBusinessDate(returnGoodSearchHeaderDto.getCheckInFrom());//业务日期
tocofsReturngoodsDetailedEntity.setBusinessType("TOC_RETURN");//业务类型 tocofsReturngoodsDetailedEntity.setBusinessType("TOB_RETURN");//业务类型
} }
} }
} }

View File

@ -17,6 +17,7 @@ import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity;
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo; import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo;
import com.hzya.frame.plugin.lets.resultvo.CalculateDateVo; import com.hzya.frame.plugin.lets.resultvo.CalculateDateVo;
import com.hzya.frame.plugin.lets.u8cdto.*; import com.hzya.frame.plugin.lets.u8cdto.*;
import com.hzya.frame.plugin.lets.util.ShopTobOrToCUtil;
import com.hzya.frame.plugin.lets.util.TocReturnBasicArchivesCacheUtil; import com.hzya.frame.plugin.lets.util.TocReturnBasicArchivesCacheUtil;
import com.hzya.frame.plugin.lets.util.DateStrUtil; import com.hzya.frame.plugin.lets.util.DateStrUtil;
import com.hzya.frame.plugin.lets.util.QueryBdBusitypeUtil; import com.hzya.frame.plugin.lets.util.QueryBdBusitypeUtil;
@ -103,6 +104,9 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
@Autowired @Autowired
private TocReturnBasicArchivesCacheUtil tocReturnBasicArchivesCacheUtil; private TocReturnBasicArchivesCacheUtil tocReturnBasicArchivesCacheUtil;
@Autowired
private ShopTobOrToCUtil shopTobOrToCUtil;
/** /**
* 按指定时间拉取 * 按指定时间拉取
* *
@ -117,30 +121,26 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
public void run() { public void run() {
LOCK.lock(); LOCK.lock();
try { try {
// TODO 注意过滤TOC店铺 String tocShop = shopTobOrToCUtil.getCommaShop("TOC");
CalculateDateVo calculateDateVo = DateStrUtil.calculateCalculateEntireDayPeriod(dateStr); CalculateDateVo calculateDateVo = DateStrUtil.calculateCalculateEntireDayPeriod(dateStr);
List<ReturnGoodHeaderDetailsDataDto> returnGoodHeaderDetailsDataDtoList = new ArrayList<>(); List<ReturnGoodHeaderDetailsDataDto> returnGoodHeaderDetailsDataDtoList = new ArrayList<>();
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
queryOfsSoSaleOutVo.setCreated_start("2024-07-16 15:35:35"); queryOfsSoSaleOutVo.setCreated_start(calculateDateVo.getStart_time());
queryOfsSoSaleOutVo.setCreated_end("2024-07-16 15:35:37"); queryOfsSoSaleOutVo.setCreated_end(calculateDateVo.getEnd_time());
queryOfsSoSaleOutVo.setClientCode("LETS"); queryOfsSoSaleOutVo.setClientCode("LETS");
// queryOfsSoSaleOutVo.setInternalInstructionType("SALES"); queryOfsSoSaleOutVo.setInternalInstructionType("SALES");
queryOfsSoSaleOutVo.setCompanyCode("SHLZ"); // queryOfsSoSaleOutVo.setCompanyCode("SHLZ");
// queryOfsSoSaleOutVo.setStatus(900L); queryOfsSoSaleOutVo.setStatus(900L);
queryOfsSoSaleOutVo.setPageNo(1L); queryOfsSoSaleOutVo.setPageNo(1L);
queryOfsSoSaleOutVo.setPageSize(50L); queryOfsSoSaleOutVo.setPageSize(50L);
queryOfsSoSaleOutVo.setCode("LETS-RE2024071600000001"); queryOfsSoSaleOutVo.setStoreCode(tocShop);
// queryOfsSoSaleOutVo.setCode("LETS-RE2024071600000001");
queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoList, 1L); queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoList, 1L);
logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoList.size()); logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoList.size());
if (returnGoodHeaderDetailsDataDtoList.size() > 0) { if (returnGoodHeaderDetailsDataDtoList.size() > 0) {
//保存到mysql getSet(returnGoodHeaderDetailsDataDtoList);
batchInsert(returnGoodHeaderDetailsDataDtoList);
//过滤成功的数据
List<ReturnGoodHeaderDetailsDataDto> returnGoodHeaderDetailsDataDtoList1 = filterData(returnGoodHeaderDetailsDataDtoList);
//执行推送主逻辑
implement(returnGoodHeaderDetailsDataDtoList1);
} else { } else {
logger.info("没有查询到任何数据!不需要同步"); logger.info("没有查询到任何数据!不需要同步");
} }
@ -164,6 +164,72 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
} }
} }
/**
* 按指定时间拉取
*
* @author liuyang
*/
public void startImplement(String code) {
String threadNameStr = StrUtil.format("OFS销售出库(TOC)同步U8C销售订单 同步单据号:{}", code);
logger.info(threadNameStr);
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
LOCK.lock();
try {
String tocShop = shopTobOrToCUtil.getCommaShop("TOC");
List<ReturnGoodHeaderDetailsDataDto> returnGoodHeaderDetailsDataDtoList = new ArrayList<>();
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
queryOfsSoSaleOutVo.setClientCode("LETS");
queryOfsSoSaleOutVo.setInternalInstructionType("SALES");
queryOfsSoSaleOutVo.setStatus(900L);
queryOfsSoSaleOutVo.setPageNo(1L);
queryOfsSoSaleOutVo.setPageSize(50L);
queryOfsSoSaleOutVo.setStoreCode(tocShop);
queryOfsSoSaleOutVo.setCode(code);
queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoList, 1L);
logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoList.size());
if (returnGoodHeaderDetailsDataDtoList.size() > 0) {
getSet(returnGoodHeaderDetailsDataDtoList);
} else {
logger.info("没有查询到任何数据!不需要同步");
}
} catch (Exception e) {
logger.error("startImplement方法抛出异常", e);
} finally {
try {
tocReturnBasicArchivesCacheUtil.clearCache();
} catch (Exception e) {
logger.info("清理档案缓存失败", e);
}
LOCK.unlock();
}
}
}, threadNameStr);
thread.start();
try {
thread.join();
} catch (Exception e) {
logger.error("thread.join()异常", e);
}
}
/**
* 预备执行逻辑
*
* @author liuyang
*/
private void getSet(List<ReturnGoodHeaderDetailsDataDto> returnGoodHeaderDetailsDataDtoList) throws Exception {
//保存到mysql
batchInsert(returnGoodHeaderDetailsDataDtoList);
//过滤成功的数据
List<ReturnGoodHeaderDetailsDataDto> returnGoodHeaderDetailsDataDtoList1 = filterData(returnGoodHeaderDetailsDataDtoList);
//执行推送主逻辑
implement(returnGoodHeaderDetailsDataDtoList1);
}
/** /**
* 过滤掉成功的数据 * 过滤掉成功的数据
* *

View File

@ -2,30 +2,50 @@ package com.hzya.frame.plugin.lets.plugin.transfer;
import cn.hutool.core.date.DateField; import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity; import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.plugin.lets.constant.OverallConstant;
import com.hzya.frame.plugin.lets.constant.ProfilesActiveConstant;
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsStockinOrderRequestVO; import com.hzya.frame.plugin.lets.ofsvo.QueryOfsStockinOrderRequestVO;
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsStockoutOrderRequestVO; import com.hzya.frame.plugin.lets.ofsvo.QueryOfsStockoutOrderRequestVO;
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsTransferOrderRequestVO;
import com.hzya.frame.plugin.lets.u8cdto.BillVO;
import com.hzya.frame.plugin.lets.u8cdto.GeneralBillVO_4IDto;
import com.hzya.frame.plugin.lets.u8cdto.ReusltStrDto;
import com.hzya.frame.plugin.lets.util.PushDataByU8cUtil; import com.hzya.frame.plugin.lets.util.PushDataByU8cUtil;
import com.hzya.frame.plugin.lets.util.SaveOrUpdateBusinessLogUtil; import com.hzya.frame.plugin.lets.util.SaveOrUpdateBusinessLogUtil;
import com.hzya.frame.plugin.lets.util.pushData.Attribute;
import com.hzya.frame.plugin.lets.util.pushData.PushU8CByApiCode;
import com.hzya.frame.plugin.lets.util.pushData.ZTResult;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao; import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
import com.hzya.frame.ttxofs.dto.InterfaceParamDto; import com.hzya.frame.ttxofs.dto.InterfaceParamDto;
import com.hzya.frame.ttxofs.dto.ofsTransferOrderSearch.OFSTranseferOrderSearchResponse;
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.DetailsDto;
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto;
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDto;
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.SaleOutReturnMessageDto;
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse; import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
import com.hzya.frame.ttxofs.dto.stock.StockoutOrderSearchResponse; import com.hzya.frame.ttxofs.dto.stock.StockoutOrderSearchResponse;
import com.hzya.frame.ttxofs.service.OfsUnifiedService; import com.hzya.frame.ttxofs.service.OfsUnifiedService;
import com.hzya.frame.web.entity.JsonResultEntity; import com.hzya.frame.web.entity.JsonResultEntity;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantLock;
/** /**
* 丽知OFS调拨出库订单--->U8C调拨出库单保存签字 * 丽知OFS调拨出库订单--->U8C调拨订单自动生成调拨出库单保存签字
*/ */
public class TransferOutPluginInitializer extends PluginBaseEntity { public class TransferOutPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(TransferOutPluginInitializer.class); Logger logger = LoggerFactory.getLogger(TransferOutPluginInitializer.class);
@ -49,12 +69,12 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
@Override @Override
public String getPluginName() { public String getPluginName() {
return "丽知OFS调拨出库订单--->U8C调拨出库单(保存签字)"; return "丽知OFS调拨出库订单--->U8C调拨订单,自动生成调拨出库单(保存签字)";
} }
@Override @Override
public String getPluginLabel() { public String getPluginLabel() {
return "丽知OFS调拨出库订单--->U8C调拨出库单(保存签字)"; return "丽知OFS调拨出库订单--->U8C调拨订单,自动生成调拨出库单(保存签字)";
} }
@Override @Override
@ -67,6 +87,8 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
@Autowired @Autowired
private PushDataByU8cUtil pushDataByU8cUtil; private PushDataByU8cUtil pushDataByU8cUtil;
@Autowired @Autowired
private PushU8CByApiCode pushU8CByApiCode;
@Autowired
private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil; private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil;
@Autowired @Autowired
@ -106,28 +128,33 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
} catch (Exception e) { } catch (Exception e) {
logger.error("丽知OFS调拨出库订单--->U8C调拨出库单(保存签字),start()方法报错:", e); logger.error("丽知OFS调拨出库订单--->U8C调拨订单,自动生成调拨出库单(保存签字),start()方法报错:", e);
} }
} }
/** /**
* 按单号 * 按单号
*/ */
public void start(String stockinNo) { public void start(String stockoutNo) {
try { try {
QueryOfsStockoutOrderRequestVO queryOfsStockoutOrderRequestVO = new QueryOfsStockoutOrderRequestVO(); QueryOfsStockoutOrderRequestVO queryOfsStockoutOrderRequestVO = new QueryOfsStockoutOrderRequestVO();
queryOfsStockoutOrderRequestVO.setCode(stockinNo); queryOfsStockoutOrderRequestVO.setCode(stockoutNo);
// queryOfsStockoutOrderRequestVO.setCompanyCode("SHXM"); // queryOfsStockoutOrderRequestVO.setCompanyCode("SHXM");
// queryOfsStockoutOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库 // queryOfsStockoutOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库
queryOfsStockoutOrderRequestVO.setPageNo(1L); queryOfsStockoutOrderRequestVO.setPageNo(1L);
queryOfsStockoutOrderRequestVO.setPageSize(500L); queryOfsStockoutOrderRequestVO.setPageSize(500L);
List<StockoutOrderSearchResponse.StockoutOrder> data = queryOfsStockoutOrder(queryOfsStockoutOrderRequestVO); List<StockoutOrderSearchResponse.StockoutOrder> transferOutOrder = queryOfsStockoutOrder(queryOfsStockoutOrderRequestVO);
System.out.println(data); System.out.println(transferOutOrder);
//过滤成功日志
List<StockoutOrderSearchResponse.StockoutOrder> filterTransferOutOrders = filterData(transferOutOrder);
//推送U8C
implement(filterTransferOutOrders);
} catch (Exception e) { } catch (Exception e) {
logger.error("丽知OFS调拨出库订单--->U8C调拨出库单保存签字,start(String goodsName)方法报错:", e); logger.error("丽知OFS调拨出库订单--->U8C调拨订单,自动生成调拨出库单(保存签字),start(String goodsName)方法报错:", e);
} }
} }
/** /**
@ -151,22 +178,279 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
System.out.println(data); System.out.println(data);
} catch (Exception e) { } catch (Exception e) {
logger.error("丽知OFS调拨出库订单--->U8C调拨出库单(保存签字),start(String startTime, String endTime)方法报错:", e); logger.error("丽知OFS调拨出库订单--->U8C调拨订单,自动生成调拨出库单(保存签字),start(String startTime, String endTime)方法报错:", e);
} }
} }
/**
* 过滤成功日志
*/
public List<StockoutOrderSearchResponse.StockoutOrder> filterData(List<StockoutOrderSearchResponse.StockoutOrder> transferOutOrder) {
List<StockoutOrderSearchResponse.StockoutOrder> filterTransferOutOrders = new ArrayList<>();
for (StockoutOrderSearchResponse.StockoutOrder stockoutOrder : transferOutOrder) {
StockoutOrderSearchResponse.StockoutOrder.StockoutH header = stockoutOrder.getHeader();
String rootAppPk = header.getCode();
boolean isExis = true;
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
integrationTaskLivingDetailsEntity.setRootAppPk(rootAppPk);
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y);
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
List<IntegrationTaskLivingDetailsEntity> integrationTaskLivingDetailsEntities = iIntegrationTaskLivingDetailsDao.query(integrationTaskLivingDetailsEntity);
if (integrationTaskLivingDetailsEntities == null || integrationTaskLivingDetailsEntities.size() == 0) {
isExis = false;
}
if (!isExis) {
filterTransferOutOrders.add(stockoutOrder);
}
}
return filterTransferOutOrders;
}
/**
* ofs调拨出库单推送U8C调拨订单自动生成调拨出库单保存签字
*
* @param filterTransferOutOrders
*/
public void implement(List<StockoutOrderSearchResponse.StockoutOrder> filterTransferOutOrders) {
for (StockoutOrderSearchResponse.StockoutOrder transferOutOrder : filterTransferOutOrders) {
System.out.println(transferOutOrder);
BillVO billVO = new BillVO();
String mapStr = "";
String format = "";
String response = "";
String ofsCode = "";
try {
//主表
StockoutOrderSearchResponse.StockoutOrder.StockoutH stockoutH = transferOutOrder.getHeader();
BillVO.Parentvo parentvo = new BillVO.Parentvo();
ofsCode = stockoutH.getCode();
////////////////////////////////////////////////////////////////////////////////ofs调拨订单
List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> ofsTranseferOrders = queryOfsTransderOrder(stockoutH.getSourceOrderCode());
if(ofsTranseferOrders==null||ofsTranseferOrders.size()==0||ofsTranseferOrders.size()>1){
Assert.state(false,"根据调拨出库单:{},的来源单据号:{}查询OFS调拨订单为空或不唯一。请检查。",ofsCode,stockoutH.getSourceOrderCode());
}
OFSTranseferOrderSearchResponse.OFSTranseferOrder ofsTranseferOrder = ofsTranseferOrders.get(0);
System.out.println(ofsTranseferOrder);
////////////////////////////////////////////////////////////////////////////////ofs调拨订单
//创建日期
String created = stockoutH.getCreated();
format = created;
//dbilldate 单据日期
parentvo.setDbilldate(format);
//dauditdate 审批日期
parentvo.setDauditdate(format);
//coperatorid 制单人
parentvo.setCoperatorid("tbadmin");
//cbiztypeid 业务流程编码
parentvo.setCbiztypeid("to01");
//coutcbid 调出组织编码 对应OFS->原库存地点公司
parentvo.setCoutcbid(ofsTranseferOrder.getHeader().getCompanyCode());
//coutcorpid 调出公司编码 对应OFS->原库存地点公司
parentvo.setCoutcorpid(ofsTranseferOrder.getHeader().getCompanyCode());
//coutwhid 调出仓库编码 对应OFS->原库存地点
parentvo.setCoutwhid(ofsTranseferOrder.getHeader().getFacilityCode());
//cincbid 调入组织编码 对应OFS->目标库存地点公司
parentvo.setCincbid(ofsTranseferOrder.getHeader().getToCompanyCode());
//cincorpid 调入公司编码 对应OFS->目标库存地点公司
parentvo.setCincorpid(ofsTranseferOrder.getHeader().getToCompanyCode());
//cinwhid 调入仓库编码 对应OFS->目标库存地点
parentvo.setCinwhid(ofsTranseferOrder.getHeader().getToFacilityCode());
//vnote 备注
parentvo.setVnote(ofsTranseferOrder.getHeader().getNotes());
//pk_defdoc19
parentvo.setPk_defdoc19(StringUtils.substring(ofsTranseferOrder.getHeader().getCode(),5));
//子表
List<OFSTranseferOrderSearchResponse.OFSTranseferOrder.OFSTranseferB> ofsDetails = ofsTranseferOrder.getDetails();
List<BillVO.Childrenvo> childrenvo = new ArrayList<>();
for (OFSTranseferOrderSearchResponse.OFSTranseferOrder.OFSTranseferB ofsDetail : ofsDetails) {
System.out.println(ofsDetail);
BillVO.Childrenvo children = new BillVO.Childrenvo();
//表体
//cinvbasid 存货基本档案
children.setCinvbasid(ofsDetail.getSkuCode());
//nnum 数量
children.setNnum(BigDecimal.valueOf(ofsDetail.getShipQty()));
childrenvo.add(children);
}
billVO.setParentvo(parentvo);
billVO.setChildrenvo(childrenvo);
String jsonStr = JSONUtil.toJsonStr(billVO);
mapStr = "{\"billvo\":"+jsonStr+"}";
ZTResult ztResult = pushU8CByApiCode.pushByCode(OverallConstant.getOverAllValue("approveqzCode"), mapStr);
System.out.println(ztResult);
//两层判断,一层中台转发,一层u8c返回
if ("false".equals(ztResult.getFlag())) {
//转发失败
Assert.state(false, "丽知OFS调拨出库订单--->U8C调拨订单自动生成调拨出库单保存签字.中台转发失败,失败原因:{}", ztResult.getMsg());
}
Attribute attribute = ztResult.getAttribute();
System.out.println(attribute);
boolean isSuccess = false;
String vbillcode = "";
if ("success".equals(attribute.getStatus())) {
isSuccess = true;
String data = attribute.getData();
BillVO resBillVO = resultDataHandle(data);
System.out.println(resBillVO);
vbillcode = resBillVO.getParentvo().getVcode();
}
if (!isSuccess) {
Assert.state(false, "推送U8C--> 丽知OFS调整出库--->U8C其它出库 失败 接口返回结果:{} 接口入参:{}", response, mapStr);
}
//成功
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y);
integrationTaskLivingDetailsEntity.setRootAppNewData(mapStr);
integrationTaskLivingDetailsEntity.setNewTransmitInfo(response);
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
integrationTaskLivingDetailsEntity.setBusinessDate(format);
integrationTaskLivingDetailsEntity.setRootAppPk(ofsCode);
integrationTaskLivingDetailsEntity.setRootAppBill(ofsCode);
integrationTaskLivingDetailsEntity.setDef1(vbillcode);//u8c调拨订单号
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
} catch (Exception e) {
e.printStackTrace();
logger.error("推送U8C丽知OFS调拨出库订单--->U8C调拨订单自动生成调拨出库单保存签字失败失败原因" + e);
//失败
ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class);
String ErrMessage = "推送U8C丽知OFS调整出库--->U8C其它出库失败失败原因" + reusltStrDto.getErrormsg();
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N);
integrationTaskLivingDetailsEntity.setRootAppNewData(mapStr);
integrationTaskLivingDetailsEntity.setNewTransmitInfo(ErrMessage);
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
integrationTaskLivingDetailsEntity.setBusinessDate(format);
integrationTaskLivingDetailsEntity.setRootAppPk(ofsCode);
integrationTaskLivingDetailsEntity.setRootAppBill(ofsCode);//u8c其他出库单号
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
}
}
}
/**
* ofs调拨出库单查询
*
* @param queryOfsStockoutOrderRequestVO
* @return
* @throws Exception
*/
public List<StockoutOrderSearchResponse.StockoutOrder> queryOfsStockoutOrder(QueryOfsStockoutOrderRequestVO queryOfsStockoutOrderRequestVO) throws Exception { public List<StockoutOrderSearchResponse.StockoutOrder> queryOfsStockoutOrder(QueryOfsStockoutOrderRequestVO queryOfsStockoutOrderRequestVO) throws Exception {
InterfaceParamDto interfaceParamDto = new InterfaceParamDto(); InterfaceParamDto interfaceParamDto = new InterfaceParamDto();
interfaceParamDto.setApi("ofs.shipment.search"); interfaceParamDto.setApi("ofs.shipment.search");
queryOfsStockoutOrderRequestVO.setInternalInstructionType("TRANSFER");//入库单类型 SALES销售 EXCHANGE换货 REISSUE补发RETURN销退 PURCHASE采购 PURCHASE_RETURN采退 TRANSFER调拨 WORK_ORDER加工 OTHER其他 ADJUST调整 EXCHANGE换货 queryOfsStockoutOrderRequestVO.setInternalInstructionType("TRANSFER");//入库单类型 SALES销售 EXCHANGE换货 REISSUE补发RETURN销退 PURCHASE采购 PURCHASE_RETURN采退 TRANSFER调拨 WORK_ORDER加工 OTHER其他 ADJUST调整 EXCHANGE换货
queryOfsStockoutOrderRequestVO.setClientCode("LETS"); queryOfsStockoutOrderRequestVO.setClientCode("LETS");
interfaceParamDto.setData(JSON.toJSONString(queryOfsStockoutOrderRequestVO)); interfaceParamDto.setData(JSON.toJSONString(queryOfsStockoutOrderRequestVO));
StockoutOrderSearchResponse stockoutOrderSearchResponse = (StockoutOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto); SaleOutReturnMessageDto saleOutReturnMessageDto = (SaleOutReturnMessageDto) ofsUnifiedService.unified(interfaceParamDto);
System.out.println(saleOutReturnMessageDto);
StockoutOrderSearchResponse stockoutOrderSearchResponse = SaleOutReturnMessageDto2StockoutOrderSearchResponse(saleOutReturnMessageDto);
System.out.println(stockoutOrderSearchResponse); System.out.println(stockoutOrderSearchResponse);
if(stockoutOrderSearchResponse.getData()==null||stockoutOrderSearchResponse.getData().size()==0){ if (stockoutOrderSearchResponse.getData() == null || stockoutOrderSearchResponse.getData().size() == 0) {
return null; return null;
} }
return stockoutOrderSearchResponse.getData(); return stockoutOrderSearchResponse.getData();
} }
/**
* 根据调拨订单号查询ofs调拨订单
*
* @param transferNo
* @throws Exception
*/
public List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> queryOfsTransderOrder(String transferNo) throws Exception {
QueryOfsTransferOrderRequestVO queryOfsTransferOrderRequestVO = new QueryOfsTransferOrderRequestVO();
// queryOfsTransferOrderRequestVO.setStatus("100");//状态 100订单池 200待出库 300已出库 400待入库 900已入库 250出库中 450入库中
queryOfsTransferOrderRequestVO.setCode(transferNo);
queryOfsTransferOrderRequestVO.setPageNo(1L);
queryOfsTransferOrderRequestVO.setPageSize(500L);
InterfaceParamDto interfaceParamDto = new InterfaceParamDto();
interfaceParamDto.setApi("ofs.transferOrder.search");
queryOfsTransferOrderRequestVO.setClientCode("LETS");
interfaceParamDto.setData(JSON.toJSONString(queryOfsTransferOrderRequestVO));
OFSTranseferOrderSearchResponse ofsTranseferOrderSearchResponse = (OFSTranseferOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto);
System.out.println(ofsTranseferOrderSearchResponse);
if (ofsTranseferOrderSearchResponse.getData().size() == 0) {
return null;
} else {
List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> data = ofsTranseferOrderSearchResponse.getData();
return data;
}
}
/**
* 只是命名不一样为了方便区分顾转换为stockout
*
* @param saleOutReturnMessageDto
* @return
*/
public StockoutOrderSearchResponse SaleOutReturnMessageDto2StockoutOrderSearchResponse(SaleOutReturnMessageDto saleOutReturnMessageDto) {
StockoutOrderSearchResponse stockoutOrderSearchResponse = new StockoutOrderSearchResponse();
List<StockoutOrderSearchResponse.StockoutOrder> data = new ArrayList<>();
BeanUtils.copyProperties(saleOutReturnMessageDto, stockoutOrderSearchResponse);
for (HeaderDetailsDto saleOutData : saleOutReturnMessageDto.getData()) {
HeaderDto saleOutHeader = saleOutData.getHeader();
StockoutOrderSearchResponse.StockoutOrder stockoutOrder = new StockoutOrderSearchResponse.StockoutOrder();
StockoutOrderSearchResponse.StockoutOrder.StockoutH stockoutH = new StockoutOrderSearchResponse.StockoutOrder.StockoutH();
List<StockoutOrderSearchResponse.StockoutOrder.StockoutB> stockoutBList = new ArrayList<>();
for (DetailsDto saleOutDetail : saleOutData.getDetails()) {
StockoutOrderSearchResponse.StockoutOrder.StockoutB stockoutB = new StockoutOrderSearchResponse.StockoutOrder.StockoutB();
BeanUtils.copyProperties(saleOutDetail, stockoutB);
stockoutBList.add(stockoutB);
}
//创建时间修改时间创建人修改人赋给表头
StockoutOrderSearchResponse.StockoutOrder.StockoutB stockoutB = stockoutBList.get(0);
stockoutH.setCreated(stockoutB.getCreated());
stockoutH.setCreatedBy(stockoutB.getCreatedBy());
stockoutH.setLastUpdated(stockoutB.getLastUpdated());
stockoutH.setLastUpdatedBy(stockoutB.getLastUpdatedBy());
BeanUtils.copyProperties(saleOutHeader, stockoutH);
stockoutOrder.setHeader(stockoutH);
stockoutOrder.setDetails(stockoutBList);
data.add(stockoutOrder);
}
stockoutOrderSearchResponse.setData(data);
System.out.println(stockoutOrderSearchResponse);
return stockoutOrderSearchResponse;
}
private BillVO resultDataHandle(String resultData) {
try {
if (resultData != null && !"".equals(resultData)) {
if (resultData.contains("[")) {
resultData = resultData.substring(1, resultData.length() - 1);
}
return JSON.parseObject(resultData, BillVO.class);
}
} catch (Exception e) {
e.printStackTrace();
logger.error("解析返回参数失败的错误", e);
//如果解析失败记录原因但是不能影响结果的记录
}
return null;
}
} }

View File

@ -1,400 +1,400 @@
package com.hzya.frame.plugin.lets.plugin.transfer; //package com.hzya.frame.plugin.lets.plugin.transfer;
//
import cn.hutool.core.date.DateField; //import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateUtil; //import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Assert; //import cn.hutool.core.lang.Assert;
import cn.hutool.json.JSONArray; //import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONUtil; //import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON; //import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; //import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity; //import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.plugin.lets.constant.OverallConstant; //import com.hzya.frame.plugin.lets.constant.OverallConstant;
import com.hzya.frame.plugin.lets.constant.ProfilesActiveConstant; //import com.hzya.frame.plugin.lets.constant.ProfilesActiveConstant;
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsTransferOrderRequestVO; //import com.hzya.frame.plugin.lets.ofsvo.QueryOfsTransferOrderRequestVO;
import com.hzya.frame.plugin.lets.u8cdto.BillVO; //import com.hzya.frame.plugin.lets.u8cdto.BillVO;
import com.hzya.frame.plugin.lets.u8cdto.ReusltStrDto; //import com.hzya.frame.plugin.lets.u8cdto.ReusltStrDto;
import com.hzya.frame.plugin.lets.u8cdto.SoSaleResultRootDto; //import com.hzya.frame.plugin.lets.u8cdto.SoSaleResultRootDto;
import com.hzya.frame.plugin.lets.util.PushDataByU8cUtil; //import com.hzya.frame.plugin.lets.util.PushDataByU8cUtil;
import com.hzya.frame.plugin.lets.util.SaveOrUpdateBusinessLogUtil; //import com.hzya.frame.plugin.lets.util.SaveOrUpdateBusinessLogUtil;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao; //import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; //import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
import com.hzya.frame.ttxofs.basics.ReturnMessageBasics; //import com.hzya.frame.ttxofs.basics.ReturnMessageBasics;
import com.hzya.frame.ttxofs.dto.InterfaceParamDto; //import com.hzya.frame.ttxofs.dto.InterfaceParamDto;
import com.hzya.frame.ttxofs.dto.ofsTransferOrderSearch.OFSTranseferOrderSearchResponse; //import com.hzya.frame.ttxofs.dto.ofsTransferOrderSearch.OFSTranseferOrderSearchResponse;
import com.hzya.frame.ttxofs.service.OfsUnifiedService; //import com.hzya.frame.ttxofs.service.OfsUnifiedService;
import com.hzya.frame.ttxofs.util.UrlTransUtil; //import com.hzya.frame.ttxofs.util.UrlTransUtil;
import com.hzya.frame.web.entity.JsonResultEntity; //import com.hzya.frame.web.entity.JsonResultEntity;
import org.apache.http.impl.client.CloseableHttpClient; //import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients; //import org.apache.http.impl.client.HttpClients;
import org.slf4j.Logger; //import org.slf4j.Logger;
import org.slf4j.LoggerFactory; //import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
//
import java.math.BigDecimal; //import java.math.BigDecimal;
import java.util.*; //import java.util.*;
import java.util.concurrent.locks.ReentrantLock; //import java.util.concurrent.locks.ReentrantLock;
//
/** ///**
* OFS->U8C调拨订单 新增修改删除 // * OFS->U8C调拨订单 新增修改删除
* add by zyd 20240802 // * add by zyd 20240802
*/ // */
public class TransferPluginInitializer extends PluginBaseEntity { //public class TransferPluginInitializer extends PluginBaseEntity {
//
Logger logger = LoggerFactory.getLogger(TransferPluginInitializer.class); // Logger logger = LoggerFactory.getLogger(TransferPluginInitializer.class);
//
private static final ReentrantLock LOCK = new ReentrantLock(true); // private static final ReentrantLock LOCK = new ReentrantLock(true);
//
@Override // @Override
public void initialize() { // public void initialize() {
logger.info(getPluginLabel() + "執行初始化方法initialize()"); // logger.info(getPluginLabel() + "執行初始化方法initialize()");
} // }
//
@Override // @Override
public void destroy() { // public void destroy() {
logger.info(getPluginLabel() + "執行銷毀方法destroy()"); // logger.info(getPluginLabel() + "執行銷毀方法destroy()");
} // }
//
@Override // @Override
public String getPluginId() { // public String getPluginId() {
return "com.hzya.frame.plugin.lets.plugin.transfer.TransferPluginInitializer"; // return "com.hzya.frame.plugin.lets.plugin.transfer.TransferPluginInitializer";
} // }
//
@Override // @Override
public String getPluginName() { // public String getPluginName() {
return "丽知OFS调拨订单--->U8C调拨订单(保存及签字)"; // return "丽知OFS调拨订单--->U8C调拨订单(保存及签字)";
} // }
//
@Override // @Override
public String getPluginLabel() { // public String getPluginLabel() {
return "丽知OFS调拨订单--->U8C调拨订单(保存及签字)"; // return "丽知OFS调拨订单--->U8C调拨订单(保存及签字)";
} // }
//
@Override // @Override
public String getPluginType() { // public String getPluginType() {
return "1"; // return "1";
} // }
//
@Autowired // @Autowired
private IIntegrationTaskLivingDetailsDao iIntegrationTaskLivingDetailsDao; // private IIntegrationTaskLivingDetailsDao iIntegrationTaskLivingDetailsDao;
@Autowired // @Autowired
private PushDataByU8cUtil pushDataByU8cUtil; // private PushDataByU8cUtil pushDataByU8cUtil;
@Autowired // @Autowired
private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil; // private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil;
//
@Autowired // @Autowired
private OfsUnifiedService ofsUnifiedService; // private OfsUnifiedService ofsUnifiedService;
//
@Override // @Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { // public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
return null; // return null;
} // }
//
//
/** // /**
* 默认推送 // * 默认推送
*/ // */
public void start() { // public void start() {
try { // try {
//获取当前时间 // //获取当前时间
Date currentDate = new Date(); // Date currentDate = new Date();
Date startTime = DateUtil.offset(currentDate, DateField.MINUTE, -10); // Date startTime = DateUtil.offset(currentDate, DateField.MINUTE, -10);
Date endTime = DateUtil.offset(currentDate, DateField.MINUTE, -2); // Date endTime = DateUtil.offset(currentDate, DateField.MINUTE, -2);
String startTimeStr = DateUtil.format(startTime, "yyyy-MM-dd HH:mm:ss"); // String startTimeStr = DateUtil.format(startTime, "yyyy-MM-dd HH:mm:ss");
String endTimeStr = DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss"); // String endTimeStr = DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss");
//
QueryOfsTransferOrderRequestVO queryOfsTransferOrderRequestVO = new QueryOfsTransferOrderRequestVO(); // QueryOfsTransferOrderRequestVO queryOfsTransferOrderRequestVO = new QueryOfsTransferOrderRequestVO();
queryOfsTransferOrderRequestVO.setCreated_start(startTimeStr); // queryOfsTransferOrderRequestVO.setCreated_start(startTimeStr);
queryOfsTransferOrderRequestVO.setCreated_end(endTimeStr); // queryOfsTransferOrderRequestVO.setCreated_end(endTimeStr);
queryOfsTransferOrderRequestVO.setCompanyCode("SHXM");//U8c&ofs对接群:好的我跟技术聊了就按照这个方 式来赋值就按照赋值的货主来查不赋值就查所有的货主数据 // queryOfsTransferOrderRequestVO.setCompanyCode("SHXM");//U8c&ofs对接群:好的我跟技术聊了就按照这个方 式来赋值就按照赋值的货主来查不赋值就查所有的货主数据
// queryOfsTransferOrderRequestVO.setStatus("900");//状态 100订单池 200待出库 300已出库 400待入库 900已入库 250出库中 450入库中 //// queryOfsTransferOrderRequestVO.setStatus("900");//状态 100订单池 200待出库 300已出库 400待入库 900已入库 250出库中 450入库中
queryOfsTransferOrderRequestVO.setPageNo(1L); // queryOfsTransferOrderRequestVO.setPageNo(1L);
queryOfsTransferOrderRequestVO.setPageSize(50L); // queryOfsTransferOrderRequestVO.setPageSize(50L);
List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> ofsTranseferOrders = queryOfsTransderOrder(queryOfsTransferOrderRequestVO); // List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> ofsTranseferOrders = queryOfsTransderOrder(queryOfsTransferOrderRequestVO);
if (ofsTranseferOrders == null || ofsTranseferOrders.size() == 0) { // if (ofsTranseferOrders == null || ofsTranseferOrders.size() == 0) {
return; // return;
} // }
System.out.println(ofsTranseferOrders); // System.out.println(ofsTranseferOrders);
//过滤日志 // //过滤日志
List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> filterOfsTranseferOrders = filterData(ofsTranseferOrders); // List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> filterOfsTranseferOrders = filterData(ofsTranseferOrders);
if (filterOfsTranseferOrders.size() == 0) { // if (filterOfsTranseferOrders.size() == 0) {
return; // return;
} // }
//
//推送 // //推送
implement(filterOfsTranseferOrders); // implement(filterOfsTranseferOrders);
//
//
} catch (Exception e) { // } catch (Exception e) {
logger.error("丽知OFS调拨订单--->U8C调拨订单(保存及签字),start()方法报错:", e); // logger.error("丽知OFS调拨订单--->U8C调拨订单(保存及签字),start()方法报错:", e);
} // }
} // }
//
/** // /**
* 按调拨订单号 // * 按调拨订单号
*/ // */
public void start(String transeferNo) { // public void start(String transeferNo) {
try { // try {
QueryOfsTransferOrderRequestVO queryOfsTransferOrderRequestVO = new QueryOfsTransferOrderRequestVO(); // QueryOfsTransferOrderRequestVO queryOfsTransferOrderRequestVO = new QueryOfsTransferOrderRequestVO();
queryOfsTransferOrderRequestVO.setCompanyCode("SHXM");//U8c&ofs对接群:好的我跟技术聊了就按照这个方式来赋值就按照赋值的货主来查不赋值就查所有的货主数据 // queryOfsTransferOrderRequestVO.setCompanyCode("SHXM");//U8c&ofs对接群:好的我跟技术聊了就按照这个方式来赋值就按照赋值的货主来查不赋值就查所有的货主数据
// queryOfsTransferOrderRequestVO.setStatus("100");//状态 100订单池 200待出库 300已出库 400待入库 900已入库 250出库中 450入库中 //// queryOfsTransferOrderRequestVO.setStatus("100");//状态 100订单池 200待出库 300已出库 400待入库 900已入库 250出库中 450入库中
queryOfsTransferOrderRequestVO.setCode(transeferNo); // queryOfsTransferOrderRequestVO.setCode(transeferNo);
//
queryOfsTransferOrderRequestVO.setCreated_start("2024-08-08 00:00:00"); // queryOfsTransferOrderRequestVO.setCreated_start("2024-08-08 00:00:00");
queryOfsTransferOrderRequestVO.setCreated_end("2024-08-12 23:59:59"); // queryOfsTransferOrderRequestVO.setCreated_end("2024-08-12 23:59:59");
//
queryOfsTransferOrderRequestVO.setPageNo(1L); // queryOfsTransferOrderRequestVO.setPageNo(1L);
queryOfsTransferOrderRequestVO.setPageSize(500L); // queryOfsTransferOrderRequestVO.setPageSize(500L);
List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> ofsTranseferOrders = queryOfsTransderOrder(queryOfsTransferOrderRequestVO); // List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> ofsTranseferOrders = queryOfsTransderOrder(queryOfsTransferOrderRequestVO);
if (ofsTranseferOrders == null || ofsTranseferOrders.size() == 0) { // if (ofsTranseferOrders == null || ofsTranseferOrders.size() == 0) {
Assert.state(false, "中台查询OFS调拨订单{}不存在请检查OFS调拨订单号。", transeferNo); // Assert.state(false, "中台查询OFS调拨订单{}不存在请检查OFS调拨订单号。", transeferNo);
} // }
//
//过滤日志 // //过滤日志
List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> filterOfsTranseferOrders = filterData(ofsTranseferOrders); // List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> filterOfsTranseferOrders = filterData(ofsTranseferOrders);
if (filterOfsTranseferOrders.size() == 0) { // if (filterOfsTranseferOrders.size() == 0) {
Assert.state(false, "中台查询OFS调拨订单{},过滤成功日志时已被过滤,请勿重新推送。", transeferNo); // Assert.state(false, "中台查询OFS调拨订单{},过滤成功日志时已被过滤,请勿重新推送。", transeferNo);
} // }
//
//推送 // //推送
implement(filterOfsTranseferOrders); // implement(filterOfsTranseferOrders);
//
} catch (Exception e) { // } catch (Exception e) {
logger.error("丽知OFS调拨订单--->U8C调拨订单(保存及签字),start(String transeferNo)方法报错:", e); // logger.error("丽知OFS调拨订单--->U8C调拨订单(保存及签字),start(String transeferNo)方法报错:", e);
} // }
//
} // }
//
/** // /**
* 按时间区间 // * 按时间区间
*/ // */
public void start(String startTime, String endTime) { // public void start(String startTime, String endTime) {
try { // try {
Date business_start = DateUtil.parse(startTime); // Date business_start = DateUtil.parse(startTime);
Date business_end = DateUtil.parse(endTime); // Date business_end = DateUtil.parse(endTime);
String start = DateUtil.format(business_start, "yyyy-MM-dd") + " 00:00:00`"; // String start = DateUtil.format(business_start, "yyyy-MM-dd") + " 00:00:00`";
String end = DateUtil.format(business_end, "yyyy-MM-dd") + " 23:59:59"; // String end = DateUtil.format(business_end, "yyyy-MM-dd") + " 23:59:59";
QueryOfsTransferOrderRequestVO queryOfsTransferOrderRequestVO = new QueryOfsTransferOrderRequestVO(); // QueryOfsTransferOrderRequestVO queryOfsTransferOrderRequestVO = new QueryOfsTransferOrderRequestVO();
queryOfsTransferOrderRequestVO.setCreated_start(start); // queryOfsTransferOrderRequestVO.setCreated_start(start);
queryOfsTransferOrderRequestVO.setCreated_end(end); // queryOfsTransferOrderRequestVO.setCreated_end(end);
queryOfsTransferOrderRequestVO.setCompanyCode("SHXM");//U8c&ofs对接群:好的我跟技术聊了就按照这个方 式来赋值就按照赋值的货主来查不赋值就查所有的货主数据 // queryOfsTransferOrderRequestVO.setCompanyCode("SHXM");//U8c&ofs对接群:好的我跟技术聊了就按照这个方 式来赋值就按照赋值的货主来查不赋值就查所有的货主数据
// queryOfsTransferOrderRequestVO.setStatus("900");//状态 100订单池 200待出库 300已出库 400待入库 900已入库 250出库中 450入库中 //// queryOfsTransferOrderRequestVO.setStatus("900");//状态 100订单池 200待出库 300已出库 400待入库 900已入库 250出库中 450入库中
queryOfsTransferOrderRequestVO.setPageNo(1L); // queryOfsTransferOrderRequestVO.setPageNo(1L);
queryOfsTransferOrderRequestVO.setPageSize(50L); // queryOfsTransferOrderRequestVO.setPageSize(50L);
List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> ofsTranseferOrders = queryOfsTransderOrder(queryOfsTransferOrderRequestVO); // List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> ofsTranseferOrders = queryOfsTransderOrder(queryOfsTransferOrderRequestVO);
if (ofsTranseferOrders == null || ofsTranseferOrders.size() == 0) { // if (ofsTranseferOrders == null || ofsTranseferOrders.size() == 0) {
Assert.state(false, "中台查询OFS调拨订单,按日期:{} - {}未查询OFS调拨订单。", startTime,endTime); // Assert.state(false, "中台查询OFS调拨订单,按日期:{} - {}未查询OFS调拨订单。", startTime,endTime);
} // }
//过滤日志 // //过滤日志
List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> filterOfsTranseferOrders = filterData(ofsTranseferOrders); // List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> filterOfsTranseferOrders = filterData(ofsTranseferOrders);
if (filterOfsTranseferOrders.size() == 0) { // if (filterOfsTranseferOrders.size() == 0) {
Assert.state(false, "中台查询OFS调拨订单,按日期:{} - {},已被推送,请查询OFS调拨订单。", startTime,endTime); // Assert.state(false, "中台查询OFS调拨订单,按日期:{} - {},已被推送,请查询OFS调拨订单。", startTime,endTime);
} // }
//
//推送 // //推送
implement(filterOfsTranseferOrders); // implement(filterOfsTranseferOrders);
//
//
} catch (Exception e) { // } catch (Exception e) {
logger.error("丽知OFS调拨订单--->U8C调拨订单(保存及签字),start(String startTime, String endTime)方法报错:", e); // logger.error("丽知OFS调拨订单--->U8C调拨订单(保存及签字),start(String startTime, String endTime)方法报错:", e);
} // }
} // }
//
//
/** // /**
* 过滤成功日志 // * 过滤成功日志
* // *
* @param ofsTranseferOrders // * @param ofsTranseferOrders
* @return // * @return
*/ // */
public List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> filterData(List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> ofsTranseferOrders) { // public List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> filterData(List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> ofsTranseferOrders) {
List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> filterOfsTranseferOrders = new ArrayList<>(); // List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> filterOfsTranseferOrders = new ArrayList<>();
for (OFSTranseferOrderSearchResponse.OFSTranseferOrder ofsTranseferOrder : ofsTranseferOrders) { // for (OFSTranseferOrderSearchResponse.OFSTranseferOrder ofsTranseferOrder : ofsTranseferOrders) {
OFSTranseferOrderSearchResponse.OFSTranseferOrder.OFSTranseferH header = ofsTranseferOrder.getHeader(); // OFSTranseferOrderSearchResponse.OFSTranseferOrder.OFSTranseferH header = ofsTranseferOrder.getHeader();
//OFS调拨订单号 // //OFS调拨订单号
String rootAppPk = header.getCode(); // String rootAppPk = header.getCode();
boolean isExis = true; // boolean isExis = true;
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); // IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
integrationTaskLivingDetailsEntity.setRootAppPk(rootAppPk); // integrationTaskLivingDetailsEntity.setRootAppPk(rootAppPk);
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y); // integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y);
integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); // integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
List<IntegrationTaskLivingDetailsEntity> integrationTaskLivingDetailsEntities = iIntegrationTaskLivingDetailsDao.query(integrationTaskLivingDetailsEntity); // List<IntegrationTaskLivingDetailsEntity> integrationTaskLivingDetailsEntities = iIntegrationTaskLivingDetailsDao.query(integrationTaskLivingDetailsEntity);
if (integrationTaskLivingDetailsEntities == null || integrationTaskLivingDetailsEntities.size() == 0) { // if (integrationTaskLivingDetailsEntities == null || integrationTaskLivingDetailsEntities.size() == 0) {
isExis = false; // isExis = false;
} // }
if (!isExis) { // if (!isExis) {
filterOfsTranseferOrders.add(ofsTranseferOrder); // filterOfsTranseferOrders.add(ofsTranseferOrder);
} // }
} // }
return filterOfsTranseferOrders; // return filterOfsTranseferOrders;
} // }
//
/** // /**
* 推送u8c调拨订单 // * 推送u8c调拨订单
* // *
* @param filterOfsTranseferOrders // * @param filterOfsTranseferOrders
*/ // */
public void implement(List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> filterOfsTranseferOrders) { // public void implement(List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> filterOfsTranseferOrders) {
for (OFSTranseferOrderSearchResponse.OFSTranseferOrder ofsTranseferOrder : filterOfsTranseferOrders) { // for (OFSTranseferOrderSearchResponse.OFSTranseferOrder ofsTranseferOrder : filterOfsTranseferOrders) {
BillVO billVO = new BillVO(); // BillVO billVO = new BillVO();
//
String mapStr = ""; // String mapStr = "";
String format=""; // String format="";
String response=""; // String response="";
String ofsCode=""; // String ofsCode="";
try { // try {
//
//主表 // //主表
OFSTranseferOrderSearchResponse.OFSTranseferOrder.OFSTranseferH ofsHeader = ofsTranseferOrder.getHeader(); // OFSTranseferOrderSearchResponse.OFSTranseferOrder.OFSTranseferH ofsHeader = ofsTranseferOrder.getHeader();
BillVO.Parentvo parentvo = new BillVO.Parentvo(); // BillVO.Parentvo parentvo = new BillVO.Parentvo();
//
ofsCode=ofsHeader.getCode(); // ofsCode=ofsHeader.getCode();
//
//创建日期 // //创建日期
Date created = ofsHeader.getCreated(); // Date created = ofsHeader.getCreated();
format = DateUtil.format(created, "yyyy-MM-dd HH:mm:ss"); // format = DateUtil.format(created, "yyyy-MM-dd HH:mm:ss");
//
//dbilldate 单据日期 // //dbilldate 单据日期
parentvo.setDbilldate(format); // parentvo.setDbilldate(format);
//dauditdate 审批日期 // //dauditdate 审批日期
parentvo.setDauditdate(format); // parentvo.setDauditdate(format);
//coperatorid 制单人 // //coperatorid 制单人
parentvo.setCoperatorid("tbadmin"); // parentvo.setCoperatorid("tbadmin");
//
//cbiztypeid 业务流程编码 // //cbiztypeid 业务流程编码
parentvo.setCbiztypeid("to01"); // parentvo.setCbiztypeid("to01");
//
//coutcbid 调出组织编码 对应OFS->原库存地点公司 // //coutcbid 调出组织编码 对应OFS->原库存地点公司
parentvo.setCoutcbid(ofsHeader.getCompanyCode()); // parentvo.setCoutcbid(ofsHeader.getCompanyCode());
parentvo.setCoutcbid("SHLZ"); // parentvo.setCoutcbid("SHLZ");
//
//coutcorpid 调出公司编码 对应OFS->原库存地点公司 // //coutcorpid 调出公司编码 对应OFS->原库存地点公司
parentvo.setCoutcorpid(ofsHeader.getCompanyCode()); // parentvo.setCoutcorpid(ofsHeader.getCompanyCode());
parentvo.setCoutcorpid("SHLZ"); // parentvo.setCoutcorpid("SHLZ");
//
//coutwhid 调出仓库编码 对应OFS->原库存地点 // //coutwhid 调出仓库编码 对应OFS->原库存地点
parentvo.setCoutwhid(ofsHeader.getFacilityCode()); // parentvo.setCoutwhid(ofsHeader.getFacilityCode());
parentvo.setCoutwhid("01"); // parentvo.setCoutwhid("01");
//
//cincbid 调入组织编码 对应OFS->目标库存地点公司 // //cincbid 调入组织编码 对应OFS->目标库存地点公司
parentvo.setCincbid("SHXM"); // parentvo.setCincbid("SHXM");
//
//cincorpid 调入公司编码 对应OFS->目标库存地点公司 // //cincorpid 调入公司编码 对应OFS->目标库存地点公司
parentvo.setCincorpid("SHXM"); // parentvo.setCincorpid("SHXM");
//
//cinwhid 调入仓库编码 对应OFS->目标库存地点 // //cinwhid 调入仓库编码 对应OFS->目标库存地点
parentvo.setCinwhid("01"); // parentvo.setCinwhid("01");
//
//vnote 备注 // //vnote 备注
parentvo.setVnote(ofsHeader.getNotes()); // parentvo.setVnote(ofsHeader.getNotes());
//
//
//
//子表 // //子表
List<OFSTranseferOrderSearchResponse.OFSTranseferOrder.OFSTranseferB> ofsDetails = ofsTranseferOrder.getDetails(); // List<OFSTranseferOrderSearchResponse.OFSTranseferOrder.OFSTranseferB> ofsDetails = ofsTranseferOrder.getDetails();
List<BillVO.Childrenvo> childrenvo = new ArrayList<>(); // List<BillVO.Childrenvo> childrenvo = new ArrayList<>();
for (OFSTranseferOrderSearchResponse.OFSTranseferOrder.OFSTranseferB ofsDetail : ofsDetails) { // for (OFSTranseferOrderSearchResponse.OFSTranseferOrder.OFSTranseferB ofsDetail : ofsDetails) {
System.out.println(ofsDetail); // System.out.println(ofsDetail);
BillVO.Childrenvo children = new BillVO.Childrenvo(); // BillVO.Childrenvo children = new BillVO.Childrenvo();
//表体 // //表体
//cinvbasid 存货基本档案 // //cinvbasid 存货基本档案
children.setCinvbasid(ofsDetail.getSkuCode()); // children.setCinvbasid(ofsDetail.getSkuCode());
children.setCinvbasid("6973391730617"); // children.setCinvbasid("6973391730617");
//nnum 数量 // //nnum 数量
children.setNnum(BigDecimal.valueOf(ofsDetail.getShipQty())); // children.setNnum(BigDecimal.valueOf(ofsDetail.getShipQty()));
childrenvo.add(children); // childrenvo.add(children);
} // }
billVO.setParentvo(parentvo); // billVO.setParentvo(parentvo);
billVO.setChildrenvo(childrenvo); // billVO.setChildrenvo(childrenvo);
String jsonStr = JSONUtil.toJsonStr(billVO); // String jsonStr = JSONUtil.toJsonStr(billVO);
mapStr = "{\"billvo\":"+jsonStr+"}"; // mapStr = "{\"billvo\":"+jsonStr+"}";
response = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("approveqz"), mapStr); // response = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("approveqz"), mapStr);
System.out.println(response); // System.out.println(response);
boolean isSuccess = false; // boolean isSuccess = false;
String vcode=""; // String vcode="";
if (response != null && !"".equals(response)) { // if (response != null && !"".equals(response)) {
ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class); // ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class);
if ("success".equals(reusltStrDto.getStatus())) { // if ("success".equals(reusltStrDto.getStatus())) {
isSuccess = true; // isSuccess = true;
String data = reusltStrDto.getData(); // String data = reusltStrDto.getData();
BillVO billVO1 = resultDataHandle(data); // BillVO billVO1 = resultDataHandle(data);
System.out.println(billVO1); // System.out.println(billVO1);
vcode = billVO1.getParentvo().getVcode(); // vcode = billVO1.getParentvo().getVcode();
} // }
} // }
if (!isSuccess) { // if (!isSuccess) {
Assert.state(false, "推送U8C--> 丽知OFS调拨订单--->U8C调拨订单(保存及签字) 失败 接口返回结果:{} 接口入参:{}", response, jsonStr); // Assert.state(false, "推送U8C--> 丽知OFS调拨订单--->U8C调拨订单(保存及签字) 失败 接口返回结果:{} 接口入参:{}", response, jsonStr);
} // }
//
//成功 // //成功
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); // IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y); // integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y);
integrationTaskLivingDetailsEntity.setRootAppNewData(mapStr); // integrationTaskLivingDetailsEntity.setRootAppNewData(mapStr);
integrationTaskLivingDetailsEntity.setNewTransmitInfo(response); // integrationTaskLivingDetailsEntity.setNewTransmitInfo(response);
integrationTaskLivingDetailsEntity.setNewPushDate(new Date()); // integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
integrationTaskLivingDetailsEntity.setBusinessDate(format); // integrationTaskLivingDetailsEntity.setBusinessDate(format);
integrationTaskLivingDetailsEntity.setRootAppPk(ofsCode); // integrationTaskLivingDetailsEntity.setRootAppPk(ofsCode);
integrationTaskLivingDetailsEntity.setRootAppBill(vcode);//u8c调拨订单号 // integrationTaskLivingDetailsEntity.setRootAppBill(vcode);//u8c调拨订单号
integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); // integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); // saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
//
//
} catch (Exception e) { // } catch (Exception e) {
e.printStackTrace(); // e.printStackTrace();
logger.error("丽知OFS调拨订单--->U8C调拨订单(保存及签字)失败,失败原因:" + e); // logger.error("丽知OFS调拨订单--->U8C调拨订单(保存及签字)失败,失败原因:" + e);
//
//失败 // //失败
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); // IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N); // integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N);
integrationTaskLivingDetailsEntity.setRootAppNewData(mapStr); // integrationTaskLivingDetailsEntity.setRootAppNewData(mapStr);
integrationTaskLivingDetailsEntity.setNewTransmitInfo(response); // integrationTaskLivingDetailsEntity.setNewTransmitInfo(response);
integrationTaskLivingDetailsEntity.setNewPushDate(new Date()); // integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
integrationTaskLivingDetailsEntity.setBusinessDate(format); // integrationTaskLivingDetailsEntity.setBusinessDate(format);
integrationTaskLivingDetailsEntity.setRootAppPk(ofsCode); // integrationTaskLivingDetailsEntity.setRootAppPk(ofsCode);
integrationTaskLivingDetailsEntity.setRootAppBill(null);//u8c调拨订单号 // integrationTaskLivingDetailsEntity.setRootAppBill(null);//u8c调拨订单号
integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); // integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); // saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
} // }
//
} // }
//
} // }
//
//
/** // /**
* 开始与结束时间必须小于或等于7天 // * 开始与结束时间必须小于或等于7天
* // *
* @param queryOfsTransferOrderRequestVO // * @param queryOfsTransferOrderRequestVO
* @throws Exception // * @throws Exception
*/ // */
public List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> queryOfsTransderOrder(QueryOfsTransferOrderRequestVO queryOfsTransferOrderRequestVO) throws Exception { // public List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> queryOfsTransderOrder(QueryOfsTransferOrderRequestVO queryOfsTransferOrderRequestVO) throws Exception {
//
InterfaceParamDto interfaceParamDto = new InterfaceParamDto(); // InterfaceParamDto interfaceParamDto = new InterfaceParamDto();
interfaceParamDto.setApi("ofs.transferOrder.search"); // interfaceParamDto.setApi("ofs.transferOrder.search");
queryOfsTransferOrderRequestVO.setClientCode("LETS"); // queryOfsTransferOrderRequestVO.setClientCode("LETS");
interfaceParamDto.setData(JSON.toJSONString(queryOfsTransferOrderRequestVO)); // interfaceParamDto.setData(JSON.toJSONString(queryOfsTransferOrderRequestVO));
OFSTranseferOrderSearchResponse ofsTranseferOrderSearchResponse = (OFSTranseferOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto); // OFSTranseferOrderSearchResponse ofsTranseferOrderSearchResponse = (OFSTranseferOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto);
System.out.println(ofsTranseferOrderSearchResponse); // System.out.println(ofsTranseferOrderSearchResponse);
if (ofsTranseferOrderSearchResponse.getData().size() == 0) { // if (ofsTranseferOrderSearchResponse.getData().size() == 0) {
return null; // return null;
} else { // } else {
List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> data = ofsTranseferOrderSearchResponse.getData(); // List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> data = ofsTranseferOrderSearchResponse.getData();
return data; // return data;
} // }
} // }
private BillVO resultDataHandle(String resultData) { // private BillVO resultDataHandle(String resultData) {
try { // try {
if (resultData != null && !"".equals(resultData)) { // if (resultData != null && !"".equals(resultData)) {
if (resultData.contains("[")) { // if (resultData.contains("[")) {
resultData = resultData.substring(1, resultData.length() - 1); // resultData = resultData.substring(1, resultData.length() - 1);
} // }
return JSON.parseObject(resultData, BillVO.class); // return JSON.parseObject(resultData, BillVO.class);
} // }
} catch (Exception e) { // } catch (Exception e) {
e.printStackTrace(); // e.printStackTrace();
logger.error("解析返回参数失败的错误", e); // logger.error("解析返回参数失败的错误", e);
//如果解析失败记录原因但是不能影响结果的记录 // //如果解析失败记录原因但是不能影响结果的记录
} // }
return null; // return null;
} // }
//
} //}

View File

@ -0,0 +1,121 @@
package com.hzya.frame.plugin.lets.queryvo;
public class StartAndEndVo {
/**
* 开始时间
*/
private String start_time;
/**
* 结束时间
*/
private String end_time;
/**
* 销售订单号
*/
private String src_order_no;
/**
* 退货入库单单号
*/
private String order_no;
/**
* 预入库单号
*/
private String stockinNo;
/**
* 出库单号
*/
private String stockout_no;
/**
* 店铺编码
*/
private String shop_nos;
/**
* 销售订单号
*/
private String vreceiptcode;
/**
* 业务类型
*/
private String cbiztype;
public String getCbiztype() {
return cbiztype;
}
public void setCbiztype(String cbiztype) {
this.cbiztype = cbiztype;
}
public String getVreceiptcode() {
return vreceiptcode;
}
public void setVreceiptcode(String vreceiptcode) {
this.vreceiptcode = vreceiptcode;
}
public String getShop_nos() {
return shop_nos;
}
public void setShop_nos(String shop_nos) {
this.shop_nos = shop_nos;
}
public String getStockout_no() {
return stockout_no;
}
public void setStockout_no(String stockout_no) {
this.stockout_no = stockout_no;
}
public String getStockinNo() {
return stockinNo;
}
public void setStockinNo(String stockinNo) {
this.stockinNo = stockinNo;
}
public String getOrder_no() {
return order_no;
}
public void setOrder_no(String order_no) {
this.order_no = order_no;
}
public String getSrc_order_no() {
return src_order_no;
}
public void setSrc_order_no(String src_order_no) {
this.src_order_no = src_order_no;
}
public String getStart_time() {
return start_time;
}
public void setStart_time(String start_time) {
this.start_time = start_time;
}
public String getEnd_time() {
return end_time;
}
public void setEnd_time(String end_time) {
this.end_time = end_time;
}
}

View File

@ -6,4 +6,6 @@ import lombok.Data;
public class GoodsAutoAllotVO { public class GoodsAutoAllotVO {
private String pk_invbasdoc; private String pk_invbasdoc;
private String pk_corp="all"; private String pk_corp="all";
private String pk_measdoc="all";
private String proBilltemplet="BD100812100000000001";
} }

View File

@ -80,5 +80,5 @@ public class OrderOutTobHeaderDto extends HeaderDetailsDto {
/** /**
* OFS销售订单 * OFS销售订单
*/ */
private SaleOrderMessageDto ofsOrder; private SaleOrderMessageDto saleOrderMessageDto;
} }

View File

@ -3,6 +3,7 @@ package com.hzya.frame.plugin.lets.u8cdto;
import com.hzya.frame.plugin.lets.entity.*; import com.hzya.frame.plugin.lets.entity.*;
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.DetailsDto; import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.DetailsDto;
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDto; import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDto;
import com.hzya.frame.ttxofs.dto.ofssalesordersearch.SaleOrderMessageDto;
import com.hzya.frame.ttxofs.dto.returngoodsearch.ReturnGoodSearchDetailsDto; import com.hzya.frame.ttxofs.dto.returngoodsearch.ReturnGoodSearchDetailsDto;
import com.hzya.frame.ttxofs.dto.returngoodsearch.ReturnGoodSearchHeaderDto; import com.hzya.frame.ttxofs.dto.returngoodsearch.ReturnGoodSearchHeaderDto;
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse; import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
@ -91,4 +92,9 @@ public class OrderToBHeaderDto {
* TOB售后入库单表体 * TOB售后入库单表体
*/ */
private List<StockinOrderSearchResponse.StockinOrder.StockinB> details; private List<StockinOrderSearchResponse.StockinOrder.StockinB> details;
/**
* 售后订单
*/
private SaleOrderMessageDto saleOrderMessageDto;
} }

View File

@ -0,0 +1,116 @@
package com.hzya.frame.plugin.lets.util;
import cn.hutool.core.lang.Assert;
import com.alibaba.fastjson.JSON;
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo;
import com.hzya.frame.plugin.lets.plugin.sales.SoSaleReturnPluginInitializerToB;
import com.hzya.frame.ttxofs.dto.InterfaceParamDto;
import com.hzya.frame.ttxofs.dto.ofssalesordersearch.SaleOrderMessageDto;
import com.hzya.frame.ttxofs.dto.returngoodordersearch.RerturnGoodsOrderSearchData;
import com.hzya.frame.ttxofs.dto.returngoodordersearch.RerturnGoodsOrderSearchJsonRootBean;
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @Authorliuyang
* @Packagecom.hzya.frame.plugin.lets.util
* @ProjectkangarooDataCenterV3
* @nameAfterSalesOrderUtil
* @Date2024/8/19 14:59
* @FilenameAfterSalesOrderUtil
*/
@Component
public class AfterSalesOrderUtil {
Logger logger = LoggerFactory.getLogger(AfterSalesOrderUtil.class);
@Autowired
private OfsUnifiedService ofsUnifiedService;
/**
* 查询售后订单
*
* @author liuyang
*/
public SaleOrderMessageDto queryAfterSalesOrder(StockinOrderSearchResponse.StockinOrder.StockinH header) throws Exception {
if (header != null) {
//根据售后入库单查询售后订单
RerturnGoodsOrderSearchData ofsRertunOrder = getOfsRertunOrder(header.getRefOrderCode());
if (ofsRertunOrder == null || ofsRertunOrder.getHeader() == null || ofsRertunOrder.getDetails() == null) {
Assert.state(false, "根据OFS售后订单编码{},无法查询到售后订单信息!", header.getRefOrderCode());
}
SaleOrderMessageDto ofsOrder = getOfsOrder(ofsRertunOrder.getHeader().getRefOrderCode());
if (ofsOrder == null) {
Assert.state(false, "根据OFS销售订单编码{},无法查询到销售订单信息!", ofsRertunOrder.getHeader().getRefOrderCode());
}
return ofsOrder;
} else {
logger.error("queryAfterSalesOrder方法入参为nullheader为null");
}
return null;
}
/**
* 根据售后订单号查询售后订单
*
* @param refOrderCode 售后订单号
* @author liuyang
*/
public RerturnGoodsOrderSearchData getOfsRertunOrder(String refOrderCode) throws Exception {
Long pageSize = 200L;
Long pageNo = 1L;
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
queryOfsSoSaleOutVo.setPageNo(pageNo);
queryOfsSoSaleOutVo.setPageSize(pageSize);
queryOfsSoSaleOutVo.setCode(refOrderCode);
InterfaceParamDto interfaceParamDto = new InterfaceParamDto();
interfaceParamDto.setApi("ofs.returnOrder.search");
interfaceParamDto.setData(JSON.toJSONString(queryOfsSoSaleOutVo));
RerturnGoodsOrderSearchJsonRootBean rerturnGoodsOrderSearchJsonRootBean = (RerturnGoodsOrderSearchJsonRootBean) ofsUnifiedService.unified(interfaceParamDto);
if (rerturnGoodsOrderSearchJsonRootBean != null) {
if ("false".equals(rerturnGoodsOrderSearchJsonRootBean.getError()) && "0".equals(rerturnGoodsOrderSearchJsonRootBean.getCode()) && "Success".equals(rerturnGoodsOrderSearchJsonRootBean.getMsg())) {
List<RerturnGoodsOrderSearchData> data = rerturnGoodsOrderSearchJsonRootBean.getData();
if (data != null && data.size() > 0) {
return data.get(0);
}
} else {
logger.error("查询售后订单失败,接口返回结果:{}", JSON.toJSON(rerturnGoodsOrderSearchJsonRootBean));
}
} else {
logger.error("rerturnGoodsOrderSearchJsonRootBean为空返回结果为空查询入参条件{}", JSON.toJSON(queryOfsSoSaleOutVo));
}
Assert.state(false, "根据售后订单号:{} 没有查询到OFS售后订单", refOrderCode);
return null;
}
/**
* 查询OFS销售订单
*
* @param code OFS销售订单编码
* @author liuyang
*/
public SaleOrderMessageDto getOfsOrder(String code) throws Exception {
Long pageSize = 200L;
Long pageNo = 1L;
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
queryOfsSoSaleOutVo.setPageNo(pageNo);
queryOfsSoSaleOutVo.setPageSize(pageSize);
queryOfsSoSaleOutVo.setCode(code);
InterfaceParamDto interfaceParamDto = new InterfaceParamDto();
interfaceParamDto.setApi("ofs.salesOrder.search");
interfaceParamDto.setData(JSON.toJSONString(queryOfsSoSaleOutVo));
SaleOrderMessageDto saleOrderMessageDto = (SaleOrderMessageDto) ofsUnifiedService.unified(interfaceParamDto);
return saleOrderMessageDto;
}
}

View File

@ -0,0 +1,39 @@
package com.hzya.frame.plugin.lets.util;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateUtil;
import com.hzya.frame.plugin.lets.queryvo.StartAndEndVo;
import org.springframework.stereotype.Component;
import java.util.Date;
/**
* @Authorliuyang
* @Packagecom.hzya.frame.plugin.lets.util
* @ProjectkangarooDataCenterV3
* @nameOffsetTimeTime
* @Date2024/8/19 16:27
* @FilenameOffsetTimeTime
*/
@Component
public class OffsetTimeTime {
/**
* 实时执行计算时间
*
* @author liuyang
*/
public StartAndEndVo offsetTime() {
StartAndEndVo startAndEndVo = new StartAndEndVo();
Date currentDate = new Date();
Date startTime = DateUtil.offset(currentDate, DateField.MINUTE, -10);
Date endTime = DateUtil.offset(currentDate, DateField.MINUTE, -2);
String startTimeStr = DateUtil.format(startTime, "yyyy-MM-dd HH:mm:ss");
String endTimeStr = DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss");
startAndEndVo.setStart_time(startTimeStr);
startAndEndVo.setEnd_time(endTimeStr);
return startAndEndVo;
}
}

View File

@ -0,0 +1,51 @@
package com.hzya.frame.plugin.lets.util;
import cn.hutool.core.lang.Assert;
import com.hzya.frame.plugin.lets.dao.IBdDefdocDao;
import com.hzya.frame.plugin.lets.entity.BdDefdocEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Authorliuyang
* @Packagecom.hzya.frame.plugin.lets.util
* @ProjectkangarooDataCenterV3
* @nameShopTobOrToCUtil
* @Date2024/8/19 15:20
* @FilenameShopTobOrToCUtil
*/
@Component
public class ShopTobOrToCUtil {
@Autowired
private IBdDefdocDao iBdDefdocDao;
/**
* 查询TOB或者TOC对应的销售订单店铺
*
* @param memo TOBTOC请传这个
*/
public List<BdDefdocEntity> queryU8cShop(String memo) {
//查询U8C店铺档案
String platformZdyId2 = "0001A210000000000XZX";
BdDefdocEntity bdDefdocEntity2 = new BdDefdocEntity();
bdDefdocEntity2.setPkDefdoclist(platformZdyId2);
bdDefdocEntity2.setDr(0);
bdDefdocEntity2.setDataSourceCode("lets_u8c");
bdDefdocEntity2.setMemo(memo);
List<BdDefdocEntity> bdDefdocEntityList2 = iBdDefdocDao.query(bdDefdocEntity2);
if (bdDefdocEntityList2.size() == 0) {
Assert.state(false, "根据O店铺编码{}无法匹配到U8C店铺自定义档案 备注类型:{}", memo);
}
return bdDefdocEntityList2;
}
public String getCommaShop(String memo) {
List<BdDefdocEntity> bdDefdocEntityList = queryU8cShop(memo);
return bdDefdocEntityList.stream().map(BdDefdocEntity::getDoccode).collect(Collectors.joining(","));
}
}

View File

@ -14,4 +14,6 @@ public class Attribute {
private String status; private String status;
private String taskNumber; private String taskNumber;
private String data; private String data;
private String errorcode;
private String errormsg;
} }

View File

@ -56,6 +56,13 @@ public class PushU8CByApiCode {
httpPost.setHeader("apicode", apicode); httpPost.setHeader("apicode", apicode);
//data //data
httpPost.setEntity(new StringEntity(data, "UTF-8")); httpPost.setEntity(new StringEntity(data, "UTF-8"));
// 配置请求的超时设置
RequestConfig requestConfig = RequestConfig.custom()
.setConnectTimeout(600000) // 连接超时时间: 600秒
.setConnectionRequestTimeout(600000) // 请求超时时间: 600秒
.setSocketTimeout(600000) // 数据读取超时时间: 600秒
.build();
httpPost.setConfig(requestConfig);
CloseableHttpResponse response = httpclient.execute(httpPost); CloseableHttpResponse response = httpclient.execute(httpPost);
HttpEntity entity = response.getEntity(); HttpEntity entity = response.getEntity();
@ -96,6 +103,14 @@ public class PushU8CByApiCode {
httpPost.setHeader("apicode", apicode); httpPost.setHeader("apicode", apicode);
//data //data
httpPost.setEntity(new StringEntity(data, "UTF-8")); httpPost.setEntity(new StringEntity(data, "UTF-8"));
// 配置请求的超时设置
RequestConfig requestConfig = RequestConfig.custom()
.setConnectTimeout(600000) // 连接超时时间: 600秒
.setConnectionRequestTimeout(600000) // 请求超时时间: 600秒
.setSocketTimeout(600000) // 数据读取超时时间: 600秒
.build();
httpPost.setConfig(requestConfig);
CloseableHttpResponse response = httpclient.execute(httpPost); CloseableHttpResponse response = httpclient.execute(httpPost);
HttpEntity entity = response.getEntity(); HttpEntity entity = response.getEntity();
String result = EntityUtils.toString(entity); String result = EntityUtils.toString(entity);

View File

@ -14,9 +14,9 @@
<bean name="SupplierPluginInitializer" class="com.hzya.frame.plugin.lets.plugin.base.SupplierPluginInitializer"/> <bean name="SupplierPluginInitializer" class="com.hzya.frame.plugin.lets.plugin.base.SupplierPluginInitializer"/>
<!--调拨--> <!--调拨-->
<bean name="transferPluginInitializer" class="com.hzya.frame.plugin.lets.plugin.transfer.TransferPluginInitializer"/> <!-- <bean name="transferPluginInitializer" class="com.hzya.frame.plugin.lets.plugin.transfer.TransferPluginInitializer"/>-->
<bean name="transferInPluginInitializer" class="com.hzya.frame.plugin.lets.plugin.transfer.TransferInPluginInitializer"/>
<bean name="transferOutPluginInitializer" class="com.hzya.frame.plugin.lets.plugin.transfer.TransferOutPluginInitializer"/> <bean name="transferOutPluginInitializer" class="com.hzya.frame.plugin.lets.plugin.transfer.TransferOutPluginInitializer"/>
<bean name="transferInPluginInitializer" class="com.hzya.frame.plugin.lets.plugin.transfer.TransferInPluginInitializer"/>
<!--调整--> <!--调整-->
<bean name="adjustInPluginInitializer" class="com.hzya.frame.plugin.lets.plugin.adjust.AdjustInPluginInitializer"/> <bean name="adjustInPluginInitializer" class="com.hzya.frame.plugin.lets.plugin.adjust.AdjustInPluginInitializer"/>
<bean name="adjustOutPluginInitializer" class="com.hzya.frame.plugin.lets.plugin.adjust.AdjustOutPluginInitializer"/> <bean name="adjustOutPluginInitializer" class="com.hzya.frame.plugin.lets.plugin.adjust.AdjustOutPluginInitializer"/>

View File

@ -26,7 +26,8 @@ public class BaseTest {
////////////////////////////////////////////////////////////////////////////////////SKU自动分配 ////////////////////////////////////////////////////////////////////////////////////SKU自动分配
@Test @Test
public void t10(){ public void t10(){
goodsAutoAllotPluginInitializer.start("0001A210000000000U4C"); // goodsAutoAllotPluginInitializer.start("0001A210000000000U4C");
goodsAutoAllotPluginInitializer.start("SKU001");
} }
////////////////////////////////////////////////////////////////////////////////////SKU分类 ////////////////////////////////////////////////////////////////////////////////////SKU分类
@Test @Test

View File

@ -1,6 +1,7 @@
package com.hzya.frame.plugin.lets.plugin.sales; package com.hzya.frame.plugin.lets.plugin.sales;
import com.hzya.frame.WebappApplication; import com.hzya.frame.WebappApplication;
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -27,9 +28,21 @@ public class SoSaleReturnPluginInitializerToBTest {
@Test @Test
public void startImplement() { public void startImplement() {
try { try {
soSaleReturnPluginInitializerToB.startImplement(null, null); // soSaleReturnPluginInitializerToB.startImplement(null, null);
soSaleReturnPluginInitializerToB.startImplement("LETS-RE2024081900000001");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
// @Test
// public void startImplement2() {
// try {
// QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
// queryOfsSoSaleOutVo.setClientCode("LETS");
// soSaleReturnPluginInitializerToB.getOfsRertunOrder(queryOfsSoSaleOutVo);
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
} }

View File

@ -12,8 +12,8 @@ import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
@SpringBootTest(classes = WebappApplication.class) @SpringBootTest(classes = WebappApplication.class)
public class TransferTest { public class TransferTest {
@Autowired // @Autowired
private TransferPluginInitializer transferPluginInitializer; // private TransferPluginInitializer transferPluginInitializer;
@Autowired @Autowired
private TransferInPluginInitializer transferInPluginInitializer; private TransferInPluginInitializer transferInPluginInitializer;
@ -25,14 +25,14 @@ public class TransferTest {
private AdjustOutPluginInitializer adjustOutPluginInitializer; private AdjustOutPluginInitializer adjustOutPluginInitializer;
////////////////////////////////////////////////////////////////////////////////////调拨订单 ////////////////////////////////////////////////////////////////////////////////////调拨订单
@Test // @Test
public void t00(){ // public void t00(){
transferPluginInitializer.start(); // transferPluginInitializer.start();
} // }
@Test // @Test
public void t01(){ // public void t01(){
transferPluginInitializer.start("LETS-TH2024080800000002"); // transferPluginInitializer.start("LETS-TH2024080800000002");
} // }
@ -40,7 +40,7 @@ public class TransferTest {
@Test @Test
public void t10(){ public void t10(){
transferOutPluginInitializer.start(); transferOutPluginInitializer.start("LETS-SH2024081400000001");
} }
@Test @Test
@ -55,7 +55,7 @@ public class TransferTest {
} }
@Test @Test
public void t21(){ public void t21(){
transferInPluginInitializer.start("LETS-RE2024080800000002"); transferInPluginInitializer.start("LETS-RE2024081900000002");
} }
@ -68,7 +68,7 @@ public class TransferTest {
} }
@Test @Test
public void t31(){ public void t31(){
adjustInPluginInitializer.start("LETS-AH2024081300000003"); adjustInPluginInitializer.start("LETS-RE2024081900000003");
} }
@Test @Test
public void t32(){ public void t32(){

View File

@ -0,0 +1,38 @@
package com.hzya.frame.plugin.lets.util;
import com.hzya.frame.WebappApplication;
import com.hzya.frame.plugin.lets.entity.BdDefdocEntity;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.List;
import static org.junit.Assert.*;
/**
* @Authorliuyang
* @Packagecom.hzya.frame.plugin.lets.util
* @ProjectkangarooDataCenterV3
* @nameShopTobOrToCUtilTest
* @Date2024/8/19 15:32
* @FilenameShopTobOrToCUtilTest
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = WebappApplication.class)
public class ShopTobOrToCUtilTest {
@Autowired
private ShopTobOrToCUtil shopTobOrToCUtil;
@Test
public void queryU8cShop() {
try {
System.out.println(shopTobOrToCUtil.getCommaShop("TOC"));
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@ -7,6 +7,7 @@ import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OfsSupplierReturnMessageDto;
import com.hzya.frame.ttxofs.dto.ofsTransferOrderSearch.OFSTranseferOrderSearchResponse; import com.hzya.frame.ttxofs.dto.ofsTransferOrderSearch.OFSTranseferOrderSearchResponse;
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.SaleOutReturnMessageDto; import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.SaleOutReturnMessageDto;
import com.hzya.frame.ttxofs.dto.ofssalesordersearch.SaleOrderMessageDto; import com.hzya.frame.ttxofs.dto.ofssalesordersearch.SaleOrderMessageDto;
import com.hzya.frame.ttxofs.dto.returngoodordersearch.RerturnGoodsOrderSearchJsonRootBean;
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse; import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
import java.util.HashMap; import java.util.HashMap;
@ -35,9 +36,9 @@ public class ApiDtoCacheMap {
apiDtoCacheMap.put("ofs.store.search", new OfsShopReturnMessageDto());//店铺查询 apiDtoCacheMap.put("ofs.store.search", new OfsShopReturnMessageDto());//店铺查询
apiDtoCacheMap.put("ofs.vendor.search", new OfsSupplierReturnMessageDto());//店铺查询 apiDtoCacheMap.put("ofs.vendor.search", new OfsSupplierReturnMessageDto());//店铺查询
apiDtoCacheMap.put("ofs.sku.search", new OFSSKUSearchResponse());//OFS存货档案查询接口 apiDtoCacheMap.put("ofs.sku.search", new OFSSKUSearchResponse());//OFS存货档案查询接口
apiDtoCacheMap.put("ofs.inventory.class.search", new OFSSKUClassSearchResponse());//OFS存货分类查询接口 apiDtoCacheMap.put("ofs.inventory.class.search", new OFSSKUClassSearchResponse());//OFS存货分类查询接口
apiDtoCacheMap.put("ofs.returnOrder.search", new RerturnGoodsOrderSearchJsonRootBean());//售后订单
} }
} }

View File

@ -1,8 +1,6 @@
package com.hzya.frame.ttxofs.basics; package com.hzya.frame.ttxofs.basics;
import com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDetailsDto; import lombok.Data;
import java.util.List;
/** /**
* @Authorliuyang * @Authorliuyang
@ -12,42 +10,10 @@ import java.util.List;
* @Date2024/7/30 11:45 * @Date2024/7/30 11:45
* @FilenameReturnMessageBasics * @FilenameReturnMessageBasics
*/ */
@Data
public class ReturnMessageBasics { public class ReturnMessageBasics {
private String code; private String code;
private String msg; private String msg;
private String notify; private String notify;
private String error; private String error;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public String getNotify() {
return notify;
}
public void setNotify(String notify) {
this.notify = notify;
}
public String getError() {
return error;
}
public void setError(String error) {
this.error = error;
}
} }

View File

@ -24,6 +24,8 @@ public class OFSTranseferOrderSearchResponse extends ReturnMessageBasics {
private String companyCode; private String companyCode;
/** 库存地点编码 */ /** 库存地点编码 */
private String facilityCode; private String facilityCode;
/** 目标货主编码 */
private String toCompanyCode;
/** 目标库存地点编码 */ /** 目标库存地点编码 */
private String toFacilityCode; private String toFacilityCode;
/** 订单编码 */ /** 订单编码 */

View File

@ -97,6 +97,17 @@ public class HeaderDto {
private String isFinanical; private String isFinanical;
private String finanicalStatus; private String finanicalStatus;
//会员id
private String memberId;
public String getMemberId() {
return memberId;
}
public void setMemberId(String memberId) {
this.memberId = memberId;
}
public String getId() { public String getId() {
return id; return id;
} }

View File

@ -0,0 +1,15 @@
package com.hzya.frame.ttxofs.dto.returngoodordersearch;
import java.util.List;
/**
* Auto-generated: 2024-08-19 11:31:49
*
* @author bejson.com (i@bejson.com)
* @website http://www.bejson.com/java2pojo/
*/
@lombok.Data
public class RerturnGoodsOrderSearchData {
private RerturnGoodsOrderSearchHeader header;
private List<RerturnGoodsOrderSearchDetails> details;
}

View File

@ -0,0 +1,45 @@
/**
* Copyright 2024 bejson.com
*/
package com.hzya.frame.ttxofs.dto.returngoodordersearch;
import lombok.Data;
/**
* Auto-generated: 2024-08-19 11:31:49
*
* @author bejson.com (i@bejson.com)
* @website http://www.bejson.com/java2pojo/
*/
@Data
public class RerturnGoodsOrderSearchDetails {
private String clientCode;
private String companyCode;
private String storeCode;
private String id;
private String returnOrderId;
private String returnOrderCode;
private String skuCode;
private String skuName;
private String returnType;
private String refundInd;
private String requestQty;
private String fulfillQty;
private String quantityUM;
private String msrPrice;
private String listPrice;
private String totalWeight;
private String totalVolume;
private String weightUM;
private String volumeUM;
private String totalAmount;
private String sourceOrderCode;
private String sourceDiscountPrice;
private String sourcePayAmount;
private String sourceRequestQty;
private String bomType;
private String created;
private String createdBy;
private String lastUpdated;
private String lastUpdatedBy;
}

View File

@ -0,0 +1,66 @@
package com.hzya.frame.ttxofs.dto.returngoodordersearch;
import lombok.Data;
/**
* Auto-generated: 2024-08-19 11:31:49
*
* @author bejson.com (i@bejson.com)
* @website http://www.bejson.com/java2pojo/
*/
@Data
public class RerturnGoodsOrderSearchHeader {
private String id;
private String clientCode;
private String companyCode;
private String storeCode;
private String facilityCode;
private String returnType;
private String exchangeType;
private String refundInd;
private String internalOrderType;
private String bizChannel;
private String code;
private String sourceUserAccount;
private String sourceUserName;
private String returnStatus;
private String shipStatus;
private String refundStatus;
private String refOrderCode;
private String refOrderId;
private String refOrderType;
private String refOrderStatusWhenReturned;
private String sourcePlatformCode;
private String sourceOrderCode;
private String returnNote;
private String requestRefundAmount;
private String actualRefundAmount;
private String totalQty;
private String totalFulfillQty;
private String shipFromAttentionTo;
private String shipFromAddress;
private String shipFromCountry;
private String shipFromState;
private String shipFromCity;
private String shipFromDistrict;
private String shipFromMobile;
private String returnCarrier;
private String returnWaybillCode;
private String auditBy;
private String auditAt;
private String refundThru;
private String csStuff;
private String errorCode;
private String errorDesc;
private String verificationStatus;
private String status;
private String created;
private String createdBy;
private String lastUpdated;
private String lastUpdatedBy;
private String processType;
private String returnNode;
private String sourceModifiedAt;
private String agNumberOfRetries;
private String realReturnReason;
}

View File

@ -0,0 +1,18 @@
package com.hzya.frame.ttxofs.dto.returngoodordersearch;
import com.hzya.frame.ttxofs.basics.ReturnMessageBasics;
import java.util.List;
import lombok.Data;
/**
* Auto-generated: 2024-08-19 11:31:49
*
* @author bejson.com (i@bejson.com)
* @website http://www.bejson.com/java2pojo/
*/
@Data
public class RerturnGoodsOrderSearchJsonRootBean extends ReturnMessageBasics {
private List<RerturnGoodsOrderSearchData> data;
}

View File

@ -8,6 +8,7 @@ import lombok.Data;
import java.util.List; import java.util.List;
/** /**
* 售后入库单
* Auto-generated: 2024-08-09 10:15:6 * Auto-generated: 2024-08-09 10:15:6
* *
* @author bejson.com (i@bejson.com) * @author bejson.com (i@bejson.com)