技师统计
This commit is contained in:
parent
db0cdebc9d
commit
aee08e00ba
|
@ -286,6 +286,7 @@ public class UserMoneyDetailsServiceImpl extends ServiceImpl<UserMoneyDetailsDao
|
|||
}
|
||||
//只查询操作余额的数据
|
||||
queryWrapper.eq("manipulate_type", 2);
|
||||
queryWrapper.eq("bl_role", 2);
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
IPage<UserMoneyDetails> page2 = baseMapper.selectPage(page1, queryWrapper);
|
||||
//资金明细添加到返回对象中
|
||||
|
@ -294,9 +295,11 @@ public class UserMoneyDetailsServiceImpl extends ServiceImpl<UserMoneyDetailsDao
|
|||
QueryWrapper<UserMoneyDetails> queryWrapper1 = new QueryWrapper();
|
||||
QueryWrapper<UserMoneyDetails> queryWrapper2 = new QueryWrapper();
|
||||
queryWrapper1.eq("user_id", period.getArtificerId());
|
||||
queryWrapper1.eq("bl_role", 2);
|
||||
queryWrapper1.select("sum(money) as sum_value");
|
||||
|
||||
queryWrapper2.eq("user_id", period.getArtificerId());
|
||||
queryWrapper2.eq("bl_role", 2);
|
||||
queryWrapper2.select("sum(money) as sum_value");
|
||||
if(StringUtil.isNotEmpty(period.getStartFundData().toString())){
|
||||
queryWrapper1.between("create_time", period.getStartFundData(), period.getEndFundData());
|
||||
|
|
|
@ -35,4 +35,6 @@ public interface UserRechargeDao extends BaseMapper<UserRecharge> {
|
|||
@Param("artificerId") String artificerId);
|
||||
|
||||
List<UserRecharge> selectStoredList(@Param("createTime") String createTime);
|
||||
|
||||
List<UserRecharge> selectRechargeList(@Param("createTime") String createTime);
|
||||
}
|
|
@ -55,7 +55,7 @@ public class AppArtificerIntegralServiceImpl implements AppArtificerIntegralServ
|
|||
public Result home(Long artificerId) {
|
||||
Artificer artificer = artificerDao.selectById(artificerId);
|
||||
//91精油 95 中医
|
||||
String classifyId = artificer.getClassifyId().toString();
|
||||
String classifyId = artificer.getClassifyId();
|
||||
|
||||
HomeVO orders = new HomeVO();
|
||||
String startDate = DateUtil.formatDateTime(obtainCycle(new Date()).getStartFundData());
|
||||
|
@ -67,79 +67,77 @@ public class AppArtificerIntegralServiceImpl implements AppArtificerIntegralServ
|
|||
}
|
||||
orders.setGrade(grade);
|
||||
|
||||
ArtificerIntegralStatistics artificerIntegralStatistics =artificerIntegralStatisticsService.getIntegralStatistics(artificerId,startDate,endDate,null);
|
||||
//当期业绩
|
||||
// Integer currentPerformance = ordersDao.selectOrdersArtificerIntegralAchievement(artificerId, endDate, startDate);
|
||||
BigDecimal currentPerformance = artificerIntegralStatistics.getAchievement();
|
||||
orders.setCurrentPerformance(String.valueOf(currentPerformance));
|
||||
|
||||
ArtificerIntegralStatistics artificerIntegralStatistics = artificerIntegralStatisticsService.getIntegralStatistics(artificerId,startDate,endDate,null);
|
||||
//当期业绩
|
||||
BigDecimal currentPerformance = BigDecimal.ZERO;
|
||||
//当期收益
|
||||
// String earnings = ordersDao.earnings(artificerId, endDate, startDate);
|
||||
// BigDecimal earnings = ordersDao.selectOrdersArtificerIntegralEarnings(artificerId, endDate, startDate);
|
||||
// earnings = earnings.setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||
// orders.setEarnings(earnings.toString());
|
||||
BigDecimal earnings = artificerIntegralStatistics.getIncome();
|
||||
BigDecimal earnings = BigDecimal.ZERO;
|
||||
//总积分
|
||||
BigDecimal add = BigDecimal.ZERO;
|
||||
if(artificerIntegralStatistics!=null){
|
||||
currentPerformance = artificerIntegralStatistics.getAchievement();
|
||||
earnings = artificerIntegralStatistics.getIncome();
|
||||
add = artificerIntegralStatistics.getIntegral();
|
||||
}
|
||||
orders.setCurrentPerformance(String.valueOf(currentPerformance));
|
||||
orders.setEarnings(String.valueOf(earnings));
|
||||
orders.setIntegral(add);
|
||||
|
||||
//当日收益
|
||||
String todayEndIncome = DateUtil.formatDateTime(DateUtil.endOfDay(new Date()));
|
||||
// String dailyEarnings = ordersDao.earnings(artificerId, todayEndIncome, String.valueOf(DateUtil.beginOfDay(new Date())));
|
||||
// BigDecimal dailyEarnings = ordersDao.selectOrdersArtificerIntegralEarnings(artificerId, todayEndIncome, String.valueOf(DateUtil.beginOfDay(new Date())));
|
||||
// dailyEarnings = dailyEarnings.setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||
// orders.setDailyEarnings(dailyEarnings.toString());
|
||||
ArtificerIntegralStatistics todayStatistics =artificerIntegralStatisticsService.getIntegralStatistics(artificerId,startDate,todayEndIncome,null);
|
||||
orders.setDailyEarnings(String.valueOf(todayStatistics.getIncome()));
|
||||
BigDecimal drEarnings = BigDecimal.ZERO;
|
||||
if(todayStatistics!=null){
|
||||
drEarnings = todayStatistics.getIncome();
|
||||
}
|
||||
orders.setDailyEarnings(String.valueOf(drEarnings));
|
||||
|
||||
//当月收益
|
||||
//当月结束日
|
||||
String startFundDataformat = DateUtil.formatDateTime(DateUtil.beginOfMonth(new Date()));
|
||||
String endFundDataformat = DateUtil.formatDateTime(DateUtil.endOfMonth(new Date()));
|
||||
// String currentMonthsIncome = ordersDao.earnings(artificerId, endFundDataformat, startFundDataformat);
|
||||
BigDecimal currentMonthsIncome = ordersDao.selectOrdersArtificerIntegralEarnings(artificerId, endFundDataformat, startFundDataformat);
|
||||
currentMonthsIncome = currentMonthsIncome.setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||
orders.setCurrentMonthsIncome(currentMonthsIncome.toString());
|
||||
ArtificerIntegralStatistics dyStatistics = artificerIntegralStatisticsService.getIntegralStatistics(artificerId,startFundDataformat,endFundDataformat,null);
|
||||
BigDecimal dyEarnings = BigDecimal.ZERO;
|
||||
if(dyStatistics!=null){
|
||||
dyEarnings = dyStatistics.getIncome();
|
||||
}
|
||||
orders.setCurrentMonthsIncome(String.valueOf(dyEarnings));
|
||||
|
||||
//当期结束日
|
||||
Period period = obtainCycle(new Date());
|
||||
orders.setCurrentEndDate(DateUtil.formatDateTime(period.getEndFundData()));
|
||||
|
||||
// //当前周期储值积分数
|
||||
// String storedValueIntegral = ordersDao.selectOrdersStoredValueIntegral(artificerId, endDate, startDate);
|
||||
// //当前周在线积分数
|
||||
// String onlineCredits = ordersDao.selectOnlineCredits(artificerId, endDate, startDate);
|
||||
// BigDecimal a = new BigDecimal(storedValueIntegral);
|
||||
// BigDecimal b = new BigDecimal(onlineCredits);
|
||||
// //储存积分数 加上在线积分数 等于当期积分
|
||||
// BigDecimal add = a.add(b);
|
||||
// List<Orders> zxscList = ordersDao.getZxscList(artificerId,startDate,endDate);
|
||||
// BigDecimal b = BigDecimal.ZERO;
|
||||
// for (Orders par:zxscList) {
|
||||
// BigDecimal jf = new BigDecimal(par.getJifen());
|
||||
// b = b.add(jf);
|
||||
// }
|
||||
|
||||
//获取所有积分方法
|
||||
// Map<String,Object> jfMap = getJifenList(artificerId, startDate, endDate);
|
||||
// String zxjf = jfMap.get("zxscjf").toString();
|
||||
// BigDecimal b = new BigDecimal(zxjf);
|
||||
|
||||
List<Orders> zxscList = ordersDao.getZxscList(artificerId,startDate,endDate);
|
||||
ArtificerIntegralStatistics zxscStatistics = artificerIntegralStatisticsService.getIntegralStatistics(artificerId,startDate,endDate,1);
|
||||
BigDecimal b = BigDecimal.ZERO;
|
||||
for (Orders par:zxscList) {
|
||||
BigDecimal jf = new BigDecimal(par.getJifen());
|
||||
b = b.add(jf);
|
||||
if(zxscStatistics!=null){
|
||||
b = zxscStatistics.getIntegral();
|
||||
}
|
||||
|
||||
//总积分
|
||||
// String sumJf = jfMap.get("sumJf").toString();
|
||||
// BigDecimal add = new BigDecimal(sumJf);
|
||||
BigDecimal add = artificerIntegralStatistics.getIntegral();
|
||||
orders.setIntegral(add);
|
||||
|
||||
//当期订单数:计算订单发生了按摩行为的订单数,订单状态经历了开始服务到订单结束。
|
||||
String currentPeriodOrdersSum = ordersDao.selectOrdersArtificerIntegral(artificerId, endDate, startDate);
|
||||
orders.setCurrentPeriodOrdersSum(currentPeriodOrdersSum);
|
||||
// String currentPeriodOrdersSum = ordersDao.selectOrdersArtificerIntegral(artificerId, endDate, startDate);
|
||||
// orders.setCurrentPeriodOrdersSum(currentPeriodOrdersSum);
|
||||
|
||||
List<ArtificerIntegralStatistics> ordersList = artificerIntegralStatisticsService.getIntegralList(artificerId,startDate,endDate,3);
|
||||
BigDecimal currentPeriodOrdersSum = BigDecimal.ZERO;
|
||||
if(ordersList!=null && ordersList.size()>0){
|
||||
currentPeriodOrdersSum = new BigDecimal(ordersList.size());
|
||||
}
|
||||
orders.setCurrentPeriodOrdersSum(String.valueOf(currentPeriodOrdersSum));
|
||||
|
||||
//当期加钟率:本周期内,加钟数/本单数
|
||||
String v = ordersDao.selectOrdersArtificerIntegraladdNum(artificerId, endDate, startDate);
|
||||
//加钟数
|
||||
BigDecimal currentPeriodAddBellsSumBig = new BigDecimal(v);
|
||||
//订单数
|
||||
BigDecimal currentPeriodOrdersSumBig = new BigDecimal(currentPeriodOrdersSum);
|
||||
BigDecimal currentPeriodOrdersSumBig = currentPeriodOrdersSum;
|
||||
BigDecimal clockRate = null;
|
||||
//充值率
|
||||
BigDecimal divide1 = null;
|
||||
|
@ -161,127 +159,239 @@ public class AppArtificerIntegralServiceImpl implements AppArtificerIntegralServ
|
|||
divide1 = new BigDecimal("0");
|
||||
}
|
||||
|
||||
//业绩后面的显示
|
||||
List<ArtificerPartitioningDetails> lists = artificerPartitioningDetailsDao.selectList(Wrappers.<ArtificerPartitioningDetails>lambdaQuery());
|
||||
for (int i = 0; i < lists.size(); i++) {
|
||||
if (currentPerformance.compareTo(lists.get(i).getOutstandingAchievement())>=0) {
|
||||
if (i + 1 < lists.size()) {
|
||||
BigDecimal bigDecimal = lists.get(i + 1).getOutstandingAchievement();
|
||||
if (Objects.nonNull(bigDecimal)) {
|
||||
orders.setSuffix(NumberUtil.toStr(bigDecimal));
|
||||
}
|
||||
}
|
||||
} else if (currentPerformance.compareTo(lists.get(i).getOutstandingAchievement())<=0) {
|
||||
orders.setSuffix(NumberUtil.toStr(artificerPartitioningDetailsDao.selectById(5).getOutstandingAchievement()));
|
||||
}
|
||||
}
|
||||
//业绩后面的显示 暂时无用
|
||||
// List<ArtificerPartitioningDetails> lists = artificerPartitioningDetailsDao.selectList(Wrappers.<ArtificerPartitioningDetails>lambdaQuery());
|
||||
// for (int i = 0; i < lists.size(); i++) {
|
||||
// if (currentPerformance.compareTo(lists.get(i).getOutstandingAchievement())>=0) {
|
||||
// if (i + 1 < lists.size()) {
|
||||
// BigDecimal bigDecimal = lists.get(i + 1).getOutstandingAchievement();
|
||||
// if (Objects.nonNull(bigDecimal)) {
|
||||
// orders.setSuffix(NumberUtil.toStr(bigDecimal));
|
||||
// }
|
||||
// }
|
||||
// } else if (currentPerformance.compareTo(lists.get(i).getOutstandingAchievement())<=0) {
|
||||
// orders.setSuffix(NumberUtil.toStr(artificerPartitioningDetailsDao.selectById(5).getOutstandingAchievement()));
|
||||
// }
|
||||
// }
|
||||
|
||||
//currentPerformance 当期业绩
|
||||
//clockRate 当期加钟率
|
||||
//divide1 当期充值率
|
||||
//b 当期在线积分
|
||||
//add 当期总积分
|
||||
//orders HomeVO存放各种统计
|
||||
//artificer 技师信息
|
||||
//classifyId 技师服务类型
|
||||
return getResult(currentPerformance, clockRate, divide1, b, add, orders, artificer, classifyId);
|
||||
}
|
||||
|
||||
private Result getResult(BigDecimal currentPerformance, BigDecimal clockRate, BigDecimal divide1, BigDecimal b, BigDecimal add, HomeVO orders, Artificer artificer, String classifyId) {
|
||||
List<ArtificerPartitioningDetails> artificerPartitioningDetails = artificerPartitioningDetailsDao.selectList(Wrappers.<ArtificerPartitioningDetails>lambdaQuery()
|
||||
.ne(ArtificerPartitioningDetails::getGrade, "A0"));
|
||||
|
||||
//多少分钟等1积分
|
||||
CommonInfo commonInfo = commonInfoDao.findOne(100000);
|
||||
String value = commonInfo.getValue();
|
||||
BigDecimal zxcs = b.multiply(new BigDecimal(value)).divide(new BigDecimal("60"), BigDecimal.ROUND_DOWN);//在线时长(小时)
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.ne("grade","新");
|
||||
queryWrapper.orderByAsc("id");
|
||||
List<ArtificerPartitioningDetails> artificerPartitioningDetails = artificerPartitioningDetailsDao.selectList(queryWrapper);
|
||||
int ydd = 0;//已到达
|
||||
int xyj = 0;//下一级
|
||||
String grade = "";
|
||||
String subtractDj = "";
|
||||
for (int i = 0; i < artificerPartitioningDetails.size(); i++) {
|
||||
ArtificerPartitioningDetails item = artificerPartitioningDetails.get(i);
|
||||
if(i==0) {
|
||||
grade = item.getGrade();
|
||||
subtractDj = item.getGrade();
|
||||
}
|
||||
//技师业绩
|
||||
BigDecimal outstandingAchievement = item.getOutstandingAchievement();
|
||||
//加钟率
|
||||
BigDecimal clockRate1 = item.getClockRate();
|
||||
//充值率
|
||||
BigDecimal depositRate = item.getDepositRate();
|
||||
//在线时长
|
||||
//在线时长(小时)
|
||||
Integer durationOnline = item.getDurationOnline();
|
||||
//积分
|
||||
String integral = item.getIntegral();
|
||||
|
||||
//多少分钟等1积分
|
||||
CommonInfo commonInfo = commonInfoDao.findOne(100000);
|
||||
String value = commonInfo.getValue();
|
||||
|
||||
if (i + 1 < artificerPartitioningDetails.size()) {
|
||||
|
||||
ArtificerPartitioningDetails items = artificerPartitioningDetails.get(i + 1);
|
||||
|
||||
if (currentPerformance.compareTo(outstandingAchievement)>=0
|
||||
&& clockRate.compareTo(clockRate1) > -1
|
||||
&& divide1.compareTo(depositRate) > -1
|
||||
&& b.intValue() >= durationOnline
|
||||
&& add.intValue() >= Integer.valueOf(integral)
|
||||
&& Objects.nonNull(items)
|
||||
) {
|
||||
BigDecimal p1 = currentPerformance;
|
||||
|
||||
//还差多少业绩加钟率积分提升等级
|
||||
BigDecimal siq = new BigDecimal(items.getOutstandingAchievement().toString());
|
||||
BigDecimal jf = new BigDecimal(items.getIntegral());
|
||||
BigDecimal jzl = new BigDecimal(items.getClockRate().toString());
|
||||
BigDecimal czl = new BigDecimal(items.getDepositRate().toString());
|
||||
|
||||
//差的业绩
|
||||
BigDecimal subtract = siq.subtract(p1);
|
||||
if (p1.intValue() >= siq.intValue()) {
|
||||
subtract = new BigDecimal("0");
|
||||
}
|
||||
//差的加钟率
|
||||
BigDecimal clockRateJzl1 = jzl.subtract(clockRate);
|
||||
if (clockRate.compareTo(jzl) > -1) {
|
||||
clockRateJzl1 = new BigDecimal("0");
|
||||
}
|
||||
//差的充值率
|
||||
BigDecimal divide11 = czl.subtract(divide1);
|
||||
if (clockRate.compareTo(jzl) > -1) {
|
||||
divide11 = new BigDecimal("0");
|
||||
}
|
||||
//差的在线时长
|
||||
BigDecimal shi = new BigDecimal(value);
|
||||
BigDecimal multiply1 = b.multiply(shi);
|
||||
BigDecimal divide = multiply1.divide(new BigDecimal("60"), ROUND_CEILING);
|
||||
BigDecimal bs = new BigDecimal(items.getDurationOnline().toString());
|
||||
BigDecimal subtract2 = bs.subtract(divide);
|
||||
|
||||
if (divide.compareTo(bs) > -1) {
|
||||
subtract2 = new BigDecimal("0");
|
||||
}
|
||||
|
||||
//差的积分
|
||||
BigDecimal subtract1 = jf.subtract(add);
|
||||
if (add.intValue() >= jf.intValue()) {
|
||||
subtract1 = new BigDecimal("0");
|
||||
}
|
||||
|
||||
//差的业绩
|
||||
orders.setDifferenceOutstandingAchievement(subtract.stripTrailingZeros().toPlainString());
|
||||
//差的积分
|
||||
orders.setDifferenceIntegral(NumberUtil.toStr(subtract1));
|
||||
//差的加钟率
|
||||
orders.setDifferenceClockRate(String.valueOf(clockRateJzl1));
|
||||
//差的充值率
|
||||
orders.setDepositRate(String.valueOf(divide11));
|
||||
//差的在线时长
|
||||
orders.setDifferenceDurationOnline(String.valueOf(subtract2));
|
||||
//差的等级
|
||||
orders.setDifferenceGrade(items.getGrade());
|
||||
String ultimately = "上周期等级:" + artificer.getGrade() + ";" + "本周期等级:" + item.getGrade() + ";" + "还差" + subtract.stripTrailingZeros().toPlainString() + "业绩;" + subtract1 + "积分;" + clockRateJzl1 + "加钟率;" + divide11 + "充值率;" + subtract2 + "在线时长;" + "可以升级" + items.getGrade();
|
||||
orders.setUltimately(ultimately);
|
||||
if (subtract.stripTrailingZeros().toPlainString().equals("0")
|
||||
&& subtract1.stripTrailingZeros().toPlainString().equals("0")
|
||||
&& clockRateJzl1.stripTrailingZeros().toPlainString().equals("0")
|
||||
&& divide11.stripTrailingZeros().toPlainString().equals("0")
|
||||
&& subtract2.stripTrailingZeros().toPlainString().equals("0")
|
||||
&& items.getGrade().equals("A5")
|
||||
) {
|
||||
orders.setMaxStatus(true);
|
||||
} else {
|
||||
orders.setMaxStatus(false);
|
||||
}
|
||||
|
||||
}
|
||||
if (currentPerformance.compareTo(outstandingAchievement) >= 0
|
||||
&& zxcs.intValue() >= durationOnline
|
||||
&& add.intValue() >= Integer.valueOf(integral)
|
||||
) {
|
||||
ydd = i;
|
||||
} else {
|
||||
xyj = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
//差的在线时长
|
||||
BigDecimal subtractSc = BigDecimal.ZERO;
|
||||
BigDecimal subtractYj = BigDecimal.ZERO;
|
||||
BigDecimal subtractJf = BigDecimal.ZERO;
|
||||
String ultimately = "";
|
||||
|
||||
if(ydd == artificerPartitioningDetails.size()){
|
||||
//满级
|
||||
ultimately = "上周期等级:" + artificer.getGrade() + ";" + "本周期等级:" + grade + ",已满级";
|
||||
orders.setMaxStatus(true);//是否满级
|
||||
}else{
|
||||
//已达到,未达到
|
||||
ArtificerPartitioningDetails entity = artificerPartitioningDetails.get(ydd);
|
||||
grade = entity.getGrade();
|
||||
//没到达任何一级,则显示最底等级
|
||||
ArtificerPartitioningDetails item = artificerPartitioningDetails.get(xyj);
|
||||
//还差多少业绩积分提升等级
|
||||
BigDecimal durationOnline = new BigDecimal(item.getDurationOnline());
|
||||
BigDecimal outstandingAchievement = item.getOutstandingAchievement();
|
||||
BigDecimal integral = new BigDecimal(item.getIntegral());
|
||||
//差的在线时长
|
||||
subtractSc = durationOnline.subtract(zxcs);
|
||||
subtractSc = subtractSc.setScale(0,BigDecimal.ROUND_DOWN);
|
||||
if(subtractSc.compareTo(BigDecimal.ZERO) <0){
|
||||
subtractSc = BigDecimal.ZERO;
|
||||
}
|
||||
//差的业绩
|
||||
subtractYj = outstandingAchievement.subtract(currentPerformance);
|
||||
subtractYj = subtractYj.setScale(0,BigDecimal.ROUND_DOWN);
|
||||
if(subtractYj.compareTo(BigDecimal.ZERO) <0){
|
||||
subtractYj = BigDecimal.ZERO;
|
||||
}
|
||||
//差的积分
|
||||
subtractJf = integral.subtract(add);
|
||||
subtractJf = subtractJf.setScale(0,BigDecimal.ROUND_DOWN);
|
||||
if(subtractJf.compareTo(BigDecimal.ZERO) <0){
|
||||
subtractJf = BigDecimal.ZERO;
|
||||
}
|
||||
//差的等级
|
||||
subtractDj = item.getGrade();
|
||||
ultimately = "上周期等级:" + artificer.getGrade() + ";本周期等级:" + grade + ";还差";
|
||||
if(subtractSc.compareTo(BigDecimal.ZERO) >0){
|
||||
ultimately = ultimately + subtractSc + "小时在线时长,";
|
||||
}
|
||||
if(subtractYj.compareTo(BigDecimal.ZERO) >0){
|
||||
ultimately = ultimately + subtractYj + "业绩,";
|
||||
}
|
||||
if(subtractJf.compareTo(BigDecimal.ZERO) >0){
|
||||
ultimately = ultimately + subtractJf + "积分,";
|
||||
}
|
||||
ultimately = ultimately + "可以升级到" + subtractDj;
|
||||
orders.setMaxStatus(false);//是否满级
|
||||
}
|
||||
|
||||
//差的在线时长
|
||||
orders.setDifferenceDurationOnline(String.valueOf(subtractSc));
|
||||
//差的业绩
|
||||
orders.setDifferenceOutstandingAchievement(String.valueOf(subtractYj));
|
||||
//差的积分
|
||||
orders.setDifferenceIntegral(String.valueOf(subtractJf));
|
||||
//差的等级
|
||||
orders.setDifferenceGrade(subtractDj);
|
||||
orders.setGrade(grade);
|
||||
orders.setLastGrade(artificer.getGrade());
|
||||
orders.setUltimately(ultimately);
|
||||
|
||||
return Result.success().put("data", orders);
|
||||
}
|
||||
|
||||
// private Result getResult(BigDecimal currentPerformance, BigDecimal clockRate, BigDecimal divide1, BigDecimal b, BigDecimal add, HomeVO orders, Artificer artificer, String classifyId) {
|
||||
|
||||
// List<ArtificerPartitioningDetails> artificerPartitioningDetails = artificerPartitioningDetailsDao.selectList(Wrappers.<ArtificerPartitioningDetails>lambdaQuery()
|
||||
// .ne(ArtificerPartitioningDetails::getGrade, "A0"));
|
||||
// for (int i = 0; i < artificerPartitioningDetails.size(); i++) {
|
||||
// ArtificerPartitioningDetails item = artificerPartitioningDetails.get(i);
|
||||
// //技师业绩
|
||||
// BigDecimal outstandingAchievement = item.getOutstandingAchievement();
|
||||
// //加钟率
|
||||
// BigDecimal clockRate1 = item.getClockRate();
|
||||
// //充值率
|
||||
// BigDecimal depositRate = item.getDepositRate();
|
||||
// //在线时长(小时)
|
||||
// Integer durationOnline = item.getDurationOnline();
|
||||
// //积分
|
||||
// String integral = item.getIntegral();
|
||||
//
|
||||
//
|
||||
//
|
||||
// if (i + 1 < artificerPartitioningDetails.size()) {
|
||||
//
|
||||
// ArtificerPartitioningDetails items = artificerPartitioningDetails.get(i + 1);
|
||||
//
|
||||
// if (currentPerformance.compareTo(outstandingAchievement)>=0
|
||||
// && clockRate.compareTo(clockRate1) > -1
|
||||
// && divide1.compareTo(depositRate) > -1
|
||||
// && b.intValue() >= durationOnline
|
||||
// && add.intValue() >= Integer.valueOf(integral)
|
||||
// && Objects.nonNull(items)
|
||||
// ) {
|
||||
// BigDecimal p1 = currentPerformance;
|
||||
//
|
||||
// //还差多少业绩加钟率积分提升等级
|
||||
// BigDecimal siq = new BigDecimal(items.getOutstandingAchievement().toString());
|
||||
// BigDecimal jf = new BigDecimal(items.getIntegral());
|
||||
// BigDecimal jzl = new BigDecimal(items.getClockRate().toString());
|
||||
// BigDecimal czl = new BigDecimal(items.getDepositRate().toString());
|
||||
//
|
||||
// //差的业绩
|
||||
// BigDecimal subtract = siq.subtract(p1);
|
||||
// if (p1.intValue() >= siq.intValue()) {
|
||||
// subtract = new BigDecimal("0");
|
||||
// }
|
||||
// //差的加钟率
|
||||
// BigDecimal clockRateJzl1 = jzl.subtract(clockRate);
|
||||
// if (clockRate.compareTo(jzl) > -1) {
|
||||
// clockRateJzl1 = new BigDecimal("0");
|
||||
// }
|
||||
// //差的充值率
|
||||
// BigDecimal divide11 = czl.subtract(divide1);
|
||||
// if (clockRate.compareTo(jzl) > -1) {
|
||||
// divide11 = new BigDecimal("0");
|
||||
// }
|
||||
// //差的在线时长
|
||||
// BigDecimal shi = new BigDecimal(value);
|
||||
// BigDecimal multiply1 = b.multiply(shi);
|
||||
// BigDecimal divide = multiply1.divide(new BigDecimal("60"), ROUND_CEILING);
|
||||
// BigDecimal bs = new BigDecimal(items.getDurationOnline().toString());
|
||||
// BigDecimal subtract2 = bs.subtract(divide);
|
||||
//
|
||||
// if (divide.compareTo(bs) > -1) {
|
||||
// subtract2 = new BigDecimal("0");
|
||||
// }
|
||||
//
|
||||
// //差的积分
|
||||
// BigDecimal subtract1 = jf.subtract(add);
|
||||
// if (add.intValue() >= jf.intValue()) {
|
||||
// subtract1 = new BigDecimal("0");
|
||||
// }
|
||||
//
|
||||
// //差的业绩
|
||||
// orders.setDifferenceOutstandingAchievement(subtract.stripTrailingZeros().toPlainString());
|
||||
// //差的积分
|
||||
// orders.setDifferenceIntegral(NumberUtil.toStr(subtract1));
|
||||
// //差的加钟率
|
||||
// orders.setDifferenceClockRate(String.valueOf(clockRateJzl1));
|
||||
// //差的充值率
|
||||
// orders.setDepositRate(String.valueOf(divide11));
|
||||
// //差的在线时长
|
||||
// orders.setDifferenceDurationOnline(String.valueOf(subtract2));
|
||||
// //差的等级
|
||||
// orders.setDifferenceGrade(items.getGrade());
|
||||
// String ultimately = "上周期等级:" + artificer.getGrade() + ";" + "本周期等级:" + item.getGrade() + ";" + "还差" + subtract.stripTrailingZeros().toPlainString() + "业绩;" + subtract1 + "积分;" + clockRateJzl1 + "加钟率;" + divide11 + "充值率;" + subtract2 + "在线时长;" + "可以升级" + items.getGrade();
|
||||
// orders.setUltimately(ultimately);
|
||||
// if (subtract.stripTrailingZeros().toPlainString().equals("0")
|
||||
// && subtract1.stripTrailingZeros().toPlainString().equals("0")
|
||||
// && clockRateJzl1.stripTrailingZeros().toPlainString().equals("0")
|
||||
// && divide11.stripTrailingZeros().toPlainString().equals("0")
|
||||
// && subtract2.stripTrailingZeros().toPlainString().equals("0")
|
||||
// && items.getGrade().equals("A5")
|
||||
// ) {
|
||||
// orders.setMaxStatus(true);
|
||||
// } else {
|
||||
// orders.setMaxStatus(false);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return Result.success().put("data", orders);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public Result upgrade(String dateTime) {
|
||||
Date newDate = null;
|
||||
|
@ -561,8 +671,6 @@ public class AppArtificerIntegralServiceImpl implements AppArtificerIntegralServ
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
@ -577,10 +685,10 @@ public class AppArtificerIntegralServiceImpl implements AppArtificerIntegralServ
|
|||
artificer.setFinishTime(DateUtil.formatDate(endFundData));
|
||||
map.put("artificerData",artificer);
|
||||
//91精油 95 中医
|
||||
String classifyId = artificer.getClassifyId().toString();
|
||||
String classifyId = artificer.getClassifyId();
|
||||
IPage<ArtificerPartitioningDetails> page1 = new Page(page, limit);
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("classify_id", classifyId);
|
||||
// queryWrapper.eq("classify_id", classifyId);
|
||||
queryWrapper.orderByAsc("id");
|
||||
IPage<ArtificerPartitioningDetails> apdPage= artificerPartitioningDetailsDao.selectPage(page1,queryWrapper);
|
||||
map.put("levelData",apdPage);
|
||||
|
|
|
@ -24,6 +24,8 @@ import com.sqx.modules.artificer.service.ArtificerClassifyService;
|
|||
import com.sqx.modules.artificer.service.ArtificerService;
|
||||
import com.sqx.modules.artificer.service.ArtificerTimeService;
|
||||
import com.sqx.modules.artificer.service.CollectArtificerService;
|
||||
import com.sqx.modules.bl.artificer.entity.ArtificerIntegralStatistics;
|
||||
import com.sqx.modules.bl.artificer.service.ArtificerIntegralStatisticsService;
|
||||
import com.sqx.modules.common.dao.CommonInfoDao;
|
||||
import com.sqx.modules.common.service.CommonInfoService;
|
||||
import com.sqx.modules.file.utils.FileUploadUtils;
|
||||
|
@ -77,6 +79,8 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
|
|||
private SysDictService sysDictService;
|
||||
@Autowired
|
||||
private ArtificerClassifyService artificerClassifyService;
|
||||
@Autowired
|
||||
ArtificerIntegralStatisticsService artificerIntegralStatisticsService;
|
||||
|
||||
@Override
|
||||
public Result selectArtificerList(Integer page, Integer limit, Long massageTypeId,String artificerName,
|
||||
|
@ -904,8 +908,14 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
|
|||
if(orderType == 1){//1当期
|
||||
// ordersIPage = ordersDao.getDangqiList(pages, userId,isSfwc,startTime,endTime);
|
||||
ordersIPage = ordersDao.selectDividedIntoDetails(pages, userId,startTime,endTime,null);
|
||||
BigDecimal yeji = ordersDao.selectOrdersArtificerIntegralEarnings(userId, endTime, startTime);
|
||||
yeji = yeji.setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||
// BigDecimal yeji = ordersDao.selectOrdersArtificerIntegralEarnings(userId, endTime, startTime);
|
||||
// yeji = yeji.setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||
// earnings = yeji.toString();
|
||||
BigDecimal yeji = BigDecimal.ZERO;
|
||||
ArtificerIntegralStatistics yejfVo = artificerIntegralStatisticsService.getIntegralStatistics(userId,startTime,endTime,3);
|
||||
if(yejfVo != null){
|
||||
yeji = yejfVo.getIncome();
|
||||
}
|
||||
earnings = yeji.toString();
|
||||
}else if(orderType == 2){//2加钟
|
||||
//查询列表
|
||||
|
@ -931,8 +941,14 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
|
|||
}else if(orderType == 4){//业绩
|
||||
// ordersIPage = ordersDao.getDangqiList(pages, userId,isSfwc,startTime,endTime);
|
||||
ordersIPage = ordersDao.selectDividedIntoDetails(pages, userId,startTime,endTime,null);
|
||||
int yeji = ordersDao.selectOrdersArtificerIntegralAchievement(userId, endTime, startTime);
|
||||
earnings = yeji+"";
|
||||
// int yeji = ordersDao.selectOrdersArtificerIntegralAchievement(userId, endTime, startTime);
|
||||
// earnings = yeji+"";
|
||||
BigDecimal yeji = BigDecimal.ZERO;
|
||||
ArtificerIntegralStatistics yejfVo = artificerIntegralStatisticsService.getIntegralStatistics(userId,startTime,endTime,3);
|
||||
if(yejfVo != null){
|
||||
yeji = yejfVo.getAchievement();
|
||||
}
|
||||
earnings = yeji.toString();
|
||||
}
|
||||
|
||||
map.put("data",new PageUtils(ordersIPage));
|
||||
|
@ -940,34 +956,88 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
|
|||
return Result.success(map);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public Result getJifenList(Long userId, String startTime, String endTime) {
|
||||
// //1.获取业绩积分
|
||||
// List<Orders> yjjfList = ordersDao.getYjjfList(userId,startTime,endTime);
|
||||
// int yjjf = 0;
|
||||
// for (Orders par:yjjfList) {
|
||||
// yjjf += (int) Double.parseDouble(par.getJifen());
|
||||
// }
|
||||
// //2.获取储值积分(为他充值的)
|
||||
// List<Orders> czjfList = ordersDao.getCzjfList(userId,startTime,endTime);
|
||||
// int czjf = 0;
|
||||
// for (Orders par:czjfList) {
|
||||
// czjf += (int) Double.parseDouble(par.getJifen());
|
||||
// }
|
||||
// //3.获取订单充值积分
|
||||
// List<Orders> ddczList = ordersDao.getDdczList(userId,startTime,endTime);
|
||||
// int ddczjf = 0;
|
||||
// for (Orders par:ddczList) {
|
||||
// ddczjf += (int) Double.parseDouble(par.getJifen());
|
||||
// }
|
||||
// //4.获取在线时长积分
|
||||
// List<Orders> zxscList = ordersDao.getZxscList(userId,startTime,endTime);
|
||||
// int zxscjf = 0;
|
||||
// for (Orders par:zxscList) {
|
||||
// zxscjf += (int) Double.parseDouble(par.getJifen());
|
||||
// }
|
||||
// int sumJf = 0;
|
||||
// sumJf = yjjf + czjf + ddczjf + zxscjf;
|
||||
// Map<String,Object> map = new HashMap<String,Object>();
|
||||
// map.put("yjjfList",yjjfList);
|
||||
// map.put("yjjf",yjjf);
|
||||
// map.put("czjfList",czjfList);
|
||||
// map.put("czjf",czjf);
|
||||
// map.put("ddczList",ddczList);
|
||||
// map.put("ddczjf",ddczjf);
|
||||
// map.put("zxscList",zxscList);
|
||||
// map.put("zxscjf",zxscjf);
|
||||
// map.put("sumJf",sumJf);
|
||||
// return Result.success(map);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public Result getJifenList(Long userId, String startTime, String endTime) {
|
||||
|
||||
BigDecimal sumJf = BigDecimal.ZERO;
|
||||
ArtificerIntegralStatistics artificerIntegralStatistics = artificerIntegralStatisticsService.getIntegralStatistics(userId,startTime,endTime,null);
|
||||
if(artificerIntegralStatistics != null){
|
||||
sumJf = artificerIntegralStatistics.getIntegral();
|
||||
}
|
||||
|
||||
//1.获取业绩积分
|
||||
BigDecimal yjjf = BigDecimal.ZERO;
|
||||
ArtificerIntegralStatistics yejfVo = artificerIntegralStatisticsService.getIntegralStatistics(userId,startTime,endTime,3);
|
||||
if(yejfVo != null){
|
||||
yjjf = yejfVo.getIntegral();
|
||||
}
|
||||
List<Orders> yjjfList = ordersDao.getYjjfList(userId,startTime,endTime);
|
||||
int yjjf = 0;
|
||||
for (Orders par:yjjfList) {
|
||||
yjjf += (int) Double.parseDouble(par.getJifen());
|
||||
}
|
||||
|
||||
//2.获取储值积分(为他充值的)
|
||||
BigDecimal czjf = BigDecimal.ZERO;
|
||||
ArtificerIntegralStatistics chuzjfVo = artificerIntegralStatisticsService.getIntegralStatistics(userId,startTime,endTime,2);
|
||||
if(chuzjfVo != null){
|
||||
czjf = chuzjfVo.getIntegral();
|
||||
}
|
||||
List<Orders> czjfList = ordersDao.getCzjfList(userId,startTime,endTime);
|
||||
int czjf = 0;
|
||||
for (Orders par:czjfList) {
|
||||
czjf += (int) Double.parseDouble(par.getJifen());
|
||||
}
|
||||
|
||||
//3.获取订单充值积分
|
||||
BigDecimal ddczjf = BigDecimal.ZERO;
|
||||
ArtificerIntegralStatistics chongzjfVo = artificerIntegralStatisticsService.getIntegralStatistics(userId,startTime,endTime,5);
|
||||
if(chongzjfVo != null) {
|
||||
ddczjf = chongzjfVo.getIntegral();
|
||||
}
|
||||
List<Orders> ddczList = ordersDao.getDdczList(userId,startTime,endTime);
|
||||
int ddczjf = 0;
|
||||
for (Orders par:ddczList) {
|
||||
ddczjf += (int) Double.parseDouble(par.getJifen());
|
||||
}
|
||||
|
||||
//4.获取在线时长积分
|
||||
List<Orders> zxscList = ordersDao.getZxscList(userId,startTime,endTime);
|
||||
int zxscjf = 0;
|
||||
for (Orders par:zxscList) {
|
||||
zxscjf += (int) Double.parseDouble(par.getJifen());
|
||||
BigDecimal zxscjf = BigDecimal.ZERO;
|
||||
ArtificerIntegralStatistics zxjfVo = artificerIntegralStatisticsService.getIntegralStatistics(userId,startTime,endTime,1);
|
||||
if(zxjfVo != null) {
|
||||
zxscjf = zxjfVo.getIntegral();
|
||||
}
|
||||
int sumJf = 0;
|
||||
sumJf = yjjf + czjf + ddczjf + zxscjf;
|
||||
List<Orders> zxscList = ordersDao.getZxscList(userId,startTime,endTime);
|
||||
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
map.put("yjjfList",yjjfList);
|
||||
map.put("yjjf",yjjf);
|
||||
|
|
|
@ -6704,7 +6704,7 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
|
|||
userMoneyDetails.setManipulateType(2);
|
||||
userMoneyDetails.setMoney(orders.getFxyOneMoney());
|
||||
userMoneyDetails.setUserId(orders.getFxyOneUserId());
|
||||
userMoneyDetails.setTitle("订单号:" + orders.getOrdersNo() + ",订单取消!");
|
||||
userMoneyDetails.setTitle("订单号:" + orders.getOrdersNo() + ",订单完成!");
|
||||
userMoneyDetails.setContent("一级分销员收益:"+orders.getFxyOneMoney());
|
||||
userMoneyDetails.setType(1);
|
||||
userMoneyDetails.setState(2);
|
||||
|
@ -6727,7 +6727,7 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
|
|||
userMoneyDetails.setManipulateType(2);
|
||||
userMoneyDetails.setMoney(orders.getFxyTwoMoney());
|
||||
userMoneyDetails.setUserId(orders.getFxyTwoUserId());
|
||||
userMoneyDetails.setTitle("订单号:" + orders.getOrdersNo() + ",订单取消!");
|
||||
userMoneyDetails.setTitle("订单号:" + orders.getOrdersNo() + ",订单完成!");
|
||||
userMoneyDetails.setContent("二级分销员收益:"+orders.getFxyTwoMoney());
|
||||
userMoneyDetails.setType(1);
|
||||
userMoneyDetails.setState(2);
|
||||
|
@ -6750,7 +6750,7 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
|
|||
userMoneyDetails.setManipulateType(2);
|
||||
userMoneyDetails.setMoney(orders.getJjrMoney());
|
||||
userMoneyDetails.setUserId(orders.getJjrUserId());
|
||||
userMoneyDetails.setTitle("订单号:" + orders.getOrdersNo() + ",订单取消!");
|
||||
userMoneyDetails.setTitle("订单号:" + orders.getOrdersNo() + ",订单完成!");
|
||||
userMoneyDetails.setContent("经纪人收益:"+orders.getJjrMoney());
|
||||
userMoneyDetails.setType(1);
|
||||
userMoneyDetails.setState(2);
|
||||
|
@ -6808,7 +6808,7 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
|
|||
//修改订单下所有加钟的状态为待评价
|
||||
UpdateWrapper<Orders> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq("parent_id", orders.getOrdersId());
|
||||
updateWrapper.notIn("status", 1,4);
|
||||
updateWrapper.notIn("status", Arrays.asList(1, 4));
|
||||
Orders orders2 = new Orders();
|
||||
orders2.setStatus(3);
|
||||
baseMapper.update(orders2,updateWrapper);
|
||||
|
@ -6980,7 +6980,7 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
|
|||
userMoneyDetails.setManipulateType(2);
|
||||
userMoneyDetails.setMoney(orders.getFxyOneMoney());
|
||||
userMoneyDetails.setUserId(orders.getFxyOneUserId());
|
||||
userMoneyDetails.setTitle("订单号:" + orders.getOrdersNo() + ",订单取消!");
|
||||
userMoneyDetails.setTitle("订单号:" + orders.getOrdersNo() + ",订单完成!");
|
||||
userMoneyDetails.setContent("一级分销员收益:"+orders.getFxyOneMoney());
|
||||
userMoneyDetails.setType(1);
|
||||
userMoneyDetails.setState(2);
|
||||
|
@ -7003,7 +7003,7 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
|
|||
userMoneyDetails.setManipulateType(2);
|
||||
userMoneyDetails.setMoney(orders.getFxyTwoMoney());
|
||||
userMoneyDetails.setUserId(orders.getFxyTwoUserId());
|
||||
userMoneyDetails.setTitle("订单号:" + orders.getOrdersNo() + ",订单取消!");
|
||||
userMoneyDetails.setTitle("订单号:" + orders.getOrdersNo() + ",订单完成!");
|
||||
userMoneyDetails.setContent("二级分销员收益:"+orders.getFxyTwoMoney());
|
||||
userMoneyDetails.setType(1);
|
||||
userMoneyDetails.setState(2);
|
||||
|
@ -7026,7 +7026,7 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
|
|||
userMoneyDetails.setManipulateType(2);
|
||||
userMoneyDetails.setMoney(orders.getJjrMoney());
|
||||
userMoneyDetails.setUserId(orders.getJjrUserId());
|
||||
userMoneyDetails.setTitle("订单号:" + orders.getOrdersNo() + ",订单取消!");
|
||||
userMoneyDetails.setTitle("订单号:" + orders.getOrdersNo() + ",订单完成!");
|
||||
userMoneyDetails.setContent("经纪人收益:"+orders.getJjrMoney());
|
||||
userMoneyDetails.setType(1);
|
||||
userMoneyDetails.setState(2);
|
||||
|
@ -7083,7 +7083,7 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
|
|||
//修改订单下所有加钟的状态为待评价
|
||||
UpdateWrapper<Orders> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq("parent_id", orders.getOrdersId());
|
||||
updateWrapper.notIn("status", "1,4");
|
||||
updateWrapper.notIn("status", Arrays.asList(1, 4));
|
||||
Orders orders2 = new Orders();
|
||||
orders2.setStatus(3);
|
||||
baseMapper.update(orders2,updateWrapper);
|
||||
|
|
|
@ -20,6 +20,9 @@ public class HomeVO implements Serializable {
|
|||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "上期等级", required = true)
|
||||
private String lastGrade;
|
||||
|
||||
@ApiModelProperty(value = "当期等级", required = true)
|
||||
private String grade;
|
||||
|
||||
|
|
|
@ -4,7 +4,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
import com.sqx.modules.bl.artificer.entity.ArtificerIntegralStatistics;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface ArtificerIntegralStatisticsDao extends BaseMapper<ArtificerIntegralStatistics> {
|
||||
ArtificerIntegralStatistics getIntegralStatistics(Long artificerId,String startDate,String endDate,Integer classify);
|
||||
List<ArtificerIntegralStatistics> getIntegralList(Long artificerId, String startDate, String endDate, Integer classify);
|
||||
}
|
|
@ -32,7 +32,7 @@ public class ArtificerIntegralStatistics implements Serializable {
|
|||
@ApiModelProperty("技师名称")
|
||||
private String createTime;
|
||||
|
||||
@ApiModelProperty("类型 1在线积分 2充值积分 3业绩积分 4系统调整")
|
||||
@ApiModelProperty("类型 1在线积分 2储值积分 3业绩积分 4系统调整 5充值积分")
|
||||
private Integer classify;
|
||||
|
||||
@ApiModelProperty("1为正数 2为负数")
|
||||
|
|
|
@ -3,6 +3,9 @@ package com.sqx.modules.bl.artificer.service;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.sqx.modules.bl.artificer.entity.ArtificerIntegralStatistics;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ArtificerIntegralStatisticsService extends IService<ArtificerIntegralStatistics> {
|
||||
ArtificerIntegralStatistics getIntegralStatistics(Long artificerId,String startDate,String endDate,Integer classify);
|
||||
List<ArtificerIntegralStatistics> getIntegralList(Long artificerId, String startDate, String endDate, Integer classify);
|
||||
}
|
|
@ -6,9 +6,15 @@ import com.sqx.modules.bl.artificer.entity.ArtificerIntegralStatistics;
|
|||
import com.sqx.modules.bl.artificer.service.ArtificerIntegralStatisticsService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class ArtificerIntegralStatisticsServiceImpl extends ServiceImpl<ArtificerIntegralStatisticsDao, ArtificerIntegralStatistics> implements ArtificerIntegralStatisticsService {
|
||||
public ArtificerIntegralStatistics getIntegralStatistics(Long artificerId,String startDate,String endDate,Integer classify){
|
||||
return baseMapper.getIntegralStatistics(artificerId,startDate,endDate,classify);
|
||||
}
|
||||
|
||||
public List<ArtificerIntegralStatistics> getIntegralList(Long artificerId,String startDate,String endDate,Integer classify){
|
||||
return baseMapper.getIntegralList(artificerId,startDate,endDate,classify);
|
||||
}
|
||||
}
|
|
@ -28,7 +28,9 @@ import com.sqx.modules.artificer.dao.OrdersDao;
|
|||
import com.sqx.modules.artificer.dao.UserRechargeDao;
|
||||
import com.sqx.modules.artificer.entity.*;
|
||||
import com.sqx.modules.artificer.service.*;
|
||||
import com.sqx.modules.bl.artificer.entity.ArtificerIntegralStatistics;
|
||||
import com.sqx.modules.bl.artificer.entity.ArtificerRechargeReward;
|
||||
import com.sqx.modules.bl.artificer.service.ArtificerIntegralStatisticsService;
|
||||
import com.sqx.modules.bl.artificer.service.ArtificerRechargeRewardService;
|
||||
import com.sqx.modules.bl.commission.fxy.entity.FxyApply;
|
||||
import com.sqx.modules.bl.commission.fxy.entity.FxyConfig;
|
||||
|
@ -173,6 +175,8 @@ public class AliPayController {
|
|||
private JjrConfigLevelService jjrConfigServiceLevel;
|
||||
@Autowired
|
||||
private ArtificerRechargeRewardService artificerRechargeRewardService;
|
||||
@Autowired
|
||||
private ArtificerIntegralStatisticsService artificerIntegralStatisticsService;
|
||||
|
||||
private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
|
@ -1166,9 +1170,22 @@ public class AliPayController {
|
|||
o.setOrdersId(payDetails.getMassageOrdersId());
|
||||
o.setCreateTime(DateUtils.format(new Date()));
|
||||
userRechargeDao.insert(o);
|
||||
|
||||
ArtificerIntegralStatistics ais = new ArtificerIntegralStatistics();
|
||||
ais.setArtificerId(payDetails.getArtificerId());
|
||||
ais.setArtificerName(artificer.getArtificerName());
|
||||
ais.setCreateTime(DateUtils.format(new Date()));
|
||||
if(payDetails.getMassageOrdersId()!=null){
|
||||
ais.setClassify(5);
|
||||
}else{
|
||||
ais.setClassify(2);
|
||||
}
|
||||
ais.setType(1);
|
||||
ais.setIntegral(jf);
|
||||
ais.setOrdersNo(payDetails.getMassageOrdersId().toString());
|
||||
artificerIntegralStatisticsService.save(ais);
|
||||
}
|
||||
}
|
||||
|
||||
}else if(payDetails.getType()==4){
|
||||
Long couponIssueId = Long.parseLong(payDetails.getRemark());
|
||||
Long userId=payDetails.getUserId();
|
||||
|
@ -2949,6 +2966,20 @@ public class AliPayController {
|
|||
// o.setOrdersId(payDetails.getMassageOrdersId());
|
||||
// o.setCreateTime(DateUtils.format(new Date()));
|
||||
// userRechargeDao.insert(o);
|
||||
|
||||
// ArtificerIntegralStatistics ais = new ArtificerIntegralStatistics();
|
||||
// ais.setArtificerId(payDetails.getArtificerId());
|
||||
// ais.setArtificerName(artificer.getArtificerName());
|
||||
// ais.setCreateTime(DateUtils.format(new Date()));
|
||||
// if(payDetails.getMassageOrdersId()!=null){
|
||||
// ais.setClassify(5);
|
||||
// }else{
|
||||
// ais.setClassify(2);
|
||||
// }
|
||||
// ais.setType(1);
|
||||
// ais.setIntegral(jf);
|
||||
// ais.setOrdersNo(payDetails.getMassageOrdersId().toString());
|
||||
// artificerIntegralStatisticsService.save(ais);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
|
|
@ -18,7 +18,9 @@ import com.sqx.modules.artificer.dao.RealNameDao;
|
|||
import com.sqx.modules.artificer.dao.UserRechargeDao;
|
||||
import com.sqx.modules.artificer.entity.*;
|
||||
import com.sqx.modules.artificer.service.*;
|
||||
import com.sqx.modules.bl.artificer.entity.ArtificerIntegralStatistics;
|
||||
import com.sqx.modules.bl.artificer.entity.ArtificerRechargeReward;
|
||||
import com.sqx.modules.bl.artificer.service.ArtificerIntegralStatisticsService;
|
||||
import com.sqx.modules.bl.artificer.service.ArtificerRechargeRewardService;
|
||||
import com.sqx.modules.bl.commission.fxy.entity.FxyApply;
|
||||
import com.sqx.modules.bl.commission.fxy.entity.FxyConfig;
|
||||
|
@ -165,6 +167,8 @@ public class WxServiceImpl implements WxService {
|
|||
private JjrConfigLevelService jjrConfigServiceLevel;
|
||||
@Autowired
|
||||
private ArtificerRechargeRewardService artificerRechargeRewardService;
|
||||
@Autowired
|
||||
private ArtificerIntegralStatisticsService artificerIntegralStatisticsService;
|
||||
|
||||
private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
|
@ -3234,6 +3238,20 @@ public class WxServiceImpl implements WxService {
|
|||
o.setOrdersId(payDetails.getMassageOrdersId());
|
||||
o.setCreateTime(DateUtils.format(new Date()));
|
||||
userRechargeDao.insert(o);
|
||||
|
||||
ArtificerIntegralStatistics ais = new ArtificerIntegralStatistics();
|
||||
ais.setArtificerId(payDetails.getArtificerId());
|
||||
ais.setArtificerName(artificer.getArtificerName());
|
||||
ais.setCreateTime(DateUtils.format(new Date()));
|
||||
if(payDetails.getMassageOrdersId()!=null){
|
||||
ais.setClassify(5);
|
||||
}else{
|
||||
ais.setClassify(2);
|
||||
}
|
||||
ais.setType(1);
|
||||
ais.setIntegral(jf);
|
||||
ais.setOrdersNo(payDetails.getMassageOrdersId().toString());
|
||||
artificerIntegralStatisticsService.save(ais);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ public class AllTaskServiceImpl implements AllTaskSercice {
|
|||
* A0,A1,A2,A3,A4,A5等
|
||||
*/
|
||||
// @Scheduled(cron = "0 * * * * ?")
|
||||
@Scheduled(cron = "0 00 21 * * ?")
|
||||
@Scheduled(cron = "0 00 04 * * ?")
|
||||
public void upgradeJishi() {
|
||||
System.out.println("------------计算技师升级规则-----------");
|
||||
//1.获取全部参与积分规则的技师
|
||||
|
@ -305,7 +305,7 @@ public class AllTaskServiceImpl implements AllTaskSercice {
|
|||
/**
|
||||
* 业绩积分汇总 t+1 8时进行汇总
|
||||
*/
|
||||
@Scheduled(cron = "0 0 8 * * ?")
|
||||
@Scheduled(cron = "0 0 1 * * ?")
|
||||
public void tongjiIntegral() {
|
||||
System.out.println("----------------每日积业绩及分汇总 定时任务-------------");
|
||||
//当前时间减一天
|
||||
|
@ -336,26 +336,7 @@ public class AllTaskServiceImpl implements AllTaskSercice {
|
|||
artificerIntegralStatistics.setCreateTime(date+" 23:59:59");
|
||||
artificerIntegralStatisticsDao.insert(artificerIntegralStatistics);
|
||||
}
|
||||
//获取充值积分
|
||||
List<UserRecharge> userRechargeList = userRechargeDao.selectStoredList(date);
|
||||
for(UserRecharge userRecharge:userRechargeList){
|
||||
QueryWrapper<ArtificerIntegralStatistics> delWrapper = new QueryWrapper<ArtificerIntegralStatistics>();
|
||||
delWrapper.eq("artificer_id",userRecharge.getArtificerId());
|
||||
delWrapper.eq("classify",2);
|
||||
delWrapper.ge("create_time",date);
|
||||
delWrapper.le("create_time",date+" 23:59:59");
|
||||
artificerIntegralStatisticsDao.delete(delWrapper);
|
||||
|
||||
Artificer artificer = artificerDao.selectById(userRecharge.getArtificerId());
|
||||
ArtificerIntegralStatistics artificerIntegralStatistics = new ArtificerIntegralStatistics();
|
||||
artificerIntegralStatistics.setArtificerId(userRecharge.getArtificerId());
|
||||
artificerIntegralStatistics.setArtificerName(artificer.getArtificerName());
|
||||
artificerIntegralStatistics.setClassify(2);
|
||||
artificerIntegralStatistics.setType(1);
|
||||
artificerIntegralStatistics.setIntegral(userRecharge.getUserRecharge());
|
||||
artificerIntegralStatistics.setCreateTime(date+" 23:59:59");
|
||||
artificerIntegralStatisticsDao.insert(artificerIntegralStatistics);
|
||||
}
|
||||
}
|
||||
|
||||
//赠送盛安豆定时任务
|
||||
|
|
|
@ -813,11 +813,7 @@
|
|||
|
||||
<select id="selectDividedIntoDetails" resultType="com.sqx.modules.artificer.entity.Orders">
|
||||
select o.*,
|
||||
(
|
||||
(case when o.is_supplement in (1,3,4) then 0 else o.price end) + ifnull(o.add_price,0)
|
||||
+ ifnull((case when o2.is_supplement in (1,3,4) then 0 else o2.price end),0) + ifnull(o2.add_price,0)
|
||||
+ ifnull((case when o3.is_supplement in (1,3,4) then 0 else o3.price end),0) + ifnull(o3.add_price,0)
|
||||
) as price_total,
|
||||
o.price + ifnull(o.add_price,0) as price_total,
|
||||
(case when o.user_package_detail_id is null then m.title else bl.title end ) as title,
|
||||
(case when o.user_package_detail_id is null then m.massage_img else bl.massage_img end ) as massageImg,
|
||||
(case when o.status = 4
|
||||
|
@ -1737,11 +1733,7 @@
|
|||
else o.artificer_money + ifnull(o.add_artificer_money,0) + ifnull(o2.artificer_money,0) +
|
||||
ifnull(o2.add_artificer_money,0) + ifnull(o3.artificer_money,0) + ifnull(o3.add_artificer_money,0)
|
||||
end) as artificer_money_total,
|
||||
(
|
||||
(case when o.is_supplement in (1,3,4) then 0 else o.price end) + ifnull(o.add_price,0)
|
||||
+ ifnull((case when o2.is_supplement in (1,3,4) then 0 else o2.price end),0) + ifnull(o2.add_price,0)
|
||||
+ ifnull((case when o3.is_supplement in (1,3,4) then 0 else o3.price end),0) + ifnull(o3.add_price,0)
|
||||
) as price_total,bl.massage_img as massageImg
|
||||
o.price + ifnull(o.add_price,0) as price_total,bl.massage_img as massageImg
|
||||
from orders o
|
||||
left join orders o2 on o.old_orders_id = o2.orders_id and o2.status != 4
|
||||
left join orders o3 on o2.old_orders_id = o3.orders_id and o3.status != 4
|
||||
|
|
|
@ -42,13 +42,27 @@
|
|||
</select>
|
||||
|
||||
<select id="selectStoredList" resultType="com.sqx.modules.artificer.entity.UserRecharge">
|
||||
SELECT artificer_id,
|
||||
IFNULL( SUM( user_recharge ), '0' ) AS userRecharge
|
||||
FROM user_recharge
|
||||
where type = 2
|
||||
and create_time >= #{createTime}
|
||||
and create_time <= concat(#{createTime},' 23:59:59')
|
||||
and orders_id is null
|
||||
GROUP BY artificer_id
|
||||
</select>
|
||||
|
||||
<select id="selectRechargeList" resultType="com.sqx.modules.artificer.entity.UserRecharge">
|
||||
SELECT artificer_id,
|
||||
IFNULL( SUM( user_recharge ), '0' ) AS userRecharge
|
||||
FROM user_recharge
|
||||
where type = 2
|
||||
and create_time >= #{createTime}
|
||||
and create_time <= concat(#{createTime},' 23:59:59')
|
||||
and orders_id is not null
|
||||
GROUP BY artificer_id
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
|
@ -15,4 +15,26 @@
|
|||
and classify = #{classify}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getIntegralList" resultType="com.sqx.modules.bl.artificer.entity.ArtificerIntegralStatistics">
|
||||
select
|
||||
id,
|
||||
artificer_id,
|
||||
artificer_name,
|
||||
create_time,
|
||||
classify,
|
||||
type,
|
||||
IFNULL(achievement,0) achievement,
|
||||
IFNULL(income,0) income,
|
||||
IFNULL(integral,0) integral,
|
||||
orders_no,
|
||||
remarks
|
||||
from bl_artificer_integral_statistics
|
||||
where artificer_id = #{artificerId}
|
||||
and date_format(create_time,'%Y-%m-%d %H:%i:%s') >= #{startDate}
|
||||
and date_format(create_time,'%Y-%m-%d %H:%i:%s') <= #{endDate}
|
||||
<if test="classify!=null">
|
||||
and classify = #{classify}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue