bug修复

pull/4/head
zhangyanli 2024-02-05 14:28:40 +08:00
parent dfae8753cc
commit 2519724187
6 changed files with 243 additions and 94 deletions

View File

@ -1950,6 +1950,7 @@ public class ListManagerController extends BaseController {
npd.put("PERIOD",pd.getString("PERIOD"));
npd.put("STATUS",pd.getString("STATUS"));
npd.put("LISTINGLEVEL",pd.getString("LISTINGLEVEL"));
npd.put("LIST_TYPE",pd.getString("LIST_TYPE"));
page.setPd(npd);
List<PageData> varList = listmanagerService.riskStandardCheckList(page); //列出ListManager列表
for (PageData list : varList) {

View File

@ -48,7 +48,10 @@ public class CommonController extends BaseController {
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业
PageData corpinfo = corpinfoService.findById(pd); //根据ID读取
pd.put("CORP_TYPE_NAME", corpinfo.getString("CORP_TYPE_NAME"));
pd.put("CORP_TYPE", corpinfo.getString("CORP_TYPE"));
pd.put("CORP_TYPE2", corpinfo.getString("CORP_TYPE2"));
pd.put("CORP_TYPE3", corpinfo.getString("CORP_TYPE3"));
pd.put("CORP_TYPE4", corpinfo.getString("CORP_TYPE4"));
page.setPd(pd);
List<PageData> varList = commonService.list(page); //列出RiskCheckItem列表
map.put("varList", varList);

View File

@ -1759,91 +1759,127 @@ public class CustomController extends BaseController {
map.put("result", errInfo);
return map;
}
//
// /**清单检查记录(日检)统计
// * @param
// * @throws Exception
// */
// @RequestMapping(value="/statisticsListCheckDay")
// @ResponseBody
// @LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单管理",instructionsType = "清单检查记录(日检)统计")
// public Object statisticsListCheckDay() throws Exception{
// Map<String,Object> map = new HashMap<String,Object>();
// String errInfo = "success";
// PageData pd = new PageData();
// pd = this.getPageData();
// String KEYWORDS = pd.getString("KEYWORDS"); // 关键词检索条件
// if (Tools.notEmpty(KEYWORDS))
// pd.put("KEYWORDS", KEYWORDS.trim());
//
// System.out.println(pd.getString("KEYWORDS"));
// List<PageData> varList = listcheckitemService.listAll(pd);
// PageData data = listmanagerService.findById(pd); //根据ID读取
// data.put("YEAR", pd.getString("YEAR"));
// List<PageData> recordList = checkrecordService.listAllYearForDay(data);//获取查询月在检查周期内的检查记录
//
// map.put("pd", data);
// map.put("varList", varList);
// map.put("recordList", recordList);
// map.put("result", errInfo);
// return map;
// }
//
// /**清单检查记录(周检)统计
// * @param
// * @throws Exception
// */
// @RequestMapping(value="/statisticsListCheckWeek")
// @ResponseBody
// @LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单管理",instructionsType = "清单检查记录(周检)统计")
// public Object statisticsListCheckWeek() throws Exception{
// Map<String,Object> map = new HashMap<String,Object>();
// String errInfo = "success";
// PageData pd = new PageData();
// pd = this.getPageData();
// String KEYWORDS = pd.getString("KEYWORDS"); // 关键词检索条件
// if (Tools.notEmpty(KEYWORDS))
// pd.put("KEYWORDS", KEYWORDS.trim());
//
// System.out.println(pd.getString("KEYWORDS"));
// List<PageData> varList = listcheckitemService.listAll(pd);
// PageData data = listmanagerService.findById(pd); //根据ID读取
// data.put("YEAR", pd.getString("YEAR"));
// List<PageData> recordList = checkrecordService.listAllYearForWeek(data);//获取检查周期内的检查记录
//
// map.put("pd", data);
// map.put("varList", varList);
// map.put("recordList", recordList);
// map.put("result", errInfo);
// return map;
// }
//
// /**清单检查记录(旬检)统计
// * @param
// * @throws Exception
// */
// @RequestMapping(value="/statisticsListCheckTenday")
// @ResponseBody
// @LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单管理",instructionsType = "清单检查记录(旬检)统计")
// public Object statisticsListCheckTenday() throws Exception{
// Map<String,Object> map = new HashMap<String,Object>();
// String errInfo = "success";
// PageData pd = new PageData();
// pd = this.getPageData();
// String KEYWORDS = pd.getString("KEYWORDS"); // 关键词检索条件
// if (Tools.notEmpty(KEYWORDS))
// pd.put("KEYWORDS", KEYWORDS.trim());
//
// System.out.println(pd.getString("KEYWORDS"));
// List<PageData> varList = listcheckitemService.listAll(pd);
// PageData data = listmanagerService.findById(pd); //根据ID读取
// data.put("YEAR", pd.getString("YEAR"));
// List<PageData> recordList = checkrecordService.statisticsListCheckTenday(data);//获取检查周期内的检查记录
//
// map.put("pd", data);
// map.put("varList", varList);
// map.put("recordList", recordList);
// map.put("result", errInfo);
// return map;
// }
/**
* @param out
* @throws Exception
*/
@RequestMapping(value="/enable")
// @RequiresPermissions("listmanager:del")
@ResponseBody
@LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单管理",instructionsType = "启用")
public Object enable() 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.enable(pd);
pd = customService.findById(pd);
// 启用清单时,修改禁用清单时间段的结束时间
PageData disPd = new PageData();
disPd.put("CUSTOM_ID", pd.get("CUSTOM_ID"));
disPd.put("CORPINFO_ID", pd.get("CORPINFO_ID"));
disPd = customDisableTimeService.findByList(pd);
disPd.put("ENDTIME", DateUtil.date2Str(new Date()));
disPd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
disPd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
customDisableTimeService.editEndTime(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("CUSTOMSTATISTICS_ID") != null) {
statistics.put("NOTEXAMINEDNUM", Integer.parseInt(statistics.get("NOTEXAMINEDNUM").toString())+2);
customStatisticsService.edit(statistics);
}
pd.put("ISSTATISTICS", '1');
// 本期已检查的不计入统计
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("CUSTOMSTATISTICS_ID") != null) {
statistics.put("NOTEXAMINEDNUM", Integer.parseInt(statistics.get("NOTEXAMINEDNUM").toString())+1);
customStatisticsService.edit(statistics);
}
pd.put("ISSTATISTICS", '1');
// 本期已检查的不计入统计
customCheckRecordService.editStatistics(pd);
}
}
// 将本频率内已检查的记录,改为不计入
map.put("result", errInfo); //返回结果
return map;
}
}

View File

@ -1514,6 +1514,9 @@
</otherwise>
</choose>
</if>
<if test="pd.LIST_TYPE != null and pd.LIST_TYPE != ''">
and "1" = #{pd.LIST_TYPE}
</if>
order by f.USER_ID= #{pd.orderUserId} desc ,f.DEPARTMENT_ID asc,f.OPERATTIME desc )
union
(select
@ -1550,6 +1553,106 @@
and
f.CORPINFO_ID = #{pd.CORPINFO_ID}
</if>
<choose>
<when test='pd.ISMAIN != null and pd.ISMAIN != "" and pd.ISMAIN == "1"'>
<if test="pd.DEPT_IDS != null and pd.DEPT_IDS != ''">
and
f.DEPARTMENT_ID in
<foreach item="item" index="index"
collection="pd.DEPT_IDS" open="(" separator="," close=")">
'${item}'
</foreach>
</if>
</when>
<otherwise>
<choose>
<when test='pd.ISSUPERVISE != null and pd.ISSUPERVISE != "" and pd.ISSUPERVISE == "1"'>
<choose>
<when test='pd.ISLEADER != null and pd.ISLEADER != "" and pd.ISLEADER == "1"'>
<choose>
<when test="pd.DEPT_IDS != null and pd.DEPT_IDS != ''">
and
f.DEPARTMENT_ID in
<foreach item="item" index="index"
collection="pd.DEPT_IDS" open="(" separator="," close=")">
'${item}'
</foreach>
</when>
<otherwise>
and
((f.DEPARTMENT_ID in (
select
SUB_DEPARTMENT_ID
from
oa_supervision_department osd
where
osd.SUP_DEPARTMENT_ID = #{pd.DEPARTMENT_ID}
and osd.ISDELETE = '0'
and osd.CORPINFO_ID = #{pd.CORPINFO_ID}
)) or (
f.DEPARTMENT_ID in
<foreach item="item" index="index"
collection="pd.DEPARTMENT_IDS" open="(" separator="," close=")">
'${item}'
</foreach>
))
</otherwise>
</choose>
</when>
<when test="pd.DEPT_IDS != null and pd.DEPT_IDS != ''">
and
f.DEPARTMENT_ID in
<foreach item="item" index="index"
collection="pd.DEPT_IDS" open="(" separator="," close=")">
'${item}'
</foreach>
</when>
<otherwise>
and
(f.DEPARTMENT_ID in (
select
SUB_DEPARTMENT_ID
from
oa_supervision_department osd
where
osd.SUP_DEPARTMENT_ID = #{pd.DEPARTMENT_ID}
and osd.ISDELETE = '0'
and osd.CORPINFO_ID = #{pd.CORPINFO_ID})
or f.USER_ID = #{pd.USER_ID})
</otherwise>
</choose>
</when>
<when test='pd.ISLEADER != null and pd.ISLEADER != "" and pd.ISLEADER == "1"'>
<choose>
<when test="pd.DEPT_IDS != null and pd.DEPT_IDS != ''">
and
f.DEPARTMENT_ID in
<foreach item="item" index="index"
collection="pd.DEPT_IDS" open="(" separator="," close=")">
'${item}'
</foreach>
</when>
<otherwise>
and
f.DEPARTMENT_ID in
<foreach item="item" index="index"
collection="pd.DEPARTMENT_IDS" open="(" separator="," close=")">
'${item}'
</foreach>
</otherwise>
</choose>
</when>
<when test="pd.DEPARTMENT_ID != null and pd.DEPARTMENT_ID != ''">
and f.USER_ID = #{pd.USER_ID}
and f.DEPARTMENT_ID=#{pd.DEPARTMENT_ID}
</when>
<otherwise>
</otherwise>
</choose>
</otherwise>
</choose>
<if test="pd.USERNAME != null and pd.USERNAME != ''">
and u.NAME LIKE CONCAT(CONCAT('%', #{pd.USERNAME}),'%')
</if>
@ -1562,10 +1665,10 @@
<if test="pd.STATUS != null and pd.STATUS != ''"><!-- 关键词检索 -->
<choose>
<when test='pd.STATUS=="1"'>
AND getCheckedNum(f.LISTMANAGER_ID) &gt; 0
AND getStandardCheckedNum(f.CUSTOM_ID) &gt; 0
</when>
<when test='pd.STATUS=="0"'>
AND getCheckedNum(f.LISTMANAGER_ID) = 0
AND getStandardCheckedNum(f.CUSTOM_ID) = 0
</when>
<otherwise>
</otherwise>
@ -1581,6 +1684,9 @@
</otherwise>
</choose>
</if>
<if test="pd.LIST_TYPE != null and pd.LIST_TYPE != ''">
and "2" = #{pd.LIST_TYPE}
</if>
order by f.USER_ID= #{pd.orderUserId} desc ,f.DEPARTMENT_ID asc,f.OPERATTIME desc )
</select>

View File

@ -97,7 +97,10 @@
and bhci.ISDELETE = 0
and f.COMMON_STATUS = 1
and bhci.COMMON_ITEM_STATUS = 1
<!-- and f.INDUSTRY_TYPE_NAMES = #{pd.CORP_TYPE_NAME} -->
and ( f.INDUSTRY_TYPE_TREE LIKE CONCAT(CONCAT('%', #{pd.CORP_TYPE}),'%')
or f.INDUSTRY_TYPE_TREE LIKE CONCAT(CONCAT('%', #{pd.CORP_TYPE2}),'%')
or f.INDUSTRY_TYPE_TREE LIKE CONCAT(CONCAT('%', #{pd.CORP_TYPE3}),'%')
or f.INDUSTRY_TYPE_TREE LIKE CONCAT(CONCAT('%', #{pd.CORP_TYPE4}),'%') )
<if test="pd.OTHERKEYWORDS != null and pd.OTHERKEYWORDS != ''"><!-- 关键词检索 -->
and
(

View File

@ -4,7 +4,7 @@
<!--表名 -->
<sql id="tableName">
BUS_HIDDENDANGERCHECKSTANDARD_CUSTOMDISABLETIME
BUS_HIDDENDANGERCHECKSTANDARD_DISABLETIME
</sql>
<!--数据字典表名 -->
@ -15,7 +15,7 @@
<!-- 字段 -->
<sql id="Field">
f.CUSTOMDISABLETIME_ID,
f.CUSTOM_ID
f.CUSTOM_ID,
f.CORPINFO_ID,
f.STARTTIME,
f.ENDTIME,
@ -80,7 +80,7 @@
update
<include refid="tableName"></include>
set
LISTMANAGER_ID = #{LISTMANAGER_ID},
CUSTOM_ID = #{CUSTOM_ID},
CORPINFO_ID = #{CORPINFO_ID},
STARTTIME = #{STARTTIME},
ENDTIME = #{ENDTIME},