|
|
@ -1,6 +1,8 @@ |
|
|
|
package com.hnac.hzims.safeproduct.risk.service.impl; |
|
|
|
package com.hnac.hzims.safeproduct.risk.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.hnac.hzims.safeproduct.risk.entity.Correlation; |
|
|
|
import com.hnac.hzims.safeproduct.risk.entity.Correlation; |
|
|
|
import com.hnac.hzims.safeproduct.risk.entity.HazardCategory; |
|
|
|
import com.hnac.hzims.safeproduct.risk.entity.HazardCategory; |
|
|
|
import com.hnac.hzims.safeproduct.risk.entity.HazardSource; |
|
|
|
import com.hnac.hzims.safeproduct.risk.entity.HazardSource; |
|
|
@ -10,18 +12,23 @@ import com.hnac.hzims.safeproduct.risk.service.CorrelationService; |
|
|
|
import com.hnac.hzims.safeproduct.risk.service.HazardCategoryService; |
|
|
|
import com.hnac.hzims.safeproduct.risk.service.HazardCategoryService; |
|
|
|
import com.hnac.hzims.safeproduct.risk.service.HazardSourceService; |
|
|
|
import com.hnac.hzims.safeproduct.risk.service.HazardSourceService; |
|
|
|
import com.hnac.hzims.safeproduct.risk.service.HazardWorkService; |
|
|
|
import com.hnac.hzims.safeproduct.risk.service.HazardWorkService; |
|
|
|
|
|
|
|
import com.hnac.hzims.safeproduct.risk.vo.HazardWorkVO; |
|
|
|
import com.hnac.hzims.safeproduct.risk.vo.PersonalCheckItemVO; |
|
|
|
import com.hnac.hzims.safeproduct.risk.vo.PersonalCheckItemVO; |
|
|
|
import com.hnac.hzims.safeproduct.risk.vo.StationRiskLevelVo; |
|
|
|
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
|
|
|
|
import org.springblade.core.mp.support.Condition; |
|
|
|
|
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.utils.BeanUtil; |
|
|
|
import org.springblade.core.tool.utils.BeanUtil; |
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
import org.springblade.system.user.cache.UserCache; |
|
|
|
import org.springblade.system.user.cache.UserCache; |
|
|
|
import org.springblade.system.user.entity.User; |
|
|
|
import org.springblade.system.user.entity.User; |
|
|
|
|
|
|
|
import org.springblade.system.user.feign.IUserClient; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Optional; |
|
|
|
import java.util.Optional; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Collectors; |
|
|
@ -38,6 +45,8 @@ public class HazardWorkServiceImpl extends BaseServiceImpl<HazardWorkMapper, Haz |
|
|
|
private final HazardSourceService hazardSourceService; |
|
|
|
private final HazardSourceService hazardSourceService; |
|
|
|
private final HazardCategoryService hazardCategoryService; |
|
|
|
private final HazardCategoryService hazardCategoryService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final IUserClient userClient; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 作业区域删除 |
|
|
|
* 作业区域删除 |
|
|
|
* @param workIds |
|
|
|
* @param workIds |
|
|
@ -79,4 +88,40 @@ public class HazardWorkServiceImpl extends BaseServiceImpl<HazardWorkMapper, Haz |
|
|
|
}); |
|
|
|
}); |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 查询作业区域页面数据 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public IPage<HazardWorkVO> getHazardWorkPage(HazardWork entity, Query query) { |
|
|
|
|
|
|
|
IPage<HazardWork> hazardWorkPage = this.page(Condition.getPage(query), Condition.getQueryWrapper(entity)); |
|
|
|
|
|
|
|
List<HazardWork> records = hazardWorkPage.getRecords(); |
|
|
|
|
|
|
|
List<HazardWorkVO> res = new ArrayList<>(); |
|
|
|
|
|
|
|
// 遍历获取负责人和分管领导名称
|
|
|
|
|
|
|
|
for (HazardWork record : records) { |
|
|
|
|
|
|
|
HazardWorkVO hazardWorkVO = new HazardWorkVO(); |
|
|
|
|
|
|
|
BeanUtil.copyProperties(record, hazardWorkVO); |
|
|
|
|
|
|
|
Long headId = record.getHead(); |
|
|
|
|
|
|
|
if (headId != null) { |
|
|
|
|
|
|
|
R<User> header = userClient.userInfoById(headId); |
|
|
|
|
|
|
|
if (header.isSuccess()) { |
|
|
|
|
|
|
|
hazardWorkVO.setHeadName(header.getData().getRealName()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Long manageId = record.getManage(); |
|
|
|
|
|
|
|
if (manageId != null) { |
|
|
|
|
|
|
|
R<User> manager = userClient.userInfoById(headId); |
|
|
|
|
|
|
|
if (manager.isSuccess()) { |
|
|
|
|
|
|
|
hazardWorkVO.setManagerName(manager.getData().getRealName()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
res.add(hazardWorkVO); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 分页
|
|
|
|
|
|
|
|
IPage<HazardWorkVO> page = new Page<>(query.getCurrent(), query.getSize()); |
|
|
|
|
|
|
|
page.setRecords(res); |
|
|
|
|
|
|
|
page.setTotal(hazardWorkPage.getTotal()); |
|
|
|
|
|
|
|
page.setPages(hazardWorkPage.getPages()); |
|
|
|
|
|
|
|
return page; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|