| | |
| | | import com.dsh.guns.core.util.ToolUtil; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import com.dsh.guns.modular.system.service.*; |
| | | import com.dsh.guns.modular.system.util.ResultUtil; |
| | | import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ; |
| | | import com.sun.org.apache.bcel.internal.generic.NEW; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private SiteClient siteClient; |
| | | |
| | | |
| | | /** |
| | | * 跳转到充值记录页面 |
| | | /* |
| | | * 充值记录功能已下线,保留原实现以便后续恢复。 |
| | | * |
| | | * @RequestMapping("/rechargeRecords") |
| | | * public String index(Model model) { |
| | | * List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | * model.addAttribute("list",list); |
| | | * Integer objectType = UserExt.getUser().getObjectType(); |
| | | * Integer objectId = UserExt.getUser().getObjectId(); |
| | | * model.addAttribute("userType",objectType); |
| | | * String roleid = UserExt.getUser().getRoleid(); |
| | | * model.addAttribute("objectType",objectType); |
| | | * return PREFIX + "RechargeRecords.html"; |
| | | * } |
| | | * |
| | | * @RequestMapping(value = "/listAll") |
| | | * @ResponseBody |
| | | * public List<RechargeRecordsVO> list(String province, String city, String name, String phone, String time, Integer type) { |
| | | * RechargeRecordsQuery coachQuery = new RechargeRecordsQuery(); |
| | | * Region provinceCode = regionService.getOne(new QueryWrapper<Region>().eq("code", province)); |
| | | * Region cityCode = regionService.getOne(new QueryWrapper<Region>().eq("code", city)); |
| | | * if (provinceCode != null) { |
| | | * coachQuery.setProvince(provinceCode.getName()); |
| | | * } else { |
| | | * coachQuery.setProvince(province); |
| | | * } |
| | | * if (cityCode != null) { |
| | | * coachQuery.setCity(cityCode.getName()); |
| | | * } else { |
| | | * coachQuery.setCity(city); |
| | | * } |
| | | * coachQuery.setName(name); |
| | | * coachQuery.setPhone(phone); |
| | | * coachQuery.setTime(time); |
| | | * coachQuery.setType(type); |
| | | * return financeClient.rechargeList(coachQuery); |
| | | * } |
| | | * |
| | | * @RequestMapping(value = "/getAmount") |
| | | * @ResponseBody |
| | | * public BigDecimal getAmount(String province, String city, String name, String phone, String time, Integer type) { |
| | | * RechargeRecordsQuery coachQuery = new RechargeRecordsQuery(); |
| | | * coachQuery.setProvince(province); |
| | | * coachQuery.setCity(city); |
| | | * coachQuery.setName(name); |
| | | * coachQuery.setPhone(phone); |
| | | * coachQuery.setTime(time); |
| | | * coachQuery.setType(type); |
| | | * List<RechargeRecordsVO> rechargeRecordsVOS = financeClient.rechargeList(coachQuery); |
| | | * BigDecimal total = new BigDecimal("0.00"); |
| | | * for (RechargeRecordsVO rechargeRecordsVO : rechargeRecordsVOS) { |
| | | * total = total.add(rechargeRecordsVO.getAmount()); |
| | | * } |
| | | * return total; |
| | | * } |
| | | */ |
| | | @RequestMapping("/rechargeRecords") |
| | | public String index(Model model) { |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | model.addAttribute("userType",objectType); |
| | | String roleid = UserExt.getUser().getRoleid(); |
| | | model.addAttribute("objectType",objectType); |
| | | return PREFIX + "RechargeRecords.html"; |
| | | } |
| | | /** |
| | | * 获取充值记录 |
| | | */ |
| | | @RequestMapping(value = "/listAll") |
| | | @ResponseBody |
| | | public List<RechargeRecordsVO> list(String province, String city, String name, String phone,String time,Integer type) { |
| | | RechargeRecordsQuery coachQuery = new RechargeRecordsQuery(); |
| | | Region provinceCode = regionService.getOne(new QueryWrapper<Region>().eq("code", province)); |
| | | Region cityCode = regionService.getOne(new QueryWrapper<Region>().eq("code", city)); |
| | | if (provinceCode!=null){ |
| | | coachQuery.setProvince(provinceCode.getName()); |
| | | }else{ |
| | | coachQuery.setProvince(province); |
| | | } |
| | | if (cityCode!=null){ |
| | | coachQuery.setCity(cityCode.getName()); |
| | | }else{ |
| | | coachQuery.setCity(city); |
| | | } |
| | | coachQuery.setName(name); |
| | | |
| | | coachQuery.setPhone(phone); |
| | | coachQuery.setTime(time); |
| | | coachQuery.setType(type); |
| | | return financeClient.rechargeList(coachQuery); |
| | | } |
| | | |
| | | /** |
| | | * 获取充值记录 |
| | | */ |
| | | @RequestMapping(value = "/getAmount") |
| | | /** 充值记录功能已下线,避免通过历史菜单或直接 URL 继续访问。 */ |
| | | @RequestMapping({"/rechargeRecords", "/listAll", "/getAmount"}) |
| | | @ResponseBody |
| | | public BigDecimal getAmount(String province, String city, String name, String phone, String time, Integer type) { |
| | | RechargeRecordsQuery coachQuery = new RechargeRecordsQuery(); |
| | | coachQuery.setProvince(province); |
| | | coachQuery.setCity(city); |
| | | coachQuery.setName(name); |
| | | coachQuery.setPhone(phone); |
| | | coachQuery.setTime(time); |
| | | coachQuery.setType(type); |
| | | List<RechargeRecordsVO> rechargeRecordsVOS = financeClient.rechargeList(coachQuery); |
| | | BigDecimal total = new BigDecimal("0.00"); |
| | | BigDecimal result = new BigDecimal("0.00"); |
| | | for (RechargeRecordsVO rechargeRecordsVO : rechargeRecordsVOS) { |
| | | BigDecimal amount = rechargeRecordsVO.getAmount(); |
| | | total = total.add(amount); // 将新的值赋给total |
| | | result = result.add(amount); // 将新的值赋给result |
| | | } |
| | | return total; |
| | | public ResultUtil rechargeRecordsUnavailable() { |
| | | return ResultUtil.error("充值记录功能暂不提供"); |
| | | } |
| | | /** |
| | | * 获取报名订单统计数据 |
| | |
| | | if(null == competition1){ |
| | | continue; |
| | | } |
| | | if (!competition1.getStoreId().equals("")){ |
| | | String[] split = competition1.getStoreId().split(","); |
| | | String competitionStoreIds = resolveCompetitionStoreIds(competition, competition1); |
| | | if (ToolUtil.isNotEmpty(competitionStoreIds)){ |
| | | String[] split = competitionStoreIds.split(","); |
| | | List<Integer> list = new ArrayList<>(); |
| | | for (String s : split) { |
| | | list.add(Integer.valueOf(s)); |
| | |
| | | if(null == competition1){ |
| | | continue; |
| | | } |
| | | if (!competition1.getStoreId().equals("")){ |
| | | String[] split = competition1.getStoreId().split(","); |
| | | String competitionStoreIds = resolveCompetitionStoreIds(competition, competition1); |
| | | if (ToolUtil.isNotEmpty(competitionStoreIds)){ |
| | | String[] split = competitionStoreIds.split(","); |
| | | List<Integer> list = new ArrayList<>(); |
| | | for (String s : split) { |
| | | list.add(Integer.valueOf(s)); |
| | |
| | | return coursePackagePaymentClient.listAllRegister(query); |
| | | } |
| | | |
| | | /** |
| | | * 获取收入记录对应的门店归属;新订单使用下单快照,兼容未回填的历史订单。 |
| | | * |
| | | * @param paymentCompetition 活动支付记录 |
| | | * @param competition 活动当前信息 |
| | | * @return 逗号分隔的门店 ID 列表 |
| | | */ |
| | | private String resolveCompetitionStoreIds(PaymentCompetition paymentCompetition, Competition competition) { |
| | | if (ToolUtil.isNotEmpty(paymentCompetition.getCompetitionStoreIds())) { |
| | | return paymentCompetition.getCompetitionStoreIds(); |
| | | } |
| | | return competition.getStoreId(); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |