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

# Conflicts:
#	buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/adjust/AdjustInPluginInitializer.java
This commit is contained in:
liuy 2024-08-16 15:02:44 +08:00
commit a58eeba470
27 changed files with 731 additions and 241 deletions

View File

@ -26,4 +26,5 @@ 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";
}
}

View File

@ -3,6 +3,8 @@ package com.hzya.frame.plugin.lets.ofs.entity;
import com.hzya.frame.web.entity.BaseEntity; import com.hzya.frame.web.entity.BaseEntity;
import lombok.Data; import lombok.Data;
import java.io.Serializable;
/** /**
* @Author * @Author
* @Date 2024/8/6 14:57 * @Date 2024/8/6 14:57
@ -11,7 +13,7 @@ import lombok.Data;
* @Description: OFS店铺实体类 * @Description: OFS店铺实体类
*/ */
@Data @Data
public class ShopEntity extends BaseEntity { public class ShopEntity implements Serializable {
// 店铺业务编码 // 店铺业务编码
private String bizCode; private String bizCode;
// 销售平台 // 销售平台
@ -39,8 +41,10 @@ public class ShopEntity extends BaseEntity {
// 货主编码 // 货主编码
private String companyCode; private String companyCode;
private Integer status; private Integer status;
private String created_start; private String lastUpdated_start;
private String created_end; private String lastUpdated_end;
private String pageNo;
} }

View File

@ -35,4 +35,9 @@ public class SupplierEntity {
private String mobile; private String mobile;
//状态 //状态
private String status; private String status;
private String pageNo;
private String lastUpdated_start;
} }

View File

@ -0,0 +1,23 @@
package com.hzya.frame.plugin.lets.ofsvo;
import lombok.Data;
/**
* OFS SKU分类查询请求类
*/
@Data
public class QueryOfsSKUClassRequestVO {
/** 开始时间 */
private String created_start;
/** 结束时间 */
private String created_end;
/** 组织 */
private String clientCode;
private String companyCode;
private String cInvCCode;
private String status;
private String code;
private int pageNo;
private int pageSize;
}

View File

@ -11,6 +11,10 @@ public class QueryOfsStockinOrderRequestVO {
private String created_start; private String created_start;
/** 结束时间 */ /** 结束时间 */
private String created_end; private String created_end;
private String closedAt_start;
private String closedAt_end;
/** 组织 */ /** 组织 */
private String clientCode; private String clientCode;
/** 入库单号 */ /** 入库单号 */

View File

@ -11,6 +11,12 @@ public class QueryOfsStockoutOrderRequestVO {
private String created_start; private String created_start;
/** 结束时间 */ /** 结束时间 */
private String created_end; private String created_end;
private String closedAt_start;
private String closedAt_end;
private String shipAt_start;
private String shipAt_end;
/** 组织 */ /** 组织 */
private String clientCode; private String clientCode;
/** 库单号 */ /** 库单号 */

View File

@ -23,6 +23,7 @@ import com.hzya.frame.ttxofs.dto.InterfaceParamDto;
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;
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.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -82,6 +83,38 @@ public class AdjustInPluginInitializer extends PluginBaseEntity {
@Override @Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
try {
logger.info("调用:" + getPluginName() + "-插件");
String prod = "prod";
String param = String.valueOf(requestJson.get("param"));
if (requestJson != null && ProfilesActiveConstant.TYPE_DATE.equals(requestJson.get("type"))) {
//按日期
if (param != null && !"".equals(param)) {
String[] split = param.split("/");
if (!(split.length == 2)) {
Assert.state(false, "时间格式传递不正确");
}
Assert.notNull(split[0], "开始时间不能为空");
Assert.notNull(split[1], "结束时间不能为空");
start(split[0], split[1]);
}
} else if (requestJson != null && ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
//按单号
if (param != null && !"".equals(param)) {
start(param);
}
} else if (ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
String integrationTaskLivingDetails = (String) requestJson.get("integration_task_living_details_id");
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = saveOrUpdateBusinessLogUtil.queryIntegrationTaskLivingDetailsEntity(integrationTaskLivingDetails);
start(integrationTaskLivingDetailsEntity.getRootAppPk());
} else if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(prod)) {
//默认
start();
}
} catch (Exception e) {
e.printStackTrace();
logger.error("executeBusiness方法抛出异常", e);
}
return null; return null;
} }
@ -101,8 +134,7 @@ public class AdjustInPluginInitializer extends PluginBaseEntity {
QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO(); QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO();
queryOfsStockinOrderRequestVO.setCreated_start(startTimeStr); queryOfsStockinOrderRequestVO.setCreated_start(startTimeStr);
queryOfsStockinOrderRequestVO.setCreated_end(endTimeStr); queryOfsStockinOrderRequestVO.setCreated_end(endTimeStr);
queryOfsStockinOrderRequestVO.setCompanyCode("SHLZ"); queryOfsStockinOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库
// queryOfsTransferOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库
queryOfsStockinOrderRequestVO.setPageNo(1L); queryOfsStockinOrderRequestVO.setPageNo(1L);
queryOfsStockinOrderRequestVO.setPageSize(500L); queryOfsStockinOrderRequestVO.setPageSize(500L);
List<StockinOrderSearchResponse.StockinOrder> stockinOrders = queryOfsStockinOrder(queryOfsStockinOrderRequestVO); List<StockinOrderSearchResponse.StockinOrder> stockinOrders = queryOfsStockinOrder(queryOfsStockinOrderRequestVO);
@ -133,23 +165,21 @@ public class AdjustInPluginInitializer extends PluginBaseEntity {
try { try {
QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO(); QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO();
queryOfsStockinOrderRequestVO.setCreated_start("2024-08-12 00:00:00");
queryOfsStockinOrderRequestVO.setCreated_end("2024-08-13 23:59:59");
queryOfsStockinOrderRequestVO.setCode(stockinNo); queryOfsStockinOrderRequestVO.setCode(stockinNo);
queryOfsStockinOrderRequestVO.setCompanyCode("SHLZ"); // queryOfsStockinOrderRequestVO.setCompanyCode("SHLZ");
// queryOfsTransferOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库 queryOfsStockinOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库
queryOfsStockinOrderRequestVO.setPageNo(1L); queryOfsStockinOrderRequestVO.setPageNo(1L);
queryOfsStockinOrderRequestVO.setPageSize(500L); queryOfsStockinOrderRequestVO.setPageSize(500L);
List<StockinOrderSearchResponse.StockinOrder> stockinOrders = queryOfsStockinOrder(queryOfsStockinOrderRequestVO); List<StockinOrderSearchResponse.StockinOrder> stockinOrders = queryOfsStockinOrder(queryOfsStockinOrderRequestVO);
System.out.println(stockinOrders); System.out.println(stockinOrders);
if (stockinOrders.size() == 0) { if (stockinOrders.size() == 0) {
return; Assert.state(false, "丽知OFS调整入库--->U8C其它入库根据单据号[入库完成]{},未查询到调整出库单",stockinNo);
} }
//过滤日志 //过滤日志
List<StockinOrderSearchResponse.StockinOrder> filterStockinOrders = filterData(stockinOrders); List<StockinOrderSearchResponse.StockinOrder> filterStockinOrders = filterData(stockinOrders);
if (filterStockinOrders.size() == 0) { if (filterStockinOrders.size() == 0) {
return; Assert.state(false, "丽知OFS调整入库--->U8C其它入库根据单据号[入库完成]{},该调整出库单已被推送成功,请勿重新推送",stockinNo);
} }
//推送 //推送
@ -174,20 +204,19 @@ public class AdjustInPluginInitializer extends PluginBaseEntity {
QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO(); QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO();
queryOfsStockinOrderRequestVO.setCreated_start(start); queryOfsStockinOrderRequestVO.setCreated_start(start);
queryOfsStockinOrderRequestVO.setCreated_end(end); queryOfsStockinOrderRequestVO.setCreated_end(end);
queryOfsStockinOrderRequestVO.setCompanyCode("SHOFF"); queryOfsStockinOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库
// queryOfsTransferOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库
queryOfsStockinOrderRequestVO.setPageNo(1L); queryOfsStockinOrderRequestVO.setPageNo(1L);
queryOfsStockinOrderRequestVO.setPageSize(500L); queryOfsStockinOrderRequestVO.setPageSize(500L);
List<StockinOrderSearchResponse.StockinOrder> stockinOrders = queryOfsStockinOrder(queryOfsStockinOrderRequestVO); List<StockinOrderSearchResponse.StockinOrder> stockinOrders = queryOfsStockinOrder(queryOfsStockinOrderRequestVO);
System.out.println(stockinOrders); System.out.println(stockinOrders);
if (stockinOrders.size() == 0) { if (stockinOrders.size() == 0) {
return; Assert.state(false, "丽知OFS调整入库--->U8C其它入库根据日期期间[开始时间]-[结束时间]{}-{},未查询到调整入库单[入库完成]",startTime,endTime);
} }
//过滤日志 //过滤日志
List<StockinOrderSearchResponse.StockinOrder> filterStockinOrders = filterData(stockinOrders); List<StockinOrderSearchResponse.StockinOrder> filterStockinOrders = filterData(stockinOrders);
if (filterStockinOrders.size() == 0) { if (filterStockinOrders.size() == 0) {
return; Assert.state(false, "丽知OFS调整入库--->U8C其它入库根据日期期间[开始时间]-[结束时间]{}-{},该调期间整入库单[入库完成]已被推送成功,请勿重新推送",startTime,endTime);
} }
//推送 //推送
@ -255,15 +284,15 @@ public class AdjustInPluginInitializer extends PluginBaseEntity {
//vnote--备注 //vnote--备注
parentvo.setVnote(ofsHeader.getNote()); parentvo.setVnote(ofsHeader.getNote());
//dbilldate--单据日期--oms入库时间 //dbilldate--单据日期--oms入库时间
String 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");
format = created; format = ofsHeader.getCreated();
parentvo.setDbilldate(format); parentvo.setDbilldate(StringUtils.substring(format,0,10));
//coperatorid--制单人 //coperatorid--制单人
String createdBy = ofsHeader.getCreatedBy(); String createdBy = ofsHeader.getCreatedBy();
parentvo.setCoperatorid("tbadmin"); parentvo.setCoperatorid("tbadmin");
//审核时间dauditdate //审核时间dauditdate
parentvo.setDauditdate(format); parentvo.setDauditdate(StringUtils.substring(format,0,10));
//cdispatcherid--收发类别ofs过来的写死20240813妮姐+万万就是调整出库调整入库 //cdispatcherid--收发类别ofs过来的写死20240813妮姐+万万就是调整出库调整入库
BdRdclEntity bdRdclEntity = new BdRdclEntity(); BdRdclEntity bdRdclEntity = new BdRdclEntity();
@ -329,7 +358,8 @@ public class AdjustInPluginInitializer extends PluginBaseEntity {
integrationTaskLivingDetailsEntity.setNewPushDate(new Date()); integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
integrationTaskLivingDetailsEntity.setBusinessDate(format); integrationTaskLivingDetailsEntity.setBusinessDate(format);
integrationTaskLivingDetailsEntity.setRootAppPk(ofsCode); integrationTaskLivingDetailsEntity.setRootAppPk(ofsCode);
integrationTaskLivingDetailsEntity.setRootAppBill(vbillcode);//u8c调拨订单号 integrationTaskLivingDetailsEntity.setRootAppBill(ofsCode);
integrationTaskLivingDetailsEntity.setRootAppBill(vbillcode);
integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
@ -348,7 +378,7 @@ public class AdjustInPluginInitializer extends PluginBaseEntity {
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(ofsCode);
integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
} }
@ -359,7 +389,7 @@ public class AdjustInPluginInitializer extends PluginBaseEntity {
public List<StockinOrderSearchResponse.StockinOrder> queryOfsStockinOrder(QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO) throws Exception { public List<StockinOrderSearchResponse.StockinOrder> queryOfsStockinOrder(QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO) throws Exception {
InterfaceParamDto interfaceParamDto = new InterfaceParamDto(); InterfaceParamDto interfaceParamDto = new InterfaceParamDto();
interfaceParamDto.setApi("ofs.receipt.search"); interfaceParamDto.setApi("ofs.receipt.search");
// queryOfsStockinOrderRequestVO.setInternalInstructionType("ADJUST");//入库单类型 SALES销售 EXCHANGE换货 REISSUE补发RETURN销退 PURCHASE采购 PURCHASE_RETURN采退 TRANSFER调拨 WORK_ORDER加工 OTHER其他 ADJUST调整 EXCHANGE换货 queryOfsStockinOrderRequestVO.setInternalInstructionType("ADJUST");//入库单类型 SALES销售 EXCHANGE换货 REISSUE补发RETURN销退 PURCHASE采购 PURCHASE_RETURN采退 TRANSFER调拨 WORK_ORDER加工 OTHER其他 ADJUST调整 EXCHANGE换货
queryOfsStockinOrderRequestVO.setClientCode("LETS"); queryOfsStockinOrderRequestVO.setClientCode("LETS");
interfaceParamDto.setData(JSON.toJSONString(queryOfsStockinOrderRequestVO)); interfaceParamDto.setData(JSON.toJSONString(queryOfsStockinOrderRequestVO));
StockinOrderSearchResponse stockinOrderSearchResponse = (StockinOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto); StockinOrderSearchResponse stockinOrderSearchResponse = (StockinOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto);
@ -367,15 +397,7 @@ public class AdjustInPluginInitializer extends PluginBaseEntity {
if (stockinOrderSearchResponse.getData() == null || stockinOrderSearchResponse.getData().size() == 0) { if (stockinOrderSearchResponse.getData() == null || stockinOrderSearchResponse.getData().size() == 0) {
return null; return null;
} }
//过滤ADJUST调整 return stockinOrderSearchResponse.getData();
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;
} }

View File

@ -13,6 +13,7 @@ import com.hzya.frame.plugin.lets.dao.IBdRdclDao;
import com.hzya.frame.plugin.lets.entity.BdRdclEntity; import com.hzya.frame.plugin.lets.entity.BdRdclEntity;
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.u8cdto.GeneralBillVO_4ADto;
import com.hzya.frame.plugin.lets.u8cdto.GeneralBillVO_4IDto; import com.hzya.frame.plugin.lets.u8cdto.GeneralBillVO_4IDto;
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;
@ -27,7 +28,9 @@ 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.u8c.ax.entity.Ass;
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.BeanUtils;
@ -87,6 +90,38 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
@Override @Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
try {
logger.info("调用:" + getPluginName() + "-插件");
String prod = "prod";
String param = String.valueOf(requestJson.get("param"));
if (requestJson != null && ProfilesActiveConstant.TYPE_DATE.equals(requestJson.get("type"))) {
//按日期
if (param != null && !"".equals(param)) {
String[] split = param.split("/");
if (!(split.length == 2)) {
Assert.state(false, "时间格式传递不正确");
}
Assert.notNull(split[0], "开始时间不能为空");
Assert.notNull(split[1], "结束时间不能为空");
start(split[0], split[1]);
}
} else if (requestJson != null && ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
//按单号
if (param != null && !"".equals(param)) {
start(param);
}
} else if (ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
String integrationTaskLivingDetails = (String) requestJson.get("integration_task_living_details_id");
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = saveOrUpdateBusinessLogUtil.queryIntegrationTaskLivingDetailsEntity(integrationTaskLivingDetails);
start(integrationTaskLivingDetailsEntity.getRootAppPk());
} else if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(prod)) {
//默认
start();
}
} catch (Exception e) {
e.printStackTrace();
logger.error("executeBusiness方法抛出异常", e);
}
return null; return null;
} }
@ -104,10 +139,10 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
String endTimeStr = DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss"); String endTimeStr = DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss");
QueryOfsStockoutOrderRequestVO queryOfsStockoutOrderRequestVO = new QueryOfsStockoutOrderRequestVO(); QueryOfsStockoutOrderRequestVO queryOfsStockoutOrderRequestVO = new QueryOfsStockoutOrderRequestVO();
queryOfsStockoutOrderRequestVO.setCreated_start("2024-08-08 00:00:00"); queryOfsStockoutOrderRequestVO.setClosedAt_start(startTimeStr);
queryOfsStockoutOrderRequestVO.setCreated_end("2024-08-10 23:59:59"); queryOfsStockoutOrderRequestVO.setClosedAt_end(endTimeStr);
queryOfsStockoutOrderRequestVO.setCompanyCode("SHXM"); // queryOfsStockoutOrderRequestVO.setCompanyCode("SHXM");
// queryOfsTransferOrderRequestVO.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> stockoutOrders = queryOfsStockoutOrder(queryOfsStockoutOrderRequestVO); List<StockoutOrderSearchResponse.StockoutOrder> stockoutOrders = queryOfsStockoutOrder(queryOfsStockoutOrderRequestVO);
@ -133,6 +168,25 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
*/ */
public void start(String stockoutNo) { public void start(String stockoutNo) {
try { try {
QueryOfsStockoutOrderRequestVO queryOfsStockoutOrderRequestVO = new QueryOfsStockoutOrderRequestVO();
queryOfsStockoutOrderRequestVO.setCode(stockoutNo);
queryOfsStockoutOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库
queryOfsStockoutOrderRequestVO.setPageNo(1L);
queryOfsStockoutOrderRequestVO.setPageSize(500L);
List<StockoutOrderSearchResponse.StockoutOrder> stockoutOrders = queryOfsStockoutOrder(queryOfsStockoutOrderRequestVO);
if (stockoutOrders == null || stockoutOrders.size() == 0) {
Assert.state(false, "丽知OFS调整出库--->U8C其它出库根据单据号[出库完成]{},未查询到调整出库单",stockoutNo);
}
//过滤日志
List<StockoutOrderSearchResponse.StockoutOrder> filterStockoutOrders = filterData(stockoutOrders);
if (filterStockoutOrders == null || filterStockoutOrders.size() == 0) {
Assert.state(false, "丽知OFS调整出库--->U8C其它出库根据单据号[出库完成]{},该调整出库单已被推送成功,请勿重新推送",stockoutNo);
}
//推送
implement(filterStockoutOrders);
} catch (Exception e) { } catch (Exception e) {
logger.error("丽知OFS调整出库--->U8C其它出库,start(String goodsName)方法报错:", e); logger.error("丽知OFS调整出库--->U8C其它出库,start(String goodsName)方法报错:", e);
} }
@ -140,7 +194,7 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
} }
/** /**
* 按时间区间 * 按时间区间,ofs接口最大显示7天时间计算7天分段
*/ */
public void start(String startTime, String endTime) { public void start(String startTime, String endTime) {
try { try {
@ -148,6 +202,27 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
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";
QueryOfsStockoutOrderRequestVO queryOfsStockoutOrderRequestVO = new QueryOfsStockoutOrderRequestVO();
queryOfsStockoutOrderRequestVO.setShipAt_start(start);
queryOfsStockoutOrderRequestVO.setShipAt_end(end);
queryOfsStockoutOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库
queryOfsStockoutOrderRequestVO.setPageNo(1L);
queryOfsStockoutOrderRequestVO.setPageSize(500L);
List<StockoutOrderSearchResponse.StockoutOrder> stockoutOrders = queryOfsStockoutOrder(queryOfsStockoutOrderRequestVO);
if (stockoutOrders == null || stockoutOrders.size() == 0) {
Assert.state(false, "丽知OFS调整出库--->U8C其它出库根据日期期间[开始时间]-[结束时间]{}-{},未查询到调整出库单[出库完成]",startTime,endTime);
}
//过滤日志
List<StockoutOrderSearchResponse.StockoutOrder> filterStockoutOrders = filterData(stockoutOrders);
if (filterStockoutOrders == null || filterStockoutOrders.size() == 0) {
Assert.state(false, "丽知OFS调整出库--->U8C其它出库根据日期期间[开始时间]-[结束时间]{}-{},该调期间整出库单[出库完成]已被推送成功,请勿重新推送",startTime,endTime);
}
//推送
implement(filterStockoutOrders);
} 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);
} }
@ -212,15 +287,15 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
//vnote--备注 //vnote--备注
parentvo.setVnote(ofsHeader.getShipmentNote()); parentvo.setVnote(ofsHeader.getShipmentNote());
//dbilldate--单据日期--oms入库时间 //dbilldate--单据日期--oms入库时间
String created1 = stockoutOrder.getDetails().get(0).getCreated(); String created1 = ofsHeader.getCreated();
// 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");
format = created1; format = created1;
parentvo.setDbilldate(format); parentvo.setDbilldate(StringUtils.substring(format,0,10));
//coperatorid--制单人 //coperatorid--制单人
parentvo.setCoperatorid("tbadmin"); parentvo.setCoperatorid("tbadmin");
//审核时间dauditdate //审核时间dauditdate
parentvo.setDauditdate(format); parentvo.setDauditdate(StringUtils.substring(format,0,10));
//cdispatcherid--收发类别ofs过来的写死20240813妮姐+万万就是调整出库调整入库 //cdispatcherid--收发类别ofs过来的写死20240813妮姐+万万就是调整出库调整入库
BdRdclEntity bdRdclEntity = new BdRdclEntity(); BdRdclEntity bdRdclEntity = new BdRdclEntity();
@ -265,9 +340,33 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
mapStr = "{\"GeneralBillVO_4I\":[" + dataJson + "]}"; mapStr = "{\"GeneralBillVO_4I\":[" + dataJson + "]}";
response = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("otheroutqz"), mapStr); response = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("otheroutqz"), mapStr);
System.out.println(response); System.out.println(response);
boolean isSuccess = false;
String vbillcode="";
if (response != null && !"".equals(response)) {
ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class);
if ("success".equals(reusltStrDto.getStatus())) {
isSuccess = true;
String data = reusltStrDto.getData();
GeneralBillVO_4IDto resGeneralBillVO = resultDataHandle(data);
System.out.println(resGeneralBillVO);
vbillcode = resGeneralBillVO.getParentvo().getVbillcode();
}
}
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);//u8c其他出库单号
// integrationTaskLivingDetailsEntity.setRootAppBill(vbillcode);//u8c其他出库单号
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
@ -275,6 +374,20 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class); ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class);
String ErrMessage ="推送U8C丽知OFS调整入库--->U8C其它入库失败失败原因"+ reusltStrDto.getErrormsg(); 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.setRootAppBill(null);//u8c其他出库单号
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
} }
} }
@ -283,7 +396,7 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
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");
// queryOfsStockinOrderRequestVO.setInternalInstructionType("ADJUST");//入库单类型 SALES销售 EXCHANGE换货 REISSUE补发RETURN销退 PURCHASE采购 PURCHASE_RETURN采退 TRANSFER调拨 WORK_ORDER加工 OTHER其他 ADJUST调整 EXCHANGE换货 queryOfsStockoutOrderRequestVO.setInternalInstructionType("ADJUST");//入库单类型 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));
SaleOutReturnMessageDto saleOutReturnMessageDto = (SaleOutReturnMessageDto) ofsUnifiedService.unified(interfaceParamDto); SaleOutReturnMessageDto saleOutReturnMessageDto = (SaleOutReturnMessageDto) ofsUnifiedService.unified(interfaceParamDto);
@ -294,15 +407,7 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
if(stockoutOrderSearchResponse.getData()==null||stockoutOrderSearchResponse.getData().size()==0){ if(stockoutOrderSearchResponse.getData()==null||stockoutOrderSearchResponse.getData().size()==0){
return null; return null;
} }
//过滤ADJUST调整 return stockoutOrderSearchResponse.getData();
List<StockoutOrderSearchResponse.StockoutOrder> adjustList=new ArrayList<>();
for (StockoutOrderSearchResponse.StockoutOrder datum : stockoutOrderSearchResponse.getData()) {
StockoutOrderSearchResponse.StockoutOrder.StockoutH header = datum.getHeader();
if("ADJUST".equals(header.getRefOrderType())){
adjustList.add(datum);
}
}
return adjustList;
} }
/** /**
@ -324,6 +429,13 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
BeanUtils.copyProperties(saleOutDetail,stockoutB); BeanUtils.copyProperties(saleOutDetail,stockoutB);
stockoutBList.add(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); BeanUtils.copyProperties(saleOutHeader,stockoutH);
stockoutOrder.setHeader(stockoutH); stockoutOrder.setHeader(stockoutH);
stockoutOrder.setDetails(stockoutBList); stockoutOrder.setDetails(stockoutBList);
@ -333,4 +445,20 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
System.out.println(stockoutOrderSearchResponse); System.out.println(stockoutOrderSearchResponse);
return stockoutOrderSearchResponse; return stockoutOrderSearchResponse;
} }
private GeneralBillVO_4IDto resultDataHandle(String resultData) {
try {
if (resultData != null && !"".equals(resultData)) {
if (resultData.contains("[")) {
resultData = resultData.substring(1, resultData.length() - 1);
}
return JSON.parseObject(resultData, GeneralBillVO_4IDto.class);
}
} catch (Exception e) {
e.printStackTrace();
logger.error("解析返回参数失败的错误", e);
//如果解析失败记录原因但是不能影响结果的记录
}
return null;
}
} }

View File

@ -16,6 +16,7 @@ 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.dto.ofsBaseSearch.OfsShopDto;
import com.hzya.frame.web.entity.JsonResultEntity; import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -33,7 +34,7 @@ import java.util.concurrent.locks.ReentrantLock;
*/ */
public class CustdocAutoAllotPluginInitializer extends PluginBaseEntity { public class CustdocAutoAllotPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(GoodsAutoAllotPluginInitializer.class); Logger logger = LoggerFactory.getLogger(CustdocAutoAllotPluginInitializer.class);
private static final ReentrantLock LOCK = new ReentrantLock(true); private static final ReentrantLock LOCK = new ReentrantLock(true);
@ -49,7 +50,7 @@ public class CustdocAutoAllotPluginInitializer extends PluginBaseEntity {
@Override @Override
public String getPluginId() { public String getPluginId() {
return "com.hzya.frame.plugin.lets.plugin.base.GoodsAutoAllotPluginInitializer"; return "com.hzya.frame.plugin.lets.plugin.base.CustdocAutoAllotPluginInitializer";
} }
@Override @Override
@ -87,8 +88,9 @@ public class CustdocAutoAllotPluginInitializer extends PluginBaseEntity {
try { try {
//查询要分配的客商 //查询要分配的客商
List<CustdocRequestVo> list = queryCustDoc(); List<CustdocRequestVo> list = queryCustDoc();
List<CustdocRequestVo> requestVoList = filterShopEntity(list);
//推送自动分配 //推送自动分配
implement(list); implement(requestVoList);
} catch (Exception e) { } catch (Exception e) {
logger.error("丽知U8C->客商基本档案自动分配全公司,start()方法报错:", e); logger.error("丽知U8C->客商基本档案自动分配全公司,start()方法报错:", e);
@ -97,31 +99,6 @@ public class CustdocAutoAllotPluginInitializer extends PluginBaseEntity {
/**
* 过滤成功日志
*
* @return
*/
public List<BdInvbasdocEntity> filter(List<BdInvbasdocEntity> bdInvbasdocEntityList) {
List<BdInvbasdocEntity> filterInvbasdocList = new ArrayList<>();
for (BdInvbasdocEntity bdInvbasdocEntity : bdInvbasdocEntityList) {
String rootAppPk = bdInvbasdocEntity.getPkInvbasdoc();
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) {
filterInvbasdocList.add(bdInvbasdocEntity);
}
}
return filterInvbasdocList;
}
/** /**
* 查询客商基本档案 * 查询客商基本档案
@ -137,7 +114,8 @@ public class CustdocAutoAllotPluginInitializer extends PluginBaseEntity {
Object o = map.get("datas"); Object o = map.get("datas");
String jsonString = JSONObject.toJSONString(o); String jsonString = JSONObject.toJSONString(o);
List<CustdocRequestVo> list = JSONObject.parseArray(jsonString, CustdocRequestVo.class); List<CustdocRequestVo> list = JSONObject.parseArray(jsonString, CustdocRequestVo.class);
custdocRequestVos = filterData(list); // custdocRequestVos = filterData(list);
custdocRequestVos = filterShopEntity(list);
} catch (Exception e) { } catch (Exception e) {
logger.error("丽知U8C->客商基本档案自动分配全公司,查询客商基本档案失败", e); logger.error("丽知U8C->客商基本档案自动分配全公司,查询客商基本档案失败", e);
} }
@ -155,45 +133,86 @@ public class CustdocAutoAllotPluginInitializer extends PluginBaseEntity {
return filterlist; return filterlist;
} }
//过滤已经分配的
public List<CustdocRequestVo> filterShopEntity(List<CustdocRequestVo> list) {
Assert.notNull(list, "不能为空!");
List<CustdocRequestVo> shopEntityList = new ArrayList<>();
if (list != null && list.size() > 0) {
for (int i = 0; i < list.size(); i++) {
CustdocRequestVo requestVo = list.get(i);
if (requestVo.getParentvo().getCustcode() != null && !"".equals(requestVo.getParentvo().getCustcode().trim())) {
boolean isExis = true;
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
integrationTaskLivingDetailsEntity.setRootAppPk(requestVo.getParentvo().getCustcode());
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y_H);
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
List<IntegrationTaskLivingDetailsEntity> integrationTaskLivingDetailsEntities = iIntegrationTaskLivingDetailsDao.query(integrationTaskLivingDetailsEntity);
if (integrationTaskLivingDetailsEntities == null || integrationTaskLivingDetailsEntities.size() == 0) {
isExis = false;
}
if (!isExis) {
shopEntityList.add(requestVo);
}
}
}
}
return shopEntityList;
}
/** /**
* U8C->客商基本档案自动分配全公司 * U8C->客商基本档案自动分配全公司
*/ */
public void implement(List<CustdocRequestVo> list) { public void implement(List<CustdocRequestVo> list) {
// //查询公司档案
// try {
// String corpresponse = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("bdcorpQuery"), "{}");
// CbdocResultVo cbdocResultVo = JSONObject.parseObject(corpresponse, CbdocResultVo.class);
// if(cbdocResultVo.getStatus()!="success"){
// Assert.state(false, "查询公司档案失败");
// }
// String data = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("bdcorpQuery"), "{}");
// CbdocResultVo ResultVo = JSONObject.parseObject(data, CbdocResultVo.class);
// String datastring = ResultVo.getData();
// Map map = JSONObject.parseObject(datastring, Map.class);
// Object o = map.get("datas");
// List<BdCorpEntity> bdCorpEntities = JSONObject.parseArray(JSON.toJSONString(o), BdCorpEntity.class);
// } catch (Exception e) {
// throw new RuntimeException(e);
// }
for (CustdocRequestVo custdocRequestVo : list) { for (CustdocRequestVo custdocRequestVo : list) {
String assginjsonString = ""; String assginjsonString = "";
String pkCubasdoc = custdocRequestVo.getParentvo().getPk_cubasdoc(); String custcode = custdocRequestVo.getParentvo().getCustcode();
String createtime = custdocRequestVo.getParentvo().getCreatetime(); String createtime = custdocRequestVo.getParentvo().getCreatetime();
// String custprop = custdocRequestVo.getParentvo().getCustprop();
try { try {
ArrayList<CustDocAssginVo> assginvolist = new ArrayList<>(); ArrayList<CustDocAssginVo> assginvolist = new ArrayList<>();
CustDocAssginVo custDocAssginVo = new CustDocAssginVo(); List<BdCorpEntity> bdCorpEntities=null;
custDocAssginVo.setPk_cubasdoc(pkCubasdoc); //查询公司档案
custDocAssginVo.setAssignallcorps("Y"); try {
custDocAssginVo.setCustprop("2"); String corpresponse = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("bdcorpQuery"), "{}");
assginvolist.add(custDocAssginVo); CbdocResultVo cbdocResultVo = JSONObject.parseObject(corpresponse, CbdocResultVo.class);
if(!"success".equals(cbdocResultVo.getStatus())){
Assert.state(false, "查询公司档案失败");
}
String datastring = cbdocResultVo.getData();
Map map = JSONObject.parseObject(datastring, Map.class);
Object o = map.get("datas");
bdCorpEntities = JSONObject.parseArray(JSON.toJSONString(o), BdCorpEntity.class);
} catch (Exception e) {
throw new RuntimeException(e);
}
for(BdCorpEntity bdCorpEntity:bdCorpEntities){
CustDocAssginVo custDocAssginVo = new CustDocAssginVo();
custDocAssginVo.setPk_cubasdoc(custcode);
//TODO
// custDocAssginVo.setCustprop(custprop);
custDocAssginVo.setPk_corp(bdCorpEntity.getUnitcode());
assginvolist.add(custDocAssginVo);
}
// CustDocAssginVo custDocAssginVo = new CustDocAssginVo();
// custDocAssginVo.setPk_cubasdoc(pkCubasdoc);
//// custDocAssginVo.setAssignallcorps("Y");
// custDocAssginVo.setCustprop("2");
// custDocAssginVo.setPk_corp();
// assginvolist.add(custDocAssginVo);
HashMap<String, List> map = new HashMap<>(); HashMap<String, List> map = new HashMap<>();
map.put("custbasvo", list); map.put("custbasvo", assginvolist);
assginjsonString = JSONObject.toJSONString(map); assginjsonString = JSONObject.toJSONString(map);
String response = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("custdocAssign"), assginjsonString); String response = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("custdocAssign"), assginjsonString);
System.out.println(response); System.out.println(response);
boolean isSuccess = false; boolean isSuccess = false;
if (response != null && !"".equals(response)) { if (response != null && !"".equals(response)) {
@ -201,7 +220,7 @@ public class CustdocAutoAllotPluginInitializer extends PluginBaseEntity {
if ("success".equals(reusltStrDto.getStatus())) { if ("success".equals(reusltStrDto.getStatus())) {
isSuccess = true; isSuccess = true;
//分配成功去更新状态 //分配成功去更新状态
updateDoc(custdocRequestVo); // updateDoc(custdocRequestVo);
} }
} }
if (!isSuccess) { if (!isSuccess) {
@ -214,8 +233,8 @@ public class CustdocAutoAllotPluginInitializer extends PluginBaseEntity {
integrationTaskLivingDetailsEntity.setNewTransmitInfo(response); integrationTaskLivingDetailsEntity.setNewTransmitInfo(response);
integrationTaskLivingDetailsEntity.setNewPushDate(new Date()); integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
integrationTaskLivingDetailsEntity.setBusinessDate(createtime); integrationTaskLivingDetailsEntity.setBusinessDate(createtime);
integrationTaskLivingDetailsEntity.setRootAppPk(pkCubasdoc); integrationTaskLivingDetailsEntity.setRootAppPk(custcode);
integrationTaskLivingDetailsEntity.setRootAppBill(pkCubasdoc); integrationTaskLivingDetailsEntity.setRootAppBill(custcode);
integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
} catch (Exception e) { } catch (Exception e) {
@ -229,8 +248,8 @@ public class CustdocAutoAllotPluginInitializer extends PluginBaseEntity {
integrationTaskLivingDetailsEntity.setNewTransmitInfo(ErrMessage); integrationTaskLivingDetailsEntity.setNewTransmitInfo(ErrMessage);
integrationTaskLivingDetailsEntity.setNewPushDate(new Date()); integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
integrationTaskLivingDetailsEntity.setBusinessDate(createtime); integrationTaskLivingDetailsEntity.setBusinessDate(createtime);
integrationTaskLivingDetailsEntity.setRootAppPk(pkCubasdoc); integrationTaskLivingDetailsEntity.setRootAppPk(custcode);
integrationTaskLivingDetailsEntity.setRootAppBill(pkCubasdoc); integrationTaskLivingDetailsEntity.setRootAppBill(custcode);
integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
} }

View File

@ -36,7 +36,7 @@ import java.util.concurrent.locks.ReentrantLock;
*/ */
public class CustmandocPluginInitializer extends PluginBaseEntity { public class CustmandocPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(GoodsClassPluginInitializer.class); Logger logger = LoggerFactory.getLogger(CustmandocPluginInitializer.class);
private static final ReentrantLock LOCK = new ReentrantLock(true); private static final ReentrantLock LOCK = new ReentrantLock(true);
@ -52,7 +52,7 @@ public class CustmandocPluginInitializer extends PluginBaseEntity {
@Override @Override
public String getPluginId() { public String getPluginId() {
return "com.hzya.frame.plugin.lets.plugin.base.GoodsClassPluginInitializer"; return "com.hzya.frame.plugin.lets.plugin.base.CustmandocPluginInitializer";
} }
@Override @Override
@ -193,7 +193,7 @@ public class CustmandocPluginInitializer extends PluginBaseEntity {
integrationTaskLivingDetailsEntity.setNewTransmitInfo(ErrMessage); integrationTaskLivingDetailsEntity.setNewTransmitInfo(ErrMessage);
integrationTaskLivingDetailsEntity.setNewPushDate(new Date()); integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
integrationTaskLivingDetailsEntity.setBusinessDate(businessFormat); integrationTaskLivingDetailsEntity.setBusinessDate(businessFormat);
integrationTaskLivingDetailsEntity.setRootAppPk(parentvo.getPk_areacl()); integrationTaskLivingDetailsEntity.setRootAppPk(parentvo.getPk_cubasdoc());
integrationTaskLivingDetailsEntity.setRootAppBill(parentvo.getCustcode()); integrationTaskLivingDetailsEntity.setRootAppBill(parentvo.getCustcode());
integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);

View File

@ -10,14 +10,17 @@ 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.entity.BdInvclEntity; import com.hzya.frame.plugin.lets.entity.BdInvclEntity;
import com.hzya.frame.plugin.lets.plugin.sales.SoSaleOutPluginInitializerToC; import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSKUClassRequestVO;
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;
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.dto.InterfaceParamByU8CApiDto;
import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OFSSKUClassSearchResponse;
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
import com.hzya.frame.web.entity.JsonResultEntity; import com.hzya.frame.web.entity.JsonResultEntity;
import com.zaxxer.hikari.util.FastList;
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;
@ -37,13 +40,12 @@ import org.springframework.beans.factory.annotation.Autowired;
* 三级AA00101自动识别为AA001的下级 * 三级AA00101自动识别为AA001的下级
*/ */
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.*; import java.util.*;
import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantLock;
public class GoodsClassPluginInitializer extends PluginBaseEntity { public class SKUClassPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(GoodsClassPluginInitializer.class); Logger logger = LoggerFactory.getLogger(SKUClassPluginInitializer.class);
private static final ReentrantLock LOCK = new ReentrantLock(true); private static final ReentrantLock LOCK = new ReentrantLock(true);
@ -59,7 +61,7 @@ public class GoodsClassPluginInitializer extends PluginBaseEntity {
@Override @Override
public String getPluginId() { public String getPluginId() {
return "com.hzya.frame.plugin.lets.plugin.base.GoodsClassPluginInitializer"; return "com.hzya.frame.plugin.lets.plugin.base.SKUClassPluginInitializer";
} }
@Override @Override
@ -83,6 +85,8 @@ public class GoodsClassPluginInitializer extends PluginBaseEntity {
private IIntegrationTaskLivingDetailsDao iIntegrationTaskLivingDetailsDao; private IIntegrationTaskLivingDetailsDao iIntegrationTaskLivingDetailsDao;
@Autowired @Autowired
private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil; private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil;
@Autowired
private OfsUnifiedService ofsUnifiedService;
@Override @Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
@ -99,8 +103,19 @@ public class GoodsClassPluginInitializer extends PluginBaseEntity {
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" + ".000"); String startTimeStr = DateUtil.format(startTime, "yyyy-MM-dd HH:mm:ss");
String endTimeStr = DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss" + ".000"); String endTimeStr = DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss");
QueryOfsSKUClassRequestVO queryOfsSKUClassRequestVO = new QueryOfsSKUClassRequestVO();
// queryOfsSKUClassRequestVO.setCreated_start(start);
// queryOfsSKUClassRequestVO.setCreated_end(end);
queryOfsSKUClassRequestVO.setClientCode("LETS");
queryOfsSKUClassRequestVO.setPageNo(1);
queryOfsSKUClassRequestVO.setPageSize(500);
List<OFSSKUClassSearchResponse.SKUClass> skuClasses = querySkuClass(queryOfsSKUClassRequestVO);
System.out.println(skuClasses);
} catch (Exception e) { } catch (Exception e) {
logger.error("丽知OFS货品档案分类--->U8C货品档案分类,start()方法报错:", e); logger.error("丽知OFS货品档案分类--->U8C货品档案分类,start()方法报错:", e);
} }
@ -126,6 +141,16 @@ public class GoodsClassPluginInitializer extends PluginBaseEntity {
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";
QueryOfsSKUClassRequestVO queryOfsSKUClassRequestVO = new QueryOfsSKUClassRequestVO();
queryOfsSKUClassRequestVO.setCreated_start(start);
queryOfsSKUClassRequestVO.setCreated_end(end);
queryOfsSKUClassRequestVO.setClientCode("LETS");
queryOfsSKUClassRequestVO.setPageNo(1);
queryOfsSKUClassRequestVO.setPageSize(500);
querySkuClass(queryOfsSKUClassRequestVO);
} 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);
} }
@ -228,5 +253,23 @@ public class GoodsClassPluginInitializer extends PluginBaseEntity {
} }
/**
* OFS存货分类查询
*/
public List<OFSSKUClassSearchResponse.SKUClass> querySkuClass(QueryOfsSKUClassRequestVO queryOfsSKUClassRequestVO) throws Exception {
InterfaceParamByU8CApiDto interfaceParamDto = new InterfaceParamByU8CApiDto();
interfaceParamDto.setApi("ofs.inventory.class.search");
queryOfsSKUClassRequestVO.setClientCode("LETS");
interfaceParamDto.setData(JSON.toJSONString(queryOfsSKUClassRequestVO));
OFSSKUClassSearchResponse ofsskuClassSearchResponse =(OFSSKUClassSearchResponse) ofsUnifiedService.unifiedByU8CApi(interfaceParamDto);
System.out.println(ofsskuClassSearchResponse);
List<OFSSKUClassSearchResponse.SKUClass> data = ofsskuClassSearchResponse.getData();
if(data==null||data.size()==0){
return null;
}
return data;
}
} }

View File

@ -11,7 +11,6 @@ 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.ttxofs.basics.ReturnMessageBasics; import com.hzya.frame.ttxofs.basics.ReturnMessageBasics;
import com.hzya.frame.ttxofs.dto.InterfaceParamByU8CApiDto; import com.hzya.frame.ttxofs.dto.InterfaceParamByU8CApiDto;
import com.hzya.frame.ttxofs.dto.InterfaceParamDto;
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;
@ -30,9 +29,9 @@ import java.util.concurrent.locks.ReentrantLock;
* 存货基本档案封存 /u8cloud/api/uapbd/invbasdoc/seal * 存货基本档案封存 /u8cloud/api/uapbd/invbasdoc/seal
* 存货基本档案取消封存 /u8cloud/api/uapbd/invbasdoc/unseal * 存货基本档案取消封存 /u8cloud/api/uapbd/invbasdoc/unseal
*/ */
public class GoodsPluginInitializer extends PluginBaseEntity { public class SKUPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(GoodsPluginInitializer.class); Logger logger = LoggerFactory.getLogger(SKUPluginInitializer.class);
private static final ReentrantLock LOCK = new ReentrantLock(true); private static final ReentrantLock LOCK = new ReentrantLock(true);
@ -94,11 +93,11 @@ public class GoodsPluginInitializer extends PluginBaseEntity {
String endTimeStr = DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss"); String endTimeStr = DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss");
QueryOfsSKURequestVO queryOfsSKURequestVO = new QueryOfsSKURequestVO(); QueryOfsSKURequestVO queryOfsSKURequestVO = new QueryOfsSKURequestVO();
queryOfsSKURequestVO.setCreated_start(startTimeStr); // queryOfsSKURequestVO.setCreated_start(startTimeStr);
queryOfsSKURequestVO.setCreated_end(endTimeStr); // queryOfsSKURequestVO.setCreated_end(endTimeStr);
queryOfsSKURequestVO.setCreated_start("2023-10-17 00:00:00"); // queryOfsSKURequestVO.setCreated_start("2023-10-15 00:00:00");
queryOfsSKURequestVO.setCreated_end("2023-10-17 23:59:59"); // queryOfsSKURequestVO.setCreated_end("2023-10-21 23:59:59");
queryOfsSKURequestVO.setCompanyCode("YX"); // queryOfsSKURequestVO.setCompanyCode("");
queryOfsSKURequestVO.setPageNo(1); queryOfsSKURequestVO.setPageNo(1);
queryOfsSKURequestVO.setPageSize(500); queryOfsSKURequestVO.setPageSize(500);
queryOfsSKUs(queryOfsSKURequestVO); queryOfsSKUs(queryOfsSKURequestVO);

View File

@ -8,7 +8,6 @@ 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.ofs.entity.ShopEntity;
import com.hzya.frame.plugin.lets.queryvo.CustdocRequestVo; import com.hzya.frame.plugin.lets.queryvo.CustdocRequestVo;
import com.hzya.frame.plugin.lets.resultvo.CbdocResultVo; import com.hzya.frame.plugin.lets.resultvo.CbdocResultVo;
@ -18,7 +17,11 @@ 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.dto.InterfaceParamByU8CApiDto;
import com.hzya.frame.ttxofs.dto.InterfaceParamDto; import com.hzya.frame.ttxofs.dto.InterfaceParamDto;
import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OfsShopDto;
import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OfsShopReturnMessageDto;
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;
@ -42,7 +45,7 @@ import java.util.concurrent.locks.ReentrantLock;
*/ */
public class ShopPluginInitializer extends PluginBaseEntity { public class ShopPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(GoodsClassPluginInitializer.class); Logger logger = LoggerFactory.getLogger(ShopPluginInitializer.class);
private static final ReentrantLock LOCK = new ReentrantLock(true); private static final ReentrantLock LOCK = new ReentrantLock(true);
@ -117,18 +120,15 @@ public class ShopPluginInitializer extends PluginBaseEntity {
public void startImplement(String startDate, String endDate) { public void startImplement(String startDate, String endDate) {
try { try {
ShopEntity shopEntity = new ShopEntity(); OfsShopDto shopEntity = new OfsShopDto();
shopEntity.setCreated_start(startDate);
shopEntity.setCreated_end(endDate);
InterfaceParamDto interfaceParamDto = new InterfaceParamDto(); InterfaceParamDto interfaceParamDto = new InterfaceParamDto();
interfaceParamDto.setApi("ofs.store.search"); interfaceParamDto.setApi("ofs.store.search");
interfaceParamDto.setData(JSON.toJSONString(shopEntity)); interfaceParamDto.setData(JSON.toJSONString(shopEntity));
ShopReturnMessageDto unified = (ShopReturnMessageDto) ofsUnifiedService.unified(interfaceParamDto); List<OfsShopDto> list = queryfromofs(shopEntity);
List<ShopEntity> data = unified.getData();
List<ShopEntity> shopEntities = filterShopEntity(data); List<OfsShopDto> shopEntities = filterShopEntity(list);
implement(shopEntities); implement(shopEntities);
} catch (Exception e) { } catch (Exception e) {
@ -149,18 +149,20 @@ public class ShopPluginInitializer extends PluginBaseEntity {
String endTimeStr = DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss"); String endTimeStr = DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss");
ShopEntity shopEntity = new ShopEntity(); OfsShopDto shopEntity = new OfsShopDto();
//TODO ofs查询店铺信息
shopEntity.setCreated_start(startTimeStr);
shopEntity.setCreated_end(endTimeStr); //TODO ofs查询店铺信息
// shopEntity.setLastUpdated_start(startTimeStr);
// shopEntity.setLastUpdated_end(endTimeStr);
shopEntity.setPageNo("1");
shopEntity.setClientCode("LETS");
List<OfsShopDto> list = queryfromofs(shopEntity);
// List<ShopEntity> query = shopDao.query(shopEntity);
List<ShopEntity> query = new ArrayList<>();
query.add(shopEntity);
//过滤数据 //过滤数据
// List<ShopEntity> shopEntities = filterShopEntity(query); List<OfsShopDto> ofsShopDtoList = filterShopEntity(list);
//同步u8c //同步u8c
implement(query); implement(ofsShopDtoList);
} catch (Exception e) { } catch (Exception e) {
logger.error("丽知OFS货品档案分类--->U8C货品档案分类,startImplement()方法报错:", e); logger.error("丽知OFS货品档案分类--->U8C货品档案分类,startImplement()方法报错:", e);
@ -171,17 +173,16 @@ public class ShopPluginInitializer extends PluginBaseEntity {
/** /**
* 按编码名称 * 按编码名称
*/ */
public void startImplement(String code) { public void startImplement(String clientcode) {
Assert.notNull(code, "code不能为空"); Assert.notNull(clientcode, "clientcode不能为空");
try { try {
ShopEntity shopEntity = new ShopEntity(); OfsShopDto shopEntity = new OfsShopDto();
shopEntity.setBizCode(code); shopEntity.setClientCode(clientcode);
shopEntity.setPageNo("1");
//TODO ofs查询店铺信息 //TODO ofs查询店铺信息
// List<ShopEntity> query = shopDao.query(shopEntity); List<OfsShopDto> list = queryfromofs(shopEntity);
List<ShopEntity> query = null;
//过滤数据 //过滤数据
List<ShopEntity> shopEntities = filterShopEntity(query); List<OfsShopDto> shopEntities = filterShopEntity(list);
//执行 //执行
implement(shopEntities); implement(shopEntities);
@ -191,13 +192,13 @@ public class ShopPluginInitializer extends PluginBaseEntity {
} }
@Transactional @Transactional
public void implement(List<ShopEntity> shopEntityList) { public void implement(List<OfsShopDto> shopEntityList) {
Assert.notNull(shopEntityList, "shopEntityList不能为空"); Assert.notNull(shopEntityList, "shopEntityList不能为空");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = new Date(System.currentTimeMillis()); Date date = new Date(System.currentTimeMillis());
String businessFormat = sdf.format(date); String businessFormat = sdf.format(date);
for (ShopEntity shopEntity : shopEntityList) { for (OfsShopDto shopEntity : shopEntityList) {
try { try {
@ -206,12 +207,14 @@ public class ShopPluginInitializer extends PluginBaseEntity {
//TODO 设置parentvo //TODO 设置parentvo
parentvo.setCustname(shopEntity.getName()); parentvo.setCustname(shopEntity.getName());
parentvo.setCustshortname(shopEntity.getName()); parentvo.setCustshortname(shopEntity.getName());
parentvo.setCustcode(shopEntity.getCustomerCode()); // parentvo.setCustcode(shopEntity.getCustomerCode());
// parentvo.setCustcode(shopEntity.getBizCode());
// parentvo.setPk_areacl("F");
//设置还未分配公司 //设置还未分配公司
parentvo.setDef10("N"); // parentvo.setDef10("N");
//设置还未同步到管理档案 // //设置还未同步到管理档案
parentvo.setDef11("N"); // parentvo.setDef11("N");
// parentvo.setCustprop("0"); // parentvo.setCustprop("2");
custdocRequestVo.setParentvo(parentvo); custdocRequestVo.setParentvo(parentvo);
//同步u8c //同步u8c
@ -270,17 +273,17 @@ public class ShopPluginInitializer extends PluginBaseEntity {
} }
public List<ShopEntity> filterShopEntity(List<ShopEntity> list) { public List<OfsShopDto> filterShopEntity(List<OfsShopDto> list) {
Assert.notNull(list, "不能为空!"); Assert.notNull(list, "不能为空!");
List<ShopEntity> shopEntityList = new ArrayList<>(); List<OfsShopDto> shopEntityList = new ArrayList<>();
if (list != null && list.size() > 0) { if (list != null && list.size() > 0) {
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
ShopEntity shopEntity = list.get(i); OfsShopDto ofsShopDto = list.get(i);
if (shopEntity.getBizCode() != null && !"".equals(shopEntity.getBizCode().trim())) { if (ofsShopDto.getBizCode() != null && !"".equals(ofsShopDto.getBizCode().trim())) {
boolean isExis = true; boolean isExis = true;
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
integrationTaskLivingDetailsEntity.setRootAppPk(shopEntity.getBizCode()); integrationTaskLivingDetailsEntity.setRootAppPk(ofsShopDto.getBizCode());
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y_H); integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y_H);
integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
List<IntegrationTaskLivingDetailsEntity> integrationTaskLivingDetailsEntities = iIntegrationTaskLivingDetailsDao.query(integrationTaskLivingDetailsEntity); List<IntegrationTaskLivingDetailsEntity> integrationTaskLivingDetailsEntities = iIntegrationTaskLivingDetailsDao.query(integrationTaskLivingDetailsEntity);
@ -288,7 +291,7 @@ public class ShopPluginInitializer extends PluginBaseEntity {
isExis = false; isExis = false;
} }
if (!isExis) { if (!isExis) {
shopEntityList.add(shopEntity); shopEntityList.add(ofsShopDto);
} }
} }
} }
@ -297,5 +300,16 @@ public class ShopPluginInitializer extends PluginBaseEntity {
} }
public List<OfsShopDto> queryfromofs(OfsShopDto shopEntity) {
InterfaceParamByU8CApiDto interfaceParamDto = new InterfaceParamByU8CApiDto();
interfaceParamDto.setApi("ofs.store.search");
interfaceParamDto.setData(JSON.toJSONString(shopEntity));
try {
OfsShopReturnMessageDto unified = (OfsShopReturnMessageDto) ofsUnifiedService.unifiedByU8CApi(interfaceParamDto);
List<OfsShopDto> list = unified.getData();
return list;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
} }

View File

@ -8,8 +8,8 @@ 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.ofs.entity.ShopEntity;
import com.hzya.frame.plugin.lets.ofs.entity.SupplierEntity;
import com.hzya.frame.plugin.lets.queryvo.CustDocAssginVo; import com.hzya.frame.plugin.lets.queryvo.CustDocAssginVo;
import com.hzya.frame.plugin.lets.queryvo.CustdocRequestVo; import com.hzya.frame.plugin.lets.queryvo.CustdocRequestVo;
@ -20,6 +20,11 @@ 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.dto.InterfaceParamByU8CApiDto;
import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OfsSupplierDto;
import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OfsSupplierReturnMessageDto;
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;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -40,10 +45,13 @@ import java.util.concurrent.locks.ReentrantLock;
* @Description: 供应商档案->客商档案 * @Description: 供应商档案->客商档案
*/ */
public class SupplierPluginInitializer extends PluginBaseEntity { public class SupplierPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(GoodsClassPluginInitializer.class); Logger logger = LoggerFactory.getLogger(SupplierPluginInitializer.class);
private static final ReentrantLock LOCK = new ReentrantLock(true); private static final ReentrantLock LOCK = new ReentrantLock(true);
@Autowired
private OfsUnifiedService ofsUnifiedService;
@Override @Override
public void initialize() { public void initialize() {
logger.info(getPluginLabel() + "执行初始化方法initialize()"); logger.info(getPluginLabel() + "执行初始化方法initialize()");
@ -56,7 +64,7 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
@Override @Override
public String getPluginId() { public String getPluginId() {
return "ShopPluginInitializer"; return "SupplierPluginInitializer";
} }
@Override @Override
@ -116,15 +124,14 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
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");
SupplierEntity supplierEntity = new SupplierEntity(); OfsSupplierDto supplierEntity = new OfsSupplierDto();
//TODO ofs查询供应商信息 //TODO ofs查询供应商信息
// List<ShopEntity> query = shopDao.query(shopEntity); List<OfsSupplierDto> list = queryfromofs(supplierEntity);
List<SupplierEntity> query = null;
//过滤数据 //过滤数据
List<SupplierEntity> supplierEntities = filterSupplierEntity(query); List<OfsSupplierDto> supplierDtoList = filterSupplierEntity(list);
implement(supplierEntities); implement(supplierDtoList);
} catch (Exception e) { } catch (Exception e) {
logger.error("丽知OFS供应商档案--->U8C客商档案,startImplement()方法报错:", e); logger.error("丽知OFS供应商档案--->U8C客商档案,startImplement()方法报错:", e);
@ -138,15 +145,15 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
public void startImplement(String code) { public void startImplement(String code) {
Assert.notNull(code, "code不能为空"); Assert.notNull(code, "code不能为空");
try { try {
ShopEntity shopEntity = new ShopEntity(); OfsSupplierDto supplierEntity = new OfsSupplierDto();
shopEntity.setBizCode(code); supplierEntity.setCompanyCode(code);
//TODO ofs查询供应商信息 //TODO ofs查询供应商信息
List<SupplierEntity> query = null; List<OfsSupplierDto> list = queryfromofs(supplierEntity);
//过滤数据 //过滤数据
List<SupplierEntity> supplierEntities = filterSupplierEntity(query); List<OfsSupplierDto> supplierDtoList = filterSupplierEntity(list);
//执行 //执行
implement(supplierEntities); implement(supplierDtoList);
} catch (Exception e) { } catch (Exception e) {
logger.error("丽知OFS供应商档案--->U8C客商档案,startImplement(String code)方法报错:", e); logger.error("丽知OFS供应商档案--->U8C客商档案,startImplement(String code)方法报错:", e);
@ -163,9 +170,9 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
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";
ShopEntity shopEntity = new ShopEntity(); OfsSupplierDto shopEntity = new OfsSupplierDto();
shopEntity.setCreated_start(start); shopEntity.setLastUpdated_start(start);
shopEntity.setCreated_end(end); shopEntity.setLastUpdated_end(end);
//TODO ofs查询供应商信息 //TODO ofs查询供应商信息
} catch (Exception e) { } catch (Exception e) {
@ -173,14 +180,14 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
} }
} }
public void implement(List<SupplierEntity> shopEntityList) { public void implement(List<OfsSupplierDto> shopEntityList) {
Assert.notNull(shopEntityList, "shopEntityList不能为空"); Assert.notNull(shopEntityList, "shopEntityList不能为空");
//业务时间 //业务时间
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = new Date(System.currentTimeMillis()); Date date = new Date(System.currentTimeMillis());
String businessFormat = sdf.format(date); String businessFormat = sdf.format(date);
for (SupplierEntity supplierEntity : shopEntityList) { for (OfsSupplierDto supplierEntity : shopEntityList) {
CustdocEntityDto parentvo = new CustdocEntityDto(); CustdocEntityDto parentvo = new CustdocEntityDto();
CustdocRequestVo CustdocEntityDto = new CustdocRequestVo(); CustdocRequestVo CustdocEntityDto = new CustdocRequestVo();
try { try {
@ -191,9 +198,10 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
parentvo.setCustcode(supplierEntity.getCompanyCode()); parentvo.setCustcode(supplierEntity.getCompanyCode());
//设置还未分配公司 //设置还未分配公司
parentvo.setDef10("N"); // parentvo.setDef10("N");
//设置还未同步到管理档案 // //设置还未同步到管理档案
parentvo.setDef11("N"); // parentvo.setDef11("N");
parentvo.setCustprop("1");
CustdocEntityDto.setParentvo(parentvo); CustdocEntityDto.setParentvo(parentvo);
// 同步u8c // 同步u8c
HashMap<String, Object> param = new HashMap<>(); HashMap<String, Object> param = new HashMap<>();
@ -248,19 +256,19 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
} }
//过滤数据 //过滤数据
public List<SupplierEntity> filterSupplierEntity(List<SupplierEntity> list) { public List<OfsSupplierDto> filterSupplierEntity(List<OfsSupplierDto> list) {
Assert.notNull(list, "不能为空!"); Assert.notNull(list, "不能为空!");
List<SupplierEntity> supplierEntityList = new ArrayList<>(); List<OfsSupplierDto> supplierDtoList = new ArrayList<>();
if (list != null && list.size() > 0) { if (list != null && list.size() > 0) {
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
SupplierEntity supplierEntity = list.get(i); OfsSupplierDto ofsSupplierDto = list.get(i);
if (supplierEntity.getBizCode() != null && !"".equals(supplierEntity.getBizCode().trim())) { if (ofsSupplierDto.getBizCode() != null && !"".equals(ofsSupplierDto.getBizCode().trim())) {
boolean isExis = true; boolean isExis = true;
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
integrationTaskLivingDetailsEntity.setRootAppPk(supplierEntity.getBizCode()); integrationTaskLivingDetailsEntity.setRootAppPk(ofsSupplierDto.getBizCode());
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y_H); integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y_H);
integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
List<IntegrationTaskLivingDetailsEntity> integrationTaskLivingDetailsEntities = iIntegrationTaskLivingDetailsDao.query(integrationTaskLivingDetailsEntity); List<IntegrationTaskLivingDetailsEntity> integrationTaskLivingDetailsEntities = iIntegrationTaskLivingDetailsDao.query(integrationTaskLivingDetailsEntity);
@ -268,11 +276,24 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
isExis = false; isExis = false;
} }
if (!isExis) { if (!isExis) {
supplierEntityList.add(supplierEntity); supplierDtoList.add(ofsSupplierDto);
} }
} }
} }
} }
return supplierEntityList; return supplierDtoList;
}
public List<OfsSupplierDto> queryfromofs(OfsSupplierDto supplierEntity) {
InterfaceParamByU8CApiDto interfaceParamDto = new InterfaceParamByU8CApiDto();
interfaceParamDto.setApi("ofs.store.search");
interfaceParamDto.setData(JSON.toJSONString(supplierEntity));
try {
OfsSupplierReturnMessageDto unified = (OfsSupplierReturnMessageDto) ofsUnifiedService.unifiedByU8CApi(interfaceParamDto);
List<OfsSupplierDto> list = unified.getData();
return list;
} catch (Exception e) {
throw new RuntimeException(e);
}
} }
} }

View File

@ -89,9 +89,11 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
String endTimeStr = DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss"); String endTimeStr = DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss");
QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO(); QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO();
queryOfsStockinOrderRequestVO.setCreated_start("2024-08-05 00:00:00"); // queryOfsStockinOrderRequestVO.setCreated_start("2024-08-05 00:00:00");
queryOfsStockinOrderRequestVO.setCreated_end("2024-08-09 23:59:59"); // queryOfsStockinOrderRequestVO.setCreated_end("2024-08-09 23:59:59");
queryOfsStockinOrderRequestVO.setCompanyCode("SHXM"); queryOfsStockinOrderRequestVO.setClosedAt_start("2024-08-05 00:00:00");
queryOfsStockinOrderRequestVO.setClosedAt_end("2024-08-09 23:59:59");
// queryOfsStockinOrderRequestVO.setCompanyCode("SHXM");
// queryOfsTransferOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库 // queryOfsTransferOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库
queryOfsStockinOrderRequestVO.setPageNo(1L); queryOfsStockinOrderRequestVO.setPageNo(1L);
queryOfsStockinOrderRequestVO.setPageSize(500L); queryOfsStockinOrderRequestVO.setPageSize(500L);
@ -113,6 +115,16 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
*/ */
public void start(String stockinNo) { public void start(String stockinNo) {
try { try {
QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO();
queryOfsStockinOrderRequestVO.setCode(stockinNo);
queryOfsStockinOrderRequestVO.setPageNo(1L);
queryOfsStockinOrderRequestVO.setPageSize(500L);
List<StockinOrderSearchResponse.StockinOrder> data = queryOfsStockinOrder(queryOfsStockinOrderRequestVO);
System.out.println(data);
} catch (Exception e) { } catch (Exception e) {
logger.error("丽知OFS调拨入库订单--->U8C调拨订单保存签字自动生成调拨出入库,start(String goodsName)方法报错:", e); logger.error("丽知OFS调拨入库订单--->U8C调拨订单保存签字自动生成调拨出入库,start(String goodsName)方法报错:", e);
} }
@ -128,6 +140,17 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
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";
QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO();
queryOfsStockinOrderRequestVO.setClosedAt_start("2024-08-05 00:00:00");
queryOfsStockinOrderRequestVO.setClosedAt_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) { } catch (Exception e) {
logger.error("丽知OFS调拨入库订单--->U8C调拨订单保存签字自动生成调拨出入库,start(String startTime, String endTime)方法报错:", e); logger.error("丽知OFS调拨入库订单--->U8C调拨订单保存签字自动生成调拨出入库,start(String startTime, String endTime)方法报错:", e);
} }
@ -137,7 +160,7 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
public List<StockinOrderSearchResponse.StockinOrder> queryOfsStockinOrder(QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO) throws Exception { public List<StockinOrderSearchResponse.StockinOrder> queryOfsStockinOrder(QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO) throws Exception {
InterfaceParamDto interfaceParamDto = new InterfaceParamDto(); InterfaceParamDto interfaceParamDto = new InterfaceParamDto();
interfaceParamDto.setApi("ofs.receipt.search"); interfaceParamDto.setApi("ofs.receipt.search");
// queryOfsStockinOrderRequestVO.setInternalInstructionType("ADJUST");//入库单类型 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");
interfaceParamDto.setData(JSON.toJSONString(queryOfsStockinOrderRequestVO)); interfaceParamDto.setData(JSON.toJSONString(queryOfsStockinOrderRequestVO));
StockinOrderSearchResponse stockinOrderSearchResponse = (StockinOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto); StockinOrderSearchResponse stockinOrderSearchResponse = (StockinOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto);

View File

@ -6,11 +6,13 @@ 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.ofsvo.QueryOfsStockinOrderRequestVO; import com.hzya.frame.plugin.lets.ofsvo.QueryOfsStockinOrderRequestVO;
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsStockoutOrderRequestVO;
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.ttxofs.dto.InterfaceParamDto; import com.hzya.frame.ttxofs.dto.InterfaceParamDto;
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.JsonResultEntity; import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -88,14 +90,14 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
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");
QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO(); QueryOfsStockoutOrderRequestVO queryOfsStockoutOrderRequestVO = new QueryOfsStockoutOrderRequestVO();
queryOfsStockinOrderRequestVO.setCreated_start("2024-08-05 00:00:00"); queryOfsStockoutOrderRequestVO.setClosedAt_start(startTimeStr);
queryOfsStockinOrderRequestVO.setCreated_end("2024-08-09 23:59:59"); queryOfsStockoutOrderRequestVO.setClosedAt_end(endTimeStr);
queryOfsStockinOrderRequestVO.setCompanyCode("SHXM"); // queryOfsStockoutOrderRequestVO.setCompanyCode("SHXM");
// queryOfsTransferOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库 // queryOfsStockoutOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库
queryOfsStockinOrderRequestVO.setPageNo(1L); queryOfsStockoutOrderRequestVO.setPageNo(1L);
queryOfsStockinOrderRequestVO.setPageSize(500L); queryOfsStockoutOrderRequestVO.setPageSize(500L);
List<StockinOrderSearchResponse.StockinOrder> data = queryOfsStockinOrder(queryOfsStockinOrderRequestVO); List<StockoutOrderSearchResponse.StockoutOrder> data = queryOfsStockoutOrder(queryOfsStockoutOrderRequestVO);
System.out.println(data); System.out.println(data);
//过滤日志 //过滤日志
@ -113,6 +115,15 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
*/ */
public void start(String stockinNo) { public void start(String stockinNo) {
try { try {
QueryOfsStockoutOrderRequestVO queryOfsStockoutOrderRequestVO = new QueryOfsStockoutOrderRequestVO();
queryOfsStockoutOrderRequestVO.setCode(stockinNo);
// queryOfsStockoutOrderRequestVO.setCompanyCode("SHXM");
// queryOfsStockoutOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库
queryOfsStockoutOrderRequestVO.setPageNo(1L);
queryOfsStockoutOrderRequestVO.setPageSize(500L);
List<StockoutOrderSearchResponse.StockoutOrder> data = queryOfsStockoutOrder(queryOfsStockoutOrderRequestVO);
System.out.println(data);
} catch (Exception e) { } catch (Exception e) {
logger.error("丽知OFS调拨出库订单--->U8C调拨出库单保存签字,start(String goodsName)方法报错:", e); logger.error("丽知OFS调拨出库订单--->U8C调拨出库单保存签字,start(String goodsName)方法报错:", e);
} }
@ -128,31 +139,34 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
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";
QueryOfsStockoutOrderRequestVO queryOfsStockoutOrderRequestVO = new QueryOfsStockoutOrderRequestVO();
queryOfsStockoutOrderRequestVO.setClosedAt_start(start);
queryOfsStockoutOrderRequestVO.setClosedAt_end(end);
// queryOfsStockoutOrderRequestVO.setCompanyCode("SHXM");
// queryOfsStockoutOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库
queryOfsStockoutOrderRequestVO.setPageNo(1L);
queryOfsStockoutOrderRequestVO.setPageSize(500L);
List<StockoutOrderSearchResponse.StockoutOrder> data = queryOfsStockoutOrder(queryOfsStockoutOrderRequestVO);
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<StockinOrderSearchResponse.StockinOrder> queryOfsStockinOrder(QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO) 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");
queryOfsStockinOrderRequestVO.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换货
queryOfsStockinOrderRequestVO.setClientCode("LETS"); queryOfsStockoutOrderRequestVO.setClientCode("LETS");
interfaceParamDto.setData(JSON.toJSONString(queryOfsStockinOrderRequestVO)); interfaceParamDto.setData(JSON.toJSONString(queryOfsStockoutOrderRequestVO));
StockinOrderSearchResponse stockinOrderSearchResponse = (StockinOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto); StockoutOrderSearchResponse stockoutOrderSearchResponse = (StockoutOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto);
System.out.println(stockinOrderSearchResponse); System.out.println(stockoutOrderSearchResponse);
if(stockinOrderSearchResponse.getData()==null||stockinOrderSearchResponse.getData().size()==0){ if(stockoutOrderSearchResponse.getData()==null||stockoutOrderSearchResponse.getData().size()==0){
return null; return null;
} }
//过滤ADJUST调整 return stockoutOrderSearchResponse.getData();
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;
} }
} }

View File

@ -6,9 +6,9 @@
<bean name="soSaleReturnPluginInitializerToC" class="com.hzya.frame.plugin.lets.plugin.sales.SoSaleReturnPluginInitializerToC"/> <bean name="soSaleReturnPluginInitializerToC" class="com.hzya.frame.plugin.lets.plugin.sales.SoSaleReturnPluginInitializerToC"/>
<!--基础档案--> <!--基础档案-->
<bean name="goodsPluginInitializer" class="com.hzya.frame.plugin.lets.plugin.base.GoodsPluginInitializer"/> <bean name="skuPluginInitializer" class="com.hzya.frame.plugin.lets.plugin.base.SKUPluginInitializer"/>
<bean name="goodsAutoAllotPluginInitializer" class="com.hzya.frame.plugin.lets.plugin.base.GoodsAutoAllotPluginInitializer"/> <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="skuClassPluginInitializer" class="com.hzya.frame.plugin.lets.plugin.base.SKUClassPluginInitializer"/>
<bean name="CustdocAutoAllotPluginInitializer" class="com.hzya.frame.plugin.lets.plugin.base.CustdocAutoAllotPluginInitializer"/> <bean name="CustdocAutoAllotPluginInitializer" class="com.hzya.frame.plugin.lets.plugin.base.CustdocAutoAllotPluginInitializer"/>
<bean name="CustmandocPluginInitializer" class="com.hzya.frame.plugin.lets.plugin.base.CustmandocPluginInitializer"/> <bean name="CustmandocPluginInitializer" class="com.hzya.frame.plugin.lets.plugin.base.CustmandocPluginInitializer"/>
<bean name="ShopPluginInitializer" class="com.hzya.frame.plugin.lets.plugin.base.ShopPluginInitializer"/> <bean name="ShopPluginInitializer" class="com.hzya.frame.plugin.lets.plugin.base.ShopPluginInitializer"/>
@ -17,6 +17,7 @@
<!--调拨--> <!--调拨-->
<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="transferInPluginInitializer" class="com.hzya.frame.plugin.lets.plugin.transfer.TransferInPluginInitializer"/>
<bean name="transferOutPluginInitializer" class="com.hzya.frame.plugin.lets.plugin.transfer.TransferOutPluginInitializer"/>
<!--调整--> <!--调整-->
<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

@ -12,24 +12,31 @@ import org.springframework.test.context.junit4.SpringRunner;
public class BaseTest { public class BaseTest {
@Autowired @Autowired
private GoodsPluginInitializer goodsPluginInitializer; private SKUPluginInitializer skuPluginInitializer;
@Autowired @Autowired
private GoodsClassPluginInitializer goodsClassPluginInitializer; private SKUClassPluginInitializer skuClassPluginInitializer;
@Autowired @Autowired
private GoodsAutoAllotPluginInitializer goodsAutoAllotPluginInitializer; private GoodsAutoAllotPluginInitializer goodsAutoAllotPluginInitializer;
////////////////////////////////////////////////////////////////////////////////////SKU
@Test @Test
public void t00(){ public void t00(){
goodsClassPluginInitializer.start("666"); skuPluginInitializer.start();
} }
////////////////////////////////////////////////////////////////////////////////////SKU自动分配
@Test @Test
public void t01(){ public void t10(){
goodsAutoAllotPluginInitializer.start("0001A210000000000U4C"); goodsAutoAllotPluginInitializer.start("0001A210000000000U4C");
} }
////////////////////////////////////////////////////////////////////////////////////SKU分类
@Test @Test
public void t02(){ public void t20(){
goodsPluginInitializer.start(); skuClassPluginInitializer.start();
} }
@Test
public void t21(){
skuClassPluginInitializer.start("2024-08-15","2024-08-16");
}
} }

View File

@ -18,6 +18,8 @@ public class TransferTest {
@Autowired @Autowired
private TransferInPluginInitializer transferInPluginInitializer; private TransferInPluginInitializer transferInPluginInitializer;
@Autowired @Autowired
private TransferOutPluginInitializer transferOutPluginInitializer;
@Autowired
private AdjustInPluginInitializer adjustInPluginInitializer; private AdjustInPluginInitializer adjustInPluginInitializer;
@Autowired @Autowired
private AdjustOutPluginInitializer adjustOutPluginInitializer; private AdjustOutPluginInitializer adjustOutPluginInitializer;
@ -36,6 +38,16 @@ public class TransferTest {
////////////////////////////////////////////////////////////////////////////////////调拨出库单 ////////////////////////////////////////////////////////////////////////////////////调拨出库单
@Test
public void t10(){
transferOutPluginInitializer.start();
}
@Test
public void t11(){
transferOutPluginInitializer.start("2024-08-06","2024-08-11");
}
////////////////////////////////////////////////////////////////////////////////////调拨入库单 ////////////////////////////////////////////////////////////////////////////////////调拨入库单
@Test @Test
public void t20(){ public void t20(){
@ -43,7 +55,7 @@ public class TransferTest {
} }
@Test @Test
public void t21(){ public void t21(){
transferInPluginInitializer.start("LETS-TH2024080800000003"); transferInPluginInitializer.start("LETS-RE2024080800000002");
} }
@ -70,11 +82,11 @@ public class TransferTest {
} }
@Test @Test
public void t41(){ public void t41(){
adjustOutPluginInitializer.start("LETS-AH2024081300000003"); adjustOutPluginInitializer.start("LETS-SH2024080900000001");
} }
@Test @Test
public void t42(){ public void t42(){
adjustOutPluginInitializer.start("2024-08-14","2024-08-14"); adjustOutPluginInitializer.start("2024-08-08","2024-08-13");
} }
} }

View File

@ -2,6 +2,7 @@ package com.hzya.frame.ttxofs.basics;
import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OFSSKUClassSearchResponse; 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.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;
@ -30,6 +31,9 @@ public class ApiDtoCacheMap {
apiDtoCacheMap.put("ofs.receipt.search", new StockinOrderSearchResponse());//入库单查询 apiDtoCacheMap.put("ofs.receipt.search", new StockinOrderSearchResponse());//入库单查询
apiDtoCacheMap.put("ofs.transferOrder.search", new OFSTranseferOrderSearchResponse());//调拨订单 apiDtoCacheMap.put("ofs.transferOrder.search", new OFSTranseferOrderSearchResponse());//调拨订单
apiDtoCacheMap.put("ofs.store.search", new OfsShopReturnMessageDto());//店铺查询
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存货分类查询接口

View File

@ -3,9 +3,25 @@ package com.hzya.frame.ttxofs.dto.ofsBaseSearch;
import com.hzya.frame.ttxofs.basics.ReturnMessageBasics; import com.hzya.frame.ttxofs.basics.ReturnMessageBasics;
import lombok.Data; import lombok.Data;
import java.util.Date;
import java.util.List;
/** /**
* OFS SKU查询返回 * OFS SKU查询返回
*/ */
@Data @Data
public class OFSSKUClassSearchResponse extends ReturnMessageBasics { public class OFSSKUClassSearchResponse extends ReturnMessageBasics {
List<SKUClass> data;
@Data
public static class SKUClass {
private String id;
private String clientCode;
private String cInvCCode;
private String cInvCName;
private Date created;
private String createdBy;
private Date lastUpdated;
private String lastUpdatedBy;
}
} }

View File

@ -11,7 +11,7 @@ import java.util.List;
*/ */
@Data @Data
public class OFSSKUSearchResponse extends ReturnMessageBasics { public class OFSSKUSearchResponse extends ReturnMessageBasics {
private List<OFSSKU> skuList; private List<OFSSKU> data;
@Data @Data
public static class OFSSKU{ public static class OFSSKU{

View File

@ -0,0 +1,47 @@
package com.hzya.frame.ttxofs.dto.ofsBaseSearch;
import lombok.Data;
/**
* @Author sx
* @Date 2024/8/15 16:37
* @PackageName:com.hzya.frame.ttxofs.dto.ofsBaseSearch
* @ClassName: OfsShopDto
* @Description: TODO
*/
@Data
public class OfsShopDto {
private String bizCode;
// 销售平台
private String platformCode;
// 店铺名称
private String name;
// 店主账号
private String ownerAccount;
// u8货主
private String u8CompanyCode;
// 运营类型
private String operationType;
// 业务
private String business;
// 客户分类编码
private String customerClassifyCode;
// 客户编码
private String customerCode;
// 客户管理类型编码
private String cmtCode;
// 品牌
private String brandCode;
// 组织
private String clientCode;
// 货主编码
private String companyCode;
private Integer status;
private String created;
private String createdBy;
private String lastUpdated;
private String lastUpdatedBy;
private String pageNo;
}

View File

@ -0,0 +1,18 @@
package com.hzya.frame.ttxofs.dto.ofsBaseSearch;
import com.hzya.frame.ttxofs.basics.ReturnMessageBasics;
import lombok.Data;
import java.util.List;
/**
* @Author sx
* @Date 2024/8/15 17:31
* @PackageName:com.hzya.frame.ttxofs.dto.ofsBaseSearch
* @ClassName: OfsShopReturnMessageDto
* @Description: TODO
*/
@Data
public class OfsShopReturnMessageDto extends ReturnMessageBasics {
private List<OfsShopDto> data;
}

View File

@ -0,0 +1,43 @@
package com.hzya.frame.ttxofs.dto.ofsBaseSearch;
import lombok.Data;
/**
* @Author sx
* @Date 2024/8/15 17:12
* @PackageName:com.hzya.frame.ttxofs.dto.ofsBaseSearch
* @ClassName: OfsSupplierDto
* @Description: TODO
*/
@Data
public class OfsSupplierDto {
//业务编码
private String bizCode;
//供应商名称
private String name;
//组织
private String clientCode;
//货主编码
private String companyCode;
//地址
private String address;
//国家
private String country;
//
private String state;
//
private String city;
//
private String district;
//联系人
private String attentionTo;
//手机号
private String mobile;
//状态
private String status;
private String lastUpdated_start;
private String lastUpdated_end;
}

View File

@ -0,0 +1,12 @@
package com.hzya.frame.ttxofs.dto.ofsBaseSearch;
import com.hzya.frame.ttxofs.basics.ReturnMessageBasics;
import lombok.Data;
import java.util.List;
@Data
public class OfsSupplierReturnMessageDto extends ReturnMessageBasics {
private List<OfsSupplierDto> data;
}

View File

@ -84,6 +84,10 @@ public class StockoutOrderSearchResponse extends ReturnMessageBasics {
private String shipAt; private String shipAt;
private String shipmentType; private String shipmentType;
private String shipmentNote; private String shipmentNote;
private String created;
private String createdBy;
private String lastUpdated;
private String lastUpdatedBy;
} }
@Data @Data
public static class StockoutB { public static class StockoutB {