随行付进件通知加入mcc
This commit is contained in:
@@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Djh
|
* @author Djh
|
||||||
@@ -276,6 +277,7 @@ public class ParameterConfig {
|
|||||||
@Value("${parameter.SJ_APPSECRET}")
|
@Value("${parameter.SJ_APPSECRET}")
|
||||||
public String SJ_APPSECRET;
|
public String SJ_APPSECRET;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 快递相关(快递鸟)
|
* 快递相关(快递鸟)
|
||||||
*/
|
*/
|
||||||
@@ -283,6 +285,8 @@ public class ParameterConfig {
|
|||||||
public String USERID;
|
public String USERID;
|
||||||
@Value("${express.APIKEY}")
|
@Value("${express.APIKEY}")
|
||||||
public String APIKEY;
|
public String APIKEY;
|
||||||
|
@Value("${parameter.mcclist.url}")
|
||||||
|
public List<String> url;
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() {
|
public void init() {
|
||||||
@@ -332,6 +336,7 @@ public class ParameterConfig {
|
|||||||
ParametersUtil.SJ_APPSECRET = SJ_APPSECRET;
|
ParametersUtil.SJ_APPSECRET = SJ_APPSECRET;
|
||||||
ParametersUtil.USERID = USERID;
|
ParametersUtil.USERID = USERID;
|
||||||
ParametersUtil.APIKEY = APIKEY;
|
ParametersUtil.APIKEY = APIKEY;
|
||||||
|
ParametersUtil.url = url;
|
||||||
|
|
||||||
SxfConfg.init(sxfDomain, publicKey, orgId);
|
SxfConfg.init(sxfDomain, publicKey, orgId);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package cn.pluss.platform.util;
|
package cn.pluss.platform.util;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author yuchen
|
* @author yuchen
|
||||||
@@ -205,5 +206,7 @@ public class ParametersUtil {
|
|||||||
*/
|
*/
|
||||||
public static String USERID;
|
public static String USERID;
|
||||||
public static String APIKEY;
|
public static String APIKEY;
|
||||||
|
|
||||||
|
public static List<String> url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,17 +34,7 @@ public interface UserAccountFlowMapper extends BaseMapper<UserAccountFlow> {
|
|||||||
"\tAND mf.biz_code = 'LD'\n" +
|
"\tAND mf.biz_code = 'LD'\n" +
|
||||||
"\torder by id desc limit #{pageSize} offset #{offset} ")
|
"\torder by id desc limit #{pageSize} offset #{offset} ")
|
||||||
List<UserMakerQuotaVO> selectByUserIdType(@Param("userId") Long userId, @Param("pageSize") Integer pageSize, @Param("offset") Integer offset);
|
List<UserMakerQuotaVO> selectByUserIdType(@Param("userId") Long userId, @Param("pageSize") Integer pageSize, @Param("offset") Integer offset);
|
||||||
@Select("SELECT\n" +
|
|
||||||
"\t IFNULL(SUM( amount ),0) \n" +
|
|
||||||
"FROM\n" +
|
|
||||||
"\ttb_pluss_user_account_flow \n" +
|
|
||||||
"WHERE\n" +
|
|
||||||
"\tuser_id = #{userId} \n" +
|
|
||||||
"AND\n" +
|
|
||||||
"\tbiz_code IN('102','LD')\n" +
|
|
||||||
"AND\n" +
|
|
||||||
"\tcreate_time < #{endTime} \n" +
|
|
||||||
"AND\n" +
|
|
||||||
"\tcreate_time\t> #{startTime}\t")
|
|
||||||
BigDecimal selectSumByUserId(@Param("userId") Long userId,@Param("startTime") Date startTime,@Param("endTime") Date endTime);
|
BigDecimal selectSumByUserId(@Param("userId") Long userId,@Param("startTime") Date startTime,@Param("endTime") Date endTime);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="cn.pluss.platform.mapper.UserAccountFlowMapper">
|
||||||
|
|
||||||
|
<select id="selectSumByUserId" resultType="java.math.BigDecimal">
|
||||||
|
SELECT
|
||||||
|
IFNULL( SUM( amount ), 0 ) - (
|
||||||
|
SELECT
|
||||||
|
IFNULL( SUM( amount ), 0 )
|
||||||
|
FROM
|
||||||
|
tb_pluss_user_account_flow
|
||||||
|
WHERE
|
||||||
|
user_id = #{userId}
|
||||||
|
AND biz_code = '103'
|
||||||
|
AND create_time < #{endTime} AND create_time > #{startTime}
|
||||||
|
)
|
||||||
|
FROM
|
||||||
|
tb_pluss_user_account_flow
|
||||||
|
WHERE
|
||||||
|
user_id = #{userId}
|
||||||
|
AND biz_code IN ( '102', 'LD' )
|
||||||
|
AND create_time <#{endTime} AND create_time > #{startTime}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -4,6 +4,7 @@ import cn.pluss.platform.entity.Account;
|
|||||||
import cn.pluss.platform.entity.BankCard;
|
import cn.pluss.platform.entity.BankCard;
|
||||||
import cn.pluss.platform.entity.IdCard;
|
import cn.pluss.platform.entity.IdCard;
|
||||||
import cn.pluss.platform.exception.MsgException;
|
import cn.pluss.platform.exception.MsgException;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
@@ -45,6 +46,177 @@ public class AccountDTO extends Account {
|
|||||||
*/
|
*/
|
||||||
private String merchantType;
|
private String merchantType;
|
||||||
|
|
||||||
|
@TableField
|
||||||
|
private String photoType;
|
||||||
|
private String photoUrl;
|
||||||
|
private String picUrl;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String picUrl1;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String picUrl2;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String picUrl3;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String picUrl6;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String picUrl7;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String picUrl8;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String picUrl9;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String picUrl999;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String picUrl101;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String picUrl102;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String picUrl11;
|
||||||
|
|
||||||
|
public String getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(String status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BankCard getBankCard() {
|
||||||
|
return bankCard;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBankCard(BankCard bankCard) {
|
||||||
|
this.bankCard = bankCard;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IdCard getIdcard() {
|
||||||
|
return idcard;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIdcard(IdCard idcard) {
|
||||||
|
this.idcard = idcard;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMerchantType() {
|
||||||
|
return merchantType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMerchantType(String merchantType) {
|
||||||
|
this.merchantType = merchantType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPhotoType() {
|
||||||
|
return photoType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPhotoType(String photoType) {
|
||||||
|
this.photoType = photoType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPhotoUrl() {
|
||||||
|
return photoUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPhotoUrl(String photoUrl) {
|
||||||
|
this.photoUrl = photoUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPicUrl() {
|
||||||
|
return picUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPicUrl(String picUrl) {
|
||||||
|
this.picUrl = picUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPicUrl1() {
|
||||||
|
return picUrl1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPicUrl1(String picUrl1) {
|
||||||
|
this.picUrl1 = picUrl1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPicUrl2() {
|
||||||
|
return picUrl2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPicUrl2(String picUrl2) {
|
||||||
|
this.picUrl2 = picUrl2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPicUrl3() {
|
||||||
|
return picUrl3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPicUrl3(String picUrl3) {
|
||||||
|
this.picUrl3 = picUrl3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPicUrl6() {
|
||||||
|
return picUrl6;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPicUrl6(String picUrl6) {
|
||||||
|
this.picUrl6 = picUrl6;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPicUrl7() {
|
||||||
|
return picUrl7;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPicUrl7(String picUrl7) {
|
||||||
|
this.picUrl7 = picUrl7;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPicUrl8() {
|
||||||
|
return picUrl8;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPicUrl8(String picUrl8) {
|
||||||
|
this.picUrl8 = picUrl8;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPicUrl9() {
|
||||||
|
return picUrl9;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPicUrl9(String picUrl9) {
|
||||||
|
this.picUrl9 = picUrl9;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPicUrl999() {
|
||||||
|
return picUrl999;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPicUrl999(String picUrl999) {
|
||||||
|
this.picUrl999 = picUrl999;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPicUrl101() {
|
||||||
|
return picUrl101;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPicUrl101(String picUrl101) {
|
||||||
|
this.picUrl101 = picUrl101;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPicUrl102() {
|
||||||
|
return picUrl102;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPicUrl102(String picUrl102) {
|
||||||
|
this.picUrl102 = picUrl102;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPicUrl11() {
|
||||||
|
return picUrl11;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPicUrl11(String picUrl11) {
|
||||||
|
this.picUrl11 = picUrl11;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过数据获取进件类型
|
* 通过数据获取进件类型
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public class UserMakerQuotaServiceImpl extends ServiceImpl<UserMakerQuotaMapper,
|
|||||||
map.put("freeQuota",bigDecimal == null?
|
map.put("freeQuota",bigDecimal == null?
|
||||||
new BigDecimal("0.00") : bigDecimal);
|
new BigDecimal("0.00") : bigDecimal);
|
||||||
map.put("returnFree",userAccountByUserId == null || userAccountByUserId.getBalance() == null?
|
map.put("returnFree",userAccountByUserId == null || userAccountByUserId.getBalance() == null?
|
||||||
new BigDecimal("0.00") : userAccountByUserId.getBalance());
|
new BigDecimal("0.00") : userAccountByUserId.getBalance().setScale(2, BigDecimal.ROUND_DOWN));
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,7 +88,6 @@ public class UserMakerQuotaServiceImpl extends ServiceImpl<UserMakerQuotaMapper,
|
|||||||
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
|
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
|
||||||
public void makerQuota(MerchantOrder order){
|
public void makerQuota(MerchantOrder order){
|
||||||
|
|
||||||
|
|
||||||
//查询自己是否为创客
|
//查询自己是否为创客
|
||||||
MerchantBaseInfo merchantBaseInfoByMerchantCode = merchantBaseInfoService.getMerchantBaseInfoByMerchantCode(order.getMerchantCode());
|
MerchantBaseInfo merchantBaseInfoByMerchantCode = merchantBaseInfoService.getMerchantBaseInfoByMerchantCode(order.getMerchantCode());
|
||||||
if(ObjectUtil.isEmpty(merchantBaseInfoByMerchantCode)){
|
if(ObjectUtil.isEmpty(merchantBaseInfoByMerchantCode)){
|
||||||
@@ -106,56 +105,39 @@ public class UserMakerQuotaServiceImpl extends ServiceImpl<UserMakerQuotaMapper,
|
|||||||
log.error("用户所属关系不存在");
|
log.error("用户所属关系不存在");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if("1".equals(userInfo.getIsExtend())){
|
|
||||||
|
if("1".equals(userInfo.getIsExtend())) {
|
||||||
UserMakerQuota userMakerQuota = userMakerQuotaMapper.selectByUserId(userInfo.getUserId().intValue());
|
UserMakerQuota userMakerQuota = userMakerQuotaMapper.selectByUserId(userInfo.getUserId().intValue());
|
||||||
if(ObjectUtil.isEmpty(userMakerQuota)){
|
if (ObjectUtil.isEmpty(userMakerQuota)) {
|
||||||
log.error("当前额度为0,{},{},{}",order.getOrderNumber(),order.getConsumeFee(),userInfo.getUserId());
|
giveParentQuota(userInfo,order);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
BigDecimal havingBalance=userMakerQuota.getAmount().subtract(new BigDecimal(order.getConsumeFee())).setScale(2,BigDecimal.ROUND_DOWN);
|
|
||||||
if(havingBalance.compareTo(BigDecimal.ZERO)>=0){
|
BigDecimal havingBalance = userMakerQuota.getAmount().subtract(new BigDecimal(String.valueOf(order.getConsumeFee()))).setScale(2, BigDecimal.ROUND_DOWN);
|
||||||
BigDecimal profit=new BigDecimal(order.getConsumeFee()).multiply(new BigDecimal("0.0038")).setScale(2, BigDecimal.ROUND_DOWN);
|
if (havingBalance.compareTo(BigDecimal.ZERO) >= 0) {
|
||||||
|
BigDecimal profit = new BigDecimal(String.valueOf(order.getConsumeFee())).subtract(new BigDecimal(String.valueOf(order.getEnterFee())));
|
||||||
BigDecimal bigDecimal = new BigDecimal(order.getConsumeFee().toString());
|
BigDecimal bigDecimal = new BigDecimal(order.getConsumeFee().toString());
|
||||||
//提现金额
|
//提现金额
|
||||||
userAccountService.modFunds(userInfo.getUserId().intValue(), "LD", "增加收益", profit, "");
|
userAccountService.modFunds(userInfo.getUserId().intValue(), "LD", "增加收益", profit, "");
|
||||||
//额度改变
|
//额度改变
|
||||||
modMakerFunds(userInfo.getUserId().intValue(), "LD", "收款消耗", bigDecimal.negate(), "",order.getOrderNumber());
|
modMakerFunds(userInfo.getUserId().intValue(), "LD", "收款消耗", bigDecimal.negate(), "", order.getOrderNumber());
|
||||||
|
//
|
||||||
|
giveParentQuota(userInfo,order);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (havingBalance.compareTo(BigDecimal.ZERO) < 0) {
|
||||||
if(havingBalance.compareTo(BigDecimal.ZERO)<0){
|
BigDecimal profit = userMakerQuota.getAmount().multiply(new BigDecimal("0.0038")).setScale(6, BigDecimal.ROUND_DOWN);
|
||||||
BigDecimal profit=userMakerQuota.getAmount().multiply(new BigDecimal("0.0038")).setScale(2, BigDecimal.ROUND_DOWN);
|
|
||||||
|
|
||||||
//提现金额
|
//提现金额
|
||||||
userAccountService.modFunds(userInfo.getUserId().intValue(), "LD", "增加收益", profit.abs(), "");
|
userAccountService.modFunds(userInfo.getUserId().intValue(), "LD", "增加收益", profit.abs(), "");
|
||||||
modMakerFunds(userInfo.getUserId().intValue(), "LD", "收款消耗", userMakerQuota.getAmount().abs().negate(), "",order.getOrderNumber());
|
modMakerFunds(userInfo.getUserId().intValue(), "LD", "收款消耗", userMakerQuota.getAmount().abs().negate(), "", order.getOrderNumber());
|
||||||
|
giveParentQuota(userInfo,order);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}else {
|
|
||||||
UserPromotion userParent = userPromotionMapper.selectByUserIdMC(Long.valueOf(userInfo.getParentUserId()));
|
|
||||||
if (userParent == null){
|
|
||||||
log.error("不存在的用户关系:{}",userInfo.getParentUserId());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!"1".equals(userParent.getIsExtend())){
|
|
||||||
log.error("商户用户类型异常:{},{}",userParent.getUserId(),userParent.getIsExtend());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
BigDecimal profit = new BigDecimal(order.getConsumeFee()).multiply(new BigDecimal("0.5")).setScale(2, BigDecimal.ROUND_DOWN);
|
|
||||||
String s = String.valueOf(userParent.getUserId());
|
|
||||||
Integer integer = Integer.valueOf(s);
|
|
||||||
this.modMakerFunds(integer, "SD", "免费额度", profit, "", order.getOrderNumber());
|
|
||||||
return;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
giveParentQuota(userInfo,order);
|
||||||
}
|
}
|
||||||
//增加提现金额
|
//增加提现金额
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void profit(UserPromotion userInfo,BigDecimal consumeFee,MerchantOrder order){
|
public void profit(UserPromotion userInfo,BigDecimal consumeFee,MerchantOrder order){
|
||||||
UserMakerQuota userMakerQuota = userMakerQuotaMapper.selectByUserId(userInfo.getUserId().intValue());
|
UserMakerQuota userMakerQuota = userMakerQuotaMapper.selectByUserId(userInfo.getUserId().intValue());
|
||||||
if (userMakerQuota != null) {
|
if (userMakerQuota != null) {
|
||||||
@@ -183,6 +165,28 @@ public class UserMakerQuotaServiceImpl extends ServiceImpl<UserMakerQuotaMapper,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 给上级额度
|
||||||
|
* @param userInfo
|
||||||
|
* @param order
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void giveParentQuota( UserPromotion userInfo,MerchantOrder order){
|
||||||
|
|
||||||
|
UserPromotion userParent = userPromotionMapper.selectByUserIdMC(Long.valueOf(userInfo.getParentUserId()));
|
||||||
|
if (userParent == null){
|
||||||
|
log.error("不存在的用户关系:{}",userInfo.getParentUserId());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!"1".equals(userParent.getIsExtend())){
|
||||||
|
log.error("商户用户类型异常:{},{}",userParent.getUserId(),userParent.getIsExtend());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
BigDecimal profit = new BigDecimal(order.getConsumeFee()).multiply(new BigDecimal("0.5")).setScale(2, BigDecimal.ROUND_DOWN);
|
||||||
|
String s = String.valueOf(userParent.getUserId());
|
||||||
|
Integer integer = Integer.valueOf(s);
|
||||||
|
this.modMakerFunds(integer, "SD", "免费额度", profit, "", order.getOrderNumber());
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 创客额度相关
|
* 创客额度相关
|
||||||
* @param userId
|
* @param userId
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ public interface MerchantChannelStatusService extends IService<MerchantChannelSt
|
|||||||
qWrapper.eq(MerchantChannelStatus::getVirChannelFlag, channelType);
|
qWrapper.eq(MerchantChannelStatus::getVirChannelFlag, channelType);
|
||||||
qWrapper.eq(MerchantChannelStatus::getMerchantCode, merchantCode);
|
qWrapper.eq(MerchantChannelStatus::getMerchantCode, merchantCode);
|
||||||
qWrapper.eq(MerchantChannelStatus::getAuthorizationStatus,1);
|
qWrapper.eq(MerchantChannelStatus::getAuthorizationStatus,1);
|
||||||
|
|
||||||
return getOne(qWrapper);
|
return getOne(qWrapper);
|
||||||
}
|
}
|
||||||
default MerchantChannelStatus getByMerchantCodeAndChannelTypeNew(String merchantCode, String channelType) {
|
default MerchantChannelStatus getByMerchantCodeAndChannelTypeNew(String merchantCode, String channelType) {
|
||||||
|
|||||||
@@ -1695,25 +1695,25 @@ public class MerchantOrderServiceImpl extends ServiceImpl<MerchantOrderMapper, M
|
|||||||
Map<String, Object> resultMap = new HashMap<>();
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
MerchantRefundOrder refundOrder = new MerchantRefundOrder();
|
MerchantRefundOrder refundOrder = new MerchantRefundOrder();
|
||||||
|
|
||||||
if(!"test".equals(environment)){
|
if (channel.getChannel() == 1) {
|
||||||
if (channel.getChannel() == 1) {
|
resultMap = sxfPayService.refundPay(order, channel.getMerchantId());
|
||||||
resultMap = sxfPayService.refundPay(order, channel.getMerchantId());
|
} else if (channel.getChannel() == 2) {
|
||||||
} else if (channel.getChannel() == 2) {
|
MsgException.throwException("通道已关闭!");
|
||||||
MsgException.throwException("通道已关闭!");
|
} else if (channel.getChannel() == 3) {
|
||||||
} else if (channel.getChannel() == 3) {
|
resultMap = ryxPayService.refundPay(order, channel.getMerchantId());
|
||||||
resultMap = ryxPayService.refundPay(order, channel.getMerchantId());
|
} else if (channel.getChannel() == 4) {
|
||||||
} else if (channel.getChannel() == 4) {
|
resultMap = ysPayOldService.refundPay(order, channel.getMerchantId());
|
||||||
resultMap = ysPayOldService.refundPay(order, channel.getMerchantId());
|
}else if(channel.getChannel()==5){
|
||||||
}else if(channel.getChannel()==5){
|
resultMap = lkLPayServiceImpl.refundPay(order,channel.getMerchantCode());
|
||||||
resultMap = lkLPayServiceImpl.refundPay(order,channel.getMerchantCode());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
MsgException.throwException("未知通道!");
|
|
||||||
}
|
|
||||||
if (ResultCode.SUCCESS.code() != (Integer) resultMap.get("code")) {
|
|
||||||
throw new MsgException(resultMap.get("msg") + "");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
MsgException.throwException("未知通道!");
|
||||||
|
}
|
||||||
|
if (ResultCode.SUCCESS.code() != (Integer) resultMap.get("code")) {
|
||||||
|
throw new MsgException(resultMap.get("msg") + "");
|
||||||
|
}
|
||||||
|
|
||||||
|
log.info("通道返回信息:{}",JSONUtil.toJsonStr(resultMap));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.core.io.ByteArrayResource;
|
import org.springframework.core.io.ByteArrayResource;
|
||||||
import org.springframework.http.HttpEntity;
|
import org.springframework.http.HttpEntity;
|
||||||
@@ -66,6 +67,9 @@ public class SxfMerchantAuditServiceImpl extends BaseMerchantAuditService {
|
|||||||
@Lazy @Autowired
|
@Lazy @Autowired
|
||||||
private MerchantImageService miService;
|
private MerchantImageService miService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param merchantImage 上传图片信息
|
* @param merchantImage 上传图片信息
|
||||||
* orgId - 机构编号;
|
* orgId - 机构编号;
|
||||||
@@ -232,6 +236,7 @@ public class SxfMerchantAuditServiceImpl extends BaseMerchantAuditService {
|
|||||||
// step 1、组合请求数据
|
// step 1、组合请求数据
|
||||||
reqData.putAll(getMerchantAuditInfo(userId, merchantBaseInfo, mcs));
|
reqData.putAll(getMerchantAuditInfo(userId, merchantBaseInfo, mcs));
|
||||||
reqData.put("callbackUrl", ParametersUtil.domain + "/api/auditCallback/sxf");
|
reqData.put("callbackUrl", ParametersUtil.domain + "/api/auditCallback/sxf");
|
||||||
|
//TODO 加与不加支付宝通道ID
|
||||||
reqData.put("specifyALiPayChannel", "2088441721243954");
|
reqData.put("specifyALiPayChannel", "2088441721243954");
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package cn.pluss.platform.task;
|
package cn.pluss.platform.task;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.pluss.platform.BankCardService;
|
import cn.pluss.platform.BankCardService;
|
||||||
import cn.pluss.platform.MerchantAuditRecordService;
|
import cn.pluss.platform.MerchantAuditRecordService;
|
||||||
import cn.pluss.platform.entity.*;
|
import cn.pluss.platform.entity.*;
|
||||||
@@ -13,6 +14,7 @@ import cn.pluss.platform.suixingfu.SxfConstants;
|
|||||||
import cn.pluss.platform.user.impl.GeneralPushUtil;
|
import cn.pluss.platform.user.impl.GeneralPushUtil;
|
||||||
import cn.pluss.platform.util.IpUtils;
|
import cn.pluss.platform.util.IpUtils;
|
||||||
import cn.pluss.platform.util.LogExceptionUtils;
|
import cn.pluss.platform.util.LogExceptionUtils;
|
||||||
|
import cn.pluss.platform.util.ParametersUtil;
|
||||||
import cn.pluss.platform.wx.WxCertService;
|
import cn.pluss.platform.wx.WxCertService;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
@@ -23,6 +25,7 @@ import lombok.Setter;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -33,6 +36,7 @@ import java.io.UnsupportedEncodingException;
|
|||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -84,6 +88,8 @@ public class SxfMerAuditHandler {
|
|||||||
@Lazy
|
@Lazy
|
||||||
private SxfMerAuditHandler self;
|
private SxfMerAuditHandler self;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Async
|
@Async
|
||||||
public void auditHandler(JSONObject auditResult) {
|
public void auditHandler(JSONObject auditResult) {
|
||||||
execute(auditResult);
|
execute(auditResult);
|
||||||
@@ -96,7 +102,7 @@ public class SxfMerAuditHandler {
|
|||||||
MerchantChannelStatus mcs = self.auditCallback(auditResult);
|
MerchantChannelStatus mcs = self.auditCallback(auditResult);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
log.info("===================>进件回调,创建店铺开始,商户编号mno为:{}<=====================", auditResult.getString("mno"));
|
log.info("===================>(餐饮商超)进件回调,创建店铺开始,商户编号mno为:{}<=====================", auditResult.getString("mno"));
|
||||||
self.createStore(mcs);
|
self.createStore(mcs);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -119,6 +125,7 @@ public class SxfMerAuditHandler {
|
|||||||
.setChannel(1)
|
.setChannel(1)
|
||||||
.setApplicationId(auditResult.getString("applicationId"))
|
.setApplicationId(auditResult.getString("applicationId"))
|
||||||
.setMerchantId(auditResult.getString("mno"));
|
.setMerchantId(auditResult.getString("mno"));
|
||||||
|
System.out.println(ParametersUtil.url);
|
||||||
merchantChannelStatus = mcsMapper.selectOne(new QueryWrapper<>(merchantChannelStatus));
|
merchantChannelStatus = mcsMapper.selectOne(new QueryWrapper<>(merchantChannelStatus));
|
||||||
|
|
||||||
String taskStatus = auditResult.getString("taskStatus");
|
String taskStatus = auditResult.getString("taskStatus");
|
||||||
@@ -344,44 +351,59 @@ public class SxfMerAuditHandler {
|
|||||||
UserInfo userInfo = userInfoMapper.selectById(userApp.getUserId());
|
UserInfo userInfo = userInfoMapper.selectById(userApp.getUserId());
|
||||||
log.info("==============>当前需要同步的用户进件数据为::{}<===================", JSONObject.toJSONString(merchantChannelStatus));
|
log.info("==============>当前需要同步的用户进件数据为::{}<===================", JSONObject.toJSONString(merchantChannelStatus));
|
||||||
if (userInfo != null) {
|
if (userInfo != null) {
|
||||||
MerchantStore merchantStore = new MerchantStore().setMerchantCode(merchantChannelStatus.getMerchantCode());
|
// MerchantStore merchantStore = new MerchantStore().setMerchantCode(merchantChannelStatus.getMerchantCode());
|
||||||
merchantStore = merchantStoreMapper.selectOne(new QueryWrapper<>(merchantStore));
|
QueryWrapper storQueryWrapper= new QueryWrapper<>();
|
||||||
|
storQueryWrapper.eq("merchantCode",merchantChannelStatus.getMerchantCode());
|
||||||
|
MerchantStore merchantStore = merchantStoreMapper.selectOne(storQueryWrapper);
|
||||||
MerchantBaseInfo merchantBaseInfo = merchantBaseInfoService.getMerchantBaseInfoByMerchantCode(merchantChannelStatus.getMerchantCode());
|
MerchantBaseInfo merchantBaseInfo = merchantBaseInfoService.getMerchantBaseInfoByMerchantCode(merchantChannelStatus.getMerchantCode());
|
||||||
QueryWrapper<MerchantImage> queryWrapper = new QueryWrapper<MerchantImage>()
|
QueryWrapper<MerchantImage> queryWrapper = new QueryWrapper<MerchantImage>()
|
||||||
.eq("merchantCode", merchantChannelStatus.getMerchantCode()).eq("photoType", "06");
|
.eq("merchantCode", merchantChannelStatus.getMerchantCode()).eq("photoType", "06");
|
||||||
MerchantImage merchantImage = merchantImageMapper.selectOne(queryWrapper);
|
MerchantImage merchantImage = merchantImageMapper.selectOne(queryWrapper);
|
||||||
//String baseUrl = "https://life.sxczgkj.cn/web/wmerchant.php?c=site&a=entry&ctrl=store&ac=oauth&op=add_merchan&do=web&m=we7_wmall&i=1";
|
//String baseUrl = "https://life.sxczgkj.cn/web/wmerchant.php?c=site&a=entry&ctrl=store&ac=oauth&op=add_merchan&do=web&m=we7_wmall&i=1";
|
||||||
String baseUrl = "https://kysh.sxczgkj.cn/javaApi/java-api/add-store";
|
List<String> mccList = ParametersUtil.url;
|
||||||
StringBuilder sb = new StringBuilder(baseUrl);
|
if(ObjectUtil.isEmpty(mccList)||mccList.size()<=0){
|
||||||
sb.append("?title=").append(merchantBaseInfo.getAlias());
|
log.error("没有配置对应的通之地址");
|
||||||
sb.append("&password=").append(userInfo.getPassword().toLowerCase());
|
return;
|
||||||
sb.append("&mobile=").append(userInfo.getLoginName());
|
}
|
||||||
sb.append("&syb_m_id=").append(merchantStore.getId());
|
|
||||||
sb.append("&addressNo=").append(merchantBaseInfo.getAddressNo());
|
mccList.stream().parallel().forEach(it->{
|
||||||
String address = merchantBaseInfo.getProvince() + merchantBaseInfo.getCity() + merchantBaseInfo.getDistrict() + merchantBaseInfo.getAddress();
|
String baseUrl = it.toString();
|
||||||
String area = merchantBaseInfo.getProvince() +"-"+ merchantBaseInfo.getCity() +"-"+ merchantBaseInfo.getDistrict();
|
StringBuilder sb = new StringBuilder(baseUrl);
|
||||||
try {
|
sb.append("?title=").append(merchantBaseInfo.getAlias());
|
||||||
String decodeAddress = URLEncoder.encode(address, "UTF-8");
|
sb.append("?mcc=").append(merchantBaseInfo.getMcc());
|
||||||
sb.append("&address=").append(decodeAddress);
|
sb.append("?mccName=").append(merchantBaseInfo.getMccName());
|
||||||
String decodeArea = URLEncoder.encode(area, "UTF-8");
|
sb.append("&password=").append(userInfo.getPassword().toLowerCase());
|
||||||
sb.append("&area=").append(decodeArea);
|
sb.append("&mobile=").append(userInfo.getLoginName());
|
||||||
String logo = URLEncoder.encode(merchantImage.getPicUrl(), "GBK");
|
sb.append("&syb_m_id=").append(merchantStore.getId());
|
||||||
sb.append("&logo=").append(logo);
|
sb.append("&addressNo=").append(merchantBaseInfo.getAddressNo());
|
||||||
} catch (UnsupportedEncodingException e) {
|
String address = merchantBaseInfo.getProvince() + merchantBaseInfo.getCity() + merchantBaseInfo.getDistrict() + merchantBaseInfo.getAddress();
|
||||||
e.printStackTrace();
|
String area = merchantBaseInfo.getProvince() +"-"+ merchantBaseInfo.getCity() +"-"+ merchantBaseInfo.getDistrict();
|
||||||
log.error("=============>请求生成店铺logo门头照转码异常,异常信息:{}<===============", e.getMessage());
|
try {
|
||||||
}
|
String decodeAddress = URLEncoder.encode(address, "UTF-8");
|
||||||
Map<String, String> lnxMap = IpUtils.getLocationByAddress(address);
|
sb.append("&address=").append(decodeAddress);
|
||||||
if (lnxMap != null) {
|
String decodeArea = URLEncoder.encode(area, "UTF-8");
|
||||||
sb.append("&location_x=").append(lnxMap.get("x"));
|
sb.append("&area=").append(decodeArea);
|
||||||
sb.append("&location_y=").append(lnxMap.get("y"));
|
String logo = URLEncoder.encode(merchantImage.getPicUrl(), "GBK");
|
||||||
}
|
sb.append("&logo=").append(logo);
|
||||||
// 请求生成店铺j
|
} catch (UnsupportedEncodingException e) {
|
||||||
String result = restTemplate.getForObject(sb.toString(), String.class);
|
e.printStackTrace();
|
||||||
log.info("=============>请求生成店铺URL:{},请求响应返回的参数为:{}<===============", sb.toString(), result);
|
log.error("=============>请求生成店铺logo门头照转码异常,异常信息:{}<===============", e.getMessage());
|
||||||
|
}
|
||||||
|
Map<String, String> lnxMap = IpUtils.getLocationByAddress(address);
|
||||||
|
if (lnxMap != null) {
|
||||||
|
sb.append("&location_x=").append(lnxMap.get("x"));
|
||||||
|
sb.append("&location_y=").append(lnxMap.get("y"));
|
||||||
|
}
|
||||||
|
// 请求生成店铺j
|
||||||
|
String result = restTemplate.getForObject(sb.toString(), String.class);
|
||||||
|
log.info("=============>请求生成店铺URL:{},请求响应返回的参数为:{}<===============", sb.toString(), result);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商户信息修改回调
|
* 商户信息修改回调
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -228,6 +228,12 @@ public class MerchantController {
|
|||||||
return "d8bd54ca68da9a76d473f246c8821ad0";
|
return "d8bd54ca68da9a76d473f246c8821ad0";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/OeUIoBWT9l.txt")
|
||||||
|
@ResponseBody
|
||||||
|
public String OeUIoBWT9l1() {
|
||||||
|
return "d8bd54ca68da9a76d473f246c8821ad0";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/account/auth")
|
@GetMapping("/account/auth")
|
||||||
public String accountAuth(HttpServletResponse response, HttpServletRequest request) {
|
public String accountAuth(HttpServletResponse response, HttpServletRequest request) {
|
||||||
@@ -2496,9 +2502,13 @@ public class MerchantController {
|
|||||||
result.put("typeCode","MC");
|
result.put("typeCode","MC");
|
||||||
result.put("currentFee","");
|
result.put("currentFee","");
|
||||||
}else {
|
}else {
|
||||||
|
if("无".equals(params[2].split("=")[1])){
|
||||||
|
result.put("currentFee","0.38");
|
||||||
|
}else {
|
||||||
|
result.put("currentFee",(params[2].split("=").length<=1)?"":params[2].split("=")[1]);
|
||||||
|
}
|
||||||
inviteNum=params[0].split("=")[1];
|
inviteNum=params[0].split("=")[1];
|
||||||
result.put("typeCode",params[1].split("=")[1]);
|
result.put("typeCode",params[1].split("=")[1]);
|
||||||
result.put("currentFee",(params[2].split("=").length<=1)?"":params[2].split("=")[1]);
|
|
||||||
}
|
}
|
||||||
String phone = "";
|
String phone = "";
|
||||||
String userName = "";
|
String userName = "";
|
||||||
|
|||||||
Reference in New Issue
Block a user