Browse Source

Merge remote-tracking branch 'origin/lingshan_master' into lingshan_master

master
luyan 3 years ago
parent
commit
b24d087f26
  1. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/BizTypeEnum.java
  2. 53
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/ListByCategory.java
  3. 25
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/StatsByCategoryRstDTO.java
  4. 19
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPublicServiceController.java
  5. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPublicServiceDao.java
  6. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPublicServiceEntity.java
  7. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPublicServiceService.java
  8. 36
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPublicServiceServiceImpl.java
  9. 14
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPublicServiceDao.xml
  10. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdYesOrNoConverter.java
  11. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingShanHelpCrowdBaseExcelData.java
  12. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/AbstractLingShanHelpCrowdExcelImportListener.java
  13. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdCanjiExcelImportListener.java
  14. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdDabingExcelImportListener.java
  15. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdDibaoExcelImportListener.java
  16. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdDujuExcelImportListener.java
  17. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdGaolingExcelImportListener.java
  18. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdKongchaoExcelImportListener.java
  19. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdLiushouExcelImportListener.java
  20. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdTekunExcelImportListener.java
  21. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanHelpCrowdServiceImpl.java
  22. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/lingshan/help_crowd_export_canji.xlsx
  23. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/lingshan/help_crowd_export_dabing.xlsx
  24. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/lingshan/help_crowd_export_dibao.xlsx
  25. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/lingshan/help_crowd_export_duju.xlsx
  26. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/lingshan/help_crowd_export_gaoling.xlsx
  27. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/lingshan/help_crowd_export_kongchao.xlsx
  28. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/lingshan/help_crowd_export_liushou.xlsx
  29. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/lingshan/help_crowd_export_tekun.xlsx

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/BizTypeEnum.java

@ -20,6 +20,7 @@ public enum BizTypeEnum {
PROJECT("project", "项目"),
ARTICLE("article", "文章(党建声音)"),
SPECIAL_CROWD("special_crowd", "社会维稳(特殊人群)"),
HELP_CROWD("help_crowd", "重点帮扶人群"),
;
public static BizTypeEnum getEnum(String code) {

53
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/ListByCategory.java

@ -0,0 +1,53 @@
package com.epmet.dto.result.lingshan;
import lombok.Data;
@Data
public class ListByCategory {
/**
* 资源名称
*/
private String title;
/**
* 类别名称
*/
private String type;
private String longitude;
private String latitude;
private String addr;
/**
* 负责人
*/
private String attn;
/**
* 负责人电话
*/
private String phone;
/**
* 片区民警姓名
*/
private String police;
/**
* 片区民警电话
*/
private String policePhone;
/**
* 网格员姓名
*/
private String gridUser;
/**
* 网格员电话
*/
private String gridUserPhone;
}

25
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/StatsByCategoryRstDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.result.lingshan;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class StatsByCategoryRstDTO {
/**
* 分类
*/
private String category;
/**
* 名称
*/
private String name;
/**
* 总量
*/
private Integer total;
}

19
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPublicServiceController.java

@ -30,6 +30,7 @@ import com.epmet.dto.form.IcPublicServiceListFormDTO;
import com.epmet.dto.form.IcSuperiorResourceAddEditFormDTO;
import com.epmet.dto.result.IcPublicServiceListResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.dto.result.lingshan.StatsByCategoryRstDTO;
import com.epmet.excel.IcPublicServiceExcel;
import com.epmet.service.IcPublicServiceService;
import com.epmet.utils.ImportTaskUtils;
@ -226,5 +227,23 @@ public class IcPublicServiceController implements ResultDataResolver {
return new Result();
}
/**
* @Description: 分类统计
* @param orgType:
* @param orgId:
* @Return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.lingshan.StatsByCategoryRstDTO>>
* @Author: wangxianzhang
* @Date: 2023/5/30 9:20 AM
*/
@GetMapping("lingshan/screen/statsByCategory")
public Result<List<StatsByCategoryRstDTO>> lingshanScreenStatsByCategory(@RequestParam("orgType") String orgType,
@RequestParam("orgId") String orgId) {
List<StatsByCategoryRstDTO> l = icPublicServiceService.lingshanScreenStatsByCategory(orgType, orgId);
return new Result<List<StatsByCategoryRstDTO>>().ok(l);
}
// @GetMapping("lingshan/screen/listByCategory")
// public Result<>
}

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPublicServiceDao.java

@ -3,6 +3,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.IcPublicServiceListFormDTO;
import com.epmet.dto.result.IcPublicServiceListResultDTO;
import com.epmet.dto.result.lingshan.StatsByCategoryRstDTO;
import com.epmet.entity.IcPublicServiceEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -25,4 +26,14 @@ public interface IcPublicServiceDao extends BaseDao<IcPublicServiceEntity> {
void importInsert(@Param("entityList") List<IcPublicServiceEntity> entityList);
void delByAgencyAndName(IcPublicServiceEntity entity);
/**
* @Description: 灵山大屏各类别服务的数量统计
* @param orgIdPath:
* @param customerId:
* @Return java.util.List<com.epmet.dto.result.lingshan.StatsByCategoryRstDTO>
* @Author: wangxianzhang
* @Date: 2023/5/30 9:44 AM
*/
List<StatsByCategoryRstDTO> lingshanScreenStatsByCategory(@Param("orgIdPath") String orgIdPath, @Param("customerId") String customerId);
}

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPublicServiceEntity.java

@ -83,4 +83,10 @@ public class IcPublicServiceEntity extends BaseEpmetEntity {
*/
private String mobile;
/**
* 用于聚合统计
*
*/
private transient int total;
}

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPublicServiceService.java

@ -6,9 +6,11 @@ import com.epmet.dto.IcPublicServiceDTO;
import com.epmet.dto.form.IcPublicServiceAddEditFormDTO;
import com.epmet.dto.form.IcPublicServiceListFormDTO;
import com.epmet.dto.result.IcPublicServiceListResultDTO;
import com.epmet.dto.result.lingshan.StatsByCategoryRstDTO;
import com.epmet.entity.IcPublicServiceEntity;
import java.nio.file.Path;
import java.util.List;
/**
* 公共服务图层
@ -70,4 +72,6 @@ public interface IcPublicServiceService extends BaseService<IcPublicServiceEntit
IcPublicServiceListResultDTO detail(IcPublicServiceListFormDTO formDTO);
void importExcel(Path fileSavePath, String taskId);
List<StatsByCategoryRstDTO> lingshanScreenStatsByCategory(String orgType, String orgId);
}

36
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPublicServiceServiceImpl.java

@ -12,11 +12,11 @@ import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.EpmetRequestHolder;
import com.epmet.commons.tools.utils.FileUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.utils.*;
import com.epmet.constant.OrgInfoConstant;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcPublicServiceDao;
import com.epmet.dto.IcPublicServiceDTO;
@ -26,12 +26,15 @@ import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.result.IcCoverageCategoryDictListResultDTO;
import com.epmet.dto.result.IcPublicServiceListResultDTO;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.dto.result.lingshan.StatsByCategoryRstDTO;
import com.epmet.entity.IcPublicServiceEntity;
import com.epmet.entity.IcSuperiorResourceEntity;
import com.epmet.excel.IcPublicServiceExcel;
import com.epmet.excel.handler.IcPublicServiceExcelImportListener;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.OssFeignClient;
import com.epmet.remote.EpmetUserRemoteService;
import com.epmet.service.CoverageService;
import com.epmet.service.IcPublicServiceService;
import com.epmet.utils.ImportTaskUtils;
@ -54,6 +57,7 @@ import java.io.IOException;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
@ -77,6 +81,12 @@ public class IcPublicServiceServiceImpl extends BaseServiceImpl<IcPublicServiceD
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
@Autowired
private IcPublicServiceDao icPublicServiceDao;
@Autowired
private EpmetUserRemoteService userRemoteService;
@Autowired
private EpmetAdminOpenFeignClient adminOpenFeignClient;
@Override
@ -301,4 +311,22 @@ public class IcPublicServiceServiceImpl extends BaseServiceImpl<IcPublicServiceD
baseDao.importInsert(entityList);
}
@Override
public List<StatsByCategoryRstDTO> lingshanScreenStatsByCategory(String orgType, String orgId) {
// 先拿pids
String orgIdPath;
if (StringUtils.isAnyBlank(orgType, orgId)) {
orgIdPath = userRemoteService.getLoginUserDetails().getOrgIdPath();
} else {
if (OrgInfoConstant.AGENCY.equals(orgType)) {
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId);
orgIdPath = PidUtils.convertPid2OrgIdPath(agencyInfo.getId(), agencyInfo.getPids());
} else {
return new ArrayList<>();
}
}
// 查询
return baseDao.lingshanScreenStatsByCategory(orgIdPath, EpmetRequestHolder.getLoginUserCustomerId());
}
}

14
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPublicServiceDao.xml

@ -105,6 +105,20 @@
ORDER BY created_time DESC
</select>
<!--灵山大屏:各类别服务的数量统计-->
<select id="lingshanScreenStatsByCategory"
resultType="com.epmet.dto.result.lingshan.StatsByCategoryRstDTO">
select d.CATEGORY_KEY category, d.CATEGORY_NAME name, count(*) total
from ic_coverage_category_dict d
left join ic_public_service ps
on (ps.DEL_FLAG = 0 and d.CUSTOMER_ID = ps.CUSTOMER_ID and d.CATEGORY_KEY = ps.CATEGORY)
where d.DEL_FLAG = 0
and d.PLACE_TYPE = 'public_service'
and ps.AGENCY_ID_PATH like CONCAT(#{orgIdPath}, '%')
and d.CUSTOMER_ID = #{customerId}
group by ps.CATEGORY, d.CATEGORY_NAME
</select>
<delete id="del">
UPDATE ic_public_service
SET del_flag = '1',

9
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdYesOrNoConverter.java

@ -47,13 +47,14 @@ public class LingShanSpecialCrowdYesOrNoConverter implements Converter<Integer>
public WriteCellData<?> convertToExcelData(WriteConverterContext<Integer> context) throws Exception {
String fieldName = context.getContentProperty().getField().getName();
Integer value = context.getValue();
if (group1.contains(fieldName)) {
return convertYesOrNoFlag(value);
} else if (group2.contains(fieldName)) {
// 这个组里的,要转化为有无
if (group2.contains(fieldName)) {
return convertHaveOrNotFlag(value);
}
return Converter.super.convertToExcelData(context);
// 其他的都转化为是否
return convertYesOrNoFlag(value);
}
WriteCellData<?> convertHaveOrNotFlag(Integer value) {

2
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingShanHelpCrowdBaseExcelData.java

@ -27,7 +27,7 @@ public class LingShanHelpCrowdBaseExcelData {
/**
* 错误信息
*/
@ExcelProperty(value = "错误信息")
@ExcelProperty(value = "说明")
private String errorInfo;
/**

4
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/AbstractLingShanHelpCrowdExcelImportListener.java

@ -292,7 +292,9 @@ public abstract class AbstractLingShanHelpCrowdExcelImportListener<T extends Lin
}
// 保存人群详情数据
saveBatchCallback(correctDatas);
if (CollectionUtils.isNotEmpty(correctDatas)) {
saveBatchCallback(correctDatas);
}
}
/**

2
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdCanjiExcelImportListener.java

@ -26,7 +26,7 @@ public class LingShanHelpCrowdCanjiExcelImportListener
@Override
String setTemplateFileName() {
return "excel/lingshan/lingshan_help_crowd_canji_export.xlsx";
return "excel/lingshan/help_crowd_export_canji.xlsx";
}
@Override

2
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdDabingExcelImportListener.java

@ -28,7 +28,7 @@ public class LingShanHelpCrowdDabingExcelImportListener
@Override
String setTemplateFileName() {
return "excel/lingshan/lingshan_help_crowd_dabing_export.xlsx";
return "excel/lingshan/help_crowd_export_dabing.xlsx";
}
@Override

2
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdDibaoExcelImportListener.java

@ -30,7 +30,7 @@ public class LingShanHelpCrowdDibaoExcelImportListener
@Override
String setTemplateFileName() {
return "excel/lingshan/lingshan_help_crowd_dibao_export.xlsx";
return "excel/lingshan/help_crowd_export_dibao.xlsx";
}
@Override

2
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdDujuExcelImportListener.java

@ -27,7 +27,7 @@ public class LingShanHelpCrowdDujuExcelImportListener
@Override
String setTemplateFileName() {
return "excel/lingshan/lingshan_help_crowd_duju_export.xlsx";
return "excel/lingshan/help_crowd_export_duju.xlsx";
}
@Override

2
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdGaolingExcelImportListener.java

@ -27,7 +27,7 @@ public class LingShanHelpCrowdGaolingExcelImportListener
@Override
String setTemplateFileName() {
return "excel/lingshan/lingshan_help_crowd_gaoling_export.xlsx";
return "excel/lingshan/help_crowd_export_gaoling.xlsx";
}
@Override

2
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdKongchaoExcelImportListener.java

@ -27,7 +27,7 @@ public class LingShanHelpCrowdKongchaoExcelImportListener
@Override
String setTemplateFileName() {
return "excel/lingshan/lingshan_help_crowd_kongchao_export.xlsx";
return "excel/lingshan/help_crowd_export_kongchao.xlsx";
}
@Override

2
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdLiushouExcelImportListener.java

@ -27,7 +27,7 @@ public class LingShanHelpCrowdLiushouExcelImportListener
@Override
String setTemplateFileName() {
return "excel/lingshan/lingshan_help_crowd_liushou_export.xlsx";
return "excel/lingshan/help_crowd_export_liushou.xlsx";
}
@Override

2
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdTekunExcelImportListener.java

@ -29,7 +29,7 @@ public class LingShanHelpCrowdTekunExcelImportListener
@Override
String setTemplateFileName() {
return "excel/lingshan/lingshan_help_crowd_tekun_export.xlsx";
return "excel/lingshan/help_crowd_export_tekun.xlsx";
}
@Override

10
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanHelpCrowdServiceImpl.java

@ -249,7 +249,7 @@ public class LingShanHelpCrowdServiceImpl implements LingShanHelpCrowdService, R
// 创建导入任务
ImportTaskCommonResultDTO importTaskRst = getResultDataOrThrowsException(ImportTaskUtils.createImportTask(originalFilename,
BizTypeEnum.SPECIAL_CROWD.getType()),
BizTypeEnum.HELP_CROWD.getType()),
ServiceConstant.EPMET_COMMON_SERVICE,
EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),
null, "【灵山街道-导入重点帮扶人群】创建导入任务失败");
@ -261,7 +261,7 @@ public class LingShanHelpCrowdServiceImpl implements LingShanHelpCrowdService, R
// 如果提交异步任务失败了,也要将导入任务置为结束,并且返回一个未知错误
log.error("【灵山街道-导入重点帮扶人群】失败,错误信息:" + ExceptionUtils.getErrorStackTrace(e));
ImportTaskUtils.finishImportTask(importTaskRst.getTaskId(),
ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL, null, "未知错误");
ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL, null, "未知错误,创建异步任务失败", 0, 0);
// 删除文件
FileUtils.deleteFileIfExists(fileSavePath);
@ -288,7 +288,7 @@ public class LingShanHelpCrowdServiceImpl implements LingShanHelpCrowdService, R
.sheet(0)
.doRead();
List<LingShanSpecialCrowdDetailBaseExcelData> errorDatas = listener.getErrorDatas();
List errorDatas = listener.getErrorDatas();
if (CollectionUtils.isNotEmpty(errorDatas)) {
// 有错误数据需要提示
String resultDescFilePath = uploadResultDescFilePath(errorDatas, listener.getTemplateFileName());
@ -301,9 +301,9 @@ public class LingShanHelpCrowdServiceImpl implements LingShanHelpCrowdService, R
ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS, null, "成功", listener.getSuccessedItemsQty(), listener.getFailedItemsQty());
}
} catch (Exception e) {
log.error("【灵山街道-导入重点帮扶人群】失败,错误信息:" + ExceptionUtils.getErrorStackTrace(e));
log.error("【灵山街道-导入重点帮扶人群】异步任务过程中失败,错误信息:" + ExceptionUtils.getErrorStackTrace(e));
ImportTaskUtils.finishImportTask(taskId,
ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL, null, "未知错误");
ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL, null, "未知错误,异步任务过程中失败", 0, 0);
} finally {
FileUtils.deleteFileIfExists(fileSavePath);
}

BIN
epmet-user/epmet-user-server/src/main/resources/excel/lingshan/help_crowd_export_canji.xlsx

Binary file not shown.

BIN
epmet-user/epmet-user-server/src/main/resources/excel/lingshan/help_crowd_export_dabing.xlsx

Binary file not shown.

BIN
epmet-user/epmet-user-server/src/main/resources/excel/lingshan/help_crowd_export_dibao.xlsx

Binary file not shown.

BIN
epmet-user/epmet-user-server/src/main/resources/excel/lingshan/help_crowd_export_duju.xlsx

Binary file not shown.

BIN
epmet-user/epmet-user-server/src/main/resources/excel/lingshan/help_crowd_export_gaoling.xlsx

Binary file not shown.

BIN
epmet-user/epmet-user-server/src/main/resources/excel/lingshan/help_crowd_export_kongchao.xlsx

Binary file not shown.

BIN
epmet-user/epmet-user-server/src/main/resources/excel/lingshan/help_crowd_export_liushou.xlsx

Binary file not shown.

BIN
epmet-user/epmet-user-server/src/main/resources/excel/lingshan/help_crowd_export_tekun.xlsx

Binary file not shown.
Loading…
Cancel
Save