forked from integrated_whb/integrated_whb
Merge remote-tracking branch 'origin/dev' into dev
commit
226bdcf489
|
@ -39,7 +39,7 @@ public class CustomStopController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private CustomService customService;
|
private CustomService customService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ListCheckItemService listcheckitemService;
|
private CustomItemService customItemService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private DepartmentService departmentService;
|
private DepartmentService departmentService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -105,7 +105,7 @@ public class CustomStopController extends BaseController {
|
||||||
itme.put("CREATTIME", DateUtil.date2Str(new Date())); //创建时间
|
itme.put("CREATTIME", DateUtil.date2Str(new Date())); //创建时间
|
||||||
itme.put("OPERATOR", Jurisdiction.getUsername()); //修改人
|
itme.put("OPERATOR", Jurisdiction.getUsername()); //修改人
|
||||||
itme.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
itme.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||||
listcheckitemService.save(itme);
|
customItemService.save(itme);
|
||||||
set.add(json.get("RISKPOINT_ID").toString());
|
set.add(json.get("RISKPOINT_ID").toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -385,127 +385,6 @@ public class CustomStopController extends BaseController {
|
||||||
map.put("result", errInfo); //返回结果
|
map.put("result", errInfo); //返回结果
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
/**启用
|
|
||||||
* @param out
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
@RequestMapping(value="/enable")
|
|
||||||
// @RequiresPermissions("customstop: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 = listdisabletimeService.findByList(pd);
|
|
||||||
disPd.put("ENDTIME", DateUtil.date2Str(new Date()));
|
|
||||||
disPd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
|
|
||||||
disPd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
|
||||||
listdisabletimeService.editEndTime(disPd);
|
|
||||||
// 修改清单统计
|
|
||||||
if(pd.get("TYPE") != null && Tools.notEmpty(pd.get("TYPE").toString())) {
|
|
||||||
if("listType0005".equals(pd.get("TYPE").toString())) {
|
|
||||||
pd.put("LISTSTATISTICS_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 = listStatisticsService.findByCondition(pd);
|
|
||||||
if(statistics != null && statistics.get("LISTSTATISTICS_ID") != null) {
|
|
||||||
statistics.put("NOTEXAMINEDNUM", Integer.parseInt(statistics.get("NOTEXAMINEDNUM").toString())+2);
|
|
||||||
listStatisticsService.edit(statistics);
|
|
||||||
}
|
|
||||||
pd.put("ISSTATISTICS", '1');
|
|
||||||
// 本期已检查的不计入统计
|
|
||||||
checkrecordService.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 = listStatisticsService.findByCondition(pd);
|
|
||||||
if(statistics != null && statistics.get("LISTSTATISTICS_ID") != null) {
|
|
||||||
statistics.put("NOTEXAMINEDNUM", Integer.parseInt(statistics.get("NOTEXAMINEDNUM").toString())+1);
|
|
||||||
listStatisticsService.edit(statistics);
|
|
||||||
}
|
|
||||||
|
|
||||||
pd.put("ISSTATISTICS", '1');
|
|
||||||
// 本期已检查的不计入统计
|
|
||||||
checkrecordService.editStatistics(pd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 将本频率内已检查的记录,改为不计入
|
|
||||||
map.put("result", errInfo); //返回结果
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**修改
|
/**修改
|
||||||
* @param
|
* @param
|
||||||
|
@ -527,71 +406,44 @@ public class CustomStopController extends BaseController {
|
||||||
|
|
||||||
PageData pd2 = new PageData(); //删除原有内容
|
PageData pd2 = new PageData(); //删除原有内容
|
||||||
pd2.put("CUSTOM_ID", pd.getString("CUSTOM_ID"));
|
pd2.put("CUSTOM_ID", pd.getString("CUSTOM_ID"));
|
||||||
List<PageData> varList = listcheckitemService.listAll(pd2); //
|
List<PageData> varList = customItemService.listAll(pd2); //
|
||||||
for (PageData pageData : varList) {
|
for (PageData pageData : varList) {
|
||||||
PageData citem = new PageData();
|
PageData citem = new PageData();
|
||||||
citem.put("LISTCHECKITEM_ID", pageData.getString("LISTCHECKITEM_ID"));
|
citem.put("CUSTOM_ITEM_ID", pageData.getString("CUSTOM_ITEM_ID"));
|
||||||
listcheckitemService.delete(citem);
|
customItemService.delete(citem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(pd.get("LISTITEM")!=null && !pd.get("LISTITEM").equals("")) {
|
if(pd.get("LISTITEM")!=null && !pd.get("LISTITEM").equals("")) {
|
||||||
Set<String> set = new HashSet<String>();//记录所有风险点
|
|
||||||
int acount=0;//重大风险数
|
|
||||||
int bcount=0;//较大风险数
|
|
||||||
int ccount=0;//一般风险数
|
|
||||||
int dcount=0;//低风险数
|
|
||||||
List<JSONObject> list = (List<JSONObject>) JSON.parse(pd.get("LISTITEM").toString());
|
List<JSONObject> list = (List<JSONObject>) JSON.parse(pd.get("LISTITEM").toString());
|
||||||
for (JSONObject json : list) {
|
for (JSONObject json : list) {
|
||||||
if(json.get("RISKCHECKITEM_ID")!=null && json.get("RISKCHECKITEM_ID")!="" && json.get("RISKPOINT_ID")!=null && json.get("RISKPOINT_ID")!="") {
|
|
||||||
PageData itme = new PageData();
|
PageData itme = new PageData();
|
||||||
itme.put("LISTCHECKITEM_ID", this.get32UUID()); //主键
|
itme.put("CUSTOM_ITEM_ID", this.get32UUID()); //主键
|
||||||
itme.put("RISKCHECKITEM_ID", json.get("RISKCHECKITEM_ID"));
|
itme.put("CHECK_CATEGORY", json.get("CHECK_CATEGORY"));
|
||||||
itme.put("RISKPOINT_ID",json.get("RISKPOINT_ID"));
|
itme.put("CHECK_ITEM",json.get("CHECK_ITEM"));
|
||||||
|
itme.put("CHECK_CONTENT",json.get("CHECK_CONTENT"));
|
||||||
|
itme.put("CHECK_STANDARD",json.get("CHECK_STANDARD"));
|
||||||
|
itme.put("REFERENCE_BASIS",json.get("REFERENCE_BASIS"));
|
||||||
|
itme.put("CHECK_QUALIFIED",json.get("CHECK_QUALIFIED"));
|
||||||
|
itme.put("CHECK_UNQUALIFIED",json.get("CHECK_UNQUALIFIED"));
|
||||||
|
itme.put("OPERATION_TYPE",json.get("OPERATION_TYPE"));
|
||||||
itme.put("CUSTOM_ID",pd.get("CUSTOM_ID"));
|
itme.put("CUSTOM_ID",pd.get("CUSTOM_ID"));
|
||||||
itme.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业
|
itme.put("COMMON_ITEM_SORT", 1);
|
||||||
itme.put("ISDELETE", "0"); //是否删除
|
itme.put("COMMON_ID", json.get("COMMON_ID") == null ? "" : json.get("COMMON_ID"));
|
||||||
itme.put("CREATOR", Jurisdiction.getUsername()); //添加人
|
itme.put("COMMON_ITEM_ID", json.get("COMMON_ITEM_ID") == null ? "" : json.get("COMMON_ITEM_ID"));
|
||||||
itme.put("CREATTIME", DateUtil.date2Str(new Date())); //创建时间
|
itme.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业
|
||||||
itme.put("OPERATOR", Jurisdiction.getUsername()); //修改人
|
itme.put("ISDELETE", "0"); //是否删除
|
||||||
itme.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
itme.put("CREATOR_ID", Jurisdiction.getUSER_ID()); //添加人id
|
||||||
listcheckitemService.save(itme);
|
itme.put("CREATOR_NAME", Jurisdiction.getUsername()); //添加人
|
||||||
set.add(json.get("RISKPOINT_ID").toString());
|
itme.put("CREATE_TIME", DateUtil.date2Str(new Date())); //创建时间
|
||||||
}
|
itme.put("OPERATOR_ID", Jurisdiction.getUSER_ID()); //修改人
|
||||||
}
|
itme.put("OPERATOR_NAME", Jurisdiction.getUsername()); //修改时间
|
||||||
for (String str : set) {
|
itme.put("OPERATE_TIME", DateUtil.date2Str(new Date())); //修改时间
|
||||||
PageData rpd= new PageData();
|
itme.put("DELETEOR_ID", Jurisdiction.getUSER_ID()); //添加人id
|
||||||
rpd.put("RISKPOINT_ID", str);
|
itme.put("DELETEOR_NAME", Jurisdiction.getUsername()); //添加人
|
||||||
rpd=this.riskpointService.findById(rpd);
|
itme.put("DELETE_TIME", DateUtil.date2Str(new Date())); //删除时间
|
||||||
if(rpd.getString("LEVELID").equals("levelA")) {
|
customItemService.save(itme);
|
||||||
acount++;
|
|
||||||
}else if(rpd.getString("LEVELID").equals("levelB")) {
|
|
||||||
bcount++;
|
|
||||||
}else if(rpd.getString("LEVELID").equals("levelC")) {
|
|
||||||
ccount++;
|
|
||||||
}else if(rpd.getString("LEVELID").equals("levelD")) {
|
|
||||||
dcount++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pd.put("ACOUNT", acount);
|
|
||||||
pd.put("BCOUNT", bcount);
|
|
||||||
pd.put("CCOUNT", ccount);
|
|
||||||
pd.put("DCOUNT", dcount);
|
|
||||||
}
|
|
||||||
|
|
||||||
//巡检路线
|
|
||||||
checkRouteService.delete(pd2);
|
|
||||||
List<JSONObject> routes = (List<JSONObject>) JSON.parse(pd.get("ROUTE").toString());
|
|
||||||
for (int j = 0; j < routes.size() ; j++) {
|
|
||||||
JSONObject json = routes.get(j);
|
|
||||||
if(json.get("ID")!=null && json.get("ID")!="") {
|
|
||||||
PageData route = new PageData();
|
|
||||||
route.put("CHECKROUTE_ID", this.get32UUID()); //主键
|
|
||||||
route.put("CUSTOM_ID",pd.get("CUSTOM_ID"));
|
|
||||||
route.put("IDENTIFICATIONPARTS_ID", json.get("ID"));
|
|
||||||
route.put("ORDERBY",j);
|
|
||||||
checkRouteService.save(route);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
customService.edit(pd); // 修改清单管理的内容
|
customService.edit(pd); // 修改清单管理的内容
|
||||||
|
@ -971,17 +823,14 @@ public class CustomStopController extends BaseController {
|
||||||
if (Tools.notEmpty(KEYWORDS))
|
if (Tools.notEmpty(KEYWORDS))
|
||||||
pd.put("KEYWORDS", KEYWORDS.trim());
|
pd.put("KEYWORDS", KEYWORDS.trim());
|
||||||
|
|
||||||
System.out.println(pd.getString("KEYWORDS"));
|
List<PageData> varList = customItemService.listAll(pd);
|
||||||
List<PageData> varList = listcheckitemService.listAll(pd);
|
|
||||||
pd = customService.findById(pd); //根据ID读取
|
pd = customService.findById(pd); //根据ID读取
|
||||||
|
|
||||||
for (PageData item : varList) {
|
for (PageData item : varList) {
|
||||||
item.put("RECORDITEM_ID", this.get32UUID()); //主键
|
item.put("RECORDITEM_ID", this.get32UUID()); //主键
|
||||||
}
|
}
|
||||||
List<PageData> ideList = identificationPartsService.listAllByList(pd);
|
|
||||||
|
|
||||||
map.put("varList", varList);
|
map.put("varList", varList);
|
||||||
map.put("ideList", ideList);
|
|
||||||
map.put("pd", pd);
|
map.put("pd", pd);
|
||||||
map.put("result", errInfo);
|
map.put("result", errInfo);
|
||||||
return map;
|
return map;
|
||||||
|
@ -1152,7 +1001,7 @@ public class CustomStopController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**列表
|
/**列表
|
||||||
* @param page
|
* @param
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value="/checkListIndex")
|
@RequestMapping(value="/checkListIndex")
|
||||||
|
|
Loading…
Reference in New Issue