| | |
| | | if (ToolUtil.isNotEmpty(listQuery.getPhone())) { |
| | | tCityManagerLambdaQueryWrapper.like(TCityManager::getPhone, listQuery.getPhone()); |
| | | } |
| | | tCityManagerLambdaQueryWrapper.orderByDesc(TCityManager::getId); |
| | | Page<TCityManager> page1 = cityService.page(page, tCityManagerLambdaQueryWrapper); |
| | | return page1; |
| | | } catch (Exception e) { |
| | |
| | | <if test="state !=null and state !='' and state ==3"> |
| | | and t3.payStatus =3 |
| | | </if> |
| | | order by t1.insertTime desc, t1.id desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | * @return |
| | | */ |
| | | private ShardingTableRuleConfiguration getCoursePackageOrderTableRuleConfiguration() { |
| | | ShardingTableRuleConfiguration result = new ShardingTableRuleConfiguration("t_course_package_order", "m_$->{0}.t_course_package_order$->{1..5}");//30 |
| | | // 兼容分表前写入基础表的历史购课记录;新订单仍按 appUserId 路由至后缀分表。 |
| | | ShardingTableRuleConfiguration result = new ShardingTableRuleConfiguration("t_course_package_order", "m_$->{0}.t_course_package_order,m_$->{0}.t_course_package_order$->{1..5}");//30 |
| | | result.setTableShardingStrategy(new StandardShardingStrategyConfiguration("appUserId", "t_course_package_order-inline")); |
| | | result.setKeyGenerateStrategy(new KeyGenerateStrategyConfiguration("id", "t_course_package_order-snowflake")); |
| | | return result; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.OutputStream; |
| | | import java.io.InputStream; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | import java.nio.charset.StandardCharsets; |
| | |
| | | public void append(Map<String, Object> audit) { |
| | | try { |
| | | List<ServiceInstance> instances = discoveryClient.getInstances("mb-cloud-other"); |
| | | if (instances == null || instances.isEmpty()) return; |
| | | if (instances == null || instances.isEmpty()) { |
| | | log.warn("管理端审计写入失败:未发现审计服务 mb-cloud-other"); |
| | | return; |
| | | } |
| | | URL url = new URL(instances.get(0).getUri().toString() + "/internal/audit-logs"); |
| | | HttpURLConnection connection = (HttpURLConnection) url.openConnection(); |
| | | connection.setConnectTimeout(1000); |
| | |
| | | connection.setRequestProperty("Content-Type", "application/json;charset=UTF-8"); |
| | | byte[] body = JSON.toJSONString(audit).getBytes(StandardCharsets.UTF_8); |
| | | try (OutputStream output = connection.getOutputStream()) { output.write(body); } |
| | | connection.getResponseCode(); |
| | | int status = connection.getResponseCode(); |
| | | if (status < HttpURLConnection.HTTP_OK || status >= HttpURLConnection.HTTP_MULT_CHOICE) { |
| | | log.warn("管理端审计写入失败,响应状态: {}, 响应内容: {}", status, |
| | | readResponse(connection.getErrorStream())); |
| | | } |
| | | connection.disconnect(); |
| | | } catch (Exception e) { |
| | | log.warn("管理端审计写入失败", e); |
| | | } |
| | | } |
| | | |
| | | private String readResponse(InputStream input) { |
| | | if (input == null) return ""; |
| | | try (InputStream stream = input) { |
| | | byte[] buffer = new byte[1024]; |
| | | int length = stream.read(buffer); |
| | | return length <= 0 ? "" : new String(buffer, 0, length, StandardCharsets.UTF_8); |
| | | } catch (Exception ignored) { |
| | | return ""; |
| | | } |
| | | } |
| | | } |
| | |
| | | public Map<String, Object> data() { |
| | | Map<String, Object> r = new HashMap<>(); |
| | | r.put("config", appGuideConfigMapper.selectOne(new QueryWrapper<AppGuideConfig>().orderByDesc("id").last("limit 1"))); |
| | | r.put("banners", appGuideBannerMapper.selectList(new QueryWrapper<AppGuideBanner>().orderByAsc("sort").orderByDesc("id"))); |
| | | r.put("banners", appGuideBannerMapper.selectList(new QueryWrapper<AppGuideBanner>().orderByDesc("sort").orderByDesc("id"))); |
| | | List<QrLink> links = qrLinkMapper.selectList(new QueryWrapper<QrLink>().eq("type", "SITE_BOOKING").orderByDesc("id")); |
| | | List<Map<String, Object>> linkData = new ArrayList<>(); |
| | | for (QrLink link : links) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 将门店统计目标限制在当前账号可见范围内。门店账号固定统计自身;运营商账号 |
| | | * 只能统计归属自己的门店,避免其它门店的数据混入其统计结果。 |
| | | */ |
| | | private Integer resolveStatisticsStoreId(Integer storeId) { |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | if (Integer.valueOf(3).equals(objectType)) { |
| | | return UserExt.getUser().getObjectId(); |
| | | } |
| | | if (storeId == null) { |
| | | return null; |
| | | } |
| | | TStore store = storeService.getById(storeId); |
| | | if (store == null || Integer.valueOf(3).equals(store.getState())) { |
| | | return null; |
| | | } |
| | | if (Integer.valueOf(2).equals(objectType) |
| | | && !UserExt.getUser().getObjectId().equals(store.getOperatorId())) { |
| | | return null; |
| | | } |
| | | return storeId; |
| | | } |
| | | |
| | | /** |
| | | * 运营商统计的门店范围:平台(0)统计平台门店,其他值统计对应运营商门店。 |
| | | */ |
| | | private List<TStore> listStatisticsStores(Integer operatorId, boolean enabledOnly) { |
| | |
| | | } else { |
| | | wrapper.ne(TStore::getState, 3); |
| | | } |
| | | if (Integer.valueOf(0).equals(operatorId)) { |
| | | if (operatorId == null) { |
| | | // 平台统计:所有门店总和,不按门店所属运营商过滤。 |
| | | } else if (Integer.valueOf(0).equals(operatorId)) { |
| | | wrapper.eq(TStore::getType, 1); |
| | | } else { |
| | | wrapper.eq(TStore::getType, 2).eq(TStore::getOperatorId, operatorId); |
| | | } |
| | | return storeService.list(wrapper); |
| | | } |
| | | |
| | | /** 空门店范围必须显式传递无匹配值,不能让下游 SQL 因空集合而省略 IN 条件。 */ |
| | | private List<Integer> listStatisticsStoreIds(Integer operatorId, boolean enabledOnly) { |
| | | List<Integer> storeIds = listStatisticsStores(operatorId, enabledOnly).stream() |
| | | .map(TStore::getId).collect(Collectors.toList()); |
| | | return storeIds.isEmpty() ? Collections.singletonList(-1) : storeIds; |
| | | } |
| | | |
| | | /** 获取统计范围门店发生课程、订场或赛事消费的用户。 */ |
| | |
| | | .stream().map(SiteBooking::getAppUserId).filter(Objects::nonNull) |
| | | .collect(Collectors.toList())); |
| | | List<Integer> competitionUserIds = competitionClient.queryAppUserId(storeIds); |
| | | if (competitionUserIds != null) { |
| | | userIds.addAll(competitionUserIds); |
| | | } |
| | | List<Integer> validUserIds = userIds.stream().filter(Objects::nonNull).distinct() |
| | | .collect(Collectors.toList()); |
| | | return validUserIds.isEmpty() ? Collections.singletonList(-1) : validUserIds; |
| | | } |
| | | |
| | | private List<Integer> listStatisticsAppUserIdsForStore(Integer storeId) { |
| | | if (storeId == null) { |
| | | return Collections.singletonList(-1); |
| | | } |
| | | List<Integer> userIds = new ArrayList<>(); |
| | | List<Integer> courseUserIds = coursePackagePaymentClient.queryPaymentCoursePackage( |
| | | Collections.singletonList(storeId)); |
| | | if (courseUserIds != null) { |
| | | userIds.addAll(courseUserIds); |
| | | } |
| | | userIds.addAll(siteBookingService.list(new QueryWrapper<SiteBooking>() |
| | | .eq("storeId", storeId).eq("state", 1)) |
| | | .stream().map(SiteBooking::getAppUserId).filter(Objects::nonNull) |
| | | .collect(Collectors.toList())); |
| | | List<Integer> competitionUserIds = competitionClient.queryAppUserId( |
| | | Collections.singletonList(storeId)); |
| | | if (competitionUserIds != null) { |
| | | userIds.addAll(competitionUserIds); |
| | | } |
| | |
| | | } else if (Integer.valueOf(2).equals(roleType)) { |
| | | operatorId = objectId; |
| | | storeId = resolveStoreId(storeId); |
| | | } |
| | | |
| | | // 下游多处查询会在门店集合为空时忽略门店过滤。运营商没有任何门店时, |
| | | // 直接返回完整的零值结构,避免被误统计为全平台数据。 |
| | | if (operatorId != null && storeId == null |
| | | && listStatisticsStores(operatorId, false).isEmpty()) { |
| | | Map<String, Object> emptyIncomeData = buildIncomeStatistics(Collections.emptyList()); |
| | | emptyIncomeData.put("incomeTypeNet", buildIncomeTypeNet(Collections.emptyList(), null)); |
| | | Map<String, Object> emptyTicketIncome = new HashMap<>(); |
| | | emptyTicketIncome.put("day", BigDecimal.ZERO); |
| | | emptyTicketIncome.put("month", BigDecimal.ZERO); |
| | | emptyTicketIncome.put("quarter", BigDecimal.ZERO); |
| | | emptyTicketIncome.put("year", BigDecimal.ZERO); |
| | | emptyIncomeData.put("ticketIncome", emptyTicketIncome); |
| | | return emptyIncomeData; |
| | | } |
| | | |
| | | // 参数代表当前统计目标,而非当前登录人的角色;平台账号查看运营商/门店页时, |
| | |
| | | private Map<String, Object> getTicketIncome(String time, Integer operatorId, Integer storeId) { |
| | | List<Integer> userIds; |
| | | if (storeId != null) { |
| | | userIds = appUserClient.getUserStore(storeId); |
| | | userIds = listStatisticsAppUserIdsForStore(storeId); |
| | | } else if (operatorId != null) { |
| | | userIds = appUserClient.getUserYYs(operatorId); |
| | | userIds = listStatisticsAppUserIds(operatorId); |
| | | } else { |
| | | List<Integer> platformUserIds = sysUserService.list(new LambdaQueryWrapper<User>() |
| | | .eq(User::getObjectType, 1)) |
| | | .stream().map(User::getId).collect(Collectors.toList()); |
| | | userIds = appUserClient.getUserPt(platformUserIds); |
| | | userIds = listStatisticsAppUserIds(null); |
| | | } |
| | | if (userIds == null) { |
| | | userIds = new ArrayList<>(); |
| | |
| | | @ResponseBody |
| | | public Object backPt(Integer type) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | List<Integer> userPt = appUserClient.getUserPt(Arrays.asList(1)); |
| | | if(userPt.size()==0){ |
| | | userPt.add(-1); |
| | | } |
| | | List<Integer> userPt = listStatisticsAppUserIds(null); |
| | | ArrayList<Object> integers = new ArrayList<>(); |
| | | int year = DateUtil.year(new Date()); |
| | | List<TBackRecord> thisYear = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().like(TBackRecord::getTime, year).in(TBackRecord::getUserId,userPt)); |
| | |
| | | @RequestMapping(value = "/backStore") |
| | | @ResponseBody |
| | | public Object backStore(Integer id) { |
| | | List<Integer> collect1 = Arrays.asList(id); |
| | | id = resolveStatisticsStoreId(id); |
| | | List<Integer> collect1 = Collections.singletonList(id == null ? -1 : id); |
| | | //课程 |
| | | List<Integer> list = coursePackagePaymentClient.queryPaymentCoursePackage(collect1); |
| | | //场地 |
| | |
| | | @RequestMapping(value = "/userAndVipPt") |
| | | @ResponseBody |
| | | public Object userAndVipPt(Integer type) { |
| | | type=1; |
| | | HashMap<String, Object> map = appUserClient.userAndVipPt(type); |
| | | HashMap<String, Object> map = appUserClient.userAndVipYys(listStatisticsAppUserIds(null)); |
| | | return map; |
| | | } |
| | | |
| | | @RequestMapping(value = "/stuPt") |
| | | @ResponseBody |
| | | public Object stuPt() { |
| | | HashMap<String, Object> map = appUserClient.stuPt(); |
| | | HashMap<String, Object> map = appUserClient.stuYys(listStatisticsAppUserIds(null)); |
| | | return map; |
| | | } |
| | | @RequestMapping(value = "/stuYys") |
| | |
| | | @RequestMapping(value = "/stuStores") |
| | | @ResponseBody |
| | | public Object stuStores(Integer id) { |
| | | List<Integer> collect1 = Arrays.asList(id); |
| | | id = resolveStatisticsStoreId(id); |
| | | List<Integer> collect1 = Collections.singletonList(id == null ? -1 : id); |
| | | //课程 |
| | | List<Integer> list = coursePackagePaymentClient.queryPaymentCoursePackage(collect1); |
| | | //场地 |
| | |
| | | @RequestMapping(value = "/coursePt") |
| | | @ResponseBody |
| | | public Object coursePt() { |
| | | List<Integer> userPt = appUserClient.getUserPt(Arrays.asList(1)); |
| | | List<Integer> userPt = listStatisticsAppUserIds(null); |
| | | 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)); |
| | | id = resolveStatisticsStoreId(id); |
| | | List<Integer> userPt = listStatisticsAppUserIdsForStore(id); |
| | | HashMap<String, Object> map = coursePackagePaymentClient.coursePt(userPt); |
| | | return map; |
| | | } |
| | |
| | | @ResponseBody |
| | | public Object userAndVipYys(Integer id) { |
| | | id = resolveOperatorId(id); |
| | | List<TStore> list4 = listStatisticsStores(id, true); |
| | | List<Integer> collect1 = list4.stream().map(TStore::getId).collect(Collectors.toList()); |
| | | List<Integer> collect1 = listStatisticsStoreIds(id, true); |
| | | //课程 |
| | | List<Integer> list = coursePackagePaymentClient.queryPaymentCoursePackage(collect1); |
| | | //场地 |
| | |
| | | @RequestMapping(value = "/userAndVipStore") |
| | | @ResponseBody |
| | | public Object userAndVipStore(Integer id) { |
| | | List<Integer> collect1 = Arrays.asList(id); |
| | | id = resolveStatisticsStoreId(id); |
| | | List<Integer> collect1 = Collections.singletonList(id == null ? -1 : id); |
| | | //课程 |
| | | List<Integer> list = coursePackagePaymentClient.queryPaymentCoursePackage(collect1); |
| | | //场地 |
| | |
| | | @RequestMapping(value = "/actPt") |
| | | @ResponseBody |
| | | public Object actPt(Integer type) { |
| | | List<Integer> userPt = appUserClient.getUserPt(Arrays.asList(1)); |
| | | List<Integer> userPt = listStatisticsAppUserIds(null); |
| | | HashMap<String, Object> map = competitionClient.actPt(userPt); |
| | | |
| | | List<TStore> list = storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getOperatorId, 0).ne(TStore::getState, 3)); |
| | | List<TStore> list = listStatisticsStores(null, false); |
| | | long l1=0; |
| | | for (TStore tStore : list) { |
| | | l1 += getStoreOperatingHours(tStore, new Date()); |
| | |
| | | public Object actYys(Integer id) { |
| | | id = resolveOperatorId(id); |
| | | CompetionVO competionVO = new CompetionVO(); |
| | | List<TStore> list4 = listStatisticsStores(id, true); |
| | | List<Integer> collect1 = list4.stream().map(TStore::getId).collect(Collectors.toList()); |
| | | List<Integer> collect1 = listStatisticsStoreIds(id, true); |
| | | //课程 |
| | | List<Integer> list = coursePackagePaymentClient.queryPaymentCoursePackage(collect1); |
| | | //场地 |
| | |
| | | // List<User> list = sysUserService.list(new LambdaQueryWrapper<User>().eq(User::getObjectType, 2)); |
| | | // List<Integer> ids = list.stream().map(User::getId).collect(Collectors.toList()); |
| | | // List<Integer> userIds = appUserClient.getUserYYs(id); |
| | | List<TStore> list4 = listStatisticsStores(id, true); |
| | | List<Integer> collect1 = list4.stream().map(TStore::getId).collect(Collectors.toList()); |
| | | List<Integer> collect1 = listStatisticsStoreIds(id, true); |
| | | QueryDataFee queryDataFee = new QueryDataFee(time, collect1); |
| | | // 课程收入 |
| | | HashMap<String, Object> map3 = courseClient.queryFee(queryDataFee); |
| | |
| | | }else{ |
| | | List<TSite> list = siteService.list(new QueryWrapper<TSite>().in("storeId", collect1).eq("state", 1)); |
| | | ids = list.stream().map(TSite::getId).collect(Collectors.toList()); |
| | | if(collect1.size()==0){ |
| | | if(ids.isEmpty()){ |
| | | ids.add(-1); |
| | | } |
| | | } |
| | |
| | | @ResponseBody |
| | | @RequestMapping("/selectStore") |
| | | public Object selectStore(Integer id,String time) { |
| | | id = resolveStatisticsStoreId(id); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | List<Integer> collect1 = Arrays.asList(id); |
| | | List<Integer> collect1 = Collections.singletonList(id == null ? -1 : id); |
| | | //课程 |
| | | List<Integer> list = coursePackagePaymentClient.queryPaymentCoursePackage(collect1); |
| | | //场地 |
| | |
| | | @ResponseBody |
| | | public Object type1(String time) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | // 找出平台的用户 |
| | | List<User> list = sysUserService.list(new LambdaQueryWrapper<User>().eq(User::getObjectType, 1)); |
| | | List<Integer> ids = list.stream().map(User::getId).collect(Collectors.toList()); |
| | | List<Integer> userIds = appUserClient.getUserPt(ids); |
| | | // 平台统计是所有门店总和,用户范围同样来自所有门店的消费用户。 |
| | | List<Integer> userIds = listStatisticsAppUserIds(null); |
| | | QueryDataFee queryDataFee = new QueryDataFee(time, userIds); |
| | | // 课程和赛事接口的 ids 参数表示门店 ID;不能把平台用户 ID 传入。 |
| | | List<Integer> platformStoreIds = storeService.list(new LambdaQueryWrapper<TStore>() |
| | |
| | | @RequestMapping("/stuCourseData") |
| | | @ResponseBody |
| | | public Object stuCourseData() { |
| | | ArrayList<Integer> objects = new ArrayList<>(); |
| | | objects.add(1); |
| | | List<Integer> userIds = appUserClient.getUserPt(objects); |
| | | List<Integer> userIds = listStatisticsAppUserIds(null); |
| | | List<Map<String,Object>> list = coursePackagePaymentClient.queryCourseData(userIds); |
| | | ArrayList<Object> objects2 = new ArrayList<>(); |
| | | ArrayList<Object> objects3 = new ArrayList<>(); |
| | |
| | | @RequestMapping("/stuUserData") |
| | | @ResponseBody |
| | | public Object stuUserData() { |
| | | ArrayList<Integer> objects = new ArrayList<>(); |
| | | objects.add(1); |
| | | HashMap<String, Object> map = appUserClient.queryUserAge1(); |
| | | HashMap<String, Object> map = appUserClient.queryUserAgeYys(listStatisticsAppUserIds(null)); |
| | | |
| | | return map; |
| | | } |
| | |
| | | @ResponseBody |
| | | public Object stuUserDataYys(Integer id) { |
| | | id = resolveOperatorId(id); |
| | | List<TStore> list4 = listStatisticsStores(id, true); |
| | | List<Integer> collect1 = list4.stream().map(TStore::getId).collect(Collectors.toList()); |
| | | List<Integer> collect1 = listStatisticsStoreIds(id, true); |
| | | //课程 |
| | | List<Integer> list = coursePackagePaymentClient.queryPaymentCoursePackage(collect1); |
| | | //场地 |
| | |
| | | @RequestMapping("/stuUserDataStore") |
| | | @ResponseBody |
| | | public Object stuUserDataStore(Integer id) { |
| | | |
| | | List<Integer> collect1 = Arrays.asList(id); |
| | | id = resolveStatisticsStoreId(id); |
| | | List<Integer> collect1 = Collections.singletonList(id == null ? -1 : id); |
| | | //课程 |
| | | List<Integer> list = coursePackagePaymentClient.queryPaymentCoursePackage(collect1); |
| | | //场地 |
| | |
| | | @ResponseBody |
| | | public Object selectYysJx(Integer id) { |
| | | id = resolveOperatorId(id); |
| | | List<TStore> list4 = listStatisticsStores(id, true); |
| | | List<Integer> collect1 = list4.stream().map(TStore::getId).collect(Collectors.toList()); |
| | | List<Integer> collect1 = listStatisticsStoreIds(id, true); |
| | | //课程 |
| | | List<Integer> list = coursePackagePaymentClient.queryPaymentCoursePackage(collect1); |
| | | //场地 |
| | |
| | | @RequestMapping("/selectStoreJx") |
| | | @ResponseBody |
| | | public Object selectStoreJx(Integer id) { |
| | | List<Integer> collect1 = Arrays.asList(id); |
| | | id = resolveStatisticsStoreId(id); |
| | | List<Integer> collect1 = Collections.singletonList(id == null ? -1 : id); |
| | | //课程 |
| | | List<Integer> list = coursePackagePaymentClient.queryPaymentCoursePackage(collect1); |
| | | //场地 |
| | |
| | | .eq(!StringUtils.isEmpty(query.getProvinceCode()), TSite::getProvinceCode, query.getProvinceCode()) |
| | | .eq(operatorId != null, TSite::getOperatorId, operatorId) |
| | | .ne(TSite::getState,3) |
| | | .orderByDesc(TSite::getId) |
| | | .eq(TSite::getSign,0) |
| | | .eq(!StringUtils.isEmpty(query.getCityCode()), TSite::getCityCode, query.getCityCode()) |
| | | .in(!storeIds.isEmpty(), TSite::getStoreId, storeIds)); |
| | |
| | | @ResponseBody |
| | | public Object listTwo1(Integer id) { |
| | | Page<TStoreOtherConfigTrue> page = new PageFactory<TStoreOtherConfigTrue>().defaultPage(); |
| | | List<TStoreOtherConfigTrue> list = tStoreOtherConfigTrueService.page(page,new LambdaQueryWrapper<TStoreOtherConfigTrue>().eq(TStoreOtherConfigTrue::getPid, id).eq(TStoreOtherConfigTrue::getState,1)).getRecords(); |
| | | List<TStoreOtherConfigTrue> list = tStoreOtherConfigTrueService.page(page,new LambdaQueryWrapper<TStoreOtherConfigTrue>().eq(TStoreOtherConfigTrue::getPid, id).eq(TStoreOtherConfigTrue::getState,1).orderByDesc(TStoreOtherConfigTrue::getId)).getRecords(); |
| | | page.setRecords(list); |
| | | return super.packForBT(page); |
| | | } |
| | |
| | | @ResponseBody |
| | | public Object list() { |
| | | Page<TSiteType> page = new PageFactory<TSiteType>().defaultPage(); |
| | | Page<TSiteType> page1 = siteTypeService.page(page, new LambdaQueryWrapper<TSiteType>().ne(TSiteType::getState,3)); |
| | | Page<TSiteType> page1 = siteTypeService.page(page, new LambdaQueryWrapper<TSiteType>().ne(TSiteType::getState,3).orderByDesc(TSiteType::getId)); |
| | | return super.packForBT(page1); |
| | | } |
| | | |
| | |
| | | @RequestMapping("/writeOff") |
| | | @ResponseBody |
| | | public Object writeOff(String id, Integer goType) { |
| | | WriteOffDTO dto = new WriteOffDTO(); |
| | | dto.setGoType(goType); |
| | | try { |
| | | if (!Integer.valueOf(1).equals(goType) && !Integer.valueOf(2).equals(goType)) { |
| | | appendTicketWriteOffAudit(dto, "FAIL", "入园方式参数不正确"); |
| | | return ResultUtil.error("入园方式参数不正确"); |
| | | } |
| | | Long aLong = Long.valueOf(id); |
| | | WriteOffDTO dto = new WriteOffDTO(); |
| | | dto.setId(Long.valueOf(id)); |
| | | // 核销人员ID与所属门店由登录上下文确定,不能由前端传入。 |
| | | Integer objectId = UserExt.getUser().getId(); |
| | | if (UserExt.getUser().getObjectType() == 1){ |
| | |
| | | TStoreStaff storeByStoreStaffId = storeStaffClient.getStoreByStoreStaffId(objectId); |
| | | dto.setVerifiStoreId(storeByStoreStaffId.getStoreId()); |
| | | } |
| | | dto.setId(aLong); |
| | | dto.setGoType(goType); |
| | | dto.setVerificationUserId(objectId); |
| | | try { |
| | | pointMercharsClient.writeOff(dto); |
| | | appendTicketWriteOffAudit(dto, "SUCCESS", null); |
| | | return new SuccessTip<>(); |
| | |
| | | Map<String, Object> afterData = new HashMap<>(beforeData); |
| | | afterData.put("status", "已核销"); |
| | | afterData.put("goType", dto.getGoType()); |
| | | afterData.put("goTypeName", dto.getGoType() == 1 ? "手环" : "门票核销"); |
| | | afterData.put("goTypeName", Integer.valueOf(1).equals(dto.getGoType()) ? "手环" : "门票核销"); |
| | | afterData.put("verificationUserId", dto.getVerificationUserId()); |
| | | afterData.put("verifiStoreId", dto.getVerifiStoreId()); |
| | | |
| | |
| | | import com.dsh.guns.core.common.exception.BizExceptionEnum; |
| | | import com.dsh.guns.core.exception.GunsException; |
| | | import com.dsh.guns.modular.system.audit.ManagementAuditWriter; |
| | | import com.dsh.guns.modular.system.model.SiteBooking; |
| | | import com.dsh.guns.modular.system.service.ISiteBookingService; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | @Resource private AppUserClient appUserClient; |
| | | @Resource private ManagementAuditWriter auditWriter; |
| | | @Resource private IUserService userService; |
| | | @Resource private ISiteBookingService siteBookingService; |
| | | |
| | | @GetMapping("/app-user/{id}") |
| | | public Map<String, Object> appUser(@PathVariable Integer id) { |
| | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 预约管理查看关联预约人的敏感信息。 |
| | | * |
| | | * <p>仅通过预约记录定位用户,避免前端以任意用户 ID 查询;该接口保留在 |
| | | * /system/sensitive 路径下,以使用全局的脱敏豁免和网关放行策略。</p> |
| | | */ |
| | | @GetMapping("/booking/{bookingId}") |
| | | public Map<String, Object> booking(@PathVariable Integer bookingId) { |
| | | assertAdmin(); |
| | | SiteBooking booking = siteBookingService.getById(bookingId); |
| | | if (booking == null || booking.getAppUserId() == null) { |
| | | writeBookingAudit(bookingId, booking, null, "NOT_FOUND"); |
| | | return null; |
| | | } |
| | | |
| | | Map<String, Object> result = appUserClient.sensitiveAppUser(booking.getAppUserId()); |
| | | writeBookingAudit(bookingId, booking, result, result == null ? "NOT_FOUND" : "SUCCESS"); |
| | | return result; |
| | | } |
| | | |
| | | private void assertAdmin() { |
| | | if (UserExt.getUser() == null || !"admin".equalsIgnoreCase(UserExt.getUser().getAccount())) { |
| | | throw new GunsException(BizExceptionEnum.NO_PERMITION); |
| | |
| | | auditWriter.append(audit); |
| | | } |
| | | |
| | | private void writeBookingAudit(Integer bookingId, SiteBooking booking, |
| | | Map<String, Object> user, String result) { |
| | | Map<String, Object> audit = new HashMap<String, Object>(); |
| | | audit.put("traceId", UUID.randomUUID().toString().replace("-", "")); |
| | | audit.put("sourceService", "mb-cloud-management"); |
| | | audit.put("sourceType", "HTTP"); |
| | | audit.put("operationType", "VIEW_SENSITIVE"); |
| | | audit.put("riskLevel", "SENSITIVE"); |
| | | audit.put("operationName", "超级管理员从预约管理查看敏感信息"); |
| | | audit.put("requestMethod", "GET"); |
| | | audit.put("requestUri", "/system/sensitive/booking/" + bookingId); |
| | | // 审计记录只存预约、用户标识和查询结果,绝不写入手机号、身份证号等明文。 |
| | | audit.put("requestParams", "bookingId=" + bookingId + ", appUserId=" |
| | | + (booking == null || booking.getAppUserId() == null ? "-" : booking.getAppUserId()) |
| | | + ", targetUserName=" + (userName(user) == null ? "-" : userName(user))); |
| | | audit.put("userId", UserExt.getUser().getId()); |
| | | audit.put("userAccount", "admin"); |
| | | audit.put("result", result); |
| | | audit.put("createdAt", new Date()); |
| | | auditWriter.append(audit); |
| | | } |
| | | |
| | | private String userName(Map<String, Object> user) { |
| | | if (user == null || user.get("name") == null) return null; |
| | | return String.valueOf(user.get("name")); |
| | |
| | | HttpServletRequest request = HttpKit.getRequest(); |
| | | queryCoursePackageLists.setLimit(Integer.valueOf(request.getParameter("limit"))); |
| | | queryCoursePackageLists.setOffset(Integer.valueOf(request.getParameter("offset"))); |
| | | queryCoursePackageLists.setSort(request.getParameter("sort")); |
| | | queryCoursePackageLists.setOrder(request.getParameter("order")); |
| | | queryCoursePackageLists.setSort("id"); |
| | | queryCoursePackageLists.setOrder("desc"); |
| | | Page<Map<String, Object>> mapPage = coursePackageClient.queryCoursePackageLists(queryCoursePackageLists); |
| | | List<Map<String, Object>> records = mapPage.getRecords(); |
| | | for (Map<String, Object> record : records) { |
| | |
| | | HttpServletRequest request = HttpKit.getRequest(); |
| | | queryRegistrationRecord.setLimit(Integer.valueOf(request.getParameter("limit"))); |
| | | queryRegistrationRecord.setOffset(Integer.valueOf(request.getParameter("offset"))); |
| | | queryRegistrationRecord.setSort(request.getParameter("sort")); |
| | | queryRegistrationRecord.setOrder(request.getParameter("order")); |
| | | queryRegistrationRecord.setSort("id"); |
| | | queryRegistrationRecord.setOrder("desc"); |
| | | Page<Map<String, Object>> mapPage = coursePackagePaymentClient.queryRegistrationRecord(queryRegistrationRecord); |
| | | return mapPage; |
| | | } |
| | |
| | | HttpServletRequest request = HttpKit.getRequest(); |
| | | queryClassRecord.setLimit(Integer.valueOf(request.getParameter("limit"))); |
| | | queryClassRecord.setOffset(Integer.valueOf(request.getParameter("offset"))); |
| | | queryClassRecord.setSort(request.getParameter("sort")); |
| | | queryClassRecord.setOrder(request.getParameter("order")); |
| | | queryClassRecord.setSort("id"); |
| | | queryClassRecord.setOrder("desc"); |
| | | Page<Map<String, Object>> mapPage = coursePackageSchedulingClient.queryCoursePackageSchedulingList(queryClassRecord); |
| | | return mapPage; |
| | | } |
| | |
| | | HttpServletRequest request = HttpKit.getRequest(); |
| | | queryCoursePackageStudentList.setLimit(Integer.valueOf(request.getParameter("limit"))); |
| | | queryCoursePackageStudentList.setOffset(Integer.valueOf(request.getParameter("offset"))); |
| | | queryCoursePackageStudentList.setSort(request.getParameter("sort")); |
| | | queryCoursePackageStudentList.setOrder(request.getParameter("order")); |
| | | queryCoursePackageStudentList.setSort("id"); |
| | | queryCoursePackageStudentList.setOrder("desc"); |
| | | return coursePackageStudentClient.queryCoursePackageStudentList(queryCoursePackageStudentList); |
| | | } |
| | | |
| | |
| | | HttpServletRequest request = HttpKit.getRequest(); |
| | | queryWalkInStudentList.setLimit(Integer.valueOf(request.getParameter("limit"))); |
| | | queryWalkInStudentList.setOffset(Integer.valueOf(request.getParameter("offset"))); |
| | | queryWalkInStudentList.setSort(request.getParameter("sort")); |
| | | queryWalkInStudentList.setOrder(request.getParameter("order")); |
| | | queryWalkInStudentList.setSort("id"); |
| | | queryWalkInStudentList.setOrder("desc"); |
| | | return coursePackagePaymentClient.queryWalkInStudentList(queryWalkInStudentList); |
| | | } |
| | | |
| | |
| | | HttpServletRequest request = HttpKit.getRequest(); |
| | | queryExamineCoursePackageLists.setLimit(Integer.valueOf(request.getParameter("limit"))); |
| | | queryExamineCoursePackageLists.setOffset(Integer.valueOf(request.getParameter("offset"))); |
| | | queryExamineCoursePackageLists.setSort(request.getParameter("sort")); |
| | | queryExamineCoursePackageLists.setOrder(request.getParameter("order")); |
| | | queryExamineCoursePackageLists.setSort("id"); |
| | | queryExamineCoursePackageLists.setOrder("desc"); |
| | | Page<Map<String, Object>> mapPage = coursePackageClient.queryExamineCoursePackageLists(queryExamineCoursePackageLists); |
| | | List<Map<String, Object>> records = mapPage.getRecords(); |
| | | for (Map<String, Object> record : records) { |
| | |
| | | queryCourseList.setName(name); |
| | | queryCourseList.setLimit(Integer.valueOf(request.getParameter("limit"))); |
| | | queryCourseList.setOffset(Integer.valueOf(request.getParameter("offset"))); |
| | | queryCourseList.setSort(request.getParameter("sort")); |
| | | queryCourseList.setOrder(request.getParameter("order")); |
| | | queryCourseList.setSort("id"); |
| | | queryCourseList.setOrder("desc"); |
| | | Page<Map<String, Object>> mapPage = courseClient.queryCourseLists(queryCourseList); |
| | | return mapPage; |
| | | } |
| | |
| | | // 通过日期 确定周X 查询设置的可以约时间段和金额 封装基础时间段数据 |
| | | LambdaQueryWrapper<TSitePrice> tSitePriceLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | tSitePriceLambdaQueryWrapper.eq(TSitePrice::getSiteId, id); |
| | | tSitePriceLambdaQueryWrapper.orderByAsc(TSitePrice::getStartTime); |
| | | tSitePriceLambdaQueryWrapper.orderByDesc(TSitePrice::getStartTime); |
| | | tSitePriceLambdaQueryWrapper.eq(TSitePrice::getTargetAudience, targetAudience); |
| | | tSitePriceLambdaQueryWrapper.eq(TSitePrice::getDayOfWeek, dayOfWeek.getValue()); |
| | | if (StringUtils.isNotBlank(halfName)) { |
| | |
| | | </if> |
| | | ) |
| | | </if> |
| | | order by id desc |
| | | </select> |
| | | <select id="list" resultType="java.util.Map"> |
| | | select * from sys_dept where 1=1 |
| | |
| | | </if> |
| | | |
| | | |
| | | order by num ASC |
| | | order by num DESC |
| | | </select> |
| | | |
| | | |
| | |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from sys_dict |
| | | where pid in(select id from sys_dict where code = #{code}) order by num asc |
| | | where pid in(select id from sys_dict where code = #{code}) order by num desc |
| | | </select> |
| | | |
| | | <select id="list" resultType="map"> |
| | |
| | | <if test="condition != null and condition != ''"> |
| | | AND name like CONCAT('%',#{condition},'%') |
| | | </if> |
| | | order by id ASC |
| | | order by id DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | order by t1.id desc |
| | | </select> |
| | | </mapper> |
| | |
| | | ) m3 ON m1.id = m3.id |
| | | where m1.ismenu = 1 |
| | | and m1.status = 1 |
| | | order by levels,num asc |
| | | order by levels desc,num desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <if test="null != province"> |
| | | and b.areaName = #{province} |
| | | </if> |
| | | order by a.sort |
| | | order by a.sort desc, a.id desc |
| | | </select> |
| | | |
| | | |
| | |
| | | updateTime as updateTime, |
| | | updateUser as updateUser |
| | | from t_open_city_business |
| | | where flag != 3 and openCityId = #{id} order by sort |
| | | where flag != 3 and openCityId = #{id} order by sort desc, id desc |
| | | </select> |
| | | </mapper> |
| | |
| | | cityName as cityName, |
| | | provinceName as provinceName, |
| | | flag as flag, |
| | | from t_open_city where flag = 1 |
| | | from t_open_city where flag = 1 order by id desc |
| | | </select> |
| | | |
| | | |
| | |
| | | insertUser as insertUser, |
| | | updateTime as updateTime, |
| | | updateUser as updateUser |
| | | from t_open_city where flag = 1 and code = #{code} |
| | | from t_open_city where flag = 1 and code = #{code} order by id desc |
| | | </select> |
| | | <select id="selectList1" resultType="com.dsh.course.entity.OpenCity"> |
| | | select |
| | |
| | | any_value( insertUser) as insertUser, |
| | | any_value( updateTime) as updateTime, |
| | | any_value( updateUser) as updateUser |
| | | from t_open_city where flag != 3 group by areaId |
| | | from t_open_city where flag != 3 group by areaId order by max(id) desc |
| | | </select> |
| | | <select id="selectListCity" resultType="com.dsh.course.entity.OpenCity"> |
| | | select t1.id, |
| | |
| | | from t_open_city t1 |
| | | left join t_city t2 on (t1.areaId = t2.id) |
| | | left join t_city t3 on (t1.cityId = t3.id) |
| | | where flag != 3 group by t1.areaId |
| | | where flag != 3 group by t1.areaId order by max(t1.id) desc |
| | | </select> |
| | | <select id="selectListCity1" resultType="com.dsh.course.entity.OpenCity"> |
| | | select t1.id, |
| | |
| | | t1.insertTime, |
| | | t1.insertUser, |
| | | t1.updateTime, |
| | | t1.updateUser from t_open_city t1 left join t_city t2 on (t1.areaId = t2.id) left join t_city t3 on (t1.cityId = t3.id) where flag != 3 and t1.areaId =#{code} |
| | | t1.updateUser from t_open_city t1 left join t_city t2 on (t1.areaId = t2.id) left join t_city t3 on (t1.cityId = t3.id) where flag != 3 and t1.areaId =#{code} order by t1.id desc |
| | | </select> |
| | | </mapper> |
| | |
| | | and areaCode = #{code} |
| | | </if> |
| | | ) |
| | | order by id desc |
| | | </select> |
| | | |
| | | |
| | |
| | | </if> |
| | | ) |
| | | </if> |
| | | order by id desc |
| | | </select> |
| | | |
| | | |
| | |
| | | <if test="null != companyId"> |
| | | and companyId = #{companyId} |
| | | </if> |
| | | order by id desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <if test="null != pushType"> |
| | | and pushType = #{pushType} |
| | | </if> |
| | | order by id desc |
| | | </select> |
| | | </mapper> |
| | |
| | | <if test="objectType == 1"> |
| | | and rr.objType =1 |
| | | </if> |
| | | order by rr.id desc |
| | | </select> |
| | | |
| | | <delete id="deleteRolesById"> |
| | |
| | | <if test="type == 2"> |
| | | and version = #{creatorId} |
| | | </if> |
| | | order by id desc |
| | | </select> |
| | | |
| | | <select id="roleTreeListByRoleId" resultType="com.dsh.course.model.node.ZTreeNode"> |
| | |
| | | </if> |
| | | </where> |
| | | ORDER BY |
| | | pId, |
| | | num ASC |
| | | pId DESC, |
| | | num DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | |
| | | <select id="queryServerCarModel" resultType="com.dsh.course.entity.ServerCarModel"> |
| | | select * from t_server_carmodel where state = 1 and `type` = #{type} |
| | | select * from t_server_carmodel where state = 1 and `type` = #{type} order by id desc |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | |
| | | <select id="query" resultType="com.dsh.course.entity.SysIntegral"> |
| | | select * from t_sys_integral where companyId = #{companyId} |
| | | select * from t_sys_integral where companyId = #{companyId} order by id desc |
| | | </select> |
| | | </mapper> |
| | |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | order by t1.id desc |
| | | </select> |
| | | <select id="info" resultType="com.dsh.guns.modular.system.model.TEvaluationListVo"> |
| | | select t1.id,t1.appUserId,t1.score,t1.insertTime time,t1.imgs,t1.content,t2.name shopName,t2.province pName,t2.city cName from t_store_evaluation t1 left join t_store t2 on t1.storeId =t2.id |
| | |
| | | <if test="type == 1"> |
| | | and isShow = 1 |
| | | </if> |
| | | order by id desc |
| | | </select> |
| | | |
| | | |
| | |
| | | and o.language =#{yy} |
| | | </if> |
| | | </where> |
| | | order by o.sort asc,o.insertTime desc |
| | | order by o.sort desc,o.insertTime desc |
| | | </select> |
| | | </mapper> |
| | |
| | | <if test="type != null and type != ''"> |
| | | and t1.type = #{type} |
| | | </if> |
| | | order by t1.id desc |
| | | </select> |
| | | <select id="getBankList" resultType="com.dsh.guns.modular.system.model.Bank"> |
| | | select * from t_bank |
| | | select * from t_bank order by id desc |
| | | </select> |
| | | </mapper> |
| | |
| | | <if test="state !=null "> |
| | | and t1.audit = #{state} |
| | | </if> |
| | | ORDER BY t1.id; |
| | | ORDER BY t1.id DESC; |
| | | |
| | | </select> |
| | | </mapper> |
| | |
| | | <if test="operatorId !=null and operatorId !=''"> |
| | | and t1.operatorId = #{operatorId} |
| | | </if> |
| | | order by t1.id desc |
| | | </select> |
| | | <select id="queryProvince" resultType="map"> |
| | | select * from ( |
| | |
| | | <if test="storeName != null and storeName != ''"> |
| | | and `name` like CONCAT('%',#{storeName},'%') |
| | | </if> |
| | | order by id desc |
| | | </select> |
| | | <select id="listOne" resultType="java.util.Map"> |
| | | select id,name,sort,state from t_store_other where storeId=#{id} |
| | | select id,name,sort,state from t_store_other where storeId=#{id} order by id desc |
| | | </select> |
| | | <select id="typeChange" resultType="java.util.Map"> |
| | | select t1.id,t1.name from t_turn t1 left join t_turn t2 on t1.pid = t2.id where t2.name =#{name} |
| | | select t1.id,t1.name from t_turn t1 left join t_turn t2 on t1.pid = t2.id where t2.name =#{name} order by t1.id desc |
| | | </select> |
| | | <select id="typeChangeOne" resultType="java.util.Map"> |
| | | select id,name from t_turn where pid =#{id} |
| | | select id,name from t_turn where pid =#{id} order by id desc |
| | | </select> |
| | | <select id="getConfig" resultType="java.lang.String"> |
| | | select name from t_turn where id =#{page} |
| | | </select> |
| | | <select id="listTwo" resultType="java.util.Map"> |
| | | select id,url,name , page,sort from t_store_other_config |
| | | select id,url,name , page,sort from t_store_other_config order by id desc |
| | | </select> |
| | | |
| | | <select id="getPage" resultType="com.dsh.guns.modular.system.model.TTurn"> |
| | |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | order by t_turn.id desc |
| | | </select> |
| | | <select id="pageList" resultType="com.dsh.guns.modular.system.model.TTurn"> |
| | | select * from t_turn where pid = 0 |
| | | select * from t_turn where pid = 0 order by id desc |
| | | </select> |
| | | <select id="get" resultType="com.dsh.course.dto.JsDto"> |
| | | select * from t_js where id = #{id} |
| | |
| | | |
| | | |
| | | <select id="getConfig1" resultType="com.dsh.guns.modular.system.model.TImgConfig"> |
| | | select * from t_img_config |
| | | select * from t_img_config order by id desc |
| | | </select> |
| | | |
| | | |
| | |
| | | SELECT op.id , CONCAT(us.name,'-',us.`phone`) as value |
| | | FROM t_operator op |
| | | LEFT JOIN sys_user us on op.userId = us.id |
| | | order by op.id desc |
| | | |
| | | |
| | | |
| | |
| | | <if test="shopName !=null and shopName !=''"> |
| | | and t1.name like concat("%",#{shopName},"%") |
| | | </if> |
| | | order by t1.id desc |
| | | </select> |
| | | <select id="querySiteListOfpage" resultType="java.util.Map"> |
| | | SELECT t1.id, t2.operatorId, t1.province, t1.city, t2.name,t1.ids,t1.name as siteName |
| | |
| | | <if test="storeId != null"> |
| | | and t1.storeId = #{storeId} |
| | | </if> |
| | | order by t1.id desc |
| | | </select> |
| | | <select id="querySiteListOfpageOperator" resultType="java.util.Map"> |
| | | SELECT t1.id, t2.operatorId, t1.province, t1.city, t2.name,t1.ids,t1.name as siteName |
| | |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | |
| | | order by t1.id desc |
| | | </select> |
| | | |
| | | <select id="listStoreAll" resultType="map"> |
| | |
| | | <if test="null != cityCode and '' != cityCode"> |
| | | and a.cityCode = #{cityCode} |
| | | </if> |
| | | order by a.id desc |
| | | </select> |
| | | |
| | | |
| | |
| | | <foreach collection="ids" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | order by a.id desc |
| | | </select> |
| | | </mapper> |
| | |
| | | <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''"> |
| | | and (createTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59')) |
| | | </if> |
| | | order by id desc |
| | | </select> |
| | | |
| | | <update id="setStatus"> |
| | |
| | | </if> |
| | | and t1.status != 3 |
| | | </where> |
| | | order by t1.id desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <if test="status != null"> |
| | | and status = #{status} |
| | | </if> |
| | | order by id desc |
| | | </select> |
| | | </mapper> |
| | |
| | | <script src="${ctxPath}/modular/system/dataStatistics/tSite.js"></script> |
| | | <script src="${ctxPath}/static/js/plugins/switchery/switchery.js"></script> |
| | | <script> |
| | | // 仅格式化前端展示,接口返回的原始数值不作改动。 |
| | | function formatStatisticNumber(value) { |
| | | var number = Number(value); |
| | | return isFinite(number) ? number.toFixed(2) : '0.00'; |
| | | } |
| | | |
| | | var weekX = ["1周","2周","3周","4周"]; |
| | | var monthX = ["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]; |
| | |
| | | var netIncomeAmount = document.getElementById("netIncomeAmount"); |
| | | var couponDeductionAmount = document.getElementById("couponDeductionAmount"); |
| | | var refundAmount = document.getElementById("refundAmount"); |
| | | t1.innerText = list[0] || 0; |
| | | t2.innerText = "年度应收:"+list[1]+" "; |
| | | netIncomeAmount.innerText = resp.netIncomeAmount || 0; |
| | | couponDeductionAmount.innerText = resp.couponDeductionAmount || 0; |
| | | refundAmount.innerText = resp.refundAmount || 0; |
| | | t1.innerText = formatStatisticNumber(list[0]); |
| | | t2.innerText = "年度应收:" + formatStatisticNumber(list[1]) + " "; |
| | | netIncomeAmount.innerText = formatStatisticNumber(resp.netIncomeAmount); |
| | | couponDeductionAmount.innerText = formatStatisticNumber(resp.couponDeductionAmount); |
| | | refundAmount.innerText = formatStatisticNumber(resp.refundAmount); |
| | | var incomeTypeNet = resp.incomeTypeNet || {}; |
| | | $("#fee1").text(incomeTypeNet[1] || 0); |
| | | $("#fee2").text(incomeTypeNet[2] || 0); |
| | | $("#fee3").text(incomeTypeNet[3] || 0); |
| | | $("#fee4").text(incomeTypeNet[4] || 0); |
| | | $("#fee5").text(incomeTypeNet[5] || 0); |
| | | $("#fee7").text(incomeTypeNet[6] || 0); |
| | | t3.innerText = "月度营收:"+list[2]+" "; |
| | | t4.innerText = "周度营收:"+list[3]+" "; |
| | | t5.innerText = "日度营收:"+list[4]+" "; |
| | | $("#fee1").text(formatStatisticNumber(incomeTypeNet[1])); |
| | | $("#fee2").text(formatStatisticNumber(incomeTypeNet[2])); |
| | | $("#fee3").text(formatStatisticNumber(incomeTypeNet[3])); |
| | | $("#fee4").text(formatStatisticNumber(incomeTypeNet[4])); |
| | | $("#fee5").text(formatStatisticNumber(incomeTypeNet[5])); |
| | | $("#fee7").text(formatStatisticNumber(incomeTypeNet[6])); |
| | | t3.innerText = "月度营收:" + formatStatisticNumber(list[2]) + " "; |
| | | t4.innerText = "周度营收:" + formatStatisticNumber(list[3]) + " "; |
| | | t5.innerText = "日度营收:" + formatStatisticNumber(list[4]) + " "; |
| | | var year = resp.yearIncome; |
| | | var month = resp.monthIncome; |
| | | var week = resp.weekIncome; |
| | |
| | | return; |
| | | } |
| | | var ajax3 = new $ax(Feng.ctxPath + "/data/backYys", function(data){ |
| | | $("#back1").text(data.thisYear); |
| | | $("#back2").text(data.thisMonth); |
| | | $("#back3").text(data.thisWeek); |
| | | $("#back4").text(data.thisDay); |
| | | $("#back1").text(formatStatisticNumber(data.thisYear)); |
| | | $("#back2").text(formatStatisticNumber(data.thisMonth)); |
| | | $("#back3").text(formatStatisticNumber(data.thisWeek)); |
| | | $("#back4").text(formatStatisticNumber(data.thisDay)); |
| | | option1 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | |
| | | <script src="${ctxPath}/modular/system/dataStatistics/echarts.min.js"></script> |
| | | <script src="${ctxPath}/static/js/plugins/switchery/switchery.js"></script> |
| | | <script> |
| | | // 仅格式化前端展示,接口返回的原始数值不作改动。 |
| | | function formatStatisticNumber(value) { |
| | | var number = Number(value); |
| | | return isFinite(number) ? number.toFixed(2) : '0.00'; |
| | | } |
| | | laydate.render({ |
| | | elem: '#beginTime' |
| | | , trigger: 'click' |
| | |
| | | var time = $("#beginTime").val(); |
| | | // 营收卡片与收入类型卡片使用同一接口、同一时间范围,避免筛选后口径不一致。 |
| | | var incomeAjax = new $ax(Feng.ctxPath + "/data/getIncomeData", function(resp){ |
| | | $("#totalIncome").text(resp.incomeStatistics.totalIncomeAmount || 0); |
| | | $("#netIncomeAmount").text(resp.incomeStatistics.netIncomeAmount || 0); |
| | | $("#couponDeductionAmount").text(resp.incomeStatistics.couponDeductionAmount || 0); |
| | | $("#refundAmount").text(resp.incomeStatistics.refundAmount || 0); |
| | | $("#totalIncome").text(formatStatisticNumber(resp.incomeStatistics.totalIncomeAmount)); |
| | | $("#netIncomeAmount").text(formatStatisticNumber(resp.incomeStatistics.netIncomeAmount)); |
| | | $("#couponDeductionAmount").text(formatStatisticNumber(resp.incomeStatistics.couponDeductionAmount)); |
| | | $("#refundAmount").text(formatStatisticNumber(resp.incomeStatistics.refundAmount)); |
| | | var incomeTypeNet = resp.incomeTypeNet || {}; |
| | | $("#fee1").text(incomeTypeNet[1] || 0); |
| | | $("#fee2").text(incomeTypeNet[2] || 0); |
| | | $("#fee3").text(incomeTypeNet[3] || 0); |
| | | $("#fee4").text(incomeTypeNet[4] || 0); |
| | | $("#fee5").text(incomeTypeNet[5] || 0); |
| | | $("#fee7").text(incomeTypeNet[6] || 0); |
| | | $("#fee1").text(formatStatisticNumber(incomeTypeNet[1])); |
| | | $("#fee2").text(formatStatisticNumber(incomeTypeNet[2])); |
| | | $("#fee3").text(formatStatisticNumber(incomeTypeNet[3])); |
| | | $("#fee4").text(formatStatisticNumber(incomeTypeNet[4])); |
| | | $("#fee5").text(formatStatisticNumber(incomeTypeNet[5])); |
| | | $("#fee7").text(formatStatisticNumber(incomeTypeNet[6])); |
| | | renderTicketIncomeChart(resp.ticketIncome || {}); |
| | | }); |
| | | incomeAjax.set("time", time); |
| | |
| | | |
| | | function renderIncomeStatistics(elementId, periodName, statistics) { |
| | | document.getElementById(elementId).innerText = periodName + "统计:总营收金额 " |
| | | + statistics.totalIncomeAmount + ",净收入金额 " + statistics.netIncomeAmount |
| | | + ",优惠券抵扣金额 " + statistics.couponDeductionAmount + ",退款金额 " |
| | | + statistics.refundAmount; |
| | | + formatStatisticNumber(statistics.totalIncomeAmount) + ",净收入金额 " + formatStatisticNumber(statistics.netIncomeAmount) |
| | | + ",优惠券抵扣金额 " + formatStatisticNumber(statistics.couponDeductionAmount) + ",退款金额 " |
| | | + formatStatisticNumber(statistics.refundAmount); |
| | | } |
| | | |
| | | function renderIncomeStatisticsList(elementId, title, labels, statistics) { |
| | | var records = labels.map(function (label, index) { |
| | | var item = statistics[index]; |
| | | return '<div class="income-period-record"><strong>' + label + '</strong>:总营收金额 ' |
| | | + item.totalIncomeAmount + ',净收入金额 ' + item.netIncomeAmount |
| | | + ',优惠券抵扣金额 ' + item.couponDeductionAmount |
| | | + ',退款金额 ' + item.refundAmount + '</div>'; |
| | | + formatStatisticNumber(item.totalIncomeAmount) + ',净收入金额 ' + formatStatisticNumber(item.netIncomeAmount) |
| | | + ',优惠券抵扣金额 ' + formatStatisticNumber(item.couponDeductionAmount) |
| | | + ',退款金额 ' + formatStatisticNumber(item.refundAmount) + '</div>'; |
| | | }).join(''); |
| | | document.getElementById(elementId).innerHTML = '<div class="income-period-title">' + title |
| | | + '</div><div class="income-period-records">' + records + '</div>'; |
| | |
| | | formatter: function (params) { |
| | | var item = params[0]; |
| | | var detail = statistics[item.dataIndex]; |
| | | return labels[item.dataIndex] + '<br/>总营收:' + detail.totalIncomeAmount |
| | | + '<br/>净收入:' + detail.netIncomeAmount |
| | | + '<br/>优惠券抵扣:' + detail.couponDeductionAmount |
| | | + '<br/>退款:' + detail.refundAmount; |
| | | return labels[item.dataIndex] + '<br/>总营收:' + formatStatisticNumber(detail.totalIncomeAmount) |
| | | + '<br/>净收入:' + formatStatisticNumber(detail.netIncomeAmount) |
| | | + '<br/>优惠券抵扣:' + formatStatisticNumber(detail.couponDeductionAmount) |
| | | + '<br/>退款:' + formatStatisticNumber(detail.refundAmount); |
| | | } |
| | | }, |
| | | grid: {left: '5%', right: '4%', bottom: '18%', containLabel: true}, |
| | |
| | | var netIncomeAmount = document.getElementById("netIncomeAmount"); |
| | | var couponDeductionAmount = document.getElementById("couponDeductionAmount"); |
| | | var refundAmount = document.getElementById("refundAmount"); |
| | | t1.innerText = list[0] || 0; |
| | | netIncomeAmount.innerText = resp.incomeStatistics.netIncomeAmount || 0; |
| | | couponDeductionAmount.innerText = resp.incomeStatistics.couponDeductionAmount || 0; |
| | | refundAmount.innerText = resp.incomeStatistics.refundAmount || 0; |
| | | t1.innerText = formatStatisticNumber(list[0]); |
| | | netIncomeAmount.innerText = formatStatisticNumber(resp.incomeStatistics.netIncomeAmount); |
| | | couponDeductionAmount.innerText = formatStatisticNumber(resp.incomeStatistics.couponDeductionAmount); |
| | | refundAmount.innerText = formatStatisticNumber(resp.incomeStatistics.refundAmount); |
| | | renderIncomeStatisticsList("yearIncomeStatistics", "历年营收明细", resp.yearLabels, resp.yearIncomeStatistics); |
| | | renderIncomeStatisticsList("monthIncomeStatistics", "本年各月营收明细", resp.monthLabels, resp.monthIncomeStatistics); |
| | | renderIncomeStatisticsList("weekIncomeStatistics", "近四周营收明细", resp.weekLabels, resp.weekIncomeStatistics); |
| | |
| | | renderIncomeTrendChart("incomeMonthChart", "本年各月营收趋势", resp.monthLabels, resp.monthIncomeStatistics); |
| | | renderIncomeTrendChart("incomeWeekChart", "近四周营收趋势", resp.weekLabels, resp.weekIncomeStatistics); |
| | | renderIncomeTrendChart("incomeDayChart", "近七日营收趋势", resp.dayLabels, resp.dayIncomeStatistics); |
| | | $("#back1").text(resp.yearIncomeStatistics[resp.yearIncomeStatistics.length - 1].refundAmount || 0); |
| | | $("#back2").text(resp.monthIncomeStatistics[new Date().getMonth()].refundAmount || 0); |
| | | $("#back3").text(resp.weekIncomeStatistics[resp.weekIncomeStatistics.length - 1].refundAmount || 0); |
| | | $("#back4").text(resp.dayIncomeStatistics[resp.dayIncomeStatistics.length - 1].refundAmount || 0); |
| | | $("#back1").text(formatStatisticNumber(resp.yearIncomeStatistics[resp.yearIncomeStatistics.length - 1].refundAmount)); |
| | | $("#back2").text(formatStatisticNumber(resp.monthIncomeStatistics[new Date().getMonth()].refundAmount)); |
| | | $("#back3").text(formatStatisticNumber(resp.weekIncomeStatistics[resp.weekIncomeStatistics.length - 1].refundAmount)); |
| | | $("#back4").text(formatStatisticNumber(resp.dayIncomeStatistics[resp.dayIncomeStatistics.length - 1].refundAmount)); |
| | | renderRefundChart(myChart1, resp); |
| | | }); |
| | | ajax.set("type",1); |
| | |
| | | <script src="${ctxPath}/modular/system/dataStatistics/tSite.js"></script> |
| | | <script src="${ctxPath}/static/js/plugins/switchery/switchery.js"></script> |
| | | <script> |
| | | // 仅格式化前端展示,接口返回的原始数值不作改动。 |
| | | function formatStatisticNumber(value) { |
| | | var number = Number(value); |
| | | return isFinite(number) ? number.toFixed(2) : '0.00'; |
| | | } |
| | | |
| | | |
| | | function search(){ |
| | |
| | | var records = labels.map(function (label, index) { |
| | | var item = statistics[index]; |
| | | return '<div class="income-period-record"><strong>' + label + '</strong>:总营收金额 ' |
| | | + item.totalIncomeAmount + ',净收入金额 ' + item.netIncomeAmount |
| | | + ',优惠券抵扣金额 ' + item.couponDeductionAmount + ',退款金额 ' |
| | | + item.refundAmount + '</div>'; |
| | | + formatStatisticNumber(item.totalIncomeAmount) + ',净收入金额 ' + formatStatisticNumber(item.netIncomeAmount) |
| | | + ',优惠券抵扣金额 ' + formatStatisticNumber(item.couponDeductionAmount) + ',退款金额 ' |
| | | + formatStatisticNumber(item.refundAmount) + '</div>'; |
| | | }).join(''); |
| | | document.getElementById(elementId).innerHTML = '<div class="income-period-title">' + title |
| | | + '</div><div class="income-period-records">' + records + '</div>'; |
| | |
| | | title: {text: title, left: 'center', textStyle: {fontSize: 15}}, |
| | | tooltip: {trigger: 'axis', formatter: function (params) { |
| | | var detail = statistics[params[0].dataIndex]; |
| | | return labels[params[0].dataIndex] + '<br/>总营收:' + detail.totalIncomeAmount |
| | | + '<br/>净收入:' + detail.netIncomeAmount + '<br/>优惠券抵扣:' |
| | | + detail.couponDeductionAmount + '<br/>退款:' + detail.refundAmount; |
| | | return labels[params[0].dataIndex] + '<br/>总营收:' + formatStatisticNumber(detail.totalIncomeAmount) |
| | | + '<br/>净收入:' + formatStatisticNumber(detail.netIncomeAmount) + '<br/>优惠券抵扣:' |
| | | + formatStatisticNumber(detail.couponDeductionAmount) + '<br/>退款:' + formatStatisticNumber(detail.refundAmount); |
| | | }}, |
| | | grid: {left: '5%', right: '4%', bottom: '18%', containLabel: true}, |
| | | xAxis: {type: 'category', boundaryGap: false, data: labels, axisLabel: {rotate: labels.length > 7 ? 35 : 0, interval: 0}}, |
| | |
| | | function income(){ |
| | | var ajax = new $ax(Feng.ctxPath + "/data/getIncomeData", function(resp){ |
| | | yearX = resp.year; |
| | | $("#totalIncome").text(resp.incomeStatistics.totalIncomeAmount || 0); |
| | | $("#netIncomeAmount").text(resp.incomeStatistics.netIncomeAmount || 0); |
| | | $("#couponDeductionAmount").text(resp.incomeStatistics.couponDeductionAmount || 0); |
| | | $("#refundAmount").text(resp.incomeStatistics.refundAmount || 0); |
| | | $("#totalIncome").text(formatStatisticNumber(resp.incomeStatistics.totalIncomeAmount)); |
| | | $("#netIncomeAmount").text(formatStatisticNumber(resp.incomeStatistics.netIncomeAmount)); |
| | | $("#couponDeductionAmount").text(formatStatisticNumber(resp.incomeStatistics.couponDeductionAmount)); |
| | | $("#refundAmount").text(formatStatisticNumber(resp.incomeStatistics.refundAmount)); |
| | | var incomeTypeNet = resp.incomeTypeNet || {}; |
| | | $("#fee1").text(incomeTypeNet[1] || 0); |
| | | $("#fee2").text(incomeTypeNet[2] || 0); |
| | | $("#fee3").text(incomeTypeNet[3] || 0); |
| | | $("#fee4").text(incomeTypeNet[4] || 0); |
| | | $("#fee5").text(incomeTypeNet[5] || 0); |
| | | $("#fee7").text(incomeTypeNet[6] || 0); |
| | | $("#fee1").text(formatStatisticNumber(incomeTypeNet[1])); |
| | | $("#fee2").text(formatStatisticNumber(incomeTypeNet[2])); |
| | | $("#fee3").text(formatStatisticNumber(incomeTypeNet[3])); |
| | | $("#fee4").text(formatStatisticNumber(incomeTypeNet[4])); |
| | | $("#fee5").text(formatStatisticNumber(incomeTypeNet[5])); |
| | | $("#fee7").text(formatStatisticNumber(incomeTypeNet[6])); |
| | | renderIncomeStatisticsList("yearIncomeStatistics", "历年营收明细", resp.yearLabels, resp.yearIncomeStatistics); |
| | | renderIncomeStatisticsList("monthIncomeStatistics", "本年各月营收明细", resp.monthLabels, resp.monthIncomeStatistics); |
| | | renderIncomeStatisticsList("weekIncomeStatistics", "近四周营收明细", resp.weekLabels, resp.weekIncomeStatistics); |
| | |
| | | Collections.sort(listVo, new Comparator<StoreConfigVo>() { |
| | | @Override |
| | | public int compare(StoreConfigVo o1, StoreConfigVo o2) { |
| | | return o1.getSort().compareTo(o2.getSort()); |
| | | return Comparator.nullsLast(Integer::compareTo).compare(o1.getSort(), o2.getSort()); |
| | | } |
| | | }); |
| | | //排序 |
| | | Collections.sort(listVo, new Comparator<StoreConfigVo>() { |
| | | @Override |
| | | public int compare(StoreConfigVo o1, StoreConfigVo o2) { |
| | | return o1.getIsTop().compareTo(o2.getIsTop()) * -1; |
| | | return Comparator.nullsLast(Integer::compareTo).compare(o2.getIsTop(), o1.getIsTop()); |
| | | } |
| | | }); |
| | | for (int i = 0; i < listVo.size(); i++) { |
| | |
| | | siteBooking.setPayMoney(BigDecimal.ZERO.doubleValue()); |
| | | siteBooking.setPayTime(new Date()); |
| | | siteBookingService.updateById(siteBooking); |
| | | consumeCouponAfterSuccessfulPayment(siteBooking); |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put("siteBooking", siteBooking.getId().toString()); |
| | | return ResultUtil.success(map); |
| | |
| | | siteBooking.setPayTime(new Date()); |
| | | siteBooking.setStatus(1); |
| | | siteBookingService.updateById(siteBooking); |
| | | consumeCouponAfterSuccessfulPayment(siteBooking); |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put("siteBooking", siteBooking.getId().toString()); |
| | | return ResultUtil.success(map); |
| | | } |
| | | |
| | | /** |
| | | * 场地订单实际支付成功后才核销所选优惠券;避免仅创建待支付订单就提前消耗优惠券。 |
| | | */ |
| | | private void consumeCouponAfterSuccessfulPayment(SiteBooking siteBooking) { |
| | | if (siteBooking.getUserCouponId() == null || siteBooking.getUserCouponId() == 0) { |
| | | return; |
| | | } |
| | | UserCoupon userCoupon = userCouponClient.queryUserCouponById( |
| | | new QueryUserCouponByIdAndUserId(siteBooking.getUserCouponId(), siteBooking.getAppUserId())); |
| | | if (userCoupon != null && Integer.valueOf(1).equals(userCoupon.getStatus())) { |
| | | userCoupon.setStatus(2); |
| | | userCouponClient.updateUserCoupon(userCoupon); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | userCoupon.setStatus(2); |
| | | userCouponClient.updateUserCoupon(userCoupon); |
| | | } |
| | | if (null != couponId && payType == 3) { |
| | | UserCoupon userCoupon = userCouponClient.queryUserCouponById(new QueryUserCouponByIdAndUserId(siteBooking.getUserCouponId(), appUser.getId())); |
| | | userCoupon.setStatus(1); |
| | | userCouponClient.updateUserCoupon(userCoupon); |
| | | } |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | siteBooking.setOrderNo(sdf.format(new Date()) + UUIDUtil.getNumberRandom(3)); |
| | | |
| | |
| | | siteBooking.setPayMoney(playCoin.doubleValue()); |
| | | } else { |
| | | siteBooking.setPayMoney(money.doubleValue()); |
| | | } |
| | | if (payType == 3) { |
| | | siteBooking.setUserCouponId(null); |
| | | } |
| | | siteBookingService.updateById(siteBooking); |
| | | if (payType == 1) {//微信支付 |