|
@@ -4,13 +4,13 @@ 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.entity.*;
|
|
|
-import com.jpsoft.excellent.modules.base.service.AreaService;
|
|
|
-import com.jpsoft.excellent.modules.base.service.OfficeAttachmentService;
|
|
|
+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.service.OfficeOpinionService;
|
|
|
+import com.jpsoft.excellent.modules.sys.entity.User;
|
|
|
+import com.jpsoft.excellent.modules.sys.service.UserService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -19,6 +19,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;
|
|
@@ -40,7 +41,13 @@ public class OfficeOpinionController {
|
|
|
@Autowired
|
|
|
private OfficeAttachmentService officeAttachmentService;
|
|
|
@Autowired
|
|
|
+ private OfficeReplyService officeReplyService;
|
|
|
+ @Autowired
|
|
|
private AreaService areaService;
|
|
|
+ @Autowired
|
|
|
+ private OrganizationService organizationService;
|
|
|
+ @Autowired
|
|
|
+ private UserService userService;
|
|
|
|
|
|
@ApiOperation(value="创建空记录")
|
|
|
@GetMapping("create")
|
|
@@ -128,6 +135,19 @@ public class OfficeOpinionController {
|
|
|
}
|
|
|
officeOpinion.setPicList(feedbackAttachmentDTOList2);
|
|
|
officeOpinion.setPicUrlList(picUrlList);
|
|
|
+ //步进列表
|
|
|
+ List<OfficeReply> officeReplyList = officeReplyService.findByList(officeOpinion.getId(),null);
|
|
|
+ for(OfficeReply officeReply : officeReplyList){
|
|
|
+ if(StringUtils.isNotEmpty(officeReply.getOrgId())){
|
|
|
+ Organization organization = organizationService.get(officeReply.getOrgId());
|
|
|
+ officeReply.setOrgName(organization.getName());
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotEmpty(officeReply.getUserId())){
|
|
|
+ User user = userService.get(officeReply.getUserId());
|
|
|
+ officeReply.setUserName(user.getRealName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ officeOpinion.setOfficeReplyList(officeReplyList);
|
|
|
|
|
|
if (officeOpinion != null) {
|
|
|
msgResult.setResult(true);
|
|
@@ -282,7 +302,7 @@ public class OfficeOpinionController {
|
|
|
@ApiOperation(value="列表")
|
|
|
@RequestMapping(value = "pageList",method = RequestMethod.POST)
|
|
|
public MessageResult<Map> pageList(
|
|
|
- String connect, String connectPhone, String areaId, Boolean areaSubordinate, String isSatisfied, String opinionStatus, String confirmStatus, Date[] reportDate,
|
|
|
+ String connect, String connectPhone, String areaId, Boolean areaSubordinate, String isSatisfied, String opinionStatus, String confirmStatus, Date[] reportDate, String timeout,
|
|
|
@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
@RequestAttribute String subject){
|
|
@@ -328,6 +348,15 @@ public class OfficeOpinionController {
|
|
|
searchParams.put("confirmStatus", false);
|
|
|
}
|
|
|
}
|
|
|
+ if (StringUtils.isNotEmpty(timeout)) {
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ if("1".equals(timeout)) {
|
|
|
+ searchParams.put("timeout", sdf.format(new Date()));
|
|
|
+ }
|
|
|
+ if("0".equals(timeout)) {
|
|
|
+ searchParams.put("noTimeout", sdf.format(new Date()));
|
|
|
+ }
|
|
|
+ }
|
|
|
if (reportDate.length > 0) {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
Calendar calendar = new GregorianCalendar();
|
|
@@ -346,6 +375,13 @@ public class OfficeOpinionController {
|
|
|
if(StringUtils.isNotEmpty(officeOpinion.getAreaId())) {
|
|
|
officeOpinion.setAreaName(parentFullName(officeOpinion.getAreaId()));
|
|
|
}
|
|
|
+ int num = officeReplyService.findByList(officeOpinion.getId(),false).size();
|
|
|
+ if(num > 0) {
|
|
|
+ officeOpinion.setIsProcessed(false);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ officeOpinion.setIsProcessed(true);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
msgResult.setResult(true);
|
|
@@ -403,7 +439,7 @@ public class OfficeOpinionController {
|
|
|
@RequestMapping(value = "reportListXls",method = RequestMethod.POST)
|
|
|
public String reportListXls(String sort, String connect, String connectPhone, String areaId, String workStation, String window,
|
|
|
String isSatisfied, String opinionStatus, String confirmStatus, String[] cause, Date[] reportDate,
|
|
|
- Boolean areaSubordinate, @RequestAttribute String subject){
|
|
|
+ Boolean areaSubordinate, String timeout, @RequestAttribute String subject){
|
|
|
String downloadUrl = "";
|
|
|
|
|
|
//新建文档
|
|
@@ -491,6 +527,15 @@ public class OfficeOpinionController {
|
|
|
searchParams.put("confirmStatus", false);
|
|
|
}
|
|
|
}
|
|
|
+ if (StringUtils.isNotEmpty(timeout)) {
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ if("1".equals(timeout)) {
|
|
|
+ searchParams.put("timeout", sdf.format(new Date()));
|
|
|
+ }
|
|
|
+ if("0".equals(timeout)) {
|
|
|
+ searchParams.put("noTimeout", sdf.format(new Date()));
|
|
|
+ }
|
|
|
+ }
|
|
|
if (reportDate.length > 0) {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
Calendar calendar = new GregorianCalendar();
|
|
@@ -578,4 +623,137 @@ public class OfficeOpinionController {
|
|
|
|
|
|
return downloadUrl;
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value="步进")
|
|
|
+ @PostMapping("nextStep")
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public MessageResult nextStep(String opinionId, String[] orgIds, String allotedDate, @RequestAttribute String subject){
|
|
|
+ MessageResult msgResult = new MessageResult<>();
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+
|
|
|
+ try {
|
|
|
+ //群众评议
|
|
|
+ OfficeOpinion officeOpinion = officeOpinionService.get(opinionId);
|
|
|
+ officeOpinion.setConfirmStatus(true);
|
|
|
+ officeOpinion.setAllotedDate(sdf.parse(allotedDate));
|
|
|
+ officeOpinionService.update(officeOpinion);
|
|
|
+
|
|
|
+ //群众评议反馈
|
|
|
+ for(String org : orgIds) {
|
|
|
+ OfficeReply officeReply = new OfficeReply();
|
|
|
+ officeReply.setId(UUID.randomUUID().toString());
|
|
|
+ officeReply.setOpinionId(officeOpinion.getId());
|
|
|
+ officeReply.setOrgId(org);
|
|
|
+ officeReply.setStatus(false);
|
|
|
+ officeReply.setAllotedDate(sdf.parse(allotedDate));
|
|
|
+ officeReply.setDelFlag(false);
|
|
|
+ officeReply.setCreateTime(new Date());
|
|
|
+ officeReply.setCreateBy(subject);
|
|
|
+ officeReplyService.insert(officeReply);
|
|
|
+ }
|
|
|
+
|
|
|
+ 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 opinionId, @RequestAttribute String subject){
|
|
|
+ MessageResult msgResult = new MessageResult<>();
|
|
|
+ try {
|
|
|
+ //反馈意见
|
|
|
+ OfficeOpinion officeOpinion = officeOpinionService.get(opinionId);
|
|
|
+ officeOpinion.setConfirmStatus(true);
|
|
|
+ officeOpinion.setOpinionStatus(true);
|
|
|
+ officeOpinion.setUpdateBy(subject);
|
|
|
+ officeOpinion.setUpdateTime(new Date());
|
|
|
+ officeOpinionService.update(officeOpinion);
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ }
|
|
|
+ catch(Exception ex){
|
|
|
+ logger.error(ex.getMessage(),ex);
|
|
|
+
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ 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.getOrgId())) {
|
|
|
+ searchParams.put("orgId", user.getOrgId());
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ searchParams.put("orgId", "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<OfficeOpinion> page = officeOpinionService.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 replyId, String content, @RequestAttribute String subject){
|
|
|
+ MessageResult msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ try {
|
|
|
+ OfficeReply officeReply = officeReplyService.get(replyId);
|
|
|
+ officeReply.setUserId(subject);
|
|
|
+ officeReply.setContent(content);
|
|
|
+ officeReply.setStatus(true);
|
|
|
+ officeReply.setUpdateBy(subject);
|
|
|
+ officeReply.setUpdateTime(new Date());
|
|
|
+ officeReplyService.update(officeReply);
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ }
|
|
|
+ catch (Exception exception) {
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage(exception.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
}
|