diff --git a/electripper-admin/src/main/java/com/ruoyi/web/controller/system/AsUserController.java b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/AsUserController.java index 69d8d70..c8961ec 100644 --- a/electripper-admin/src/main/java/com/ruoyi/web/controller/system/AsUserController.java +++ b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/AsUserController.java @@ -3,6 +3,7 @@ package com.ruoyi.web.controller.system; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.ValidGroup; import com.ruoyi.common.core.domain.entity.AsUser; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.vo.LabelVo; @@ -123,7 +124,7 @@ public class AsUserController extends BaseController */ @Log(title = "用户管理", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@Validated @RequestBody AsUser user) + public AjaxResult edit(@RequestBody @Validated(ValidGroup.Update.class) AsUser user) { if (!asUserService.checkUserNameUnique(user)) { diff --git a/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtFeeRuleController.java b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtFeeRuleController.java index b7c499d..558b778 100644 --- a/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtFeeRuleController.java +++ b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtFeeRuleController.java @@ -113,7 +113,7 @@ public class EtFeeRuleController extends BaseController } // 校验运营商 if (etFeeRule.getDeptId() == null) { - return "代理商为必填项"; + etFeeRule.setDeptId(getDeptId()); } // 校验说明 if (etFeeRule.getInstructions() == null || etFeeRule.getInstructions().trim().isEmpty()) { diff --git a/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtOrderController.java b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtOrderController.java index 3b0e6b5..1ba6479 100644 --- a/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtOrderController.java +++ b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtOrderController.java @@ -69,6 +69,18 @@ public class EtOrderController extends BaseController return getDataTable(list); } + /** + * 查询充值/退款订单列表(视图) + */ + @PreAuthorize("@ss.hasPermi('system:order:list')") + @GetMapping("/rechargeList2") + public TableDataInfo rechargeList2(EtOrderQuery etOrder) + { + startPage(); + List list = etOrderService.rechargeList2(etOrder); + return getDataTable(list); + } + /** * 导出订单列表 */ diff --git a/electripper-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java b/electripper-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java index e76f86e..cf00557 100644 --- a/electripper-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java +++ b/electripper-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java @@ -58,6 +58,12 @@ public class CacheConstants */ public static final String CACHE_DEVICE_KEY = "device:"; + /** + * 首页缓存key + */ + public static final String CACHE_ADMIN_STATISTICS = "adminStatistics"; + + /** * 首页数据 redis key */ diff --git a/electripper-common/src/main/java/com/ruoyi/common/constant/ServiceConstants.java b/electripper-common/src/main/java/com/ruoyi/common/constant/ServiceConstants.java index be16809..bf45fc8 100644 --- a/electripper-common/src/main/java/com/ruoyi/common/constant/ServiceConstants.java +++ b/electripper-common/src/main/java/com/ruoyi/common/constant/ServiceConstants.java @@ -122,6 +122,11 @@ public class ServiceConstants { */ public static final String ORDER_STATUS_DAMAGED = "6"; + /** + * 订单状态:7-待官方审核 + */ + public static final String ORDER_STATUS_OFFICIAL_REVIEW = "7"; + /**----------------------------订单状态end----------------------------*/ /**----------------------------支付状态start----------------------------*/ diff --git a/electripper-common/src/main/java/com/ruoyi/common/core/domain/entity/AsUser.java b/electripper-common/src/main/java/com/ruoyi/common/core/domain/entity/AsUser.java index 08604a0..ef915ba 100644 --- a/electripper-common/src/main/java/com/ruoyi/common/core/domain/entity/AsUser.java +++ b/electripper-common/src/main/java/com/ruoyi/common/core/domain/entity/AsUser.java @@ -5,6 +5,7 @@ import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel.ColumnType; import com.ruoyi.common.annotation.Excel.Type; import com.ruoyi.common.core.domain.BaseEntity; +import com.ruoyi.common.core.domain.ValidGroup; import com.ruoyi.common.xss.Xss; import lombok.ToString; @@ -116,6 +117,9 @@ public class AsUser extends BaseEntity /** 运营区id */ private String areaId; + /** 运营区 */ + private String areaName; + /** 是否认证:0-未认证;1-已认证 */ public String isAuthentication; @@ -187,6 +191,14 @@ public class AsUser extends BaseEntity this.areaId = areaId; } + public String getAreaName() { + return areaName; + } + + public void setAreaName(String areaName) { + this.areaName = areaName; + } + /** 最后一笔订单 */ private EtOrderDto latestOrder; @@ -292,7 +304,7 @@ public class AsUser extends BaseEntity } @Xss(message = "用户账号不能包含脚本字符") - @NotBlank(message = "用户账号不能为空") + @NotBlank(message = "用户账号不能为空", groups = {ValidGroup.Create.class}) @Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符") public String getUserName() { diff --git a/electripper-common/src/main/java/com/ruoyi/common/utils/onenet/LocationVo.java b/electripper-common/src/main/java/com/ruoyi/common/utils/onenet/LocationVo.java index 91d3d40..e99bd27 100644 --- a/electripper-common/src/main/java/com/ruoyi/common/utils/onenet/LocationVo.java +++ b/electripper-common/src/main/java/com/ruoyi/common/utils/onenet/LocationVo.java @@ -17,5 +17,5 @@ public class LocationVo { private Integer s;//卫星数量 - private Integer q;//质量 + private Integer q;//电门 0-关;1-开 } diff --git a/electripper-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java b/electripper-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java index 9c6327f..6435aed 100644 --- a/electripper-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java +++ b/electripper-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java @@ -226,10 +226,16 @@ public class SysLoginService String phoneNumber = wxAuthService.getPhoneNumber(mobileCode, dept, url); user = asUserService.selectUserByWxOpenid(openId); + if(ObjectUtils.isEmpty(user)){ + user = asUserService.selectUserByPhone(phoneNumber); + } if(ObjectUtils.isEmpty(user)){ // 用户不存在,注册用户 user = registerUser(areaId, phoneNumber, openId, Constants.CUSTOM_LOGIN_WX,dept); }else{ + if(StrUtil.isBlank(user.getWxOpenid())){ + user.setWxOpenid(openId); + } if(dept.getIsUsePlatformApp().equals("true")){ user.setAppName("创享电动车"); user.setAppId(dept.getAppid()); diff --git a/electripper-system/src/main/java/com/ruoyi/system/domain/EtOrderQuery.java b/electripper-system/src/main/java/com/ruoyi/system/domain/EtOrderQuery.java index d109dbd..e3481bf 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/domain/EtOrderQuery.java +++ b/electripper-system/src/main/java/com/ruoyi/system/domain/EtOrderQuery.java @@ -21,6 +21,10 @@ public class EtOrderQuery extends BaseEntity @Excel(name = "用户") private String userName; + /** 用户id */ + @Excel(name = "用户id") + private Long userId; + /** 类型 */ @Excel(name = "类型") private String type; @@ -49,4 +53,8 @@ public class EtOrderQuery extends BaseEntity @Excel(name = "是否退款") private List isRefund; + /** 运营区ids */ + @Excel(name = "运营区ids") + private List areaIds; + } diff --git a/electripper-system/src/main/java/com/ruoyi/system/domain/EtReconciliation.java b/electripper-system/src/main/java/com/ruoyi/system/domain/EtReconciliation.java index 5d1896a..8bd0ad7 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/domain/EtReconciliation.java +++ b/electripper-system/src/main/java/com/ruoyi/system/domain/EtReconciliation.java @@ -76,4 +76,14 @@ public class EtReconciliation extends BaseEntity @Excel(name = "平台服务费") private BigDecimal platformServiceFee; + @Excel(name = "订单数") + private int orderCount; + + @Excel(name = "提现服务费") + private BigDecimal withdrawServiceFee; + + @Excel(name = "渠道成本") + private BigDecimal channelCost; + + } diff --git a/electripper-system/src/main/java/com/ruoyi/system/domain/vo/IndexAdminVo.java b/electripper-system/src/main/java/com/ruoyi/system/domain/vo/IndexAdminVo.java index bf91d5b..96979a9 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/domain/vo/IndexAdminVo.java +++ b/electripper-system/src/main/java/com/ruoyi/system/domain/vo/IndexAdminVo.java @@ -60,6 +60,11 @@ public class IndexAdminVo { /** 还车待审核订单数 */ private Integer returnOrderCount=0; + /** 提现待审核数 */ + private Integer withdrawReviewCount=0; + /** 扣款待审核数 */ + private Integer deductionReviewCount=0; + /** 今日支付手续费 */ private BigDecimal todayHandlingFee= BigDecimal.ZERO; /** 总支付手续费 */ @@ -76,9 +81,12 @@ public class IndexAdminVo { /** 运维统计 */ private OperationVo operationVo; - /** 收入统计list */ + /** 营收统计list */ private List incomeVoList; + /** 收入及成本 */ + private List incomeCostList; + /** * 营收统计 incomeVo */ @@ -90,8 +98,23 @@ public class IndexAdminVo { private BigDecimal orderFee; /** 订单数 */ private Integer orderNum; + /** 退款金额 */ + private BigDecimal refundFee; } +// 收入及成本 + @Data + public static class IncomeCostVo { + /** 日期 */ + private String day; + private BigDecimal serviceFee; // 服务费 + private BigDecimal handlingFee; // 手续费 + private BigDecimal withdrawalFee; // 提现手续费 + private BigDecimal channelCost; // 渠道成本 + private BigDecimal platformProfit; // 平台盈利 + } + + /** * 车辆统计 */ diff --git a/electripper-system/src/main/java/com/ruoyi/system/domain/vo/SelfReconciliationVO.java b/electripper-system/src/main/java/com/ruoyi/system/domain/vo/SelfReconciliationVO.java index 0c05581..fbe7ff9 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/domain/vo/SelfReconciliationVO.java +++ b/electripper-system/src/main/java/com/ruoyi/system/domain/vo/SelfReconciliationVO.java @@ -25,6 +25,9 @@ public class SelfReconciliationVO { //订单支付 包含押金抵扣 private BigDecimal orderPaid= BigDecimal.ZERO; + //订单数 + private int orderCount= 0; + //押金充值 private BigDecimal depositPaid= BigDecimal.ZERO; @@ -52,6 +55,13 @@ public class SelfReconciliationVO { // 平台服务费 private BigDecimal platformServiceFee= BigDecimal.ZERO; + // 提现服务费 + private BigDecimal withdrawServiceFee= BigDecimal.ZERO; + //结算金额 private BigDecimal settlementAmount= BigDecimal.ZERO; + + //渠道成本 + private BigDecimal channelCost= BigDecimal.ZERO; + } diff --git a/electripper-system/src/main/java/com/ruoyi/system/mapper/EtCapitalFlowMapper.java b/electripper-system/src/main/java/com/ruoyi/system/mapper/EtCapitalFlowMapper.java index 38876d6..b842df0 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/mapper/EtCapitalFlowMapper.java +++ b/electripper-system/src/main/java/com/ruoyi/system/mapper/EtCapitalFlowMapper.java @@ -29,6 +29,14 @@ public interface EtCapitalFlowMapper */ public List selectEtCapitalFlowList(EtCapitalFlow etCapitalFlow); + /** + * 查询资金流水列表 + * + * @param etCapitalFlow 资金流水 + * @return 资金流水集合 + */ + public int selectCount(EtCapitalFlow etCapitalFlow); + /** * 新增资金流水 * @@ -104,6 +112,14 @@ public interface EtCapitalFlowMapper */ BigDecimal getServiceFee2(@Param("timeStart") String timeStart, @Param("timeEnd") String timeEnd, @Param("sn") String sn, @Param("areaId") Long areaId,@Param("channelId") Long channelId); + /** + * 提现服务费 + * + * @param areaId 运营区id + * @return + */ + BigDecimal getWithdrawServiceFee(@Param("timeStart") String timeStart, @Param("timeEnd") String timeEnd, @Param("areaId") Long areaId); + /** * 骑行订单收入 * diff --git a/electripper-system/src/main/java/com/ruoyi/system/mapper/EtOrderMapper.java b/electripper-system/src/main/java/com/ruoyi/system/mapper/EtOrderMapper.java index 661f166..2c57093 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/mapper/EtOrderMapper.java +++ b/electripper-system/src/main/java/com/ruoyi/system/mapper/EtOrderMapper.java @@ -8,6 +8,7 @@ import com.ruoyi.system.domain.EtOrderQuery; import com.ruoyi.system.domain.IncomeQuery; import com.ruoyi.system.domain.vo.IncomeVo; import com.ruoyi.system.domain.vo.IndexVo; +import com.ruoyi.system.domain.vo.RechargeVo; import org.apache.ibatis.annotations.Param; /** @@ -66,6 +67,14 @@ public interface EtOrderMapper */ public List selectEtOrderListNoRoute2(EtOrderQuery etOrder); + /** + * 查询充值记录(从视图中获取) + * + * @param etOrder 订单 + * @return 订单集合 + */ + List selectFromRechargeView(EtOrderQuery etOrder); + /** * 新增订单 * @@ -224,7 +233,7 @@ public interface EtOrderMapper /** * 还车待审核订单数 */ - int getAuditOrderNum(@Param("timeStart") String timeStart, @Param("timeEnd") String timeEnd, @Param("areaId") String areaId); + int getAuditOrderNum(@Param("status") String status, @Param("timeStart") String timeStart, @Param("timeEnd") String timeEnd, @Param("areaId") String areaId); /** * 待审核还车押金扣款 @@ -236,6 +245,10 @@ public interface EtOrderMapper */ int getOrderNum(@Param("timeStart") String timeStart, @Param("timeEnd") String timeEnd, @Param("areaId") Long areaId, @Param("areaIds") List areaIds); + /** + * 获取订单数 + */ + int getOrderNum2(@Param("timeStart") String timeStart, @Param("timeEnd") String timeEnd, @Param("areaId") Long areaId, @Param("channelId") Long channelId); /** * 订单总金额 */ @@ -324,6 +337,11 @@ public interface EtOrderMapper */ BigDecimal getDepositAmount(@Param("startDateStr") String startDateStr , @Param("endDateStr") String endDateStr, @Param("areaId") Long areaId,@Param("channelId") Long channelId); + /** + * 获取渠道成本 + */ + BigDecimal getCost(@Param("startDateStr") String startDateStr, @Param("endDateStr") String endDateStr, @Param("areaId") Long areaId,@Param("channelId") Long channelId); + // /** // * 平台服务费 // */ diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/IEtCapitalFlowService.java b/electripper-system/src/main/java/com/ruoyi/system/service/IEtCapitalFlowService.java index 4626b0f..acf179f 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/IEtCapitalFlowService.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/IEtCapitalFlowService.java @@ -44,6 +44,14 @@ public interface IEtCapitalFlowService */ public List selectEtCapitalFlowList(EtCapitalFlow etCapitalFlow); + /** + * 查询数量 + * + * @param etCapitalFlow 资金流水 + * @return 资金流水集合 + */ + public int selectCount(EtCapitalFlow etCapitalFlow); + /** * 新增资金流水 * diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/IEtOrderService.java b/electripper-system/src/main/java/com/ruoyi/system/service/IEtOrderService.java index 14428a4..62b43b2 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/IEtOrderService.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/IEtOrderService.java @@ -193,6 +193,11 @@ public interface IEtOrderService */ List rechargeList(EtOrderQuery etOrder); + /** + * 查询充值/退款订单列表(视图) + */ + List rechargeList2(EtOrderQuery etOrder); + /** * 获取当前正在骑行中的订单 */ @@ -272,6 +277,11 @@ public interface IEtOrderService */ IndexAdminVo admimStatistics(); + /** + * 首页统计-数据库中获取 + */ + IndexAdminVo getIndexAdminVo(); + /** * 首页统计-排行榜 */ diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java index db72108..a0448db 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java @@ -38,11 +38,15 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.support.TransactionTemplate; import javax.annotation.Resource; +import java.io.UnsupportedEncodingException; import java.math.BigDecimal; import java.math.RoundingMode; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; +import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -1895,6 +1899,8 @@ public class AsDeviceServiceImpl extends ServiceImpl i log.info("【还车关锁】远程关锁失败"); throw new ServiceException("远程关锁失败"); } + /** 3. 递归检查3次车辆状态*/ + recursiveCheck(orderNo, lon, lat, device, token); }else{ // 更新定位 device.setLongitude(lon); @@ -1980,6 +1986,35 @@ public class AsDeviceServiceImpl extends ServiceImpl i } } + private void recursiveCheck(String orderNo, String lon, String lat, AsDevice device, String token) { + // 定义一个递归检查并重试的函数 + Runnable checkAndRetryLock = new Runnable() { + private int attempt = 0; + private static final int MAX_ATTEMPTS = 3; // 设置最大尝试次数为2次(总共发送4次命令) + + @Override + public void run() { + LocationVo latestLocation2 = getLatestLocation2(device.getMac()); + // 检查电门是否仍处于开启状态且没有正在进行的订单 + if (!etOrderService.isInOrderBySn(device.getSn()) && latestLocation2.getQ() == 1) { + attempt++; + if (attempt <= MAX_ATTEMPTS) { + // 发送关锁命令 + sendCommandWithResp(device.getMac(), token, IotConstants.COMMAND_CLOSE + IotConstants.COMMAND_FREQUENCY_3600, + "车辆锁同步关锁尝试" + attempt, orderNo, lon, lat); + // 如果尝试次数未达到上限,则安排下一次尝试 + Executors.newSingleThreadScheduledExecutor().schedule(this, 3, TimeUnit.SECONDS); + } else { + log.info("【还车关锁】多次尝试后依然无法关闭车辆锁"); + } + } + } + }; + + // 初始调用 + Executors.newSingleThreadScheduledExecutor().schedule(checkAndRetryLock, 3, TimeUnit.SECONDS); + } + // /** 押金抵扣 */ // private void depositDeduction(EtOrder order) { //// EtFeeRule rule = etFeeRuleService.selectEtFeeRuleByRuleIdIncludeDelete(order.getRuleId()); @@ -2417,6 +2452,9 @@ public class AsDeviceServiceImpl extends ServiceImpl i String latitude = device.getLatitude(); String longitude = device.getLongitude(); log.info("定位:{},{},=============运营区【{}】,边界:【{}】",longitude,latitude,area.getAreaName(),area.getBoundaryStr()); + if(StrUtil.isBlank(area.getBoundary())){ + return true; + } Geometry geometry = GeoUtils.fromWkt(area.getBoundary()); inCircle = GeoUtils.isInCircle(longitude, latitude, geometry); if(inCircle){ @@ -2657,8 +2695,8 @@ public class AsDeviceServiceImpl extends ServiceImpl i AsDevice device = asDeviceMapper.selectAsDeviceBySn(sn); double[] latestLocation = getLatestLocation(device.getMac()); if(ObjectUtil.isNotNull(latestLocation)){ - BigDecimal longitude1 = new BigDecimal(latestLocation[1]).setScale(8, RoundingMode.HALF_UP); - BigDecimal latitude1 = new BigDecimal(latestLocation[0]).setScale(8, RoundingMode.HALF_UP); + BigDecimal longitude1 = BigDecimal.valueOf(latestLocation[1]).setScale(8, RoundingMode.HALF_UP); + BigDecimal latitude1 = BigDecimal.valueOf(latestLocation[0]).setScale(8, RoundingMode.HALF_UP); log.info("【判断是否在停车区】,lon:{},lat:{}",longitude1,latitude1); Boolean parkingZoneByLocation = isParkingZoneByLocation(longitude1.toString(), latitude1.toString(), Long.parseLong(areaId)); if(parkingZoneByLocation){ @@ -2952,6 +2990,30 @@ public class AsDeviceServiceImpl extends ServiceImpl i return null; } + @SneakyThrows + public LocationVo getLatestLocation2(String mac) { + String token = Token.getToken(); + DataPointRes datapoints = historyDatapoints(mac, token); + if(datapoints.getCode() == 0){ + Data data = datapoints.getData(); + List datastreams = data.getDevices(); + for (Datastream datastream: datastreams) { + List datapointList = datastream.getDatastreams(); + if(ObjectUtil.isNotNull(datapointList)){ + for (Datapoint datapoint:datapointList) { + if(datapoint.getId().equals(IotConstants.ONENET_LOCATION)){ + String string = JSON.toJSONString(datapoint.getValue()); + if(StrUtil.isNotBlank(string)){ + return JSONObject.parseObject(string, LocationVo.class); + } + } + } + } + } + } + return null; + } + /** 计算电量和里程后更新设备*/ public int updateDevice(String at,LocationVo locationVo, AsDevice device, BigDecimal lon, BigDecimal lat) { device.setLatitude(lat.toString()); @@ -3013,7 +3075,11 @@ public class AsDeviceServiceImpl extends ServiceImpl i device.setSignalStrength(locationVo.getCsq()); device.setSatellites(locationVo.getS()); device.setQuality(locationVo.getQ()); - return updateLocation(device); + //开异步线程:1.更新在线状态 2.记录在线、离线日志 + scheduledExecutorService.schedule(() -> { + updateLocation(device); + }, 0, TimeUnit.SECONDS); + return 1; } /** 无定位更新设备 */ diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/CallbackServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/CallbackServiceImpl.java index 1cd865a..1765353 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/impl/CallbackServiceImpl.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/CallbackServiceImpl.java @@ -45,6 +45,7 @@ import org.springframework.transaction.support.TransactionTemplate; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; +import java.math.RoundingMode; import java.time.LocalDateTime; import java.util.Comparator; import java.util.Date; @@ -338,8 +339,8 @@ public class CallbackServiceImpl implements CallbackService { private BigDecimal getCost(ChannelVO channel,BigDecimal payFee) { // 获取到渠道成本 BigDecimal costRate = channel.getCostRate(); - BigDecimal bigDecimal = costRate.divide(new BigDecimal(100), 6, BigDecimal.ROUND_HALF_UP); - BigDecimal cost = bigDecimal.multiply(payFee).setScale(2, BigDecimal.ROUND_HALF_UP); + BigDecimal bigDecimal = costRate.divide(new BigDecimal(100), 6, RoundingMode.HALF_UP); + BigDecimal cost = bigDecimal.multiply(payFee).setScale(2, RoundingMode.HALF_UP); logger.info("【保存资金流水记录--订单支付】 成本==============bigDecimal=====================:"+bigDecimal); logger.info("【保存资金流水记录--订单支付】 成本==============cost=====================:"+cost); return cost; diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtCapitalFlowServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtCapitalFlowServiceImpl.java index fc064f7..5494591 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtCapitalFlowServiceImpl.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtCapitalFlowServiceImpl.java @@ -72,6 +72,13 @@ public class EtCapitalFlowServiceImpl implements IEtCapitalFlowService return etCapitalFlowMapper.selectEtCapitalFlowList(etCapitalFlow); } + + @Override + public int selectCount(EtCapitalFlow etCapitalFlow) + { + return etCapitalFlowMapper.selectCount(etCapitalFlow); + } + /** * 新增资金流水 * diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtOrderServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtOrderServiceImpl.java index 9acc501..d690ac5 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtOrderServiceImpl.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtOrderServiceImpl.java @@ -1,6 +1,5 @@ package com.ruoyi.system.service.impl; -import cn.hutool.core.thread.ThreadUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson2.JSON; @@ -32,11 +31,11 @@ import com.ruoyi.system.domain.*; import com.ruoyi.system.domain.vo.*; import com.ruoyi.system.mapper.*; import com.ruoyi.system.service.*; -import com.wechat.pay.java.service.payments.jsapi.model.PrepayWithRequestPaymentResponse; import com.wechat.pay.java.service.payments.model.Transaction; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.ObjectUtils; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -57,6 +56,10 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; +import static com.ruoyi.common.constant.CacheConstants.CACHE_ADMIN_STATISTICS; +import static com.ruoyi.common.constant.ServiceConstants.ORDER_STATUS_OFFICIAL_REVIEW; +import static com.ruoyi.common.constant.ServiceConstants.ORDER_STATUS_TO_BE_AUDIT; + /** * 订单Service业务层处理 * @@ -154,6 +157,9 @@ public class EtOrderServiceImpl implements IEtOrderService @Autowired private RedisCache redisCache; + @Resource + private EtReconciliationMapper reconciliationMapper; + /** * 查询订单 * @@ -377,6 +383,12 @@ public class EtOrderServiceImpl implements IEtOrderService return etOrders; } + @Override + @DataScope(deptAlias = "d") + public List rechargeList2(EtOrderQuery etOrder) { + return etOrderMapper.selectFromRechargeView(etOrder); + } + /** * 查询充值/退款订单列表 */ @@ -425,7 +437,7 @@ public class EtOrderServiceImpl implements IEtOrderService rechargeVoList.add(rechargeVo); }); } - //补充代码 根据isRefund判断,如果isRefund只存在"0",则只查询未退款(rechargeVo.isRefunded字段,布尔类型的)的记录,如果isRefund存在"1",则查询已退款的记录,如果isRefund为空或两个都有,则查询全部 + //根据isRefund判断,如果isRefund只存在"0",则只查询未退款(rechargeVo.isRefunded字段,布尔类型的)的记录,如果isRefund存在"1",则查询已退款的记录,如果isRefund为空或两个都有,则查询全部 List isRefund = etOrder.getIsRefund(); if (isRefund != null && isRefund.size() > 0) { // 如果只包含 "0",则过滤未退款记录 @@ -612,7 +624,7 @@ public class EtOrderServiceImpl implements IEtOrderService if (x != null) return x; EtOrder depositOrder = getDepositOrder(order.getUserId()); BigDecimal deposit = depositOrder.getTotalFee(); - BigDecimal ridingFee = order.getTotalFee(); + BigDecimal ridingFee = order.getPayFee(); BigDecimal afterDeductionFee; String mark; if(deposit.compareTo(ridingFee) <= 0){ @@ -632,6 +644,8 @@ public class EtOrderServiceImpl implements IEtOrderService order1.setPayType(ServiceConstants.PAY_TYPE_YJ); order1.setMark(mark); order1.setDepositDeduction(ServiceConstants.IS_DEPOSIT_DEDUCTION); + ChannelVO channelVO = etChannelService.selectSmChannelByChannelId(order.getPayChannel()); + order1.setCost(getCost(channelVO,ridingFee)); int updateEtOrder = etOrderMapper.updateEtOrder(order1); if(updateEtOrder == 0){ throw new ServiceException("押金抵扣失败,更新骑行订单失败"); @@ -676,6 +690,13 @@ public class EtOrderServiceImpl implements IEtOrderService redisLock.unlock(RedisLockKey.DEDUCTION, orderNo); } } + private BigDecimal getCost(ChannelVO channel,BigDecimal payFee) { + // 获取到渠道成本 + BigDecimal costRate = channel.getCostRate(); + BigDecimal bigDecimal = costRate.divide(new BigDecimal(100), 6, RoundingMode.HALF_UP); + return bigDecimal.multiply(payFee).setScale(2, RoundingMode.HALF_UP); + } + private @Nullable Integer isExistOutTradeNo(EtOrder order, String orderNo) { // 押金抵扣时,判断是否有outtradeno @@ -1029,7 +1050,7 @@ public class EtOrderServiceImpl implements IEtOrderService indexVo.setUnpaidOrderCount(Integer.parseInt(etOrderMapper.getUnpaidOrder(null,null,areaId+"")));//待付款订单数 indexVo.setUnpaidOrderFee(new BigDecimal(etOrderMapper.getTotalUnpaid(null,null,areaId+"")));//待付款订单金额 - indexVo.setReturnOrderCount(etOrderMapper.getAuditOrderNum(null,null,areaId+""));//还车待审核订单 + indexVo.setReturnOrderCount(etOrderMapper.getAuditOrderNum("5",null,null,areaId+""));//还车待审核订单 indexVo.setRidingOrder(Integer.parseInt(etOrderMapper.getRidingOrder(null,null,areaId+"")));//骑行中订单 indexVo.setTodayRefundFee(new BigDecimal(etOrderMapper.getTotalRefund(startDateStr,endDateStr,areaId+"")));// 今日退款金额 indexVo.setFaultOrderCount(etFaultMapper.getAuditFaultNum(areaId));//待审核故障数量 @@ -1085,7 +1106,7 @@ public class EtOrderServiceImpl implements IEtOrderService @Override public IndexAdminVo admimStatistics() { // 定义缓存的键 - String cacheKey = "adminStatistics"; + String cacheKey = CACHE_ADMIN_STATISTICS; // 从 Redis 中获取缓存对象 IndexAdminVo cachedIndexAdminVo = redisCache.getCacheObject(cacheKey); @@ -1093,14 +1114,28 @@ public class EtOrderServiceImpl implements IEtOrderService log.info("【首页统计】从缓存中获取数据:{}", JSON.toJSON(cachedIndexAdminVo)); return cachedIndexAdminVo; // 如果缓存存在,则直接返回 } + log.info("【首页统计】从数据库中获取数据"); + IndexAdminVo indexAdminVo = getIndexAdminVo(); + + // 将生成的对象保存到 Redis + redisCache.setCacheObject(cacheKey, indexAdminVo, 30, TimeUnit.MINUTES); + + return indexAdminVo; + } + + @Override + @NotNull + public IndexAdminVo getIndexAdminVo() { /** 首页数据*/ IndexAdminVo indexAdminVo = createIndexAdminVo(); /** 营收统计*/ ArrayList incomeVos = new ArrayList<>(); + ArrayList incomeCosts = new ArrayList<>(); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); Calendar calendar = Calendar.getInstance(); calendar.setTime(DateUtils.getNowDate()); + calendar.add(Calendar.DAY_OF_MONTH, -1); for (int i = 0; i < 13; i++) { String formattedDate = dateFormat.format(calendar.getTime()); @@ -1108,13 +1143,61 @@ public class EtOrderServiceImpl implements IEtOrderService String endDateStr = formattedDate + " " + Constants.DATE_FORMAT_END_PEREND; int orderCount = etOrderMapper.getOrderNum(startDateStr, endDateStr, null,null); IndexAdminVo.IncomeVo incomeVo = new IndexAdminVo.IncomeVo(); + + EtReconciliation reconciliation = new EtReconciliation(); + // 准备额外的查询参数 + reconciliation.setDay(formattedDate); + List etReconciliations = reconciliationMapper.selectEtReconciliationList(reconciliation); + Collections.reverse(etReconciliations); + IndexAdminVo.IncomeCostVo incomeCostVo = new IndexAdminVo.IncomeCostVo(); + // 初始化统计变量 + BigDecimal serviceFeeTotal = BigDecimal.ZERO; + BigDecimal handlingFeeTotal = BigDecimal.ZERO; + BigDecimal channelCostTotal = BigDecimal.ZERO; + BigDecimal withdrawServiceFeeFirst = BigDecimal.ZERO; + + // 遍历 etReconciliations 进行统计 + for (EtReconciliation item : etReconciliations) { + // 累加服务费 + if (item.getPlatformServiceFee() != null) { + serviceFeeTotal = serviceFeeTotal.add(item.getPlatformServiceFee()); + } + // 累加手续费(假设 handlingCharge 是 EtReconciliation 的一个属性) + if (item.getHandlingCharge() != null) { + handlingFeeTotal = handlingFeeTotal.add(item.getHandlingCharge()); + } + // 累加渠道成本 + if (item.getChannelCost() != null) { + channelCostTotal = channelCostTotal.add(item.getChannelCost()); + } + // 提现服务费只拿第一个值 + if (item.getWithdrawServiceFee() != null) { + withdrawServiceFeeFirst = item.getWithdrawServiceFee(); + } + } + + // 计算平台盈利(这里只是一个示例,具体公式根据实际情况调整) + BigDecimal platformProfit = serviceFeeTotal.subtract(handlingFeeTotal).subtract(channelCostTotal); + + // 设置 IncomeCostVo 的值 + incomeCostVo.setDay(formattedDate); + incomeCostVo.setServiceFee(serviceFeeTotal); + incomeCostVo.setHandlingFee(handlingFeeTotal); + incomeCostVo.setWithdrawalFee(withdrawServiceFeeFirst); // 设置提现手续费 + incomeCostVo.setChannelCost(channelCostTotal); + incomeCostVo.setPlatformProfit(platformProfit); + incomeVo.setDay(formattedDate); incomeVo.setOrderNum(orderCount); incomeVo.setOrderFee(etOrderMapper.getOrderFee(startDateStr, endDateStr, null)); + incomeVo.setRefundFee(etOrderMapper.getRefundFee(startDateStr, endDateStr, null,null,null)); + incomeVos.add(incomeVo); + incomeCosts.add(incomeCostVo); calendar.add(Calendar.DATE, -1); } indexAdminVo.setIncomeVoList(incomeVos); + indexAdminVo.setIncomeCostList(incomeCosts); /** 车辆统计*/ IndexAdminVo.VehicleVo vehicleVo = new IndexAdminVo.VehicleVo(); @@ -1136,10 +1219,6 @@ public class EtOrderServiceImpl implements IEtOrderService operationVo.setBluetoothUnlockCount(operLogService.getBluetoothUnlockCount(todayStartDateStr, todayEndDateStr,BusinessStatus.SUCCESS.name()));//蓝牙解锁数 indexAdminVo.setOperationVo(operationVo); log.info("【首页统计-总管理】indexAdminVo==={}",JSON.toJSON(indexAdminVo)); - - // 将生成的对象保存到 Redis - redisCache.setCacheObject(cacheKey, indexAdminVo, 30, TimeUnit.MINUTES); - return indexAdminVo; } @@ -1245,9 +1324,15 @@ public class EtOrderServiceImpl implements IEtOrderService indexAdminVo.setUnpaidOrderCount(Integer.parseInt(etOrderMapper.getUnpaidOrder(null,null,null)));//待付款订单数 indexAdminVo.setUnpaidOrderFee(new BigDecimal(etOrderMapper.getTotalUnpaid(null,null,null)));//待付款订单金额 - indexAdminVo.setReturnOrderCount(etOrderMapper.getAuditOrderNum(null,null,null));//还车待审核订单 + indexAdminVo.setReturnOrderCount(etOrderMapper.getAuditOrderNum(ORDER_STATUS_TO_BE_AUDIT,null,null,null));//还车待审核订单 indexAdminVo.setReturnOrderDeductFee(etOrderMapper.getReturnOrderDeductFee(null,null,null));// 待审核还车押金扣款 + EtCapitalFlow etCapitalFlow = new EtCapitalFlow(); + etCapitalFlow.setBusType(ServiceConstants.ORDER_TYPE_WITHDRAW); + etCapitalFlow.setStatus(ServiceConstants.FLOW_STATUS_APPLY); + indexAdminVo.setWithdrawReviewCount(etCapitalFlowService.selectCount(etCapitalFlow));// 提现待审核数 + indexAdminVo.setDeductionReviewCount(etOrderMapper.getAuditOrderNum(ORDER_STATUS_OFFICIAL_REVIEW,null,null,null));//扣款待审核数 + indexAdminVo.setTodayHandlingFee(etCapitalFlowMapper.getHandlingFee(startDateStr, endDateStr, null,null,null,null));// 今日支付手续费 indexAdminVo.setTotalHandlingFee(etCapitalFlowMapper.getHandlingFee(null, null, null,null,null,null));// 总手续费 @@ -1960,8 +2045,7 @@ public class EtOrderServiceImpl implements IEtOrderService */ @Override public EtOrder latestOrder2(EtOrder etOrder) { - EtOrder order = etOrderMapper.selectLatestOrder2(etOrder); - return order; + return etOrderMapper.selectLatestOrder2(etOrder); } /** @@ -1985,8 +2069,8 @@ public class EtOrderServiceImpl implements IEtOrderService throw new ServiceException("订单未支付,不能退款"); } SysDept sysDept = wxPayService.getDeptObjByAreaId(etOrder1.getAreaId()); - BigDecimal subtract = sysDept.getBalance().subtract(etOrder1.getTotalFee()); - if(subtract.compareTo(BigDecimal.ZERO) <= 0 && sysDept.getSeparateAccount().equals("N")){ + BigDecimal subtract = sysDept.getBalance().subtract(etOrder1.getOperatorDividend());// 运营商分账的钱 + if(subtract.compareTo(BigDecimal.ZERO) < 0 && sysDept.getSeparateAccount().equals("N")){ throw new ServiceException("余额不足,不能退款"); } /** 1.退款*/ diff --git a/electripper-system/src/main/java/com/ruoyi/system/task/EtTask.java b/electripper-system/src/main/java/com/ruoyi/system/task/EtTask.java index 6bc3dd1..cf66329 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/task/EtTask.java +++ b/electripper-system/src/main/java/com/ruoyi/system/task/EtTask.java @@ -27,6 +27,7 @@ import com.ruoyi.common.utils.onenet.Token; import com.ruoyi.common.utils.uuid.IdUtils; import com.ruoyi.system.domain.*; import com.ruoyi.system.domain.vo.AsDeviceVO; +import com.ruoyi.system.domain.vo.IndexAdminVo; import com.ruoyi.system.domain.vo.SelfReconciliationVO; import com.ruoyi.system.mapper.*; import com.ruoyi.system.service.*; @@ -54,6 +55,8 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import java.util.stream.IntStream; +import static com.ruoyi.common.constant.CacheConstants.CACHE_ADMIN_STATISTICS; + /** * 定时任务调度测试 * @@ -892,19 +895,27 @@ public class EtTask { private SelfReconciliationVO buildSelfReconciliation(String startDateStr, String endDateStr, String formattedDate, Long aLong, Long channelId) { SelfReconciliationVO selfReconciliationVO = new SelfReconciliationVO(); selfReconciliationVO.setDay(formattedDate); - BigDecimal totalFlowAmount = defaultIfNull(etOrderMapper.getTotalPaidFee(startDateStr, endDateStr, aLong,channelId),BigDecimal.ZERO);// 骑行订单收入 29835.51 + BigDecimal totalFlowAmount = defaultIfNull(etOrderMapper.getTotalPaidFee(startDateStr, endDateStr, aLong,channelId),BigDecimal.ZERO);// 总流水收入 29835.51 BigDecimal totalAmount = defaultIfNull(etCapitalFlowMapper.getOrderPaidAmount(startDateStr, endDateStr, aLong,channelId),BigDecimal.ZERO);// 骑行订单收入 4712.51 + int orderCount = etOrderMapper.getOrderNum2(startDateStr, endDateStr, aLong,channelId); BigDecimal deductionAmount = defaultIfNull(etOrderMapper.getDepositDeductionAmount(startDateStr, endDateStr, aLong,channelId),BigDecimal.ZERO);// 押金抵扣金额 538 BigDecimal depositAmount = defaultIfNull(etOrderMapper.getDepositAmount(startDateStr, endDateStr, aLong,channelId),BigDecimal.ZERO);// 押金收入 25123 BigDecimal handlingFee = etCapitalFlowMapper.getHandlingFee2(startDateStr, endDateStr, null, aLong,channelId);//手续费,扣除掉退款部分的 BigDecimal platformServiceFee = etCapitalFlowMapper.getServiceFee2(startDateStr, endDateStr, null,aLong,channelId);//平台服务费 ,扣除掉退款部分的 + BigDecimal withdrawServiceFee = etCapitalFlowMapper.getWithdrawServiceFee(startDateStr, endDateStr,aLong);//提现服务费 ,扣除掉提现失败部分的 + BigDecimal cost = defaultIfNull(etOrderMapper.getCost(startDateStr, endDateStr, aLong,channelId),BigDecimal.ZERO);// 押金收入 25123 selfReconciliationVO.setOrderPaid(totalAmount); + selfReconciliationVO.setOrderCount(orderCount); selfReconciliationVO.setTotalFlowAmount(totalFlowAmount); selfReconciliationVO.setDeductionAmount(deductionAmount); selfReconciliationVO.setDepositPaid(depositAmount); selfReconciliationVO.setHandlingCharge(handlingFee); selfReconciliationVO.setPlatformServiceFee(platformServiceFee); + if(channelId == 2){ + selfReconciliationVO.setChannelCost(cost); + } + selfReconciliationVO.setWithdrawServiceFee(withdrawServiceFee); /** 总支出*/ BigDecimal orderRefund = defaultIfNull(etOrderMapper.getRefundFee2(startDateStr, endDateStr, null, aLong,channelId), BigDecimal.ZERO);//订单退款 @@ -941,6 +952,9 @@ public class EtTask { etReconciliation.setSettlementAmount(selfReconciliationVO.getSettlementAmount()); etReconciliation.setCreateTime(DateUtils.getNowDate()); etReconciliation.setPayChannel(channelId); + etReconciliation.setOrderCount(selfReconciliationVO.getOrderCount()); + etReconciliation.setChannelCost(selfReconciliationVO.getChannelCost()); + etReconciliation.setWithdrawServiceFee(selfReconciliationVO.getWithdrawServiceFee()); int i1 = etReconciliationMapper.insertEtReconciliation(etReconciliation); log.info("【平台对账】保存对账数据结果:【{}】",i1); } @@ -972,4 +986,19 @@ public class EtTask { } } } + + /** + * 10分钟获取一次首页统计数据保存至缓存 + * cron: 0 * /10 * * * ? + */ + public void getIndexAdminVo() { + + log.info("【首页统计】从数据库中获取数据"); + IndexAdminVo indexAdminVo = etOrderService.getIndexAdminVo(); + + // 将生成的对象保存到 Redis + redisCache.setCacheObject(CACHE_ADMIN_STATISTICS, indexAdminVo); + + } + } diff --git a/electripper-system/src/main/resources/mapper/system/AsUserMapper.xml b/electripper-system/src/main/resources/mapper/system/AsUserMapper.xml index 70800d7..7862605 100644 --- a/electripper-system/src/main/resources/mapper/system/AsUserMapper.xml +++ b/electripper-system/src/main/resources/mapper/system/AsUserMapper.xml @@ -34,6 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -45,8 +46,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select u.user_id, u.user_name, u.real_name, u.id_card, u.nick_name, u.email, u.avatar, u.phonenumber, u.balance, u.birthday, u.password, u.pay_password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,u.wxopenid,u.aliopenid, - u.is_sign,u.role,u.sys_role,u.sys_user_id,u.area_id,u.is_authentication,u.app_name,u.appid,u.vip_type,u.expiration_time + u.is_sign,u.role,u.sys_role,u.sys_user_id,u.area_id,oa.area_name, u.is_authentication,u.app_name,u.appid,u.vip_type,u.expiration_time from et_user u + left join et_operating_area oa on oa.area_id = u.area_id SELECT cf.flow_id, @@ -63,39 +94,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN et_model m ON m.model_id = cf.model_id WHERE 1 = 1 - and cf.area_id = #{areaId} - and cf.order_no = #{orderNo} - and cf.owner_id = #{ownerId} - and cf.owner_phone like concat('%', #{ownerPhone}, '%') - and cf.owner_type = #{ownerType} - and cf.out_trade_no = #{outTradeNo} - and cf.type = #{type} - and cf.bus_type = #{busType} - and cf.status = #{status} - and cf.amount = #{amount} - and cf.handling_charge = #{handlingCharge} - and cf.operator_dividend = #{operatorDividend} - and cf.operator_balance = #{operatorBalance} - and cf.partner_dividend = #{partnerDividend} - and cf.model_id = #{modelId} - and cf.pay_type = #{payType} - - AND DATE(cf.create_time) >= #{params.beginTime} - - - AND DATE(cf.create_time) <= #{params.endTime} - - - AND cf.bus_type IN - - #{item} - - + ${params.dataScope} order by cf.create_time desc + + + + + + + - select COALESCE(count(1), 0) from et_order where status = 5 and type = 1 + select COALESCE(count(1), 0) from et_order where type = 1 + + AND status = #{status} + AND DATE(create_time) >= #{timeStart} @@ -663,6 +731,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and area_id = #{areaId} + + + + @@ -47,6 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND `day` <= #{params.endTime} + and day = #{day} order by `day` desc @@ -74,6 +79,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" deposit_surplus, order_refund, order_surplus, + order_count, + withdraw_service_fee, + channel_cost, #{orderPaid}, @@ -91,6 +99,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{depositSurplus}, #{orderRefund}, #{orderSurplus}, + #{orderCount}, + #{withdrawServiceFee}, + #{channelCost}, @@ -112,6 +123,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" deposit_surplus = #{depositSurplus}, order_refund = #{orderRefund}, order_surplus = #{orderSurplus}, + order_count = #{orderCount}, + withdraw_service + channel_cost = #{channelCost}, where reconciliation_id = #{reconciliationId} diff --git a/electripper-system/src/main/resources/mapper/system/EtRefundMapper.xml b/electripper-system/src/main/resources/mapper/system/EtRefundMapper.xml index a0cb0f7..4b4cdf4 100644 --- a/electripper-system/src/main/resources/mapper/system/EtRefundMapper.xml +++ b/electripper-system/src/main/resources/mapper/system/EtRefundMapper.xml @@ -46,6 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and r.refund_result = #{refundResult} and r.type = #{refundType} and d.dept_id = #{deptId} + and u.user_id = #{userId} and u.user_name like concat('%', #{userName}, '%') ${params.dataScope}