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

首页业务调整

parent db61564e
...@@ -297,6 +297,7 @@ public class THazardWorkPlanCheckServiceImpl extends SuperServiceImpl<THazardWor ...@@ -297,6 +297,7 @@ public class THazardWorkPlanCheckServiceImpl extends SuperServiceImpl<THazardWor
tHazardWorkPlanCheckParam.setOrgId(user.getOrgId()); tHazardWorkPlanCheckParam.setOrgId(user.getOrgId());
//tHazardWorkPlanCheckParam.setOrgId("69223d5d1fa84ff29a0c11863d1b00b7"); //tHazardWorkPlanCheckParam.setOrgId("69223d5d1fa84ff29a0c11863d1b00b7");
HazardWorkPlanCheckStatsDTO hazardWorkPlanCheckStatsDTO = baseMapper.selectHazardWorkPlanCheckStats(tHazardWorkPlanCheckParam); HazardWorkPlanCheckStatsDTO hazardWorkPlanCheckStatsDTO = baseMapper.selectHazardWorkPlanCheckStats(tHazardWorkPlanCheckParam);
hazardWorkPlanCheckStatsDTO.setBasicUnitCount(hazardWorkPlanCheckStatsDTO.getComplianceBasicUnitCount().intValue() + hazardWorkPlanCheckStatsDTO.getNoComplianceBasicUnitCount().intValue());
// 计算合规比例(合规企业数/企业总数) // 计算合规比例(合规企业数/企业总数)
if (hazardWorkPlanCheckStatsDTO.getComplianceBasicUnitCount() != null && hazardWorkPlanCheckStatsDTO.getComplianceBasicUnitCount() > 0 if (hazardWorkPlanCheckStatsDTO.getComplianceBasicUnitCount() != null && hazardWorkPlanCheckStatsDTO.getComplianceBasicUnitCount() > 0
......
...@@ -225,6 +225,8 @@ public class TLeaseBankController extends SuperController { ...@@ -225,6 +225,8 @@ public class TLeaseBankController extends SuperController {
int year = calendar.get(Calendar.YEAR); int year = calendar.get(Calendar.YEAR);
// 获取当前传入orgid 的本下级 // 获取当前传入orgid 的本下级
List<String> orgs = getSubordinate(orgId); List<String> orgs = getSubordinate(orgId);
log.info("orgs:{}", orgId);
log.info("orgs:{}", orgs);
// 一般隐患 // 一般隐患
List<TSafeHazardOrg> generals = tSafeHazardOrgService.list(new QueryWrapper<TSafeHazardOrg>() List<TSafeHazardOrg> generals = tSafeHazardOrgService.list(new QueryWrapper<TSafeHazardOrg>()
.in("org_id", orgs) .in("org_id", orgs)
...@@ -239,10 +241,22 @@ public class TLeaseBankController extends SuperController { ...@@ -239,10 +241,22 @@ public class TLeaseBankController extends SuperController {
.like("create_date", year) .like("create_date", year)
.ne("status", BizConstants.STATUS_DELETE) .ne("status", BizConstants.STATUS_DELETE)
); );
//一般危险隐患
QueryWrapper<TSafeHazardOrg> generallyQueryWrapper = new QueryWrapper<TSafeHazardOrg>().in("org_id", orgs)
.ne("status", BizConstants.STATUS_DELETE).ne("process_status", 5).ne("process_status", 4)
.eq("\"level\"", 1).lt("create_date", year + "-01-01");
int generallyCount = tSafeHazardOrgService.count(generallyQueryWrapper);
//重大危险隐患
QueryWrapper<TSafeHazardOrg> majorQueryWrapper = new QueryWrapper<TSafeHazardOrg>().in("org_id", orgs)
.ne("status", BizConstants.STATUS_DELETE).ne("process_status", 5).ne("process_status", 4)
.eq("\"level\"", 2).lt("create_date", year + "-01-01");;
int majorCount = tSafeHazardOrgService.count(majorQueryWrapper);
// 一般隐患数量 // 一般隐患数量
int general = generals.size(); int general = generals.size()+generallyCount;
// 重大隐患数量 // 重大隐患数量
int great = greats.size(); int great = greats.size()+majorCount;
// 一般隐患数量 // 一般隐患数量
hiddenDanger.setGeneral(general); hiddenDanger.setGeneral(general);
// 重大隐患数量 // 重大隐患数量
......
...@@ -368,6 +368,7 @@ public class TJobStatisticsServiceImpl extends SuperServiceImpl<TJobStatisticsDa ...@@ -368,6 +368,7 @@ public class TJobStatisticsServiceImpl extends SuperServiceImpl<TJobStatisticsDa
List<String> orgIds = newSysOrgService.getOrgIdListByParentId(orgId); List<String> orgIds = newSysOrgService.getOrgIdListByParentId(orgId);
//如果没有下级查看当前单位数据 //如果没有下级查看当前单位数据
if (orgIds == null || orgIds.isEmpty()) { if (orgIds == null || orgIds.isEmpty()) {
log.info("(orgIds == null || orgIds.isEmpty()");
regionalStatisticsVOList = hazardWorkPlanDao.selectWorkTypeCount(tJobStatisticsParam); regionalStatisticsVOList = hazardWorkPlanDao.selectWorkTypeCount(tJobStatisticsParam);
hazardousWorkStatisticsVo.setCount(regionalStatisticsVOList.size()); hazardousWorkStatisticsVo.setCount(regionalStatisticsVOList.size());
}else { }else {
...@@ -381,10 +382,26 @@ public class TJobStatisticsServiceImpl extends SuperServiceImpl<TJobStatisticsDa ...@@ -381,10 +382,26 @@ public class TJobStatisticsServiceImpl extends SuperServiceImpl<TJobStatisticsDa
if(null != org){ if(null != org){
regionalStatisticsVO.setName(org.getOrgName()); regionalStatisticsVO.setName(org.getOrgName());
} }
log.info("tJobStatisticsParam------>"+tJobStatisticsParam);
List<RegionalStatisticsVO> regionalStatisticsVOS = hazardWorkPlanDao.selectOrgWorkPlanCount(tJobStatisticsParam); List<RegionalStatisticsVO> regionalStatisticsVOS = hazardWorkPlanDao.selectOrgWorkPlanCount(tJobStatisticsParam);
if(null != regionalStatisticsVOS && !regionalStatisticsVOS.isEmpty()){ if(null != regionalStatisticsVOS && !regionalStatisticsVOS.isEmpty()){
regionalStatisticsVO.setDone(regionalStatisticsVOS.get(0).getDone()); /*regionalStatisticsVO.setDone(regionalStatisticsVOS.get(0).getDone());
regionalStatisticsVO.setUndone(regionalStatisticsVOS.get(0).getUndone()); regionalStatisticsVO.setUndone(regionalStatisticsVOS.get(0).getUndone());*/
// 将字符串转换为整数后求和
int totalDone = regionalStatisticsVOS.stream()
.map(RegionalStatisticsVO::getDone)
.filter(done -> done != null && !done.trim().isEmpty()) // 过滤空值
.mapToInt(Integer::parseInt) // 字符串转整数
.sum();
int totalUndone = regionalStatisticsVOS.stream()
.map(RegionalStatisticsVO::getUndone)
.filter(undone -> undone != null && !undone.trim().isEmpty())
.mapToInt(Integer::parseInt)
.sum();
regionalStatisticsVO.setDone(String.valueOf(totalDone));
regionalStatisticsVO.setUndone(String.valueOf(totalUndone));
}else{ }else{
regionalStatisticsVO.setDone("0"); regionalStatisticsVO.setDone("0");
regionalStatisticsVO.setUndone("0"); regionalStatisticsVO.setUndone("0");
......
...@@ -71,6 +71,13 @@ public interface NewSysOrgService extends IService<NewSysOrg> { ...@@ -71,6 +71,13 @@ public interface NewSysOrgService extends IService<NewSysOrg> {
*/ */
List<String> getOrgIdListByParentId(String parentId); List<String> getOrgIdListByParentId(String parentId);
/**
* 获取下级单位id
* @param parentId
* @return
*/
List<String> getOrgIdListByParentIds(String parentId);
List<SysOrg> getOrgAllByLoginUser(); List<SysOrg> getOrgAllByLoginUser();
List<NewSysOrg> getChildrenDept(String orgId); List<NewSysOrg> getChildrenDept(String orgId);
......
...@@ -129,6 +129,15 @@ public class NewSysOrgServiceImpl extends SuperServiceImpl<NewSysOrgDao, NewSysO ...@@ -129,6 +129,15 @@ public class NewSysOrgServiceImpl extends SuperServiceImpl<NewSysOrgDao, NewSysO
return fullName.toString(); return fullName.toString();
} }
public List<NewSysOrg> getOrgListByParentIds(String parentId) {
QueryWrapper<NewSysOrg> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("status", "0")
.eq("is_dept", "0")
.eq("parent_ids", parentId).or().eq("org_id", parentId)
.orderByAsc("tree_level", "tree_sort");
return this.list(queryWrapper);
}
public List<NewSysOrg> getOrgListByParentId(String parentId) { public List<NewSysOrg> getOrgListByParentId(String parentId) {
QueryWrapper<NewSysOrg> queryWrapper = new QueryWrapper<>(); QueryWrapper<NewSysOrg> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("status", "0") queryWrapper.eq("status", "0")
...@@ -144,6 +153,11 @@ public class NewSysOrgServiceImpl extends SuperServiceImpl<NewSysOrgDao, NewSysO ...@@ -144,6 +153,11 @@ public class NewSysOrgServiceImpl extends SuperServiceImpl<NewSysOrgDao, NewSysO
return orgListByParentId.stream().map(NewSysOrg::getOrgId).collect(Collectors.toList()); return orgListByParentId.stream().map(NewSysOrg::getOrgId).collect(Collectors.toList());
} }
@Override
public List<String> getOrgIdListByParentIds(String parentId) {
List<NewSysOrg> orgListByParentId = getOrgListByParentIds(parentId);
return orgListByParentId.stream().map(NewSysOrg::getOrgId).collect(Collectors.toList());
}
public List<SysOrg> getOrgAllByLoginUser() { public List<SysOrg> getOrgAllByLoginUser() {
return this.sysOrgDao.getOrgAllByLoginUser(ContextUtils.getLoginUser().getParentIds(), ContextUtils.getLoginUser().getOrgId()); return this.sysOrgDao.getOrgAllByLoginUser(ContextUtils.getLoginUser().getParentIds(), ContextUtils.getLoginUser().getOrgId());
......
...@@ -306,13 +306,13 @@ ...@@ -306,13 +306,13 @@
SELECT SELECT
<!-- 企业总数(有检查记录的企业)--> <!-- 企业总数(有检查记录的企业)-->
(SELECT COUNT(DISTINCT basic_unit) <!--(SELECT COUNT(DISTINCT basic_unit)
FROM t_hazard_work_plan_check FROM t_hazard_work_plan_check
WHERE status = '0' WHERE status = '0'
AND check_status = '2' AND check_status = '2'
<include refid="orgIdFilter" /> <include refid="orgIdFilter" />
<include refid="checkTimeFilter" /> <include refid="checkTimeFilter" />
) AS basicUnitCount, ) AS basicUnitCount,-->
<!--- 合规企业数(C >= 95)--> <!--- 合规企业数(C >= 95)-->
SUM( SUM(
......
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