| | |
| | | import com.dsh.course.feignClient.account.model.*; |
| | | import com.dsh.course.feignClient.activity.PointMercharsClient; |
| | | import com.dsh.course.feignClient.competition.CompetitionClient; |
| | | import com.dsh.course.feignClient.competition.model.CompetionVO; |
| | | import com.dsh.course.feignClient.competition.model.Competition; |
| | | import com.dsh.course.feignClient.competition.model.CompetitionQuery; |
| | | import com.dsh.course.feignClient.competition.model.PaymentCompetition; |
| | |
| | | public Object getIncomeData(Integer operatorId,Integer storeId) { |
| | | // 报名课程查询query |
| | | RegisterOrderQuery query = new RegisterOrderQuery(); |
| | | // 充值记录查询query |
| | | // 充值记录查询query |
| | | RechargeRecordsQuery rechargeRecordsQuery = new RechargeRecordsQuery(); |
| | | // 赛事活动查询query |
| | | CompetitionQuery competitionQuery = new CompetitionQuery(); |
| | | |
| | | // 会员支付查询query |
| | | IncomeQuery incomeQuery = new IncomeQuery(); |
| | | // 场地预约记录查询query |
| | | SiteBookingQuery siteBookingQuery = new SiteBookingQuery(); |
| | | // 筛选运营商的是时候使用 |
| | | List<Integer> storeIds = new ArrayList<>(); |
| | | // 根据运营商ID 查询运营商下的所有门店 |
| | | if (operatorId!=null){ |
| | | List<TStore> stores = storeService.list(new QueryWrapper<TStore>().eq("operatorId", operatorId)); |
| | | // 拿到该运营商下的门店id集合 |
| | | List<Integer> storeIds = stores.stream().map(TStore::getId).collect(Collectors.toList()); |
| | | query.setStoresIds(storeIds); |
| | | siteBookingQuery.setStoreIds(storeIds); |
| | | if (storeId==null){ |
| | | if (operatorId!=null){ |
| | | List<TStore> stores = storeService.list(new QueryWrapper<TStore>().eq("operatorId", operatorId)); |
| | | // 拿到该运营商下的门店id集合 |
| | | storeIds = stores.stream().map(TStore::getId).collect(Collectors.toList()); |
| | | query.setStoresIds(storeIds); |
| | | siteBookingQuery.setStoreIds(storeIds); |
| | | competitionQuery.setOperatorId(operatorId); |
| | | } |
| | | }else { |
| | | List<Integer> list = new ArrayList<>(); |
| | | list.add(storeId); |
| | | query.setStoresIds(list); |
| | | siteBookingQuery.setStoreIds(list); |
| | | competitionQuery.setStoreId(storeId); |
| | | } |
| | | |
| | | |
| | |
| | | query.setInsertType(roleType); |
| | | competitionQuery.setInsertType(roleType); |
| | | incomeQuery.setInsertType(roleType); |
| | | rechargeRecordsQuery.setObjectId(UserExt.getUser().getObjectId()); |
| | | List<IncomeVO> incomeVOS = new ArrayList<>(); |
| | | // 会员支付记录 |
| | | List<VipPayment> vipPayments = vipPaymentClient.registrationList(incomeQuery); |
| | |
| | | incomeVOS.add(temp); |
| | | } |
| | | } |
| | | // query权限设置 获取运营商下的门店集合 |
| | | |
| | | if (roleType==2){ |
| | | competitionQuery.setOperatorId(UserExt.getUser().getObjectId()); |
| | | } |
| | | // 报名活动 |
| | | List<PaymentCompetition> competitions = competitionClient.listAllPayment(competitionQuery); |
| | | for (PaymentCompetition competition : competitions) { |
| | |
| | | incomeVOS.add(temp); |
| | | } |
| | | // 预约场地 |
| | | if (operatorId!=null){ |
| | | if (siteBookingQuery.getStoreIds().size()==0){ |
| | | }else{ |
| | | List<SiteBooking> siteBookings = siteClient.listAll(siteBookingQuery); |
| | | for (SiteBooking siteBooking : siteBookings) { |
| | | IncomeVO temp = new IncomeVO(); |
| | | if(siteBooking.getStatus()!=3){ |
| | | continue; |
| | | } |
| | | temp.setInsertTime(siteBooking.getPayTime()); |
| | | if (siteBooking.getPayMoney() != null) { |
| | | temp.setAmount(new BigDecimal(siteBooking.getPayMoney().toString())); |
| | | } |
| | | incomeVOS.add(temp); |
| | | // 说明当前运营商下没有门店 |
| | | if (operatorId!=null && storeIds.size()==0){ |
| | | }else{ |
| | | List<SiteBooking> siteBookings = siteClient.listAll(siteBookingQuery); |
| | | for (SiteBooking siteBooking : siteBookings) { |
| | | IncomeVO temp = new IncomeVO(); |
| | | if(siteBooking.getStatus()!=3){ |
| | | continue; |
| | | } |
| | | temp.setInsertTime(siteBooking.getPayTime()); |
| | | if (siteBooking.getPayMoney() != null) { |
| | | temp.setAmount(new BigDecimal(siteBooking.getPayMoney().toString())); |
| | | } |
| | | incomeVOS.add(temp); |
| | | } |
| | | |
| | | } |
| | | |
| | | // 积分商品 |
| | |
| | | int years = DateUtil.year(new Date()); |
| | | for (int i = 0; i < 10; i++) { |
| | | integers1.add(years-i); |
| | | } |
| | | } |
| | | List<Object> collect = integers1.stream().sorted().collect(Collectors.toList()); |
| | | List<Object> objects1 = new ArrayList<>(); |
| | | for (Object o : collect) { |
| | |
| | | @RequestMapping(value = "/backStore") |
| | | @ResponseBody |
| | | public Object backStore(Integer id) { |
| | | if(UserExt.getUser().getObjectType()==3){ |
| | | id = UserExt.getUser().getObjectId(); |
| | | } |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | List<Integer> userPt = appUserClient.getUserStore(id); |
| | | if(userPt.size()==0){ |
| | |
| | | HashMap<String, Object> map = appUserClient.stuPt(); |
| | | return map; |
| | | } |
| | | @RequestMapping(value = "/stuYys") |
| | | @ResponseBody |
| | | public Object stuYys(Integer id) { |
| | | HashMap<String, Object> map = appUserClient.stuYys(id); |
| | | return map; |
| | | } |
| | | @RequestMapping(value = "/stuStores") |
| | | @ResponseBody |
| | | public Object stuStores(Integer id) { |
| | | HashMap<String, Object> map = appUserClient.stuStores(id); |
| | | return map; |
| | | } |
| | | |
| | | // 消耗课时数据-平台 |
| | | @RequestMapping(value = "/coursePt") |
| | | @ResponseBody |
| | | public Object coursePt() { |
| | | List<Integer> userPt = appUserClient.getUserPt(Arrays.asList(1)); |
| | | HashMap<String, Object> map = coursePackagePaymentClient.coursePt(userPt); |
| | | return map; |
| | | } |
| | | // 消耗课时数据-运营商 |
| | | @RequestMapping(value = "/courseYys") |
| | | @ResponseBody |
| | | public Object courseYys(Integer id) { |
| | | List<Integer> userPt = appUserClient.getUserYYs(id); |
| | | HashMap<String, Object> map = coursePackagePaymentClient.coursePt(userPt); |
| | | return map; |
| | | } |
| | | // 消耗课时数据-运营商 |
| | | @RequestMapping(value = "/courseStore") |
| | | @ResponseBody |
| | | public Object courseStore(Integer id) { |
| | | List<Integer> userPt = appUserClient.getUserPt(Arrays.asList(id)); |
| | | HashMap<String, Object> map = coursePackagePaymentClient.coursePt(userPt); |
| | | return map; |
| | | } |
| | |
| | | @RequestMapping(value = "/userAndVipStore") |
| | | @ResponseBody |
| | | public Object userAndVipStore(Integer id) { |
| | | if(UserExt.getUser().getObjectType()==3){ |
| | | id = UserExt.getUser().getObjectId(); |
| | | } |
| | | HashMap<String, Object> map = appUserClient.userAndVipStore(id); |
| | | return map; |
| | | } |
| | |
| | | @RequestMapping(value = "/actYys") |
| | | @ResponseBody |
| | | public Object actYys(Integer id) { |
| | | List<Integer> userPt = appUserClient.getUserYYs(id); |
| | | HashMap<String, Object> map = competitionClient.actPt(userPt); |
| | | CompetionVO competionVO = new CompetionVO(); |
| | | |
| | | List<TStore> list = storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getOperatorId, 0)); |
| | | List<Integer> userPt = appUserClient.getUserYYs(id); |
| | | competionVO.setIds(userPt); |
| | | competionVO.setOperatorId(id); |
| | | HashMap<String, Object> map = competitionClient.actYys(competionVO); |
| | | |
| | | List<TStore> list = storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getOperatorId, id)); |
| | | long l1=0; |
| | | for (TStore tStore : list) { |
| | | long l = DateUtil.betweenDay(tStore.getCreateTime(), new Date(), true); |
| | |
| | | if(integer==0 && integer1==0){ |
| | | a=24; |
| | | }else { |
| | | a= integer1-integer; |
| | | a= integer-integer1; |
| | | } |
| | | l1 += l * a; |
| | | } |
| | |
| | | @RequestMapping(value = "/actStore") |
| | | @ResponseBody |
| | | public Object actStore(Integer id) { |
| | | |
| | | |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | if(objectType==3){ |
| | | id = UserExt.getUser().getObjectId(); |
| | | } |
| | | List<Integer> userPt = appUserClient.getUserStore(id); |
| | | HashMap<String, Object> map = competitionClient.actPt(userPt); |
| | | |
| | |
| | | @RequestMapping("/operator") |
| | | public String operator(Model model) { |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | List<TOperator> list = operatorService.list(new LambdaQueryWrapper<TOperator>().ne(TOperator::getState, 3)); |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | |
| | | List<TOperator> list = operatorService.list(new LambdaQueryWrapper<TOperator>().ne(TOperator::getState, 3).ne(TOperator::getId,0)); |
| | | model.addAttribute("list",list); |
| | | model.addAttribute("objectType",objectType); |
| | | model.addAttribute("objectId",objectId); |
| | | return PREFIX + "operatorIncome.html"; |
| | | } |
| | | |
| | |
| | | // 找出平台的用户 |
| | | List<User> list = sysUserService.list(new LambdaQueryWrapper<User>().eq(User::getObjectType, 2)); |
| | | List<Integer> ids = list.stream().map(User::getId).collect(Collectors.toList()); |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | if(objectType==3){ |
| | | id = UserExt.getUser().getObjectId(); |
| | | } |
| | | List<Integer> userIds = appUserClient.getUserStore(id); |
| | | QueryDataFee queryDataFee = new QueryDataFee(time, userIds); |
| | | // 会员费 |
| | |
| | | List<TStore> list = storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getState, 1)); |
| | | model.addAttribute("list",list); |
| | | model.addAttribute("objectType",objectType); |
| | | model.addAttribute("objectId",UserExt.getUser().getObjectId()); |
| | | return PREFIX + "storeIncome.html"; |
| | | } |
| | | |
| | |
| | | @ResponseBody |
| | | public Object stuUserDataYys(Integer id) { |
| | | ArrayList<Integer> objects = new ArrayList<>(); |
| | | |
| | | objects.add(1); |
| | | HashMap<String, Object> map = appUserClient.queryUserAgeYys(id); |
| | | HashMap<String, Object> map = appUserClient.queryUserAgeYys(operatorService.getById(id).getId()); |
| | | |
| | | return map; |
| | | } |
| | | @RequestMapping("/stuUserDataStore") |
| | | @ResponseBody |
| | | public Object stuUserDataStore(Integer id) { |
| | | if(UserExt.getUser().getObjectType()==3){ |
| | | id = UserExt.getUser().getObjectId(); |
| | | } |
| | | ArrayList<Integer> objects = new ArrayList<>(); |
| | | objects.add(1); |
| | | HashMap<String, Object> map = appUserClient.queryUserAgeStore(id); |
| | |
| | | @RequestMapping("/selectStoreJx") |
| | | @ResponseBody |
| | | public Object selectStoreJx(Integer id) { |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | if(objectType==3){ |
| | | id = UserExt.getUser().getObjectId(); |
| | | } |
| | | ArrayList<Integer> objects = new ArrayList<>(); |
| | | objects.add(1); |
| | | HashMap<String, Object> map1 = appUserClient.queryUserAgeStore1(id); |