Commit 5d2fe622 authored by huyuchen's avatar huyuchen

huych-户配置调整

parent 8c0f5027
package com.yifu.cloud.plus.v1.ekp.controller;
import com.icbc.api.IcbcApiException;
import com.icbc.api.response.MybankEnterpriseAccountQuerybankinfoResponseV1;
import com.yifu.cloud.plus.v1.ekp.entity.EkpBankCodeSet;
import com.yifu.cloud.plus.v1.ekp.service.IcbcTransactionFlowQueryService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
......@@ -109,4 +108,30 @@ public class IcbcTransactionFlowQueryController {
}
return icbcTransactionFlowQueryService.querybankinfo(cardNo);
}
/**
* 指令对账单明细下载
*
* @param
* @param
* @return
*/
@Operation(summary = "指令对账单明细下载", description = "指令对账单明细下载")
@PostMapping("/enterprisePayDowninstr")
public R getEnterprisePayDowninstr() {
return icbcTransactionFlowQueryService.getEnterprisePayDowninstr();
}
/**
* 电子回单下载功能
*
* @param
* @param
* @return
*/
@Operation(summary = "电子回单下载功能", description = "电子回单下载功能")
@PostMapping("/entermeatebillreceive")
public R getMeatebillreceive() {
return icbcTransactionFlowQueryService.getMeatebillreceive();
}
}
......@@ -2,7 +2,6 @@ package com.yifu.cloud.plus.v1.ekp.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.icbc.api.IcbcApiException;
import com.icbc.api.response.MybankEnterpriseAccountQuerybankinfoResponseV1;
import com.yifu.cloud.plus.v1.ekp.entity.EkpBankCodeSet;
import com.yifu.cloud.plus.v1.ekp.entity.EkpSocialInfo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
......@@ -31,4 +30,20 @@ public interface IcbcTransactionFlowQueryService extends IService<EkpSocialInfo>
**/
R<EkpBankCodeSet> querybankinfo(String cardNo);
/**
* @Description: 查询账单明细文件名
* @Author: huyc
* @Date: 2024-12-12
* @return: R
**/
R getEnterprisePayDowninstr();
/**
* @Description: 电子回单下载功能
* @Author: huyc
* @Date: 2024-12-13
* @return: R
**/
R getMeatebillreceive();
}
......@@ -6,14 +6,8 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.icbc.api.DefaultIcbcClient;
import com.icbc.api.IcbcApiException;
import com.icbc.api.IcbcConstants;
import com.icbc.api.request.JftApiB2bpayTransqueryRequestV1;
import com.icbc.api.request.JftApiPayB2bpayGenpreorderRequestV1;
import com.icbc.api.request.MybankEnterpriseAccountQuerybankinfoRequestV1;
import com.icbc.api.request.MybankEnterpriseTradeQhisdRequestV1;
import com.icbc.api.response.JftApiB2bpayTransqueryResponseV1;
import com.icbc.api.response.JftApiPayB2bpayGenpreorderResponseV1;
import com.icbc.api.response.MybankEnterpriseAccountQuerybankinfoResponseV1;
import com.icbc.api.response.MybankEnterpriseTradeQhisdResponseV1;
import com.icbc.api.request.*;
import com.icbc.api.response.*;
import com.yifu.cloud.plus.v1.ekp.config.EkpEntryProperties;
import com.yifu.cloud.plus.v1.ekp.config.IcbcConfigProperties;
import com.yifu.cloud.plus.v1.ekp.entity.EkpBankCodeSet;
......@@ -22,7 +16,6 @@ import com.yifu.cloud.plus.v1.ekp.mapper.EkpSocialInfoMapper;
import com.yifu.cloud.plus.v1.ekp.service.EkpBankCodeSetService;
import com.yifu.cloud.plus.v1.ekp.service.IcbcTransactionFlowQueryService;
import com.yifu.cloud.plus.v1.ekp.vo.EKPEntryPushParam;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import io.micrometer.core.instrument.util.StringUtils;
......@@ -498,6 +491,87 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
}
}
@Override
public R getEnterprisePayDowninstr() {
DefaultIcbcClient client = new DefaultIcbcClient(icbcConfigProperties.getAppId(), IcbcConstants.SIGN_TYPE_CA_SM_ICBC,
icbcConfigProperties.getAppPrivateKey(), IcbcConstants.CHARSET_UTF8, IcbcConstants.FORMAT_JSON, null,
null, null, icbcConfigProperties.getCaSm(), null);
client.setIcbc_ca(icbcConfigProperties.getCaSmIcbc());
try {
MybankEnterprisePayDowninstrRequestV1.MybankEnterprisePayDowninstrRequestBizV1 bizContent =
new MybankEnterprisePayDowninstrRequestV1.MybankEnterprisePayDowninstrRequestBizV1();
MybankEnterprisePayDowninstrRequestV1 request = new MybankEnterprisePayDowninstrRequestV1();
// 请对照接口文档用bizContent.setxxx()方法对业务上送数据进行赋值
bizContent.setTransCode("DOWNINSTR");
bizContent.setTranDate("20241204");
bizContent.setTranTime("103231001");
bizContent.setBeginDate("20241204");
bizContent.setEndDate("20241204");
bizContent.setPayeeAccNo("6222623470001851928");
bizContent.setLanguage("zh_CN");
bizContent.setfSeqNo("WX1733276761404");
bizContent.setServiceCode("PAYENT");
// bizContent.setQryfSeqno("PAYENT411erji17023");
request.setServiceUrl("https://gw.open.icbc.com.cn/api/mybank/enterprise/pay/downinstr/V1");
request.setBizContent(bizContent);
MybankEnterprisePayDowninstrResponseV1 response = client.execute(request);
if (response.isSuccess()) {
// 业务成功处理
return R.ok();
} else {
return R.failed();
}
} catch (Exception e) {
e.printStackTrace();
}
return R.ok();
}
@Override
public R getMeatebillreceive() {
DefaultIcbcClient client = new DefaultIcbcClient(icbcConfigProperties.getAppId(), IcbcConstants.SIGN_TYPE_CA_SM_ICBC,
icbcConfigProperties.getAppPrivateKey(), IcbcConstants.CHARSET_UTF8, IcbcConstants.FORMAT_JSON, null,
null, null, icbcConfigProperties.getCaSm(), null);
client.setIcbc_ca(icbcConfigProperties.getCaSmIcbc());
try {
MybankEnterpriseAccountTradeinfoMeatebillreceiveRequestV1.MybankEnterpriseAccountDownebillRequesBizV1 bizContent =
new MybankEnterpriseAccountTradeinfoMeatebillreceiveRequestV1.MybankEnterpriseAccountDownebillRequesBizV1();
MybankEnterpriseAccountTradeinfoMeatebillreceiveRequestV1 request =
new MybankEnterpriseAccountTradeinfoMeatebillreceiveRequestV1();
bizContent.setTransCode("DownEBill ");
bizContent.setBankCode("102");
bizContent.setCis("");
bizContent.setLoginId("");
bizContent.setTranDate("");
bizContent.setTranTime("");
bizContent.setfSeqno("");
bizContent.setAreaCode("");
bizContent.setNetCode("");
bizContent.setTellerNo("");
bizContent.setWorkDate("");
bizContent.setTranSerialNo("");
bizContent.setAcctNo("");
bizContent.setCurrencyType("");
bizContent.setReqReserved1("");
bizContent.setReqReserved2("");
bizContent.setReqReserved3("");
bizContent.setReqReserved4("");
bizContent.setfSeqno("");
request.setServiceUrl("https://gw.open.icbc.com.cn/api/mybank/enterprise/account/tradeinfo/meatebillreceive/V1");
request.setBizContent(bizContent);
MybankEnterpriseAccountTradeinfoMeatebillreceiveResponseV1 response =
client.execute(request);
if (response.isSuccess()) {
return R.ok();
} else {
return R.failed();
}
} catch (Exception e) {
e.printStackTrace();
}
return R.ok();
}
private void initValue(MybankEnterpriseTradeQhisdResponseV1.MybankEnterpriseTradeQhisdResponseRdV1 entry,
EKPEntryPushParam pushParam,String bankName,String bankNo) throws ParseException {
pushParam.setFd_recipName(entry.getRecipName());
......
......@@ -35,10 +35,6 @@ import java.io.Serializable;
@Data
public class TSocialHouseholdInsertVo extends RowIndex implements Serializable {
@Schema(description = "账户性质")
@ExcelAttribute(name = "账户性质", isExport = false)
private String type;
/**
* 员工姓名
*/
......@@ -187,8 +183,4 @@ public class TSocialHouseholdInsertVo extends RowIndex implements Serializable {
@ExcelProperty("是否自动办理")
private String autoStatus;
@Schema(description ="是否配置公章")
@ExcelAttribute(name = "是否配置公章", isExport = false)
private String isSign;
}
......@@ -31,5 +31,7 @@ public class HouseConfigConstants {
public static final String SUCESS = "成功";
public static final String ERROR_TEMPLATE_SEVEN = "未找到模板中填写的所属机构";
}
......@@ -32,6 +32,7 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysArea;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AllUserNaVo;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AreaVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
......@@ -289,9 +290,11 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
ReadRowHolder readRowHolder = context.readRowHolder();
Integer rowIndex = readRowHolder.getRowIndex();
data.setRowIndex(rowIndex+1);
TSocialHouseholdInsertVo dataReturn = new TSocialHouseholdInsertVo();
BeanCopyUtils.copyProperties(data,dataReturn);
ErrorMessage errorMessage = util1.checkEntity(data, data.getRowIndex());
if (Common.isNotNull(errorMessage)){
errorMessage.setData(data);
errorMessage.setData(dataReturn);
errorMessageList.add(errorMessage);
}else {
cachedDataList.add(data);
......@@ -348,9 +351,11 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
ReadRowHolder readRowHolder = context.readRowHolder();
Integer rowIndex = readRowHolder.getRowIndex();
data.setRowIndex(rowIndex+1);
TSocialHouseholdInsertVo dataReturn = new TSocialHouseholdInsertVo();
BeanCopyUtils.copyProperties(data,dataReturn);
ErrorMessage errorMessage = util1.checkEntity(data, data.getRowIndex());
if (Common.isNotNull(errorMessage)){
errorMessage.setData(data);
errorMessage.setData(dataReturn);
errorMessageList.add(errorMessage);
}else {
cachedDataList.add(data);
......@@ -421,6 +426,18 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
if (!Common.isNotNull(excelVOList)){
return;
}
Map<String, String> dicMap = new HashMap<>();
Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue()
.get(CacheConstants.DICT_DETAILS
+ CommonConstants.COLON_STRING
+ "dept_config_type");
if (Common.isNotNull(dicObj)) {
for (Map.Entry<String, String> entry : dicObj.entrySet()) {
String key = entry.getKey();
String Label = entry.getValue();
dicMap.put(Label, key);
}
}
//获取所有区域数据
HashMap<String, SysArea> areaMap = initAreaMap();
if (Common.isEmpty(areaMap)) {
......@@ -439,7 +456,6 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
}
Map<String,String> exitNameMap = new HashMap<>();
String errorMsg;
SysHouseHoldInfo info;
SysUser auditUser;
SysUser handlerUser;
......@@ -448,7 +464,7 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
for (int i = 0; i < excelVOList.size(); i++) {
TSocialHouseholdInsertVo excel = excelVOList.get(i);
//所属机构去空
excel.setOrganName(excel.getOrganName().trim());
excel.setOrganName(excel.getOrganName().replace(" ",""));
SysHouseHoldInfo household = new SysHouseHoldInfo();
BeanCopyUtils.copyProperties(excel,household);
excel.setProvince(areaMap.get(excel.getProvince()).getAreaName());
......@@ -456,6 +472,12 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
if (Common.isNotNull(excel.getTown())) {
excel.setTown(areaMap.get(excel.getTown()).getAreaName());
}
//判断所属机构是否填写正确
if (Common.isNotNull(dicMap) && Common.isEmpty(dicMap.get(excel.getOrganName()))) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), HouseConfigConstants.ERROR_TEMPLATE_SEVEN,excel));
continue;
}
//判断模板中是否有户重复的数据
if (null == exitNameMap.get(excel.getName())) {
exitNameMap.put(excel.getName(),"1");
......@@ -502,20 +524,19 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
continue;
}
//校验手机号准确性
errorMsg = checkMobile(String.valueOf(excel.getPhone()));
if (!errorMsg.contains(HouseConfigConstants.SUCESS)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), errorMsg,excel));
continue;
}
// errorMsg = checkMobile(String.valueOf(excel.getPhone()));
// if (!errorMsg.contains(HouseConfigConstants.SUCESS)) {
// errorMessageList.add(new ErrorMessage(excel.getRowIndex(), errorMsg,excel));
// continue;
// }
//封装和插入数据
household.setAreaCode(areaMap.get(household.getCity()).getAreaCode());
household.setAutoStatus(excel.getAutoStatus().equals(CommonConstants.IS_TRUE) ? "0" : "1");
household.setType("0");
household.setHouseType(excel.getHouseType().equals(HouseConfigConstants.HOUSE_TYPE_ONE) ? "0" : "1");
household.setHouseType(excel.getHouseType().equals(HouseConfigConstants.HOUSE_TYPE_ONE) ? "1" : "0");
household.setAuditUser(null == auditUser.getUserId() ? "" : auditUser.getUserId());
household.setAuditUserDeptName(null == auditUser.getDeptName() ? "" : auditUser.getDeptName());
household.setHandleUser(null == handlerUser.getUserId() ? "" :handlerUser.getUserId());
household.setHandleUserDeptName(null == handlerUser.getDeptName() ? "" : handlerUser.getDeptName());
household.setOrganId(dicMap.get(household.getOrganName()));
baseMapper.insert(household);
// 同步审核权限、办理权限
this.saveAuditUserOrHandleUser(household, CommonConstants.ZERO_STRING);
......@@ -529,6 +550,18 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
if (!Common.isNotNull(excelVOList)){
return;
}
Map<String, String> dicMap = new HashMap<>();
Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue()
.get(CacheConstants.DICT_DETAILS
+ CommonConstants.COLON_STRING
+ "dept_config_type");
if (Common.isNotNull(dicObj)) {
for (Map.Entry<String, String> entry : dicObj.entrySet()) {
String key = entry.getKey();
String Label = entry.getValue();
dicMap.put(Label, key);
}
}
//获取所有区域数据
HashMap<String, SysArea> areaMap = initAreaMap();
if (Common.isEmpty(areaMap)) {
......@@ -546,17 +579,11 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
errorMessageList.add(new ErrorMessage(1, "获取人员信息数据失败"));
}
Map<String,String> exitNameMap = new HashMap<>();
String errorMsg;
SysHouseHoldInfo info;
// 个性化校验逻辑
// 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) {
TSocialHouseholdUpdateVo excel = excelVOList.get(i);
//校验省市县
if (Common.isNotNull(excel.getProvince()) && Common.isEmpty(excel.getProvince())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), HouseConfigConstants.ERROR_TEMPLATE_SIX,excel));
continue;
}
info = this.getOne(Wrappers.<SysHouseHoldInfo>query().lambda()
.eq(SysHouseHoldInfo::getType,CommonConstants.ZERO_STRING)
.eq(SysHouseHoldInfo::getName,excel.getName())
......@@ -584,6 +611,20 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), HouseConfigConstants.ERROR_NOT_EXIT,excel));
continue;
}
if (Common.isNotNull(excel.getOrganName())) {
excel.setOrganName(excel.getOrganName().replace(" ",""));
if (Common.isNotNull(dicMap) && Common.isEmpty(dicMap.get(excel.getOrganName()))) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), HouseConfigConstants.ERROR_TEMPLATE_SEVEN, excel));
continue;
} else {
info.setOrganId(dicMap.get(excel.getOrganName()));
}
}
//校验省市县
if (Common.isNotNull(excel.getProvince()) && Common.isEmpty(excel.getProvince())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), HouseConfigConstants.ERROR_TEMPLATE_SIX,excel));
continue;
}
//判断模板中是否有户重复的数据
if (null == exitNameMap.get(excel.getName())) {
exitNameMap.put(excel.getName(),"1");
......@@ -622,13 +663,13 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
}
//校验手机号准确性
if (Common.isNotNull(excel.getPhone())) {
errorMsg = checkMobile(String.valueOf(excel.getPhone()));
if (!errorMsg.contains(HouseConfigConstants.SUCESS)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), errorMsg, excel));
continue;
}
}
// if (Common.isNotNull(excel.getPhone())) {
// errorMsg = checkMobile(String.valueOf(excel.getPhone()));
// if (!errorMsg.contains(HouseConfigConstants.SUCESS)) {
// errorMessageList.add(new ErrorMessage(excel.getRowIndex(), errorMsg, excel));
// continue;
// }
// }
// 新老数据审核人办理人不同,先删除,再添加
if (Common.isNotNull(excel.getAuditUserName()) && !excel.getAuditUserName().equals(info.getAuditUserName())) {
tSocialfundHouseResService.deleteAuditUser(info);
......@@ -642,7 +683,7 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
}
//更新数据
updateHouseInfo(excel,info,userMap);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(),CommonConstants.UPDATE_SUCCESS));
errorMessageList.add(new ErrorMessage(excel.getRowIndex(),CommonConstants.UPDATE_SUCCESS,excel));
}
}
......@@ -670,13 +711,13 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
private void updateHouseInfo (TSocialHouseholdUpdateVo excel,SysHouseHoldInfo info,
Map<String,SysUser> userMap) {
if (Common.isNotNull(excel.getHouseType())) {
info.setHouseType(excel.getHouseType().equals(HouseConfigConstants.HOUSE_TYPE_ONE) ? "0" : "1");
info.setHouseType(excel.getHouseType().equals(HouseConfigConstants.HOUSE_TYPE_ONE) ? "1" : "0");
}
if (Common.isNotNull(excel.getAutoStatus())) {
info.setAutoStatus(excel.getAutoStatus().equals(CommonConstants.IS_TRUE) ? "0" : "1");
}
if (Common.isNotNull(excel.getOrganName())) {
info.setOrganName(excel.getOrganName().trim());
info.setOrganName(excel.getOrganName());
}
if (Common.isNotNull(excel.getPhone())) {
info.setPhone(String.valueOf(excel.getPhone()));
......@@ -703,13 +744,11 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
SysUser auditUser = userMap.get(excel.getAuditUserName());
info.setAuditUser(auditUser.getUserId());
info.setAuditUserName(excel.getAuditUserName());
info.setAuditUserDeptName(auditUser.getDeptName());
}
if (Common.isNotNull(excel.getHandleUserName())) {
SysUser handlerUser = userMap.get(excel.getHandleUserName());
info.setHandleUser(handlerUser.getUserId());
info.setHandleUserName(excel.getAuditUserName());
info.setHandleUserDeptName(handlerUser.getDeptName());
info.setHandleUserName(excel.getHandleUserName());
}
baseMapper.updateById(info);
}
......
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