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:
@@ -1,101 +1,120 @@
|
||||
package com.sqx.common.utils;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分页工具类
|
||||
*
|
||||
*/
|
||||
public class PageUtils implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 总记录数
|
||||
*/
|
||||
private int totalCount;
|
||||
/**
|
||||
* 每页记录数
|
||||
*/
|
||||
private int pageSize;
|
||||
/**
|
||||
* 总页数
|
||||
*/
|
||||
private int totalPage;
|
||||
/**
|
||||
* 当前页数
|
||||
*/
|
||||
private int currPage;
|
||||
/**
|
||||
* 列表数据
|
||||
*/
|
||||
private List<?> list;
|
||||
|
||||
/**
|
||||
* 分页
|
||||
* @param list 列表数据
|
||||
* @param totalCount 总记录数
|
||||
* @param pageSize 每页记录数
|
||||
* @param currPage 当前页数
|
||||
*/
|
||||
public PageUtils(List<?> list, int totalCount, int pageSize, int currPage) {
|
||||
this.list = list;
|
||||
this.totalCount = totalCount;
|
||||
this.pageSize = pageSize;
|
||||
this.currPage = currPage;
|
||||
this.totalPage = (int)Math.ceil((double)totalCount/pageSize);
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 总记录数
|
||||
*/
|
||||
private int totalCount;
|
||||
/**
|
||||
* 每页记录数
|
||||
*/
|
||||
private int pageSize;
|
||||
/**
|
||||
* 总页数
|
||||
*/
|
||||
private int totalPage;
|
||||
/**
|
||||
* 当前页数
|
||||
*/
|
||||
private int currPage;
|
||||
/**
|
||||
* 列表数据
|
||||
*/
|
||||
private List<?> list;
|
||||
private List<?> records;
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*/
|
||||
public PageUtils(IPage<?> page) {
|
||||
this.list = page.getRecords();
|
||||
this.totalCount = (int)page.getTotal();
|
||||
this.pageSize = (int)page.getSize();
|
||||
this.currPage = (int)page.getCurrent();
|
||||
this.totalPage = (int)page.getPages();
|
||||
}
|
||||
|
||||
public int getTotalCount() {
|
||||
return totalCount;
|
||||
}
|
||||
public PageUtils() {
|
||||
}
|
||||
|
||||
public void setTotalCount(int totalCount) {
|
||||
this.totalCount = totalCount;
|
||||
}
|
||||
/**
|
||||
* 分页
|
||||
*
|
||||
* @param list 列表数据
|
||||
* @param totalCount 总记录数
|
||||
* @param pageSize 每页记录数
|
||||
* @param currPage 当前页数
|
||||
*/
|
||||
public PageUtils(List<?> list, int totalCount, int pageSize, int currPage) {
|
||||
this.list = list;
|
||||
this.totalCount = totalCount;
|
||||
this.pageSize = pageSize;
|
||||
this.currPage = currPage;
|
||||
this.totalPage = (int) Math.ceil((double) totalCount / pageSize);
|
||||
}
|
||||
|
||||
public int getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
public static PageUtils page(PageInfo<?> page) {
|
||||
return page(page,false);
|
||||
}
|
||||
|
||||
public void setPageSize(int pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
public static PageUtils page(PageInfo<?> page, boolean isRecords) {
|
||||
PageUtils pageUtils = new PageUtils();
|
||||
if (isRecords) {
|
||||
pageUtils.records = page.getList();
|
||||
} else {
|
||||
pageUtils.list = page.getList();
|
||||
}
|
||||
pageUtils.totalCount = (int) page.getTotal();
|
||||
pageUtils.pageSize = page.getSize();
|
||||
pageUtils.currPage = page.getPageNum();
|
||||
pageUtils.totalPage = page.getPages();
|
||||
return pageUtils;
|
||||
}
|
||||
|
||||
public int getTotalPage() {
|
||||
return totalPage;
|
||||
}
|
||||
public int getTotalCount() {
|
||||
return totalCount;
|
||||
}
|
||||
|
||||
public void setTotalPage(int totalPage) {
|
||||
this.totalPage = totalPage;
|
||||
}
|
||||
public void setTotalCount(int totalCount) {
|
||||
this.totalCount = totalCount;
|
||||
}
|
||||
|
||||
public int getCurrPage() {
|
||||
return currPage;
|
||||
}
|
||||
public int getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setCurrPage(int currPage) {
|
||||
this.currPage = currPage;
|
||||
}
|
||||
public void setPageSize(int pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public List<?> getList() {
|
||||
return list;
|
||||
}
|
||||
public int getTotalPage() {
|
||||
return totalPage;
|
||||
}
|
||||
|
||||
public void setList(List<?> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
public void setTotalPage(int totalPage) {
|
||||
this.totalPage = totalPage;
|
||||
}
|
||||
|
||||
public int getCurrPage() {
|
||||
return currPage;
|
||||
}
|
||||
|
||||
public void setCurrPage(int currPage) {
|
||||
this.currPage = currPage;
|
||||
}
|
||||
|
||||
public List<?> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<?> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
public List<?> getRecords() {
|
||||
return records;
|
||||
}
|
||||
|
||||
public void setRecords(List<?> records) {
|
||||
this.records = records;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
package com.sqx.common.utils;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sqx.common.xss.SQLFilter;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 查询参数
|
||||
*
|
||||
*/
|
||||
public class Query<T> {
|
||||
|
||||
public IPage<T> getPage(Map<String, Object> params) {
|
||||
return this.getPage(params, null, false);
|
||||
}
|
||||
|
||||
public IPage<T> getPage(Map<String, Object> params, String defaultOrderField, boolean isAsc) {
|
||||
//分页参数
|
||||
long curPage = 1;
|
||||
long limit = 10;
|
||||
|
||||
if(params.get(Constant.PAGE) != null){
|
||||
curPage = Long.parseLong(String.valueOf(params.get(Constant.PAGE)));
|
||||
}
|
||||
if(params.get(Constant.LIMIT) != null){
|
||||
limit = Long.parseLong(String.valueOf(params.get(Constant.LIMIT)));
|
||||
}
|
||||
|
||||
//分页对象
|
||||
Page<T> page = new Page<>(curPage, limit);
|
||||
|
||||
//分页参数
|
||||
params.put(Constant.PAGE, page);
|
||||
|
||||
//排序字段
|
||||
//防止SQL注入(因为sidx、order是通过拼接SQL实现排序的,会有SQL注入风险)
|
||||
String orderField = SQLFilter.sqlInject((String)params.get(Constant.ORDER_FIELD));
|
||||
String order = (String)params.get(Constant.ORDER);
|
||||
|
||||
|
||||
//前端字段排序
|
||||
if(StringUtils.isNotEmpty(orderField) && StringUtils.isNotEmpty(order)){
|
||||
if(Constant.ASC.equalsIgnoreCase(order)) {
|
||||
return page.addOrder(OrderItem.asc(orderField));
|
||||
}else {
|
||||
return page.addOrder(OrderItem.desc(orderField));
|
||||
}
|
||||
}
|
||||
|
||||
//没有排序字段,则不排序
|
||||
if(StringUtils.isBlank(defaultOrderField)){
|
||||
return page;
|
||||
}
|
||||
|
||||
//默认排序
|
||||
if(isAsc) {
|
||||
page.addOrder(OrderItem.asc(defaultOrderField));
|
||||
}else {
|
||||
page.addOrder(OrderItem.desc(defaultOrderField));
|
||||
}
|
||||
|
||||
return page;
|
||||
}
|
||||
}
|
||||
@@ -6,20 +6,20 @@ import com.zaxxer.hikari.HikariConfig;
|
||||
import com.zaxxer.hikari.HikariDataSource;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shardingsphere.api.config.masterslave.MasterSlaveRuleConfiguration;
|
||||
import org.apache.shardingsphere.api.config.sharding.ShardingRuleConfiguration;
|
||||
import org.apache.shardingsphere.api.config.sharding.TableRuleConfiguration;
|
||||
import org.apache.shardingsphere.api.config.sharding.strategy.InlineShardingStrategyConfiguration;
|
||||
import org.apache.shardingsphere.shardingjdbc.api.ShardingDataSourceFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.sql.DataSource;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
@@ -31,6 +31,9 @@ import java.util.stream.Collectors;
|
||||
@ConfigurationProperties(prefix = "spring.shardingsphere")
|
||||
public class ShardingConfig {
|
||||
|
||||
@Value("${spring.profiles.active}")
|
||||
private String activeProfile;
|
||||
|
||||
/**
|
||||
* 读取数据源信息
|
||||
*/
|
||||
@@ -49,12 +52,46 @@ public class ShardingConfig {
|
||||
*/
|
||||
private String centerTablesDataNode;
|
||||
|
||||
|
||||
/**
|
||||
* 中心表,不进行分库操作
|
||||
*/
|
||||
private List<String> centerTables;
|
||||
private Set<String> centerTables;
|
||||
|
||||
/**
|
||||
* 区域库的节点
|
||||
*/
|
||||
private String regionTablesDataNode;
|
||||
|
||||
/**
|
||||
* 区域表分库策略的字段
|
||||
*/
|
||||
private String regionTablesShardingDatabaseColumn;
|
||||
|
||||
/**
|
||||
* 区域表分库的算法
|
||||
*/
|
||||
private String regionTablesShardingDatabaseAlgorithm;
|
||||
|
||||
/**
|
||||
* 分库表,通过userId进行分库
|
||||
*/
|
||||
private Set<String> regionTables;
|
||||
|
||||
|
||||
/**
|
||||
* 区域表分库策略的字段
|
||||
*/
|
||||
private String courseDetailsShardingDatabaseColumn;
|
||||
|
||||
/**
|
||||
* 区域表分库的算法
|
||||
*/
|
||||
private String courseDetailsShardingDatabaseAlgorithm;
|
||||
|
||||
/**
|
||||
* 分库表,通过userId进行分库
|
||||
*/
|
||||
private Set<String> courseDetails;
|
||||
|
||||
/**
|
||||
* 配置sharding-jdbc数据源
|
||||
@@ -69,6 +106,12 @@ public class ShardingConfig {
|
||||
// 配置表的切分策略
|
||||
shardingRuleConfig.setTableRuleConfigs(addTableRuleConfigs());
|
||||
|
||||
// 配置表绑定规则
|
||||
List<Set<String>> sets = new ArrayList<>();
|
||||
sets.add(regionTables);
|
||||
shardingRuleConfig.setBindingTableGroups(bindingTableGroups(sets));
|
||||
|
||||
|
||||
// 配置是否显示sql
|
||||
Properties props = new Properties();
|
||||
props.put("sql.show", showSql);
|
||||
@@ -88,15 +131,36 @@ public class ShardingConfig {
|
||||
String.format(centerTablesDataNode, centerTable));
|
||||
sets.add(tableRuleConfig);
|
||||
}
|
||||
if ("prod".equals(activeProfile)) {
|
||||
// 定义区域表的分库规则
|
||||
InlineShardingStrategyConfiguration databaseShardingStrategyConfig = new InlineShardingStrategyConfiguration(
|
||||
regionTablesShardingDatabaseColumn, regionTablesShardingDatabaseAlgorithm);
|
||||
for (String regionTable : regionTables) {
|
||||
TableRuleConfiguration tableRuleConfig = new TableRuleConfiguration(regionTable, String.format(regionTablesDataNode, regionTable));
|
||||
tableRuleConfig.setDatabaseShardingStrategyConfig(databaseShardingStrategyConfig);
|
||||
sets.add(tableRuleConfig);
|
||||
}
|
||||
|
||||
// // 定义区域表的分库规则
|
||||
// InlineShardingStrategyConfiguration databaseShardingStrategyConfig = new InlineShardingStrategyConfiguration(
|
||||
// regionTablesShardingDatabaseColumn, regionTablesShardingDatabaseAlgorithm);
|
||||
// for (String regionTable : regionTables) {
|
||||
// TableRuleConfiguration tableRuleConfig = new TableRuleConfiguration(regionTable, String.format(regionTablesDataNode, regionTable));
|
||||
// tableRuleConfig.setDatabaseShardingStrategyConfig(databaseShardingStrategyConfig);
|
||||
// sets.add(tableRuleConfig);
|
||||
// }
|
||||
// 定义区域表的分库规则
|
||||
InlineShardingStrategyConfiguration courseDetailsShardingStrategyConfig = new InlineShardingStrategyConfiguration(
|
||||
courseDetailsShardingDatabaseColumn, courseDetailsShardingDatabaseAlgorithm);
|
||||
for (String regionTable : courseDetails) {
|
||||
TableRuleConfiguration tableRuleConfig = new TableRuleConfiguration(regionTable, String.format(regionTablesDataNode, regionTable));
|
||||
tableRuleConfig.setDatabaseShardingStrategyConfig(courseDetailsShardingStrategyConfig);
|
||||
sets.add(tableRuleConfig);
|
||||
}
|
||||
}else {
|
||||
for (String centerTable : regionTables) {
|
||||
TableRuleConfiguration tableRuleConfig = new TableRuleConfiguration(centerTable,
|
||||
String.format(centerTablesDataNode, centerTable));
|
||||
sets.add(tableRuleConfig);
|
||||
}
|
||||
for (String centerTable : courseDetails) {
|
||||
TableRuleConfiguration tableRuleConfig = new TableRuleConfiguration(centerTable,
|
||||
String.format(centerTablesDataNode, centerTable));
|
||||
sets.add(tableRuleConfig);
|
||||
}
|
||||
}
|
||||
return sets;
|
||||
}
|
||||
|
||||
@@ -136,4 +200,38 @@ public class ShardingConfig {
|
||||
});
|
||||
return sets;
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定表的分片规则
|
||||
*/
|
||||
public static Set<String> bindingTableGroups(List<Set<String>> sets) {
|
||||
if (sets != null && !sets.isEmpty()) {
|
||||
Set<String> tableGroups = new HashSet<>();
|
||||
for (Set<String> set : sets) {
|
||||
String tableNames = bindingTable(set.toArray(new String[0]));
|
||||
if (StringUtils.isNotBlank(tableNames)) {
|
||||
tableGroups.add(tableNames);
|
||||
}
|
||||
}
|
||||
return tableGroups;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量绑定表规则
|
||||
*
|
||||
* @param tables 批量绑定的标规则
|
||||
* @return tableNames
|
||||
*/
|
||||
private static String bindingTable(String... tables) {
|
||||
StringBuilder tableNames = new StringBuilder();
|
||||
if (tables != null && tables.length != 0) {
|
||||
for (String table : tables) {
|
||||
tableNames.append(table).append(",");
|
||||
}
|
||||
tableNames.deleteCharAt(tableNames.length() - 1);
|
||||
}
|
||||
return tableNames.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
package com.sqx.modules.app.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.app.entity.App;
|
||||
import com.sqx.modules.app.service.AppService;
|
||||
@@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* APP登录授权
|
||||
@@ -30,8 +32,10 @@ public class AppUpgradeController {
|
||||
@ApiOperation("管理平台升级详情")
|
||||
@ResponseBody
|
||||
public Result list(Integer page,Integer limit) {
|
||||
IPage<App> pages =new Page<>(page,limit);
|
||||
return Result.success().put("data",iAppService.page(pages));
|
||||
PageHelper.startPage(page,limit);
|
||||
List<App> list = iAppService.list();
|
||||
PageInfo<App> pageInfo = new PageInfo<>(list);
|
||||
return Result.success().put("data", PageUtils.page(pageInfo, true));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.sqx.modules.app.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.app.entity.UserEntity;
|
||||
@@ -270,9 +270,8 @@ public class UserController {
|
||||
@GetMapping("/courseMessage")
|
||||
@ApiOperation("短剧分析")
|
||||
public Result courseMessage(Long page, Long limit, String date, int type, Long sysUserId) {
|
||||
Page<Map<String, Object>> iPage = new Page<>(page, limit);
|
||||
IPage<Map<String, Object>> mapIPage = userService.queryCourseOrder(iPage, type, TimeCompleteUtils.completeStartTime(date), sysUserId);
|
||||
return Result.success().put("data", new PageUtils(mapIPage));
|
||||
PageUtils pageUtils = userService.queryCourseOrder(page, limit, type, TimeCompleteUtils.completeStartTime(date), sysUserId);
|
||||
return Result.success().put("data", pageUtils);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.sqx.modules.app.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sqx.common.utils.DateUtils;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Result;
|
||||
@@ -16,6 +18,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@Api(value = "会员管理", tags = {"会员管理"})
|
||||
@@ -89,7 +92,10 @@ public class VipDetailsController {
|
||||
@ApiParam("查询会员列表")
|
||||
@GetMapping("/selectVipDetailsList")
|
||||
public Result selectVipDetailsList(Integer page,Integer limit) {
|
||||
return Result.success().put("data",new PageUtils(vipDetailsService.page(new Page<>(page,limit))));
|
||||
PageHelper.startPage(page,limit);
|
||||
List<VipDetails> list = vipDetailsService.list();
|
||||
PageInfo<VipDetails> pageInfo = new PageInfo<>(list);
|
||||
return Result.success().put("data", PageUtils.page(pageInfo));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.sqx.modules.app.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.app.entity.UserEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -17,7 +15,7 @@ import java.util.Map;
|
||||
public interface UserDao extends BaseMapper<UserEntity> {
|
||||
|
||||
|
||||
IPage<UserEntity> selectUserPage(@Param("page") Page<UserEntity> page, @Param("search") String search, @Param("sex") Integer sex, @Param("platform") String platform,
|
||||
List<UserEntity> selectUserPage(@Param("search") String search, @Param("sex") Integer sex, @Param("platform") String platform,
|
||||
@Param("sysPhone") String sysPhone, @Param("status") Integer status, @Param("member") Integer member,
|
||||
@Param("inviterCode") String inviterCode, @Param("userName") String userName,
|
||||
@Param("invitationCode") String invitationCode, @Param("startTime") String startTime,
|
||||
@@ -31,13 +29,13 @@ public interface UserDao extends BaseMapper<UserEntity> {
|
||||
|
||||
Double queryPayMoney(@Param("type") int type, @Param("date") String date,String qdCode);
|
||||
|
||||
IPage<Map<String, Object>> queryCourseOrder(Page iPage,@Param("type") int type, @Param("start") String start, @Param("end") String end,Long sysUserId);
|
||||
List<Map<String, Object>> queryCourseOrder(@Param("type") int type, @Param("start") String start, @Param("end") String end,Long sysUserId);
|
||||
|
||||
int userMessage( String date, int type,String qdCode,Integer vipType);
|
||||
|
||||
int insertUser(UserEntity userEntity);
|
||||
|
||||
IPage<UserEntity> selectInviteUserList(Page<UserEntity> page,String userName,String phone);
|
||||
List<UserEntity> selectInviteUserList(String userName,String phone);
|
||||
|
||||
int selectUserOnLineCount(String qdCode);
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.sqx.modules.app.service;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
@@ -215,7 +214,7 @@ public interface UserService extends IService<UserEntity> {
|
||||
|
||||
Double queryPayMoney(int type,String qdCode);
|
||||
|
||||
IPage<Map<String, Object>> queryCourseOrder(Page<Map<String, Object>> iPage, int type, String date,Long sysUserId);
|
||||
PageUtils queryCourseOrder(Long page, Long limit, int type, String date,Long sysUserId);
|
||||
|
||||
int userMessage( String date, int type,String qdCode,Integer vipType);
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package com.sqx.modules.app.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.common.utils.Result;
|
||||
import com.sqx.modules.app.dao.UserMoneyDetailsDao;
|
||||
import com.sqx.modules.app.entity.UserMoneyDetails;
|
||||
@@ -11,7 +12,6 @@ import com.sqx.modules.app.service.UserMoneyDetailsService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -21,7 +21,7 @@ public class UserMoneyDetailsServiceImpl extends ServiceImpl<UserMoneyDetailsDao
|
||||
@Override
|
||||
public Result queryUserMoneyDetails(Integer page, Integer limit, Long sysUserId, Long userId, Integer classify,
|
||||
Integer type, Integer moneyType, Integer viewType) {
|
||||
IPage<UserMoneyDetails> page1 = new Page(page, limit);
|
||||
PageHelper.startPage(page, limit);
|
||||
QueryWrapper<UserMoneyDetails> queryWrapper = new QueryWrapper();
|
||||
if (sysUserId != null) {
|
||||
queryWrapper.eq("sys_user_id", sysUserId);
|
||||
@@ -45,7 +45,7 @@ public class UserMoneyDetailsServiceImpl extends ServiceImpl<UserMoneyDetailsDao
|
||||
queryWrapper.in("classify", arrayList);
|
||||
}
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
return Result.success().put("data", baseMapper.selectPage(page1, queryWrapper));
|
||||
return Result.success().put("data", PageUtils.page(new PageInfo<>(baseMapper.selectList(queryWrapper))));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -9,10 +9,10 @@ import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.aliyun.tea.ValidateException;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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;
|
||||
@@ -100,8 +100,8 @@ public class UserPrizeExchangeServiceImpl extends ServiceImpl<UserPrizeExchangeD
|
||||
wrapper.orderByDesc(UserPrizeExchange::getId);
|
||||
long pageNum = proxy.getLong(Constant.PAGE, 1L);
|
||||
long pageSize = proxy.getLong(Constant.LIMIT, 10L);
|
||||
IPage<UserPrizeExchange> page = this.page(new Page<>(pageNum, pageSize), wrapper);
|
||||
return new PageUtils(page);
|
||||
PageHelper.startPage((int) pageNum, (int) pageSize);
|
||||
return PageUtils.page(new PageInfo<>(this.list(wrapper)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -245,14 +245,14 @@ public class UserPrizeExchangeServiceImpl extends ServiceImpl<UserPrizeExchangeD
|
||||
}
|
||||
int count = userMoneyDetailsService.count(
|
||||
Wrappers.<UserMoneyDetails>lambdaQuery()
|
||||
.eq(UserMoneyDetails::getUserId, currentUserId)
|
||||
.eq(UserMoneyDetails::getUserId, currentUserId)
|
||||
.eq(UserMoneyDetails::getType, 1)
|
||||
.eq(UserMoneyDetails::getClassify, 7)
|
||||
.eq(UserMoneyDetails::getMoneyType, 1)
|
||||
.likeLeft(UserMoneyDetails::getTitle, "[连续签到")
|
||||
.likeRight(UserMoneyDetails::getTitle, "天]")
|
||||
);
|
||||
if(count > 0){
|
||||
if (count > 0) {
|
||||
throw new SqxException("已经领取过连续签到奖励,无需重复操作");
|
||||
}
|
||||
BigDecimal money = new BigDecimal(moneyStr);
|
||||
|
||||
@@ -19,7 +19,6 @@ import com.aliyuncs.http.MethodType;
|
||||
import com.aliyuncs.profile.DefaultProfile;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.getui.push.v2.sdk.ApiHelper;
|
||||
@@ -34,6 +33,8 @@ import com.getui.push.v2.sdk.dto.req.message.android.GTNotification;
|
||||
import com.getui.push.v2.sdk.dto.req.message.ios.Alert;
|
||||
import com.getui.push.v2.sdk.dto.req.message.ios.Aps;
|
||||
import com.getui.push.v2.sdk.dto.req.message.ios.IosDTO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.github.qcloudsms.SmsSingleSenderResult;
|
||||
import com.sqx.common.exception.SqxException;
|
||||
import com.sqx.common.utils.DateUtils;
|
||||
@@ -1358,9 +1359,11 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
|
||||
public PageUtils selectUserPage(Integer page, Integer limit, String search, Integer sex, String platform,
|
||||
String sysPhone, Integer status, Integer member, String inviterCode, String userName,
|
||||
String invitationCode, String startTime, String endTime, String qdCode, String sysUserName, Integer vipType) {
|
||||
Page<UserEntity> pages = new Page<>(page, limit);
|
||||
return new PageUtils(baseMapper.selectUserPage(pages, search, sex, platform, sysPhone, status, member,
|
||||
inviterCode, userName, invitationCode, TimeCompleteUtils.completeStartTime(startTime), TimeCompleteUtils.completeEndTime(endTime), qdCode, sysUserName, vipType));
|
||||
PageHelper.startPage(page, limit);
|
||||
List<UserEntity> entities = baseMapper.selectUserPage(search, sex, platform, sysPhone, status, member,
|
||||
inviterCode, userName, invitationCode, TimeCompleteUtils.completeStartTime(startTime), TimeCompleteUtils.completeEndTime(endTime), qdCode, sysUserName, vipType);
|
||||
PageInfo<UserEntity> pageInfo = new PageInfo<>(entities);
|
||||
return PageUtils.page(pageInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1391,7 +1394,7 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<Map<String, Object>> queryCourseOrder(Page<Map<String, Object>> iPage, int type, String date, Long sysUserId) {
|
||||
public PageUtils queryCourseOrder(Long page, Long limit, int type, String date, Long sysUserId) {
|
||||
DateTime parse = DateUtil.parse(date, "yyyy-MM-dd");
|
||||
|
||||
String startTime = DateUtil.format(parse, "yyyy-MM-dd 00:00:00");
|
||||
@@ -1403,7 +1406,12 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
|
||||
startTime = DateUtil.format(DateUtil.beginOfYear(parse), "yyyy-MM-dd 00:00:00");
|
||||
endTime = DateUtil.format(DateUtil.endOfYear(parse), "yyyy-MM-dd 23:59:59");
|
||||
}
|
||||
return baseMapper.queryCourseOrder(iPage, type, startTime, endTime, sysUserId);
|
||||
|
||||
PageHelper.startPage(page.intValue(), limit.intValue());
|
||||
List<Map<String, Object>> list = baseMapper.queryCourseOrder(type, startTime, endTime, sysUserId);
|
||||
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(list);
|
||||
|
||||
return PageUtils.page(pageInfo, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1484,7 +1492,8 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
|
||||
|
||||
@Override
|
||||
public Result selectInviteUserList(Integer page, Integer limit, String userName, String phone) {
|
||||
return Result.success().put("data", baseMapper.selectInviteUserList(new Page<>(page, limit), userName, phone));
|
||||
PageHelper.startPage(page,limit);
|
||||
return Result.success().put("data", PageUtils.page(new PageInfo<>(baseMapper.selectInviteUserList(userName, phone)),true));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.sqx.modules.banner.controller.app;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.banner.entity.Banner;
|
||||
@@ -13,6 +15,8 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author fang
|
||||
* @date 2020/7/9
|
||||
@@ -38,7 +42,10 @@ public class AppBannerController {
|
||||
@ApiOperation("查询所有banner图")
|
||||
@ResponseBody
|
||||
public Result selectBannerPage(Integer page,Integer limit,Integer classify) {
|
||||
return Result.success().put("data", new PageUtils(bannerService.page(new Page<>(page,limit),new QueryWrapper<Banner>().eq("classify",classify))));
|
||||
PageHelper.startPage(page,limit);
|
||||
List<Banner> classify1 = bannerService.list(new QueryWrapper<Banner>().eq("classify", classify));
|
||||
PageInfo<Banner> pageInfo = new PageInfo<>(classify1);
|
||||
return Result.success().put("data", PageUtils.page(pageInfo));
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/clickBanner", method = RequestMethod.GET)
|
||||
@@ -49,4 +56,4 @@ public class AppBannerController {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.sqx.modules.banner.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.banner.entity.Banner;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -21,6 +19,6 @@ public interface BannerDao extends BaseMapper<Banner> {
|
||||
|
||||
// List<Banner> selectList(@Param("classify") Integer classify);
|
||||
|
||||
IPage<Banner> selectBannerPage(Page<Banner> page,@Param("classify") Integer classify);
|
||||
List<Banner> selectBanner(@Param("classify") Integer classify);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
package com.sqx.modules.banner.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.common.utils.Result;
|
||||
import com.sqx.modules.banner.dao.BannerDao;
|
||||
import com.sqx.modules.banner.entity.Activity;
|
||||
import com.sqx.modules.banner.entity.Banner;
|
||||
import com.sqx.modules.banner.service.BannerService;
|
||||
import com.sqx.modules.course.dao.CourseDao;
|
||||
@@ -53,8 +52,8 @@ public class BannerServiceImpl extends ServiceImpl<BannerDao, Banner> implements
|
||||
|
||||
@Override
|
||||
public PageUtils selectBannerPage(Integer page, Integer limit, Integer classify) {
|
||||
Page<Banner> pages = new Page<>(page, limit);
|
||||
return new PageUtils(bannerDao.selectBannerPage(pages, classify));
|
||||
PageHelper.startPage(page, limit);
|
||||
return PageUtils.page(new PageInfo<>(bannerDao.selectBanner(classify)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -83,12 +82,13 @@ public class BannerServiceImpl extends ServiceImpl<BannerDao, Banner> implements
|
||||
|
||||
@Override
|
||||
public Result clickBanner(Integer bannerId, int page, int limit) {
|
||||
Page<Course> page1 = new Page<>(page, limit);
|
||||
PageHelper.startPage(page, limit);
|
||||
QueryWrapper<Course> queryWrapper = new QueryWrapper();
|
||||
//查询banner 对应短剧
|
||||
queryWrapper.eq("banner_id", bannerId);
|
||||
IPage<Course> coursePage = courseDao.selectPage(page1, queryWrapper);
|
||||
return Result.success().put("data", coursePage);
|
||||
List<Course> coursePage = courseDao.selectList(queryWrapper);
|
||||
PageInfo<Course> pageInfo = new PageInfo<>(coursePage);
|
||||
return Result.success().put("data", PageUtils.page(pageInfo, true));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package com.sqx.modules.coupon.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.coupon.dao.CouponDao;
|
||||
import com.sqx.modules.coupon.entity.Coupon;
|
||||
@@ -34,13 +33,12 @@ public class CouponServiceImpl extends ServiceImpl<CouponDao, Coupon> implements
|
||||
|
||||
@Override
|
||||
public Result selectCoupon(Integer page, Integer limit, String couponName) {
|
||||
IPage<Coupon> pages = new Page<>(page, limit);
|
||||
PageHelper.startPage(page,limit);
|
||||
QueryWrapper<Coupon> queryWrapper1 = new QueryWrapper<>();
|
||||
if(couponName!=null){
|
||||
queryWrapper1.eq("coupon_name",couponName);
|
||||
}
|
||||
pages=baseMapper.selectPage(pages,queryWrapper1);
|
||||
return Result.success().put("data",pages.getRecords());
|
||||
return Result.success().put("data",baseMapper.selectList(queryWrapper1));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.sqx.modules.course.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.course.entity.CourseClassification;
|
||||
import com.sqx.modules.course.response.ClassificationResponse;
|
||||
import com.sqx.modules.course.response.CurriculumResponse;
|
||||
@@ -14,10 +12,7 @@ import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
public interface CourseClassificationDao extends BaseMapper<CourseClassification> {
|
||||
|
||||
IPage<Map<String, Object>> selectCourseClassificationPage(Page<Map<String, Object>> pages, @Param("classificationName") String classificationName);
|
||||
|
||||
IPage<Map<String, Object>> selectCourseClassificationList(@Param("classificationName") String classificationName);
|
||||
List<Map<String, Object>> selectCourseClassificationList(@Param("classificationName") String classificationName);
|
||||
|
||||
int updateDelete(@Param("id") Long id);
|
||||
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
package com.sqx.modules.course.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.course.entity.Course;
|
||||
import com.sqx.modules.course.entity.CourseCollect;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface CourseCollectDao extends BaseMapper<CourseCollect> {
|
||||
|
||||
IPage<Course> selectCourseByCollect(Page<Course> page, @Param("userId") Long userId,@Param("classify") Integer classify);
|
||||
List<Course> selectCourseByCollect(@Param("userId") Long userId, @Param("classify") Integer classify);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
package com.sqx.modules.course.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.course.entity.CourseComment;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
@@ -14,7 +13,7 @@ public interface CourseCommentDao extends BaseMapper<CourseComment> {
|
||||
|
||||
int updateCourseComment(@Param("type") Integer type, @Param("courseCommentId") Long courseCommentId);
|
||||
|
||||
IPage<CourseComment> selectCourseComment(Page<CourseComment> page, @Param("courseId") Long courseId,@Param("userId") Long userId);
|
||||
List<CourseComment> selectCourseComment(@Param("courseId") Long courseId, @Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 删除评论的点赞关联
|
||||
@@ -22,8 +21,8 @@ public interface CourseCommentDao extends BaseMapper<CourseComment> {
|
||||
* @return
|
||||
*/
|
||||
int deleteCommentGood(@Param("courseCommentId") Long courseCommentId);
|
||||
|
||||
IPage<Map<String,Object>> selectCourseCommentByUserId(Page<Map<String,Object>> page,@Param("userId") Long userId);
|
||||
|
||||
|
||||
|
||||
List<Map<String,Object>> selectCourseCommentByUserId(@Param("userId") Long userId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
package com.sqx.modules.course.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.course.entity.Course;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
@@ -14,16 +13,16 @@ public interface CourseDao extends BaseMapper<Course> {
|
||||
|
||||
int updateDelete(@Param("id") Long id);
|
||||
|
||||
IPage<Map<String, Object>> selectCourse(Page<Map<String, Object>> pages, @Param("classifyId") Long classifyId,
|
||||
@Param("title") String title,@Param("isRecommend") Integer isRecommend,
|
||||
@Param("status") Integer status,@Param("bannerId") Long bannerId,
|
||||
@Param("sort") Integer sort,@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime,@Param("userId") Long userId,
|
||||
@Param("isPrice") Integer isPrice,@Param("over") Integer over,
|
||||
@Param("wxCourse") Integer wxCourse,@Param("dyCourse") Integer dyCourse,
|
||||
@Param("wxShow") Integer wxShow,@Param("dyShow") Integer dyShow);
|
||||
List<Map<String, Object>> selectCourse(@Param("classifyId") Long classifyId,
|
||||
@Param("title") String title, @Param("isRecommend") Integer isRecommend,
|
||||
@Param("status") Integer status, @Param("bannerId") Long bannerId,
|
||||
@Param("sort") Integer sort, @Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime, @Param("userId") Long userId,
|
||||
@Param("isPrice") Integer isPrice, @Param("over") Integer over,
|
||||
@Param("wxCourse") Integer wxCourse, @Param("dyCourse") Integer dyCourse,
|
||||
@Param("wxShow") Integer wxShow, @Param("dyShow") Integer dyShow);
|
||||
|
||||
IPage<Map<String, Object>> selectCourseAdmin(Page<Map<String, Object>> pages, @Param("classifyId") Long classifyId,
|
||||
List<Map<String, Object>> selectCourseAdmin(@Param("classifyId") Long classifyId,
|
||||
@Param("title") String title,@Param("isRecommend") Integer isRecommend,
|
||||
@Param("status") Integer status,@Param("bannerId") Long bannerId,
|
||||
@Param("sort") Integer sort,@Param("startTime") String startTime,
|
||||
@@ -34,10 +33,9 @@ public interface CourseDao extends BaseMapper<Course> {
|
||||
|
||||
/**
|
||||
* 根据title 模糊查询短剧
|
||||
* @param pages
|
||||
* @param title
|
||||
* @return
|
||||
*/
|
||||
IPage<Map<String, Object>> selectCourseTitle(Page<Map<String, Object>> pages, @Param("title")String title);
|
||||
List<Map<String, Object>> selectCourseTitle(@Param("title")String title);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.sqx.modules.course.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.course.entity.CourseDetails;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -14,12 +12,12 @@ public interface CourseDetailsDao extends BaseMapper<CourseDetails> {
|
||||
|
||||
List<CourseDetails> findByCourseId(@Param("id") Long id,@Param("userId") Long userId);
|
||||
|
||||
IPage<CourseDetails> selectCoursePageByCourseId(Page<CourseDetails> page, @Param("id") Long id,@Param("good") Integer good);
|
||||
List<CourseDetails> selectCoursePageByCourseId(@Param("id") Long id,@Param("good") Integer good);
|
||||
|
||||
List<CourseDetails> findByCourseIdNotUrl(@Param("id") Long id,@Param("userId") Long userId);
|
||||
|
||||
int deleteCourseDetails(String[] ids);
|
||||
|
||||
IPage<CourseDetails> selectCourseDetailsList(Page<CourseDetails> page,String randomNum,Integer wxShow,Integer dyShow);
|
||||
List<CourseDetails> selectCourseDetailsList(String randomNum,Integer wxShow,Integer dyShow);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package com.sqx.modules.course.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.course.entity.Course;
|
||||
import com.sqx.modules.course.entity.CourseUser;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -12,12 +9,6 @@ import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface CourseUserDao extends BaseMapper<CourseUser> {
|
||||
|
||||
// IPage<Course> selectLatelyCourse(Page<Course> pages, @Param("userId") Long userId);
|
||||
|
||||
//子查询不能用
|
||||
// IPage<Course> selectCourseByCourseUser(Page<Course> pages, @Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 查询用户是否订购
|
||||
*
|
||||
|
||||
@@ -9,9 +9,5 @@ public interface CourseUserService extends IService<CourseUser> {
|
||||
|
||||
void updateTime(Long courseId);
|
||||
|
||||
// Result selectCourseUser(Integer page, Integer limit, Long userId);
|
||||
|
||||
// Result selectLatelyCourse(Integer page, Integer limit, Long userId);
|
||||
|
||||
Result insertCourseUser(CourseUser courseUser);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package com.sqx.modules.course.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.common.utils.Result;
|
||||
import com.sqx.modules.course.dao.CourseClassificationDao;
|
||||
@@ -37,11 +38,16 @@ public class CourseClassificationServiceImpl extends ServiceImpl<CourseClassific
|
||||
|
||||
@Override
|
||||
public Result selectCourseClassification(Integer page, Integer limit, String classificationName) {
|
||||
if(page==null || limit==null){
|
||||
return Result.success().put("data", new PageUtils(baseMapper.selectCourseClassificationList( classificationName)));
|
||||
if (page == null) {
|
||||
page = 1;
|
||||
}
|
||||
Page<Map<String, Object>> pages = new Page<>(page, limit);
|
||||
return Result.success().put("data", new PageUtils(baseMapper.selectCourseClassificationPage(pages, classificationName)));
|
||||
if (limit == null) {
|
||||
limit = 10;
|
||||
}
|
||||
PageHelper.startPage(page, limit);
|
||||
List<Map<String, Object>> list = baseMapper.selectCourseClassificationList(classificationName);
|
||||
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(list);
|
||||
return Result.success().put("data", PageUtils.page(pageInfo));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package com.sqx.modules.course.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.DateUtils;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.course.dao.CourseClassificationDao;
|
||||
import com.sqx.modules.course.dao.CourseCollectDao;
|
||||
@@ -100,15 +101,16 @@ public class CourseCollectServiceImpl extends ServiceImpl<CourseCollectDao, Cour
|
||||
@Override
|
||||
@CachePut(value = "app:courseCollect", key = "#userId")
|
||||
public Result selectByUserId(Integer page, Integer limit, Long userId,Integer classify) {
|
||||
Page<Course> pages=new Page<>(page,limit);
|
||||
IPage<Course> courseIPage = baseMapper.selectCourseByCollect(pages, userId,classify);
|
||||
List<Course> courses = courseIPage.getRecords();
|
||||
PageHelper.startPage(page,limit);
|
||||
List<Course> courseList = baseMapper.selectCourseByCollect( userId,classify);
|
||||
PageInfo<Course> pageInfo = new PageInfo<>(courseList);
|
||||
List<Course> courses = pageInfo.getList();
|
||||
if (courses != null && courses.size() > 0) {
|
||||
for (Course course : courses) {
|
||||
course.setCourseClassification(courseClassificationDao.selectById(course.getClassifyId()));
|
||||
}
|
||||
}
|
||||
return Result.success().put("data",courseIPage);
|
||||
return Result.success().put("data", PageUtils.page(pageInfo, true));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package com.sqx.modules.course.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.common.utils.Result;
|
||||
import com.sqx.modules.course.dao.CourseCommentDao;
|
||||
@@ -15,6 +16,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
@@ -62,9 +64,11 @@ public class CourseCommentServiceImpl extends ServiceImpl<CourseCommentDao, Cour
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result selectCourseComment(Integer page, Integer limit, Long courseId,Long userId) {
|
||||
Page<CourseComment> courseCommentPage = new Page<>(page, limit);
|
||||
return Result.success().put("data", new PageUtils(baseMapper.selectCourseComment(courseCommentPage, courseId,userId)));
|
||||
public Result selectCourseComment(Integer page, Integer limit, Long courseId, Long userId) {
|
||||
PageHelper.startPage(page, limit);
|
||||
List<CourseComment> commentList = baseMapper.selectCourseComment(courseId, userId);
|
||||
PageInfo<CourseComment> pageInfo = new PageInfo<>(commentList);
|
||||
return Result.success().put("data", PageUtils.page(pageInfo));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -77,8 +81,10 @@ public class CourseCommentServiceImpl extends ServiceImpl<CourseCommentDao, Cour
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result selectCourseCommentUser(Integer page, Integer limit,Long userId) {
|
||||
Page<Map<String,Object>> pages=new Page(page,limit);
|
||||
return Result.success().put("data",new PageUtils(baseMapper.selectCourseCommentByUserId(pages,userId)));
|
||||
public Result selectCourseCommentUser(Integer page, Integer limit, Long userId) {
|
||||
PageHelper.startPage(page, limit);
|
||||
List<Map<String, Object>> list = baseMapper.selectCourseCommentByUserId(userId);
|
||||
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(list);
|
||||
return Result.success().put("data", PageUtils.page(pageInfo));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,11 +5,11 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
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.ApiAccessLimitUtil;
|
||||
import com.sqx.common.utils.DateUtils;
|
||||
@@ -246,6 +246,7 @@ public class CourseDetailsServiceImpl extends ServiceImpl<CourseDetailsDao, Cour
|
||||
|
||||
@Override
|
||||
public Result selectCourseDetailsList(Integer page, Integer limit, String token, String randomNum, Integer wxShow, Integer dyShow) {
|
||||
PageHelper.startPage(page, limit);
|
||||
Long userId = null;
|
||||
if (StringUtils.isNotEmpty(token)) {
|
||||
Claims claims = jwtUtils.getClaimByToken(token);
|
||||
@@ -256,10 +257,11 @@ public class CourseDetailsServiceImpl extends ServiceImpl<CourseDetailsDao, Cour
|
||||
if(!Validator.isNumber(randomNum)){
|
||||
throw new SqxException("随机码必须是数字");
|
||||
};
|
||||
IPage<CourseDetails> courseDetailsIPage = baseMapper.selectCourseDetailsList(new Page<>(page, limit), randomNum, wxShow, dyShow);
|
||||
List<CourseDetails> list = baseMapper.selectCourseDetailsList(randomNum, wxShow, dyShow);
|
||||
PageInfo<CourseDetails> pageInfo = new PageInfo<>(list);
|
||||
|
||||
if (userId != null) {
|
||||
List<CourseDetails> records = courseDetailsIPage.getRecords();
|
||||
List<CourseDetails> records = pageInfo.getList();
|
||||
for (CourseDetails courseDetails : records) {
|
||||
courseDetails.setIsCollect(courseCollectDao.selectCount(new QueryWrapper<CourseCollect>()
|
||||
.eq("user_id", userId).eq("course_details_id", courseDetails.getCourseDetailsId()).eq("classify", 1)));
|
||||
@@ -270,7 +272,7 @@ public class CourseDetailsServiceImpl extends ServiceImpl<CourseDetailsDao, Cour
|
||||
courseDetails.setCourseDetailsCount(baseMapper.selectCount(new QueryWrapper<CourseDetails>().eq("course_id", courseDetails.getCourseId())));
|
||||
}
|
||||
}
|
||||
return Result.success().put("data", new PageUtils(courseDetailsIPage));
|
||||
return Result.success().put("data", PageUtils.page(pageInfo));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,9 +16,15 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
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.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||
import com.sqx.common.utils.*;
|
||||
import com.sqx.modules.app.entity.InviteAchievement;
|
||||
import com.sqx.common.utils.DateUtils;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.RedisUtils;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.app.service.InviteAchievementService;
|
||||
import com.sqx.modules.app.utils.JwtUtils;
|
||||
import com.sqx.modules.common.service.CommonInfoService;
|
||||
@@ -179,30 +185,36 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, Course> implements
|
||||
Map<String, Object> data = JSONUtil.toBean(cache, Map.class);
|
||||
return Result.success().put("data", data);
|
||||
}
|
||||
|
||||
PageHelper.startPage(page, limit);
|
||||
if (admin == null) {
|
||||
IPage<Map<String, Object>> mapIPage = baseMapper.selectCourse(pages, classifyId, title, isRecommend, status, bannerId,
|
||||
List<Map<String, Object>> map = baseMapper.selectCourse(classifyId, title, isRecommend, status, bannerId,
|
||||
sort, startTime, endTime, userId, isPrice, over, wxCourse, dyCourse, wxShow, dyShow);
|
||||
List<Map<String, Object>> records = mapIPage.getRecords();
|
||||
for (Map<String, Object> map : records) {
|
||||
map.put("courseDetailsId", null);
|
||||
map.put("courseDetailsName", "");
|
||||
map.put("dyEpisodeId", "");
|
||||
map.put("wxCourseDetailsId", "");
|
||||
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(map);
|
||||
List<Map<String, Object>> records = pageInfo.getList();
|
||||
for (Map<String, Object> m : records) {
|
||||
m.put("courseDetailsId", null);
|
||||
m.put("courseDetailsName", "");
|
||||
m.put("dyEpisodeId", "");
|
||||
m.put("wxCourseDetailsId", "");
|
||||
}
|
||||
setCache(cacheKey, JSONUtil.toJsonStr(new PageUtils(mapIPage)));
|
||||
return Result.success().put("data", new PageUtils(mapIPage));
|
||||
PageUtils pageUtils = PageUtils.page(pageInfo);
|
||||
setCache(cacheKey, JSONUtil.toJsonStr(pageUtils));
|
||||
return Result.success().put("data", pageUtils);
|
||||
}
|
||||
IPage<Map<String, Object>> mapIPage = baseMapper.selectCourseAdmin(pages, classifyId, title, isRecommend, status, bannerId,
|
||||
List<Map<String, Object>> list = baseMapper.selectCourseAdmin(classifyId, title, isRecommend, status, bannerId,
|
||||
sort, startTime, endTime, userId, isPrice, over, wxCourse, dyCourse, wxShow, dyShow);
|
||||
List<Map<String, Object>> records = mapIPage.getRecords();
|
||||
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(list);
|
||||
List<Map<String, Object>> records = pageInfo.getList();
|
||||
for (Map<String, Object> map : records) {
|
||||
map.put("courseDetailsId", null);
|
||||
map.put("courseDetailsName", "");
|
||||
map.put("dyEpisodeId", "");
|
||||
map.put("wxCourseDetailsId", "");
|
||||
}
|
||||
setCache(cacheKey, JSONUtil.toJsonStr(new PageUtils(mapIPage)));
|
||||
return Result.success().put("data", new PageUtils(mapIPage));
|
||||
PageUtils pageUtils = PageUtils.page(pageInfo);
|
||||
setCache(cacheKey, JSONUtil.toJsonStr(pageUtils));
|
||||
return Result.success().put("data", pageUtils);
|
||||
}
|
||||
|
||||
/*@Override
|
||||
@@ -235,8 +247,10 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, Course> implements
|
||||
|
||||
@Override
|
||||
public Result selectCourseById(Integer page, Integer limit, Long id, Integer good) {
|
||||
Page<CourseDetails> pages = new Page<>(page, limit);
|
||||
return Result.success().put("data", new PageUtils(courseDetailsDao.selectCoursePageByCourseId(pages, id, good)));
|
||||
PageHelper.startPage(page, limit);
|
||||
List<CourseDetails> details = courseDetailsDao.selectCoursePageByCourseId(id, good);
|
||||
PageInfo<CourseDetails> pageInfo = new PageInfo<>(details);
|
||||
return Result.success().put("data", PageUtils.page(pageInfo));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -247,15 +261,14 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, Course> implements
|
||||
//记录或更新搜索内容
|
||||
appSearchService.insetAppSearch(title, userId);
|
||||
}
|
||||
//拼接模糊查询
|
||||
String title1 = null;
|
||||
if (StringUtils.isNotBlank(title)) {
|
||||
title1 = "%" + title + "%";
|
||||
return Result.success().put("data", new PageUtils(baseMapper.selectCourseTitle(pages, title1)));
|
||||
} else {
|
||||
if (StringUtils.isEmpty(title)) {
|
||||
return Result.error("请输入要搜索的内容!");
|
||||
}
|
||||
|
||||
PageHelper.startPage(page, limit);
|
||||
List<Map<String, Object>> list = baseMapper.selectCourseTitle(title);
|
||||
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(list);
|
||||
return Result.success().put("data", PageUtils.page(pageInfo));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,17 +2,12 @@ package com.sqx.modules.course.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.course.dao.CourseClassificationDao;
|
||||
import com.sqx.modules.course.dao.CourseUserDao;
|
||||
import com.sqx.modules.course.entity.Course;
|
||||
import com.sqx.modules.course.entity.CourseUser;
|
||||
import com.sqx.modules.course.service.CourseUserService;
|
||||
import com.sqx.modules.orders.entity.Orders;
|
||||
import com.sqx.modules.orders.service.OrdersService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -20,7 +15,6 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
@@ -42,41 +36,6 @@ public class CourseUserServiceImpl extends ServiceImpl<CourseUserDao, CourseUser
|
||||
baseMapper.update(bean, updateWrapper);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public Result selectCourseUser(Integer page, Integer limit, Long userId) {
|
||||
// Page<Course> courseUserPage = new Page<>(page, limit);
|
||||
// IPage<Course> iPage = baseMapper.selectCourseByCourseUser(courseUserPage, userId);
|
||||
//
|
||||
// List<Course> courses = iPage.getRecords();
|
||||
// if (courses != null && courses.size() > 0) {
|
||||
// for (Course course : courses) {
|
||||
// Orders orders = ordersService.selectOrdersByCourseIdAndUserId(userId, course.getCourseId());
|
||||
// if(orders!=null){
|
||||
// course.setOrders(orders);
|
||||
// }
|
||||
// course.setCourseClassification(courseClassificationDao.selectById(course.getClassifyId()));
|
||||
// }
|
||||
// }
|
||||
// return Result.success().put("data", new PageUtils(iPage));
|
||||
// }
|
||||
|
||||
// @Override
|
||||
// public Result selectLatelyCourse(Integer page, Integer limit, Long userId) {
|
||||
// Page<Course> pages = new Page<>(page, limit);
|
||||
// IPage<Course> iPage = baseMapper.selectLatelyCourse(pages, userId);
|
||||
// List<Course> courses = iPage.getRecords();
|
||||
// if (courses != null && courses.size() > 0) {
|
||||
// for (Course course : courses) {
|
||||
// Orders orders = ordersService.selectOrdersByCourseIdAndUserId(userId, course.getCourseId());
|
||||
// if(orders!=null){
|
||||
// course.setOrders(orders);
|
||||
// }
|
||||
// course.setCourseClassification(courseClassificationDao.selectById(course.getClassifyId()));
|
||||
// }
|
||||
// }
|
||||
// return Result.success().put("data", new PageUtils(iPage));
|
||||
// }
|
||||
|
||||
|
||||
@Override
|
||||
public Result insertCourseUser(CourseUser courseUser) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.sqx.modules.helpCenter.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sqx.common.utils.DateUtils;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Result;
|
||||
@@ -32,7 +32,7 @@ public class HelpWordController {
|
||||
|
||||
@PostMapping("/insertHelpClassify")
|
||||
@ApiOperation("添加帮助分类")
|
||||
public Result insertHelpClassify(@RequestBody HelpClassify helpClassify){
|
||||
public Result insertHelpClassify(@RequestBody HelpClassify helpClassify) {
|
||||
helpClassify.setCreateTime(DateUtils.format(new Date()));
|
||||
helpClassifyService.save(helpClassify);
|
||||
return Result.success();
|
||||
@@ -40,14 +40,14 @@ public class HelpWordController {
|
||||
|
||||
@PostMapping("/updateHelpClassify")
|
||||
@ApiOperation("修改帮助分类")
|
||||
public Result updateHelpClassify(@RequestBody HelpClassify helpClassify){
|
||||
public Result updateHelpClassify(@RequestBody HelpClassify helpClassify) {
|
||||
helpClassifyService.updateById(helpClassify);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@PostMapping("/deleteHelpClassify")
|
||||
@ApiOperation("删除帮助分类")
|
||||
public Result deleteHelpClassify(Long helpClassifyId){
|
||||
public Result deleteHelpClassify(Long helpClassifyId) {
|
||||
helpClassifyService.removeById(helpClassifyId);
|
||||
return Result.success();
|
||||
}
|
||||
@@ -55,27 +55,28 @@ public class HelpWordController {
|
||||
|
||||
@GetMapping("/selectHelpClassifyList")
|
||||
@ApiOperation("查询帮助分类")
|
||||
public Result selectHelpClassifyList(Integer page,Integer limit,Long parentId,Integer types,String helpClassifyName){
|
||||
if(page==null || limit==null){
|
||||
List<HelpClassify> page1 = helpClassifyService.list(
|
||||
new QueryWrapper<HelpClassify>()
|
||||
.eq(types!=null,"types",types)
|
||||
.eq(StringUtils.isNotBlank(helpClassifyName), "help_classify_name", helpClassifyName)
|
||||
.eq(parentId != null, "parent_id", parentId).orderByAsc("sort"));
|
||||
return Result.success().put("data",page1);
|
||||
public Result selectHelpClassifyList(Integer page, Integer limit, Long parentId, Integer types, String helpClassifyName) {
|
||||
if (page == null) {
|
||||
page = 1;
|
||||
}
|
||||
IPage<HelpClassify> page1 = helpClassifyService.page(new Page<>(page, limit),
|
||||
new QueryWrapper<HelpClassify>()
|
||||
.eq(types!=null,"types",types)
|
||||
.eq(StringUtils.isNotBlank(helpClassifyName), "help_classify_name", helpClassifyName)
|
||||
.eq(parentId != null, "parent_id", parentId).orderByAsc("sort"));
|
||||
return Result.success().put("data",new PageUtils(page1));
|
||||
if (limit == null) {
|
||||
limit = 10;
|
||||
}
|
||||
|
||||
PageHelper.startPage(page, limit);
|
||||
List<HelpClassify> list = helpClassifyService.list(new QueryWrapper<HelpClassify>()
|
||||
.eq(types != null, "types", types)
|
||||
.eq(StringUtils.isNotBlank(helpClassifyName), "help_classify_name", helpClassifyName)
|
||||
.eq(parentId != null, "parent_id", parentId).orderByAsc("sort"));
|
||||
|
||||
PageInfo<HelpClassify> pageInfo = new PageInfo<>(list);
|
||||
return Result.success().put("data", PageUtils.page(pageInfo));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/insertHelpWord")
|
||||
@ApiOperation("添加帮助文档")
|
||||
public Result insertHelpWord(@RequestBody HelpWord helpWord){
|
||||
public Result insertHelpWord(@RequestBody HelpWord helpWord) {
|
||||
helpWord.setCreateTime(DateUtils.format(new Date()));
|
||||
helpWordService.save(helpWord);
|
||||
return Result.success();
|
||||
@@ -83,14 +84,14 @@ public class HelpWordController {
|
||||
|
||||
@PostMapping("/updateHelpWord")
|
||||
@ApiOperation("修改帮助文档")
|
||||
public Result updateHelpWord(@RequestBody HelpWord helpWord){
|
||||
public Result updateHelpWord(@RequestBody HelpWord helpWord) {
|
||||
helpWordService.updateById(helpWord);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@PostMapping("/deleteHelpWord")
|
||||
@ApiOperation("删除帮助文档")
|
||||
public Result deleteHelpWord(Long helpWordId){
|
||||
public Result deleteHelpWord(Long helpWordId) {
|
||||
helpWordService.removeById(helpWordId);
|
||||
return Result.success();
|
||||
}
|
||||
@@ -98,15 +99,16 @@ public class HelpWordController {
|
||||
|
||||
@GetMapping("/selectHelpWordList")
|
||||
@ApiOperation("查询帮助文档")
|
||||
public Result selectHelpWordList(Integer page,Integer limit,Long helpClassifyId,String helpWordTitle){
|
||||
IPage<HelpWord> page1 = helpWordService.page(new Page<>(page, limit), new QueryWrapper<HelpWord>()
|
||||
public Result selectHelpWordList(Integer page, Integer limit, Long helpClassifyId, String helpWordTitle) {
|
||||
PageHelper.startPage(page, limit);
|
||||
|
||||
List<HelpWord> page1 = helpWordService.list(new QueryWrapper<HelpWord>()
|
||||
.eq(helpClassifyId != null, "help_classify_id", helpClassifyId)
|
||||
.eq(StringUtils.isNotBlank(helpWordTitle), "help_word_title", helpWordTitle).orderByAsc("sort"));
|
||||
return Result.success().put("data",new PageUtils(page1));
|
||||
|
||||
PageInfo<HelpWord> pageInfo = new PageInfo<>(page1);
|
||||
return Result.success().put("data", PageUtils.page(pageInfo));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package com.sqx.modules.integral.service.Impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.common.utils.Result;
|
||||
import com.sqx.modules.app.entity.UserMoneyDetails;
|
||||
import com.sqx.modules.app.service.UserMoneyDetailsService;
|
||||
@@ -40,11 +41,12 @@ public class UserIntegralDetailsServiceImpl extends ServiceImpl<UserIntegralDeta
|
||||
private UserMoneyDetailsService userMoneyDetailsService;
|
||||
|
||||
@Override
|
||||
public IPage selectUserIntegralDetailsByUserId(int page, int limit, Long userId) {
|
||||
|
||||
IPage<UserIntegralDetails> page1 = userIntegralDetailsDao.selectPage(new Page<>(page, limit), new QueryWrapper<UserIntegralDetails>().eq(userId != null, "user_id", userId).orderByDesc("create_time"));
|
||||
|
||||
return page1;
|
||||
public PageUtils selectUserIntegralDetailsByUserId(int page, int limit, Long userId) {
|
||||
PageHelper.startPage(page,limit);
|
||||
return PageUtils.page(new PageInfo<>(userIntegralDetailsDao.selectList(
|
||||
new QueryWrapper<UserIntegralDetails>()
|
||||
.eq(userId != null, "user_id", userId)
|
||||
.orderByDesc("create_time"))),true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package com.sqx.modules.integral.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.integral.entity.UserIntegralDetails;
|
||||
|
||||
public interface UserIntegralDetailsService extends IService<UserIntegralDetails> {
|
||||
|
||||
IPage selectUserIntegralDetailsByUserId(int page, int limit, Long userId);
|
||||
PageUtils selectUserIntegralDetailsByUserId(int page, int limit, Long userId);
|
||||
|
||||
Result signIn(Long userId);
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.sqx.modules.invite.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.invite.entity.Invite;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -18,7 +16,7 @@ import java.util.Map;
|
||||
@Mapper
|
||||
public interface InviteDao extends BaseMapper<Invite> {
|
||||
|
||||
IPage<Invite> selectInviteList(Page<Map<String,Object>> page, @Param("state") Integer state, @Param("userId") Long userId);
|
||||
List<Invite> selectInviteList(@Param("state") Integer state, @Param("userId") Long userId);
|
||||
|
||||
Integer selectInviteCount(@Param("state") Integer state, @Param("userId") Long userId);
|
||||
Integer selectInviteCount2(@Param("code") String code);
|
||||
@@ -28,8 +26,7 @@ public interface InviteDao extends BaseMapper<Invite> {
|
||||
|
||||
Double selectInviteSum(@Param("state") Integer state, @Param("userId") Long userId);
|
||||
|
||||
// IPage<Map<String,Object>> selectInviteUser(Page<Map<String,Object>> page, @Param("userId") Long userId,@Param("state") Integer state,@Param("userType") Integer userType);
|
||||
IPage<Map<String,Object>> selectInviteUser(Page<Map<String,Object>> page,@Param("code") String code);
|
||||
List<Map<String,Object>> selectInviteUser(@Param("code") String code);
|
||||
|
||||
Invite selectInviteByUser(@Param("userId")Long userId,@Param("inviteeUserId") Long inviteeUserId,@Param("userType") Integer userType);
|
||||
|
||||
@@ -41,7 +38,7 @@ public interface InviteDao extends BaseMapper<Invite> {
|
||||
|
||||
Double sumInviteMoney(@Param("time")String time,@Param("flag")Integer flag);
|
||||
|
||||
IPage<Map<String,Object>> inviteAnalysis(Page<Map<String,Object>> page,@Param("time")String time,@Param("flag")Integer flag);
|
||||
List<Map<String,Object>> inviteAnalysis(@Param("time")String time,@Param("flag")Integer flag);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
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.utils.DateUtils;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.modules.app.entity.UserEntity;
|
||||
@@ -61,19 +63,20 @@ public class InviteServiceImpl extends ServiceImpl<InviteDao, Invite> implements
|
||||
|
||||
@Override
|
||||
public PageUtils selectInviteList(int page, int limit, Integer state, Long userId) {
|
||||
Page<Map<String, Object>> pages = new Page<>(page, limit);
|
||||
PageHelper.startPage(page, limit);
|
||||
if (state == null || state == -1) {
|
||||
state = null;
|
||||
}
|
||||
return new PageUtils(inviteDao.selectInviteList(pages, state, userId));
|
||||
List<Invite> inviteList = inviteDao.selectInviteList(state, userId);
|
||||
return PageUtils.page(new PageInfo<>(inviteList));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public PageUtils selectInviteUser(int page, int limit, Long userId, Integer state, Integer userType) {
|
||||
Page<Map<String, Object>> pages = new Page<>(page, limit);
|
||||
UserEntity userEntity = userService.queryByUserId(userId);
|
||||
return new PageUtils(inviteDao.selectInviteUser(pages, userEntity.getInvitationCode()));
|
||||
PageHelper.startPage(page, limit);
|
||||
return PageUtils.page(new PageInfo<>(inviteDao.selectInviteUser(userEntity.getInvitationCode())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -98,8 +101,8 @@ public class InviteServiceImpl extends ServiceImpl<InviteDao, Invite> implements
|
||||
|
||||
@Override
|
||||
public PageUtils inviteAnalysis(int page, int limit, String time, Integer flag) {
|
||||
Page<Map<String, Object>> pages = new Page<>(page, limit);
|
||||
return new PageUtils(inviteDao.inviteAnalysis(pages, time, flag));
|
||||
PageHelper.startPage(page, limit);
|
||||
return PageUtils.page(new PageInfo<>(inviteDao.inviteAnalysis(time, flag)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package com.sqx.modules.job.service.impl;
|
||||
|
||||
import cn.hutool.core.map.MapProxy;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sqx.common.utils.Constant;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Query;
|
||||
import com.sqx.modules.job.dao.ScheduleJobLogDao;
|
||||
import com.sqx.modules.job.entity.ScheduleJobLogEntity;
|
||||
import com.sqx.modules.job.service.ScheduleJobLogService;
|
||||
@@ -20,12 +22,11 @@ public class ScheduleJobLogServiceImpl extends ServiceImpl<ScheduleJobLogDao, Sc
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
String jobId = (String)params.get("jobId");
|
||||
|
||||
IPage<ScheduleJobLogEntity> page = this.page(
|
||||
new Query<ScheduleJobLogEntity>().getPage(params),
|
||||
new QueryWrapper<ScheduleJobLogEntity>().like(StringUtils.isNotBlank(jobId),"job_id", jobId).orderByDesc("create_time")
|
||||
);
|
||||
|
||||
return new PageUtils(page);
|
||||
MapProxy proxy = MapProxy.create(params);
|
||||
long pageNum = proxy.getLong(Constant.PAGE, 1L);
|
||||
long pageSize = proxy.getLong(Constant.LIMIT, 10L);
|
||||
PageHelper.startPage((int) pageNum, (int) pageSize);
|
||||
return PageUtils.page(new PageInfo<>(this.list(new QueryWrapper<ScheduleJobLogEntity>().like(StringUtils.isNotBlank(jobId),"job_id", jobId).orderByDesc("create_time"))));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package com.sqx.modules.job.service.impl;
|
||||
|
||||
import cn.hutool.core.map.MapProxy;
|
||||
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.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sqx.common.utils.Constant;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Query;
|
||||
import com.sqx.modules.job.dao.ScheduleJobDao;
|
||||
import com.sqx.modules.job.dto.RunJobDTO;
|
||||
import com.sqx.modules.job.entity.ScheduleJobEntity;
|
||||
import com.sqx.modules.job.service.ScheduleJobService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@@ -37,12 +37,11 @@ public class ScheduleJobServiceImpl extends ServiceImpl<ScheduleJobDao, Schedule
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
String beanName = (String)params.get("beanName");
|
||||
|
||||
IPage<ScheduleJobEntity> page = this.page(
|
||||
new Query<ScheduleJobEntity>().getPage(params),
|
||||
new QueryWrapper <ScheduleJobEntity>().like(StringUtils.isNotBlank(beanName),"bean_name", beanName)
|
||||
);
|
||||
|
||||
return new PageUtils(page);
|
||||
MapProxy proxy = MapProxy.create(params);
|
||||
long pageNum = proxy.getLong(Constant.PAGE, 1L);
|
||||
long pageSize = proxy.getLong(Constant.LIMIT, 10L);
|
||||
PageHelper.startPage((int) pageNum, (int) pageSize);
|
||||
return PageUtils.page(new PageInfo<>(this.list(new QueryWrapper <ScheduleJobEntity>().like(StringUtils.isNotBlank(beanName),"bean_name", beanName))));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.sqx.modules.message.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.message.entity.ActivityMessageInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author fang
|
||||
* @date 2020/7/9
|
||||
@@ -14,11 +14,11 @@ import org.apache.ibatis.annotations.Param;
|
||||
@Mapper
|
||||
public interface ActivityMessageInfoDao extends BaseMapper<ActivityMessageInfo> {
|
||||
|
||||
IPage<ActivityMessageInfo> find(Page<ActivityMessageInfo> page,@Param("state") String state);
|
||||
List<ActivityMessageInfo> find(@Param("state") String state);
|
||||
|
||||
IPage<ActivityMessageInfo> findType(Page<ActivityMessageInfo> page,@Param("type") Integer type);
|
||||
List<ActivityMessageInfo> findType(@Param("type") Integer type);
|
||||
|
||||
IPage<ActivityMessageInfo> findTypeByUserId(Page<ActivityMessageInfo> page,@Param("type")String type,@Param("userId") String userId);
|
||||
List<ActivityMessageInfo> findTypeByUserId(@Param("type")String type,@Param("userId") String userId);
|
||||
|
||||
Integer updateState(@Param("state") String state, @Param("id") Long id);
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.sqx.modules.message.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.message.dao.ActivityMessageInfoDao;
|
||||
import com.sqx.modules.message.entity.ActivityMessageInfo;
|
||||
@@ -54,8 +56,8 @@ public class ActivityMessageServiceImpl extends ServiceImpl<ActivityMessageInfoD
|
||||
|
||||
@Override
|
||||
public PageUtils find(String state, int page,int limit) {
|
||||
Page<ActivityMessageInfo> pages = new Page<>(page, limit);
|
||||
return new PageUtils(activityMessageInfoDao.find(pages,state));
|
||||
PageHelper.startPage(page, limit);
|
||||
return PageUtils.page(new PageInfo<>(activityMessageInfoDao.find(state)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -67,8 +69,8 @@ public class ActivityMessageServiceImpl extends ServiceImpl<ActivityMessageInfoD
|
||||
|
||||
@Override
|
||||
public PageUtils findType(Integer type, int page,int limit) {
|
||||
Page<ActivityMessageInfo> pages = new Page<>(page, limit);
|
||||
return new PageUtils(activityMessageInfoDao.findType(pages,type));
|
||||
PageHelper.startPage(page, limit);
|
||||
return PageUtils.page(new PageInfo<>(activityMessageInfoDao.findType(type)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -85,8 +87,8 @@ public class ActivityMessageServiceImpl extends ServiceImpl<ActivityMessageInfoD
|
||||
|
||||
@Override
|
||||
public PageUtils findTypeByUserId( String type,String userId, int page,int limit) {
|
||||
Page<ActivityMessageInfo> pages = new Page<>(page, limit);
|
||||
return new PageUtils(activityMessageInfoDao.findTypeByUserId(pages,type,userId));
|
||||
PageHelper.startPage(page, limit);
|
||||
return PageUtils.page(new PageInfo<>(activityMessageInfoDao.findTypeByUserId(type,userId)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package com.sqx.modules.message.service.impl;
|
||||
|
||||
import cn.hutool.core.map.MapProxy;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sqx.common.utils.Constant;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Query;
|
||||
import com.sqx.modules.app.service.UserService;
|
||||
import com.sqx.modules.message.dao.MessageInfoDao;
|
||||
import com.sqx.modules.message.entity.MessageInfo;
|
||||
@@ -38,20 +40,22 @@ public class MessageServiceImpl extends ServiceImpl<MessageInfoDao, MessageInfo>
|
||||
Long userId = (Long)params.get("userId");
|
||||
Integer state = (Integer)params.get("state");
|
||||
Integer type = (Integer)params.get("type");
|
||||
IPage<MessageInfo> page = this.page(
|
||||
new Query<MessageInfo>().getPage(params),
|
||||
new QueryWrapper<MessageInfo>()
|
||||
.eq(userId!=null,"user_id", userId)
|
||||
.eq(state!=null,"state", state)
|
||||
.eq(type!=null,"type", type).orderByDesc("create_at")
|
||||
);
|
||||
List<MessageInfo> records = page.getRecords();
|
||||
MapProxy proxy = MapProxy.create(params);
|
||||
long pageNum = proxy.getLong(Constant.PAGE, 1L);
|
||||
long pageSize = proxy.getLong(Constant.LIMIT, 10L);
|
||||
PageHelper.startPage((int) pageNum, (int) pageSize);
|
||||
PageUtils page = PageUtils.page(new PageInfo<>(this.list(new QueryWrapper<MessageInfo>()
|
||||
.eq(userId != null, "user_id", userId)
|
||||
.eq(state != null, "state", state)
|
||||
.eq(type != null, "type", type).orderByDesc("create_at"))));
|
||||
|
||||
List<MessageInfo> records = (List<MessageInfo>) page.getList();
|
||||
for (MessageInfo messageInfo:records){
|
||||
if(messageInfo.getUserId()!=null){
|
||||
messageInfo.setUserEntity(userService.selectUserById(Long.parseLong(messageInfo.getUserId())));
|
||||
}
|
||||
}
|
||||
return new PageUtils(page);
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.sqx.modules.orders.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.orders.entity.Orders;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface OrdersDao extends BaseMapper<Orders> {
|
||||
|
||||
@@ -14,11 +14,11 @@ public interface OrdersDao extends BaseMapper<Orders> {
|
||||
|
||||
int insertOrders(Orders orders);
|
||||
|
||||
IPage<Orders> selectOrdersByOrdersNo(Page<Orders> pages, @Param("ordersNo") String ordersNo, @Param("status") Integer status,
|
||||
@Param("userId") Long userId, @Param("courseId") Long courseId, @Param("flag") Integer flag,
|
||||
@Param("time") String time, @Param("userName") String userName, @Param("ordersType") Integer ordersType,
|
||||
@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("sysUserId") Long sysUserId,
|
||||
@Param("qdCode") String qdCode, @Param("sysUserName") String sysUserName);
|
||||
List<Orders> selectOrdersByOrdersNo(@Param("ordersNo") String ordersNo, @Param("status") Integer status,
|
||||
@Param("userId") Long userId, @Param("courseId") Long courseId, @Param("flag") Integer flag,
|
||||
@Param("time") String time, @Param("userName") String userName, @Param("ordersType") Integer ordersType,
|
||||
@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("sysUserId") Long sysUserId,
|
||||
@Param("qdCode") String qdCode, @Param("sysUserName") String sysUserName);
|
||||
|
||||
int deleteOrders(String[] ids);
|
||||
|
||||
@@ -26,7 +26,7 @@ public interface OrdersDao extends BaseMapper<Orders> {
|
||||
|
||||
Orders selectOrdersByCourseIdAndUserId(Long userId, Long courseId);
|
||||
|
||||
IPage<Orders> selectOrdersMoneyList(Page<Orders> page, Integer flag, String time);
|
||||
List<Orders> selectOrdersMoneyList(Integer flag, String time);
|
||||
|
||||
Integer selectOrdersCount(Integer status, Integer ordersType, Integer flag, String time, Long sysUserId);
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.utils.DateUtils;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Result;
|
||||
@@ -657,28 +657,32 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
|
||||
public Result selectOrders(Integer page, Integer limit, String ordersNo, Integer status, Long userId, Long courseId,
|
||||
Integer flag, String time, String userName, Integer ordersType, String startTime, String endTime,
|
||||
Long sysUserId, String qdCode, String sysUserName) {
|
||||
Page<Orders> pages = new Page<>(page, limit);
|
||||
PageHelper.startPage(page, limit);
|
||||
|
||||
return Result.success().put("data", new PageUtils(baseMapper.selectOrdersByOrdersNo(pages, ordersNo, status, userId, courseId,
|
||||
flag, time, userName, ordersType, TimeCompleteUtils.completeStartTime(startTime), TimeCompleteUtils.completeEndTime(endTime), sysUserId, qdCode, sysUserName)));
|
||||
List<Orders> orders = baseMapper.selectOrdersByOrdersNo(ordersNo, status, userId, courseId,
|
||||
flag, time, userName, ordersType, TimeCompleteUtils.completeStartTime(startTime), TimeCompleteUtils.completeEndTime(endTime), sysUserId, qdCode, sysUserName);
|
||||
PageInfo<Orders> pageInfo = new PageInfo<>(orders);
|
||||
|
||||
return Result.success().put("data", PageUtils.page(pageInfo));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result selectOrderByUserId(Integer page, Integer limit, Long userId) {
|
||||
IPage<Orders> orderPage = new Page<>(page, limit);
|
||||
PageHelper.startPage(page, limit);
|
||||
QueryWrapper<Orders> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("user_id", userId);
|
||||
queryWrapper.eq("orders_type", 1);
|
||||
queryWrapper.eq("status", 1);
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
IPage<Orders> iPage = baseMapper.selectPage(orderPage, queryWrapper);
|
||||
List<Orders> bean = iPage.getRecords();
|
||||
List<Orders> list = baseMapper.selectList(queryWrapper);
|
||||
PageInfo<Orders> pageInfo = new PageInfo<>(list);
|
||||
List<Orders> bean = pageInfo.getList();
|
||||
if (bean != null && bean.size() > 0) {
|
||||
for (int i = 0; bean.size() > i; i++) {
|
||||
bean.get(i).setCourse(courseDao.selectById(bean.get(i).getCourseId()));
|
||||
}
|
||||
}
|
||||
return Result.success().put("data", iPage);
|
||||
return Result.success().put("data", PageUtils.page(pageInfo, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -711,7 +715,8 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
|
||||
|
||||
@Override
|
||||
public Result selectOrdersMoneyList(Integer page, Integer limit, Integer flag, String time) {
|
||||
return Result.success().put("data", baseMapper.selectOrdersMoneyList(new Page<>(page, limit), flag, time));
|
||||
PageHelper.startPage(page,limit);
|
||||
return Result.success().put("data", PageUtils.page(new PageInfo<>(baseMapper.selectOrdersMoneyList( flag, time)),true));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.sqx.modules.oss.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import cn.hutool.core.map.MapProxy;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sqx.common.utils.Constant;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Query;
|
||||
import com.sqx.modules.oss.dao.SysOssDao;
|
||||
import com.sqx.modules.oss.entity.SysOssEntity;
|
||||
import com.sqx.modules.oss.service.SysOssService;
|
||||
@@ -17,11 +19,11 @@ public class SysOssServiceImpl extends ServiceImpl<SysOssDao, SysOssEntity> impl
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
IPage<SysOssEntity> page = this.page(
|
||||
new Query<SysOssEntity>().getPage(params)
|
||||
);
|
||||
|
||||
return new PageUtils(page);
|
||||
MapProxy proxy = MapProxy.create(params);
|
||||
long pageNum = proxy.getLong(Constant.PAGE, 1L);
|
||||
long pageSize = proxy.getLong(Constant.LIMIT, 10L);
|
||||
PageHelper.startPage((int) pageNum, (int) pageSize);
|
||||
return PageUtils.page(new PageInfo<>(this.list()));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.sqx.modules.sdk.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.sdk.entity.SdkInfo;
|
||||
import com.sqx.modules.sdk.service.SdkInfoService;
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.sqx.modules.sdk.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.sdk.entity.SdkInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -20,7 +18,7 @@ import java.util.List;
|
||||
@Mapper
|
||||
public interface SdkInfoDao extends BaseMapper<SdkInfo> {
|
||||
|
||||
IPage<SdkInfo> getSdkPage(@Param("pages") Page<SdkInfo> pages, @Param("sdkInfo") SdkInfo sdkInfo);
|
||||
List<SdkInfo> getSdkPage(@Param("sdkInfo") SdkInfo sdkInfo);
|
||||
|
||||
|
||||
List<SdkInfo> getSdkList(@Param("sdkInfo") SdkInfo sdkInfo);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.sqx.modules.sdk.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.sdk.entity.SdkInfo;
|
||||
import com.sqx.modules.utils.excel.ExcelData;
|
||||
@@ -18,7 +18,7 @@ public interface SdkInfoService extends IService<SdkInfo> {
|
||||
|
||||
Result saveSdkInfo(Long typeId, Integer num,Long sysUserId);
|
||||
|
||||
IPage<SdkInfo> getSdkList(Integer page, Integer limit, SdkInfo sdkInfo);
|
||||
PageUtils getSdkList(Integer page, Integer limit, SdkInfo sdkInfo);
|
||||
|
||||
Result sdkExchange(Long userId, String sdkContent);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.sqx.modules.sdk.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.sdk.entity.SdkType;
|
||||
|
||||
@@ -17,5 +17,5 @@ public interface SdkTypeService extends IService<SdkType> {
|
||||
|
||||
Result saveSdkType(SdkType sdkType);
|
||||
|
||||
IPage<SdkType> getSdkTypeList(Integer page, Integer limit, SdkType sdkType);
|
||||
PageUtils getSdkTypeList(Integer page, Integer limit, SdkType sdkType);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package com.sqx.modules.sdk.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.DateUtils;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.app.entity.UserVip;
|
||||
import com.sqx.modules.app.service.UserService;
|
||||
@@ -65,15 +66,14 @@ public class SdkInfoServiceImpl extends ServiceImpl<SdkInfoDao, SdkInfo> impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<SdkInfo> getSdkList(Integer page, Integer limit, SdkInfo sdkInfo) {
|
||||
Page<SdkInfo> pages;
|
||||
if (page != null && limit != null) {
|
||||
pages = new Page<>(page, limit);
|
||||
} else {
|
||||
pages = new Page<>();
|
||||
pages.setSize(-1);
|
||||
public PageUtils getSdkList(Integer page, Integer limit, SdkInfo sdkInfo) {
|
||||
if (page == null || limit == null) {
|
||||
page = 1;
|
||||
limit = -1;
|
||||
}
|
||||
return baseMapper.getSdkPage(pages, sdkInfo);
|
||||
PageHelper.startPage(page, limit);
|
||||
List<SdkInfo> sdkList = baseMapper.getSdkList(sdkInfo);
|
||||
return PageUtils.page(new PageInfo<>(sdkList), true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package com.sqx.modules.sdk.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.DateUtils;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.sdk.dao.SdkTypeDao;
|
||||
import com.sqx.modules.sdk.entity.SdkType;
|
||||
@@ -39,15 +40,14 @@ public class SdkTypeServiceImpl extends ServiceImpl<SdkTypeDao, SdkType> impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<SdkType> getSdkTypeList(Integer page, Integer limit, SdkType sdkType) {
|
||||
Page<SdkType> pages;
|
||||
if (page != null && limit != null) {
|
||||
pages = new Page<>(page, limit);
|
||||
} else {
|
||||
pages = new Page<>();
|
||||
pages.setSize(-1);
|
||||
public PageUtils getSdkTypeList(Integer page, Integer limit, SdkType sdkType) {
|
||||
|
||||
if (page == null || limit == null) {
|
||||
page = 1;
|
||||
limit = 10;
|
||||
}
|
||||
return baseMapper.selectPage(pages, new QueryWrapper<>(sdkType).orderByDesc("create_time"));
|
||||
PageHelper.startPage(page,limit);
|
||||
return PageUtils.page(new PageInfo<>(baseMapper.selectList(new QueryWrapper<>(sdkType).orderByDesc("create_time"))),true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
package com.sqx.modules.search.controller.app;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.app.annotation.Login;
|
||||
import com.sqx.modules.app.entity.App;
|
||||
import com.sqx.modules.search.entity.Search;
|
||||
import com.sqx.modules.search.service.AppSearchService;
|
||||
import com.sqx.modules.search.service.SearchService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.RequestAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 搜索记录
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package com.sqx.modules.search.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.search.Response.SearchResponse;
|
||||
@@ -17,7 +14,6 @@ import org.springframework.stereotype.Service;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Service
|
||||
|
||||
@@ -1,16 +1,20 @@
|
||||
package com.sqx.modules.sys.controller;
|
||||
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sqx.common.annotation.SysLog;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.common.validator.ValidatorUtils;
|
||||
import com.sqx.modules.sys.entity.SysConfigEntity;
|
||||
import com.sqx.modules.sys.service.SysConfigService;
|
||||
import com.sqx.modules.utils.ParamPageUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -29,9 +33,10 @@ public class SysConfigController extends AbstractController {
|
||||
@GetMapping("/list")
|
||||
@RequiresPermissions("sys:config:list")
|
||||
public Result list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = sysConfigService.queryPage(params);
|
||||
|
||||
return Result.success().put("page", page);
|
||||
PageHelper.startPage(ParamPageUtils.getPageNum(params), ParamPageUtils.getPageSize(params));
|
||||
List<SysConfigEntity> list = sysConfigService.list();
|
||||
PageInfo<SysConfigEntity> pageInfo = new PageInfo<>(list);
|
||||
return Result.success().put("page", PageUtils.page(pageInfo));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,20 +1,23 @@
|
||||
package com.sqx.modules.sys.controller;
|
||||
|
||||
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.common.validator.ValidatorUtils;
|
||||
import com.sqx.modules.sys.entity.SysDictEntity;
|
||||
import com.sqx.modules.sys.service.SysDictService;
|
||||
import com.sqx.modules.utils.ParamPageUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 数据字典
|
||||
*
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("sys/dict")
|
||||
@@ -27,10 +30,12 @@ public class SysDictController {
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
@RequiresPermissions("sys:dict:list")
|
||||
public Result list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = sysDictService.queryPage(params);
|
||||
public Result list(@RequestParam Map<String, Object> params) {
|
||||
PageHelper.startPage(ParamPageUtils.getPageNum(params), ParamPageUtils.getPageSize(params));
|
||||
List<SysDictEntity> list = sysDictService.list();
|
||||
PageInfo<SysDictEntity> pageInfo = new PageInfo<>(list);
|
||||
|
||||
return Result.success().put("page", page);
|
||||
return Result.success().put("page", PageUtils.page(pageInfo));
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +44,7 @@ public class SysDictController {
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
@RequiresPermissions("sys:dict:info")
|
||||
public Result info(@PathVariable("id") Long id){
|
||||
public Result info(@PathVariable("id") Long id) {
|
||||
SysDictEntity dict = sysDictService.getById(id);
|
||||
|
||||
return Result.success().put("dict", dict);
|
||||
@@ -50,7 +55,7 @@ public class SysDictController {
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
@RequiresPermissions("sys:dict:save")
|
||||
public Result save(@RequestBody SysDictEntity dict){
|
||||
public Result save(@RequestBody SysDictEntity dict) {
|
||||
//校验类型
|
||||
ValidatorUtils.validateEntity(dict);
|
||||
|
||||
@@ -64,7 +69,7 @@ public class SysDictController {
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
@RequiresPermissions("sys:dict:update")
|
||||
public Result update(@RequestBody SysDictEntity dict){
|
||||
public Result update(@RequestBody SysDictEntity dict) {
|
||||
//校验类型
|
||||
ValidatorUtils.validateEntity(dict);
|
||||
|
||||
@@ -78,7 +83,7 @@ public class SysDictController {
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
@RequiresPermissions("sys:dict:delete")
|
||||
public Result delete(@RequestBody Long[] ids){
|
||||
public Result delete(@RequestBody Long[] ids) {
|
||||
sysDictService.removeByIds(Arrays.asList(ids));
|
||||
|
||||
return Result.success();
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
package com.sqx.modules.sys.controller;
|
||||
|
||||
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.sys.entity.SysLogEntity;
|
||||
import com.sqx.modules.sys.service.SysLogService;
|
||||
import com.sqx.modules.utils.ParamPageUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
@@ -11,29 +15,31 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 系统日志
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/sys/log")
|
||||
public class SysLogController {
|
||||
@Autowired
|
||||
private SysLogService sysLogService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/list")
|
||||
@RequiresPermissions("sys:log:list")
|
||||
public Result list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = sysLogService.queryPage(params);
|
||||
@Autowired
|
||||
private SysLogService sysLogService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/list")
|
||||
@RequiresPermissions("sys:log:list")
|
||||
public Result list(@RequestParam Map<String, Object> params) {
|
||||
PageHelper.startPage(ParamPageUtils.getPageNum(params), ParamPageUtils.getPageSize(params));
|
||||
List<SysLogEntity> entities = sysLogService.list();
|
||||
PageInfo<SysLogEntity> pageInfo = new PageInfo<>(entities);
|
||||
|
||||
return Result.success().put("page", PageUtils.page(pageInfo));
|
||||
}
|
||||
|
||||
return Result.success().put("page", page);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.sqx.modules.sys.controller;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sqx.common.annotation.SysLog;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Result;
|
||||
@@ -7,6 +9,7 @@ import com.sqx.common.validator.ValidatorUtils;
|
||||
import com.sqx.modules.sys.entity.SysRoleEntity;
|
||||
import com.sqx.modules.sys.service.SysRoleMenuService;
|
||||
import com.sqx.modules.sys.service.SysRoleService;
|
||||
import com.sqx.modules.utils.ParamPageUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -17,101 +20,102 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* 角色管理
|
||||
*
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/sys/role")
|
||||
public class SysRoleController extends AbstractController {
|
||||
@Autowired
|
||||
private SysRoleService sysRoleService;
|
||||
@Autowired
|
||||
private SysRoleMenuService sysRoleMenuService;
|
||||
@Autowired
|
||||
private SysRoleService sysRoleService;
|
||||
@Autowired
|
||||
private SysRoleMenuService sysRoleMenuService;
|
||||
|
||||
/**
|
||||
* 角色列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@RequiresPermissions("sys:role:list")
|
||||
public Result list(@RequestParam Map<String, Object> params){
|
||||
//如果不是超级管理员,则只查询自己创建的角色列表
|
||||
/**
|
||||
* 角色列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@RequiresPermissions("sys:role:list")
|
||||
public Result list(@RequestParam Map<String, Object> params) {
|
||||
//如果不是超级管理员,则只查询自己创建的角色列表
|
||||
/*if(getUserId() != Constant.SUPER_ADMIN){
|
||||
params.put("createUserId", getUserId());
|
||||
}*/
|
||||
PageUtils page = sysRoleService.queryPage(params);
|
||||
return Result.success().put("page", page);
|
||||
}
|
||||
PageHelper.startPage(ParamPageUtils.getPageNum(params), ParamPageUtils.getPageSize(params));
|
||||
List<SysRoleEntity> list = sysRoleService.list();
|
||||
PageInfo<SysRoleEntity> pageInfo = new PageInfo<>(list);
|
||||
return Result.success().put("page", PageUtils.page(pageInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 角色列表
|
||||
*/
|
||||
@GetMapping("/select")
|
||||
@RequiresPermissions("sys:role:select")
|
||||
public Result select(){
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
/**
|
||||
* 角色列表
|
||||
*/
|
||||
@GetMapping("/select")
|
||||
@RequiresPermissions("sys:role:select")
|
||||
public Result select() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
|
||||
//如果不是超级管理员,则只查询自己所拥有的角色列表
|
||||
//如果不是超级管理员,则只查询自己所拥有的角色列表
|
||||
/*if(getUserId() != Constant.SUPER_ADMIN){
|
||||
map.put("create_user_id", getUserId());
|
||||
}*/
|
||||
List<SysRoleEntity> list = (List<SysRoleEntity>) sysRoleService.listByMap(map);
|
||||
List<SysRoleEntity> list = (List<SysRoleEntity>) sysRoleService.listByMap(map);
|
||||
|
||||
return Result.success().put("list", list);
|
||||
}
|
||||
return Result.success().put("list", list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 角色信息
|
||||
*/
|
||||
@GetMapping("/info/{roleId}")
|
||||
@RequiresPermissions("sys:role:info")
|
||||
public Result info(@PathVariable("roleId") Long roleId){
|
||||
SysRoleEntity role = sysRoleService.getById(roleId);
|
||||
/**
|
||||
* 角色信息
|
||||
*/
|
||||
@GetMapping("/info/{roleId}")
|
||||
@RequiresPermissions("sys:role:info")
|
||||
public Result info(@PathVariable("roleId") Long roleId) {
|
||||
SysRoleEntity role = sysRoleService.getById(roleId);
|
||||
|
||||
//查询角色对应的菜单
|
||||
List<Long> menuIdList = sysRoleMenuService.queryMenuIdList(roleId);
|
||||
role.setMenuIdList(menuIdList);
|
||||
//查询角色对应的菜单
|
||||
List<Long> menuIdList = sysRoleMenuService.queryMenuIdList(roleId);
|
||||
role.setMenuIdList(menuIdList);
|
||||
|
||||
return Result.success().put("role", role);
|
||||
}
|
||||
return Result.success().put("role", role);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存角色
|
||||
*/
|
||||
@SysLog("保存角色")
|
||||
@PostMapping("/save")
|
||||
@RequiresPermissions("sys:role:save")
|
||||
public Result save(@RequestBody SysRoleEntity role){
|
||||
ValidatorUtils.validateEntity(role);
|
||||
/**
|
||||
* 保存角色
|
||||
*/
|
||||
@SysLog("保存角色")
|
||||
@PostMapping("/save")
|
||||
@RequiresPermissions("sys:role:save")
|
||||
public Result save(@RequestBody SysRoleEntity role) {
|
||||
ValidatorUtils.validateEntity(role);
|
||||
|
||||
role.setCreateUserId(getUserId());
|
||||
sysRoleService.saveRole(role);
|
||||
role.setCreateUserId(getUserId());
|
||||
sysRoleService.saveRole(role);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改角色
|
||||
*/
|
||||
@SysLog("修改角色")
|
||||
@PostMapping("/update")
|
||||
@RequiresPermissions("sys:role:update")
|
||||
public Result update(@RequestBody SysRoleEntity role){
|
||||
ValidatorUtils.validateEntity(role);
|
||||
/**
|
||||
* 修改角色
|
||||
*/
|
||||
@SysLog("修改角色")
|
||||
@PostMapping("/update")
|
||||
@RequiresPermissions("sys:role:update")
|
||||
public Result update(@RequestBody SysRoleEntity role) {
|
||||
ValidatorUtils.validateEntity(role);
|
||||
|
||||
role.setCreateUserId(getUserId());
|
||||
sysRoleService.update(role);
|
||||
role.setCreateUserId(getUserId());
|
||||
sysRoleService.update(role);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除角色
|
||||
*/
|
||||
@SysLog("删除角色")
|
||||
@PostMapping("/delete")
|
||||
@RequiresPermissions("sys:role:delete")
|
||||
public Result delete(@RequestBody Long[] roleIds){
|
||||
sysRoleService.deleteBatch(roleIds);
|
||||
/**
|
||||
* 删除角色
|
||||
*/
|
||||
@SysLog("删除角色")
|
||||
@PostMapping("/delete")
|
||||
@RequiresPermissions("sys:role:delete")
|
||||
public Result delete(@RequestBody Long[] roleIds) {
|
||||
sysRoleService.deleteBatch(roleIds);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.sqx.modules.sys.controller;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sqx.common.annotation.SysLog;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Result;
|
||||
@@ -11,6 +13,7 @@ import com.sqx.modules.sys.entity.SysUserEntity;
|
||||
import com.sqx.modules.sys.form.PasswordForm;
|
||||
import com.sqx.modules.sys.service.SysUserRoleService;
|
||||
import com.sqx.modules.sys.service.SysUserService;
|
||||
import com.sqx.modules.utils.ParamPageUtils;
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.shiro.crypto.hash.Sha256Hash;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -41,11 +44,12 @@ public class SysUserController extends AbstractController {
|
||||
/*if(getUserId() != Constant.SUPER_ADMIN){
|
||||
params.put("createUserId", getUserId());
|
||||
}*/
|
||||
PageUtils page = sysUserService.queryPage(params);
|
||||
|
||||
return Result.success().put("page", page);
|
||||
PageHelper.startPage(ParamPageUtils.getPageNum(params), ParamPageUtils.getPageSize(params));
|
||||
List<SysUserEntity> list = sysUserService.list();
|
||||
PageInfo<SysUserEntity> pageInfo = new PageInfo<>(list);
|
||||
return Result.success().put("page", PageUtils.page(pageInfo));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取登录的用户信息
|
||||
*/
|
||||
@@ -53,42 +57,42 @@ public class SysUserController extends AbstractController {
|
||||
public Result info(){
|
||||
return Result.success().put("user", getUser());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改登录用户密码
|
||||
*/
|
||||
@SysLog("修改密码")
|
||||
public Result password(@RequestBody PasswordForm form){
|
||||
Assert.isBlank(form.getNewPassword(), "新密码不为能空");
|
||||
|
||||
|
||||
//sha256加密
|
||||
String password = new Sha256Hash(form.getPassword(), getUser().getSalt()).toHex();
|
||||
//sha256加密
|
||||
String newPassword = new Sha256Hash(form.getNewPassword(), getUser().getSalt()).toHex();
|
||||
|
||||
|
||||
//更新密码
|
||||
boolean flag = sysUserService.updatePassword(getUserId(), password, newPassword);
|
||||
if(!flag){
|
||||
return Result.error("原密码不正确");
|
||||
}
|
||||
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
*/
|
||||
@GetMapping("/info/{userId}")
|
||||
public Result info(@PathVariable("userId") Long userId){
|
||||
SysUserEntity user = sysUserService.getById(userId);
|
||||
|
||||
|
||||
//获取用户所属的角色列表
|
||||
List<Long> roleIdList = sysUserRoleService.queryRoleIdList(userId);
|
||||
user.setRoleIdList(roleIdList);
|
||||
|
||||
|
||||
return Result.success().put("user", user);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存用户
|
||||
*/
|
||||
@@ -96,13 +100,13 @@ public class SysUserController extends AbstractController {
|
||||
@PostMapping("/save")
|
||||
public Result save(@RequestBody SysUserEntity user){
|
||||
ValidatorUtils.validateEntity(user, AddGroup.class);
|
||||
|
||||
|
||||
user.setCreateUserId(getUserId());
|
||||
sysUserService.saveUser(user);
|
||||
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改用户
|
||||
*/
|
||||
@@ -113,10 +117,10 @@ public class SysUserController extends AbstractController {
|
||||
|
||||
user.setCreateUserId(getUserId());
|
||||
sysUserService.update(user);
|
||||
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除用户
|
||||
*/
|
||||
@@ -126,13 +130,13 @@ public class SysUserController extends AbstractController {
|
||||
if(ArrayUtils.contains(userIds, 1L)){
|
||||
return Result.error("系统管理员不能删除");
|
||||
}
|
||||
|
||||
|
||||
if(ArrayUtils.contains(userIds, getUserId())){
|
||||
return Result.error("当前用户不能删除");
|
||||
}
|
||||
|
||||
|
||||
sysUserService.deleteBatch(userIds);
|
||||
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,96 +1,97 @@
|
||||
package com.sqx.modules.sys.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.google.gson.Gson;
|
||||
import com.sqx.common.exception.SqxException;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Query;
|
||||
import com.sqx.modules.sys.dao.SysConfigDao;
|
||||
import com.sqx.modules.sys.entity.SysConfigEntity;
|
||||
import com.sqx.modules.sys.redis.SysConfigRedis;
|
||||
import com.sqx.modules.sys.service.SysConfigService;
|
||||
import com.sqx.modules.utils.ParamPageUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service("sysConfigService")
|
||||
public class SysConfigServiceImpl extends ServiceImpl<SysConfigDao, SysConfigEntity> implements SysConfigService {
|
||||
@Autowired
|
||||
private SysConfigRedis sysConfigRedis;
|
||||
@Autowired
|
||||
private SysConfigRedis sysConfigRedis;
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
String paramKey = (String)params.get("paramKey");
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
String paramKey = (String) params.get("paramKey");
|
||||
|
||||
IPage<SysConfigEntity> page = this.page(
|
||||
new Query<SysConfigEntity>().getPage(params),
|
||||
new QueryWrapper<SysConfigEntity>()
|
||||
.like(StringUtils.isNotBlank(paramKey),"param_key", paramKey)
|
||||
.eq("status", 1)
|
||||
);
|
||||
PageHelper.startPage(ParamPageUtils.getPageNum(params), ParamPageUtils.getPageSize(params));
|
||||
List<SysConfigEntity> entityList = baseMapper.selectList(new QueryWrapper<SysConfigEntity>()
|
||||
.like(StringUtils.isNotBlank(paramKey), "param_key", paramKey)
|
||||
.eq("status", 1)
|
||||
);
|
||||
PageInfo<SysConfigEntity> pageInfo = new PageInfo<>(entityList);
|
||||
return PageUtils.page(pageInfo);
|
||||
}
|
||||
|
||||
return new PageUtils(page);
|
||||
}
|
||||
@Override
|
||||
public void saveConfig(SysConfigEntity config) {
|
||||
this.save(config);
|
||||
sysConfigRedis.saveOrUpdate(config);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveConfig(SysConfigEntity config) {
|
||||
this.save(config);
|
||||
sysConfigRedis.saveOrUpdate(config);
|
||||
}
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(SysConfigEntity config) {
|
||||
this.updateById(config);
|
||||
sysConfigRedis.saveOrUpdate(config);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(SysConfigEntity config) {
|
||||
this.updateById(config);
|
||||
sysConfigRedis.saveOrUpdate(config);
|
||||
}
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateValueByKey(String key, String value) {
|
||||
baseMapper.updateValueByKey(key, value);
|
||||
sysConfigRedis.delete(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateValueByKey(String key, String value) {
|
||||
baseMapper.updateValueByKey(key, value);
|
||||
sysConfigRedis.delete(key);
|
||||
}
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteBatch(Long[] ids) {
|
||||
for (Long id : ids) {
|
||||
SysConfigEntity config = this.getById(id);
|
||||
sysConfigRedis.delete(config.getParamKey());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteBatch(Long[] ids) {
|
||||
for(Long id : ids){
|
||||
SysConfigEntity config = this.getById(id);
|
||||
sysConfigRedis.delete(config.getParamKey());
|
||||
}
|
||||
this.removeByIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
this.removeByIds(Arrays.asList(ids));
|
||||
}
|
||||
@Override
|
||||
public String getValue(String key) {
|
||||
SysConfigEntity config = sysConfigRedis.get(key);
|
||||
if (config == null) {
|
||||
config = baseMapper.queryByKey(key);
|
||||
sysConfigRedis.saveOrUpdate(config);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValue(String key) {
|
||||
SysConfigEntity config = sysConfigRedis.get(key);
|
||||
if(config == null){
|
||||
config = baseMapper.queryByKey(key);
|
||||
sysConfigRedis.saveOrUpdate(config);
|
||||
}
|
||||
return config == null ? null : config.getParamValue();
|
||||
}
|
||||
|
||||
return config == null ? null : config.getParamValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T getConfigObject(String key, Class<T> clazz) {
|
||||
String value = getValue(key);
|
||||
if(StringUtils.isNotBlank(value)){
|
||||
return new Gson().fromJson(value, clazz);
|
||||
}
|
||||
@Override
|
||||
public <T> T getConfigObject(String key, Class<T> clazz) {
|
||||
String value = getValue(key);
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
return new Gson().fromJson(value, clazz);
|
||||
}
|
||||
|
||||
try {
|
||||
return clazz.newInstance();
|
||||
} catch (Exception e) {
|
||||
throw new SqxException("获取参数失败");
|
||||
}
|
||||
}
|
||||
try {
|
||||
return clazz.newInstance();
|
||||
} catch (Exception e) {
|
||||
throw new SqxException("获取参数失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
package com.sqx.modules.sys.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.common.utils.Query;
|
||||
import com.sqx.modules.sys.dao.SysDictDao;
|
||||
import com.sqx.modules.sys.entity.SysDictEntity;
|
||||
import com.sqx.modules.sys.service.SysDictService;
|
||||
import com.sqx.modules.utils.ParamPageUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -19,15 +21,14 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictDao, SysDictEntity> i
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
String name = (String)params.get("name");
|
||||
String name = (String) params.get("name");
|
||||
|
||||
IPage<SysDictEntity> page = this.page(
|
||||
new Query<SysDictEntity>().getPage(params),
|
||||
new QueryWrapper<SysDictEntity>()
|
||||
.like(StringUtils.isNotBlank(name),"name", name)
|
||||
PageHelper.startPage(ParamPageUtils.getPageNum(params), ParamPageUtils.getPageSize(params));
|
||||
List<SysDictEntity> entityList = baseMapper.selectList(new QueryWrapper<SysDictEntity>()
|
||||
.like(StringUtils.isNotBlank(name), "name", name)
|
||||
);
|
||||
|
||||
return new PageUtils(page);
|
||||
PageInfo<SysDictEntity> pageInfo = new PageInfo<>(entityList);
|
||||
return PageUtils.page(pageInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
package com.sqx.modules.sys.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.common.utils.Query;
|
||||
import com.sqx.modules.sys.dao.SysLogDao;
|
||||
import com.sqx.modules.sys.entity.SysLogEntity;
|
||||
import com.sqx.modules.sys.service.SysLogService;
|
||||
import com.sqx.modules.utils.ParamPageUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -19,13 +21,11 @@ public class SysLogServiceImpl extends ServiceImpl<SysLogDao, SysLogEntity> impl
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
String key = (String)params.get("key");
|
||||
String key = (String) params.get("key");
|
||||
|
||||
IPage<SysLogEntity> page = this.page(
|
||||
new Query<SysLogEntity>().getPage(params),
|
||||
new QueryWrapper<SysLogEntity>().like(StringUtils.isNotBlank(key),"username", key)
|
||||
);
|
||||
|
||||
return new PageUtils(page);
|
||||
PageHelper.startPage(ParamPageUtils.getPageNum(params), ParamPageUtils.getPageSize(params));
|
||||
List<SysLogEntity> list = baseMapper.selectList(new QueryWrapper<SysLogEntity>().like(StringUtils.isNotBlank(key), "username", key));
|
||||
PageInfo<SysLogEntity> pageInfo = new PageInfo<>(list);
|
||||
return PageUtils.page(pageInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package com.sqx.modules.sys.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.common.utils.Query;
|
||||
import com.sqx.modules.sys.dao.SysRoleDao;
|
||||
import com.sqx.modules.sys.entity.SysRoleEntity;
|
||||
import com.sqx.modules.sys.service.SysRoleMenuService;
|
||||
import com.sqx.modules.sys.service.SysRoleService;
|
||||
import com.sqx.modules.sys.service.SysUserRoleService;
|
||||
import com.sqx.modules.sys.service.SysUserService;
|
||||
import com.sqx.modules.utils.ParamPageUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -29,8 +29,6 @@ import java.util.Map;
|
||||
public class SysRoleServiceImpl extends ServiceImpl<SysRoleDao, SysRoleEntity> implements SysRoleService {
|
||||
@Autowired
|
||||
private SysRoleMenuService sysRoleMenuService;
|
||||
@Autowired
|
||||
private SysUserService sysUserService;
|
||||
@Autowired
|
||||
private SysUserRoleService sysUserRoleService;
|
||||
|
||||
@@ -39,14 +37,12 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleDao, SysRoleEntity> i
|
||||
String roleName = (String)params.get("roleName");
|
||||
Long createUserId = (Long)params.get("createUserId");
|
||||
|
||||
IPage<SysRoleEntity> page = this.page(
|
||||
new Query<SysRoleEntity>().getPage(params),
|
||||
new QueryWrapper<SysRoleEntity>()
|
||||
.like(StringUtils.isNotBlank(roleName),"role_name", roleName)
|
||||
.eq(createUserId != null,"create_user_id", createUserId)
|
||||
);
|
||||
|
||||
return new PageUtils(page);
|
||||
PageHelper.startPage(ParamPageUtils.getPageNum(params), ParamPageUtils.getPageSize(params));
|
||||
List<SysRoleEntity> sysRoleEntities = baseMapper.selectList(new QueryWrapper<SysRoleEntity>()
|
||||
.like(StringUtils.isNotBlank(roleName), "role_name", roleName)
|
||||
.eq(createUserId != null, "create_user_id", createUserId));
|
||||
PageInfo<SysRoleEntity> pageInfo = new PageInfo<>(sysRoleEntities);
|
||||
return PageUtils.page(pageInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -101,10 +97,10 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleDao, SysRoleEntity> i
|
||||
if(role.getCreateUserId() == Constant.SUPER_ADMIN){
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
//查询用户所拥有的菜单列表
|
||||
List<Long> menuIdList = sysUserService.queryAllMenuId(role.getCreateUserId());
|
||||
|
||||
|
||||
//判断是否越权
|
||||
if(!menuIdList.containsAll(role.getMenuIdList())){
|
||||
throw new SqxException("新增角色的权限,已超出你的权限范围");
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
package com.sqx.modules.sys.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.common.utils.Query;
|
||||
import com.sqx.modules.sys.dao.SysUserDao;
|
||||
import com.sqx.modules.sys.entity.SysUserEntity;
|
||||
import com.sqx.modules.sys.service.SysRoleService;
|
||||
import com.sqx.modules.sys.service.SysUserRoleService;
|
||||
import com.sqx.modules.sys.service.SysUserService;
|
||||
import com.sqx.modules.utils.InvitationCodeUtil;
|
||||
import com.sqx.modules.utils.ParamPageUtils;
|
||||
import org.apache.commons.lang.RandomStringUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.crypto.hash.Sha256Hash;
|
||||
@@ -41,18 +42,16 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
|
||||
Long createUserId = (Long) params.get("createUserId");
|
||||
Object isChannel = params.get("isChannel");
|
||||
Object sysUserId = params.get("sysUserId");
|
||||
IPage<SysUserEntity> page = this.page(
|
||||
new Query<SysUserEntity>().getPage(params),
|
||||
new QueryWrapper<SysUserEntity>()
|
||||
.like(StringUtils.isNotBlank(username), "username", username)
|
||||
.eq(createUserId != null, "create_user_id", createUserId)
|
||||
.eq(isChannel != null, "is_channel", isChannel)
|
||||
.eq(sysUserId != null, "sys_user_id", sysUserId)
|
||||
.isNull(sysUserId == null, "sys_user_id")
|
||||
.isNull(isChannel == null, "is_channel")
|
||||
);
|
||||
|
||||
return new PageUtils(page);
|
||||
PageHelper.startPage(ParamPageUtils.getPageNum(params), ParamPageUtils.getPageSize(params));
|
||||
List<SysUserEntity> sysUserEntities = baseMapper.selectList(new QueryWrapper<SysUserEntity>()
|
||||
.like(StringUtils.isNotBlank(username), "username", username)
|
||||
.eq(createUserId != null, "create_user_id", createUserId)
|
||||
.eq(isChannel != null, "is_channel", isChannel)
|
||||
.eq(sysUserId != null, "sys_user_id", sysUserId)
|
||||
.isNull(sysUserId == null, "sys_user_id")
|
||||
.isNull(isChannel == null, "is_channel"));
|
||||
PageInfo<SysUserEntity> pageInfo = new PageInfo<>(sysUserEntities);
|
||||
return PageUtils.page(pageInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -132,7 +131,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
|
||||
if(user.getCreateUserId() == Constant.SUPER_ADMIN){
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
//查询用户创建的角色列表
|
||||
List<Long> roleIdList = sysRoleService.queryRoleIdList(user.getCreateUserId());
|
||||
|
||||
@@ -147,4 +146,4 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
|
||||
return baseMapper.selectOne(new QueryWrapper<SysUserEntity>().isNull("sys_user_id").eq("qd_code", qdCode));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@ package com.sqx.modules.taskCenter.service.impl;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.sqx.common.utils.DateUtils;
|
||||
import com.sqx.common.utils.RedisKeys;
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.sqx.modules.urlAddress.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sqx.common.utils.DateUtils;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Result;
|
||||
@@ -15,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@Api(value = "域名池", tags = {"域名池"})
|
||||
@@ -49,9 +52,11 @@ public class UrlAddressController extends AbstractController {
|
||||
@GetMapping("/selectUrlAddressList")
|
||||
@ApiOperation("查询域名池列表")
|
||||
public Result selectUrlAddressList(Integer page,Integer limit,String urlAddress,Integer status){
|
||||
return Result.success().put("data",new PageUtils(urlAddressService.page(new Page<>(page,limit),
|
||||
new QueryWrapper<UrlAddress>().like(StringUtils.isNotEmpty(urlAddress),"url_address",urlAddress)
|
||||
.eq(status!=null && status!=0,"status",status))));
|
||||
PageHelper.startPage(page,limit);
|
||||
List<UrlAddress> list = urlAddressService.list(new QueryWrapper<UrlAddress>().like(StringUtils.isNotEmpty(urlAddress), "url_address", urlAddress)
|
||||
.eq(status != null && status != 0, "status", status));
|
||||
PageInfo<UrlAddress> pageInfo = new PageInfo<>(list);
|
||||
return Result.success().put("data", PageUtils.page(pageInfo));
|
||||
}
|
||||
|
||||
@GetMapping("/selectUrlAddress")
|
||||
|
||||
24
src/main/java/com/sqx/modules/utils/ParamPageUtils.java
Normal file
24
src/main/java/com/sqx/modules/utils/ParamPageUtils.java
Normal file
@@ -0,0 +1,24 @@
|
||||
package com.sqx.modules.utils;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author GYJoker
|
||||
*/
|
||||
public class ParamPageUtils {
|
||||
public static int getPageNum(Map<String, Object> params) {
|
||||
Object page = params.get("page");
|
||||
if (page == null) {
|
||||
return 1;
|
||||
}
|
||||
return Integer.parseInt(page.toString());
|
||||
}
|
||||
|
||||
public static int getPageSize(Map<String, Object> params) {
|
||||
Object limit = params.get("limit");
|
||||
if (limit == null) {
|
||||
return 10;
|
||||
}
|
||||
return Integer.parseInt(limit.toString());
|
||||
}
|
||||
}
|
||||
@@ -21,9 +21,10 @@ connection-timeout: 30000
|
||||
spring:
|
||||
# sharding-jdbc 配置
|
||||
shardingsphere:
|
||||
center-tables-data-node: duanju.%s
|
||||
# 显示sharding-jdbc改写的sql语句
|
||||
show-sql: false
|
||||
|
||||
center-tables-data-node: duanju.%s
|
||||
# 数据源名称
|
||||
datasource:
|
||||
# 数据源配置begin
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
swagger:
|
||||
enabled: true
|
||||
enabled: false
|
||||
pay:
|
||||
h5BaseUrl: https://video-h5.hnsiyao.cn/me/detail/detail?allId=
|
||||
orderNotifyUrl: https://video.hnsiyao.cn/czg/app/wuyou/notify
|
||||
extractNotifyUrl: https://video.hnsiyao.cn/czg/app/wuyou/extractNotify
|
||||
h5BaseUrl: https://dj-h5.hnsiyao.cn/me/detail/detail?allId=
|
||||
orderNotifyUrl: https://pay.hnsiyao.cn/czg/app/wuyou/notify
|
||||
extractNotifyUrl: https://pay.hnsiyao.cn/czg/app/wuyou/extractNotify
|
||||
|
||||
# 数据源的一些配置
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
@@ -22,14 +22,24 @@ spring:
|
||||
# sharding-jdbc 配置
|
||||
shardingsphere:
|
||||
center-tables-data-node: duanju.%s
|
||||
# 区域表的数据源节点
|
||||
region-tables-data-node: duanju-$->{0..4}.%s
|
||||
# 区域分库策略的计算字段
|
||||
region-tables-sharding-database-column: user_id
|
||||
# 分库的计算方法
|
||||
region-tables-sharding-database-algorithm: duanju-$->{Math.abs(user_id) % 5}
|
||||
|
||||
# 短剧集表 拆分
|
||||
course_details-sharding-database-column: course_id
|
||||
course_details-sharding-database-algorithm: duanju-$->{Math.abs(course_id) % 5}
|
||||
|
||||
# 显示sharding-jdbc改写的sql语句
|
||||
show-sql: false
|
||||
# 数据源名称
|
||||
datasource:
|
||||
# 数据源配置begin
|
||||
master-0:
|
||||
master:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url: jdbc:mysql://rm-gc712o11yndj78x6a6o.mysql.cn-chengdu.rds.aliyuncs.com/duanju?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
|
||||
jdbc-url: jdbc:mysql://rm-gc7xx913734hv5w5q.mysql.cn-chengdu.rds.aliyuncs.com/duanju?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
|
||||
username: video_user
|
||||
password: VideoUser@1
|
||||
minimum-idle: ${minimum-idle}
|
||||
@@ -37,11 +47,112 @@ spring:
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
# 数据源配置begin
|
||||
master-0:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url:
|
||||
username:
|
||||
password:
|
||||
minimum-idle: ${minimum-idle}
|
||||
maximum-pool-size: ${maximum-pool-size}
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
master-1:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url:
|
||||
username:
|
||||
password:
|
||||
minimum-idle: ${minimum-idle}
|
||||
maximum-pool-size: ${maximum-pool-size}
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
master-2:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url:
|
||||
username:
|
||||
password:
|
||||
minimum-idle: ${minimum-idle}
|
||||
maximum-pool-size: ${maximum-pool-size}
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
master-3:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url:
|
||||
username:
|
||||
password:
|
||||
minimum-idle: ${minimum-idle}
|
||||
maximum-pool-size: ${maximum-pool-size}
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
master-4:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url:
|
||||
username:
|
||||
password:
|
||||
minimum-idle: ${minimum-idle}
|
||||
maximum-pool-size: ${maximum-pool-size}
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
slave:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url:
|
||||
username:
|
||||
password:
|
||||
minimum-idle: ${minimum-idle}
|
||||
maximum-pool-size: ${maximum-pool-size}
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
slave-0:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url: jdbc:mysql://47.122.26.160:3306/duanju?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
|
||||
username: root
|
||||
password: 0fd6497c308ccfa8
|
||||
jdbc-url:
|
||||
username:
|
||||
password:
|
||||
minimum-idle: ${minimum-idle}
|
||||
maximum-pool-size: ${maximum-pool-size}
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
slave-1:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url:
|
||||
username:
|
||||
password:
|
||||
minimum-idle: ${minimum-idle}
|
||||
maximum-pool-size: ${maximum-pool-size}
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
slave-2:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url:
|
||||
username:
|
||||
password:
|
||||
minimum-idle: ${minimum-idle}
|
||||
maximum-pool-size: ${maximum-pool-size}
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
slave-3:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url:
|
||||
username:
|
||||
password:
|
||||
minimum-idle: ${minimum-idle}
|
||||
maximum-pool-size: ${maximum-pool-size}
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
slave-4:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url:
|
||||
username:
|
||||
password:
|
||||
minimum-idle: ${minimum-idle}
|
||||
maximum-pool-size: ${maximum-pool-size}
|
||||
idle-timeout: ${idle-timeout}
|
||||
@@ -53,6 +164,21 @@ spring:
|
||||
master-slave-rules:
|
||||
#数据源
|
||||
duanju:
|
||||
master-data-source-name: master
|
||||
slave-data-source-names: slave
|
||||
duanju-0:
|
||||
master-data-source-name: master-0
|
||||
slave-data-source-names:
|
||||
- slave-0
|
||||
slave-data-source-names: slave-0
|
||||
duanju-1:
|
||||
master-data-source-name: master-1
|
||||
slave-data-source-names: slave-1
|
||||
duanju-2:
|
||||
master-data-source-name: master-2
|
||||
slave-data-source-names: slave-2
|
||||
duanju-3:
|
||||
master-data-source-name: master-3
|
||||
slave-data-source-names: slave-3
|
||||
duanju-4:
|
||||
master-data-source-name: master-4
|
||||
slave-data-source-names: slave-4
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
swagger:
|
||||
enabled: false
|
||||
enabled: false
|
||||
pay:
|
||||
h5BaseUrl: https://dj-h5.hnsiyao.cn/me/detail/detail?allId=
|
||||
orderNotifyUrl: https://pay.hnsiyao.cn/czg/app/wuyou/notify
|
||||
extractNotifyUrl: https://pay.hnsiyao.cn/czg/app/wuyou/extractNotify
|
||||
h5BaseUrl: https://dj-h5.hnsiyao.cn/me/detail/detail?allId=
|
||||
orderNotifyUrl: https://pay.hnsiyao.cn/czg/app/wuyou/notify
|
||||
extractNotifyUrl: https://pay.hnsiyao.cn/czg/app/wuyou/extractNotify
|
||||
|
||||
# 数据源的一些配置
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
@@ -19,63 +19,173 @@ max-lifetime: 30000
|
||||
connection-timeout: 30000
|
||||
|
||||
spring:
|
||||
# sharding-jdbc 配置
|
||||
shardingsphere:
|
||||
center-tables-data-node: duanju.%s
|
||||
# 显示sharding-jdbc改写的sql语句
|
||||
show-sql: false
|
||||
# 数据源名称
|
||||
datasource:
|
||||
# 数据源配置begin
|
||||
master-0:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url: jdbc:mysql://rm-gc7xx913734hv5w5q.mysql.cn-chengdu.rds.aliyuncs.com/duanju?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
|
||||
username: video_user
|
||||
password: VideoUser@1
|
||||
minimum-idle: ${minimum-idle}
|
||||
maximum-pool-size: ${maximum-pool-size}
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
# slave-0:
|
||||
# driver-class-name: ${driver-class-name}
|
||||
# jdbc-url: jdbc:mysql://localhost:3306/duanju?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
|
||||
# username: root
|
||||
# password: acddb0c84a192ada
|
||||
# minimum-idle: ${minimum-idle}
|
||||
# maximum-pool-size: ${maximum-pool-size}
|
||||
# idle-timeout: ${idle-timeout}
|
||||
# max-lifetime: ${max-lifetime}
|
||||
# connection-timeout: ${connection-timeout}
|
||||
# slave-1:
|
||||
# driver-class-name: ${driver-class-name}
|
||||
# jdbc-url: jdbc:mysql://172.18.96.9:3306/duanju?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
|
||||
# username: root
|
||||
# password: VideoUser1@
|
||||
# minimum-idle: ${minimum-idle}
|
||||
# maximum-pool-size: ${maximum-pool-size}
|
||||
# idle-timeout: ${idle-timeout}
|
||||
# max-lifetime: ${max-lifetime}
|
||||
# connection-timeout: ${connection-timeout}
|
||||
slave-2:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url: jdbc:mysql://172.18.96.8:3306/duanju?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
|
||||
username: root
|
||||
password: VideoUser1@
|
||||
minimum-idle: ${minimum-idle}
|
||||
maximum-pool-size: ${maximum-pool-size}
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
# 数据源配置end
|
||||
# sharding-jdbc 配置
|
||||
shardingsphere:
|
||||
# 显示sharding-jdbc改写的sql语句
|
||||
show-sql: true
|
||||
|
||||
center-tables-data-node: duanju.%s
|
||||
# 区域表的数据源节点
|
||||
region-tables-data-node: duanju-$->{0..4}.%s
|
||||
# 区域分库策略的计算字段
|
||||
region-tables-sharding-database-column: user_id
|
||||
# 分库的计算方法
|
||||
region-tables-sharding-database-algorithm: duanju-$->{user_id % 5}
|
||||
|
||||
# 短剧集表 拆分
|
||||
course_details-sharding-database-column: course_id
|
||||
course_details-sharding-database-algorithm: duanju-$->{course_id % 5}
|
||||
# 数据源名称
|
||||
datasource:
|
||||
duanju:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url: jdbc:mysql://192.168.1.41:3306/duanju?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
|
||||
username: root
|
||||
password: gongyijieqp002
|
||||
minimum-idle: ${minimum-idle}
|
||||
maximum-pool-size: ${maximum-pool-size}
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
# 数据源配置begin
|
||||
duanju-0:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url: jdbc:mysql://192.168.1.41:3306/duanju-0?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
|
||||
username: root
|
||||
password: gongyijieqp002
|
||||
minimum-idle: ${minimum-idle}
|
||||
maximum-pool-size: ${maximum-pool-size}
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
duanju-1:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url: jdbc:mysql://192.168.1.41:3306/duanju-1?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
|
||||
username: root
|
||||
password: gongyijieqp002
|
||||
minimum-idle: ${minimum-idle}
|
||||
maximum-pool-size: ${maximum-pool-size}
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
duanju-2:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url: jdbc:mysql://192.168.1.41:3306/duanju-2?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
|
||||
username: root
|
||||
password: gongyijieqp002
|
||||
minimum-idle: ${minimum-idle}
|
||||
maximum-pool-size: ${maximum-pool-size}
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
duanju-3:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url: jdbc:mysql://192.168.1.41:3306/duanju-3?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
|
||||
username: root
|
||||
password: gongyijieqp002
|
||||
minimum-idle: ${minimum-idle}
|
||||
maximum-pool-size: ${maximum-pool-size}
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
duanju-4:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url: jdbc:mysql://192.168.1.41:3306/duanju-4?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
|
||||
username: root
|
||||
password: gongyijieqp002
|
||||
minimum-idle: ${minimum-idle}
|
||||
maximum-pool-size: ${maximum-pool-size}
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
|
||||
duanju-slave:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url: jdbc:mysql://192.168.1.41:3306/duanju?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
|
||||
username: root
|
||||
password: gongyijieqp002
|
||||
minimum-idle: ${minimum-idle}
|
||||
maximum-pool-size: ${maximum-pool-size}
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
duanju-slave-0:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url: jdbc:mysql://192.168.1.41:3306/duanju-0?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
|
||||
username: root
|
||||
password: gongyijieqp002
|
||||
minimum-idle: ${minimum-idle}
|
||||
maximum-pool-size: ${maximum-pool-size}
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
duanju-slave-1:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url: jdbc:mysql://192.168.1.41:3306/duanju-1?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
|
||||
username: root
|
||||
password: gongyijieqp002
|
||||
minimum-idle: ${minimum-idle}
|
||||
maximum-pool-size: ${maximum-pool-size}
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
duanju-slave-2:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url: jdbc:mysql://192.168.1.41:3306/duanju-2?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
|
||||
username: root
|
||||
password: gongyijieqp002
|
||||
minimum-idle: ${minimum-idle}
|
||||
maximum-pool-size: ${maximum-pool-size}
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
duanju-slave-3:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url: jdbc:mysql://192.168.1.41:3306/duanju-3?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
|
||||
username: root
|
||||
password: gongyijieqp002
|
||||
minimum-idle: ${minimum-idle}
|
||||
maximum-pool-size: ${maximum-pool-size}
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
duanju-slave-4:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url: jdbc:mysql://192.168.1.41:3306/duanju-4?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
|
||||
username: root
|
||||
password: gongyijieqp002
|
||||
minimum-idle: ${minimum-idle}
|
||||
maximum-pool-size: ${maximum-pool-size}
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
# 数据源配置end
|
||||
|
||||
# 读写分离配置begin
|
||||
master-slave-rules:
|
||||
#数据源
|
||||
duanju:
|
||||
masterDataSourceName: duanju
|
||||
slaveDataSourceNames:
|
||||
- duanju-slave
|
||||
duanju-0:
|
||||
masterDataSourceName: duanju-0
|
||||
slaveDataSourceNames:
|
||||
- duanju-slave-0
|
||||
duanju-1:
|
||||
masterDataSourceName: duanju-1
|
||||
slaveDataSourceNames:
|
||||
- duanju-slave-1
|
||||
duanju-2:
|
||||
masterDataSourceName: duanju-2
|
||||
slaveDataSourceNames:
|
||||
- duanju-slave-2
|
||||
duanju-3:
|
||||
masterDataSourceName: duanju-3
|
||||
slaveDataSourceNames:
|
||||
- duanju-slave-3
|
||||
duanju-4:
|
||||
masterDataSourceName: duanju-4
|
||||
slaveDataSourceNames:
|
||||
- duanju-slave-4
|
||||
|
||||
# 读写分离配置begin
|
||||
master-slave-rules:
|
||||
#数据源
|
||||
duanju:
|
||||
master-data-source-name: master-0
|
||||
# slave-data-source-names: slave-0,slave-1,slave-2
|
||||
slave-data-source-names: slave-2
|
||||
# - slave-0
|
||||
# - slave-1
|
||||
# - slave-2
|
||||
|
||||
@@ -65,7 +65,7 @@ spring:
|
||||
allow-bean-definition-overriding: true
|
||||
# 环境 dev|test|prod
|
||||
profiles:
|
||||
active: local
|
||||
active: prod
|
||||
# jackson时间格式化
|
||||
jackson:
|
||||
time-zone: GMT+8
|
||||
@@ -93,74 +93,79 @@ spring:
|
||||
# pathmatch:
|
||||
# matching-strategy: ant_path_matcher
|
||||
shardingsphere:
|
||||
center-tables:
|
||||
- activity
|
||||
- app
|
||||
- banner
|
||||
- cash_out
|
||||
- comment_good
|
||||
- common_info
|
||||
- complet_award
|
||||
- coupon
|
||||
- coupon_user
|
||||
- course
|
||||
- course_classification
|
||||
- course_collect
|
||||
- course_comment
|
||||
# 短剧集表 通过course_id 分
|
||||
course-details:
|
||||
- course_details
|
||||
- course_user
|
||||
- disc_spinning
|
||||
- disc_spinning_amount
|
||||
- disc_spinning_record
|
||||
- help_classify
|
||||
- help_word
|
||||
- invite
|
||||
- invite_award
|
||||
- invite_money
|
||||
- message_info
|
||||
- msg
|
||||
#分库表 通过user_Id分
|
||||
region-tables:
|
||||
- user_money_details
|
||||
- orders
|
||||
- pay_classify
|
||||
- course_collect
|
||||
- pay_details
|
||||
- qrtz_blob_triggers
|
||||
- qrtz_calendars
|
||||
- qrtz_cron_triggers
|
||||
- qrtz_fired_triggers
|
||||
- qrtz_job_details
|
||||
- qrtz_locks
|
||||
- qrtz_paused_trigger_grps
|
||||
- qrtz_scheduler_state
|
||||
- qrtz_simple_triggers
|
||||
- qrtz_simprop_triggers
|
||||
- qrtz_triggers
|
||||
- schedule_job
|
||||
- disc_spinning_record
|
||||
- cash_out
|
||||
- course_user
|
||||
- tb_user
|
||||
- task_center_record
|
||||
- user_money
|
||||
- user_sign_record
|
||||
- invite_achievement
|
||||
- invite_money
|
||||
#中心表
|
||||
center-tables:
|
||||
- message_info
|
||||
- schedule_job_log
|
||||
- invite
|
||||
- msg
|
||||
- sys_role_menu
|
||||
- sdk_info
|
||||
- course
|
||||
- user_integral_details
|
||||
- common_info
|
||||
- sys_log
|
||||
- user_vip
|
||||
- uni_ad_callback_record
|
||||
- sys_user_role
|
||||
- sys_menu
|
||||
- comment_good
|
||||
- sys_user
|
||||
- course_comment
|
||||
- banner
|
||||
- disc_spinning
|
||||
- course_classification
|
||||
- task_center
|
||||
- sdk_type
|
||||
- search
|
||||
- sys_captcha
|
||||
- task_center_reward
|
||||
- schedule_job
|
||||
- help_word
|
||||
- help_classify
|
||||
- disc_spinning_amount
|
||||
- activity
|
||||
- vip_details
|
||||
- sys_role
|
||||
- pay_classify
|
||||
- app
|
||||
- invite_award
|
||||
- complet_award
|
||||
- url_address
|
||||
- sys_config
|
||||
- sys_dict
|
||||
- sys_log
|
||||
- sys_menu
|
||||
- sys_oss
|
||||
- sys_role
|
||||
- sys_role_menu
|
||||
- sys_user
|
||||
- sys_user_role
|
||||
- sys_user_token
|
||||
- task_center
|
||||
- task_center_record
|
||||
- task_center_reward
|
||||
- tb_user
|
||||
- uni_ad_callback_record
|
||||
- url_address
|
||||
- user_integral
|
||||
- user_integral_details
|
||||
- user_money
|
||||
- user_money_details
|
||||
- search
|
||||
- coupon_user
|
||||
- coupon
|
||||
- user_prize_exchange
|
||||
- user_sign_record
|
||||
- user_vip
|
||||
- vip_details
|
||||
- invite_achievement
|
||||
- user_integral
|
||||
- sys_user_token
|
||||
- sys_captcha
|
||||
- qrtz_triggers
|
||||
- qrtz_simprop_triggers
|
||||
- qrtz_simple_triggers
|
||||
- qrtz_scheduler_state
|
||||
- qrtz_paused_trigger_grps
|
||||
- qrtz_locks
|
||||
- qrtz_job_details
|
||||
- qrtz_fired_triggers
|
||||
- qrtz_cron_triggers
|
||||
- qrtz_calendars
|
||||
- qrtz_blob_triggers
|
||||
@@ -16,7 +16,7 @@
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectBannerPage" resultType="com.sqx.modules.banner.entity.Banner">
|
||||
<select id="selectBanner" resultType="com.sqx.modules.banner.entity.Banner">
|
||||
select * from banner
|
||||
where classify=#{classify}
|
||||
order by `sort` desc
|
||||
|
||||
@@ -1,14 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.sqx.modules.course.dao.CourseClassificationDao">
|
||||
<select id="selectCourseClassificationPage" resultType="com.sqx.modules.course.entity.CourseClassification">
|
||||
select * from course_classification where 1=1 and is_delete=0
|
||||
<if test ='null != classificationName'>
|
||||
and classification_name LIKE CONCAT('%', #{classificationName}, '%')
|
||||
</if>
|
||||
order by sort
|
||||
</select>
|
||||
|
||||
<select id="selectCourseClassificationList" resultType="com.sqx.modules.course.entity.CourseClassification">
|
||||
select * from course_classification where 1=1 and is_delete=0
|
||||
<if test ='null != classificationName'>
|
||||
@@ -23,4 +15,4 @@
|
||||
<select id="queryClassification" resultType="com.sqx.modules.course.response.ClassificationResponse">
|
||||
select classification_id ,classification_name from course_classification where is_delete=0;
|
||||
</select>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
@@ -26,50 +26,7 @@
|
||||
GROUP BY
|
||||
u.course_id, c.course_id, d.course_details_name, d.course_details_id
|
||||
ORDER BY
|
||||
produceEndTime DESC
|
||||
|
||||
<!-- SELECT
|
||||
MAX( u.update_time ) AS produceEndTime,
|
||||
c.*,
|
||||
(
|
||||
SELECT
|
||||
d.course_details_name
|
||||
FROM
|
||||
course_collect cc
|
||||
LEFT JOIN course_details d ON cc.course_details_id = d.course_details_id
|
||||
WHERE
|
||||
d.course_id = u.course_id
|
||||
AND cc.classify = 3 and cc.user_id=#{userId}
|
||||
ORDER BY
|
||||
cc.update_time DESC
|
||||
LIMIT 1
|
||||
) AS courseDetailsName,
|
||||
(
|
||||
SELECT
|
||||
d.course_details_id
|
||||
FROM
|
||||
course_collect cc
|
||||
LEFT JOIN course_details d ON cc.course_details_id = d.course_details_id
|
||||
WHERE
|
||||
d.course_id = u.course_id
|
||||
AND cc.classify = 3 and cc.user_id=#{userId}
|
||||
ORDER BY
|
||||
cc.update_time DESC
|
||||
LIMIT 1
|
||||
) AS courseDetailsId,
|
||||
( SELECT count(*) FROM course_details d WHERE d.course_id = c.course_id ) AS courseDetailsCount
|
||||
FROM
|
||||
course_collect u
|
||||
LEFT JOIN course c ON u.course_id = c.course_id
|
||||
WHERE
|
||||
u.user_id = #{userId}
|
||||
AND c.course_id IS NOT NULL
|
||||
AND u.classify = #{classify}
|
||||
GROUP BY
|
||||
u.course_id
|
||||
ORDER BY
|
||||
produceEndTime DESC
|
||||
-->
|
||||
produceEndTime DESC;
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -249,7 +249,7 @@
|
||||
WHERE
|
||||
c.is_delete = 0 and c.status=1
|
||||
<if test='null != title'>
|
||||
and c.title LIKE #{title}
|
||||
and c.title LIKE concat("%",#{title},"%")
|
||||
</if>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user