Commit bafceab7 authored by hezhuozhi's avatar hezhuozhi

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

parents 4b9b1e64 72581637
...@@ -71,12 +71,12 @@ public class HygfIcbcRecordDTO { ...@@ -71,12 +71,12 @@ public class HygfIcbcRecordDTO {
* 协议开始日期 * 协议开始日期
*/ */
@ApiModelProperty (value = "协议开始日期") @ApiModelProperty (value = "协议开始日期")
private Date protocolStartTime; private String protocolStartTime;
/** /**
* 协议终止日期 * 协议终止日期
*/ */
@ApiModelProperty (value = "协议终止日期") @ApiModelProperty (value = "协议终止日期")
private Date protocolEndTime; private String protocolEndTime;
/** /**
* 单笔限额 * 单笔限额
*/ */
...@@ -131,26 +131,32 @@ public class HygfIcbcRecordDTO { ...@@ -131,26 +131,32 @@ public class HygfIcbcRecordDTO {
/** /**
* 农户信息编号 * 农户信息编号
*/ */
@ApiModelProperty(value = "农户信息编号")
private String peasantHouseholdNo; private String peasantHouseholdNo;
/** /**
* 项目地址 * 项目地址
*/ */
@ApiModelProperty(value = "项目地址")
private List<Integer> projectAddress; private List<Integer> projectAddress;
/** /**
* 项目地址 * 项目地址
*/ */
@ApiModelProperty(value = "项目地址")
private String projectAddressName; private String projectAddressName;
/* /*
* 区域公司id * 区域公司id
* */ * */
@ApiModelProperty(value = "区域公司id")
private Long regionalCompaniesSeq; private Long regionalCompaniesSeq;
/* /*
* 区域公司code * 区域公司code
* */ * */
@ApiModelProperty(value = "区域公司code")
private String regionalCompaniesCode; private String regionalCompaniesCode;
/* /*
* 区域公司名称 * 区域公司名称
* */ * */
@ApiModelProperty(value = "区域公司名称")
private String regionalCompaniesName; private String regionalCompaniesName;
} }
......
...@@ -66,12 +66,12 @@ public class HygfIcbcRecord extends BaseEntity { ...@@ -66,12 +66,12 @@ public class HygfIcbcRecord extends BaseEntity {
* 协议开始日期 * 协议开始日期
*/ */
@TableField ("protocol_start_time") @TableField ("protocol_start_time")
private Date protocolStartTime; private String protocolStartTime;
/** /**
* 协议终止日期 * 协议终止日期
*/ */
@TableField ("protocol_end_time") @TableField ("protocol_end_time")
private Date protocolEndTime; private String protocolEndTime;
/** /**
* 单笔限额 * 单笔限额
*/ */
......
...@@ -15,21 +15,14 @@ import com.icbc.api.response.JftApiUserEntrustopenacctQueryResponseV1; ...@@ -15,21 +15,14 @@ import com.icbc.api.response.JftApiUserEntrustopenacctQueryResponseV1;
import com.icbc.api.utils.IcbcSignature; import com.icbc.api.utils.IcbcSignature;
import com.icbc.api.utils.WebUtils; import com.icbc.api.utils.WebUtils;
import com.yeejoin.amos.boot.module.hygf.api.Enum.IcbcEnum; import com.yeejoin.amos.boot.module.hygf.api.Enum.IcbcEnum;
import com.yeejoin.amos.boot.module.hygf.api.dto.FinancingInfoDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.FinancingRectificationOrderDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordDTO; import com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordDTO;
import com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordQueryDTO; import com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordQueryDTO;
import com.yeejoin.amos.boot.module.hygf.api.entity.FinancingInfo;
import com.yeejoin.amos.boot.module.hygf.api.entity.HygfIcbcRecord; import com.yeejoin.amos.boot.module.hygf.api.entity.HygfIcbcRecord;
import com.yeejoin.amos.boot.module.hygf.api.entity.PeasantHousehold; import com.yeejoin.amos.boot.module.hygf.api.entity.PeasantHousehold;
import com.yeejoin.amos.boot.module.hygf.api.mapper.FinancingInfoMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.HygfIcbcRecordMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.HygfIcbcRecordMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IHygfIcbcService; import com.yeejoin.amos.boot.module.hygf.api.service.IHygfIcbcService;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSON;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
...@@ -37,7 +30,6 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -37,7 +30,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
...@@ -172,10 +164,6 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc ...@@ -172,10 +164,6 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
} }
public JftApiUserEntrustopenacctQueryResponseV1 getHygfIcbcWalletInfo(String userId) { public JftApiUserEntrustopenacctQueryResponseV1 getHygfIcbcWalletInfo(String userId) {
// String userId = req.getParameter("userId");
DefaultIcbcClient client = new DefaultIcbcClient( DefaultIcbcClient client = new DefaultIcbcClient(
APP_ID, APP_ID,
IcbcConstants.SIGN_TYPE_RSA2, IcbcConstants.SIGN_TYPE_RSA2,
...@@ -202,21 +190,33 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc ...@@ -202,21 +190,33 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
return response; return response;
} catch (IcbcApiException e) { } catch (IcbcApiException e) {
e.printStackTrace(); e.printStackTrace();
log.error("聚富通委托代扣签约同步开户结果查询数据接口error: ", e);
return null; return null;
} }
} }
/**
* 户用光伏开户签约异步通知使用
*
* @param request request
* @param response response
* @return {@link Object}
* @throws
* @author yangyang
* @date 2024/7/18 20:15
*/
public Object registerWalletCallback(HttpServletRequest request, HttpServletResponse response) throws Exception { public Object registerWalletCallback(HttpServletRequest request, HttpServletResponse response) throws Exception {
log.info("验签"); log.info("户用光伏开户签约异步通知, => 验签");
boolean verifyFlag = verifySignData(request, notifyUrl); boolean verifyFlag = verifySignData(request, notifyUrl);
String returnJson; String returnJson;
// 获取其他参数略... // 获取其他参数略...
if (verifyFlag) {// 验签成功 if (verifyFlag) {
log.info("解密..."); // 验签成功
String biz_content = request.getParameter("biz_content"); String biz_content = request.getParameter("biz_content");
String decode = URLDecoder.decode(biz_content, "utf-8"); String decode = URLDecoder.decode(biz_content, "utf-8");
Map<String, String> data = JSONObject.parseObject(decode, Map.class); Map<String, String> data = JSONObject.parseObject(decode, Map.class);
// 其中certNo、custName、newPayAcc字段进行了base64编码,可以调用示例代码中的base64Decode进行解码 log.info("解密后参数:{}", data);// 进行自己的处理,此处默认处理成功,返回通知方成功,return_code=0
// 其中certNo、custName、newPayAcc字段进行了base64编码,可以调用示例代码中的base64Decode进行解码
String custName = base64Decode(data.get("custName")); String custName = base64Decode(data.get("custName"));
String certNo = base64Decode(data.get("certNo")); String certNo = base64Decode(data.get("certNo"));
String newPayAcc = base64Decode(data.get("newPayAcc")); String newPayAcc = base64Decode(data.get("newPayAcc"));
...@@ -224,11 +224,34 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc ...@@ -224,11 +224,34 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
String projectId = data.get("projectId"); String projectId = data.get("projectId");
String openAccoutSucceedFlag = data.get("openAccoutSucceedFlag"); String openAccoutSucceedFlag = data.get("openAccoutSucceedFlag");
String signEntrsutPrtlSucceedFlag = data.get("signEntrsutPrtlSucceedFlag"); String signEntrsutPrtlSucceedFlag = data.get("signEntrsutPrtlSucceedFlag");
// 获取其他参数略... JftApiUserEntrustopenacctQueryResponseV1 jftApiUserEntrustopenacctQueryResponse = this.getHygfIcbcWalletInfo(outUserId);
//... System.out.println(jftApiUserEntrustopenacctQueryResponse);
JftApiUserEntrustopenacctQueryResponseV1 jftApiUserEntrustopenacctQueryResponseV1 = this.getHygfIcbcWalletInfo(outUserId); // region 保存数据
System.out.println(jftApiUserEntrustopenacctQueryResponseV1); HygfIcbcRecord hygfIcbcRecord = this.lambdaQuery().eq(HygfIcbcRecord::getAmosUserId, outUserId).last(" limit 1").one();
log.info("解密后参数:{}", data);// 进行自己的处理,此处默认处理成功,返回通知方成功,return_code=0 if (hygfIcbcRecord == null) {
hygfIcbcRecord = new HygfIcbcRecord();
}
hygfIcbcRecord.setCustName(custName);
hygfIcbcRecord.setIdCard(certNo);
// hygfIcbcRecord.setPhone();
hygfIcbcRecord.setMediumId(newPayAcc);
hygfIcbcRecord.setProjectId(projectId);
hygfIcbcRecord.setOpenAccountStatus(openAccoutSucceedFlag);
hygfIcbcRecord.setProtocolStatus(jftApiUserEntrustopenacctQueryResponse.getProtocolStatus());
hygfIcbcRecord.setProtocolStartTime(jftApiUserEntrustopenacctQueryResponse.getProtocolStartDate());
hygfIcbcRecord.setProtocolEndTime(jftApiUserEntrustopenacctQueryResponse.getProtocolEndDate());
hygfIcbcRecord.setTrxLimitAmount(jftApiUserEntrustopenacctQueryResponse.getTrxLimitAmount());
hygfIcbcRecord.setDayLimitAmount(jftApiUserEntrustopenacctQueryResponse.getDayLimitAmount());
hygfIcbcRecord.setProtocolLimitAmount(jftApiUserEntrustopenacctQueryResponse.getProtocolLimitAmount());
hygfIcbcRecord.setAppId(jftApiUserEntrustopenacctQueryResponse.getAppId());
hygfIcbcRecord.setOutUserId(jftApiUserEntrustopenacctQueryResponse.getOutUserId());
hygfIcbcRecord.setOutVendorId(jftApiUserEntrustopenacctQueryResponse.getOutVendorId());
hygfIcbcRecord.setSignEntrsutPrtlStatus(signEntrsutPrtlSucceedFlag);
// hygfIcbcRecord.setDiscardStatus();
hygfIcbcRecord.setAmosUserId(outUserId);
hygfIcbcRecord.setRecDate(new Date());
this.saveOrUpdate(hygfIcbcRecord);
// endregion
String copReturnCode = "0";// 通知合作方接收成功的返回码,固定 String copReturnCode = "0";// 通知合作方接收成功的返回码,固定
String copReturnMsg = "success";// 合作方的返回信息,固定 String copReturnMsg = "success";// 合作方的返回信息,固定
returnJson = sign(request, copReturnCode, copReturnMsg); returnJson = sign(request, copReturnCode, copReturnMsg);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment