Commit b5117079 authored by 鲁鸿波's avatar 鲁鸿波

危险作业检查统计开发bug修改

危险作业实际开始时间bug修改
其它bug修改
parent 085c9877
......@@ -8,10 +8,13 @@ public class DangerousOperationValidator {
public enum OperationType {
HOT_WORK("动火作业"),
HEIGHT_WORK("高处作业"),
CONFINED_SPACE("有限空间"),
TEMP_ELECTRICITY("临时用电"),
CONFINED_SPACE("有限空间作业"),
TEMP_ELECTRICITY("临时用电作业"),
FUMIGATION("熏蒸作业"),
IN_OUT_WAREHOUSE("进出仓");
IN_WAREHOUSE("进仓作业"),
OUT_WAREHOUSE("出仓作业"),
FLAG_WAREHOUSE("平仓作业"),
IN_OUT_WAREHOUSE("进出仓作业");
private final String name;
OperationType(String name) {
......@@ -90,6 +93,27 @@ public class DangerousOperationValidator {
// 其他等级不设置限制
TIME_LIMITS.put(OperationType.FUMIGATION, fumigationMap);
// 进仓
Map<DangerLevel, Integer> inWarehouseMap = new HashMap<>();
inWarehouseMap.put(DangerLevel.HIGH, 12);
inWarehouseMap.put(DangerLevel.MEDIUM, 24);
inWarehouseMap.put(DangerLevel.LOW, 72);
TIME_LIMITS.put(OperationType.IN_WAREHOUSE, inWarehouseMap);
// 出仓
Map<DangerLevel, Integer> outWarehouseMap = new HashMap<>();
outWarehouseMap.put(DangerLevel.HIGH, 12);
outWarehouseMap.put(DangerLevel.MEDIUM, 24);
outWarehouseMap.put(DangerLevel.LOW, 72);
TIME_LIMITS.put(OperationType.OUT_WAREHOUSE, outWarehouseMap);
// 平仓
Map<DangerLevel, Integer> flagWarehouseMap = new HashMap<>();
flagWarehouseMap.put(DangerLevel.HIGH, 12);
flagWarehouseMap.put(DangerLevel.MEDIUM, 24);
flagWarehouseMap.put(DangerLevel.LOW, 72);
TIME_LIMITS.put(OperationType.FLAG_WAREHOUSE, flagWarehouseMap);
// 进出仓
Map<DangerLevel, Integer> inOutWarehouseMap = new HashMap<>();
inOutWarehouseMap.put(DangerLevel.HIGH, 12);
......
......@@ -20,6 +20,7 @@ import com.testor.module.contractor.manage.service.TContractorAllowService;
import com.testor.module.contractor.manage.service.TContractorBasicInfoService;
import com.testor.module.contractor.manage.service.TContractorPreparationService;
import com.testor.module.hazard.dao.TContractorAccessLogApprovalDao;
import com.testor.module.hazard.dao.TContractorAccessLogDao;
import com.testor.module.hazard.model.domain.TContractorAccessLogApproval;
import com.testor.module.hazard.service.TContractorAccessLogApprovalService;
import com.tongtech.tfw.backend.common.biz.constants.BizConstants;
......@@ -34,6 +35,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import com.tongtech.tfw.backend.common.models.supers.SuperServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
......@@ -69,6 +71,9 @@ public class TContractorAllowServiceImpl extends SuperServiceImpl<TContractorAll
@Autowired
private TContractorBasicInfoService tContractorBasicInfoService;
@Autowired
private TContractorAccessLogDao contractorAccessLogDao;
@Override
public Page<TContractorAllowDTO> pageList(TContractorAllowParam param) {
Long page=
......@@ -243,6 +248,7 @@ public class TContractorAllowServiceImpl extends SuperServiceImpl<TContractorAll
/**
* 删除准入管理数据并回退基本信息状态
*/
@Transactional
@Override
public void deleteAdmissionAndRollback(String allowId) throws BusinessException {
// 1. 查询准入管理数据
......@@ -259,6 +265,9 @@ public class TContractorAllowServiceImpl extends SuperServiceImpl<TContractorAll
// 3. 删除准入管理数据
this.removeById(allowId);
contractorAccessLogDao.updateStatus(allowId);
contractorAccessLogApprovalDao.updateStatus(allowId);
log.info("准入管理数据删除成功,业务ID: {}, 删除原因: {}", bizId);
}
......
......@@ -7,6 +7,7 @@ import com.tongtech.tfw.backend.common.models.supers.SuperDao;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.List;
......@@ -58,4 +59,7 @@ public interface TContractorAccessLogApprovalDao extends BaseMapper<TContractorA
*/
int updateApprovalStatus(@Param("ids") List<String> ids, @Param("approvalStatus") String approvalStatus);
@Update("update t_contractor_access_log_approval set status ='1' where contractor_allow_id = #{contractorAllowId}")
void updateStatus(@Param("contractorAllowId") String contractorAllowId);
}
......@@ -6,6 +6,7 @@ import com.tongtech.tfw.backend.common.models.supers.SuperDao;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
/**
* 承包商准入管理访问日志Mapper接口
......@@ -21,10 +22,14 @@ public interface TContractorAccessLogDao extends BaseMapper<TContractorAccessLog
* @param contractorAllowId
* @return
*/
@Select("select max(batch) from t_contractor_access_log\n" +
"where contractor_allow_id = #{contractorAllowId}")
@Select("SELECT MAX(CAST(batch AS INTEGER)) \n" +
"FROM t_contractor_access_log \n" +
"WHERE contractor_allow_id = #{contractorAllowId}")
String getMaxBatch(@Param("contractorAllowId") String contractorAllowId);
@Update("update t_contractor_access_log set status ='1' where contractor_allow_id = #{contractorAllowId}")
void updateStatus(@Param("contractorAllowId") String contractorAllowId);
......
......@@ -20,5 +20,5 @@ public interface THazardWorkPlanDao extends SuperDao<THazardWorkPlan>
IPage<TodoTask> selectToDoList(Page<TodoTask> resultPage,@Param("todo") TodoTaskSqlParam todoTaskSqlParam);
@Update("UPDATE t_hazard_work_plan SET actual_start_time = NOW() WHERE id = #{id}")
void updateActualStartTime(@Param("id") Long id);
void updateActualStartTime(@Param("id") String id);
}
......@@ -69,7 +69,7 @@ public class TContractorAccessLogServiceImpl extends SuperServiceImpl<TContracto
if (StringHelper.isNotEmpty(queryParam.getContractorAllowId())) {
queryWrapper.like("contractor_allow_id", queryParam.getContractorAllowId());
}
queryWrapper.orderByDesc("batch", "create_date");
queryWrapper.orderByDesc("create_date","batch" );
return queryWrapper;
}
}
......@@ -320,6 +320,21 @@ public class THazardWorkPlanCheckServiceImpl extends SuperServiceImpl<THazardWor
for (TSysOrg sysOrg:tSysOrgs){
hazardWorkPlanCheckEnterpriseComplianceDtos.add(new HazardWorkPlanCheckEnterpriseComplianceDto(sysOrg.getOrgName(),baseMapper.selectComplianceCount(tHazardWorkPlanCheckParam)));
}
// 按count倒序排序
hazardWorkPlanCheckEnterpriseComplianceDtos.sort((o1, o2) -> {
if (o1.getCount() == null && o2.getCount() == null) {
return 0;
}
if (o1.getCount() == null) {
return 1;
}
if (o2.getCount() == null) {
return -1;
}
return o2.getCount().compareTo(o1.getCount());
});
return hazardWorkPlanCheckEnterpriseComplianceDtos;
}
......
......@@ -552,7 +552,7 @@ public class THazardWorkPlanServiceImpl extends SuperServiceImpl<THazardWorkPlan
if (WorkPlanStatusEnum.PERMIT.getValue().equals(workStatus) || "99".equals(workStatus)) {
//更新实际开始时间
if (null != id) {
tHazardWorkPlanDao.updateActualStartTime(Long.parseLong(id));
tHazardWorkPlanDao.updateActualStartTime(id);
}
SysDictData escalatedLevel = sysDictDataService.getDictTypeDetail(tHazardWorkPlan.getEscalatedLevel(), null, null);
String escalatedLevelValue = escalatedLevel.getDictKey();
......@@ -833,6 +833,19 @@ public class THazardWorkPlanServiceImpl extends SuperServiceImpl<THazardWorkPlan
@Override
public String validateOperation(String workType, String workLevel, String scheduledStartTime, String scheduledEndTime) {
/*中粮/北良规则如下
动火作业高度危险: 8小时内
动火作业较大危险: 12小时内
动火作业一般危险: 72小时内
高处作业高度危险: 12小时内
高处作业较大危险: 24小时内
高处作业一般危险: 7天内
有限空间高度/较大/一般危险: 8小时内
临时用电高度/较大/一般危险: 8小时内
熏蒸作业高度: 7天内
进出仓高度危险作业: 12小时内
进出仓较大危险作业: 24小时内
进出仓一般危险作业: 72小时内*/
SysDictData workTypeDictData = sysDictDataService.getDictDataById(workType);
SysDictData workLevelDictData = sysDictDataService.getDictDataById(workLevel);
String result = "在安全时间内";
......@@ -1180,7 +1193,9 @@ public class THazardWorkPlanServiceImpl extends SuperServiceImpl<THazardWorkPlan
//关闭主流程数据
try {
//runtimeService.deleteProcessInstance(byId.getProcessId(), opinion);
ruTaskService.stopProcess(byId.getProcessId());
if(byId.getProcessId() != null){
ruTaskService.stopProcess(byId.getProcessId());
}
}catch (FlowableObjectNotFoundException e) {
log.error(e.getMessage());
}
......
......@@ -386,7 +386,6 @@
WHEN COUNT(*) = 0 THEN 0
ELSE (SUM(CASE WHEN is_compliant = '1' THEN 1 ELSE 0 END) * 100.0 / COUNT(*))
END <![CDATA[ >= ]]> 95
order by complianceRate desc
) AS compliant_enterprises
</select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment