| | |
| | | @PostMapping("/uploadFile") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "body", name = "projectId", dataType = "long", required = true, value = "项目id"), |
| | | @ApiImplicitParam(paramType = "body", name = "moduleType", dataType = "int", required = true, value = "上传模块code:1主要装置前的合影照片,2现场勘验照片,3企业陪同人员图片,4现场勘验视频,5现场勘验记录附件,6评审记录附件,7评价结论,8过程控制记录文档附件,9项目归档材料,10报备申请附件,11项目整改情况附件") |
| | | @ApiImplicitParam(paramType = "body", name = "moduleType", dataType = "int", required = true, value = "上传模块code:1主要装置前的合影照片,2现场勘验照片,3企业陪同人员图片,4现场勘验视频,5现场勘验记录附件,6评审记录附件,7评价结论,8过程控制记录文档附件,9项目归档材料,10报备申请附件,11项目整改情况附件,12从业报告附件") |
| | | }) |
| | | public CommonResult uploadFile(@RequestParam @NotNull Long projectId,@RequestParam @NotNull Integer moduleType, @RequestParam MultipartFile file){ |
| | | return CommonResult.success(assAccessoryFileService.uploadFile(projectId,moduleType,file)); |
| | |
| | | master: |
| | | url: jdbc:mysql://localhost:3306/smart_assess?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&serverTimezone=Asia/Shanghai&useSSL=false |
| | | username: root |
| | | password: password |
| | | password: 123456 |
| | | slave: |
| | | enabled: false |
| | | url: |
| | |
| | | @ApiModelProperty("机构名称") |
| | | @TableField(exist = false) |
| | | private String agencyName; |
| | | |
| | | @ApiModelProperty("是否检验检测 0否1是") |
| | | @TableField(exist = false) |
| | | private Integer safetyCheck; |
| | | |
| | | @ApiModelProperty("未完成:1") |
| | | @TableField(exist = false) |
| | | private Integer unFinish; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("项目归档总数") |
| | | private Integer archiveTotal; |
| | | |
| | | @ApiModelProperty("未完成检验检测总数") |
| | | private Integer safetyCheckTotal; |
| | | |
| | | @ApiModelProperty("未完成安全评价总数") |
| | | private Integer safetyTotal; |
| | | |
| | | @ApiModelProperty("未完总数") |
| | | private Integer unFinishTotal; |
| | | } |
| | |
| | | PROCESS_ATTACHMENT(8, "过程控制记录文档附件"), |
| | | PROJECT_MATERIAL(9, "项目归档材料"), |
| | | FILING_APPLY(10, "报备申请附件"), |
| | | PROJECT_RECITIFICATON(11, "项目整改情况附件"); |
| | | PROJECT_RECITIFICATON(11, "项目整改情况附件"), |
| | | EMPLOYMENT_NOTICE(12, "从业告知书附件"); |
| | | |
| | | private final Integer code; |
| | | private final String info; |
对比新文件 |
| | |
| | | package com.gkhy.assess.system.enums; |
| | | |
| | | /** |
| | | * 项目五大阶段 |
| | | * |
| | | */ |
| | | public enum SafetyCheckEnum |
| | | { |
| | | UN_CHECK(0, "非检验检测"), |
| | | CHECKED(1, "检验检测"); |
| | | |
| | | private final Integer code; |
| | | private final String info; |
| | | |
| | | SafetyCheckEnum(Integer code, String info) |
| | | { |
| | | this.code = code; |
| | | this.info = info; |
| | | } |
| | | |
| | | public Integer getCode() |
| | | { |
| | | return code; |
| | | } |
| | | |
| | | public String getInfo() |
| | | { |
| | | return info; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | * @param name |
| | | * @return |
| | | */ |
| | | AssProject getProjectByName(@Param("name")String name,@Param("agencyId")Long agencyId); |
| | | AssProject getProjectByName(@Param("name")String name,@Param("agencyId")Long agencyId,@Param("safetyCheck")Integer safetyCheck); |
| | | |
| | | /** |
| | | * 获取项目状态 |
| | |
| | | import com.gkhy.assess.system.domain.vo.ProjectStaticVO; |
| | | import com.gkhy.assess.system.enums.ProgressPhaseEnum; |
| | | import com.gkhy.assess.system.enums.ReportProgressEnum; |
| | | import com.gkhy.assess.system.enums.SafetyCheckEnum; |
| | | import com.gkhy.assess.system.mapper.AssPlanPersonMapper; |
| | | import com.gkhy.assess.system.mapper.AssProjectMapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | throw new ApiException("用户机构id为空"); |
| | | } |
| | | project.setAgencyId(user.getAgencyId()); |
| | | project.setSafetyCheck(project.getEstimateType() == 33 ? SafetyCheckEnum.CHECKED.getCode() :SafetyCheckEnum.UN_CHECK.getCode()); |
| | | if(!checkNameUnique(project)){ |
| | | throw new ApiException("项目名已存在"); |
| | | } |
| | |
| | | @Override |
| | | public boolean checkNameUnique(AssProject project) { |
| | | Long projectId = project.getId()==null? -1L : project.getId(); |
| | | AssProject pro = baseMapper.getProjectByName(project.getName(),project.getAgencyId()); |
| | | AssProject pro = baseMapper.getProjectByName(project.getName(),project.getAgencyId(),project.getSafetyCheck()); |
| | | if (pro!=null && pro.getId().longValue() != projectId.longValue()) |
| | | { |
| | | return false; |
| | |
| | | project.setPhase(ProgressPhaseEnum.ARCHIVE.getCode()); |
| | | Integer archiveTotal=baseMapper.getProjectCount(project); |
| | | |
| | | project.setPhase(null); |
| | | |
| | | project.setUnFinish(1); |
| | | project.setSafetyCheck(SafetyCheckEnum.CHECKED.getCode()); |
| | | Integer safetyCheckTotal=baseMapper.getProjectCount(project); |
| | | |
| | | project.setSafetyCheck(SafetyCheckEnum.UN_CHECK.getCode()); |
| | | Integer safetyTotal=baseMapper.getProjectCount(project); |
| | | |
| | | ProjectStaticVO projectStaticVO=new ProjectStaticVO() |
| | | .setProjectTotal(projectTotal) |
| | | .setRiskTotal(riskTotal) |
| | | .setInvestigationTotal(investigationTotal) |
| | | .setReviewTotal(reviewTotal) |
| | | .setReportTotal(reportTotal) |
| | | .setArchiveTotal(archiveTotal); |
| | | .setArchiveTotal(archiveTotal) |
| | | .setSafetyCheckTotal(safetyCheckTotal) |
| | | .setSafetyTotal(safetyTotal) |
| | | .setUnFinishTotal(safetyTotal+safetyCheckTotal); |
| | | return projectStaticVO; |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.assess.common.exception.ApiException; |
| | | import com.gkhy.assess.system.domain.AssWorkNotification; |
| | | import com.gkhy.assess.system.enums.AccessoryFileTypeEnum; |
| | | import com.gkhy.assess.system.enums.ReportProgressEnum; |
| | | import com.gkhy.assess.system.mapper.AssWorkNotificationMapper; |
| | | import com.gkhy.assess.system.service.AssAccessoryFileService; |
| | | import com.gkhy.assess.system.service.AssProjectService; |
| | | import com.gkhy.assess.system.service.AssWorkNotificationService; |
| | | import com.gkhy.assess.system.utils.ShiroUtils; |
| | |
| | | public class AssWorkNotificationServiceImpl extends ServiceImpl<AssWorkNotificationMapper, AssWorkNotification> implements AssWorkNotificationService { |
| | | @Autowired |
| | | private AssProjectService projectService; |
| | | |
| | | @Autowired |
| | | private AssAccessoryFileService accessoryFileService; |
| | | @Override |
| | | @Transactional(rollbackFor = RuntimeException.class) |
| | | public int addWorkNotification(AssWorkNotification workNotification) { |
| | | Long projectId=workNotification.getProjectId(); |
| | | projectService.checkUserAllowed(projectId); |
| | | checkWorkNotificationCount(projectId); |
| | | Integer fileCount=accessoryFileService.getAccessoryFileCountByProjectId(projectId,null, AccessoryFileTypeEnum.EMPLOYMENT_NOTICE.getCode()); |
| | | if(fileCount==0){ |
| | | throw new ApiException("未上传从业告知书"); |
| | | } |
| | | //校验项目状态 |
| | | projectService.checkReportProgress(projectId, ReportProgressEnum.ESTIMATE_PLAN); |
| | | workNotification.setCreateBy(ShiroUtils.getSysUser().getUsername()); |
| | |
| | | </if> |
| | | <where> |
| | | and p.del_flag = 0 |
| | | <if test="safetyCheck != null and safetyCheck == 0"> |
| | | and p.estimate_type != 33 |
| | | </if> |
| | | <if test="safetyCheck != null and safetyCheck == 1"> |
| | | and p.estimate_type = 33 |
| | | </if> |
| | | <if test="unFinish != null and unFinish == 1"> |
| | | and p.report_progress != 14 |
| | | </if> |
| | | <if test="agencyName != null and agencyName != ''"> |
| | | and a.name=#{agencyName} |
| | | </if> |
| | | <if test="name != null and name != ''"> |
| | | AND p.name like concat('%', #{name}, '%') |
| | | </if> |
| | |
| | | |
| | | <select id="getProjectByName" resultType="com.gkhy.assess.system.domain.AssProject"> |
| | | select id,name from ass_project |
| | | where name=#{name} and agency_id=#{agencyId} and del_flag=0 limit 1 |
| | | where name=#{name} and agency_id=#{agencyId} and del_flag=0 |
| | | <if test="safetyCheck != null and safetyCheck == 0"> |
| | | and estimate_type != 33 |
| | | </if> |
| | | <if test="safetyCheck != null and safetyCheck == 1"> |
| | | and estimate_type = 33 |
| | | </if> |
| | | limit 1 |
| | | </select> |
| | | |
| | | <select id="getReportProgress" resultType="java.lang.Integer"> |
| | |
| | | </select> |
| | | |
| | | <select id="getProjectCount" resultType="java.lang.Integer"> |
| | | select count(distinct p.id) from ass_project p |
| | | select Ifnull(count(distinct p.id),0) from ass_project p |
| | | <if test="params.lostMaterial != null"> |
| | | left join ass_project_material m on m.project_id=p.id |
| | | </if> |
| | | <if test="agencyName != null and agencyName != ''"> |
| | | left join sys_agency a on a.id=p.agency_id |
| | | </if> |
| | | <where> |
| | | and p.del_flag=0 |
| | | <if test="safetyCheck != null and safetyCheck == 0"> |
| | | and p.estimate_type != 33 |
| | | </if> |
| | | <if test="safetyCheck != null and safetyCheck == 1"> |
| | | and p.estimate_type = 33 |
| | | </if> |
| | | <if test="unFinish != null and unFinish == 1"> |
| | | and p.report_progress != 14 |
| | | </if> |
| | | <if test="agencyId!=null and agencyId!=''"> |
| | | and p.agency_id=#{agencyId} |
| | | </if> |
| | | <if test="agencyName != null and agencyName != ''"> |
| | | and a.name=#{agencyName} |
| | | </if> |
| | | <if test="name != null and name != ''"> |
| | | AND p.name like concat('%', #{name}, '%') |
| | | </if> |