|
@@ -3,6 +3,7 @@ package com.jpsoft.excellent.modules.base.controller;
|
|
|
import com.github.pagehelper.Page;
|
|
|
import com.jpsoft.excellent.config.OSSConfig;
|
|
|
import com.jpsoft.excellent.modules.base.dto.IncidentAttachmentDTO;
|
|
|
+import com.jpsoft.excellent.modules.base.dto.ShowCountDTO;
|
|
|
import com.jpsoft.excellent.modules.base.entity.*;
|
|
|
import com.jpsoft.excellent.modules.base.service.*;
|
|
|
import com.jpsoft.excellent.modules.common.utils.OSSUtil;
|
|
@@ -142,11 +143,11 @@ public class IncidentController {
|
|
|
//发送跟踪专班短信
|
|
|
// templateId = "2431012137069";
|
|
|
// MessageContent = String.format("您好!%s,市委督查室已向你单位发送了督办事项“%s”,请安排人员及时接收办理。联系人:%s %s。", sdfDetail.format(incidentStep.getCreateTime()), incident.getTitle(), user.getRealName(), user.getPhone());
|
|
|
- SMSUtil.sendSMSing(MessageContent, templateId, null, incident.getSpecialClassId(), "");
|
|
|
+// SMSUtil.sendSMSing(MessageContent, templateId, null, incident.getSpecialClassId(), "");
|
|
|
//发送交办单位短信
|
|
|
// 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, "");
|
|
|
+// SMSUtil.sendSMSing(MessageContent, templateId, incidentStep.getOrgId(), null, "");
|
|
|
}
|
|
|
|
|
|
msgResult.setResult(true);
|
|
@@ -510,7 +511,7 @@ public class IncidentController {
|
|
|
searchParams.put("areaId",areaId);
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(specialClassId)) {
|
|
|
- searchParams.put("specialClassId",specialClassId);
|
|
|
+ searchParams.put("specialClassId","%"+specialClassId+"%");
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(isFinished)) {
|
|
|
searchParams.put("isFinished",isFinished);
|
|
@@ -520,6 +521,16 @@ public class IncidentController {
|
|
|
for(Incident incident : page.getResult()){
|
|
|
List<IncidentStep> incidentStepList = incidentStepService.findListByIncidentId(incident.getId());
|
|
|
incident.setIncidentStepList(incidentStepList);
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(incident.getSpecialClassId())){
|
|
|
+ List<String> nameList = new ArrayList<>();
|
|
|
+ String[] ids = incident.getSpecialClassId().split(",");
|
|
|
+ for(String id : ids){
|
|
|
+ DataDictionary dataDictionary = dataDictionaryService.findByCatalogNameAndValue("工作专班",id);
|
|
|
+ nameList.add(dataDictionary.getName());
|
|
|
+ }
|
|
|
+ incident.setSpecialClassName(String.join(",", nameList));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
msgResult.setResult(true);
|
|
@@ -568,7 +579,7 @@ public class IncidentController {
|
|
|
searchParams.put("areaId",areaId);
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(specialClassId)) {
|
|
|
- searchParams.put("specialClassId",specialClassId);
|
|
|
+ searchParams.put("specialClassId","%"+specialClassId+"%");
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(isFinished)) {
|
|
|
searchParams.put("isFinished",isFinished);
|
|
@@ -578,6 +589,17 @@ public class IncidentController {
|
|
|
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(",");
|
|
|
+ for(String id : ids){
|
|
|
+ DataDictionary dataDictionary = dataDictionaryService.findByCatalogNameAndValue("工作专班",id);
|
|
|
+ nameList.add(dataDictionary.getName());
|
|
|
+ }
|
|
|
+ incident.setSpecialClassName(String.join(",", nameList));
|
|
|
+ }
|
|
|
+
|
|
|
//报警灯
|
|
|
Date currentTime = new Date();
|
|
|
Date warnTime = incident.getLastStep().getWarnDate1();
|
|
@@ -601,33 +623,69 @@ public class IncidentController {
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value="区域类型数量")
|
|
|
- @RequestMapping(value = "countByCaseType",method = RequestMethod.POST)
|
|
|
- public MessageResult<Map> countByCaseType(@RequestAttribute String subject){
|
|
|
- MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
-// Map<String, Object> map = new HashMap<>();
|
|
|
-//
|
|
|
-// int total = 0;
|
|
|
-// List<DataDictionary> dataDictionaryList = dataDictionaryService.findByCatalogName("督办类型");
|
|
|
-// for(DataDictionary dataDictionary : dataDictionaryList) {
|
|
|
-// Map<String, Object> searchParams = new HashMap<>();
|
|
|
-//// searchParams.put("createBy", subject);
|
|
|
-//
|
|
|
-//// List<Role> roleList = userRoleService.findRoleByUserId(subject);
|
|
|
-//// for(Role role : roleList) {
|
|
|
-//// if("8d4dd9ac-dcf4-4178-885c-fd309f4be8f6".equals(role.getId()))
|
|
|
-//// searchParams.put("createBy", null);
|
|
|
-//// }
|
|
|
-// searchParams.put("caseType",dataDictionary.getValue());
|
|
|
-// List<Sort> sortList = new ArrayList<>();
|
|
|
-// sortList.add(new Sort("a.warn_time", "asc"));
|
|
|
-// Page<Incident> page = incidentService.pageSearchPanding(searchParams, 1, 10000, false, sortList);
|
|
|
-// map.put("item" + dataDictionary.getValue(),page.getResult().size());
|
|
|
-// total += page.getResult().size();
|
|
|
-// }
|
|
|
-// map.put("total", total);
|
|
|
-//
|
|
|
-// msgResult.setResult(true);
|
|
|
-// msgResult.setData(map);
|
|
|
+ @RequestMapping(value = "countByArea",method = RequestMethod.POST)
|
|
|
+ public MessageResult<List> countByArea(@RequestAttribute String subject){
|
|
|
+ MessageResult<List> msgResult = new MessageResult<>();
|
|
|
+ List<ShowCountDTO> list = new ArrayList<>();
|
|
|
+
|
|
|
+ List<DataDictionary> dataDictionaryList = dataDictionaryService.findByCatalogName("区域");
|
|
|
+ for(DataDictionary dataDictionary : dataDictionaryList) {
|
|
|
+ Map<String, Object> searchParams = new HashMap<>();
|
|
|
+ searchParams.put("createBy", subject);
|
|
|
+ searchParams.put("areaId",dataDictionary.getValue());
|
|
|
+
|
|
|
+ List<Role> roleList = userRoleService.findRoleByUserId(subject);
|
|
|
+ for(Role role : roleList) {
|
|
|
+ if("8d4dd9ac-dcf4-4178-885c-fd309f4be8f6".equals(role.getId()))
|
|
|
+ searchParams.put("createBy", null);
|
|
|
+ }
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("create_time","desc"));
|
|
|
+
|
|
|
+ Page<Incident> page = incidentService.pageSearch(searchParams,1,10000,false,sortList);
|
|
|
+
|
|
|
+ ShowCountDTO dto = new ShowCountDTO();
|
|
|
+ dto.setName(dataDictionary.getName());
|
|
|
+ dto.setValue(String.valueOf(page.size()));
|
|
|
+ list.add(dto);
|
|
|
+ }
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(list);
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value="区域类型数量")
|
|
|
+ @RequestMapping(value = "countBySpecialClass",method = RequestMethod.POST)
|
|
|
+ public MessageResult<List> countBySpecialClass(@RequestAttribute String subject){
|
|
|
+ MessageResult<List> msgResult = new MessageResult<>();
|
|
|
+ List<ShowCountDTO> list = new ArrayList<>();
|
|
|
+
|
|
|
+ List<DataDictionary> dataDictionaryList = dataDictionaryService.findByCatalogName("工作专班");
|
|
|
+ for(DataDictionary dataDictionary : dataDictionaryList) {
|
|
|
+ Map<String, Object> searchParams = new HashMap<>();
|
|
|
+ searchParams.put("createBy", subject);
|
|
|
+ searchParams.put("specialClassId","%"+dataDictionary.getValue()+"%");
|
|
|
+
|
|
|
+ List<Role> roleList = userRoleService.findRoleByUserId(subject);
|
|
|
+ for(Role role : roleList) {
|
|
|
+ if("8d4dd9ac-dcf4-4178-885c-fd309f4be8f6".equals(role.getId()))
|
|
|
+ searchParams.put("createBy", null);
|
|
|
+ }
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("create_time","desc"));
|
|
|
+
|
|
|
+ Page<Incident> page = incidentService.pageSearch(searchParams,1,10000,false,sortList);
|
|
|
+
|
|
|
+ ShowCountDTO dto = new ShowCountDTO();
|
|
|
+ dto.setName(dataDictionary.getName());
|
|
|
+ dto.setValue(String.valueOf(page.size()));
|
|
|
+ list.add(dto);
|
|
|
+ }
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(list);
|
|
|
|
|
|
return msgResult;
|
|
|
}
|
|
@@ -702,13 +760,23 @@ public class IncidentController {
|
|
|
searchParams.put("areaId",areaId);
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(specialClassId)) {
|
|
|
- searchParams.put("specialClassId",specialClassId);
|
|
|
+ searchParams.put("specialClassId","%"+specialClassId+"%");
|
|
|
}
|
|
|
|
|
|
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(",");
|
|
|
+ for(String id : ids){
|
|
|
+ DataDictionary dataDictionary = dataDictionaryService.findByCatalogNameAndValue("工作专班",id);
|
|
|
+ nameList.add(dataDictionary.getName());
|
|
|
+ }
|
|
|
+ incident.setSpecialClassName(String.join(",", nameList));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
msgResult.setResult(true);
|
|
@@ -780,7 +848,7 @@ public class IncidentController {
|
|
|
searchParams.put("areaId",areaId);
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(specialClassId)) {
|
|
|
- searchParams.put("specialClassId",specialClassId);
|
|
|
+ searchParams.put("specialClassId","%"+specialClassId+"%");
|
|
|
}
|
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
@@ -788,6 +856,16 @@ public class IncidentController {
|
|
|
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(",");
|
|
|
+ for(String id : ids){
|
|
|
+ DataDictionary dataDictionary = dataDictionaryService.findByCatalogNameAndValue("工作专班",id);
|
|
|
+ nameList.add(dataDictionary.getName());
|
|
|
+ }
|
|
|
+ incident.setSpecialClassName(String.join(",", nameList));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//写入数据
|