2024-01-31 15:15:23 +08:00
|
|
|
|
package com.zcloud.controller.hiddenDangerCheckStandard;
|
|
|
|
|
|
|
|
|
|
import com.zcloud.controller.base.BaseController;
|
|
|
|
|
import com.zcloud.entity.Page;
|
|
|
|
|
import com.zcloud.entity.PageData;
|
|
|
|
|
import com.zcloud.logs.LogAnno;
|
|
|
|
|
import com.zcloud.service.check.*;
|
|
|
|
|
import com.zcloud.service.hiddenDangerCheckStandard.CustomCheckRecordItemService;
|
|
|
|
|
import com.zcloud.service.hiddenDangerCheckStandard.CustomCheckRecordService;
|
|
|
|
|
import com.zcloud.service.hiddenDangerCheckStandard.CustomItemService;
|
|
|
|
|
import com.zcloud.service.hiddenDangerCheckStandard.CustomService;
|
|
|
|
|
import com.zcloud.service.offduty.OffDutyService;
|
|
|
|
|
import com.zcloud.service.risk.IdentificationPartsService;
|
|
|
|
|
import com.zcloud.service.risk.RiskPointService;
|
|
|
|
|
import com.zcloud.service.statistics.ListStatisticsService;
|
|
|
|
|
import com.zcloud.service.system.DepartmentService;
|
|
|
|
|
import com.zcloud.service.system.UsersService;
|
|
|
|
|
import com.zcloud.util.DateUtil;
|
|
|
|
|
import com.zcloud.util.Jurisdiction;
|
|
|
|
|
import com.zcloud.util.Tools;
|
|
|
|
|
import com.zcloud.util.Warden;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 说明:清单管理-隐患排查清单
|
|
|
|
|
* 作者:luoxiaobao
|
|
|
|
|
* 时间:2020-12-30
|
|
|
|
|
* 官网:www.zcloudchina.com
|
|
|
|
|
*/
|
|
|
|
|
@Controller
|
|
|
|
|
@RequestMapping("/app/hiddenDangerCheckStandardCustom")
|
|
|
|
|
public class AppCustomController extends BaseController {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private CustomService customService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private CustomItemService customItemService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private ListCheckItemService listcheckitemService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private DepartmentService departmentService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private CustomCheckRecordService customCheckRecordService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private CustomCheckRecordItemService customCheckRecordItemService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private RiskPointService riskpointService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private ListStatisticsService listStatisticsService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private IdentificationPartsService identificationPartsService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private ListDisableTimeService listdisabletimeService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private CheckRouteService checkRouteService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private UsersService usersService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private OffDutyService offdutyService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 列表
|
|
|
|
|
*
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "/checkList")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
@LogAnno(menuType = "手机", menuServer = "隐患排查", instructionsOperate = "清单管理", instructionsType = "列表")
|
|
|
|
|
public Object checkList() throws Exception {
|
|
|
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
|
|
|
String errInfo = "success";
|
|
|
|
|
PageData pd = new PageData();
|
|
|
|
|
pd = this.getPageData();
|
|
|
|
|
String USER_NAME = pd.getString("USER_NAME");
|
|
|
|
|
PageData cpd = new PageData();
|
|
|
|
|
cpd = usersService.findById(pd);
|
|
|
|
|
pd.put("ISLEADER", cpd.getString("ISLEADER"));
|
|
|
|
|
PageData dept = new PageData();
|
|
|
|
|
dept.put("DEPARTMENT_ID", pd.getString("CHECK_DEPARTMENT_ID"));
|
|
|
|
|
dept = departmentService.findById(dept);
|
|
|
|
|
if (dept != null && dept.getString("ISSUPERVISE").equals("1")) {
|
|
|
|
|
pd.put("SUP_DEPARTMENT_ID", dept.getString("DEPARTMENT_ID"));
|
|
|
|
|
pd.put("ISSUPERVISE", dept.getString("ISSUPERVISE"));
|
|
|
|
|
} else {
|
|
|
|
|
pd.put("DEPARTMENT_ID", pd.getString("CHECK_DEPARTMENT_ID"));
|
|
|
|
|
}
|
|
|
|
|
if (cpd.getString("ISLEADER") != null && cpd.getString("ISLEADER").equals("1")) {
|
|
|
|
|
String DEPARTMENT_ID = pd.getString("CHECK_DEPARTMENT_ID");
|
|
|
|
|
String ids = departmentService.getDEPARTMENT_IDS(DEPARTMENT_ID);
|
|
|
|
|
ids = pd.getString("CHECK_DEPARTMENT_ID") + "," + ids; //把自己部门插入进去
|
|
|
|
|
if (ids != null && Tools.notEmpty(ids) && ids.lastIndexOf(",") > -1) {
|
|
|
|
|
ids = ids.substring(0, ids.lastIndexOf(","));
|
|
|
|
|
pd.put("DEPARTMENT_IDS", ids.split(","));
|
|
|
|
|
} else {
|
|
|
|
|
pd.put("DEPARTMENT_IDS", DEPARTMENT_ID);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
pd.put("orderUserId", pd.get("USER_ID"));
|
|
|
|
|
List<PageData> varList = customService.getMyCheckList(pd);//列出ListManager列表
|
|
|
|
|
for (PageData list : varList) {
|
|
|
|
|
String cycle = list.getString("PERIODNAME");
|
|
|
|
|
if (cycle.equals("每日")) {
|
|
|
|
|
list.put("START_DATE", DateUtil.getDay());
|
|
|
|
|
list.put("END_DATE", DateUtil.getDay());
|
|
|
|
|
} else if (cycle.equals("每周")) {
|
|
|
|
|
list.put("START_DATE", DateUtil.getWeekStart().substring(0, 10));
|
|
|
|
|
list.put("END_DATE", DateUtil.getWeekEnd().substring(0, 10));
|
|
|
|
|
} else if (cycle.equals("每旬")) {
|
|
|
|
|
//1-10
|
|
|
|
|
if (DateUtil.timeCalendar(new Date(), DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "01 00:00:00"), DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "10 23:59:59"))) {
|
|
|
|
|
list.put("START_DATE", DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "01");
|
|
|
|
|
list.put("END_DATE", DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "10");
|
|
|
|
|
}
|
|
|
|
|
//10-20
|
|
|
|
|
if (DateUtil.timeCalendar(new Date(), DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "11 00:00:00"), DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "20 23:59:59"))) {
|
|
|
|
|
list.put("START_DATE", DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "11");
|
|
|
|
|
list.put("END_DATE", DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "20");
|
|
|
|
|
}
|
|
|
|
|
//20-月底
|
|
|
|
|
if (DateUtil.timeCalendar(new Date(), DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "21 00:00:00"), DateUtil.fomatDateTime(DateUtil.getMonthEndDay() + " 23:59:59"))) {
|
|
|
|
|
list.put("START_DATE", DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "21");
|
|
|
|
|
list.put("END_DATE", DateUtil.getMonthEndDay());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else if (cycle.equals("每月")) {
|
|
|
|
|
list.put("START_DATE", DateUtil.getMonthFirstDay());
|
|
|
|
|
list.put("END_DATE", DateUtil.getMonthEndDay());
|
|
|
|
|
} else if (cycle.equals("每季")) {
|
|
|
|
|
list.put("START_DATE", DateUtil.quarterStart());
|
|
|
|
|
list.put("END_DATE", DateUtil.quarterEnd());
|
|
|
|
|
} else if (cycle.equals("半年")) {
|
|
|
|
|
Integer bmonth = Integer.parseInt(DateUtil.getMonth().toString());
|
|
|
|
|
if (bmonth <= 6) {
|
|
|
|
|
list.put("START_DATE", DateUtil.getYear() + "-01-01");
|
|
|
|
|
list.put("END_DATE", DateUtil.getYear() + "-06-30");
|
|
|
|
|
} else if (bmonth > 6) {
|
|
|
|
|
list.put("START_DATE", DateUtil.getYear() + "-07-01");
|
|
|
|
|
list.put("END_DATE", DateUtil.getYear() + "-12-31");
|
|
|
|
|
}
|
|
|
|
|
} else if (cycle.equals("每年")) {
|
|
|
|
|
list.put("START_DATE", DateUtil.getCurrYearFirst());
|
|
|
|
|
list.put("END_DATE", DateUtil.getCurrYearLast());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
map.put("varList", varList);
|
|
|
|
|
map.put("result", errInfo);
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取清单风险点
|
|
|
|
|
*
|
|
|
|
|
* @param
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "/getCheckItem")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
@LogAnno(menuType = "手机", menuServer = "隐患排查", instructionsOperate = "清单管理", instructionsType = "获取清单风险点")
|
|
|
|
|
public Object getRisk() throws Exception {
|
|
|
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
|
|
|
String errInfo = "success";
|
|
|
|
|
PageData pd = new PageData();
|
|
|
|
|
pd = this.getPageData();
|
|
|
|
|
String USER_ID = pd.getString("USER_NAME");
|
|
|
|
|
List<PageData> varList = customItemService.getCheckItem(pd);
|
|
|
|
|
map.put("varList", varList);
|
|
|
|
|
pd = customService.findById(pd);
|
|
|
|
|
if (pd.getString("TYPE").equals("listType0005")) {
|
|
|
|
|
if (DateUtil.timeCalendar(new Date(), DateUtil.fomatDateTime(pd.getString("START_DATE") + " 00:00:00"), DateUtil.fomatDateTime(pd.getString("END_DATE") + " 23:59:59"))) {
|
|
|
|
|
PageData type = new PageData();
|
|
|
|
|
type.put("CUSTOM_ID", pd.get("CUSTOM_ID"));
|
|
|
|
|
type.put("IS_XUN", 1);//查询方法和旬一样,直接借用
|
|
|
|
|
type.put("FINISHED", '0');
|
|
|
|
|
type.put("USER_ID", USER_ID);
|
|
|
|
|
type.put("BEGINTIME", pd.getString("START_DATE") + " 00:00:00");
|
|
|
|
|
type.put("ENDTIME", pd.getString("END_DATE") + " 23:59:59");
|
|
|
|
|
List<PageData> records = customCheckRecordService.listAllUnfinished(type);
|
|
|
|
|
if (records != null && records.size() > 0) {
|
|
|
|
|
PageData record = new PageData();
|
|
|
|
|
record.put("CHECKRECORD_ID", records.get(0).get("CHECKRECORD_ID"));
|
|
|
|
|
List<PageData> checkedList = customCheckRecordItemService.listAll(record);
|
|
|
|
|
Map<String, Integer> checkmap = new HashMap<String, Integer>();//记录所有风险点
|
|
|
|
|
for (PageData item : checkedList) {
|
2024-02-01 10:43:52 +08:00
|
|
|
|
if (!checkmap.containsKey(item.getString("CHECK_ITEM"))) {
|
|
|
|
|
checkmap.put(item.getString("CHECK_ITEM"), 1);
|
2024-01-31 15:15:23 +08:00
|
|
|
|
} else {
|
2024-02-01 10:43:52 +08:00
|
|
|
|
checkmap.put(item.getString("CHECK_ITEM"), checkmap.get(item.getString("CHECK_ITEM")) + 1);
|
2024-01-31 15:15:23 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-02-01 10:43:52 +08:00
|
|
|
|
map.put("CHECK_ITEM", records.get(0).get("CHECK_ITEM"));
|
2024-01-31 15:15:23 +08:00
|
|
|
|
map.put("checkmap", checkmap);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
map.put("result", errInfo);
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
String cycle = pd.getString("PERIODNAME");
|
|
|
|
|
if (cycle.equals("每日")) {
|
|
|
|
|
PageData type = new PageData();
|
|
|
|
|
type.put("CUSTOM_ID", pd.get("CUSTOM_ID"));
|
|
|
|
|
type.put("IS_DAY", 1);
|
|
|
|
|
type.put("FINISHED", '0');
|
|
|
|
|
type.put("USER_ID", USER_ID);
|
|
|
|
|
List<PageData> records = customCheckRecordService.listAllUnfinished(type);
|
|
|
|
|
pd.put("checkCount", records == null ? 0 : records.size());
|
|
|
|
|
if (records != null && records.size() > 0) {
|
|
|
|
|
PageData record = new PageData();
|
|
|
|
|
record.put("CHECKRECORD_ID", records.get(0).get("CHECKRECORD_ID"));
|
|
|
|
|
List<PageData> checkedList = customCheckRecordItemService.listAll(record);
|
|
|
|
|
Map<String, Integer> checkmap = new HashMap<String, Integer>();//记录所有风险点
|
|
|
|
|
for (PageData item : checkedList) {
|
2024-02-01 10:43:52 +08:00
|
|
|
|
if (!checkmap.containsKey(item.getString("CHECK_ITEM"))) {
|
|
|
|
|
checkmap.put(item.getString("CHECK_ITEM"), 1);
|
2024-01-31 15:15:23 +08:00
|
|
|
|
} else {
|
2024-02-01 10:43:52 +08:00
|
|
|
|
checkmap.put(item.getString("CHECK_ITEM"), checkmap.get(item.getString("CHECK_ITEM")) + 1);
|
2024-01-31 15:15:23 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
map.put("CHECKRECORD_ID", records.get(0).get("CHECKRECORD_ID"));
|
|
|
|
|
map.put("checkmap", checkmap);
|
|
|
|
|
}
|
|
|
|
|
} else if (cycle.equals("每周")) {
|
|
|
|
|
PageData type = new PageData();
|
|
|
|
|
type.put("CUSTOM_ID", pd.get("CUSTOM_ID"));
|
|
|
|
|
type.put("IS_WEEK", 1);
|
|
|
|
|
type.put("FINISHED", '0');
|
|
|
|
|
type.put("USER_ID", USER_ID);
|
|
|
|
|
List<PageData> records = customCheckRecordService.listAllUnfinished(type);
|
|
|
|
|
pd.put("checkCount", records == null ? 0 : records.size());
|
|
|
|
|
if (records != null && records.size() > 0) {
|
|
|
|
|
PageData record = new PageData();
|
|
|
|
|
record.put("CHECKRECORD_ID", records.get(0).get("CHECKRECORD_ID"));
|
|
|
|
|
List<PageData> checkedList = customCheckRecordItemService.listAll(record);
|
|
|
|
|
Map<String, Integer> checkmap = new HashMap<String, Integer>();//记录所有风险点
|
|
|
|
|
for (PageData item : checkedList) {
|
2024-02-01 10:43:52 +08:00
|
|
|
|
if (!checkmap.containsKey(item.getString("CHECK_ITEM"))) {
|
|
|
|
|
checkmap.put(item.getString("CHECK_ITEM"), 1);
|
2024-01-31 15:15:23 +08:00
|
|
|
|
} else {
|
2024-02-01 10:43:52 +08:00
|
|
|
|
checkmap.put(item.getString("CHECK_ITEM"), checkmap.get(item.getString("CHECK_ITEM")) + 1);
|
2024-01-31 15:15:23 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
map.put("CHECKRECORD_ID", records.get(0).get("CHECKRECORD_ID"));
|
|
|
|
|
map.put("checkmap", checkmap);
|
|
|
|
|
}
|
|
|
|
|
} else if (cycle.equals("每旬")) {
|
|
|
|
|
//1-10
|
|
|
|
|
if (DateUtil.timeCalendar(new Date(), DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "01 00:00:00"), DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "10 23:59:59"))) {
|
|
|
|
|
PageData type = new PageData();
|
|
|
|
|
type.put("CUSTOM_ID", pd.get("CUSTOM_ID"));
|
|
|
|
|
type.put("IS_XUN", 1);
|
|
|
|
|
type.put("FINISHED", '0');
|
|
|
|
|
type.put("USER_ID", USER_ID);
|
|
|
|
|
type.put("BEGINTIME", DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "01 00:00:00");
|
|
|
|
|
type.put("ENDTIME", DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "10 23:59:59");
|
|
|
|
|
List<PageData> records = customCheckRecordService.listAllUnfinished(type);
|
|
|
|
|
if (records != null && records.size() > 0) {
|
|
|
|
|
PageData record = new PageData();
|
|
|
|
|
record.put("CHECKRECORD_ID", records.get(0).get("CHECKRECORD_ID"));
|
|
|
|
|
List<PageData> checkedList = customCheckRecordItemService.listAll(record);
|
|
|
|
|
Map<String, Integer> checkmap = new HashMap<String, Integer>();//记录所有风险点
|
|
|
|
|
for (PageData item : checkedList) {
|
2024-02-01 10:43:52 +08:00
|
|
|
|
if (!checkmap.containsKey(item.getString("CHECK_ITEM"))) {
|
|
|
|
|
checkmap.put(item.getString("CHECK_ITEM"), 1);
|
2024-01-31 15:15:23 +08:00
|
|
|
|
} else {
|
2024-02-01 10:43:52 +08:00
|
|
|
|
checkmap.put(item.getString("CHECK_ITEM"), checkmap.get(item.getString("CHECK_ITEM")) + 1);
|
2024-01-31 15:15:23 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
map.put("CHECKRECORD_ID", records.get(0).get("CHECKRECORD_ID"));
|
|
|
|
|
map.put("checkmap", checkmap);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//10-20
|
|
|
|
|
if (DateUtil.timeCalendar(new Date(), DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "11 00:00:00"), DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "20 23:59:59"))) {
|
|
|
|
|
PageData type = new PageData();
|
|
|
|
|
type.put("CUSTOM_ID", pd.get("CUSTOM_ID"));
|
|
|
|
|
type.put("IS_XUN", 1);
|
|
|
|
|
type.put("FINISHED", '0');
|
|
|
|
|
type.put("USER_ID", USER_ID);
|
|
|
|
|
type.put("BEGINTIME", DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "11 00:00:00");
|
|
|
|
|
type.put("ENDTIME", DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "20 23:59:59");
|
|
|
|
|
List<PageData> records = customCheckRecordService.listAllUnfinished(type);
|
|
|
|
|
if (records != null && records.size() > 0) {
|
|
|
|
|
PageData record = new PageData();
|
|
|
|
|
record.put("CHECKRECORD_ID", records.get(0).get("CHECKRECORD_ID"));
|
|
|
|
|
List<PageData> checkedList = customCheckRecordItemService.listAll(record);
|
|
|
|
|
Map<String, Integer> checkmap = new HashMap<String, Integer>();//记录所有风险点
|
|
|
|
|
for (PageData item : checkedList) {
|
2024-02-01 10:43:52 +08:00
|
|
|
|
if (!checkmap.containsKey(item.getString("CHECK_ITEM"))) {
|
|
|
|
|
checkmap.put(item.getString("CHECK_ITEM"), 1);
|
2024-01-31 15:15:23 +08:00
|
|
|
|
} else {
|
2024-02-01 10:43:52 +08:00
|
|
|
|
checkmap.put(item.getString("CHECK_ITEM"), checkmap.get(item.getString("CHECK_ITEM")) + 1);
|
2024-01-31 15:15:23 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
map.put("CHECKRECORD_ID", records.get(0).get("CHECKRECORD_ID"));
|
|
|
|
|
map.put("checkmap", checkmap);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//20-月底
|
|
|
|
|
if (DateUtil.timeCalendar(new Date(), DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "21 00:00:00"), DateUtil.fomatDateTime(DateUtil.getMonthEndDay() + " 23:59:59"))) {
|
|
|
|
|
PageData type = new PageData();
|
|
|
|
|
type.put("CUSTOM_ID", pd.get("CUSTOM_ID"));
|
|
|
|
|
type.put("IS_XUN", 1);
|
|
|
|
|
type.put("FINISHED", '0');
|
|
|
|
|
type.put("USER_ID", USER_ID);
|
|
|
|
|
type.put("BEGINTIME", DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "21 00:00:00");
|
|
|
|
|
type.put("ENDTIME", DateUtil.getMonthEndDay() + " 23:59:59");
|
|
|
|
|
List<PageData> records = customCheckRecordService.listAllUnfinished(type);
|
|
|
|
|
if (records != null && records.size() > 0) {
|
|
|
|
|
PageData record = new PageData();
|
|
|
|
|
record.put("CHECKRECORD_ID", records.get(0).get("CHECKRECORD_ID"));
|
|
|
|
|
List<PageData> checkedList = customCheckRecordItemService.listAll(record);
|
|
|
|
|
Map<String, Integer> checkmap = new HashMap<String, Integer>();//记录所有风险点
|
|
|
|
|
for (PageData item : checkedList) {
|
2024-02-01 10:43:52 +08:00
|
|
|
|
if (!checkmap.containsKey(item.getString("CHECK_ITEM"))) {
|
|
|
|
|
checkmap.put(item.getString("CHECK_ITEM"), 1);
|
2024-01-31 15:15:23 +08:00
|
|
|
|
} else {
|
2024-02-01 10:43:52 +08:00
|
|
|
|
checkmap.put(item.getString("CHECK_ITEM"), checkmap.get(item.getString("CHECK_ITEM")) + 1);
|
2024-01-31 15:15:23 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
map.put("CHECKRECORD_ID", records.get(0).get("CHECKRECORD_ID"));
|
|
|
|
|
map.put("checkmap", checkmap);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else if (cycle.equals("每月")) {
|
|
|
|
|
PageData type = new PageData();
|
|
|
|
|
type.put("CUSTOM_ID", pd.get("CUSTOM_ID"));
|
|
|
|
|
type.put("IS_MONTH", 1);
|
|
|
|
|
type.put("FINISHED", '0');
|
|
|
|
|
type.put("USER_ID", USER_ID);
|
|
|
|
|
List<PageData> records = customCheckRecordService.listAllUnfinished(type);
|
|
|
|
|
pd.put("checkCount", records == null ? 0 : records.size());
|
|
|
|
|
if (records != null && records.size() > 0) {
|
|
|
|
|
PageData record = new PageData();
|
|
|
|
|
record.put("CHECKRECORD_ID", records.get(0).get("CHECKRECORD_ID"));
|
|
|
|
|
List<PageData> checkedList = customCheckRecordItemService.listAll(record);
|
|
|
|
|
Map<String, Integer> checkmap = new HashMap<String, Integer>();//记录所有风险点
|
|
|
|
|
for (PageData item : checkedList) {
|
2024-02-01 10:43:52 +08:00
|
|
|
|
if (!checkmap.containsKey(item.getString("CHECK_ITEM"))) {
|
|
|
|
|
checkmap.put(item.getString("CHECK_ITEM"), 1);
|
2024-01-31 15:15:23 +08:00
|
|
|
|
} else {
|
2024-02-01 10:43:52 +08:00
|
|
|
|
checkmap.put(item.getString("CHECK_ITEM"), checkmap.get(item.getString("CHECK_ITEM")) + 1);
|
2024-01-31 15:15:23 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
map.put("CHECKRECORD_ID", records.get(0).get("CHECKRECORD_ID"));
|
|
|
|
|
map.put("checkmap", checkmap);
|
|
|
|
|
}
|
|
|
|
|
} else if (cycle.equals("每季")) {
|
|
|
|
|
PageData type = new PageData();
|
|
|
|
|
type.put("CUSTOM_ID", pd.get("CUSTOM_ID"));
|
|
|
|
|
type.put("IS_QUARTER", 1);
|
|
|
|
|
type.put("FINISHED", '0');
|
|
|
|
|
type.put("USER_ID", USER_ID);
|
|
|
|
|
List<PageData> records = customCheckRecordService.listAllUnfinished(type);
|
|
|
|
|
pd.put("checkCount", records == null ? 0 : records.size());
|
|
|
|
|
if (records != null && records.size() > 0) {
|
|
|
|
|
PageData record = new PageData();
|
|
|
|
|
record.put("CHECKRECORD_ID", records.get(0).get("CHECKRECORD_ID"));
|
|
|
|
|
List<PageData> checkedList = customCheckRecordItemService.listAll(record);
|
|
|
|
|
Map<String, Integer> checkmap = new HashMap<String, Integer>();//记录所有风险点
|
|
|
|
|
for (PageData item : checkedList) {
|
2024-02-01 10:43:52 +08:00
|
|
|
|
if (!checkmap.containsKey(item.getString("CHECK_ITEM"))) {
|
|
|
|
|
checkmap.put(item.getString("CHECK_ITEM"), 1);
|
2024-01-31 15:15:23 +08:00
|
|
|
|
} else {
|
2024-02-01 10:43:52 +08:00
|
|
|
|
checkmap.put(item.getString("CHECK_ITEM"), checkmap.get(item.getString("CHECK_ITEM")) + 1);
|
2024-01-31 15:15:23 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
map.put("CHECKRECORD_ID", records.get(0).get("CHECKRECORD_ID"));
|
|
|
|
|
map.put("checkmap", checkmap);
|
|
|
|
|
}
|
|
|
|
|
} else if (cycle.equals("半年")) {
|
|
|
|
|
PageData type = new PageData();
|
|
|
|
|
type.put("CUSTOM_ID", pd.get("CUSTOM_ID"));
|
|
|
|
|
type.put("IS_HALFYEAR", 1);
|
|
|
|
|
type.put("FINISHED", '0');
|
|
|
|
|
type.put("USER_ID", USER_ID);
|
|
|
|
|
List<PageData> records = customCheckRecordService.listAllUnfinished(type);
|
|
|
|
|
pd.put("checkCount", records == null ? 0 : records.size());
|
|
|
|
|
if (records != null && records.size() > 0) {
|
|
|
|
|
PageData record = new PageData();
|
|
|
|
|
record.put("CHECKRECORD_ID", records.get(0).get("CHECKRECORD_ID"));
|
|
|
|
|
List<PageData> checkedList = customCheckRecordItemService.listAll(record);
|
|
|
|
|
Map<String, Integer> checkmap = new HashMap<String, Integer>();//记录所有风险点
|
|
|
|
|
for (PageData item : checkedList) {
|
2024-02-01 10:43:52 +08:00
|
|
|
|
if (!checkmap.containsKey(item.getString("CHECK_ITEM"))) {
|
|
|
|
|
checkmap.put(item.getString("CHECK_ITEM"), 1);
|
2024-01-31 15:15:23 +08:00
|
|
|
|
} else {
|
2024-02-01 10:43:52 +08:00
|
|
|
|
checkmap.put(item.getString("CHECK_ITEM"), checkmap.get(item.getString("CHECK_ITEM")) + 1);
|
2024-01-31 15:15:23 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
map.put("CHECKRECORD_ID", records.get(0).get("CHECKRECORD_ID"));
|
|
|
|
|
map.put("checkmap", checkmap);
|
|
|
|
|
}
|
|
|
|
|
} else if (cycle.equals("每年")) {
|
|
|
|
|
PageData type = new PageData();
|
|
|
|
|
type.put("CUSTOM_ID", pd.get("CUSTOM_ID"));
|
|
|
|
|
type.put("IS_YEAR", 1);
|
|
|
|
|
type.put("FINISHED", '0');
|
|
|
|
|
type.put("USER_ID", USER_ID);
|
|
|
|
|
List<PageData> records = customCheckRecordService.listAllUnfinished(type);
|
|
|
|
|
pd.put("checkCount", records == null ? 0 : records.size());
|
|
|
|
|
if (records != null && records.size() > 0) {
|
|
|
|
|
PageData record = new PageData();
|
|
|
|
|
record.put("CHECKRECORD_ID", records.get(0).get("CHECKRECORD_ID"));
|
|
|
|
|
List<PageData> checkedList = customCheckRecordItemService.listAll(record);
|
|
|
|
|
Map<String, Integer> checkmap = new HashMap<String, Integer>();//记录所有风险点
|
|
|
|
|
for (PageData item : checkedList) {
|
2024-02-01 10:43:52 +08:00
|
|
|
|
if (!checkmap.containsKey(item.getString("CHECK_ITEM"))) {
|
|
|
|
|
checkmap.put(item.getString("CHECK_ITEM"), 1);
|
2024-01-31 15:15:23 +08:00
|
|
|
|
} else {
|
2024-02-01 10:43:52 +08:00
|
|
|
|
checkmap.put(item.getString("CHECK_ITEM"), checkmap.get(item.getString("CHECK_ITEM")) + 1);
|
2024-01-31 15:15:23 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
map.put("CHECKRECORD_ID", records.get(0).get("CHECKRECORD_ID"));
|
|
|
|
|
map.put("checkmap", checkmap);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
map.put("result", errInfo);
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2024-02-01 10:43:52 +08:00
|
|
|
|
/**
|
|
|
|
|
* 获取检查项
|
|
|
|
|
*
|
|
|
|
|
* @param
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "/goCheck")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
@LogAnno(menuType = "手机", menuServer = "隐患排查", instructionsOperate = "清单管理", instructionsType = "获取检查项")
|
|
|
|
|
public Object goCheck() throws Exception {
|
|
|
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
|
|
|
String errInfo = "success";
|
|
|
|
|
PageData pd = new PageData();
|
|
|
|
|
pd = this.getPageData();
|
|
|
|
|
List<PageData> varList = customItemService.listAll(pd);
|
|
|
|
|
for (PageData item : varList) {
|
|
|
|
|
item.put("RECORDITEM_ID", this.get32UUID()); //主键
|
|
|
|
|
}
|
|
|
|
|
map.put("varList", varList);
|
|
|
|
|
String USER_ID = pd.getString("USER_NAME");
|
|
|
|
|
pd = customService.findById(pd);
|
|
|
|
|
if (pd.getString("TYPE").equals("listType0005")) {
|
|
|
|
|
if (DateUtil.timeCalendar(new Date(), DateUtil.fomatDateTime(pd.getString("START_DATE") + " 00:00:00"), DateUtil.fomatDateTime(pd.getString("END_DATE") + " 23:59:59"))) {
|
|
|
|
|
PageData type = new PageData();
|
|
|
|
|
type.put("LISTMANAGER_ID", pd.get("LISTMANAGER_ID"));
|
|
|
|
|
type.put("IS_XUN", 1);//查询方法和旬一样,直接借用
|
|
|
|
|
type.put("FINISHED", '0');
|
|
|
|
|
type.put("USER_ID", USER_ID);
|
|
|
|
|
type.put("BEGINTIME", pd.getString("START_DATE") + " 00:00:00");
|
|
|
|
|
type.put("ENDTIME", pd.getString("END_DATE") + " 23:59:59");
|
|
|
|
|
List<PageData> records = customCheckRecordService.listAllUnfinished(type);
|
|
|
|
|
if (records != null && records.size() > 0) {
|
|
|
|
|
PageData record = new PageData();
|
|
|
|
|
record.put("CHECKRECORD_ID", records.get(0).get("CHECKRECORD_ID"));
|
|
|
|
|
List<PageData> checkedList = customCheckRecordItemService.listAll(record);
|
|
|
|
|
map.put("records", checkedList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
map.put("result", errInfo);
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
String cycle = pd.getString("PERIODNAME");
|
|
|
|
|
if (cycle.equals("每日")) {
|
|
|
|
|
PageData type = new PageData();
|
|
|
|
|
type.put("LISTMANAGER_ID", pd.get("LISTMANAGER_ID"));
|
|
|
|
|
type.put("IS_DAY", 1);
|
|
|
|
|
type.put("FINISHED", '0');
|
|
|
|
|
type.put("USER_ID", USER_ID);
|
|
|
|
|
List<PageData> records = customCheckRecordService.listAllUnfinished(type);
|
|
|
|
|
if (records != null && records.size() > 0) {
|
|
|
|
|
PageData record = new PageData();
|
|
|
|
|
record.put("CHECKRECORD_ID", records.get(0).get("CHECKRECORD_ID"));
|
|
|
|
|
List<PageData> checkedList = customCheckRecordItemService.listAll(record);
|
|
|
|
|
map.put("records", checkedList);
|
|
|
|
|
}
|
|
|
|
|
} else if (cycle.equals("每周")) {
|
|
|
|
|
PageData type = new PageData();
|
|
|
|
|
type.put("LISTMANAGER_ID", pd.get("LISTMANAGER_ID"));
|
|
|
|
|
type.put("IS_WEEK", 1);
|
|
|
|
|
type.put("FINISHED", '0');
|
|
|
|
|
type.put("USER_ID", USER_ID);
|
|
|
|
|
List<PageData> records = customCheckRecordService.listAllUnfinished(type);
|
|
|
|
|
if (records != null && records.size() > 0) {
|
|
|
|
|
PageData record = new PageData();
|
|
|
|
|
record.put("CHECKRECORD_ID", records.get(0).get("CHECKRECORD_ID"));
|
|
|
|
|
List<PageData> checkedList = customCheckRecordItemService.listAll(record);
|
|
|
|
|
map.put("records", checkedList);
|
|
|
|
|
}
|
|
|
|
|
} else if (cycle.equals("每旬")) {
|
|
|
|
|
//1-10
|
|
|
|
|
if (DateUtil.timeCalendar(new Date(), DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "01 00:00:00"), DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "10 23:59:59"))) {
|
|
|
|
|
PageData type = new PageData();
|
|
|
|
|
type.put("LISTMANAGER_ID", pd.get("LISTMANAGER_ID"));
|
|
|
|
|
type.put("IS_XUN", 1);
|
|
|
|
|
type.put("FINISHED", '0');
|
|
|
|
|
type.put("USER_ID", USER_ID);
|
|
|
|
|
type.put("BEGINTIME", DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "01 00:00:00");
|
|
|
|
|
type.put("ENDTIME", DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "10 23:59:59");
|
|
|
|
|
List<PageData> records = customCheckRecordService.listAllUnfinished(type);
|
|
|
|
|
if (records != null && records.size() > 0) {
|
|
|
|
|
PageData record = new PageData();
|
|
|
|
|
record.put("CHECKRECORD_ID", records.get(0).get("CHECKRECORD_ID"));
|
|
|
|
|
List<PageData> checkedList = customCheckRecordItemService.listAll(record);
|
|
|
|
|
map.put("records", checkedList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//10-20
|
|
|
|
|
if (DateUtil.timeCalendar(new Date(), DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "11 00:00:00"), DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "20 23:59:59"))) {
|
|
|
|
|
PageData type = new PageData();
|
|
|
|
|
type.put("LISTMANAGER_ID", pd.get("LISTMANAGER_ID"));
|
|
|
|
|
type.put("IS_XUN", 1);
|
|
|
|
|
type.put("FINISHED", '0');
|
|
|
|
|
type.put("USER_ID", USER_ID);
|
|
|
|
|
type.put("BEGINTIME", DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "11 00:00:00");
|
|
|
|
|
type.put("ENDTIME", DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "20 23:59:59");
|
|
|
|
|
List<PageData> records = customCheckRecordService.listAllUnfinished(type);
|
|
|
|
|
if (records != null && records.size() > 0) {
|
|
|
|
|
PageData record = new PageData();
|
|
|
|
|
record.put("CHECKRECORD_ID", records.get(0).get("CHECKRECORD_ID"));
|
|
|
|
|
List<PageData> checkedList = customCheckRecordItemService.listAll(record);
|
|
|
|
|
map.put("records", checkedList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//20-月底
|
|
|
|
|
if (DateUtil.timeCalendar(new Date(), DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "21 00:00:00"), DateUtil.fomatDateTime(DateUtil.getMonthEndDay() + " 23:59:59"))) {
|
|
|
|
|
PageData type = new PageData();
|
|
|
|
|
type.put("LISTMANAGER_ID", pd.get("LISTMANAGER_ID"));
|
|
|
|
|
type.put("IS_XUN", 1);
|
|
|
|
|
type.put("FINISHED", '0');
|
|
|
|
|
type.put("USER_ID", USER_ID);
|
|
|
|
|
type.put("BEGINTIME", DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "21 00:00:00");
|
|
|
|
|
type.put("ENDTIME", DateUtil.getMonthEndDay() + " 23:59:59");
|
|
|
|
|
List<PageData> records = customCheckRecordService.listAllUnfinished(type);
|
|
|
|
|
if (records != null && records.size() > 0) {
|
|
|
|
|
PageData record = new PageData();
|
|
|
|
|
record.put("CHECKRECORD_ID", records.get(0).get("CHECKRECORD_ID"));
|
|
|
|
|
List<PageData> checkedList = customCheckRecordItemService.listAll(record);
|
|
|
|
|
map.put("records", checkedList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if (cycle.equals("每月")) {
|
|
|
|
|
PageData type = new PageData();
|
|
|
|
|
type.put("LISTMANAGER_ID", pd.get("LISTMANAGER_ID"));
|
|
|
|
|
type.put("IS_MONTH", 1);
|
|
|
|
|
type.put("FINISHED", '0');
|
|
|
|
|
type.put("USER_ID", USER_ID);
|
|
|
|
|
List<PageData> records = customCheckRecordService.listAllUnfinished(type);
|
|
|
|
|
if (records != null && records.size() > 0) {
|
|
|
|
|
PageData record = new PageData();
|
|
|
|
|
record.put("CHECKRECORD_ID", records.get(0).get("CHECKRECORD_ID"));
|
|
|
|
|
List<PageData> checkedList = customCheckRecordItemService.listAll(record);
|
|
|
|
|
map.put("records", checkedList);
|
|
|
|
|
}
|
|
|
|
|
} else if (cycle.equals("每季")) {
|
|
|
|
|
PageData type = new PageData();
|
|
|
|
|
type.put("LISTMANAGER_ID", pd.get("LISTMANAGER_ID"));
|
|
|
|
|
type.put("IS_QUARTER", 1);
|
|
|
|
|
type.put("FINISHED", '0');
|
|
|
|
|
type.put("USER_ID", USER_ID);
|
|
|
|
|
List<PageData> records = customCheckRecordService.listAllUnfinished(type);
|
|
|
|
|
if (records != null && records.size() > 0) {
|
|
|
|
|
PageData record = new PageData();
|
|
|
|
|
record.put("CHECKRECORD_ID", records.get(0).get("CHECKRECORD_ID"));
|
|
|
|
|
List<PageData> checkedList = customCheckRecordItemService.listAll(record);
|
|
|
|
|
map.put("records", checkedList);
|
|
|
|
|
}
|
|
|
|
|
} else if (cycle.equals("半年")) {
|
|
|
|
|
PageData type = new PageData();
|
|
|
|
|
type.put("LISTMANAGER_ID", pd.get("LISTMANAGER_ID"));
|
|
|
|
|
type.put("IS_HALFYEAR", 1);
|
|
|
|
|
type.put("FINISHED", '0');
|
|
|
|
|
type.put("USER_ID", USER_ID);
|
|
|
|
|
List<PageData> records = customCheckRecordService.listAllUnfinished(type);
|
|
|
|
|
if (records != null && records.size() > 0) {
|
|
|
|
|
PageData record = new PageData();
|
|
|
|
|
record.put("CHECKRECORD_ID", records.get(0).get("CHECKRECORD_ID"));
|
|
|
|
|
List<PageData> checkedList = customCheckRecordItemService.listAll(record);
|
|
|
|
|
map.put("records", checkedList);
|
|
|
|
|
}
|
|
|
|
|
} else if (cycle.equals("每年")) {
|
|
|
|
|
PageData type = new PageData();
|
|
|
|
|
type.put("LISTMANAGER_ID", pd.get("LISTMANAGER_ID"));
|
|
|
|
|
type.put("IS_YEAR", 1);
|
|
|
|
|
type.put("FINISHED", '0');
|
|
|
|
|
type.put("USER_ID", USER_ID);
|
|
|
|
|
List<PageData> records = customCheckRecordService.listAllUnfinished(type);
|
|
|
|
|
if (records != null && records.size() > 0) {
|
|
|
|
|
PageData record = new PageData();
|
|
|
|
|
record.put("CHECKRECORD_ID", records.get(0).get("CHECKRECORD_ID"));
|
|
|
|
|
List<PageData> checkedList = customCheckRecordItemService.listAll(record);
|
|
|
|
|
map.put("records", checkedList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
map.put("result", errInfo);
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2024-01-31 15:15:23 +08:00
|
|
|
|
|
|
|
|
|
}
|