更改日志
This commit is contained in:
parent
d69e1709eb
commit
5200655f93
|
@ -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
|
||||||
|
@ -137,7 +138,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 +157,88 @@ 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<>();
|
||||||
|
List<BdCorpEntity> bdCorpEntities=null;
|
||||||
|
//查询公司档案
|
||||||
|
try {
|
||||||
|
String corpresponse = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("bdcorpQuery"), "{}");
|
||||||
|
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 custDocAssginVo = new CustDocAssginVo();
|
||||||
custDocAssginVo.setPk_cubasdoc(pkCubasdoc);
|
custDocAssginVo.setPk_cubasdoc(custcode);
|
||||||
custDocAssginVo.setAssignallcorps("Y");
|
//TODO
|
||||||
custDocAssginVo.setCustprop("2");
|
custDocAssginVo.setCustprop(custprop);
|
||||||
|
custDocAssginVo.setPk_corp(bdCorpEntity.getUnitcode());
|
||||||
assginvolist.add(custDocAssginVo);
|
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);
|
||||||
|
String response = "";
|
||||||
System.out.println(response);
|
System.out.println(response);
|
||||||
boolean isSuccess = false;
|
boolean isSuccess = false;
|
||||||
if (response != null && !"".equals(response)) {
|
if (response != null && !"".equals(response)) {
|
||||||
|
@ -214,8 +259,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 +274,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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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查询店铺信息
|
//TODO ofs查询店铺信息
|
||||||
shopEntity.setCreated_start(startTimeStr);
|
// shopEntity.setLastUpdated_start(startTimeStr);
|
||||||
shopEntity.setCreated_end(endTimeStr);
|
// shopEntity.setLastUpdated_end(endTimeStr);
|
||||||
|
|
||||||
// List<ShopEntity> query = shopDao.query(shopEntity);
|
// List<ShopEntity> query = shopDao.query(shopEntity);
|
||||||
List<ShopEntity> query = new ArrayList<>();
|
List<OfsShopDto> list = queryfromofs(shopEntity);
|
||||||
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue