From b1f2f102034b4433201225b67a9fc78c08e532f0 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期五, 06 六月 2025 18:35:03 +0800 Subject: [PATCH] 修改bug和管理后台报表 --- ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/PlatformController.java | 112 +++++++++++++++++++++++++++++++++---------------------- 1 files changed, 67 insertions(+), 45 deletions(-) diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/PlatformController.java b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/PlatformController.java index 8afc55f..833c524 100644 --- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/PlatformController.java +++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/PlatformController.java @@ -2,9 +2,7 @@ import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.mapper.Wrapper; -import com.baomidou.mybatisplus.plugins.Page; import com.stylefeng.guns.core.base.controller.BaseController; -import com.stylefeng.guns.core.common.constant.factory.PageFactory; import com.stylefeng.guns.core.util.ToolUtil; import com.stylefeng.guns.modular.system.model.*; import com.stylefeng.guns.modular.system.service.*; @@ -12,8 +10,6 @@ import com.stylefeng.guns.modular.system.vo.PlatformVO; import com.stylefeng.guns.modular.system.vo.WaterMoneyVO; import com.stylefeng.guns.modular.system.vo.WaterVO; -import io.swagger.models.auth.In; -import org.checkerframework.checker.units.qual.A; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; @@ -21,13 +17,10 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; import java.math.BigDecimal; import java.math.RoundingMode; import java.text.SimpleDateFormat; import java.time.*; -import java.time.format.DateTimeFormatter; import java.time.temporal.TemporalAdjusters; import java.util.*; import java.util.stream.Collectors; @@ -48,26 +41,31 @@ private ITOrderPrivateCarService orderPrivateCarService; @Autowired private ITOrderLogisticsService orderLogisticsService; - /** - * 跳转到首页 - */ - @RequestMapping("/commission") - public String index( Model model) { - return PREFIX + "commission.html"; - } - @RequestMapping("/water") - public String watter( Model model) { - return PREFIX + "watter.html"; - } @Autowired private IIncomeService incomeService; @Autowired private ISettlementRecordService settlementRecordService; - @Autowired private ISettlementDetailService settlementDetailService; @Autowired private ITDriverService driverService; + /** + * 第三方流水统计获取列表 + */ + + @Autowired + private ITPubTransactionDetailsService pubTransactionDetailsService; + @Autowired + private ITPubWithdrawalService pubWithdrawalService; + @Autowired + private IPaymentRecordService paymentRecordService; + @Autowired + private ITUserService appUserService; + @Autowired + private IOrderCancelService orderCancelService; + + @Autowired + private ITCompanyService companyService; public static void main(String[] args) { // 获取今天的日期 @@ -99,7 +97,20 @@ } + /** + * 跳转到首页 + */ + @RequestMapping("/commission") + public String index( Model model) { + List<TCompany> tCompanies = companyService.selectList(new EntityWrapper<TCompany>().eq("state", 0).ne("flag", 3)); + model.addAttribute("company", tCompanies); + return PREFIX + "commission.html"; + } + @RequestMapping("/water") + public String watter( Model model) { + return PREFIX + "watter.html"; + } /** * @@ -111,7 +122,7 @@ */ @RequestMapping(value = "/commission/getCount") @ResponseBody - public Object getCount(Integer time,String insertTime,Integer state) { + public Object getCount(Integer time,String insertTime,Integer state, Integer company) { if (time == null){ time =1; } @@ -188,7 +199,6 @@ } EntityWrapper<SettlementDetail> settlementDetailEntityWrapper = new EntityWrapper<>(); - settlementDetailEntityWrapper.between("createTime", start, end); if (state!=null && state == 2){ List<SettlementRecord> paymentStatus = settlementRecordService.selectList(new EntityWrapper<SettlementRecord>().eq("paymentStatus", 1)); if(paymentStatus.size() > 0){ @@ -241,7 +251,9 @@ if (tOrderPrivateCar==null){ continue; } - + if(null != company && !company.equals(tOrderPrivateCar.getCompanyId())){ + continue; + } platformVO.setMoney(new BigDecimal(income.getMoney())); if (tOrderPrivateCar.getState()!=10 && tOrderPrivateCar.getPayType() == null){ continue; @@ -263,7 +275,9 @@ if (tOrderLogistics==null){ continue; } - + if(null != company && !company.equals(tOrderLogistics.getCompanyId())){ + continue; + } platformVO.setMoney(new BigDecimal(income.getMoney())); if (tOrderLogistics.getState()!=10 && tOrderLogistics.getPayType() == null){ @@ -284,6 +298,9 @@ TOrderPrivateCar tOrderPrivateCar = orderPrivateCarMap.get(settlementDetail.getOrderId()); if (tOrderPrivateCar==null){ + continue; + } + if(null != company && !company.equals(tOrderPrivateCar.getCompanyId())){ continue; } platformVO.setCode(tOrderPrivateCar.getOrderNum()); @@ -324,6 +341,9 @@ TOrderLogistics tOrderLogistics = orderLogisticsRecordMap.get(settlementDetail.getOrderId()); if (tOrderLogistics==null){ + continue; + } + if(null != company && !company.equals(tOrderLogistics.getCompanyId())){ continue; } String string1 = settlementDetail.getPrice().toString(); @@ -1043,20 +1063,7 @@ waterMoneyVO.setUserWithdrawal(userWithdrawal); return waterMoneyVO; } - /** - * 第三方流水统计获取列表 - */ - @Autowired - private ITPubTransactionDetailsService pubTransactionDetailsService; - @Autowired - private ITPubWithdrawalService pubWithdrawalService; - @Autowired - private IPaymentRecordService paymentRecordService; - @Autowired - private ITUserService appUserService; - @Autowired - private IOrderCancelService orderCancelService; @RequestMapping(value = "/water/list") @ResponseBody public Object list1(Integer time,String insertTime,Integer payType,Integer type, String code) { @@ -1724,7 +1731,7 @@ */ @RequestMapping(value = "/commission/list") @ResponseBody - public Object list(Integer time,String insertTime,Integer state) { + public Object list(Integer time,String insertTime,Integer state, Integer company) { if (time == null){ time =1; @@ -1784,7 +1791,6 @@ break; } } - Page<Map<String,Object>> page = new PageFactory<Map<String,Object>>().defaultPage(); List<Income> incomes = new ArrayList<>(); List<SettlementDetail> settlementDetails = new ArrayList<>(); if (time == 5 && !StringUtils.hasLength(insertTime)){ @@ -1803,11 +1809,16 @@ } EntityWrapper<SettlementDetail> settlementDetailEntityWrapper = new EntityWrapper<>(); - settlementDetailEntityWrapper.between("createTime", start, end); + if (time == 5 && !StringUtils.hasLength(insertTime)){ + + }else{ + settlementDetailEntityWrapper.between("createTime", start, end); + } if (state!=null && state == 2){ List<SettlementRecord> paymentStatus = settlementRecordService.selectList(new EntityWrapper<SettlementRecord>().eq("paymentStatus", 1)); if(paymentStatus.size() > 0){ - settlementDetailEntityWrapper.in("settlementRecordId", paymentStatus.stream().map(SettlementRecord::getId).collect(Collectors.toList())); + settlementDetailEntityWrapper.in("settlementRecordId", paymentStatus.stream().map(SettlementRecord::getId).collect(Collectors.toList())) + .or().isNull("settlementRecordId"); }else{ settlementDetailEntityWrapper.eq("settlementRecordId", 0); } @@ -1818,11 +1829,6 @@ }else{ settlementDetailEntityWrapper.eq("settlementRecordId", 0); } - } - if (time == 5 && !StringUtils.hasLength(insertTime)){ - - }else{ - settlementDetailEntityWrapper.between("createTime", start, end); } settlementDetails = settlementDetailService.selectList(settlementDetailEntityWrapper); List<PlatformVO> res = new ArrayList<>(); @@ -1882,6 +1888,9 @@ if (tOrderPrivateCar==null){ continue; } + if(null != company && !company.equals(tOrderPrivateCar.getCompanyId())){ + continue; + } platformVO.setCode(tOrderPrivateCar.getOrderNum()); TDriver tDriver = driverMap.get(tOrderPrivateCar.getDriverId()); if (tDriver != null){ @@ -1927,6 +1936,8 @@ break; case 4: platformVO.setPayType("现金支付"); + case 5: + platformVO.setPayType("平台支付"); break; } } @@ -1948,6 +1959,9 @@ TOrderLogistics tOrderLogistics = orderLogisticsRecordMap.get(income.getIncomeId()); if (tOrderLogistics==null){ + continue; + } + if(null != company && !company.equals(tOrderLogistics.getCompanyId())){ continue; } platformVO.setCode(tOrderLogistics.getOrderNum()); @@ -2019,6 +2033,10 @@ if (tOrderPrivateCar==null){ continue; } + + if(null != company && !company.equals(tOrderPrivateCar.getCompanyId())){ + continue; + } platformVO.setCode(tOrderPrivateCar.getOrderNum()); TDriver tDriver = driverMap.get(tOrderPrivateCar.getDriverId()); if (tDriver!=null){ @@ -2065,6 +2083,10 @@ if (tOrderLogistics==null){ continue; } + + if(null != company && !company.equals(tOrderLogistics.getCompanyId())){ + continue; + } platformVO.setCode(tOrderLogistics.getOrderNum()); TDriver tDriver1 = driverMap.get(tOrderLogistics.getDriverId()); if (tDriver1!=null){ -- Gitblit v1.7.1