parent
d48de94825
commit
ebaa5037a4
|
|
@ -12,7 +12,6 @@ import io.swagger.v3.oas.annotations.Parameter;
|
|||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -78,14 +77,9 @@ public class ProjectImplementationController extends BaseController {
|
|||
if (!"1".equals(workPlan.getApprovalStatus())) {
|
||||
return error("项目未通过审核");
|
||||
}
|
||||
|
||||
// 验证当前状态必须是未实施(0)
|
||||
if (!"0".equals(workPlan.getImplementationStatus())) {
|
||||
return error("项目已提交实施,无需重复提交");
|
||||
}
|
||||
|
||||
// 将状态从未实施(0)改为实施中(1)
|
||||
// 将实施状态改为实施中,项目状态改为进行中
|
||||
workPlan.setImplementationStatus("1");
|
||||
workPlan.setProjectStatus("2");
|
||||
return toAjax(workPlanService.updateWorkPlan(workPlan));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,9 @@ public class RiskControlCardCheckItem extends BaseEntity {
|
|||
|
||||
@Schema(description = "检查项描述")
|
||||
private String itemDescription;
|
||||
|
||||
@Schema(description = "风险等级:1高 2中 3低")
|
||||
private String riskLevel;
|
||||
|
||||
@Schema(description = "检查结果:合格、不合格")
|
||||
private String checkResult;
|
||||
|
|
|
|||
|
|
@ -62,6 +62,12 @@ public class WorkPlan extends BaseEntity {
|
|||
|
||||
@Schema(description = "施工单位名称")
|
||||
private String constructionUnitName;
|
||||
|
||||
@Schema(description = "监理单位ID(sys_dept,dept_type=2)")
|
||||
private Long supervisionUnitId;
|
||||
|
||||
@Schema(description = "监理单位名称")
|
||||
private String supervisionUnitName;
|
||||
|
||||
@Schema(description = "作业类型")
|
||||
private String workType;
|
||||
|
|
|
|||
|
|
@ -50,8 +50,14 @@ public class WorkTicket extends BaseEntity {
|
|||
@Schema(description = "作业内容")
|
||||
private String workContent;
|
||||
|
||||
@Schema(description = "风险类型")
|
||||
private String riskType;
|
||||
@Schema(description = "票证类型:普通作业票、危险作业票")
|
||||
private String ticketType;
|
||||
|
||||
@Schema(description = "涉及危险作业类型:高处危险作业、有限空间作业、起重吊装作业、临时用电作业、动火作业、不涉及")
|
||||
private String dangerousOperationType;
|
||||
|
||||
@Schema(description = "涉及危险作业内容说明")
|
||||
private String riskContent;
|
||||
|
||||
@Schema(description = "作业开始时间")
|
||||
private String workStartTime;
|
||||
|
|
|
|||
|
|
@ -10,9 +10,11 @@ import com.admin.contractor.mapper.DailyInspectionItemMapper;
|
|||
import com.admin.contractor.mapper.DailyInspectionSubmissionMapper;
|
||||
import com.admin.contractor.mapper.RiskControlCardCheckItemMapper;
|
||||
import com.admin.contractor.mapper.RiskControlCardMapper;
|
||||
import com.admin.contractor.mapper.SysDeptMapper;
|
||||
import com.admin.contractor.mapper.WorkPlanMapper;
|
||||
import com.admin.contractor.service.IRiskControlCardService;
|
||||
import com.admin.contractor.service.IWorkPlanService;
|
||||
import com.admin.property.mapper.PcCameraAllocMapper;
|
||||
import com.ruoyi.common.core.exception.ServiceException;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||
|
|
@ -42,6 +44,9 @@ public class WorkPlanServiceImpl implements IWorkPlanService {
|
|||
|
||||
@Autowired
|
||||
private SysUserMapper sysUserMapper;
|
||||
|
||||
@Autowired(required = false)
|
||||
private SysDeptMapper sysDeptMapper;
|
||||
|
||||
@Autowired
|
||||
private com.admin.contractor.mapper.WorkTicketMapper workTicketMapper;
|
||||
|
|
@ -72,6 +77,9 @@ public class WorkPlanServiceImpl implements IWorkPlanService {
|
|||
|
||||
@Autowired(required = false)
|
||||
private ConstructionIssueRectificationMapper constructionIssueRectificationMapper;
|
||||
|
||||
@Autowired(required = false)
|
||||
private PcCameraAllocMapper pcCameraAllocMapper;
|
||||
|
||||
private static final ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
|
|
@ -175,6 +183,20 @@ public class WorkPlanServiceImpl implements IWorkPlanService {
|
|||
if (StringUtils.isEmpty(workPlan.getProjectCode())) {
|
||||
workPlan.setProjectCode(generateProjectCode());
|
||||
}
|
||||
// 新增时:若未传施工单位,则用当前登录用户所属部门作为施工单位入库
|
||||
if (workPlan.getConstructionUnitId() == null && StringUtils.isEmpty(workPlan.getConstructionUnitName())) {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
if (userId != null && sysDeptMapper != null) {
|
||||
SysUser currentUser = sysUserMapper.selectUserById(userId);
|
||||
if (currentUser != null && currentUser.getDeptId() != null) {
|
||||
workPlan.setConstructionUnitId(currentUser.getDeptId());
|
||||
String deptName = sysDeptMapper.selectDeptNameById(currentUser.getDeptId());
|
||||
if (StringUtils.isNotEmpty(deptName)) {
|
||||
workPlan.setConstructionUnitName(deptName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 默认状态为草稿
|
||||
if (StringUtils.isEmpty(workPlan.getProjectStatus())) {
|
||||
workPlan.setProjectStatus("0");
|
||||
|
|
@ -272,6 +294,13 @@ public class WorkPlanServiceImpl implements IWorkPlanService {
|
|||
if (projectIds == null || projectIds.length == 0) {
|
||||
return 0;
|
||||
}
|
||||
// 删除前检查:是否存在未归还入库的球机(alloc_status=1已分配 或 2待入库)
|
||||
if (pcCameraAllocMapper != null) {
|
||||
int notInboundCount = pcCameraAllocMapper.countNotInboundByProjectIds(projectIds);
|
||||
if (notInboundCount > 0) {
|
||||
throw new ServiceException("存在未归还入库的球机,无法删除工作计划");
|
||||
}
|
||||
}
|
||||
// 1. 工作票ID(用于删风险管控卡、工作票)
|
||||
List<Long> ticketIds = workTicketMapper.selectTicketIdsByProjectIds(projectIds);
|
||||
Long[] ticketIdArr = ticketIds.isEmpty() ? null : ticketIds.toArray(new Long[0]);
|
||||
|
|
@ -362,9 +391,6 @@ public class WorkPlanServiceImpl implements IWorkPlanService {
|
|||
if (workPlan == null) {
|
||||
throw new ServiceException("工作计划不存在");
|
||||
}
|
||||
if (!"0".equals(workPlan.getProjectStatus())) {
|
||||
throw new ServiceException("只能提交草稿状态的工作计划");
|
||||
}
|
||||
// 更新状态为已提交,审批状态为待审核(0)
|
||||
return workPlanMapper.updateProjectStatusAndApproval(projectId, "1", null, "0", null, null, null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.admin.contractor.mapper.WorkPlanMapper;
|
|||
import com.admin.contractor.mapper.WorkTicketMapper;
|
||||
import com.admin.contractor.service.IRiskControlCardService;
|
||||
import com.admin.contractor.service.IWorkTicketService;
|
||||
import com.admin.owner.service.IOwnerIssuerService;
|
||||
import com.ruoyi.common.core.exception.ServiceException;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||
|
|
@ -30,12 +31,15 @@ public class WorkTicketServiceImpl implements IWorkTicketService {
|
|||
|
||||
@Autowired
|
||||
private WorkTicketMapper workTicketMapper;
|
||||
|
||||
|
||||
@Autowired
|
||||
private WorkPlanMapper workPlanMapper;
|
||||
|
||||
@Autowired(required = false)
|
||||
private IRiskControlCardService riskControlCardService;
|
||||
|
||||
@Autowired(required = false)
|
||||
private IOwnerIssuerService ownerIssuerService;
|
||||
|
||||
private static final ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
|
|
@ -65,7 +69,7 @@ public class WorkTicketServiceImpl implements IWorkTicketService {
|
|||
if (workPlan != null) {
|
||||
if (ticket.getProjectName() == null) {
|
||||
ticket.setProjectName(workPlan.getProjectName());
|
||||
}
|
||||
}
|
||||
if (ticket.getProjectCode() == null) {
|
||||
ticket.setProjectCode(workPlan.getProjectCode());
|
||||
}
|
||||
|
|
@ -224,6 +228,10 @@ public class WorkTicketServiceImpl implements IWorkTicketService {
|
|||
if (!"1".equals(workPlan.getApprovalStatus())) {
|
||||
throw new ServiceException("工作计划审批未通过,无法审批工作票申请");
|
||||
}
|
||||
// 签发人权限:须为该项目工作票签发人
|
||||
if (ownerIssuerService != null && !ownerIssuerService.canApproveWorkTicket(SecurityUtils.getUserId(), ticket.getProjectId())) {
|
||||
throw new ServiceException("您不是该项目的签发人或未具备工作票签发权限,无法审批签发");
|
||||
}
|
||||
}
|
||||
String reviewer = SecurityUtils.getUsername();
|
||||
return workTicketMapper.updateTicketStatus(ticketId, "2", reviewer, reviewComment); // 已签发
|
||||
|
|
@ -255,6 +263,10 @@ public class WorkTicketServiceImpl implements IWorkTicketService {
|
|||
if (!"1".equals(workPlan.getApprovalStatus())) {
|
||||
throw new ServiceException("工作计划审批未通过,无法审批工作票申请");
|
||||
}
|
||||
// 驳回同样要求具备该项目工作票签发权限
|
||||
if (ownerIssuerService != null && !ownerIssuerService.canApproveWorkTicket(SecurityUtils.getUserId(), ticket.getProjectId())) {
|
||||
throw new ServiceException("您不是该项目的签发人或未具备工作票签发权限,无法驳回");
|
||||
}
|
||||
}
|
||||
String reviewer = SecurityUtils.getUsername();
|
||||
return workTicketMapper.updateTicketStatus(ticketId, "3", reviewer, reviewComment); // 已驳回
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@ public class RiskControlCardItem extends BaseEntity {
|
|||
|
||||
@Schema(description = "是否必选:0可选,1必选")
|
||||
private String isRequired;
|
||||
|
||||
@Schema(description = "风险等级:1高 2中 3低")
|
||||
private String riskLevel;
|
||||
|
||||
@Schema(description = "排序号")
|
||||
private Integer sortOrder;
|
||||
|
|
|
|||
|
|
@ -29,4 +29,14 @@ public interface IOwnerIssuerService {
|
|||
* 判断用户是否为指定项目的签发人(具备该项目的审核/签发权限)
|
||||
*/
|
||||
boolean isIssuerForProject(Long userId, Long projectId);
|
||||
|
||||
/**
|
||||
* 是否可审批/签发工作票:须为该项目签发人,且「工作票签发人」为是
|
||||
*/
|
||||
boolean canApproveWorkTicket(Long userId, Long projectId);
|
||||
|
||||
/**
|
||||
* 是否可签发出入证:须为该项目签发人(在可管理项目范围内)
|
||||
*/
|
||||
boolean canIssueAccessPermit(Long userId, Long projectId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,12 +2,14 @@ package com.admin.owner.service.impl;
|
|||
|
||||
import com.admin.contractor.domain.AccessPermit;
|
||||
import com.admin.contractor.domain.VehicleInfo;
|
||||
import com.admin.contractor.domain.WorkPlan;
|
||||
import com.admin.contractor.domain.WorkTicket;
|
||||
import com.admin.contractor.mapper.AccessPermitMapper;
|
||||
import com.admin.contractor.mapper.SysUserMapper;
|
||||
import com.admin.contractor.mapper.WorkTicketMapper;
|
||||
import com.admin.contractor.service.IWorkTicketService;
|
||||
import com.admin.owner.service.IAccessPermitIssuanceService;
|
||||
import com.admin.owner.service.IOwnerIssuerService;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.ruoyi.common.core.exception.ServiceException;
|
||||
|
|
@ -45,6 +47,9 @@ public class AccessPermitIssuanceServiceImpl implements IAccessPermitIssuanceSer
|
|||
|
||||
@Autowired
|
||||
private SysUserMapper sysUserMapper;
|
||||
|
||||
@Autowired(required = false)
|
||||
private IOwnerIssuerService ownerIssuerService;
|
||||
|
||||
private static final ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
|
|
@ -164,13 +169,18 @@ public class AccessPermitIssuanceServiceImpl implements IAccessPermitIssuanceSer
|
|||
}
|
||||
|
||||
// 检查工作计划的审批状态,必须审批通过才能签发出入证
|
||||
com.admin.contractor.domain.WorkPlan workPlan = workPlanMapper.selectWorkPlanById(accessPermit.getProjectId());
|
||||
WorkPlan workPlan = workPlanMapper.selectWorkPlanById(accessPermit.getProjectId());
|
||||
if (workPlan == null) {
|
||||
throw new ServiceException("关联的工作计划不存在");
|
||||
}
|
||||
if (!"1".equals(workPlan.getApprovalStatus())) {
|
||||
throw new ServiceException("工作计划审批未通过,无法签发出入证");
|
||||
}
|
||||
|
||||
// 签发人权限:须为该项目签发人(在可管理项目范围内,管理员除外)
|
||||
if (ownerIssuerService != null && !ownerIssuerService.canIssueAccessPermit(SecurityUtils.getUserId(), accessPermit.getProjectId())) {
|
||||
throw new ServiceException("您不是该项目的签发人,无权签发出入证");
|
||||
}
|
||||
|
||||
// 处理车辆选择逻辑
|
||||
processVehicleSelection(accessPermit);
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import com.admin.owner.service.IOwnerIssuerService;
|
|||
import com.ruoyi.common.core.exception.ServiceException;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||
import com.ruoyi.common.core.constant.UserConstants;
|
||||
import com.ruoyi.system.api.domain.SysUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -141,6 +142,26 @@ public class OwnerIssuerServiceImpl implements IOwnerIssuerService {
|
|||
return projectIds != null && projectIds.contains(projectId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canApproveWorkTicket(Long userId, Long projectId) {
|
||||
if (userId != null && UserConstants.isAdmin(userId)) {
|
||||
return true;
|
||||
}
|
||||
if (!isIssuerForProject(userId, projectId)) {
|
||||
return false;
|
||||
}
|
||||
OwnerIssuer issuer = ownerIssuerMapper.selectOwnerIssuerByUserId(userId);
|
||||
return issuer != null && "1".equals(issuer.getWorkTicketIssuer());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canIssueAccessPermit(Long userId, Long projectId) {
|
||||
if (userId != null && UserConstants.isAdmin(userId)) {
|
||||
return true;
|
||||
}
|
||||
return isIssuerForProject(userId, projectId);
|
||||
}
|
||||
|
||||
private static Date todayStart() {
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(Calendar.HOUR_OF_DAY, 0);
|
||||
|
|
|
|||
|
|
@ -41,4 +41,9 @@ public interface PcCameraAllocMapper {
|
|||
|
||||
/** 批量更新分配记录为入库驳回(audit_status=2) */
|
||||
int updateInboundReject(@Param("allocIds") List<Long> allocIds, @Param("auditBy") String auditBy, @Param("auditRemark") String auditRemark);
|
||||
|
||||
/**
|
||||
* 统计指定项目下未归还入库的球机数量(alloc_status=1 已分配 或 2 待入库,且台账状态非已入库)
|
||||
*/
|
||||
int countNotInboundByProjectIds(@Param("projectIds") Long[] projectIds);
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@ import com.ruoyi.common.core.exception.ServiceException;
|
|||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.admin.property.domain.PcRiskProject;
|
||||
import com.admin.property.mapper.PcRiskProjectMapper;
|
||||
import com.admin.property.mapper.PcCameraAllocMapper;
|
||||
import com.admin.property.service.IPcRiskProjectService;
|
||||
import com.admin.contractor.domain.WorkTicket;
|
||||
import com.admin.contractor.domain.WorkPlan;
|
||||
|
|
@ -13,7 +14,10 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class PcRiskProjectServiceImpl implements IPcRiskProjectService {
|
||||
|
|
@ -26,6 +30,9 @@ public class PcRiskProjectServiceImpl implements IPcRiskProjectService {
|
|||
@Autowired
|
||||
private IWorkPlanService workPlanService;
|
||||
|
||||
@Autowired(required = false)
|
||||
private PcCameraAllocMapper pcCameraAllocMapper;
|
||||
|
||||
public PcRiskProjectServiceImpl(PcRiskProjectMapper pcRiskProjectMapper) {
|
||||
this.pcRiskProjectMapper = pcRiskProjectMapper;
|
||||
}
|
||||
|
|
@ -69,12 +76,6 @@ public class PcRiskProjectServiceImpl implements IPcRiskProjectService {
|
|||
throw new ServiceException("该工作票不需要申领移动监控球机");
|
||||
}
|
||||
|
||||
// 验证是否为高风险作业项
|
||||
if (StringUtils.isEmpty(workTicket.getRiskType()) ||
|
||||
(!workTicket.getRiskType().contains("高风险") && !workTicket.getRiskType().contains("危险"))) {
|
||||
throw new ServiceException("只有涉及高风险作业项的工作票才能创建球机申领");
|
||||
}
|
||||
|
||||
// 根据工作票的项目ID获取工作计划信息
|
||||
WorkPlan workPlan = workPlanService.selectWorkPlanById(workTicket.getProjectId());
|
||||
if (workPlan == null) {
|
||||
|
|
@ -117,7 +118,108 @@ public class PcRiskProjectServiceImpl implements IPcRiskProjectService {
|
|||
|
||||
@Override
|
||||
public List<PcRiskProject> selectProjectCompletionReviewList(PcRiskProject pcRiskProject) {
|
||||
return pcRiskProjectMapper.selectProjectCompletionReviewList(pcRiskProject);
|
||||
// 原始列表:每条记录是一条球机申领(applicationId),同一项目可能多条
|
||||
List<PcRiskProject> rawList = pcRiskProjectMapper.selectProjectCompletionReviewList(pcRiskProject);
|
||||
if (rawList == null || rawList.isEmpty()) {
|
||||
return rawList;
|
||||
}
|
||||
|
||||
// 按项目ID聚合(一个项目一行)
|
||||
Map<Long, List<PcRiskProject>> groupByProject = new LinkedHashMap<>();
|
||||
for (PcRiskProject item : rawList) {
|
||||
Long projectId = item.getProjectId();
|
||||
if (projectId == null) {
|
||||
// projectId 为空的记录直接保留
|
||||
groupByProject.computeIfAbsent(-1L, k -> new ArrayList<>()).add(item);
|
||||
} else {
|
||||
groupByProject.computeIfAbsent(projectId, k -> new ArrayList<>()).add(item);
|
||||
}
|
||||
}
|
||||
|
||||
List<PcRiskProject> result = new ArrayList<>();
|
||||
for (Map.Entry<Long, List<PcRiskProject>> entry : groupByProject.entrySet()) {
|
||||
List<PcRiskProject> list = entry.getValue();
|
||||
if (list.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
PcRiskProject first = list.get(0);
|
||||
PcRiskProject agg = new PcRiskProject();
|
||||
// 简单复制基础字段(项目名称、施工单位等)
|
||||
agg.setApplicationId(first.getApplicationId());
|
||||
agg.setNeedCameraCnt(first.getNeedCameraCnt());
|
||||
agg.setInstallationLocation(first.getInstallationLocation());
|
||||
agg.setContactPerson(first.getContactPerson());
|
||||
agg.setContactPhone(first.getContactPhone());
|
||||
agg.setWorkTicketId(first.getWorkTicketId());
|
||||
agg.setProjectId(first.getProjectId());
|
||||
agg.setDelFlag(first.getDelFlag());
|
||||
agg.setRemark(first.getRemark());
|
||||
agg.setCreateBy(first.getCreateBy());
|
||||
agg.setCreateTime(first.getCreateTime());
|
||||
agg.setUpdateBy(first.getUpdateBy());
|
||||
agg.setUpdateTime(first.getUpdateTime());
|
||||
agg.setProjectName(first.getProjectName());
|
||||
agg.setProjectCode(first.getProjectCode());
|
||||
agg.setConstructionUnit(first.getConstructionUnit());
|
||||
agg.setWorkLocation(first.getWorkLocation());
|
||||
agg.setWorkStart(first.getWorkStart());
|
||||
agg.setWorkEnd(first.getWorkEnd());
|
||||
agg.setRiskType(first.getRiskType());
|
||||
|
||||
// 监理复核、现场复核、最终审核状态聚合:
|
||||
// 只有全部记录达到“通过/已复核/已审核”时,汇总状态才显示为相应完成状态,否则显示为进行中
|
||||
boolean allSupervisionPass = true;
|
||||
boolean anySupervision = false;
|
||||
boolean allOnSiteReviewed = true;
|
||||
boolean anyOnSite = false;
|
||||
boolean allFinalAudited = true;
|
||||
boolean anyFinal = false;
|
||||
|
||||
for (PcRiskProject p : list) {
|
||||
if (StringUtils.isNotEmpty(p.getSupervisionReviewStatus())) {
|
||||
anySupervision = true;
|
||||
if (!"复核通过".equals(p.getSupervisionReviewStatus())) {
|
||||
allSupervisionPass = false;
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotEmpty(p.getOnSiteReviewStatus())) {
|
||||
anyOnSite = true;
|
||||
if (!"已复核".equals(p.getOnSiteReviewStatus())) {
|
||||
allOnSiteReviewed = false;
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotEmpty(p.getFinalAuditStatus())) {
|
||||
anyFinal = true;
|
||||
if (!"已审核".equals(p.getFinalAuditStatus())) {
|
||||
allFinalAudited = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (anySupervision) {
|
||||
agg.setSupervisionReviewStatus(allSupervisionPass ? "复核通过" : "复核中");
|
||||
}
|
||||
if (anyOnSite) {
|
||||
agg.setOnSiteReviewStatus(allOnSiteReviewed ? "已复核" : "复核中");
|
||||
}
|
||||
if (anyFinal) {
|
||||
agg.setFinalAuditStatus(allFinalAudited ? "已审核" : "未完成");
|
||||
}
|
||||
|
||||
// 球机入库状态聚合:只有全部球机已入库才显示“已入库”,否则显示“未入库”
|
||||
if (agg.getProjectId() != null && pcCameraAllocMapper != null) {
|
||||
Long[] projectIds = new Long[]{agg.getProjectId()};
|
||||
int notInboundCount = pcCameraAllocMapper.countNotInboundByProjectIds(projectIds);
|
||||
if (notInboundCount == 0) {
|
||||
agg.setAllocStatus("已入库");
|
||||
} else {
|
||||
agg.setAllocStatus("未入库");
|
||||
}
|
||||
}
|
||||
|
||||
result.add(agg);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -187,12 +289,6 @@ public class PcRiskProjectServiceImpl implements IPcRiskProjectService {
|
|||
throw new ServiceException("该工作票不需要申领移动监控球机");
|
||||
}
|
||||
|
||||
// 验证是否为高风险作业项
|
||||
if (StringUtils.isEmpty(workTicket.getRiskType()) ||
|
||||
(!workTicket.getRiskType().contains("高风险") && !workTicket.getRiskType().contains("危险"))) {
|
||||
throw new ServiceException("只有涉及高风险作业项的工作票才能创建球机申领");
|
||||
}
|
||||
|
||||
// 根据工作票的项目ID获取工作计划信息
|
||||
WorkPlan workPlan = workPlanService.selectWorkPlanById(workTicket.getProjectId());
|
||||
if (workPlan == null) {
|
||||
|
|
@ -210,7 +306,12 @@ public class PcRiskProjectServiceImpl implements IPcRiskProjectService {
|
|||
result.setWorkLocation(workPlan.getWorkLocation());
|
||||
result.setWorkStart(workPlan.getWorkStartTime());
|
||||
result.setWorkEnd(workPlan.getWorkEndTime());
|
||||
result.setRiskType(workTicket.getRiskType());
|
||||
// 预填充展示:票证类型 + 涉及危险作业类型
|
||||
if (StringUtils.isNotEmpty(workTicket.getDangerousOperationType())) {
|
||||
result.setRiskType(workTicket.getTicketType() + " / " + workTicket.getDangerousOperationType());
|
||||
} else {
|
||||
result.setRiskType(workTicket.getTicketType());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
@ -235,12 +336,6 @@ public class PcRiskProjectServiceImpl implements IPcRiskProjectService {
|
|||
throw new ServiceException("该工作票不需要申领移动监控球机");
|
||||
}
|
||||
|
||||
// 验证是否为高风险作业项
|
||||
if (StringUtils.isEmpty(workTicket.getRiskType()) ||
|
||||
(!workTicket.getRiskType().contains("高等风险") && !workTicket.getRiskType().contains("危险"))) {
|
||||
throw new ServiceException("只有涉及高风险作业项的工作票才能绑定球机申领");
|
||||
}
|
||||
|
||||
// 验证工作计划是否匹配
|
||||
if (project.getProjectId() != null && !project.getProjectId().equals(workTicket.getProjectId())) {
|
||||
throw new ServiceException("工作票所属项目与球机申请单关联的项目不匹配");
|
||||
|
|
|
|||
|
|
@ -223,4 +223,18 @@
|
|||
</foreach>
|
||||
</update>
|
||||
|
||||
<!-- 统计指定项目下未归还入库的球机数量:
|
||||
条件:分配记录未删除、状态为1已分配或2待入库 -->
|
||||
<select id="countNotInboundByProjectIds" resultType="int">
|
||||
select count(1)
|
||||
from pc_camera_alloc a
|
||||
left join pc_camera_risk p on p.application_id = a.application_id and p.del_flag='0'
|
||||
where a.del_flag='0'
|
||||
and a.alloc_status in ('1','2')
|
||||
and p.project_id in
|
||||
<foreach collection="projectIds" item="pid" open="(" close=")" separator=",">
|
||||
#{pid}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -77,8 +77,8 @@
|
|||
wp.work_end_time as work_end,
|
||||
-- 通过工作计划的项目负责人联查施工单位名称(负责人所在部门)
|
||||
(case when d.dept_id is not null then d.dept_name else wp.construction_unit_name end) as construction_unit,
|
||||
-- 从工作票关联查询
|
||||
wt.risk_type
|
||||
-- 从工作票关联查询(work_ticket 已去掉 risk_type,用票证类型 + 涉及危险作业类型 拼接展示)
|
||||
concat_ws(' / ', nullif(trim(wt.ticket_type), ''), nullif(trim(wt.dangerous_operation_type), '')) as risk_type
|
||||
from pc_camera_risk r
|
||||
left join work_plan wp on wp.project_id = r.project_id and wp.del_flag = '0'
|
||||
left join sys_user u on u.user_id = wp.supervisor_id and u.del_flag = '0'
|
||||
|
|
@ -119,8 +119,8 @@
|
|||
wp.work_end_time as work_end,
|
||||
-- 通过工作计划的项目负责人联查施工单位名称(负责人所在部门)
|
||||
(case when d.dept_id is not null then d.dept_name else wp.construction_unit_name end) as construction_unit,
|
||||
-- 从工作票关联查询
|
||||
wt.risk_type
|
||||
-- 从工作票关联查询(work_ticket 已去掉 risk_type,用票证类型 + 涉及危险作业类型 拼接展示)
|
||||
concat_ws(' / ', nullif(trim(wt.ticket_type), ''), nullif(trim(wt.dangerous_operation_type), '')) as risk_type
|
||||
from pc_camera_risk r
|
||||
left join work_plan wp on wp.project_id = r.project_id and wp.del_flag = '0'
|
||||
left join sys_user u on u.user_id = wp.supervisor_id and u.del_flag = '0'
|
||||
|
|
@ -241,8 +241,8 @@
|
|||
wp.work_end_time as work_end,
|
||||
-- 通过工作计划的项目负责人联查施工单位名称(负责人所在部门)
|
||||
(case when d.dept_id is not null then d.dept_name else wp.construction_unit_name end) as construction_unit,
|
||||
-- 从工作票关联查询
|
||||
wt.risk_type
|
||||
-- 从工作票关联查询(work_ticket 已去掉 risk_type,用票证类型 + 涉及危险作业类型 拼接展示)
|
||||
concat_ws(' / ', nullif(trim(wt.ticket_type), ''), nullif(trim(wt.dangerous_operation_type), '')) as risk_type
|
||||
from pc_camera_risk r
|
||||
left join work_plan wp on wp.project_id = r.project_id and wp.del_flag = '0'
|
||||
left join sys_user u on u.user_id = wp.supervisor_id and u.del_flag = '0'
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
<result property="cardId" column="card_id" />
|
||||
<result property="templateItemId" column="template_item_id" />
|
||||
<result property="itemDescription" column="item_description" />
|
||||
<result property="riskLevel" column="risk_level" />
|
||||
<result property="checkResult" column="check_result" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="sortOrder" column="sort_order" />
|
||||
|
|
@ -32,22 +33,22 @@
|
|||
|
||||
<insert id="insertRiskControlCardCheckItem" parameterType="com.admin.contractor.domain.RiskControlCardCheckItem" useGeneratedKeys="true" keyProperty="checkItemId">
|
||||
insert into risk_control_card_check_item(
|
||||
card_id, template_item_id, item_description, check_result, remark, sort_order, del_flag,
|
||||
card_id, template_item_id, item_description, risk_level, check_result, remark, sort_order, del_flag,
|
||||
create_by, create_time
|
||||
)values(
|
||||
#{cardId}, #{templateItemId}, #{itemDescription}, #{checkResult}, #{remark}, #{sortOrder}, '0',
|
||||
#{cardId}, #{templateItemId}, #{itemDescription}, #{riskLevel}, #{checkResult}, #{remark}, #{sortOrder}, '0',
|
||||
#{createBy}, now()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="batchInsertRiskControlCardCheckItem" parameterType="java.util.List">
|
||||
insert into risk_control_card_check_item(
|
||||
card_id, template_item_id, item_description, check_result, remark, sort_order, del_flag,
|
||||
card_id, template_item_id, item_description, risk_level, check_result, remark, sort_order, del_flag,
|
||||
create_by, create_time
|
||||
)values
|
||||
<foreach collection="checkItems" item="item" separator=",">
|
||||
(
|
||||
#{item.cardId}, #{item.templateItemId}, #{item.itemDescription}, #{item.checkResult}, #{item.remark}, #{item.sortOrder}, '0',
|
||||
#{item.cardId}, #{item.templateItemId}, #{item.itemDescription}, #{item.riskLevel}, #{item.checkResult}, #{item.remark}, #{item.sortOrder}, '0',
|
||||
#{item.createBy}, now()
|
||||
)
|
||||
</foreach>
|
||||
|
|
@ -59,6 +60,7 @@
|
|||
<if test="cardId != null">card_id = #{cardId},</if>
|
||||
<if test="templateItemId != null">template_item_id = #{templateItemId},</if>
|
||||
<if test="itemDescription != null and itemDescription != ''">item_description = #{itemDescription},</if>
|
||||
<if test="riskLevel != null and riskLevel != ''">risk_level = #{riskLevel},</if>
|
||||
<if test="checkResult != null and checkResult != ''">check_result = #{checkResult},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="sortOrder != null">sort_order = #{sortOrder},</if>
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
<result property="itemDescription" column="item_description" />
|
||||
<result property="checkMethod" column="check_method" />
|
||||
<result property="isRequired" column="is_required" />
|
||||
<result property="riskLevel" column="risk_level" />
|
||||
<result property="sortOrder" column="sort_order" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
|
|
@ -19,8 +20,8 @@
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectRiskControlCardItemVo">
|
||||
select item_id, template_id, item_description, check_method, is_required, sort_order, del_flag, create_by, create_time, update_by, update_time
|
||||
from risk_control_card_item
|
||||
select item_id, template_id, item_description, check_method, is_required, risk_level, sort_order, del_flag, create_by, create_time, update_by, update_time
|
||||
from risk_control_card_item_template
|
||||
</sql>
|
||||
|
||||
<select id="selectRiskControlCardItemById" parameterType="Long" resultMap="RiskControlCardItemResult">
|
||||
|
|
@ -37,6 +38,9 @@
|
|||
<if test="isRequired != null and isRequired != ''">
|
||||
and is_required = #{isRequired}
|
||||
</if>
|
||||
<if test="riskLevel != null and riskLevel != ''">
|
||||
and risk_level = #{riskLevel}
|
||||
</if>
|
||||
order by sort_order asc, create_time asc
|
||||
</select>
|
||||
|
||||
|
|
@ -47,11 +51,12 @@
|
|||
</select>
|
||||
|
||||
<insert id="insertRiskControlCardItem" parameterType="com.admin.logistics.domain.RiskControlCardItem" useGeneratedKeys="true" keyProperty="itemId">
|
||||
insert into risk_control_card_item(
|
||||
insert into risk_control_card_item_template(
|
||||
<if test="templateId != null">template_id,</if>
|
||||
<if test="itemDescription != null and itemDescription != ''">item_description,</if>
|
||||
<if test="checkMethod != null and checkMethod != ''">check_method,</if>
|
||||
<if test="isRequired != null and isRequired != ''">is_required,</if>
|
||||
<if test="riskLevel != null and riskLevel != ''">risk_level,</if>
|
||||
<if test="sortOrder != null">sort_order,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
|
|
@ -60,6 +65,7 @@
|
|||
<if test="itemDescription != null and itemDescription != ''">#{itemDescription},</if>
|
||||
<if test="checkMethod != null and checkMethod != ''">#{checkMethod},</if>
|
||||
<if test="isRequired != null and isRequired != ''">#{isRequired},</if>
|
||||
<if test="riskLevel != null and riskLevel != ''">#{riskLevel},</if>
|
||||
<if test="sortOrder != null">#{sortOrder},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
now()
|
||||
|
|
@ -67,19 +73,20 @@
|
|||
</insert>
|
||||
|
||||
<insert id="batchInsertRiskControlCardItem" parameterType="java.util.List">
|
||||
insert into risk_control_card_item(template_id, item_description, check_method, is_required, sort_order, create_by, create_time)
|
||||
insert into risk_control_card_item_template(template_id, item_description, check_method, is_required, risk_level, sort_order, create_by, create_time)
|
||||
values
|
||||
<foreach collection="items" item="item" separator=",">
|
||||
(#{item.templateId}, #{item.itemDescription}, #{item.checkMethod}, #{item.isRequired}, #{item.sortOrder}, #{item.createBy}, now())
|
||||
(#{item.templateId}, #{item.itemDescription}, #{item.checkMethod}, #{item.isRequired}, #{item.riskLevel}, #{item.sortOrder}, #{item.createBy}, now())
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateRiskControlCardItem" parameterType="com.admin.logistics.domain.RiskControlCardItem">
|
||||
update risk_control_card_item
|
||||
update risk_control_card_item_template
|
||||
<set>
|
||||
<if test="itemDescription != null and itemDescription != ''">item_description = #{itemDescription},</if>
|
||||
<if test="checkMethod != null and checkMethod != ''">check_method = #{checkMethod},</if>
|
||||
<if test="isRequired != null and isRequired != ''">is_required = #{isRequired},</if>
|
||||
<if test="riskLevel != null and riskLevel != ''">risk_level = #{riskLevel},</if>
|
||||
<if test="sortOrder != null">sort_order = #{sortOrder},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = now()
|
||||
|
|
@ -88,22 +95,22 @@
|
|||
</update>
|
||||
|
||||
<delete id="deleteRiskControlCardItemById" parameterType="Long">
|
||||
delete from risk_control_card_item where item_id = #{itemId}
|
||||
delete from risk_control_card_item_template where item_id = #{itemId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRiskControlCardItemByIds" parameterType="String">
|
||||
delete from risk_control_card_item where item_id in
|
||||
delete from risk_control_card_item_template where item_id in
|
||||
<foreach item="itemId" collection="itemIds" open="(" separator="," close=")">
|
||||
#{itemId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteItemsByTemplateId" parameterType="Long">
|
||||
delete from risk_control_card_item where template_id = #{templateId}
|
||||
delete from risk_control_card_item_template where template_id = #{templateId}
|
||||
</delete>
|
||||
|
||||
<update id="updateItemSortOrder">
|
||||
update risk_control_card_item
|
||||
update risk_control_card_item_template
|
||||
set sort_order = #{sortOrder},
|
||||
update_time = now()
|
||||
where item_id = #{itemId}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@
|
|||
<update id="updateItemCount" parameterType="Long">
|
||||
update risk_control_card_template t
|
||||
set t.item_count = (
|
||||
select count(1) from risk_control_card_item i
|
||||
select count(1) from risk_control_card_item_template i
|
||||
where i.template_id = t.template_id and i.del_flag = '0'
|
||||
),
|
||||
t.update_time = now()
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@
|
|||
<result property="sysUsers" column="team_members" />
|
||||
<result property="constructionUnitId" column="construction_unit_id" />
|
||||
<result property="constructionUnitName" column="construction_unit_name" />
|
||||
<result property="supervisionUnitId" column="supervision_unit_id" />
|
||||
<result property="supervisionUnitName" column="supervision_unit_name" />
|
||||
<result property="workType" column="work_type" />
|
||||
<result property="riskLevel" column="risk_level" />
|
||||
<result property="projectStatus" column="project_status" />
|
||||
|
|
@ -64,6 +66,9 @@
|
|||
<if test="constructionUnitName != null and constructionUnitName != ''">
|
||||
and construction_unit_name like concat('%', #{constructionUnitName}, '%')
|
||||
</if>
|
||||
<if test="supervisionUnitName != null and supervisionUnitName != ''">
|
||||
and supervision_unit_name like concat('%', #{supervisionUnitName}, '%')
|
||||
</if>
|
||||
<if test="workType != null and workType != ''">
|
||||
and work_type = #{workType}
|
||||
</if>
|
||||
|
|
@ -81,7 +86,7 @@
|
|||
project_code, project_name, work_location, work_location_detail,
|
||||
longitude, latitude, work_start_time, work_end_time,
|
||||
supervisor_id, supervisor_name, supervisor_position, team_members,
|
||||
construction_unit_id, construction_unit_name, work_type, risk_level,
|
||||
construction_unit_id, construction_unit_name, supervision_unit_id, supervision_unit_name, work_type, risk_level,
|
||||
project_status, implementation_status, approval_status, approver, approval_time, approval_comment,
|
||||
current_progress, remark, del_flag,
|
||||
create_by, create_time
|
||||
|
|
@ -89,7 +94,7 @@
|
|||
#{projectCode}, #{projectName}, #{workLocation}, #{workLocationDetail},
|
||||
#{longitude}, #{latitude}, #{workStartTime}, #{workEndTime},
|
||||
#{supervisorId}, #{supervisorName}, #{supervisorPosition}, #{sysUsers},
|
||||
#{constructionUnitId}, #{constructionUnitName}, #{workType}, #{riskLevel},
|
||||
#{constructionUnitId}, #{constructionUnitName}, #{supervisionUnitId}, #{supervisionUnitName}, #{workType}, #{riskLevel},
|
||||
#{projectStatus}, #{implementationStatus}, #{approvalStatus}, #{approver}, #{approvalTime}, #{approvalComment},
|
||||
#{currentProgress}, #{remark}, '0',
|
||||
#{createBy}, now()
|
||||
|
|
@ -113,6 +118,8 @@
|
|||
<if test="sysUsers != null">team_members = #{sysUsers},</if>
|
||||
<if test="constructionUnitId != null">construction_unit_id = #{constructionUnitId},</if>
|
||||
<if test="constructionUnitName != null">construction_unit_name = #{constructionUnitName},</if>
|
||||
<if test="supervisionUnitId != null">supervision_unit_id = #{supervisionUnitId},</if>
|
||||
<if test="supervisionUnitName != null">supervision_unit_name = #{supervisionUnitName},</if>
|
||||
<if test="workType != null">work_type = #{workType},</if>
|
||||
<if test="riskLevel != null">risk_level = #{riskLevel},</if>
|
||||
<if test="projectStatus != null and projectStatus != ''">project_status = #{projectStatus},</if>
|
||||
|
|
@ -202,7 +209,7 @@
|
|||
wp.update_by,
|
||||
wp.update_time,
|
||||
wt.status as work_ticket_status,
|
||||
wt.status as hazardous_work_ticket_status,
|
||||
case when wt.ticket_type = '危险作业票' then wt.status else null end as hazardous_work_ticket_status,
|
||||
wt.reviewer as issuer,
|
||||
ap.permit_number as access_permit_number,
|
||||
concat(ap.validity_start_time, ' 至 ', ap.validity_end_time) as access_permit_validity,
|
||||
|
|
|
|||
|
|
@ -16,7 +16,9 @@
|
|||
<result property="supervisorPosition" column="supervisor_position" />
|
||||
<result property="supervisorDeptName" column="supervisor_dept_name" />
|
||||
<result property="workContent" column="work_content" />
|
||||
<result property="riskType" column="risk_type" />
|
||||
<result property="ticketType" column="ticket_type" />
|
||||
<result property="dangerousOperationType" column="dangerous_operation_type" />
|
||||
<result property="riskContent" column="risk_content" />
|
||||
<result property="workStartTime" column="work_start_time" />
|
||||
<result property="workEndTime" column="work_end_time" />
|
||||
<result property="generalSafetyMeasures" column="general_safety_measures" />
|
||||
|
|
@ -41,7 +43,8 @@
|
|||
wp.project_code, wp.project_name,
|
||||
wt.work_location, wt.supervisor_id, wt.supervisor_name, wt.supervisor_position,
|
||||
d.dept_name as supervisor_dept_name,
|
||||
wt.work_content, wt.risk_type, wt.work_start_time, wt.work_end_time,
|
||||
wt.work_content, wt.ticket_type, wt.dangerous_operation_type, wt.risk_content,
|
||||
wt.work_start_time, wt.work_end_time,
|
||||
wt.general_safety_measures, wt.custom_safety_measures, wt.team_member_qualifications,
|
||||
wt.need_monitoring_camera, wt.camera_application_id, wt.status,
|
||||
wt.reviewer, wt.review_time, wt.review_comment, wt.del_flag, wt.remark,
|
||||
|
|
@ -58,7 +61,8 @@
|
|||
wp.project_code, wp.project_name,
|
||||
wt.work_location, wt.supervisor_id, wt.supervisor_name, wt.supervisor_position,
|
||||
d.dept_name as supervisor_dept_name,
|
||||
wt.work_content, wt.risk_type, wt.work_start_time, wt.work_end_time,
|
||||
wt.work_content, wt.ticket_type, wt.dangerous_operation_type, wt.risk_content,
|
||||
wt.work_start_time, wt.work_end_time,
|
||||
wt.general_safety_measures, wt.custom_safety_measures, wt.team_member_qualifications,
|
||||
wt.need_monitoring_camera, wt.camera_application_id, wt.status,
|
||||
wt.reviewer, wt.review_time, wt.review_comment, wt.del_flag, wt.remark,
|
||||
|
|
@ -85,7 +89,8 @@
|
|||
wp.project_code, wp.project_name,
|
||||
wt.work_location, wt.supervisor_id, wt.supervisor_name, wt.supervisor_position,
|
||||
d.dept_name as supervisor_dept_name,
|
||||
wt.work_content, wt.risk_type, wt.work_start_time, wt.work_end_time,
|
||||
wt.work_content, wt.ticket_type, wt.dangerous_operation_type, wt.risk_content,
|
||||
wt.work_start_time, wt.work_end_time,
|
||||
wt.general_safety_measures, wt.custom_safety_measures, wt.team_member_qualifications,
|
||||
wt.need_monitoring_camera, wt.camera_application_id, wt.status,
|
||||
wt.reviewer, wt.review_time, wt.review_comment, wt.del_flag, wt.remark,
|
||||
|
|
@ -113,15 +118,17 @@
|
|||
<insert id="insertWorkTicket" parameterType="com.admin.contractor.domain.WorkTicket" useGeneratedKeys="true" keyProperty="ticketId">
|
||||
insert into work_ticket(
|
||||
ticket_number, project_id,
|
||||
ticket_type,
|
||||
work_location, supervisor_id, supervisor_name, supervisor_position,
|
||||
work_content, risk_type, work_start_time, work_end_time,
|
||||
work_content, dangerous_operation_type, risk_content, work_start_time, work_end_time,
|
||||
general_safety_measures, custom_safety_measures, team_member_qualifications,
|
||||
need_monitoring_camera, camera_application_id, status, remark,
|
||||
del_flag, create_by, create_time
|
||||
)values(
|
||||
#{ticketNumber}, #{projectId},
|
||||
#{ticketType},
|
||||
#{workLocation}, #{supervisorId}, #{supervisorName}, #{supervisorPosition},
|
||||
#{workContent}, #{riskType}, #{workStartTime}, #{workEndTime},
|
||||
#{workContent}, #{dangerousOperationType}, #{riskContent}, #{workStartTime}, #{workEndTime},
|
||||
#{generalSafetyMeasures}, #{customSafetyMeasures}, #{teamMemberQualifications},
|
||||
#{needMonitoringCamera}, #{cameraApplicationId}, #{status}, #{remark},
|
||||
'0', #{createBy}, now()
|
||||
|
|
@ -138,7 +145,9 @@
|
|||
<if test="supervisorName != null">supervisor_name = #{supervisorName},</if>
|
||||
<if test="supervisorPosition != null">supervisor_position = #{supervisorPosition},</if>
|
||||
<if test="workContent != null">work_content = #{workContent},</if>
|
||||
<if test="riskType != null">risk_type = #{riskType},</if>
|
||||
<if test="ticketType != null">ticket_type = #{ticketType},</if>
|
||||
<if test="dangerousOperationType != null">dangerous_operation_type = #{dangerousOperationType},</if>
|
||||
<if test="riskContent != null">risk_content = #{riskContent},</if>
|
||||
<if test="workStartTime != null">work_start_time = #{workStartTime},</if>
|
||||
<if test="workEndTime != null">work_end_time = #{workEndTime},</if>
|
||||
<if test="generalSafetyMeasures != null">general_safety_measures = #{generalSafetyMeasures},</if>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.ruoyi.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
|
@ -124,7 +126,10 @@ public class SysDeptController extends BaseController
|
|||
{
|
||||
Long deptId = dept.getDeptId();
|
||||
deptService.checkDeptDataScope(deptId);
|
||||
if (!deptService.checkDeptNameUnique(dept))
|
||||
// 仅当部门名称发生变化时校验同名,避免只改其他字段时误判
|
||||
SysDept existDept = deptService.selectDeptById(deptId);
|
||||
if (existDept != null && !StringUtils.equals(existDept.getDeptName(), dept.getDeptName())
|
||||
&& !deptService.checkDeptNameUnique(dept))
|
||||
{
|
||||
return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||
}
|
||||
|
|
@ -137,6 +142,7 @@ public class SysDeptController extends BaseController
|
|||
return error("该部门包含未停用的子部门!");
|
||||
}
|
||||
dept.setUpdateBy(SecurityUtils.getUsername());
|
||||
dept.setAuditStatus("0");
|
||||
return toAjax(deptService.updateDept(dept));
|
||||
}
|
||||
|
||||
|
|
@ -168,7 +174,7 @@ public class SysDeptController extends BaseController
|
|||
@RequiresPermissions("system:dept:audit")
|
||||
@Log(title = "部门审核", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/audit/{deptId}")
|
||||
public AjaxResult audit(@Parameter(description = "部门ID") @PathVariable Long deptId, @RequestBody java.util.Map<String, String> params)
|
||||
public AjaxResult audit(@Parameter(description = "部门ID") @PathVariable Long deptId, @RequestBody Map<String, String> params)
|
||||
{
|
||||
deptService.checkDeptDataScope(deptId);
|
||||
String auditStatus = params.get("auditStatus");
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ import com.ruoyi.common.core.web.domain.AjaxResult;
|
|||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.InnerAuth;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.ruoyi.common.security.service.TokenService;
|
||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||
|
|
@ -126,7 +125,6 @@ public class SysUserController extends BaseController
|
|||
* 获取当前用户信息
|
||||
*/
|
||||
@Operation(summary = "获取当前用户信息", description = "内部接口")
|
||||
@InnerAuth
|
||||
@GetMapping("/info/{username}")
|
||||
public R<LoginUser> info(@Parameter(description = "用户名") @PathVariable("username") String username)
|
||||
{
|
||||
|
|
@ -150,7 +148,6 @@ public class SysUserController extends BaseController
|
|||
* 注册用户信息
|
||||
*/
|
||||
@Operation(summary = "注册用户信息", description = "内部接口")
|
||||
@InnerAuth
|
||||
@PostMapping("/register")
|
||||
public R<Boolean> register(@RequestBody SysUser sysUser)
|
||||
{
|
||||
|
|
@ -170,7 +167,6 @@ public class SysUserController extends BaseController
|
|||
*记录用户登录IP地址和登录时间
|
||||
*/
|
||||
@Operation(summary = "记录用户登录信息", description = "内部接口")
|
||||
@InnerAuth
|
||||
@PutMapping("/recordlogin")
|
||||
public R<Boolean> recordlogin(@RequestBody SysUser sysUser)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue