丽知:1、供应商同步修改。
This commit is contained in:
parent
4fff5ef07d
commit
fa48a7f682
|
@ -3,6 +3,7 @@ package com.hzya.frame.plugin.lets.plugin.base;
|
||||||
import cn.hutool.core.date.DateField;
|
import cn.hutool.core.date.DateField;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.lang.Assert;
|
import cn.hutool.core.lang.Assert;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.hzya.frame.base.PluginBaseEntity;
|
import com.hzya.frame.base.PluginBaseEntity;
|
||||||
|
@ -10,12 +11,15 @@ 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.BdCubasdocEntity;
|
||||||
import com.hzya.frame.plugin.lets.queryvo.BankVo;
|
import com.hzya.frame.plugin.lets.queryvo.BankVo;
|
||||||
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;
|
||||||
|
import com.hzya.frame.plugin.lets.u8cdto.ArapDjzb;
|
||||||
import com.hzya.frame.plugin.lets.u8cdto.CustdocEntityDto;
|
import com.hzya.frame.plugin.lets.u8cdto.CustdocEntityDto;
|
||||||
import com.hzya.frame.plugin.lets.util.PushDataByU8cUtil;
|
import com.hzya.frame.plugin.lets.util.PushDataByU8cUtil;
|
||||||
|
import com.hzya.frame.plugin.lets.util.QueryU8CEntityUtil;
|
||||||
import com.hzya.frame.plugin.lets.util.SaveOrUpdateBusinessLogUtil;
|
import com.hzya.frame.plugin.lets.util.SaveOrUpdateBusinessLogUtil;
|
||||||
import com.hzya.frame.plugin.lets.util.pushData.Attribute;
|
import com.hzya.frame.plugin.lets.util.pushData.Attribute;
|
||||||
import com.hzya.frame.plugin.lets.util.pushData.PushU8CByApiCode;
|
import com.hzya.frame.plugin.lets.util.pushData.PushU8CByApiCode;
|
||||||
|
@ -34,11 +38,9 @@ import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.locks.ReentrantLock;
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author
|
* @Author
|
||||||
|
@ -147,14 +149,18 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
|
||||||
String endTimeStr = DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss");
|
String endTimeStr = DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
OfsSupplierDto supplierEntity = new OfsSupplierDto();
|
OfsSupplierDto supplierEntity = new OfsSupplierDto();
|
||||||
supplierEntity.setClientCode("LETS");
|
|
||||||
supplierEntity.setPageNo("1");
|
|
||||||
supplierEntity.setLastUpdated_start(startTimeStr);
|
supplierEntity.setLastUpdated_start(startTimeStr);
|
||||||
supplierEntity.setLastUpdated_end(endTimeStr);
|
supplierEntity.setLastUpdated_end(endTimeStr);
|
||||||
|
|
||||||
List<OfsSupplierDto> list = queryfromofs(supplierEntity);
|
List<OfsSupplierDto> list = queryfromofs(supplierEntity);
|
||||||
|
if (list == null || list.size() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
//过滤数据
|
//过滤数据
|
||||||
List<OfsSupplierDto> supplierDtoList = filterSupplierEntity(list);
|
List<OfsSupplierDto> supplierDtoList = filterSupplierEntity(list);
|
||||||
|
if (supplierDtoList == null || supplierDtoList.size() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
//执行
|
//执行
|
||||||
implement(supplierDtoList);
|
implement(supplierDtoList);
|
||||||
|
|
||||||
|
@ -168,16 +174,21 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
|
||||||
* 按编码名称
|
* 按编码名称
|
||||||
*/
|
*/
|
||||||
public void startImplement(String code) {
|
public void startImplement(String code) {
|
||||||
|
String[] split = code.split("_");
|
||||||
Assert.notNull(code, "code不能为空");
|
Assert.notNull(code, "code不能为空");
|
||||||
try {
|
try {
|
||||||
OfsSupplierDto supplierEntity = new OfsSupplierDto();
|
OfsSupplierDto supplierEntity = new OfsSupplierDto();
|
||||||
supplierEntity.setBizCode(code);
|
supplierEntity.setBizCode(split[0]);
|
||||||
supplierEntity.setClientCode("LETS");
|
|
||||||
supplierEntity.setPageNo("1");
|
|
||||||
|
|
||||||
List<OfsSupplierDto> list = queryfromofs(supplierEntity);
|
List<OfsSupplierDto> list = queryfromofs(supplierEntity);
|
||||||
|
if (list == null || list.size() == 0) {
|
||||||
|
Assert.state(false, "根据编码:{},未查询到ofs供应商档案。", code);
|
||||||
|
}
|
||||||
//过滤数据
|
//过滤数据
|
||||||
List<OfsSupplierDto> supplierDtoList = filterSupplierEntity(list);
|
List<OfsSupplierDto> supplierDtoList = filterSupplierEntity(list);
|
||||||
|
if (supplierDtoList == null || supplierDtoList.size() == 0) {
|
||||||
|
Assert.state(false, "根据编码:{},已被成功日志过滤。", code);
|
||||||
|
|
||||||
|
}
|
||||||
//执行
|
//执行
|
||||||
implement(supplierDtoList);
|
implement(supplierDtoList);
|
||||||
|
|
||||||
|
@ -198,11 +209,15 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
|
||||||
OfsSupplierDto supplierDto = new OfsSupplierDto();
|
OfsSupplierDto supplierDto = new OfsSupplierDto();
|
||||||
supplierDto.setLastUpdated_start(start);
|
supplierDto.setLastUpdated_start(start);
|
||||||
supplierDto.setLastUpdated_end(end);
|
supplierDto.setLastUpdated_end(end);
|
||||||
supplierDto.setClientCode("LETS");
|
|
||||||
supplierDto.setPageNo("1");
|
|
||||||
List<OfsSupplierDto> queryfromofs = queryfromofs(supplierDto);
|
List<OfsSupplierDto> queryfromofs = queryfromofs(supplierDto);
|
||||||
|
if (queryfromofs == null || queryfromofs.size() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
//过滤数据
|
//过滤数据
|
||||||
List<OfsSupplierDto> supplierDtoList = filterSupplierEntity(queryfromofs);
|
List<OfsSupplierDto> supplierDtoList = filterSupplierEntity(queryfromofs);
|
||||||
|
if (supplierDtoList == null || supplierDtoList.size() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
//执行
|
//执行
|
||||||
implement(supplierDtoList);
|
implement(supplierDtoList);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -210,88 +225,13 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void implement(List<OfsSupplierDto> shopEntityList) {
|
/**
|
||||||
|
* 过滤日志
|
||||||
Assert.notNull(shopEntityList, "shopEntityList不能为空");
|
* 编码_最后修改日期
|
||||||
//业务时间
|
*
|
||||||
String businessFormat = null;
|
* @param list
|
||||||
for (OfsSupplierDto supplierEntity : shopEntityList) {
|
* @return
|
||||||
businessFormat = supplierEntity.getLastUpdated();
|
*/
|
||||||
CustdocEntityDto parentvo = new CustdocEntityDto();
|
|
||||||
BankVo bankVo = new BankVo();
|
|
||||||
CustdocRequestVo CustdocEntityDto = new CustdocRequestVo();
|
|
||||||
try {
|
|
||||||
//设置parentvo
|
|
||||||
parentvo.setCustname(supplierEntity.getName());
|
|
||||||
parentvo.setCustshortname(supplierEntity.getName());
|
|
||||||
|
|
||||||
parentvo.setPk_areacl("GG");//20241031:妮妮姐:供应商是BB。202411081502:妮妮姐:供应商是GG
|
|
||||||
|
|
||||||
parentvo.setDef1(supplierEntity.getBizCode());
|
|
||||||
|
|
||||||
CustdocEntityDto.setParentvo(parentvo);
|
|
||||||
|
|
||||||
// 同步u8c
|
|
||||||
HashMap<String, Object> param = new HashMap<>();
|
|
||||||
param.put("cbdocvo", CustdocEntityDto);
|
|
||||||
|
|
||||||
String jsonString = JSONObject.toJSONString(param);
|
|
||||||
|
|
||||||
|
|
||||||
// String response = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("custdocSave"), jsonString);
|
|
||||||
ZTResult ztResult = pushU8CByApiCode.pushByCode(OverallConstant.getOverAllValue("custdocSaveCode"), jsonString);
|
|
||||||
//两层判断,一层中台转发,一层u8c返回
|
|
||||||
Attribute attribute = ztResult.getAttribute();
|
|
||||||
if ("false".equals(ztResult.getFlag())) {
|
|
||||||
//转发失败
|
|
||||||
Assert.state(false, "丽知:OFS供应商档案分类--->U8C客商档案分类.中台转发失败,失败原因:{}", attribute.getErrormsg());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
String taskNumber = null;
|
|
||||||
boolean isSuccess = false;
|
|
||||||
if ("success".equals(attribute.getStatus())) {
|
|
||||||
isSuccess = true;
|
|
||||||
// CbdocResultVo cbdocResultVo = JSONObject.parseObject(attribute.getData(), CbdocResultVo.class);
|
|
||||||
// taskNumber = cbdocResultVo.getTaskNumber();
|
|
||||||
// String data = cbdocResultVo.getData();
|
|
||||||
}
|
|
||||||
if (!isSuccess) {
|
|
||||||
Assert.state(false, "推送U8C,原因:{} 接口入参:{}", attribute.getErrormsg(), jsonString);
|
|
||||||
}
|
|
||||||
// 根据返回结果记录日志
|
|
||||||
//成功
|
|
||||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
|
||||||
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y);
|
|
||||||
integrationTaskLivingDetailsEntity.setRootAppNewData(jsonString);
|
|
||||||
integrationTaskLivingDetailsEntity.setNewTransmitInfo(attribute.getData());
|
|
||||||
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
|
|
||||||
integrationTaskLivingDetailsEntity.setBusinessDate(businessFormat);
|
|
||||||
integrationTaskLivingDetailsEntity.setRootAppPk(supplierEntity.getBizCode());
|
|
||||||
integrationTaskLivingDetailsEntity.setRootAppBill(supplierEntity.getBizCode());
|
|
||||||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
|
||||||
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("丽知:OFS供应商档案--->U8C客商档案,implement()方法报错:", e);
|
|
||||||
String ErrMessage = e.getMessage();
|
|
||||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
|
||||||
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N);
|
|
||||||
integrationTaskLivingDetailsEntity.setRootAppNewData(JSONObject.toJSONString(CustdocEntityDto));
|
|
||||||
integrationTaskLivingDetailsEntity.setNewTransmitInfo(ErrMessage);
|
|
||||||
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
|
|
||||||
integrationTaskLivingDetailsEntity.setBusinessDate(businessFormat);
|
|
||||||
integrationTaskLivingDetailsEntity.setRootAppPk(supplierEntity.getBizCode());
|
|
||||||
integrationTaskLivingDetailsEntity.setRootAppBill(supplierEntity.getBizCode());
|
|
||||||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
|
||||||
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//过滤数据
|
|
||||||
public List<OfsSupplierDto> filterSupplierEntity(List<OfsSupplierDto> list) {
|
public List<OfsSupplierDto> filterSupplierEntity(List<OfsSupplierDto> list) {
|
||||||
|
|
||||||
Assert.notNull(list, "不能为空!");
|
Assert.notNull(list, "不能为空!");
|
||||||
|
@ -304,7 +244,7 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
|
||||||
if (ofsSupplierDto.getBizCode() != null && !"".equals(ofsSupplierDto.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(ofsSupplierDto.getBizCode());
|
integrationTaskLivingDetailsEntity.setRootAppPk(ofsSupplierDto.getBizCode() + "_" + ofsSupplierDto.getLastUpdated());
|
||||||
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y);
|
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y);
|
||||||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||||
List<IntegrationTaskLivingDetailsEntity> integrationTaskLivingDetailsEntities = iIntegrationTaskLivingDetailsDao.query(integrationTaskLivingDetailsEntity);
|
List<IntegrationTaskLivingDetailsEntity> integrationTaskLivingDetailsEntities = iIntegrationTaskLivingDetailsDao.query(integrationTaskLivingDetailsEntity);
|
||||||
|
@ -320,17 +260,151 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
|
||||||
return supplierDtoList;
|
return supplierDtoList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<OfsSupplierDto> queryfromofs(OfsSupplierDto supplierEntity) {
|
/**
|
||||||
|
* 根据名称分组,编码用逗号隔开
|
||||||
|
*
|
||||||
|
* @param shopEntityList
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private QueryU8CEntityUtil queryU8CEntityUtil;
|
||||||
|
|
||||||
|
public void implement(List<OfsSupplierDto> shopEntityList) {
|
||||||
|
//根据名称分组
|
||||||
|
Map<String, List<OfsSupplierDto>> collectByName = shopEntityList.stream().collect(Collectors.groupingBy(index -> index.getName()));
|
||||||
|
//根据名称查询u8c客商,有则更新def1,无则新增
|
||||||
|
collectByName.forEach((k, v) -> {
|
||||||
|
CustdocRequestVo res_custdoc = null;
|
||||||
|
String pk_cubasdoc = null;
|
||||||
|
String jsonString = null;
|
||||||
|
String def1 = null;
|
||||||
|
String url = null;
|
||||||
|
String custName = k;//客商名称
|
||||||
|
try {
|
||||||
|
//查询u8c客商基本档案
|
||||||
|
BdCubasdocEntity bdCubasdocEntity = queryU8CEntityUtil.queryBdCubasdocByName(custName);
|
||||||
|
if (bdCubasdocEntity == null) {
|
||||||
|
//新增
|
||||||
|
url = OverallConstant.getOverAllValue("custdocSaveCode");
|
||||||
|
} else {
|
||||||
|
//更新
|
||||||
|
url = OverallConstant.getOverAllValue("custdocUpdate");
|
||||||
|
pk_cubasdoc = bdCubasdocEntity.getPkCubasdoc();
|
||||||
|
}
|
||||||
|
|
||||||
|
//拼接def1,如果存在则跳过转换,如果不存在则新增
|
||||||
|
// def1 = v.stream().map(OfsSupplierDto::getBizCode).collect(Collectors.joining(","));
|
||||||
|
List<String> def1_new = v.stream().map(OfsSupplierDto::getBizCode).collect(Collectors.toList());
|
||||||
|
String def1_old = bdCubasdocEntity.getDef1();
|
||||||
|
String[] def1_split_old = def1_old.split(",");
|
||||||
|
// 将数组转换为列表
|
||||||
|
List<String> def1_list_old = Arrays.asList(def1_split_old);//u8c里已有的def1
|
||||||
|
for (String s_new : def1_new) {
|
||||||
|
if (!def1_list_old.contains(s_new)) {
|
||||||
|
def1_list_old.add(s_new);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
def1 = String.join(",", def1_list_old);
|
||||||
|
|
||||||
|
CustdocEntityDto parentvo = new CustdocEntityDto();
|
||||||
|
CustdocRequestVo CustdocEntityDto = new CustdocRequestVo();
|
||||||
|
if (pk_cubasdoc != null) {
|
||||||
|
parentvo.setPk_cubasdoc(pk_cubasdoc);
|
||||||
|
}
|
||||||
|
parentvo.setCustname(k);
|
||||||
|
parentvo.setCustshortname(k);
|
||||||
|
parentvo.setPk_areacl("GG");//20241031:妮妮姐:供应商是BB。202411081502:妮妮姐:供应商是GG
|
||||||
|
parentvo.setDef1(def1);
|
||||||
|
|
||||||
|
CustdocEntityDto.setParentvo(parentvo);
|
||||||
|
HashMap<String, Object> param = new HashMap<>();
|
||||||
|
param.put("cbdocvo", CustdocEntityDto);
|
||||||
|
jsonString = JSONObject.toJSONString(param);
|
||||||
|
|
||||||
|
ZTResult ztResult = pushU8CByApiCode.pushByCode(url, jsonString);
|
||||||
|
Attribute attribute = ztResult.getAttribute();
|
||||||
|
if ("false".equals(ztResult.getFlag())) {
|
||||||
|
//转发失败
|
||||||
|
Assert.state(false, "丽知:OFS供应商档案分类--->U8C客商档案分类.中台转发失败,失败原因:{}", attribute.getErrormsg());
|
||||||
|
}
|
||||||
|
boolean isSuccess = false;
|
||||||
|
if ("success".equals(attribute.getStatus())) {
|
||||||
|
isSuccess = true;
|
||||||
|
CbdocResultVo cbdocResultVo = JSONObject.parseObject(attribute.getData(), CbdocResultVo.class);
|
||||||
|
String data = cbdocResultVo.getData();
|
||||||
|
List<CustdocRequestVo> custdocList = JSONUtil.toList(data, CustdocRequestVo.class);
|
||||||
|
res_custdoc = custdocList.get(0);
|
||||||
|
}
|
||||||
|
if (!isSuccess) {
|
||||||
|
Assert.state(false, "推送U8C,原因:{} 接口入参:{}", attribute.getErrormsg(), jsonString);
|
||||||
|
}
|
||||||
|
//成功
|
||||||
|
// 根据返回结果记录日志
|
||||||
|
for (OfsSupplierDto ofsSupplierDto : v) {
|
||||||
|
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||||
|
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y);
|
||||||
|
integrationTaskLivingDetailsEntity.setRootAppNewData(jsonString);
|
||||||
|
integrationTaskLivingDetailsEntity.setNewTransmitInfo(attribute.getData());
|
||||||
|
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
|
||||||
|
integrationTaskLivingDetailsEntity.setBusinessDate(ofsSupplierDto.getLastUpdated());
|
||||||
|
integrationTaskLivingDetailsEntity.setRootAppPk(ofsSupplierDto.getBizCode() + "_" + ofsSupplierDto.getLastUpdated());
|
||||||
|
integrationTaskLivingDetailsEntity.setRootAppBill(ofsSupplierDto.getBizCode());
|
||||||
|
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||||
|
integrationTaskLivingDetailsEntity.setNewSystemNumber(res_custdoc.getParentvo().getCustcode());
|
||||||
|
integrationTaskLivingDetailsEntity.setNewSystemPrimary(res_custdoc.getParentvo().getPk_cubasdoc());
|
||||||
|
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("ofs供应商档案同步报错:{}", e);
|
||||||
|
String ErrMessage = e.getMessage();
|
||||||
|
for (OfsSupplierDto ofsSupplierDto : v) {
|
||||||
|
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||||
|
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N);
|
||||||
|
integrationTaskLivingDetailsEntity.setRootAppNewData(jsonString);
|
||||||
|
integrationTaskLivingDetailsEntity.setNewTransmitInfo(ErrMessage);
|
||||||
|
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
|
||||||
|
integrationTaskLivingDetailsEntity.setBusinessDate(ofsSupplierDto.getLastUpdated());
|
||||||
|
integrationTaskLivingDetailsEntity.setRootAppPk(ofsSupplierDto.getBizCode() + "_" + ofsSupplierDto.getLastUpdated());
|
||||||
|
integrationTaskLivingDetailsEntity.setRootAppBill(ofsSupplierDto.getBizCode());
|
||||||
|
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||||
|
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<OfsSupplierDto> queryfromofs(OfsSupplierDto supplierEntity) throws Exception {
|
||||||
|
Long pageNo = 1L;
|
||||||
|
|
||||||
|
List<OfsSupplierDto> all = new ArrayList<>();
|
||||||
|
|
||||||
InterfaceParamByU8CApiDto interfaceParamDto = new InterfaceParamByU8CApiDto();
|
InterfaceParamByU8CApiDto interfaceParamDto = new InterfaceParamByU8CApiDto();
|
||||||
interfaceParamDto.setApi("ofs.vendor.search");
|
interfaceParamDto.setApi("ofs.vendor.search");
|
||||||
|
supplierEntity.setClientCode("LETS");
|
||||||
|
supplierEntity.setPageNo("1");
|
||||||
|
supplierEntity.setPageNo(String.valueOf(pageNo));
|
||||||
|
supplierEntity.setPageSize("500");
|
||||||
interfaceParamDto.setData(JSON.toJSONString(supplierEntity));
|
interfaceParamDto.setData(JSON.toJSONString(supplierEntity));
|
||||||
try {
|
|
||||||
OfsSupplierReturnMessageDto unified = (OfsSupplierReturnMessageDto) ofsUnifiedService.unifiedByU8CApi(interfaceParamDto);
|
OfsSupplierReturnMessageDto unified = (OfsSupplierReturnMessageDto) ofsUnifiedService.unifiedByU8CApi(interfaceParamDto);
|
||||||
List<OfsSupplierDto> list = unified.getData();
|
if (unified.getData() == null || unified.getData().size() == 0) {
|
||||||
return list;
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("丽知:OFS供应商档案查询失败,queryfromofs()方法报错:", e);
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int count = unified.getData().size();
|
||||||
|
|
||||||
|
while (count >= 500) {//>=500,可能还有下一页。
|
||||||
|
//还有下一页
|
||||||
|
pageNo++;
|
||||||
|
supplierEntity.setPageNo(String.valueOf(pageNo));
|
||||||
|
interfaceParamDto.setData(JSON.toJSONString(supplierEntity));
|
||||||
|
OfsSupplierReturnMessageDto unified1 = (OfsSupplierReturnMessageDto) ofsUnifiedService.unifiedByU8CApi(interfaceParamDto);
|
||||||
|
all.addAll(unified1.getData());
|
||||||
|
count = unified1.getData().size();
|
||||||
|
|
||||||
|
}
|
||||||
|
return all;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -425,6 +425,37 @@ public class QueryU8CEntityUtil {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IBdCubasdocDao iBdCubasdocDao;
|
private IBdCubasdocDao iBdCubasdocDao;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据客商名称查询客商基本档案
|
||||||
|
*/
|
||||||
|
public BdCubasdocEntity queryBdCubasdocByName(String name){
|
||||||
|
BdCubasdocEntity entity = new BdCubasdocEntity();
|
||||||
|
entity.setCustname(name);
|
||||||
|
entity.setDr(0L);
|
||||||
|
entity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE);
|
||||||
|
List<BdCubasdocEntity> query = iBdCubasdocDao.query(entity);
|
||||||
|
if (query.size() >= 1) {
|
||||||
|
return query.get(0);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 根据客商编码查询客商基本档案
|
||||||
|
*/
|
||||||
|
public BdCubasdocEntity queryBdCubasdocByCode(String code){
|
||||||
|
BdCubasdocEntity entity = new BdCubasdocEntity();
|
||||||
|
entity.setCustcode(code);
|
||||||
|
entity.setDr(0L);
|
||||||
|
entity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE);
|
||||||
|
List<BdCubasdocEntity> query = iBdCubasdocDao.query(entity);
|
||||||
|
if (query.size() >= 1) {
|
||||||
|
return query.get(0);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据def1查询客商基本档案
|
* 根据def1查询客商基本档案
|
||||||
|
|
Loading…
Reference in New Issue