|
@@ -52,6 +52,8 @@ public class IncidentController {
|
|
|
@Autowired
|
|
|
private IncidentStepService incidentStepService;
|
|
|
@Autowired
|
|
|
+ private IncidentReplyService incidentReplyService;
|
|
|
+ @Autowired
|
|
|
private DataDictionaryService dataDictionaryService;
|
|
|
@Autowired
|
|
|
private OrganizationService organizationService;
|
|
@@ -70,12 +72,10 @@ public class IncidentController {
|
|
|
MessageResult<Incident> msgResult = new MessageResult<>();
|
|
|
|
|
|
List<IncidentAttachmentDTO> incidentAttachmentDTOList = new ArrayList<IncidentAttachmentDTO>();
|
|
|
- IncidentStep incidentStep = new IncidentStep();
|
|
|
|
|
|
Incident incident = new Incident();
|
|
|
incident.setAttList(incidentAttachmentDTOList);
|
|
|
incident.setPicList(incidentAttachmentDTOList);
|
|
|
- incident.setFirstStep(incidentStep);
|
|
|
|
|
|
msgResult.setData(incident);
|
|
|
msgResult.setResult(true);
|
|
@@ -125,57 +125,19 @@ public class IncidentController {
|
|
|
incidentAttachment.setCreateTime(new Date());
|
|
|
incidentAttachmentService.insert(incidentAttachment);
|
|
|
}
|
|
|
- //启动督查,下发第一步任务
|
|
|
- if(incident.getFirstStep() != null) {
|
|
|
- IncidentStep incidentStep = new IncidentStep();
|
|
|
- incidentStep.setId(UUID.randomUUID().toString());
|
|
|
- incidentStep.setIncidentId(incident.getId());
|
|
|
- incidentStep.setOrgId(incident.getFirstStep().getOrgId());
|
|
|
- incidentStep.setWarnDate1(incident.getFirstStep().getWarnDate1());
|
|
|
- incidentStep.setIsWarned1(false);
|
|
|
- incidentStep.setWarnDate2(incident.getFirstStep().getWarnDate2());
|
|
|
- incidentStep.setIsWarned2(false);
|
|
|
- incidentStep.setWarnDate3(incident.getFirstStep().getWarnDate3());
|
|
|
- incidentStep.setIsWarned3(false);
|
|
|
- incidentStep.setAllotedDate(incident.getFirstStep().getAllotedDate());
|
|
|
-// incidentStep.setContent("办理中");
|
|
|
- incidentStep.setCreateBy(subject);
|
|
|
- incidentStep.setCreateTime(new Date());
|
|
|
- incidentStepService.insert(incidentStep);
|
|
|
-
|
|
|
- //保存到交办单位操作表
|
|
|
- //List<IncidentStepStatus> incidentStepStatusList = incidentStepStatusService.findByIncidentId(incident.getId());
|
|
|
- incidentStepStatusService.deleteByIncidentId(incident.getId());
|
|
|
- String [] orgIds = incident.getFirstStep().getOrgId().split(",");
|
|
|
- for(String orgId : orgIds){
|
|
|
- IncidentStepStatus incidentStepStatus = new IncidentStepStatus();
|
|
|
- incidentStepStatus.setId(UUID.randomUUID().toString());
|
|
|
- incidentStepStatus.setCreateBy(subject);
|
|
|
- incidentStepStatus.setCreateTime(new Date());
|
|
|
- incidentStepStatus.setIncidentId(incident.getId());
|
|
|
- incidentStepStatus.setIncidentStepId(incidentStep.getId());
|
|
|
- incidentStepStatus.setOrgId(orgId);
|
|
|
- incidentStepStatus.setStatus("0");
|
|
|
- incidentStepStatus.setDelFlag(false);
|
|
|
- incidentStepStatusService.insert(incidentStepStatus);
|
|
|
- }
|
|
|
|
|
|
- User user = userService.get(subject);
|
|
|
- SimpleDateFormat sdfDetail = new SimpleDateFormat("yyyy年MM月dd日");
|
|
|
- String templateId = "";
|
|
|
- String MessageContent = "";
|
|
|
- //发送跟踪专班短信
|
|
|
- templateId = "2431012137069";
|
|
|
- MessageContent = "您有一条待办提醒,请登录双优督办平台手机端查看。(http://39.104.144.104/excellent-mobile)";
|
|
|
- sendSMSing(MessageContent, templateId, null, incident.getSpecialClassId(), "");
|
|
|
- //发送交办单位短信
|
|
|
- templateId = "2431012137069";
|
|
|
- MessageContent = "您有一条待办提醒,请登录双优督办平台电脑端查看。(http://39.104.144.104/excellent-portal)";
|
|
|
- sendSMSing(MessageContent, templateId, incidentStep.getOrgId(), null, "");
|
|
|
-// templateId = "2431012137069";
|
|
|
-// MessageContent = String.format("您好!%s,市委督查室已向你单位发送了督办事项“%s”,请安排人员及时接收办理。联系人:%s %s。", sdfDetail.format(incidentStep.getCreateTime()), incident.getTitle(), user.getRealName(), user.getPhone());
|
|
|
-// SMSUtil.sendSMSing(MessageContent, templateId, incidentStep.getOrgId(), null, "");
|
|
|
- }
|
|
|
+// User user = userService.get(subject);
|
|
|
+// SimpleDateFormat sdfDetail = new SimpleDateFormat("yyyy年MM月dd日");
|
|
|
+ String templateId = "";
|
|
|
+ String MessageContent = "";
|
|
|
+ //发送跟踪专班短信
|
|
|
+ templateId = "2431012137069";
|
|
|
+ MessageContent = "您有一条待办提醒,请登录双优督办平台手机端查看。(http://39.104.144.104/excellent-mobile)";
|
|
|
+ sendSMSing(MessageContent, templateId, null, incident.getSpecialClassId(), "");
|
|
|
+ //发送交办单位短信
|
|
|
+ templateId = "2431012137069";
|
|
|
+ MessageContent = "您有一条待办提醒,请登录双优督办平台电脑端查看。(http://39.104.144.104/excellent-portal)";
|
|
|
+ sendSMSing(MessageContent, templateId, incident.getOrgId(), null, "");
|
|
|
|
|
|
msgResult.setResult(true);
|
|
|
msgResult.setData(incident);
|
|
@@ -203,7 +165,17 @@ public class IncidentController {
|
|
|
//督办事件
|
|
|
Incident incident = incidentService.get(id);
|
|
|
incident.setSpecialClassName(dataDictionaryService.getName(incident.getSpecialClassId()));
|
|
|
- incident.setNewStep(new IncidentStep());
|
|
|
+ List<String> orgNames = new ArrayList<>();
|
|
|
+ String[] orgIds = incident.getOrgId().split(",");
|
|
|
+ for(String orgId : orgIds) {
|
|
|
+ Organization organization = organizationService.get(orgId);
|
|
|
+ orgNames.add(organization.getName());
|
|
|
+ }
|
|
|
+ incident.setOrgName(String.join(",", orgNames));
|
|
|
+ IncidentReply incidentReplyNew = new IncidentReply();
|
|
|
+ incidentReplyNew.setAttList(new ArrayList<IncidentAttachmentDTO>());
|
|
|
+ incidentReplyNew.setPicList(new ArrayList<IncidentAttachmentDTO>());
|
|
|
+ incident.setNewReply(incidentReplyNew);
|
|
|
//附件列表
|
|
|
List<IncidentAttachment> incidentAttachmentList1 = incidentAttachmentService.findListByIncidentId(id,"1");
|
|
|
List<IncidentAttachmentDTO> incidentAttachmentDTOList1 = new ArrayList<>();
|
|
@@ -228,32 +200,44 @@ public class IncidentController {
|
|
|
}
|
|
|
incident.setPicList(incidentAttachmentDTOList2);
|
|
|
incident.setPicUrlList(picUrlList);
|
|
|
- //首次步进
|
|
|
- List<IncidentStep> incidentStepList = incidentStepService.findListByIncidentId(id);
|
|
|
- if(incidentStepList.size() > 0) {
|
|
|
- for(IncidentStep incidentStep : incidentStepList){
|
|
|
- List<String> orgNames = new ArrayList<>();
|
|
|
- List<String> personNames = new ArrayList<>();
|
|
|
- String[] orgIds = incidentStep.getOrgId().split(",");
|
|
|
- for(String orgId : orgIds) {
|
|
|
- Organization organization = organizationService.get(orgId);
|
|
|
- orgNames.add(organization.getName());
|
|
|
-
|
|
|
- List<Person> personList = personService.findListByOrgId(orgId);
|
|
|
- for(Person person : personList) {
|
|
|
- personNames.add(person.getName());
|
|
|
- }
|
|
|
- }
|
|
|
- incidentStep.setOrgName(String.join(",", orgNames));
|
|
|
- incidentStep.setPersonName(String.join(",", personNames));
|
|
|
+ //回复列表
|
|
|
+ List<IncidentReply> incidentReplyList = incidentReplyService.findListByIncidentId(id);
|
|
|
+ for(IncidentReply incidentReply : incidentReplyList){
|
|
|
+ if(StringUtils.isNotEmpty(incidentReply.getOrgId())) {
|
|
|
+ Organization organization = organizationService.get(incidentReply.getOrgId());
|
|
|
+ incidentReply.setOrgName(organization.getName());
|
|
|
}
|
|
|
- incident.setIncidentStepList(incidentStepList);
|
|
|
- incident.setFirstStep(incidentStepList.get(0));
|
|
|
- incident.setLastStep(incidentStepList.get(incidentStepList.size()-1));
|
|
|
-
|
|
|
- incident.setAttStepOrgList(new ArrayList<>());
|
|
|
- incident.setPicStepOrgList(new ArrayList<>());
|
|
|
+ if(StringUtils.isNotEmpty(incidentReply.getSpecialClassId())) {
|
|
|
+ incidentReply.setSpecialClassName(dataDictionaryService.getName(incidentReply.getSpecialClassId()));
|
|
|
+ }
|
|
|
+ User user = userService.get(incidentReply.getUserId());
|
|
|
+ incidentReply.setUserName(user.getRealName());
|
|
|
+ //附件列表
|
|
|
+ List<IncidentAttachment> incidentAttachments1 = incidentAttachmentService.findListByIncidentId(incidentReply.getId(),"1");
|
|
|
+ List<IncidentAttachmentDTO> incidentAttachmentDTOS1 = new ArrayList<>();
|
|
|
+ for(IncidentAttachment incidentAttachment : incidentAttachments1){
|
|
|
+ IncidentAttachmentDTO incidentAttachmentDTO = new IncidentAttachmentDTO();
|
|
|
+ incidentAttachmentDTO.setName(incidentAttachment.getAttachmentTitle());
|
|
|
+ incidentAttachmentDTO.setUrl(incidentAttachment.getAttachmentUrl());
|
|
|
+ incidentAttachmentDTOS1.add(incidentAttachmentDTO);
|
|
|
+ }
|
|
|
+ incidentReply.setAttList(incidentAttachmentDTOS1);
|
|
|
+ //图片列表
|
|
|
+ List<IncidentAttachment> incidentAttachments2 = incidentAttachmentService.findListByIncidentId(incidentReply.getId(),"2");
|
|
|
+ List<IncidentAttachmentDTO> incidentAttachmentDTOS2 = new ArrayList<>();
|
|
|
+ String[] picUrlListEx = new String[incidentAttachments2.size()];
|
|
|
+ for(int i=0;i<incidentAttachments2.size();i++){
|
|
|
+ IncidentAttachment incidentAttachment = incidentAttachments2.get(i);
|
|
|
+ IncidentAttachmentDTO incidentAttachmentDTO = new IncidentAttachmentDTO();
|
|
|
+ incidentAttachmentDTO.setName(incidentAttachment.getAttachmentTitle());
|
|
|
+ incidentAttachmentDTO.setUrl(incidentAttachment.getAttachmentUrl());
|
|
|
+ incidentAttachmentDTOS2.add(incidentAttachmentDTO);
|
|
|
+ picUrlListEx[i] = incidentAttachment.getAttachmentUrl();
|
|
|
+ }
|
|
|
+ incidentReply.setPicList(incidentAttachmentDTOS2);
|
|
|
+ incidentReply.setPicUrlList(picUrlListEx);
|
|
|
}
|
|
|
+ incident.setIncidentReplyList(incidentReplyList);
|
|
|
|
|
|
if (incident != null) {
|
|
|
msgResult.setResult(true);
|
|
@@ -318,52 +302,19 @@ public class IncidentController {
|
|
|
incidentAttachment.setCreateTime(new Date());
|
|
|
incidentAttachmentService.insert(incidentAttachment);
|
|
|
}
|
|
|
- //启动督查,下发第一步任务
|
|
|
- if(incident.getFirstStep() != null) {
|
|
|
- IncidentStep incidentStep = incidentStepService.get(incident.getFirstStep().getId());
|
|
|
- incidentStep.setOrgId(incident.getFirstStep().getOrgId());
|
|
|
- incidentStep.setWarnDate1(incident.getFirstStep().getWarnDate1());
|
|
|
- incidentStep.setIsWarned1(false);
|
|
|
- incidentStep.setWarnDate2(incident.getFirstStep().getWarnDate2());
|
|
|
- incidentStep.setIsWarned2(false);
|
|
|
- incidentStep.setWarnDate3(incident.getFirstStep().getWarnDate3());
|
|
|
- incidentStep.setIsWarned3(false);
|
|
|
- incidentStep.setAllotedDate(incident.getFirstStep().getAllotedDate());
|
|
|
-// incidentStep.setContent("办理中");
|
|
|
- incidentStep.setUpdateBy(subject);
|
|
|
- incidentStep.setUpdateTime(new Date());
|
|
|
- incidentStepService.update(incidentStep);
|
|
|
-
|
|
|
- //保存到交办单位操作表
|
|
|
- //List<IncidentStepStatus> incidentStepStatusList = incidentStepStatusService.findByIncidentId(incident.getId());
|
|
|
- incidentStepStatusService.deleteByIncidentId(incident.getId());
|
|
|
- String [] orgIds = incident.getFirstStep().getOrgId().split(",");
|
|
|
- for(String orgId : orgIds){
|
|
|
- IncidentStepStatus incidentStepStatus = new IncidentStepStatus();
|
|
|
- incidentStepStatus.setId(UUID.randomUUID().toString());
|
|
|
- incidentStepStatus.setCreateBy(subject);
|
|
|
- incidentStepStatus.setCreateTime(new Date());
|
|
|
- incidentStepStatus.setIncidentId(incident.getId());
|
|
|
- incidentStepStatus.setIncidentStepId(incidentStep.getId());
|
|
|
- incidentStepStatus.setOrgId(orgId);
|
|
|
- incidentStepStatus.setStatus("0");
|
|
|
- incidentStepStatus.setDelFlag(false);
|
|
|
- incidentStepStatusService.insert(incidentStepStatus);
|
|
|
- }
|
|
|
|
|
|
- User user = userService.get(subject);
|
|
|
- SimpleDateFormat sdfDetail = new SimpleDateFormat("yyyy年MM月dd日");
|
|
|
- String templateId = "";
|
|
|
- String MessageContent = "";
|
|
|
- //发送跟踪专班短信
|
|
|
- templateId = "2431012152806";
|
|
|
- MessageContent = "您有一条待办提醒,请登录双优督办平台手机端查看。(http://39.104.144.104/excellent-mobile)";
|
|
|
- sendSMSing(MessageContent, templateId, null, incident.getSpecialClassId(), "");
|
|
|
- //发送交办单位短信
|
|
|
- templateId = "2431012152806";
|
|
|
- MessageContent = "您有一条待办提醒,请登录双优督办平台电脑端查看。(http://39.104.144.104/excellent-portal)";
|
|
|
- sendSMSing(MessageContent, templateId, incidentStep.getOrgId(), null, "");
|
|
|
- }
|
|
|
+// User user = userService.get(subject);
|
|
|
+// SimpleDateFormat sdfDetail = new SimpleDateFormat("yyyy年MM月dd日");
|
|
|
+ String templateId = "";
|
|
|
+ String MessageContent = "";
|
|
|
+ //发送跟踪专班短信
|
|
|
+ templateId = "2431012152806";
|
|
|
+ MessageContent = "您有一条待办提醒,请登录双优督办平台手机端查看。(http://39.104.144.104/excellent-mobile)";
|
|
|
+ sendSMSing(MessageContent, templateId, null, incident.getSpecialClassId(), "");
|
|
|
+ //发送交办单位短信
|
|
|
+ templateId = "2431012152806";
|
|
|
+ MessageContent = "您有一条待办提醒,请登录双优督办平台电脑端查看。(http://39.104.144.104/excellent-portal)";
|
|
|
+ sendSMSing(MessageContent, templateId, incident.getOrgId(), null, "");
|
|
|
|
|
|
msgResult.setResult(true);
|
|
|
msgResult.setData(incident);
|
|
@@ -386,47 +337,59 @@ public class IncidentController {
|
|
|
@PostMapping("nextStep")
|
|
|
public MessageResult<Incident> nextStep(@RequestBody Incident incident, @RequestAttribute String subject){
|
|
|
MessageResult<Incident> msgResult = new MessageResult<>();
|
|
|
+ User user = userService.get(subject);
|
|
|
+ Organization organization = organizationService.get(incident.getOrgId());
|
|
|
|
|
|
try {
|
|
|
- //更新当前最后一条的督办记录的处置记录
|
|
|
- IncidentStep incidentStep = incident.getLastStep();
|
|
|
- incidentStep.setIsWarned1(true);
|
|
|
- incidentStep.setIsWarned2(true);
|
|
|
- incidentStep.setIsWarned3(true);
|
|
|
- incidentStep.setUpdateBy(subject);
|
|
|
- incidentStep.setUpdateTime(new Date());
|
|
|
- incidentStepService.update(incidentStep);
|
|
|
-
|
|
|
- if(StringUtils.isEmpty(incident.getNewStep().getOrgId())){
|
|
|
- //督办事件办结
|
|
|
- incident.setIsFinished("0");
|
|
|
- incident.setUpdateBy(subject);
|
|
|
- incident.setUpdateTime(new Date());
|
|
|
- incidentService.update(incident);
|
|
|
- }
|
|
|
- else{
|
|
|
- //督办事件重启
|
|
|
- if(incident.getIsFinished().equals("0")) {
|
|
|
- incident.setIsFinished("1");
|
|
|
- incident.setUpdateBy(subject);
|
|
|
- incident.setUpdateTime(new Date());
|
|
|
- incidentService.update(incident);
|
|
|
+ if(StringUtils.isNotEmpty(incident.getNewReply().getContent())){
|
|
|
+ //写入回复
|
|
|
+ IncidentReply incidentReply = new IncidentReply();
|
|
|
+ incidentReply.setId(UUID.randomUUID().toString());
|
|
|
+ incidentReply.setIncidentId(incident.getId());
|
|
|
+ incidentReply.setOrgId(user.getOrgId());
|
|
|
+ incidentReply.setSpecialClassId(user.getSpecialClassId());
|
|
|
+ incidentReply.setUserId(subject);
|
|
|
+ incidentReply.setContent(incident.getNewReply().getContent());
|
|
|
+ incidentReply.setCreateBy(subject);
|
|
|
+ incidentReply.setCreateTime(new Date());
|
|
|
+ incidentReplyService.insert(incidentReply);
|
|
|
+ //关联附件
|
|
|
+ for(int i=0;i<incident.getNewReply().getAttList().size();i++){
|
|
|
+ IncidentAttachmentDTO incidentAttachmentDTO = incident.getNewReply().getAttList().get(i);
|
|
|
+ IncidentAttachment incidentAttachment = new IncidentAttachment();
|
|
|
+ incidentAttachment.setId(UUID.randomUUID().toString());
|
|
|
+ incidentAttachment.setIncidentId(incidentReply.getId());
|
|
|
+ incidentAttachment.setAttachmentType("1");
|
|
|
+ incidentAttachment.setAttachmentTitle(incidentAttachmentDTO.getName());
|
|
|
+ incidentAttachment.setAttachmentUrl(incidentAttachmentDTO.getUrl());
|
|
|
+ incidentAttachment.setSortNo(i);
|
|
|
+ incidentAttachment.setCreateBy(subject);
|
|
|
+ incidentAttachment.setCreateTime(new Date());
|
|
|
+ incidentAttachmentService.insert(incidentAttachment);
|
|
|
+ }
|
|
|
+ //关联图片
|
|
|
+ for(int i=0;i<incident.getNewReply().getPicList().size();i++){
|
|
|
+ IncidentAttachmentDTO incidentAttachmentDTO = incident.getNewReply().getPicList().get(i);
|
|
|
+ IncidentAttachment incidentAttachment = new IncidentAttachment();
|
|
|
+ incidentAttachment.setId(UUID.randomUUID().toString());
|
|
|
+ incidentAttachment.setIncidentId(incidentReply.getId());
|
|
|
+ incidentAttachment.setAttachmentType("2");
|
|
|
+ incidentAttachment.setAttachmentTitle(incidentAttachmentDTO.getName());
|
|
|
+ incidentAttachment.setAttachmentUrl(incidentAttachmentDTO.getUrl());
|
|
|
+ incidentAttachment.setSortNo(i);
|
|
|
+ incidentAttachment.setCreateBy(subject);
|
|
|
+ incidentAttachment.setCreateTime(new Date());
|
|
|
+ incidentAttachmentService.insert(incidentAttachment);
|
|
|
}
|
|
|
- //督办事件进入下一步
|
|
|
- IncidentStep incidentStepNext = new IncidentStep();
|
|
|
- incidentStepNext.setId(UUID.randomUUID().toString());
|
|
|
- incidentStepNext.setIncidentId(incident.getId());
|
|
|
- incidentStepNext.setOrgId(incident.getNewStep().getOrgId());
|
|
|
- incidentStepNext.setWarnDate1(incident.getNewStep().getWarnDate1());
|
|
|
- incidentStepNext.setIsWarned1(false);
|
|
|
- incidentStepNext.setWarnDate2(incident.getNewStep().getWarnDate2());
|
|
|
- incidentStepNext.setIsWarned2(false);
|
|
|
- incidentStepNext.setWarnDate3(incident.getNewStep().getWarnDate3());
|
|
|
- incidentStepNext.setIsWarned3(false);
|
|
|
- incidentStepNext.setAllotedDate(incident.getNewStep().getAllotedDate());
|
|
|
- incidentStepNext.setCreateBy(subject);
|
|
|
- incidentStepNext.setCreateTime(new Date());
|
|
|
- incidentStepService.insert(incidentStepNext);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(incident.getSpecialClassId())) {
|
|
|
+ String templateId = "";
|
|
|
+ String MessageContent = "";
|
|
|
+ //发送跟踪专班短信
|
|
|
+ templateId = "2431012153083";
|
|
|
+ MessageContent = organization.getName() + "责任单位已上传文档,请查阅。";
|
|
|
+ sendSMSing(MessageContent, templateId, null, incident.getSpecialClassId(), "");
|
|
|
}
|
|
|
|
|
|
msgResult.setResult(true);
|
|
@@ -517,9 +480,17 @@ public class IncidentController {
|
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
@RequestAttribute String subject){
|
|
|
MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
+ User user = userService.get(subject);
|
|
|
|
|
|
Map<String,Object> searchParams = new HashMap<>();
|
|
|
searchParams.put("createBy", subject);
|
|
|
+// searchParams.put("orCreateBy", subject);
|
|
|
+// if(StringUtils.isNotEmpty(user.getSpecialClassId())) {
|
|
|
+// searchParams.put("orSpecialClassId", user.getSpecialClassId());
|
|
|
+// }
|
|
|
+// if(StringUtils.isNotEmpty(user.getOrgId())) {
|
|
|
+// searchParams.put("orOrgId", user.getOrgId());
|
|
|
+// }
|
|
|
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
sortList.add(new Sort("batch_","asc"));
|
|
@@ -558,7 +529,7 @@ public class IncidentController {
|
|
|
Page<Incident> page = incidentService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
for(Incident incident : page.getResult()){
|
|
|
List<IncidentStep> incidentStepList = incidentStepService.findListByIncidentId(incident.getId());
|
|
|
- incident.setIncidentStepList(incidentStepList);
|
|
|
+// incident.setIncidentStepList(incidentStepList);
|
|
|
|
|
|
if(StringUtils.isNotEmpty(incident.getSpecialClassId())){
|
|
|
List<String> nameList = new ArrayList<>();
|
|
@@ -579,26 +550,32 @@ public class IncidentController {
|
|
|
@ApiOperation(value="列表")
|
|
|
@RequestMapping(value = "pageListPending",method = RequestMethod.POST)
|
|
|
public MessageResult<Map> pageListPending(
|
|
|
- String batch, String serialNo, String complainant, String complainantPhone, String areaId, String specialClassId, String isFinished,
|
|
|
+ String batch, String serialNo, String complainant, String complainantPhone, String areaId,
|
|
|
@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
@RequestAttribute String subject){
|
|
|
MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
+ User user = userService.get(subject);
|
|
|
|
|
|
Map<String,Object> searchParams = new HashMap<>();
|
|
|
searchParams.put("isFinished", "1");
|
|
|
+ if(StringUtils.isNotEmpty(user.getSpecialClassId())) {
|
|
|
+ searchParams.put("orSpecialClassId", user.getSpecialClassId());
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotEmpty(user.getOrgId())) {
|
|
|
+ searchParams.put("orOrgId", user.getOrgId());
|
|
|
+ }
|
|
|
// searchParams.put("createBy", subject);
|
|
|
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
-// sortList.add(new Sort("a.warn_time","asc"));
|
|
|
sortList.add(new Sort("batch_","asc"));
|
|
|
sortList.add(new Sort("serial_no","asc"));
|
|
|
|
|
|
- List<Role> roleList = userRoleService.findRoleByUserId(subject);
|
|
|
- for(Role role : roleList) {
|
|
|
- if("8d4dd9ac-dcf4-4178-885c-fd309f4be8f6".equals(role.getId()))
|
|
|
- searchParams.put("createBy", null);
|
|
|
- }
|
|
|
+// List<Role> roleList = userRoleService.findRoleByUserId(subject);
|
|
|
+// for(Role role : roleList) {
|
|
|
+// if("8d4dd9ac-dcf4-4178-885c-fd309f4be8f6".equals(role.getId()))
|
|
|
+// searchParams.put("createBy", null);
|
|
|
+// }
|
|
|
|
|
|
//搜索条件
|
|
|
if (StringUtils.isNotEmpty(batch)) {
|
|
@@ -616,18 +593,9 @@ public class IncidentController {
|
|
|
if (StringUtils.isNotEmpty(areaId)) {
|
|
|
searchParams.put("areaId",areaId);
|
|
|
}
|
|
|
- if (StringUtils.isNotEmpty(specialClassId)) {
|
|
|
- searchParams.put("specialClassId","%"+specialClassId+"%");
|
|
|
- }
|
|
|
- if (StringUtils.isNotEmpty(isFinished)) {
|
|
|
- searchParams.put("isFinished",isFinished);
|
|
|
- }
|
|
|
|
|
|
Page<Incident> page = incidentService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
for(Incident incident : page.getResult()){
|
|
|
- List<IncidentStep> incidentStepList = incidentStepService.findListByIncidentId(incident.getId());
|
|
|
- incident.setLastStep(incidentStepList.get(incidentStepList.size()-1));
|
|
|
-
|
|
|
if(StringUtils.isNotEmpty(incident.getSpecialClassId())){
|
|
|
List<String> nameList = new ArrayList<>();
|
|
|
String[] ids = incident.getSpecialClassId().split(",");
|
|
@@ -635,12 +603,20 @@ public class IncidentController {
|
|
|
nameList.add(dataDictionaryService.getName(id));
|
|
|
}
|
|
|
incident.setSpecialClassName(String.join(",", nameList));
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(incident.getSpecialClassId()) && StringUtils.isNotEmpty(user.getSpecialClassId())) {
|
|
|
+ if (incident.getSpecialClassId().contains(user.getSpecialClassId())) {
|
|
|
+ incident.setBtnClose(true);
|
|
|
+ } else {
|
|
|
+ incident.setBtnClose(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//报警灯
|
|
|
Date currentTime = new Date();
|
|
|
- Date warnTime = incident.getLastStep().getWarnDate1();
|
|
|
- Date allotedTime = incident.getLastStep().getAllotedDate();
|
|
|
+ Date warnTime = incident.getWarnDate1();
|
|
|
+ Date allotedTime = incident.getAllotedDate();
|
|
|
|
|
|
if(currentTime.before(warnTime)){
|
|
|
incident.setWarningLight("绿");
|
|
@@ -839,11 +815,11 @@ public class IncidentController {
|
|
|
total = page.size();
|
|
|
for(Incident incident : page.getResult()){
|
|
|
List<IncidentStep> incidentStepList = incidentStepService.findListByIncidentId(incident.getId());
|
|
|
- incident.setLastStep(incidentStepList.get(incidentStepList.size()-1));
|
|
|
+// incident.setLastStep(incidentStepList.get(incidentStepList.size()-1));
|
|
|
//报警灯
|
|
|
Date currentTime = new Date();
|
|
|
- Date warnTime = incident.getLastStep().getWarnDate1();
|
|
|
- Date allotedTime = incident.getLastStep().getAllotedDate();
|
|
|
+ Date warnTime = incident.getWarnDate1();
|
|
|
+ Date allotedTime = incident.getAllotedDate();
|
|
|
|
|
|
if(currentTime.before(warnTime)){
|
|
|
intSafety++;
|
|
@@ -889,9 +865,6 @@ public class IncidentController {
|
|
|
|
|
|
Page<Incident> page = incidentService.pageSearch(searchParams,1,10000,false,sortList);
|
|
|
for(Incident incident : page.getResult()){
|
|
|
- List<IncidentStep> incidentStepList = incidentStepService.findListByIncidentId(incident.getId());
|
|
|
- incident.setLastStep(incidentStepList.get(incidentStepList.size()-1));
|
|
|
-
|
|
|
if(StringUtils.isNotEmpty(incident.getSpecialClassId())){
|
|
|
List<String> nameList = new ArrayList<>();
|
|
|
String[] ids = incident.getSpecialClassId().split(",");
|
|
@@ -977,9 +950,6 @@ public class IncidentController {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
Page<Incident> page = incidentService.pageSearch(searchParams,1,10000,false,sortList);
|
|
|
for(Incident incident : page.getResult()){
|
|
|
- List<IncidentStep> incidentStepList = incidentStepService.findListByIncidentId(incident.getId());
|
|
|
- incident.setLastStep(incidentStepList.get(incidentStepList.size()-1));
|
|
|
-
|
|
|
if(StringUtils.isNotEmpty(incident.getSpecialClassId())){
|
|
|
List<String> nameList = new ArrayList<>();
|
|
|
String[] ids = incident.getSpecialClassId().split(",");
|
|
@@ -1011,8 +981,8 @@ public class IncidentController {
|
|
|
row.getCell(3).setCellValue(incident.getAreaName());
|
|
|
row.getCell(4).setCellValue(incident.getSpecialClassName());
|
|
|
row.getCell(5).setCellValue(incident.getSuggestedDate());
|
|
|
- row.getCell(6).setCellValue(sdf.format(incident.getLastStep().getAllotedDate()));
|
|
|
- if(incident.getLastStep().getUpdateTime() != null) row.getCell(7).setCellValue(sdf.format(incident.getLastStep().getUpdateTime()));
|
|
|
+ row.getCell(6).setCellValue(sdf.format(incident.getAllotedDate()));
|
|
|
+ if(incident.getUpdateTime() != null) row.getCell(7).setCellValue(sdf.format(incident.getUpdateTime()));
|
|
|
row.getCell(8).setCellValue(incident.getIsFinishedName());
|
|
|
|
|
|
row.getCell(0).setCellStyle(cellStyleContent);
|
|
@@ -1208,13 +1178,6 @@ public class IncidentController {
|
|
|
incident.setRemark(strRemark);
|
|
|
}
|
|
|
|
|
|
- //案件步骤
|
|
|
- IncidentStep incidentStep = new IncidentStep();
|
|
|
- incidentStep.setId(UUID.randomUUID().toString());
|
|
|
- incidentStep.setIncidentId(incident.getId());
|
|
|
- incidentStep.setCreateBy(subject);
|
|
|
- incidentStep.setCreateTime(new Date());
|
|
|
-
|
|
|
if(StringUtils.isNotEmpty(strOrg)){
|
|
|
List<String> ids = new ArrayList<>();
|
|
|
String[] names = strOrg.split(",");
|
|
@@ -1225,7 +1188,7 @@ public class IncidentController {
|
|
|
}
|
|
|
}
|
|
|
if(ids.size() > 0) {
|
|
|
- incidentStep.setOrgId(String.join(",", ids));
|
|
|
+ incident.setOrgId(String.join(",", ids));
|
|
|
}
|
|
|
else{
|
|
|
sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("交办单位出现错误!");
|
|
@@ -1240,8 +1203,7 @@ public class IncidentController {
|
|
|
}
|
|
|
|
|
|
if(StringUtils.isNotEmpty(strWarnDate1)){
|
|
|
- incidentStep.setWarnDate1(sdf.parse(strWarnDate1));
|
|
|
- incidentStep.setIsWarned1(false);
|
|
|
+ incident.setWarnDate1(sdf.parse(strWarnDate1));
|
|
|
}
|
|
|
else{
|
|
|
sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("请填写第一次提醒时间!");
|
|
@@ -1250,17 +1212,15 @@ public class IncidentController {
|
|
|
}
|
|
|
|
|
|
if(StringUtils.isNotEmpty(strWarnDate2)){
|
|
|
- incidentStep.setWarnDate2(sdf.parse(strWarnDate2));
|
|
|
- incidentStep.setIsWarned2(false);
|
|
|
+ incident.setWarnDate2(sdf.parse(strWarnDate2));
|
|
|
}
|
|
|
|
|
|
if(StringUtils.isNotEmpty(strWarnDate3)){
|
|
|
- incidentStep.setWarnDate3(sdf.parse(strWarnDate3));
|
|
|
- incidentStep.setIsWarned3(false);
|
|
|
+ incident.setWarnDate3(sdf.parse(strWarnDate3));
|
|
|
}
|
|
|
|
|
|
if(StringUtils.isNotEmpty(strAllotedDate)){
|
|
|
- incidentStep.setAllotedDate(sdf.parse(strAllotedDate));
|
|
|
+ incident.setAllotedDate(sdf.parse(strAllotedDate));
|
|
|
}
|
|
|
else{
|
|
|
sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("请填写到期时间!");
|
|
@@ -1269,24 +1229,6 @@ public class IncidentController {
|
|
|
}
|
|
|
|
|
|
incidentService.insert(incident);
|
|
|
- incidentStepService.insert(incidentStep);
|
|
|
-
|
|
|
- //保存到交办单位操作表
|
|
|
- //List<IncidentStepStatus> incidentStepStatusList = incidentStepStatusService.findByIncidentId(incident.getId());
|
|
|
- incidentStepStatusService.deleteByIncidentId(incident.getId());
|
|
|
- String [] orgIds = incidentStep.getOrgId().split(",");
|
|
|
- for(String orgId : orgIds){
|
|
|
- IncidentStepStatus incidentStepStatus = new IncidentStepStatus();
|
|
|
- incidentStepStatus.setId(UUID.randomUUID().toString());
|
|
|
- incidentStepStatus.setCreateBy(subject);
|
|
|
- incidentStepStatus.setCreateTime(new Date());
|
|
|
- incidentStepStatus.setIncidentId(incident.getId());
|
|
|
- incidentStepStatus.setIncidentStepId(incidentStep.getId());
|
|
|
- incidentStepStatus.setOrgId(orgId);
|
|
|
- incidentStepStatus.setStatus("0");
|
|
|
- incidentStepStatus.setDelFlag(false);
|
|
|
- incidentStepStatusService.insert(incidentStepStatus);
|
|
|
- }
|
|
|
|
|
|
String templateId = "";
|
|
|
String MessageContent = "";
|
|
@@ -1297,12 +1239,13 @@ public class IncidentController {
|
|
|
//发送交办单位短信
|
|
|
templateId = "2431012137069";
|
|
|
MessageContent = "您有一条待办提醒,请登录双优督办平台电脑端查看。(http://39.104.144.104/excellent-portal)";
|
|
|
- sendSMSing(MessageContent, templateId, incidentStep.getOrgId(), null, "");
|
|
|
+ sendSMSing(MessageContent, templateId, incident.getOrgId(), null, "");
|
|
|
|
|
|
affectCount++;
|
|
|
}
|
|
|
catch(Exception innerEx){
|
|
|
logger.error(innerEx.getMessage(),innerEx);
|
|
|
+ failCount++;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1443,4 +1386,34 @@ public class IncidentController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value="变更信息状态")
|
|
|
+ @GetMapping("changeFinished/{id}")
|
|
|
+ public MessageResult<Incident> changeFinished(@PathVariable("id") String id,@RequestAttribute String subject){
|
|
|
+ MessageResult<Incident> msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ try {
|
|
|
+ Incident incident = incidentService.get(id);
|
|
|
+ if(incident.getIsFinished().equals("0")){
|
|
|
+ incident.setIsFinished("1");
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ incident.setIsFinished("0");
|
|
|
+ }
|
|
|
+ incident.setUpdateBy(subject);
|
|
|
+ incident.setUpdateTime(new Date());
|
|
|
+ incidentService.update(incident);
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(incident);
|
|
|
+ }
|
|
|
+ catch(Exception ex){
|
|
|
+ logger.error(ex.getMessage(),ex);
|
|
|
+
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
}
|