修改bug

This commit is contained in:
guoshengxiong 2025-08-15 09:04:14 +08:00
parent 933b8012be
commit af7fb5f8f9
25 changed files with 623 additions and 191 deletions

View File

@ -170,7 +170,9 @@ public class SystemUserController {
@ApiImplicitParam(name = "qualityRegionId", required = false, value = "区域id", paramType = "body"),
@ApiImplicitParam(name = "qualityRegionBindType", required = false, value = "1区域绑定的人2区域绑定单位", paramType = "body"),
@ApiImplicitParam(name = "userId", required = false, value = "用户id", paramType = "body"),
@ApiImplicitParam(name = "roleName", required = false, value = "角色名称", paramType = "body"),
@ApiImplicitParam(name = "isSupervisingRoleName", required = false, value = "1监理角色名称的人", paramType = "body"),
@ApiImplicitParam(name = "safeQualityRegionIdForDuty", required = false, value = "安全区域id多个分割查责任人", paramType = "body"),
})
@PostMapping(value = "/getProjectChilderSystemUserList")
public Result<List<SystemUser>> getProjectChilderSystemUserList(@RequestBody Map<String, Object> map) {

View File

@ -82,6 +82,15 @@
<if test="param.userIds != null and param.userIds != ''">
and find_in_set(t.user_id,#{param.userIds})
</if>
<if test="param.userIdList != null and param.userIdList.size() != 0">
and t.user_id in
<foreach collection="param.userIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.roleName != null and param.roleName != ''">
and c.role_name = #{param.roleName}
</if>
<if test="param.isSupervisingRoleName == '1'.toString()">
and c.role_name = '监理'
</if>

View File

@ -43,9 +43,11 @@ import com.zhgd.xmgl.modules.project.entity.ProjectExternalSystemService;
import com.zhgd.xmgl.modules.project.mapper.ProjectExternalSystemServiceMapper;
import com.zhgd.xmgl.modules.project.mapper.ProjectMapper;
import com.zhgd.xmgl.modules.quality.entity.QualityInspectionRecord;
import com.zhgd.xmgl.modules.quality.entity.QualityRegion;
import com.zhgd.xmgl.modules.quality.enums.QualityInspectionRecordStatusEnum;
import com.zhgd.xmgl.modules.quality.mapper.QualityRegionMapper;
import com.zhgd.xmgl.modules.quality.service.IQualityInspectionRecordService;
import com.zhgd.xmgl.modules.quality.service.IQualityRegionService;
import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatDev;
import com.zhgd.xmgl.modules.safetyhat.mapper.SafetyHatDevMapper;
import com.zhgd.xmgl.modules.worker.entity.UserEnterprise;
@ -197,6 +199,9 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
@Lazy
@Autowired
private IXzSecurityQualityInspectionVerifyService xzSecurityQualityInspectionVerifyService;
@Lazy
@Autowired
private IQualityRegionService qualityRegionService;
@Override
public Map<String, Object> getToken(Map<String, Object> map) {
@ -952,6 +957,23 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
if (StrUtil.isNotBlank(enterpriseId)) {
map.put("enterpriseIdList", StrUtil.split(enterpriseId, ","));
}
String safeQualityRegionIdForDuty = MapUtils.getString(map, "safeQualityRegionIdForDuty");
if (StrUtil.isNotBlank(safeQualityRegionIdForDuty)) {
List<String> userIds = qualityRegionService.list(new LambdaQueryWrapper<QualityRegion>()
.in(QualityRegion::getId, StrUtil.split(safeQualityRegionIdForDuty, ","))).stream().flatMap(r -> {
if (StrUtil.isBlank(r.getSecurityDutyIds())) {
return null;
} else {
return StrUtil.split(r.getSecurityDutyIds(), ",").stream();
}
}).filter(Objects::nonNull).collect(Collectors.toList());
userIds.add("0");
List<String> queryUserIdList = MapUtil.getList(map, "userIdList", String.class);
if (CollUtil.isNotEmpty(queryUserIdList)) {
userIds = userIds.stream().filter(queryUserIdList::contains).collect(Collectors.toList());
}
map.put("userIdList", userIds);
}
return systemUserMapper.getProjectChilderSystemUserList(map);
}

View File

@ -1,126 +1,126 @@
package com.zhgd.xmgl.modules.xz.security.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zhgd.annotation.OperLog;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityDangerFieldConfig;
import com.zhgd.xmgl.modules.xz.security.entity.dto.XzSecurityDangerFieldConfigDto;
import com.zhgd.xmgl.modules.xz.security.entity.vo.XzSecurityDangerFieldConfigVo;
import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityDangerFieldConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.simpleframework.xml.core.Validate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.HashMap;
import java.util.List;
/**
* @Title: Controller
* @Description: 安全隐患检查字段设置配置
* @author pds
* @date 2025-08-06
* @version V1.0
*/
@RestController
@RequestMapping("/xmgl/xzSecurityDangerFieldConfig")
@Slf4j
@Api(tags = "安全隐患检查字段设置配置相关Api")
public class XzSecurityDangerFieldConfigController {
@Lazy
@Autowired
private IXzSecurityDangerFieldConfigService xzSecurityDangerFieldConfigService;
/**
* 列表查询
*
* @return
*/
@OperLog(operModul = "安全隐患检查字段设置配置管理", operType = "列表查询", operDesc = "列表查询安全隐患检查字段设置配置信息")
@ApiOperation(value = "列表查询安全隐患检查字段设置配置信息", notes = "列表查询安全隐患检查字段设置配置信息", httpMethod = "GET")
@GetMapping(value = "/list")
public Result<List<XzSecurityDangerFieldConfigVo>> queryList(@ApiIgnore @RequestParam HashMap<String, Object> param) {
return Result.success(xzSecurityDangerFieldConfigService.queryList(param));
}
/**
* 添加
*
* @param xzSecurityDangerFieldConfigDto
* @return
*/
@OperLog(operModul = "安全隐患检查字段设置配置管理", operType = "添加", operDesc = "添加安全隐患检查字段设置配置信息")
@ApiOperation(value = "添加安全隐患检查字段设置配置信息", notes = "添加安全隐患检查字段设置配置信息", httpMethod = "POST")
@PostMapping(value = "/add")
public Result<XzSecurityDangerFieldConfigVo> add(@RequestBody @Validate XzSecurityDangerFieldConfigDto xzSecurityDangerFieldConfigDto) {
xzSecurityDangerFieldConfigService.add(xzSecurityDangerFieldConfigDto);
return Result.ok();
}
/**
* 编辑
*
* @param xzSecurityDangerFieldConfigDto
* @return
*/
@OperLog(operModul = "安全隐患检查字段设置配置管理", operType = "编辑", operDesc = "编辑安全隐患检查字段设置配置信息")
@ApiOperation(value = "编辑安全隐患检查字段设置配置信息", notes = "编辑安全隐患检查字段设置配置信息", httpMethod = "POST")
@PostMapping(value = "/edit")
public Result<XzSecurityDangerFieldConfig> edit(@RequestBody XzSecurityDangerFieldConfigDto xzSecurityDangerFieldConfigDto) {
xzSecurityDangerFieldConfigService.edit(xzSecurityDangerFieldConfigDto);
return Result.ok();
}
/**
* 通过id删除
*
* @return
*/
@OperLog(operModul = "安全隐患检查字段设置配置管理", operType = "删除", operDesc = "删除安全隐患检查字段设置配置信息")
@ApiOperation(value = "删除安全隐患检查字段设置配置信息", notes = "删除安全隐患检查字段设置配置信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "安全隐患检查字段设置配置ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}")
@PostMapping(value = "/delete")
public Result<XzSecurityDangerFieldConfig> delete(@ApiIgnore @RequestBody HashMap<String, Object> map) {
xzSecurityDangerFieldConfigService.delete(MapUtils.getString(map, "id"));
return Result.ok();
}
/**
* 通过id查询
*
* @param id
* @return
*/
@OperLog(operModul = "安全隐患检查字段设置配置管理", operType = "通过id查询", operDesc = "通过id查询安全隐患检查字段设置配置信息")
@ApiOperation(value = "通过id查询安全隐患检查字段设置配置信息", notes = "通过id查询安全隐患检查字段设置配置信息", httpMethod = "GET")
@ApiImplicitParam(name = "id", value = "安全隐患检查字段设置配置ID", paramType = "query", required = true, dataType = "Integer")
@GetMapping(value = "/queryById")
public Result<XzSecurityDangerFieldConfigVo> queryById(@RequestParam(name = "id", required = true) String id) {
return Result.success(xzSecurityDangerFieldConfigService.queryById(id));
}
@OperLog(operModul = "安全隐患检查字段设置配置管理", operType = "", operDesc = "保存安全隐患检查字段设置配置信息")
@ApiOperation(value = "保存安全隐患检查字段设置配置信息", notes = "保存安全隐患检查字段设置配置信息", httpMethod = "POST")
@PostMapping(value = "/saveConfig")
public Result<XzSecurityDangerFieldConfig> saveConfig(@RequestBody XzSecurityDangerFieldConfigDto xzSecurityDangerFieldConfigDto) {
XzSecurityDangerFieldConfig config = xzSecurityDangerFieldConfigService.getOne(new LambdaQueryWrapper<XzSecurityDangerFieldConfig>()
.eq(XzSecurityDangerFieldConfig::getProjectSn, xzSecurityDangerFieldConfigDto.getProjectSn())
.eq(XzSecurityDangerFieldConfig::getRecordType, xzSecurityDangerFieldConfigDto.getRecordType())
);
if (config == null) {
xzSecurityDangerFieldConfigService.save(xzSecurityDangerFieldConfigDto);
} else {
xzSecurityDangerFieldConfigDto.setId(config.getId());
xzSecurityDangerFieldConfigService.edit(xzSecurityDangerFieldConfigDto);
}
return Result.ok();
}
}
//package com.zhgd.xmgl.modules.xz.security.controller;
//
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
//import com.zhgd.annotation.OperLog;
//import com.zhgd.jeecg.common.api.vo.Result;
//import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityDangerFieldConfig;
//import com.zhgd.xmgl.modules.xz.security.entity.dto.XzSecurityDangerFieldConfigDto;
//import com.zhgd.xmgl.modules.xz.security.entity.vo.XzSecurityDangerFieldConfigVo;
//import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityDangerFieldConfigService;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiImplicitParam;
//import io.swagger.annotations.ApiOperation;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.commons.collections.MapUtils;
//import org.simpleframework.xml.core.Validate;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Lazy;
//import org.springframework.web.bind.annotation.*;
//import springfox.documentation.annotations.ApiIgnore;
//
//import java.util.HashMap;
//import java.util.List;
//
//
///**
// * @Title: Controller
// * @Description: 安全隐患检查字段设置配置
// * @author pds
// * @date 2025-08-06
// * @version V1.0
// */
//@RestController
//@RequestMapping("/xmgl/xzSecurityDangerFieldConfig")
//@Slf4j
//@Api(tags = "安全隐患检查字段设置配置相关Api")
//public class XzSecurityDangerFieldConfigController {
// @Lazy
// @Autowired
// private IXzSecurityDangerFieldConfigService xzSecurityDangerFieldConfigService;
//
// /**
// * 列表查询
// *
// * @return
// */
// @OperLog(operModul = "安全隐患检查字段设置配置管理", operType = "列表查询", operDesc = "列表查询安全隐患检查字段设置配置信息")
// @ApiOperation(value = "列表查询安全隐患检查字段设置配置信息", notes = "列表查询安全隐患检查字段设置配置信息", httpMethod = "GET")
// @GetMapping(value = "/list")
// public Result<List<XzSecurityDangerFieldConfigVo>> queryList(@ApiIgnore @RequestParam HashMap<String, Object> param) {
// return Result.success(xzSecurityDangerFieldConfigService.queryList(param));
// }
//
// /**
// * 添加
// *
// * @param xzSecurityDangerFieldConfigDto
// * @return
// */
// @OperLog(operModul = "安全隐患检查字段设置配置管理", operType = "添加", operDesc = "添加安全隐患检查字段设置配置信息")
// @ApiOperation(value = "添加安全隐患检查字段设置配置信息", notes = "添加安全隐患检查字段设置配置信息", httpMethod = "POST")
// @PostMapping(value = "/add")
// public Result<XzSecurityDangerFieldConfigVo> add(@RequestBody @Validate XzSecurityDangerFieldConfigDto xzSecurityDangerFieldConfigDto) {
// xzSecurityDangerFieldConfigService.add(xzSecurityDangerFieldConfigDto);
// return Result.ok();
// }
//
// /**
// * 编辑
// *
// * @param xzSecurityDangerFieldConfigDto
// * @return
// */
// @OperLog(operModul = "安全隐患检查字段设置配置管理", operType = "编辑", operDesc = "编辑安全隐患检查字段设置配置信息")
// @ApiOperation(value = "编辑安全隐患检查字段设置配置信息", notes = "编辑安全隐患检查字段设置配置信息", httpMethod = "POST")
// @PostMapping(value = "/edit")
// public Result<XzSecurityDangerFieldConfig> edit(@RequestBody XzSecurityDangerFieldConfigDto xzSecurityDangerFieldConfigDto) {
// xzSecurityDangerFieldConfigService.edit(xzSecurityDangerFieldConfigDto);
// return Result.ok();
// }
//
// /**
// * 通过id删除
// *
// * @return
// */
// @OperLog(operModul = "安全隐患检查字段设置配置管理", operType = "删除", operDesc = "删除安全隐患检查字段设置配置信息")
// @ApiOperation(value = "删除安全隐患检查字段设置配置信息", notes = "删除安全隐患检查字段设置配置信息", httpMethod = "POST")
// @ApiImplicitParam(name = "id", value = "安全隐患检查字段设置配置ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}")
// @PostMapping(value = "/delete")
// public Result<XzSecurityDangerFieldConfig> delete(@ApiIgnore @RequestBody HashMap<String, Object> map) {
// xzSecurityDangerFieldConfigService.delete(MapUtils.getString(map, "id"));
// return Result.ok();
// }
//
// /**
// * 通过id查询
// *
// * @param id
// * @return
// */
// @OperLog(operModul = "安全隐患检查字段设置配置管理", operType = "通过id查询", operDesc = "通过id查询安全隐患检查字段设置配置信息")
// @ApiOperation(value = "通过id查询安全隐患检查字段设置配置信息", notes = "通过id查询安全隐患检查字段设置配置信息", httpMethod = "GET")
// @ApiImplicitParam(name = "id", value = "安全隐患检查字段设置配置ID", paramType = "query", required = true, dataType = "Integer")
// @GetMapping(value = "/queryById")
// public Result<XzSecurityDangerFieldConfigVo> queryById(@RequestParam(name = "id", required = true) String id) {
// return Result.success(xzSecurityDangerFieldConfigService.queryById(id));
// }
//
// @OperLog(operModul = "安全隐患检查字段设置配置管理", operType = "", operDesc = "保存安全隐患检查字段设置配置信息")
// @ApiOperation(value = "保存安全隐患检查字段设置配置信息", notes = "保存安全隐患检查字段设置配置信息", httpMethod = "POST")
// @PostMapping(value = "/saveConfig")
// public Result<XzSecurityDangerFieldConfig> saveConfig(@RequestBody XzSecurityDangerFieldConfigDto xzSecurityDangerFieldConfigDto) {
// XzSecurityDangerFieldConfig config = xzSecurityDangerFieldConfigService.getOne(new LambdaQueryWrapper<XzSecurityDangerFieldConfig>()
// .eq(XzSecurityDangerFieldConfig::getProjectSn, xzSecurityDangerFieldConfigDto.getProjectSn())
// .eq(XzSecurityDangerFieldConfig::getRecordType, xzSecurityDangerFieldConfigDto.getRecordType())
// );
// if (config == null) {
// xzSecurityDangerFieldConfigService.save(xzSecurityDangerFieldConfigDto);
// } else {
// xzSecurityDangerFieldConfigDto.setId(config.getId());
// xzSecurityDangerFieldConfigService.edit(xzSecurityDangerFieldConfigDto);
// }
// return Result.ok();
// }
//
//}

View File

@ -1,6 +1,6 @@
package com.zhgd.xmgl.modules.xz.security.controller;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhgd.annotation.OperLog;
@ -9,7 +9,6 @@ import com.zhgd.xmgl.modules.basicdata.service.ICompanyService;
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityDangerField;
import com.zhgd.xmgl.modules.xz.security.entity.dto.SaveAllXzSecurityDangerFieldDto;
import com.zhgd.xmgl.modules.xz.security.entity.dto.XzSecurityDangerFieldDto;
import com.zhgd.xmgl.modules.xz.security.entity.vo.XzSecurityDangerFieldConfigVo;
import com.zhgd.xmgl.modules.xz.security.entity.vo.XzSecurityDangerFieldVo;
import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityDangerFieldConfigService;
import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityDangerFieldService;
@ -28,7 +27,7 @@ import springfox.documentation.annotations.ApiIgnore;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
@ -142,18 +141,7 @@ public class XzSecurityDangerFieldController {
@PostMapping(value = "/saveAll")
@Transactional(rollbackFor = Exception.class)
public Result saveAll(@RequestBody @Validate SaveAllXzSecurityDangerFieldDto dto) {
xzSecurityDangerFieldService.remove(new LambdaQueryWrapper<XzSecurityDangerField>()
.eq(XzSecurityDangerField::getSn, dto.getSn())
.eq(XzSecurityDangerField::getRecordType, dto.getRecordType())
.eq(XzSecurityDangerField::getCompanyProjectType, dto.getCompanyProjectType())
);
for (XzSecurityDangerField field : dto.getFieldList()) {
field.setId(null);
field.setSn(dto.getSn());
field.setRecordType(dto.getRecordType());
field.setCompanyProjectType(dto.getCompanyProjectType());
xzSecurityDangerFieldService.save(field);
}
xzSecurityDangerFieldService.saveAll(dto);
return Result.ok();
}
@ -166,36 +154,33 @@ public class XzSecurityDangerFieldController {
})
@PostMapping(value = "/getEffectiveConfig")
public Result<List<XzSecurityDangerFieldVo>> getEffectiveConfig(@RequestBody HashMap<String, Object> param) {
Integer companyProjectType = MapUtils.getInteger(param, "companyProjectType");
Integer recordType = MapUtils.getInteger(param, "recordType");
String sn = MapUtils.getString(param, "sn");
List<XzSecurityDangerFieldConfigVo> configVos = xzSecurityDangerFieldConfigService.queryList(param);
List<XzSecurityDangerFieldVo> list = xzSecurityDangerFieldService.queryList(param);
if (Objects.equals(companyProjectType, 2) && CollUtil.isEmpty(list)) {
//项目不存在查询企业配置
list = getCompanyConfig(param, sn);
for (XzSecurityDangerFieldVo fieldVo : list) {
fieldVo.setCompanyProjectType(companyProjectType);
fieldVo.setSn(sn);
}
}
return Result.success(list);
return Result.success(xzSecurityDangerFieldService.getEffectiveConfig(param));
}
/**
* 查询企业配置
*
* @param param
* @param projectSn
* @return
*/
private List<XzSecurityDangerFieldVo> getCompanyConfig(HashMap<String, Object> param, String projectSn) {
List<XzSecurityDangerFieldVo> list;
String headquartersSn = companyService.getHeadquartersSnByProjectSn(projectSn);
param.put("sn", headquartersSn);
param.put("companyProjectType", 1);
list = xzSecurityDangerFieldService.queryList(param);
return list;
@OperLog(operModul = "安全隐患检查字段设置管理", operType = "", operDesc = "同步企业配置")
@ApiOperation(value = "同步企业配置", notes = "同步企业配置", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "Integer"),
})
@PostMapping(value = "/syncCompanyConfig")
@Transactional(rollbackFor = Exception.class)
public Result syncCompanyConfig(@RequestBody HashMap<String, Object> param) {
String projectSn = MapUtils.getString(param, "projectSn");
xzSecurityDangerFieldService.remove(new LambdaQueryWrapper<XzSecurityDangerField>()
.eq(XzSecurityDangerField::getSn, projectSn)
.eq(XzSecurityDangerField::getCompanyProjectType, 2)
);
List<XzSecurityDangerFieldVo> companyConfigs = xzSecurityDangerFieldService.getCompanyConfigs(projectSn);
List<XzSecurityDangerField> fieldList = companyConfigs.stream().map(vo -> {
XzSecurityDangerField field = new XzSecurityDangerField();
BeanUtil.copyProperties(vo, field);
field.setId(null);
field.setSn(projectSn);
field.setCompanyProjectType(2);
return field;
}).collect(Collectors.toList());
xzSecurityDangerFieldService.saveBatch(fieldList);
xzSecurityDangerFieldService.saveReviewVerify(projectSn, 2);
return Result.ok();
}
}

View File

@ -13,10 +13,7 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.*;
@ -172,4 +169,10 @@ public class XzSecurityDangerItemRecordController {
return result;
}
@ApiOperation(value = "查询我使用过的最近三天的三条数据", notes = "查询我使用过的最近三天的三条数据", httpMethod = "GET")
@GetMapping(value = "/getNewestUseRecords")
public Result<List<XzSecurityDangerItemRecord>> getNewestUseRecords(@ApiIgnore @RequestParam HashMap<String, Object> param) {
List<XzSecurityDangerItemRecord> list = dangerItemRecordService.getNewestUseRecords(param);
return Result.success(list);
}
}

View File

@ -1,15 +1,20 @@
package com.zhgd.xmgl.modules.xz.security.controller;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhgd.annotation.OperLog;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.xmgl.modules.basicdata.service.ICompanyService;
import com.zhgd.xmgl.modules.xz.security.constants.XzSecurityDangerFieldConstant;
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityDangerField;
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityDangerReviewVerify;
import com.zhgd.xmgl.modules.xz.security.entity.dto.XzSecurityDangerReviewVerifyDto;
import com.zhgd.xmgl.modules.xz.security.entity.vo.XzSecurityDangerFieldVo;
import com.zhgd.xmgl.modules.xz.security.entity.vo.XzSecurityDangerReviewVerifyVo;
import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityDangerFieldService;
import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityDangerReviewVerifyService;
import com.zhgd.xmgl.util.MapBuilder;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@ -156,9 +161,46 @@ public class XzSecurityDangerReviewVerifyController {
dto.setId(reviewVerifyDb.getId());
xzSecurityDangerReviewVerifyService.updateById(dto);
}
if (dto.getModType() == 1) {
XzSecurityDangerField field = xzSecurityDangerFieldService.getByCondition(dto.getSn(), dto.getCompanyProjectType(), 1, XzSecurityDangerFieldConstant.FU_CHA_REN);
if (field == null) {
saveFieldForProject(dto);
} else {
field.setIsEnabled(dto.getEnableReview());
xzSecurityDangerFieldService.updateById(field);
}
} else {
XzSecurityDangerField field = xzSecurityDangerFieldService.getByCondition(dto.getSn(), dto.getCompanyProjectType(), 1, XzSecurityDangerFieldConstant.HE_YAN_REN);
if (field == null) {
saveFieldForProject(dto);
} else {
field.setIsEnabled(dto.getEnableVerify());
xzSecurityDangerFieldService.updateById(field);
}
}
return Result.ok();
}
/**
* 保存安全字段
*
* @param dto
*/
private void saveFieldForProject(XzSecurityDangerReviewVerifyDto dto) {
List<XzSecurityDangerFieldVo> companyConfigs = xzSecurityDangerFieldService.getCompanyConfigs(dto.getSn());
xzSecurityDangerFieldService.remove(new LambdaQueryWrapper<XzSecurityDangerField>()
.eq(XzSecurityDangerField::getSn, dto.getSn())
.eq(XzSecurityDangerField::getCompanyProjectType, dto.getCompanyProjectType())
);
for (XzSecurityDangerFieldVo field1 : companyConfigs) {
field1.setId(null);
field1.setSn(dto.getSn());
field1.setRecordType(field1.getRecordType());
field1.setCompanyProjectType(dto.getCompanyProjectType());
xzSecurityDangerFieldService.save(field1);
}
}
@OperLog(operModul = "安全隐患复查核验人设置管理", operType = "", operDesc = "查询生效的配置")
@ApiOperation(value = "查询生效的配置", notes = "查询生效的配置", httpMethod = "POST")
@ApiImplicitParams({
@ -170,4 +212,28 @@ public class XzSecurityDangerReviewVerifyController {
return Result.success(xzSecurityDangerReviewVerifyService.getEffectiveConfig(param));
}
@OperLog(operModul = "安全隐患复查核验人设置管理", operType = "", operDesc = "同步企业配置")
@ApiOperation(value = "同步企业配置", notes = "同步企业配置", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "modType", value = "1修改复查2修改核验", paramType = "body", required = true, dataType = "Integer"),
})
@PostMapping(value = "/syncCompanyConfig")
@Transactional(rollbackFor = Exception.class)
public Result syncCompanyConfig(@RequestBody HashMap<String, Object> param) {
String projectSn = MapUtils.getString(param, "projectSn");
Integer modType = MapUtils.getInteger(param, "modType");
String headquartersSn = companyService.getHeadquartersSnByProjectSn(projectSn);
XzSecurityDangerReviewVerifyVo effectiveConfig = xzSecurityDangerReviewVerifyService.getEffectiveConfig(new MapBuilder<String, Object>()
.put("sn", headquartersSn)
.put("companyProjectType", 1)
.build());
XzSecurityDangerReviewVerifyDto dto = new XzSecurityDangerReviewVerifyDto();
BeanUtil.copyProperties(effectiveConfig, dto);
dto.setModType(modType);
dto.setSn(projectSn);
dto.setCompanyProjectType(2);
save(dto);
return Result.ok();
}
}

View File

@ -1,6 +1,7 @@
package com.zhgd.xmgl.modules.xz.security.controller;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
@ -11,11 +12,16 @@ import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.modules.basicdata.constant.DictionaryConstant;
import com.zhgd.xmgl.modules.basicdata.entity.DictionaryItem;
import com.zhgd.xmgl.modules.basicdata.service.IDictionaryItemService;
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityDangerItemRecord;
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityDangerTypeRecord;
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityDangerTypeRecordCollect;
import com.zhgd.xmgl.modules.xz.security.entity.vo.TopProjectClassifyTypeRecordTreeVo;
import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityDangerItemRecordService;
import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityDangerTypeRecordCollectService;
import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityDangerTypeRecordService;
import com.zhgd.xmgl.security.util.SecurityUtils;
import com.zhgd.xmgl.util.ListUtils;
import com.zhgd.xmgl.util.MapUtil;
import com.zhgd.xmgl.util.MessageUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@ -31,6 +37,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.io.ClassPathResource;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import springfox.documentation.annotations.ApiIgnore;
@ -60,11 +67,15 @@ import java.util.stream.Collectors;
public class XzSecurityDangerTypeRecordController {
@Autowired
private IXzSecurityDangerTypeRecordService dangerTypeRecordService;
@Lazy
@Autowired
private IXzSecurityDangerItemRecordService dangerItemRecordService;
private IXzSecurityDangerTypeRecordCollectService xzSecurityDangerTypeRecordCollectService;
@Lazy
@Autowired
private IDictionaryItemService dictionaryItemService;
@Lazy
@Autowired
private IXzSecurityDangerItemRecordService dangerItemRecordService;
/**
* 分页列表查询
@ -252,7 +263,7 @@ public class XzSecurityDangerTypeRecordController {
return Result.ok();
}
@ApiOperation(value = "树形分页列表查询安全库大项(工程类别(字典值)顶级)", notes = "树形分页列表查询安全库大项(工程类别(字典值)顶级)", httpMethod = "GET")
@ApiOperation(value = "树形列表查询安全库大项(工程类别(字典值)顶级)", notes = "树形列表查询安全库大项(工程类别(字典值)顶级)", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "sn", value = "总公司企业sn", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "projectClassify", value = "工程类别(字典值)", paramType = "body", required = false, dataType = "String"),
@ -289,5 +300,95 @@ public class XzSecurityDangerTypeRecordController {
List<TopProjectClassifyTypeRecordTreeVo> vos = BeanUtil.copyToList(ListUtils.listToTree(JSONArray.parseArray(JSON.toJSONString(records)), "id", "parentId", "children"), TopProjectClassifyTypeRecordTreeVo.class);
return Result.success(vos);
}
@ApiOperation(value = "树形列表查询项目的安全库大项子项(工程类别(字典值)顶级)", notes = "树形列表查询项目的安全库大项子项(工程类别(字典值)顶级)", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目唯一标识", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "content", value = "安全问题库子项内容", paramType = "body", required = false, dataType = "String"),
})
@GetMapping(value = "/getTopProjectClassifyTypeRecordDetailTree")
public Result<List<TopProjectClassifyTypeRecordTreeVo>> getTopProjectClassifyTypeRecordDetailTree(@ApiIgnore @RequestParam HashMap<String, Object> param) {
String itemRecordContent = MapUtils.getString(param, "itemRecordContent");
List<TopProjectClassifyTypeRecordTreeVo> records;
if (StrUtil.isNotBlank(itemRecordContent)) {
records = dangerItemRecordService.selectDangerItemRecordList(param).stream().map(r -> {
TopProjectClassifyTypeRecordTreeVo vo = new TopProjectClassifyTypeRecordTreeVo();
vo.setId(r.getId());
vo.setParentId(r.getDangerTypeId());
vo.setName(r.getPriorityName());
vo.setLevel(r.getLevel());
vo.setPriorityName(r.getPriorityName());
vo.setChangeLimit(r.getChangeLimit());
return vo;
}).collect(Collectors.toList());
} else {
String projectClassify = MapUtils.getString(param, "projectClassify");
String projectSn = MapUtils.getString(param, "projectSn");
List<DictionaryItem> projectTypeList = dictionaryItemService.getDictList(DictionaryConstant.RISK_LIST_PROJECT_TYPE, null);
if (StrUtil.isNotBlank(projectClassify)) {
projectTypeList = projectTypeList.stream().filter(dictionaryItem -> Objects.equals(dictionaryItem.getData(), projectClassify)).collect(Collectors.toList());
}
List<TopProjectClassifyTypeRecordTreeVo> items = projectTypeList.stream().map(r -> {
TopProjectClassifyTypeRecordTreeVo vo = new TopProjectClassifyTypeRecordTreeVo();
vo.setId(Long.valueOf(r.getData()));
vo.setParentId(0L);
vo.setName(r.getName());
vo.setProjectClassify(r.getData());
return vo;
}).collect(Collectors.toList());
records = dangerTypeRecordService.getEnableList(projectSn).stream().map(r -> {
TopProjectClassifyTypeRecordTreeVo vo = BeanUtil.toBean(r, TopProjectClassifyTypeRecordTreeVo.class);
vo.setName(r.getDangerName());
if (vo.getParentId() == 0L) {
vo.setParentId(Convert.toLong(r.getProjectClassify()));
}
return vo;
}).collect(Collectors.toList());
records.addAll(items);
List<Long> typeIds = records.stream().map(TopProjectClassifyTypeRecordTreeVo::getId).collect(Collectors.toList());
typeIds.add(0L);
List<TopProjectClassifyTypeRecordTreeVo> itemRecords = dangerItemRecordService.list(new LambdaQueryWrapper<XzSecurityDangerItemRecord>()
.in(XzSecurityDangerItemRecord::getDangerTypeId, typeIds)
).stream().map(r -> {
TopProjectClassifyTypeRecordTreeVo vo = new TopProjectClassifyTypeRecordTreeVo();
vo.setId(r.getId());
vo.setParentId(r.getDangerTypeId());
vo.setName(r.getContent());
vo.setLevel(r.getLevel());
vo.setPriorityName(r.getPriorityName());
vo.setChangeLimit(r.getChangeLimit());
return vo;
}).collect(Collectors.toList());
records.addAll(itemRecords);
}
List<TopProjectClassifyTypeRecordTreeVo> vos = BeanUtil.copyToList(ListUtils.listToTree(JSONArray.parseArray(JSON.toJSONString(records)), "id", "parentId", "children"), TopProjectClassifyTypeRecordTreeVo.class);
return Result.success(vos);
}
// @ApiOperation(value = "查询我收藏的安全库(工程类别(字典值)顶级)", notes = "查询我收藏的安全库(工程类别(字典值)顶级)", httpMethod = "GET")
// @GetMapping(value = "/getMyCollectProjectClassifyTypeRecords")
// public Result<List<Long>> getMyCollectProjectClassifyTypeRecords(@ApiIgnore @RequestParam HashMap<String, Object> param) {
// return Result.success(null);
// }
@ApiOperation(value = "收藏安全库", notes = "收藏安全库")
@ApiImplicitParams({
@ApiImplicitParam(name = "idList", value = "安全库工程类别字典值idList", paramType = "body", required = true, dataType = "String"),
})
@PostMapping(value = "/collectProjectClassifyTypeRecords")
@Transactional(rollbackFor = Exception.class)
public Result collectProjectClassifyTypeRecords(@ApiIgnore @RequestBody HashMap<String, Object> param) throws Exception {
Long userId = SecurityUtils.getUser().getUserId();
xzSecurityDangerTypeRecordCollectService.remove(new LambdaQueryWrapper<XzSecurityDangerTypeRecordCollect>()
.eq(XzSecurityDangerTypeRecordCollect::getUserId, userId));
List<String> idList = MapUtil.getList(param, "idList", String.class);
for (String id : idList) {
XzSecurityDangerTypeRecordCollect entity = new XzSecurityDangerTypeRecordCollect();
entity.setXzSecurityDangerTypeRecordId(Long.valueOf(id));
entity.setUserId(userId);
xzSecurityDangerTypeRecordCollectService.save(entity);
}
return Result.ok();
}
}

View File

@ -20,6 +20,7 @@ import java.io.Serializable;
@Data
@TableName("xz_security_danger_field_config")
@ApiModel(value = "XzSecurityDangerFieldConfig实体类", description = "XzSecurityDangerFieldConfig")
@Deprecated
public class XzSecurityDangerFieldConfig implements Serializable {
private static final long serialVersionUID = 1L;

View File

@ -0,0 +1,44 @@
package com.zhgd.xmgl.modules.xz.security.entity;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* @Description: 安全问题库收藏
* @author pds
* @date 2025-08-14
* @version V1.0
*/
@Data
@TableName("xz_security_danger_type_record_collect")
@ApiModel(value = "XzSecurityDangerTypeRecordCollect实体类", description = "XzSecurityDangerTypeRecordCollect")
public class XzSecurityDangerTypeRecordCollect implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private java.lang.Long id;
/**
* 安全问题库id
*/
@ApiModelProperty(value = "安全问题库id")
private java.lang.Long xzSecurityDangerTypeRecordId;
/**
* 用户id
*/
@ApiModelProperty(value = "用户id")
private java.lang.Long userId;
}

View File

@ -8,16 +8,6 @@ import lombok.Data;
@Data
@ApiModel(value = "XzSecurityDangerReviewVerifyDto实体类", description = "XzSecurityDangerReviewVerifyDto实体类")
public class XzSecurityDangerReviewVerifyDto extends XzSecurityDangerReviewVerify {
/**
* 1开启复查0不开启复查
*/
@ApiModelProperty("1开启复查0不开启复查")
private Integer enableReview;
/**
* 1开启核验0不开启核验
*/
@ApiModelProperty("1开启核验0不开启核验")
private Integer enableVerify;
/**
* 1修改复查2修改核验
*/

View File

@ -15,4 +15,19 @@ public class TopProjectClassifyTypeRecordTreeVo {
private java.lang.String projectClassify;
private java.lang.String name;
private List<TopProjectClassifyTypeRecordTreeVo> children;
/**
* 等级
*/
@ApiModelProperty(value = "等级")
private Integer level;
/**
* 问题等级
*/
@ApiModelProperty(value = "问题等级")
private String priorityName;
/**
* 整改时限(
*/
@ApiModelProperty(value = "整改时限(天)")
private Integer changeLimit;
}

View File

@ -5,6 +5,7 @@ import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityDangerItemRecord;
import com.zhgd.xmgl.modules.xz.security.entity.vo.XzSecurityDangerItemRecordVo;
import org.apache.ibatis.annotations.Mapper;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -39,4 +40,6 @@ public interface XzSecurityDangerItemRecordMapper extends BaseMapper<XzSecurityD
* @return
*/
List<XzSecurityDangerItemRecord> selectProjectDangerItemList(Map<String, Object> map);
List<XzSecurityDangerItemRecord> getNewestUseRecords(HashMap<String, Object> param);
}

View File

@ -0,0 +1,15 @@
package com.zhgd.xmgl.modules.xz.security.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityDangerTypeRecordCollect;
import org.apache.ibatis.annotations.Mapper;
/**
* @Description: 安全问题库收藏
* @author pds
* @date 2025-08-14
* @version V1.0
*/
@Mapper
public interface XzSecurityDangerTypeRecordCollectMapper extends BaseMapper<XzSecurityDangerTypeRecordCollect> {
}

View File

@ -38,4 +38,14 @@
WHERE t.sn = #{headquartersSn}
and IFNULL(b.record_status, 0) = 0
</select>
<select id="getNewestUseRecords" resultType="com.zhgd.xmgl.modules.xz.security.entity.XzSecurityDangerItemRecord">
SELECT a.*
from xz_security_danger_item_record a
join xz_security_quality_inspection_record xsqir on xsqir.danger_item_id = a.id
JOIN (SELECT * FROM xz_security_project_danger_type_disable WHERE project_sn = #{projectSn} and type = 2) b
ON b.danger_type_id = a.id
WHERE xsqir.inspect_man_id=#{inspectManId}
order by xsqir.create_time desc limit 3
</select>
</mapper>

View File

@ -0,0 +1,4 @@
<?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.zhgd.xmgl.modules.xz.security.mapper.XzSecurityDangerTypeRecordCollectMapper">
</mapper>

View File

@ -3,6 +3,7 @@ package com.zhgd.xmgl.modules.xz.security.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityDangerField;
import com.zhgd.xmgl.modules.xz.security.entity.dto.SaveAllXzSecurityDangerFieldDto;
import com.zhgd.xmgl.modules.xz.security.entity.dto.XzSecurityDangerFieldDto;
import com.zhgd.xmgl.modules.xz.security.entity.vo.XzSecurityDangerFieldVo;
@ -65,4 +66,24 @@ public interface IXzSecurityDangerFieldService extends IService<XzSecurityDanger
XzSecurityDangerFieldVo queryById(String id);
XzSecurityDangerField getByCondition(String sn, Integer companyProjectType, Integer recordType, String originalFieldName);
List<XzSecurityDangerFieldVo> getEffectiveConfig(HashMap<String, Object> param);
/**
* 查询企业配置
*
* @param projectSn
* @return
*/
List<XzSecurityDangerFieldVo> getCompanyConfigs(String projectSn);
void saveAll(SaveAllXzSecurityDangerFieldDto dto);
/**
* 保存复查核验人
*
* @param sn
* @param companyProjectType
*/
void saveReviewVerify(String sn, Integer companyProjectType);
}

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityDangerItemRecord;
import com.zhgd.xmgl.modules.xz.security.entity.vo.XzSecurityDangerItemRecordVo;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -36,4 +37,6 @@ public interface IXzSecurityDangerItemRecordService extends IService<XzSecurityD
* @param map
*/
void updateDangerItemRecordUsable(Map<String, Object> map);
List<XzSecurityDangerItemRecord> getNewestUseRecords(HashMap<String, Object> param);
}

View File

@ -0,0 +1,13 @@
package com.zhgd.xmgl.modules.xz.security.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityDangerTypeRecordCollect;
/**
* @Description: 安全问题库收藏
* @author pds
* @date 2025-08-14
* @version V1.0
*/
public interface IXzSecurityDangerTypeRecordCollectService extends IService<XzSecurityDangerTypeRecordCollect> {
}

View File

@ -54,6 +54,14 @@ public interface IXzSecurityDangerTypeRecordService extends IService<XzSecurityD
*/
List<EntityMap> getBigList(String projectSn);
/**
* 安全问题库获取启动的列表
*
* @param projectSn
* @return
*/
List<XzSecurityDangerTypeRecord> getEnableList(String projectSn);
/**
* 删除检查库节点
*

View File

@ -8,22 +8,28 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.base.Objects;
import com.zhgd.jeecg.common.execption.OpenAlertException;
import com.zhgd.jeecg.common.system.query.QueryGenerator;
import com.zhgd.xmgl.modules.basicdata.service.ICompanyService;
import com.zhgd.xmgl.modules.xz.security.constants.XzSecurityDangerFieldConstant;
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityDangerField;
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityDangerReviewVerify;
import com.zhgd.xmgl.modules.xz.security.entity.dto.SaveAllXzSecurityDangerFieldDto;
import com.zhgd.xmgl.modules.xz.security.entity.dto.XzSecurityDangerFieldDto;
import com.zhgd.xmgl.modules.xz.security.entity.vo.XzSecurityDangerFieldVo;
import com.zhgd.xmgl.modules.xz.security.mapper.XzSecurityDangerFieldMapper;
import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityDangerFieldService;
import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityDangerReviewVerifyService;
import com.zhgd.xmgl.util.PageUtil;
import com.zhgd.xmgl.util.RefUtil;
import org.apache.commons.collections4.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
@ -34,8 +40,14 @@ import java.util.stream.Collectors;
*/
@Service
public class XzSecurityDangerFieldServiceImpl extends ServiceImpl<XzSecurityDangerFieldMapper, XzSecurityDangerField> implements IXzSecurityDangerFieldService {
@Lazy
@Autowired
ICompanyService companyService;
@Autowired
private XzSecurityDangerFieldMapper xzSecurityDangerFieldMapper;
@Lazy
@Autowired
private IXzSecurityDangerReviewVerifyService xzSecurityDangerReviewVerifyService;
@Override
public IPage<XzSecurityDangerFieldVo> queryPageList(HashMap<String, Object> param) {
@ -65,7 +77,7 @@ public class XzSecurityDangerFieldServiceImpl extends ServiceImpl<XzSecurityDang
if (CollUtil.isEmpty(list)) {
//空就初始化值
List<XzSecurityDangerFieldVo> fieldVos = JSON.parseArray(ResourceUtil.readUtf8Str("init/data/xzSecurityDangerField.json"), XzSecurityDangerFieldVo.class);
list = fieldVos.stream().filter(vo -> Objects.equal(vo.getRecordType(), recordType)).collect(Collectors.toList());
list = fieldVos.stream().filter(vo -> Objects.equals(vo.getRecordType(), recordType)).collect(Collectors.toList());
for (XzSecurityDangerFieldVo vo : list) {
vo.setSn(sn);
vo.setCompanyProjectType(companyProjectType);
@ -117,4 +129,72 @@ public class XzSecurityDangerFieldServiceImpl extends ServiceImpl<XzSecurityDang
);
}
@Override
public List<XzSecurityDangerFieldVo> getEffectiveConfig(HashMap<String, Object> param) {
Integer companyProjectType = MapUtils.getInteger(param, "companyProjectType");
Integer recordType = MapUtils.getInteger(param, "recordType");
String sn = MapUtils.getString(param, "sn");
List<XzSecurityDangerFieldVo> list = this.queryList(param);
if (Objects.equals(companyProjectType, 2) && CollUtil.isEmpty(list)) {
//项目不存在查询企业配置
list = this.getCompanyConfigs(sn);
for (XzSecurityDangerFieldVo fieldVo : list) {
fieldVo.setCompanyProjectType(companyProjectType);
fieldVo.setSn(sn);
}
}
return list;
}
@Override
public List<XzSecurityDangerFieldVo> getCompanyConfigs(String projectSn) {
List<XzSecurityDangerFieldVo> list;
String headquartersSn = companyService.getHeadquartersSnByProjectSn(projectSn);
HashMap<String, Object> map = new HashMap<>();
map.put("sn", headquartersSn);
map.put("companyProjectType", 1);
list = this.queryList(map);
return list;
}
@Override
public void saveAll(SaveAllXzSecurityDangerFieldDto dto) {
this.remove(new LambdaQueryWrapper<XzSecurityDangerField>()
.eq(XzSecurityDangerField::getSn, dto.getSn())
.eq(XzSecurityDangerField::getRecordType, dto.getRecordType())
.eq(XzSecurityDangerField::getCompanyProjectType, dto.getCompanyProjectType())
);
for (XzSecurityDangerField field : dto.getFieldList()) {
field.setId(null);
field.setSn(dto.getSn());
field.setRecordType(dto.getRecordType());
field.setCompanyProjectType(dto.getCompanyProjectType());
this.save(field);
}
saveReviewVerify(dto.getSn(), dto.getCompanyProjectType());
}
@Override
public void saveReviewVerify(String sn, Integer companyProjectType) {
XzSecurityDangerReviewVerify reviewVerify = xzSecurityDangerReviewVerifyService.getOne(new LambdaQueryWrapper<XzSecurityDangerReviewVerify>()
.eq(XzSecurityDangerReviewVerify::getSn, sn)
.eq(XzSecurityDangerReviewVerify::getCompanyProjectType, companyProjectType)
);
XzSecurityDangerField fieldReview = this.getByCondition(sn, companyProjectType, 1, XzSecurityDangerFieldConstant.FU_CHA_REN);
XzSecurityDangerField fieldVerify = this.getByCondition(sn, companyProjectType, 1, XzSecurityDangerFieldConstant.HE_YAN_REN);
if (reviewVerify == null) {
reviewVerify = new XzSecurityDangerReviewVerify();
reviewVerify.setSn(sn);
reviewVerify.setCompanyProjectType(companyProjectType);
}
reviewVerify.setEnableReview(fieldReview.getIsEnabled());
reviewVerify.setEnableVerify(fieldVerify.getIsEnabled());
if (reviewVerify.getId() == null) {
xzSecurityDangerReviewVerifyService.save(reviewVerify);
} else {
xzSecurityDangerReviewVerifyService.updateById(reviewVerify);
}
}
}

View File

@ -16,6 +16,7 @@ import com.zhgd.xmgl.modules.xz.security.mapper.XzSecurityDangerItemRecordMapper
import com.zhgd.xmgl.modules.xz.security.mapper.XzSecurityDangerTypeRecordMapper;
import com.zhgd.xmgl.modules.xz.security.mapper.XzSecurityProjectDangerTypeDisableMapper;
import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityDangerItemRecordService;
import com.zhgd.xmgl.security.util.SecurityUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -23,6 +24,7 @@ import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@ -101,6 +103,12 @@ public class XzSecurityDangerItemRecordServiceImpl extends ServiceImpl<XzSecurit
}
}
@Override
public List<XzSecurityDangerItemRecord> getNewestUseRecords(HashMap<String, Object> param) {
param.put("inspectManId", SecurityUtils.getUser().getUserId());
return baseMapper.getNewestUseRecords(param);
}
private void enableDangerTypeRecord(String id) {
XzSecurityDangerItemRecord xzSecurityDangerItemRecord = xzSecurityDangerItemRecordMapper.selectById(id);
Long dangerTypeId = xzSecurityDangerItemRecord.getDangerTypeId();

View File

@ -49,14 +49,14 @@ public class XzSecurityDangerReviewVerifyServiceImpl extends ServiceImpl<XzSecur
QueryWrapper<XzSecurityDangerReviewVerifyVo> queryWrapper = this.getQueryWrapper(param);
Page<XzSecurityDangerReviewVerifyVo> page = PageUtil.getPage(param);
IPage<XzSecurityDangerReviewVerifyVo> pageList = baseMapper.queryList(page, queryWrapper, param);
pageList.setRecords(this.dealList(pageList.getRecords()));
pageList.setRecords(this.dealList(pageList.getRecords(), param));
return pageList;
}
@Override
public List<XzSecurityDangerReviewVerifyVo> queryList(HashMap<String, Object> param) {
QueryWrapper<XzSecurityDangerReviewVerifyVo> queryWrapper = getQueryWrapper(param);
return dealList(baseMapper.queryList(queryWrapper, param));
return dealList(baseMapper.queryList(queryWrapper, param), param);
}
private QueryWrapper<XzSecurityDangerReviewVerifyVo> getQueryWrapper(HashMap<String, Object> param) {
@ -65,7 +65,7 @@ public class XzSecurityDangerReviewVerifyServiceImpl extends ServiceImpl<XzSecur
return queryWrapper;
}
private List<XzSecurityDangerReviewVerifyVo> dealList(List<XzSecurityDangerReviewVerifyVo> list) {
private List<XzSecurityDangerReviewVerifyVo> dealList(List<XzSecurityDangerReviewVerifyVo> list, HashMap<String, Object> param) {
if (CollUtil.isNotEmpty(list)) {
}
return list;

View File

@ -0,0 +1,17 @@
package com.zhgd.xmgl.modules.xz.security.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityDangerTypeRecordCollect;
import com.zhgd.xmgl.modules.xz.security.mapper.XzSecurityDangerTypeRecordCollectMapper;
import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityDangerTypeRecordCollectService;
import org.springframework.stereotype.Service;
/**
* @Description: 安全问题库收藏
* @author pds
* @date 2025-08-14
* @version V1.0
*/
@Service
public class XzSecurityDangerTypeRecordCollectServiceImpl extends ServiceImpl<XzSecurityDangerTypeRecordCollectMapper, XzSecurityDangerTypeRecordCollect> implements IXzSecurityDangerTypeRecordCollectService {
}

View File

@ -1,5 +1,6 @@
package com.zhgd.xmgl.modules.xz.security.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -20,6 +21,7 @@ import com.zhgd.xmgl.modules.xz.security.mapper.XzSecurityProjectDangerTypeDisab
import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityDangerTypeRecordService;
import com.zhgd.xmgl.util.CodeUtils;
import com.zhgd.xmgl.util.ExcelUtils;
import com.zhgd.xmgl.util.MapBuilder;
import com.zhgd.xmgl.util.MessageUtil;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
@ -191,6 +193,16 @@ public class XzSecurityDangerTypeRecordServiceImpl extends ServiceImpl<XzSecurit
return xzSecurityDangerTypeRecordMapper.getBigList(map);
}
@Override
public List<XzSecurityDangerTypeRecord> getEnableList(String projectSn) {
List<XzSecurityDangerTypeRecord> bigList = BeanUtil.copyToList(this.getBigList(projectSn), XzSecurityDangerTypeRecord.class);
List<XzSecurityDangerTypeRecord> smallList = baseMapper.getSmallList(new MapBuilder<String, Object>()
.put("projectSn", projectSn)
.build());
bigList.addAll(smallList);
return bigList;
}
@Override
public void deleteRecordById(Long id) {
xzSecurityDangerTypeRecordMapper.deleteRecordById(id);