可靠授信申请表 ,销售返利表同步BIP
This commit is contained in:
parent
070090b3a7
commit
af680ede6b
|
@ -0,0 +1,10 @@
|
|||
package com.hzya.frame.plugin.kekao.dao;
|
||||
|
||||
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.plugin.kekao.entity.CreditauditEntity;
|
||||
|
||||
public interface ICreditauditDao extends IBaseDao<CreditauditEntity, String> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.hzya.frame.plugin.kekao.dao.impl;
|
||||
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
import com.hzya.frame.plugin.kekao.dao.ICreditauditDao;
|
||||
import com.hzya.frame.plugin.kekao.entity.CreditauditEntity;
|
||||
|
||||
|
||||
public class CreditauditDaoImpl extends MybatisGenericDao<CreditauditEntity, String> implements ICreditauditDao {
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package com.hzya.frame.plugin.kekao.entity;
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
public class CreditauditEntity extends BaseEntity {
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hzya.frame.plugin.kekao.dao.impl.CreditauditDaoImpl">
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.hzya.frame.plugin.kekao.plugin;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.base.PluginBaseEntity;
|
||||
import com.hzya.frame.plugin.kekao.service.ICreditauditService;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* 信用额度审批单保存提交
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-21 13:52:35
|
||||
*/
|
||||
public class CreditauditPluginInitializer extends PluginBaseEntity{
|
||||
Logger logger = LoggerFactory.getLogger(CreditauditPluginInitializer.class);
|
||||
@Autowired
|
||||
private ICreditauditService creditauditService;
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
logger.info(getPluginLabel() + "执行初始化方法initialize()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
logger.info(getPluginLabel() + "执行销毁方法destroy()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "CreditauditPlugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "CreditauditPlugin插件";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginLabel() {
|
||||
return "CreditauditPlugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginType() {
|
||||
return "1";
|
||||
}
|
||||
@Override
|
||||
public JsonResultEntity executeBusiness(JSONObject requestJson) {
|
||||
try {
|
||||
logger.info("======开始执行信用额度审批单保存提交同步========");
|
||||
return creditauditService.sendCreditauditData(requestJson);
|
||||
}catch (Exception e){
|
||||
logger.info("======执行信用额度审批单保存提交同步失败:{}========",e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package com.hzya.frame.plugin.kekao.plugin;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.base.PluginBaseEntity;
|
||||
import com.hzya.frame.plugin.kekao.service.ICreditauditService;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* 销售返利
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-21 13:52:35
|
||||
*/
|
||||
public class SalesRebatePluginInitializer extends PluginBaseEntity{
|
||||
Logger logger = LoggerFactory.getLogger(SalesRebatePluginInitializer.class);
|
||||
@Autowired
|
||||
private ICreditauditService creditauditService;
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
logger.info(getPluginLabel() + "执行初始化方法initialize()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
logger.info(getPluginLabel() + "执行销毁方法destroy()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "SalesRebatePlugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "SalesRebatePlugin插件";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginLabel() {
|
||||
return "SalesRebatePlugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginType() {
|
||||
return "1";
|
||||
}
|
||||
@Override
|
||||
public JsonResultEntity executeBusiness(JSONObject requestJson) {
|
||||
try {
|
||||
logger.info("======开始执行销售返利同步========");
|
||||
return creditauditService.sendSalesRebateData(requestJson);
|
||||
}catch (Exception e){
|
||||
logger.info("======执行销售返利同步失败:{}========",e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package com.hzya.frame.plugin.kekao.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.plugin.kekao.entity.CreditauditEntity;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
||||
public interface ICreditauditService extends IBaseService<CreditauditEntity, String>{
|
||||
|
||||
/**
|
||||
* @Author lvleigang
|
||||
* @Description 信用额度审批单保存提交同步
|
||||
* @Date 2:32 下午 2025/8/5
|
||||
* @param requestJson
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
**/
|
||||
JsonResultEntity sendCreditauditData(JSONObject requestJson);
|
||||
|
||||
/**
|
||||
* @Author lvleigang
|
||||
* @Description 销售返利同步
|
||||
* @Date 3:12 下午 2025/8/5
|
||||
* @param requestJson
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
**/
|
||||
JsonResultEntity sendSalesRebateData(JSONObject requestJson);
|
||||
}
|
|
@ -0,0 +1,222 @@
|
|||
package com.hzya.frame.plugin.kekao.service.impl;
|
||||
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
import com.hzya.frame.plugin.kekao.dao.ICreditauditDao;
|
||||
import com.hzya.frame.plugin.kekao.entity.CreditauditEntity;
|
||||
import com.hzya.frame.plugin.kekao.service.ICreditauditService;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
public class CreditauditServiceImpl extends BaseService<CreditauditEntity, String> implements ICreditauditService {
|
||||
@Value("${zt.url}")
|
||||
private String url;
|
||||
|
||||
private ICreditauditDao creditauditDao;
|
||||
|
||||
@Autowired
|
||||
public void setCreditauditDao(ICreditauditDao dao) {
|
||||
this.creditauditDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param requestJson
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 信用额度审批单保存提交同步
|
||||
* @Date 2:32 下午 2025/8/5
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity sendCreditauditData(JSONObject requestJson) {
|
||||
logger.error("同步信用额度审批单保存提交入参" + requestJson.toJSONString());
|
||||
JSONObject jsonStr = requestJson.getJSONObject("jsonStr");
|
||||
if (jsonStr == null) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
JSONObject businessDataStr = jsonStr.getJSONObject("businessDataStr");
|
||||
if (businessDataStr == null) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
JSONObject mainData = businessDataStr.getJSONObject("formmain_9555");
|
||||
if (mainData == null) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
//组装数据
|
||||
//获取token
|
||||
String token = null; //todo
|
||||
JSONObject tokenData = new JSONObject();
|
||||
tokenData.put("userName","beis");
|
||||
tokenData.put("password","64de4de7-23ce-4946-ac91-dd9e322d86e5");
|
||||
tokenData.put("loginName","seeyon");
|
||||
String tokenResult = HttpRequest.post(url).
|
||||
header("appId", "800051").
|
||||
header("apiCode", "8000510005").
|
||||
header("publicKey", "ZJYAM2YFEIsIaI1e4wMagkS2Q7SFgGk0RvsPhEES45m/OVFCe7eDIk+3zDUT+v578prj").
|
||||
header("secretKey", "lR6+uf94mvNMclAB43oIwmhJSMDzQaViTkfXLeNvmGdpLfbFiUvbgbU+p43zO25Zj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=").
|
||||
body(tokenData.toJSONString()).
|
||||
execute().
|
||||
body();
|
||||
logger.error("BIP Token:" + tokenResult);
|
||||
JSONObject resoutJson = JSONObject.parseObject(tokenResult);
|
||||
if (resoutJson.getBoolean("flag")) {
|
||||
token = resoutJson.getJSONObject("attribute").getString("id");
|
||||
} else {
|
||||
return BaseResult.getFailureMessageEntity("获取BIP token失败");
|
||||
}
|
||||
JSONObject sendData = setSendCreditauditData(mainData);
|
||||
logger.error("同步信用额度审批单保存提交单据发送参数:" + sendData.toJSONString());
|
||||
String sendResult = HttpRequest.post(url).//todo
|
||||
header("appId", "800051").
|
||||
header("apiCode", "8000510001").
|
||||
header("token", token).
|
||||
header("publicKey", "ZJYAM2YFEIsIaI1e4wMagkS2Q7SFgGk0RvsPhEES45m/OVFCe7eDIk+3zDUT+v578prj").
|
||||
header("secretKey", "lR6+uf94mvNMclAB43oIwmhJSMDzQaViTkfXLeNvmGdpLfbFiUvbgbU+p43zO25Zj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=").
|
||||
body(sendData.toJSONString()).
|
||||
execute().
|
||||
body();
|
||||
logger.error("同步信用额度审批单保存提交单据发送返回:" + sendResult);
|
||||
JSONObject sendJson = JSONObject.parseObject(sendResult);
|
||||
if (sendJson.getBoolean("flag")) {
|
||||
return BaseResult.getSuccessMessageEntity("同步信用额度审批单保存提交单据发送成功");
|
||||
} else {
|
||||
return BaseResult.getFailureMessageEntity("同步信用额度审批单保存提交单据发送错误:"+sendJson.getString("msg"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @Author lvleigang
|
||||
* @Description 组装参数
|
||||
* @Date 2:47 下午 2025/8/5
|
||||
* @param mainData
|
||||
* @return com.alibaba.fastjson.JSONObject
|
||||
**/
|
||||
private JSONObject setSendCreditauditData(JSONObject mainData) {
|
||||
JSONObject sendData = new JSONObject();
|
||||
|
||||
// 构建headVO对象
|
||||
JSONObject headVO = new JSONObject();
|
||||
headVO.put("pk_org", "COCO_CS");
|
||||
headVO.put("ctrantypeid", "4320-01");
|
||||
headVO.put("vtrantypecode", "4320-01");
|
||||
headVO.put("capplyerid", "subo");
|
||||
headVO.put("vbillcode", "wxz08051210");
|
||||
headVO.put("dbilldate", "2025-08-05 09:30:19");
|
||||
headVO.put("vnote", "wxz备注");
|
||||
headVO.put("creator", "sub");
|
||||
headVO.put("vdef1", "wxzvdef1");
|
||||
|
||||
// 构建bodyVOList数组中的第一个对象
|
||||
JSONObject bodyVO = new JSONObject();
|
||||
bodyVO.put("climittypeid", "COCO_01");
|
||||
bodyVO.put("ccurrencyid", "CNY");
|
||||
bodyVO.put("nlimitmny", "12.00");
|
||||
bodyVO.put("dtodate", "2099-12-31 23:59:59");
|
||||
bodyVO.put("dfromdate", "2025-08-05 00:00:00");
|
||||
bodyVO.put("csaleorgid", "001");
|
||||
bodyVO.put("ccustid", "01020017");
|
||||
bodyVO.put("dbilldate", "2025-08-05 09:36:37");
|
||||
bodyVO.put("vnote", "wxzB备注");
|
||||
bodyVO.put("vbdef1", "wxzvbdef1");
|
||||
bodyVO.put("pk_saleorg", "001");
|
||||
bodyVO.put("pk_income", "1010");
|
||||
|
||||
// 创建JSON数组并添加bodyVO对象
|
||||
JSONArray bodyVOList = new JSONArray();
|
||||
bodyVOList.add(bodyVO);
|
||||
|
||||
// 将headVO和bodyVOList添加到外层对象
|
||||
sendData.put("headVO", headVO);
|
||||
sendData.put("bodyVOList", bodyVOList);
|
||||
|
||||
return sendData;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param requestJson
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 销售返利同步
|
||||
* @Date 2:32 下午 2025/8/5
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity sendSalesRebateData(JSONObject requestJson) {
|
||||
logger.error("同步销售返利入参" + requestJson.toJSONString());
|
||||
JSONObject jsonStr = requestJson.getJSONObject("jsonStr");
|
||||
if (jsonStr == null) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
JSONObject businessDataStr = jsonStr.getJSONObject("businessDataStr");
|
||||
if (businessDataStr == null) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
JSONObject mainData = businessDataStr.getJSONObject("formmain_9555");
|
||||
if (mainData == null) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
//组装数据
|
||||
//获取token
|
||||
String token = null; //todo
|
||||
JSONObject tokenData = new JSONObject();
|
||||
tokenData.put("userName","beis");
|
||||
tokenData.put("password","64de4de7-23ce-4946-ac91-dd9e322d86e5");
|
||||
tokenData.put("loginName","seeyon");
|
||||
String tokenResult = HttpRequest.post(url).
|
||||
header("appId", "800051").
|
||||
header("apiCode", "8000510005").
|
||||
header("publicKey", "ZJYAM2YFEIsIaI1e4wMagkS2Q7SFgGk0RvsPhEES45m/OVFCe7eDIk+3zDUT+v578prj").
|
||||
header("secretKey", "lR6+uf94mvNMclAB43oIwmhJSMDzQaViTkfXLeNvmGdpLfbFiUvbgbU+p43zO25Zj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=").
|
||||
body(tokenData.toJSONString()).
|
||||
execute().
|
||||
body();
|
||||
logger.error("BIP Token:" + tokenResult);
|
||||
JSONObject resoutJson = JSONObject.parseObject(tokenResult);
|
||||
if (resoutJson.getBoolean("flag")) {
|
||||
token = resoutJson.getJSONObject("attribute").getString("id");
|
||||
} else {
|
||||
return BaseResult.getFailureMessageEntity("获取BIP token失败");
|
||||
}
|
||||
JSONObject sendData = setSalesRebateData(mainData);
|
||||
logger.error("同步销售返利发送参数:" + sendData.toJSONString());
|
||||
String sendResult = HttpRequest.post(url).//todo
|
||||
header("appId", "800051").
|
||||
header("apiCode", "8000510001").
|
||||
header("token", token).
|
||||
header("publicKey", "ZJYAM2YFEIsIaI1e4wMagkS2Q7SFgGk0RvsPhEES45m/OVFCe7eDIk+3zDUT+v578prj").
|
||||
header("secretKey", "lR6+uf94mvNMclAB43oIwmhJSMDzQaViTkfXLeNvmGdpLfbFiUvbgbU+p43zO25Zj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=").
|
||||
body(sendData.toJSONString()).
|
||||
execute().
|
||||
body();
|
||||
logger.error("同步销售返利发送返回:" + sendResult);
|
||||
JSONObject sendJson = JSONObject.parseObject(sendResult);
|
||||
if (sendJson.getBoolean("flag")) {
|
||||
return BaseResult.getSuccessMessageEntity("同步销售返利发送成功");
|
||||
} else {
|
||||
return BaseResult.getFailureMessageEntity("同步销售返利发送错误:"+sendJson.getString("msg"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @Author lvleigang
|
||||
* @Description 组装参数
|
||||
* @Date 2:47 下午 2025/8/5
|
||||
* @param mainData
|
||||
* @return com.alibaba.fastjson.JSONObject
|
||||
**/
|
||||
private JSONObject setSalesRebateData(JSONObject mainData) {
|
||||
JSONObject sendData = new JSONObject();
|
||||
|
||||
|
||||
|
||||
return sendData;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin>
|
||||
<id>CreditauditPlugin</id>
|
||||
<name>CreditauditPlugin插件</name>
|
||||
<category>20250805001</category>
|
||||
</plugin>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean name="creditauditDao" class="com.hzya.frame.plugin.kekao.dao.impl.CreditauditDaoImpl" />
|
||||
</beans>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean name="creditauditPluginInitializer" class="com.hzya.frame.plugin.kekao.plugin.CreditauditPluginInitializer" />
|
||||
<bean name="salesRebatePluginInitializer" class="com.hzya.frame.plugin.kekao.plugin.SalesRebatePluginInitializer" />
|
||||
</beans>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean name="creditauditService" class="com.hzya.frame.plugin.kekao.service.impl.CreditauditServiceImpl" />
|
||||
</beans>
|
Loading…
Reference in New Issue