供应商->客商

This commit is contained in:
sx 2024-08-19 17:15:30 +08:00
parent 6effaf0f2e
commit cfb5eef150
9 changed files with 130 additions and 136 deletions

View File

@ -14,37 +14,23 @@ import java.io.Serializable;
*/
@Data
public class ShopEntity implements Serializable {
// 店铺业务编码
//业务编码
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 lastUpdated_start;
private String lastUpdated_end;
private String created;
private String createdBy;
private String lastUpdated;
private String lastUpdatedBy;
private String pageNo;
private String pageSize;
}

View File

@ -18,26 +18,21 @@ public class SupplierEntity {
//组织
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 companyCode;
private String bankAccount;
private String openBank;
private String payeeName;
private String payeePhone;
private String payeeAddress;
private String stauts;
private String created;
private String createdBy;
private String pageNo;
private String pageSize;
private String lastUpdated_start;
private String lastUpdated;
private String lastUpdatedBy;
}

View File

@ -121,13 +121,11 @@ public class ShopPluginInitializer extends PluginBaseEntity {
public void startImplement(String startDate, String endDate) {
try {
OfsShopDto shopEntity = new OfsShopDto();
InterfaceParamDto interfaceParamDto = new InterfaceParamDto();
interfaceParamDto.setApi("ofs.store.search");
interfaceParamDto.setData(JSON.toJSONString(shopEntity));
shopEntity.setLastUpdated_start(startDate);
shopEntity.setLastUpdated_end(endDate);
shopEntity.setPageNo("1");
shopEntity.setPageNo("1");
List<OfsShopDto> list = queryfromofs(shopEntity);
List<OfsShopDto> shopEntities = filterShopEntity(list);
implement(shopEntities);
@ -150,11 +148,8 @@ public class ShopPluginInitializer extends PluginBaseEntity {
OfsShopDto shopEntity = new OfsShopDto();
//TODO ofs查询店铺信息
// shopEntity.setLastUpdated_start(startTimeStr);
// shopEntity.setLastUpdated_end(endTimeStr);
shopEntity.setLastUpdated_start(startTimeStr);
shopEntity.setLastUpdated_end(endTimeStr);
shopEntity.setPageNo("1");
shopEntity.setClientCode("LETS");
List<OfsShopDto> list = queryfromofs(shopEntity);
@ -173,13 +168,12 @@ public class ShopPluginInitializer extends PluginBaseEntity {
/**
* 按编码名称
*/
public void startImplement(String clientcode) {
Assert.notNull(clientcode, "clientcode不能为空");
public void startImplement(String code) {
try {
OfsShopDto shopEntity = new OfsShopDto();
shopEntity.setClientCode(clientcode);
shopEntity.setBizCode(code);
shopEntity.setClientCode("LETS");
shopEntity.setPageNo("1");
//TODO ofs查询店铺信息
List<OfsShopDto> list = queryfromofs(shopEntity);
//过滤数据
List<OfsShopDto> shopEntities = filterShopEntity(list);
@ -204,15 +198,10 @@ public class ShopPluginInitializer extends PluginBaseEntity {
CustdocEntityDto parentvo = new CustdocEntityDto();
CustdocRequestVo custdocRequestVo = new CustdocRequestVo();
//TODO 设置parentvo
parentvo.setCustname(shopEntity.getName());
parentvo.setCustshortname(shopEntity.getName());
// parentvo.setCustcode(shopEntity.getCustomerCode());
// parentvo.setCustcode(shopEntity.getBizCode());
// parentvo.setPk_areacl("F");
// parentvo.setCustprop("2");
custdocRequestVo.setParentvo(parentvo);
custdocRequestVo.setParentvo(parentvo);
//同步u8c
HashMap<String, Object> param = new HashMap<>();
param.put("cbdocvo", custdocRequestVo);

View File

@ -11,9 +11,8 @@ import com.hzya.frame.plugin.lets.constant.ProfilesActiveConstant;
import com.hzya.frame.plugin.lets.queryvo.CustDocAssginVo;
import com.hzya.frame.plugin.lets.queryvo.CustdocRequestVo;
import com.hzya.frame.plugin.lets.queryvo.CustmandocRequestVo;
import com.hzya.frame.plugin.lets.resultvo.CbdocResultVo;
import com.hzya.frame.plugin.lets.u8cdto.CustdocEntityDto;
import com.hzya.frame.plugin.lets.util.PushDataByU8cUtil;
@ -125,12 +124,16 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
String endTimeStr = DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss");
OfsSupplierDto supplierEntity = new OfsSupplierDto();
supplierEntity.setClientCode("LETS");
supplierEntity.setCompanyCode("LETS");
supplierEntity.setPageNo("1");
supplierEntity.setLastUpdated_start(startTimeStr);
supplierEntity.setLastUpdated_end(endTimeStr);
//TODO ofs查询供应商信息
List<OfsSupplierDto> list = queryfromofs(supplierEntity);
//过滤数据
List<OfsSupplierDto> supplierDtoList = filterSupplierEntity(list);
//执行
implement(supplierDtoList);
} catch (Exception e) {
@ -146,8 +149,10 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
Assert.notNull(code, "code不能为空");
try {
OfsSupplierDto supplierEntity = new OfsSupplierDto();
supplierEntity.setCompanyCode(code);
//TODO ofs查询供应商信息
supplierEntity.setBizCode(code);
supplierEntity.setClientCode("LETS");
supplierEntity.setCompanyCode("LETS");
supplierEntity.setPageNo("1");
List<OfsSupplierDto> list = queryfromofs(supplierEntity);
//过滤数据
@ -165,16 +170,17 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
*/
public void startImplement(String startTime, String endTime) {
try {
Date business_start = DateUtil.parse(startTime);
Date business_end = DateUtil.parse(endTime);
String start = DateUtil.format(business_start, "yyyy-MM-dd") + " 00:00:00";
String end = DateUtil.format(business_end, "yyyy-MM-dd") + " 23:59:59";
OfsSupplierDto shopEntity = new OfsSupplierDto();
shopEntity.setLastUpdated_start(start);
shopEntity.setLastUpdated_end(end);
//TODO ofs查询供应商信息
OfsSupplierDto supplierDto = new OfsSupplierDto();
supplierDto.setLastUpdated_start(startTime);
supplierDto.setLastUpdated_end(endTime);
supplierDto.setClientCode("LETS");
supplierDto.setCompanyCode("LETS");
supplierDto.setPageNo("1");
List<OfsSupplierDto> queryfromofs = queryfromofs(supplierDto);
//过滤数据
List<OfsSupplierDto> supplierDtoList = filterSupplierEntity(queryfromofs);
//执行
implement(supplierDtoList);
} catch (Exception e) {
logger.error("丽知OFS供应商档案--->U8C客商档案,startImplement(String startTime, String endTime)方法报错:", e);
}
@ -195,13 +201,7 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
// parentvo.setPk_areacl("");
parentvo.setCustname(supplierEntity.getName());
parentvo.setCustshortname(supplierEntity.getName());
parentvo.setCustcode(supplierEntity.getCompanyCode());
//设置还未分配公司
// parentvo.setDef10("N");
// //设置还未同步到管理档案
// parentvo.setDef11("N");
parentvo.setCustprop("1");
CustdocEntityDto.setParentvo(parentvo);
// 同步u8c
HashMap<String, Object> param = new HashMap<>();
@ -269,7 +269,7 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
boolean isExis = true;
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
integrationTaskLivingDetailsEntity.setRootAppPk(ofsSupplierDto.getBizCode());
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y_H);
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y);
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
List<IntegrationTaskLivingDetailsEntity> integrationTaskLivingDetailsEntities = iIntegrationTaskLivingDetailsDao.query(integrationTaskLivingDetailsEntity);
if (integrationTaskLivingDetailsEntities == null || integrationTaskLivingDetailsEntities.size() == 0) {
@ -286,7 +286,7 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
public List<OfsSupplierDto> queryfromofs(OfsSupplierDto supplierEntity) {
InterfaceParamByU8CApiDto interfaceParamDto = new InterfaceParamByU8CApiDto();
interfaceParamDto.setApi("ofs.store.search");
interfaceParamDto.setApi("ofs.vendor.search");
interfaceParamDto.setData(JSON.toJSONString(supplierEntity));
try {
OfsSupplierReturnMessageDto unified = (OfsSupplierReturnMessageDto) ofsUnifiedService.unifiedByU8CApi(interfaceParamDto);

View File

@ -1,8 +1,9 @@
package com.hzya.frame.plugin.lets.resultvo;
import com.hzya.frame.plugin.lets.ofs.entity.ShopEntity;
import com.hzya.frame.ttxofs.basics.ReturnMessageBasics;
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto;
import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OfsShopDto;
import java.util.List;
@ -14,13 +15,13 @@ import java.util.List;
* @Description: TODO
*/
public class ShopReturnMessageDto extends ReturnMessageBasics {
private List<ShopEntity> data;
private List<OfsShopDto> data;
public List<ShopEntity> getData() {
public List<OfsShopDto> getData() {
return data;
}
public void setData(List<ShopEntity> data) {
public void setData(List<OfsShopDto> data) {
this.data = data;
}
}

View File

@ -1,5 +1,7 @@
package com.hzya.frame.plugin.lets.plugin.base;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.hzya.frame.WebappApplication;
import com.hzya.frame.plugin.lets.constant.ProfilesActiveConstant;
@ -15,6 +17,7 @@ import com.hzya.frame.ttxofs.dto.InterfaceParamByU8CApiDto;
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.dto.ofsBaseSearch.OfsSupplierDto;
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
import org.checkerframework.checker.units.qual.C;
import org.junit.Test;
@ -24,6 +27,7 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@ -41,6 +45,8 @@ public class ShopTest {
@Autowired
private ShopPluginInitializer shopPluginInitializer;
@Autowired
private SupplierPluginInitializer supplierPluginInitializer;
@Autowired
private OfsUnifiedService ofsUnifiedService;
@Autowired
private PushDataByU8cUtil pushDataByU8cUtil;
@ -52,11 +58,20 @@ public class ShopTest {
@Test
public void t00() {
// shopPluginInitializer.startImplement();
// supplierPluginInitializer.startImplement();
//
// ShopEntity shopEntity = new ShopEntity();
// OfsShopDto shopEntity = new OfsShopDto();
//// shopEntity.setLastUpdated_start("2021-08-01 00:00:00");
// shopEntity.setPageNo("1");
// shopEntity.setClientCode("LETS");
//// Date currentDate = new Date();
//// Date startTime = DateUtil.offset(currentDate, DateField.MINUTE, -10);
//// Date endTime = DateUtil.offset(currentDate, DateField.MINUTE, -2);
//// String startTimeStr = DateUtil.format(startTime, "yyyy-MM-dd HH:mm:ss");
//// String endTimeStr = DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss");
//// shopEntity.setLastUpdated_start("2024-03-10 16:06:57");
//// shopEntity.setLastUpdated_end("2024-03-12 16:06:57");
// shopEntity.setBizCode("hzz");
// InterfaceParamByU8CApiDto interfaceParamDto = new InterfaceParamByU8CApiDto();
// interfaceParamDto.setApi("ofs.store.search");
// interfaceParamDto.setData(JSON.toJSONString(shopEntity));
@ -69,6 +84,29 @@ public class ShopTest {
// List<OfsShopDto> data = unified.getData();
// System.out.println("data = " + data);
OfsSupplierDto shopEntity = new OfsSupplierDto();
// shopEntity.setLastUpdated_start("2021-08-01 00:00:00");
shopEntity.setPageNo("1");
shopEntity.setClientCode("LETS");
shopEntity.setCompanyCode("LETS");
shopEntity.setBizCode("983");
Date currentDate = new Date();
// shopEntity.setLastUpdated_start("2023-07-27 16:06:57");
// shopEntity.setLastUpdated_end("2023-07-28 16:06:57");
InterfaceParamByU8CApiDto interfaceParamDto = new InterfaceParamByU8CApiDto();
interfaceParamDto.setApi("ofs.vendor.search");
interfaceParamDto.setData(JSON.toJSONString(shopEntity));
OfsShopReturnMessageDto unified = null;
try {
unified = (OfsShopReturnMessageDto) ofsUnifiedService.unifiedByU8CApi(interfaceParamDto);
} catch (Exception e) {
throw new RuntimeException(e);
}
List<OfsShopDto> data = unified.getData();
System.out.println("data = " + data);
// SupplierEntity supplierEntity = new SupplierEntity();
// supplierEntity.setPageNo("1");
// supplierEntity.setClientCode("LETS");
@ -78,8 +116,6 @@ public class ShopTest {
custdocAutoAllotPluginInitializer.start();
//
// System.out.println(unified);
// } catch (Exception e) {

View File

@ -3,6 +3,7 @@ package com.hzya.frame.ttxofs.basics;
import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OFSSKUClassSearchResponse;
import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OFSSKUSearchResponse;
import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OfsShopReturnMessageDto;
import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OfsSupplierReturnMessageDto;
import com.hzya.frame.ttxofs.dto.ofsTransferOrderSearch.OFSTranseferOrderSearchResponse;
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.SaleOutReturnMessageDto;
import com.hzya.frame.ttxofs.dto.ofssalesordersearch.SaleOrderMessageDto;
@ -32,6 +33,7 @@ public class ApiDtoCacheMap {
apiDtoCacheMap.put("ofs.transferOrder.search", new OFSTranseferOrderSearchResponse());//调拨订单
apiDtoCacheMap.put("ofs.store.search", new OfsShopReturnMessageDto());//店铺查询
apiDtoCacheMap.put("ofs.vendor.search", new OfsSupplierReturnMessageDto());//店铺查询

View File

@ -12,26 +12,8 @@ import lombok.Data;
@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;
// 货主编码
@ -44,4 +26,8 @@ public class OfsShopDto {
private String lastUpdated;
private String lastUpdatedBy;
private String pageNo;
private String pageSize;
private String lastUpdated_start;
private String lastUpdated_end;
}

View File

@ -12,32 +12,31 @@ import lombok.Data;
@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 bizCode;
//供应商名称
private String name;
//组织
private String clientCode;
//货主编码
private String companyCode;
private String lastUpdated_start;
private String lastUpdated_end;
private String bankAccount;
private String openBank;
private String payeeName;
private String payeePhone;
private String payeeAddress;
private String stauts;
private String created;
private String createdBy;
private String pageNo;
private String pageSize;
private String lastUpdated;
private String lastUpdatedBy;
private String lastUpdated_start;
private String lastUpdated_end;
}