Browse Source

【治理排行】后台管理开发-王公峰-2020-06-17

feature/dangjian
wanggongfeng 5 years ago
parent
commit
551813eaee
  1. 5
      esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/ExportTemplateInfoFormDTO.java
  2. 61
      esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/ExportKpiResultDTO.java
  3. 12
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java
  4. 6
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysDeptDao.java
  5. 6
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysDeptService.java
  6. 4
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java
  7. 5
      esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysDeptDao.xml
  8. 38
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/DateUtils.java
  9. 45
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/ExcelUtils.java
  10. 22
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiGridEntityDTO.java
  11. 127
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiMassEvaluationDTO.java
  12. 122
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiMattersResponseDTO.java
  13. 126
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiPublicOpinionDTO.java
  14. 127
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiTypicalCultureDTO.java
  15. 26
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/form/CheckIsScoredByYearFormDTO.java
  16. 2
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiCommunityBuildingController.java
  17. 114
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiGridEntityController.java
  18. 114
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiMassEvaluationController.java
  19. 95
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiMattersResponseController.java
  20. 114
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiPublicOpinionController.java
  21. 95
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiTypicalCultureController.java
  22. 50
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiGridEntityDao.java
  23. 50
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiMassEvaluationDao.java
  24. 42
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiMattersResponseDao.java
  25. 50
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiPublicOpinionDao.java
  26. 42
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiTypicalCultureDao.java
  27. 93
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiGridEntityEntity.java
  28. 96
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiMassEvaluationEntity.java
  29. 92
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiMattersResponseEntity.java
  30. 96
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiPublicOpinionEntity.java
  31. 93
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiTypicalCultureEntity.java
  32. 87
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiGridEntityExcel.java
  33. 87
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiMassEvaluationExcel.java
  34. 87
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiMattersResponseExcel.java
  35. 87
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiPublicOpinionExcel.java
  36. 89
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiTypicalCultureExcel.java
  37. 4
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java
  38. 4
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java
  39. 47
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiGridEntityRedis.java
  40. 47
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiMassEvaluationRedis.java
  41. 47
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiMattersResponseRedis.java
  42. 47
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiPublicOpinionRedis.java
  43. 47
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiTypicalCultureRedis.java
  44. 2
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiCommunityBuildingService.java
  45. 124
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiGridEntityService.java
  46. 124
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiMassEvaluationService.java
  47. 103
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiMattersResponseService.java
  48. 124
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiPublicOpinionService.java
  49. 102
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiTypicalCultureService.java
  50. 134
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiCommunityBuildingServiceImpl.java
  51. 377
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiGridEntityServiceImpl.java
  52. 375
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiMassEvaluationServiceImpl.java
  53. 137
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiMattersResponseServiceImpl.java
  54. 377
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiPublicOpinionServiceImpl.java
  55. 137
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiTypicalCultureServiceImpl.java
  56. 95
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiGridEntityDao.xml
  57. 95
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiMassEvaluationDao.xml
  58. 63
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiMattersResponseDao.xml
  59. 95
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiPublicOpinionDao.xml
  60. 67
      esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiTypicalCultureDao.xml

5
esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/ExportTemplateInfoFormDTO.java

@ -32,4 +32,9 @@ public class ExportTemplateInfoFormDTO implements Serializable {
* 部门类型
*/
private String deptTypeKey;
/**
*
*/
private String year;
}

61
esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/ExportKpiResultDTO.java

@ -0,0 +1,61 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dto.epdc.result;
import lombok.Data;
import java.io.Serializable;
/**
* 获取导出模板
*
* @author wanggongfeng
* @since v1.0.0 2020-06-16
*/
@Data
public class ExportKpiResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 部门id
*/
private String deptId;
/**
* 部门名称
*/
private String deptName;
/**
* 部门类别
*/
private String deptTypeKey;
/**
* 年月
*/
private String monthYear;
/**
*
*/
private String year;
}

12
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java

@ -19,7 +19,7 @@ import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.dto.*;
import com.elink.esua.epdc.dto.epdc.form.ExportTemplateInfoFormDTO;
import com.elink.esua.epdc.dto.epdc.form.UserSysDeptInfoFormDTO;
import com.elink.esua.epdc.dto.epdc.result.ExportTemplateInfoResultDTO;
import com.elink.esua.epdc.dto.epdc.result.ExportKpiResultDTO;
import com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO;
import com.elink.esua.epdc.service.SysDeptService;
import io.swagger.annotations.Api;
@ -325,14 +325,14 @@ public class SysDeptController {
/**
* @param formDTO
* @return ExportTemplateInfoResultDTO
* @return ExportKpiResultDTO
* @Author wanggongfeng
* @Description 获取网格建设打分模板
* @Description 获取治理排行打分模板
* @Date 2020-06-15
**/
@PostMapping("getExportTemplateInfo")
public Result<List<ExportTemplateInfoResultDTO>> getExportTemplateInfo(@RequestBody ExportTemplateInfoFormDTO formDTO) {
List<ExportTemplateInfoResultDTO> list = sysDeptService.getExportTemplateInfo(formDTO);
return new Result<List<ExportTemplateInfoResultDTO>>().ok(list);
public Result<List<ExportKpiResultDTO>> getExportTemplateInfo(@RequestBody ExportTemplateInfoFormDTO formDTO) {
List<ExportKpiResultDTO> list = sysDeptService.getExportTemplateInfo(formDTO);
return new Result<List<ExportKpiResultDTO>>().ok(list);
}
}

6
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysDeptDao.java

@ -13,7 +13,7 @@ import com.elink.esua.epdc.dto.*;
import com.elink.esua.epdc.dto.epdc.GridForLeaderRegisterDTO;
import com.elink.esua.epdc.dto.epdc.form.ExportTemplateInfoFormDTO;
import com.elink.esua.epdc.dto.epdc.form.UserSysDeptInfoFormDTO;
import com.elink.esua.epdc.dto.epdc.result.ExportTemplateInfoResultDTO;
import com.elink.esua.epdc.dto.epdc.result.ExportKpiResultDTO;
import com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO;
import com.elink.esua.epdc.entity.SysDeptEntity;
import org.apache.ibatis.annotations.Mapper;
@ -214,10 +214,10 @@ public interface SysDeptDao extends BaseDao<SysDeptEntity> {
/**
* @param formDTO
* @return ExportTemplateInfoResultDTO
* @return ExportKpiResultDTO
* @Author wanggongfeng
* @Description 获取网格建设打分模板
* @Date 2020-06-15
**/
List<ExportTemplateInfoResultDTO> getExportTemplateInfo(ExportTemplateInfoFormDTO formDTO);
List<ExportKpiResultDTO> getExportTemplateInfo(ExportTemplateInfoFormDTO formDTO);
}

6
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysDeptService.java

@ -15,7 +15,7 @@ import com.elink.esua.epdc.dto.*;
import com.elink.esua.epdc.dto.epdc.GridForLeaderRegisterDTO;
import com.elink.esua.epdc.dto.epdc.form.ExportTemplateInfoFormDTO;
import com.elink.esua.epdc.dto.epdc.form.UserSysDeptInfoFormDTO;
import com.elink.esua.epdc.dto.epdc.result.ExportTemplateInfoResultDTO;
import com.elink.esua.epdc.dto.epdc.result.ExportKpiResultDTO;
import com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO;
import com.elink.esua.epdc.entity.SysDeptEntity;
@ -294,10 +294,10 @@ public interface SysDeptService extends BaseService<SysDeptEntity> {
/**
* @param formDTO
* @return ExportTemplateInfoResultDTO
* @return ExportKpiResultDTO
* @Author wanggongfeng
* @Description 获取网格建设打分模板
* @Date 2020-06-15
**/
List<ExportTemplateInfoResultDTO> getExportTemplateInfo(ExportTemplateInfoFormDTO formDTO);
List<ExportKpiResultDTO> getExportTemplateInfo(ExportTemplateInfoFormDTO formDTO);
}

4
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java

@ -34,7 +34,7 @@ import com.elink.esua.epdc.dto.*;
import com.elink.esua.epdc.dto.epdc.GridForLeaderRegisterDTO;
import com.elink.esua.epdc.dto.epdc.form.ExportTemplateInfoFormDTO;
import com.elink.esua.epdc.dto.epdc.form.UserSysDeptInfoFormDTO;
import com.elink.esua.epdc.dto.epdc.result.ExportTemplateInfoResultDTO;
import com.elink.esua.epdc.dto.epdc.result.ExportKpiResultDTO;
import com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO;
import com.elink.esua.epdc.entity.SysDeptEntity;
import com.elink.esua.epdc.feign.GroupFeignClient;
@ -1097,7 +1097,7 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit
}
@Override
public List<ExportTemplateInfoResultDTO> getExportTemplateInfo(ExportTemplateInfoFormDTO formDTO) {
public List<ExportKpiResultDTO> getExportTemplateInfo(ExportTemplateInfoFormDTO formDTO) {
return baseDao.getExportTemplateInfo(formDTO);
}
}

5
esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysDeptDao.xml

@ -367,13 +367,16 @@
</if>
</select>
<select id="getExportTemplateInfo" parameterType="com.elink.esua.epdc.dto.epdc.form.ExportTemplateInfoFormDTO" resultType="com.elink.esua.epdc.dto.epdc.result.ExportTemplateInfoResultDTO">
<select id="getExportTemplateInfo" parameterType="com.elink.esua.epdc.dto.epdc.form.ExportTemplateInfoFormDTO" resultType="com.elink.esua.epdc.dto.epdc.result.ExportKpiResultDTO">
SELECT
sd.id deptId,
CONCAT(st.NAME,'-',sd.NAME) deptName,
<if test="monthYear!=null and monthYear !=''">
#{monthYear} as monthYear,
</if>
<if test="year!=null and year !=''">
#{year} as year,
</if>
sdi.dict_name deptTypeKey
FROM
sys_dept sd

38
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/DateUtils.java

@ -17,6 +17,7 @@ import org.joda.time.format.DateTimeFormatter;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
@ -211,4 +212,41 @@ public class DateUtils {
return df2.format(date1);
}
/**
* 获取上一个月字符串yyyy-MM
* @return
*/
public static String getLastMonth() {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM");
Date date = new Date();
Calendar calendar = Calendar.getInstance();
calendar.setTime(date); // 设置为当前时间
calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) - 1); // 设置为上一个月
date = calendar.getTime();
String accDate = format.format(date);
return accDate;
}
/**
* 获取当前月字符串yyyy-MM
* @return
*/
public static String getCurrentMonth() {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM");
Date date = new Date();
String currentDate = format.format(date);
return currentDate;
}
/**
* 获取当前年字符串yyyy
* @return
*/
public static String getCurrentYear() {
SimpleDateFormat format = new SimpleDateFormat("yyyy");
Date date = new Date();
String currentDate = format.format(date);
return currentDate;
}
}

45
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/ExcelUtils.java

@ -20,12 +20,15 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Excel工具类
@ -145,4 +148,46 @@ public class ExcelUtils {
public static boolean isExcel2007(String filePath) {
return filePath.matches("^.+\\.(?i)(xlsx)$");
}
/**
* 校验是否为数字字符串
* @param numStr
* @return
*/
public static Boolean checkNumber(String numStr){
Pattern pattern = Pattern.compile("([1-9]\\d*\\.?\\d*)|(0\\.\\d*[1-9])");
Matcher isNum = pattern.matcher(numStr);
if( !isNum.matches() ){
return true;
}
return false;
}
/**
* 删除文件夹强制删除
*
* @param path
*/
public static void deleteAllFilesOfDir(File path) {
if (null != path) {
if (!path.exists()) {
return;
}
if (path.isFile()) {
boolean result = path.delete();
int tryCount = 0;
while (!result && tryCount++ < 10) {
System.gc(); // 回收资源
result = path.delete();
}
}
File[] files = path.listFiles();
if (null != files) {
for (int i = 0; i < files.length; i++) {
deleteAllFilesOfDir(files[i]);
}
}
path.delete();
}
}
}

22
esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/ExportTemplateInfoResultDTO.java → esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiGridEntityDTO.java

@ -15,7 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dto.epdc.result;
package com.elink.esua.epdc.dto;
import lombok.Data;
@ -24,13 +24,13 @@ import java.util.Date;
/**
* 获取导出模板
* 网格实体化运作打分
*
* @author wanggongfeng
* @since v1.0.0 2020-06-15
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Data
public class ExportTemplateInfoResultDTO implements Serializable {
public class KpiGridEntityDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ -60,19 +60,19 @@ public class ExportTemplateInfoResultDTO implements Serializable {
private String monthYear;
/**
* 民主协商机制
* 建站达标
*/
private String democraticConsultationMechanism;
private String stationEstablishment;
/**
* 居民公约制度
* 人员配备
*/
private String residentConventionSystem;
private String staffingPlacement;
/**
* 网格协商案例
* 网格运行
*/
private String gridNegotiationCase;
private String gridOperation;
/**
* 上级部门id

127
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiMassEvaluationDTO.java

@ -0,0 +1,127 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 群众评价打分表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Data
public class KpiMassEvaluationDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 部门id
*/
private String deptId;
/**
* 部门名称
*/
private String deptName;
/**
* 部门类别
*/
private String deptTypeKey;
/**
*
*/
private String year;
/**
* 满意
*/
private String satisfied;
/**
* 基本满意
*/
private String basicSatisfaction;
/**
* 不满意
*/
private String dissatisfied;
/**
* 上级部门id
*/
private String parentDeptIds;
/**
* 上级部门名称
*/
private String parentDeptNames;
/**
* 所有部门id
*/
private String allDeptIds;
/**
* 所有部门名称
*/
private String allDeptNames;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 逻辑删除标识
*/
private String delFlag;
}

122
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiMattersResponseDTO.java

@ -0,0 +1,122 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import java.math.BigDecimal;
/**
* 响应率打分表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Data
public class KpiMattersResponseDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 部门id
*/
private String deptId;
/**
* 部门名称
*/
private String deptName;
/**
* 部门类别
*/
private String deptTypeKey;
/**
* 年月
*/
private String monthYear;
/**
* 扣分类别
*/
private String deductionCategory;
/**
* 扣分分值
*/
private BigDecimal deduction;
/**
* 上级部门id
*/
private String parentDeptIds;
/**
* 上级部门名称
*/
private String parentDeptNames;
/**
* 所有部门id
*/
private String allDeptIds;
/**
* 所有部门名称
*/
private String allDeptNames;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 逻辑删除标识
*/
private String delFlag;
}

126
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiPublicOpinionDTO.java

@ -0,0 +1,126 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 舆论监督打分表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Data
public class KpiPublicOpinionDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 部门id
*/
private String deptId;
/**
* 部门名称
*/
private String deptName;
/**
* 部门类别
*/
private String deptTypeKey;
/**
* 年月
*/
private String monthYear;
/**
* 宣传基础
*/
private String publicityFoundation;
/**
* 创新突破
*/
private String innovationBreakthrough;
/**
* 舆情应对
*/
private String publicOpinionResponse;
/**
* 上级部门id
*/
private String parentDeptIds;
/**
* 上级部门名称
*/
private String parentDeptNames;
/**
* 所有部门id
*/
private String allDeptIds;
/**
* 所有部门名称
*/
private String allDeptNames;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 逻辑删除标识
*/
private String delFlag;
}

127
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/KpiTypicalCultureDTO.java

@ -0,0 +1,127 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 典型培树
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Data
public class KpiTypicalCultureDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 部门id
*/
private String deptId;
/**
* 部门名称
*/
private String deptName;
/**
* 部门类别
*/
private String deptTypeKey;
/**
*
*/
private String year;
/**
* 加分类别
*/
private String bonusCategory;
/**
* 加分分值
*/
private String bonus;
/**
* 加分级别
*/
private String bonusLevel;
/**
* 上级部门id
*/
private String parentDeptIds;
/**
* 上级部门名称
*/
private String parentDeptNames;
/**
* 所有部门id
*/
private String allDeptIds;
/**
* 所有部门名称
*/
private String allDeptNames;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 逻辑删除标识
*/
private String delFlag;
}

26
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/form/CheckIsScoredByYearFormDTO.java

@ -0,0 +1,26 @@
package com.elink.esua.epdc.dto.form;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description 查询某年份某部门是否已打分
* @Author wanggongfeng
* @Date 2020/06/17 10:29
*/
@Data
public class CheckIsScoredByYearFormDTO implements Serializable {
private static final long serialVersionUID = -8214790072156444793L;
/**
* 主键集合
*/
private List<String> checkList;
/**
* 年月
*/
private String year;
}

2
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiCommunityBuildingController.java

@ -104,7 +104,7 @@ public class KpiCommunityBuildingController {
}
/**
* @Description: 导入治理排行管理-手动打分记录
* @Description: 导入治理排行管理-社区建设打分
* @Param: [file]
* @return: Result
* @Author: wanggongfeng

114
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiGridEntityController.java

@ -0,0 +1,114 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.dto.KpiGridEntityDTO;
import com.elink.esua.epdc.excel.KpiGridEntityExcel;
import com.elink.esua.epdc.service.KpiGridEntityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 网格实体化运作打分
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@RestController
@RequestMapping("kpigridentity")
public class KpiGridEntityController {
@Autowired
private KpiGridEntityService kpiGridEntityService;
@GetMapping("page")
public Result<PageData<KpiGridEntityDTO>> page(@RequestParam Map<String, Object> params){
//PageData<KpiGridEntityDTO> page = kpiGridEntityService.page(params);
PageData<KpiGridEntityDTO> page = kpiGridEntityService.getInfoPage(params);
return new Result<PageData<KpiGridEntityDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<KpiGridEntityDTO> get(@PathVariable("id") String id){
KpiGridEntityDTO data = kpiGridEntityService.get(id);
return new Result<KpiGridEntityDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody KpiGridEntityDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
kpiGridEntityService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody KpiGridEntityDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
kpiGridEntityService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
kpiGridEntityService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<KpiGridEntityDTO> list = kpiGridEntityService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, KpiGridEntityExcel.class);
}
@GetMapping("exportTemplate")
public void exportTemplate(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<KpiGridEntityDTO> list = kpiGridEntityService.exportTemplate(params);
ExcelUtils.exportExcelToTarget(response, null, list, KpiGridEntityExcel.class);
}
/**
* @Description: 导入治理排行管理-网格实体化运作
* @Param: [file]
* @return: Result
* @Author: wanggongfeng
* @Date: 2020-06-16
*/
@PostMapping("importManualScoreExcel")
public Result importManualScoreExcel(@RequestParam("file") MultipartFile file) {
return kpiGridEntityService.importManualScoreExcel(file);
}
}

114
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiMassEvaluationController.java

@ -0,0 +1,114 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.dto.KpiMassEvaluationDTO;
import com.elink.esua.epdc.excel.KpiMassEvaluationExcel;
import com.elink.esua.epdc.service.KpiMassEvaluationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 群众评价打分表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@RestController
@RequestMapping("kpimassevaluation")
public class KpiMassEvaluationController {
@Autowired
private KpiMassEvaluationService kpiMassEvaluationService;
@GetMapping("page")
public Result<PageData<KpiMassEvaluationDTO>> page(@RequestParam Map<String, Object> params){
//PageData<KpiMassEvaluationDTO> page = kpiMassEvaluationService.page(params);
PageData<KpiMassEvaluationDTO> page = kpiMassEvaluationService.getInfoPage(params);
return new Result<PageData<KpiMassEvaluationDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<KpiMassEvaluationDTO> get(@PathVariable("id") String id){
KpiMassEvaluationDTO data = kpiMassEvaluationService.get(id);
return new Result<KpiMassEvaluationDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody KpiMassEvaluationDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
kpiMassEvaluationService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody KpiMassEvaluationDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
kpiMassEvaluationService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
kpiMassEvaluationService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<KpiMassEvaluationDTO> list = kpiMassEvaluationService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, KpiMassEvaluationExcel.class);
}
@GetMapping("exportTemplate")
public void exportTemplate(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<KpiMassEvaluationDTO> list = kpiMassEvaluationService.exportTemplate(params);
ExcelUtils.exportExcelToTarget(response, null, list, KpiMassEvaluationExcel.class);
}
/**
* @Description: 导入治理排行管理-群众评价打分
* @Param: [file]
* @return: Result
* @Author: wanggongfeng
* @Date: 2020-06-17
*/
@PostMapping("importManualScoreExcel")
public Result importManualScoreExcel(@RequestParam("file") MultipartFile file) {
return kpiMassEvaluationService.importManualScoreExcel(file);
}
}

95
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiMattersResponseController.java

@ -0,0 +1,95 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.dto.KpiMattersResponseDTO;
import com.elink.esua.epdc.excel.KpiMattersResponseExcel;
import com.elink.esua.epdc.service.KpiMattersResponseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 响应率打分表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@RestController
@RequestMapping("kpimattersresponse")
public class KpiMattersResponseController {
@Autowired
private KpiMattersResponseService kpiMattersResponseService;
@GetMapping("page")
public Result<PageData<KpiMattersResponseDTO>> page(@RequestParam Map<String, Object> params){
//PageData<KpiMattersResponseDTO> page = kpiMattersResponseService.page(params);
PageData<KpiMattersResponseDTO> page = kpiMattersResponseService.getInfoPage(params);
return new Result<PageData<KpiMattersResponseDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<KpiMattersResponseDTO> get(@PathVariable("id") String id){
KpiMattersResponseDTO data = kpiMattersResponseService.get(id);
return new Result<KpiMattersResponseDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody KpiMattersResponseDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
kpiMattersResponseService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody KpiMattersResponseDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
kpiMattersResponseService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
kpiMattersResponseService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<KpiMattersResponseDTO> list = kpiMattersResponseService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, KpiMattersResponseExcel.class);
}
}

114
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiPublicOpinionController.java

@ -0,0 +1,114 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.dto.KpiPublicOpinionDTO;
import com.elink.esua.epdc.excel.KpiPublicOpinionExcel;
import com.elink.esua.epdc.service.KpiPublicOpinionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 舆论监督打分表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@RestController
@RequestMapping("kpipublicopinion")
public class KpiPublicOpinionController {
@Autowired
private KpiPublicOpinionService kpiPublicOpinionService;
@GetMapping("page")
public Result<PageData<KpiPublicOpinionDTO>> page(@RequestParam Map<String, Object> params){
//PageData<KpiPublicOpinionDTO> page = kpiPublicOpinionService.page(params);
PageData<KpiPublicOpinionDTO> page = kpiPublicOpinionService.getInfoPage(params);
return new Result<PageData<KpiPublicOpinionDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<KpiPublicOpinionDTO> get(@PathVariable("id") String id){
KpiPublicOpinionDTO data = kpiPublicOpinionService.get(id);
return new Result<KpiPublicOpinionDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody KpiPublicOpinionDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
kpiPublicOpinionService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody KpiPublicOpinionDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
kpiPublicOpinionService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
kpiPublicOpinionService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<KpiPublicOpinionDTO> list = kpiPublicOpinionService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, KpiPublicOpinionExcel.class);
}
@GetMapping("exportTemplate")
public void exportTemplate(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<KpiPublicOpinionDTO> list = kpiPublicOpinionService.exportTemplate(params);
ExcelUtils.exportExcelToTarget(response, null, list, KpiPublicOpinionExcel.class);
}
/**
* @Description: 导入治理排行管理-舆论监督打分
* @Param: [file]
* @return: Result
* @Author: wanggongfeng
* @Date: 2020-06-17
*/
@PostMapping("importManualScoreExcel")
public Result importManualScoreExcel(@RequestParam("file") MultipartFile file) {
return kpiPublicOpinionService.importManualScoreExcel(file);
}
}

95
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiTypicalCultureController.java

@ -0,0 +1,95 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.dto.KpiTypicalCultureDTO;
import com.elink.esua.epdc.excel.KpiTypicalCultureExcel;
import com.elink.esua.epdc.service.KpiTypicalCultureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 典型培树
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@RestController
@RequestMapping("kpitypicalculture")
public class KpiTypicalCultureController {
@Autowired
private KpiTypicalCultureService kpiTypicalCultureService;
@GetMapping("page")
public Result<PageData<KpiTypicalCultureDTO>> page(@RequestParam Map<String, Object> params){
//PageData<KpiTypicalCultureDTO> page = kpiTypicalCultureService.page(params);
PageData<KpiTypicalCultureDTO> page = kpiTypicalCultureService.getInfoPage(params);
return new Result<PageData<KpiTypicalCultureDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<KpiTypicalCultureDTO> get(@PathVariable("id") String id){
KpiTypicalCultureDTO data = kpiTypicalCultureService.get(id);
return new Result<KpiTypicalCultureDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody KpiTypicalCultureDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
kpiTypicalCultureService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody KpiTypicalCultureDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
kpiTypicalCultureService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
kpiTypicalCultureService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<KpiTypicalCultureDTO> list = kpiTypicalCultureService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, KpiTypicalCultureExcel.class);
}
}

50
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiGridEntityDao.java

@ -0,0 +1,50 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.KpiGridEntityDTO;
import com.elink.esua.epdc.dto.form.CheckIsScoredFormDTO;
import com.elink.esua.epdc.entity.KpiGridEntityEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
* 网格实体化运作打分
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Mapper
public interface KpiGridEntityDao extends BaseDao<KpiGridEntityEntity> {
/**
* 条件查询
* @param params
* @return
*/
List<KpiGridEntityDTO> getInfoPage(Map<String, Object> params);
/**
* 条件查询
* @param checkIsScoredFormDTO
* @return
*/
List<KpiGridEntityDTO> getDuplicateData(CheckIsScoredFormDTO checkIsScoredFormDTO);
}

50
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiMassEvaluationDao.java

@ -0,0 +1,50 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.KpiMassEvaluationDTO;
import com.elink.esua.epdc.dto.form.CheckIsScoredByYearFormDTO;
import com.elink.esua.epdc.entity.KpiMassEvaluationEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
* 群众评价打分表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Mapper
public interface KpiMassEvaluationDao extends BaseDao<KpiMassEvaluationEntity> {
/**
* 条件查询
* @param params
* @return
*/
List<KpiMassEvaluationDTO> getInfoPage(Map<String, Object> params);
/**
* 条件查询
* @param checkIsScoredByYearFormDTO
* @return
*/
List<KpiMassEvaluationDTO> getDuplicateData(CheckIsScoredByYearFormDTO checkIsScoredByYearFormDTO);
}

42
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiMattersResponseDao.java

@ -0,0 +1,42 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.KpiMattersResponseDTO;
import com.elink.esua.epdc.entity.KpiMattersResponseEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
* 响应率打分表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Mapper
public interface KpiMattersResponseDao extends BaseDao<KpiMattersResponseEntity> {
/**
* 条件查询
* @param params
* @return
*/
List<KpiMattersResponseDTO> getInfoPage(Map<String, Object> params);
}

50
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiPublicOpinionDao.java

@ -0,0 +1,50 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.KpiPublicOpinionDTO;
import com.elink.esua.epdc.dto.form.CheckIsScoredFormDTO;
import com.elink.esua.epdc.entity.KpiPublicOpinionEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
* 舆论监督打分表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Mapper
public interface KpiPublicOpinionDao extends BaseDao<KpiPublicOpinionEntity> {
/**
* 条件查询
* @param params
* @return
*/
List<KpiPublicOpinionDTO> getInfoPage(Map<String, Object> params);
/**
* 条件查询
* @param checkIsScoredFormDTO
* @return
*/
List<KpiPublicOpinionDTO> getDuplicateData(CheckIsScoredFormDTO checkIsScoredFormDTO);
}

42
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiTypicalCultureDao.java

@ -0,0 +1,42 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.KpiTypicalCultureDTO;
import com.elink.esua.epdc.entity.KpiTypicalCultureEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
* 典型培树
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Mapper
public interface KpiTypicalCultureDao extends BaseDao<KpiTypicalCultureEntity> {
/**
* 条件查询
* @param params
* @return
*/
List<KpiTypicalCultureDTO> getInfoPage(Map<String, Object> params);
}

93
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiGridEntityEntity.java

@ -0,0 +1,93 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 网格实体化运作打分
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_kpi_grid_entity")
public class KpiGridEntityEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 部门id
*/
private String deptId;
/**
* 部门名称
*/
private String deptName;
/**
* 部门类别
*/
private String deptTypeKey;
/**
* 年月
*/
private String monthYear;
/**
* 建站达标
*/
private String stationEstablishment;
/**
* 人员配备
*/
private String staffingPlacement;
/**
* 网格运行
*/
private String gridOperation;
/**
* 上级部门id
*/
private String parentDeptIds;
/**
* 上级部门名称
*/
private String parentDeptNames;
/**
* 所有部门id
*/
private String allDeptIds;
/**
* 所有部门名称
*/
private String allDeptNames;
}

96
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiMassEvaluationEntity.java

@ -0,0 +1,96 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 群众评价打分表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_kpi_mass_evaluation")
public class KpiMassEvaluationEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 部门id
*/
private String deptId;
/**
* 部门名称
*/
private String deptName;
/**
* 部门类别
*/
private String deptTypeKey;
/**
*
*/
private String year;
/**
* 满意
*/
private String satisfied;
/**
* 基本满意
*/
private String basicSatisfaction;
/**
* 不满意
*/
private String dissatisfied;
/**
* 上级部门id
*/
private String parentDeptIds;
/**
* 上级部门名称
*/
private String parentDeptNames;
/**
* 所有部门id
*/
private String allDeptIds;
/**
* 所有部门名称
*/
private String allDeptNames;
}

92
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiMattersResponseEntity.java

@ -0,0 +1,92 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;
/**
* 响应率打分表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_kpi_matters_response")
public class KpiMattersResponseEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 部门id
*/
private String deptId;
/**
* 部门名称
*/
private String deptName;
/**
* 部门类别
*/
private String deptTypeKey;
/**
* 年月
*/
private String monthYear;
/**
* 扣分类别
*/
private String deductionCategory;
/**
* 扣分分值
*/
private BigDecimal deduction;
/**
* 上级部门id
*/
private String parentDeptIds;
/**
* 上级部门名称
*/
private String parentDeptNames;
/**
* 所有部门id
*/
private String allDeptIds;
/**
* 所有部门名称
*/
private String allDeptNames;
}

96
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiPublicOpinionEntity.java

@ -0,0 +1,96 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 舆论监督打分表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_kpi_public_opinion")
public class KpiPublicOpinionEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 部门id
*/
private String deptId;
/**
* 部门名称
*/
private String deptName;
/**
* 部门类别
*/
private String deptTypeKey;
/**
* 年月
*/
private String monthYear;
/**
* 宣传基础
*/
private String publicityFoundation;
/**
* 创新突破
*/
private String innovationBreakthrough;
/**
* 舆情应对
*/
private String publicOpinionResponse;
/**
* 上级部门id
*/
private String parentDeptIds;
/**
* 上级部门名称
*/
private String parentDeptNames;
/**
* 所有部门id
*/
private String allDeptIds;
/**
* 所有部门名称
*/
private String allDeptNames;
}

93
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiTypicalCultureEntity.java

@ -0,0 +1,93 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 典型培树
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_kpi_typical_culture")
public class KpiTypicalCultureEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 部门id
*/
private String deptId;
/**
* 部门名称
*/
private String deptName;
/**
* 部门类别
*/
private String deptTypeKey;
/**
*
*/
private String year;
/**
* 加分类别
*/
private String bonusCategory;
/**
* 加分分值
*/
private String bonus;
/**
* 加分级别
*/
private String bonusLevel;
/**
* 上级部门id
*/
private String parentDeptIds;
/**
* 上级部门名称
*/
private String parentDeptNames;
/**
* 所有部门id
*/
private String allDeptIds;
/**
* 所有部门名称
*/
private String allDeptNames;
}

87
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiGridEntityExcel.java

@ -0,0 +1,87 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
/**
* 网格实体化运作打分
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Data
public class KpiGridEntityExcel {
// @Excel(name = "主键")
// private String id;
@Excel(name = "部门id")
private String deptId;
@Excel(name = "部门名称")
private String deptName;
@Excel(name = "部门类别")
private String deptTypeKey;
@Excel(name = "年月")
private String monthYear;
@Excel(name = "建站达标分数")
private String stationEstablishment;
@Excel(name = "人员配备分数")
private String staffingPlacement;
@Excel(name = "网格运行分数")
private String gridOperation;
// @Excel(name = "上级部门id")
// private String parentDeptIds;
//
// @Excel(name = "上级部门名称")
// private String parentDeptNames;
//
// @Excel(name = "所有部门id")
// private String allDeptIds;
//
// @Excel(name = "所有部门名称")
// private String allDeptNames;
//
// @Excel(name = "乐观锁")
// private Integer revision;
//
// @Excel(name = "创建人")
// private String createdBy;
//
// @Excel(name = "创建时间")
// private Date createdTime;
//
// @Excel(name = "更新人")
// private String updatedBy;
//
// @Excel(name = "更新时间")
// private Date updatedTime;
//
// @Excel(name = "逻辑删除标识")
// private String delFlag;
}

87
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiMassEvaluationExcel.java

@ -0,0 +1,87 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
/**
* 群众评价打分表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Data
public class KpiMassEvaluationExcel {
// @Excel(name = "主键")
// private String id;
@Excel(name = "部门id")
private String deptId;
@Excel(name = "部门名称")
private String deptName;
@Excel(name = "部门类别")
private String deptTypeKey;
@Excel(name = "年")
private String year;
@Excel(name = "满意分数")
private String satisfied;
@Excel(name = "基本满意分数")
private String basicSatisfaction;
@Excel(name = "不满意分数")
private String dissatisfied;
// @Excel(name = "上级部门id")
// private String parentDeptIds;
//
// @Excel(name = "上级部门名称")
// private String parentDeptNames;
//
// @Excel(name = "所有部门id")
// private String allDeptIds;
//
// @Excel(name = "所有部门名称")
// private String allDeptNames;
//
// @Excel(name = "乐观锁")
// private Integer revision;
//
// @Excel(name = "创建人")
// private String createdBy;
//
// @Excel(name = "创建时间")
// private Date createdTime;
//
// @Excel(name = "更新人")
// private String updatedBy;
//
// @Excel(name = "更新时间")
// private Date updatedTime;
//
// @Excel(name = "逻辑删除标识")
// private String delFlag;
}

87
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiMattersResponseExcel.java

@ -0,0 +1,87 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* 响应率打分表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Data
public class KpiMattersResponseExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "部门id")
private String deptId;
@Excel(name = "部门名称")
private String deptName;
@Excel(name = "部门类别")
private String deptTypeKey;
@Excel(name = "年月")
private String monthYear;
@Excel(name = "扣分类别")
private String deductionCategory;
@Excel(name = "扣分分值")
private BigDecimal deduction;
@Excel(name = "上级部门id")
private String parentDeptIds;
@Excel(name = "上级部门名称")
private String parentDeptNames;
@Excel(name = "所有部门id")
private String allDeptIds;
@Excel(name = "所有部门名称")
private String allDeptNames;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
@Excel(name = "逻辑删除标识")
private String delFlag;
}

87
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiPublicOpinionExcel.java

@ -0,0 +1,87 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
/**
* 舆论监督打分表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Data
public class KpiPublicOpinionExcel {
// @Excel(name = "主键")
// private String id;
@Excel(name = "部门id")
private String deptId;
@Excel(name = "部门名称")
private String deptName;
@Excel(name = "部门类别")
private String deptTypeKey;
@Excel(name = "年月")
private String monthYear;
@Excel(name = "宣传基础")
private String publicityFoundation;
@Excel(name = "创新突破")
private String innovationBreakthrough;
@Excel(name = "舆情应对")
private String publicOpinionResponse;
// @Excel(name = "上级部门id")
// private String parentDeptIds;
//
// @Excel(name = "上级部门名称")
// private String parentDeptNames;
//
// @Excel(name = "所有部门id")
// private String allDeptIds;
//
// @Excel(name = "所有部门名称")
// private String allDeptNames;
//
// @Excel(name = "乐观锁")
// private Integer revision;
//
// @Excel(name = "创建人")
// private String createdBy;
//
// @Excel(name = "创建时间")
// private Date createdTime;
//
// @Excel(name = "更新人")
// private String updatedBy;
//
// @Excel(name = "更新时间")
// private Date updatedTime;
//
// @Excel(name = "逻辑删除标识")
// private String delFlag;
}

89
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/excel/KpiTypicalCultureExcel.java

@ -0,0 +1,89 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 典型培树
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Data
public class KpiTypicalCultureExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "部门id")
private String deptId;
@Excel(name = "部门名称")
private String deptName;
@Excel(name = "部门类别")
private String deptTypeKey;
@Excel(name = "年")
private String year;
@Excel(name = "加分类别")
private String bonusCategory;
@Excel(name = "加分分值")
private String bonus;
@Excel(name = "加分级别")
private String bonusLevel;
@Excel(name = "上级部门id")
private String parentDeptIds;
@Excel(name = "上级部门名称")
private String parentDeptNames;
@Excel(name = "所有部门id")
private String allDeptIds;
@Excel(name = "所有部门名称")
private String allDeptNames;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
@Excel(name = "逻辑删除标识")
private String delFlag;
}

4
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java

@ -6,7 +6,7 @@ import com.elink.esua.epdc.dto.DeptLevelAndLeaderDTO;
import com.elink.esua.epdc.dto.SysDeptDTO;
import com.elink.esua.epdc.dto.epdc.form.ExportTemplateInfoFormDTO;
import com.elink.esua.epdc.dto.epdc.form.UserSysDeptInfoFormDTO;
import com.elink.esua.epdc.dto.epdc.result.ExportTemplateInfoResultDTO;
import com.elink.esua.epdc.dto.epdc.result.ExportKpiResultDTO;
import com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO;
import com.elink.esua.epdc.feign.fallback.AdminFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
@ -104,5 +104,5 @@ public interface AdminFeignClient {
* @Date: 2020-06-15
*/
@PostMapping("/sys/dept/getExportTemplateInfo")
Result<List<ExportTemplateInfoResultDTO>> getExportTemplateInfo(ExportTemplateInfoFormDTO exportTemplateInfoFormDTO);
Result<List<ExportKpiResultDTO>> getExportTemplateInfo(ExportTemplateInfoFormDTO exportTemplateInfoFormDTO);
}

4
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java

@ -7,7 +7,7 @@ import com.elink.esua.epdc.dto.DeptLevelAndLeaderDTO;
import com.elink.esua.epdc.dto.SysDeptDTO;
import com.elink.esua.epdc.dto.epdc.form.ExportTemplateInfoFormDTO;
import com.elink.esua.epdc.dto.epdc.form.UserSysDeptInfoFormDTO;
import com.elink.esua.epdc.dto.epdc.result.ExportTemplateInfoResultDTO;
import com.elink.esua.epdc.dto.epdc.result.ExportKpiResultDTO;
import com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO;
import com.elink.esua.epdc.feign.AdminFeignClient;
import org.springframework.stereotype.Component;
@ -59,7 +59,7 @@ public class AdminFeignClientFallback implements AdminFeignClient {
}
@Override
public Result<List<ExportTemplateInfoResultDTO>> getExportTemplateInfo(ExportTemplateInfoFormDTO exportTemplateInfoFormDTO) {
public Result<List<ExportKpiResultDTO>> getExportTemplateInfo(ExportTemplateInfoFormDTO exportTemplateInfoFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getExportTemplateInfo", exportTemplateInfoFormDTO);
}

47
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiGridEntityRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 网格实体化运作打分
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Component
public class KpiGridEntityRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

47
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiMassEvaluationRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 群众评价打分表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Component
public class KpiMassEvaluationRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

47
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiMattersResponseRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 响应率打分表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Component
public class KpiMattersResponseRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

47
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiPublicOpinionRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 舆论监督打分表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Component
public class KpiPublicOpinionRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

47
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiTypicalCultureRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 典型培树
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Component
public class KpiTypicalCultureRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

2
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiCommunityBuildingService.java

@ -113,7 +113,7 @@ public interface KpiCommunityBuildingService extends BaseService<KpiCommunityBui
List<KpiCommunityBuildingDTO> exportTemplate(Map<String, Object> params);
/**
* 网格建设打分导入
* 社区建设打分导入
*
* @param file
* @return Result

124
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiGridEntityService.java

@ -0,0 +1,124 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.KpiGridEntityDTO;
import com.elink.esua.epdc.entity.KpiGridEntityEntity;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
import java.util.Map;
/**
* 网格实体化运作打分
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
public interface KpiGridEntityService extends BaseService<KpiGridEntityEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<KpiGridEntityDTO>
* @author generator
* @date 2020-06-16
*/
PageData<KpiGridEntityDTO> page(Map<String, Object> params);
/**
* 分页条件查询
* @param params
* @return
*/
PageData<KpiGridEntityDTO> getInfoPage(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<KpiGridEntityDTO>
* @author generator
* @date 2020-06-16
*/
List<KpiGridEntityDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return KpiGridEntityDTO
* @author generator
* @date 2020-06-16
*/
KpiGridEntityDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-06-16
*/
void save(KpiGridEntityDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-06-16
*/
void update(KpiGridEntityDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-06-16
*/
void delete(String[] ids);
/**
* 导出模板
*
* @param params
* @return java.util.List<KpiGridEntityDTO>
* @author wanggongfeng
* @date 2020-06-16
*/
List<KpiGridEntityDTO> exportTemplate(Map<String, Object> params);
/**
* 网格实体化运作打分导入
*
* @param file
* @return Result
* @author wanggongfeng
* @date 2020-06-16
*/
Result importManualScoreExcel(MultipartFile file);
}

124
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiMassEvaluationService.java

@ -0,0 +1,124 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.KpiMassEvaluationDTO;
import com.elink.esua.epdc.entity.KpiMassEvaluationEntity;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
import java.util.Map;
/**
* 群众评价打分表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
public interface KpiMassEvaluationService extends BaseService<KpiMassEvaluationEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<KpiMassEvaluationDTO>
* @author generator
* @date 2020-06-16
*/
PageData<KpiMassEvaluationDTO> page(Map<String, Object> params);
/**
* 分页条件查询
* @param params
* @return
*/
PageData<KpiMassEvaluationDTO> getInfoPage(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<KpiMassEvaluationDTO>
* @author generator
* @date 2020-06-16
*/
List<KpiMassEvaluationDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return KpiMassEvaluationDTO
* @author generator
* @date 2020-06-16
*/
KpiMassEvaluationDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-06-16
*/
void save(KpiMassEvaluationDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-06-16
*/
void update(KpiMassEvaluationDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-06-16
*/
void delete(String[] ids);
/**
* 导出模板
*
* @param params
* @return java.util.List<KpiCommunityBuildingDTO>
* @author wanggongfeng
* @date 2020-06-15
*/
List<KpiMassEvaluationDTO> exportTemplate(Map<String, Object> params);
/**
* 群众评价打分导入
*
* @param file
* @return Result
* @author wanggongfeng
* @date 2020-06-17
*/
Result importManualScoreExcel(MultipartFile file);
}

103
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiMattersResponseService.java

@ -0,0 +1,103 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.dto.KpiCommunityBuildingDTO;
import com.elink.esua.epdc.dto.KpiMattersResponseDTO;
import com.elink.esua.epdc.entity.KpiMattersResponseEntity;
import java.util.List;
import java.util.Map;
/**
* 响应率打分表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
public interface KpiMattersResponseService extends BaseService<KpiMattersResponseEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<KpiMattersResponseDTO>
* @author generator
* @date 2020-06-16
*/
PageData<KpiMattersResponseDTO> page(Map<String, Object> params);
/**
* 分页条件查询
* @param params
* @return
*/
PageData<KpiMattersResponseDTO> getInfoPage(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<KpiMattersResponseDTO>
* @author generator
* @date 2020-06-16
*/
List<KpiMattersResponseDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return KpiMattersResponseDTO
* @author generator
* @date 2020-06-16
*/
KpiMattersResponseDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-06-16
*/
void save(KpiMattersResponseDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-06-16
*/
void update(KpiMattersResponseDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-06-16
*/
void delete(String[] ids);
}

124
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiPublicOpinionService.java

@ -0,0 +1,124 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.KpiPublicOpinionDTO;
import com.elink.esua.epdc.entity.KpiPublicOpinionEntity;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
import java.util.Map;
/**
* 舆论监督打分表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
public interface KpiPublicOpinionService extends BaseService<KpiPublicOpinionEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<KpiPublicOpinionDTO>
* @author generator
* @date 2020-06-16
*/
PageData<KpiPublicOpinionDTO> page(Map<String, Object> params);
/**
* 分页条件查询
* @param params
* @return
*/
PageData<KpiPublicOpinionDTO> getInfoPage(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<KpiPublicOpinionDTO>
* @author generator
* @date 2020-06-16
*/
List<KpiPublicOpinionDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return KpiPublicOpinionDTO
* @author generator
* @date 2020-06-16
*/
KpiPublicOpinionDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-06-16
*/
void save(KpiPublicOpinionDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-06-16
*/
void update(KpiPublicOpinionDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-06-16
*/
void delete(String[] ids);
/**
* 导出模板
*
* @param params
* @return java.util.List<KpiCommunityBuildingDTO>
* @author wanggongfeng
* @date 2020-06-15
*/
List<KpiPublicOpinionDTO> exportTemplate(Map<String, Object> params);
/**
* 舆论监督打分导入
*
* @param file
* @return Result
* @author wanggongfeng
* @date 2020-06-17
*/
Result importManualScoreExcel(MultipartFile file);
}

102
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiTypicalCultureService.java

@ -0,0 +1,102 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.dto.KpiTypicalCultureDTO;
import com.elink.esua.epdc.entity.KpiTypicalCultureEntity;
import java.util.List;
import java.util.Map;
/**
* 典型培树
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
public interface KpiTypicalCultureService extends BaseService<KpiTypicalCultureEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<KpiTypicalCultureDTO>
* @author generator
* @date 2020-06-16
*/
PageData<KpiTypicalCultureDTO> page(Map<String, Object> params);
/**
* 分页条件查询
* @param params
* @return
*/
PageData<KpiTypicalCultureDTO> getInfoPage(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<KpiTypicalCultureDTO>
* @author generator
* @date 2020-06-16
*/
List<KpiTypicalCultureDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return KpiTypicalCultureDTO
* @author generator
* @date 2020-06-16
*/
KpiTypicalCultureDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-06-16
*/
void save(KpiTypicalCultureDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-06-16
*/
void update(KpiTypicalCultureDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-06-16
*/
void delete(String[] ids);
}

134
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiCommunityBuildingServiceImpl.java

@ -31,13 +31,15 @@ import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser;
import com.elink.esua.epdc.commons.tools.security.user.UserDetail;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.utils.DateUtils;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dao.KpiCommunityBuildingDao;
import com.elink.esua.epdc.dto.DeptLevelAndLeaderDTO;
import com.elink.esua.epdc.dto.KpiCommunityBuildingDTO;
import com.elink.esua.epdc.dto.SysDeptDTO;
import com.elink.esua.epdc.dto.epdc.form.ExportTemplateInfoFormDTO;
import com.elink.esua.epdc.dto.epdc.result.ExportTemplateInfoResultDTO;
import com.elink.esua.epdc.dto.epdc.result.ExportKpiResultDTO;
import com.elink.esua.epdc.dto.form.CheckIsScoredFormDTO;
import com.elink.esua.epdc.entity.KpiCommunityBuildingEntity;
import com.elink.esua.epdc.excel.KpiCommunityBuildingExcel;
@ -53,10 +55,10 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 网格建设打分表
@ -128,7 +130,7 @@ public class KpiCommunityBuildingServiceImpl extends BaseServiceImpl<KpiCommunit
List<String> checkList = new ArrayList<String>();
checkList.add(deptId);
// 判断录入月份是否为当前月或者前一个月
if(!dto.getMonthYear().equals(getLastMonth()) && !dto.getMonthYear().equals(getCurrentMonth())){
if(!dto.getMonthYear().equals(DateUtils.getLastMonth()) && !dto.getMonthYear().equals(DateUtils.getCurrentMonth())){
throw new RenException("只能对当前月份或者上个月份进行打分,请维护后重试!");
}
// 检测excel中是否存在已打分部门
@ -175,13 +177,13 @@ public class KpiCommunityBuildingServiceImpl extends BaseServiceImpl<KpiCommunit
exportTemplateInfoFormDTO.setDeptId(params.get("deptId") == null ? "" : params.get("deptId").toString());
exportTemplateInfoFormDTO.setDeptTypeKey(params.get("deptTypeKey") == null ? "" : params.get("deptTypeKey").toString());
exportTemplateInfoFormDTO.setMonthYear(params.get("monthYear") == null ? "" : params.get("monthYear").toString());
Result<List<ExportTemplateInfoResultDTO>> result = adminFeignClient.getExportTemplateInfo(exportTemplateInfoFormDTO);
List<ExportTemplateInfoResultDTO> resultList = result.getData();
Result<List<ExportKpiResultDTO>> result = adminFeignClient.getExportTemplateInfo(exportTemplateInfoFormDTO);
List<ExportKpiResultDTO> resultList = result.getData();
return ConvertUtils.sourceToTarget(resultList, KpiCommunityBuildingDTO.class);
}
/**
* @Description: 导入治理排行管理-手动打分记录
* @Description: 导入治理排行管理-社区建设打分
* @Param: [file]
* @return: Result
* @Author: wanggongfeng
@ -237,7 +239,7 @@ public class KpiCommunityBuildingServiceImpl extends BaseServiceImpl<KpiCommunit
checkInfo.append(splicingErrorDeptName(i,kpiCommunityBuildingExcel,recordList));
}
// 判断导入月份是否为当前月或者前一个月
if(!monthYear.equals(getLastMonth()) && !monthYear.equals(getCurrentMonth())){
if(!monthYear.equals(DateUtils.getLastMonth()) && !monthYear.equals(DateUtils.getCurrentMonth())){
return new Result().error("只能对当前月份或者上个月份进行打分,请维护后重试!");
}
// 校验部门ID是否存在当前用户权限内
@ -250,7 +252,7 @@ public class KpiCommunityBuildingServiceImpl extends BaseServiceImpl<KpiCommunit
return new Result().error(deptErrorInfo + " 已打分, 不可重复打分!");
}
// 循环插入网格建设打分数据(必要时可改为批量插入)
// 插入社区建设打分数据(必要时可改为批量插入)
/*KpiCommunityBuildingEntity[] kpiCommunityBuildingEntities = new KpiCommunityBuildingEntity[recordList.size()];
for(int i = 0 ; i < recordList.size() ; i++){
KpiCommunityBuildingExcel kpiCommunityBuildingExcel = recordList.get(i);
@ -266,7 +268,7 @@ public class KpiCommunityBuildingServiceImpl extends BaseServiceImpl<KpiCommunit
return new Result().error("数据异常,解析excel文件失败");
} finally {
// 删除文件
this.deleteAllFilesOfDir(f);
ExcelUtils.deleteAllFilesOfDir(f);
}
return new Result();
}
@ -313,70 +315,30 @@ public class KpiCommunityBuildingServiceImpl extends BaseServiceImpl<KpiCommunit
private Boolean checkScoreCell(KpiCommunityBuildingExcel kpiCommunityBuildingExcel){
// 民主协商机制分数(3分)
String democraticConsultationMechanism = kpiCommunityBuildingExcel.getDemocraticConsultationMechanism();
if(checkNumber(democraticConsultationMechanism)){
if(ExcelUtils.checkNumber(democraticConsultationMechanism)){
return true;
}
Double democraticConsultationMechanismInt = Double.parseDouble(democraticConsultationMechanism);
Double democraticConsultationMechanismDouble = Double.parseDouble(democraticConsultationMechanism);
// 网格协商案例分数(4分)
String gridNegotiationCase = kpiCommunityBuildingExcel.getGridNegotiationCase();
if(checkNumber(gridNegotiationCase)){
if(ExcelUtils.checkNumber(gridNegotiationCase)){
return true;
}
Double gridNegotiationCaseInt = Double.parseDouble(gridNegotiationCase);
Double gridNegotiationCaseDouble = Double.parseDouble(gridNegotiationCase);
// 居民公约制度分数(3分)
String residentConventionSystem = kpiCommunityBuildingExcel.getResidentConventionSystem();
if(checkNumber(residentConventionSystem)){
if(ExcelUtils.checkNumber(residentConventionSystem)){
return true;
}
Double residentConventionSystemInt = Double.parseDouble(residentConventionSystem);
if(democraticConsultationMechanismInt < 0 || democraticConsultationMechanismInt > 3
|| gridNegotiationCaseInt < 0 || gridNegotiationCaseInt > 4
|| residentConventionSystemInt < 0 || residentConventionSystemInt > 3){
Double residentConventionSystemDouble = Double.parseDouble(residentConventionSystem);
if(democraticConsultationMechanismDouble < 0 || democraticConsultationMechanismDouble > 3
|| gridNegotiationCaseDouble < 0 || gridNegotiationCaseDouble > 4
|| residentConventionSystemDouble < 0 || residentConventionSystemDouble > 3){
return true;
}
return false;
}
/**
* 校验是否为数字字符串
* @param numStr
* @return
*/
private Boolean checkNumber(String numStr){
Pattern pattern = Pattern.compile("([1-9]\\d*\\.?\\d*)|(0\\.\\d*[1-9])");
Matcher isNum = pattern.matcher(numStr);
if( !isNum.matches() ){
return true;
}
return false;
}
/**
* 获取上一个月字符串yyyy-MM
* @return
*/
public String getLastMonth() {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM");
Date date = new Date();
Calendar calendar = Calendar.getInstance();
calendar.setTime(date); // 设置为当前时间
calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) - 1); // 设置为上一个月
date = calendar.getTime();
String accDate = format.format(date);
return accDate;
}
/**
* 获取当前月字符串yyyy-MM
* @return
*/
public String getCurrentMonth() {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM");
Date date = new Date();
String currentDate = format.format(date);
return currentDate;
}
/**
* 拼接已打分部门提示信息
* @param checkList
@ -400,7 +362,7 @@ public class KpiCommunityBuildingServiceImpl extends BaseServiceImpl<KpiCommunit
}
/**
* 拼接网格建设打分实体
* 拼接社区建设打分实体
* @param kpiCommunityBuildingExcel
* @return
*/
@ -430,52 +392,4 @@ public class KpiCommunityBuildingServiceImpl extends BaseServiceImpl<KpiCommunit
return entity;
}
/**
* 获取19位随机数
* @return
*/
/*public String getLongRandom(){
Guid+=1;
long now = System.currentTimeMillis();
SimpleDateFormat dateFormat=new SimpleDateFormat("MMdd");
String time=dateFormat.format(now);
String currentTimeMillis=now+"";
int ran=0;
if(Guid>999){
Guid=100;
}
ran=Guid;
String str = time+currentTimeMillis.substring(1, currentTimeMillis.length())+ran;
return str;
}*/
/**
* 删除文件夹强制删除
*
* @param path
*/
private void deleteAllFilesOfDir(File path) {
if (null != path) {
if (!path.exists()) {
return;
}
if (path.isFile()) {
boolean result = path.delete();
int tryCount = 0;
while (!result && tryCount++ < 10) {
System.gc(); // 回收资源
result = path.delete();
}
}
File[] files = path.listFiles();
if (null != files) {
for (int i = 0; i < files.length; i++) {
deleteAllFilesOfDir(files[i]);
}
}
path.delete();
}
}
}

377
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiGridEntityServiceImpl.java

@ -0,0 +1,377 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.service.impl;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.constant.StrConstant;
import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum;
import com.elink.esua.epdc.commons.tools.exception.RenException;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser;
import com.elink.esua.epdc.commons.tools.security.user.UserDetail;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.utils.DateUtils;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dao.KpiGridEntityDao;
import com.elink.esua.epdc.dto.DeptLevelAndLeaderDTO;
import com.elink.esua.epdc.dto.KpiGridEntityDTO;
import com.elink.esua.epdc.dto.SysDeptDTO;
import com.elink.esua.epdc.dto.epdc.form.ExportTemplateInfoFormDTO;
import com.elink.esua.epdc.dto.epdc.result.ExportKpiResultDTO;
import com.elink.esua.epdc.dto.form.CheckIsScoredFormDTO;
import com.elink.esua.epdc.entity.KpiGridEntityEntity;
import com.elink.esua.epdc.excel.KpiGridEntityExcel;
import com.elink.esua.epdc.feign.AdminFeignClient;
import com.elink.esua.epdc.redis.KpiGridEntityRedis;
import com.elink.esua.epdc.service.KpiGridEntityService;
import com.elink.esua.epdc.utils.DeptUtils;
import com.elink.esua.epdc.utils.StreamUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 网格实体化运作打分
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Service
public class KpiGridEntityServiceImpl extends BaseServiceImpl<KpiGridEntityDao, KpiGridEntityEntity> implements KpiGridEntityService {
@Autowired
private KpiGridEntityRedis kpiGridEntityRedis;
@Autowired
private AdminFeignClient adminFeignClient;
@Autowired
private DeptUtils deptUtils;
@Override
public PageData<KpiGridEntityDTO> page(Map<String, Object> params) {
IPage<KpiGridEntityEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, KpiGridEntityDTO.class);
}
/**
* 条件查询
* @param params
* @return
*/
@Override
public PageData<KpiGridEntityDTO> getInfoPage(Map<String, Object> params) {
IPage<KpiGridEntityDTO> page = getPage(params);
List<KpiGridEntityDTO> list = baseDao.getInfoPage(params);
return new PageData<>(list, page.getTotal());
}
@Override
public List<KpiGridEntityDTO> list(Map<String, Object> params) {
List<KpiGridEntityEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, KpiGridEntityDTO.class);
}
private QueryWrapper<KpiGridEntityEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<KpiGridEntityEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public KpiGridEntityDTO get(String id) {
KpiGridEntityEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, KpiGridEntityDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(KpiGridEntityDTO dto) {
String deptId = dto.getDeptId();
List<String> checkList = new ArrayList<String>();
checkList.add(deptId);
// 判断录入月份是否为当前月或者前一个月
if(!dto.getMonthYear().equals(DateUtils.getLastMonth()) && !dto.getMonthYear().equals(DateUtils.getCurrentMonth())){
throw new RenException("只能对当前月份或者上个月份进行打分,请维护后重试!");
}
// 检测excel中是否存在已打分部门
StringBuffer deptErrorInfo = this.getDuplicateData(checkList,dto.getMonthYear());
if (deptErrorInfo.length() > 0) {
throw new RenException(deptErrorInfo + " 已打分, 不可重复打分!");
}
// 查询机构类型键值
Result<SysDeptDTO> result = adminFeignClient.get(Long.valueOf(deptId));
SysDeptDTO sysDeptDTO = result.getData();
// 设置部门类别
dto.setDeptTypeKey(sysDeptDTO.getTypeKey());
KpiGridEntityEntity entity = ConvertUtils.sourceToTarget(dto, KpiGridEntityEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(KpiGridEntityDTO dto) {
KpiGridEntityEntity entity = ConvertUtils.sourceToTarget(dto, KpiGridEntityEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* 拼接已打分部门提示信息
* @param checkList
* @return
*/
private StringBuffer getDuplicateData(List<String> checkList ,String monthYear){
CheckIsScoredFormDTO checkIsScoredFormDTO = new CheckIsScoredFormDTO();
checkIsScoredFormDTO.setCheckList(checkList);
checkIsScoredFormDTO.setMonthYear(monthYear);
StringBuffer deptErrorInfo = new StringBuffer();
List<KpiGridEntityDTO> list = baseDao.getDuplicateData(checkIsScoredFormDTO);
for(int i = 0 ; i < list.size() ; i++){
KpiGridEntityDTO kpiGridEntityDTO = list.get(i);
if(i == (list.size()-1)){
deptErrorInfo.append(kpiGridEntityDTO.getDeptName());
}else{
deptErrorInfo.append(kpiGridEntityDTO.getDeptName()).append("、");
}
}
return deptErrorInfo;
}
/**
* 获取导出模板
*
* @param params
* @return java.util.List<KpiGridEntityDTO>
* @author wanggongfeng
* @date 2020-06-16
*/
@Override
public List<KpiGridEntityDTO> exportTemplate(Map<String, Object> params) {
List<Long> deptIdList = SecurityUser.getUser().getDeptIdList(); //获取用户权限
ExportTemplateInfoFormDTO exportTemplateInfoFormDTO = new ExportTemplateInfoFormDTO();
exportTemplateInfoFormDTO.setDeptIdList(deptIdList);
exportTemplateInfoFormDTO.setDeptId(params.get("deptId") == null ? "" : params.get("deptId").toString());
exportTemplateInfoFormDTO.setDeptTypeKey(params.get("deptTypeKey") == null ? "" : params.get("deptTypeKey").toString());
exportTemplateInfoFormDTO.setMonthYear(params.get("monthYear") == null ? "" : params.get("monthYear").toString());
Result<List<ExportKpiResultDTO>> result = adminFeignClient.getExportTemplateInfo(exportTemplateInfoFormDTO);
List<ExportKpiResultDTO> resultList = result.getData();
return ConvertUtils.sourceToTarget(resultList, KpiGridEntityDTO.class);
}
/**
* @Description: 导入治理排行管理-网格实体化运作
* @Param: [file]
* @return: Result
* @Author: wanggongfeng
* @Date: 2020-06-16
*/
@Override
public Result importManualScoreExcel(MultipartFile file) {
File f = StreamUtils.conversionFile(file);
try {
//判断上传文件类型
String originalFilename = file.getOriginalFilename();
if (!originalFilename.endsWith(StrConstant.EXCEL_SUFFIX_2003) && !originalFilename.endsWith(StrConstant.EXCEL_SUFFIX_2007)) {
return new Result().error("请选择.xls或者.xlsx格式文件");
}
List<KpiGridEntityExcel> recordList = ExcelImportUtil.importExcel(f, KpiGridEntityExcel.class, new ImportParams());
if (CollUtil.isEmpty(recordList)) {
return new Result().error("导入内容不能为空");
}
// 存储检测excel是否存在重复ID使用
List<String> checkList = new ArrayList<String>();
StringBuffer checkInfo = new StringBuffer();
String monthYear = "";
for(int i = 0 ; i < recordList.size() ; i++){
KpiGridEntityExcel kpiGridEntityExcel = recordList.get(i);
// 校验是否存在空单元格
if(checkNullCell(kpiGridEntityExcel)){
return new Result().error("导入文件中存在空单元格,请完善后重试!");
}
// 校验是否存在分数范围不正确的打分
if(checkScoreCell(kpiGridEntityExcel)){
return new Result().error("存在不符合分值范围的分数!");
}
// 校验月份是否不一致
if(i == 0){
monthYear = kpiGridEntityExcel.getMonthYear();
}else{
if(!monthYear.equals(kpiGridEntityExcel.getMonthYear())){
return new Result().error("导入文件中月份不一致,请修改一致后重试!");
}
monthYear = kpiGridEntityExcel.getMonthYear();
}
// 校验ID是否存在重复
if(checkList.contains(kpiGridEntityExcel.getDeptId())){
return new Result().error(kpiGridEntityExcel.getDeptName() + "ID重复,请维护唯一ID后重试!");
}
checkList.add(kpiGridEntityExcel.getDeptId());
// 拼接部门ID不在当前用户权限内的部门名称
checkInfo.append(splicingErrorDeptName(i,kpiGridEntityExcel,recordList));
}
// 判断导入月份是否为当前月或者前一个月
if(!monthYear.equals(DateUtils.getLastMonth()) && !monthYear.equals(DateUtils.getCurrentMonth())){
return new Result().error("只能对当前月份或者上个月份进行打分,请维护后重试!");
}
// 校验部门ID是否存在当前用户权限内
if (checkInfo.length() > 0) {
return new Result().error(checkInfo.append("部门ID错误,请维护后重试!").toString());
}
// 检测excel中是否存在已打分部门
StringBuffer deptErrorInfo = this.getDuplicateData(checkList,monthYear);
if (deptErrorInfo.length() > 0) {
return new Result().error(deptErrorInfo + " 已打分, 不可重复打分!");
}
// 插入网格建设打分数据(必要时可改为批量插入)
for (KpiGridEntityExcel kpiGridEntityExcel : recordList) {
KpiGridEntityEntity entity = splicingEntity(kpiGridEntityExcel);
insert(entity);
}
} catch (Exception e) {
return new Result().error("数据异常,解析excel文件失败");
} finally {
// 删除文件
ExcelUtils.deleteAllFilesOfDir(f);
}
return new Result();
}
/**
* 校验是否存在空单元格
* @param kpiGridEntityExcel
* @return
*/
private Boolean checkNullCell(KpiGridEntityExcel kpiGridEntityExcel){
if(StringUtils.isBlank(kpiGridEntityExcel.getDeptId()) || StringUtils.isBlank(kpiGridEntityExcel.getDeptName()) || StringUtils.isBlank(kpiGridEntityExcel.getMonthYear())
|| StringUtils.isBlank(kpiGridEntityExcel.getStationEstablishment()) || StringUtils.isBlank(kpiGridEntityExcel.getDeptTypeKey())
|| StringUtils.isBlank(kpiGridEntityExcel.getStaffingPlacement()) || StringUtils.isBlank(kpiGridEntityExcel.getGridOperation())){
return true;
}
return false;
}
/**
* 校验分数是否规范
* @param kpiGridEntityExcel
* @return
*/
private Boolean checkScoreCell(KpiGridEntityExcel kpiGridEntityExcel){
// 建站达标分数(4分)
String stationEstablishment = kpiGridEntityExcel.getStationEstablishment();
if(ExcelUtils.checkNumber(stationEstablishment)){
return true;
}
Double stationEstablishmentDouble = Double.parseDouble(stationEstablishment);
// 人员配备分数(3分)
String staffingPlacement = kpiGridEntityExcel.getStaffingPlacement();
if(ExcelUtils.checkNumber(staffingPlacement)){
return true;
}
Double staffingPlacementDouble = Double.parseDouble(staffingPlacement);
// 网格运行分数(3分)
String gridOperation = kpiGridEntityExcel.getGridOperation();
if(ExcelUtils.checkNumber(gridOperation)){
return true;
}
Double gridOperationDouble = Double.parseDouble(gridOperation);
if(stationEstablishmentDouble < 0 || stationEstablishmentDouble > 4
|| staffingPlacementDouble < 0 || staffingPlacementDouble > 3
|| gridOperationDouble < 0 || gridOperationDouble > 3){
return true;
}
return false;
}
/**
* 拼接部门ID不在当前用户权限内的部门名称
* @param index
* @param kpiGridEntityExcel
* @param recordList
* @return
*/
private String splicingErrorDeptName(int index, KpiGridEntityExcel kpiGridEntityExcel, List<KpiGridEntityExcel> recordList){
UserDetail user = SecurityUser.getUser();
List<Long> deptIdList = user.getDeptIdList();
if(!deptIdList.contains(Long.valueOf(kpiGridEntityExcel.getDeptId()))){
if(index == (recordList.size()-1)){
return kpiGridEntityExcel.getDeptName();
}else{
return kpiGridEntityExcel.getDeptName() + "、";
}
}
return "";
}
/**
* 拼接网格建设打分实体
* @param kpiGridEntityExcel
* @return
*/
private KpiGridEntityEntity splicingEntity(KpiGridEntityExcel kpiGridEntityExcel){
KpiGridEntityEntity entity = ConvertUtils.sourceToTarget(kpiGridEntityExcel, KpiGridEntityEntity.class);
// 查询设置部门类别和部门名称
String deptId = entity.getDeptId();
Result<SysDeptDTO> result = adminFeignClient.get(Long.valueOf(deptId));
SysDeptDTO sysDeptDTO = result.getData();
entity.setDeptTypeKey(sysDeptDTO.getTypeKey());
entity.setDeptName(sysDeptDTO.getName());
// 查询设置上级部门信息
DeptLevelAndLeaderDTO deptLevelInfo = deptUtils.getDeptLevelInfo(Long.valueOf(deptId), YesOrNoEnum.YES);
entity.setAllDeptIds(deptLevelInfo.getAllDeptIds());
entity.setAllDeptNames(deptLevelInfo.getAllDeptNames());
entity.setParentDeptIds(deptLevelInfo.getParentDeptIds());
entity.setParentDeptNames(deptLevelInfo.getParentDeptNames());
return entity;
}
}

375
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiMassEvaluationServiceImpl.java

@ -0,0 +1,375 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.service.impl;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.constant.StrConstant;
import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum;
import com.elink.esua.epdc.commons.tools.exception.RenException;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser;
import com.elink.esua.epdc.commons.tools.security.user.UserDetail;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.utils.DateUtils;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dao.KpiMassEvaluationDao;
import com.elink.esua.epdc.dto.DeptLevelAndLeaderDTO;
import com.elink.esua.epdc.dto.KpiMassEvaluationDTO;
import com.elink.esua.epdc.dto.SysDeptDTO;
import com.elink.esua.epdc.dto.epdc.form.ExportTemplateInfoFormDTO;
import com.elink.esua.epdc.dto.epdc.result.ExportKpiResultDTO;
import com.elink.esua.epdc.dto.form.CheckIsScoredByYearFormDTO;
import com.elink.esua.epdc.entity.KpiMassEvaluationEntity;
import com.elink.esua.epdc.excel.KpiMassEvaluationExcel;
import com.elink.esua.epdc.feign.AdminFeignClient;
import com.elink.esua.epdc.redis.KpiMassEvaluationRedis;
import com.elink.esua.epdc.service.KpiMassEvaluationService;
import com.elink.esua.epdc.utils.DeptUtils;
import com.elink.esua.epdc.utils.StreamUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 群众评价打分表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Service
public class KpiMassEvaluationServiceImpl extends BaseServiceImpl<KpiMassEvaluationDao, KpiMassEvaluationEntity> implements KpiMassEvaluationService {
@Autowired
private KpiMassEvaluationRedis kpiMassEvaluationRedis;
@Autowired
private AdminFeignClient adminFeignClient;
@Autowired
private DeptUtils deptUtils;
@Override
public PageData<KpiMassEvaluationDTO> page(Map<String, Object> params) {
IPage<KpiMassEvaluationEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, KpiMassEvaluationDTO.class);
}
/**
* 条件查询
* @param params
* @return
*/
@Override
public PageData<KpiMassEvaluationDTO> getInfoPage(Map<String, Object> params) {
IPage<KpiMassEvaluationDTO> page = getPage(params);
List<KpiMassEvaluationDTO> list = baseDao.getInfoPage(params);
return new PageData<>(list, page.getTotal());
}
@Override
public List<KpiMassEvaluationDTO> list(Map<String, Object> params) {
List<KpiMassEvaluationEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, KpiMassEvaluationDTO.class);
}
private QueryWrapper<KpiMassEvaluationEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<KpiMassEvaluationEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public KpiMassEvaluationDTO get(String id) {
KpiMassEvaluationEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, KpiMassEvaluationDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(KpiMassEvaluationDTO dto) {
String deptId = dto.getDeptId();
List<String> checkList = new ArrayList<String>();
checkList.add(deptId);
// 判断录入年份是否为当前年份
if(!dto.getYear().equals(DateUtils.getCurrentYear())){
throw new RenException("只能对当前年份进行打分,请维护后重试!");
}
// 检测excel中是否存在已打分部门
StringBuffer deptErrorInfo = this.getDuplicateData(checkList,dto.getYear());
if (deptErrorInfo.length() > 0) {
throw new RenException(deptErrorInfo + " 已打分, 不可重复打分!");
}
// 查询机构类型键值
Result<SysDeptDTO> result = adminFeignClient.get(Long.valueOf(deptId));
SysDeptDTO sysDeptDTO = result.getData();
// 设置部门类别
dto.setDeptTypeKey(sysDeptDTO.getTypeKey());
KpiMassEvaluationEntity entity = ConvertUtils.sourceToTarget(dto, KpiMassEvaluationEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(KpiMassEvaluationDTO dto) {
KpiMassEvaluationEntity entity = ConvertUtils.sourceToTarget(dto, KpiMassEvaluationEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* 拼接已打分部门提示信息
* @param checkList
* @return
*/
private StringBuffer getDuplicateData(List<String> checkList ,String year){
CheckIsScoredByYearFormDTO checkIsScoredByYearFormDTO = new CheckIsScoredByYearFormDTO();
checkIsScoredByYearFormDTO.setCheckList(checkList);
checkIsScoredByYearFormDTO.setYear(year);
StringBuffer deptErrorInfo = new StringBuffer();
List<KpiMassEvaluationDTO> list = baseDao.getDuplicateData(checkIsScoredByYearFormDTO);
for(int i = 0 ; i < list.size() ; i++){
KpiMassEvaluationDTO kpiMassEvaluationDTO = list.get(i);
if(i == (list.size()-1)){
deptErrorInfo.append(kpiMassEvaluationDTO.getDeptName());
}else{
deptErrorInfo.append(kpiMassEvaluationDTO.getDeptName()).append("、");
}
}
return deptErrorInfo;
}
/**
* 获取导出模板
*
* @param params
* @return java.util.List<KpiCommunityBuildingDTO>
* @author wanggongfeng
* @date 2020-06-15
*/
@Override
public List<KpiMassEvaluationDTO> exportTemplate(Map<String, Object> params) {
List<Long> deptIdList = SecurityUser.getUser().getDeptIdList(); //获取用户权限
ExportTemplateInfoFormDTO exportTemplateInfoFormDTO = new ExportTemplateInfoFormDTO();
exportTemplateInfoFormDTO.setDeptIdList(deptIdList);
exportTemplateInfoFormDTO.setDeptId(params.get("deptId") == null ? "" : params.get("deptId").toString());
exportTemplateInfoFormDTO.setDeptTypeKey(params.get("deptTypeKey") == null ? "" : params.get("deptTypeKey").toString());
exportTemplateInfoFormDTO.setYear(params.get("year") == null ? "" : params.get("year").toString());
Result<List<ExportKpiResultDTO>> result = adminFeignClient.getExportTemplateInfo(exportTemplateInfoFormDTO);
List<ExportKpiResultDTO> resultList = result.getData();
return ConvertUtils.sourceToTarget(resultList, KpiMassEvaluationDTO.class);
}
/**
* @Description: 导入治理排行管理-群众评价打分
* @Param: [file]
* @return: Result
* @Author: wanggongfeng
* @Date: 2020-06-17
*/
@Override
public Result importManualScoreExcel(MultipartFile file) {
File f = StreamUtils.conversionFile(file);
try {
//判断上传文件类型
String originalFilename = file.getOriginalFilename();
if (!originalFilename.endsWith(StrConstant.EXCEL_SUFFIX_2003) && !originalFilename.endsWith(StrConstant.EXCEL_SUFFIX_2007)) {
return new Result().error("请选择.xls或者.xlsx格式文件");
}
List<KpiMassEvaluationExcel> recordList = ExcelImportUtil.importExcel(f, KpiMassEvaluationExcel.class, new ImportParams());
if (CollUtil.isEmpty(recordList)) {
return new Result().error("导入内容不能为空");
}
// 存储检测excel是否存在重复ID使用
List<String> checkList = new ArrayList<String>();
StringBuffer checkInfo = new StringBuffer();
String year = "";
for(int i = 0 ; i < recordList.size() ; i++){
KpiMassEvaluationExcel kpiMassEvaluationExcel = recordList.get(i);
// 校验是否存在空单元格
if(checkNullCell(kpiMassEvaluationExcel)){
return new Result().error("导入文件中存在空单元格,请完善后重试!");
}
// 校验是否存在分数范围不正确的打分
if(checkScoreCell(kpiMassEvaluationExcel)){
return new Result().error("存在分值总和超过20分的部门,请维护后重试!");
}
// 校验月份是否不一致
if(i == 0){
year = kpiMassEvaluationExcel.getYear();
}else{
if(!year.equals(kpiMassEvaluationExcel.getYear())){
return new Result().error("导入文件中年份不一致,请修改一致后重试!");
}
year = kpiMassEvaluationExcel.getYear();
}
// 校验ID是否存在重复
if(checkList.contains(kpiMassEvaluationExcel.getDeptId())){
return new Result().error(kpiMassEvaluationExcel.getDeptName() + "ID重复,请维护唯一ID后重试!");
}
checkList.add(kpiMassEvaluationExcel.getDeptId());
// 拼接部门ID不在当前用户权限内的部门名称
checkInfo.append(splicingErrorDeptName(i,kpiMassEvaluationExcel,recordList));
}
// 判断导入年份是否为当前年份
if(!year.equals(DateUtils.getCurrentYear())){
return new Result().error("只能对当前年份进行打分,请维护后重试!");
}
// 校验部门ID是否存在当前用户权限内
if (checkInfo.length() > 0) {
return new Result().error(checkInfo.append("部门ID错误,请维护后重试!").toString());
}
// 检测excel中是否存在已打分部门
StringBuffer deptErrorInfo = this.getDuplicateData(checkList,year);
if (deptErrorInfo.length() > 0) {
return new Result().error(deptErrorInfo + " 已打分, 不可重复打分!");
}
// 插入群众评价打分数据(必要时可改为批量插入)
for (KpiMassEvaluationExcel kpiMassEvaluationExcel : recordList) {
KpiMassEvaluationEntity entity = splicingEntity(kpiMassEvaluationExcel);
insert(entity);
}
} catch (Exception e) {
return new Result().error("数据异常,解析excel文件失败");
} finally {
// 删除文件
ExcelUtils.deleteAllFilesOfDir(f);
}
return new Result();
}
/**
* 校验是否存在空单元格
* @param kpiMassEvaluationExcel
* @return
*/
private Boolean checkNullCell(KpiMassEvaluationExcel kpiMassEvaluationExcel){
if(StringUtils.isBlank(kpiMassEvaluationExcel.getDeptId()) || StringUtils.isBlank(kpiMassEvaluationExcel.getDeptName()) || StringUtils.isBlank(kpiMassEvaluationExcel.getYear())
|| StringUtils.isBlank(kpiMassEvaluationExcel.getSatisfied()) || StringUtils.isBlank(kpiMassEvaluationExcel.getDeptTypeKey())
|| StringUtils.isBlank(kpiMassEvaluationExcel.getBasicSatisfaction()) || StringUtils.isBlank(kpiMassEvaluationExcel.getDissatisfied())){
return true;
}
return false;
}
/**
* 校验分数是否规范
* @param kpiMassEvaluationExcel
* @return
*/
private Boolean checkScoreCell(KpiMassEvaluationExcel kpiMassEvaluationExcel){
// 满意分数
String satisfied = kpiMassEvaluationExcel.getSatisfied();
if(ExcelUtils.checkNumber(satisfied)){
return true;
}
Double satisfiedDouble = Double.parseDouble(satisfied);
// 基本满意分数
String basicSatisfaction = kpiMassEvaluationExcel.getBasicSatisfaction();
if(ExcelUtils.checkNumber(basicSatisfaction)){
return true;
}
Double basicSatisfactionDouble = Double.parseDouble(basicSatisfaction);
// 不满意分数
String dissatisfied = kpiMassEvaluationExcel.getDissatisfied();
if(ExcelUtils.checkNumber(dissatisfied)){
return true;
}
Double dissatisfiedDouble = Double.parseDouble(dissatisfied);
if((satisfiedDouble + basicSatisfactionDouble + dissatisfiedDouble) > 20){
return true;
}
return false;
}
/**
* 拼接部门ID不在当前用户权限内的部门名称
* @param index
* @param kpiMassEvaluationExcel
* @param recordList
* @return
*/
private String splicingErrorDeptName(int index,KpiMassEvaluationExcel kpiMassEvaluationExcel,List<KpiMassEvaluationExcel> recordList){
UserDetail user = SecurityUser.getUser();
List<Long> deptIdList = user.getDeptIdList();
if(!deptIdList.contains(Long.valueOf(kpiMassEvaluationExcel.getDeptId()))){
if(index == (recordList.size()-1)){
return kpiMassEvaluationExcel.getDeptName();
}else{
return kpiMassEvaluationExcel.getDeptName() + "、";
}
}
return "";
}
/**
* 拼接网格建设打分实体
* @param kpiMassEvaluationExcel
* @return
*/
private KpiMassEvaluationEntity splicingEntity(KpiMassEvaluationExcel kpiMassEvaluationExcel){
KpiMassEvaluationEntity entity = ConvertUtils.sourceToTarget(kpiMassEvaluationExcel, KpiMassEvaluationEntity.class);
// 查询设置部门类别和部门名称
String deptId = entity.getDeptId();
Result<SysDeptDTO> result = adminFeignClient.get(Long.valueOf(deptId));
SysDeptDTO sysDeptDTO = result.getData();
entity.setDeptTypeKey(sysDeptDTO.getTypeKey());
entity.setDeptName(sysDeptDTO.getName());
// 查询设置上级部门信息
DeptLevelAndLeaderDTO deptLevelInfo = deptUtils.getDeptLevelInfo(Long.valueOf(deptId), YesOrNoEnum.YES);
entity.setAllDeptIds(deptLevelInfo.getAllDeptIds());
entity.setAllDeptNames(deptLevelInfo.getAllDeptNames());
entity.setParentDeptIds(deptLevelInfo.getParentDeptIds());
entity.setParentDeptNames(deptLevelInfo.getParentDeptNames());
return entity;
}
}

137
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiMattersResponseServiceImpl.java

@ -0,0 +1,137 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.exception.RenException;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.utils.DateUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dao.KpiMattersResponseDao;
import com.elink.esua.epdc.dto.KpiMattersResponseDTO;
import com.elink.esua.epdc.dto.SysDeptDTO;
import com.elink.esua.epdc.entity.KpiMattersResponseEntity;
import com.elink.esua.epdc.feign.AdminFeignClient;
import com.elink.esua.epdc.redis.KpiMattersResponseRedis;
import com.elink.esua.epdc.service.KpiMattersResponseService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 响应率打分表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Service
public class KpiMattersResponseServiceImpl extends BaseServiceImpl<KpiMattersResponseDao, KpiMattersResponseEntity> implements KpiMattersResponseService {
@Autowired
private KpiMattersResponseRedis kpiMattersResponseRedis;
@Autowired
private AdminFeignClient adminFeignClient;
@Override
public PageData<KpiMattersResponseDTO> page(Map<String, Object> params) {
IPage<KpiMattersResponseEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, KpiMattersResponseDTO.class);
}
/**
* 条件查询
* @param params
* @return
*/
@Override
public PageData<KpiMattersResponseDTO> getInfoPage(Map<String, Object> params) {
IPage<KpiMattersResponseDTO> page = getPage(params);
List<KpiMattersResponseDTO> list = baseDao.getInfoPage(params);
return new PageData<>(list, page.getTotal());
}
@Override
public List<KpiMattersResponseDTO> list(Map<String, Object> params) {
List<KpiMattersResponseEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, KpiMattersResponseDTO.class);
}
private QueryWrapper<KpiMattersResponseEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<KpiMattersResponseEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public KpiMattersResponseDTO get(String id) {
KpiMattersResponseEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, KpiMattersResponseDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(KpiMattersResponseDTO dto) {
String deptId = dto.getDeptId();
List<String> checkList = new ArrayList<String>();
checkList.add(deptId);
// 判断录入月份是否为当前月或者前一个月
if(!dto.getMonthYear().equals(DateUtils.getLastMonth()) && !dto.getMonthYear().equals(DateUtils.getCurrentMonth())){
throw new RenException("只能对当前月份或者上个月份进行扣分,请维护后重试!");
}
// 查询机构类型键值
Result<SysDeptDTO> result = adminFeignClient.get(Long.valueOf(deptId));
SysDeptDTO sysDeptDTO = result.getData();
// 设置部门类别
dto.setDeptTypeKey(sysDeptDTO.getTypeKey());
KpiMattersResponseEntity entity = ConvertUtils.sourceToTarget(dto, KpiMattersResponseEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(KpiMattersResponseDTO dto) {
KpiMattersResponseEntity entity = ConvertUtils.sourceToTarget(dto, KpiMattersResponseEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

377
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiPublicOpinionServiceImpl.java

@ -0,0 +1,377 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.service.impl;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.constant.StrConstant;
import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum;
import com.elink.esua.epdc.commons.tools.exception.RenException;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser;
import com.elink.esua.epdc.commons.tools.security.user.UserDetail;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.utils.DateUtils;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dao.KpiPublicOpinionDao;
import com.elink.esua.epdc.dto.DeptLevelAndLeaderDTO;
import com.elink.esua.epdc.dto.KpiPublicOpinionDTO;
import com.elink.esua.epdc.dto.SysDeptDTO;
import com.elink.esua.epdc.dto.epdc.form.ExportTemplateInfoFormDTO;
import com.elink.esua.epdc.dto.epdc.result.ExportKpiResultDTO;
import com.elink.esua.epdc.dto.form.CheckIsScoredFormDTO;
import com.elink.esua.epdc.entity.KpiPublicOpinionEntity;
import com.elink.esua.epdc.excel.KpiPublicOpinionExcel;
import com.elink.esua.epdc.feign.AdminFeignClient;
import com.elink.esua.epdc.redis.KpiPublicOpinionRedis;
import com.elink.esua.epdc.service.KpiPublicOpinionService;
import com.elink.esua.epdc.utils.DeptUtils;
import com.elink.esua.epdc.utils.StreamUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 舆论监督打分表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Service
public class KpiPublicOpinionServiceImpl extends BaseServiceImpl<KpiPublicOpinionDao, KpiPublicOpinionEntity> implements KpiPublicOpinionService {
@Autowired
private KpiPublicOpinionRedis kpiPublicOpinionRedis;
@Autowired
private AdminFeignClient adminFeignClient;
@Autowired
private DeptUtils deptUtils;
@Override
public PageData<KpiPublicOpinionDTO> page(Map<String, Object> params) {
IPage<KpiPublicOpinionEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, KpiPublicOpinionDTO.class);
}
/**
* 条件查询
* @param params
* @return
*/
@Override
public PageData<KpiPublicOpinionDTO> getInfoPage(Map<String, Object> params) {
IPage<KpiPublicOpinionDTO> page = getPage(params);
List<KpiPublicOpinionDTO> list = baseDao.getInfoPage(params);
return new PageData<>(list, page.getTotal());
}
@Override
public List<KpiPublicOpinionDTO> list(Map<String, Object> params) {
List<KpiPublicOpinionEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, KpiPublicOpinionDTO.class);
}
private QueryWrapper<KpiPublicOpinionEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<KpiPublicOpinionEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public KpiPublicOpinionDTO get(String id) {
KpiPublicOpinionEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, KpiPublicOpinionDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(KpiPublicOpinionDTO dto) {
String deptId = dto.getDeptId();
List<String> checkList = new ArrayList<String>();
checkList.add(deptId);
// 判断录入月份是否为当前月或者前一个月
if(!dto.getMonthYear().equals(DateUtils.getLastMonth()) && !dto.getMonthYear().equals(DateUtils.getCurrentMonth())){
throw new RenException("只能对当前月份或者上个月份进行打分,请维护后重试!");
}
// 检测excel中是否存在已打分部门
StringBuffer deptErrorInfo = this.getDuplicateData(checkList,dto.getMonthYear());
if (deptErrorInfo.length() > 0) {
throw new RenException(deptErrorInfo + " 已打分, 不可重复打分!");
}
// 查询机构类型键值
Result<SysDeptDTO> result = adminFeignClient.get(Long.valueOf(deptId));
SysDeptDTO sysDeptDTO = result.getData();
// 设置部门类别
dto.setDeptTypeKey(sysDeptDTO.getTypeKey());
KpiPublicOpinionEntity entity = ConvertUtils.sourceToTarget(dto, KpiPublicOpinionEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(KpiPublicOpinionDTO dto) {
KpiPublicOpinionEntity entity = ConvertUtils.sourceToTarget(dto, KpiPublicOpinionEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* 拼接已打分部门提示信息
* @param checkList
* @return
*/
private StringBuffer getDuplicateData(List<String> checkList ,String monthYear){
CheckIsScoredFormDTO checkIsScoredFormDTO = new CheckIsScoredFormDTO();
checkIsScoredFormDTO.setCheckList(checkList);
checkIsScoredFormDTO.setMonthYear(monthYear);
StringBuffer deptErrorInfo = new StringBuffer();
List<KpiPublicOpinionDTO> list = baseDao.getDuplicateData(checkIsScoredFormDTO);
for(int i = 0 ; i < list.size() ; i++){
KpiPublicOpinionDTO kpiPublicOpinionDTO = list.get(i);
if(i == (list.size()-1)){
deptErrorInfo.append(kpiPublicOpinionDTO.getDeptName());
}else{
deptErrorInfo.append(kpiPublicOpinionDTO.getDeptName()).append("、");
}
}
return deptErrorInfo;
}
/**
* 获取导出模板
*
* @param params
* @return java.util.List<KpiPublicOpinionDTO>
* @author wanggongfeng
* @date 2020-06-15
*/
@Override
public List<KpiPublicOpinionDTO> exportTemplate(Map<String, Object> params) {
List<Long> deptIdList = SecurityUser.getUser().getDeptIdList(); //获取用户权限
ExportTemplateInfoFormDTO exportTemplateInfoFormDTO = new ExportTemplateInfoFormDTO();
exportTemplateInfoFormDTO.setDeptIdList(deptIdList);
exportTemplateInfoFormDTO.setDeptId(params.get("deptId") == null ? "" : params.get("deptId").toString());
exportTemplateInfoFormDTO.setDeptTypeKey(params.get("deptTypeKey") == null ? "" : params.get("deptTypeKey").toString());
exportTemplateInfoFormDTO.setMonthYear(params.get("monthYear") == null ? "" : params.get("monthYear").toString());
Result<List<ExportKpiResultDTO>> result = adminFeignClient.getExportTemplateInfo(exportTemplateInfoFormDTO);
List<ExportKpiResultDTO> resultList = result.getData();
return ConvertUtils.sourceToTarget(resultList, KpiPublicOpinionDTO.class);
}
/**
* @Description: 导入治理排行管理-舆论监督打分
* @Param: [file]
* @return: Result
* @Author: wanggongfeng
* @Date: 2020-06-17
*/
@Override
public Result importManualScoreExcel(MultipartFile file) {
File f = StreamUtils.conversionFile(file);
try {
//判断上传文件类型
String originalFilename = file.getOriginalFilename();
if (!originalFilename.endsWith(StrConstant.EXCEL_SUFFIX_2003) && !originalFilename.endsWith(StrConstant.EXCEL_SUFFIX_2007)) {
return new Result().error("请选择.xls或者.xlsx格式文件");
}
List<KpiPublicOpinionExcel> recordList = ExcelImportUtil.importExcel(f, KpiPublicOpinionExcel.class, new ImportParams());
if (CollUtil.isEmpty(recordList)) {
return new Result().error("导入内容不能为空");
}
// 存储检测excel是否存在重复ID使用
List<String> checkList = new ArrayList<String>();
StringBuffer checkInfo = new StringBuffer();
String monthYear = "";
for(int i = 0 ; i < recordList.size() ; i++){
KpiPublicOpinionExcel kpiPublicOpinionExcel = recordList.get(i);
// 校验是否存在空单元格
if(checkNullCell(kpiPublicOpinionExcel)){
return new Result().error("导入文件中存在空单元格,请完善后重试!");
}
// 校验是否存在分数范围不正确的打分
if(checkScoreCell(kpiPublicOpinionExcel)){
return new Result().error("存在不符合分值范围的分数!");
}
// 校验月份是否不一致
if(i == 0){
monthYear = kpiPublicOpinionExcel.getMonthYear();
}else{
if(!monthYear.equals(kpiPublicOpinionExcel.getMonthYear())){
return new Result().error("导入文件中月份不一致,请修改一致后重试!");
}
monthYear = kpiPublicOpinionExcel.getMonthYear();
}
// 校验ID是否存在重复
if(checkList.contains(kpiPublicOpinionExcel.getDeptId())){
return new Result().error(kpiPublicOpinionExcel.getDeptName() + "ID重复,请维护唯一ID后重试!");
}
checkList.add(kpiPublicOpinionExcel.getDeptId());
// 拼接部门ID不在当前用户权限内的部门名称
checkInfo.append(splicingErrorDeptName(i,kpiPublicOpinionExcel,recordList));
}
// 判断导入月份是否为当前月或者前一个月
if(!monthYear.equals(DateUtils.getLastMonth()) && !monthYear.equals(DateUtils.getCurrentMonth())){
return new Result().error("只能对当前月份或者上个月份进行打分,请维护后重试!");
}
// 校验部门ID是否存在当前用户权限内
if (checkInfo.length() > 0) {
return new Result().error(checkInfo.append("部门ID错误,请维护后重试!").toString());
}
// 检测excel中是否存在已打分部门
StringBuffer deptErrorInfo = this.getDuplicateData(checkList,monthYear);
if (deptErrorInfo.length() > 0) {
return new Result().error(deptErrorInfo + " 已打分, 不可重复打分!");
}
// 插入网格建设打分数据(必要时可改为批量插入)
for (KpiPublicOpinionExcel kpiPublicOpinionExcel : recordList) {
KpiPublicOpinionEntity entity = splicingEntity(kpiPublicOpinionExcel);
insert(entity);
}
} catch (Exception e) {
return new Result().error("数据异常,解析excel文件失败");
} finally {
// 删除文件
ExcelUtils.deleteAllFilesOfDir(f);
}
return new Result();
}
/**
* 校验是否存在空单元格
* @param kpiPublicOpinionExcel
* @return
*/
private Boolean checkNullCell(KpiPublicOpinionExcel kpiPublicOpinionExcel){
if(StringUtils.isBlank(kpiPublicOpinionExcel.getDeptId()) || StringUtils.isBlank(kpiPublicOpinionExcel.getDeptName()) || StringUtils.isBlank(kpiPublicOpinionExcel.getMonthYear())
|| StringUtils.isBlank(kpiPublicOpinionExcel.getPublicityFoundation()) || StringUtils.isBlank(kpiPublicOpinionExcel.getDeptTypeKey())
|| StringUtils.isBlank(kpiPublicOpinionExcel.getPublicOpinionResponse()) || StringUtils.isBlank(kpiPublicOpinionExcel.getInnovationBreakthrough())){
return true;
}
return false;
}
/**
* 校验分数是否规范
* @param kpiPublicOpinionExcel
* @return
*/
private Boolean checkScoreCell(KpiPublicOpinionExcel kpiPublicOpinionExcel){
// 宣传基础分数(5分)
String publicityFoundation = kpiPublicOpinionExcel.getPublicityFoundation();
if(ExcelUtils.checkNumber(publicityFoundation)){
return true;
}
Double publicityFoundationDouble = Double.parseDouble(publicityFoundation);
// 创新突破分数(3分)
String innovationBreakthrough = kpiPublicOpinionExcel.getInnovationBreakthrough();
if(ExcelUtils.checkNumber(innovationBreakthrough)){
return true;
}
Double innovationBreakthroughDouble = Double.parseDouble(innovationBreakthrough);
// 舆情应对分数(2分)
String publicOpinionResponse = kpiPublicOpinionExcel.getPublicOpinionResponse();
if(ExcelUtils.checkNumber(publicOpinionResponse)){
return true;
}
Double publicOpinionResponseDouble = Double.parseDouble(publicOpinionResponse);
if(publicityFoundationDouble < 0 || publicityFoundationDouble > 5
|| innovationBreakthroughDouble < 0 || innovationBreakthroughDouble > 3
|| publicOpinionResponseDouble < 0 || publicOpinionResponseDouble > 2){
return true;
}
return false;
}
/**
* 拼接部门ID不在当前用户权限内的部门名称
* @param index
* @param kpiPublicOpinionExcel
* @param recordList
* @return
*/
private String splicingErrorDeptName(int index,KpiPublicOpinionExcel kpiPublicOpinionExcel,List<KpiPublicOpinionExcel> recordList){
UserDetail user = SecurityUser.getUser();
List<Long> deptIdList = user.getDeptIdList();
if(!deptIdList.contains(Long.valueOf(kpiPublicOpinionExcel.getDeptId()))){
if(index == (recordList.size()-1)){
return kpiPublicOpinionExcel.getDeptName();
}else{
return kpiPublicOpinionExcel.getDeptName() + "、";
}
}
return "";
}
/**
* 拼接网格建设打分实体
* @param kpiPublicOpinionExcel
* @return
*/
private KpiPublicOpinionEntity splicingEntity(KpiPublicOpinionExcel kpiPublicOpinionExcel){
KpiPublicOpinionEntity entity = ConvertUtils.sourceToTarget(kpiPublicOpinionExcel, KpiPublicOpinionEntity.class);
// 查询设置部门类别和部门名称
String deptId = entity.getDeptId();
Result<SysDeptDTO> result = adminFeignClient.get(Long.valueOf(deptId));
SysDeptDTO sysDeptDTO = result.getData();
entity.setDeptTypeKey(sysDeptDTO.getTypeKey());
entity.setDeptName(sysDeptDTO.getName());
// 查询设置上级部门信息
DeptLevelAndLeaderDTO deptLevelInfo = deptUtils.getDeptLevelInfo(Long.valueOf(deptId), YesOrNoEnum.YES);
entity.setAllDeptIds(deptLevelInfo.getAllDeptIds());
entity.setAllDeptNames(deptLevelInfo.getAllDeptNames());
entity.setParentDeptIds(deptLevelInfo.getParentDeptIds());
entity.setParentDeptNames(deptLevelInfo.getParentDeptNames());
return entity;
}
}

137
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiTypicalCultureServiceImpl.java

@ -0,0 +1,137 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.exception.RenException;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.utils.DateUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dao.KpiTypicalCultureDao;
import com.elink.esua.epdc.dto.KpiTypicalCultureDTO;
import com.elink.esua.epdc.dto.SysDeptDTO;
import com.elink.esua.epdc.entity.KpiTypicalCultureEntity;
import com.elink.esua.epdc.feign.AdminFeignClient;
import com.elink.esua.epdc.redis.KpiTypicalCultureRedis;
import com.elink.esua.epdc.service.KpiTypicalCultureService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 典型培树
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Service
public class KpiTypicalCultureServiceImpl extends BaseServiceImpl<KpiTypicalCultureDao, KpiTypicalCultureEntity> implements KpiTypicalCultureService {
@Autowired
private KpiTypicalCultureRedis kpiTypicalCultureRedis;
@Autowired
private AdminFeignClient adminFeignClient;
@Override
public PageData<KpiTypicalCultureDTO> page(Map<String, Object> params) {
IPage<KpiTypicalCultureEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, KpiTypicalCultureDTO.class);
}
/**
* 条件查询
* @param params
* @return
*/
@Override
public PageData<KpiTypicalCultureDTO> getInfoPage(Map<String, Object> params) {
IPage<KpiTypicalCultureDTO> page = getPage(params);
List<KpiTypicalCultureDTO> list = baseDao.getInfoPage(params);
return new PageData<>(list, page.getTotal());
}
@Override
public List<KpiTypicalCultureDTO> list(Map<String, Object> params) {
List<KpiTypicalCultureEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, KpiTypicalCultureDTO.class);
}
private QueryWrapper<KpiTypicalCultureEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<KpiTypicalCultureEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public KpiTypicalCultureDTO get(String id) {
KpiTypicalCultureEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, KpiTypicalCultureDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(KpiTypicalCultureDTO dto) {
String deptId = dto.getDeptId();
List<String> checkList = new ArrayList<String>();
checkList.add(deptId);
// 判断录入年份是否为当前年份
if(!dto.getYear().equals(DateUtils.getCurrentYear())){
throw new RenException("只能对当前年份进行打分,请维护后重试!");
}
// 查询机构类型键值
Result<SysDeptDTO> result = adminFeignClient.get(Long.valueOf(deptId));
SysDeptDTO sysDeptDTO = result.getData();
// 设置部门类别
dto.setDeptTypeKey(sysDeptDTO.getTypeKey());
KpiTypicalCultureEntity entity = ConvertUtils.sourceToTarget(dto, KpiTypicalCultureEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(KpiTypicalCultureDTO dto) {
KpiTypicalCultureEntity entity = ConvertUtils.sourceToTarget(dto, KpiTypicalCultureEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

95
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiGridEntityDao.xml

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.dao.KpiGridEntityDao">
<resultMap type="com.elink.esua.epdc.entity.KpiGridEntityEntity" id="kpiGridEntityMap">
<result property="id" column="ID"/>
<result property="deptId" column="DEPT_ID"/>
<result property="deptName" column="DEPT_NAME"/>
<result property="deptTypeKey" column="DEPT_TYPE_KEY"/>
<result property="monthYear" column="MONTH_YEAR"/>
<result property="stationEstablishment" column="STATION_ESTABLISHMENT"/>
<result property="staffingPlacement" column="STAFFING_PLACEMENT"/>
<result property="gridOperation" column="GRID_OPERATION"/>
<result property="parentDeptIds" column="PARENT_DEPT_IDS"/>
<result property="parentDeptNames" column="PARENT_DEPT_NAMES"/>
<result property="allDeptIds" column="ALL_DEPT_IDS"/>
<result property="allDeptNames" column="ALL_DEPT_NAMES"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
<result property="delFlag" column="DEL_FLAG"/>
</resultMap>
<select id="getInfoPage" resultType="com.elink.esua.epdc.dto.KpiGridEntityDTO">
select
ID,
DEPT_ID,
DEPT_NAME,
DEPT_TYPE_KEY,
MONTH_YEAR,
STATION_ESTABLISHMENT,
STAFFING_PLACEMENT,
GRID_OPERATION,
PARENT_DEPT_IDS,
PARENT_DEPT_NAMES,
ALL_DEPT_IDS,
ALL_DEPT_NAMES,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME,
DEL_FLAG
from epdc_kpi_grid_entity
where DEL_FLAG = '0'
<if test="deptId != null and deptId != ''">
and DEPT_ID = #{deptId}
</if>
<if test="monthYear != null and monthYear != ''">
and MONTH_YEAR = #{monthYear}
</if>
<if test="deptTypeKey != null and deptTypeKey != ''">
and DEPT_TYPE_KEY = #{deptTypeKey}
</if>
order by UPDATED_TIME desc
</select>
<select id="getDuplicateData" resultType="com.elink.esua.epdc.dto.KpiCommunityBuildingDTO" parameterType="com.elink.esua.epdc.dto.form.CheckIsScoredFormDTO">
select
ID,
DEPT_ID,
DEPT_NAME,
DEPT_TYPE_KEY,
MONTH_YEAR,
STATION_ESTABLISHMENT,
STAFFING_PLACEMENT,
GRID_OPERATION,
PARENT_DEPT_IDS,
PARENT_DEPT_NAMES,
ALL_DEPT_IDS,
ALL_DEPT_NAMES,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME,
DEL_FLAG
from epdc_kpi_grid_entity
where DEL_FLAG = '0'
<if test="checkList != null and checkList.size() > 0">
AND DEPT_ID IN
<foreach collection="checkList" item="deptId" index="index" open="(" close=")" separator=",">
#{deptId}
</foreach>
</if>
<if test="monthYear != null and monthYear != ''">
and MONTH_YEAR = #{monthYear}
</if>
</select>
</mapper>

95
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiMassEvaluationDao.xml

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.dao.KpiMassEvaluationDao">
<resultMap type="com.elink.esua.epdc.entity.KpiMassEvaluationEntity" id="kpiMassEvaluationMap">
<result property="id" column="ID"/>
<result property="deptId" column="DEPT_ID"/>
<result property="deptName" column="DEPT_NAME"/>
<result property="deptTypeKey" column="DEPT_TYPE_KEY"/>
<result property="year" column="YEAR"/>
<result property="satisfied" column="SATISFIED"/>
<result property="basicSatisfaction" column="BASIC_SATISFACTION"/>
<result property="dissatisfied" column="DISSATISFIED"/>
<result property="parentDeptIds" column="PARENT_DEPT_IDS"/>
<result property="parentDeptNames" column="PARENT_DEPT_NAMES"/>
<result property="allDeptIds" column="ALL_DEPT_IDS"/>
<result property="allDeptNames" column="ALL_DEPT_NAMES"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
<result property="delFlag" column="DEL_FLAG"/>
</resultMap>
<select id="getInfoPage" resultType="com.elink.esua.epdc.dto.KpiMassEvaluationDTO">
select
ID,
DEPT_ID,
DEPT_NAME,
DEPT_TYPE_KEY,
YEAR,
SATISFIED,
BASIC_SATISFACTION,
DISSATISFIED,
PARENT_DEPT_IDS,
PARENT_DEPT_NAMES,
ALL_DEPT_IDS,
ALL_DEPT_NAMES,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME,
DEL_FLAG
from epdc_kpi_mass_evaluation
where DEL_FLAG = '0'
<if test="deptId != null and deptId != ''">
and DEPT_ID = #{deptId}
</if>
<if test="year != null and year != ''">
and YEAR = #{year}
</if>
<if test="deptTypeKey != null and deptTypeKey != ''">
and DEPT_TYPE_KEY = #{deptTypeKey}
</if>
order by UPDATED_TIME desc
</select>
<select id="getDuplicateData" resultType="com.elink.esua.epdc.dto.KpiMassEvaluationDTO" parameterType="com.elink.esua.epdc.dto.form.CheckIsScoredByYearFormDTO">
select
ID,
DEPT_ID,
DEPT_NAME,
DEPT_TYPE_KEY,
YEAR,
SATISFIED,
BASIC_SATISFACTION,
DISSATISFIED,
PARENT_DEPT_IDS,
PARENT_DEPT_NAMES,
ALL_DEPT_IDS,
ALL_DEPT_NAMES,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME,
DEL_FLAG
from epdc_kpi_mass_evaluation
where DEL_FLAG = '0'
<if test="checkList != null and checkList.size() > 0">
AND DEPT_ID IN
<foreach collection="checkList" item="deptId" index="index" open="(" close=")" separator=",">
#{deptId}
</foreach>
</if>
<if test="year != null and year != ''">
and YEAR = #{year}
</if>
</select>
</mapper>

63
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiMattersResponseDao.xml

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.dao.KpiMattersResponseDao">
<resultMap type="com.elink.esua.epdc.entity.KpiMattersResponseEntity" id="kpiMattersResponseMap">
<result property="id" column="ID"/>
<result property="deptId" column="DEPT_ID"/>
<result property="deptName" column="DEPT_NAME"/>
<result property="deptTypeKey" column="DEPT_TYPE_KEY"/>
<result property="monthYear" column="MONTH_YEAR"/>
<result property="deductionCategory" column="DEDUCTION_CATEGORY"/>
<result property="deduction" column="DEDUCTION"/>
<result property="parentDeptIds" column="PARENT_DEPT_IDS"/>
<result property="parentDeptNames" column="PARENT_DEPT_NAMES"/>
<result property="allDeptIds" column="ALL_DEPT_IDS"/>
<result property="allDeptNames" column="ALL_DEPT_NAMES"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
<result property="delFlag" column="DEL_FLAG"/>
</resultMap>
<select id="getInfoPage" resultType="com.elink.esua.epdc.dto.KpiMattersResponseDTO">
select
ID,
DEPT_ID,
DEPT_NAME,
DEPT_TYPE_KEY,
MONTH_YEAR,
DEDUCTION_CATEGORY,
DEDUCTION,
PARENT_DEPT_IDS,
PARENT_DEPT_NAMES,
ALL_DEPT_IDS,
ALL_DEPT_NAMES,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME,
DEL_FLAG
from epdc_kpi_matters_response
where DEL_FLAG = '0'
<if test="deptId != null and deptId != ''">
and DEPT_ID = #{deptId}
</if>
<if test="monthYear != null and monthYear != ''">
and MONTH_YEAR = #{monthYear}
</if>
<if test="deptTypeKey != null and deptTypeKey != ''">
and DEPT_TYPE_KEY = #{deptTypeKey}
</if>
<if test="deductionCategory != null and deductionCategory != ''">
and DEDUCTION_CATEGORY = #{deductionCategory}
</if>
order by UPDATED_TIME desc
</select>
</mapper>

95
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiPublicOpinionDao.xml

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.dao.KpiPublicOpinionDao">
<resultMap type="com.elink.esua.epdc.entity.KpiPublicOpinionEntity" id="kpiPublicOpinionMap">
<result property="id" column="ID"/>
<result property="deptId" column="DEPT_ID"/>
<result property="deptName" column="DEPT_NAME"/>
<result property="deptTypeKey" column="DEPT_TYPE_KEY"/>
<result property="monthYear" column="MONTH_YEAR"/>
<result property="publicityFoundation" column="PUBLICITY_FOUNDATION"/>
<result property="innovationBreakthrough" column="INNOVATION_BREAKTHROUGH"/>
<result property="publicOpinionResponse" column="PUBLIC_OPINION_RESPONSE"/>
<result property="parentDeptIds" column="PARENT_DEPT_IDS"/>
<result property="parentDeptNames" column="PARENT_DEPT_NAMES"/>
<result property="allDeptIds" column="ALL_DEPT_IDS"/>
<result property="allDeptNames" column="ALL_DEPT_NAMES"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
<result property="delFlag" column="DEL_FLAG"/>
</resultMap>
<select id="getInfoPage" resultType="com.elink.esua.epdc.dto.KpiPublicOpinionDTO">
select
sd.ID,
sd.DEPT_ID,
sd.DEPT_NAME,
sd.DEPT_TYPE_KEY,
sd.MONTH_YEAR,
sd.PUBLICITY_FOUNDATION,
sd.INNOVATION_BREAKTHROUGH,
sd.PUBLIC_OPINION_RESPONSE,
sd.PARENT_DEPT_IDS,
sd.PARENT_DEPT_NAMES,
sd.ALL_DEPT_IDS,
sd.ALL_DEPT_NAMES,
sd.REVISION,
sd.CREATED_BY,
sd.CREATED_TIME,
sd.UPDATED_BY,
sd.UPDATED_TIME,
sd.DEL_FLAG
from epdc_kpi_public_opinion sd
where sd.DEL_FLAG = '0'
<if test="deptId != null and deptId != ''">
and sd.DEPT_ID = #{deptId}
</if>
<if test="monthYear != null and monthYear != ''">
and sd.MONTH_YEAR = #{monthYear}
</if>
<if test="deptTypeKey != null and deptTypeKey != ''">
and sd.DEPT_TYPE_KEY = #{deptTypeKey}
</if>
order by sd.UPDATED_TIME desc
</select>
<select id="getDuplicateData" resultType="com.elink.esua.epdc.dto.KpiPublicOpinionDTO" parameterType="com.elink.esua.epdc.dto.form.CheckIsScoredFormDTO">
select
ID,
DEPT_ID,
DEPT_NAME,
DEPT_TYPE_KEY,
MONTH_YEAR,
PUBLICITY_FOUNDATION,
INNOVATION_BREAKTHROUGH,
PUBLIC_OPINION_RESPONSE,
PARENT_DEPT_IDS,
PARENT_DEPT_NAMES,
ALL_DEPT_IDS,
ALL_DEPT_NAMES,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME,
DEL_FLAG
from epdc_kpi_public_opinion
where DEL_FLAG = '0'
<if test="checkList != null and checkList.size() > 0">
AND DEPT_ID IN
<foreach collection="checkList" item="deptId" index="index" open="(" close=")" separator=",">
#{deptId}
</foreach>
</if>
<if test="monthYear != null and monthYear != ''">
and MONTH_YEAR = #{monthYear}
</if>
</select>
</mapper>

67
esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiTypicalCultureDao.xml

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.dao.KpiTypicalCultureDao">
<resultMap type="com.elink.esua.epdc.entity.KpiTypicalCultureEntity" id="kpiTypicalCultureMap">
<result property="id" column="ID"/>
<result property="deptId" column="DEPT_ID"/>
<result property="deptName" column="DEPT_NAME"/>
<result property="deptTypeKey" column="DEPT_TYPE_KEY"/>
<result property="year" column="YEAR"/>
<result property="bonusCategory" column="BONUS_CATEGORY"/>
<result property="bonus" column="BONUS"/>
<result property="bonusLevel" column="BONUS_LEVEL"/>
<result property="parentDeptIds" column="PARENT_DEPT_IDS"/>
<result property="parentDeptNames" column="PARENT_DEPT_NAMES"/>
<result property="allDeptIds" column="ALL_DEPT_IDS"/>
<result property="allDeptNames" column="ALL_DEPT_NAMES"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
<result property="delFlag" column="DEL_FLAG"/>
</resultMap>
<select id="getInfoPage" resultType="com.elink.esua.epdc.dto.KpiTypicalCultureDTO">
select
ID,
DEPT_ID,
DEPT_NAME,
DEPT_TYPE_KEY,
YEAR,
BONUS_CATEGORY,
BONUS,
BONUS_LEVEL,
PARENT_DEPT_IDS,
PARENT_DEPT_NAMES,
ALL_DEPT_IDS,
ALL_DEPT_NAMES,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME,
DEL_FLAG
from epdc_kpi_typical_culture
where DEL_FLAG = '0'
<if test="deptId != null and deptId != ''">
and DEPT_ID = #{deptId}
</if>
<if test="year != null and year != ''">
and YEAR = #{year}
</if>
<if test="deptTypeKey != null and deptTypeKey != ''">
and DEPT_TYPE_KEY = #{deptTypeKey}
</if>
<if test="bonusCategory != null and bonusCategory != ''">
and BONUS_CATEGORY = #{bonusCategory}
</if>
<if test="bonusLevel != null and bonusLevel != ''">
and BONUS_LEVEL = #{bonusLevel}
</if>
order by UPDATED_TIME desc
</select>
</mapper>
Loading…
Cancel
Save