丽知:新增调拨入库确认单推送调拨入库单。

This commit is contained in:
zhengyf 2025-03-11 10:56:32 +08:00
parent b01de5e5de
commit ec21ad025d
5 changed files with 525 additions and 134 deletions

View File

@ -7,6 +7,10 @@ import lombok.Data;
*/ */
@Data @Data
public class QueryOfsStockinOrderRequestVO { public class QueryOfsStockinOrderRequestVO {
/** 开始时间 */ /** 开始时间 */
private String created_start; private String created_start;
/** 结束时间 */ /** 结束时间 */
@ -15,6 +19,11 @@ public class QueryOfsStockinOrderRequestVO {
private String closedAt_start; private String closedAt_start;
private String closedAt_end; private String closedAt_end;
/** 收货时间 */
private String receivedAt_start;
private String receivedAt_end;
/** 组织 */ /** 组织 */
private String clientCode; private String clientCode;
/** 入库单号 */ /** 入库单号 */

View File

@ -16,8 +16,6 @@ import com.hzya.frame.plugin.lets.entity.IcGeneralBEntity;
import com.hzya.frame.plugin.lets.entity.IcGeneralHEntity; import com.hzya.frame.plugin.lets.entity.IcGeneralHEntity;
import com.hzya.frame.plugin.lets.entity.ToBillEntity; import com.hzya.frame.plugin.lets.entity.ToBillEntity;
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsStockinOrderRequestVO; import com.hzya.frame.plugin.lets.ofsvo.QueryOfsStockinOrderRequestVO;
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsTransferOrderRequestVO;
import com.hzya.frame.plugin.lets.u8cdto.BillVO;
import com.hzya.frame.plugin.lets.u8cdto.GeneralBillVO; import com.hzya.frame.plugin.lets.u8cdto.GeneralBillVO;
import com.hzya.frame.plugin.lets.u8cdto.ReusltStrDto; import com.hzya.frame.plugin.lets.u8cdto.ReusltStrDto;
import com.hzya.frame.plugin.lets.util.PushDataByU8cUtil; import com.hzya.frame.plugin.lets.util.PushDataByU8cUtil;
@ -28,12 +26,9 @@ import com.hzya.frame.plugin.lets.util.pushData.PushU8CByApiCode;
import com.hzya.frame.plugin.lets.util.pushData.ZTResult; 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.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
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.ofsReceiptConfirmSearch.OFSReceiptConfirmSearchResponse;
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.service.OfsUnifiedService; import com.hzya.frame.ttxofs.service.OfsUnifiedService;
import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity; import com.hzya.frame.web.entity.JsonResultEntity;
@ -42,18 +37,22 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.concurrent.locks.ReentrantLock;
/** /**
* 丽知OFS调拨入库订单--->U8C调拨入库订单 * 20250303ofs调拨入库确认单--->U8C调拨入库订单
* 存在多笔入库单
*/ */
public class TransferInPluginInitializer extends PluginBaseEntity { public class TransferInPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(TransferInPluginInitializer.class); Logger logger = LoggerFactory.getLogger(TransferInPluginInitializer.class);
private static final Object OBJECT_LOCK = new Object(); private static final Object OBJECT_LOCK = new Object();
//过滤的公司
public static final List<String> FILTER_CORP_LIST = Arrays.asList("NMNS", "YNS", "HJ");
@Override @Override
public void initialize() { public void initialize() {
logger.info(getPluginLabel() + "執行初始化方法initialize()"); logger.info(getPluginLabel() + "執行初始化方法initialize()");
@ -71,12 +70,12 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
@Override @Override
public String getPluginName() { public String getPluginName() {
return "丽知OFS调拨入库单--->U8C调拨入库订单保存签字关联U8C调拨出库单"; return "丽知OFS调拨入库确认单--->U8C调拨入库订单保存签字关联U8C调拨出库单";
} }
@Override @Override
public String getPluginLabel() { public String getPluginLabel() {
return "丽知OFS调拨入库单--->U8C调拨入库订单保存签字关联U8C调拨出库单"; return "丽知OFS调拨入库确认单--->U8C调拨入库订单保存签字关联U8C调拨出库单";
} }
@Override @Override
@ -108,7 +107,6 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
private QueryU8CEntityUtil queryU8CEntityUtil; private QueryU8CEntityUtil queryU8CEntityUtil;
@Override @Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
try { try {
@ -164,53 +162,58 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO(); QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO();
queryOfsStockinOrderRequestVO.setClosedAt_start(startTimeStr); queryOfsStockinOrderRequestVO.setClosedAt_start(startTimeStr);
queryOfsStockinOrderRequestVO.setClosedAt_end(endTimeStr); queryOfsStockinOrderRequestVO.setClosedAt_end(endTimeStr);
//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库
queryOfsStockinOrderRequestVO.setStatus("900");
List<StockinOrderSearchResponse.StockinOrder> transferInOrder = queryOfsStockinOrder(queryOfsStockinOrderRequestVO);
if (transferInOrder == null || transferInOrder.size() == 0) { List<OFSReceiptConfirmSearchResponse.Order> orders = queryOfsStockinOrder(queryOfsStockinOrderRequestVO);
if (orders == null || orders.size() == 0) {
return; return;
} }
//过滤日志 // //过滤日志
List<StockinOrderSearchResponse.StockinOrder> filterTransferInOrders = filterData(transferInOrder); List<OFSReceiptConfirmSearchResponse.Order> filterOrders = filterData(orders);
if (filterTransferInOrders.size() == 0) { if (filterOrders.size() == 0) {
return; return;
} }
implement(filterTransferInOrders); implement(filterOrders);
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("丽知OFS调拨入库单--->U8C调拨入库订单保存签字关联U8C调拨出库单,start()方法报错:", e); logger.error("丽知OFS调拨入库确认单--->U8C调拨入库订单保存签字关联U8C调拨出库单,start()方法报错:", e);
} }
} }
/** /**
* 按单号 * 按单号
* LETS-RE2025010600000520-confirm_227
* [单号]-[确认单标识]_[id]
*/ */
public void start(String stockinNo) { public void start(String stockinNo) {
try { try {
synchronized (OBJECT_LOCK) { synchronized (OBJECT_LOCK) {
String code = null;
String[] split = stockinNo.split("_");
code = split[0];
if (!code.endsWith("-confirm")) {
code = code + "-confirm";
}
QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO(); QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO();
queryOfsStockinOrderRequestVO.setCode(stockinNo); queryOfsStockinOrderRequestVO.setCode(code);
//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库 List<OFSReceiptConfirmSearchResponse.Order> orders = queryOfsStockinOrder(queryOfsStockinOrderRequestVO);
queryOfsStockinOrderRequestVO.setStatus("900");
List<StockinOrderSearchResponse.StockinOrder> transferInOrder = queryOfsStockinOrder(queryOfsStockinOrderRequestVO);
if (transferInOrder == null || transferInOrder.size() == 0) { if (orders == null || orders.size() == 0) {
Assert.state(false, "丽知OFS调拨入库--->U8C调拨入库根据单据号[入库完成]{},未查询到调拨入库单", stockinNo); Assert.state(false, "丽知OFS调拨入库--->U8C调拨入库根据单据号[入库完成]{},未查询到调拨入库单", stockinNo);
} }
//过滤日志 //过滤日志
List<StockinOrderSearchResponse.StockinOrder> filterTransferInOrders = filterData(transferInOrder); List<OFSReceiptConfirmSearchResponse.Order> filterOrders = filterData(orders);
if (filterTransferInOrders.size() == 0) { if (filterOrders.size() == 0) {
Assert.state(false, "丽知OFS调拨入库--->U8C调拨入库根据单据号[入库完成]{},该调拨入库单已被推送成功,请勿重新推送", stockinNo); Assert.state(false, "丽知OFS调拨入库--->U8C调拨入库根据单据号[入库完成]{},该调拨入库单已被推送成功,请勿重新推送", stockinNo);
} }
implement(filterTransferInOrders); implement(filterOrders);
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("丽知OFS调拨入库单--->U8C调拨入库订单保存签字关联U8C调拨出库单,start(String goodsName)方法报错:", e); logger.error("丽知OFS调拨入库确认单--->U8C调拨入库订单保存签字关联U8C调拨出库单,start(String goodsName)方法报错:", e);
} }
} }
@ -228,26 +231,24 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
String end = DateUtil.format(business_end, "yyyy-MM-dd") + " 23:59:59"; String end = DateUtil.format(business_end, "yyyy-MM-dd") + " 23:59:59";
QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO(); QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO();
queryOfsStockinOrderRequestVO.setClosedAt_start(start); queryOfsStockinOrderRequestVO.setReceivedAt_start(start);
queryOfsStockinOrderRequestVO.setClosedAt_end(end); queryOfsStockinOrderRequestVO.setReceivedAt_end(end);
//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库 List<OFSReceiptConfirmSearchResponse.Order> orders = queryOfsStockinOrder(queryOfsStockinOrderRequestVO);
queryOfsStockinOrderRequestVO.setStatus("900");
List<StockinOrderSearchResponse.StockinOrder> transferInOrder = queryOfsStockinOrder(queryOfsStockinOrderRequestVO);
if (transferInOrder == null || transferInOrder.size() == 0) { if (orders == null || orders.size() == 0) {
Assert.state(false, "丽知OFS调拨入库单--->U8C调拨入库订单根据日期期间[开始时间]-[结束时间]{}-{},未查询到调拨入库单[入库完成]", startTime, endTime); Assert.state(false, "丽知OFS调拨入库确认单--->U8C调拨入库订单根据日期期间[开始时间]-[结束时间]{}-{},未查询到调拨入库单[入库完成]", startTime, endTime);
} }
//过滤日志 // //过滤日志
List<StockinOrderSearchResponse.StockinOrder> filterTransferInOrders = filterData(transferInOrder); List<OFSReceiptConfirmSearchResponse.Order> filterOrders = filterData(orders);
if (filterTransferInOrders.size() == 0) { if (filterOrders.size() == 0) {
Assert.state(false, "丽知OFS调拨入库单--->U8C调拨入库订单根据日期期间[开始时间]-[结束时间]{}-{},该调期调拨入库单[入库完成]已被推送成功,请勿重新推送", startTime, endTime); Assert.state(false, "丽知OFS调拨入库确认单--->U8C调拨入库订单根据日期期间[开始时间]-[结束时间]{}-{},该调期调拨入库单[入库完成]已被推送成功,请勿重新推送", startTime, endTime);
} }
implement(filterTransferInOrders); implement(filterOrders);
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("丽知OFS调拨入库单--->U8C调拨入库订单保存签字关联U8C调拨出库单,start(String startTime, String endTime)方法报错:", e); logger.error("丽知OFS调拨入库确认单--->U8C调拨入库订单保存签字关联U8C调拨出库单,start(String startTime, String endTime)方法报错:", e);
} }
} }
@ -256,15 +257,16 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
* *
* @return * @return
*/ */
public List<StockinOrderSearchResponse.StockinOrder> filterData(List<StockinOrderSearchResponse.StockinOrder> stockinOrders) { public List<OFSReceiptConfirmSearchResponse.Order> filterData(List<OFSReceiptConfirmSearchResponse.Order> orders) {
List<StockinOrderSearchResponse.StockinOrder> filterStockinOrders = new ArrayList<>(); //需要改变为确认单的id 不在使用调拨入库单单号可以记录为调拨入库单_确认单id
for (StockinOrderSearchResponse.StockinOrder stockinOrder : stockinOrders) { List<OFSReceiptConfirmSearchResponse.Order> filterOrders = new ArrayList<>();
StockinOrderSearchResponse.StockinOrder.StockinH header = stockinOrder.getHeader(); for (OFSReceiptConfirmSearchResponse.Order order : orders) {
OFSReceiptConfirmSearchResponse.Header header = order.getHeader();
//过滤"NMNS"\"YNS"\"HJ" //过滤"NMNS"\"YNS"\"HJ"
if("NMNS".equals(header.getCompanyCode())||"YNS".equals(header.getCompanyCode())||"HJ".equals(header.getCompanyCode())){ if (FILTER_CORP_LIST.contains(header.getCompanyCode())) {
continue; continue;
} }
String rootAppPk = header.getCode(); String rootAppPk = header.getCode() + "_" + header.getId();
boolean isExis = true; boolean isExis = true;
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
integrationTaskLivingDetailsEntity.setRootAppPk(rootAppPk); integrationTaskLivingDetailsEntity.setRootAppPk(rootAppPk);
@ -275,35 +277,34 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
isExis = false; isExis = false;
} }
if (!isExis) { if (!isExis) {
filterStockinOrders.add(stockinOrder); filterOrders.add(order);
} }
} }
return filterStockinOrders; return filterOrders;
} }
/** /**
* ofs调拨入库推送u8c调拨入库关联调拨订 * ofs调拨入库确认单推送u8c调拨入库关联调拨订单出库
* <p> * <p>
* 根据ofs调拨订单可以查询到u8c调拨订单 * 根据ofs调拨订单可以查询到u8c调拨订单调拨出库单
* u8c调拨出库单子表的来源单据号vsourcebillcode调拨订单号 * u8c调拨出库单子表的来源单据号vsourcebillcode调拨订单号
*
* @param filterTransferInOrders
*/ */
public void implement(List<StockinOrderSearchResponse.StockinOrder> filterTransferInOrders) { public void implement(List<OFSReceiptConfirmSearchResponse.Order> filterOrders) {
for (StockinOrderSearchResponse.StockinOrder transferInOrders : filterTransferInOrders) { for (OFSReceiptConfirmSearchResponse.Order order : filterOrders) {
OFSReceiptConfirmSearchResponse.Header ofsHeader = order.getHeader();
System.out.println(ofsHeader);
String mapStr = ""; String mapStr = "";
String format = ""; String format = "";
String response = ""; String response = "";
String ofsCode = ""; String ofsCode = "";
try { try {
StockinOrderSearchResponse.StockinOrder.StockinH ofsTransferHeader = transferInOrders.getHeader();
//ofs调拨订单号 //ofs调拨订单号
String ofsSourceOrderCode = ofsTransferHeader.getSourceOrderCode(); String ofsRefOrderCode = ofsHeader.getRefOrderCode();
//ofs调拨入库单单号 //ofs调拨入库确认单单号
ofsCode = ofsTransferHeader.getCode(); ofsCode = ofsHeader.getCode();
//ofs最后修改时间调入时间 //ofs最后修改时间调入时间
format = ofsTransferHeader.getLastUpdated(); format = ofsHeader.getLastUpdated();
GeneralBillVO generalBillVO = new GeneralBillVO(); GeneralBillVO generalBillVO = new GeneralBillVO();
//主表 //主表
@ -311,26 +312,24 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
//coperatorid 制单人 //coperatorid 制单人
parentvo.setCoperatorid("tbadmin"); parentvo.setCoperatorid("tbadmin");
//cwarehouseid 仓库 //cwarehouseid 仓库
parentvo.setCwarehouseid(ofsTransferHeader.getFacilityCode()); parentvo.setCwarehouseid(ofsHeader.getFacilityCode());
//pk_calbody 库存组织 //pk_calbody 库存组织
String corpCode = queryU8CEntityUtil.queryBdDefDocByPkDefDocList(ofsTransferHeader.getCompanyCode()); String corpCode = queryU8CEntityUtil.queryBdDefDocByPkDefDocList(ofsHeader.getCompanyCode());
parentvo.setPk_calbody(corpCode); parentvo.setPk_calbody(corpCode);
//pk_corp 公司 //pk_corp 公司
parentvo.setPk_corp(corpCode); parentvo.setPk_corp(corpCode);
//pk_defdoc19 自定义项19ofs调拨订单号 //pk_defdoc19 自定义项19ofs调拨订单号
parentvo.setVuserdef19(ofsSourceOrderCode); parentvo.setVuserdef19(ofsRefOrderCode);
//dbilldate 单据日期 //dbilldate 单据日期
parentvo.setDbilldate(format.substring(0, 10)); parentvo.setDbilldate(format.substring(0, 10));
//U8C调拨订单信息
// List<ToBillEntity> toBillEntityList = queryToBillByPkVdefdoc19(ofsSourceOrderCode);
//U8C调拨出库单主表信息 //U8C调拨出库单主表信息
List<IcGeneralHEntity> icGeneralHEntityList = queryIcGeneralHByVdef19(ofsSourceOrderCode); List<IcGeneralHEntity> icGeneralHEntityList = queryIcGeneralHByVdef19(ofsRefOrderCode);
if (icGeneralHEntityList == null) { if (icGeneralHEntityList == null) {
Assert.state(false, "在U8C内根据OFS调拨订单号vdefdoc19:{},没有查询到调拨出库单,请检查。", ofsSourceOrderCode); Assert.state(false, "在U8C内根据OFS调拨订单号vdefdoc19:{},没有查询到调拨出库单,请检查。", ofsRefOrderCode);
} }
if (icGeneralHEntityList.size() > 1) { if (icGeneralHEntityList.size() > 1) {
Assert.state(false, "在U8C内根据OFS调拨订单号vdefdoc19:{},查询到调拨出库单不唯一,请检查。", ofsSourceOrderCode); Assert.state(false, "在U8C内根据OFS调拨订单号vdefdoc19:{},查询到调拨出库单不唯一,请检查。", ofsRefOrderCode);
} }
IcGeneralHEntity icGeneralHEntity = icGeneralHEntityList.get(0); IcGeneralHEntity icGeneralHEntity = icGeneralHEntityList.get(0);
@ -342,13 +341,13 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
List<GeneralBillVO.Childrenvo> ChildrenList = new ArrayList<>(); List<GeneralBillVO.Childrenvo> ChildrenList = new ArrayList<>();
int i = 1; int i = 1;
for (StockinOrderSearchResponse.StockinOrder.StockinB ofsTransferDetail : transferInOrders.getDetails()) { for (OFSReceiptConfirmSearchResponse.Detail detail : order.getDetails()) {
GeneralBillVO.Childrenvo childrenvo = new GeneralBillVO.Childrenvo(); GeneralBillVO.Childrenvo childrenvo = new GeneralBillVO.Childrenvo();
//cinventoryid 存货 //cinventoryid 存货
childrenvo.setCinventoryid(ofsTransferDetail.getSkuCode()); childrenvo.setCinventoryid(detail.getSkuCode());
//ninnum 实收数量 //ninnum 实收数量
childrenvo.setNinnum(ofsTransferDetail.getReceivedQty()); childrenvo.setNinnum(detail.getReceivedQty());
//csourcetype 来源单据类型编码 //csourcetype 来源单据类型编码
childrenvo.setCsourcetype("4Y"); childrenvo.setCsourcetype("4Y");
//vsourcebillcode 来源单据号 //vsourcebillcode 来源单据号
@ -357,11 +356,11 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
for (IcGeneralBEntity icGeneralBEntity : icGeneralBEntityList) { for (IcGeneralBEntity icGeneralBEntity : icGeneralBEntityList) {
//根据存货+行号匹配 //根据存货+行号匹配
if (ofsTransferDetail.getRefOrderDetailId().equals(icGeneralBEntity.getVuserdef20().trim()) && ofsTransferDetail.getSkuCode().equals(icGeneralBEntity.getCinvbascode())) { if (detail.getRefOrderDetailId().equals(icGeneralBEntity.getVuserdef20().trim()) && detail.getSkuCode().equals(icGeneralBEntity.getCinvbascode())) {
//crowno 行号 //crowno 行号
childrenvo.setCrowno(i++ + "0"); childrenvo.setCrowno(i++ + "0");
//ofs来源单据行行号 //ofs来源单据行行号
childrenvo.setVuserdef20(ofsTransferDetail.getRefOrderDetailId()); childrenvo.setVuserdef20(detail.getRefOrderDetailId());
//vsourcerowno 来源单据行号 //vsourcerowno 来源单据行号
childrenvo.setVsourcerowno(icGeneralBEntity.getCrowno()); childrenvo.setVsourcerowno(icGeneralBEntity.getCrowno());
break; break;
@ -374,11 +373,11 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
mapStr = "{\"GeneralBillVO\":[" + JSONUtil.toJsonStr(generalBillVO) + "]}"; mapStr = "{\"GeneralBillVO\":[" + JSONUtil.toJsonStr(generalBillVO) + "]}";
ZTResult ztResult = pushU8CByApiCode.pushByCode(OverallConstant.getOverAllValue("approveInqzCode"), mapStr); ZTResult ztResult = pushU8CByApiCode.pushByCode(OverallConstant.getOverAllValue("approveInqzCode"), mapStr);
//两层判断,一层中台转发,一层u8c返回 //中台返回结果
if ("false".equals(ztResult.getFlag())) { if ("false".equals(ztResult.getFlag())) {
//转发失败 //转发失败
response = JSONUtil.toJsonStr(ztResult.getAttribute()); response = JSONUtil.toJsonStr(ztResult.getAttribute());
Assert.state(false, "丽知OFS调拨入库单--->U8C调拨入库订单.中台转发失败,失败原因:{}", response); Assert.state(false, "丽知OFS调拨入库确认单--->U8C调拨入库订单.中台转发失败,失败原因:{}", response);
} }
Attribute attribute = ztResult.getAttribute(); Attribute attribute = ztResult.getAttribute();
boolean isSuccess = false; boolean isSuccess = false;
@ -390,7 +389,7 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
vbillcode = generalBill.getParentvo().getVbillcode(); vbillcode = generalBill.getParentvo().getVbillcode();
} }
if (!isSuccess) { if (!isSuccess) {
Assert.state(false, "推送U8C--> 丽知OFS调拨入库单--->U8C调拨入库订单 失败 接口返回结果:{} 接口入参:{}", response, mapStr); Assert.state(false, "推送U8C--> 丽知OFS调拨入库确认单--->U8C调拨入库订单 失败 接口返回结果:{} 接口入参:{}", response, mapStr);
} }
//成功 //成功
@ -400,19 +399,19 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
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 + "_" + ofsHeader.getId());
integrationTaskLivingDetailsEntity.setRootAppBill(ofsCode); integrationTaskLivingDetailsEntity.setRootAppBill(ofsCode);
integrationTaskLivingDetailsEntity.setNewSystemNumber(corpCode+"_"+vbillcode); integrationTaskLivingDetailsEntity.setNewSystemNumber(corpCode + "_" + vbillcode);
integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
logger.error("推送U8C丽知OFS调拨入库单--->U8C调拨入库订单保存签字关联U8C调拨出库单失败失败原因" + e); logger.error("推送U8C丽知OFS调拨入库确认单--->U8C调拨入库订单保存签字关联U8C调拨出库单失败失败原因" + e);
ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class); ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class);
String ErrMessage = null; String ErrMessage = null;
if (reusltStrDto != null) { if (reusltStrDto != null) {
ErrMessage = "推送U8C丽知OFS调拨入库单--->U8C调拨入库订单失败原因" + reusltStrDto.getErrormsg(); ErrMessage = "推送U8C丽知OFS调拨入库确认单--->U8C调拨入库订单失败原因" + reusltStrDto.getErrormsg();
} else { } else {
ErrMessage = e.getMessage(); ErrMessage = e.getMessage();
} }
@ -423,7 +422,7 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
integrationTaskLivingDetailsEntity.setNewTransmitInfo(ErrMessage); integrationTaskLivingDetailsEntity.setNewTransmitInfo(ErrMessage);
integrationTaskLivingDetailsEntity.setNewPushDate(new Date()); integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
integrationTaskLivingDetailsEntity.setBusinessDate(format); integrationTaskLivingDetailsEntity.setBusinessDate(format);
integrationTaskLivingDetailsEntity.setRootAppPk(ofsCode); integrationTaskLivingDetailsEntity.setRootAppPk(ofsCode + "_" + ofsHeader.getId());
integrationTaskLivingDetailsEntity.setRootAppBill(ofsCode); integrationTaskLivingDetailsEntity.setRootAppBill(ofsCode);
integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
@ -443,80 +442,86 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
logger.error("解析返回参数失败的错误", e); logger.error("解析返回参数失败的错误", e);
//如果解析失败记录原因但是不能影响结果的记录
} }
return null; return null;
} }
// /**
// * 查询ofs调拨入库单
// */
// public List<StockinOrderSearchResponse.StockinOrder> queryOfsStockinOrder(QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO) throws Exception {
// Long pageNo = 1L;
//
// List<StockinOrderSearchResponse.StockinOrder> all = new ArrayList<>();
//
// InterfaceParamDto interfaceParamDto = new InterfaceParamDto();
// interfaceParamDto.setApi("ofs.receipt.search");
// queryOfsStockinOrderRequestVO.setInternalInstructionType("TRANSFER");//入库单类型 SALES销售 EXCHANGE换货 REISSUE补发RETURN销退 PURCHASE采购 PURCHASE_RETURN采退 TRANSFER调拨 WORK_ORDER加工 OTHER其他 ADJUST调整 EXCHANGE换货
// queryOfsStockinOrderRequestVO.setClientCode("LETS");
// queryOfsStockinOrderRequestVO.setPageNo(pageNo);
// queryOfsStockinOrderRequestVO.setPageSize(500L);
// interfaceParamDto.setData(JSON.toJSONString(queryOfsStockinOrderRequestVO));
// StockinOrderSearchResponse stockinOrderSearchResponse = (StockinOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto);
// if (stockinOrderSearchResponse.getData() == null || stockinOrderSearchResponse.getData().size() == 0) {
// return null;
// }
// all.addAll(stockinOrderSearchResponse.getData());
//
// int count = stockinOrderSearchResponse.getData().size();
// while (count >= 500) {//>=500,可能还有下一页
// //还有下一页
// pageNo++;
// queryOfsStockinOrderRequestVO.setPageNo(pageNo);
// interfaceParamDto.setData(JSON.toJSONString(queryOfsStockinOrderRequestVO));
// StockinOrderSearchResponse stockinOrderSearchResponse1 = (StockinOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto);
//
// all.addAll(stockinOrderSearchResponse1.getData());
//
// count = stockinOrderSearchResponse1.getData().size();
// }
//
// return all;
// }
/** /**
* 查询ofs调拨入库单 * 查询ofs调拨入库确认单
*
* @param queryOfsStockinOrderRequestVO
* @return
* @throws Exception
*/ */
public List<StockinOrderSearchResponse.StockinOrder> queryOfsStockinOrder(QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO) throws Exception { public List<OFSReceiptConfirmSearchResponse.Order> queryOfsStockinOrder(QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO) throws Exception {
Long pageNo = 1L; Long pageNo = 1L;
List<StockinOrderSearchResponse.StockinOrder> all = new ArrayList<>(); List<OFSReceiptConfirmSearchResponse.Order> all = new ArrayList<>();
InterfaceParamDto interfaceParamDto = new InterfaceParamDto(); InterfaceParamDto interfaceParamDto = new InterfaceParamDto();
interfaceParamDto.setApi("ofs.receipt.search"); interfaceParamDto.setApi("ofs.receipt.confirm.search");
queryOfsStockinOrderRequestVO.setInternalInstructionType("TRANSFER");//入库单类型 SALES销售 EXCHANGE换货 REISSUE补发RETURN销退 PURCHASE采购 PURCHASE_RETURN采退 TRANSFER调拨 WORK_ORDER加工 OTHER其他 ADJUST调整 EXCHANGE换货 queryOfsStockinOrderRequestVO.setInternalInstructionType("TRANSFER");//入库单类型 SALES销售 EXCHANGE换货 REISSUE补发RETURN销退 PURCHASE采购 PURCHASE_RETURN采退 TRANSFER调拨 WORK_ORDER加工 OTHER其他 ADJUST调整 EXCHANGE换货
queryOfsStockinOrderRequestVO.setClientCode("LETS"); queryOfsStockinOrderRequestVO.setClientCode("LETS");
queryOfsStockinOrderRequestVO.setPageNo(pageNo); queryOfsStockinOrderRequestVO.setPageNo(pageNo);
queryOfsStockinOrderRequestVO.setPageSize(500L); queryOfsStockinOrderRequestVO.setPageSize(500L);
queryOfsStockinOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库
interfaceParamDto.setData(JSON.toJSONString(queryOfsStockinOrderRequestVO)); interfaceParamDto.setData(JSON.toJSONString(queryOfsStockinOrderRequestVO));
StockinOrderSearchResponse stockinOrderSearchResponse = (StockinOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto); OFSReceiptConfirmSearchResponse ofsReceiptConfirmSearchResponse = (OFSReceiptConfirmSearchResponse) ofsUnifiedService.unified(interfaceParamDto);
if (stockinOrderSearchResponse.getData() == null || stockinOrderSearchResponse.getData().size() == 0) { if (ofsReceiptConfirmSearchResponse.getData() == null || ofsReceiptConfirmSearchResponse.getData().size() == 0) {
return null; return null;
} }
all.addAll(stockinOrderSearchResponse.getData()); all.addAll(ofsReceiptConfirmSearchResponse.getData());
int count = stockinOrderSearchResponse.getData().size(); int count = ofsReceiptConfirmSearchResponse.getData().size();
while (count >= 500) {//>=500,可能还有下一页 while (count >= 500) {//>=500,可能还有下一页
//还有下一页 //还有下一页
pageNo++; pageNo++;
queryOfsStockinOrderRequestVO.setPageNo(pageNo); queryOfsStockinOrderRequestVO.setPageNo(pageNo);
interfaceParamDto.setData(JSON.toJSONString(queryOfsStockinOrderRequestVO)); interfaceParamDto.setData(JSON.toJSONString(queryOfsStockinOrderRequestVO));
StockinOrderSearchResponse stockinOrderSearchResponse1 = (StockinOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto); OFSReceiptConfirmSearchResponse ofsReceiptConfirmSearchResponse1 = (OFSReceiptConfirmSearchResponse) ofsUnifiedService.unified(interfaceParamDto);
all.addAll(stockinOrderSearchResponse1.getData()); all.addAll(ofsReceiptConfirmSearchResponse1.getData());
count = stockinOrderSearchResponse1.getData().size(); count = ofsReceiptConfirmSearchResponse1.getData().size();
} }
return all; return all;
} }
/**
* 根据单号查询调拨单 to_bill 单据主表 单据
*
* @param vcode
*/
public List<ToBillEntity> queryToBillByVCode(String vcode) {
ToBillEntity toBillEntity = new ToBillEntity();
toBillEntity.setVcode(vcode);
toBillEntity.setCbilltype("5X");
List<ToBillEntity> toBillEntityList = toBillDao.queryToBillEntity(toBillEntity);
return toBillEntityList;
}
/**
* 根据自定义项19ofs调拨订单单号查询u8c调拨订单
*
* @param pkDefdoc19
* @return
*/
public List<ToBillEntity> queryToBillByPkVdefdoc19(String pkDefdoc19) {
ToBillEntity toBillEntity = new ToBillEntity();
toBillEntity.setPkDefdoc19(pkDefdoc19);
toBillEntity.setCbilltype("5X");
toBillEntity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE);
List<ToBillEntity> toBillEntityList = toBillDao.query(toBillEntity);
return toBillEntityList;
}
/** /**
* 根据调拨出库单主表自定义项19ofs调拨订单号查询调拨出库单主表 * 根据调拨出库单主表自定义项19ofs调拨订单号查询调拨出库单主表
@ -538,10 +543,6 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
* 根据调拨出库单主表主键查询调拨出库单子表 * 根据调拨出库单主表主键查询调拨出库单子表
*/ */
public List<IcGeneralBEntity> queryIcGeneralBByCgeneralhid(String cgeneralhid) { public List<IcGeneralBEntity> queryIcGeneralBByCgeneralhid(String cgeneralhid) {
// IcGeneralBEntity icGeneralBEntity = new IcGeneralBEntity();
// icGeneralBEntity.setDr(0);
// icGeneralBEntity.setCgeneralhid(cgeneralhid);
// icGeneralBEntity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE);
List<IcGeneralBEntity> icGeneralBEntityList = icGeneralBDao.queryAndCinvbasCode(cgeneralhid); List<IcGeneralBEntity> icGeneralBEntityList = icGeneralBDao.queryAndCinvbasCode(cgeneralhid);
if (icGeneralBEntityList == null || icGeneralBEntityList.size() == 0) { if (icGeneralBEntityList == null || icGeneralBEntityList.size() == 0) {
return null; return null;

View File

@ -5,6 +5,7 @@ import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OFSSKUClassSearchResponse;
import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OFSSKUSearchResponse; import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OFSSKUSearchResponse;
import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OfsShopReturnMessageDto; import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OfsShopReturnMessageDto;
import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OfsSupplierReturnMessageDto; import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OfsSupplierReturnMessageDto;
import com.hzya.frame.ttxofs.dto.ofsReceiptConfirmSearch.OFSReceiptConfirmSearchResponse;
import com.hzya.frame.ttxofs.dto.ofsTransferOrderSearch.OFSAdjustOrderSearchResponse; import com.hzya.frame.ttxofs.dto.ofsTransferOrderSearch.OFSAdjustOrderSearchResponse;
import com.hzya.frame.ttxofs.dto.ofsTransferOrderSearch.OFSTranseferOrderSearchResponse; import com.hzya.frame.ttxofs.dto.ofsTransferOrderSearch.OFSTranseferOrderSearchResponse;
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderBean; import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderBean;
@ -50,5 +51,7 @@ public class ApiDtoCacheMap {
apiDtoCacheMap.put("ofs.purchaseOrder.search", new OfsPoOrderBean());//采购订单 apiDtoCacheMap.put("ofs.purchaseOrder.search", new OfsPoOrderBean());//采购订单
apiDtoCacheMap.put("ofs.purchaseReturnOrder.search", new PurchaseReturnOrderBean());//采退订单 apiDtoCacheMap.put("ofs.purchaseReturnOrder.search", new PurchaseReturnOrderBean());//采退订单
apiDtoCacheMap.put("ofs.adjustOrder.search", new OFSAdjustOrderSearchResponse());//调整单 apiDtoCacheMap.put("ofs.adjustOrder.search", new OFSAdjustOrderSearchResponse());//调整单
apiDtoCacheMap.put("ofs.receipt.confirm.search", new OFSReceiptConfirmSearchResponse());//调整单
} }
} }

View File

@ -18,15 +18,15 @@ public class InterfaceParamDto extends InterfaceBasics {
private String format = "json"; private String format = "json";
private String appKey = "1023142858"; // private String appKey = "1023142858";
// private String appKey = "2097046829"; private String appKey = "2097046829";
private String v = "1.0"; private String v = "1.0";
private String sign; private String sign;
private String secret = "382e4a2584027a36ac9431103"; // private String secret = "382e4a2584027a36ac9431103";
// private String secret = "35282f251476a3af4f00c7b36"; private String secret = "35282f251476a3af4f00c7b36";
private String timestamp; private String timestamp;

View File

@ -0,0 +1,378 @@
package com.hzya.frame.ttxofs.dto.ofsReceiptConfirmSearch;
import com.hzya.frame.ttxofs.basics.ReturnMessageBasics;
import com.hzya.frame.ttxofs.dto.ofsTransferOrderSearch.OFSAdjustOrderSearchResponse;
import lombok.Data;
import java.util.List;
/**
* Created by zydd on 2025-03-06 16:29
*/
@Data
public class OFSReceiptConfirmSearchResponse extends ReturnMessageBasics {
private List<Order> data;
@Data
public class Order {
private Header header;
private List<Detail> details;
}
@Data
public class Header {
/**
* id
*/
private String id;
/**
* 入库单
*/
private String code;
/**
* 组织
*/
private String clientCode;
/**
* 货主
*/
private String companyCode;
/**
* 库存地点
*/
private String facilityCode;
/**
* 入库单id
*/
private String receiptId;
/**
* 入库单编码
*/
private String receiptCode;
/**
* 关联订单id
*/
private String refOrderId;
/**
* 关联订单
*/
private String refOrderCode;
/**
* 入库类型
*/
private String internalInstructionType;
/**
* 业务渠道
*/
private String bizChannel;
/**
* 总数量
*/
private String totalQty;
/**
* 处理状态
*/
private String status;
/**
* 来源类型
*/
private String sourceType;
/**
* 重试次数
*/
private String retryCount;
/**
* 外部业务编码
*/
private String outBizCode;
/**
* 确认类型
*/
private String confirmType;
/**
* 创建时间
*/
private String created;
/**
* 创建用户
*/
private String createdBy;
/**
* 更新时间
*/
private String lastUpdated;
/**
* 更新用户
*/
private String lastUpdatedBy;
/**
* 数据版本
*/
private String version;
/**
* 处理标记
*/
private String processStamp;
/**
* 自定义字段1
*/
private String userDef1;
/**
* 自定义字段2
*/
private String userDef2;
/**
* 自定义字段3
*/
private String userDef3;
/**
* 自定义字段4
*/
private String userDef4;
/**
* 自定义字段5
*/
private String userDef5;
/**
* 自定义字段6
*/
private String userDef6;
/**
* 自定义字段7
*/
private String userDef7;
/**
* 自定义字段8
*/
private String userDef8;
/**
* 收货时间
*/
private String receivedAt;
/**
* 收货人
*/
private String receivedBy;
/**
* 异常类型
*/
private String errorCode;
/**
* 异常描述
*/
private String errorDesc;
/**
* 推送状态0-未推送1-已推送2-推送失败
*/
private String pushU8Status;
}
@Data
public class Detail {
/**
* id
*/
private String id;
/**
* 入库确认单id
*/
private String receiptConfirmId;
/**
* 入库确认单
*/
private String receiptConfirmCode;
/**
* 组织
*/
private String clientCode;
/**
* 货主
*/
private String companyCode;
/**
* 库存地点
*/
private String facilityCode;
/**
* 入库单id
*/
private String receiptId;
/**
* 入库单
*/
private String receiptCode;
/**
* 入库单明细id
*/
private String receiptDetailId;
/**
* 关联订单ID
*/
private String refOrderId;
/**
* 关联订单
*/
private String refOrderCode;
/**
* 关联订单明细id
*/
private String refOrderDetailId;
/**
* sku编码
*/
private String skuCode;
/**
* SKU名称
*/
private String skuName;
/**
* 收货数量
*/
private String receivedQty;
/**
* 在途数量
*/
private String inTransQty;
/**
* 可退数量
*/
private String returnableQty;
/**
* 单位
*/
private String quantityUM;
/**
* 库存id
*/
private String inventoryId;
/**
* 在库数量
*/
private String onHandInvId;
/**
* 库存状态
*/
private String inventorySts;
/**
* 批号
*/
private String lot;
/**
* 批次
*/
private String batch;
/**
* 入库日期
*/
private String agingDate;
/**
* 失效日期
*/
private String expirationDate;
/**
* 生产日期
*/
private String mfgDate;
/**
* 批属性1
*/
private String attribute1;
/**
* 批属性2
*/
private String attribute2;
/**
* 批属性3
*/
private String attribute3;
/**
* 批属性4
*/
private String attribute4;
/**
* 总重量
*/
private String totalWeight;
/**
* 总体积
*/
private String totalVolume;
/**
* 总材积
*/
private String totalVolumeWeight;
/**
* 重量单位
*/
private String weightUM;
/**
* 体积单位
*/
private String volumeUM;
/**
* 创建时间
*/
private String created;
/**
* 创建用户
*/
private String createdBy;
/**
* 更新时间
*/
private String lastUpdated;
/**
* 更新用户
*/
private String lastUpdatedBy;
/**
* 数据版本
*/
private String version;
/**
* 处理标记
*/
private String processStamp;
/**
* 自定义字段1
*/
private String userDef1;
/**
* 自定义字段2
*/
private String userDef2;
/**
* 自定义字段3
*/
private String userDef3;
/**
* 自定义字段4
*/
private String userDef4;
/**
* 自定义字段5
*/
private String userDef5;
/**
* 自定义字段6
*/
private String userDef6;
/**
* 自定义字段7
*/
private String userDef7;
/**
* 自定义字段8
*/
private String userDef8;
/**
* 备案编码
*/
private String registerCode;
}
}