Browse Source

【灵山】项目,fix

master
wxz 3 years ago
parent
commit
170bb78e6e
  1. 29
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/FileDownloadHelper.java
  2. 1
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java
  3. 2
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java
  4. 7
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java
  5. 2
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java
  6. 8
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java
  7. 40
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml
  8. 52
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/LingShanHelpCrowdController.java
  9. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdCanjiExcelData.java

29
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/FileDownloadHelper.java

@ -0,0 +1,29 @@
package com.epmet.commons.tools.utils;
import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
/**
* @Description 文件下载工具类
* @Author wangxianzhang
* @Time 2023/5/25 2:23 PM
*/
public class FileDownloadHelper {
/**
* @Description: 为下载xlsx文件设置response
* @param response:
* @param fileName:
* @Return void
* @Author: wangxianzhang
* @Date: 2023/5/25 2:23 PM
*/
public static void setResponseForXlsx(HttpServletResponse response, String fileName) throws UnsupportedEncodingException {
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
response.setHeader("content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
// response.setHeader("content-Type", "application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode(fileName, "UTF-8"));
}
}

1
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java

@ -218,4 +218,5 @@ public class IcEventDTO implements Serializable {
*/
private Date updatedTime;
private Integer replyStatus;
}

2
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java

@ -206,6 +206,8 @@ public class IcEventListResultDTO implements Serializable {
*/
private String difficultPointName;
private Integer replyStatus;
/**
* 事件附件
*/

7
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java

@ -624,6 +624,13 @@ public class IcEventController {
@PostMapping("updateReply")
public Result updateReply(@RequestBody IcEventReplyFormDTO formDTO) {
icEventReplyService.updateByReplyId(formDTO);
if (null != formDTO.getIcEventId()) {
IcEventDTO entity = icEventService.get(formDTO.getId());
if (formDTO.getManageStatus() > entity.getReplyStatus()) {
entity.setReplyStatus(formDTO.getManageStatus());
icEventService.update(entity);
}
}
return new Result();
}

2
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java

@ -186,4 +186,6 @@ public class IcEventEntity extends BaseEpmetEntity {
*/
private String difficultPoint;
private Integer replyStatus;
}

8
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java

@ -798,6 +798,14 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
entity.setLatestOperatedTime(new Date());
//工作端回复了,居民端那要展示红点。
entity.setRedDot(NumConstant.ONE);
//灵山项目,为了便于统计分析事件处理状态,同步事件处理状态到主表;如果修改处理进度的状态
if (null == entity.getReplyStatus()) {
//如果事件没有处理,则该事件待响应,并同步更新事件处理状态
entity.setReplyStatus(formDTO.getManageStatus());
} else if (entity.getReplyStatus() > formDTO.getManageStatus()) {
//如果事件已经存在处理流程,且当前处理流程状态大于之前的状态则更新最新的处理状态
entity.setReplyStatus(formDTO.getManageStatus());
}
baseDao.updateById(entity);
//3.新增回复数据

40
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml

@ -133,6 +133,7 @@
<result property="categoryId" column="category_id" />
<result property="difficultPoint" column="difficult_point" />
<result property="difficultPointName" column="difficultPointName" />
<result property="replyStatus" column="REPLY_STATUS" />
<collection property="attachmentList" ofType="com.epmet.dto.result.IcEventListResultDTO$Attachment"
column="icEventId" select="matterListByPartyServiceCenterId"/>
<!--<collection property="attachmentList" ofType="com.epmet.dto.result.IcEventListResultDTO$Attachment" select="">
@ -542,27 +543,26 @@
<select id="getEventByReplyTypeCount" resultType="java.lang.Integer">
SELECT
count( r.id )
COUNT( e.id )
FROM
ic_event_reply r
<where>
r.DEL_FLAG = 0
<if test="null != manageType and manageType != ''">
AND r.MANAGE_STATUS = #{manageType}
</if>
AND r.IC_EVENT_ID IN (
SELECT e.id from ic_event e
<where>
e.DEL_FLAG = 0
<if test="null != sourceType and sourceType != ''">
AND e.SOURCE_TYPE = #{sourceType}
</if>
<if test="null != orgIdPath and orgIdPath != ''">
AND e.GRID_PIDS LIKE concat(#{orgIdPath},'%')
</if>
</where>
)
</where>
ic_event e
where
e.DEL_FLAG = 0
<if test="null != manageType and manageType != '' and manageType == 0">
AND (e.REPLY_STATUS = #{manageType} or e.REPLY_STATUS is null)
</if>
<if test="null != manageType and manageType != '' and manageType == 1 and manageType == 5">
AND e.REPLY_STATUS = #{manageType}
</if>
<if test="null != manageType and manageType != '' and manageType == 2">
AND (e.REPLY_STATUS = #{manageType} or e.REPLY_STATUS = 3 or e.REPLY_STATUS = 4)
</if>
<if test="null != sourceType and sourceType != ''">
AND e.SOURCE_TYPE = #{sourceType}
</if>
<if test="null != orgIdPath and orgIdPath != ''">
AND e.GRID_PIDS LIKE concat(#{orgIdPath},'%')
</if>
</select>
<select id="getEventBySourceTypeCount" resultType="com.epmet.dto.result.EventAnalysisResultDTO">

52
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/LingShanHelpCrowdController.java

@ -2,9 +2,12 @@ package com.epmet.controller;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.FileDownloadHelper;
import com.epmet.commons.tools.utils.FileUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.enums.LingShanHelpCrowdTypeEnum;
import com.epmet.service.LingShanHelpCrowdService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
@ -12,8 +15,12 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.nio.file.Path;
import java.util.Date;
@ -25,6 +32,14 @@ public class LingShanHelpCrowdController {
@Autowired
private LingShanHelpCrowdService helpCrowdService;
/**
* @Description: 导入重点帮扶人群
* @param file:
* @param crowdType:
* @Return com.epmet.commons.tools.utils.Result
* @Author: wangxianzhang
* @Date: 2023/5/25 2:13 PM
*/
@PostMapping("import")
public Result importExcel(@RequestBody MultipartFile file, @RequestParam("crowdType") String crowdType) {
@ -46,6 +61,14 @@ public class LingShanHelpCrowdController {
}
/**
* @Description: 保存临时文件
* @param file:
* @param suffix:
* @Return java.nio.file.Path
* @Author: wangxianzhang
* @Date: 2023/5/25 2:14 PM
*/
public Path saveHelpCrowdTempFile(@RequestParam("file") MultipartFile file, String suffix) {
Path fileSavePath;
FileOutputStream os = null;
@ -64,5 +87,34 @@ public class LingShanHelpCrowdController {
}
}
/**
* @Description: 下载导入模板
* @param helpType:
* @Return void
* @Author: wangxianzhang
* @Date: 2023/5/25 2:17 PM
*/
@GetMapping("downloadTemplate")
public void downloadTemplate(@RequestParam("helpType") String helpType, HttpServletResponse response) {
LingShanHelpCrowdTypeEnum typeEnum;
if ((typeEnum = LingShanHelpCrowdTypeEnum.getByType(helpType)) == null ) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "【重点帮扶人群】下载模板:指定的类型不正确:" + helpType);
}
try (ServletOutputStream os = response.getOutputStream()){
FileDownloadHelper.setResponseForXlsx(response, "重点帮扶人群导入模板-" + typeEnum.getName() + ".xlsx");
InputStream is = getClass().getClassLoader().getResourceAsStream("lingshan_help_crowd_" + helpType + "_import.xlsx");
IOUtils.copy(is, os);
} catch (IOException e) {
log.error("【重点帮扶人群】下载导入模板出错:" + ExceptionUtils.getErrorStackTrace(e));
throw new EpmetException(null);
}
}
}

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

@ -42,7 +42,7 @@ public class LingshanHelpCrowdCanjiExcelData extends LingShanHelpCrowdBaseExcelD
* 有效期开始时间
*/
@ExcelProperty(value = "有效期开始时间")
@DateTimeFormat("yyyy/MM")
@DateTimeFormat("yyyy/MM/dd")
private Date validityStart;
/**

Loading…
Cancel
Save