提交代码

yy_dev
胡锐 1 year ago
parent 86846f0ede
commit a3acbca28e
  1. 108
      cweb/src/main/java/com/cweb/notify/TianQueController.java
  2. 5
      schedule/src/main/java/com/hfkj/schedule/Merchant.java
  3. 2
      service/src/main/java/com/hfkj/channel/tianque/service/TianQueMerService.java
  4. 17
      service/src/main/java/com/hfkj/dao/BsMerPlatformNoMapper.java
  5. 14
      service/src/main/java/com/hfkj/dao/BsMerPlatformNoSqlProvider.java
  6. 28
      service/src/main/java/com/hfkj/entity/BsMerPlatformNo.java
  7. 70
      service/src/main/java/com/hfkj/entity/BsMerPlatformNoExample.java
  8. 51
      service/src/main/java/com/hfkj/sysenum/MerPlatformNoStatusEnum.java

@ -3,6 +3,7 @@ package com.cweb.notify;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.channel.lakala.LaKaLaLedgerService;
import com.hfkj.channel.lakala.LaKaLaWalletService;
import com.hfkj.channel.tianque.service.TianQueMerElecSignService;
import com.hfkj.config.CommonSysConst;
import com.hfkj.entity.*;
import com.hfkj.service.*;
@ -22,6 +23,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.BufferedOutputStream;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
@ -37,21 +39,20 @@ public class TianQueController {
@Resource
private BsTradeOrderService tradeOrderService;
@Resource
private BsTradeOrderMsgService tradeOrderMsgService;
@Resource
private BsMerLedgerService merLedgerService;
private BsMerService merService;
@Resource
private BsMerLedgerApplyService merLedgerApplyService;
private BsMerPlatformNoService merPlatformNoService;
@Resource
private BsMerLedgerReceiverService merLedgerReceiverService;
private BsStoreService storeService;
@Resource
private BsMerLedgerReceiverApplyService merLedgerReceiverApplyService;
private BsMerContractRecordService merContractRecordService;
@Resource
private LaKaLaLedgerService laKaLaLedgerService;
private BsMerContractRecordMsgService merContractRecordMsgService;
@Resource
private LaKaLaWalletService laKaLaWalletService;
private TianQueMerElecSignService tianQueMerElecSignService;
@RequestMapping(value="/microPay",method = RequestMethod.POST)
@ResponseBody
@ -136,47 +137,88 @@ public class TianQueController {
@RequestMapping(value="/applyLedgerMer",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "商户进件通知")
public void merInbound(@RequestBody String reqBody) {
public void merInbound(@RequestBody String reqBody, HttpServletResponse response) {
try {
log.info("商户进件通知", reqBody);
System.out.println(reqBody);
JSONObject respData = JSONObject.parseObject(reqBody);
BsMerLedgerApply ledgerApply = merLedgerApplyService.getApplyByApplyId(respData.getString("applicationId"));
if (ledgerApply != null) {
ledgerApply.setNotifyBody(reqBody);
merLedgerApplyService.editMerLedgerApply(ledgerApply);
// 查询商户分账信息
BsMerLedger merLedger = merLedgerService.getMerLedgerById(ledgerApply.getMerLedgerId());
if (merLedger != null) {
// 审核状态 1:通过,2拒绝
if (respData.getString("auditStatus").equals("1")) {
merLedger.setStatus(MerLedgerStatusEnum.status1.getNumber());
merLedgerService.editMerLedger(merLedger);
// 延迟3秒
Thread.sleep(3000);
// 提现通知地址
String notifyUrl = CommonSysConst.getSysConfig().getDomainName()+"/crest/merWithdrawal/notify?cupNo="+merLedger.getCupNo();
BsMerContractRecord merContractRecord = merContractRecordService.getRecordByOrderNo(respData.getString("applicationId"));
if (merContractRecord != null) {
// 审核状态,枚举值 取值范围:1 入驻通过 2 入驻驳回 5 商户修改通过 6 商户修改驳回
if (respData.getString("taskStatus").equals("1") || respData.getString("taskStatus").equals("5")) {
merContractRecord.setStatus(2);
} else {
merContractRecord.setStatus(3);
}
merContractRecordService.updateRecord(merContractRecord);
BsMerContractRecordMsg merContractRecordMsg = new BsMerContractRecordMsg();
merContractRecordMsg.setOrderNo(merContractRecord.getOrderNo());
merContractRecordMsg.setType(1);
merContractRecordMsg.setResponseCode(merContractRecord.getStatus().equals(2)?"SUCCESS":"REJECT");
merContractRecordMsg.setResponseMsg(respData.getString("suggestion"));
merContractRecordMsgService.insertRecordMsg(merContractRecordMsg);
// 查询商户
BsMer mer = merService.getMer(merContractRecord.getMerId());
if (mer != null && mer.getMerStatus().equals(MerStatusEnum.status3.getNumber())) {
if (merContractRecord.getStatus().equals(2)) {
mer.setMerStatus(MerStatusEnum.status1.getNumber());
merService.editMer(mer);
List<BsStore> storeList = storeService.getStoreByMerId(mer.getId(), StoreCreateTypeEnum.type1);
if (storeList.size() > 0) {
BsStore store = storeList.get(0);
store.setStatus(StoreStatusEnum.status2.getNumber());
storeService.editStore(store);
}
// 配置账户自动结算
laKaLaWalletService.ewalletSettleProfile(1,merLedger.getCupNo(), "02", "06", notifyUrl);
BsMerPlatformNo merPlatformNo = merPlatformNoService.getPlatformNo(mer.getId(), PlatformTypeEnum.type5);
if (merPlatformNo != null) {
merPlatformNo.setStatus(MerPlatformNoStatusEnum.status1.getNumber());
merPlatformNoService.editMerPlatformNo(merPlatformNo);
}
// 配置分账接收方账户自动结算
laKaLaWalletService.ewalletSettleProfile(2,merLedger.getReceiverNo(), "02", "06", notifyUrl);
// 签署协议
tianQueMerElecSignService.openElecSignature(respData.getString("mno"));
} else {
merLedger.setStatus(MerLedgerStatusEnum.status3.getNumber());
merLedger.setRejectReason(respData.getString("remark"));
merLedgerService.editMerLedger(merLedger);
mer.setMerStatus(MerStatusEnum.status4.getNumber());
merService.editMer(mer);
List<BsStore> storeList = storeService.getStoreByMerId(mer.getId(), StoreCreateTypeEnum.type1);
if (storeList.size() > 0) {
BsStore store = storeList.get(0);
store.setStatus(StoreStatusEnum.status4.getNumber());
storeService.editStore(store);
}
BsMerPlatformNo merPlatformNo = merPlatformNoService.getPlatformNo(mer.getId(), PlatformTypeEnum.type5);
if (merPlatformNo != null) {
merPlatformNo.setStatus(MerPlatformNoStatusEnum.status3.getNumber());
merPlatformNo.setSuggestionReject(respData.getString("suggestion"));
merPlatformNoService.editMerPlatformNo(merPlatformNo);
}
}
}
}
} catch (Exception e) {
log.error("login error!",e);
} finally {
try {
BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream());
JSONObject result = new JSONObject();
result.put("code", "success");
result.put("msg", "成功");
out.write(result.toJSONString().getBytes());
out.flush();
out.close();
} catch (Exception e) {
}
}
}

@ -191,10 +191,9 @@ public class Merchant {
List<BsMerContractRecord> list = merContractRecordService.getContractRecordList(param);
for (BsMerContractRecord contractRecord : list) {
try {
BsMer mer = merService.getMer(contractRecord.getMerId());
if (mer != null && mer.getMerStatus().equals(MerStatusEnum.status3.getNumber())) {
if (contractRecord.getPlatformType().equals(PlatformTypeEnum.type1.getNumber())) {
BsMerPlatformNo platform = merPlatformNoService.getPlatformNo(mer.getId(), PlatformTypeEnum.type1);
if (platform != null) {
JSONObject merchantInfo = saasMerService.merchantInfo(platform.getPlatformNo());
@ -283,11 +282,11 @@ public class Merchant {
merContractRecordMsg.setType(1);
merContractRecordMsg.setResponseCode(customer.getString("customerStatus"));
merContractRecordMsg.setResponseMsg(customer.getString("auditRemark"));
merContractRecordMsg.setResponseMsg(customer.getString("auditRemark"));
merContractRecordMsgService.insertRecordMsg(merContractRecordMsg);
}
}
}
}
} catch (Exception e) {
}

@ -16,6 +16,7 @@ import com.hfkj.service.BsMerContractRecordMsgService;
import com.hfkj.service.BsMerContractRecordService;
import com.hfkj.service.BsMerPlatformNoService;
import com.hfkj.service.BsMerService;
import com.hfkj.sysenum.MerPlatformNoStatusEnum;
import com.hfkj.sysenum.MerSettleType;
import com.hfkj.sysenum.MerTypeEnum;
import com.hfkj.sysenum.PlatformTypeEnum;
@ -212,6 +213,7 @@ public class TianQueMerService {
platform.setMerNo(basisModel.getMerNo());
platform.setPlatformType(PlatformTypeEnum.type5.getNumber());
platform.setPlatformNo(response.getString("mno"));
platform.setStatus(MerPlatformNoStatusEnum.status2.getNumber());
merPlatformNoService.editMerPlatformNo(platform);
// 增加进件记录

@ -46,8 +46,9 @@ public interface BsMerPlatformNoMapper extends BsMerPlatformNoMapperExt {
"mer_public_key, platform_operator_id, ",
"platform_operator_pwd, refund_cert_url, ",
"refund_cert_pwd, `status`, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"suggestion_reject, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"values (#{companyId,jdbcType=BIGINT}, #{agentId,jdbcType=BIGINT}, ",
"#{merId,jdbcType=BIGINT}, #{merNo,jdbcType=VARCHAR}, #{platformType,jdbcType=INTEGER}, ",
"#{platformNo,jdbcType=VARCHAR}, #{cupNo,jdbcType=VARCHAR}, ",
@ -55,8 +56,9 @@ public interface BsMerPlatformNoMapper extends BsMerPlatformNoMapperExt {
"#{merPublicKey,jdbcType=VARCHAR}, #{platformOperatorId,jdbcType=VARCHAR}, ",
"#{platformOperatorPwd,jdbcType=VARCHAR}, #{refundCertUrl,jdbcType=VARCHAR}, ",
"#{refundCertPwd,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"#{suggestionReject,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsMerPlatformNo record);
@ -83,6 +85,7 @@ public interface BsMerPlatformNoMapper extends BsMerPlatformNoMapperExt {
@Result(column="refund_cert_url", property="refundCertUrl", jdbcType=JdbcType.VARCHAR),
@Result(column="refund_cert_pwd", property="refundCertPwd", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="suggestion_reject", property="suggestionReject", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@ -95,8 +98,8 @@ public interface BsMerPlatformNoMapper extends BsMerPlatformNoMapperExt {
"select",
"id, company_id, agent_id, mer_id, mer_no, platform_type, platform_no, cup_no, ",
"pos_id, branch_id, mer_public_key, platform_operator_id, platform_operator_pwd, ",
"refund_cert_url, refund_cert_pwd, `status`, create_time, update_time, ext_1, ",
"ext_2, ext_3",
"refund_cert_url, refund_cert_pwd, `status`, suggestion_reject, create_time, ",
"update_time, ext_1, ext_2, ext_3",
"from bs_mer_platform_no",
"where id = #{id,jdbcType=BIGINT}"
})
@ -117,6 +120,7 @@ public interface BsMerPlatformNoMapper extends BsMerPlatformNoMapperExt {
@Result(column="refund_cert_url", property="refundCertUrl", jdbcType=JdbcType.VARCHAR),
@Result(column="refund_cert_pwd", property="refundCertPwd", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="suggestion_reject", property="suggestionReject", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@ -151,6 +155,7 @@ public interface BsMerPlatformNoMapper extends BsMerPlatformNoMapperExt {
"refund_cert_url = #{refundCertUrl,jdbcType=VARCHAR},",
"refund_cert_pwd = #{refundCertPwd,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},",
"suggestion_reject = #{suggestionReject,jdbcType=VARCHAR},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",

@ -88,6 +88,10 @@ public class BsMerPlatformNoSqlProvider {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getSuggestionReject() != null) {
sql.VALUES("suggestion_reject", "#{suggestionReject,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
@ -133,6 +137,7 @@ public class BsMerPlatformNoSqlProvider {
sql.SELECT("refund_cert_url");
sql.SELECT("refund_cert_pwd");
sql.SELECT("`status`");
sql.SELECT("suggestion_reject");
sql.SELECT("create_time");
sql.SELECT("update_time");
sql.SELECT("ext_1");
@ -219,6 +224,10 @@ public class BsMerPlatformNoSqlProvider {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getSuggestionReject() != null) {
sql.SET("suggestion_reject = #{record.suggestionReject,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
@ -263,6 +272,7 @@ public class BsMerPlatformNoSqlProvider {
sql.SET("refund_cert_url = #{record.refundCertUrl,jdbcType=VARCHAR}");
sql.SET("refund_cert_pwd = #{record.refundCertPwd,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("suggestion_reject = #{record.suggestionReject,jdbcType=VARCHAR}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
@ -338,6 +348,10 @@ public class BsMerPlatformNoSqlProvider {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getSuggestionReject() != null) {
sql.SET("suggestion_reject = #{suggestionReject,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
}

@ -89,10 +89,15 @@ public class BsMerPlatformNo implements Serializable {
private String refundCertPwd;
/**
* 状态 0不可用 1可用
* 状态 0不可用 1可用 2 审核中 3审核驳回
*/
private Integer status;
/**
* 审核驳回原因
*/
private String suggestionReject;
/**
* 创建时间
*/
@ -109,16 +114,6 @@ public class BsMerPlatformNo implements Serializable {
private String ext3;
BsMerPlatformTerm merPlatformTerm;
public BsMerPlatformTerm getMerPlatformTerm() {
return merPlatformTerm;
}
public void setMerPlatformTerm(BsMerPlatformTerm merPlatformTerm) {
this.merPlatformTerm = merPlatformTerm;
}
private static final long serialVersionUID = 1L;
public Long getId() {
@ -249,6 +244,14 @@ public class BsMerPlatformNo implements Serializable {
this.status = status;
}
public String getSuggestionReject() {
return suggestionReject;
}
public void setSuggestionReject(String suggestionReject) {
this.suggestionReject = suggestionReject;
}
public Date getCreateTime() {
return createTime;
}
@ -317,6 +320,7 @@ public class BsMerPlatformNo implements Serializable {
&& (this.getRefundCertUrl() == null ? other.getRefundCertUrl() == null : this.getRefundCertUrl().equals(other.getRefundCertUrl()))
&& (this.getRefundCertPwd() == null ? other.getRefundCertPwd() == null : this.getRefundCertPwd().equals(other.getRefundCertPwd()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getSuggestionReject() == null ? other.getSuggestionReject() == null : this.getSuggestionReject().equals(other.getSuggestionReject()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1()))
@ -344,6 +348,7 @@ public class BsMerPlatformNo implements Serializable {
result = prime * result + ((getRefundCertUrl() == null) ? 0 : getRefundCertUrl().hashCode());
result = prime * result + ((getRefundCertPwd() == null) ? 0 : getRefundCertPwd().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getSuggestionReject() == null) ? 0 : getSuggestionReject().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
@ -374,6 +379,7 @@ public class BsMerPlatformNo implements Serializable {
sb.append(", refundCertUrl=").append(refundCertUrl);
sb.append(", refundCertPwd=").append(refundCertPwd);
sb.append(", status=").append(status);
sb.append(", suggestionReject=").append(suggestionReject);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", ext1=").append(ext1);

@ -1185,6 +1185,76 @@ public class BsMerPlatformNoExample {
return (Criteria) this;
}
public Criteria andSuggestionRejectIsNull() {
addCriterion("suggestion_reject is null");
return (Criteria) this;
}
public Criteria andSuggestionRejectIsNotNull() {
addCriterion("suggestion_reject is not null");
return (Criteria) this;
}
public Criteria andSuggestionRejectEqualTo(String value) {
addCriterion("suggestion_reject =", value, "suggestionReject");
return (Criteria) this;
}
public Criteria andSuggestionRejectNotEqualTo(String value) {
addCriterion("suggestion_reject <>", value, "suggestionReject");
return (Criteria) this;
}
public Criteria andSuggestionRejectGreaterThan(String value) {
addCriterion("suggestion_reject >", value, "suggestionReject");
return (Criteria) this;
}
public Criteria andSuggestionRejectGreaterThanOrEqualTo(String value) {
addCriterion("suggestion_reject >=", value, "suggestionReject");
return (Criteria) this;
}
public Criteria andSuggestionRejectLessThan(String value) {
addCriterion("suggestion_reject <", value, "suggestionReject");
return (Criteria) this;
}
public Criteria andSuggestionRejectLessThanOrEqualTo(String value) {
addCriterion("suggestion_reject <=", value, "suggestionReject");
return (Criteria) this;
}
public Criteria andSuggestionRejectLike(String value) {
addCriterion("suggestion_reject like", value, "suggestionReject");
return (Criteria) this;
}
public Criteria andSuggestionRejectNotLike(String value) {
addCriterion("suggestion_reject not like", value, "suggestionReject");
return (Criteria) this;
}
public Criteria andSuggestionRejectIn(List<String> values) {
addCriterion("suggestion_reject in", values, "suggestionReject");
return (Criteria) this;
}
public Criteria andSuggestionRejectNotIn(List<String> values) {
addCriterion("suggestion_reject not in", values, "suggestionReject");
return (Criteria) this;
}
public Criteria andSuggestionRejectBetween(String value1, String value2) {
addCriterion("suggestion_reject between", value1, value2, "suggestionReject");
return (Criteria) this;
}
public Criteria andSuggestionRejectNotBetween(String value1, String value2) {
addCriterion("suggestion_reject not between", value1, value2, "suggestionReject");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;

@ -0,0 +1,51 @@
package com.hfkj.sysenum;
import java.util.Objects;
/**
* @className: MerPlatformNoStatus
* @author: HuRui
* @date: 2023/8/30
**/
public enum MerPlatformNoStatusEnum {
status0(0, "不可用"),
status1(1, "可用"),
status2(2, "审核中"),
status3(3, "审核驳回"),
;
private Integer number;
private String name;
MerPlatformNoStatusEnum(int number, String name) {
this.number = number;
this.name = name;
}
public static MerPlatformNoStatusEnum getDataByNumber(Integer number) {
for (MerPlatformNoStatusEnum ele : values()) {
if (Objects.equals(number,ele.getNumber())) {
return ele;
}
}
return null;
}
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
Loading…
Cancel
Save