diff --git a/src/main/java/com/sqx/modules/artificer/dao/OrdersDao.java b/src/main/java/com/sqx/modules/artificer/dao/OrdersDao.java index 79c5ae9..647dc7d 100644 --- a/src/main/java/com/sqx/modules/artificer/dao/OrdersDao.java +++ b/src/main/java/com/sqx/modules/artificer/dao/OrdersDao.java @@ -11,6 +11,7 @@ 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; @@ -56,6 +57,8 @@ public interface OrdersDao extends BaseMapper { IPage selectTodayOrder(Page pages,@Param("artificerId") Long artificerId,@Param("type") Integer type,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("minutes") Integer minutes); + IPage selectDividedIntoDetails(Page pages,@Param("artificerId") Long artificerId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("isSfwc") Integer isSfwc); + IPage selectArtificerOrder(Page pages, Long userId, Integer status); int selectOrdersCountByUnderway(@Param("artificerId") Long artificerId); @@ -93,13 +96,15 @@ public interface OrdersDao extends BaseMapper { Double selectNewUserOrdersRate(); + Integer selectOrdersArtificerIntegralAchievement(Long artificerId, String endDate, String startDate); + Integer selectOrdersArtificerIntegralEarnings(Long artificerId, String endDate, String startDate); String selectOrdersArtificerIntegral(Long artificerId, String endDate, String startDate); String selectOrdersArtificerIntegraladdNum(Long artificerId, String endDate, String startDate); - String selectOrdersCurrentPeriodRechargeSum(Long artificerId, String endDate, String startDate); + String selectOrdersCurrentPeriodRechargeSum(Long artificerId, String endDate, String startDate,@Param("isSfwc") Integer isSfwc); String selectOrdersStoredValueIntegral(Long artificerId, String endDate, String startDate); @@ -123,7 +128,7 @@ public interface OrdersDao extends BaseMapper { IPage getJiazhongList(Page pages, Long userId, Integer isSfwc, String startTime, String endTime); - IPage getChongzhiList(Page pages, Long userId, Integer isSfwc, String startTime, String endTime); + IPage getChongzhiList(Page pages, Long artificerId, Integer isSfwc, String startTime, String endTime); String selectOrdersZxscNum(Long artificerId, String startTime, String endTime); diff --git a/src/main/java/com/sqx/modules/artificer/entity/Orders.java b/src/main/java/com/sqx/modules/artificer/entity/Orders.java index 126c90c..3b915cb 100644 --- a/src/main/java/com/sqx/modules/artificer/entity/Orders.java +++ b/src/main/java/com/sqx/modules/artificer/entity/Orders.java @@ -88,6 +88,13 @@ public class Orders implements Serializable { @TableField(exist = false) private BigDecimal artificerMoneyTotal; + /** + * 总业绩 + */ + @TableField(exist = false) + private BigDecimal priceTotal; + + /** * 服务费用 */ diff --git a/src/main/java/com/sqx/modules/artificer/service/impl/AppArtificerIntegralServiceImpl.java b/src/main/java/com/sqx/modules/artificer/service/impl/AppArtificerIntegralServiceImpl.java index 3bbf568..6e46c60 100644 --- a/src/main/java/com/sqx/modules/artificer/service/impl/AppArtificerIntegralServiceImpl.java +++ b/src/main/java/com/sqx/modules/artificer/service/impl/AppArtificerIntegralServiceImpl.java @@ -67,23 +67,26 @@ public class AppArtificerIntegralServiceImpl implements AppArtificerIntegralServ orders.setGrade(grade); //当期业绩 - Integer currentPerformance = ordersDao.selectOrdersArtificerIntegralEarnings(artificerId, endDate, startDate); + Integer currentPerformance = ordersDao.selectOrdersArtificerIntegralAchievement(artificerId, endDate, startDate); orders.setCurrentPerformance(String.valueOf(currentPerformance)); //当期收益 - String earnings = ordersDao.earnings(artificerId, endDate, startDate); +// String earnings = ordersDao.earnings(artificerId, endDate, startDate); + String earnings = ordersDao.selectOrdersArtificerIntegralEarnings(artificerId, endDate, startDate).toString(); orders.setEarnings(earnings); //当日收益 String todayEndIncome = DateUtil.formatDateTime(DateUtil.endOfDay(new Date())); - String dailyEarnings = ordersDao.earnings(artificerId, todayEndIncome, String.valueOf(DateUtil.beginOfDay(new Date()))); +// String dailyEarnings = ordersDao.earnings(artificerId, todayEndIncome, String.valueOf(DateUtil.beginOfDay(new Date()))); + String dailyEarnings = ordersDao.selectOrdersArtificerIntegralEarnings(artificerId, todayEndIncome, String.valueOf(DateUtil.beginOfDay(new Date()))).toString(); orders.setDailyEarnings(dailyEarnings); //当月收益 //当月结束日 String startFundDataformat = DateUtil.formatDateTime(DateUtil.beginOfMonth(new Date())); String endFundDataformat = DateUtil.formatDateTime(DateUtil.endOfMonth(new Date())); - String currentMonthsIncome = ordersDao.earnings(artificerId, endFundDataformat, startFundDataformat); +// String currentMonthsIncome = ordersDao.earnings(artificerId, endFundDataformat, startFundDataformat); + String currentMonthsIncome = ordersDao.selectOrdersArtificerIntegralEarnings(artificerId, endFundDataformat, startFundDataformat).toString(); orders.setCurrentMonthsIncome(currentMonthsIncome); //当期结束日 @@ -128,7 +131,7 @@ public class AppArtificerIntegralServiceImpl implements AppArtificerIntegralServ orders.setCurrentPeriodAddBellsSum(clockRate.toString()); //当前周期充值率(本周期内充值订单数/本单数) - String currentPeriodRechargeSum = ordersDao.selectOrdersCurrentPeriodRechargeSum(artificerId, endDate, startDate); + String currentPeriodRechargeSum = ordersDao.selectOrdersCurrentPeriodRechargeSum(artificerId, endDate, startDate,1); BigDecimal c = new BigDecimal(currentPeriodRechargeSum); divide1 = c.divide(currentPeriodOrdersSumBig, 2, RoundingMode.HALF_UP); orders.setCurrentPeriodRechargeSum(divide1.toString()); @@ -315,7 +318,7 @@ public class AppArtificerIntegralServiceImpl implements AppArtificerIntegralServ if (currentPeriodOrdersSumBig.compareTo(new BigDecimal("0")) != 0) { clockRate = currentPeriodAddBellsSumBig.divide(currentPeriodOrdersSumBig, 2, RoundingMode.HALF_UP); //当前周期充值率(本周期内充值订单数/本单数) - String currentPeriodRechargeSum = ordersDao.selectOrdersCurrentPeriodRechargeSum(artificerId, date, cycleTime); + String currentPeriodRechargeSum = ordersDao.selectOrdersCurrentPeriodRechargeSum(artificerId, date, cycleTime,1); BigDecimal c = new BigDecimal(currentPeriodRechargeSum); divide1 = c.divide(currentPeriodOrdersSumBig, 2, RoundingMode.HALF_UP); } else { @@ -424,7 +427,7 @@ public class AppArtificerIntegralServiceImpl implements AppArtificerIntegralServ if (currentPeriodOrdersSumBig.compareTo(new BigDecimal("0")) != 0) { clockRate = currentPeriodAddBellsSumBig.divide(currentPeriodOrdersSumBig, 2, RoundingMode.HALF_UP); //当前周期充值率(本周期内充值订单数/本单数) - String currentPeriodRechargeSum = ordersDao.selectOrdersCurrentPeriodRechargeSum(artificerId, date, cycleTime); + String currentPeriodRechargeSum = ordersDao.selectOrdersCurrentPeriodRechargeSum(artificerId, date, cycleTime,1); BigDecimal c = new BigDecimal(currentPeriodRechargeSum); divide1 = c.divide(currentPeriodOrdersSumBig, 2, RoundingMode.HALF_UP); } else { diff --git a/src/main/java/com/sqx/modules/artificer/service/impl/ArtificerServiceImpl.java b/src/main/java/com/sqx/modules/artificer/service/impl/ArtificerServiceImpl.java index a757d95..bcd85ec 100644 --- a/src/main/java/com/sqx/modules/artificer/service/impl/ArtificerServiceImpl.java +++ b/src/main/java/com/sqx/modules/artificer/service/impl/ArtificerServiceImpl.java @@ -550,7 +550,7 @@ public class ArtificerServiceImpl extends ServiceImpl i clockRate = currentPeriodAddBellsSumBig.divide(currentPeriodOrdersSumBig, 2, RoundingMode.HALF_UP);//加钟率 //当前周期充值率(本周期内充值订单数/本单数) - String currentPeriodRechargeSum = ordersDao.selectOrdersCurrentPeriodRechargeSum(artificerId, endTime, startTime); + String currentPeriodRechargeSum = ordersDao.selectOrdersCurrentPeriodRechargeSum(artificerId, endTime, startTime,1); BigDecimal c = new BigDecimal(currentPeriodRechargeSum); divide1 = c.divide(currentPeriodOrdersSumBig, 2, RoundingMode.HALF_UP);//充值率 } else { @@ -689,11 +689,14 @@ public class ArtificerServiceImpl extends ServiceImpl i String earnings = "0"; BigDecimal cy100 = new BigDecimal(100); if(orderType == 1){//1当期 - ordersIPage = ordersDao.getDangqiList(pages, userId,isSfwc,startTime,endTime); - earnings = ordersDao.earnings(userId, endTime, startTime); +// ordersIPage = ordersDao.getDangqiList(pages, userId,isSfwc,startTime,endTime); + ordersIPage = ordersDao.selectDividedIntoDetails(pages, userId,startTime,endTime,null); + int yeji = ordersDao.selectOrdersArtificerIntegralEarnings(userId, endTime, startTime); + earnings = yeji+""; }else if(orderType == 2){//2加钟 //查询列表 - ordersIPage = ordersDao.getJiazhongList(pages, userId,isSfwc,startTime,endTime); +// ordersIPage = ordersDao.getJiazhongList(pages, userId,isSfwc,startTime,endTime); + ordersIPage = ordersDao.selectDividedIntoDetails(pages, userId,startTime,endTime,isSfwc); //当期加钟率:本周期内,加钟数/本单数 String jzl = ordersDao.selectOrdersArtificerIntegraladdNum(userId, endTime, startTime); //加钟数 @@ -704,17 +707,17 @@ public class ArtificerServiceImpl extends ServiceImpl i System.out.println(currentPeriodOrdersSumBig+"=========="+num+"---"+clockRate); }else if(orderType == 3){//3充值 ordersIPage = ordersDao.getChongzhiList(pages, userId,isSfwc,startTime,endTime); - //当前周期充值率(本周期内充值订单数/本单数) - String currentPeriodRechargeSum = ordersDao.selectOrdersCurrentPeriodRechargeSum(userId, endTime, startTime); + String currentPeriodRechargeSum = ordersDao.selectOrdersCurrentPeriodRechargeSum(userId, endTime, startTime,1); BigDecimal c = new BigDecimal(currentPeriodRechargeSum); BigDecimal divide1 = c.divide(currentPeriodOrdersSumBig, 2, RoundingMode.HALF_UP); divide1 = divide1.multiply(cy100); earnings = divide1.intValue()+"%"; System.out.println(currentPeriodOrdersSumBig+"=========="+c+"---"+divide1); }else if(orderType == 4){//业绩 - ordersIPage = ordersDao.getDangqiList(pages, userId,isSfwc,startTime,endTime); - int yeji = ordersDao.selectOrdersArtificerIntegralEarnings(userId, endTime, startTime); +// 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+""; } diff --git a/src/main/java/com/sqx/modules/artificer/service/impl/OrdersServiceImpl.java b/src/main/java/com/sqx/modules/artificer/service/impl/OrdersServiceImpl.java index 1c8f7af..5e9faae 100644 --- a/src/main/java/com/sqx/modules/artificer/service/impl/OrdersServiceImpl.java +++ b/src/main/java/com/sqx/modules/artificer/service/impl/OrdersServiceImpl.java @@ -6667,20 +6667,24 @@ public class OrdersServiceImpl extends ServiceImpl implements } @Override public Result selectDividedIntoDetails(Integer page, Integer limit, Period period) { - IPage page1 = new Page(page, limit); - QueryWrapper queryWrapper = new QueryWrapper(); - queryWrapper.eq("artificer_id", period.getArtificerId()); - if(StringUtil.isNotEmpty(period.getStartFundData().toString())){ - queryWrapper.between("end_times", period.getStartFundData(), period.getEndFundData()); - } - //只查询已完成和待评价的订单 - queryWrapper.in("status", Arrays.asList(5, 3)); - //只查询根节点数据 - queryWrapper.eq("parent_id", 0); - queryWrapper.orderByDesc("end_times"); - IPage page2 = baseMapper.selectPage(page1, queryWrapper); - //分成明细添加到返回对象中 - return Result.success().put("data", page2); + Page page1 = new Page(page, limit); +// QueryWrapper queryWrapper = new QueryWrapper(); +// queryWrapper.eq("artificer_id", period.getArtificerId()); +// if(StringUtil.isNotEmpty(period.getStartFundData().toString())){ +// queryWrapper.between("end_times", period.getStartFundData(), period.getEndFundData()); +// } +// //只查询已完成和待评价的订单 +// queryWrapper.in("status", Arrays.asList(5, 3)); +// //只查询根节点数据 +// queryWrapper.eq("parent_id", 0); +// queryWrapper.orderByDesc("end_times"); +// IPage page2 = baseMapper.selectPage(page1, queryWrapper); +// //分成明细添加到返回对象中 +// return Result.success().put("data", page2); + String startFundData = DateUtils.format(period.getStartFundData()); + String endFundData = DateUtils.format(period.getEndFundData()); + return Result.success().put("data", baseMapper.selectDividedIntoDetails(page1,Long.valueOf(period.getArtificerId()),startFundData,endFundData,0)); + } @Override diff --git a/src/main/resources/mapper/artificer/OrdersDao.xml b/src/main/resources/mapper/artificer/OrdersDao.xml index f2cd70c..a6896fd 100644 --- a/src/main/resources/mapper/artificer/OrdersDao.xml +++ b/src/main/resources/mapper/artificer/OrdersDao.xml @@ -762,6 +762,73 @@ order by serve_time desc + + - + + + -