@@ -30,7 +30,8 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice; | |||
"com.ningdatech.pmapi.ding.controller", | |||
"com.ningdatech.pmapi.filemanage.controller", | |||
"com.ningdatech.pmapi.performance.controller", | |||
"com.ningdatech.pmapi.irs.controller" | |||
"com.ningdatech.pmapi.irs.controller", | |||
"com.ningdatech.pmapi.safety.controller" | |||
}) | |||
public class GlobalResponseHandler implements ResponseBodyAdvice<Object> { | |||
@@ -37,7 +37,6 @@ public class AnnualPlanController { | |||
@GetMapping("/list") | |||
@ApiOperation("年度计划库列表") | |||
@WebLog("年度计划库列表") | |||
public PageVo<AnnualPlanListItemVO> annualPlanLibList(ProjectListReq req) { | |||
return annualPlanLibManage.annulPlanLibList(req); | |||
} | |||
@@ -10,6 +10,7 @@ import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO; | |||
import com.ningdatech.pmapi.projectdeclared.model.vo.OperationVO; | |||
import com.ningdatech.pmapi.projectdeclared.model.vo.PreInsAcceptancePersonVO; | |||
import com.ningdatech.pmapi.projectdeclared.model.vo.PurchaseVO; | |||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; | |||
import com.ningdatech.pmapi.todocenter.model.vo.ProcessProgressDetailVo; | |||
import io.swagger.annotations.ApiModel; | |||
@@ -422,4 +423,22 @@ public class ProjectDetailVO { | |||
this.dynamicForm = JSON.parseObject(dynamicFormStr, Map.class); | |||
} | |||
} | |||
@ApiModelProperty("项目阶段中文") | |||
private String stageName; | |||
public String getStageName(){ | |||
if(Objects.nonNull(this.stage)){ | |||
return ProjectStatusEnum.getDesc(this.stage); | |||
} | |||
return StringUtils.EMPTY; | |||
} | |||
@ApiModelProperty("项目状态中文") | |||
private String statusName; | |||
public String getStatusName(){ | |||
if(Objects.nonNull(this.status)){ | |||
return ProjectStatusEnum.getDesc(this.status); | |||
} | |||
return StringUtils.EMPTY; | |||
} | |||
} |
@@ -0,0 +1,65 @@ | |||
package com.ningdatech.pmapi.safety.controller; | |||
import com.alibaba.fastjson.JSONObject; | |||
import com.ningdatech.basic.model.PageVo; | |||
import com.ningdatech.log.annotation.WebLog; | |||
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; | |||
import com.ningdatech.pmapi.safety.manage.SafetyRiskManage; | |||
import com.ningdatech.pmapi.safety.model.dto.PersonSafetyInfoDTO; | |||
import com.ningdatech.pmapi.safety.model.dto.SupplierSafetyQualificationDTO; | |||
import com.ningdatech.pmapi.safety.model.vo.ProjectMonitorVO; | |||
import com.ningdatech.pmapi.safety.model.vo.SafetyMonitorVO; | |||
import io.swagger.annotations.Api; | |||
import io.swagger.annotations.ApiOperation; | |||
import lombok.RequiredArgsConstructor; | |||
import org.springframework.web.bind.annotation.*; | |||
import javax.validation.Valid; | |||
import java.util.List; | |||
/** | |||
* @Classname SafetyRiskController | |||
* @Description | |||
* @Date 2023/8/2 9:15 | |||
* @Author PoffyZhang | |||
*/ | |||
@RestController | |||
@RequiredArgsConstructor | |||
@Api(tags = "安全风险监测") | |||
@RequestMapping("/api/v1/safety-risk") | |||
public class SafetyRiskController { | |||
private final SafetyRiskManage safetyRiskManage; | |||
@GetMapping("/person-monitor/list") | |||
@ApiOperation("安全人员监控列表") | |||
public PageVo<ProjectMonitorVO> personMonitorList(ProjectListReq req) { | |||
return safetyRiskManage.personMonitorList(req); | |||
} | |||
@PostMapping("/person-monitor/save") | |||
@ApiOperation("安全人员监控信息保存") | |||
@WebLog("安全人员监控信息保存") | |||
public String personMonitorSave(@Valid @RequestBody List<PersonSafetyInfoDTO> dtos) { | |||
return safetyRiskManage.personMonitorSave(dtos); | |||
} | |||
@GetMapping("/supplier-safety-qualification/save") | |||
@ApiOperation("供应商安全资质保存") | |||
@WebLog("供应商安全资质保存") | |||
public String supplierSafetyQualificationSave(@Valid @RequestBody List<SupplierSafetyQualificationDTO> dtos) { | |||
return safetyRiskManage.supplierSafetyQualificationSave(dtos); | |||
} | |||
@GetMapping("/detail/{projectCode}") | |||
@ApiOperation("安全人员管控详情") | |||
public SafetyMonitorVO personMonitorDetail(@PathVariable String projectCode) { | |||
return safetyRiskManage.personMonitorDetail(projectCode); | |||
} | |||
@GetMapping("/operation-monitor/search/{projectCode}") | |||
@ApiOperation("安全运行监控-查询监测(对接外部平台)") | |||
public JSONObject operationnMonitorList(@PathVariable String projectCode) { | |||
return safetyRiskManage.operationnMonitorSearch(projectCode); | |||
} | |||
} |
@@ -0,0 +1,202 @@ | |||
package com.ningdatech.pmapi.safety.manage; | |||
import cn.hutool.core.bean.BeanUtil; | |||
import cn.hutool.core.collection.CollUtil; | |||
import com.alibaba.fastjson.JSONObject; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.ningdatech.basic.function.VUtils; | |||
import com.ningdatech.basic.model.PageVo; | |||
import com.ningdatech.basic.util.CollUtils; | |||
import com.ningdatech.pmapi.common.constant.BizConst; | |||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | |||
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; | |||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | |||
import com.ningdatech.pmapi.safety.model.dto.PersonSafetyInfoDTO; | |||
import com.ningdatech.pmapi.safety.model.dto.SupplierSafetyQualificationDTO; | |||
import com.ningdatech.pmapi.safety.model.entity.PersonSafetyInfo; | |||
import com.ningdatech.pmapi.safety.model.entity.SupplierSafetyQualification; | |||
import com.ningdatech.pmapi.safety.model.vo.PersonSafetyInfoVO; | |||
import com.ningdatech.pmapi.safety.model.vo.ProjectMonitorVO; | |||
import com.ningdatech.pmapi.safety.model.vo.SafetyMonitorVO; | |||
import com.ningdatech.pmapi.safety.model.vo.SupplierSafetyQualificationVO; | |||
import com.ningdatech.pmapi.safety.service.IPersonSafetyInfoService; | |||
import com.ningdatech.pmapi.safety.service.ISupplierSafetyQualificationService; | |||
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; | |||
import com.ningdatech.pmapi.user.util.LoginUserUtil; | |||
import lombok.AllArgsConstructor; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.apache.commons.lang3.StringUtils; | |||
import org.springframework.stereotype.Component; | |||
import java.time.LocalDateTime; | |||
import java.util.List; | |||
import java.util.Objects; | |||
import java.util.stream.Collectors; | |||
/** | |||
* @Classname SafetyRiskManage | |||
* @Description | |||
* @Date 2023/8/2 9:17 | |||
* @Author PoffyZhang | |||
*/ | |||
@Component | |||
@Slf4j | |||
@AllArgsConstructor | |||
public class SafetyRiskManage { | |||
private final IProjectService projectService; | |||
private final ISupplierSafetyQualificationService supplierSafetyQualificationService; | |||
private final IPersonSafetyInfoService personSafetyInfoService; | |||
/** | |||
* 列表 | |||
* @param req | |||
* @return | |||
*/ | |||
public PageVo<ProjectMonitorVO> personMonitorList(ProjectListReq req) { | |||
LambdaQueryWrapper<Project> query = Wrappers.lambdaQuery(Project.class) | |||
.eq(Project::getNewest, Boolean.TRUE) | |||
.ge(Project::getStatus, ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()) | |||
.ne(Project::getStatus, ProjectStatusEnum.OPERATION.getCode()) | |||
.like(StringUtils.isNotBlank(req.getProjectName()),Project::getProjectName,req.getProjectName()) | |||
.like(StringUtils.isNotBlank(req.getBuildOrgName()),Project::getBuildOrgName,req.getBuildOrgName()); | |||
checkAuth(query,LoginUserUtil.loginUserDetail()); | |||
Page<Project> page = projectService.page(req.page(), query); | |||
long total; | |||
if ((total = page.getTotal()) == 0) { | |||
return PageVo.empty(); | |||
} | |||
List<ProjectMonitorVO> records = CollUtils.convert(page.getRecords(), | |||
p -> BeanUtil.copyProperties(p,ProjectMonitorVO.class)); | |||
return PageVo.of(records, total); | |||
} | |||
/** | |||
* 权限控制 | |||
* @param query | |||
* @param user | |||
*/ | |||
private void checkAuth(LambdaQueryWrapper<Project> query, UserInfoDetails user) { | |||
//如果是超管 | |||
if(user.getSuperAdmin()){ | |||
log.info(user.getUsername() + " 是超管,可以看所有项目"); | |||
}else if(user.getRegionAdmin()){ | |||
//如果是区域管理员 | |||
log.info(user.getUsername() + " 是区管,可以看本区域" + user.getRegionCode() + "项目"); | |||
query.eq(Project::getAreaCode,user.getRegionCode()); | |||
}else if(user.getIsOrgAdmin()){ | |||
//单位管理员 | |||
log.info(user.getUsername() + " 是单位管理员,可以看单位 " + user.getEmpPosUnitName() + " 项目"); | |||
query.eq(Project::getBuildOrgCode,user.getEmpPosUnitCode()); | |||
}else{ | |||
//其它角色全都看不见 | |||
query.eq(Project::getId,0L); | |||
} | |||
} | |||
public SafetyMonitorVO personMonitorDetail(String projectCode) { | |||
SafetyMonitorVO vo = new SafetyMonitorVO(); | |||
Project project = projectService.getOne(Wrappers.lambdaQuery(Project.class) | |||
.eq(Project::getNewest, Boolean.TRUE) | |||
.eq(Project::getProjectCode, projectCode) | |||
.last(BizConst.LIMIT_1)); | |||
if(Objects.isNull(project)){ | |||
return null; | |||
} | |||
List<SupplierSafetyQualification> ssq = supplierSafetyQualificationService.list(Wrappers.lambdaQuery(SupplierSafetyQualification.class) | |||
.eq(SupplierSafetyQualification::getProjectCode, projectCode)); | |||
if(CollUtil.isNotEmpty(ssq)){ | |||
vo.setSupplierSafetyQualification(ssq.stream() | |||
.map(s -> BeanUtil.copyProperties(s, SupplierSafetyQualificationVO.class)) | |||
.collect(Collectors.toList())); | |||
} | |||
List<PersonSafetyInfo> psi = personSafetyInfoService.list(Wrappers.lambdaQuery(PersonSafetyInfo.class) | |||
.eq(PersonSafetyInfo::getProjectCode, projectCode)); | |||
if(CollUtil.isNotEmpty(psi)){ | |||
vo.setPersonSafetyInfo(psi.stream() | |||
.map(p -> BeanUtil.copyProperties(p, PersonSafetyInfoVO.class)) | |||
.collect(Collectors.toList())); | |||
} | |||
return vo; | |||
} | |||
public JSONObject operationnMonitorSearch(String projectCode) { | |||
return null; | |||
} | |||
/** | |||
* 保存 供应商安全资质 | |||
* @param dtos | |||
* @return | |||
*/ | |||
public String supplierSafetyQualificationSave(List<SupplierSafetyQualificationDTO> dtos) { | |||
if(CollUtil.isEmpty(dtos)){ | |||
return "数据为空"; | |||
} | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
Integer sucessNum = 0; | |||
for(SupplierSafetyQualificationDTO dto : dtos){ | |||
String projectCode = dto.getProjectCode(); | |||
Project project = projectService.getOne(Wrappers.lambdaQuery(Project.class) | |||
.eq(Project::getNewest, Boolean.TRUE) | |||
.eq(Project::getProjectCode, projectCode) | |||
.last(BizConst.LIMIT_1)); | |||
VUtils.isTrue(Objects.isNull(project)).throwMessage("此项目并不存在!"); | |||
SupplierSafetyQualification entity = BeanUtil.copyProperties(dto, SupplierSafetyQualification.class); | |||
entity.setCreateBy(user.getUsername()); | |||
entity.setCreateOn(LocalDateTime.now()); | |||
entity.setProjectId(project.getId()); | |||
entity.setUpdateBy(user.getUsername()); | |||
entity.setUpdateOn(LocalDateTime.now()); | |||
if(supplierSafetyQualificationService.save(entity)){ | |||
sucessNum ++; | |||
} | |||
} | |||
return "保存成功" + sucessNum + "条"; | |||
} | |||
public String personMonitorSave(List<PersonSafetyInfoDTO> dtos) { | |||
if(CollUtil.isEmpty(dtos)){ | |||
return "数据为空"; | |||
} | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
Integer sucessNum = 0; | |||
for(PersonSafetyInfoDTO dto : dtos){ | |||
String projectCode = dto.getProjectCode(); | |||
Project project = projectService.getOne(Wrappers.lambdaQuery(Project.class) | |||
.eq(Project::getNewest, Boolean.TRUE) | |||
.eq(Project::getProjectCode, projectCode) | |||
.last(BizConst.LIMIT_1)); | |||
VUtils.isTrue(Objects.isNull(project)).throwMessage("此项目并不存在!"); | |||
PersonSafetyInfo entity = BeanUtil.copyProperties(dto, PersonSafetyInfo.class); | |||
entity.setCreateBy(user.getUsername()); | |||
entity.setCreateOn(LocalDateTime.now()); | |||
entity.setProjectId(project.getId()); | |||
entity.setUpdateBy(user.getUsername()); | |||
entity.setUpdateOn(LocalDateTime.now()); | |||
if(personSafetyInfoService.save(entity)){ | |||
sucessNum ++; | |||
} | |||
} | |||
return "保存成功" + sucessNum + "条"; | |||
} | |||
} |
@@ -0,0 +1,15 @@ | |||
package com.ningdatech.pmapi.safety.mapper; | |||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
import com.ningdatech.pmapi.safety.model.entity.PersonSafetyInfo; | |||
/** | |||
* <p> | |||
* </p> | |||
* | |||
* @author ZPF | |||
* @since 2023-08-2 | |||
*/ | |||
public interface PersonSafetyInfoMapper extends BaseMapper<PersonSafetyInfo> { | |||
} |
@@ -0,0 +1,15 @@ | |||
package com.ningdatech.pmapi.safety.mapper; | |||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
import com.ningdatech.pmapi.safety.model.entity.SupplierSafetyQualification; | |||
/** | |||
* <p> | |||
* </p> | |||
* | |||
* @author ZPF | |||
* @since 2023-08-2 | |||
*/ | |||
public interface SupplierSafetyQualificationMapper extends BaseMapper<SupplierSafetyQualification> { | |||
} |
@@ -0,0 +1,45 @@ | |||
package com.ningdatech.pmapi.safety.model.dto; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import javax.validation.constraints.NotBlank; | |||
import java.io.Serializable; | |||
import java.time.LocalDateTime; | |||
/** | |||
* <p> | |||
* 安全人员信息 | |||
* </p> | |||
* | |||
* @author ZPF | |||
* @since 2023-08-02 | |||
*/ | |||
@Data | |||
@ApiModel(value = "PersonSafetyInfo对象", description = "安全人员信息") | |||
public class PersonSafetyInfoDTO implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
@ApiModelProperty("主键") | |||
private Long id; | |||
@ApiModelProperty("项目编号") | |||
@NotBlank(message = "项目编号不能为空") | |||
private String projectCode; | |||
@ApiModelProperty("项目ID") | |||
private Long projectId; | |||
@ApiModelProperty("人员姓名") | |||
private String username; | |||
@ApiModelProperty("调查报告") | |||
private String investigationReport; | |||
private LocalDateTime createOn; | |||
private LocalDateTime updateOn; | |||
private String createBy; | |||
private String updateBy; | |||
} |
@@ -0,0 +1,39 @@ | |||
package com.ningdatech.pmapi.safety.model.dto; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import javax.validation.constraints.NotBlank; | |||
import java.io.Serializable; | |||
/** | |||
* <p> | |||
* 供应商安全资质 | |||
* </p> | |||
* | |||
* @author ZPF | |||
* @since 2023-08-02 | |||
*/ | |||
@Data | |||
@ApiModel(value = "SupplierSafetyQualification对象", description = "供应商安全资质") | |||
public class SupplierSafetyQualificationDTO implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
@ApiModelProperty("主键") | |||
private Long id; | |||
@ApiModelProperty("项目编号") | |||
@NotBlank(message = "项目编号不能为空") | |||
private String projectCode; | |||
@ApiModelProperty("项目ID") | |||
private Long projectId; | |||
@ApiModelProperty("安全资质") | |||
private String safetyQualification; | |||
@ApiModelProperty("安全协议") | |||
private String safetyProtocol; | |||
} |
@@ -0,0 +1,48 @@ | |||
package com.ningdatech.pmapi.safety.model.entity; | |||
import com.baomidou.mybatisplus.annotation.IdType; | |||
import com.baomidou.mybatisplus.annotation.TableId; | |||
import com.baomidou.mybatisplus.annotation.TableName; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import java.io.Serializable; | |||
import java.time.LocalDateTime; | |||
/** | |||
* <p> | |||
* 安全人员信息 | |||
* </p> | |||
* | |||
* @author ZPF | |||
* @since 2023-08-02 | |||
*/ | |||
@Data | |||
@TableName("nd_person_safety_info") | |||
@ApiModel(value = "PersonSafetyInfo对象", description = "安全人员信息") | |||
public class PersonSafetyInfo implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
@ApiModelProperty("主键") | |||
@TableId(type = IdType.AUTO) | |||
private Long id; | |||
@ApiModelProperty("项目编号") | |||
private String projectCode; | |||
@ApiModelProperty("项目ID") | |||
private Long projectId; | |||
@ApiModelProperty("人员姓名") | |||
private String username; | |||
@ApiModelProperty("调查报告") | |||
private String investigationReport; | |||
private LocalDateTime createOn; | |||
private LocalDateTime updateOn; | |||
private String createBy; | |||
private String updateBy; | |||
} |
@@ -0,0 +1,45 @@ | |||
package com.ningdatech.pmapi.safety.model.entity; | |||
import com.baomidou.mybatisplus.annotation.*; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import java.io.Serializable; | |||
import java.time.LocalDateTime; | |||
/** | |||
* <p> | |||
* 供应商安全资质 | |||
* </p> | |||
* | |||
* @author ZPF | |||
* @since 2023-08-02 | |||
*/ | |||
@Data | |||
@TableName("nd_supplier_safety_qualification") | |||
@ApiModel(value = "SupplierSafetyQualification对象", description = "供应商安全资质") | |||
public class SupplierSafetyQualification implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
@ApiModelProperty("主键") | |||
@TableId(type = IdType.AUTO) | |||
private Long id; | |||
@ApiModelProperty("项目编号") | |||
private String projectCode; | |||
@ApiModelProperty("项目ID") | |||
private Long projectId; | |||
@ApiModelProperty("安全资质") | |||
private String safetyQualification; | |||
@ApiModelProperty("安全协议") | |||
private String safetyProtocol; | |||
private LocalDateTime createOn; | |||
private LocalDateTime updateOn; | |||
private String createBy; | |||
private String updateBy; | |||
} |
@@ -0,0 +1,43 @@ | |||
package com.ningdatech.pmapi.safety.model.vo; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import java.io.Serializable; | |||
import java.time.LocalDateTime; | |||
/** | |||
* <p> | |||
* 安全人员信息 | |||
* </p> | |||
* | |||
* @author ZPF | |||
* @since 2023-08-02 | |||
*/ | |||
@Data | |||
@ApiModel(value = "PersonSafetyInfo对象", description = "安全人员信息") | |||
public class PersonSafetyInfoVO implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
@ApiModelProperty("主键") | |||
private Long id; | |||
@ApiModelProperty("项目编号") | |||
private String projectCode; | |||
@ApiModelProperty("项目ID") | |||
private Long projectId; | |||
@ApiModelProperty("人员姓名") | |||
private String username; | |||
@ApiModelProperty("调查报告") | |||
private String investigationReport; | |||
private LocalDateTime createOn; | |||
private LocalDateTime updateOn; | |||
private String createBy; | |||
private String updateBy; | |||
} |
@@ -0,0 +1,75 @@ | |||
package com.ningdatech.pmapi.safety.model.vo; | |||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import org.apache.commons.lang3.StringUtils; | |||
import java.util.Objects; | |||
import java.util.Optional; | |||
/** | |||
* @Classname ProjectMonitorVO | |||
* @Description | |||
* @Date 2023/8/2 9:19 | |||
* @Author PoffyZhang | |||
*/ | |||
@Data | |||
@ApiModel(value = "ProjectMonitorVO", description = "项目监控VO") | |||
public class ProjectMonitorVO { | |||
@ApiModelProperty("项目ID") | |||
private Long id; | |||
@ApiModelProperty("项目名称") | |||
private String projectName; | |||
@ApiModelProperty("申报单位code") | |||
private String buildOrgCode; | |||
@ApiModelProperty("申报单位名") | |||
private String buildOrgName; | |||
@ApiModelProperty("项目年度") | |||
private Integer projectYear; | |||
@ApiModelProperty("项目类型") | |||
private Integer projectType; | |||
@ApiModelProperty("项目类型名") | |||
private String projectTypeName; | |||
public String getProjectTypeName() { | |||
if (Objects.nonNull(this.projectType)) { | |||
Optional.ofNullable(ProjectTypeEnum.getDesc(this.projectType)) | |||
.ifPresent(desc -> this.projectTypeName = desc); | |||
} | |||
return this.projectTypeName; | |||
} | |||
@ApiModelProperty("项目阶段") | |||
private Integer stage; | |||
@ApiModelProperty("项目状态") | |||
private Integer status; | |||
@ApiModelProperty("项目阶段中文") | |||
private String stageName; | |||
public String getStageName(){ | |||
if(Objects.nonNull(this.stage)){ | |||
return ProjectStatusEnum.getDesc(this.stage); | |||
} | |||
return StringUtils.EMPTY; | |||
} | |||
@ApiModelProperty("项目状态中文") | |||
private String statusName; | |||
public String getStatusName(){ | |||
if(Objects.nonNull(this.status)){ | |||
return ProjectStatusEnum.getDesc(this.status); | |||
} | |||
return StringUtils.EMPTY; | |||
} | |||
} |
@@ -0,0 +1,23 @@ | |||
package com.ningdatech.pmapi.safety.model.vo; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import java.util.List; | |||
/** | |||
* @Classname SafetyMonitorVO | |||
* @Description | |||
* @Date 2023/8/2 9:19 | |||
* @Author PoffyZhang | |||
*/ | |||
@Data | |||
@ApiModel(value = "SafetyMonitorVO", description = "监控VO") | |||
public class SafetyMonitorVO { | |||
@ApiModelProperty("人员安全信息") | |||
private List<PersonSafetyInfoVO> personSafetyInfo; | |||
@ApiModelProperty("供应商安全资质") | |||
private List<SupplierSafetyQualificationVO> supplierSafetyQualification; | |||
} |
@@ -0,0 +1,43 @@ | |||
package com.ningdatech.pmapi.safety.model.vo; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import java.io.Serializable; | |||
import java.time.LocalDateTime; | |||
/** | |||
* <p> | |||
* 供应商安全资质 | |||
* </p> | |||
* | |||
* @author ZPF | |||
* @since 2023-08-02 | |||
*/ | |||
@Data | |||
@ApiModel(value = "SupplierSafetyQualification对象", description = "供应商安全资质") | |||
public class SupplierSafetyQualificationVO implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
@ApiModelProperty("主键") | |||
private Long id; | |||
@ApiModelProperty("项目编号") | |||
private String projectCode; | |||
@ApiModelProperty("项目ID") | |||
private Long projectId; | |||
@ApiModelProperty("安全资质") | |||
private String safetyQualification; | |||
@ApiModelProperty("安全协议") | |||
private String safetyProtocol; | |||
private LocalDateTime createOn; | |||
private LocalDateTime updateOn; | |||
private String createBy; | |||
private String updateBy; | |||
} |
@@ -0,0 +1,14 @@ | |||
package com.ningdatech.pmapi.safety.service; | |||
import com.baomidou.mybatisplus.extension.service.IService; | |||
import com.ningdatech.pmapi.safety.model.entity.PersonSafetyInfo; | |||
/** | |||
* @Classname IPersonSafetyInfoService | |||
* @Description | |||
* @Date 2023/8/2 10:47 | |||
* @Author PoffyZhang | |||
*/ | |||
public interface IPersonSafetyInfoService extends IService<PersonSafetyInfo> { | |||
} |
@@ -0,0 +1,14 @@ | |||
package com.ningdatech.pmapi.safety.service; | |||
import com.baomidou.mybatisplus.extension.service.IService; | |||
import com.ningdatech.pmapi.safety.model.entity.SupplierSafetyQualification; | |||
/** | |||
* @Classname ISupplierSafetyQulificationService | |||
* @Description | |||
* @Date 2023/8/2 10:47 | |||
* @Author PoffyZhang | |||
*/ | |||
public interface ISupplierSafetyQualificationService extends IService<SupplierSafetyQualification> { | |||
} |
@@ -0,0 +1,20 @@ | |||
package com.ningdatech.pmapi.safety.service.impl; | |||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
import com.ningdatech.pmapi.safety.mapper.PersonSafetyInfoMapper; | |||
import com.ningdatech.pmapi.safety.model.entity.PersonSafetyInfo; | |||
import com.ningdatech.pmapi.safety.service.IPersonSafetyInfoService; | |||
import org.springframework.stereotype.Service; | |||
/** | |||
* <p> | |||
* </p> | |||
* | |||
* @author ZPF | |||
* @since 2023-08-2 | |||
*/ | |||
@Service | |||
public class PersonSafetyInfoServiceImpl extends ServiceImpl<PersonSafetyInfoMapper, | |||
PersonSafetyInfo> implements IPersonSafetyInfoService { | |||
} |
@@ -0,0 +1,20 @@ | |||
package com.ningdatech.pmapi.safety.service.impl; | |||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
import com.ningdatech.pmapi.safety.mapper.SupplierSafetyQualificationMapper; | |||
import com.ningdatech.pmapi.safety.model.entity.SupplierSafetyQualification; | |||
import com.ningdatech.pmapi.safety.service.ISupplierSafetyQualificationService; | |||
import org.springframework.stereotype.Service; | |||
/** | |||
* <p> | |||
* </p> | |||
* | |||
* @author ZPF | |||
* @since 2023-08-2 | |||
*/ | |||
@Service | |||
public class SupplierSafetyQualificationServiceImpl extends ServiceImpl<SupplierSafetyQualificationMapper, | |||
SupplierSafetyQualification> implements ISupplierSafetyQualificationService { | |||
} |
@@ -157,6 +157,18 @@ public class UserInfoDetails extends AbstractLoginUser implements UserDetails { | |||
return Boolean.FALSE; | |||
} | |||
public Boolean getRegionAdmin() { | |||
if (CollUtil.isNotEmpty(this.userRoleList)) { | |||
for (Role role : this.userRoleList) { | |||
RoleEnum roleEnum = RoleEnum.mathByName(role.getCode()); | |||
if (Objects.nonNull(roleEnum) && roleEnum.eq(RoleEnum.REGION_MANAGER.name())) { | |||
return Boolean.TRUE; | |||
} | |||
} | |||
} | |||
return Boolean.FALSE; | |||
} | |||
public Boolean getIsMunicipalOrg() { | |||
//如果是丽水市本级的code 就是 | |||
if (RegionConst.RC_LS.equals(this.regionCode)) { | |||