1、隐患快报隐患发现人修改为单选,并可以修改;2修复隐患排查 多次点击提交清单之后 有报错;3、重点工程安全环保检查加 归档状态 归档状态就是检查确认并且隐患全部验收;4、修复重大隐患被确认为忽略隐患后 隐患级别显

示错误;5、隐患确认人、整改人、验收人能看到安全环保检查验收打回的信息;6、安全环保检查被打回或申辩后只有发起人能处理;7、待检查人核实、待被检查人确认这两个状态可以单独删除安全环保检查内的隐患;8、驾驶舱的计算方式后加气泡,鼠标放上去后显示相应的文字描述规则;9、监管端创建的安全承诺书模板不能删除
limingyu-20240328-0328测试内容
limingyu 2024-03-27 17:53:29 +08:00
parent fd086f09e8
commit 7d8727867d
18 changed files with 272 additions and 14 deletions

View File

@ -486,11 +486,23 @@ public class AppHiddenController extends BaseController {
return map;
}else {
userpd.put("USER_ID",departmentService.findById(userpd).getString("HEADMAN"));
if(Tools.notEmpty(usersService.findById(userpd).getString("USER_ID"))){
pd.put("CONFIRM_USER",usersService.findById(userpd).getString("USER_ID"));//通过名字查询用户获取出ID
}else {
PageData byId = usersService.findById(userpd);
if (byId == null || Tools.isEmpty(byId.getString("USER_ID"))) {
map.put("msg", "未查询到部门负责人");
return map;
} else {
pd.put("CONFIRM_USER",usersService.findById(userpd).getString("USER_ID"));//通过名字查询用户获取出ID
}
/**
* findById(userpd)getString("USER_ID")
* @date 202426
* @author limingyu
*/
// if(Tools.notEmpty(usersService.findById(userpd).getString("USER_ID"))){
// pd.put("CONFIRM_USER",usersService.findById(userpd).getString("USER_ID"));//通过名字查询用户获取出ID
// }else {
// map.put("msg", "未查询到部门负责人");
// }
}
}else{
if(Tools.isEmpty(departmentService.findById(userpd).getString("HEADMAN"))) {//判断部门是否有负责人

View File

@ -303,20 +303,42 @@ public class HiddenController extends BaseController {
}
}
pd.put("ISCONFIRM", "0");
hiddenUserService.saveRectificationo(pd.getString("findCreator"), pd.getString("HIDDEN_ID"), "1");
// hiddenUserService.saveRectificationo(pd.getString("findCreator"), pd.getString("HIDDEN_ID"), "1");
hiddenUserService.saveRectificationoSingleFinder(pd.getString("findCreator"), pd.getString("HIDDEN_ID"), "1", pd.getString("hiddenFindCreator"));
if (pd.getString("HIDDENLEVEL").equals("jdyh001") || pd.getString("HIDDENLEVEL").equals("hiddenLevel2002")) {//判断是否是重大隐患
PageData userpd = new PageData();
userpd.put("USER_ID", Jurisdiction.getUSER_ID());
userpd.put("DEPARTMENT_ID", usersService.findById(userpd).getString("DEPARTMENT_ID"));//获取登录人的部门ID
if (departmentService.findById(userpd).getString("LEVEL").equals("departmentLevel0003")) {//判断部门级别是不是班组
userpd.put("DEPARTMENT_ID", departmentService.findById(userpd).getString("DEPARTMENT_ID"));
if (Tools.isEmpty(departmentService.findById(userpd).getString("HEADMAN"))) {//判断部门是否有负责人
String HEADMAN = departmentService.findById(userpd).getString("HEADMAN");
if (Tools.isEmpty(HEADMAN)){
map.put("msg", "所在部门未维护部门负责人");
return map;
} else {
userpd.put("USER_ID", departmentService.findById(userpd).getString("HEADMAN"));
pd.put("CONFIRM_USER", usersService.findById(userpd).getString("USER_ID"));//通过名字查询用户获取出ID
userpd.put("USER_ID", HEADMAN);
PageData data = usersService.findById(userpd);
if (Tools.isEmpty(data)) {
userpd.put("NAME", HEADMAN);
PageData byName = usersService.findByName(userpd);
if (Tools.isEmpty(byName)) {
map.put("msg", "所在部门未维护部门负责人");
return map;
}
pd.put("CONFIRM_USER", byName.getString("USER_ID"));//通过名字查询用户获取出ID
}
pd.put("CONFIRM_USER", data.getString("USER_ID"));//通过名字查询用户获取出ID
}
/**
* usersService.findById(userpd)getString
*/
// if (Tools.isEmpty(departmentService.findById(userpd).getString("HEADMAN"))) {//判断部门是否有负责人
// map.put("msg", "所在部门未维护部门负责人");
// return map;
// } else {
// userpd.put("USER_ID", departmentService.findById(userpd).getString("HEADMAN"));
// pd.put("CONFIRM_USER", usersService.findById(userpd).getString("USER_ID"));//通过名字查询用户获取出ID
// }
} else {
if (Tools.isEmpty(departmentService.findById(userpd).getString("HEADMAN"))) {//判断部门是否有负责人
map.put("msg", "所在部门未维护部门负责人");

View File

@ -56,6 +56,7 @@ public class PromiseController extends BaseController {
pd.put("OPERATOR", "admin"); //创建人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //创建时间
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
pd.put("IS_REGULATORY", 1); // 是否是监管端创建 0监管端 1企业端
promiseService.save(pd);
List<JSONObject> list = (List<JSONObject>) JSON.parse(pd.getString("DETAIL"));
if(list.size()>0){

View File

@ -166,7 +166,8 @@ public class HiddenApiController extends BaseController {
pd.put("HIDDENPART", hiddenRegion.getString("HIDDENREGION_ID"));
}
/** 隐患的主要负责人 一条隐患 多个隐患发现人 ,把多个信息填入这个张表中 */
hiddenUserApiService.saveRectificationo(pd.getString("findCreator"), pd.getString("HIDDEN_ID"), "1", Jurisdiction.getUSER_ID());
// hiddenUserApiService.saveRectificationo(pd.getString("findCreator"), pd.getString("HIDDEN_ID"), "1", Jurisdiction.getUSER_ID());
hiddenUserApiService.saveRectificationo(pd.getString("findCreator"), pd.getString("HIDDEN_ID"), "1", pd.getString("hiddenFindCreator"));
/** 初始化隐患确认信息 记录隐患发现人的隐患等级等信息 */
hiddenExamineApiService.saveConfirm(pd, "0");
@ -1275,4 +1276,32 @@ public class HiddenApiController extends BaseController {
mv = new ModelAndView(erv2, dataMap);
return mv;
}
/**
*
*
* @throws Exception
*/
@RequestMapping(value = "/deleteHiddenForSafetyenvironmental")
@ResponseBody
public Object deleteHiddenForSafetyenvironmental() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
PageData hidden = hiddenApiService.findById(pd);
Integer deleteHidden = hiddenApiService.deleteApi(pd.getString("HIDDEN_ID")); //修改隐患的状态
map.put("deleteHidden", deleteHidden);
/** 隐患相关人员 */
Integer deleteHiddenUserType = hiddenUserApiService.deleteByHidden(pd.getString("HIDDEN_ID"));
map.put("deleteHiddenUserType", deleteHiddenUserType);
/** 删除隐患流程信息 */
Integer deleteHiddenExaType = hiddenExamineApiService.deleteByHiddenId(pd);
map.put("deleteHiddenExaType", deleteHiddenExaType);
map.put("result", errInfo);
map.put("pd", pd);
return map;
}
}

View File

@ -12,6 +12,7 @@ import com.zcloud.service.keyProjects.KeyprojectHiddenService;
import com.zcloud.util.DateUtil;
import com.zcloud.util.Tools;
import com.zcloud.util.UuidUtil;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@ -162,6 +163,40 @@ public class KeyprojectCheckController extends BaseController {
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
page.setPd(pd);
List<PageData> varList = keyprojectcheckService.list(page); //列出KeyprojectCheck列表
if (varList.size() > 0) {
List<String> foreignIdList = new ArrayList<>();
for (PageData data : varList) {
foreignIdList.add(data.getString("KEYPROJECTCHECK_ID"));
}
// 查询列表中安全环保检查下所有的隐患
List<PageData> allKeyprojectHiddenList = keyprojectHiddenService.listByForeignIds(foreignIdList);
for (PageData data : varList) {
if (StringUtils.equals(data.getString("INSPECTION_STATUS"), "1")) {
boolean isCheck = true; // 安全环保检查是否验收
List<PageData> keyProjectHiddenList = new ArrayList<>();
for (PageData pageData : allKeyprojectHiddenList) {
if (StringUtils.equals(pageData.getString("FOREIGN_ID"), data.getString("KEYPROJECTCHECK_ID"))) {
keyProjectHiddenList.add(pageData);
}
}
if (keyProjectHiddenList.size() > 0) {
for (PageData pageData : keyProjectHiddenList) {
if (!StringUtils.equals(pageData.getString("STATE"), "4")) {
isCheck = false;
}
}
} else {
if (!data.getString("INSPECTION_STATUS").equals("1")) {
isCheck = false;
}
}
if (isCheck) {
// 安全环保检查验收
data.put("INSPECTION_STATUS", "2");
}
}
}
}
map.put("varList", varList);
map.put("page", page);
map.put("result", errInfo);
@ -266,4 +301,37 @@ public class KeyprojectCheckController extends BaseController {
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/goDelete")
@ResponseBody
public Object goDelete() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
// 删除安全环保检查下对应的隐患
if (Tools.notEmpty(pd.getString("KEYPROJECTCHECK_ID"))) {
PageData hiddenPd = new PageData();
hiddenPd.put("FOREIGN_ID", pd.getString("KEYPROJECTCHECK_ID"));
List<PageData> hiddenList = keyprojectHiddenService.listAllInspection(hiddenPd);
if (hiddenList.size() > 0) {
List<String> hiddenIds = new ArrayList<>();
for (PageData hiddenData : hiddenList) {
hiddenIds.add(hiddenData.getString("HIDDEN_ID"));
}
// 将hiddenIds转为数组
String[] hiddenIdArray = new String[hiddenIds.size()];
hiddenIdArray = hiddenIds.toArray(hiddenIdArray);
keyprojectHiddenService.deleteByIds(hiddenIdArray);
}
}
keyprojectcheckService.delete(pd);
map.put("result", errInfo);
return map;
}
}

View File

@ -226,6 +226,43 @@ public class AppKeyprojectCheckController extends BaseController {
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
page.setPd(pd);
List<PageData> varList = keyprojectcheckService.list(page); //列出KeyprojectCheck列表
if (varList.size() > 0) {
List<String> foreignIdList = new ArrayList<>();
for (PageData data : varList) {
foreignIdList.add(data.getString("KEYPROJECTCHECK_ID"));
}
// 查询列表中安全环保检查下所有的隐患
List<PageData> allKeyprojectHiddenList = keyprojectHiddenService.listByForeignIds(foreignIdList);
for (PageData data : varList) {
if (StringUtils.equals(data.getString("INSPECTION_STATUS"), "1")) {
boolean isCheck = true; // 安全环保检查是否验收
List<PageData> keyProjectHiddenList = new ArrayList<>(); // 单个安全环保检查下的隐患集合
for (PageData pageData : allKeyprojectHiddenList) {
if (StringUtils.equals(pageData.getString("FOREIGN_ID"), data.getString("KEYPROJECTCHECK_ID"))) {
// 遍历所有的隐患,把对应安全环保检查下的隐患放到一个集合中
keyProjectHiddenList.add(pageData);
}
}
if (keyProjectHiddenList.size() > 0) {
// 判断安全环保检查下是否有隐患
for (PageData pageData : keyProjectHiddenList) {
if (!StringUtils.equals(pageData.getString("STATE"), "4")) {
// 如果隐患列表中存在未验收的隐患,则安全环保检查未验收
isCheck = false;
}
}
} else {
if (!data.getString("INSPECTION_STATUS").equals("1")) {
isCheck = false;
}
}
if (isCheck) {
// 安全环保检查验收
data.put("INSPECTION_STATUS", "2");
}
}
}
}
map.put("varList", varList);
map.put("page", page);
map.put("result", errInfo);

View File

@ -167,5 +167,9 @@ public interface KeyprojectHiddenMapper {
List<String> getPhone(PageData pd);
List<PageData> listByForeignIds(List<String> foreignIdList);
void deleteByIds(String[] hiddenIdArray);
}

View File

@ -90,5 +90,11 @@ public interface HiddenUserService{
* @throws Exception
*/
void deleteByHidden (PageData pd) throws Exception;
/**
*
* @throws Exception
*/
void saveRectificationoSingleFinder(String userIds, String hiddenId, String type, String hiddenFindCreator)throws Exception;
}

View File

@ -190,5 +190,37 @@ public class HiddenUserServiceImpl implements HiddenUserService{
public void deleteByHidden(PageData pd) throws Exception {
hiddenuserMapper.deleteByHidden(pd);
}
@Override
public void saveRectificationoSingleFinder(String userIds, String hiddenId, String type, String hiddenFindCreator) throws Exception {
if(!Tools.isEmpty(hiddenId)){
PageData del = new PageData();
del.put("TYPE",type);
del.put("HIDDEN_ID",hiddenId);
hiddenuserMapper.deleteByHidden(del); // 先删除后添加
}
if(!Tools.isEmpty(userIds)){
String removeLoginUser = userIds.replaceAll(Jurisdiction.getUSER_ID(),""); //去除当前登录人的用户id
String userID [] = removeLoginUser.split(",");
for (int i =0;i<userID.length;i++){
if(!Tools.isEmpty(userID[i])){
PageData pd = new PageData();
pd.put("HIDDENUSER_ID", UuidUtil.get32UUID());
pd.put("HIDDEN_ID",hiddenId);
pd.put("USER_ID",userID[i]);
pd.put("TYPE",type);
pd.put("IS_MAIN","0");
hiddenuserMapper.save(pd);
}
}
}
PageData pd = new PageData();
pd.put("HIDDENUSER_ID", UuidUtil.get32UUID());
pd.put("HIDDEN_ID",hiddenId);
pd.put("USER_ID",hiddenFindCreator);
pd.put("TYPE",type);
pd.put("IS_MAIN","1");
hiddenuserMapper.save(pd);
}
}

View File

@ -189,5 +189,14 @@ public interface KeyprojectHiddenService {
String getPUNISHTHEPERSON(PageData pd);
List<String> getPhone(PageData pd);
List<PageData> listByForeignIds(List<String> foreignIdList);
/**
* id
* @param hiddenIdArray
* @throws Exception
*/
void deleteByIds(String[] hiddenIdArray);
}

View File

@ -263,5 +263,15 @@ public class KeyprojectHiddenServiceImpl implements KeyprojectHiddenService {
public List<String> getPhone(PageData pd) {
return hiddenMapper.getPhone(pd);
}
@Override
public List<PageData> listByForeignIds(List<String> foreignIdList) {
return hiddenMapper.listByForeignIds(foreignIdList);
}
@Override
public void deleteByIds(String[] hiddenIdArray) {
hiddenMapper.deleteByIds(hiddenIdArray);
}
}

View File

@ -197,6 +197,7 @@
, users.NAME as NEWRECTIFICATIONOR
,exa.RECTIFICATIONDEADLINE as spare3
,re.name as editUserName
,usera.name as CREATORNAME
from
<include refid="tableName"></include> f
LEFT JOIN sys_user user on user.USER_ID = f.spare2
@ -205,6 +206,7 @@
LEFT JOIN sys_dictionaries LEVEL on LEVEL.BIANMA = f.spare1
LEFT JOIN BUS_HIDDEN exa ON f.HIDDEN_ID = exa.HIDDEN_ID
LEFT JOIN sys_user re ON re.USER_ID = exa.RECTIFICATIONOR
LEFT JOIN sys_user usera ON usera.USER_ID = f.CREATOR
where 1=1
<if test="HIDDEN_ID != null and HIDDEN_ID != ''">
and f.HIDDEN_ID = #{HIDDEN_ID}

View File

@ -24,7 +24,8 @@
f.OPERATOR,
f.OPERATTIME,
f.CORPINFO_ID,
f.TYPE
f.TYPE,
f.IS_REGULATORY
</sql>
<!-- 字段用于新增 -->
@ -39,7 +40,8 @@
OPERATOR,
OPERATTIME,
CORPINFO_ID,
TYPE
TYPE,
IS_REGULATORY
</sql>
<!-- 字段值 -->
@ -54,7 +56,8 @@
#{OPERATOR},
#{OPERATTIME},
#{CORPINFO_ID},
#{TYPE}
#{TYPE},
#{IS_REGULATORY}
</sql>
<!-- 新增-->

View File

@ -185,12 +185,14 @@
, dept.name as editDeptName
, LEVEL.name as editLevelName
, users.NAME as NEWRECTIFICATIONOR
, auser.NAME as CREATORNAME
from
<include refid="tableName"></include> f
LEFT JOIN sys_user user on user.USER_ID = f.spare2
LEFT JOIN sys_user users on users.USER_ID = f.NEW_RECTIFICATIONOR
LEFT JOIN oa_department dept on dept.DEPARTMENT_ID = f.spare4
LEFT JOIN sys_dictionaries LEVEL on LEVEL.BIANMA = f.spare1
LEFT JOIN sys_user auser on auser.USER_ID = f.CREATOR
where 1=1
<if test="HIDDEN_ID != null and HIDDEN_ID != ''">
and f.HIDDEN_ID = #{HIDDEN_ID}

View File

@ -354,7 +354,7 @@
left join vi_user_all ua on ua.USER_ID = f.OPERATOR
LEFT JOIN bus_hotworkapplicationuser bhu ON bhu.FOREIGN_KEY = f.HOTWORKAPPLICATION_ID
LEFT JOIN vi_user_all bhuuser ON bhuuser.USER_ID = bhu.USER_ID
left join bus_hotworkapplicationuser hot on f.HOTWORKAPPLICATION_ID = hot.FOREIGN_KEY and hot.ISDELETE ='0' and hot.state='4'
left join bus_hotworkapplicationuser hot on f.HOTWORKAPPLICATION_ID = hot.FOREIGN_KEY and hot.ISDELETE ='0' and hot.state='3'
left join sys_user hu on hot.USER_ID = hu.USER_ID
left join oa_department hd on hd.DEPARTMENT_ID = hu.DEPARTMENT_ID
where f.ISDELETE = '0'

View File

@ -758,7 +758,7 @@
COUNT(DISTINCT h.HIDDEN_ID) HIDDEN_COUNT
from
<include refid="tableName"></include> f
LEFT JOIN bus_hidden h on h.FOREIGN_ID = f.INSPECTION_ID
LEFT JOIN bus_hidden h on h.FOREIGN_ID = f.INSPECTION_ID and h.ISDELETE = '0'
LEFT JOIN vi_user_all iou ON iou.USER_ID = f.INSPECTION_ORIGINATOR_ID
LEFT JOIN OA_DEPARTMENT ild ON ild.DEPARTMENT_ID = f.INSPECTION_LEADDEPARTMENT_ID
LEFT JOIN vi_department_all iod ON iod.DEPARTMENT_ID = iou.DEPARTMENT_ID

View File

@ -1511,6 +1511,18 @@
HIDDEN_ID = #{HIDDEN_ID}
</update>
<update id="deleteByIds" parameterType="String">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
HIDDEN_ID in
<foreach item="item" index="index" collection="array" open="(" separator="," close=")">
#{item}
</foreach>
</update>
<!-- 删除-->
<delete id="deleteByKey" parameterType="pd">
update
@ -1641,4 +1653,13 @@ FROM
</foreach>
</if>
</select>
<select id="listByForeignIds" resultType="com.zcloud.entity.PageData">
select *
from <include refid="tableName"></include>
where ISDELETE = '0' and FOREIGN_ID in
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>

View File

@ -316,7 +316,7 @@
LEFT JOIN ( select count(c.KEYPROJECTCHECK_ID) co, c.OUTSOURCED_ID from `qa-gwj-prevention`.BUS_KEYPROJECTCHECK c where c.ISDELETE = '0' group by c.OUTSOURCED_ID ) cc on cc.OUTSOURCED_ID = f.OUTSOURCED_ID
left join ( SELECT t.OUTSOURCED_ID, COUNT( t.HIDDEN_ID ) HIDDEN_COUNT
FROM
( SELECT IFNULL( k.OUTSOURCED_ID, h.FOREIGN_ID ) OUTSOURCED_ID, h.* FROM `qa-gwj-prevention`.bus_keyproject_hidden h LEFT JOIN `qa-gwj-prevention`.bus_keyprojectcheck k ON h.FOREIGN_ID = k.KEYPROJECTCHECK_ID ) t GROUP BY t.OUTSOURCED_ID ) h on h.OUTSOURCED_ID = f.OUTSOURCED_ID
( SELECT IFNULL( k.OUTSOURCED_ID, h.FOREIGN_ID ) OUTSOURCED_ID, h.* FROM `qa-gwj-prevention`.bus_keyproject_hidden h LEFT JOIN `qa-gwj-prevention`.bus_keyprojectcheck k ON h.FOREIGN_ID = k.KEYPROJECTCHECK_ID and h.ISDELETE = '0') t GROUP BY t.OUTSOURCED_ID ) h on h.OUTSOURCED_ID = f.OUTSOURCED_ID
where f.ISDELETE = '0'
<if test="pd.CORPINFO_ID != null and pd.CORPINFO_ID != ''"><!-- 关键词检索 -->
and