mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
Merge branch 'dev' into merge_adapay
# Conflicts: # jsowell-pile/src/main/java/com/jsowell/pile/service/ISettleOrderReportService.java # jsowell-pile/src/main/java/com/jsowell/pile/service/impl/SettleOrderReportServiceImpl.java
This commit is contained in:
@@ -23,7 +23,6 @@ import com.jsowell.common.core.redis.RedisCache;
|
||||
import com.jsowell.common.enums.DelFlagEnum;
|
||||
import com.jsowell.common.enums.adapay.AdapayStatusEnum;
|
||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.enums.ykc.ScenarioEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.util.AdapayUtil;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
@@ -115,7 +114,7 @@ public class AdapayService {
|
||||
createAdaPaymentParam.setGoods_title(dto.getGoodsTitle());
|
||||
createAdaPaymentParam.setGoods_desc(dto.getGoodsDesc()); // 这个字段是微信支付凭证的商品名
|
||||
Map<String, String> map = Maps.newHashMap();
|
||||
map.put("type", ScenarioEnum.ORDER.getValue());
|
||||
map.put("type", dto.getType());
|
||||
map.put("orderCode", dto.getOrderCode());
|
||||
map.put("payMode", payMode);
|
||||
map.put("memberId", dto.getMemberId());
|
||||
|
||||
@@ -255,16 +255,19 @@ public class PileStationInfo extends BaseEntity {
|
||||
/**
|
||||
* 是否对外开放 (0-否;1-是)
|
||||
*/
|
||||
@Excel(name = "是否对外开放 (0-否;1-是)")
|
||||
private String publicFlag;
|
||||
|
||||
/**
|
||||
* 是否营业中(0-否;1-是)
|
||||
*/
|
||||
@Excel(name = "是否营业中(0-否;1-是)")
|
||||
private String openFlag;
|
||||
|
||||
/**
|
||||
* 是否对接高德(0-否;1-是)
|
||||
*/
|
||||
@Excel(name = "是否对接高德(0-否;1-是)")
|
||||
private String aMapFlag;
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.jsowell.pile.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 查询清分账单DTO
|
||||
*
|
||||
* @author Lemon
|
||||
* @Date 2023/8/28 13:47
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class GetClearingBillDTO {
|
||||
|
||||
private Integer pageNum;
|
||||
|
||||
private Integer pageSize;
|
||||
|
||||
private String merchantId;
|
||||
|
||||
private String startTime;
|
||||
|
||||
private String endTime;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.jsowell.pile.dto;
|
||||
|
||||
import com.jsowell.common.enums.ykc.ScenarioEnum;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -30,6 +31,12 @@ public class PayOrderDTO {
|
||||
*/
|
||||
private BigDecimal payAmount;
|
||||
|
||||
/**
|
||||
* @see ScenarioEnum
|
||||
* 支付场景
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 微信支付需要用的code
|
||||
*/
|
||||
|
||||
@@ -11,6 +11,11 @@ public class SettleOrderReportDTO {
|
||||
*/
|
||||
private String stationId;
|
||||
|
||||
/**
|
||||
* 运营商id
|
||||
*/
|
||||
private String merchantId;
|
||||
|
||||
/**
|
||||
* 交易日期
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.jsowell.pile.mapper;
|
||||
|
||||
import com.jsowell.pile.domain.ClearingBillInfo;
|
||||
import com.jsowell.pile.dto.GetClearingBillDTO;
|
||||
import com.jsowell.pile.vo.web.ClearingBillVO;
|
||||
import com.jsowell.pile.vo.web.MerchantClearingBillVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@@ -57,4 +60,11 @@ public interface ClearingBillInfoMapper {
|
||||
List<ClearingBillInfo> selectByMerchantId(@Param("merchantId") String merchantId, @Param("billStatus") String billStatus);
|
||||
|
||||
void updateStatus(@Param("clearingBillIds") List<Integer> clearingBillIds, @Param("billStatus") String billStatus);
|
||||
|
||||
/**
|
||||
* 后管用 查询运营商账单列表
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<MerchantClearingBillVO> getMerchantClearingBillList(GetClearingBillDTO dto);
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.jsowell.pile.service;
|
||||
|
||||
import com.jsowell.pile.domain.ClearingBillInfo;
|
||||
import com.jsowell.pile.dto.GetClearingBillDTO;
|
||||
import com.jsowell.pile.vo.web.MerchantClearingBillVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -22,4 +24,11 @@ public interface ClearingBillInfoService{
|
||||
List<ClearingBillInfo> selectByMerchantId(String merchantId, String billStatus);
|
||||
|
||||
void updateStatus(List<Integer> clearingBillIds, String billStatus);
|
||||
|
||||
/**
|
||||
* 后管用 查询运营商账单列表
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<MerchantClearingBillVO> getMerchantClearingBillList(GetClearingBillDTO dto);
|
||||
}
|
||||
|
||||
@@ -2,11 +2,13 @@ package com.jsowell.pile.service;
|
||||
|
||||
import com.jsowell.common.core.page.PageResponse;
|
||||
import com.jsowell.pile.domain.SettleOrderReport;
|
||||
import com.jsowell.pile.dto.GetClearingBillDTO;
|
||||
import com.jsowell.pile.dto.MerchantOrderReportDTO;
|
||||
import com.jsowell.pile.dto.SettleOrderReportDTO;
|
||||
import com.jsowell.pile.vo.web.MerchantOrderReportVO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 结算订单报Service接口
|
||||
@@ -76,6 +78,8 @@ public interface ISettleOrderReportService {
|
||||
*/
|
||||
MerchantOrderReportVO getMerchantOrderReport(MerchantOrderReportDTO dto);
|
||||
|
||||
MerchantOrderReportVO getMerchantOrderReportV2(MerchantOrderReportDTO dto);
|
||||
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(SettleOrderReport record);
|
||||
@@ -107,4 +111,14 @@ public interface ISettleOrderReportService {
|
||||
* @param tradeDate 交易日期
|
||||
*/
|
||||
void generateDailyOrderReports(String stationId, String tradeDate);
|
||||
Map<String, Object> queryUndividedOrder(SettleOrderReportDTO dto);
|
||||
|
||||
/**
|
||||
* 获取运营商清分账单列表
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
public PageResponse getMerchantClearingBillList(GetClearingBillDTO dto);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,8 +2,10 @@ package com.jsowell.pile.service.impl;
|
||||
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.domain.ClearingBillInfo;
|
||||
import com.jsowell.pile.dto.GetClearingBillDTO;
|
||||
import com.jsowell.pile.mapper.ClearingBillInfoMapper;
|
||||
import com.jsowell.pile.service.ClearingBillInfoService;
|
||||
import com.jsowell.pile.vo.web.MerchantClearingBillVO;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -59,4 +61,14 @@ public class ClearingBillInfoServiceImpl implements ClearingBillInfoService{
|
||||
clearingBillInfoMapper.updateStatus(clearingBillIds, billStatus);
|
||||
}
|
||||
|
||||
/**
|
||||
* 后管用 查询运营商账单列表
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<MerchantClearingBillVO> getMerchantClearingBillList(GetClearingBillDTO dto) {
|
||||
return clearingBillInfoMapper.getMerchantClearingBillList(dto);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2828,6 +2828,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
// 2023-07-11 全部改为汇付支付
|
||||
dto.setGoodsTitle("充电费用");
|
||||
dto.setGoodsDesc("充电桩预付款金额");
|
||||
dto.setType(ScenarioEnum.ORDER.getValue());
|
||||
Map<String, Object> weixinMap = adapayService.createPayment(dto);
|
||||
|
||||
// 返回微信支付参数
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.jsowell.common.enums.uniapp.OccupyOrderPayStatusEnum;
|
||||
import com.jsowell.common.enums.uniapp.OccupyOrderStatusEnum;
|
||||
import com.jsowell.common.enums.ykc.OrderPayModeEnum;
|
||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.enums.ykc.ScenarioEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.common.util.PageUtils;
|
||||
@@ -443,6 +444,7 @@ public class OrderPileOccupyServiceImpl implements OrderPileOccupyService {
|
||||
// 返回支付参数
|
||||
dto.setGoodsTitle("占桩费用");
|
||||
dto.setGoodsDesc("占桩订单金额");
|
||||
dto.setType(ScenarioEnum.OCCUPY.getValue());
|
||||
Map<String, Object> weixinMap = adapayService.createPayment(dto);
|
||||
resultMap.put("weixinMap", weixinMap);
|
||||
} else if (StringUtils.equals(dto.getPayMode(), OrderPayModeEnum.PAYMENT_OF_WHITELIST.getValue())) { // 白名单支付
|
||||
|
||||
@@ -13,7 +13,11 @@ import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.common.util.PageUtils;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.common.util.id.IdUtils;
|
||||
import com.jsowell.pile.domain.ClearingBillInfo;
|
||||
import com.jsowell.pile.domain.PileBasicInfo;
|
||||
import com.jsowell.pile.domain.PileStationInfo;
|
||||
import com.jsowell.pile.domain.SettleOrderReport;
|
||||
import com.jsowell.pile.dto.GetClearingBillDTO;
|
||||
import com.jsowell.pile.dto.MerchantOrderReportDTO;
|
||||
import com.jsowell.pile.dto.QueryOrderDTO;
|
||||
import com.jsowell.pile.dto.SettleOrderReportDTO;
|
||||
@@ -27,6 +31,8 @@ import com.jsowell.pile.service.ISettleOrderReportService;
|
||||
import com.jsowell.pile.vo.base.SplitSettleAmountVO;
|
||||
import com.jsowell.pile.vo.web.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.jsowell.pile.service.*;
|
||||
import com.jsowell.pile.vo.web.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
@@ -38,6 +44,7 @@ import java.time.LocalTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -70,6 +77,12 @@ public class SettleOrderReportServiceImpl implements ISettleOrderReportService {
|
||||
@Autowired
|
||||
private ClearingWithdrawInfoService clearingWithdrawInfoService;
|
||||
|
||||
@Autowired
|
||||
private ClearingBillInfoService clearingBillInfoService;
|
||||
|
||||
@Autowired
|
||||
private IPileStationInfoService pileStationInfoService;
|
||||
|
||||
/**
|
||||
* 查询结算订单报
|
||||
*
|
||||
@@ -97,30 +110,23 @@ public class SettleOrderReportServiceImpl implements ISettleOrderReportService {
|
||||
*/
|
||||
@Override
|
||||
public PageResponse selectSettleOrderReportDetail(SettleOrderReportDTO dto) {
|
||||
SettleOrderReport orderReport = selectByStationIdAndDate(dto.getStationId(), dto.getTradeDate());
|
||||
if (orderReport == null) {
|
||||
return new PageResponse();
|
||||
}
|
||||
String orderCodes = orderReport.getOrderCodes();
|
||||
if (StringUtils.isBlank(orderCodes)) {
|
||||
return new PageResponse();
|
||||
}
|
||||
List<String> orderCodes = getOrderCodes(dto);
|
||||
|
||||
List<String> orderCodeList = Lists.newArrayList(StringUtils.split(orderCodes, ","));
|
||||
// 查询订单支付信息 分页
|
||||
int pageNum = dto.getPageNum() != null ? dto.getPageNum() : 1;
|
||||
int pageSize = dto.getPageSize() != null ? dto.getPageSize() : 10;
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
List<ClearingBillVO> clearingBillVOList = clearingWithdrawInfoService.selectWithdrawInfoByOrderCodeList(orderCodeList);
|
||||
List<ClearingBillVO> clearingBillVOList = clearingWithdrawInfoService.selectWithdrawInfoByOrderCodeList(orderCodes);
|
||||
PageInfo<ClearingBillVO> pageInfo = new PageInfo<>(clearingBillVOList);
|
||||
|
||||
// 封装结果集
|
||||
List<OrderSettleDetailVO> resultList = Lists.newArrayList();
|
||||
OrderSettleDetailVO vo = null;
|
||||
String wechatAppId = pileMerchantInfoService.queryAppIdByMerchantId(orderReport.getMerchantId());
|
||||
String wechatAppId = pileMerchantInfoService.queryAppIdByMerchantId(dto.getMerchantId());
|
||||
for (ClearingBillVO clearingBillVO : pageInfo.getList()) {
|
||||
vo = new OrderSettleDetailVO();
|
||||
vo.setOrderCode(clearingBillVO.getOrderCode());
|
||||
vo.setSettleAmount(clearingBillVO.getSettleAmount());
|
||||
String paymentId = clearingBillVO.getPaymentId();
|
||||
QueryPaymentConfirmDTO build = QueryPaymentConfirmDTO.builder()
|
||||
.wechatAppId(wechatAppId)
|
||||
@@ -158,6 +164,51 @@ public class SettleOrderReportServiceImpl implements ISettleOrderReportService {
|
||||
return pageResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据 merchantId 或 stationId 以及交易日期获取订单号
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
private List<String> getOrderCodes(SettleOrderReportDTO dto) {
|
||||
List<String> orderCodeList = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(dto.getMerchantId())) {
|
||||
List<PileStationInfo> stationIdInfos = pileStationInfoService.selectStationListByMerchantId(Long.parseLong(dto.getMerchantId()));
|
||||
// 收集出站点id
|
||||
List<String> stationIds = stationIdInfos.stream()
|
||||
.map(PileStationInfo::getId)
|
||||
.collect(Collectors.toList())
|
||||
.stream()
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
List<SettleOrderReport> list = queryOrderReport(stationIds, dto.getTradeDate(), dto.getTradeDate());
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<String> orderCodes = list.stream().map(SettleOrderReport::getOrderCodes)
|
||||
.filter(StringUtils::isNotBlank)
|
||||
.collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(orderCodes)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
for (String orderCode : orderCodes) {
|
||||
orderCodeList = Lists.newArrayList(StringUtils.split(orderCode, ","));
|
||||
}
|
||||
} else if (StringUtils.isNotBlank(dto.getStationId())){
|
||||
SettleOrderReport orderReport = selectByStationIdAndDate(dto.getStationId(), dto.getTradeDate());
|
||||
|
||||
if (orderReport == null) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
String orderCodes = orderReport.getOrderCodes();
|
||||
if (StringUtils.isBlank(orderCodes)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
orderCodeList = Lists.newArrayList(StringUtils.split(orderCodes, ","));
|
||||
dto.setMerchantId(orderReport.getMerchantId());
|
||||
}
|
||||
return orderCodeList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SettleOrderReport> selectByMerchantIdAndDate(String merchantId, String date) {
|
||||
return settleOrderReportMapper.selectByMerchantIdAndDate(merchantId, date);
|
||||
@@ -280,6 +331,88 @@ public class SettleOrderReportServiceImpl implements ISettleOrderReportService {
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据运营商id查询订单报表V2
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public MerchantOrderReportVO getMerchantOrderReportV2(MerchantOrderReportDTO dto) {
|
||||
int pageNum = dto.getPageNum() == null ? 1 : dto.getPageNum();
|
||||
int pageSize = dto.getPageSize() == null ? 10 : dto.getPageSize();
|
||||
if (StringUtils.isBlank(dto.getStartTime())) {
|
||||
dto.setStartTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, DateUtils.addDays(new Date(), -7)));
|
||||
}
|
||||
if (StringUtils.isBlank(dto.getEndTime())) {
|
||||
dto.setEndTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, new Date()));
|
||||
}
|
||||
MerchantOrderReportVO vo = new MerchantOrderReportVO();
|
||||
MerchantOrderReportVO.MerchantOrderReport report = new MerchantOrderReportVO.MerchantOrderReport();
|
||||
PageUtils.startPage(pageNum, pageSize);
|
||||
GetClearingBillDTO clearingBillDTO = GetClearingBillDTO.builder()
|
||||
.merchantId(dto.getMerchantId())
|
||||
.startTime(dto.getStartTime())
|
||||
.endTime(dto.getEndTime())
|
||||
.pageNum(dto.getPageNum())
|
||||
.pageSize(dto.getPageSize())
|
||||
.build();
|
||||
PageResponse pageResponse = getMerchantClearingBillList(clearingBillDTO);
|
||||
vo.setPageResponse(pageResponse);
|
||||
|
||||
vo.setMerchantId(dto.getMerchantId());
|
||||
// 进行数据汇总
|
||||
List<SettleOrderReportVO> list = settleOrderReportMapper.getMerchantOrderReport(dto);
|
||||
// 用电度数
|
||||
report.setUseElectricity(list.stream().map(SettleOrderReportVO::getUseElectricity).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||
// 充电次数
|
||||
report.setChargeNum(list.stream().map(SettleOrderReport -> new BigDecimal(SettleOrderReport.getChargeNum())).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||
// 充电时长
|
||||
report.setChargeTime(list.stream().map(SettleOrderReport -> new BigDecimal(SettleOrderReport.getChargeTime())).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||
// 电费金额
|
||||
report.setElectricityAmount(list.stream().map(SettleOrderReportVO::getElectricityAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||
// 服务费金额
|
||||
report.setServiceAmount(list.stream().map(SettleOrderReportVO::getServiceAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||
// 收入金额
|
||||
report.setTotalAmount(list.stream().map(SettleOrderReportVO::getTotalAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||
// 虚拟金额
|
||||
report.setVirtualAmount(list.stream().map(SettleOrderReportVO::getVirtualAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||
// 交易金额
|
||||
report.setTradeAmount(list.stream().map(SettleOrderReportVO::getTradeAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||
// 交易手续费
|
||||
report.setTradeFee(list.stream().map(SettleOrderReportVO::getTradeFee).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||
|
||||
vo.setMerchantOrderReport(report);
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取运营商清分账单列表
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public PageResponse getMerchantClearingBillList(GetClearingBillDTO dto) {
|
||||
List<MerchantClearingBillVO> resultList;
|
||||
int pageNum = dto.getPageNum() == null ? 1 : dto.getPageNum();
|
||||
int pageSize = dto.getPageSize() == null ? 10 : dto.getPageSize();
|
||||
// 分页
|
||||
PageUtils.startPage(pageNum, pageSize);
|
||||
resultList = clearingBillInfoService.getMerchantClearingBillList(dto);
|
||||
if (CollectionUtils.isEmpty(resultList)) {
|
||||
return null;
|
||||
}
|
||||
PageInfo<MerchantClearingBillVO> pageInfo = new PageInfo<>(resultList);
|
||||
PageResponse response = PageResponse.builder()
|
||||
.pageNum(pageInfo.getPageNum())
|
||||
.pageSize(pageInfo.getPageSize())
|
||||
.list(pageInfo.getList())
|
||||
.total(pageInfo.getTotal())
|
||||
.pages(pageInfo.getPages())
|
||||
.build();
|
||||
return response;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByPrimaryKey(Integer id) {
|
||||
return settleOrderReportMapper.deleteByPrimaryKey(id);
|
||||
@@ -340,6 +473,11 @@ public class SettleOrderReportServiceImpl implements ISettleOrderReportService {
|
||||
return settleOrderReportMapper.queryOrderReport(stationIdList, startTime, endTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryUndividedOrder(SettleOrderReportDTO dto) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算站点订单报表
|
||||
*
|
||||
|
||||
@@ -36,20 +36,23 @@ public class SnUtils {
|
||||
* @param prefix 生成序列号的前缀
|
||||
* @return
|
||||
*/
|
||||
private String getPileSn(String prefix) {
|
||||
public String getPileSn(String prefix) {
|
||||
//序列号前缀加特定标识,如系统模块名之类的 防止重复
|
||||
String key = CacheConstants.PILE_SN_GENERATE_KEY + prefix;
|
||||
String increResult = null;
|
||||
try {
|
||||
String pileNum = redisCache.getCacheObject(key);
|
||||
if (StringUtils.isBlank(pileNum)) {
|
||||
// 取缓存
|
||||
Integer pileNum = redisCache.getCacheObject(key);
|
||||
if (pileNum == null) {
|
||||
// 缓存中没有,从数据库中取
|
||||
PileBasicInfo pileInfo = pileBasicInfoService.getMaxNumPileInfo();
|
||||
String pileSn = pileInfo.getSn();
|
||||
// 将前四位截取,并将后面转为long
|
||||
long pileSnNum = Long.parseLong(StringUtils.substring(pileSn, 4, pileSn.length()));
|
||||
Long pileSnNum = Long.parseLong(StringUtils.substring(pileSn, 4, pileSn.length()));
|
||||
// String pileSnNum = StringUtils.substring(pileSn, 4, pileSn.length());
|
||||
// 再将该值存入数据库
|
||||
redisCache.setCacheObject(key, pileSnNum);
|
||||
redisCache.setCacheObject(key, pileSnNum.intValue());
|
||||
|
||||
}
|
||||
Long increNum = redisCache.increment(key, 1);
|
||||
// 年份
|
||||
@@ -63,11 +66,13 @@ public class SnUtils {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String pileSn = "88230000002060";
|
||||
String substring = StringUtils.substring(pileSn, 4, pileSn.length());
|
||||
long l = Long.parseLong(substring);
|
||||
System.out.println(substring);
|
||||
System.out.println(l);
|
||||
// String pileSn = "88230000002060";
|
||||
// String substring = StringUtils.substring(pileSn, 4, pileSn.length());
|
||||
// long l = Long.parseLong(substring);
|
||||
// System.out.println(substring);
|
||||
// System.out.println(l);
|
||||
|
||||
Long a = 3147483647L;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.jsowell.pile.vo.web;
|
||||
import com.jsowell.adapay.response.QueryPaymentConfirmDetailResponse;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class ClearingBillVO {
|
||||
/**
|
||||
@@ -10,6 +12,11 @@ public class ClearingBillVO {
|
||||
*/
|
||||
private String orderCode;
|
||||
|
||||
/**
|
||||
* 结算金额
|
||||
*/
|
||||
private BigDecimal settleAmount;
|
||||
|
||||
/**
|
||||
* 支付id
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.jsowell.pile.vo.web;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 运营商清分账单VO
|
||||
*
|
||||
* @author Lemon
|
||||
* @Date 2023/8/28 13:30
|
||||
*/
|
||||
@Data
|
||||
public class MerchantClearingBillVO {
|
||||
|
||||
// 交易日期
|
||||
private String tradeDate;
|
||||
|
||||
// 账单状态
|
||||
private String billStatus;
|
||||
|
||||
// 清分账单编号
|
||||
private String clearingBillCode;
|
||||
|
||||
// 清分时间
|
||||
private String clearingTime;
|
||||
|
||||
// 运营商id
|
||||
private String merchantId;
|
||||
|
||||
// 运营商名称
|
||||
private String merchantName;
|
||||
|
||||
// 应收金额
|
||||
private String receivableAmount;
|
||||
|
||||
// 应清分金额
|
||||
private String shouldClearingAmount;
|
||||
|
||||
// 实际清分金额
|
||||
private String actualClearingAmount;
|
||||
|
||||
// 手续费
|
||||
private String feeAmount;
|
||||
|
||||
// 可提现金额
|
||||
private String withdrawAbleAmount;
|
||||
|
||||
// 提现单号
|
||||
private String withdrawCode;
|
||||
}
|
||||
@@ -45,5 +45,8 @@ public class MerchantOrderReportVO {
|
||||
|
||||
// 虚拟金额
|
||||
private BigDecimal virtualAmount;
|
||||
|
||||
// 白名单支付次数
|
||||
private BigDecimal whitelistPaymentsNum;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.jsowell.pile.vo.web;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 订单结算详情
|
||||
*/
|
||||
@@ -19,7 +21,7 @@ public class OrderSettleDetailVO {
|
||||
/**
|
||||
* 结算金额
|
||||
*/
|
||||
private String settleAmount;
|
||||
private BigDecimal settleAmount;
|
||||
|
||||
/**
|
||||
* 清分状态
|
||||
@@ -34,7 +36,7 @@ public class OrderSettleDetailVO {
|
||||
|
||||
/**
|
||||
* 提现状态
|
||||
* 0-未提现;1-体现中;2-提现到账
|
||||
* 0-未提现;1-提现中;2-提现到账
|
||||
*/
|
||||
private String withdrawStatus;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user