From 4fd1a95e6589d86dc2d6b9fd174cebdebab49ca4 Mon Sep 17 00:00:00 2001 From: guoshengxiong <1923636941@qq.com> Date: Fri, 25 Oct 2024 19:10:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=85=E5=A4=B4=E9=A6=96=E9=A1=B5=E6=A6=82?= =?UTF-8?q?=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/HomeOverviewController.java | 51 +++++++++++++++++++ .../baotou/entity/vo/CountEnterpriseVo.java | 10 ++++ .../baotou/entity/vo/EnterpriseListVo.java | 11 ++++ .../baotou/mapper/ProjectGroupMapper.java | 6 +++ .../baotou/mapper/xml/ProjectGroupMapper.xml | 49 ++++++++++++++++++ .../mapper/xml/QualityProblemMapper.xml | 2 +- ...zSecurityQualityInspectionRecordMapper.xml | 2 +- .../baotou/service/IProjectGroupService.java | 6 +++ .../service/impl/ProjectGroupServiceImpl.java | 12 +++++ .../worker/mapper/xml/WorkerInfoMapper.xml | 31 ++++++++++- src/main/resources/application.properties | 4 +- 11 files changed, 178 insertions(+), 6 deletions(-) create mode 100644 src/main/java/com/zhgd/xmgl/modules/baotou/controller/HomeOverviewController.java create mode 100644 src/main/java/com/zhgd/xmgl/modules/baotou/entity/vo/CountEnterpriseVo.java create mode 100644 src/main/java/com/zhgd/xmgl/modules/baotou/entity/vo/EnterpriseListVo.java diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/controller/HomeOverviewController.java b/src/main/java/com/zhgd/xmgl/modules/baotou/controller/HomeOverviewController.java new file mode 100644 index 000000000..bbeb37c10 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/controller/HomeOverviewController.java @@ -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 countEnterprise(@ApiIgnore @RequestParam HashMap 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> getEnterpriseList(@ApiIgnore @RequestParam HashMap param) { + return Result.success(projectGroupService.getEnterpriseList(param)); + } + +} diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/entity/vo/CountEnterpriseVo.java b/src/main/java/com/zhgd/xmgl/modules/baotou/entity/vo/CountEnterpriseVo.java new file mode 100644 index 000000000..608b70f7c --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/entity/vo/CountEnterpriseVo.java @@ -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; +} diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/entity/vo/EnterpriseListVo.java b/src/main/java/com/zhgd/xmgl/modules/baotou/entity/vo/EnterpriseListVo.java new file mode 100644 index 000000000..968a34ed5 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/entity/vo/EnterpriseListVo.java @@ -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; +} diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/ProjectGroupMapper.java b/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/ProjectGroupMapper.java index fbe47593e..41f51fe85 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/ProjectGroupMapper.java +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/ProjectGroupMapper.java @@ -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 { List queryList(@Param(Constants.WRAPPER)QueryWrapper queryWrapper); + CountEnterpriseVo countEnterprise(HashMap param); + + List getEnterpriseList(HashMap param); } diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/ProjectGroupMapper.xml b/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/ProjectGroupMapper.xml index 4d05bcbee..2236d7a08 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/ProjectGroupMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/ProjectGroupMapper.xml @@ -16,5 +16,54 @@ group by t.id order by t.create_date desc + + diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/QualityProblemMapper.xml b/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/QualityProblemMapper.xml index c88f7f014..4ab13e0c1 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/QualityProblemMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/QualityProblemMapper.xml @@ -93,7 +93,7 @@ #{inspectTime_end}) 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 diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/security/mapper/xml/XzSecurityQualityInspectionRecordMapper.xml b/src/main/java/com/zhgd/xmgl/modules/baotou/security/mapper/xml/XzSecurityQualityInspectionRecordMapper.xml index e1924dad3..1679ea115 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/security/mapper/xml/XzSecurityQualityInspectionRecordMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/security/mapper/xml/XzSecurityQualityInspectionRecordMapper.xml @@ -1096,7 +1096,7 @@ #{inspectTime_end}) 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 diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/service/IProjectGroupService.java b/src/main/java/com/zhgd/xmgl/modules/baotou/service/IProjectGroupService.java index 6f257b1ae..160401849 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/service/IProjectGroupService.java +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/service/IProjectGroupService.java @@ -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 { void saveObj(ProjectGroup projectGroup); ProjectGroupEnterpriseVo getProjectGroupEnterpriseList(HashMap param); + + CountEnterpriseVo countEnterprise(HashMap param); + + List getEnterpriseList(HashMap param); } diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/service/impl/ProjectGroupServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/baotou/service/impl/ProjectGroupServiceImpl.java index 35299400b..4ad4b750a 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/service/impl/ProjectGroupServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/service/impl/ProjectGroupServiceImpl.java @@ -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 param) { + return baseMapper.countEnterprise(param); + } + + @Override + public List getEnterpriseList(HashMap param) { + return baseMapper.getEnterpriseList(param); + } + } diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/WorkerInfoMapper.xml b/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/WorkerInfoMapper.xml index 7d68a2099..7952c9b49 100644 --- a/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/WorkerInfoMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/WorkerInfoMapper.xml @@ -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 + + and f.headquarters_sn = #{sn} + + + and f.company_sn = #{sn} + + + and b.company_sn = #{sn} + + + and w1.project_sn = #{sn} + + + and cp.company_sn = #{sn} + + 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 diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index ea2829f9a..1769f2d8a 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -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 #邮箱配置