Merge branch 'sharding-分库' into test
# Conflicts: # src/main/java/com/sqx/modules/course/service/impl/CourseServiceImpl.java # src/main/java/com/sqx/modules/pay/dao/CashOutDao.java # src/main/java/com/sqx/modules/pay/service/impl/CashOutServiceImpl.java # src/main/resources/mapper/course/CourseCollectDao.xml
This commit is contained in:
@@ -2,6 +2,8 @@ package com.sqx.modules.pay.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.pay.entity.PayClassify;
|
||||
@@ -14,6 +16,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author fang
|
||||
@@ -31,7 +34,7 @@ public class PayClassifyController {
|
||||
|
||||
@PostMapping("/insertPayClassify")
|
||||
@ApiOperation("添加充值分类")
|
||||
public Result insertPayClassify(@RequestBody PayClassify payClassify){
|
||||
public Result insertPayClassify(@RequestBody PayClassify payClassify) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
payClassify.setCreateTime(sdf.format(new Date()));
|
||||
payClassifyService.save(payClassify);
|
||||
@@ -40,26 +43,26 @@ public class PayClassifyController {
|
||||
|
||||
@PostMapping("/updatePayClassify")
|
||||
@ApiOperation("修改充值分类")
|
||||
public Result updatePayClassify(@RequestBody PayClassify payClassify){
|
||||
public Result updatePayClassify(@RequestBody PayClassify payClassify) {
|
||||
payClassifyService.updateById(payClassify);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@PostMapping("/deletePayClassify")
|
||||
@ApiOperation("删除充值分类")
|
||||
public Result deletePayClassify(Long payClassifyId){
|
||||
public Result deletePayClassify(Long payClassifyId) {
|
||||
payClassifyService.removeById(payClassifyId);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@GetMapping("/selectPayClassifyList")
|
||||
@ApiOperation("查询充值分类")
|
||||
public Result selectPayClassifyList(Integer page,Integer limit){
|
||||
Page<PayClassify> pages=new Page<>(page,limit);
|
||||
return Result.success().put("data",new PageUtils(payClassifyService.page(pages)));
|
||||
public Result selectPayClassifyList(Integer page, Integer limit) {
|
||||
PageHelper.startPage(page, limit);
|
||||
List<PayClassify> list = payClassifyService.list();
|
||||
PageInfo<PayClassify> pageInfo = new PageInfo<>(list);
|
||||
return Result.success().put("data", PageUtils.page(pageInfo));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
package com.sqx.modules.pay.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sqx.modules.pay.entity.CashOut;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author fang
|
||||
@@ -42,7 +38,7 @@ public interface CashOutDao extends BaseMapper<CashOut> {
|
||||
|
||||
Double selectMayMoney(@Param("userId") Long userId);
|
||||
|
||||
IPage<CashOut> selectCashOutPage(Page<CashOut> page, CashOut cashOut,@Param("isApp") boolean isApp);
|
||||
List<CashOut> selectCashOutPage(CashOut cashOut,@Param("isApp") boolean isApp);
|
||||
|
||||
List<CashOut> selectCashOutList(@Param("cashOut") CashOut cashOut);
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.sqx.modules.pay.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sqx.modules.pay.entity.PayDetails;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -29,19 +27,19 @@ public interface PayDetailsDao extends BaseMapper<PayDetails> {
|
||||
|
||||
int updateState(@Param("id") Long id, @Param("state") Integer state, @Param("time") String time, @Param("tradeNo") String tradeNo,@Param("thirdOrderNo") String thirdOrderNo);
|
||||
|
||||
IPage<Map<String, Object>> selectPayDetails(@Param("page") Page<Map<String, Object>> page, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("userId") Long userId, @Param("state") Integer state, @Param("userName") String userName, String orderId);
|
||||
List<Map<String, Object>> selectPayDetails(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("userId") Long userId, @Param("state") Integer state, @Param("userName") String userName, String orderId);
|
||||
|
||||
Double selectSumPay(@Param("createTime") String createTime, @Param("endTime") String endTime, @Param("userId") Long userId);
|
||||
|
||||
Double selectSumMember(@Param("time") String time, @Param("flag") Integer flag);
|
||||
|
||||
IPage<Map<String, Object>> payMemberAnalysis(Page<Map<String, Object>> page, @Param("time") String time, @Param("flag") Integer flag);
|
||||
List<Map<String, Object>> payMemberAnalysis(@Param("time") String time, @Param("flag") Integer flag);
|
||||
|
||||
Double selectSumPayByState(@Param("time") String time, @Param("flag") Integer flag, @Param("state") Integer state);
|
||||
|
||||
Double selectSumPayByClassify(@Param("time") String time, @Param("flag") Integer flag, @Param("classify") Integer classify,@Param("payClassify") Integer payClassify);
|
||||
|
||||
IPage<Map<String, Object>> selectUserMemberList(Page<Map<String, Object>> page, @Param("phone") String phone);
|
||||
List<Map<String, Object>> selectUserMemberList(@Param("phone") String phone);
|
||||
|
||||
int selectPayCount(Long userId);
|
||||
|
||||
|
||||
@@ -4,17 +4,15 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapProxy;
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sqx.common.exception.SqxException;
|
||||
import com.sqx.common.utils.Constant;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.app.dao.MsgDao;
|
||||
@@ -40,6 +38,7 @@ import com.sqx.modules.sys.entity.SysUserEntity;
|
||||
import com.sqx.modules.sys.service.SysUserService;
|
||||
import com.sqx.modules.utils.AliPayOrderUtil;
|
||||
import com.sqx.modules.utils.AmountCalUtils;
|
||||
import com.sqx.modules.utils.ParamPageUtils;
|
||||
import com.sqx.modules.utils.excel.ExcelData;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@@ -106,8 +105,9 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils selectCashOutList(Integer page, Integer limit, CashOut cashOut, boolean isApp) {
|
||||
return new PageUtils(baseMapper.selectCashOutPage(new Page<>(page, limit), cashOut, isApp));
|
||||
public PageUtils selectCashOutList(Integer page, Integer limit, CashOut cashOut) {
|
||||
PageHelper.startPage(page, limit);
|
||||
return PageUtils.page(new PageInfo<>(baseMapper.selectCashOutPage(cashOut)));
|
||||
}
|
||||
|
||||
|
||||
@@ -545,13 +545,11 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
||||
|
||||
@Override
|
||||
public PageUtils auditPage(Map<String, Object> params) {
|
||||
MapProxy proxy = MapProxy.create(params);
|
||||
PageHelper.startPage(ParamPageUtils.getPageNum(params), ParamPageUtils.getPageSize(params));
|
||||
CashOut cashOut = BeanUtil.toBean(params, CashOut.class);
|
||||
//cashOut.setState(3);
|
||||
long pageNum = proxy.getLong(Constant.PAGE, 1L);
|
||||
long pageSize = proxy.getLong(Constant.LIMIT, 10L);
|
||||
IPage<CashOut> page = baseMapper.selectCashOutPage(new Page<>(pageNum, pageSize), cashOut, false);
|
||||
return new PageUtils(page);
|
||||
List<CashOut> page = baseMapper.selectCashOutPage(cashOut, false);
|
||||
PageInfo<CashOut> pageInfo = new PageInfo<>(page);
|
||||
return PageUtils.page(pageInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -627,7 +625,7 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
||||
baseMapper.updateById(entity);
|
||||
UserMoneyDetails userMoneyDetails = new UserMoneyDetails(
|
||||
entity.getUserId(), entity.getSysUserId(), null, "[提现退款]", 4, 1, 2,
|
||||
new BigDecimal(entity.getMoney()), "提现失败,自动退款" + entity.getMoney() + "元", 1,entity.getId());
|
||||
new BigDecimal(entity.getMoney()), "提现失败,自动退款" + entity.getMoney() + "元", 1, entity.getId());
|
||||
userMoneyDetailsService.save(userMoneyDetails);
|
||||
//归还余额 钱
|
||||
userMoneyService.updateAmount(1, entity.getUserId(), Convert.toDouble(entity.getMoney()));
|
||||
@@ -672,7 +670,7 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
||||
|
||||
@Override
|
||||
public Map<String, Object> alipayTransferSummaryQuery(String alipayAccountName) {
|
||||
if(StrUtil.isBlank(alipayAccountName)){
|
||||
if (StrUtil.isBlank(alipayAccountName)) {
|
||||
throw new SqxException("支付宝账号不能为空!");
|
||||
}
|
||||
BigDecimal sum = BigDecimal.ZERO;
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.sqx.modules.pay.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.modules.pay.dao.PayDetailsDao;
|
||||
import com.sqx.modules.pay.entity.PayDetails;
|
||||
@@ -10,6 +12,7 @@ import com.sqx.modules.utils.TimeCompleteUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -27,11 +30,13 @@ public class PayDetailsServiceImpl extends ServiceImpl<PayDetailsDao, PayDetails
|
||||
|
||||
@Override
|
||||
public PageUtils selectPayDetails(int page, int limit, String startTime, String endTime, Long userId, Integer state, String userName, String orderId) {
|
||||
Page<Map<String, Object>> pages = new Page<>(page, limit);
|
||||
PageHelper.startPage(page, limit);
|
||||
if (state != null && state == -1) {
|
||||
state = null;
|
||||
}
|
||||
return new PageUtils(payDetailsDao.selectPayDetails(pages, TimeCompleteUtils.completeStartTime(startTime), TimeCompleteUtils.completeEndTime(endTime), userId, state,userName,orderId));
|
||||
List<Map<String, Object>> payDetails = payDetailsDao.selectPayDetails(TimeCompleteUtils.completeStartTime(startTime), TimeCompleteUtils.completeEndTime(endTime), userId, state, userName, orderId);
|
||||
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(payDetails);
|
||||
return PageUtils.page(pageInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -44,14 +49,18 @@ public class PayDetailsServiceImpl extends ServiceImpl<PayDetailsDao, PayDetails
|
||||
|
||||
@Override
|
||||
public PageUtils payMemberAnalysis(int page, int limit, String time, Integer flag) {
|
||||
Page<Map<String, Object>> pages = new Page<>(page, limit);
|
||||
return new PageUtils(payDetailsDao.payMemberAnalysis(pages, time, flag));
|
||||
PageHelper.startPage(page, limit);
|
||||
List<Map<String, Object>> list = payDetailsDao.payMemberAnalysis(time, flag);
|
||||
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(list);
|
||||
return PageUtils.page(pageInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils selectUserMemberList(int page, int limit, String phone) {
|
||||
Page<Map<String, Object>> pages = new Page<>(page, limit);
|
||||
return new PageUtils(payDetailsDao.selectUserMemberList(pages, phone));
|
||||
PageHelper.startPage(page, limit);
|
||||
List<Map<String, Object>> list = payDetailsDao.selectUserMemberList(phone);
|
||||
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(list);
|
||||
return PageUtils.page(pageInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -65,8 +74,8 @@ public class PayDetailsServiceImpl extends ServiceImpl<PayDetailsDao, PayDetails
|
||||
}
|
||||
|
||||
@Override
|
||||
public Double selectSumPayByClassify(String time, Integer flag, Integer classify,Integer payClassify) {
|
||||
return payDetailsDao.selectSumPayByClassify(time, flag, classify,payClassify);
|
||||
public Double selectSumPayByClassify(String time, Integer flag, Integer classify, Integer payClassify) {
|
||||
return payDetailsDao.selectSumPayByClassify(time, flag, classify, payClassify);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user