首页优化

快速生成
This commit is contained in:
邱贞招 2024-11-05 13:54:18 +08:00
parent 3767ec6b65
commit 1dbfb4f59b
23 changed files with 542 additions and 151 deletions

View File

@ -9,9 +9,11 @@ import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.system.domain.EtOperatingArea;
import com.ruoyi.system.domain.vo.IndexAdminVo;
import com.ruoyi.system.domain.vo.IndexVo;
import com.ruoyi.system.domain.vo.StatisticsResult;
import com.ruoyi.system.domain.vo.LeaderboardVo;
import com.ruoyi.system.service.IEtOperatingAreaService;
import com.ruoyi.system.service.IEtOrderService;
import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -19,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
@ -72,10 +75,51 @@ public class IndexController extends BaseController
public AjaxResult statistics(Long areaId)
{
logger.info("【首页统计】请求参数: areaId={}", areaId);
IndexVo indexVo = etOrderService.statistics(areaId);
IndexVo indexVo = etOrderService.statistics(areaId,"1");
return success(indexVo);
}
/**
* 首页统计-运营商
*/
@GetMapping(value = "/statisticsByDeptId")
public AjaxResult statisticsByDeptId(Long deptId)
{
logger.info("【运营商统计】请求参数: deptId={}", deptId);
if(deptId == null){
throw new ServiceException("运营商id不能为空deptId");
}
List<Long> areaIds = etOperatingAreaService.selectAreaListByDeptId(deptId);
// 创建一个结果对象
IndexVo result = new IndexVo();
for (Long areaId : areaIds) {
IndexVo areaIndexVo = etOrderService.statistics(areaId,"2");
// 赋值
assign(result, areaIndexVo);
}
return success(result);
}
private static void assign(IndexVo result, IndexVo areaIndexVo) {
result.setBalance(result.getBalance().add(areaIndexVo.getBalance()));
result.setWithdraw(result.getWithdraw().add(areaIndexVo.getWithdraw()));
result.setSettlementAmount(result.getSettlementAmount().add(areaIndexVo.getSettlementAmount()));
result.setTodayIncome(result.getTodayIncome().add(areaIndexVo.getTodayIncome()));
result.setTodayOrderFee(result.getTodayOrderFee().add(areaIndexVo.getTodayOrderFee()));
result.setTodayOrderCount(result.getTodayOrderCount() + areaIndexVo.getTodayOrderCount());
result.setTotalIncome(result.getTotalIncome().add(areaIndexVo.getTotalIncome()));
result.setTotalOrderCount(result.getTotalOrderCount() + areaIndexVo.getTotalOrderCount());
result.setTotalOrderFee(result.getTotalOrderFee().add(areaIndexVo.getTotalOrderFee()));
result.setUnpaidOrderCount(result.getUnpaidOrderCount() + areaIndexVo.getUnpaidOrderCount());
result.setUnpaidOrderFee(result.getUnpaidOrderFee().add(areaIndexVo.getUnpaidOrderFee()));
result.setReturnOrderCount(result.getReturnOrderCount() + areaIndexVo.getReturnOrderCount());
result.setRidingOrder(result.getRidingOrder() + areaIndexVo.getRidingOrder());
result.setTodayRefundFee(result.getTodayRefundFee().add(areaIndexVo.getTodayRefundFee()));
result.setFaultOrderCount(result.getFaultOrderCount() + areaIndexVo.getFaultOrderCount());
result.setVehicleVo(areaIndexVo.getVehicleVo());
result.setIncomeVoList(areaIndexVo.getIncomeVoList());
}
/**
* 首页统计-总管理

View File

@ -345,6 +345,20 @@ public class AppController extends BaseController
return success(i);
}
/**
* 电压校准
*/
@PostMapping("/voltage/check")
public AjaxResult check(String sn)
{
if(StrUtil.isBlank(sn)){
logger.info("【电压校准】没有sn号参数【sn={}】",sn);
return error("请传sn号参数"+"【sn="+sn+"");
}
Boolean i =asDeviceService.check(sn);
return success(i);
}
/**
* 根据sn号查询车辆实时信息

View File

@ -559,6 +559,19 @@ public class AppVerifyController extends BaseController
return toAjax(asDeviceService.updateAsDeviceBySn(asDevice));
}
/**
* 修改车型
*/
@Log(title = "修改车型", businessType = BusinessType.UPDATE)
@PutMapping("/device/editModel")
public AjaxResult editModel(String sn, Long modelId)
{
AsDevice asDevice = new AsDevice();
asDevice.setSn(sn);
asDevice.setModelId(modelId);
return toAjax(asDeviceService.updateAsDeviceBySn(asDevice));
}
/**
* 我的工单列表
@ -1019,8 +1032,8 @@ public class AppVerifyController extends BaseController
for (Long id:longs) {
BigDecimal payFee = defaultIfNull(etOrderMapper.getPayFee(startDateStr, endDateStr, null, id), BigDecimal.ZERO);//新增
BigDecimal refundFee = defaultIfNull(etOrderMapper.getRefundFee(startDateStr, endDateStr, null, id), BigDecimal.ZERO);//退款
BigDecimal serviceFee = etCapitalFlowMapper.getHandlingFee(startDateStr, endDateStr, null, id);//手续费,扣除掉退款部分的
BigDecimal platformServiceFee = etCapitalFlowMapper.getServiceFee(startDateStr, endDateStr, null,id);//平台服务费 ,扣除掉退款部分的
BigDecimal serviceFee = etCapitalFlowMapper.getHandlingFee(startDateStr, endDateStr, null, id,null);//手续费,扣除掉退款部分的
BigDecimal platformServiceFee = etCapitalFlowMapper.getServiceFee(startDateStr, endDateStr, null,id,null);//平台服务费 ,扣除掉退款部分的
BigDecimal areaOrderAmount = defaultIfNull(payFee.subtract(serviceFee).subtract(refundFee).subtract(platformServiceFee), BigDecimal.ZERO);//营收 = 新增 - 手续费 - 退款 - 平台服务费
if (areaOrderAmount != null) {
todayOrderAmount = todayOrderAmount.add(areaOrderAmount);
@ -1041,11 +1054,12 @@ public class AppVerifyController extends BaseController
//今日订单金额
BigDecimal todayOrderAmount = BigDecimal.ZERO;
Long areaId = user.getAreaId();
BigDecimal payFee = defaultIfNull(etOrderMapper.getPayFee(startDateStr, endDateStr, null, areaId), BigDecimal.ZERO);//新增
BigDecimal refundFee = defaultIfNull(etOrderMapper.getRefundFee(startDateStr, endDateStr, null, areaId), BigDecimal.ZERO);//退款
BigDecimal serviceFee = etCapitalFlowMapper.getHandlingFee(startDateStr, endDateStr, null, areaId);//手续费,扣除掉退款部分的
BigDecimal platformServiceFee = etCapitalFlowMapper.getServiceFee(startDateStr, endDateStr, null,areaId);//平台服务费 ,扣除掉退款部分的
Long userId = user.getUserId();
// 统计et_capital_flow中 合伙人
BigDecimal payFee = defaultIfNull(etCapitalFlowMapper.getTotalAmountByUserId(startDateStr, endDateStr,userId), BigDecimal.ZERO);
BigDecimal refundFee = defaultIfNull(etCapitalFlowMapper.getPartnerRefundFee(startDateStr, endDateStr, userId), BigDecimal.ZERO);//退款
BigDecimal serviceFee = etCapitalFlowMapper.getHandlingFee(startDateStr, endDateStr, null, null, userId);//手续费,扣除掉退款部分的 0.01
BigDecimal platformServiceFee = etCapitalFlowMapper.getServiceFee(startDateStr, endDateStr, null,null,userId);//平台服务费 ,扣除掉退款部分的
BigDecimal areaOrderAmount = defaultIfNull(payFee.subtract(serviceFee).subtract(refundFee).subtract(platformServiceFee), BigDecimal.ZERO);//营收 = 新增 - 手续费 - 退款 - 平台服务费
if (areaOrderAmount != null) {
todayOrderAmount = todayOrderAmount.add(areaOrderAmount);

View File

@ -136,8 +136,8 @@ public class SysDeptController extends BaseController
for (Long areaId:longs) {
BigDecimal payFee = defaultIfNull(etOrderMapper.getPayFee(startDateStr, endDateStr, null, areaId), BigDecimal.ZERO);//新增
BigDecimal refundFee = defaultIfNull(etOrderMapper.getRefundFee(startDateStr, endDateStr, null, areaId), BigDecimal.ZERO);//退款
BigDecimal serviceFee = etCapitalFlowMapper.getHandlingFee(startDateStr, endDateStr, null, areaId);//手续费,扣除掉退款部分的
BigDecimal platformServiceFee = etCapitalFlowMapper.getServiceFee(startDateStr, endDateStr, null,areaId);//平台服务费 ,扣除掉退款部分的
BigDecimal serviceFee = etCapitalFlowMapper.getHandlingFee(startDateStr, endDateStr, null, areaId,null);//手续费,扣除掉退款部分的
BigDecimal platformServiceFee = etCapitalFlowMapper.getServiceFee(startDateStr, endDateStr, null,areaId,null);//平台服务费 ,扣除掉退款部分的
BigDecimal areaOrderAmount = defaultIfNull(payFee.subtract(serviceFee).subtract(refundFee).subtract(platformServiceFee), BigDecimal.ZERO);//营收 = 新增 - 手续费 - 退款 - 平台服务费
if (areaOrderAmount != null) {
todayOrderAmount = todayOrderAmount.add(areaOrderAmount);
@ -172,6 +172,22 @@ public class SysDeptController extends BaseController
return toAjax(deptService.insertDept(dept));
}
/**
* 快速生成
*/
@PreAuthorize("@ss.hasPermi('system:dept:add')")
@Log(title = "快速生成", businessType = BusinessType.FASTCREATE)
@PostMapping("/fastCreate")
public AjaxResult fastInsertDept(@Validated @RequestBody SysDept dept)
{
if (!deptService.checkDeptNameUnique(dept))
{
return error("【快速生成】新增运营商'" + dept.getDeptName() + "'失败,运营商名称已存在");
}
dept.setCreateBy(getUsername());
return toAjax(deptService.fastInsertDept(dept));
}
/**
* 修改运营商
*/

View File

@ -57,4 +57,9 @@ public class CacheConstants
* 设备定位信息 redis key
*/
public static final String CACHE_DEVICE_KEY = "device:";
/**
* 首页数据 redis key
*/
public static final String INDEX_DATA = "index:";
}

View File

@ -86,6 +86,11 @@ public class IotConstants {
*/
public static final String COMMAND_PLAY1 = "play1@";
/**
* 电压校准
*/
public static final String VOLTAGE_CHECK = "check";
/**
* 命令 2营运边界
* 接近运营边界请规划好路线

View File

@ -34,6 +34,15 @@ public class SysDept extends BaseEntity
/** 部门名称 */
private String deptName;
/** 省 */
private String province;
/** 市 */
private String city;
/** 区 */
private String county;
/** 显示顺序 */
private Integer orderNum;
@ -133,6 +142,30 @@ public class SysDept extends BaseEntity
/** 支付渠道 */
public Long payChannel;
public String getCounty() {
return county;
}
public void setCounty(String county) {
this.county = county;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public Long getPayChannel() {
return payChannel;
}

View File

@ -218,4 +218,9 @@ public enum BusinessType
ZEROORDER,
LOGIN,
/**
* 快速生成
*/
FASTCREATE,
}

View File

@ -23,6 +23,10 @@ public class EtOrderQuery extends BaseEntity
@Excel(name = "类型")
private String type;
/** 运营商id */
@Excel(name = "运营商id")
private Long deptId;
/** 状态:0-预约中1-取消预约2-开始骑行3-结束 */
@Excel(name = "状态:0-预约中1-取消预约2-开始骑行3-结束")
private String status;

View File

@ -1,5 +1,6 @@
package com.ruoyi.system.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
@ -40,6 +41,11 @@ public class EtRefund extends BaseEntity
@Excel(name = "运营区id")
private Long areaId;
/** 运营商id */
@Excel(name = "运营商id")
@TableField(exist = false)
private Long deptId;
/** 运营区 */
@Excel(name = "运营区")
private String areaName;

View File

@ -0,0 +1,11 @@
package com.ruoyi.system.domain.vo;
import lombok.Data;
import java.util.List;
@Data
public class StatisticsResult {
private IndexVo deptStatistics;
private List<IndexVo> areaStatistics;
}

View File

@ -79,7 +79,7 @@ public interface EtCapitalFlowMapper
* @param areaId 运营区id
* @return
*/
BigDecimal getHandlingFee(@Param("timeStart") String timeStart, @Param("timeEnd") String timeEnd, @Param("sn") String sn, @Param("areaId") Long areaId);
BigDecimal getHandlingFee(@Param("timeStart") String timeStart, @Param("timeEnd") String timeEnd, @Param("sn") String sn, @Param("areaId") Long areaId, @Param("ownerId") Long ownerId);
/**
* 手续费
@ -95,7 +95,7 @@ public interface EtCapitalFlowMapper
* @param areaId 运营区id
* @return
*/
BigDecimal getServiceFee(@Param("timeStart") String timeStart, @Param("timeEnd") String timeEnd, @Param("sn") String sn, @Param("areaId") Long areaId);
BigDecimal getServiceFee(@Param("timeStart") String timeStart, @Param("timeEnd") String timeEnd, @Param("sn") String sn, @Param("areaId") Long areaId, @Param("ownerId") Long ownerId);
/**
* 平台服务费
*
@ -112,6 +112,13 @@ public interface EtCapitalFlowMapper
*/
BigDecimal getTotalAmount(@Param("timeStart") String timeStart, @Param("timeEnd") String timeEnd, @Param("sn") String sn, @Param("areaId") Long areaId);
/**
* 骑行订单收入
*
* @param ownerId 用户id
* @return
*/
BigDecimal getTotalAmountByUserId(@Param("timeStart") String timeStart, @Param("timeEnd") String timeEnd, @Param("ownerId") Long ownerId);
/**
* 押金抵扣收入
*
@ -135,4 +142,12 @@ public interface EtCapitalFlowMapper
* @return
*/
BigDecimal getAllUserReceipts(@Param("timeStart") String timeStart, @Param("timeEnd") String timeEnd, @Param("areaId") Long areaId,@Param("channelId") Long channelId);
/**
* 获取合伙人退款
*
* @param userId 用户id
* @return
*/
BigDecimal getPartnerRefundFee(@Param("timeStart") String timeStart, @Param("timeEnd") String timeEnd, @Param("ownerId") Long userId);
}

View File

@ -232,6 +232,11 @@ public interface IAsDeviceService extends IService<AsDevice>
*/
Boolean ringByMac(String mac);
/**
* 电压校准
*/
Boolean check(String sn);
/**
* 坐垫锁用mac
*/

View File

@ -263,7 +263,7 @@ public interface IEtOrderService
/**
* 首页统计-运营商
*/
IndexVo statistics(Long areaId);
IndexVo statistics(Long areaId,String type);
/**
* 首页统计-总管理

View File

@ -132,6 +132,14 @@ public interface ISysDeptService
*/
public int insertDept(SysDept dept);
/**
* 快速生成
*
* @param dept 部门信息
* @return 结果
*/
public int fastInsertDept(SysDept dept);
/**
* 修改保存部门信息
*

View File

@ -1456,6 +1456,26 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
return Boolean.TRUE;
}
/**
* 电压校准
* @param sn
* @return
*/
@SneakyThrows
@Override
public Boolean check(String sn) {
AsDevice asDevice = asDeviceMapper.selectAsDeviceBySn(sn);
/** 1.获取token*/
String token = Token.getToken();
Boolean execute = transactionTemplate.execute(e -> {
/** 2.发送命令*/
sendCommand(asDevice.getMac(), token,IotConstants.VOLTAGE_CHECK,"电压校准",null,null);
return Boolean.TRUE;
});
if(!execute)throw new ServiceException("电压校准失败");
return Boolean.TRUE;
}
/**
* 坐垫锁用mac

View File

@ -262,7 +262,6 @@ public class AsUserServiceImpl implements IAsUserService
@Transactional
public int updateUser(AsUser user)
{
Long userId = user.getUserId();
return asUserMapper.updateUser(user);
}

View File

@ -11,6 +11,7 @@ import com.ruoyi.common.constant.ServiceConstants;
import com.ruoyi.common.core.domain.entity.AsUser;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.enums.BusinessStatus;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.pay.PaymentResult;
@ -44,9 +45,12 @@ import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static com.ruoyi.common.constant.CacheConstants.INDEX_DATA;
/**
* 订单Service业务层处理
*
@ -138,6 +142,9 @@ public class EtOrderServiceImpl implements IEtOrderService
@Autowired
private TmPayService tmPayService;
@Autowired
private RedisCache redisCache;
/**
* 查询订单
*
@ -834,18 +841,44 @@ public class EtOrderServiceImpl implements IEtOrderService
* 首页统计-运营商
*/
@Override
public IndexVo statistics(Long areaId) {
public IndexVo statistics(Long areaId, String type) {
// 定义缓存的键
String cacheKey = "statistics:areaId_" + areaId + ":type_" + type;
IndexVo cachedIndexVo = redisCache.getCacheObject(cacheKey);
if (cachedIndexVo != null) {
log.info("【首页统计】从缓存中获取数据:" + cacheKey);
return cachedIndexVo; // 如果缓存存在则直接返回
}
/** 首页数据*/
SysDept sysDept = wxPayService.getDeptObjByAreaId(areaId);
IndexVo indexVo = createIndexVo(areaId,sysDept);
int defualtDays;
/** 营收统计*/
if(type.equals("1")){
/** 运维统计*/
IndexVo.OperationVo operationVo = new IndexVo.OperationVo();
operationVo.setReplacementOrderCount(etAdminOrderMapper.getOrderCount(ServiceConstants.ADMIN_ORDER_TYPE_REPLACEMENT,ServiceConstants.REPLACEMENT_ELECTRICITY_STATUS_UNDER_WAY,areaId));
operationVo.setCompletedReplacementOrderCount(etAdminOrderMapper.getOrderCount(ServiceConstants.ADMIN_ORDER_TYPE_REPLACEMENT,ServiceConstants.REPLACEMENT_ELECTRICITY_STATUS_COMPLETED,areaId));
operationVo.setDispatchCount(0);// 暂时没有调度工单
operationVo.setCompletedDispatchCount(0);// 暂时没有调度工单
operationVo.setRepairCount(etAdminOrderMapper.getOrderCount(ServiceConstants.ADMIN_ORDER_TYPE_REPAIR,ServiceConstants.REPLACEMENT_ELECTRICITY_STATUS_REPAIR,areaId));
operationVo.setCompletedRepairCount(etAdminOrderMapper.getOrderCount(ServiceConstants.ADMIN_ORDER_TYPE_REPAIR,ServiceConstants.REPLACEMENT_ELECTRICITY_STATUS_COMPLETED,areaId));
indexVo.setOperationVo(operationVo);
defualtDays = 13;
}else{
defualtDays = 29;
}
ArrayList<IndexVo.IncomeVo> incomeVos = new ArrayList<>();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
calendar.setTime(DateUtils.getNowDate());
for (int i = 0; i < 13; i++) {
for (int i = 0; i < defualtDays; i++) {
String formattedDate = dateFormat.format(calendar.getTime());
String startDateStr = formattedDate + " " + Constants.DATE_FORMAT_START_PEREND;
String endDateStr = formattedDate + " " + Constants.DATE_FORMAT_END_PEREND;
@ -867,19 +900,8 @@ public class EtOrderServiceImpl implements IEtOrderService
com.ruoyi.common.utils.bean.BeanUtils.copyBeanProp(vehicleVo,deviceNumVo);
indexVo.setVehicleVo(vehicleVo);
/** 运维统计*/
IndexVo.OperationVo operationVo = new IndexVo.OperationVo();
operationVo.setReplacementOrderCount(etAdminOrderMapper.getOrderCount(ServiceConstants.ADMIN_ORDER_TYPE_REPLACEMENT,ServiceConstants.REPLACEMENT_ELECTRICITY_STATUS_UNDER_WAY,areaId));
operationVo.setCompletedReplacementOrderCount(etAdminOrderMapper.getOrderCount(ServiceConstants.ADMIN_ORDER_TYPE_REPLACEMENT,ServiceConstants.REPLACEMENT_ELECTRICITY_STATUS_COMPLETED,areaId));
operationVo.setDispatchCount(0);// 暂时没有调度工单
operationVo.setCompletedDispatchCount(0);// 暂时没有调度工单
operationVo.setRepairCount(etAdminOrderMapper.getOrderCount(ServiceConstants.ADMIN_ORDER_TYPE_REPAIR,ServiceConstants.REPLACEMENT_ELECTRICITY_STATUS_REPAIR,areaId));
operationVo.setCompletedRepairCount(etAdminOrderMapper.getOrderCount(ServiceConstants.ADMIN_ORDER_TYPE_REPAIR,ServiceConstants.REPLACEMENT_ELECTRICITY_STATUS_COMPLETED,areaId));
indexVo.setOperationVo(operationVo);
log.info("【首页统计】indexVo==={}",JSON.toJSON(indexVo));
redisCache.setCacheObject(cacheKey, indexVo,30, TimeUnit.MINUTES);
return indexVo;
}
@ -923,8 +945,8 @@ public class EtOrderServiceImpl implements IEtOrderService
IndexVo.OrderFeeStatisticsVo feeStatisticsVo = new IndexVo.OrderFeeStatisticsVo();
BigDecimal payFee = defaultIfNull(etOrderMapper.getPayFee(startDateStr, endDateStr, null, areaId), BigDecimal.ZERO);//新增
BigDecimal refundFee = defaultIfNull(etOrderMapper.getRefundFee(startDateStr, endDateStr, null, areaId), BigDecimal.ZERO);//退款
BigDecimal serviceFee = etCapitalFlowMapper.getHandlingFee(startDateStr, endDateStr, null, areaId);//手续费,扣除掉退款部分的
BigDecimal platformServiceFee = etCapitalFlowMapper.getServiceFee(startDateStr, endDateStr, null,areaId);//平台服务费 ,扣除掉退款部分的
BigDecimal serviceFee = etCapitalFlowMapper.getHandlingFee(startDateStr, endDateStr, null, areaId,null);//手续费,扣除掉退款部分的
BigDecimal platformServiceFee = etCapitalFlowMapper.getServiceFee(startDateStr, endDateStr, null,areaId,null);//平台服务费 ,扣除掉退款部分的
BigDecimal incomeFee = defaultIfNull(payFee.subtract(serviceFee).subtract(refundFee).subtract(platformServiceFee), BigDecimal.ZERO);//营收 = 新增 - 手续费 - 退款 - 平台服务费
int orderCount = etOrderMapper.getOrderNum(startDateStr, endDateStr, areaId);
feeStatisticsVo.setOrderFee(payFee);
@ -938,6 +960,15 @@ public class EtOrderServiceImpl implements IEtOrderService
*/
@Override
public IndexAdminVo admimStatistics() {
// 定义缓存的键
String cacheKey = "adminStatistics";
// Redis 中获取缓存对象
IndexAdminVo cachedIndexAdminVo = redisCache.getCacheObject(cacheKey);
if (cachedIndexAdminVo != null) {
log.info("【首页统计】从缓存中获取数据:{}", JSON.toJSON(cachedIndexAdminVo));
return cachedIndexAdminVo; // 如果缓存存在则直接返回
}
/** 首页数据*/
IndexAdminVo indexAdminVo = createIndexAdminVo();
@ -982,6 +1013,9 @@ public class EtOrderServiceImpl implements IEtOrderService
indexAdminVo.setOperationVo(operationVo);
log.info("【首页统计-总管理】indexAdminVo==={}",JSON.toJSON(indexAdminVo));
// 将生成的对象保存到 Redis
redisCache.setCacheObject(cacheKey, indexAdminVo, 30, TimeUnit.MINUTES);
return indexAdminVo;
}
@ -1090,11 +1124,11 @@ public class EtOrderServiceImpl implements IEtOrderService
indexAdminVo.setReturnOrderCount(etOrderMapper.getAuditOrderNum(null,null,null));//还车待审核订单
indexAdminVo.setReturnOrderDeductFee(etOrderMapper.getReturnOrderDeductFee(null,null,null));// 待审核还车押金扣款
indexAdminVo.setTodayHandlingFee(etCapitalFlowMapper.getHandlingFee(startDateStr, endDateStr, null,null));// 今日支付手续费
indexAdminVo.setTotalHandlingFee(etCapitalFlowMapper.getHandlingFee(null, null, null,null));// 总手续费
indexAdminVo.setTodayHandlingFee(etCapitalFlowMapper.getHandlingFee(startDateStr, endDateStr, null,null,null));// 今日支付手续费
indexAdminVo.setTotalHandlingFee(etCapitalFlowMapper.getHandlingFee(null, null, null,null,null));// 总手续费
indexAdminVo.setTodayServiceFee(etCapitalFlowMapper.getServiceFee(startDateStr, endDateStr, null,null));//今日服务费
indexAdminVo.setTotalServiceFee(etCapitalFlowMapper.getServiceFee(null, null, null,null));// 总服务费
indexAdminVo.setTodayServiceFee(etCapitalFlowMapper.getServiceFee(startDateStr, endDateStr, null,null,null));//今日服务费
indexAdminVo.setTotalServiceFee(etCapitalFlowMapper.getServiceFee(null, null, null,null,null));// 总服务费
return indexAdminVo;
}
@ -1359,8 +1393,8 @@ public class EtOrderServiceImpl implements IEtOrderService
String totalRefund = etOrderMapper.getTotalRefund(timeStart, timeEnd, areaId);//已退款
income.setTotalPaid(totalPaid);//已支付
//handlingFee 手续费 = 0.0054 * 已支付金额
BigDecimal handlingFee = etCapitalFlowMapper.getHandlingFee(timeStart, timeEnd, null, Long.parseLong(areaId));//手续费,扣除掉退款部分的
BigDecimal platformServiceFee = etCapitalFlowMapper.getServiceFee(timeStart, timeEnd, null,Long.parseLong(areaId));//平台服务费 ,扣除掉退款部分的
BigDecimal handlingFee = etCapitalFlowMapper.getHandlingFee(timeStart, timeEnd, null, Long.parseLong(areaId),null);//手续费,扣除掉退款部分的
BigDecimal platformServiceFee = etCapitalFlowMapper.getServiceFee(timeStart, timeEnd, null,Long.parseLong(areaId),null);//平台服务费 ,扣除掉退款部分的
income.setHandlingFee(handlingFee.add(platformServiceFee).toString());
// 总营收 = 已支付 - 已退款 - 手续费
@ -1433,8 +1467,8 @@ public class EtOrderServiceImpl implements IEtOrderService
/** 总支出*/
BigDecimal refundFee = defaultIfNull(etOrderMapper.getRefundFee(timeStart, timeEnd, null, aLong), BigDecimal.ZERO);//订单退款
BigDecimal depositRefundFee = defaultIfNull(etOrderMapper.getDepositRefundFee(timeStart, timeEnd, null, aLong,null), BigDecimal.ZERO);//押金退款 24795
BigDecimal serviceFee = defaultIfNull(etCapitalFlowMapper.getHandlingFee(timeStart, timeEnd, null, aLong),BigDecimal.ZERO);//手续费,扣除掉退款部分的
BigDecimal platformServiceFee = defaultIfNull(etCapitalFlowMapper.getServiceFee(timeStart, timeEnd, null,aLong),BigDecimal.ZERO);//平台服务费 ,扣除掉退款部分的
BigDecimal serviceFee = defaultIfNull(etCapitalFlowMapper.getHandlingFee(timeStart, timeEnd, null, aLong,null),BigDecimal.ZERO);//手续费,扣除掉退款部分的
BigDecimal platformServiceFee = defaultIfNull(etCapitalFlowMapper.getServiceFee(timeStart, timeEnd, null,aLong,null),BigDecimal.ZERO);//平台服务费 ,扣除掉退款部分的
BigDecimal totalExpenditure = defaultIfNull(refundFee.add(depositRefundFee).add(serviceFee).add(platformServiceFee), BigDecimal.ZERO);
income.setOrderRefund(refundFee);
@ -1733,8 +1767,8 @@ public class EtOrderServiceImpl implements IEtOrderService
reconciliation.setDay(formattedDate);
BigDecimal payFee = defaultIfNull(etOrderMapper.getPayFee(startDateStr, endDateStr, null, areaId), BigDecimal.ZERO);//新增
BigDecimal refundFee = defaultIfNull(etOrderMapper.getRefundFee(startDateStr, endDateStr, null, areaId), BigDecimal.ZERO);//退款
BigDecimal serviceFee = etCapitalFlowMapper.getHandlingFee(startDateStr, endDateStr, null, areaId);//手续费,扣除掉退款部分的
BigDecimal platformServiceFee = etCapitalFlowMapper.getServiceFee(startDateStr, endDateStr, null,areaId);//平台服务费 ,扣除掉退款部分的
BigDecimal serviceFee = etCapitalFlowMapper.getHandlingFee(startDateStr, endDateStr, null, areaId,null);//手续费,扣除掉退款部分的
BigDecimal platformServiceFee = etCapitalFlowMapper.getServiceFee(startDateStr, endDateStr, null,areaId,null);//平台服务费 ,扣除掉退款部分的
BigDecimal incomeFee = defaultIfNull(payFee.subtract(serviceFee).subtract(refundFee).subtract(platformServiceFee), BigDecimal.ZERO);//营收 = 新增 - 手续费 - 退款 - 平台服务费
reconciliation.setPayFee(payFee);
@ -1768,8 +1802,8 @@ public class EtOrderServiceImpl implements IEtOrderService
reconciliation.setPayFee(payFee);
BigDecimal refundFee = etOrderMapper.getRefundFee(timeStart, timeEnd, sn, null);
reconciliation.setRefundFee(refundFee);
BigDecimal serviceFee = etCapitalFlowMapper.getHandlingFee(timeStart, timeEnd, sn, areaId);//手续费
BigDecimal platformServiceFee = etCapitalFlowMapper.getServiceFee(timeStart, timeEnd, sn, areaId);//平台服务费
BigDecimal serviceFee = etCapitalFlowMapper.getHandlingFee(timeStart, timeEnd, sn, areaId,null);//手续费
BigDecimal platformServiceFee = etCapitalFlowMapper.getServiceFee(timeStart, timeEnd, sn, areaId,null);//平台服务费
reconciliation.setIncome(payFee.subtract(refundFee).subtract(serviceFee).subtract(platformServiceFee));
reconciliation.setServiceFee(serviceFee);
reconciliation.setPlatformServiceFee(platformServiceFee);

View File

@ -31,6 +31,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionTemplate;
import javax.annotation.Resource;
import java.math.BigDecimal;
@ -89,6 +90,15 @@ public class SysDeptServiceImpl implements ISysDeptService
@Autowired
private ScheduledExecutorService scheduledExecutorService;
@Autowired
private IEtModelService etModelService;
@Autowired
private IEtFeeRuleService etFeeRuleService;
@Autowired
private TransactionTemplate transactionTemplate;
@Value("${aliyun.accessKeyId}")
private String accessKeyId;
@ -342,15 +352,6 @@ public class SysDeptServiceImpl implements ISysDeptService
dept.setAppName(platform.getAppName());
dept.setDomain(platform.getDomain());
}
// if (dept.getSeparateAccount().equals("N")) {
// SysDept platform = deptMapper.selectDeptById(100L);
// dept.setMerchantId(platform.getMerchantId());
// dept.setApiV3Key(platform.getApiV3Key());
// dept.setNotifyUrl(platform.getNotifyUrl());
// dept.setPrivateKeyPath(platform.getPrivateKeyPath());
// dept.setMerchantSerialNumber(platform.getMerchantSerialNumber());
// dept.setRefundNotifyUrl(platform.getRefundNotifyUrl());
// }
int i = deptMapper.insertDept(dept);
Long[] areaIds = dept.getAreaIds();
if (StringUtils.isNotNull(areaIds)){
@ -368,6 +369,131 @@ public class SysDeptServiceImpl implements ISysDeptService
return i;
}
@Override
public int fastInsertDept(SysDept dept) {
SysDept info = deptMapper.selectDeptById(dept.getParentId());
// 如果父节点不为正常状态,则不允许新增子节点
if (!UserConstants.DEPT_NORMAL.equals(info.getStatus()))
{
throw new ServiceException("部门停用,不允许新增");
}
dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
if (StrUtil.isNotBlank(dept.getIsUsePlatformApp()) && dept.getIsUsePlatformApp().equals("true")) {
SysDept platform = deptMapper.selectDeptById(100L);
dept.setAppid(platform.getAppid());
dept.setAppSecret(platform.getAppSecret());
dept.setAppName(platform.getAppName());
dept.setDomain(platform.getDomain());
}
Boolean execute = transactionTemplate.execute(e -> {
log.info("=================【快速生成】==================");
int i = deptMapper.insertDept(dept);
Long[] areaIds = dept.getAreaIds();
if (StringUtils.isNotNull(areaIds)){
for (Long areaId:areaIds){
etAreaDeptMapper.insert(EtAreaDept.builder().areaId(areaId).deptId(dept.getDeptId()).build());
}
}
// 添加运营商账号并添加运营商角色
createOperator(dept);
/** 新建运营区,绑定运营商*/
EtOperatingArea etOperatingArea = new EtOperatingArea();
saveOperator(dept,etOperatingArea);
/** 新建收费方式,绑定车型*/
EtFeeRule etFeeRule = createFeeRule(dept);
/** 新建车型*/
Long[] rules = {etFeeRule.getRuleId()};
EtModel etModel = createModel(dept,etOperatingArea,rules);
return Boolean.TRUE;
});
if(!execute)throw new ServiceException("快速生成失败");
return 1;
}
private EtFeeRule createFeeRule(SysDept dept) {
EtFeeRule etFeeRule = new EtFeeRule();
etFeeRule.setName(dept.getDeptName());
etFeeRule.setInstructions("按小时计费");
etFeeRule.setDeptId(dept.getDeptId());
etFeeRule.setAutoRefundDeposit(0);
etFeeRule.setOrderExceedMinutes(0);
etFeeRule.setOrderExceedWarn(0);
etFeeRule.setFreeRideTime(0);
etFeeRule.setRentalUnit("minutes");
etFeeRule.setRidingRule("1");
etFeeRule.setChargingCycle("1");
etFeeRule.setChargingCycleValue("24");
etFeeRule.setCappedAmount(new BigDecimal(200));
etFeeRule.setOrderNum(1);
etFeeRule.setRidingRuleJson("{\"timeoutTime\":\"10\",\"startingPrice\":\"1\",\"startingTime\":\"10\",\"timeoutPrice\":\"1\"}");
int i1 = etFeeRuleService.insertEtFeeRule(etFeeRule);
if(i1 == 0){
throw new ServiceException("新增收费方式失败");
}
return etFeeRule;
}
private EtModel createModel(SysDept dept,EtOperatingArea etOperatingArea,Long[] rules) {
EtModel etModel = new EtModel();
etModel.setModel(dept.getDeptName());
etModel.setOperator(dept.getDeptId());
etModel.setFullVoltage(new Double(53));
etModel.setLowVoltage(new Double(48));
etModel.setFullEndurance(50);
etModel.setAreaId(etOperatingArea.getAreaId());
etModel.setRuleIds(rules);
etModel.setLowBatteryReminderSwitch(Boolean.FALSE);
int i2 = etModelService.insertEtModel(etModel);
if(i2 == 0){
throw new ServiceException("新增车型失败");
}
return etModel;
}
private void saveOperator(SysDept dept,EtOperatingArea etOperatingArea) {
etOperatingArea.setProvince(dept.getProvince());
etOperatingArea.setCity(dept.getCity());
etOperatingArea.setAreaName(dept.getAreaName());
etOperatingArea.setCounty(dept.getCounty());
etOperatingArea.setAreaTime("1");
String agreement = "<p><strong style=\"color: rgb(68, 68, 68);\">亲爱的用户,为了确保您的骑行安全,</strong></p><p><strong style=\"color: rgb(68, 68, 68);\">请务必遵守以下骑行提示: </strong></p><p><span style=\"color: rgb(136, 136, 136);\">仅限16岁及以上用户使用。</span></p><p><span style=\"color: rgb(136, 136, 136);\">为确保安全,后座不允许载人。</span></p><p><span style=\"color: rgb(136, 136, 136);\">请务必佩戴安全头盔,保护自身安全。 </span></p><p><span style=\"color: rgb(136, 136, 136);\">注意道路状况,避开坑洼,小心骑行。</span></p><p><span style=\"color: rgb(136, 136, 136);\">\uFEFF请在规定的地点还车避免随意停放。</span></p><p><span style=\"color: rgb(136, 136, 136);\">不逆行、不闯红灯,遵守所有交通法规。</span></p><p><span style=\"color: rgb(136, 136, 136);\">骑行时不要使用手机,保持注意力集中。</span></p><p><span style=\"color: rgb(136, 136, 136);\">避免急刹车和急转弯,保持适当的车速。</span></p><p><span style=\"color: rgb(136, 136, 136);\">夜间骑行时,确保车灯和反光标识正常。</span></p><p><br></p><p><strong style=\"color: rgb(68, 68, 68);\">紧急情况处理:</strong></p><p><span style=\"color: rgb(136, 136, 136);\">如有紧急情况,请及时拨打客服电话。</span></p><p><span style=\"color: rgb(136, 136, 136);\">感谢您的理解与配合,祝您骑行愉快。</span></p>";
etOperatingArea.setAgreement(agreement);
etOperatingArea.setStatus("0");
etOperatingArea.setDeptId(dept.getDeptId());
etOperatingArea.setAutoReplacementOrder(10);
etOperatingArea.setAreaOutOutage("1");
etOperatingArea.setParkingOutDispatch("1");
etOperatingArea.setAreaOutDispatch("1");
etOperatingArea.setNoRidingOutage("1");
etOperatingArea.setAuthentication("0");
etOperatingArea.setMsgSwitch("0");
etOperatingArea.setParkingReturn("1");
etOperatingArea.setAreaOutReturn("1");
etOperatingArea.setIsDepositDeduction("0");
etOperatingArea.setReturnVerify("0");
etOperatingArea.setDeposit("10");
etOperatingArea.setCustomService("1");
etOperatingArea.setUndercharge("10");
etOperatingArea.setDispatchFee(new BigDecimal(10));
etOperatingArea.setVehicleManagementFee(new BigDecimal(10));
etOperatingArea.setError(5);
etOperatingArea.setTimeoutMinutes(30);
etOperatingArea.setAppointmentServiceFee(new BigDecimal(2));
etOperatingArea.setServiceName1("客服");
etOperatingArea.setServicePhone1(dept.getPhone());
etOperatingArea.setCreateTime(DateUtils.getNowDate());
int i1 = etOperatingAreaService.insertEtOperatingArea(etOperatingArea);
if(i1 == 0){
throw new ServiceException("新增运营区失败");
}
}
/**
* 修改保存部门信息
*

View File

@ -671,7 +671,7 @@ public class EtTask {
if(BigDecimal.ZERO.compareTo(lon) != 0 && BigDecimal.ZERO.compareTo(lat) != 0){
device.setLatitude(lat.toString());
device.setLongitude(lon.toString());
device.setLastLocationTime(DateUtils.getNowDate());
device.setLastLocationTime(new Date(logEntry.getAt()));
device.setGps("1");
// 信号强度
device.setSatellites(value.getS());

View File

@ -129,12 +129,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where f.bus_type != '5' and f.bus_type != '6'
<if test="sn != null and sn != ''"> and o.sn = #{sn}</if>
<if test="timeStart != null and timeStart != ''">
AND date_format(f.create_time,'%y%m%d') &gt;= date_format(#{timeStart},'%y%m%d')
AND DATE(f.create_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND date_format(f.create_time,'%y%m%d') &lt;= date_format(#{timeEnd},'%y%m%d')
AND DATE(f.create_time) &lt;= #{timeEnd}
</if>
<if test="areaId != null and areaId != 0"> and f.area_id = #{areaId}</if>
<if test="ownerId != null and ownerId != 0"> and f.owner_id = #{ownerId}</if>
</select>
<select id="getHandlingFee2" resultType="java.math.BigDecimal">
@ -149,10 +150,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where f.bus_type != '5' and f.bus_type != '6'
<if test="sn != null and sn != ''"> and o.sn = #{sn}</if>
<if test="timeStart != null and timeStart != ''">
AND date_format(f.create_time,'%y%m%d') &gt;= date_format(#{timeStart},'%y%m%d')
AND DATE(f.create_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND date_format(f.create_time,'%y%m%d') &lt;= date_format(#{timeEnd},'%y%m%d')
AND DATE(f.create_time) &lt;= #{timeEnd}
</if>
<if test="areaId != null and areaId != 0"> and f.area_id = #{areaId}</if>
<if test="channelId != null ">and o.pay_channel = #{channelId}</if>
@ -167,12 +168,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where f.area_id != 14
<if test="sn != null and sn != ''"> and o.sn = #{sn}</if>
<if test="timeStart != null and timeStart != ''">
AND date_format(f.create_time,'%y%m%d') &gt;= date_format(#{timeStart},'%y%m%d')
AND DATE(f.create_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND date_format(f.create_time,'%y%m%d') &lt;= date_format(#{timeEnd},'%y%m%d')
AND DATE(f.create_time) &lt;= #{timeEnd}
</if>
<if test="areaId != null and areaId != 0"> and f.area_id = #{areaId}</if>
<if test="ownerId != null and ownerId != 0"> and f.owner_id = #{ownerId}</if>
</select>
<select id="getServiceFee2" resultType="java.math.BigDecimal">
@ -184,10 +186,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where f.area_id != 14
<if test="sn != null and sn != ''"> and o.sn = #{sn}</if>
<if test="timeStart != null and timeStart != ''">
AND date_format(f.create_time,'%y%m%d') &gt;= date_format(#{timeStart},'%y%m%d')
AND DATE(f.create_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND date_format(f.create_time,'%y%m%d') &lt;= date_format(#{timeEnd},'%y%m%d')
AND DATE(f.create_time) &lt;= #{timeEnd}
</if>
<if test="areaId != null and areaId != 0"> and f.area_id = #{areaId}</if>
<if test="channelId != null ">and o.pay_channel = #{channelId}</if>
@ -196,21 +198,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getTotalAmount" resultType="java.math.BigDecimal">
select sum(amount) from et_capital_flow f where type = 1 and bus_type = 1 and pay_type != 'yj'
<if test="timeStart != null and timeStart != ''">
AND date_format(f.create_time,'%y%m%d') &gt;= date_format(#{timeStart},'%y%m%d')
AND DATE(f.create_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND date_format(f.create_time,'%y%m%d') &lt;= date_format(#{timeEnd},'%y%m%d')
AND DATE(f.create_time) &lt;= #{timeEnd}
</if>
<if test="areaId != null and areaId != 0"> and f.area_id = #{areaId}</if>
</select>
<select id="getTotalAmountByUserId" resultType="java.math.BigDecimal">
select sum(amount) from et_capital_flow f where type = 1 and bus_type = 1 and pay_type != 'yj'
<if test="timeStart != null and timeStart != ''">
AND DATE(f.create_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND DATE(f.create_time) &lt;= #{timeEnd}
</if>
<if test="ownerId != null and ownerId != 0"> and f.owner_id = #{ownerId}</if>
</select>
<select id="getDeductionAmount" resultType="java.math.BigDecimal">
select COALESCE(SUM(amount), 0) from et_capital_flow f where type = 1 and bus_type = 1 and pay_type = 'yj'
<if test="timeStart != null and timeStart != ''">
AND date_format(f.create_time,'%y%m%d') &gt;= date_format(#{timeStart},'%y%m%d')
AND DATE(f.create_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND date_format(f.create_time,'%y%m%d') &lt;= date_format(#{timeEnd},'%y%m%d')
AND DATE(f.create_time) &lt;= #{timeEnd}
</if>
<if test="areaId != null and areaId != 0"> and f.area_id = #{areaId}</if>
</select>
@ -225,10 +238,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="areaId != null and areaId != 0"> and area_id = #{areaId}</if>
<if test="channelId != null ">AND pay_channel = #{channelId}</if>
<if test="timeStart != null and timeStart != ''">
AND date_format(pay_time,'%y%m%d') &gt;= date_format(#{timeStart},'%y%m%d')
AND DATE(pay_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND date_format(pay_time,'%y%m%d') &lt;= date_format(#{timeEnd},'%y%m%d')
AND DATE(pay_time) &lt;= #{timeEnd}
</if>
AND STATUS = 4
AND type = 1
@ -249,12 +262,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="areaId != null and areaId != 0"> and f.area_id = #{areaId}</if>
<if test="channelId != null ">and o.pay_channel = #{channelId}</if>
<if test="timeStart != null and timeStart != ''">
AND date_format(o.pay_time,'%y%m%d') &gt;= date_format(#{timeStart},'%y%m%d')
AND DATE(o.pay_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND date_format(o.pay_time,'%y%m%d') &lt;= date_format(#{timeEnd},'%y%m%d')
AND DATE(o.pay_time) &lt;= #{timeEnd}
</if>
</select>
<select id="getPartnerRefundFee" resultType="java.math.BigDecimal">
SELECT
COALESCE(SUM(amount), 0)
FROM
et_capital_flow f
where
f.bus_type = 4 and f.type = 2 and owner_type = 2
<if test="owner_id != null and ownerId != 0"> and f.owner_id = #{ownerId}</if>
<if test="timeStart != null and timeStart != ''">
AND DATE(f.create_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND DATE(f.create_time) &lt;= #{timeEnd}
</if>
</select>
<insert id="insertEtCapitalFlow" parameterType="EtCapitalFlow">

View File

@ -168,16 +168,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="paid != null and paid != ''"> and o.paid = #{paid}</if>
<if test="payType != null and payType != ''"> and o.pay_type = #{payType}</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(o.create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
AND DATE(o.create_time) &gt;= #{params.beginTime}
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(o.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
AND DATE(o.create_time) &lt;= #{params.endTime}
</if>
<if test="startTime != null and startTime != ''"><!-- 开始时间检索 -->
AND date_format(o.create_time,'%y%m%d') &gt;= date_format(#{startTime},'%y%m%d')
AND DATE(o.create_time) &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
AND date_format(o.create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
AND DATE(o.create_time) &lt;= #{endTime}
</if>
<if test="statusList != null">
AND o.status IN
@ -268,16 +268,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="paid != null and paid != ''"> and o.paid = #{paid}</if>
<if test="payType != null and payType != ''"> and o.pay_type = #{payType}</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(o.create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
AND DATE(o.create_time) &gt;= #{params.beginTime}
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(o.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
AND DATE(o.create_time) &lt;= #{params.endTime}
</if>
<if test="startTime != null and startTime != ''"><!-- 开始时间检索 -->
AND date_format(o.create_time,'%y%m%d') &gt;= date_format(#{startTime},'%y%m%d')
AND DATE(o.create_time) &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
AND date_format(o.create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
AND DATE(o.create_time) &lt;= #{endTime}
</if>
<if test="statusList != null">
AND o.status IN
@ -345,12 +345,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
o.cost
FROM
et_order o
LEFT JOIN
et_operating_area oa ON o.area_id = oa.area_id
LEFT JOIN
et_device de ON de.sn = o.sn
LEFT JOIN
et_user u ON u.user_id = o.user_id
LEFT JOIN et_operating_area oa ON o.area_id = oa.area_id
LEFT JOIN et_device de ON de.sn = o.sn
LEFT JOIN et_user u ON u.user_id = o.user_id
LEFT join et_area_dept ad on ad.area_id = oa.area_id
LEFT join sys_dept d on d.dept_id = ad.dept_id
where 1 = 1
@ -358,6 +355,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="type != null and type != ''"> and o.type = #{type}</if>
<if test="status != null and status != ''"> and o.status = #{status}</if>
<if test="paid != null and paid != ''"> and o.paid = #{paid}</if>
<if test="deptId != null and deptId != ''"> and d.dept_id = #{deptId}</if>
<!-- 数据范围过滤 -->
${params.dataScope}
order by o.create_time desc
@ -459,10 +457,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getTotalIncome" resultType="java.lang.String">
select COALESCE(SUM(total_fee), 0) from et_order where status = 4 and type = 1
<if test="timeStart != null and timeStart != ''">
AND date_format(create_time,'%y%m%d') &gt;= date_format(#{timeStart},'%y%m%d')
AND DATE(create_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND date_format(create_time,'%y%m%d') &lt;= date_format(#{timeEnd},'%y%m%d')
AND DATE(create_time) &lt;= #{timeEnd}
</if>
<if test="areaId != null and areaId != ''"> and area_id = #{areaId}</if>
</select>
@ -470,10 +468,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getTotalUnpaid" resultType="java.lang.String" parameterType="String">
select COALESCE(SUM(total_fee), 0) from et_order where status = 3 and type = 1 and paid = 0
<if test="timeStart != null and timeStart != ''">
AND date_format(create_time,'%y%m%d') &gt;= date_format(#{timeStart},'%y%m%d')
AND DATE(create_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND date_format(create_time,'%y%m%d') &lt;= date_format(#{timeEnd},'%y%m%d')
AND DATE(create_time) &lt;= #{timeEnd}
</if>
<if test="areaId != null and areaId != ''"> and area_id = #{areaId}</if>
</select>
@ -481,10 +479,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getTotalPaid" resultType="java.lang.String">
select COALESCE(SUM(total_fee), 0) from et_order where status = 4 and type = 1 and paid = 1
<if test="timeStart != null and timeStart != ''">
AND date_format(pay_time,'%y%m%d') &gt;= date_format(#{timeStart},'%y%m%d')
and DATE(pay_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND date_format(pay_time,'%y%m%d') &lt;= date_format(#{timeEnd},'%y%m%d')
and DATE(pay_time) &lt;= #{timeEnd}
</if>
<if test="areaId != null and areaId != ''"> and area_id = #{areaId}</if>
</select>
@ -492,10 +490,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getTotalRefund" resultType="java.lang.String">
select COALESCE(SUM(r.amount), 0) from et_refund r left join et_order o on o.order_no = r.order_no where r.type = 1 AND refund_result = 'SUCCESS'
<if test="timeStart != null and timeStart != ''">
AND date_format(r.create_time,'%y%m%d') &gt;= date_format(#{timeStart},'%y%m%d')
and DATE(r.create_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND date_format(r.create_time,'%y%m%d') &lt;= date_format(#{timeEnd},'%y%m%d')
and DATE(r.create_time) &lt;= #{timeEnd}
</if>
<if test="areaId != null and areaId != ''"> and o.area_id = #{areaId}</if>
</select>
@ -503,10 +501,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getTotalRidingFee" resultType="java.lang.String">
select COALESCE(SUM(riding_fee), 0) from et_order where status = 4 and type = 1 and paid = 1
<if test="timeStart != null and timeStart != ''">
AND date_format(create_time,'%y%m%d') &gt;= date_format(#{timeStart},'%y%m%d')
AND DATE(create_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND date_format(create_time,'%y%m%d') &lt;= date_format(#{timeEnd},'%y%m%d')
AND DATE(create_time) &lt;= #{timeEnd}
</if>
<if test="areaId != null and areaId != ''"> and area_id = #{areaId}</if>
</select>
@ -514,10 +512,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getTotalRidingRefund" resultType="java.lang.String">
select COALESCE(SUM(r.riding_fee), 0) from et_refund r left join et_order o on o.order_no = r.order_no where r.type = 1 AND refund_result = 'SUCCESS'
<if test="timeStart != null and timeStart != ''">
AND date_format(r.create_time,'%y%m%d') &gt;= date_format(#{timeStart},'%y%m%d')
and DATE(r.create_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND date_format(r.create_time,'%y%m%d') &lt;= date_format(#{timeEnd},'%y%m%d')
and DATE(r.create_time) &lt;= #{timeEnd}
</if>
<if test="areaId != null and areaId != ''"> and o.area_id = #{areaId}</if>
</select>
@ -525,10 +523,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getTotalDispatchFee" resultType="java.lang.String">
select COALESCE(SUM(dispatch_fee), 0) from et_order where status = 4 and type = 1 and paid = 1
<if test="timeStart != null and timeStart != ''">
AND date_format(create_time,'%y%m%d') &gt;= date_format(#{timeStart},'%y%m%d')
AND DATE(create_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND date_format(create_time,'%y%m%d') &lt;= date_format(#{timeEnd},'%y%m%d')
AND DATE(create_time) &lt;= #{timeEnd}
</if>
<if test="areaId != null and areaId != ''"> and area_id = #{areaId}</if>
</select>
@ -536,10 +534,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getTotalDispatchRefund" resultType="java.lang.String">
select COALESCE(SUM(r.dispatch_fee), 0) from et_refund r left join et_order o on o.order_no = r.order_no where r.type = 1 AND refund_result = 'SUCCESS'
<if test="timeStart != null and timeStart != ''">
AND date_format(r.create_time,'%y%m%d') &gt;= date_format(#{timeStart},'%y%m%d')
and DATE(r.create_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND date_format(r.create_time,'%y%m%d') &lt;= date_format(#{timeEnd},'%y%m%d')
and DATE(r.create_time) &lt;= #{timeEnd}
</if>
<if test="areaId != null and areaId != ''"> and o.area_id = #{areaId}</if>
</select>
@ -547,10 +545,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getTotalAppointmentFee" resultType="java.lang.String">
select COALESCE(SUM(appointment_fee), 0) from et_order where status = 4 and type = 1 and paid = 1
<if test="timeStart != null and timeStart != ''">
AND date_format(create_time,'%y%m%d') &gt;= date_format(#{timeStart},'%y%m%d')
AND DATE(create_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND date_format(create_time,'%y%m%d') &lt;= date_format(#{timeEnd},'%y%m%d')
AND DATE(create_time) &lt;= #{timeEnd}
</if>
<if test="areaId != null and areaId != ''"> and area_id = #{areaId}</if>
</select>
@ -558,10 +556,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getTotalAppointmentRefund" resultType="java.lang.String">
select COALESCE(SUM(r.appointment_fee), 0) from et_refund r left join et_order o on o.order_no = r.order_no where r.type = 1 AND refund_result = 'SUCCESS'
<if test="timeStart != null and timeStart != ''">
AND date_format(r.create_time,'%y%m%d') &gt;= date_format(#{timeStart},'%y%m%d')
and DATE(r.create_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND date_format(r.create_time,'%y%m%d') &lt;= date_format(#{timeEnd},'%y%m%d')
and DATE(r.create_time) &lt;= #{timeEnd}
</if>
<if test="areaId != null and areaId != ''"> and o.area_id = #{areaId}</if>
</select>
@ -569,10 +567,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getTotalManageFee" resultType="java.lang.String">
select COALESCE(SUM(manage_fee), 0) from et_order where status = 4 and type = 1 and paid = 1
<if test="timeStart != null and timeStart != ''">
AND date_format(create_time,'%y%m%d') &gt;= date_format(#{timeStart},'%y%m%d')
AND DATE(create_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND date_format(create_time,'%y%m%d') &lt;= date_format(#{timeEnd},'%y%m%d')
AND DATE(create_time) &lt;= #{timeEnd}
</if>
<if test="areaId != null and areaId != ''"> and area_id = #{areaId}</if>
</select>
@ -580,30 +578,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getTotalManageRefund" resultType="java.lang.String">
select COALESCE(SUM(r.manage_fee), 0) from et_refund r left join et_order o on o.order_no = r.order_no where r.type = 1 AND refund_result = 'SUCCESS'
<if test="timeStart != null and timeStart != ''">
AND date_format(r.create_time,'%y%m%d') &gt;= date_format(#{timeStart},'%y%m%d')
and DATE(r.create_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND date_format(r.create_time,'%y%m%d') &lt;= date_format(#{timeEnd},'%y%m%d')
and DATE(r.create_time) &lt;= #{timeEnd}
</if>
<if test="areaId != null and areaId != ''"> and o.area_id = #{areaId}</if>
</select>
<select id="getPaidOrder" resultType="java.lang.String">
select COALESCE(count(1), 0) from et_order where status = 4 and type = 1 and paid = 1
<if test="timeStart != null and timeStart != ''">
AND date_format(create_time,'%y%m%d') &gt;= date_format(#{timeStart},'%y%m%d')
AND DATE(create_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND date_format(create_time,'%y%m%d') &lt;= date_format(#{timeEnd},'%y%m%d')
AND DATE(create_time) &lt;= #{timeEnd}
</if>
<if test="areaId != null and areaId != ''"> and area_id = #{areaId}</if>
</select>
<select id="getRidingOrder" resultType="java.lang.String">
select COALESCE(count(1), 0) from et_order where status = 2 and type = 1
<if test="timeStart != null and timeStart != ''">
AND date_format(create_time,'%y%m%d') &gt;= date_format(#{timeStart},'%y%m%d')
AND DATE(create_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND date_format(create_time,'%y%m%d') &lt;= date_format(#{timeEnd},'%y%m%d')
AND DATE(create_time) &lt;= #{timeEnd}
</if>
<if test="areaId != null and areaId != ''"> and area_id = #{areaId}</if>
</select>
@ -611,10 +609,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getRefundOrder" resultType="java.lang.String">
select COALESCE(count(1), 0) from et_refund r left join et_order o on o.order_no = r.order_no where r.type = 1 AND refund_result = 'SUCCESS'
<if test="timeStart != null and timeStart != ''">
AND date_format(r.create_time,'%y%m%d') &gt;= date_format(#{timeStart},'%y%m%d')
and DATE(r.create_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND date_format(r.create_time,'%y%m%d') &lt;= date_format(#{timeEnd},'%y%m%d')
and DATE(r.create_time) &lt;= #{timeEnd}
</if>
<if test="areaId != null and areaId != ''"> and o.area_id = #{areaId}</if>
</select>
@ -622,10 +620,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getUnpaidOrder" resultType="java.lang.String">
select COALESCE(count(1), 0) from et_order where status = 3 and type = 1 and paid = 0
<if test="timeStart != null and timeStart != ''">
AND date_format(create_time,'%y%m%d') &gt;= date_format(#{timeStart},'%y%m%d')
AND DATE(create_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND date_format(create_time,'%y%m%d') &lt;= date_format(#{timeEnd},'%y%m%d')
AND DATE(create_time) &lt;= #{timeEnd}
</if>
<if test="areaId != null and areaId != ''"> and area_id = #{areaId}</if>
</select>
@ -634,10 +632,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getAuditOrderNum" resultType="java.lang.Integer">
select COALESCE(count(1), 0) from et_order where status = 5 and type = 1
<if test="timeStart != null and timeStart != ''">
AND date_format(create_time,'%y%m%d') &gt;= date_format(#{timeStart},'%y%m%d')
AND DATE(create_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND date_format(create_time,'%y%m%d') &lt;= date_format(#{timeEnd},'%y%m%d')
AND DATE(create_time) &lt;= #{timeEnd}
</if>
<if test="areaId != null and areaId != ''"> and area_id = #{areaId}</if>
</select>
@ -646,10 +644,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getReturnOrderDeductFee" resultType="java.math.BigDecimal">
select COALESCE(SUM(total_fee), 0) from et_order where status > 5 and type = 1
<if test="timeStart != null and timeStart != ''">
AND date_format(create_time,'%y%m%d') &gt;= date_format(#{timeStart},'%y%m%d')
AND DATE(create_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND date_format(create_time,'%y%m%d') &lt;= date_format(#{timeEnd},'%y%m%d')
AND DATE(create_time) &lt;= #{timeEnd}
</if>
<if test="areaId != null and areaId != ''"> and area_id = #{areaId}</if>
</select>
@ -657,10 +655,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getOrderNum" resultType="java.lang.Integer">
select COALESCE(count(1), 0) from et_order where type = 1
<if test="timeStart != null and timeStart != ''">
AND date_format(create_time,'%y%m%d') &gt;= date_format(#{timeStart},'%y%m%d')
AND DATE(create_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND date_format(create_time,'%y%m%d') &lt;= date_format(#{timeEnd},'%y%m%d')
AND DATE(create_time) &lt;= #{timeEnd}
</if>
<if test="areaId != null and areaId != ''"> and area_id = #{areaId}</if>
</select>
@ -668,10 +666,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getServiceFee" resultType="java.math.BigDecimal">
select COALESCE(SUM(total_fee), 0) from et_order where status = 4 and type = 1 and paid = 1
<if test="timeStart != null and timeStart != ''">
AND date_format(create_time,'%y%m%d') &gt;= date_format(#{timeStart},'%y%m%d')
AND DATE(create_time) &gt;= #{timeStart}
</if>
<if test="timeEnd != null and timeEnd != ''">
AND date_format(create_time,'%y%m%d') &lt;= date_format(#{timeEnd},'%y%m%d')
AND DATE(create_time) &gt;= #{timeEnd}
</if>
<if test="areaId != null and areaId != ''"> and area_id = #{areaId}</if>
</select>
@ -682,10 +680,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="sn != null and sn != ''"> and sn = #{sn}</if>
<if test="areaId != null"> and area_id = #{areaId}</if>
<if test="startDateStr != null and startDateStr != ''">
AND date_format(pay_time,'%y%m%d') &gt;= date_format(#{startDateStr},'%y%m%d')
and DATE(pay_time) &gt;= #{startDateStr}
</if>
<if test="endDateStr != null and endDateStr != ''">
AND date_format(pay_time,'%y%m%d') &lt;= date_format(#{endDateStr},'%y%m%d')
and DATE(pay_time) &lt;= #{endDateStr}
</if>
AND status = 4 and type = 1 and paid = 1
</where>
@ -696,10 +694,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="areaId != null"> and area_id = #{areaId}</if>
<if test="startDateStr != null and startDateStr != ''">
AND date_format(pay_time,'%y%m%d') &gt;= date_format(#{startDateStr},'%y%m%d')
and DATE(pay_time) &gt;= #{startDateStr}
</if>
<if test="endDateStr != null and endDateStr != ''">
AND date_format(pay_time,'%y%m%d') &lt;= date_format(#{endDateStr},'%y%m%d')
and DATE(pay_time) &lt;= #{endDateStr}
</if>
AND status = 4 and type = 1
</where>
@ -714,10 +712,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="areaId != null"> and o.area_id = #{areaId}</if>
<if test="startDateStr != null and startDateStr != ''">
AND date_format(o.create_time,'%y%m%d') &gt;= date_format(#{startDateStr},'%y%m%d')
AND DATE(o.create_time) &gt;= #{startDateStr}
</if>
<if test="endDateStr != null and endDateStr != ''">
AND date_format(o.create_time,'%y%m%d') &lt;= date_format(#{endDateStr},'%y%m%d')
AND DATE(o.create_time) &lt;= #{endDateStr}
</if>
AND o.status = 4 and o.type = 1 and o.paid = 1 and dd.partner_id is not null
</where>
@ -729,10 +727,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="areaId != null and areaId != 0"> and o.area_id = #{areaId}</if>
<if test="channelId != null ">AND o.pay_channel = #{channelId}</if>
<if test="startDateStr != null and startDateStr != ''">
AND date_format(o.create_time,'%y%m%d') &gt;= date_format(#{startDateStr},'%y%m%d')
AND DATE(o.create_time) &gt;= #{startDateStr}
</if>
<if test="endDateStr != null and endDateStr != ''">
AND date_format(o.create_time,'%y%m%d') &lt;= date_format(#{endDateStr},'%y%m%d')
AND DATE(o.create_time) &lt;= #{endDateStr}
</if>
<if test="channelId != 3 or (channelId == null)">and o.area_id != 14 </if>
AND o.status = 4 and o.type = 2 and o.paid = 1
@ -748,10 +746,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="areaId != null"> and o.area_id = #{areaId}</if>
<if test="startDateStr != null and startDateStr != ''">
AND date_format(o.create_time,'%y%m%d') &gt;= date_format(#{startDateStr},'%y%m%d')
AND DATE(o.create_time) &gt;= #{startDateStr}
</if>
<if test="endDateStr != null and endDateStr != ''">
AND date_format(o.create_time,'%y%m%d') &lt;= date_format(#{endDateStr},'%y%m%d')
AND DATE(o.create_time) &lt;= #{endDateStr}
</if>
AND o.status = 4 and o.type = 1 and o.paid = 1 and dd.partner_id is null
</where>
@ -763,10 +761,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="sn != null and sn != ''"> and sn = #{sn}</if>
<if test="areaId != null"> and area_id = #{areaId}</if>
<if test="startDateStr != null and startDateStr != ''">
AND date_format(create_time,'%y%m%d') &gt;= date_format(#{startDateStr},'%y%m%d')
AND DATE(create_time) &gt;= #{startDateStr}
</if>
<if test="endDateStr != null and endDateStr != ''">
AND date_format(create_time,'%y%m%d') &lt;= date_format(#{endDateStr},'%y%m%d')
AND DATE(create_time) &lt;= #{endDateStr}
</if>
AND status = 4 and type = 1
</where>
@ -779,10 +777,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="sn != null and sn != ''"> and o.sn = #{sn}</if>
<if test="areaId != null and areaId != 0"> and o.area_id = #{areaId}</if>
<if test="startDateStr != null and startDateStr != ''">
AND date_format(ref.create_time,'%y%m%d') &gt;= date_format(#{startDateStr},'%y%m%d')
AND DATE(ref.create_time) &gt;= #{startDateStr}
</if>
<if test="endDateStr != null and endDateStr != ''">
AND date_format(ref.create_time,'%y%m%d') &lt;= date_format(#{endDateStr},'%y%m%d')
AND DATE(ref.create_time) &lt;= #{endDateStr}
</if>
AND ref.type = 1 AND ref.refund_result = 'SUCCESS'
</where>
@ -796,10 +794,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="areaId != null and areaId != 0"> and o.area_id = #{areaId}</if>
<if test="channelId != null ">and o.pay_channel = #{channelId}</if>
<if test="startDateStr != null and startDateStr != ''">
AND date_format(ref.create_time,'%y%m%d') &gt;= date_format(#{startDateStr},'%y%m%d')
AND DATE(ref.create_time) &gt;= #{startDateStr}
</if>
<if test="endDateStr != null and endDateStr != ''">
AND date_format(ref.create_time,'%y%m%d') &lt;= date_format(#{endDateStr},'%y%m%d')
AND DATE(ref.create_time) &lt;= #{endDateStr}
</if>
AND ref.type = 1 AND ref.refund_result = 'SUCCESS'
</where>
@ -814,10 +812,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="areaId != null and areaId != 0"> and o.area_id = #{areaId}</if>
<if test="channelId != null ">and o.pay_channel = #{channelId}</if>
<if test="startDateStr != null and startDateStr != ''">
AND date_format(ref.create_time,'%y%m%d') &gt;= date_format(#{startDateStr},'%y%m%d')
AND DATE(ref.create_time) &gt;= #{startDateStr}
</if>
<if test="endDateStr != null and endDateStr != ''">
AND date_format(ref.create_time,'%y%m%d') &lt;= date_format(#{endDateStr},'%y%m%d')
AND DATE(ref.create_time) &lt;= #{endDateStr}
</if>
<if test="channelId != 3 or (channelId == null)">and o.area_id != 14 </if>
AND ref.type = 2 AND ref.refund_result = 'SUCCESS'
@ -932,10 +930,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="areaId != null"> and o.area_id = #{areaId}</if>
<if test="startDateStr != null and startDateStr != ''">
AND date_format(o.pay_time,'%y%m%d') &gt;= date_format(#{startDateStr},'%y%m%d')
AND DATE(o.pay_time) &gt;= #{startDateStr}
</if>
<if test="endDateStr != null and endDateStr != ''">
AND date_format(o.pay_time,'%y%m%d') &lt;= date_format(#{endDateStr},'%y%m%d')
AND DATE(o.pay_time) &lt;= #{endDateStr}
</if>
AND o.pay_type = 'yj'
</where>
@ -1187,7 +1185,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="deductionErrorOrderList" resultType="com.ruoyi.system.domain.EtOrder">
select order_id, area_id, order_no, sn,`status`,pay_type from et_order
where status = 3 and pay_type = 'yj' and pay_time is not null
where status = 3 and pay_type = 'yj' and DATE(pay_time) is not null
</select>
<select id="getTotalPaidFee" resultType="java.math.BigDecimal">
@ -1203,10 +1201,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="areaId != null and areaId != 0"> and area_id = #{areaId}</if>
<if test="channelId != null ">AND pay_channel = #{channelId}</if>
<if test="startDateStr != null and startDateStr != ''">
AND date_format(pay_time,'%y%m%d') &gt;= date_format(#{startDateStr},'%y%m%d')
and DATE(pay_time) &gt;= #{startDateStr}
</if>
<if test="endDateStr != null and endDateStr != ''">
AND date_format(pay_time,'%y%m%d') &lt;= date_format(#{endDateStr},'%y%m%d')
and DATE(pay_time) &lt;= #{endDateStr}
</if>
AND STATUS in (4,5)
AND paid = 1
@ -1221,10 +1219,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="areaId != null and areaId != 0"> and area_id = #{areaId}</if>
<if test="channelId != null ">AND pay_channel = #{channelId}</if>
<if test="startDateStr != null and startDateStr != ''">
AND date_format(pay_time,'%y%m%d') &gt;= date_format(#{startDateStr},'%y%m%d')
and DATE(pay_time) &gt;= #{startDateStr}
</if>
<if test="endDateStr != null and endDateStr != ''">
AND date_format(pay_time,'%y%m%d') &lt;= date_format(#{endDateStr},'%y%m%d')
and DATE(pay_time) &lt;= #{endDateStr}
</if>
AND STATUS in (4,5)
AND type = 1
@ -1249,10 +1247,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="channelId != 3 or (channelId == null)">and o.area_id != 14 </if>
<if test="areaId != null and areaId != 0"> and o.area_id = #{areaId}</if>
<if test="startDateStr != null and startDateStr != ''">
AND date_format(o.pay_time,'%y%m%d') &gt;= date_format(#{startDateStr},'%y%m%d')
AND DATE(o.pay_time) &gt;= #{startDateStr}
</if>
<if test="endDateStr != null and endDateStr != ''">
AND date_format(o.pay_time,'%y%m%d') &lt;= date_format(#{endDateStr},'%y%m%d')
AND DATE(o.pay_time) &lt;= #{endDateStr}
</if>
AND o.STATUS = 4
AND o.type = 1
@ -1272,10 +1270,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="areaId != null and areaId != 0"> and o.area_id = #{areaId}</if>
<if test="channelId != null ">AND o.pay_channel = #{channelId}</if>
<if test="startDateStr != null and startDateStr != ''">
AND date_format(ref.create_time,'%y%m%d') &gt;= date_format(#{startDateStr},'%y%m%d')
AND DATE(ref.create_time) &gt;= #{startDateStr}
</if>
<if test="endDateStr != null and endDateStr != ''">
AND date_format(ref.create_time,'%y%m%d') &lt;= date_format(#{endDateStr},'%y%m%d')
AND DATE(ref.create_time) &lt;= #{endDateStr}
</if>
AND o.STATUS = 4
AND o.type = 2

View File

@ -39,6 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userId != null "> and r.user_id like concat('%', #{userId}, '%')</if>
<if test="amount != null "> and r.amount = #{amount}</if>
<if test="areaId != null"> and o.area_id = #{areaId}</if>
<if test="deptId != null"> and d.dept_id = #{deptId}</if>
<if test="itemDesc != null and itemDesc != ''"> and r.item_desc like concat('%', #{itemDesc}, '%')</if>
<if test="refundResult != null "> and r.refund_result = #{refundResult}</if>
<if test="type != null "> and r.type = #{type}</if>