Merge remote-tracking branch 'origin/master'

This commit is contained in:
韩鹏辉 2024-02-20 15:14:38 +08:00
commit a7eb6e2028
7 changed files with 236 additions and 2 deletions

View File

@ -89,6 +89,13 @@ public class AgencyController {
return agencyService.queryAgency(userId,userType,agencyCode,isExtend,pageNum,pageSize);
}
@GetMapping(value = "/queryMerchantCashPlace")
public RespBody queryMerchantCashPlace(@RequestParam("pageNum") Integer pageNum,@RequestParam("pageSzie") Integer pageSize){
return agencyService.queryMerchantCashPlace(pageNum,pageSize);
}
/**
* 获取商户列表

View File

@ -8,6 +8,7 @@ import com.chaozhanggui.common.system.util.StringUtil;
import com.chaozhanggui.common.system.config.RespBody;
import com.chaozhanggui.dao.system.dao.*;
import com.chaozhanggui.dao.system.entity.*;
import com.chaozhanggui.dao.system.entity.VO.MerchantCashVO;
import com.chaozhanggui.dao.system.model.CashStatus;
import com.chaozhanggui.dao.system.model.ProfitPO;
import com.chaozhanggui.dao.system.util.N;
@ -23,6 +24,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource;
@ -60,6 +62,8 @@ public class AgencyService {
@Resource
private TbPlussIdCardMapper idCardMapper;
@Autowired
RestTemplate restTemplate;
@ -505,7 +509,16 @@ public class AgencyService {
return new RespBody("000000",pageInfo);
}
/**
* 收银点列表
* @return
*/
public RespBody queryMerchantCashPlace( Integer pageNum, Integer pageSize){
PageHelper.startPage(pageNum, pageSize);
List<MerchantCashVO> merchantBaseInfoList = tbPlussMerchantBaseInfoMapper.selectByMasterMerchantCode();
PageInfo pageInfo=new PageInfo(merchantBaseInfoList);
return new RespBody("000000",pageInfo);
}
public List<TbPlussUserPromotion> getUserId(String userId,List<TbPlussUserPromotion> list){

View File

@ -2,10 +2,13 @@ package com.chaozhanggui.dao.system.dao;
import com.chaozhanggui.dao.system.entity.TbPlussMerchantBaseInfo;
import com.chaozhanggui.dao.system.entity.VO.MerchantCashVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Mapper
public interface TbPlussMerchantBaseInfoMapper {
@ -26,4 +29,6 @@ public interface TbPlussMerchantBaseInfoMapper {
TbPlussMerchantBaseInfo selectByUserId(String userId);
TbPlussMerchantBaseInfo selectByMerchantcode(String merchantcode);
List<MerchantCashVO> selectByMasterMerchantCode();
}

View File

@ -135,6 +135,33 @@ public class TbPlussMerchantBaseInfo implements Serializable {
private Byte validflag;
/**
* ()多收银点主商户号
*/
private String masterMerchantCode;
/**
* 通道切换标记
*/
private Integer tab;
public String getMasterMerchantCode() {
return masterMerchantCode;
}
public void setMasterMerchantCode(String masterMerchantCode) {
this.masterMerchantCode = masterMerchantCode;
}
public Integer getTab() {
return tab;
}
public void setTab(Integer tab) {
this.tab = tab;
}
public LicenseVO getLicense() {
return license;
}

View File

@ -0,0 +1,80 @@
package com.chaozhanggui.dao.system.entity.VO;
/**
* 收银点列表
* @author lyf
*/
public class MerchantCashVO {
/**
* 收银点名称
*/
private String name;
/**
* 收银点code
*/
private String subcode;
/**
* 收银点地址
*/
private String address;
/**
* 主账号名称
*/
private String masterName;
/**
* 主账号商户code
*/
private String masterCode;
/**
* 主账号userId
*/
private String masterUserId;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSubcode() {
return subcode;
}
public void setSubcode(String subcode) {
this.subcode = subcode;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getMasterName() {
return masterName;
}
public void setMasterName(String masterName) {
this.masterName = masterName;
}
public String getMasterCode() {
return masterCode;
}
public void setMasterCode(String masterCode) {
this.masterCode = masterCode;
}
public String getMasterUserId() {
return masterUserId;
}
public void setMasterUserId(String masterUserId) {
this.masterUserId = masterUserId;
}
}

View File

@ -49,6 +49,8 @@
<result column="lastTradeTime" jdbcType="TIMESTAMP" property="lasttradetime" />
<result column="splitFlag" jdbcType="TINYINT" property="splitflag" />
<result column="validFlag" jdbcType="TINYINT" property="validflag" />
<result column="masterMerchantCode" jdbcType="VARCHAR" property="masterMerchantCode"/>
<result column="tab" jdbcType="INTEGER" property="tab"/>
</resultMap>
<sql id="Base_Column_List">
id, bindingCode, userId, aliAccount, merchantCode, merchantName, merchantType, productDesc,
@ -57,7 +59,7 @@
bussAuthName, bussAuthNum, bussAuthAddress, bussAuthStartTime, bussAuthEndTime, certOrgCode,
createDt, updateDt, creator, buslicType, isVoice, allowBankLarge, wxCertStatus, isPushWxMessage,
isUnionPay, md5Key, limitPay, subAppId, appid, firstTradeTime, lastTradeTime, splitFlag,
validFlag
validFlag,masterMerchantCode,tab
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
@ -618,4 +620,20 @@
WHERE mcs.`status` IN (3, 7)
AND ic.certNo = #{idCardNo}
</select>
<select id="selectByMasterMerchantCode"
resultType="com.chaozhanggui.dao.system.entity.VO.MerchantCashVO">
SELECT
a.alias AS name,
a.merchantCode AS subcode,
a.address,
b.alias AS masterName,
b.merchantCode AS masterCode,
b.userId AS masterUserId
FROM
tb_pluss_merchant_base_info a
LEFT JOIN tb_pluss_merchant_base_info b ON a.masterMerchantCode = b.merchantCode
WHERE
a.masterMerchantCode IS NOT NULL
</select>
</mapper>

View File

@ -189,6 +189,90 @@ public class SxfMerchantAuditService extends BaseMerchantAuditService {
}
}
/**
* 收银点随行付进件
* @param userId
*/
@Transactional(rollbackFor = Exception.class)
public void merchantCashPlace(String userId, TbPlussMerchantChannelStatus mcs) {
//进件检测
merchantAuditCheck(userId,false);
TbPlussMerchantBaseInfo merchantBaseInfo = merchantBaseInfoMapper.selectByUserId(userId);
JSONObject reqData = new JSONObject();
// 判断是第一次进件是入驻修改还是第一次进件
String targetUrl;
String merchantId = mcs.getMerchantid();
if (StringUtils.isEmpty(merchantId)) {
// 初次进件
targetUrl = sxfConfig.SXF_MERCHANT_INCOME;
} else {
// 进件失败数据修改
targetUrl = sxfConfig.SXF_UPADTE_MERCHANT_RZ;
reqData.put("mno", merchantId);
}
// step 1组合请求数据
reqData.putAll(getMerchantAuditInfo(userId, merchantBaseInfo, mcs));
reqData.put("callbackUrl", parameterConfig.getDomain() + "/api/auditCallback/sxf");
//支付宝通道ID
reqData.put("specifyALiPayChannel", ParametersUtil.alipayChannel);
log.info("{}随行付进件参数{}", userId, JSON.toJSONString(reqData));
// step 2调取通用请求
JSONObject resultMap = requestApi(targetUrl, reqData);
// 请求成功, 验证签名
try {
checkSign(resultMap);
} catch (Exception e) {
MsgException.throwException(e.getMessage());
}
MsgException.checkUnequals(sxfConfig.SXF_SUCCESS_CODE, resultMap.get("code"), "进件失败," + resultMap.get("msg"));
// 业务成功
JSONObject respData = resultMap.getJSONObject("respData");
MsgException.checkUnequals(sxfConfig.SXF_SUCCESS_CODE, respData.get("bizCode"), "进件失败," + respData.get("bizMsg"));
Date date = new Date();
String applicationId = respData.getString("applicationId");
String mno = respData.getString("mno");
mcs.setChannel(1);
mcs.setUpdatetime(date);
mcs.setMerchantcode(merchantBaseInfo.getMerchantcode());
mcs.setStatus("1");
mcs.setThirdstatus("");
mcs.setCallbackstatus("0");
mcs.setRemark("随行付审核中");
mcs.setApplicationid(applicationId);
mcs.setMerchantid(mno);
TbPlussMerchantAuditRecord merchantAuditRecord = new TbPlussMerchantAuditRecord();
merchantAuditRecord.setStatus("1");
merchantAuditRecord.setMerchantcode(merchantBaseInfo.getMerchantcode());
merchantAuditRecord.setChannel(1);
merchantAuditRecord.setThirdstatus("");
merchantAuditRecord.setMerchantid(mno);
merchantAuditRecordMapper.insert(merchantAuditRecord);
if (StringUtil.isNotEmpty(mcs.getId())) {
merchantChannelStatusMapper.updateByPrimaryKeySelective(mcs);
} else {
// 保存进件信息
merchantChannelStatusMapper.insertSelective(mcs);
}
}
@Autowired
ParameterConfig parameterConfig;