| | |
| | | import com.trafficaudit.dataimport.entity.InvestmentSystem; |
| | | import com.trafficaudit.dataimport.entity.EnergyVehicleQuarterly; |
| | | import com.trafficaudit.dataimport.entity.EnergyAuthVehicle; |
| | | import com.trafficaudit.dataimport.entity.PassengerIndividualMonthly; |
| | | import com.trafficaudit.dataimport.entity.WycOrderMonthly; |
| | | import com.trafficaudit.dataimport.entity.WycTotalMonthly; |
| | | import com.trafficaudit.common.util.RegionUtil; |
| | | import com.trafficaudit.dataimport.mapper.FreightTurnoverImportMapper; |
| | | import com.trafficaudit.dataimport.mapper.H2032EnterpriseMonthlyMapper; |
| | | import com.trafficaudit.dataimport.mapper.PassengerAuthVehicleMapper; |
| | |
| | | import com.trafficaudit.dataimport.mapper.InvestmentSystemMapper; |
| | | import com.trafficaudit.dataimport.mapper.EnergyVehicleQuarterlyMapper; |
| | | import com.trafficaudit.dataimport.mapper.EnergyAuthVehicleMapper; |
| | | import com.trafficaudit.dataimport.mapper.PassengerIndividualMonthlyMapper; |
| | | import com.trafficaudit.dataimport.mapper.WycOrderMonthlyMapper; |
| | | import com.trafficaudit.dataimport.mapper.WycTotalMonthlyMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | private EnergyVehicleQuarterlyMapper energyVehicleMapper; |
| | | @Resource |
| | | private EnergyAuthVehicleMapper energyAuthMapper; |
| | | @Resource |
| | | private PassengerIndividualMonthlyMapper passengerIndividualMapper; |
| | | @Resource |
| | | private WycOrderMonthlyMapper wycOrderMapper; |
| | | @Resource |
| | | private WycTotalMonthlyMapper wycTotalMapper; |
| | | |
| | | @GetMapping("/list") |
| | | public Result<Map<String, Object>> list(@RequestParam("type") String type, |
| | |
| | | fillPage(result, r); |
| | | break; |
| | | } |
| | | case "passengerIndividual": { |
| | | LambdaQueryWrapper<PassengerIndividualMonthly> w = new LambdaQueryWrapper<PassengerIndividualMonthly>() |
| | | .eq(notEmpty(period), PassengerIndividualMonthly::getReportPeriod, period) |
| | | .like(!kw.isEmpty(), PassengerIndividualMonthly::getEnterpriseName, kw) |
| | | .orderByDesc(PassengerIndividualMonthly::getId); |
| | | Page<PassengerIndividualMonthly> p = new Page<>(safePage, safeSize); |
| | | Page<PassengerIndividualMonthly> r = passengerIndividualMapper.selectPage(p, w); |
| | | List<Map<String, Object>> rows = toMaps(r.getRecords(), propsOf(PAX_INDIVIDUAL_COLUMNS)); |
| | | for (Map<String, Object> row : rows) { |
| | | Object rc = row.get("regionCode"); |
| | | String cityName = rc == null ? null : RegionUtil.cityByCode(String.valueOf(rc)); |
| | | row.put("city", cityName == null ? "" : cityName); |
| | | } |
| | | result.put("records", rows); |
| | | fillPage(result, r); |
| | | break; |
| | | } |
| | | case "wycTotal": { |
| | | LambdaQueryWrapper<WycTotalMonthly> w = new LambdaQueryWrapper<WycTotalMonthly>() |
| | | .eq(notEmpty(period), WycTotalMonthly::getReportPeriod, period) |
| | | .orderByDesc(WycTotalMonthly::getId); |
| | | Page<WycTotalMonthly> p = new Page<>(safePage, safeSize); |
| | | Page<WycTotalMonthly> r = wycTotalMapper.selectPage(p, w); |
| | | result.put("records", toMaps(r.getRecords(), propsOf(WYC_TOTAL_COLUMNS))); |
| | | fillPage(result, r); |
| | | break; |
| | | } |
| | | case "wycOrder": { |
| | | LambdaQueryWrapper<WycOrderMonthly> w = new LambdaQueryWrapper<WycOrderMonthly>() |
| | | .eq(notEmpty(period), WycOrderMonthly::getReportPeriod, period) |
| | | .orderByDesc(WycOrderMonthly::getId); |
| | | Page<WycOrderMonthly> p = new Page<>(safePage, safeSize); |
| | | Page<WycOrderMonthly> r = wycOrderMapper.selectPage(p, w); |
| | | result.put("records", toMaps(r.getRecords(), propsOf(WYC_ORDER_COLUMNS))); |
| | | fillPage(result, r); |
| | | break; |
| | | } |
| | | default: |
| | | result.put("records", new ArrayList<>()); |
| | | result.put("total", 0L); |
| | |
| | | case "investmentSystem": return INVEST_SYSTEM_COLUMNS; |
| | | case "energyVehicle": return ENERGY_VEHICLE_COLUMNS; |
| | | case "energyAuth": return ENERGY_AUTH_COLUMNS; |
| | | case "passengerIndividual": return PAX_INDIVIDUAL_COLUMNS; |
| | | case "wycTotal": return WYC_TOTAL_COLUMNS; |
| | | case "wycOrder": return WYC_ORDER_COLUMNS; |
| | | default: return new ArrayList<>(); |
| | | } |
| | | } |
| | |
| | | private static final List<Map<String, Object>> INVEST_SYSTEM_COLUMNS = new ArrayList<>(); |
| | | private static final List<Map<String, Object>> ENERGY_VEHICLE_COLUMNS = new ArrayList<>(); |
| | | private static final List<Map<String, Object>> ENERGY_AUTH_COLUMNS = new ArrayList<>(); |
| | | private static final List<Map<String, Object>> PAX_INDIVIDUAL_COLUMNS = new ArrayList<>(); |
| | | private static final List<Map<String, Object>> WYC_TOTAL_COLUMNS = new ArrayList<>(); |
| | | private static final List<Map<String, Object>> WYC_ORDER_COLUMNS = new ArrayList<>(); |
| | | |
| | | static { |
| | | H2032_COLUMNS.add(col("reportPeriod", "报表期", 100)); |
| | |
| | | ENERGY_AUTH_COLUMNS.add(col("markedTonnage", "标记吨位", 100)); |
| | | ENERGY_AUTH_COLUMNS.add(col("tractionQuality", "牵引质量", 110)); |
| | | |
| | | PAX_INDIVIDUAL_COLUMNS.add(col("reportPeriod", "报表期", 100)); |
| | | PAX_INDIVIDUAL_COLUMNS.add(col("regionCode", "所属地区", 110)); |
| | | PAX_INDIVIDUAL_COLUMNS.add(col("city", "市州", 110)); |
| | | PAX_INDIVIDUAL_COLUMNS.add(col("enterpriseCode", "企业代码", 130)); |
| | | PAX_INDIVIDUAL_COLUMNS.add(col("enterpriseName", "企业名称", 220)); |
| | | PAX_INDIVIDUAL_COLUMNS.add(col("passengerCount", "个体客运量", 130)); |
| | | PAX_INDIVIDUAL_COLUMNS.add(col("turnover", "个体旅客周转量", 150)); |
| | | |
| | | WYC_TOTAL_COLUMNS.add(col("reportPeriod", "报表期", 100)); |
| | | WYC_TOTAL_COLUMNS.add(col("pinK", "全省网约车客运量(万人次)", 210)); |
| | | WYC_TOTAL_COLUMNS.add(col("pinCK", "其中城市内客运量(万人次)", 210)); |
| | | WYC_TOTAL_COLUMNS.add(col("pinZ", "全省网约车周转量(万人公里)", 220)); |
| | | WYC_TOTAL_COLUMNS.add(col("pinCZ", "其中城市内周转量(万人公里)", 220)); |
| | | |
| | | WYC_ORDER_COLUMNS.add(col("reportPeriod", "报表期", 100)); |
| | | WYC_ORDER_COLUMNS.add(col("pinK", "全省客运量(万人次)", 170)); |
| | | WYC_ORDER_COLUMNS.add(col("pinCK", "其中城市内客运量", 170)); |
| | | WYC_ORDER_COLUMNS.add(col("pinZ", "全省周转量(万人公里)", 180)); |
| | | WYC_ORDER_COLUMNS.add(col("pinCZ", "其中城市内周转量", 170)); |
| | | WYC_ORDER_COLUMNS.add(col("orderSum", "订单合计(单)", 130)); |
| | | String[] wycOrderCityProps = { "orderWuhan", "orderHuangshi", "orderShiyan", "orderYichang", "orderXiangyang", |
| | | "orderEzhou", "orderJingmen", "orderXiaogan", "orderJingzhou", "orderHuanggang", "orderXianning", |
| | | "orderSuizhou", "orderEnshi", "orderXiantao", "orderQianjiang", "orderTianmen", "orderShennong" }; |
| | | String[] wycOrderCityNames = { "武汉", "黄石", "十堰", "宜昌", "襄阳", "鄂州", "荆门", "孝感", "荆州", "黄冈", |
| | | "咸宁", "随州", "恩施", "仙桃", "潜江", "天门", "神农架" }; |
| | | for (int i = 0; i < wycOrderCityProps.length; i++) { |
| | | WYC_ORDER_COLUMNS.add(col(wycOrderCityProps[i], wycOrderCityNames[i] + "订单(单)", 120)); |
| | | } |
| | | |
| | | } |
| | | } |