丽知:调拨订单新增。
This commit is contained in:
parent
31c1ab8a77
commit
a8a6843f98
|
@ -38,6 +38,9 @@ public class OverallConstant {
|
|||
prodOverPublic.put("bdinvclSeal", "/u8cloud/api/uapbd/invbasdoc/seal");//存货基本档案封存
|
||||
prodOverPublic.put("bdinvclUnseal", "/u8cloud/api/uapbd/invbasdoc/unseal");//存货基本档案取消封存
|
||||
prodOverPublic.put("bdinvclAllot", "/u8cloud/api/uapbd/invbasdoc/assign");//存货基本档案自动分配
|
||||
//调拨
|
||||
prodOverPublic.put("approveqz", "/u8cloud/api/to/transorder/saveapprove");//调拨订单保存即审批
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,155 @@
|
|||
package com.hzya.frame.plugin.lets.plugin.adjust;
|
||||
|
||||
import cn.hutool.core.date.DateField;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.base.PluginBaseEntity;
|
||||
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsStockinOrderRequestVO;
|
||||
import com.hzya.frame.plugin.lets.util.PushDataByU8cUtil;
|
||||
import com.hzya.frame.plugin.lets.util.SaveOrUpdateBusinessLogUtil;
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao;
|
||||
import com.hzya.frame.ttxofs.dto.InterfaceParamDto;
|
||||
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
|
||||
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
public class AdjustInPluginInitializer extends PluginBaseEntity {
|
||||
Logger logger = LoggerFactory.getLogger(AdjustInPluginInitializer.class);
|
||||
|
||||
private static final ReentrantLock LOCK = new ReentrantLock(true);
|
||||
|
||||
@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.adjust.AdjustInPluginInitializer";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "丽知:OFS调整入库--->U8C其它入库";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginLabel() {
|
||||
return "丽知:OFS调整入库--->U8C其它入库";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginType() {
|
||||
return "1";
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private IIntegrationTaskLivingDetailsDao iIntegrationTaskLivingDetailsDao;
|
||||
@Autowired
|
||||
private PushDataByU8cUtil pushDataByU8cUtil;
|
||||
@Autowired
|
||||
private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil;
|
||||
|
||||
@Autowired
|
||||
private OfsUnifiedService ofsUnifiedService;
|
||||
|
||||
@Override
|
||||
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 默认推送
|
||||
*/
|
||||
public void start() {
|
||||
try {
|
||||
//获取当前时间
|
||||
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");
|
||||
|
||||
QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO();
|
||||
queryOfsStockinOrderRequestVO.setCreated_start("2024-08-05 00:00:00");
|
||||
queryOfsStockinOrderRequestVO.setCreated_end("2024-08-09 23:59:59");
|
||||
queryOfsStockinOrderRequestVO.setCompanyCode("SHXM");
|
||||
// queryOfsTransferOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库
|
||||
queryOfsStockinOrderRequestVO.setPageNo(1L);
|
||||
queryOfsStockinOrderRequestVO.setPageSize(500L);
|
||||
List<StockinOrderSearchResponse.StockinOrder> data = queryOfsStockinOrder(queryOfsStockinOrderRequestVO);
|
||||
System.out.println(data);
|
||||
|
||||
//过滤日志
|
||||
|
||||
//推送
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("丽知:OFS调整入库--->U8C其它入库,start()方法报错:", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 按单号
|
||||
*/
|
||||
public void start(String stockinNo) {
|
||||
try {
|
||||
} catch (Exception e) {
|
||||
logger.error("丽知:OFS调整入库--->U8C其它入库,start(String goodsName)方法报错:", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 按时间区间
|
||||
*/
|
||||
public void start(String startTime, String endTime) {
|
||||
try {
|
||||
Date business_start = DateUtil.parse(startTime);
|
||||
Date business_end = DateUtil.parse(endTime);
|
||||
String start = DateUtil.format(business_start, "yyyy-MM-dd") + " 00:00:00";
|
||||
String end = DateUtil.format(business_end, "yyyy-MM-dd") + " 23:59:59";
|
||||
} catch (Exception e) {
|
||||
logger.error("丽知:OFS调整入库--->U8C其它入库,start(String startTime, String endTime)方法报错:", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public List<StockinOrderSearchResponse.StockinOrder> queryOfsStockinOrder(QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO) throws Exception {
|
||||
InterfaceParamDto interfaceParamDto = new InterfaceParamDto();
|
||||
interfaceParamDto.setApi("ofs.receipt.search");
|
||||
// queryOfsStockinOrderRequestVO.setInternalInstructionType("ADJUST");//入库单类型 SALES销售 EXCHANGE换货 REISSUE补发RETURN销退 PURCHASE采购 PURCHASE_RETURN采退 TRANSFER调拨 WORK_ORDER加工 OTHER其他 ADJUST调整 EXCHANGE换货
|
||||
queryOfsStockinOrderRequestVO.setClientCode("LETS");
|
||||
interfaceParamDto.setData(JSON.toJSONString(queryOfsStockinOrderRequestVO));
|
||||
StockinOrderSearchResponse stockinOrderSearchResponse = (StockinOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto);
|
||||
System.out.println(stockinOrderSearchResponse);
|
||||
if(stockinOrderSearchResponse.getData()==null||stockinOrderSearchResponse.getData().size()==0){
|
||||
return null;
|
||||
}
|
||||
//过滤ADJUST调整
|
||||
List<StockinOrderSearchResponse.StockinOrder> adjustList=new ArrayList<>();
|
||||
for (StockinOrderSearchResponse.StockinOrder datum : stockinOrderSearchResponse.getData()) {
|
||||
StockinOrderSearchResponse.StockinOrder.StockinH header = datum.getHeader();
|
||||
if("ADJUST".equals(header.getInternalInstructionType())){
|
||||
adjustList.add(datum);
|
||||
}
|
||||
}
|
||||
return adjustList;
|
||||
}
|
||||
}
|
|
@ -2,14 +2,22 @@ package com.hzya.frame.plugin.lets.plugin.transfer;
|
|||
|
||||
import cn.hutool.core.date.DateField;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
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.QueryOfsTransferOrderRequestVO;
|
||||
import com.hzya.frame.plugin.lets.u8cdto.BillVO;
|
||||
import com.hzya.frame.plugin.lets.u8cdto.ReusltStrDto;
|
||||
import com.hzya.frame.plugin.lets.u8cdto.SoSaleResultRootDto;
|
||||
import com.hzya.frame.plugin.lets.util.PushDataByU8cUtil;
|
||||
import com.hzya.frame.plugin.lets.util.SaveOrUpdateBusinessLogUtil;
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao;
|
||||
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.ofsTransferOrderSearch.OFSTranseferOrderSearchResponse;
|
||||
|
@ -22,8 +30,8 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
/**
|
||||
|
@ -53,12 +61,12 @@ public class TransferPluginInitializer extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "丽知:OFS调拨订单--->U8C调拨订单";
|
||||
return "丽知:OFS调拨订单--->U8C调拨订单(保存及签字)";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginLabel() {
|
||||
return "丽知:OFS调拨订单--->U8C调拨订单";
|
||||
return "丽知:OFS调拨订单--->U8C调拨订单(保存及签字)";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -97,19 +105,27 @@ public class TransferPluginInitializer extends PluginBaseEntity {
|
|||
QueryOfsTransferOrderRequestVO queryOfsTransferOrderRequestVO = new QueryOfsTransferOrderRequestVO();
|
||||
queryOfsTransferOrderRequestVO.setCreated_start(startTimeStr);
|
||||
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.setPageNo(1L);
|
||||
queryOfsTransferOrderRequestVO.setPageSize(50L);
|
||||
List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> ofsTranseferOrders = queryOfsTransderOrder(queryOfsTransferOrderRequestVO);
|
||||
if (ofsTranseferOrders==null||ofsTranseferOrders.size()==0) {
|
||||
if (ofsTranseferOrders == null || ofsTranseferOrders.size() == 0) {
|
||||
return;
|
||||
}
|
||||
System.out.println(ofsTranseferOrders);
|
||||
//过滤日志
|
||||
List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> filterOfsTranseferOrders = filterData(ofsTranseferOrders);
|
||||
if (filterOfsTranseferOrders.size() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
//推送
|
||||
implement(filterOfsTranseferOrders);
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("丽知:OFS调拨订单--->U8C调拨订单,start()方法报错:", e);
|
||||
logger.error("丽知:OFS调拨订单--->U8C调拨订单(保存及签字),start()方法报错:", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -120,19 +136,30 @@ public class TransferPluginInitializer extends PluginBaseEntity {
|
|||
try {
|
||||
QueryOfsTransferOrderRequestVO queryOfsTransferOrderRequestVO = new QueryOfsTransferOrderRequestVO();
|
||||
queryOfsTransferOrderRequestVO.setCompanyCode("SHXM");//U8c&ofs对接群:好的,我跟技术聊了,就按照这个方式来,赋值就按照赋值的货主来查,不赋值就查所有的货主数据
|
||||
// queryOfsTransferOrderRequestVO.setStatus("900");//状态 100订单池 200待出库 300已出库 400待入库 900已入库 250出库中 450入库中
|
||||
// queryOfsTransferOrderRequestVO.setStatus("100");//状态 100订单池 200待出库 300已出库 400待入库 900已入库 250出库中 450入库中
|
||||
queryOfsTransferOrderRequestVO.setCode(transeferNo);
|
||||
|
||||
queryOfsTransferOrderRequestVO.setCreated_start("2024-08-08 00:00:00");
|
||||
queryOfsTransferOrderRequestVO.setCreated_end("2024-08-12 23:59:59");
|
||||
|
||||
queryOfsTransferOrderRequestVO.setPageNo(1L);
|
||||
queryOfsTransferOrderRequestVO.setPageSize(500L);
|
||||
List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> ofsTranseferOrders = queryOfsTransderOrder(queryOfsTransferOrderRequestVO);
|
||||
if (ofsTranseferOrders==null||ofsTranseferOrders.size()==0) {
|
||||
return;
|
||||
if (ofsTranseferOrders == null || ofsTranseferOrders.size() == 0) {
|
||||
Assert.state(false, "中台:查询OFS调拨订单:{},不存在,请检查OFS调拨订单号。", transeferNo);
|
||||
}
|
||||
System.out.println(ofsTranseferOrders);
|
||||
|
||||
//过滤日志
|
||||
List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> filterOfsTranseferOrders = filterData(ofsTranseferOrders);
|
||||
if (filterOfsTranseferOrders.size() == 0) {
|
||||
Assert.state(false, "中台:查询OFS调拨订单:{},过滤成功日志时已被过滤,请勿重新推送。", transeferNo);
|
||||
}
|
||||
|
||||
//推送
|
||||
implement(filterOfsTranseferOrders);
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("丽知:OFS调拨订单--->U8C调拨订单,start(String transeferNo)方法报错:", e);
|
||||
logger.error("丽知:OFS调拨订单--->U8C调拨订单(保存及签字),start(String transeferNo)方法报错:", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -146,14 +173,198 @@ public class TransferPluginInitializer extends PluginBaseEntity {
|
|||
Date business_end = DateUtil.parse(endTime);
|
||||
String start = DateUtil.format(business_start, "yyyy-MM-dd") + " 00:00:00`";
|
||||
String end = DateUtil.format(business_end, "yyyy-MM-dd") + " 23:59:59";
|
||||
QueryOfsTransferOrderRequestVO queryOfsTransferOrderRequestVO = new QueryOfsTransferOrderRequestVO();
|
||||
queryOfsTransferOrderRequestVO.setCreated_start(start);
|
||||
queryOfsTransferOrderRequestVO.setCreated_end(end);
|
||||
queryOfsTransferOrderRequestVO.setCompanyCode("SHXM");//U8c&ofs对接群:好的,我跟技术聊了,就按照这个方 式来,赋值就按照赋值的货主来查,不赋值就查所有的货主数据
|
||||
// queryOfsTransferOrderRequestVO.setStatus("900");//状态 100订单池 200待出库 300已出库 400待入库 900已入库 250出库中 450入库中
|
||||
queryOfsTransferOrderRequestVO.setPageNo(1L);
|
||||
queryOfsTransferOrderRequestVO.setPageSize(50L);
|
||||
List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> ofsTranseferOrders = queryOfsTransderOrder(queryOfsTransferOrderRequestVO);
|
||||
if (ofsTranseferOrders == null || ofsTranseferOrders.size() == 0) {
|
||||
Assert.state(false, "中台:查询OFS调拨订单,按日期:{} - {},未查询OFS调拨订单。", startTime,endTime);
|
||||
}
|
||||
//过滤日志
|
||||
List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> filterOfsTranseferOrders = filterData(ofsTranseferOrders);
|
||||
if (filterOfsTranseferOrders.size() == 0) {
|
||||
Assert.state(false, "中台:查询OFS调拨订单,按日期:{} - {},已被推送,请查询OFS调拨订单。", startTime,endTime);
|
||||
}
|
||||
|
||||
//推送
|
||||
implement(filterOfsTranseferOrders);
|
||||
|
||||
|
||||
} 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
|
||||
* @return
|
||||
*/
|
||||
public List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> filterData(List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> ofsTranseferOrders) {
|
||||
List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> filterOfsTranseferOrders = new ArrayList<>();
|
||||
for (OFSTranseferOrderSearchResponse.OFSTranseferOrder ofsTranseferOrder : ofsTranseferOrders) {
|
||||
OFSTranseferOrderSearchResponse.OFSTranseferOrder.OFSTranseferH header = ofsTranseferOrder.getHeader();
|
||||
//OFS调拨订单号
|
||||
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) {
|
||||
filterOfsTranseferOrders.add(ofsTranseferOrder);
|
||||
}
|
||||
}
|
||||
return filterOfsTranseferOrders;
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送u8c调拨订单
|
||||
*
|
||||
* @param filterOfsTranseferOrders
|
||||
*/
|
||||
public void implement(List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> filterOfsTranseferOrders) {
|
||||
for (OFSTranseferOrderSearchResponse.OFSTranseferOrder ofsTranseferOrder : filterOfsTranseferOrders) {
|
||||
BillVO billVO = new BillVO();
|
||||
|
||||
String mapStr = "";
|
||||
String format="";
|
||||
String response="";
|
||||
String ofsCode="";
|
||||
try {
|
||||
|
||||
//主表
|
||||
OFSTranseferOrderSearchResponse.OFSTranseferOrder.OFSTranseferH ofsHeader = ofsTranseferOrder.getHeader();
|
||||
BillVO.Parentvo parentvo = new BillVO.Parentvo();
|
||||
|
||||
ofsCode=ofsHeader.getCode();
|
||||
|
||||
//创建日期
|
||||
Date created = ofsHeader.getCreated();
|
||||
format = DateUtil.format(created, "yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
//dbilldate 单据日期
|
||||
parentvo.setDbilldate(format);
|
||||
//dauditdate 审批日期
|
||||
parentvo.setDauditdate(format);
|
||||
//coperatorid 制单人
|
||||
parentvo.setCoperatorid("tbadmin");
|
||||
|
||||
//cbiztypeid 业务流程编码
|
||||
parentvo.setCbiztypeid("to01");
|
||||
|
||||
//coutcbid 调出组织编码 对应OFS->原库存地点公司
|
||||
parentvo.setCoutcbid(ofsHeader.getCompanyCode());
|
||||
parentvo.setCoutcbid("SHLZ");
|
||||
|
||||
//coutcorpid 调出公司编码 对应OFS->原库存地点公司
|
||||
parentvo.setCoutcorpid(ofsHeader.getCompanyCode());
|
||||
parentvo.setCoutcorpid("SHLZ");
|
||||
|
||||
//coutwhid 调出仓库编码 对应OFS->原库存地点
|
||||
parentvo.setCoutwhid(ofsHeader.getFacilityCode());
|
||||
parentvo.setCoutwhid("01");
|
||||
|
||||
|
||||
//cincbid 调入组织编码 对应OFS->目标库存地点公司
|
||||
parentvo.setCincbid("SHXM");
|
||||
|
||||
//cincorpid 调入公司编码 对应OFS->目标库存地点公司
|
||||
parentvo.setCincorpid("SHXM");
|
||||
|
||||
//cinwhid 调入仓库编码 对应OFS->目标库存地点
|
||||
parentvo.setCinwhid("01");
|
||||
|
||||
//vnote 备注
|
||||
parentvo.setVnote(ofsHeader.getNotes());
|
||||
|
||||
|
||||
|
||||
//子表
|
||||
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());
|
||||
children.setCinvbasid("6973391730617");
|
||||
//nnum 数量
|
||||
children.setNnum(BigDecimal.valueOf(ofsDetail.getShipQty()));
|
||||
childrenvo.add(children);
|
||||
}
|
||||
billVO.setParentvo(parentvo);
|
||||
billVO.setChildrenvo(childrenvo);
|
||||
String jsonStr = JSONUtil.toJsonStr(billVO);
|
||||
mapStr = "{\"billvo\":"+jsonStr+"}";
|
||||
response = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("approveqz"), mapStr);
|
||||
System.out.println(response);
|
||||
boolean isSuccess = false;
|
||||
String vcode="";
|
||||
if (response != null && !"".equals(response)) {
|
||||
ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class);
|
||||
if ("success".equals(reusltStrDto.getStatus())) {
|
||||
isSuccess = true;
|
||||
String data = reusltStrDto.getData();
|
||||
BillVO billVO1 = resultDataHandle(data);
|
||||
System.out.println(billVO1);
|
||||
vcode = billVO1.getParentvo().getVcode();
|
||||
}
|
||||
}
|
||||
if (!isSuccess) {
|
||||
Assert.state(false, "推送U8C--> 丽知:OFS调拨订单--->U8C调拨订单(保存及签字) 失败 接口返回结果:{} 接口入参:{}", response, jsonStr);
|
||||
}
|
||||
|
||||
|
||||
//成功
|
||||
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(vcode);//u8c调拨订单号
|
||||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("丽知:OFS调拨订单--->U8C调拨订单(保存及签字)失败,失败原因:" + e);
|
||||
|
||||
//失败
|
||||
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(null);//u8c调拨订单号
|
||||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 开始与结束时间必须小于或等于7天
|
||||
*
|
||||
* @param queryOfsTransferOrderRequestVO
|
||||
* @throws Exception
|
||||
*/
|
||||
|
@ -163,15 +374,29 @@ public class TransferPluginInitializer extends PluginBaseEntity {
|
|||
interfaceParamDto.setApi("ofs.transferOrder.search");
|
||||
queryOfsTransferOrderRequestVO.setClientCode("LETS");
|
||||
interfaceParamDto.setData(JSON.toJSONString(queryOfsTransferOrderRequestVO));
|
||||
OFSTranseferOrderSearchResponse ofsTranseferOrderSearchResponse =(OFSTranseferOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto);
|
||||
OFSTranseferOrderSearchResponse ofsTranseferOrderSearchResponse = (OFSTranseferOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto);
|
||||
System.out.println(ofsTranseferOrderSearchResponse);
|
||||
if (ofsTranseferOrderSearchResponse.getData().size()==0) {
|
||||
if (ofsTranseferOrderSearchResponse.getData().size() == 0) {
|
||||
return null;
|
||||
}else {
|
||||
} else {
|
||||
List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> data = ofsTranseferOrderSearchResponse.getData();
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -9,8 +9,9 @@
|
|||
<bean name="goodsPluginInitializer" class="com.hzya.frame.plugin.lets.plugin.base.GoodsPluginInitializer"/>
|
||||
<bean name="goodsAutoAllotPluginInitializer" class="com.hzya.frame.plugin.lets.plugin.base.GoodsAutoAllotPluginInitializer"/>
|
||||
<bean name="goodsClassPluginInitializer" class="com.hzya.frame.plugin.lets.plugin.base.GoodsClassPluginInitializer"/>
|
||||
|
||||
<!--调拨-->
|
||||
<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="adjustInPluginInitializer" class="com.hzya.frame.plugin.lets.plugin.adjust.AdjustInPluginInitializer"/>
|
||||
</beans>
|
|
@ -23,7 +23,7 @@ public class TransferTest {
|
|||
}
|
||||
@Test
|
||||
public void t01(){
|
||||
transferPluginInitializer.start("LETS-TH2024080800000003");
|
||||
transferPluginInitializer.start("LETS-TH2024080800000002");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -76,6 +76,8 @@ public class OFSTranseferOrderSearchResponse extends ReturnMessageBasics {
|
|||
private Date lastUpdated;
|
||||
/** */
|
||||
private String lastUpdatedBy;
|
||||
/** 备注 */
|
||||
private String notes;
|
||||
}
|
||||
@Data
|
||||
public class OFSTranseferB{
|
||||
|
|
Loading…
Reference in New Issue