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

This commit is contained in:
liuy 2024-08-19 10:15:48 +08:00
commit f2f63867ba
12 changed files with 246 additions and 561 deletions

View File

@ -41,7 +41,9 @@ public class OverallConstant {
prodOverPublic.put("approveqz", "/u8cloud/api/to/transorder/saveapprove");//调拨订单保存即审批 prodOverPublic.put("approveqz", "/u8cloud/api/to/transorder/saveapprove");//调拨订单保存即审批
//其他出入库 //其他出入库
prodOverPublic.put("otherinqzCode", "8000370007");//库存其他入库保存即签字
prodOverPublic.put("otherinqz", "/u8cloud/api/ic/otherin/save/sign");//库存其他入库保存即签字 prodOverPublic.put("otherinqz", "/u8cloud/api/ic/otherin/save/sign");//库存其他入库保存即签字
prodOverPublic.put("otheroutqzCode", "8000370008");//库存其他出库保存即签字
prodOverPublic.put("otheroutqz", "/u8cloud/api/ic/otherout/save/sign");//库存其他出库保存即签字 prodOverPublic.put("otheroutqz", "/u8cloud/api/ic/otherout/save/sign");//库存其他出库保存即签字
@ -58,12 +60,12 @@ public class OverallConstant {
} }
private static void loadDev() { private static void loadDev() {
devOverAll.put("u8cApiUrl", "http://39.170.109.90:9099");//测试U8C
devOverAll.put("u8cApiUsercodePK", "admin"); devOverAll.put("u8cApiUsercodePK", "admin");
devOverAll.put("u8cApiPasswordPK", "21232f297a57a5a743894a0e4a801fc3"); devOverAll.put("u8cApiPasswordPK", "21232f297a57a5a743894a0e4a801fc3");
devOverAll.put("u8cApiTrantypePK", "pk"); devOverAll.put("u8cApiTrantypePK", "pk");
devOverAll.put("u8cApiSystemPK", "lz"); devOverAll.put("u8cApiSystemPK", "lz");
devOverAll.put("u8cApiServiceNamePK", "http://39.170.109.90:9099");//测试U8C
devOverAll.put("u8cApiNeedStackTracePK", "Y"); devOverAll.put("u8cApiNeedStackTracePK", "Y");
devOverAll.put("u8cApiZdrPK", "0001A210000000000GVS");//单据制单人---测试环境郑一凡 devOverAll.put("u8cApiZdrPK", "0001A210000000000GVS");//单据制单人---测试环境郑一凡
@ -71,7 +73,6 @@ public class OverallConstant {
devOverAll.put("u8cApiPasswordCode", "e00cf25ad42683b3df678c61f42c6bda"); devOverAll.put("u8cApiPasswordCode", "e00cf25ad42683b3df678c61f42c6bda");
devOverAll.put("u8cApiTrantypeCode", "code"); devOverAll.put("u8cApiTrantypeCode", "code");
devOverAll.put("u8cApiSystemCode", "lz1"); devOverAll.put("u8cApiSystemCode", "lz1");
devOverAll.put("u8cApiServiceNameCode", "http://39.170.109.90:9099");//测试U8C
devOverAll.put("u8cApiNeedStackTraceCode", "Y"); devOverAll.put("u8cApiNeedStackTraceCode", "Y");
devOverAll.put("u8cApiZdrCode", "15932295350");//单据制单人---测试环境郑一凡 devOverAll.put("u8cApiZdrCode", "15932295350");//单据制单人---测试环境郑一凡

View File

@ -14,9 +14,13 @@ 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.u8cdto.BillVO; import com.hzya.frame.plugin.lets.u8cdto.BillVO;
import com.hzya.frame.plugin.lets.u8cdto.GeneralBillVO_4ADto; 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.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.plugin.lets.util.pushData.Attribute;
import com.hzya.frame.plugin.lets.util.pushData.PushU8CByApiCode;
import com.hzya.frame.plugin.lets.util.pushData.ZTResult;
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.InterfaceParamDto; import com.hzya.frame.ttxofs.dto.InterfaceParamDto;
@ -73,6 +77,8 @@ public class AdjustInPluginInitializer extends PluginBaseEntity {
@Autowired @Autowired
private PushDataByU8cUtil pushDataByU8cUtil; private PushDataByU8cUtil pushDataByU8cUtil;
@Autowired @Autowired
private PushU8CByApiCode pushU8CByApiCode;
@Autowired
private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil; private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil;
@Autowired @Autowired
@ -256,6 +262,7 @@ public class AdjustInPluginInitializer extends PluginBaseEntity {
/** /**
* 推送U8C其它入库单 * 推送U8C其它入库单
*
* @param filterStockinOrders * @param filterStockinOrders
*/ */
public void implement(List<StockinOrderSearchResponse.StockinOrder> filterStockinOrders) { public void implement(List<StockinOrderSearchResponse.StockinOrder> filterStockinOrders) {
@ -332,20 +339,26 @@ public class AdjustInPluginInitializer extends PluginBaseEntity {
mapStr = "{\"GeneralBillVO_4A\":[" + dataJson + "]}"; mapStr = "{\"GeneralBillVO_4A\":[" + dataJson + "]}";
//推送 //推送
response = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("otherinqz"), mapStr); // response = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("otherinqz"), mapStr);
System.out.println(response); ZTResult ztResult = pushU8CByApiCode.pushByCode(OverallConstant.getOverAllValue("otherinqzCode"), mapStr);
//两层判断,一层中台转发,一层u8c返回
if ("false".equals(ztResult.getFlag())) {
//转发失败
Assert.state(false, "丽知OFS调整入库--->U8C其它入库.中台转发失败,失败原因:{}", ztResult.getMsg());
}
Attribute attribute = ztResult.getAttribute();
System.out.println(attribute);
boolean isSuccess = false; boolean isSuccess = false;
String vbillcode = ""; String vbillcode = "";
if (response != null && !"".equals(response)) { if ("success".equals(attribute.getStatus())) {
ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class);
if ("success".equals(reusltStrDto.getStatus())) {
isSuccess = true; isSuccess = true;
String data = reusltStrDto.getData(); String data = attribute.getData();
GeneralBillVO_4ADto resGeneralBillVO = resultDataHandle(data); GeneralBillVO_4ADto resGeneralBillVO = resultDataHandle(data);
System.out.println(resGeneralBillVO); System.out.println(resGeneralBillVO);
vbillcode = resGeneralBillVO.getParentvo().getVbillcode(); vbillcode = resGeneralBillVO.getParentvo().getVbillcode();
} }
}
if (!isSuccess) { if (!isSuccess) {
Assert.state(false, "推送U8C--> 丽知OFS调整入库--->U8C其它入库 失败 接口返回结果:{} 接口入参:{}", response, mapStr); Assert.state(false, "推送U8C--> 丽知OFS调整入库--->U8C其它入库 失败 接口返回结果:{} 接口入参:{}", response, mapStr);
} }
@ -360,6 +373,7 @@ public class AdjustInPluginInitializer extends PluginBaseEntity {
integrationTaskLivingDetailsEntity.setRootAppPk(ofsCode); integrationTaskLivingDetailsEntity.setRootAppPk(ofsCode);
integrationTaskLivingDetailsEntity.setRootAppBill(ofsCode); integrationTaskLivingDetailsEntity.setRootAppBill(ofsCode);
integrationTaskLivingDetailsEntity.setRootAppBill(vbillcode); integrationTaskLivingDetailsEntity.setRootAppBill(vbillcode);
integrationTaskLivingDetailsEntity.setDef1(vbillcode);
integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);

View File

@ -18,6 +18,9 @@ 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;
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.PushU8CByApiCode;
import com.hzya.frame.plugin.lets.util.pushData.ZTResult;
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.InterfaceParamDto; import com.hzya.frame.ttxofs.dto.InterfaceParamDto;
@ -81,6 +84,8 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
@Autowired @Autowired
private PushDataByU8cUtil pushDataByU8cUtil; private PushDataByU8cUtil pushDataByU8cUtil;
@Autowired @Autowired
private PushU8CByApiCode pushU8CByApiCode;
@Autowired
private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil; private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil;
@Autowired @Autowired
@ -256,6 +261,7 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
/** /**
* 丽知OFS调整出库--->U8C其它出库 * 丽知OFS调整出库--->U8C其它出库
*
* @param filterStockoutOrders * @param filterStockoutOrders
*/ */
public void implement(List<StockoutOrderSearchResponse.StockoutOrder> filterStockoutOrders) { public void implement(List<StockoutOrderSearchResponse.StockoutOrder> filterStockoutOrders) {
@ -338,22 +344,28 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
generalBillVO_4I.setChildrenvo(childrenvo); generalBillVO_4I.setChildrenvo(childrenvo);
String dataJson = JSONUtil.toJsonStr(generalBillVO_4I); String dataJson = JSONUtil.toJsonStr(generalBillVO_4I);
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); ZTResult ztResult = pushU8CByApiCode.pushByCode(OverallConstant.getOverAllValue("otheroutqzCode"), mapStr);
//两层判断,一层中台转发,一层u8c返回
if ("false".equals(ztResult.getFlag())) {
//转发失败
Assert.state(false, "丽知OFS调整出库--->U8C其它出库.中台转发失败,失败原因:{}", ztResult.getMsg());
}
Attribute attribute = ztResult.getAttribute();
System.out.println(attribute);
boolean isSuccess = false; boolean isSuccess = false;
String vbillcode = ""; String vbillcode = "";
if (response != null && !"".equals(response)) { if ("success".equals(attribute.getStatus())) {
ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class);
if ("success".equals(reusltStrDto.getStatus())) {
isSuccess = true; isSuccess = true;
String data = reusltStrDto.getData(); String data = attribute.getData();
GeneralBillVO_4IDto resGeneralBillVO = resultDataHandle(data); GeneralBillVO_4IDto resGeneralBillVO = resultDataHandle(data);
System.out.println(resGeneralBillVO); System.out.println(resGeneralBillVO);
vbillcode = resGeneralBillVO.getParentvo().getVbillcode(); vbillcode = resGeneralBillVO.getParentvo().getVbillcode();
} }
}
if (!isSuccess) { if (!isSuccess) {
Assert.state(false, "推送U8C--> 丽知OFS调整入库--->U8C其它入库 失败 接口返回结果:{} 接口入参:{}", response, mapStr); Assert.state(false, "推送U8C--> 丽知OFS调整出库--->U8C其它出库 失败 接口返回结果:{} 接口入参:{}", response, mapStr);
} }
//成功 //成功
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
@ -363,8 +375,8 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
integrationTaskLivingDetailsEntity.setNewPushDate(new Date()); integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
integrationTaskLivingDetailsEntity.setBusinessDate(format); integrationTaskLivingDetailsEntity.setBusinessDate(format);
integrationTaskLivingDetailsEntity.setRootAppPk(ofsCode); integrationTaskLivingDetailsEntity.setRootAppPk(ofsCode);
integrationTaskLivingDetailsEntity.setRootAppBill(ofsCode);//u8c其他出库单号 integrationTaskLivingDetailsEntity.setRootAppBill(ofsCode);
// integrationTaskLivingDetailsEntity.setRootAppBill(vbillcode);//u8c其他出库单号 integrationTaskLivingDetailsEntity.setDef1(vbillcode);//u8c其他出库单号
integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
@ -373,8 +385,7 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
logger.error("推送U8C丽知OFS调整出库--->U8C其它出库失败失败原因" + e); logger.error("推送U8C丽知OFS调整出库--->U8C其它出库失败失败原因" + e);
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 integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
@ -412,6 +423,7 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
/** /**
* 只是命名不一样为了方便区分顾转换为stockout * 只是命名不一样为了方便区分顾转换为stockout
*
* @param saleOutReturnMessageDto * @param saleOutReturnMessageDto
* @return * @return
*/ */

View File

@ -145,7 +145,7 @@ public class CustdocAutoAllotPluginInitializer extends PluginBaseEntity {
boolean isExis = true; boolean isExis = true;
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
integrationTaskLivingDetailsEntity.setRootAppPk(requestVo.getParentvo().getCustcode()); integrationTaskLivingDetailsEntity.setRootAppPk(requestVo.getParentvo().getCustcode());
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y_H); integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y);
integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
List<IntegrationTaskLivingDetailsEntity> integrationTaskLivingDetailsEntities = iIntegrationTaskLivingDetailsDao.query(integrationTaskLivingDetailsEntity); List<IntegrationTaskLivingDetailsEntity> integrationTaskLivingDetailsEntities = iIntegrationTaskLivingDetailsDao.query(integrationTaskLivingDetailsEntity);
if (integrationTaskLivingDetailsEntities == null || integrationTaskLivingDetailsEntities.size() == 0) { if (integrationTaskLivingDetailsEntities == null || integrationTaskLivingDetailsEntities.size() == 0) {

View File

@ -1,257 +0,0 @@
package com.hzya.frame.plugin.lets.plugin.base;
import cn.hutool.core.lang.Assert;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.plugin.lets.constant.OverallConstant;
import com.hzya.frame.plugin.lets.constant.ProfilesActiveConstant;
import com.hzya.frame.plugin.lets.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.u8cdto.CustmandocEntityDto;
import com.hzya.frame.plugin.lets.u8cdto.ReusltStrDto;
import com.hzya.frame.plugin.lets.util.PushDataByU8cUtil;
import com.hzya.frame.plugin.lets.util.SaveOrUpdateBusinessLogUtil;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.locks.ReentrantLock;
/**
* @Author
* @Date 2024/8/12 15:25
* @PackageName:com.hzya.frame.plugin.lets.plugin.base
* @ClassName: CustmandocPluginInitializer
* @Description: 客商管理档案
*/
public class CustmandocPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(CustmandocPluginInitializer.class);
private static final ReentrantLock LOCK = new ReentrantLock(true);
@Override
public void initialize() {
logger.info(getPluginLabel() + "執行初始化方法initialize()");
}
@Override
public void destroy() {
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
}
@Override
public String getPluginId() {
return "com.hzya.frame.plugin.lets.plugin.base.CustmandocPluginInitializer";
}
@Override
public String getPluginName() {
return "丽知OFS客商档案--->U8C客商管理档案";
}
@Override
public String getPluginLabel() {
return "丽知U8C客商基本档案--->U8C客商管理档案";
}
@Override
public String getPluginType() {
return "1";
}
@Autowired
private PushDataByU8cUtil pushDataByU8cUtil;
@Autowired
private IIntegrationTaskLivingDetailsDao iIntegrationTaskLivingDetailsDao;
@Autowired
private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil;
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
return null;
}
/**
* 默认推送
*/
public void start() {
try {
//获取符合条件客商基本档案
List<CustdocRequestVo> custdocRequestVos = queryCustDoc();
implement(custdocRequestVos);
} catch (Exception e) {
logger.error("丽知U8C客商基本档案 --->U8C客商管理档案 ,start()方法报错:", e);
}
}
/**
* 查询客商基本档案
* @return
*/
private List<CustdocRequestVo> queryCustDoc() {
List<CustdocRequestVo> custdocRequestVos=null;
try {
String data = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("custdocQuery"), "{}");
CbdocResultVo cbdocResultVo = JSONObject.parseObject(data, CbdocResultVo.class);
String datastring = cbdocResultVo.getData();
Map map = JSONObject.parseObject(datastring, Map.class);
Object o = map.get("datas");
List<CustdocRequestVo> list = JSONObject.parseArray(JSON.toJSONString(o), CustdocRequestVo.class);
custdocRequestVos = filterData(list);
} catch (Exception e) {
logger.error("丽知:查询客商基本档案失败", e);
}
return custdocRequestVos;
}
private List<CustdocRequestVo> filterData(List<CustdocRequestVo> list) {
List<CustdocRequestVo> filterlist = new ArrayList<>();
for (CustdocRequestVo requestVo : list) {
if("N".equals(requestVo.getParentvo().getDef11())){
filterlist.add(requestVo);
}
}
return filterlist;
}
public void implement(List<CustdocRequestVo> list) {
for (CustdocRequestVo vo : list) {
String mandocjsonString = "";
//生成业务日期
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 定义日期格式
Date date = new Date(System.currentTimeMillis()); // 创建Date对象
String businessFormat = sdf.format(date); // 将Date对象格式化为字符串
CustdocEntityDto parentvo = vo.getParentvo();
try {
parentvo.setPk_areacl("F");
CustmandocRequestVo custmandocRequestVo = new CustmandocRequestVo();
custmandocRequestVo.setParentvo(parentvo);
custmandocRequestVo.setAddrs(vo.getAddrs());
// custmandocRequestVo.setBanks(vo.getBanks());
CustmandocEntityDto custmandocEntityDto = new CustmandocEntityDto();
custmandocEntityDto.setCustflag("0");
CustmandocEntityDto custmandocEntityDto1 = new CustmandocEntityDto();
custmandocEntityDto1.setCustflag("4");
List<CustmandocEntityDto> custmandocEntities = new ArrayList<>();
custmandocEntities.add(custmandocEntityDto);
custmandocEntities.add(custmandocEntityDto1);
custmandocRequestVo.setChildrenvo(custmandocEntities);
HashMap<String, Object> mandocparam = new HashMap<>();
mandocparam.put("billvo", custmandocRequestVo);
mandocjsonString = JSONObject.toJSONString(mandocparam);
String response = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("custmandocSave"), mandocjsonString);
System.out.println(response);
boolean isSuccess = false;
if (response != null && !"".equals(response)) {
ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class);
if ("success".equals(reusltStrDto.getStatus())) {
isSuccess = true;
updateDoc(vo);
}
}
if (!isSuccess) {
Assert.state(false, "推送U8C-->丽知U8C客商基本档案 --->U8C客商管理档案 失败 接口返回结果:{} 接口入参:{}", response, mandocjsonString);
}
//成功
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y);
integrationTaskLivingDetailsEntity.setRootAppNewData(mandocjsonString);
integrationTaskLivingDetailsEntity.setNewTransmitInfo(response);
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
integrationTaskLivingDetailsEntity.setBusinessDate(businessFormat);
integrationTaskLivingDetailsEntity.setRootAppPk(parentvo.getPk_cubasdoc());
integrationTaskLivingDetailsEntity.setRootAppBill(parentvo.getCustcode());
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
} catch (Exception e) {
e.printStackTrace();
logger.error("丽知U8C客商基本档案 --->U8C客商管理档案 ,implement()方法报错", e);
//失败
String ErrMessage = e.getMessage();
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N);
integrationTaskLivingDetailsEntity.setRootAppNewData(mandocjsonString);
integrationTaskLivingDetailsEntity.setNewTransmitInfo(ErrMessage);
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
integrationTaskLivingDetailsEntity.setBusinessDate(businessFormat);
integrationTaskLivingDetailsEntity.setRootAppPk(parentvo.getPk_cubasdoc());
integrationTaskLivingDetailsEntity.setRootAppBill(parentvo.getCustcode());
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
}
}
}
private void updateDoc(CustdocRequestVo custdocRequestVo) {
//已分配
String pkCubasdoc = custdocRequestVo.getParentvo().getPk_cubasdoc();
String createtime = custdocRequestVo.getParentvo().getCreatetime();
custdocRequestVo.getParentvo().setDef11("Y");
ArrayList<CustdocRequestVo> requestVos = new ArrayList<>();
requestVos.add(custdocRequestVo);
HashMap<String, List> map = new HashMap<>();
map.put("custbasvo", requestVos);
String data = JSONObject.toJSONString(map);
try {
String response = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("custdocUpdate"), data);
boolean isSuccess = false;
if (response != null && !"".equals(response)) {
ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class);
if ("success".equals(reusltStrDto.getStatus())) {
isSuccess = true;
}
}
if (!isSuccess) {
Assert.state(false, "更新客商基本档案失败 接口返回结果:{} 接口入参:{}", response, data);
}
//成功
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y);
integrationTaskLivingDetailsEntity.setRootAppNewData(data);
integrationTaskLivingDetailsEntity.setNewTransmitInfo(response);
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
integrationTaskLivingDetailsEntity.setBusinessDate(createtime);
integrationTaskLivingDetailsEntity.setRootAppPk(pkCubasdoc);
integrationTaskLivingDetailsEntity.setRootAppBill(pkCubasdoc);
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
} catch (Exception e) {
//失败
logger.error("U8C->客商基本档案更新updateDoc(CustdocRequestVo custdocRequestVo)方法失败");
String ErrMessage = e.getMessage();
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N);
integrationTaskLivingDetailsEntity.setRootAppNewData(data);
integrationTaskLivingDetailsEntity.setNewTransmitInfo(ErrMessage);
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
integrationTaskLivingDetailsEntity.setBusinessDate(createtime);
integrationTaskLivingDetailsEntity.setRootAppPk(pkCubasdoc);
integrationTaskLivingDetailsEntity.setRootAppBill(pkCubasdoc);
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
}
}
}

View File

@ -210,10 +210,6 @@ public class ShopPluginInitializer extends PluginBaseEntity {
// parentvo.setCustcode(shopEntity.getCustomerCode()); // parentvo.setCustcode(shopEntity.getCustomerCode());
// parentvo.setCustcode(shopEntity.getBizCode()); // parentvo.setCustcode(shopEntity.getBizCode());
// parentvo.setPk_areacl("F"); // parentvo.setPk_areacl("F");
//设置还未分配公司
// parentvo.setDef10("N");
// //设置还未同步到管理档案
// parentvo.setDef11("N");
// parentvo.setCustprop("2"); // parentvo.setCustprop("2");
custdocRequestVo.setParentvo(parentvo); custdocRequestVo.setParentvo(parentvo);
@ -284,7 +280,7 @@ public class ShopPluginInitializer extends PluginBaseEntity {
boolean isExis = true; boolean isExis = true;
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
integrationTaskLivingDetailsEntity.setRootAppPk(ofsShopDto.getBizCode()); integrationTaskLivingDetailsEntity.setRootAppPk(ofsShopDto.getBizCode());
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y_H); integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y);
integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
List<IntegrationTaskLivingDetailsEntity> integrationTaskLivingDetailsEntities = iIntegrationTaskLivingDetailsDao.query(integrationTaskLivingDetailsEntity); List<IntegrationTaskLivingDetailsEntity> integrationTaskLivingDetailsEntities = iIntegrationTaskLivingDetailsDao.query(integrationTaskLivingDetailsEntity);
if (integrationTaskLivingDetailsEntities == null || integrationTaskLivingDetailsEntities.size() == 0) { if (integrationTaskLivingDetailsEntities == null || integrationTaskLivingDetailsEntities.size() == 0) {

View File

@ -1,24 +0,0 @@
package com.hzya.frame.plugin.lets.queryvo;
import com.hzya.frame.plugin.lets.entity.BdCumandocEntity;
import com.hzya.frame.plugin.lets.u8cdto.CustdocEntityDto;
import com.hzya.frame.plugin.lets.u8cdto.CustmandocEntityDto;
import lombok.Data;
import java.util.List;
/**
* @Author
* @Date 2024/8/8 15:17
* @PackageName:com.hzya.frame.plugin.lets.plugin.base.vo
* @ClassName: CustmandocRequestVo
* @Description: TODO
*/
@Data
public class CustmandocRequestVo {
private List<AddrVo> addrs;
private List<BankVo> custBanks;
private List<CustmandocEntityDto> childrenvo;
private CustdocEntityDto parentvo;
}

View File

@ -1,199 +0,0 @@
package com.hzya.frame.plugin.lets.u8cdto;
import lombok.Data;
import java.util.List;
/**
* @Author
* @Date 2024/8/8 15:15
* @PackageName:com.hzya.frame.plugin.lets.plugin.base.vo
* @ClassName: BdCumandocEntity
* @Description: 客商管理档案
*/
@Data
public class CustmandocEntityDto {
// 于客商总公司账期控制
private boolean acclimitcontrol;
// 呼机
private String bp;
// 助记码
private String cmnecode;
// 是否收付协同
private boolean cooperateflag;
// 合作期限从
private String cooperatingdayfrom;
// 合作期限到
private String cooperatingdayto;
// 创建时间
private String createtime;
// 创建人
private String creator;
// 基于客商总公司信用控制
private boolean creditcontrol;
// 信用等级(填写编码)
private String creditlevel;
// 信用期限
private int creditlimitnum;
// 信用额度
private double creditmny;
// 信用保证金
private double creditmoney;
// 是否信用管制
private String credlimitflag;
// 客商编码
private String custcode;
//由于客商管理档案在数据库表中存的两条所以childrenvo如果传的话需要传两条这两条数据的客商属性字段必须是这些组合客户0和4供应商1和空格客商2和3不传childrenvo默认是客户0和4
private String custflag;
// 客商名称
private String custname;
// 客商状态
private String custstate;
private String def1;
private String def10;
private String def11;
private String def12;
private String def13;
private String def14;
private String def15;
private String def16;
private String def17;
private String def18;
private String def19;
private String def2;
private String def20;
private String def21;
private String def22;
private String def23;
private String def24;
private String def25;
private String def26;
private String def27;
private String def28;
private String def29;
private String def3;
private String def30;
private String def4;
private String def5;
private String def6;
private String def7;
private String def8;
private String def9;
// 发展日期
private String developdate;
//是否允许异币种核算
private String diffcurrflag;
// 扣率
private String discountrate;
// 删除标志
private int dr;
// 免于帐期检查
private boolean freeofacclmtcheck;
// 免于信用额度检查
private boolean freeofcremnycheck;
// 冻结时间
private String frozendate;
// 是否冻结
private boolean frozenflag;
// 等级
private int grade;
// 内控帐期天数
private String innerctldays;
// 筹投资单位
private boolean iounit;
// 是否零售加盟店
private boolean isagent;
// 是否催款
private boolean ispromtesettlement;
// 联系人
private String linkman;
// 备注
private String memo;
// 手机
private String mobilephone;
// 修改人
private String modifier;
// 修改时间
private String modifytime;
// 地区分类
private String pk_areacl;
// 库存组织(填写编码)
private String pk_calbody;
// 公司(填写编码)
private String pk_corp;
// 默认交易币种(填写编码)
private String pk_currtype1;
// 开票客商(填写编码)
private String pk_cusmandoc2;
// 发货客商(填写编码)
private String pk_cusmandoc3;
// 默认业务类型(填写编码)
private String pk_defbusitype;
// 默认收付款协议(填写编码)
private String pk_payterm;
// 公司价格分组(填写编码)
private String pk_pricegroupcorp;
// 专管部门(填写编码)
private String pk_respdept1;
// 专管业务员(填写编码)
private String pk_resppsn1;
// 销售组织(填写编码)
private String pk_salestru;
// 发运方式(填写编码)
private String pk_sendtype;
// 结算单位主键(已废弃)
private String pk_settleunit;
// 仓库档案(填写编码)
private String pk_stordoc2;
// 预收款比例
private int prepaidratio;
// 批准日期
private String ratifydate;
// 封存标志
private String sealflag;
// 存货最低售价比例
private int stockpriceratio;
// 新产品试销保证金
private double testsalemoney;
}

View File

@ -40,7 +40,7 @@ public class PushDataByU8cUtil {
.setSocketTimeout(300000) // 读取超时时间为60秒 .setSocketTimeout(300000) // 读取超时时间为60秒
.build(); .build();
HttpPost post = new HttpPost(OverallConstant.getOverAllValue("u8cApiServiceNamePK") + url); HttpPost post = new HttpPost(OverallConstant.getOverAllValue("u8cApiUrl") + url);
post.setHeader("Content-Type", "application/json;charset=UTF-8"); post.setHeader("Content-Type", "application/json;charset=UTF-8");
post.setHeader("usercode", OverallConstant.getOverAllValue("u8cApiUsercodePK")); post.setHeader("usercode", OverallConstant.getOverAllValue("u8cApiUsercodePK"));
post.setHeader("password", OverallConstant.getOverAllValue("u8cApiPasswordPK")); post.setHeader("password", OverallConstant.getOverAllValue("u8cApiPasswordPK"));
@ -100,7 +100,7 @@ public class PushDataByU8cUtil {
.setSocketTimeout(300000) // 读取超时时间为60秒 .setSocketTimeout(300000) // 读取超时时间为60秒
.build(); .build();
HttpPost post = new HttpPost(OverallConstant.getOverAllValue("u8cApiServiceNameCode") + url); HttpPost post = new HttpPost(OverallConstant.getOverAllValue("u8cApiUrl") + url);
post.setHeader("Content-Type", "application/json;charset=UTF-8"); post.setHeader("Content-Type", "application/json;charset=UTF-8");
post.setHeader("usercode", OverallConstant.getOverAllValue("u8cApiUsercodeCode")); post.setHeader("usercode", OverallConstant.getOverAllValue("u8cApiUsercodeCode"));
post.setHeader("password", OverallConstant.getOverAllValue("u8cApiPasswordCode")); post.setHeader("password", OverallConstant.getOverAllValue("u8cApiPasswordCode"));

View File

@ -0,0 +1,17 @@
package com.hzya.frame.plugin.lets.util.pushData;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* U8C返回参数
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Attribute {
private String status;
private String taskNumber;
private String data;
}

View File

@ -0,0 +1,107 @@
package com.hzya.frame.plugin.lets.util.pushData;
import cn.hutool.core.lang.Assert;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSON;
import com.hzya.frame.plugin.lets.constant.OverallConstant;
import com.hzya.frame.plugin.lets.constant.ProfilesActiveConstant;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.springframework.stereotype.Component;
/**
* 通过中台推送U8C推送工具类.
*/
@Component
public class PushU8CByApiCode {
private static String appId = "800037";
private static String publicKey = "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj";//用安中台
private static String secretKey = "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=";//用安中台
/**
* 发起post请求传递json类型
*
* @param apicode 地址
* @param data 请求参数
* @return 返回消息
*/
public ZTResult pushByPK(String apicode, String data) throws Exception {
Assert.notNull(apicode, "请求地址不能为空");
Assert.notNull(data, "请求参数不能为空(需要JSON格式)");
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(OverallConstant.getOverAllValue("u8cApiUrl"));
httpPost.setHeader("Content-Type", "application/json");
//u8c
httpPost.setHeader("usercode", OverallConstant.getOverAllValue("u8cApiUsercodePK"));
httpPost.setHeader("password", OverallConstant.getOverAllValue("u8cApiPasswordPK"));
httpPost.setHeader("trantype", OverallConstant.getOverAllValue("u8cApiTrantypePK"));
httpPost.setHeader("system", OverallConstant.getOverAllValue("u8cApiSystemPK"));
httpPost.setHeader("needStackTrace", OverallConstant.getOverAllValue("u8cApiNeedStackTracePK"));
//中台
httpPost.setHeader("publicKey", publicKey);
httpPost.setHeader("secretKey", secretKey);
//app
httpPost.setHeader("appId", appId);
httpPost.setHeader("apicode", apicode);
//data
httpPost.setEntity(new StringEntity(data, "UTF-8"));
CloseableHttpResponse response = httpclient.execute(httpPost);
HttpEntity entity = response.getEntity();
String result = EntityUtils.toString(entity);
EntityUtils.consume(entity);
ZTResult ztResult = JSON.parseObject(result).toJavaObject(ZTResult.class);
return ztResult;
}
/**
* 发起post请求传递json类型
* <p>
* u8c code模式
*
* @param apicode
* @param data 请求参数
* @return 返回消息
*/
public ZTResult pushByCode(String apicode, String data) throws Exception {
Assert.notNull(apicode, "请求地址不能为空");
Assert.notNull(data, "请求参数不能为空(需要JSON格式)");
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(ProfilesActiveConstant.U8C_URL);
httpPost.setHeader("Content-Type", "application/json");
//u8c
httpPost.setHeader("usercode", OverallConstant.getOverAllValue("u8cApiUsercodeCode"));
httpPost.setHeader("password", OverallConstant.getOverAllValue("u8cApiPasswordCode"));
httpPost.setHeader("trantype", OverallConstant.getOverAllValue("u8cApiTrantypeCode"));
httpPost.setHeader("system", OverallConstant.getOverAllValue("u8cApiSystemCode"));
httpPost.setHeader("needStackTrace", OverallConstant.getOverAllValue("u8cApiNeedStackTraceCode"));
//中台
httpPost.setHeader("publicKey", publicKey);
httpPost.setHeader("secretKey", secretKey);
//app
httpPost.setHeader("appId", appId);
httpPost.setHeader("apicode", apicode);
//data
httpPost.setEntity(new StringEntity(data, "UTF-8"));
CloseableHttpResponse response = httpclient.execute(httpPost);
HttpEntity entity = response.getEntity();
String result = EntityUtils.toString(entity);
EntityUtils.consume(entity);
ZTResult ztResult = JSON.parseObject(result).toJavaObject(ZTResult.class);
return ztResult;
}
}

View File

@ -0,0 +1,18 @@
package com.hzya.frame.plugin.lets.util.pushData;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ZTResult {
private String msg;
private String type;
private String flag;
private String status;
private Attribute attribute;
private String headMsg;
}