Commit 7c4124fc authored by wujiang's avatar wujiang

添加icbc修复接口

parent 42a37921
......@@ -112,8 +112,14 @@ public class HygfIcbcController extends BaseController {
@ApiOperation (httpMethod = "GET", value = "聚富通电子钱包分页查询", notes = "聚富通电子钱包分页查询")
@UserLimits
public ResponseModel<Page<HygfIcbcRecordDTO>> queryForPage(@ApiParam HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO) {
return ResponseHelper.buildResponse(hygfIcbcService.queryForPage(hygfIcbcRecordQueryDTO.getCurrent(), hygfIcbcRecordQueryDTO.getSize(), hygfIcbcRecordQueryDTO));
}
@TycloudOperation (ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping (value = "/repair")
@ApiOperation (httpMethod = "GET", value = "修复入库失败的数据", notes = "修复入库失败的数据")
public ResponseModel<Object> repair(@RequestParam("userId") String userId) {
return ResponseHelper.buildResponse(hygfIcbcService.repair(userId));
}
}
......@@ -69,8 +69,6 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbcRecord, HygfIcbcRecordMapper>
implements IHygfIcbcService {
private static final String trxChannel = "05"; // 05表示小程序
......@@ -254,8 +252,7 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
* @param request request
* @param response response
* @return {@link Object}
* @throws
* @author yangyang
* @throws @author yangyang
* @date 2024/7/18 20:15
*/
public Object registerWalletCallback(HttpServletRequest request, HttpServletResponse response) throws Exception {
......@@ -302,7 +299,7 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
Map<String, String> data = JSONObject.parseObject(decode, Map.class);
log.debug("解密后参数:{}", 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 newPayAcc = base64Decode(data.get("newPayAcc"));
String outUserId = data.get("outUserId");
......@@ -329,7 +326,7 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
hygfIcbcRequest.setPhase("组装");
hygfIcbcRequest.setException(data.get("custName") + " -> " + peasantHousehold.getOwnersName());
hygfIcbcRequestMapper.updateById(hygfIcbcRequest);
if (hygfIcbcWalletInfo != null) {
hygfIcbcRecord.setCustName(hygfIcbcWalletInfo.getCustName());
hygfIcbcRecord.setIdCard(hygfIcbcWalletInfo.getCertNo());
......@@ -427,11 +424,12 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
.collect(Collectors.groupingBy(PeasantHousehold::getAmosUserId));// 根据农户 ID 分组
List<PeasantHousehold> peasantHouseholdList = peasantHouseholdMap.get(amosUserId);
if(peasantHouseholdList != null && peasantHouseholdList.size() > 0) {
if (peasantHouseholdList != null && peasantHouseholdList.size() > 0) {
peasantHouseholdList.forEach(e -> {
if(e.getSurveyInformationId() != null) {
if (e.getSurveyInformationId() != null) {
e.setScale(householdContractMapper.getHygfCommercialScale(e.getPeasantHouseholdNo()));
e.setRealScale(powerStationEngineeringInfoMapper.getRealScaleByPeasantHouseholdNo(e.getPeasantHouseholdNo()));
e.setRealScale(powerStationEngineeringInfoMapper
.getRealScaleByPeasantHouseholdNo(e.getPeasantHouseholdNo()));
}
});
}
......@@ -601,4 +599,43 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
Map<Object, Boolean> distinctMap = new ConcurrentHashMap<>();
return object -> distinctMap.putIfAbsent(distinctField.apply(object), Boolean.TRUE) == null;
}
public String repair(String userId) {
JftApiUserEntrustopenacctQueryResponseV1 hygfIcbcWalletInfo = getHygfIcbcWalletInfo(userId);
PeasantHousehold peasantHousehold = peasantHouseholdService.lambdaQuery().select(PeasantHousehold::getTelephone)
.eq(PeasantHousehold::getAmosUserId, userId).last("limit 1").one();
HygfIcbcRecord hygfIcbcRecord = this.lambdaQuery().eq(HygfIcbcRecord::getAmosUserId, userId).last(" limit 1")
.one();
if (hygfIcbcRecord == null) {
hygfIcbcRecord = new HygfIcbcRecord();
}
if (hygfIcbcWalletInfo != null) {
hygfIcbcRecord.setPhone(peasantHousehold != null ? peasantHousehold.getTelephone() : "");
hygfIcbcRecord.setMediumId(hygfIcbcWalletInfo.getMediumId());
hygfIcbcRecord.setProjectId("PJ140014023565102203");
hygfIcbcRecord.setOpenAccountStatus(hygfIcbcWalletInfo.getOpenacctStatus());
hygfIcbcRecord.setSignEntrsutPrtlStatus("1");
hygfIcbcRecord.setCustName(hygfIcbcWalletInfo.getCustName());
hygfIcbcRecord.setIdCard(hygfIcbcWalletInfo.getCertNo());
hygfIcbcRecord.setProtocolStatus(hygfIcbcWalletInfo.getProtocolStatus());
hygfIcbcRecord.setProtocolStartTime(hygfIcbcWalletInfo.getProtocolStartDate());
hygfIcbcRecord.setProtocolEndTime(hygfIcbcWalletInfo.getProtocolEndDate());
hygfIcbcRecord.setTrxLimitAmount(hygfIcbcWalletInfo.getTrxLimitAmount());
hygfIcbcRecord.setDayLimitAmount(hygfIcbcWalletInfo.getDayLimitAmount());
hygfIcbcRecord.setProtocolLimitAmount(hygfIcbcWalletInfo.getProtocolLimitAmount());
hygfIcbcRecord.setAppId(hygfIcbcWalletInfo.getAppId());
hygfIcbcRecord.setOutUserId(hygfIcbcWalletInfo.getOutUserId());
hygfIcbcRecord.setOutVendorId(hygfIcbcWalletInfo.getOutVendorId());
} else {
return "开卡信息不存在";
}
// hygfIcbcRecord.setDiscardStatus();
hygfIcbcRecord.setAmosUserId(userId);
hygfIcbcRecord.setRecDate(new Date());
this.saveOrUpdate(hygfIcbcRecord);
return "success";
}
}
\ No newline at end of file
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