|
@@ -1,18 +1,16 @@
|
|
|
package com.jpsoft.excellent.modules.base.controller;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSONArray;
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
import com.github.pagehelper.Page;
|
|
|
import com.jpsoft.excellent.config.OSSConfig;
|
|
|
-import com.jpsoft.excellent.modules.base.dto.FeedbackAttachmentDTO;
|
|
|
+import com.jpsoft.excellent.modules.base.dto.AttachmentDTO;
|
|
|
import com.jpsoft.excellent.modules.base.dto.FeedbackOpinionReportDTO;
|
|
|
+import com.jpsoft.excellent.modules.base.dto.NextStepDTO;
|
|
|
import com.jpsoft.excellent.modules.base.entity.*;
|
|
|
import com.jpsoft.excellent.modules.base.service.*;
|
|
|
import com.jpsoft.excellent.modules.common.utils.OSSUtil;
|
|
|
import com.jpsoft.excellent.modules.common.utils.PojoUtils;
|
|
|
import com.jpsoft.excellent.modules.common.dto.Sort;
|
|
|
import com.jpsoft.excellent.modules.common.dto.MessageResult;
|
|
|
-import com.jpsoft.excellent.modules.sys.entity.DataDictionary;
|
|
|
import com.jpsoft.excellent.modules.sys.entity.User;
|
|
|
import com.jpsoft.excellent.modules.sys.service.DataDictionaryService;
|
|
|
import com.jpsoft.excellent.modules.sys.service.UserService;
|
|
@@ -27,7 +25,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
import java.io.ByteArrayInputStream;
|
|
|
import java.io.ByteArrayOutputStream;
|
|
|
import java.text.SimpleDateFormat;
|
|
@@ -65,7 +62,7 @@ public class FeedbackOpinionController {
|
|
|
public MessageResult<FeedbackOpinion> create(){
|
|
|
MessageResult<FeedbackOpinion> msgResult = new MessageResult<>();
|
|
|
|
|
|
- List<FeedbackAttachmentDTO> feedbackAttachmentList = new ArrayList<FeedbackAttachmentDTO>();
|
|
|
+ List<AttachmentDTO> feedbackAttachmentList = new ArrayList<AttachmentDTO>();
|
|
|
|
|
|
FeedbackOpinion feedbackOpinion = new FeedbackOpinion();
|
|
|
feedbackOpinion.setAttList(feedbackAttachmentList);
|
|
@@ -126,28 +123,28 @@ public class FeedbackOpinionController {
|
|
|
}
|
|
|
|
|
|
//附件列表
|
|
|
- List<FeedbackAttachmentDTO> feedbackAttachmentDTOList1 = new ArrayList<>();
|
|
|
- List<FeedbackAttachment> feedbackAttachmentList1 = feedbackAttachmentService.findListByFeedbackOpinionId(id,"1");
|
|
|
+ List<AttachmentDTO> attachmentDTOList1 = new ArrayList<>();
|
|
|
+ List<FeedbackAttachment> feedbackAttachmentList1 = feedbackAttachmentService.findListByFeedbackOpinionId(id,"3");
|
|
|
for(FeedbackAttachment feedbackAttachment : feedbackAttachmentList1){
|
|
|
- FeedbackAttachmentDTO feedbackAttachmentDTO = new FeedbackAttachmentDTO();
|
|
|
- feedbackAttachmentDTO.setName(feedbackAttachment.getAttachmentTitle());
|
|
|
- feedbackAttachmentDTO.setUrl(feedbackAttachment.getAttachmentUrl());
|
|
|
- feedbackAttachmentDTOList1.add(feedbackAttachmentDTO);
|
|
|
+ AttachmentDTO attachmentDTO = new AttachmentDTO();
|
|
|
+ attachmentDTO.setName(feedbackAttachment.getAttachmentTitle());
|
|
|
+ attachmentDTO.setUrl(feedbackAttachment.getAttachmentUrl());
|
|
|
+ attachmentDTOList1.add(attachmentDTO);
|
|
|
}
|
|
|
- feedbackOpinion.setAttList(feedbackAttachmentDTOList1);
|
|
|
+ feedbackOpinion.setAttList(attachmentDTOList1);
|
|
|
//图片列表
|
|
|
- List<FeedbackAttachmentDTO> feedbackAttachmentDTOList2 = new ArrayList<>();
|
|
|
+ List<AttachmentDTO> attachmentDTOList2 = new ArrayList<>();
|
|
|
List<FeedbackAttachment> feedbackAttachmentList2 = feedbackAttachmentService.findListByFeedbackOpinionId(id,"2");
|
|
|
String[] picUrlList = new String[feedbackAttachmentList2.size()];
|
|
|
for(int i=0;i<feedbackAttachmentList2.size();i++){
|
|
|
FeedbackAttachment feedbackAttachment = feedbackAttachmentList2.get(i);
|
|
|
- FeedbackAttachmentDTO feedbackAttachmentDTO = new FeedbackAttachmentDTO();
|
|
|
- feedbackAttachmentDTO.setName(feedbackAttachment.getAttachmentTitle());
|
|
|
- feedbackAttachmentDTO.setUrl(feedbackAttachment.getAttachmentUrl());
|
|
|
- feedbackAttachmentDTOList2.add(feedbackAttachmentDTO);
|
|
|
+ AttachmentDTO attachmentDTO = new AttachmentDTO();
|
|
|
+ attachmentDTO.setName(feedbackAttachment.getAttachmentTitle());
|
|
|
+ attachmentDTO.setUrl(feedbackAttachment.getAttachmentUrl());
|
|
|
+ attachmentDTOList2.add(attachmentDTO);
|
|
|
picUrlList[i] = feedbackAttachment.getAttachmentUrl();
|
|
|
}
|
|
|
- feedbackOpinion.setPicList(feedbackAttachmentDTOList2);
|
|
|
+ feedbackOpinion.setPicList(attachmentDTOList2);
|
|
|
feedbackOpinion.setPicUrlList(picUrlList);
|
|
|
//步进列表
|
|
|
List<FeedbackStepStatus> feedbackStepStatusList = feedbackStepStatusService.findByList(feedbackOpinion.getId(),null);
|
|
@@ -193,7 +190,7 @@ public class FeedbackOpinionController {
|
|
|
int affectCount = feedbackOpinionService.update(feedbackOpinion);
|
|
|
|
|
|
if (affectCount > 0) {
|
|
|
- if (feedbackOpinion.getConfirmStatus() == null || !feedbackOpinion.getConfirmStatus()) {
|
|
|
+ if (feedbackOpinion.getConfirmStatus() == null || feedbackOpinion.getConfirmStatus() == 0) {
|
|
|
//删除关联附件及图片
|
|
|
List<FeedbackAttachment> feedbackAttachmentList = feedbackAttachmentService.findListByFeedbackOpinionId(feedbackOpinion.getId(), null);
|
|
|
for (FeedbackAttachment feedbackAttachment : feedbackAttachmentList) {
|
|
@@ -201,13 +198,13 @@ public class FeedbackOpinionController {
|
|
|
}
|
|
|
//关联附件
|
|
|
for (int i = 0; i < feedbackOpinion.getAttList().size(); i++) {
|
|
|
- FeedbackAttachmentDTO feedbackAttachmentDTO = feedbackOpinion.getAttList().get(i);
|
|
|
+ AttachmentDTO attachmentDTO = feedbackOpinion.getAttList().get(i);
|
|
|
FeedbackAttachment feedbackAttachment = new FeedbackAttachment();
|
|
|
feedbackAttachment.setId(UUID.randomUUID().toString());
|
|
|
feedbackAttachment.setFeedbackOpinionId(feedbackOpinion.getId());
|
|
|
feedbackAttachment.setAttachmentType("1");
|
|
|
- feedbackAttachment.setAttachmentTitle(feedbackAttachmentDTO.getName());
|
|
|
- feedbackAttachment.setAttachmentUrl(feedbackAttachmentDTO.getUrl());
|
|
|
+ feedbackAttachment.setAttachmentTitle(attachmentDTO.getName());
|
|
|
+ feedbackAttachment.setAttachmentUrl(attachmentDTO.getUrl());
|
|
|
feedbackAttachment.setSortNo(i);
|
|
|
feedbackAttachment.setCreateBy(subject);
|
|
|
feedbackAttachment.setCreateTime(new Date());
|
|
@@ -215,13 +212,13 @@ public class FeedbackOpinionController {
|
|
|
}
|
|
|
//关联图片
|
|
|
for (int i = 0; i < feedbackOpinion.getPicList().size(); i++) {
|
|
|
- FeedbackAttachmentDTO feedbackAttachmentDTO = feedbackOpinion.getPicList().get(i);
|
|
|
+ AttachmentDTO attachmentDTO = feedbackOpinion.getPicList().get(i);
|
|
|
FeedbackAttachment feedbackAttachment = new FeedbackAttachment();
|
|
|
feedbackAttachment.setId(UUID.randomUUID().toString());
|
|
|
feedbackAttachment.setFeedbackOpinionId(feedbackOpinion.getId());
|
|
|
feedbackAttachment.setAttachmentType("2");
|
|
|
- feedbackAttachment.setAttachmentTitle(feedbackAttachmentDTO.getName());
|
|
|
- feedbackAttachment.setAttachmentUrl(feedbackAttachmentDTO.getUrl());
|
|
|
+ feedbackAttachment.setAttachmentTitle(attachmentDTO.getName());
|
|
|
+ feedbackAttachment.setAttachmentUrl(attachmentDTO.getUrl());
|
|
|
feedbackAttachment.setSortNo(i);
|
|
|
feedbackAttachment.setCreateBy(subject);
|
|
|
feedbackAttachment.setCreateTime(new Date());
|
|
@@ -246,7 +243,7 @@ public class FeedbackOpinionController {
|
|
|
return msgResult;
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value="删除")
|
|
|
+ @ApiOperation(value="删除")
|
|
|
@PostMapping("delete/{id}")
|
|
|
public MessageResult<Integer> delete(@PathVariable("id") String id,@RequestAttribute String subject){
|
|
|
MessageResult<Integer> msgResult = new MessageResult<>();
|
|
@@ -371,12 +368,10 @@ public class FeedbackOpinionController {
|
|
|
}
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(confirmStatus)) {
|
|
|
- if("1".equals(confirmStatus)) {
|
|
|
- searchParams.put("confirmStatus", true);
|
|
|
- }
|
|
|
- if("0".equals(confirmStatus)) {
|
|
|
- searchParams.put("confirmStatus", false);
|
|
|
- }
|
|
|
+ searchParams.put("confirmStatus", confirmStatus);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ searchParams.put("avail", true);
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(timeout)) {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
@@ -515,12 +510,7 @@ public class FeedbackOpinionController {
|
|
|
}
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(confirmStatus)) {
|
|
|
- if("1".equals(confirmStatus)) {
|
|
|
- searchParams.put("confirmStatus", true);
|
|
|
- }
|
|
|
- if("0".equals(confirmStatus)) {
|
|
|
- searchParams.put("confirmStatus", false);
|
|
|
- }
|
|
|
+ searchParams.put("confirmStatus", confirmStatus);
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(timeout)) {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
@@ -580,12 +570,15 @@ public class FeedbackOpinionController {
|
|
|
else{
|
|
|
row.getCell(9).setCellValue("未处理");
|
|
|
}
|
|
|
- if(feedbackOpinion.getConfirmStatus()){
|
|
|
+ if(feedbackOpinion.getConfirmStatus() == 1){
|
|
|
row.getCell(10).setCellValue("已确认");
|
|
|
}
|
|
|
- else{
|
|
|
+ if(feedbackOpinion.getConfirmStatus() == 0){
|
|
|
row.getCell(10).setCellValue("待确认");
|
|
|
}
|
|
|
+ if(feedbackOpinion.getConfirmStatus() == 2){
|
|
|
+ row.getCell(10).setCellValue("忽略");
|
|
|
+ }
|
|
|
|
|
|
row.getCell(0).setCellStyle(cellStyleContent);
|
|
|
row.getCell(1).setCellStyle(cellStyleContent);
|
|
@@ -672,7 +665,7 @@ public class FeedbackOpinionController {
|
|
|
} else {
|
|
|
ZsWCY++;
|
|
|
}
|
|
|
- if (feedbackOpinion.getConfirmStatus() != null && feedbackOpinion.getConfirmStatus()) {
|
|
|
+ if (feedbackOpinion.getConfirmStatus() != null && feedbackOpinion.getConfirmStatus() == 1) {
|
|
|
ZsYQR++;
|
|
|
} else {
|
|
|
ZsWQR++;
|
|
@@ -714,7 +707,7 @@ public class FeedbackOpinionController {
|
|
|
} else {
|
|
|
countWCY++;
|
|
|
}
|
|
|
- if (feedbackOpinion.getConfirmStatus() != null && feedbackOpinion.getConfirmStatus()) {
|
|
|
+ if (feedbackOpinion.getConfirmStatus() != null && feedbackOpinion.getConfirmStatus() == 1) {
|
|
|
countYQR++;
|
|
|
} else {
|
|
|
countWQR++;
|
|
@@ -907,35 +900,48 @@ public class FeedbackOpinionController {
|
|
|
@ApiOperation(value="步进")
|
|
|
@PostMapping("nextStep")
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public MessageResult nextStep(String feedbackOpinionId, String[] orgIds, String allotedDate, @RequestAttribute String subject){
|
|
|
+ public MessageResult nextStep(@RequestBody NextStepDTO nextStepDTO, @RequestAttribute String subject){
|
|
|
MessageResult msgResult = new MessageResult<>();
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
|
try {
|
|
|
//反馈意见
|
|
|
- FeedbackOpinion feedbackOpinion = feedbackOpinionService.get(feedbackOpinionId);
|
|
|
- feedbackOpinion.setConfirmStatus(true);
|
|
|
- feedbackOpinion.setAllotedDate(sdf.parse(allotedDate));
|
|
|
+ FeedbackOpinion feedbackOpinion = feedbackOpinionService.get(nextStepDTO.getOpinionId());
|
|
|
+ feedbackOpinion.setConfirmStatus(1);
|
|
|
+ feedbackOpinion.setAllotedDate(sdf.parse(nextStepDTO.getAllotedDate()));
|
|
|
feedbackOpinionService.update(feedbackOpinion);
|
|
|
|
|
|
+ //反馈意见附件
|
|
|
+ for(AttachmentDTO dto : nextStepDTO.getAttList()) {
|
|
|
+ FeedbackAttachment feedbackAttachment = new FeedbackAttachment();
|
|
|
+ feedbackAttachment.setId(UUID.randomUUID().toString());
|
|
|
+ feedbackAttachment.setFeedbackOpinionId(feedbackOpinion.getId());
|
|
|
+ feedbackAttachment.setAttachmentType("3");
|
|
|
+ feedbackAttachment.setAttachmentTitle(dto.getName());
|
|
|
+ feedbackAttachment.setAttachmentUrl(dto.getUrl());
|
|
|
+ feedbackAttachment.setCreateBy(subject);
|
|
|
+ feedbackAttachment.setCreateTime(new Date());
|
|
|
+ feedbackAttachmentService.insert(feedbackAttachment);
|
|
|
+ }
|
|
|
+
|
|
|
//反馈意见步进
|
|
|
FeedbackStep feedbackStep = new FeedbackStep();
|
|
|
feedbackStep.setId(UUID.randomUUID().toString());
|
|
|
feedbackStep.setFeedbackOpinionId(feedbackOpinion.getId());
|
|
|
- feedbackStep.setAllotedDate(sdf.parse(allotedDate));
|
|
|
+ feedbackStep.setAllotedDate(sdf.parse(nextStepDTO.getAllotedDate()));
|
|
|
feedbackStep.setDelFlag(false);
|
|
|
feedbackStep.setCreateTime(new Date());
|
|
|
feedbackStep.setCreateBy(subject);
|
|
|
feedbackStepService.insert(feedbackStep);
|
|
|
|
|
|
//反馈意见反馈
|
|
|
- for(String orgId : orgIds) {
|
|
|
+ for(String orgId : nextStepDTO.getOrgIds()) {
|
|
|
FeedbackStepStatus feedbackStepStatus = new FeedbackStepStatus();
|
|
|
feedbackStepStatus.setId(UUID.randomUUID().toString());
|
|
|
feedbackStepStatus.setFeedbackStepId(feedbackStep.getId());
|
|
|
feedbackStepStatus.setOrgId(orgId);
|
|
|
feedbackStepStatus.setStatus(false);
|
|
|
- feedbackStepStatus.setAllotedDate(sdf.parse(allotedDate));
|
|
|
+ feedbackStepStatus.setAllotedDate(sdf.parse(nextStepDTO.getAllotedDate()));
|
|
|
feedbackStepStatus.setDelFlag(false);
|
|
|
feedbackStepStatus.setCreateTime(new Date());
|
|
|
feedbackStepStatus.setCreateBy(subject);
|
|
@@ -962,7 +968,7 @@ public class FeedbackOpinionController {
|
|
|
try {
|
|
|
//反馈意见
|
|
|
FeedbackOpinion feedbackOpinion = feedbackOpinionService.get(feedbackOpinionId);
|
|
|
- feedbackOpinion.setConfirmStatus(true);
|
|
|
+ feedbackOpinion.setConfirmStatus(1);
|
|
|
feedbackOpinion.setOpinionStatus(true);
|
|
|
feedbackOpinion.setUpdateBy(subject);
|
|
|
feedbackOpinion.setUpdateTime(new Date());
|
|
@@ -980,6 +986,30 @@ public class FeedbackOpinionController {
|
|
|
return msgResult;
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value="完成")
|
|
|
+ @PostMapping("noAvail")
|
|
|
+ public MessageResult noAvail(String feedbackOpinionId, @RequestAttribute String subject){
|
|
|
+ MessageResult msgResult = new MessageResult<>();
|
|
|
+ try {
|
|
|
+ //反馈意见
|
|
|
+ FeedbackOpinion feedbackOpinion = feedbackOpinionService.get(feedbackOpinionId);
|
|
|
+ feedbackOpinion.setConfirmStatus(2);
|
|
|
+ feedbackOpinion.setUpdateBy(subject);
|
|
|
+ feedbackOpinion.setUpdateTime(new Date());
|
|
|
+ feedbackOpinionService.update(feedbackOpinion);
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ }
|
|
|
+ catch(Exception ex){
|
|
|
+ logger.error(ex.getMessage(),ex);
|
|
|
+
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
+
|
|
|
private String parentFullName(String parentId){
|
|
|
String fullName = "";
|
|
|
|