Procházet zdrojové kódy

各类费用支出明细导出

tanbin před 1 rokem
rodič
revize
f1618b4319

+ 20 - 1
device-api-service-merc-mini/src/main/java/com/xy/controller/DeviceAlgorithmChargingHisController.java

@@ -52,6 +52,25 @@ public class DeviceAlgorithmChargingHisController {
         return R.ok(totalMoney);
     }
 
+    @ApiOperation("财务管理-支出管理-设备激活费明细导出")
+    @PostMapping("exportMySpendPage")
+    public void exportMySpendPage(HttpServletResponse response, @RequestBody @Valid DeviceAlgorithmChargingHistoryDto.PageByTopMerc page) throws IOException {
+        page.setCurMercId(MercAuthUtils.getMercId());
+        R<PageBean<DeviceAlgorithmChargingHistoryDto.MySpendPageVO>> data = deviceAlgorithmChargingHistoryService.mySpendPage(page);
+        List<DeviceAlgorithmChargingHistoryDto.MySpendPageVO> records = data.getData().getRecords();
+        if (CollUtil.isNotEmpty(records)) {
+            for (DeviceAlgorithmChargingHistoryDto.MySpendPageVO record : records) {
+                Integer status = record.getStatus();
+                if (status.intValue() != 2) {
+                    record.setCreateTime(null);
+                }
+            }
+        }
+        List<DeviceAlgorithmChargingHistoryDto.SpendPageExcelVo> deviceExcelVOS = BeanUtil.copyToList(records, DeviceAlgorithmChargingHistoryDto.SpendPageExcelVo.class);
+        // 输出
+        ExcelUtils.write(response, "设备激活费用明细.xls", "设备激活费明细", DeviceAlgorithmChargingHistoryDto.SpendPageExcelVo.class, deviceExcelVOS);
+    }
+
 
     @PostMapping("pageByTopMerc")
     @ApiOperation("加盟商-服务费管理-设备激活费明细")
@@ -93,7 +112,7 @@ public class DeviceAlgorithmChargingHisController {
         }
         List<DeviceAlgorithmChargingHistoryDto.PageExcelVo> deviceExcelVOS = BeanUtil.copyToList(records, DeviceAlgorithmChargingHistoryDto.PageExcelVo.class);
         // 输出
-        ExcelUtils.write(response, "设备激活算法费用明细.xls", "设备激活算法费明细", DeviceAlgorithmChargingHistoryDto.PageExcelVo.class, deviceExcelVOS);
+        ExcelUtils.write(response, "设备激活费用明细.xls", "设备激活费明细", DeviceAlgorithmChargingHistoryDto.PageExcelVo.class, deviceExcelVOS);
     }
 
 }

+ 12 - 0
device-api-service-merc-mini/src/main/java/com/xy/controller/DeviceChargingHistoryController.java

@@ -42,6 +42,18 @@ public class DeviceChargingHistoryController {
         return deviceChargingHistoryService.mySpendPage(page);
     }
 
+    @ApiOperation("财务管理-支出管理-设备管理费导出")
+    @PostMapping("exportMySpendPage")
+    public void exportMySpendPage(HttpServletResponse response, @RequestBody @Valid DeviceChargingHistoryDto.PageByTopMerc page) throws IOException {
+        page.setCurMercId(MercAuthUtils.getMercId());
+        R<PageBean<DeviceChargingHistoryDto.MySpendPageVO>> data = deviceChargingHistoryService.mySpendPage(page);
+        List<DeviceChargingHistoryDto.MySpendPageVO> records = data.getData().getRecords();
+        List<DeviceChargingHistoryDto.SpendPageExcelVo> deviceExcelVOS = BeanUtil.copyToList(records, DeviceChargingHistoryDto.SpendPageExcelVo.class);
+        // 输出
+        ExcelUtils.write(response, "设备管理费缴费记录明细.xls", "设备管理费缴费记录明细", DeviceChargingHistoryDto.SpendPageExcelVo.class, deviceExcelVOS);
+    }
+
+
     @PostMapping("mySpendPageCount")
     @ApiOperation("财务管理-支出管理-设备管理费缴费统计")
     public R<Integer> mySpendPageCount(@RequestBody DeviceChargingHistoryDto.PageByTopMerc page) {

+ 20 - 0
device-api-service-merc-mini/src/main/java/com/xy/controller/DeviceSimChargeController.java

@@ -61,6 +61,26 @@ public class DeviceSimChargeController {
         return deviceSimChargeService.mySpendPage(page);
     }
 
+
+    @ApiOperation("财务管理-支出管理-流量卡费明细")
+    @PostMapping("exportMySpendPage")
+    public void exportMySpendPage(HttpServletResponse response, @RequestBody @Valid DeviceSimChargeDto.PageByTopMerc page) throws IOException {
+        page.setCurMercId(MercAuthUtils.getMercId());
+        R<PageBean<DeviceSimChargeDto.MySpendPageVO>> data = deviceSimChargeService.mySpendPage(page);
+        List<DeviceSimChargeDto.MySpendPageVO> records = data.getData().getRecords();
+        if (CollUtil.isNotEmpty(records)) {
+            for (DeviceSimChargeDto.MySpendPageVO record : records) {
+                Integer status = record.getStatus();
+                if (status.intValue() != 2) {
+                    record.setCreateTime(null);
+                }
+            }
+        }
+        List<DeviceSimChargeDto.SpendPageExcelVo> deviceExcelVOS = BeanUtil.copyToList(records, DeviceSimChargeDto.SpendPageExcelVo.class);
+        // 输出
+        ExcelUtils.write(response, "流量卡费用明细.xls", "流量卡费用明细", DeviceSimChargeDto.SpendPageExcelVo.class, deviceExcelVOS);
+    }
+
     @PostMapping("mySpendPageCount")
     @ApiOperation("财务管理-支出管理-流量卡费统计")
     public R<Integer> mySpendPageCount(@RequestBody @Validated DeviceSimChargeDto.PageByTopMerc page) {

+ 54 - 0
device-api/src/main/java/com/xy/dto/DeviceAlgorithmChargingHistoryDto.java

@@ -204,6 +204,60 @@ public class DeviceAlgorithmChargingHistoryDto {
         private LocalDateTime createTime;
 
 
+    }
+
+    @Data
+    @Accessors(chain = true)
+    public static class SpendPageExcelVo {
+
+
+        @ExcelProperty("商户名称")
+        @ApiModelProperty(value = "商户名称")
+        private String mercName;
+
+        @ExcelProperty("缴费单号")
+        @ApiModelProperty(value = "缴费单号")
+        private String orderId;
+        @ExcelProperty("设备编号")
+        @ApiModelProperty(value = "设备id")
+        private Long deviceId;
+
+        @ExcelProperty(value = "算法类型", converter = DictConvert.class)
+        @DictFormat(DictConsts.ALGORITHM_TYPES)
+        @ApiModelProperty(value = "算法类型")
+        private Long algorithmId;
+
+//        @ApiModelProperty(value = "名称")
+//        private String name;
+
+        @ExcelProperty(value = "实缴金额", converter = CustomFenToYuanConverter.class)
+        @NumberFormat("#0.00")
+        @ApiModelProperty(value = "实缴金额")
+        private Integer chargingMoney;
+
+
+        @ExcelProperty("缴费数量(笔)")
+        @ApiModelProperty(value = "缴费数量")
+        private Integer chargingSize;
+
+
+        @ExcelProperty(value = "缴费方式", converter = DictConvert.class)
+        @DictFormat(DictConsts.ORDER_MERC_MANAGE_PAY_TYPE)
+        @ApiModelProperty(value = "缴费方式")
+        private Integer chargingType;
+
+        @ExcelProperty(value = "支付状态", converter = DictConvert.class)
+        @DictFormat(DictConsts.ORDER_MERC_MANAGE_STATUS)
+        @ApiModelProperty(value = "支付状态")
+        private Integer status;
+
+
+        @ExcelProperty("支付时间")
+        @ApiModelProperty(value = "缴费时间")
+        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+        private LocalDateTime createTime;
+
+
     }
 
     @Data

+ 41 - 1
device-api/src/main/java/com/xy/dto/DeviceChargingHistoryDto.java

@@ -188,6 +188,46 @@ public class DeviceChargingHistoryDto {
 
     }
 
+    @Data
+    @Accessors(chain = true)
+    public static class SpendPageExcelVo {
+        @ExcelProperty("商户名称")
+        @ApiModelProperty(value = "商户名称")
+        private String mercName;
+        @ExcelProperty("缴费单号")
+        @ApiModelProperty(value = "缴费单号")
+        private String orderId;
+        @ExcelProperty("设备编号")
+        @ApiModelProperty(value = "设备编号")
+        private Long deviceId;
+        @ExcelProperty(value = "实缴金额", converter = CustomFenToYuanConverter.class)
+        @NumberFormat("#0.00")
+        @ApiModelProperty(value = "续费金额")
+        private Integer chargingMoney;
+         
+        @ExcelProperty("续费数量(年)")
+        @ApiModelProperty(value = "续费数量")
+        private Integer chargingSize;
+        @ExcelProperty(value = "续费方式", converter = DictConvert.class)
+        @DictFormat(DictConsts.ORDER_MERC_MANAGE_PAY_TYPE)
+        @ApiModelProperty(value = "续费方式")
+        private Integer chargingType;
+        @ExcelProperty("缴费时间")
+        @ApiModelProperty(value = "创建时间")
+        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+        private LocalDateTime createTime;
+
+
+        @ExcelProperty("过期时间")
+        @ApiModelProperty(value = "过期时间")
+        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+        private LocalDateTime timeout;
+        @ExcelProperty("状态说明")
+        @ApiModelProperty(value = "过期状态说明")
+        private String timeoutStatus;
+
+    }
+
 
     @Data
     @Accessors(chain = true)
@@ -275,7 +315,7 @@ public class DeviceChargingHistoryDto {
         private String orderId;
         @ApiModelProperty(value = "设备id")
         private Long deviceId;
-     
+
         @ApiModelProperty(value = "续费金额")
         private Integer chargingMoney;
         @ApiModelProperty(value = "续费数量")

+ 54 - 0
device-api/src/main/java/com/xy/dto/DeviceSimChargeDto.java

@@ -97,6 +97,60 @@ public class DeviceSimChargeDto {
         private String timeoutStatus;
 
 
+    }
+
+    @Data
+    @Accessors(chain = true)
+    public static class SpendPageExcelVo {
+        @ExcelProperty("商户名称")
+        @ApiModelProperty(value = "商户名称")
+        private String mercName;
+
+        @ExcelProperty("缴费单号")
+        @ApiModelProperty(value = "缴费单号")
+        private String orderId;
+
+        @ExcelProperty("流量卡号")
+        @ApiModelProperty(value = "流量卡id")
+        private String simId;
+
+
+        @ApiModelProperty(value = "金额")
+        @ExcelProperty(value = "金额", converter = CustomFenToYuanConverter.class)
+        @NumberFormat("#0.00")
+        private Integer money;
+
+
+        @ExcelProperty("续费时长(年)")
+        @ApiModelProperty(value = "数量")
+        private Integer size;
+
+        @ExcelProperty(value = "支付方式", converter = DictConvert.class)
+        @DictFormat(DictConsts.ORDER_PAY_TYPE)
+        @ApiModelProperty(value = "支付方式")
+        private Integer payType;
+
+
+        @ExcelProperty(value = "支付状态", converter = DictConvert.class)
+        @DictFormat(DictConsts.ORDER_MERC_MANAGE_STATUS)
+        @ApiModelProperty(value = "支付状态")
+        private Integer status;
+
+        @ExcelProperty("支付时间")
+        @ApiModelProperty(value = "创建时间")
+        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+        private LocalDateTime createTime;
+
+        @ExcelProperty("过期时间")
+        @ApiModelProperty(value = "过期时间")
+        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+        private LocalDateTime timeout;
+
+        @ApiModelProperty(value = "状态")
+        @ExcelProperty("过期状态说明")
+        private String timeoutStatus;
+
+
     }
 
     @Data