包头首页概览

This commit is contained in:
guoshengxiong 2024-10-25 19:10:24 +08:00
parent 769659f88d
commit 4fd1a95e65
11 changed files with 178 additions and 6 deletions

View File

@ -0,0 +1,51 @@
package com.zhgd.xmgl.modules.baotou.controller;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.xmgl.modules.baotou.entity.ProjectGroup;
import com.zhgd.xmgl.modules.baotou.entity.vo.CountEnterpriseVo;
import com.zhgd.xmgl.modules.baotou.entity.vo.EnterpriseListVo;
import com.zhgd.xmgl.modules.baotou.service.IProjectGroupService;
import com.zhgd.xmgl.modules.baotou.service.impl.ProjectGroupServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.HashMap;
import java.util.List;
@RestController
@RequestMapping("/xmgl/homeOverview")
@Slf4j
@Api(tags = "首页概览")
public class HomeOverviewController {
@Autowired
private IProjectGroupService projectGroupService;
@ApiOperation(value = "施工队伍单位统计", notes = "施工队伍单位统计", httpMethod = "GET")
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String")
@GetMapping(value = "/countEnterprise")
public Result<CountEnterpriseVo> countEnterprise(@ApiIgnore @RequestParam HashMap<String, Object> param) {
return Result.success(projectGroupService.countEnterprise(param));
}
@ApiOperation(value = "施工队伍单位列表", notes = "施工队伍单位列表", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "type", value = "1监理2epc3施工", paramType = "body", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "enterpriseName", value = "单位名称", paramType = "body", required = true, dataType = "Integer"),
})
@GetMapping(value = "/getEnterpriseList")
public Result<List<EnterpriseListVo>> getEnterpriseList(@ApiIgnore @RequestParam HashMap<String, Object> param) {
return Result.success(projectGroupService.getEnterpriseList(param));
}
}

View File

@ -0,0 +1,10 @@
package com.zhgd.xmgl.modules.baotou.entity.vo;
import lombok.Data;
@Data
public class CountEnterpriseVo {
private Integer epc;
private Integer supervise;
private Integer construction;
}

View File

@ -0,0 +1,11 @@
package com.zhgd.xmgl.modules.baotou.entity.vo;
import lombok.Data;
@Data
public class EnterpriseListVo {
private String epc;
private String supervise;
private String construction;
private Integer num;
}

View File

@ -1,11 +1,14 @@
package com.zhgd.xmgl.modules.baotou.mapper;
import java.util.HashMap;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhgd.xmgl.modules.baotou.entity.vo.CountEnterpriseVo;
import com.zhgd.xmgl.modules.baotou.entity.vo.EnterpriseListVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.zhgd.xmgl.modules.baotou.entity.ProjectGroup;
@ -24,4 +27,7 @@ public interface ProjectGroupMapper extends BaseMapper<ProjectGroup> {
List<ProjectGroup> queryList(@Param(Constants.WRAPPER)QueryWrapper<ProjectGroup> queryWrapper);
CountEnterpriseVo countEnterprise(HashMap<String, Object> param);
List<EnterpriseListVo> getEnterpriseList(HashMap<String, Object> param);
}

View File

@ -16,5 +16,54 @@
group by t.id
order by t.create_date desc
</select>
<select id="countEnterprise" resultType="com.zhgd.xmgl.modules.baotou.entity.vo.CountEnterpriseVo">
select
count(distinct ei.id) as epc,
count(distinct ei2.id) as supervise,
count(distinct ei3.id) as construction
from project_group t
join project_group_unit pgu on t.id = pgu.project_group_id
join enterprise_info ei on ei.id=pgu.epc_contractor_id
join enterprise_info ei2 on ei2.id=pgu.supervising_unit_id
join enterprise_info ei3 on find_in_set(ei3.id,pgu.construction_unit_ids)
where t.project_sn=#{projectSn}
</select>
<select id="getEnterpriseList" resultType="com.zhgd.xmgl.modules.baotou.entity.vo.EnterpriseListVo">
select
ei.enterprise_name
<if test="type == '1'.toString() ">
as supervise,
group_concat(distinct ei1.enterprise_name) as epc
</if>
<if test="type == '2'.toString() ">
as epc,
group_concat(distinct ei1.enterprise_name) as construction
</if>
<if test="type == '3'.toString() ">
as construction
</if>
,
count(distinct wi.id) as num
from project_group t
join project_group_unit pgu on t.id = pgu.project_group_id
left join enterprise_info ei
<if test="type == '1'.toString() ">
on ei.id=pgu.supervising_unit_id
left join enterprise_info ei1 on ei1.id=pgu.epc_contractor_id
</if>
<if test="type == '2'.toString() ">
on ei.id= pgu.epc_contractor_id
left join enterprise_info ei1 on find_in_set(ei1.id,pgu.construction_unit_ids)
</if>
<if test="type == '3'.toString() ">
on find_in_set(ei.id,pgu.construction_unit_ids)
</if>
left join worker_info wi on ei.id = wi.enterprise_id and wi.inService_type = 1
where t.project_sn = #{projectSn}
<if test="enterpriseName != null and enterpriseName != ''">
and ei.enterprise_name like concat('%', #{enterpriseName}, '%')
</if>
group by ei.id
</select>
</mapper>

View File

@ -93,7 +93,7 @@
#{inspectTime_end})
</if>
group by r.epc_contractor_id)t on ei.id=t.epc_contractor_id
where pe.project_sn = #{projectSn}
where pe.project_sn = #{projectSn} and pe.enterprise_type_id = 3
order by y desc
</select>

View File

@ -1096,7 +1096,7 @@
#{inspectTime_end})
</if>
group by r.epc_contractor_id)t on ei.id=t.epc_contractor_id
where pe.project_sn = #{projectSn}
where pe.project_sn = #{projectSn} and pe.enterprise_type_id = 3
order by y desc
</select>

View File

@ -3,6 +3,8 @@ package com.zhgd.xmgl.modules.baotou.service;
import com.zhgd.xmgl.modules.baotou.entity.ProjectGroup;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhgd.xmgl.modules.baotou.entity.vo.CountEnterpriseVo;
import com.zhgd.xmgl.modules.baotou.entity.vo.EnterpriseListVo;
import com.zhgd.xmgl.modules.baotou.entity.vo.ProjectGroupEnterpriseVo;
import java.util.HashMap;
@ -55,4 +57,8 @@ public interface IProjectGroupService extends IService<ProjectGroup> {
void saveObj(ProjectGroup projectGroup);
ProjectGroupEnterpriseVo getProjectGroupEnterpriseList(HashMap<String, Object> param);
CountEnterpriseVo countEnterprise(HashMap<String, Object> param);
List<EnterpriseListVo> getEnterpriseList(HashMap<String, Object> param);
}

View File

@ -13,6 +13,8 @@ import com.zhgd.redis.lock.redisson.DistributedLock;
import com.zhgd.xmgl.modules.baotou.entity.DeviceUnit;
import com.zhgd.xmgl.modules.baotou.entity.ProjectGroup;
import com.zhgd.xmgl.modules.baotou.entity.ProjectGroupUnit;
import com.zhgd.xmgl.modules.baotou.entity.vo.CountEnterpriseVo;
import com.zhgd.xmgl.modules.baotou.entity.vo.EnterpriseListVo;
import com.zhgd.xmgl.modules.baotou.entity.vo.ProjectGroupEnterpriseVo;
import com.zhgd.xmgl.modules.baotou.mapper.DeviceUnitMapper;
import com.zhgd.xmgl.modules.baotou.mapper.ProjectGroupMapper;
@ -183,4 +185,14 @@ public class ProjectGroupServiceImpl extends ServiceImpl<ProjectGroupMapper, Pro
return vo;
}
@Override
public CountEnterpriseVo countEnterprise(HashMap<String, Object> param) {
return baseMapper.countEnterprise(param);
}
@Override
public List<EnterpriseListVo> getEnterpriseList(HashMap<String, Object> param) {
return baseMapper.getEnterpriseList(param);
}
}

View File

@ -312,7 +312,7 @@
IFNULL(sum((CASE WHEN w1.sex = 2 and (w1.person_type = 1 or w1.person_type = 2) then 1 ELSE 0 END)), 0)
woman_person_total,
IFNULL(sum((CASE WHEN g.special_team = 1 then 1 ELSE 0 END)), 0) special_person_total,
IFNULL(sum((CASE WHEN ba.id is not null then 1 ELSE 0 END)), 0) blacklist_person_total,
ba.blacklist_person_total,
IFNULL(sum(a.sale_acreage), 0) total_sale_acreage,
IFNULL(sum((CASE
WHEN IFNULL(w1.special_certificate_number, '') != '' or
@ -350,7 +350,34 @@
LEFT JOIN dictionaries_record w3 ON w1.job_name = w3.id
Left JOIN company f ON b.parent_id = f.company_id
Left JOIN team_info g ON w1.team_id = g.id
Left JOIN worker_blacklist ba ON w1.id = ba.worker_id
Left JOIN (
select wb.worker_id,
count(*) as blacklist_person_total
from worker_blacklist wb
join worker_info w1 on w1.id=wb.worker_id
INNER JOIN project a ON w1.project_sn = a.project_sn
INNER JOIN company cp ON a.company_sn = cp.company_sn
INNER JOIN company b ON cp.parent_id = b.company_id
Left JOIN company f ON b.parent_id = f.company_id
Left JOIN team_info g ON w1.team_id = g.id
where 1=1
<if test="companyType == '1'.toString()">
and f.headquarters_sn = #{sn}
</if>
<if test="companyType == '2'.toString()">
and f.company_sn = #{sn}
</if>
<if test="companyType == '3'.toString()">
and b.company_sn = #{sn}
</if>
<if test="companyType == '4'.toString()">
and w1.project_sn = #{sn}
</if>
<if test="companyType == '5'.toString()">
and cp.company_sn = #{sn}
</if>
group by wb.worker_id
) ba ON w1.id = ba.worker_id
LEFT JOIN (SELECT wi.id, count(*) num
FROM worker_certificate wc,
worker_info wi

View File

@ -168,9 +168,9 @@ is-license=false
#天气url
tianqiUrl=http://v1.yiketianqi.com
#天气appid
tianqiAppid=37328925
tianqiAppid=98454448
#天气appsecret
tianqiAppsecret=uu9bihuE
tianqiAppsecret=ZIycjw4u
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.time-zone=GMT+8
#邮箱配置