Explorar el Código

政务服务excel导入

wanxing hace 3 meses
padre
commit
a9f475d4bd
Se han modificado 29 ficheros con 486 adiciones y 34 borrados
  1. 30 0
      src/main/java/com/cqut/stack/bn/controller/GovernmentServiceController.java
  2. 1 8
      src/main/java/com/cqut/stack/bn/dao/AreaEvaluateMapper.java
  3. 1 8
      src/main/java/com/cqut/stack/bn/dao/AreaHandleMapper.java
  4. 1 8
      src/main/java/com/cqut/stack/bn/dao/CharacteristicThingMapper.java
  5. 1 8
      src/main/java/com/cqut/stack/bn/dao/EfficientThingMapper.java
  6. 30 0
      src/main/java/com/cqut/stack/bn/pojo/dto/areaEvaluate/AreaEvaluateImportDTO.java
  7. 16 0
      src/main/java/com/cqut/stack/bn/pojo/dto/areaEvaluate/ImportAreaEvaluateInfoDTO.java
  8. 38 0
      src/main/java/com/cqut/stack/bn/pojo/dto/areaHandle/AreaHandleImportDTO.java
  9. 16 0
      src/main/java/com/cqut/stack/bn/pojo/dto/areaHandle/ImportAreaHandleInfoDTO.java
  10. 26 0
      src/main/java/com/cqut/stack/bn/pojo/dto/characteristicThing/CharacteristicThingImportDTO.java
  11. 16 0
      src/main/java/com/cqut/stack/bn/pojo/dto/characteristicThing/ImportCharacteristicThingDTO.java
  12. 27 0
      src/main/java/com/cqut/stack/bn/pojo/dto/efficientThing/EfficientThingImportDTO.java
  13. 16 0
      src/main/java/com/cqut/stack/bn/pojo/dto/efficientThing/ImportEfficientThingInfoDTO.java
  14. 34 0
      src/main/java/com/cqut/stack/bn/pojo/listener/AreaEvaluateListener.java
  15. 39 0
      src/main/java/com/cqut/stack/bn/pojo/listener/AreaHandleListener.java
  16. 36 0
      src/main/java/com/cqut/stack/bn/pojo/listener/CharacteristicThingListener.java
  17. 36 0
      src/main/java/com/cqut/stack/bn/pojo/listener/EfficientThingListener.java
  18. 3 0
      src/main/java/com/cqut/stack/bn/service/AreaEvaluateService.java
  19. 3 0
      src/main/java/com/cqut/stack/bn/service/AreaHandleService.java
  20. 3 0
      src/main/java/com/cqut/stack/bn/service/CharacteristicThingService.java
  21. 3 0
      src/main/java/com/cqut/stack/bn/service/EfficientThingService.java
  22. 27 0
      src/main/java/com/cqut/stack/bn/service/impl/AreaEvaluateServiceImpl.java
  23. 26 0
      src/main/java/com/cqut/stack/bn/service/impl/AreaHandleServiceImpl.java
  24. 22 0
      src/main/java/com/cqut/stack/bn/service/impl/CharacteristicThingServiceImpl.java
  25. 21 0
      src/main/java/com/cqut/stack/bn/service/impl/EfficientThingServiceImpl.java
  26. 4 1
      src/main/resources/mapper/AreaEvaluateMapper.xml
  27. 4 1
      src/main/resources/mapper/AreaHandleMapper.xml
  28. 3 0
      src/main/resources/mapper/CharacteristicThingMapper.xml
  29. 3 0
      src/main/resources/mapper/EfficientThingMapper.xml

+ 30 - 0
src/main/java/com/cqut/stack/bn/controller/GovernmentServiceController.java

@@ -1,8 +1,11 @@
 package com.cqut.stack.bn.controller;
 
+import com.cqut.stack.bn.pojo.dto.areaEvaluate.ImportAreaEvaluateInfoDTO;
 import com.cqut.stack.bn.pojo.dto.areaHandle.GetAreaEvaluateInfoDTO;
+import com.cqut.stack.bn.pojo.dto.areaHandle.ImportAreaHandleInfoDTO;
 import com.cqut.stack.bn.pojo.dto.characteristicThing.GetCharacteristicThingInfoDTO;
 import com.cqut.stack.bn.pojo.dto.characteristicThing.GetCharacteristicThingInfoListByPageDTO;
+import com.cqut.stack.bn.pojo.dto.characteristicThing.ImportCharacteristicThingDTO;
 import com.cqut.stack.bn.pojo.dto.efficientThing.GetEfficientThingInfoDTO;
 import com.cqut.stack.bn.pojo.dto.efficientThing.GetEfficientThingInfoListByPageDTO;
 import com.cqut.stack.bn.pojo.dto.electronicCertificate.GetElectronicCertificateInfoDTO;
@@ -165,6 +168,33 @@ public class GovernmentServiceController {
         return Result.buildSuccessResult(CodeMessage.S_SUCCESS);
     }
 
+    @ApiOperation(value = "导入高效办成一件事信息")
+    @PostMapping("/importEfficientThingInfo")
+    public Result<?> importEfficientThingInfo(@Validated ImportAreaHandleInfoDTO dto){
+        efficientThingService.importEfficientThingInfo(dto);
+        return Result.buildSuccessResult(CodeMessage.S_SUCCESS);
+    }
+
+    @ApiOperation(value = "导入地方特色一件事信息")
+    @PostMapping("/importCharacteristicThing")
+    public Result<?> importCharacteristicThing(@Validated ImportCharacteristicThingDTO dto){
+        characteristicThingService.importCharacteristicThing(dto);
+        return Result.buildSuccessResult(CodeMessage.S_SUCCESS);
+    }
+
+    @ApiOperation(value = "导入区域评价信息")
+    @PostMapping("/importAreaEvaluateInfo")
+    public Result<?> importAreaEvaluateInfo(@Validated ImportAreaEvaluateInfoDTO dto){
+        areaEvaluateService.importAreaEvaluateInfo(dto);
+        return Result.buildSuccessResult(CodeMessage.S_SUCCESS);
+    }
+
+    @ApiOperation(value = "导入区域办件信息")
+    @PostMapping("/importAreaHandleInfo")
+    public Result<?> importAreaHandleInfo(@Validated ImportAreaHandleInfoDTO dto){
+        areaHandleService.importAreaHandleInfo(dto);
+        return Result.buildSuccessResult(CodeMessage.S_SUCCESS);
+    }
 
     //****************************************** Excel数据同步结束 *******************************************
 

+ 1 - 8
src/main/java/com/cqut/stack/bn/dao/AreaEvaluateMapper.java

@@ -3,14 +3,7 @@ package com.cqut.stack.bn.dao;
 import com.cqut.stack.bn.pojo.entity.AreaEvaluate;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
-/**
- * <p>
- * 区域评价情况 Mapper 接口
- * </p>
- *
- * @author ${author}
- * @since 2024-11-27
- */
 public interface AreaEvaluateMapper extends BaseMapper<AreaEvaluate> {
 
+    void deleteAll();
 }

+ 1 - 8
src/main/java/com/cqut/stack/bn/dao/AreaHandleMapper.java

@@ -3,14 +3,7 @@ package com.cqut.stack.bn.dao;
 import com.cqut.stack.bn.pojo.entity.AreaHandle;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
-/**
- * <p>
- * 区域办件情况 Mapper 接口
- * </p>
- *
- * @author ${author}
- * @since 2024-11-27
- */
 public interface AreaHandleMapper extends BaseMapper<AreaHandle> {
 
+    void deleteAll();
 }

+ 1 - 8
src/main/java/com/cqut/stack/bn/dao/CharacteristicThingMapper.java

@@ -3,14 +3,7 @@ package com.cqut.stack.bn.dao;
 import com.cqut.stack.bn.pojo.entity.CharacteristicThing;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
-/**
- * <p>
- * 地方特色一件事 Mapper 接口
- * </p>
- *
- * @author wanxing
- * @since 2024-11-24
- */
 public interface CharacteristicThingMapper extends BaseMapper<CharacteristicThing> {
 
+    void deleteAll();
 }

+ 1 - 8
src/main/java/com/cqut/stack/bn/dao/EfficientThingMapper.java

@@ -3,14 +3,7 @@ package com.cqut.stack.bn.dao;
 import com.cqut.stack.bn.pojo.entity.EfficientThing;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
-/**
- * <p>
- * 高效办成一件事 Mapper 接口
- * </p>
- *
- * @author wanxing
- * @since 2024-11-24
- */
 public interface EfficientThingMapper extends BaseMapper<EfficientThing> {
 
+    void deleteAll();
 }

+ 30 - 0
src/main/java/com/cqut/stack/bn/pojo/dto/areaEvaluate/AreaEvaluateImportDTO.java

@@ -0,0 +1,30 @@
+package com.cqut.stack.bn.pojo.dto.areaEvaluate;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel("导入区域评价信息模板参数")
+public class AreaEvaluateImportDTO {
+    @ApiModelProperty(value = "地区")
+    @ExcelProperty(value = "地区",index = 0)
+    private String districtCode;
+
+    @ApiModelProperty(value = "评价数")
+    @ExcelProperty(value = "评价数",index = 1)
+    private String evaluateCount;
+
+    @ApiModelProperty(value = "好评数")
+    @ExcelProperty(value = "好评数",index = 2)
+    private String positiveCount ;
+
+    @ApiModelProperty(value = "差评数")
+    @ExcelProperty(value = "差评数",index = 3)
+    private String negativeCount;
+
+    @ApiModelProperty(value = "满意率")
+    @ExcelProperty(value = "满意率",index = 4)
+    private String satisfactionRate;
+}

+ 16 - 0
src/main/java/com/cqut/stack/bn/pojo/dto/areaEvaluate/ImportAreaEvaluateInfoDTO.java

@@ -0,0 +1,16 @@
+package com.cqut.stack.bn.pojo.dto.areaEvaluate;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.validation.constraints.NotNull;
+
+@Data
+@ApiModel("导入区域评价信息入参")
+public class ImportAreaEvaluateInfoDTO {
+    @NotNull(message = "请选择需要导入的文件")
+    @ApiModelProperty("导入文件")
+    private MultipartFile multipartFile;
+}

+ 38 - 0
src/main/java/com/cqut/stack/bn/pojo/dto/areaHandle/AreaHandleImportDTO.java

@@ -0,0 +1,38 @@
+package com.cqut.stack.bn.pojo.dto.areaHandle;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel("区域办件情况导入模板参数")
+public class AreaHandleImportDTO {
+    @ApiModelProperty(value = "地区")
+    @ExcelProperty(value = "地区",index = 0)
+    private String districtCode;
+
+    @ApiModelProperty(value = "申请")
+    @ExcelProperty(value = "申请",index = 1)
+    private String applyCount;
+
+    @ApiModelProperty(value = "受理")
+    @ExcelProperty(value = "受理",index = 2)
+    private String acceptCount ;
+
+    @ApiModelProperty(value = "办结(全量)")
+    @ExcelProperty(value = "办结(全量)",index = 3)
+    private String completeCount;
+
+    @ApiModelProperty(value = "办结覆盖率")
+    @ExcelProperty(value = "办结(全量)",index = 4)
+    private String completeRate;
+
+    @ApiModelProperty(value = "网上受理率")
+    @ExcelProperty(value = "办结(全量)",index = 5)
+    private String networkApplyRate;
+
+    @ApiModelProperty(value = "按时办结率")
+    @ExcelProperty(value = "办结(全量)",index = 6)
+    private String completeOnTimeRate;
+}

+ 16 - 0
src/main/java/com/cqut/stack/bn/pojo/dto/areaHandle/ImportAreaHandleInfoDTO.java

@@ -0,0 +1,16 @@
+package com.cqut.stack.bn.pojo.dto.areaHandle;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.validation.constraints.NotNull;
+
+@Data
+@ApiModel("导入高效办成一件事信息入参")
+public class ImportAreaHandleInfoDTO {
+    @NotNull(message = "请选择需要导入的文件")
+    @ApiModelProperty("导入文件")
+    private MultipartFile multipartFile;
+}

+ 26 - 0
src/main/java/com/cqut/stack/bn/pojo/dto/characteristicThing/CharacteristicThingImportDTO.java

@@ -0,0 +1,26 @@
+package com.cqut.stack.bn.pojo.dto.characteristicThing;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel("地方特色一件事信息导入模板参数")
+public class CharacteristicThingImportDTO {
+    @ApiModelProperty(value = "地区")
+    @ExcelProperty(value = "地区",index = 0)
+    private String districtCode;
+
+    @ApiModelProperty(value = "申请件数")
+    @ExcelProperty(value = "申请件数",index = 1)
+    private String processNowCount;
+
+    @ApiModelProperty(value = "受理件数")
+    @ExcelProperty(value = "受理件数",index = 2)
+    private String processNowAccount ;
+
+    @ApiModelProperty(value = "办结件数")
+    @ExcelProperty(value = "办结件数",index = 3)
+    private String processNetCount;
+}

+ 16 - 0
src/main/java/com/cqut/stack/bn/pojo/dto/characteristicThing/ImportCharacteristicThingDTO.java

@@ -0,0 +1,16 @@
+package com.cqut.stack.bn.pojo.dto.characteristicThing;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.validation.constraints.NotNull;
+
+@Data
+@ApiModel("导入地方特色一件事信息入参")
+public class ImportCharacteristicThingDTO {
+    @NotNull(message = "请选择需要导入的文件")
+    @ApiModelProperty("导入文件")
+    private MultipartFile multipartFile;
+}

+ 27 - 0
src/main/java/com/cqut/stack/bn/pojo/dto/efficientThing/EfficientThingImportDTO.java

@@ -0,0 +1,27 @@
+package com.cqut.stack.bn.pojo.dto.efficientThing;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel("高效办成一件事信息导入模板参数")
+public class EfficientThingImportDTO {
+    @ApiModelProperty(value = "地区")
+    @ExcelProperty(value = "地区",index = 0)
+    private String districtCode;
+
+    @ApiModelProperty(value = "申请件数")
+    @ExcelProperty(value = "申请件数",index = 1)
+    private String processNowCount;
+
+    @ApiModelProperty(value = "受理件数")
+    @ExcelProperty(value = "受理件数",index = 2)
+    private String processNowAccount ;
+
+    @ApiModelProperty(value = "办结件数")
+    @ExcelProperty(value = "办结件数",index = 3)
+    private String processNetCount;
+}

+ 16 - 0
src/main/java/com/cqut/stack/bn/pojo/dto/efficientThing/ImportEfficientThingInfoDTO.java

@@ -0,0 +1,16 @@
+package com.cqut.stack.bn.pojo.dto.efficientThing;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.validation.constraints.NotNull;
+
+@Data
+@ApiModel("导入四办情况信息入参")
+public class ImportEfficientThingInfoDTO {
+    @NotNull(message = "请选择需要导入的文件")
+    @ApiModelProperty("导入文件")
+    private MultipartFile multipartFile;
+}

+ 34 - 0
src/main/java/com/cqut/stack/bn/pojo/listener/AreaEvaluateListener.java

@@ -0,0 +1,34 @@
+package com.cqut.stack.bn.pojo.listener;
+
+import cn.hutool.core.bean.BeanUtil;
+import com.alibaba.excel.context.AnalysisContext;
+import com.alibaba.excel.read.listener.ReadListener;
+import com.cqut.stack.bn.pojo.dto.areaEvaluate.AreaEvaluateImportDTO;
+import com.cqut.stack.bn.pojo.entity.AreaEvaluate;
+import com.cqut.stack.bn.pojo.enums.GovernmentServiceEnum;
+import lombok.Getter;
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Slf4j
+@Getter
+public class AreaEvaluateListener implements ReadListener<AreaEvaluateImportDTO> {
+    private final List<AreaEvaluate> areaEvaluateList = new ArrayList<>();
+
+    @Override
+    public void invoke(AreaEvaluateImportDTO areaEvaluateImportDTO, AnalysisContext analysisContext) {
+        areaEvaluateImportDTO.setSatisfactionRate(areaEvaluateImportDTO.getSatisfactionRate().split("%")[0]);
+        AreaEvaluate areaEvaluate = new AreaEvaluate();
+        BeanUtil.copyProperties(areaEvaluateImportDTO,areaEvaluate);
+
+        areaEvaluate.setDistrictName(GovernmentServiceEnum.DistrictEnum.getCodeByName(areaEvaluateImportDTO.getDistrictCode()));
+        areaEvaluateList.add(areaEvaluate);
+    }
+
+    @Override
+    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
+        log.info("excel读取完毕");
+    }
+}

+ 39 - 0
src/main/java/com/cqut/stack/bn/pojo/listener/AreaHandleListener.java

@@ -0,0 +1,39 @@
+package com.cqut.stack.bn.pojo.listener;
+
+import cn.hutool.core.bean.BeanUtil;
+import com.alibaba.excel.context.AnalysisContext;
+import com.alibaba.excel.read.listener.ReadListener;
+import com.cqut.stack.bn.pojo.dto.areaHandle.AreaHandleImportDTO;
+import com.cqut.stack.bn.pojo.dto.electronicCertificate.ElectronicCertificateImportDTO;
+import com.cqut.stack.bn.pojo.entity.AreaHandle;
+import com.cqut.stack.bn.pojo.entity.ElectronicCertificate;
+import com.cqut.stack.bn.pojo.enums.GovernmentServiceEnum;
+import lombok.Getter;
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Slf4j
+@Getter
+public class AreaHandleListener implements ReadListener<AreaHandleImportDTO> {
+
+    private final List<AreaHandle> areaHandleList = new ArrayList<>();
+
+    @Override
+    public void invoke(AreaHandleImportDTO areaHandleImportDTO, AnalysisContext analysisContext) {
+        areaHandleImportDTO.setCompleteRate(areaHandleImportDTO.getCompleteRate().split("%")[0]);
+        areaHandleImportDTO.setCompleteOnTimeRate(areaHandleImportDTO.getCompleteOnTimeRate().split("%")[0]);
+        areaHandleImportDTO.setNetworkApplyRate(areaHandleImportDTO.getNetworkApplyRate().split("%")[0]);
+        AreaHandle areaHandle = new AreaHandle();
+        BeanUtil.copyProperties(areaHandleImportDTO,areaHandle);
+
+        areaHandle.setDistrictName(GovernmentServiceEnum.DistrictEnum.getCodeByName(areaHandleImportDTO.getDistrictCode()));
+        areaHandleList.add(areaHandle);
+    }
+
+    @Override
+    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
+        log.info("excel读取完毕");
+    }
+}

+ 36 - 0
src/main/java/com/cqut/stack/bn/pojo/listener/CharacteristicThingListener.java

@@ -0,0 +1,36 @@
+package com.cqut.stack.bn.pojo.listener;
+
+import cn.hutool.core.bean.BeanUtil;
+import com.alibaba.excel.context.AnalysisContext;
+import com.alibaba.excel.read.listener.ReadListener;
+import com.cqut.stack.bn.pojo.dto.characteristicThing.CharacteristicThingImportDTO;
+import com.cqut.stack.bn.pojo.dto.electronicCertificate.ElectronicCertificateImportDTO;
+import com.cqut.stack.bn.pojo.entity.CharacteristicThing;
+import com.cqut.stack.bn.pojo.entity.ElectronicCertificate;
+import com.cqut.stack.bn.pojo.enums.GovernmentServiceEnum;
+import lombok.Getter;
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Slf4j
+@Getter
+public class CharacteristicThingListener implements ReadListener<CharacteristicThingImportDTO> {
+
+    private final List<CharacteristicThing> characteristicThingList = new ArrayList<>();
+
+    @Override
+    public void invoke(CharacteristicThingImportDTO characteristicThingImportDTO, AnalysisContext analysisContext) {
+        CharacteristicThing characteristicThing = new CharacteristicThing();
+        BeanUtil.copyProperties(characteristicThingImportDTO,characteristicThing);
+
+        characteristicThing.setDistrictName(GovernmentServiceEnum.DistrictEnum.getCodeByName(characteristicThingImportDTO.getDistrictCode()));
+        characteristicThingList.add(characteristicThing);
+    }
+
+    @Override
+    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
+        log.info("excel读取完毕");
+    }
+}

+ 36 - 0
src/main/java/com/cqut/stack/bn/pojo/listener/EfficientThingListener.java

@@ -0,0 +1,36 @@
+package com.cqut.stack.bn.pojo.listener;
+
+import cn.hutool.core.bean.BeanUtil;
+import com.alibaba.excel.context.AnalysisContext;
+import com.alibaba.excel.read.listener.ReadListener;
+import com.cqut.stack.bn.pojo.dto.efficientThing.EfficientThingImportDTO;
+import com.cqut.stack.bn.pojo.dto.electronicCertificate.ElectronicCertificateImportDTO;
+import com.cqut.stack.bn.pojo.entity.EfficientThing;
+import com.cqut.stack.bn.pojo.entity.ElectronicCertificate;
+import com.cqut.stack.bn.pojo.enums.GovernmentServiceEnum;
+import lombok.Getter;
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Slf4j
+@Getter
+public class EfficientThingListener implements ReadListener<EfficientThingImportDTO> {
+
+    private final List<EfficientThing> efficientThingList = new ArrayList<>();
+
+    @Override
+    public void invoke(EfficientThingImportDTO efficientThingImportDTO, AnalysisContext analysisContext) {
+        EfficientThing efficientThing = new EfficientThing();
+        BeanUtil.copyProperties(efficientThingImportDTO,efficientThing);
+
+        efficientThing.setDistrictName(GovernmentServiceEnum.DistrictEnum.getCodeByName(efficientThingImportDTO.getDistrictCode()));
+        efficientThingList.add(efficientThing);
+    }
+
+    @Override
+    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
+        log.info("excel读取完毕");
+    }
+}

+ 3 - 0
src/main/java/com/cqut/stack/bn/service/AreaEvaluateService.java

@@ -1,5 +1,6 @@
 package com.cqut.stack.bn.service;
 
+import com.cqut.stack.bn.pojo.dto.areaEvaluate.ImportAreaEvaluateInfoDTO;
 import com.cqut.stack.bn.pojo.entity.AreaEvaluate;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.cqut.stack.bn.pojo.vo.areaEvaluate.GetAreaEvaluateInfoVO;
@@ -9,4 +10,6 @@ import java.util.List;
 public interface AreaEvaluateService extends IService<AreaEvaluate> {
 
     List<GetAreaEvaluateInfoVO> areaEvaluateService();
+
+    void importAreaEvaluateInfo(ImportAreaEvaluateInfoDTO dto);
 }

+ 3 - 0
src/main/java/com/cqut/stack/bn/service/AreaHandleService.java

@@ -1,6 +1,7 @@
 package com.cqut.stack.bn.service;
 
 import com.cqut.stack.bn.pojo.dto.areaHandle.GetAreaEvaluateInfoDTO;
+import com.cqut.stack.bn.pojo.dto.areaHandle.ImportAreaHandleInfoDTO;
 import com.cqut.stack.bn.pojo.entity.AreaHandle;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.cqut.stack.bn.pojo.vo.areaEvaluate.GetAreaEvaluateInfoVO;
@@ -9,4 +10,6 @@ import com.cqut.stack.bn.pojo.vo.areaHandle.GetAreaHandleInfoVO;
 public interface AreaHandleService extends IService<AreaHandle> {
 
     GetAreaHandleInfoVO getAreaHandleInfo(GetAreaEvaluateInfoDTO dto);
+
+    void importAreaHandleInfo(ImportAreaHandleInfoDTO dto);
 }

+ 3 - 0
src/main/java/com/cqut/stack/bn/service/CharacteristicThingService.java

@@ -2,6 +2,7 @@ package com.cqut.stack.bn.service;
 
 import com.cqut.stack.bn.pojo.dto.characteristicThing.GetCharacteristicThingInfoDTO;
 import com.cqut.stack.bn.pojo.dto.characteristicThing.GetCharacteristicThingInfoListByPageDTO;
+import com.cqut.stack.bn.pojo.dto.characteristicThing.ImportCharacteristicThingDTO;
 import com.cqut.stack.bn.pojo.entity.CharacteristicThing;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.cqut.stack.bn.pojo.vo.characteristicThing.GetCharacteristicThingInfoVO;
@@ -15,4 +16,6 @@ public interface CharacteristicThingService extends IService<CharacteristicThing
     List<CharacteristicThing> getCharacteristicThingInfoListByPage(GetCharacteristicThingInfoListByPageDTO dto);
 
     GetCharacteristicThingInfoVO getCharacteristicThingInfo(GetCharacteristicThingInfoDTO dto);
+
+    void importCharacteristicThing(ImportCharacteristicThingDTO dto);
 }

+ 3 - 0
src/main/java/com/cqut/stack/bn/service/EfficientThingService.java

@@ -1,5 +1,6 @@
 package com.cqut.stack.bn.service;
 
+import com.cqut.stack.bn.pojo.dto.areaHandle.ImportAreaHandleInfoDTO;
 import com.cqut.stack.bn.pojo.dto.efficientThing.GetEfficientThingInfoDTO;
 import com.cqut.stack.bn.pojo.dto.efficientThing.GetEfficientThingInfoListByPageDTO;
 import com.cqut.stack.bn.pojo.entity.EfficientThing;
@@ -14,4 +15,6 @@ public interface EfficientThingService extends IService<EfficientThing> {
    List<EfficientThing> getEfficientThingInfoListByPage(GetEfficientThingInfoListByPageDTO dto);
 
     GetEfficientThingInfoVO getEfficientThingInfo(GetEfficientThingInfoDTO dto);
+
+    void importEfficientThingInfo(ImportAreaHandleInfoDTO dto);
 }

+ 27 - 0
src/main/java/com/cqut/stack/bn/service/impl/AreaEvaluateServiceImpl.java

@@ -1,22 +1,34 @@
 package com.cqut.stack.bn.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
+import com.alibaba.excel.EasyExcel;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.cqut.stack.bn.pojo.dto.areaEvaluate.AreaEvaluateImportDTO;
+import com.cqut.stack.bn.pojo.dto.areaEvaluate.ImportAreaEvaluateInfoDTO;
+import com.cqut.stack.bn.pojo.dto.fourOfficeInfo.FourOfficeImportDTO;
 import com.cqut.stack.bn.pojo.entity.AreaEvaluate;
 import com.cqut.stack.bn.dao.AreaEvaluateMapper;
 import com.cqut.stack.bn.pojo.enums.GovernmentServiceEnum;
+import com.cqut.stack.bn.pojo.listener.AreaEvaluateListener;
+import com.cqut.stack.bn.pojo.listener.FourOfficeListener;
 import com.cqut.stack.bn.pojo.vo.areaEvaluate.GetAreaEvaluateInfoVO;
 import com.cqut.stack.bn.service.AreaEvaluateService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import jdk.nashorn.internal.ir.annotations.Reference;
+import org.checkerframework.checker.units.qual.A;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 
 @Service
 public class AreaEvaluateServiceImpl extends ServiceImpl<AreaEvaluateMapper, AreaEvaluate> implements AreaEvaluateService {
 
+    @Resource
+    private AreaEvaluateMapper areaEvaluateMapper;
     @Override
     public List<GetAreaEvaluateInfoVO> areaEvaluateService() {
         List<AreaEvaluate> areaEvaluateList = this.list();
@@ -29,4 +41,19 @@ public class AreaEvaluateServiceImpl extends ServiceImpl<AreaEvaluateMapper, Are
         }
         return getAreaEvaluateInfoVOList;
     }
+
+    @Override
+    public void importAreaEvaluateInfo(ImportAreaEvaluateInfoDTO dto) {
+        // 删除所有旧数据
+        areaEvaluateMapper.deleteAll();
+        AreaEvaluateListener areaEvaluateListener = new AreaEvaluateListener();
+        FourOfficeListener fourOfficeListener = new FourOfficeListener();
+        try {
+            EasyExcel.read(dto.getMultipartFile().getInputStream(), AreaEvaluateImportDTO.class, areaEvaluateListener)
+                    .headRowNumber(2).sheet().doRead();
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+        this.saveBatch(areaEvaluateListener.getAreaEvaluateList());
+    }
 }

+ 26 - 0
src/main/java/com/cqut/stack/bn/service/impl/AreaHandleServiceImpl.java

@@ -2,19 +2,29 @@ package com.cqut.stack.bn.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollectionUtil;
+import com.alibaba.excel.EasyExcel;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.cqut.stack.bn.dao.FourOfficeInfoMapper;
+import com.cqut.stack.bn.pojo.dto.areaHandle.AreaHandleImportDTO;
 import com.cqut.stack.bn.pojo.dto.areaHandle.GetAreaEvaluateInfoDTO;
+import com.cqut.stack.bn.pojo.dto.areaHandle.ImportAreaHandleInfoDTO;
+import com.cqut.stack.bn.pojo.dto.fourOfficeInfo.FourOfficeImportDTO;
 import com.cqut.stack.bn.pojo.entity.AreaEvaluate;
 import com.cqut.stack.bn.pojo.entity.AreaHandle;
 import com.cqut.stack.bn.dao.AreaHandleMapper;
 import com.cqut.stack.bn.pojo.enums.GovernmentServiceEnum;
+import com.cqut.stack.bn.pojo.listener.AreaHandleListener;
+import com.cqut.stack.bn.pojo.listener.FourOfficeListener;
 import com.cqut.stack.bn.pojo.vo.areaEvaluate.GetAreaEvaluateInfoVO;
 import com.cqut.stack.bn.pojo.vo.areaHandle.GetAreaHandleInfoVO;
 import com.cqut.stack.bn.service.AreaHandleService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.checkerframework.checker.units.qual.A;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
@@ -22,6 +32,8 @@ import java.util.List;
 @Service
 public class AreaHandleServiceImpl extends ServiceImpl<AreaHandleMapper, AreaHandle> implements AreaHandleService {
 
+    @Resource
+    private AreaHandleMapper areaHandleMapper;
     @Override
     public GetAreaHandleInfoVO getAreaHandleInfo(GetAreaEvaluateInfoDTO dto) {
         LambdaQueryWrapper<AreaHandle> queryWrapper = Wrappers.lambdaQuery();
@@ -34,4 +46,18 @@ public class AreaHandleServiceImpl extends ServiceImpl<AreaHandleMapper, AreaHan
         getAreaHandleInfoVO.setDistrictName(GovernmentServiceEnum.DistrictEnum.getNameByCode(areaHandleList.get(0).getDistrictName()));
        return getAreaHandleInfoVO;
     }
+
+    @Override
+    public void importAreaHandleInfo(ImportAreaHandleInfoDTO dto) {
+        // 删除所有旧数据
+        areaHandleMapper.deleteAll();
+        AreaHandleListener areaHandleListener = new AreaHandleListener();
+        try {
+            EasyExcel.read(dto.getMultipartFile().getInputStream(), AreaHandleImportDTO.class, areaHandleListener)
+                    .headRowNumber(2).sheet().doRead();
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+        this.saveBatch(areaHandleListener.getAreaHandleList());
+    }
 }

+ 22 - 0
src/main/java/com/cqut/stack/bn/service/impl/CharacteristicThingServiceImpl.java

@@ -1,14 +1,20 @@
 package com.cqut.stack.bn.service.impl;
 
 import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.excel.EasyExcel;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.cqut.stack.bn.dao.CharacteristicThingMapper;
+import com.cqut.stack.bn.pojo.dto.characteristicThing.CharacteristicThingImportDTO;
 import com.cqut.stack.bn.pojo.dto.characteristicThing.GetCharacteristicThingInfoDTO;
 import com.cqut.stack.bn.pojo.dto.characteristicThing.GetCharacteristicThingInfoListByPageDTO;
+import com.cqut.stack.bn.pojo.dto.characteristicThing.ImportCharacteristicThingDTO;
+import com.cqut.stack.bn.pojo.dto.fourOfficeInfo.FourOfficeImportDTO;
 import com.cqut.stack.bn.pojo.entity.CharacteristicThing;
 import com.cqut.stack.bn.pojo.entity.EfficientThing;
+import com.cqut.stack.bn.pojo.listener.CharacteristicThingListener;
+import com.cqut.stack.bn.pojo.listener.FourOfficeListener;
 import com.cqut.stack.bn.pojo.vo.characteristicThing.GetCharacteristicThingInfoVO;
 import com.cqut.stack.bn.pojo.vo.efficientThing.GetEfficientThingInfoVO;
 import com.cqut.stack.bn.service.CharacteristicThingService;
@@ -16,6 +22,7 @@ import com.github.pagehelper.PageHelper;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.io.IOException;
 import java.util.*;
 
 
@@ -61,4 +68,19 @@ public class CharacteristicThingServiceImpl extends ServiceImpl<CharacteristicTh
         getCharacteristicThingInfoVO.setYAxisData(yAxisData);
         return getCharacteristicThingInfoVO;
     }
+
+    @Override
+    public void importCharacteristicThing(ImportCharacteristicThingDTO dto) {
+        // 删除所有旧数据
+        characteristicThingMapper.deleteAll();
+        CharacteristicThingListener characteristicThingListener = new CharacteristicThingListener();
+        FourOfficeListener fourOfficeListener = new FourOfficeListener();
+        try {
+            EasyExcel.read(dto.getMultipartFile().getInputStream(), CharacteristicThingImportDTO.class, characteristicThingListener)
+                    .headRowNumber(2).sheet().doRead();
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+        this.saveBatch(characteristicThingListener.getCharacteristicThingList());
+    }
 }

+ 21 - 0
src/main/java/com/cqut/stack/bn/service/impl/EfficientThingServiceImpl.java

@@ -1,19 +1,26 @@
 package com.cqut.stack.bn.service.impl;
 
 import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.excel.EasyExcel;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.cqut.stack.bn.pojo.dto.areaHandle.ImportAreaHandleInfoDTO;
+import com.cqut.stack.bn.pojo.dto.efficientThing.EfficientThingImportDTO;
 import com.cqut.stack.bn.pojo.dto.efficientThing.GetEfficientThingInfoDTO;
 import com.cqut.stack.bn.pojo.dto.efficientThing.GetEfficientThingInfoListByPageDTO;
+import com.cqut.stack.bn.pojo.dto.fourOfficeInfo.FourOfficeImportDTO;
 import com.cqut.stack.bn.pojo.entity.EfficientThing;
 import com.cqut.stack.bn.dao.EfficientThingMapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.cqut.stack.bn.pojo.listener.EfficientThingListener;
+import com.cqut.stack.bn.pojo.listener.FourOfficeListener;
 import com.cqut.stack.bn.pojo.vo.efficientThing.GetEfficientThingInfoVO;
 import com.cqut.stack.bn.service.EfficientThingService;
 import com.github.pagehelper.PageHelper;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.io.IOException;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -60,4 +67,18 @@ public class EfficientThingServiceImpl extends ServiceImpl<EfficientThingMapper,
         getEfficientThingInfoVO.setYAxisData(yAxisData);
         return getEfficientThingInfoVO;
     }
+
+    @Override
+    public void importEfficientThingInfo(ImportAreaHandleInfoDTO dto) {
+        // 删除所有旧数据
+        efficientThingMapper.deleteAll();
+        EfficientThingListener efficientThingListener = new EfficientThingListener();
+        try {
+            EasyExcel.read(dto.getMultipartFile().getInputStream(), EfficientThingImportDTO.class, efficientThingListener)
+                    .headRowNumber(2).sheet().doRead();
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+        this.saveBatch(efficientThingListener.getEfficientThingList());
+    }
 }

+ 4 - 1
src/main/resources/mapper/AreaEvaluateMapper.xml

@@ -5,7 +5,7 @@
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.cqut.stack.bn.pojo.entity.AreaEvaluate">
         <id column="id" property="id" />
-        <result column="evalute_count" property="evaluteCount" />
+        <result column="evaluate_count" property="evaluateCount" />
         <result column="positive_count" property="positiveCount" />
         <result column="negative_count" property="negativeCount" />
         <result column="satisfaction_rate" property="satisfactionRate" />
@@ -16,5 +16,8 @@
     <sql id="Base_Column_List">
         id, evalute_count, positive_count, negative_count, satisfaction_rate, district_name
     </sql>
+    <delete id="deleteAll">
+        TRUNCATE TABLE area_evaluate;
+    </delete>
 
 </mapper>

+ 4 - 1
src/main/resources/mapper/AreaHandleMapper.xml

@@ -11,12 +11,15 @@
         <result column="complete_count" property="completeCount" />
         <result column="complete_rate" property="completeRate" />
         <result column="network_apply_rate" property="networkApplyRate" />
-        <result column="comlete_on_time_rate" property="comleteOnTimeRate" />
+        <result column="complete_on_time_rate" property="completeOnTimeRate" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
         id, district_name, apply_count, accept_count, complete_count, complete_rate, network_apply_rate, comlete_on_time_rate
     </sql>
+    <delete id="deleteAll">
+        TRUNCATE TABLE area_handle;
+    </delete>
 
 </mapper>

+ 3 - 0
src/main/resources/mapper/CharacteristicThingMapper.xml

@@ -15,5 +15,8 @@
     <sql id="Base_Column_List">
         id, directory_name, apply_count, process_count, stat_date
     </sql>
+    <delete id="deleteAll">
+        TRUNCATE table characteristic_thing;
+    </delete>
 
 </mapper>

+ 3 - 0
src/main/resources/mapper/EfficientThingMapper.xml

@@ -15,5 +15,8 @@
     <sql id="Base_Column_List">
         id, directory_name, apply_count, process_count, stat_date
     </sql>
+    <delete id="deleteAll">
+        TRUNCATE table efficient_thing;
+    </delete>
 
 </mapper>