mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-29 07:25:05 +08:00
Merge branch 'dev' of http://192.168.2.2:8099/jsowell/jsowell-charger-web into dev
This commit is contained in:
@@ -563,4 +563,17 @@ public class AdapayMemberService {
|
||||
Map<String, Object> paymentResult = AdapayCommon.requestAdapay(balanceParam);
|
||||
log.info("创建余额支付param:{}, result:{}", JSON.toJSONString(balanceParam), JSON.toJSONString(paymentResult));
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建支付确认撤销
|
||||
*/
|
||||
public void createConfirmReverse(String paymentConfirmId) throws BaseAdaPayException {
|
||||
Map<String, Object> confirmReverseParams = Maps.newHashMap();
|
||||
confirmReverseParams.put("adapay_func_code", "payments.confirm.reverse");
|
||||
confirmReverseParams.put("payment_confirm_id", paymentConfirmId);
|
||||
confirmReverseParams.put("reason", "支付确认撤销");
|
||||
confirmReverseParams.put("order_no", IdUtils.fastSimpleUUID());
|
||||
Map<String, Object> confirmReverseResult = AdapayCommon.requestAdapay(confirmReverseParams);
|
||||
log.info("创建支付确认撤销param:{}, result:{}", JSON.toJSONString(confirmReverseParams), JSON.toJSONString(confirmReverseResult));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,16 @@ public class PileMerchantInfo extends BaseEntity {
|
||||
@Excel(name = "运营商名称")
|
||||
private String merchantName;
|
||||
|
||||
/**
|
||||
* 运营商等级(1-一级运营商;2-二级运营商)
|
||||
*/
|
||||
private String merchantLevel;
|
||||
|
||||
/**
|
||||
* 父级运营商id
|
||||
*/
|
||||
private String parentId;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.jsowell.pile.domain;
|
||||
|
||||
import com.jsowell.common.annotation.Excel;
|
||||
import com.jsowell.common.core.domain.BaseEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
@@ -11,6 +13,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
* @author jsowell
|
||||
* @date 2023-04-19
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class PileStationWhitelist extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -19,6 +23,12 @@ public class PileStationWhitelist extends BaseEntity {
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 运营商id
|
||||
*/
|
||||
@Excel(name = "运营商id")
|
||||
private String merchantId;
|
||||
|
||||
/**
|
||||
* 站点id
|
||||
*/
|
||||
|
||||
@@ -25,4 +25,6 @@ public class PileAuthCardDTO {
|
||||
private String phoneNumber;
|
||||
|
||||
private String verificationCode;
|
||||
|
||||
private String merchantId;
|
||||
}
|
||||
|
||||
@@ -34,4 +34,6 @@ public class PileMemberBindingDTO {
|
||||
* 用户memberId
|
||||
*/
|
||||
private String memberId;
|
||||
|
||||
private String merchantId;
|
||||
}
|
||||
|
||||
@@ -84,4 +84,9 @@ public interface PileMerchantInfoMapper {
|
||||
* @return
|
||||
*/
|
||||
List<PileMerchantInfo> queryInfoListByIds(@Param("deptIds") List<String> deptIds);
|
||||
|
||||
/**
|
||||
* 查询一级运营商
|
||||
*/
|
||||
List<PileMerchantInfo> queryFirstLevelMerchant();
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public interface IMemberBasicInfoService {
|
||||
* @param mobileNumber 手机号
|
||||
* @return
|
||||
*/
|
||||
MemberBasicInfo selectInfoByMobileNumber(String mobileNumber);
|
||||
// MemberBasicInfo selectInfoByMobileNumber(String mobileNumber);
|
||||
|
||||
/**
|
||||
* 根据会员id查询会员信息
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.jsowell.common.core.domain.ykc.TransactionRecordsData;
|
||||
import com.jsowell.pile.domain.AdapayMemberAccount;
|
||||
import com.jsowell.pile.domain.OrderBasicInfo;
|
||||
import com.jsowell.pile.domain.OrderDetail;
|
||||
import com.jsowell.pile.domain.SettleOrderReport;
|
||||
import com.jsowell.pile.dto.*;
|
||||
import com.jsowell.pile.vo.base.MerchantOrderInfoVO;
|
||||
import com.jsowell.pile.vo.base.OrderAmountDetailVO;
|
||||
@@ -142,7 +143,9 @@ public interface IOrderBasicInfoService {
|
||||
|
||||
List<OrderVO> getListByMemberIdAndOrderStatus(String memberId, List<String> orderStatusList, LocalDateTime dateTime, String stationId);
|
||||
|
||||
void orderSplittingOperations(String merchantId, String tradeDate);
|
||||
void orderSplittingOperations(AdapayMemberAccount adapayMemberAccount, List<SettleOrderReport> stationReportList);
|
||||
|
||||
void orderSplittingOperations(String merchantId, String tradeDate);
|
||||
|
||||
void tempOrderSplittingOperations(String merchantId, String tradeDate);
|
||||
|
||||
|
||||
@@ -85,4 +85,10 @@ public interface IPileMerchantInfoService {
|
||||
* @return
|
||||
*/
|
||||
List<PileMerchantInfo> queryInfoListByIds(AuthorizedDeptVO authorizedMap);
|
||||
|
||||
/**
|
||||
* 查询一级运营商列表
|
||||
* @return
|
||||
*/
|
||||
List<PileMerchantInfo> queryFirstLevelMerchant();
|
||||
}
|
||||
|
||||
@@ -142,10 +142,10 @@ public class MemberBasicInfoServiceImpl implements IMemberBasicInfoService {
|
||||
return memberBasicInfoMapper.selectInfoByMobileNumberAndMerchantId(mobileNumber, merchantId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MemberBasicInfo selectInfoByMobileNumber(String mobileNumber) {
|
||||
return selectInfoByMobileNumber(mobileNumber, null);
|
||||
}
|
||||
// @Override
|
||||
// public MemberBasicInfo selectInfoByMobileNumber(String mobileNumber) {
|
||||
// return selectInfoByMobileNumber(mobileNumber, null);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public MemberBasicInfo selectInfoByMemberId(String memberId) {
|
||||
|
||||
@@ -873,22 +873,24 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
* 只有开通结算账户的运营商才走分账逻辑
|
||||
*/
|
||||
@Override
|
||||
public void orderSplittingOperations(String merchantId, String tradeDate) {
|
||||
logger.info("运营商:{}, 交易日期:{}, 进行分账处理start", merchantId, tradeDate);
|
||||
public void orderSplittingOperations(AdapayMemberAccount adapayMemberAccount, List<SettleOrderReport> stationReportList) {
|
||||
logger.info("运营商:{}, 交易日期:{}, 进行分账处理start", adapayMemberAccount, stationReportList);
|
||||
|
||||
// 查询运营商有没有开通结算账户
|
||||
AdapayMemberAccount adapayMemberAccount = adapayMemberAccountService.selectByMerchantId(merchantId);
|
||||
// 运营商有没有开通结算账户
|
||||
if (adapayMemberAccount == null) {
|
||||
logger.error("订单分账逻辑error, 运营商id:{}, 未配置结算账户", merchantId);
|
||||
logger.error("订单分账逻辑error-运营商有没有开通结算账户");
|
||||
return;
|
||||
}
|
||||
|
||||
if (CollectionUtils.isEmpty(stationReportList)) {
|
||||
logger.error("订单分账逻辑error-stationReportList为空");
|
||||
return;
|
||||
}
|
||||
|
||||
// 根据交易日期查询运营商下面所有站点的交易日报
|
||||
List<SettleOrderReport> stationReportList = settleOrderReportService.selectByMerchantIdAndDate(merchantId, tradeDate);
|
||||
for (SettleOrderReport orderReport : stationReportList) {
|
||||
String orderCodes = orderReport.getOrderCodes();
|
||||
if (StringUtils.isBlank(orderCodes)) {
|
||||
logger.info("站点:{}, 日期:{}, 没有查到订单数据", orderReport.getStationId(), tradeDate);
|
||||
logger.info("站点:{}, 日期:{}, 没有查到订单数据", orderReport.getStationId(), orderReport.getTradeDate());
|
||||
continue;
|
||||
}
|
||||
List<String> orderCodeList = Lists.newArrayList(StringUtils.split(orderCodes, ","));
|
||||
@@ -903,7 +905,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
String clearingBillCode = "CLE" + IdUtils.getOrderCode();
|
||||
clearingBillInfo.setClearingBillCode(clearingBillCode);
|
||||
clearingBillInfo.setClearingTime(DateUtils.getNowDate());
|
||||
clearingBillInfo.setMerchantId(merchantId);
|
||||
clearingBillInfo.setMerchantId(orderReport.getMerchantId());
|
||||
clearingBillInfo.setOrderSource("1");
|
||||
|
||||
// 应收金额
|
||||
@@ -967,7 +969,20 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
dto.setBillDetailList(billDetailList);
|
||||
transactionService.createClearingBill(dto);
|
||||
}
|
||||
logger.info("运营商:{}, 交易日期:{}, 进行分账处理end", merchantId, tradeDate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void orderSplittingOperations(String merchantId, String tradeDate) {
|
||||
// 查询运营商有没有开通结算账户
|
||||
AdapayMemberAccount adapayMemberAccount = adapayMemberAccountService.selectByMerchantId(merchantId);
|
||||
if (adapayMemberAccount == null) {
|
||||
logger.error("订单分账逻辑error, 运营商id:{}, 未配置结算账户", merchantId);
|
||||
return;
|
||||
}
|
||||
|
||||
// 根据交易日期查询运营商下面所有站点的交易日报
|
||||
List<SettleOrderReport> stationReportList = settleOrderReportService.selectByMerchantIdAndDate(merchantId, tradeDate);
|
||||
orderSplittingOperations(adapayMemberAccount, stationReportList);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,25 +1,23 @@
|
||||
package com.jsowell.pile.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.domain.MemberBasicInfo;
|
||||
import com.jsowell.pile.dto.MemberRegisterAndLoginDTO;
|
||||
import com.jsowell.pile.domain.PileAuthCard;
|
||||
import com.jsowell.pile.dto.PileAuthCardDTO;
|
||||
import com.jsowell.pile.mapper.PileAuthCardMapper;
|
||||
import com.jsowell.pile.service.IMemberBasicInfoService;
|
||||
import com.jsowell.pile.service.IPileAuthCardService;
|
||||
import com.jsowell.pile.vo.uniapp.AuthCardVO;
|
||||
import com.jsowell.pile.vo.web.PileAuthCardVO;
|
||||
import org.apache.commons.lang3.RandomStringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.jsowell.pile.mapper.PileAuthCardMapper;
|
||||
import com.jsowell.pile.domain.PileAuthCard;
|
||||
import com.jsowell.pile.service.IPileAuthCardService;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* 充电站鉴权卡Service业务层处理
|
||||
@@ -108,7 +106,7 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
|
||||
memberBasicInfo.setStatus("0"); // 0-待激活
|
||||
}else {
|
||||
// 通过手机号查询memberId
|
||||
memberBasicInfo = memberBasicInfoService.selectInfoByMobileNumber(dto.getPhoneNumber());
|
||||
memberBasicInfo = memberBasicInfoService.selectInfoByMobileNumber(dto.getPhoneNumber(), dto.getMerchantId());
|
||||
if (memberBasicInfo == null) {
|
||||
// 为空则说明未查到该用户的注册信息
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_USER_IS_NOT_REGISTER);
|
||||
@@ -139,7 +137,7 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
|
||||
@Override
|
||||
public int updateCardInfo(PileAuthCardDTO dto) {
|
||||
// 通过手机号查询memberId
|
||||
MemberBasicInfo memberBasicInfo = memberBasicInfoService.selectInfoByMobileNumber(dto.getPhoneNumber());
|
||||
MemberBasicInfo memberBasicInfo = memberBasicInfoService.selectInfoByMobileNumber(dto.getPhoneNumber(), dto.getMerchantId());
|
||||
if (memberBasicInfo == null) {
|
||||
// 为空则说明未查到该用户的注册信息
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_USER_IS_NOT_REGISTER);
|
||||
@@ -228,7 +226,7 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
|
||||
public int bindAuthCard(PileAuthCardDTO dto) {
|
||||
String phoneNumber = dto.getPhoneNumber();
|
||||
// 判断此用户是否已注册小程序账号
|
||||
MemberBasicInfo memberBasicInfo = memberBasicInfoService.selectInfoByMobileNumber(phoneNumber);
|
||||
MemberBasicInfo memberBasicInfo = memberBasicInfoService.selectInfoByMobileNumber(phoneNumber, dto.getMerchantId());
|
||||
if (memberBasicInfo == null) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_USER_IS_NOT_REGISTER);
|
||||
}
|
||||
|
||||
@@ -332,4 +332,13 @@ public class PileMerchantInfoServiceImpl implements IPileMerchantInfoService {
|
||||
AuthorizedDeptVO authorizedMap = SecurityUtils.getAuthorizedMap();
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询一级运营商列表
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<PileMerchantInfo> queryFirstLevelMerchant() {
|
||||
return pileMerchantInfoMapper.queryFirstLevelMerchant();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public class PileStationWhitelistServiceImpl implements IPileStationWhitelistSer
|
||||
if (StringUtils.isBlank(pileStationWhitelist.getMobileNumber())) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
||||
}
|
||||
MemberBasicInfo memberInfo = memberBasicInfoService.selectInfoByMobileNumber(pileStationWhitelist.getMobileNumber());
|
||||
MemberBasicInfo memberInfo = memberBasicInfoService.selectInfoByMobileNumber(pileStationWhitelist.getMobileNumber(), pileStationWhitelist.getMerchantId());
|
||||
if (memberInfo == null) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_MEMBER_NOT_FOUND_ERROR);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
<resultMap type="com.jsowell.pile.domain.PileMerchantInfo" id="PileMerchantInfoResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="merchantName" column="merchant_name"/>
|
||||
<result property="merchantLevel" column="merchant_level"/>
|
||||
<result property="parentId" column="parent_id"/>
|
||||
<result property="address" column="address"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="organizationCode" column="organization_code"/>
|
||||
@@ -25,6 +27,8 @@
|
||||
<sql id="Base_Column_List">
|
||||
id,
|
||||
merchant_name,
|
||||
merchant_level,
|
||||
parent_id,
|
||||
address,
|
||||
status,
|
||||
organization_code,
|
||||
@@ -99,6 +103,12 @@
|
||||
<if test="merchantName != null">
|
||||
merchant_name,
|
||||
</if>
|
||||
<if test="merchantLevel != null">
|
||||
merchant_level,
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
parent_id,
|
||||
</if>
|
||||
<if test="address != null">
|
||||
address,
|
||||
</if>
|
||||
@@ -149,6 +159,12 @@
|
||||
<if test="merchantName != null">
|
||||
#{merchantName},
|
||||
</if>
|
||||
<if test="merchantLevel != null">
|
||||
#{merchantLevel},
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
#{parentId},
|
||||
</if>
|
||||
<if test="address != null">
|
||||
#{address},
|
||||
</if>
|
||||
@@ -200,6 +216,12 @@
|
||||
<if test="merchantName != null">
|
||||
merchant_name = #{merchantName},
|
||||
</if>
|
||||
<if test="merchantLevel != null">
|
||||
merchant_level = #{merchantLevel},
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
parent_id = #{parentId},
|
||||
</if>
|
||||
<if test="address != null">
|
||||
address = #{address},
|
||||
</if>
|
||||
@@ -302,4 +324,13 @@
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="queryFirstLevelMerchant" resultMap="PileMerchantInfoResult">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from
|
||||
pile_merchant_info
|
||||
where del_flag = '0'
|
||||
and merchant_level = '1'
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
<resultMap type="com.jsowell.pile.domain.PileStationWhitelist" id="PileStationWhitelistResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="merchantId" column="merchant_id" />
|
||||
<result property="stationId" column="station_id" />
|
||||
<result property="memberId" column="member_id" />
|
||||
<result property="mobileNumber" column="mobile_number" />
|
||||
@@ -17,7 +18,7 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, station_id, member_id, mobile_number, create_time, create_by, update_time, update_by, del_flag
|
||||
id, merchant_id, station_id, member_id, mobile_number, create_time, create_by, update_time, update_by, del_flag
|
||||
</sql>
|
||||
|
||||
<sql id="selectPileStationWhitelistVo">
|
||||
@@ -29,6 +30,7 @@
|
||||
<select id="selectPileStationWhitelistList" parameterType="com.jsowell.pile.domain.PileStationWhitelist" resultMap="PileStationWhitelistResult">
|
||||
<include refid="selectPileStationWhitelistVo"/>
|
||||
<where>
|
||||
<if test="merchantId != null and merchantId != ''"> and merchant_id = #{merchantId}</if>
|
||||
<if test="stationId != null and stationId != ''"> and station_id = #{stationId}</if>
|
||||
<if test="memberId != null and memberId != ''"> and member_id = #{memberId}</if>
|
||||
<if test="mobileNumber != null and mobileNumber != ''"> and mobile_number = #{mobileNumber}</if>
|
||||
@@ -44,6 +46,7 @@
|
||||
insert into pile_station_whitelist
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="merchantId != null">merchant_id,</if>
|
||||
<if test="stationId != null">station_id,</if>
|
||||
<if test="memberId != null">member_id,</if>
|
||||
<if test="mobileNumber != null">mobile_number,</if>
|
||||
@@ -55,6 +58,7 @@
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="merchantId != null">#{merchantId},</if>
|
||||
<if test="stationId != null">#{stationId},</if>
|
||||
<if test="memberId != null">#{memberId},</if>
|
||||
<if test="mobileNumber != null">#{mobileNumber},</if>
|
||||
@@ -69,6 +73,7 @@
|
||||
<update id="updatePileStationWhitelist" parameterType="com.jsowell.pile.domain.PileStationWhitelist">
|
||||
update pile_station_whitelist
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="merchantId != null">merchant_id = #{merchantId},</if>
|
||||
<if test="stationId != null">station_id = #{stationId},</if>
|
||||
<if test="memberId != null">member_id = #{memberId},</if>
|
||||
<if test="mobileNumber != null">mobile_number = #{mobileNumber},</if>
|
||||
|
||||
Reference in New Issue
Block a user