隐患排查接口

pull/4/head
zhangyanli 2024-01-31 11:59:44 +08:00
parent 1f8a3f7f6f
commit 0602963d2f
19 changed files with 4218 additions and 256 deletions

View File

@ -45,7 +45,8 @@ public class CommonController extends BaseController {
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业
pd = corpinfoService.findById(pd); //根据ID读取
PageData corpinfo = corpinfoService.findById(pd); //根据ID读取
pd.put("CORP_TYPE_NAME", corpinfo.getString("CORP_TYPE_NAME"));
page.setPd(pd);
List<PageData> varList = commonService.list(page); //列出RiskCheckItem列表
map.put("varList", varList);

View File

@ -5,23 +5,23 @@ 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.CustomItemService;
import com.zcloud.service.hiddenDangerCheckStandard.CustomService;
import com.zcloud.service.hiddenDangerCheckStandard.*;
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.apache.shiro.authz.annotation.RequiresPermissions;
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;
@ -41,17 +41,15 @@ public class CustomController extends BaseController {
@Autowired
private CustomItemService customItemService;
@Autowired
private ListCheckItemService listcheckitemService;
private CustomDisableTimeService customDisableTimeService;
@Autowired
private DepartmentService departmentService;
@Autowired
private CheckRecordService checkrecordService;
private CustomCheckRecordService customCheckRecordService;
@Autowired
private RecordItemService recordItemService;
@Autowired
private RiskPointService riskpointService;
@Autowired
private ListStatisticsService listStatisticsService;
private CustomStatisticsService customStatisticsService;
@Autowired
private IdentificationPartsService identificationPartsService;
@Autowired
@ -97,17 +95,145 @@ public class CustomController extends BaseController {
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
PageData npd = new PageData();
pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
if(Tools.notEmpty(KEYWORDS))npd.put("KEYWORDS", KEYWORDS.trim());
List<PageData> varList = customService.listAll(pd);
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
page.setPd(pd);
List<PageData> varList = customService.list(page);
map.put("varList", varList);
map.put("result", errInfo);
return map;
}
/**
* @param out
* @throws Exception
*/
@RequestMapping(value="/delete")
@ResponseBody
@LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单管理",instructionsType = "禁用")
public Object delete() throws Exception{
Map<String,String> map = new HashMap<String,String>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
customService.delete(pd);
pd = customService.findById(pd);
// 记录清单禁用开始时间
PageData disPd = new PageData();
disPd = this.getPageData();
disPd.put("CUSTOMDISABLETIME_ID", this.get32UUID()); //主键
disPd.put("CUSTOM_ID", pd.get("CUSTOM_ID"));
disPd.put("CORPINFO_ID", pd.get("CORPINFO_ID"));
disPd.put("STARTTIME", DateUtil.date2Str(new Date())); //开始时间
disPd.put("ISDELETE", "0"); //是否删除 0 未删除 1已删除
disPd.put("OPERATOR", Jurisdiction.getUsername()); //操作人
disPd.put("OPERATTIME", DateUtil.date2Str(new Date())); //操作时间
disPd.put("CREATOR", Jurisdiction.getUsername()); //创建人
disPd.put("CREATTIME", DateUtil.date2Str(new Date())); //创建时间
customDisableTimeService.save(disPd);
// 修改清单统计
if(pd.get("TYPE") != null && Tools.notEmpty(pd.get("TYPE").toString())) {
if("listType0005".equals(pd.get("TYPE").toString())) {
pd.put("CUSTOMSTATISTICS_ID", this.get32UUID()); //主键
pd.put("STARTTIME", pd.get("START_DATE").toString()+" 00:00:00");
pd.put("ENDTIME", pd.get("END_DATE").toString()+" 23:59:59");
pd.put("PERIOD", null);
PageData statistics = customStatisticsService.findByCondition(pd);
if(statistics != null && statistics.get("LISTSTATISTICS_ID") != null) {
statistics.put("NOTEXAMINEDNUM", Integer.parseInt(statistics.get("NOTEXAMINEDNUM").toString())-2);
customStatisticsService.edit(statistics);
}
pd.put("ISSTATISTICS", '0');
// 本期已检查的不计入统计
customCheckRecordService.editStatistics(pd);
} else {
if(pd.get("PERIOD") != null && Tools.notEmpty(pd.get("PERIOD").toString())) {
String period = pd.get("PERIOD").toString();
switch (period) {
case "checkPeriod0001"://每日
pd.put("STARTTIME", DateUtil.getDay()+" 00:00:00");
pd.put("ENDTIME", DateUtil.getDay()+" 23:59:59");
break;
case "checkPeriod0002"://每周
pd.put("STARTTIME", DateUtil.getWeekStart());
pd.put("ENDTIME", DateUtil.getWeekEnd());
break;
case "checkPeriod0003"://每旬
String year = DateUtil.getYear().toString();
String month = DateUtil.getMonth().toString();
Integer day = Integer.parseInt(DateUtil.getOnlyDay().toString());
String startTime = year + "-" + month + "-";
String endTime = year + "-" + month + "-";
if(day <= 10) {
startTime = startTime+"01 00:00:00";
endTime = endTime+"10 23:59:59";
} else if(day > 10 && day <= 20) {
startTime = startTime+"11 00:00:00";
endTime = endTime+"20 23:59:59";
} else {
startTime = startTime+"21 00:00:00";
endTime = DateUtil.getMonthEndDay()+" 23:59:59";
}
pd.put("STARTTIME", startTime);
pd.put("ENDTIME", endTime);
break;
case "checkPeriod0004"://每月
pd.put("STARTTIME", DateUtil.getMonthFirstDay()+" 00:00:00");
pd.put("ENDTIME", DateUtil.getMonthEndDay()+" 23:59:59");
break;
case "checkPeriod0005"://每季
pd.put("STARTTIME", DateUtil.quarterStart()+" 00:00:00");
pd.put("ENDTIME", DateUtil.quarterEnd()+" 23:59:59");
break;
case "checkPeriod0006"://每年
pd.put("STARTTIME", DateUtil.getCurrYearFirst()+" 00:00:00");
pd.put("ENDTIME", DateUtil.getCurrYearLast()+" 23:59:59");
break;
case "checkPeriod0007"://半年
String byear = DateUtil.getYear().toString();
Integer bmonth = Integer.parseInt(DateUtil.getMonth().toString());
if(bmonth <= 6) {
pd.put("STARTTIME", byear+"-01-01 00:00:00");
pd.put("ENDTIME", byear+"-06-30 23:59:59");
} else if(bmonth > 6) {
pd.put("STARTTIME", byear+"-07-01 00:00:00");
pd.put("ENDTIME", byear+"-12-31 23:59:59");
}
break;
default:
break;
}
}
PageData statistics = customStatisticsService.findByCondition(pd);
if(statistics != null && statistics.get("LISTSTATISTICS_ID") != null) {
statistics.put("NOTEXAMINEDNUM", Integer.parseInt(statistics.get("NOTEXAMINEDNUM").toString())-1);
customStatisticsService.edit(statistics);
}
pd.put("ISSTATISTICS", '0');
// 本期已检查的不计入统计
customCheckRecordService.editStatistics(pd);
}
}
// 将本频率内已检查的记录,改为不计入
map.put("result", errInfo); //返回结果
return map;
}
// /**列表
// * @param page
// * @throws Exception
@ -317,173 +443,173 @@ public class CustomController extends BaseController {
// map.put("result", errInfo);
// return map;
// }
//
// /**批量删除
// * @param
// * @throws Exception
// */
// @RequestMapping(value="/deleteAll")
// @RequiresPermissions("listmanager:del")
// @ResponseBody
// @LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单管理",instructionsType = "批量删除")
// public Object deleteAll() throws Exception{
// Map<String,Object> map = new HashMap<String,Object>();
// String errInfo = "success";
// PageData pd = new PageData();
// pd = this.getPageData();
// String DATA_IDS = pd.getString("DATA_IDS");
// if(Tools.notEmpty(DATA_IDS)){
// String ArrayDATA_IDS[] = DATA_IDS.split(",");
// for(int i = 0; i < ArrayDATA_IDS.length; i++) {
// PageData pd1 = new PageData();
// pd1.put("OPERATOR", Jurisdiction.getUsername()); //修改人
// pd1.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
// pd1.put("LISTMANAGER_ID", ArrayDATA_IDS[i]);
// listmanagerService.remove(pd1);
// pd1 = listmanagerService.findById(pd1);
// if(pd1.get("TYPE") != null && Tools.notEmpty(pd1.get("TYPE").toString())) {
// if("listType0005".equals(pd1.get("TYPE").toString())) {
// pd1.put("LISTSTATISTICS_ID", this.get32UUID()); //主键
// pd1.put("STARTTIME", pd1.get("START_DATE").toString()+" 00:00:00");
// pd1.put("ENDTIME", pd1.get("END_DATE").toString()+" 23:59:59");
// pd1.put("PERIOD", null);
// PageData statistics = listStatisticsService.findByCondition(pd1);
// if(statistics != null && statistics.get("LISTSTATISTICS_ID") != null) {
// statistics.put("NOTEXAMINEDNUM", Integer.parseInt(statistics.get("NOTEXAMINEDNUM").toString())-2);
// listStatisticsService.edit(statistics);
// }
// pd1.put("ISSTATISTICS", '0');
// // 本期已检查的不计入统计
// checkrecordService.editStatistics(pd1);
// } else {
// if(pd1.get("PERIOD") != null && Tools.notEmpty(pd1.get("PERIOD").toString())) {
// String period = pd1.get("PERIOD").toString();
// switch (period) {
// case "checkPeriod0001"://每日
// pd1.put("STARTTIME", DateUtil.getDay()+" 00:00:00");
// pd1.put("ENDTIME", DateUtil.getDay()+" 23:59:59");
// break;
//
// case "checkPeriod0002"://每周
// pd1.put("STARTTIME", DateUtil.getWeekStart());
// pd1.put("ENDTIME", DateUtil.getWeekEnd());
// break;
//
// case "checkPeriod0003"://每旬
// String year = DateUtil.getYear().toString();
// String month = DateUtil.getMonth().toString();
// Integer day = Integer.parseInt(DateUtil.getOnlyDay().toString());
// String startTime = year + "-" + month + "-";
// String endTime = year + "-" + month + "-";
// if(day <= 10) {
// startTime = startTime+"01 00:00:00";
// endTime = endTime+"10 23:59:59";
// } else if(day > 10 && day <= 20) {
// startTime = startTime+"11 00:00:00";
// endTime = endTime+"20 23:59:59";
// } else {
// startTime = startTime+"21 00:00:00";
// endTime = DateUtil.getMonthEndDay()+" 23:59:59";
// }
// pd1.put("STARTTIME", startTime);
// pd1.put("ENDTIME", endTime);
// break;
//
// case "checkPeriod0004"://每月
// pd1.put("STARTTIME", DateUtil.getMonthFirstDay()+" 00:00:00");
// pd1.put("ENDTIME", DateUtil.getMonthEndDay()+" 23:59:59");
// break;
//
// case "checkPeriod0005"://每季
// pd1.put("STARTTIME", DateUtil.quarterStart()+" 00:00:00");
// pd1.put("ENDTIME", DateUtil.quarterEnd()+" 23:59:59");
// break;
//
// case "checkPeriod0006"://每年
// pd1.put("STARTTIME", DateUtil.getCurrYearFirst()+" 00:00:00");
// pd1.put("ENDTIME", DateUtil.getCurrYearLast()+" 23:59:59");
// break;
//
// case "checkPeriod0007"://半年
// String byear = DateUtil.getYear().toString();
// Integer bmonth = Integer.parseInt(DateUtil.getMonth().toString());
// if(bmonth <= 6) {
// pd1.put("STARTTIME", byear+"-01-01 00:00:00");
// pd1.put("ENDTIME", byear+"-06-30 23:59:59");
// } else if(bmonth > 6) {
// pd1.put("STARTTIME", byear+"-07-01 00:00:00");
// pd1.put("ENDTIME", byear+"-12-31 23:59:59");
// }
// break;
//
// default:
// break;
// }
// }
// PageData statistics = listStatisticsService.findByCondition(pd1);
// if(statistics != null && statistics.get("LISTSTATISTICS_ID") != null) {
// statistics.put("NOTEXAMINEDNUM", Integer.parseInt(statistics.get("NOTEXAMINEDNUM").toString())-1);
// listStatisticsService.edit(statistics);
// }
//
// pd1.put("ISSTATISTICS", '0');
// // 本期已检查的不计入统计
// checkrecordService.editStatistics(pd1);
// }
// }
// }
// errInfo = "success";
// }else{
// errInfo = "error";
// }
// map.put("result", errInfo); //返回结果
// return map;
// }
//
// /**批量删除
// * @param
// * @throws Exception
// */
// @RequestMapping(value="/deleteAlltemp")
// @ResponseBody
// @LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单管理",instructionsType = "批量删除")
// public Object deleteAlltemp() throws Exception{
// Map<String,Object> map = new HashMap<String,Object>();
// String errInfo = "success";
// PageData pd = new PageData();
// pd = this.getPageData();
// String DATA_IDS = pd.getString("DATA_IDS");
// if(Tools.notEmpty(DATA_IDS)){
// String ArrayDATA_IDS[] = DATA_IDS.split(",");
// for(int i = 0; i < ArrayDATA_IDS.length; i++) {
// PageData pd1 = new PageData();
// pd1.put("OPERATOR", Jurisdiction.getUsername()); //修改人
// pd1.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
// pd1.put("LISTMANAGER_ID", ArrayDATA_IDS[i]);
// listmanagerService.deleted(pd1);
// pd1 = listmanagerService.findById(pd1);
// if(pd1.get("TYPE") != null && Tools.notEmpty(pd1.get("TYPE").toString())) {
// pd1.put("LISTSTATISTICS_ID", this.get32UUID()); //主键
// pd1.put("STARTTIME", pd1.get("START_DATE").toString()+" 00:00:00");
// pd1.put("ENDTIME", pd1.get("END_DATE").toString()+" 23:59:59");
// pd1.put("PERIOD", null);
// PageData statistics = listStatisticsService.findByCondition(pd1);
// if(statistics != null && statistics.get("LISTSTATISTICS_ID") != null) {
// statistics.put("NOTEXAMINEDNUM", Integer.parseInt(statistics.get("NOTEXAMINEDNUM").toString())-1);
// listStatisticsService.edit(statistics);
// }
// pd1.put("ISSTATISTICS", '0');
// // 本期已检查的不计入统计
// checkrecordService.editStatistics(pd1);
// }
// }
// errInfo = "success";
// }else{
// errInfo = "error";
// }
// map.put("result", errInfo); //返回结果
// return map;
// }
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/deleteAll")
@RequiresPermissions("listmanager:del")
@ResponseBody
@LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单管理",instructionsType = "批量删除")
public Object deleteAll() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
String DATA_IDS = pd.getString("DATA_IDS");
if(Tools.notEmpty(DATA_IDS)){
String ArrayDATA_IDS[] = DATA_IDS.split(",");
for(int i = 0; i < ArrayDATA_IDS.length; i++) {
PageData pd1 = new PageData();
pd1.put("OPERATOR", Jurisdiction.getUsername()); //修改人
pd1.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
pd1.put("CUSTOM_ID", ArrayDATA_IDS[i]);
customService.remove(pd1);
pd1 = customService.findById(pd1);
if(pd1.get("TYPE") != null && Tools.notEmpty(pd1.get("TYPE").toString())) {
if("listType0005".equals(pd1.get("TYPE").toString())) {
pd1.put("CUSTOMSTATISTICS_ID", this.get32UUID()); //主键
pd1.put("STARTTIME", pd1.get("START_DATE").toString()+" 00:00:00");
pd1.put("ENDTIME", pd1.get("END_DATE").toString()+" 23:59:59");
pd1.put("PERIOD", null);
PageData statistics = customStatisticsService.findByCondition(pd1);
if(statistics != null && statistics.get("CUSTOMSTATISTICS_ID") != null) {
statistics.put("NOTEXAMINEDNUM", Integer.parseInt(statistics.get("NOTEXAMINEDNUM").toString())-2);
customStatisticsService.edit(statistics);
}
pd1.put("ISSTATISTICS", '0');
// 本期已检查的不计入统计
customCheckRecordService.editStatistics(pd1);
} else {
if(pd1.get("PERIOD") != null && Tools.notEmpty(pd1.get("PERIOD").toString())) {
String period = pd1.get("PERIOD").toString();
switch (period) {
case "checkPeriod0001"://每日
pd1.put("STARTTIME", DateUtil.getDay()+" 00:00:00");
pd1.put("ENDTIME", DateUtil.getDay()+" 23:59:59");
break;
case "checkPeriod0002"://每周
pd1.put("STARTTIME", DateUtil.getWeekStart());
pd1.put("ENDTIME", DateUtil.getWeekEnd());
break;
case "checkPeriod0003"://每旬
String year = DateUtil.getYear().toString();
String month = DateUtil.getMonth().toString();
Integer day = Integer.parseInt(DateUtil.getOnlyDay().toString());
String startTime = year + "-" + month + "-";
String endTime = year + "-" + month + "-";
if(day <= 10) {
startTime = startTime+"01 00:00:00";
endTime = endTime+"10 23:59:59";
} else if(day > 10 && day <= 20) {
startTime = startTime+"11 00:00:00";
endTime = endTime+"20 23:59:59";
} else {
startTime = startTime+"21 00:00:00";
endTime = DateUtil.getMonthEndDay()+" 23:59:59";
}
pd1.put("STARTTIME", startTime);
pd1.put("ENDTIME", endTime);
break;
case "checkPeriod0004"://每月
pd1.put("STARTTIME", DateUtil.getMonthFirstDay()+" 00:00:00");
pd1.put("ENDTIME", DateUtil.getMonthEndDay()+" 23:59:59");
break;
case "checkPeriod0005"://每季
pd1.put("STARTTIME", DateUtil.quarterStart()+" 00:00:00");
pd1.put("ENDTIME", DateUtil.quarterEnd()+" 23:59:59");
break;
case "checkPeriod0006"://每年
pd1.put("STARTTIME", DateUtil.getCurrYearFirst()+" 00:00:00");
pd1.put("ENDTIME", DateUtil.getCurrYearLast()+" 23:59:59");
break;
case "checkPeriod0007"://半年
String byear = DateUtil.getYear().toString();
Integer bmonth = Integer.parseInt(DateUtil.getMonth().toString());
if(bmonth <= 6) {
pd1.put("STARTTIME", byear+"-01-01 00:00:00");
pd1.put("ENDTIME", byear+"-06-30 23:59:59");
} else if(bmonth > 6) {
pd1.put("STARTTIME", byear+"-07-01 00:00:00");
pd1.put("ENDTIME", byear+"-12-31 23:59:59");
}
break;
default:
break;
}
}
PageData statistics = customStatisticsService.findByCondition(pd1);
if(statistics != null && statistics.get("CUSTOMSTATISTICS_ID") != null) {
statistics.put("NOTEXAMINEDNUM", Integer.parseInt(statistics.get("NOTEXAMINEDNUM").toString())-1);
customStatisticsService.edit(statistics);
}
pd1.put("ISSTATISTICS", '0');
// 本期已检查的不计入统计
customCheckRecordService.editStatistics(pd1);
}
}
}
errInfo = "success";
}else{
errInfo = "error";
}
map.put("result", errInfo); //返回结果
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/deleteAlltemp")
@ResponseBody
@LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单管理",instructionsType = "批量删除")
public Object deleteAlltemp() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
String DATA_IDS = pd.getString("DATA_IDS");
if(Tools.notEmpty(DATA_IDS)){
String ArrayDATA_IDS[] = DATA_IDS.split(",");
for(int i = 0; i < ArrayDATA_IDS.length; i++) {
PageData pd1 = new PageData();
pd1.put("OPERATOR", Jurisdiction.getUsername()); //修改人
pd1.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
pd1.put("CUSTOM_ID", ArrayDATA_IDS[i]);
customService.deleted(pd1);
pd1 = customService.findById(pd1);
if(pd1.get("TYPE") != null && Tools.notEmpty(pd1.get("TYPE").toString())) {
pd1.put("CUSTOMSTATISTICS_ID", this.get32UUID()); //主键
pd1.put("STARTTIME", pd1.get("START_DATE").toString()+" 00:00:00");
pd1.put("ENDTIME", pd1.get("END_DATE").toString()+" 23:59:59");
pd1.put("PERIOD", null);
PageData statistics = customStatisticsService.findByCondition(pd1);
if(statistics != null && statistics.get("CUSTOMSTATISTICS_ID") != null) {
statistics.put("NOTEXAMINEDNUM", Integer.parseInt(statistics.get("NOTEXAMINEDNUM").toString())-1);
customStatisticsService.edit(statistics);
}
pd1.put("ISSTATISTICS", '0');
// 本期已检查的不计入统计
customCheckRecordService.editStatistics(pd1);
}
}
errInfo = "success";
}else{
errInfo = "error";
}
map.put("result", errInfo); //返回结果
return map;
}
//
// /**导出到excel
// * @param
@ -735,7 +861,7 @@ public class CustomController extends BaseController {
// planMap.put(pageData.getString("type_bianma") + "," + pageData.getString("level_bianma") + "," + pageData.getString("period_bianma"),pageData);
// }
// //企业所有应查数
// List<PageData> staList = listStatisticsService.listAllForPlan(pd);
// List<PageData> staList = customStatisticsService.listAllForPlan(pd);
// for (PageData pageData : staList) {
// String rowName = pageData.getString("TYPE") + "," + pageData.getString("level_bianma") + "," + pageData.getString("PERIOD");
// PageData row = planMap.get(rowName);

View File

@ -34,7 +34,6 @@ public class StandardDictionaryController extends BaseController {
* @throws Exception
*/
@RequestMapping(value = "/list")
@RequiresPermissions("hiddendictionary:list")
@ResponseBody
public Object list() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();

View File

@ -0,0 +1,177 @@
package com.zcloud.mapper.datasource.hiddenDangerCheckStandard;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import java.util.List;
/**
*
* luoxiaobao
* 2021-01-04
* www.zcloudchina.com
*/
public interface CustomCheckRecordMapper {
/**
* @param pd
* @throws Exception
*/
void save(PageData pd);
/**
* @param pd
* @throws Exception
*/
void delete(PageData pd);
/**
* @param pd
* @throws Exception
*/
void edit(PageData pd);
/**
* @param pd
* @throws Exception
*/
int countOverTime(PageData pd);
/**
* @param page
* @throws Exception
*/
List<PageData> datalistPage(Page page);
/**
* @param page
* @throws Exception
*/
List<PageData> listlistPage(Page page);
/**()
* @param pd
* @throws Exception
*/
List<PageData> listAll(PageData pd);
List<PageData> findRiskPointByLId(PageData pd);
/**id
* @param pd
* @throws Exception
*/
PageData findById(PageData pd);
/**
* @param ArrayDATA_IDS
* @throws Exception
*/
void deleteAll(String[] ArrayDATA_IDS);
List<PageData> listAllUnfinished(PageData pd);
/* 统计功能 */
List<PageData> listCountDay(PageData pd);/* 统计日 */
List<PageData> listCountWeek(PageData pd);/* 统计周 */
List<PageData> listCountTenDays(PageData pd);/* 统计旬 */
List<PageData> listCountMonth(PageData pd);/* 统计功月 */
List<PageData> listCountQuarter(PageData pd);/* 统计季 */
List<PageData> listCountHalfYear(PageData pd);/* 统计半年 */
List<PageData> listCountYear(PageData pd);/* 统计年 */
Integer listCountJjr(PageData pd);/* 统计节假日 */
/**
* @param pd
* @throws Exception
*/
void editStatistics(PageData pd);
/**
*
* @param pd
* @return
*/
List<PageData> listLogByIde(PageData pd);
/**
*
* @param pd
* @return
*/
List<PageData> recordByIde(PageData pd);
/**
* @param pd
* @throws Exception
*/
void recording(PageData pd);
/**
* APP
* @param pd
* @return
*/
List<PageData> appdatalist(PageData pd);
/**
*
* @param pd
* @return
*/
List<PageData> countByPeriodUser(PageData pd);
/**
*
* @param pd
* @return
*/
int getWorkedUserCount(PageData pd);
/**
*
* @param pd
* @return
*/
public int getWorkedDepCount(PageData pd);
List<PageData> listTypeBi(PageData pd);
List<PageData> listForDocking(PageData pd);
void updateDocking(PageData pageData);
/**
* (ids)
* @param pd
* @return
*/
List<PageData> listForIdsAndMonth(PageData pd);
List<PageData> anaysis(PageData util);
PageData findByNumber(PageData condition);
/**
* (ID)
* @param pd
* @return
*/
public List<PageData> listAllYearForDay(PageData pd);
/**
* (ID)
* @param pd
* @return
*/
public List<PageData> listAllYearForWeek(PageData pd);
/**
* (ID)
* @param pd
* @return
*/
public List<PageData> listAllYearForTenday(PageData pd);
}

View File

@ -0,0 +1,75 @@
package com.zcloud.mapper.datasource.hiddenDangerCheckStandard;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import java.util.List;
/**
* -
* luoxiaobao
* 2020-12-31
* www.zcloudchina.com
*/
public interface CustomDisableTimeMapper {
/**
* @param pd
* @throws Exception
*/
void save(PageData pd);
/**
* @param pd
* @throws Exception
*/
void delete(PageData pd);
/**
* @param pd
* @throws Exception
*/
void edit(PageData pd);
/**
* @param pd
* @throws Exception
*/
void editEndTime(PageData pd);
/**
* @param page
* @throws Exception
*/
List<PageData> datalistPage(Page page);
/**()
* @param pd
* @throws Exception
*/
List<PageData> listAll(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> listByFull(PageData pd);
/**id
* @param pd
* @throws Exception
*/
PageData findById(PageData pd);
/**
* @param pd
* @throws Exception
*/
PageData findByList(PageData pd);
/**
* @param ArrayDATA_IDS
* @throws Exception
*/
void deleteAll(String[] ArrayDATA_IDS);
}

View File

@ -54,6 +54,7 @@ public interface CustomMapper {
* @throws Exception
*/
List<PageData> datalistPage(Page page);
List<PageData> stopdatalistPage(Page page);
/**()

View File

@ -0,0 +1,108 @@
package com.zcloud.mapper.datasource.hiddenDangerCheckStandard;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import java.util.List;
/**
*
* luoxiaobao
* 2021-01-27
* www.zcloudchina.com
*/
public interface CustomStatisticsMapper {
/**
* @param pd
* @throws Exception
*/
void save(PageData pd);
/**
* @param pd
* @throws Exception
*/
void delete(PageData pd);
/**
* @param pd
* @throws Exception
*/
void deletewl(PageData pd);
/**
* @param pd
* @throws Exception
*/
void edit(PageData pd);
/**
* @param page
* @throws Exception
*/
List<PageData> datalistPage(Page page);
/**()
* @param pd
* @throws Exception
*/
List<PageData> listAll(PageData pd);
/**()
* @param pd
* @throws Exception
*/
List<PageData> getCountList(PageData pd);
/**id
* @param pd
* @throws Exception
*/
PageData findById(PageData pd);
/**
* @param pd
* @throws Exception
*/
PageData findByCondition(PageData pd);
/**
* @param ArrayDATA_IDS
* @throws Exception
*/
void deleteAll(String[] ArrayDATA_IDS);
PageData getTimeAstrict(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> countStaByUser(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> countSta(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> checkSituation(PageData pd);
/**1
* @param pd
* @throws Exception
*/
List<PageData> countListStaByUser(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> countByPeriodUser(PageData pd);
List<PageData> listAllForPlan(PageData pd);
}

View File

@ -0,0 +1,178 @@
package com.zcloud.service.hiddenDangerCheckStandard;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import java.util.List;
/**
*
* luoxiaobao
* 2021-01-04
* www.zcloudchina.com
*/
public interface CustomCheckRecordService {
/**
* @param pd
* @throws Exception
*/
public void save(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public void delete(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public void edit(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public int countOverTime(PageData pd)throws Exception;
/**
* @param page
* @throws Exception
*/
public List<PageData> list(Page page)throws Exception;
/**
* @param page
* @throws Exception
*/
public List<PageData> listAllList(Page page)throws Exception;
/**()
* @param pd
* @throws Exception
*/
public List<PageData> listAll(PageData pd)throws Exception;
/**()
* @param pd
* @throws Exception
*/
public List<PageData> listAllUnfinished(PageData pd)throws Exception;
/**ID
* @param pd
* @throws Exception
*/
public List<PageData> findRiskPointByLId(PageData pd)throws Exception;
/**id
* @param pd
* @throws Exception
*/
public PageData findById(PageData pd)throws Exception;
/**
* @param ArrayDATA_IDS
* @throws Exception
*/
public void deleteAll(String[] ArrayDATA_IDS)throws Exception;
/* 统计功能 */
public List<PageData> listCountDay(PageData pd)throws Exception;/* 统计日 */
public List<PageData> listCountWeek(PageData pd)throws Exception;/* 统计周 */
public List<PageData> listCountTenDays(PageData pd)throws Exception;/* 统计旬 */
public List<PageData> listCountMonth(PageData pd)throws Exception;/* 统计功月 */
public List<PageData> listCountQuarter(PageData pd)throws Exception;/* 统计季 */
public List<PageData> listCountHalfYear(PageData pd)throws Exception;/* 统计半年 */
public List<PageData> listCountYear(PageData pd)throws Exception;/* 统计年 */
public Integer listCountJjr(PageData pd)throws Exception;/* 统计节假日 */
/**
* @param pd
* @throws Exception
*/
public void editStatistics(PageData pd)throws Exception;
/**
*
* @param pd
* @return
*/
public List<PageData> listLogByIde(PageData pd)throws Exception;
/**
*
* @param pd
* @return
*/
public List<PageData> recordByIde(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public void recording(PageData pd)throws Exception;
/**
* APP
* @param pd
* @return
*/
public List<PageData> appdatalist(PageData pd)throws Exception;
/**
*
* @param pd
* @return
*/
public List<PageData> countByPeriodUser(PageData pd)throws Exception;
/**
*
* @param pd
* @return
*/
public int getWorkedUserCount(PageData pd) throws Exception;
/**
*
* @param pd
* @return
*/
public int getWorkedDepCount(PageData pd)throws Exception;
public List<PageData> listTypeBi(PageData pd)throws Exception;
/**
* (ids)
* @param pd
* @return
*/
public List<PageData> listForIdsAndMonth(PageData pd)throws Exception;
/**
* (ID)
* @param pd
* @return
*/
public List<PageData> listAllYearForDay(PageData pd)throws Exception;
/**
* (ID)
* @param pd
* @return
*/
public List<PageData> listAllYearForWeek(PageData pd)throws Exception;
/**
* (ID)
* @param pd
* @return
*/
public List<PageData> statisticsListCheckTenday(PageData pd)throws Exception;
}

View File

@ -0,0 +1,68 @@
package com.zcloud.service.hiddenDangerCheckStandard;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import java.util.List;
public interface CustomDisableTimeService {
/**
* @param pd
* @throws Exception
*/
public void save(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public void delete(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public void edit(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public void editEndTime(PageData pd)throws Exception;
/**
* @param page
* @throws Exception
*/
public List<PageData> list(Page page)throws Exception;
/**()
* @param pd
* @throws Exception
*/
public List<PageData> listAll(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public List<PageData> listByFull(PageData pd)throws Exception;
/**id
* @param pd
* @throws Exception
*/
public PageData findById(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public PageData findByList(PageData pd)throws Exception;
/**
* @param ArrayDATA_IDS
* @throws Exception
*/
public void deleteAll(String[] ArrayDATA_IDS)throws Exception;
}

View File

@ -1,5 +1,6 @@
package com.zcloud.service.hiddenDangerCheckStandard;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import java.util.List;
@ -24,5 +25,40 @@ public interface CustomService {
*/
public List<PageData> listAll(PageData pd)throws Exception;
/**
* @param page
* @throws Exception
*/
public List<PageData> list(Page page)throws Exception;
/**
* @param pd
* @throws Exception
*/
public void delete(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public void remove(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public void deleted(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public void enable(PageData pd)throws Exception;
/**id
* @param pd
* @throws Exception
*/
public PageData findById(PageData pd)throws Exception;
}

View File

@ -0,0 +1,110 @@
package com.zcloud.service.hiddenDangerCheckStandard;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import java.util.List;
/**
*
* luoxiaobao
* 2021-01-27
* www.zcloudchina.com
*/
public interface CustomStatisticsService {
/**
* @param pd
* @throws Exception
*/
public void save(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public void delete(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public void deletewl(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public void edit(PageData pd)throws Exception;
/**
* @param page
* @throws Exception
*/
public List<PageData> list(Page page)throws Exception;
/**()
* @param pd
* @throws Exception
*/
public List<PageData> listAll(PageData pd)throws Exception;
/**()
* @param pd
* @throws Exception
*/
public List<PageData> getCountList(PageData pd)throws Exception;
/**id
* @param pd
* @throws Exception
*/
public PageData findById(PageData pd)throws Exception;
/**
* @param ArrayDATA_IDS
* @throws Exception
*/
public void deleteAll(String[] ArrayDATA_IDS)throws Exception;
/**
* @param pd
* @throws Exception
*/
public PageData findByCondition(PageData pd)throws Exception;
public PageData getTimeAstrict(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public List<PageData> countStaByUser(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public List<PageData> countSta(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public List<PageData> checkSituation(PageData pd)throws Exception;
/**1
* @param pd
* @throws Exception
*/
public List<PageData> countListStaByUser(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public List<PageData> countByPeriodUser(PageData pd)throws Exception;
public List<PageData> listAllForPlan(PageData pd)throws Exception;
}

View File

@ -0,0 +1,794 @@
package com.zcloud.service.hiddenDangerCheckStandard.impl;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.hiddenDangerCheckStandard.CustomCheckRecordMapper;
import com.zcloud.service.hiddenDangerCheckStandard.CustomCheckRecordService;
import com.zcloud.util.DateSysUtil;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
/**
*
* luoxiaobao
* 2021-01-04
* www.zcloudchina.com
*/
@Service
@Transactional //开启事物
public class CustomCheckRecordServiceImpl implements CustomCheckRecordService {
@Autowired
private CustomCheckRecordMapper customCheckRecordMapper;
/**
* @param pd
* @throws Exception
*/
public void save(PageData pd)throws Exception{
customCheckRecordMapper.save(pd);
}
/**
* @param pd
* @throws Exception
*/
public void delete(PageData pd)throws Exception{
customCheckRecordMapper.delete(pd);
}
/**
* @param pd
* @throws Exception
*/
public void edit(PageData pd)throws Exception{
customCheckRecordMapper.edit(pd);
}
/**
* @param pd
* @throws Exception
*/
public int countOverTime(PageData pd)throws Exception{
return customCheckRecordMapper.countOverTime(pd);
}
/**
* @param page
* @throws Exception
*/
public List<PageData> list(Page page)throws Exception{
return customCheckRecordMapper.datalistPage(page);
}
/**
* @param page
* @throws Exception
*/
public List<PageData> listAllList(Page page)throws Exception{
return customCheckRecordMapper.listlistPage(page);
}
/**()
* @param pd
* @throws Exception
*/
public List<PageData> listAll(PageData pd)throws Exception{
return customCheckRecordMapper.listAll(pd);
}
/**()
* @param pd
* @throws Exception
*/
public List<PageData> listAllUnfinished(PageData pd)throws Exception{
return customCheckRecordMapper.listAllUnfinished(pd);
}
/**ID
* @param pd
* @throws Exception
*/
public List<PageData> findRiskPointByLId(PageData pd)throws Exception{
return customCheckRecordMapper.findRiskPointByLId(pd);
}
/**id
* @param pd
* @throws Exception
*/
public PageData findById(PageData pd)throws Exception{
return customCheckRecordMapper.findById(pd);
}
/**
* @param ArrayDATA_IDS
* @throws Exception
*/
public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
customCheckRecordMapper.deleteAll(ArrayDATA_IDS);
}
/* 统计功能 */
@Override
public List<PageData> listCountDay(PageData pd) throws Exception {
return customCheckRecordMapper.listCountDay(pd);
}
@Override
public List<PageData> listCountWeek(PageData pd) throws Exception {
return customCheckRecordMapper.listCountWeek(pd);
}
@Override
public List<PageData> listCountTenDays(PageData pd) throws Exception {
return customCheckRecordMapper.listCountTenDays(pd);
}
@Override
public List<PageData> listCountMonth(PageData pd) throws Exception {
return customCheckRecordMapper.listCountMonth(pd);
}
@Override
public List<PageData> listCountQuarter(PageData pd) throws Exception {
return customCheckRecordMapper.listCountQuarter(pd);
}
@Override
public List<PageData> listCountHalfYear(PageData pd) throws Exception {
return customCheckRecordMapper.listCountHalfYear(pd);
}
@Override
public List<PageData> listCountYear(PageData pd) throws Exception {
return customCheckRecordMapper.listCountYear(pd);
}
@Override
public Integer listCountJjr(PageData pd) throws Exception {
return customCheckRecordMapper.listCountJjr(pd);
}
/**
* @param pd
* @throws Exception
*/
public void editStatistics(PageData pd)throws Exception{
customCheckRecordMapper.editStatistics(pd);
}
/**
*
* @param pd
* @return
*/
public List<PageData> listLogByIde(PageData pd)throws Exception{
return customCheckRecordMapper.listLogByIde(pd);
}
/**
*
* @param pd
* @return
*/
public List<PageData> recordByIde(PageData pd)throws Exception{
return customCheckRecordMapper.recordByIde(pd);
}
/**
* @param pd
* @throws Exception
*/
public void recording(PageData pd)throws Exception{
customCheckRecordMapper.recording(pd);
}
/**APP
* @param page
* @throws Exception
*/
public List<PageData> appdatalist(PageData pd)throws Exception{
return customCheckRecordMapper.appdatalist(pd);
}
/**
* @param page
* @throws Exception
*/
public List<PageData> countByPeriodUser(PageData pd)throws Exception{
return customCheckRecordMapper.countByPeriodUser(pd);
}
/**
*
* @param pd
* @return
*/
public int getWorkedUserCount(PageData pd) throws Exception{
return customCheckRecordMapper.getWorkedUserCount(pd);
}
/**
*
* @param pd
* @return
*/
public int getWorkedDepCount(PageData pd)throws Exception{
return customCheckRecordMapper.getWorkedDepCount(pd);
}
public List<PageData> listTypeBi(PageData pd)throws Exception{
return customCheckRecordMapper.listTypeBi(pd);
}
/**
* (ids)
* @param pd
* @return
*/
public List<PageData> listForIdsAndMonth(PageData pd)throws Exception{
return customCheckRecordMapper.listForIdsAndMonth(pd);
}
/**
* (ID)
* @param pd
* @return
*/
public List<PageData> listAllYearForDay(PageData pd)throws Exception {
List<PageData> list = new ArrayList<>();
List<PageData> recordList = customCheckRecordMapper.listAllYearForDay(pd);
List<PageData> trList = new ArrayList<>();
for (int i = 0; i < 12; i++) {
PageData month = new PageData();
month.put("MONTH",(i+1)+"");
List<PageData> dayList = new ArrayList<>();
List<PageData> tdList = new ArrayList<>();
int days = DateSysUtil.getMonthDays(Integer.parseInt(pd.getString("YEAR")), i);
for (int j = 1; j <= days; j++) {
PageData day = new PageData();
day.put("DAY", j+"");
day.put("CHECKDATA","△"); // 默认离岗
String curDay = pd.getString("YEAR") + "-" + ((i+1) <= 9 ? "0"+(i+1) : (i+1)) + "-" + (j <= 9 ? ("0"+j) : j);
//清单生成日期在遍历日期之后(未建立清单)
if (DateSysUtil.fomatDate(pd.getString("CREATTIME").substring(0,10)).after(DateSysUtil.fomatDate(curDay))) {
day.put("CHECKDATA","-");
}
else {
for (PageData r : recordList) {
if (curDay.equals(r.getString("PERIODSTART").substring(0,10))) {
if ("1".equals(r.getString("TYPE"))) {
day.put("CHECKDATA", "√"); // 已检查(隐患数)
break;
} else if ("2".equals(r.getString("TYPE"))) {
day.put("CHECKDATA","×"); // 未排查
break;
}
}
}
}
dayList.add(day);
if (j % 7 == 0) {
PageData dayPd = new PageData();
dayPd.put("DAYLIST", dayList);
tdList.add(dayPd);
dayList = new ArrayList<>();
}
}
if (dayList.size() > 0) {
PageData dayPd = new PageData();
dayPd.put("DAYLIST", dayList);
tdList.add(dayPd);
}
String curMonth = pd.getString("YEAR") + "-" + ((i+1) <= 9 ? "0"+(i+1) : (i+1));
List<String> hdList = new ArrayList<>();
recordList.forEach(record -> {
if(DateSysUtil.isSameMonth(record.getString("CREATTIME"),curMonth)) {//如果清单创建时间是查询月
String hddesc = record.getString("HIDDEN_DESC");
if (StringUtils.isNotBlank(hddesc)) {
String[] hddescArr = hddesc.split("[$]");
for (int k = 0; k < hddescArr.length; k++) {
hdList.add(hddescArr[k]);
}
}
}
});
month.put("HDLIST", hdList);
month.put("TDLIST", tdList);
trList.add(month);
if (i!=0 && (i+1) % 2 == 0) {
PageData tr = new PageData();
tr.put("TRLIST", trList);
list.add(tr);
trList = new ArrayList<>();
}
}
if (trList.size() > 0) {
PageData tr = new PageData();
tr.put("TRLIST", trList);
list.add(tr);
}
return list;
}
/**
* (ID)
* @param pd
* @return
*/
public List<PageData> listAllYearForWeek(PageData pd)throws Exception {
List<PageData> list = new ArrayList<>();
List<PageData> recordList = customCheckRecordMapper.listAllYearForWeek(pd);
recordList.forEach( record -> {
String week = DateSysUtil.getMonthNoAndWeekNo(record.getString("PERIODSTART")); // 按照排查任务的周期开始时间计算该任务是哪月第几周,例如:12,2
record.put("RECORD_WEEK", week);
});
String listWeek = DateSysUtil.getMonthNoAndWeekNo(pd.getString("CREATTIME"));
int index = 0, colIndex0 = 0, colIndex2 = 0, colIndex3 = 0, colIndex4 = 0, colIndex5 = 0;
for (int z = 0; z < 24; z++) {
List<PageData> trList = new ArrayList<>();
PageData col0 = new PageData();
col0.put("VALUETYPE","string");
col0.put("COLSPAN",2);
col0.put("ROWSPAN",1);
switch (index){
case 0:
col0.put("VALUE","月份");
trList.add(col0);
for (int i = 1; i <= 3; i++) {
PageData month = new PageData();
month.put("VALUETYPE","string");
month.put("VALUE", (colIndex0 * 3 + i) + "月");
month.put("COLSPAN", 5);
month.put("ROWSPAN", 1);
trList.add(month);
}
colIndex0++;
break;
case 1:
col0.put("VALUE","检查日期");
trList.add(col0);
for (int i = 1; i <= 3; i++) {
for (int j = 1; j <= 5; j++) {
PageData week = new PageData();
week.put("VALUETYPE","string");
week.put("VALUE", "第" + j + "周");
week.put("COLSPAN", 1);
week.put("ROWSPAN", 1);
trList.add(week);
}
}
break;
case 2:
col0.put("VALUE","检查情况");
col0.put("COLSPAN",1);
col0.put("ROWSPAN",4);
trList.add(col0);
PageData col1 = new PageData();
col1.put("VALUETYPE","string");
col1.put("VALUE","是否检查");
col1.put("COLSPAN",1);
col1.put("ROWSPAN",1);
trList.add(col1);
for (int i = 1; i <= 3; i++) {
for (int j = 1; j <= 5; j++) {
int month = colIndex2 * 3 + i;
String curWeek = pd.getString("YEAR") + "," + (month <= 9 ? "0"+month : month) + "," + j;
PageData col = new PageData();
col.put("VALUETYPE","string");
col.put("COLSPAN", 1);
col.put("ROWSPAN", 1);
col.put("VALUE","△"); // 默认离岗
//清单生成日期在遍历日期之后(未建立清单)
if (Integer.parseInt(listWeek.replace(",",""))>Integer.parseInt(curWeek.replace(",",""))) {
col.put("VALUE","-");
}
else {
for (PageData r : recordList) {
if (curWeek.equals(r.getString("RECORD_WEEK"))) {
if ("1".equals(r.getString("TYPE"))) {
col.put("VALUE", "√"); // 已检查(隐患数)
break;
} else if ("2".equals(r.getString("TYPE"))) {
col.put("VALUE","×"); // 未排查
break;
}
}
}
}
trList.add(col);
}
}
colIndex2++;
break;
case 3:
col0.put("VALUE","发现隐患数");
col0.put("COLSPAN",1);
col0.put("ROWSPAN",1);
trList.add(col0);
PageData col = new PageData();
col.put("VALUETYPE","array");
col.put("COLSPAN", 15);
col.put("ROWSPAN", 1);
for (int i = 1; i <= 3; i++) {
for (int j = 1; j <= 5; j++) {
int month = colIndex3 * 3 + i;
String curWeek = pd.getString("YEAR") + "," + (month <= 9 ? "0"+month : month) + "," + j;
PageData col01 = new PageData();
col01.put("VALUETYPE","string");
col01.put("COLSPAN", 1);
col01.put("ROWSPAN", 1);
col01.put("VALUE","0"); // 默认离岗
//清单生成日期在遍历日期之后(未建立清单)
if (Integer.parseInt(listWeek.replace(",",""))>Integer.parseInt(curWeek.replace(",",""))) {
col01.put("VALUE","0");
}
else {
int hiddenCount = 0;
for (PageData r : recordList) {
if (curWeek.equals(r.getString("RECORD_WEEK"))) {
if ("1".equals(r.getString("TYPE"))) {
hiddenCount += Integer.parseInt(r.getString("HIDDEN_COUNT"));
// col01.put("VALUE", r.getString("HIDDEN_COUNT")); // 已检查(隐患数)
} else if ("2".equals(r.getString("TYPE"))) {
hiddenCount = 0;
// col01.put("VALUE","0"); // 未排查
break;
}
}
}
col01.put("VALUE",hiddenCount); // 未排查
}
trList.add(col01);
}
}
// trList.add(col);
colIndex3++;
break;
case 4:
col0.put("VALUE","检查时间");
col0.put("COLSPAN",1);
trList.add(col0);
col = new PageData();
col.put("VALUETYPE","array");
col.put("COLSPAN", 15);
col.put("ROWSPAN", 1);
for (int i = 1; i <= 3; i++) {
for (int j = 1; j <= 5; j++) {
int month = colIndex4 * 3 + i;
String curWeek = pd.getString("YEAR") + "," + (month <= 9 ? "0"+month : month) + "," + j;
PageData col01 = new PageData();
col01.put("VALUETYPE","string");
col01.put("COLSPAN", 1);
col01.put("ROWSPAN", 1);
col01.put("VALUE",""); // 默认离岗
//清单生成日期在遍历日期之后(未建立清单)
if (Integer.parseInt(listWeek.replace(",",""))>Integer.parseInt(curWeek.replace(",",""))) {
col01.put("VALUE","");
}
else {
for (PageData r : recordList) {
if (curWeek.equals(r.getString("RECORD_WEEK"))) {
if ("1".equals(r.getString("TYPE"))) {
col01.put("VALUE", r.getString("CREATTIME")); // 已检查(隐患数)
break;
} else if ("2".equals(r.getString("TYPE"))) {
col01.put("VALUE",""); // 未排查
break;
}
}
}
}
trList.add(col01);
}
}
// trList.add(col);
colIndex4++;
break;
case 5:
col0.put("VALUE","发现问题");
col0.put("COLSPAN",1);
trList.add(col0);
PageData col02 = new PageData();
for (int i = 1; i <= 3; i++) {
List<String> descList = new ArrayList<>();
col02 = new PageData();
col02.put("VALUETYPE","array");
col02.put("COLSPAN", 5);
col02.put("ROWSPAN", 1);
// for (int j = 1; j <= 5; j++) {
int month = colIndex5 * 3 + i;
// String curWeek = pd.getString("YEAR") + "," + (month <= 9 ? "0"+month : month) + "," + j;
String curMonth = pd.getString("YEAR") + "-" + (month <= 9 ? "0"+month : month);
for (PageData r : recordList) {
// if (curWeek.equals(r.getString("RECORD_WEEK")) && StringUtils.isNotBlank(r.getString("HIDDENDESCR"))) {
if (DateSysUtil.isSameMonth(r.getString("PERIODSTART"),curMonth) && StringUtils.isNotBlank(r.getString("HIDDENDESCR"))) {
String[] hddescArr = r.getString("HIDDENDESCR").split("[$]");
for (int k = 0; k < hddescArr.length; k++) {
descList.add(hddescArr[k]);
}
}
}
// }
col02.put("VALUE",descList);
trList.add(col02);
}
colIndex5++;
break;
}
PageData tr = new PageData();
tr.put("TRLIST", trList);
list.add(tr);
index++;
if (index==6) { index = 0;}
}
return list;
}
/**
* (ID)
* @param pd
* @return
*/
public List<PageData> statisticsListCheckTenday(PageData pd)throws Exception {
List<PageData> list = new ArrayList<>();
List<PageData> recordList = customCheckRecordMapper.listAllYearForTenday(pd);
String[] tendayList = {"上旬", "中旬", "下旬"};
String listCreateDate = pd.getString("CREATTIME").substring(0, 10);
int index = 0, colIndex0 = 0, colIndex2 = 0, colIndex3 = 0, colIndex4 = 0, colIndex5 = 0;
for (int z = 0; z < 24; z++) {
List<PageData> trList = new ArrayList<>();
PageData col0 = new PageData();
col0.put("VALUETYPE","string");
col0.put("COLSPAN",2);
col0.put("ROWSPAN",1);
switch (index){
case 0:
col0.put("VALUE","月份");
trList.add(col0);
for (int i = 1; i <= 3; i++) {
PageData month = new PageData();
month.put("VALUETYPE","string");
month.put("VALUE", (colIndex0 * 3 + i) + "月");
month.put("COLSPAN", 3);
month.put("ROWSPAN", 1);
trList.add(month);
}
colIndex0++;
break;
case 1:
col0.put("VALUE","检查日期");
trList.add(col0);
for (int i = 1; i <= 3; i++) {
for (int j = 0; j < tendayList.length; j++) {
PageData week = new PageData();
week.put("VALUETYPE","string");
week.put("VALUE", tendayList[j]);
week.put("COLSPAN", 1);
week.put("ROWSPAN", 1);
trList.add(week);
}
}
break;
case 2:
col0.put("VALUE","检查情况");
col0.put("COLSPAN",1);
col0.put("ROWSPAN",4);
trList.add(col0);
PageData col1 = new PageData();
col1.put("VALUETYPE","string");
col1.put("VALUE","是否检查");
col1.put("COLSPAN",1);
col1.put("ROWSPAN",1);
trList.add(col1);
for (int i = 1; i <= 3; i++) {
for (int j = 0; j < tendayList.length; j++) {
int month = colIndex2 * 3 + i;
String curTendy = pd.getString("YEAR") + "-" + (month <= 9 ? "0"+month : month);
String dateBegin = "", dateEnd = "";
if (j == 0) {
dateBegin = curTendy + "-01";
dateEnd = curTendy + "-10";
} else if (j == 1) {
dateBegin = curTendy + "-11";
dateEnd = curTendy + "-20";
} else {
dateBegin = curTendy + "-21";
int lastDays = DateSysUtil.getMonthDays(Integer.parseInt(pd.getString("YEAR")),month-1);
dateEnd = curTendy + "-" + lastDays;
}
PageData col = new PageData();
col.put("VALUETYPE","string");
col.put("COLSPAN", 1);
col.put("ROWSPAN", 1);
col.put("VALUE","△"); // 默认离岗
//清单生成日期在遍历日期之后(未建立清单)
if (DateSysUtil.fomatDate(listCreateDate).getTime()>DateSysUtil.fomatDate(dateEnd).getTime()) {
col.put("VALUE","-");
}else {
for (PageData r : recordList) {
if (DateSysUtil.fomatDate(dateBegin).getTime() <= DateSysUtil.fomatDate(r.getString("PERIODSTART").substring(0, 10)).getTime()
&& DateSysUtil.fomatDate(r.getString("PERIODSTART").substring(0, 10)).getTime() <= DateSysUtil.fomatDate(dateEnd).getTime()) {
if ("1".equals(r.getString("TYPE"))) {
col.put("VALUE","√"); // 已检查(隐患数)
break;
} else if ("2".equals(r.getString("TYPE"))) {
col.put("VALUE","×"); // 未排查
break;
}
}
}
}
trList.add(col);
}
}
colIndex2++;
break;
case 3:
col0.put("VALUE","发现隐患数");
col0.put("COLSPAN",1);
trList.add(col0);
PageData col = new PageData();
col.put("VALUETYPE","array");
col.put("COLSPAN", 9);
col.put("ROWSPAN", 1);
for (int i = 1; i <= 3; i++) {
for (int j = 0; j < tendayList.length; j++) {
int month = colIndex3 * 3 + i;
String curTendy = pd.getString("YEAR") + "-" + (month <= 9 ? "0"+month : month);
String dateBegin = "", dateEnd = "";
if (j == 0) {
dateBegin = curTendy + "-01";
dateEnd = curTendy + "-10";
} else if (j == 1) {
dateBegin = curTendy + "-11";
dateEnd = curTendy + "-20";
} else {
dateBegin = curTendy + "-21";
int lastDays = DateSysUtil.getMonthDays(Integer.parseInt(pd.getString("YEAR")),month-1);
dateEnd = curTendy + "-" + lastDays;
}
PageData col2 = new PageData();
col2.put("VALUETYPE","string");
col2.put("COLSPAN", 1);
col2.put("ROWSPAN", 1);
col2.put("VALUE","0"); // 默认离岗
//清单生成日期在遍历日期之后(未建立清单)
if (DateSysUtil.fomatDate(listCreateDate).getTime()>DateSysUtil.fomatDate(dateEnd).getTime()) {
col2.put("VALUE","0");
}else {
int hiddenCount = 0;
for (PageData r : recordList) {
if (DateSysUtil.fomatDate(dateBegin).getTime() <= DateSysUtil.fomatDate(r.getString("PERIODSTART").substring(0, 10)).getTime()
&& DateSysUtil.fomatDate(r.getString("PERIODSTART").substring(0, 10)).getTime() <= DateSysUtil.fomatDate(dateEnd).getTime()) {
if ("1".equals(r.getString("TYPE"))) {
hiddenCount += Integer.parseInt(r.getString("HIDDEN_COUNT"));
// col2.put("VALUE",r.getString("HIDDEN_COUNT")); // 已检查(隐患数)
} else if ("2".equals(r.getString("TYPE"))) {
hiddenCount = 0;
break;
}
}
}
col2.put("VALUE",hiddenCount); // 未排查
}
trList.add(col2);
}
}
colIndex3++;
break;
case 4:
col0.put("VALUE","检查时间");
col0.put("COLSPAN",1);
trList.add(col0);
col = new PageData();
col.put("VALUETYPE","array");
col.put("COLSPAN", 9);
col.put("ROWSPAN", 1);
for (int i = 1; i <= 3; i++) {
for (int j = 0; j < tendayList.length; j++) {
int month = colIndex4 * 3 + i;
String curTendy = pd.getString("YEAR") + "-" + (month <= 9 ? "0"+month : month);
String dateBegin = "", dateEnd = "";
if (j == 0) {
dateBegin = curTendy + "-01";
dateEnd = curTendy + "-10";
} else if (j == 1) {
dateBegin = curTendy + "-11";
dateEnd = curTendy + "-20";
} else {
dateBegin = curTendy + "-21";
int lastDays = DateSysUtil.getMonthDays(Integer.parseInt(pd.getString("YEAR")),month-1);
dateEnd = curTendy + "-" + lastDays;
}
PageData col2 = new PageData();
col2.put("VALUETYPE","string");
col2.put("COLSPAN", 1);
col2.put("ROWSPAN", 1);
col2.put("VALUE",""); // 默认离岗
//清单生成日期在遍历日期之后(未建立清单)
if (DateSysUtil.fomatDate(listCreateDate).getTime()>DateSysUtil.fomatDate(dateEnd).getTime()) {
col2.put("VALUE","");
}else {
for (PageData r : recordList) {
if (DateSysUtil.fomatDate(dateBegin).getTime() <= DateSysUtil.fomatDate(r.getString("PERIODSTART").substring(0, 10)).getTime()
&& DateSysUtil.fomatDate(r.getString("PERIODSTART").substring(0, 10)).getTime() <= DateSysUtil.fomatDate(dateEnd).getTime()) {
if ("1".equals(r.getString("TYPE"))) {
col2.put("VALUE",r.getString("CREATTIME")); // 已检查(隐患数)
break;
} else if ("2".equals(r.getString("TYPE"))) {
col2.put("VALUE",""); // 未排查
break;
}
}
}
}
trList.add(col2);
}
}
colIndex4++;
break;
case 5:
col0.put("VALUE","发现问题");
col0.put("COLSPAN",1);
trList.add(col0);
PageData col02 = new PageData();
for (int i = 1; i <= 3; i++) {
col02 = new PageData();
col02.put("VALUETYPE","array");
col02.put("COLSPAN", 3);
col02.put("ROWSPAN", 1);
for (int j = 0; j < tendayList.length; j++) {
List<String> descList = new ArrayList<>();
int month = colIndex5 * 3 + i;
String curTendy = pd.getString("YEAR") + "-" + (month <= 9 ? "0"+month : month);
String dateBegin = "", dateEnd = "";
if (j == 0) {
dateBegin = curTendy + "-01";
dateEnd = curTendy + "-10";
} else if (j == 1) {
dateBegin = curTendy + "-11";
dateEnd = curTendy + "-20";
} else {
dateBegin = curTendy + "-21";
int lastDays = DateSysUtil.getMonthDays(Integer.parseInt(pd.getString("YEAR")),month-1);
dateEnd = curTendy + "-" + lastDays;
}
for (PageData r : recordList) {
if (DateSysUtil.isSameMonth(r.getString("PERIODSTART"),dateBegin.substring(0,7))
&& StringUtils.isNotBlank(r.getString("HIDDENDESCR")) ) {
String[] hddescArr = r.getString("HIDDENDESCR").split("[$]");
for (int k = 0; k < hddescArr.length; k++) {
descList.add(hddescArr[k]);
}
}
}
col02.put("VALUE",descList);
}
trList.add(col02);
}
colIndex5++;
break;
}
PageData tr = new PageData();
tr.put("TRLIST", trList);
list.add(tr);
index++;
if (index==6) { index = 0;}
}
return list;
}
}

View File

@ -0,0 +1,106 @@
package com.zcloud.service.hiddenDangerCheckStandard.impl;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.hiddenDangerCheckStandard.CustomDisableTimeMapper;
import com.zcloud.mapper.datasource.hiddenDangerCheckStandard.ListCheckStandardItemMapper;
import com.zcloud.service.hiddenDangerCheckStandard.CustomDisableTimeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
*
* luoxiaobao
* 2020-12-30
* www.zcloudchina.com
*/
@Service
@Transactional //开启事物
public class CustomDisableTimeServiceImpl implements CustomDisableTimeService {
@Autowired
private CustomDisableTimeMapper customDisableTimeMapper;
/**
* @param pd
* @throws Exception
*/
public void save(PageData pd)throws Exception{
customDisableTimeMapper.save(pd);
}
/**
* @param pd
* @throws Exception
*/
public void delete(PageData pd)throws Exception{
customDisableTimeMapper.delete(pd);
}
/**
* @param pd
* @throws Exception
*/
public void edit(PageData pd)throws Exception{
customDisableTimeMapper.edit(pd);
}
/**
* @param pd
* @throws Exception
*/
public void editEndTime(PageData pd)throws Exception{
customDisableTimeMapper.editEndTime(pd);
}
/**
* @param page
* @throws Exception
*/
public List<PageData> list(Page page)throws Exception{
return customDisableTimeMapper.datalistPage(page);
}
/**()
* @param pd
* @throws Exception
*/
public List<PageData> listAll(PageData pd)throws Exception{
return customDisableTimeMapper.listAll(pd);
}
/**
* @param pd
* @throws Exception
*/
public List<PageData> listByFull(PageData pd)throws Exception{
return customDisableTimeMapper.listByFull(pd);
}
/**id
* @param pd
* @throws Exception
*/
public PageData findById(PageData pd)throws Exception{
return customDisableTimeMapper.findById(pd);
}
/**
* @param pd
* @throws Exception
*/
public PageData findByList(PageData pd)throws Exception{
return customDisableTimeMapper.findByList(pd);
}
/**
* @param ArrayDATA_IDS
* @throws Exception
*/
public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
customDisableTimeMapper.deleteAll(ArrayDATA_IDS);
}
}

View File

@ -1,5 +1,6 @@
package com.zcloud.service.hiddenDangerCheckStandard.impl;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.hiddenDangerCheckStandard.CustomMapper;
import com.zcloud.service.hiddenDangerCheckStandard.CustomService;
@ -38,6 +39,54 @@ public class CustomServiceImpl implements CustomService {
public List<PageData> listAll(PageData pd)throws Exception{
return customMapper.listAll(pd);
}
/**
* @param page
* @throws Exception
*/
public List<PageData> list(Page page)throws Exception{
return customMapper.datalistPage(page);
}
/**
* @param pd
* @throws Exception
*/
public void delete(PageData pd)throws Exception{
customMapper.delete(pd);
}
/**
* @param pd
* @throws Exception
*/
public void remove(PageData pd)throws Exception{
customMapper.remove(pd);
}
/**
* @param pd
* @throws Exception
*/
public void deleted(PageData pd)throws Exception{
customMapper.deleted(pd);
}
/**
* @param pd
* @throws Exception
*/
public void enable(PageData pd)throws Exception{
customMapper.enable(pd);
}
/**id
* @param pd
* @throws Exception
*/
public PageData findById(PageData pd)throws Exception{
return customMapper.findById(pd);
}
}

View File

@ -0,0 +1,157 @@
package com.zcloud.service.hiddenDangerCheckStandard.impl;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.hiddenDangerCheckStandard.CustomStatisticsMapper;
import com.zcloud.service.hiddenDangerCheckStandard.CustomStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
*
* luoxiaobao
* 2021-01-27
* www.zcloudchina.com
*/
@Service
@Transactional //开启事物
public class CustomStatisticsServiceImpl implements CustomStatisticsService {
@Autowired
private CustomStatisticsMapper customStatisticsMapper;
/**
* @param pd
* @throws Exception
*/
public void save(PageData pd)throws Exception{
customStatisticsMapper.save(pd);
}
/**
* @param pd
* @throws Exception
*/
public void delete(PageData pd)throws Exception{
customStatisticsMapper.delete(pd);
}
/**
* @param pd
* @throws Exception
*/
public void deletewl(PageData pd)throws Exception{
customStatisticsMapper.deletewl(pd);
}
/**
* @param pd
* @throws Exception
*/
public void edit(PageData pd)throws Exception{
customStatisticsMapper.edit(pd);
}
/**
* @param page
* @throws Exception
*/
public List<PageData> list(Page page)throws Exception{
return customStatisticsMapper.datalistPage(page);
}
/**()
* @param pd
* @throws Exception
*/
public List<PageData> listAll(PageData pd)throws Exception{
return customStatisticsMapper.listAll(pd);
}
/**id
* @param pd
* @throws Exception
*/
public PageData findById(PageData pd)throws Exception{
return customStatisticsMapper.findById(pd);
}
/**
* @param ArrayDATA_IDS
* @throws Exception
*/
public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
customStatisticsMapper.deleteAll(ArrayDATA_IDS);
}
/**
* @param pd
* @throws Exception
*/
@Override
public PageData findByCondition(PageData pd) throws Exception {
/* PageData ls = new PageData();
List<PageData> lsList = customStatisticsMapper.findByCondition(pd);
if(lsList != null && lsList.size() > 0) {
ls = lsList.get(0);
}*/
return customStatisticsMapper.findByCondition(pd);
}
@Override
public List<PageData> getCountList(PageData pd) throws Exception {
return customStatisticsMapper.getCountList(pd);
}
@Override
public PageData getTimeAstrict(PageData pd) throws Exception {
return customStatisticsMapper.getTimeAstrict(pd);
}
/**
* @param pd
* @throws Exception
*/
public List<PageData> countStaByUser(PageData pd)throws Exception{
return customStatisticsMapper.countStaByUser(pd);
}
/**
* @param pd
* @throws Exception
*/
public List<PageData> countSta(PageData pd)throws Exception{
return customStatisticsMapper.countSta(pd);
}
/**
* @param pd
* @throws Exception
*/
public List<PageData> checkSituation(PageData pd)throws Exception{
return customStatisticsMapper.checkSituation(pd);
}
/**1
* @param pd
* @throws Exception
*/
public List<PageData> countListStaByUser(PageData pd)throws Exception{
return customStatisticsMapper.countListStaByUser(pd);
}
/**
* @param pd
* @throws Exception
*/
public List<PageData> countByPeriodUser(PageData pd)throws Exception{
return customStatisticsMapper.countByPeriodUser(pd);
}
public List<PageData> listAllForPlan(PageData pd)throws Exception{
return customStatisticsMapper.listAllForPlan(pd);
}
}

View File

@ -96,7 +96,8 @@
f.ISDELETE = 0
and bhci.ISDELETE = 0
and f.COMMON_STATUS = 1
and f.INDUSTRY_TYPE_NAMES = #{pd.CORP_TYPE_NAME}
and bhci.COMMON_ITEM_STATUS = 1
<!-- and f.INDUSTRY_TYPE_NAMES = #{pd.CORP_TYPE_NAME} -->
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and
(

View File

@ -0,0 +1,180 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zcloud.mapper.datasource.hiddenDangerCheckStandard.CustomDisableTimeMapper">
<!--表名 -->
<sql id="tableName">
BUS_HIDDENDANGERCHECKSTANDARD_CUSTOMDISABLETIME
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!-- 字段 -->
<sql id="Field">
f.CUSTOMDISABLETIME_ID,
f.CUSTOM_ID
f.CORPINFO_ID,
f.STARTTIME,
f.ENDTIME,
f.ISDELETE,
f.CREATOR,
f.CREATTIME,
f.OPERATOR,
f.OPERATTIME
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
CUSTOM_ID,
CORPINFO_ID,
STARTTIME,
ENDTIME,
ISDELETE,
CREATOR,
CREATTIME,
OPERATOR,
OPERATTIME,
CUSTOMDISABLETIME_ID
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{CUSTOM_ID},
#{CORPINFO_ID},
#{STARTTIME},
#{ENDTIME},
#{ISDELETE},
#{CREATOR},
#{CREATTIME},
#{OPERATOR},
#{OPERATTIME},
#{CUSTOMDISABLETIME_ID}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
CUSTOMDISABLETIME_ID = #{CUSTOMDISABLETIME_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
LISTMANAGER_ID = #{LISTMANAGER_ID},
CORPINFO_ID = #{CORPINFO_ID},
STARTTIME = #{STARTTIME},
ENDTIME = #{ENDTIME},
CUSTOMDISABLETIME_ID = CUSTOMDISABLETIME_ID
where
CUSTOMDISABLETIME_ID = #{CUSTOMDISABLETIME_ID}
</update>
<!-- 修改 -->
<update id="editEndTime" parameterType="pd">
update
<include refid="tableName"></include>
set
ENDTIME = #{ENDTIME},
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME}
where
CUSTOMDISABLETIME_ID = #{CUSTOMDISABLETIME_ID}
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.CUSTOMDISABLETIME_ID = #{CUSTOMDISABLETIME_ID}
</select>
<!-- 通过清单获取数据 -->
<select id="findByList" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.CUSTOM_ID = #{CUSTOM_ID}
and f.CORPINFO_ID = #{CORPINFO_ID}
and f.ISDELETE = '0'
and f.STARTTIME &lt;= NOW()
and f.ENDTIME is null
</select>
<!-- 列表 -->
<select id="datalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where f.ISDELETE = '0'
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and
(
<!-- 根据需求自己加检索条件
字段1 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
or
字段2 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
-->
)
</if>
</select>
<!-- 列表(全部) -->
<select id="listAll" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
</select>
<!-- 查找完整数据 -->
<select id="listByFull" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where f.ISDELETE = '0'
AND CUSTOM_ID = #{CUSTOM_ID}
AND CORPINFO_ID =#{CORPINFO_ID}
AND STARTTIME IS NOT NULL
AND ENDTIME IS NOT NULL
</select>
<!-- 批量删除 -->
<delete id="deleteAll" parameterType="String">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
CUSTOMDISABLETIME_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
</mapper>

View File

@ -16,64 +16,73 @@
<!-- 字段 -->
<sql id="Field">
f.CUSTOM_ID,
f.NAME,
f.PERIOD,
f.TYPE,
f.CORPINFO_ID,
f.INDUSTRY_TYPE,
f.INDUSTRY_TYPE_TREE,
f.INDUSTRY_TYPE_NAMES,
f.CHECK_STANDARD_NAME,
f.COMMON_STATUS,
f.CREATOR,
f.CREATTIME,
f.OPERATOR,
f.OPERATTIME,
f.ISDELETE,
f.CREATOR_ID,
f.CREATOR_NAME,
f.CREATE_TIME,
f.OPERATOR_ID,
f.OPERATOR_NAME,
f.OPERATE_TIME,
f.DELETEOR_ID,
f.DELETEOR_NAME,
f.DELETE_TIME
f.DEPARTMENT_ID,
f.POST_ID,
f.USER_ID,
f.START_DATE,
f.END_DATE,
f.SCREENTYPE,
f.BAO_BAO_DEPARTMENT_ID,
f.BAO_BAO_USER_ID,
f.BAO_BAO_TYPE,
f.TASK_TYPE
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
CUSTOM_ID,
NAME,
PERIOD,
TYPE,
CORPINFO_ID,
INDUSTRY_TYPE,
INDUSTRY_TYPE_TREE,
INDUSTRY_TYPE_NAMES,
CHECK_STANDARD_NAME,
COMMON_STATUS,
CREATOR,
CREATTIME,
OPERATOR,
OPERATTIME,
ISDELETE,
CREATOR_ID,
CREATOR_NAME,
CREATE_TIME,
OPERATOR_ID,
OPERATOR_NAME,
OPERATE_TIME,
DELETEOR_ID,
DELETEOR_NAME,
DELETE_TIME
DEPARTMENT_ID,
POST_ID,
USER_ID,
START_DATE,
END_DATE,
SCREENTYPE,
BAO_BAO_DEPARTMENT_ID,
BAO_BAO_USER_ID,
BAO_BAO_TYPE,
TASK_TYPE
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{CUSTOM_ID},
#{NAME},
#{PERIOD},
#{TYPE},
#{CORPINFO_ID},
#{INDUSTRY_TYPE},
#{INDUSTRY_TYPE_TREE},
#{INDUSTRY_TYPE_NAMES},
#{CHECK_STANDARD_NAME},
#{COMMON_STATUS},
#{CREATOR},
#{CREATTIME},
#{OPERATOR},
#{OPERATTIME},
#{ISDELETE},
#{CREATOR_ID},
#{CREATOR_NAME},
#{CREATE_TIME},
#{OPERATOR_ID},
#{OPERATOR_NAME},
#{OPERATE_TIME},
#{DELETEOR_ID},
#{DELETEOR_NAME},
#{DELETE_TIME}
#{DEPARTMENT_ID},
#{POST_ID},
#{USER_ID},
#{START_DATE},
#{END_DATE},
#{SCREENTYPE},
#{BAO_BAO_DEPARTMENT_ID},
#{BAO_BAO_USER_ID},
#{BAO_BAO_TYPE},
#{TASK_TYPE}
</sql>
<!-- 新增 -->
@ -90,43 +99,220 @@
<!-- 列表(全部) -->
<select id="listAll" parameterType="pd" resultType="pd">
select
f.CUSTOM_ID,
f.CORPINFO_ID,
f.INDUSTRY_TYPE,
f.INDUSTRY_TYPE_TREE,
f.INDUSTRY_TYPE_NAMES,
f.CHECK_STANDARD_NAME,
bhci.CUSTOM_ITEM_ID,
bhci.CUSTOM_ID,
bhci.CHECK_CATEGORY,
bhci.CHECK_ITEM,
bhci.CHECK_CONTENT,
bhci.CHECK_STANDARD,
bhci.REFERENCE_BASIS,
bhci.CHECK_QUALIFIED,
bhci.CHECK_UNQUALIFIED,
bhci.OPERATION_TYPE,
bhci.COMMON_ITEM_SORT,
bhci.COMMON_ID,
bhci.COMMON_ITEM_ID,
bhd1.DICTIONARY_NAME as CHECK_CATEGORY_NAME,
bhd2.DICTIONARY_NAME as CHECK_ITEM_NAME
<include refid="Field"></include>,
p.NAME PERIODNAME,
t.NAME TYPENAME,
d.NAME as DEPARTMENT_NAME,
sp.NAME as POST_NAME,
u.NAME USER_NAME,
bb.NAME as TASK_TYPE_NAME,
s.NAME as SCREENTYPENAME,
(select count(1) from bus_hiddendangercheckstandard_custom_item ch where
ch.CUSTOM_ID = f.CUSTOM_ID and ch.ISDELETE = '0') as count ,
(SELECT count(1) FROM bus_hiddendangercheckstandard_checkrecord ch WHERE ch.CUSTOM_ID =
f.CUSTOM_ID AND ch.FINISHED = '1' AND ch.ISDELETE = 0 ) as cdcount
from
<include refid="tableName"></include> f
left join bus_hiddendangercheckstandard_custom_item bhci on bhci.CUSTOM_ID = f.CUSTOM_ID
left join bus_hiddendangercheckstandard_dictionary bhd1 on bhd1.DICTIONARY_ID = bhci.CHECK_CATEGORY and bhd1.ISDELETE = 0
left join bus_hiddendangercheckstandard_dictionary bhd2 on bhd2.DICTIONARY_ID = bhci.CHECK_ITEM and bhd2.ISDELETE = 0
where
f.ISDELETE = 0
and bhci.ISDELETE = 0
and f.COMMON_STATUS = 1
and f.CORPINFO_ID = #{CORPINFO_ID}
left join sys_dictionaries p on f.PERIOD = p.BIANMA
left join sys_dictionaries t on f.TYPE = t.BIANMA
left join sys_dictionaries s on f.SCREENTYPE = s.BIANMA
left join sys_dictionaries bb on f.TASK_TYPE = bb.DICTIONARIES_ID
left join OA_DEPARTMENT d on d.DEPARTMENT_ID=f.DEPARTMENT_ID
left join SYS_POST sp on sp.POST_ID = f.POST_ID
left join sys_user u on u.USER_ID = f.USER_ID
where f.CORPINFO_ID = #{pd.CORPINFO_ID}
and f.ISDELETE != '2'
and f.ISDELETE !='-1'
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and
(
bhci.CHECK_CONTENT LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%')
f.NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
)
</if>
order by bhci.CHECK_CATEGORY,bhci.CHECK_ITEM,bhci.COMMON_ITEM_SORT
<if test="pd.POST_ID != null and pd.POST_ID != ''"><!-- 关键词检索 -->
and
(
f.POST_ID = #{pd.POST_ID}
)
</if>
<if test="pd.PERIOD != null and pd.PERIOD != ''"><!-- 关键词检索 -->
and f.PERIOD = #{pd.PERIOD}
</if>
<if test="pd.USERNAME != null and pd.USERNAME != ''"><!-- 关键词检索 -->
and u.NAME LIKE CONCAT(CONCAT('%', #{pd.USERNAME}),'%')
</if>
<if test="pd.TYPE != null and pd.TYPE != ''"><!-- 关键词检索 -->
and f.TYPE = #{pd.TYPE}
</if>
<if test="pd.LISTINGLEVEL != null and pd.LISTINGLEVEL != ''"><!-- 关键词检索 -->
<choose>
<when test='pd.LISTINGLEVEL == "1"'>
and d.LEVEL = ''
</when>
<otherwise>
and d.LEVEL = #{pd.LISTINGLEVEL}
</otherwise>
</choose>
</if>
<if test="pd.SCREENTYPE != null and pd.SCREENTYPE != ''"><!-- 关键词检索 -->
and f.SCREENTYPE = #{pd.SCREENTYPE}
</if>
order by f.ISDELETE,f.OPERATTIME desc
</select>
<!-- 列表(全部) -->
<select id="datalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>,
p.NAME PERIODNAME,
t.NAME TYPENAME,
d.NAME as DEPARTMENT_NAME,
sp.NAME as POST_NAME,
u.NAME USER_NAME,
bb.NAME as TASK_TYPE_NAME,
s.NAME as SCREENTYPENAME,
(select count(1) from bus_hiddendangercheckstandard_custom_item ch where
ch.CUSTOM_ID = f.CUSTOM_ID and ch.ISDELETE = '0') as count ,
(SELECT count(1) FROM bus_hiddendangercheckstandard_checkrecord ch WHERE ch.CUSTOM_ID =
f.CUSTOM_ID AND ch.FINISHED = '1' AND ch.ISDELETE = 0 ) as cdcount
from
<include refid="tableName"></include> f
left join sys_dictionaries p on f.PERIOD = p.BIANMA
left join sys_dictionaries t on f.TYPE = t.BIANMA
left join sys_dictionaries s on f.SCREENTYPE = s.BIANMA
left join sys_dictionaries bb on f.TASK_TYPE = bb.DICTIONARIES_ID
left join OA_DEPARTMENT d on d.DEPARTMENT_ID=f.DEPARTMENT_ID
left join SYS_POST sp on sp.POST_ID = f.POST_ID
left join sys_user u on u.USER_ID = f.USER_ID
where f.CORPINFO_ID = #{pd.CORPINFO_ID}
and f.ISDELETE != '2'
and f.ISDELETE !='-1'
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and
(
f.NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
)
</if>
<if test="pd.POST_ID != null and pd.POST_ID != ''"><!-- 关键词检索 -->
and
(
f.POST_ID = #{pd.POST_ID}
)
</if>
<if test="pd.PERIOD != null and pd.PERIOD != ''"><!-- 关键词检索 -->
and f.PERIOD = #{pd.PERIOD}
</if>
<if test="pd.USERNAME != null and pd.USERNAME != ''"><!-- 关键词检索 -->
and u.NAME LIKE CONCAT(CONCAT('%', #{pd.USERNAME}),'%')
</if>
<if test="pd.TYPE != null and pd.TYPE != ''"><!-- 关键词检索 -->
and f.TYPE = #{pd.TYPE}
</if>
<if test="pd.LISTINGLEVEL != null and pd.LISTINGLEVEL != ''"><!-- 关键词检索 -->
<choose>
<when test='pd.LISTINGLEVEL == "1"'>
and d.LEVEL = ''
</when>
<otherwise>
and d.LEVEL = #{pd.LISTINGLEVEL}
</otherwise>
</choose>
</if>
<if test="pd.SCREENTYPE != null and pd.SCREENTYPE != ''"><!-- 关键词检索 -->
and f.SCREENTYPE = #{pd.SCREENTYPE}
</if>
order by f.ISDELETE,f.OPERATTIME desc
</select>
<!-- 禁用 -->
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
<if test="OPERATTIME != null or OPERATTIME != ''">
,OPERATTIME =#{OPERATTIME}
</if>
<if test="OPERATOR != null or OPERATOR != ''">
,OPERATOR =#{OPERATOR}
</if>
where
CUSTOM_ID = #{CUSTOM_ID}
</delete>
<!-- 删除 -->
<delete id="remove" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '2'
<if test="OPERATTIME != null or OPERATTIME != ''">
,OPERATTIME =#{OPERATTIME}
</if>
<if test="OPERATOR != null or OPERATOR != ''">
,OPERATOR =#{OPERATOR}
</if>
where
CUSTOM_ID = #{CUSTOM_ID}
</delete>
<!-- 删除 -->
<delete id="deleted" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '-1'
<if test="OPERATTIME != null or OPERATTIME != ''">
,OPERATTIME =#{OPERATTIME}
</if>
<if test="OPERATOR != null or OPERATOR != ''">
,OPERATOR =#{OPERATOR}
</if>
where
CUSTOM_ID = #{CUSTOM_ID}
</delete>
<!-- 启用 -->
<update id="enable" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '0'
<if test="OPERATTIME != null or OPERATTIME != ''">
,OPERATTIME =#{OPERATTIME}
</if>
<if test="OPERATOR != null or OPERATOR != ''">
,OPERATOR =#{OPERATOR}
</if>
where
CUSTOM_ID = #{CUSTOM_ID}
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>,
p.NAME PERIODNAME,
t.NAME TYPENAME,
d.NAME as DEPARTMENT_NAME,
tt.NAME as TASK_TYPE_NAME,
sp.NAME
AS POST_NAME,
s.NAME AS SCREENTYPENAME,
u.NAME AS USER_NAME,
bb.NAME as BAO_BAO_USER_NAME,
bbd.NAME as BAO_BAO_DEPARTMENT_NAME
from
<include refid="tableName"></include>
f
left join sys_dictionaries p on f.PERIOD = p.BIANMA
left join sys_dictionaries t on f.TYPE = t.BIANMA
left join sys_dictionaries s on f.SCREENTYPE = s.BIANMA
left join sys_dictionaries tt on f.TASK_TYPE = tt.DICTIONARIES_ID
left join OA_DEPARTMENT d on d.DEPARTMENT_ID=f.DEPARTMENT_ID
left join SYS_POST sp on sp.POST_ID = f.POST_ID
LEFT JOIN SYS_USER u on u.USER_ID = f.USER_ID
LEFT JOIN SYS_USER bb on bb.USER_ID = f.BAO_BAO_USER_ID
left join OA_DEPARTMENT bbd on bbd.DEPARTMENT_ID=f.DEPARTMENT_ID
where
f.CUSTOM_ID = #{CUSTOM_ID}
</select>
</mapper>