|
@@ -6,18 +6,16 @@ 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.FeedbackOpinionReportDTO;
|
|
|
-import com.jpsoft.excellent.modules.base.entity.Area;
|
|
|
-import com.jpsoft.excellent.modules.base.entity.FeedbackAttachment;
|
|
|
-import com.jpsoft.excellent.modules.base.service.AreaService;
|
|
|
-import com.jpsoft.excellent.modules.base.service.FeedbackAttachmentService;
|
|
|
+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.base.entity.FeedbackOpinion;
|
|
|
-import com.jpsoft.excellent.modules.base.service.FeedbackOpinionService;
|
|
|
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;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -26,6 +24,7 @@ import org.apache.poi.ss.usermodel.*;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
@@ -45,8 +44,16 @@ public class FeedbackOpinionController {
|
|
|
@Autowired
|
|
|
private DataDictionaryService dataDictionaryService;
|
|
|
@Autowired
|
|
|
+ private UserService userService;
|
|
|
+ @Autowired
|
|
|
+ private WorkStationService workStationService;
|
|
|
+ @Autowired
|
|
|
private FeedbackOpinionService feedbackOpinionService;
|
|
|
@Autowired
|
|
|
+ private FeedbackStepService feedbackStepService;
|
|
|
+ @Autowired
|
|
|
+ private FeedbackStepStatusService feedbackStepStatusService;
|
|
|
+ @Autowired
|
|
|
private FeedbackAttachmentService feedbackAttachmentService;
|
|
|
@Autowired
|
|
|
private AreaService areaService;
|
|
@@ -138,6 +145,19 @@ public class FeedbackOpinionController {
|
|
|
}
|
|
|
feedbackOpinion.setPicList(feedbackAttachmentDTOList2);
|
|
|
feedbackOpinion.setPicUrlList(picUrlList);
|
|
|
+ //步进列表
|
|
|
+ List<FeedbackStepStatus> feedbackStepStatusList = feedbackStepStatusService.findByList(feedbackOpinion.getId(),null);
|
|
|
+ for(FeedbackStepStatus feedbackStepStatus : feedbackStepStatusList){
|
|
|
+ if(StringUtils.isNotEmpty(feedbackStepStatus.getStationId())){
|
|
|
+ WorkStation workStation = workStationService.get(feedbackStepStatus.getStationId());
|
|
|
+ feedbackStepStatus.setStationName(workStation.getStationName());
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotEmpty(feedbackStepStatus.getUserId())){
|
|
|
+ User user = userService.get(feedbackStepStatus.getUserId());
|
|
|
+ feedbackStepStatus.setUserName(user.getRealName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ feedbackOpinion.setStepStatusList(feedbackStepStatusList);
|
|
|
|
|
|
if (feedbackOpinion != null) {
|
|
|
msgResult.setResult(true);
|
|
@@ -369,6 +389,13 @@ public class FeedbackOpinionController {
|
|
|
if(StringUtils.isNotEmpty(feedbackOpinion.getAreaId())) {
|
|
|
feedbackOpinion.setAreaName(parentFullName(feedbackOpinion.getAreaId()));
|
|
|
}
|
|
|
+ int num = feedbackStepStatusService.findByList(feedbackOpinion.getId(),false).size();
|
|
|
+ if(num > 0) {
|
|
|
+ feedbackOpinion.setIsProcessed(false);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ feedbackOpinion.setIsProcessed(true);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
msgResult.setResult(true);
|
|
@@ -690,6 +717,73 @@ public class FeedbackOpinionController {
|
|
|
return msgResult;
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value="列表")
|
|
|
+ @RequestMapping(value = "pageListTodo",method = RequestMethod.POST)
|
|
|
+ public MessageResult<Map> pageListTodo(
|
|
|
+ String connectPhone, Date[] reportDate,
|
|
|
+ @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
+ @RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
+ @RequestAttribute String subject){
|
|
|
+ MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("create_time","desc"));
|
|
|
+
|
|
|
+ Map<String,Object> searchParams = new HashMap<>();
|
|
|
+ User user = userService.get(subject);
|
|
|
+ if(StringUtils.isNotEmpty(user.getStationId())) {
|
|
|
+ searchParams.put("workStation", user.getStationId());
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ searchParams.put("workStation", "0");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(connectPhone)) {
|
|
|
+ searchParams.put("connectPhone","%" + connectPhone + "%");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (reportDate.length > 0) {
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ Calendar calendar = new GregorianCalendar();
|
|
|
+ calendar.setTime(reportDate[1]);
|
|
|
+ calendar.add(calendar.DATE,1);
|
|
|
+
|
|
|
+ searchParams.put("reportDateStart",sdf.format(reportDate[0]));
|
|
|
+ searchParams.put("reportDateEnd",sdf.format(calendar.getTime()));
|
|
|
+ }
|
|
|
+
|
|
|
+ Page<FeedbackOpinion> page = feedbackOpinionService.pageSearchTodo(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(PojoUtils.pageWrapper(page));
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value="意见待办处理")
|
|
|
+ @RequestMapping(value = "saveTodo",method = RequestMethod.POST)
|
|
|
+ public MessageResult saveTodo(String stepStatusId, String content, @RequestAttribute String subject){
|
|
|
+ MessageResult msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ try {
|
|
|
+ FeedbackStepStatus feedbackStepStatus = feedbackStepStatusService.get(stepStatusId);
|
|
|
+ feedbackStepStatus.setUserId(subject);
|
|
|
+ feedbackStepStatus.setContent(content);
|
|
|
+ feedbackStepStatus.setStatus(true);
|
|
|
+ feedbackStepStatus.setUpdateBy(subject);
|
|
|
+ feedbackStepStatus.setUpdateTime(new Date());
|
|
|
+ feedbackStepStatusService.update(feedbackStepStatus);
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ }
|
|
|
+ catch (Exception exception) {
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage(exception.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value="导出报表")
|
|
|
@RequestMapping(value = "reportXls",method = RequestMethod.POST)
|
|
|
public String reportXls(@RequestBody FeedbackOpinionReportDTO feedbackOpinionReportDTO){
|
|
@@ -788,6 +882,81 @@ public class FeedbackOpinionController {
|
|
|
return downloadUrl;
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value="步进")
|
|
|
+ @PostMapping("nextStep")
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public MessageResult nextStep(String feedbackOpinionId, String[] stationIds, String allotedDate, @RequestAttribute String subject){
|
|
|
+ MessageResult msgResult = new MessageResult<>();
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+
|
|
|
+ try {
|
|
|
+ //反馈意见
|
|
|
+ FeedbackOpinion feedbackOpinion = feedbackOpinionService.get(feedbackOpinionId);
|
|
|
+ feedbackOpinion.setConfirmStatus(true);
|
|
|
+ feedbackOpinionService.update(feedbackOpinion);
|
|
|
+
|
|
|
+ //反馈意见步进
|
|
|
+ FeedbackStep feedbackStep = new FeedbackStep();
|
|
|
+ feedbackStep.setId(UUID.randomUUID().toString());
|
|
|
+ feedbackStep.setFeedbackOpinionId(feedbackOpinion.getId());
|
|
|
+ feedbackStep.setAllotedDate(sdf.parse(allotedDate));
|
|
|
+ feedbackStep.setDelFlag(false);
|
|
|
+ feedbackStep.setCreateTime(new Date());
|
|
|
+ feedbackStep.setCreateBy(subject);
|
|
|
+ feedbackStepService.insert(feedbackStep);
|
|
|
+
|
|
|
+ //反馈意见反馈
|
|
|
+ for(String stationId : stationIds) {
|
|
|
+ FeedbackStepStatus feedbackStepStatus = new FeedbackStepStatus();
|
|
|
+ feedbackStepStatus.setId(UUID.randomUUID().toString());
|
|
|
+ feedbackStepStatus.setFeedbackStepId(feedbackStep.getId());
|
|
|
+ feedbackStepStatus.setStationId(stationId);
|
|
|
+ feedbackStepStatus.setStatus(false);
|
|
|
+ feedbackStepStatus.setAllotedDate(sdf.parse(allotedDate));
|
|
|
+ feedbackStepStatus.setDelFlag(false);
|
|
|
+ feedbackStepStatus.setCreateTime(new Date());
|
|
|
+ feedbackStepStatus.setCreateBy(subject);
|
|
|
+ feedbackStepStatusService.insert(feedbackStepStatus);
|
|
|
+ }
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ }
|
|
|
+ catch(Exception ex){
|
|
|
+ logger.error(ex.getMessage(),ex);
|
|
|
+
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value="完成")
|
|
|
+ @PostMapping("finish")
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public MessageResult finish(String feedbackOpinionId, @RequestAttribute String subject){
|
|
|
+ MessageResult msgResult = new MessageResult<>();
|
|
|
+ try {
|
|
|
+ //反馈意见
|
|
|
+ FeedbackOpinion feedbackOpinion = feedbackOpinionService.get(feedbackOpinionId);
|
|
|
+ feedbackOpinion.setConfirmStatus(true);
|
|
|
+ feedbackOpinion.setOpinionStatus(true);
|
|
|
+ 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 = "";
|
|
|
|