添加汇付支付

This commit is contained in:
韩鹏辉
2024-01-19 14:50:53 +08:00
parent f930f5a274
commit 7e90ab73b0
3 changed files with 27 additions and 14 deletions

View File

@@ -125,6 +125,8 @@
<configuration> <configuration>
<mainClass>com.chaozhanggui.admin.system.Shell</mainClass> <mainClass>com.chaozhanggui.admin.system.Shell</mainClass>
<outputDirectory>./</outputDirectory> <outputDirectory>./</outputDirectory>
<fork>true</fork>
<includeSystemScope>true</includeSystemScope>
</configuration> </configuration>
<executions> <executions>
<execution> <execution>

View File

@@ -156,6 +156,6 @@
</select> </select>
<select id="selectByStatus" resultMap="BaseResultMap"> <select id="selectByStatus" resultMap="BaseResultMap">
select * from tb_pluss_merchant_audit_record where channel=7 and thirdStatus=1 select * from tb_pluss_merchant_audit_record where channel=7 and thirdStatus=3 and applicationId like concat('merchantResident_','%')
</select> </select>
</mapper> </mapper>

View File

@@ -24,6 +24,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpMethod; import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.mock.web.MockMultipartFile; import org.springframework.mock.web.MockMultipartFile;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@@ -1892,7 +1893,7 @@ public class HfMerService {
log.info("私钥:{}",privateKey); log.info("私钥:{}",privateKey);
Map<String, Object> merchantEntryParams = new HashMap<>(10); Map<String, Object> merchantEntryParams = new HashMap<>(10);
merchantEntryParams.put("request_id", requestId);//请求流水号 merchantEntryParams.put("request_id", "openAccount_"+requestId);//请求流水号
merchantEntryParams.put("usr_phone", baseInfo.getContactmobile());//注册手机号 merchantEntryParams.put("usr_phone", baseInfo.getContactmobile());//注册手机号
merchantEntryParams.put("cont_name", baseInfo.getContactname()); //联系人姓名 merchantEntryParams.put("cont_name", baseInfo.getContactname()); //联系人姓名
merchantEntryParams.put("cont_phone", baseInfo.getContactmobile());//联系人电话 merchantEntryParams.put("cont_phone", baseInfo.getContactmobile());//联系人电话
@@ -2181,16 +2182,14 @@ public class HfMerService {
tbPlussMerchantHfInfoMapper.updateByPrimaryKey(hfInfo); tbPlussMerchantHfInfoMapper.updateByPrimaryKey(hfInfo);
record.setThirdstatus("5");
record.setUpdatetime(new Date());
tbPlussMerchantAuditRecordMapper.updateByPrimaryKeySelective(record);
channelStatus.setStatus("3"); channelStatus.setStatus("3");
channelStatus.setStatus("00"); channelStatus.setThirdstatus("00");
channelStatus.setRemark("汇付审核通过");
channelStatus.setMercname(null); channelStatus.setMercname(null);
tbPlussMerchantChannelStatusMapper.updateByPrimaryKeySelective(channelStatus); tbPlussMerchantChannelStatusMapper.updateByPrimaryKeySelective(channelStatus);
Map map=null; Map map=null;
//上传证照 //上传证照
TbPlussMerchantBaseInfo baseInfo= tbPlussMerchantBaseInfoMapper.selectByMerchantcode(record.getMerchantcode()); TbPlussMerchantBaseInfo baseInfo= tbPlussMerchantBaseInfoMapper.selectByMerchantcode(record.getMerchantcode());
@@ -2283,6 +2282,7 @@ public class HfMerService {
tbPlussMerchantHfInfoMapper.updateByPrimaryKey(hfInfo); tbPlussMerchantHfInfoMapper.updateByPrimaryKey(hfInfo);
record.setThirdstatus("5"); record.setThirdstatus("5");
record.setStatus("1");
record.setUpdatetime(new Date()); record.setUpdatetime(new Date());
tbPlussMerchantAuditRecordMapper.updateByPrimaryKeySelective(record); tbPlussMerchantAuditRecordMapper.updateByPrimaryKeySelective(record);
@@ -2332,7 +2332,7 @@ public class HfMerService {
init(); init();
String requestId= SnowFlakeUtil.nextId().toString(); String requestId= SnowFlakeUtil.nextId().toString();
Map<String, Object> merchantEntryParams = new HashMap<>(10); Map<String, Object> merchantEntryParams = new HashMap<>(10);
merchantEntryParams.put("request_id", requestId);//测试时每次请求需修改流水 merchantEntryParams.put("request_id", "merchantResident_"+requestId);//测试时每次请求需修改流水
merchantEntryParams.put("sub_Api_Key", sub_Api_Key);//商户进件后返回的生产或者测试API Key merchantEntryParams.put("sub_Api_Key", sub_Api_Key);//商户进件后返回的生产或者测试API Key
merchantEntryParams.put("fee_type", "02");//费率01-标准费率线上02-标准费率线下 merchantEntryParams.put("fee_type", "02");//费率01-标准费率线上02-标准费率线下
merchantEntryParams.put("app_id", app_id);//商户进件后返回的应用ID merchantEntryParams.put("app_id", app_id);//商户进件后返回的应用ID
@@ -2368,7 +2368,7 @@ public class HfMerService {
merchantAuditRecord.setMerchantcode(baseInfo.getMerchantcode()); merchantAuditRecord.setMerchantcode(baseInfo.getMerchantcode());
merchantAuditRecord.setChannel(7); merchantAuditRecord.setChannel(7);
merchantAuditRecord.setMerchantid(sub_Api_Key); merchantAuditRecord.setMerchantid(sub_Api_Key);
merchantAuditRecord.setThirdstatus("1"); merchantAuditRecord.setThirdstatus("3");
merchantAuditRecord.setApplicationid(requestId); merchantAuditRecord.setApplicationid(requestId);
merchantAuditRecord.setCreatetime(new Date()); merchantAuditRecord.setCreatetime(new Date());
tbPlussMerchantAuditRecordMapper.insert(merchantAuditRecord); tbPlussMerchantAuditRecordMapper.insert(merchantAuditRecord);
@@ -2387,8 +2387,7 @@ public class HfMerService {
log.info("商户入驻merchant config result=" + JSON.toJSONString(merchantResident)); log.info("商户入驻merchant config result=" + JSON.toJSONString(merchantResident));
} }
@Scheduled(initialDelay = 1000,fixedDelay = 10000)
public void queryMerchantResident(){ public void queryMerchantResident(){
List<TbPlussMerchantAuditRecord> records= tbPlussMerchantAuditRecordMapper.selectByStatus(); List<TbPlussMerchantAuditRecord> records= tbPlussMerchantAuditRecordMapper.selectByStatus();
if(ObjectUtil.isEmpty(records)){ if(ObjectUtil.isEmpty(records)){
@@ -2396,7 +2395,7 @@ public class HfMerService {
return; return;
} }
for (TbPlussMerchantAuditRecord record : records) { for (TbPlussMerchantAuditRecord record : records) {
queryResident(record.getApplicationid());
} }
} }
@@ -2404,9 +2403,21 @@ public class HfMerService {
public void queryResident(String requestId){ public void queryResident(String requestId){
// MerchantResident.query() init();
Map<String, Object> merchantEntryParams = new HashMap<>(10);
merchantEntryParams.put("request_id",requestId);
try {
Map<String, Object> queryMap= MerchantResident.query(merchantEntryParams);
if(ObjectUtil.isNotEmpty(queryMap)&&"succeeded".equals(queryMap.get("status").toString())){
authInfo(requestId);
}
} catch (BaseAdaPayException e) {
e.printStackTrace();
}
} }