Commit fcf60b62 authored by m1991's avatar m1991

Merge remote-tracking branch 'origin/master'

parents 9b81f405 59314805
...@@ -5,6 +5,9 @@ import cn.wisenergy.model.app.AccountInfo; ...@@ -5,6 +5,9 @@ import cn.wisenergy.model.app.AccountInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/** /**
* @author 86187 * @author 86187
*/ */
...@@ -57,4 +60,17 @@ public interface AccountMapper extends BaseMapper<AccountInfo> { ...@@ -57,4 +60,17 @@ public interface AccountMapper extends BaseMapper<AccountInfo> {
* @return * @return
*/ */
int updateEarningsMonthAndEarningsTotalByid(AccountInfo accountInfo); int updateEarningsMonthAndEarningsTotalByid(AccountInfo accountInfo);
/**
* 统计
* @return 数量
*/
int count();
/**
* 获取账户列表
* @param map 条件
* @return 账户列表
*/
List<AccountInfo> getList(Map<String,Object> map);
} }
...@@ -4,6 +4,9 @@ import cn.wisenergy.model.app.MemberPercent; ...@@ -4,6 +4,9 @@ import cn.wisenergy.model.app.MemberPercent;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/** /**
* @author 86187 * @author 86187
*/ */
...@@ -39,4 +42,17 @@ public interface MemberPercentMapper extends BaseMapper<MemberPercent> { ...@@ -39,4 +42,17 @@ public interface MemberPercentMapper extends BaseMapper<MemberPercent> {
*/ */
MemberPercent getByLevelAndType(@Param("userLevel") Integer userLevel, @Param("type") Integer type); MemberPercent getByLevelAndType(@Param("userLevel") Integer userLevel, @Param("type") Integer type);
/**
* 统计条数
* @return 条数
*/
int count();
/**
* 获取会员优惠比列
* @param map 参数条件
* @return 列表
*/
List<MemberPercent> getList(Map<String,Object> map);
} }
...@@ -108,6 +108,21 @@ ...@@ -108,6 +108,21 @@
</where> </where>
</select> </select>
<select id="count" resultType="java.lang.Integer">
select count(1)
from
<include refid="table"/>
</select>
<select id="getList" resultType="cn.wisenergy.model.app.AccountInfo">
select
<include refid="cols_all"/>
from
<include refid="table"/>
order by create_time desc
limit #{startNum},#{endNum}
</select>
<update id="updateEarningsMonthAndEarningsTotalByid" parameterType="cn.wisenergy.model.app.AccountInfo"> <update id="updateEarningsMonthAndEarningsTotalByid" parameterType="cn.wisenergy.model.app.AccountInfo">
UPDATE UPDATE
<include refid="table"/> <include refid="table"/>
......
...@@ -83,4 +83,19 @@ ...@@ -83,4 +83,19 @@
</where> </where>
</select> </select>
<select id="count" resultType="java.lang.Integer">
select count(1)
from
<include refid="table"/>
</select>
<select id="getList" resultType="cn.wisenergy.model.app.MemberPercent">
select
<include refid="cols_all"/>
from
<include refid="table"/>
order by create_time desc
limit #{startNum},#{endNum}
</select>
</mapper> </mapper>
...@@ -38,18 +38,18 @@ public class MemberPercent implements Serializable { ...@@ -38,18 +38,18 @@ public class MemberPercent implements Serializable {
/** /**
* 等级对应的返佣比例 * 等级对应的返佣比例
*/ */
@ApiModelProperty(name = "", value = "") @ApiModelProperty(name = "percent", value = "等级对应的返佣比例")
private BigDecimal percent; private BigDecimal percent;
/** /**
* 创建时间 * 创建时间
*/ */
@ApiModelProperty(name = "", value = "") @ApiModelProperty(name = "createTime", value = "创建时间")
private Date createTime; private Date createTime;
/** /**
* 更新时间 * 更新时间
*/ */
@ApiModelProperty(name = "", value = "") @ApiModelProperty(name = "updateTime", value = "更新时间")
private Date updateTime; private Date updateTime;
} }
package cn.wisenergy.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author 86187
*/
@Data
@ApiModel("AccountInfoQuery")
public class AccountInfoQuery {
/**
* 页码
*/
@ApiModelProperty(value = "页码", name = "pageNo")
private Integer pageNo;
/**
* 页条数
*/
@ApiModelProperty(value = "页条数", name = "pageSize")
private Integer pageSize;
private Integer startNum;
private Integer endNum;
}
package cn.wisenergy.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author 86187
*/
@Data
@ApiModel("MemberPercentQuery")
public class MemberPercentQuery {
/**
* 页码
*/
@ApiModelProperty(value = "页码", name = "pageNo")
private Integer pageNo;
/**
* 页条数
*/
@ApiModelProperty(value = "页条数", name = "pageSize")
private Integer pageSize;
private Integer startNum;
private Integer endNum;
}
...@@ -3,21 +3,15 @@ package cn.wisenergy.service.app; ...@@ -3,21 +3,15 @@ package cn.wisenergy.service.app;
import cn.wisenergy.common.utils.R; import cn.wisenergy.common.utils.R;
import cn.wisenergy.model.app.AccountInfo; import cn.wisenergy.model.app.AccountInfo;
import cn.wisenergy.model.app.User; import cn.wisenergy.model.dto.AccountInfoQuery;
import com.github.pagehelper.PageInfo;
import java.util.List;
/** /**
* @author 86187 * @author 86187
*/ */
public interface AccountService { public interface AccountService {
/**
* 订单返佣-日任务
* @return true or false
*/
R<Boolean> orderRebate();
/** /**
* 获取账户信息 * 获取账户信息
* *
...@@ -27,24 +21,9 @@ public interface AccountService { ...@@ -27,24 +21,9 @@ public interface AccountService {
R<AccountInfo> getByUserId(String userId); R<AccountInfo> getByUserId(String userId);
/** /**
* 收益和业绩统计(月度肥料 -日) * 获取账户列表
* @return true or false * @param query 查询条件
*/ * @return 账户列表
R<Boolean> performanceCount();
/**
* 获取用户的商机信息
*
* @param userId 用户id
* @return 用户商机列表
*/
List<User> getByList(String userId);
/**
* 进步奖收益统计(最大进步奖) -日任务
*
* @return true or false
*/ */
R<Boolean> progressPrizeCount(); R<PageInfo<AccountInfo>> getList(AccountInfoQuery query);
} }
package cn.wisenergy.service.app;
import cn.wisenergy.common.utils.R;
import cn.wisenergy.model.app.User;
import java.util.List;
/**
*@ Description: 日定时任务
*@ Author : 86187
*@ Date : 2021/3/25 15:09
* @author 86187
*/
public interface DayTaskService {
/**
* 订单返佣-日任务
* @return true or false
*/
R<Boolean> orderRebate();
/**
* 收益和业绩统计(月度肥料 -日)
* @return true or false
*/
R<Boolean> performanceCount();
/**
* 获取用户的商机信息
*
* @param userId 用户id
* @return 用户商机列表
*/
List<User> getByList(String userId);
/**
* 进步奖收益统计(最大进步奖) -日任务
*
* @return true or false
*/
R<Boolean> progressPrizeCount();
}
package cn.wisenergy.service.app;
import cn.wisenergy.common.utils.R;
import cn.wisenergy.model.app.MemberPercent;
import cn.wisenergy.model.dto.MemberPercentQuery;
import com.github.pagehelper.PageInfo;
/**
* @author 86187
*/
public interface MemberPercentService {
/**
* 获取会员等级优惠比列列表
* @param query 条件
* @return 优惠比列列表
*/
R<PageInfo<MemberPercent>> getList(MemberPercentQuery query);
}
package cn.wisenergy.service.app.impl;
import cn.wisenergy.common.constant.CommonAttributes;
import cn.wisenergy.common.utils.R;
import cn.wisenergy.mapper.MemberPercentMapper;
import cn.wisenergy.model.app.MemberPercent;
import cn.wisenergy.model.app.TradeRecord;
import cn.wisenergy.model.dto.MemberPercentQuery;
import cn.wisenergy.model.dto.TradeRecordQuery;
import cn.wisenergy.service.app.MemberPercentService;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author 86187
*/
@Service
@Slf4j
public class MemberPercentServiceImpl implements MemberPercentService {
@Autowired
private MemberPercentMapper memberPercentMapper;
@Override
public R<PageInfo<MemberPercent>> getList(MemberPercentQuery query) {
log.info("sho[-mall[]MemberPercentServiceImpl[]getList[]input.method");
pageHandle(query);
Map<String,Object> map=new HashMap<>();
int total = memberPercentMapper.count();
map.put("startNum", query.getStartNum());
map.put("endNum", query.getEndNum());
List<MemberPercent> list = memberPercentMapper.getList(map);
PageInfo<MemberPercent> info = new PageInfo<>();
info.setPageSize(query.getPageSize());
info.setPageNum(query.getPageNo());
info.setTotal(total);
info.setList(list);
return R.ok(info);
}
/**
* 分页处理方法
*
* @param schemeVo 参数
*/
private void pageHandle(MemberPercentQuery schemeVo) {
Integer pageNum = schemeVo.getPageNo();
Integer pageSize = schemeVo.getPageSize();
if (null == pageSize || pageSize == 0) {
pageSize = 10;
}
if (null == pageNum || pageNum == 0) {
pageNum = 1;
}
Integer endNum = pageSize;
Integer startNum = (pageNum - CommonAttributes.NUM_ONE) * pageSize;
schemeVo.setEndNum(endNum);
schemeVo.setStartNum(startNum);
schemeVo.setPageNo(pageNum);
schemeVo.setPageSize(pageSize);
}
}
...@@ -12,6 +12,7 @@ import cn.wisenergy.model.vo.TeamPerformanceSortVo; ...@@ -12,6 +12,7 @@ import cn.wisenergy.model.vo.TeamPerformanceSortVo;
import cn.wisenergy.service.Manager.AccountManager; import cn.wisenergy.service.Manager.AccountManager;
import cn.wisenergy.service.Manager.PublicManager; import cn.wisenergy.service.Manager.PublicManager;
import cn.wisenergy.service.app.AccountService; import cn.wisenergy.service.app.AccountService;
import cn.wisenergy.service.app.DayTaskService;
import cn.wisenergy.service.app.MonthTaskService; import cn.wisenergy.service.app.MonthTaskService;
import com.xxl.job.core.handler.annotation.XxlJob; import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -58,7 +59,7 @@ public class MonthTaskServiceImpl implements MonthTaskService { ...@@ -58,7 +59,7 @@ public class MonthTaskServiceImpl implements MonthTaskService {
private ProgressPrizeMapper progressPrizeMapper; private ProgressPrizeMapper progressPrizeMapper;
@Autowired @Autowired
private AccountService accountService; private DayTaskService dayTaskService;
@Autowired @Autowired
private MonthManureMapper monthManureMapper; private MonthManureMapper monthManureMapper;
...@@ -124,7 +125,7 @@ public class MonthTaskServiceImpl implements MonthTaskService { ...@@ -124,7 +125,7 @@ public class MonthTaskServiceImpl implements MonthTaskService {
} }
//2)、获取当前用户的上级用户列表 //2)、获取当前用户的上级用户列表
List<User> userList = accountService.getByList(userId); List<User> userList = dayTaskService.getByList(userId);
if (CollectionUtils.isEmpty(userList)) { if (CollectionUtils.isEmpty(userList)) {
continue; continue;
} }
......
...@@ -3,8 +3,11 @@ package cn.wisenergy.web.admin.controller.app; ...@@ -3,8 +3,11 @@ package cn.wisenergy.web.admin.controller.app;
import cn.wisenergy.common.utils.R; import cn.wisenergy.common.utils.R;
import cn.wisenergy.model.app.AccountInfo; import cn.wisenergy.model.app.AccountInfo;
import cn.wisenergy.model.app.User; import cn.wisenergy.model.app.User;
import cn.wisenergy.model.dto.AccountInfoQuery;
import cn.wisenergy.service.app.AccountService; import cn.wisenergy.service.app.AccountService;
import cn.wisenergy.service.app.DayTaskService;
import cn.wisenergy.web.common.BaseController; import cn.wisenergy.web.common.BaseController;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -14,8 +17,6 @@ import org.springframework.web.bind.annotation.GetMapping; ...@@ -14,8 +17,6 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/** /**
* @author 86187 * @author 86187
*/ */
...@@ -27,6 +28,9 @@ public class AccountController extends BaseController { ...@@ -27,6 +28,9 @@ public class AccountController extends BaseController {
@Autowired @Autowired
private AccountService accountService; private AccountService accountService;
@Autowired
private DayTaskService dayTaskService;
@ApiOperation(value = "获取账户信息", notes = "获取账户信息", httpMethod = "GET") @ApiOperation(value = "获取账户信息", notes = "获取账户信息", httpMethod = "GET")
@ApiImplicitParam(name = "userId", value = "用户id", dataType = "String") @ApiImplicitParam(name = "userId", value = "用户id", dataType = "String")
@GetMapping("/getByUserId") @GetMapping("/getByUserId")
...@@ -34,30 +38,32 @@ public class AccountController extends BaseController { ...@@ -34,30 +38,32 @@ public class AccountController extends BaseController {
return accountService.getByUserId(userId); return accountService.getByUserId(userId);
} }
@ApiOperation(value = "获取账户列表信息", notes = "获取账户列表信息", httpMethod = "GET")
@ApiImplicitParam(name = "userId", value = "用户id", dataType = "String") @ApiOperation(value = "获取账户分页列表", notes = "获取账户分页列表", httpMethod = "GET")
@GetMapping("/getByList") @ApiImplicitParam(name = "query", value = "查询条件", dataType = "AccountInfoQuery")
public List<User> getByList(String userId) { @GetMapping("/getList")
return accountService.getByList(userId); public R<PageInfo<AccountInfo>> getList(AccountInfoQuery query) {
return accountService.getList(query);
} }
/***********************************************测试日定时任务***************************/
@ApiOperation(value = "订单佣金", notes = "订单佣金", httpMethod = "GET") @ApiOperation(value = "订单佣金", notes = "订单佣金", httpMethod = "GET")
@GetMapping("/orderRebate") @GetMapping("/orderRebate")
public R<Boolean> orderRebate() { public R<Boolean> orderRebate() {
return accountService.orderRebate(); return dayTaskService.orderRebate();
} }
@ApiOperation(value = "月度肥料", notes = "月度肥料", httpMethod = "GET") @ApiOperation(value = "月度肥料", notes = "月度肥料", httpMethod = "GET")
@GetMapping("/monthManure") @GetMapping("/monthManure")
public R<Boolean> monthManure() { public R<Boolean> monthManure() {
return accountService.performanceCount(); return dayTaskService.performanceCount();
} }
@ApiOperation(value = "最大进步奖", notes = "最大进步奖", httpMethod = "GET") @ApiOperation(value = "最大进步奖", notes = "最大进步奖", httpMethod = "GET")
@GetMapping("/growAward") @GetMapping("/growAward")
public R<Boolean> growAward() { public R<Boolean> growAward() {
return accountService.progressPrizeCount(); return dayTaskService.progressPrizeCount();
} }
} }
package cn.wisenergy.web.admin.controller.app;
import cn.wisenergy.common.utils.R;
import cn.wisenergy.model.app.MemberPercent;
import cn.wisenergy.model.dto.MemberPercentQuery;
import cn.wisenergy.service.app.MemberPercentService;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author 86187
*/
@Api(tags = "会员优惠比列-后台管理")
@RestController
@RequestMapping("/member")
@Slf4j
public class MemberController {
@Autowired
private MemberPercentService memberPercentService;
@ApiOperation(value = "获取会员优惠比列列表", notes = "获取会员优惠比列列表", httpMethod = "GET")
@ApiImplicitParam(name = "query", value = "查询参数", dataType = "MemberPercentQuery")
@GetMapping("/getList")
public R<PageInfo<MemberPercent>> getList(MemberPercentQuery query) {
log.info("shop-mall[]MemberController[]getList[]input.param.query:" + query);
if (null == query) {
return R.error("入参为空!");
}
return memberPercentService.getList(query);
}
}
...@@ -2,11 +2,8 @@ package cn.wisenergy.web.admin.controller.app; ...@@ -2,11 +2,8 @@ package cn.wisenergy.web.admin.controller.app;
import cn.wisenergy.common.utils.R; import cn.wisenergy.common.utils.R;
import cn.wisenergy.mapper.SysUserMapper; import cn.wisenergy.mapper.SysUserMapper;
import cn.wisenergy.model.app.ProgressPrize;
import cn.wisenergy.model.app.SysUser; import cn.wisenergy.model.app.SysUser;
import cn.wisenergy.model.dto.ProgressPrizeQuery;
import cn.wisenergy.model.dto.SysLoginDto; import cn.wisenergy.model.dto.SysLoginDto;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment