From ff43ac9ec3847f7b0f83f24f9b70b56e4647d125 Mon Sep 17 00:00:00 2001 From: guo Date: Sat, 15 Jul 2023 16:45:55 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AlarmsDistinguishedNumberByAlarmType.java | 9 ++ .../service/impl/LifterAlarmServiceImpl.java | 108 +++++++++--------- .../service/impl/TowerAlarmServiceImpl.java | 62 +++++----- .../SjSafeEnvironmentFileServiceImpl.java | 2 +- .../controller/WorkerInfoController.java | 2 +- .../entity/vo/ProjectWorkerStatisticsVo.java | 91 +++++++++++++++ .../xml/WorkerSafeEducationWorkerMapper.xml | 29 +++-- .../worker/service/IWorkerInfoService.java | 2 +- .../service/impl/WorkerInfoServiceImpl.java | 5 +- .../impl/WorkerSafeEducationServiceImpl.java | 10 ++ 10 files changed, 225 insertions(+), 95 deletions(-) create mode 100644 src/main/java/com/zhgd/xmgl/modules/worker/entity/vo/ProjectWorkerStatisticsVo.java diff --git a/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/vo/AlarmsDistinguishedNumberByAlarmType.java b/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/vo/AlarmsDistinguishedNumberByAlarmType.java index a61eee75a..fc64eec74 100644 --- a/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/vo/AlarmsDistinguishedNumberByAlarmType.java +++ b/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/vo/AlarmsDistinguishedNumberByAlarmType.java @@ -1,6 +1,7 @@ package com.zhgd.xmgl.modules.bigdevice.entity.vo; import io.swagger.annotations.ApiModelProperty; +import lombok.Builder; import lombok.Data; import java.util.List; @@ -40,7 +41,15 @@ public class AlarmsDistinguishedNumberByAlarmType { "fallAlarm>防坠器报警 0:正常 1:报警\n" + "bottomAlarm>下限位报警 0:正常 1:报警") private String type; + private String typeName; @ApiModelProperty(value = "报警数量") private Integer num; + + public TypeNum() { + } + + public TypeNum(String typeName) { + this.typeName = typeName; + } } } diff --git a/src/main/java/com/zhgd/xmgl/modules/bigdevice/service/impl/LifterAlarmServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/bigdevice/service/impl/LifterAlarmServiceImpl.java index 6b93388aa..3228c2283 100644 --- a/src/main/java/com/zhgd/xmgl/modules/bigdevice/service/impl/LifterAlarmServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/bigdevice/service/impl/LifterAlarmServiceImpl.java @@ -208,13 +208,14 @@ public class LifterAlarmServiceImpl extends ServiceImpl lifterAlarms = lifterAlarmMapper.queryAlarmsByTime(map); - Map countTowerAlarmByTypeMap = countLifterAlarmByType(lifterAlarms); + Map countTowerAlarmByTypeMap = countLifterAlarmByType(lifterAlarms); List typeNums = new ArrayList<>(); Integer alarmCount = 0; - for (Map.Entry entry : countTowerAlarmByTypeMap.entrySet()) { + for (Map.Entry entry : countTowerAlarmByTypeMap.entrySet()) { AlarmsDistinguishedNumberByAlarmType.TypeNum typeNum = new AlarmsDistinguishedNumberByAlarmType.TypeNum(); - Integer value = entry.getValue(); + Integer value = entry.getValue().getNum(); typeNum.setType(entry.getKey()); + typeNum.setTypeName(entry.getValue().getTypeName()); typeNum.setNum(value); typeNums.add(typeNum); alarmCount += value; @@ -230,85 +231,90 @@ public class LifterAlarmServiceImpl extends ServiceImpl countLifterAlarmByType(List lifterAlarms) { - Map typeNumMap = new HashMap<>(); - typeNumMap.put(ReflectionUtil.getFieldName(LifterAlarm::getPeopleCntAlarm), 0); - typeNumMap.put(ReflectionUtil.getFieldName(LifterAlarm::getWeightAlarm), 0); - typeNumMap.put(ReflectionUtil.getFieldName(LifterAlarm::getSpeedAlarm), 0); - typeNumMap.put(ReflectionUtil.getFieldName(LifterAlarm::getHeightAlarm), 0); - typeNumMap.put(ReflectionUtil.getFieldName(LifterAlarm::getObliguityXAlarm), 0); - typeNumMap.put(ReflectionUtil.getFieldName(LifterAlarm::getObliguityYAlarm), 0); - typeNumMap.put(ReflectionUtil.getFieldName(LifterAlarm::getWindSpeedAlarm), 0); - typeNumMap.put(ReflectionUtil.getFieldName(LifterAlarm::getMotor1Alarm), 0); - typeNumMap.put(ReflectionUtil.getFieldName(LifterAlarm::getMotor2Alarm), 0); - typeNumMap.put(ReflectionUtil.getFieldName(LifterAlarm::getMotor3Alarm), 0); - typeNumMap.put(ReflectionUtil.getFieldName(LifterAlarm::getTopAlarm), 0); - typeNumMap.put(ReflectionUtil.getFieldName(LifterAlarm::getFallAlarm), 0); - typeNumMap.put(ReflectionUtil.getFieldName(LifterAlarm::getBottomAlarm), 0); + private Map countLifterAlarmByType(List lifterAlarms) { + Map typeNumMap = new HashMap<>(); + typeNumMap.put(ReflectionUtil.getFieldName(LifterAlarm::getPeopleCntAlarm), getNewTypeNum("人数报警")); + typeNumMap.put(ReflectionUtil.getFieldName(LifterAlarm::getWeightAlarm), getNewTypeNum("载重报警")); + typeNumMap.put(ReflectionUtil.getFieldName(LifterAlarm::getSpeedAlarm), getNewTypeNum("速度报警")); + typeNumMap.put(ReflectionUtil.getFieldName(LifterAlarm::getHeightAlarm), getNewTypeNum("高度报警")); + typeNumMap.put(ReflectionUtil.getFieldName(LifterAlarm::getObliguityXAlarm), getNewTypeNum("倾角X报警")); + typeNumMap.put(ReflectionUtil.getFieldName(LifterAlarm::getObliguityYAlarm), getNewTypeNum("倾角Y报警")); + typeNumMap.put(ReflectionUtil.getFieldName(LifterAlarm::getWindSpeedAlarm), getNewTypeNum("风速报警")); + typeNumMap.put(ReflectionUtil.getFieldName(LifterAlarm::getMotor1Alarm), getNewTypeNum("1号电机报警")); + typeNumMap.put(ReflectionUtil.getFieldName(LifterAlarm::getMotor2Alarm), getNewTypeNum("2号电机报警")); + typeNumMap.put(ReflectionUtil.getFieldName(LifterAlarm::getMotor3Alarm), getNewTypeNum("3号电机报警")); + typeNumMap.put(ReflectionUtil.getFieldName(LifterAlarm::getTopAlarm), getNewTypeNum("防冲顶报警")); + typeNumMap.put(ReflectionUtil.getFieldName(LifterAlarm::getFallAlarm), getNewTypeNum("防坠器报警")); + typeNumMap.put(ReflectionUtil.getFieldName(LifterAlarm::getBottomAlarm), getNewTypeNum("下限位报警")); for (LifterAlarm lifterAlarm : lifterAlarms) { + String fieldName = null; if (Objects.equals(lifterAlarm.getPeopleCntAlarm(), 1)) { - String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getPeopleCntAlarm); - typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1); + fieldName = ReflectionUtil.getFieldName(LifterAlarm::getPeopleCntAlarm); + setTypeNum(typeNumMap, fieldName); } if (Objects.equals(lifterAlarm.getWeightAlarm(), 1)) { - String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getWeightAlarm); - typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1); + fieldName = ReflectionUtil.getFieldName(LifterAlarm::getWeightAlarm); + setTypeNum(typeNumMap, fieldName); } if (Objects.equals(lifterAlarm.getSpeedAlarm(), 1)) { - String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getSpeedAlarm); - typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1); + fieldName = ReflectionUtil.getFieldName(LifterAlarm::getSpeedAlarm); + setTypeNum(typeNumMap, fieldName); } if (Objects.equals(lifterAlarm.getHeightAlarm(), 1)) { - String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getHeightAlarm); - typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1); + fieldName = ReflectionUtil.getFieldName(LifterAlarm::getHeightAlarm); + setTypeNum(typeNumMap, fieldName); } if (Objects.equals(lifterAlarm.getObliguityXAlarm(), 1)) { - String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getObliguityXAlarm); - typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1); + fieldName = ReflectionUtil.getFieldName(LifterAlarm::getObliguityXAlarm); + setTypeNum(typeNumMap, fieldName); } if (Objects.equals(lifterAlarm.getObliguityYAlarm(), 1)) { - String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getObliguityYAlarm); - typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1); + fieldName = ReflectionUtil.getFieldName(LifterAlarm::getObliguityYAlarm); + setTypeNum(typeNumMap, fieldName); } if (Objects.equals(lifterAlarm.getWindSpeedAlarm(), 1)) { - String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getWindSpeedAlarm); - typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1); + fieldName = ReflectionUtil.getFieldName(LifterAlarm::getWindSpeedAlarm); + setTypeNum(typeNumMap, fieldName); } if (Objects.equals(lifterAlarm.getMotor1Alarm(), 1)) { - String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getMotor1Alarm); - typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1); + fieldName = ReflectionUtil.getFieldName(LifterAlarm::getMotor1Alarm); + setTypeNum(typeNumMap, fieldName); } if (Objects.equals(lifterAlarm.getMotor2Alarm(), 1)) { - String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getMotor2Alarm); - typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1); + fieldName = ReflectionUtil.getFieldName(LifterAlarm::getMotor2Alarm); + setTypeNum(typeNumMap, fieldName); } if (Objects.equals(lifterAlarm.getMotor3Alarm(), 1)) { - String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getMotor3Alarm); - typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1); + fieldName = ReflectionUtil.getFieldName(LifterAlarm::getMotor3Alarm); + setTypeNum(typeNumMap, fieldName); } if (Objects.equals(lifterAlarm.getTopAlarm(), 1)) { - String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getTopAlarm); - typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1); + fieldName = ReflectionUtil.getFieldName(LifterAlarm::getTopAlarm); + setTypeNum(typeNumMap, fieldName); } if (Objects.equals(lifterAlarm.getFallAlarm(), 1)) { - String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getFallAlarm); - typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1); + fieldName = ReflectionUtil.getFieldName(LifterAlarm::getFallAlarm); + setTypeNum(typeNumMap, fieldName); } if (Objects.equals(lifterAlarm.getBottomAlarm(), 1)) { - String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getBottomAlarm); - typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1); + fieldName = ReflectionUtil.getFieldName(LifterAlarm::getBottomAlarm); + setTypeNum(typeNumMap, fieldName); } } return typeNumMap; } - private void addLifterAlarmCountByType(Map typeNumMap, String fieldName) { - Integer integer = typeNumMap.get(fieldName); - if (integer != null) { - integer += 1; - } else { - integer = 1; + public void setTypeNum(Map typeNumMap, String fieldName) { + AlarmsDistinguishedNumberByAlarmType.TypeNum typeNum = typeNumMap.get(fieldName); + if (typeNum != null) { + typeNum.setNum(typeNum.getNum() + 1); } - typeNumMap.put(fieldName, integer); } + + public AlarmsDistinguishedNumberByAlarmType.TypeNum getNewTypeNum(String typeName) { + AlarmsDistinguishedNumberByAlarmType.TypeNum typeNum = new AlarmsDistinguishedNumberByAlarmType.TypeNum(typeName); + typeNum.setNum(0); + return typeNum; + } + } diff --git a/src/main/java/com/zhgd/xmgl/modules/bigdevice/service/impl/TowerAlarmServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/bigdevice/service/impl/TowerAlarmServiceImpl.java index c37f33a4c..9df433f15 100644 --- a/src/main/java/com/zhgd/xmgl/modules/bigdevice/service/impl/TowerAlarmServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/bigdevice/service/impl/TowerAlarmServiceImpl.java @@ -44,6 +44,8 @@ public class TowerAlarmServiceImpl extends ServiceImpl towerAlarms = towerAlarmMapper.queryAlarmsByTime(map); - Map countTowerAlarmByTypeMap = countTowerAlarmByType(towerAlarms); + Map countTowerAlarmByTypeMap = countTowerAlarmByType(towerAlarms); List typeNums = new ArrayList<>(); Integer alarmCount = 0; - for (Map.Entry entry : countTowerAlarmByTypeMap.entrySet()) { + for (Map.Entry entry : countTowerAlarmByTypeMap.entrySet()) { AlarmsDistinguishedNumberByAlarmType.TypeNum typeNum = new AlarmsDistinguishedNumberByAlarmType.TypeNum(); - Integer value = entry.getValue(); + Integer value = entry.getValue().getNum(); typeNum.setType(entry.getKey()); + typeNum.setTypeName(entry.getValue().getTypeName()); typeNum.setNum(value); typeNums.add(typeNum); alarmCount += value; @@ -584,70 +587,71 @@ public class TowerAlarmServiceImpl extends ServiceImpl countTowerAlarmByType(List towerAlarms) { - Map typeNumMap = new HashMap<>(); - typeNumMap.put(ReflectionUtil.getFieldName(TowerAlarm::getMomentAlarm), 0); - typeNumMap.put(ReflectionUtil.getFieldName(TowerAlarm::getWindSpeedAlarm), 0); - typeNumMap.put(ReflectionUtil.getFieldName(TowerAlarm::getHeightAlarm), 0); - typeNumMap.put(ReflectionUtil.getFieldName(TowerAlarm::getHeightLowerAlarm), 0); - typeNumMap.put(ReflectionUtil.getFieldName(TowerAlarm::getMinRangeAlarm), 0); - typeNumMap.put(ReflectionUtil.getFieldName(TowerAlarm::getMaxRangeAlarm), 0); - typeNumMap.put(ReflectionUtil.getFieldName(TowerAlarm::getPosAngleAlarm), 0); - typeNumMap.put(ReflectionUtil.getFieldName(TowerAlarm::getNegAngleAlarm), 0); - typeNumMap.put(ReflectionUtil.getFieldName(TowerAlarm::getObliguityAlarm), 0); - typeNumMap.put(ReflectionUtil.getFieldName(TowerAlarm::getEnvironmentAlarm), 0); - typeNumMap.put(ReflectionUtil.getFieldName(TowerAlarm::getMultiAlarm), 0); - typeNumMap.put(ReflectionUtil.getFieldName(TowerAlarm::getStandardHighAlarm), 0); + private Map countTowerAlarmByType(List towerAlarms) { + Map typeNumMap = new HashMap<>(); + typeNumMap.put(ReflectionUtil.getFieldName(TowerAlarm::getMomentAlarm), lifterAlarmService.getNewTypeNum("力矩报警")); + typeNumMap.put(ReflectionUtil.getFieldName(TowerAlarm::getWindSpeedAlarm), lifterAlarmService.getNewTypeNum("风速报警")); + typeNumMap.put(ReflectionUtil.getFieldName(TowerAlarm::getHeightAlarm), lifterAlarmService.getNewTypeNum("高度上限位报警")); + typeNumMap.put(ReflectionUtil.getFieldName(TowerAlarm::getHeightLowerAlarm), lifterAlarmService.getNewTypeNum("高度下限位报警")); + typeNumMap.put(ReflectionUtil.getFieldName(TowerAlarm::getMinRangeAlarm), lifterAlarmService.getNewTypeNum("幅度内限位报警")); + typeNumMap.put(ReflectionUtil.getFieldName(TowerAlarm::getMaxRangeAlarm), lifterAlarmService.getNewTypeNum("幅度外限位报警")); + typeNumMap.put(ReflectionUtil.getFieldName(TowerAlarm::getPosAngleAlarm), lifterAlarmService.getNewTypeNum("顺时针回转限位报警")); + typeNumMap.put(ReflectionUtil.getFieldName(TowerAlarm::getNegAngleAlarm), lifterAlarmService.getNewTypeNum("逆时针回转限位报警")); + typeNumMap.put(ReflectionUtil.getFieldName(TowerAlarm::getObliguityAlarm), lifterAlarmService.getNewTypeNum("倾角报警")); + typeNumMap.put(ReflectionUtil.getFieldName(TowerAlarm::getEnvironmentAlarm), lifterAlarmService.getNewTypeNum("环境防撞报警")); + typeNumMap.put(ReflectionUtil.getFieldName(TowerAlarm::getMultiAlarm), lifterAlarmService.getNewTypeNum("多机防撞报警")); + typeNumMap.put(ReflectionUtil.getFieldName(TowerAlarm::getStandardHighAlarm), lifterAlarmService.getNewTypeNum("塔机间竖向高度报警")); for (TowerAlarm towerAlarm : towerAlarms) { if (Objects.equals(towerAlarm.getMomentAlarm(), 1)) { String fieldName = ReflectionUtil.getFieldName(TowerAlarm::getMomentAlarm); - typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1); + lifterAlarmService.setTypeNum(typeNumMap, fieldName); } if (Objects.equals(towerAlarm.getWindSpeedAlarm(), 1)) { String fieldName = ReflectionUtil.getFieldName(TowerAlarm::getWindSpeedAlarm); - typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1); + lifterAlarmService.setTypeNum(typeNumMap, fieldName); } if (Objects.equals(towerAlarm.getHeightAlarm(), 1)) { String fieldName = ReflectionUtil.getFieldName(TowerAlarm::getHeightAlarm); - typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1); + lifterAlarmService.setTypeNum(typeNumMap, fieldName); } if (Objects.equals(towerAlarm.getHeightLowerAlarm(), 1)) { String fieldName = ReflectionUtil.getFieldName(TowerAlarm::getHeightLowerAlarm); - typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1); + lifterAlarmService.setTypeNum(typeNumMap, fieldName); } if (Objects.equals(towerAlarm.getMinRangeAlarm(), 1)) { String fieldName = ReflectionUtil.getFieldName(TowerAlarm::getMinRangeAlarm); - typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1); + lifterAlarmService.setTypeNum(typeNumMap, fieldName); } if (Objects.equals(towerAlarm.getMaxRangeAlarm(), 1)) { String fieldName = ReflectionUtil.getFieldName(TowerAlarm::getMaxRangeAlarm); - typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1); + lifterAlarmService.setTypeNum(typeNumMap, fieldName); } if (Objects.equals(towerAlarm.getPosAngleAlarm(), 1)) { String fieldName = ReflectionUtil.getFieldName(TowerAlarm::getPosAngleAlarm); - typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1); + lifterAlarmService.setTypeNum(typeNumMap, fieldName); } if (Objects.equals(towerAlarm.getNegAngleAlarm(), 1)) { String fieldName = ReflectionUtil.getFieldName(TowerAlarm::getNegAngleAlarm); - typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1); + lifterAlarmService.setTypeNum(typeNumMap, fieldName); } if (Objects.equals(towerAlarm.getObliguityAlarm(), 1)) { String fieldName = ReflectionUtil.getFieldName(TowerAlarm::getObliguityAlarm); - typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1); + lifterAlarmService.setTypeNum(typeNumMap, fieldName); } if (Objects.equals(towerAlarm.getEnvironmentAlarm(), 1)) { String fieldName = ReflectionUtil.getFieldName(TowerAlarm::getEnvironmentAlarm); - typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1); + lifterAlarmService.setTypeNum(typeNumMap, fieldName); } if (Objects.equals(towerAlarm.getMultiAlarm(), 1)) { String fieldName = ReflectionUtil.getFieldName(TowerAlarm::getMultiAlarm); - typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1); + lifterAlarmService.setTypeNum(typeNumMap, fieldName); } if (Objects.equals(towerAlarm.getStandardHighAlarm(), 1)) { String fieldName = ReflectionUtil.getFieldName(TowerAlarm::getStandardHighAlarm); - typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1); + lifterAlarmService.setTypeNum(typeNumMap, fieldName); } } return typeNumMap; } + } diff --git a/src/main/java/com/zhgd/xmgl/modules/sanjiang/service/impl/SjSafeEnvironmentFileServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/sanjiang/service/impl/SjSafeEnvironmentFileServiceImpl.java index f9f1bd1c5..f0a8d4759 100644 --- a/src/main/java/com/zhgd/xmgl/modules/sanjiang/service/impl/SjSafeEnvironmentFileServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/sanjiang/service/impl/SjSafeEnvironmentFileServiceImpl.java @@ -373,7 +373,7 @@ public class SjSafeEnvironmentFileServiceImpl extends ServiceImpl getProjectSnList(String sn) { + public List getProjectSnList(String sn) { if (StringUtils.isBlank(sn)) { return null; } diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/controller/WorkerInfoController.java b/src/main/java/com/zhgd/xmgl/modules/worker/controller/WorkerInfoController.java index e393806be..b221acad2 100644 --- a/src/main/java/com/zhgd/xmgl/modules/worker/controller/WorkerInfoController.java +++ b/src/main/java/com/zhgd/xmgl/modules/worker/controller/WorkerInfoController.java @@ -325,7 +325,7 @@ public class WorkerInfoController { @ApiImplicitParam(name = "sn", value = "项目sn", paramType = "query", required = true, dataType = "String"), }) @PostMapping("/selectProjectWorkerStatistics") - public Result> selectProjectWorkerStatistics(@RequestBody Map map) { + public Result selectProjectWorkerStatistics(@RequestBody Map map) { return Result.success(workerInfoService.selectProjectWorkerStatistics(map)); } diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/entity/vo/ProjectWorkerStatisticsVo.java b/src/main/java/com/zhgd/xmgl/modules/worker/entity/vo/ProjectWorkerStatisticsVo.java new file mode 100644 index 000000000..5af0d51b9 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/worker/entity/vo/ProjectWorkerStatisticsVo.java @@ -0,0 +1,91 @@ +package com.zhgd.xmgl.modules.worker.entity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class ProjectWorkerStatisticsVo { + + private WorkerCount workercount; + private Integer attendancePersonNum; + private DevCount devcount; + private PresenceCount presencecount; + private Integer educationPersonNum; + + @Data + public static class WorkerCount { + + private Integer lwPersonYesterdayAdd; + @ApiModelProperty(value = "甲方人员(在册)") + private Integer jfGlPersonTotal; + private Integer age18; + private Integer age18to25; + private Integer totalSaleAcreage; + private Integer womanPersonTotal; + private Integer blacklistPersonTotal; + private Integer specialPersonTotal; + @ApiModelProperty(value = "临时工人数(在册)") + private Integer lsPersonTotal; + @ApiModelProperty(value = "监理人员(在册)") + private Integer jlGlPersonTotal; + private Integer age45to60; + @ApiModelProperty(value = "劳务人数(在册)") + private Integer lwPersonTotal; + private Integer manPersonTotal; + private Integer certificatePersonTotal; + @ApiModelProperty(value = "在册总人数(实名制人数)") + private String totalPerson; + private Integer age25to35; + private Integer glPersonTotal; + private Integer lwAndGlPersonTotal; + @ApiModelProperty(value = "乙方人员(在册)") + private Integer yfGlPersonTotal; + private Double avgage; + private Integer age35to45; + private Integer glPersonYesterdayAdd; + private Integer age60; + + } + + @Data + public static class DevCount { + + private Integer ufaceDevNum; + private Integer lifterDevNum; + private Integer videoNum; + private Integer environmentDevNum; + private Integer towerDevNum; + + } + + @Data + public static class PresenceCount { + + private String totalWorkerTypeNum; + @ApiModelProperty(value = "甲方人员(在场)") + private Integer jfGlPersonTotal; + private Integer age18; + private Integer age18to25; + private Integer womanPersonTotal; + @ApiModelProperty(value = "临时工人数(在场)") + private Integer lsPersonTotal; + @ApiModelProperty(value = "监理人员(在场)") + private Integer jlGlPersonTotal; + private Integer age45to60; + private Integer lwPersonTotal; + private Integer manPersonTotal; + private String totalTeamNum; + @ApiModelProperty(value = "总人数(在场)") + private String totalPerson; + private Integer age25to35; + private Integer glPersonTotal; + @ApiModelProperty(value = "乙方人员(在场)") + private Integer yfGlPersonTotal; + private Integer avgage; + private Integer age35to45; + private Integer age60; + + } + + +} diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/WorkerSafeEducationWorkerMapper.xml b/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/WorkerSafeEducationWorkerMapper.xml index bec9afa4d..f8067e724 100644 --- a/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/WorkerSafeEducationWorkerMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/WorkerSafeEducationWorkerMapper.xml @@ -29,23 +29,32 @@ b.team_name, c.department_name, d.enterprise_name, - a.sex, - a.id_card idcardnumber, - (case - when a.birthday != '' then year(from_days(datediff(NOW(), a.birthday))) - else '-' end) age + a.sex, + a.id_card idcardnumber, + (case + when a.birthday != '' then year(from_days(datediff(NOW(), a.birthday))) + else '-' end) age FROM worker_safe_education_worker w - LEFT JOIN worker_info a ON w.worker_id = a.id - LEFT JOIN team_info b ON a.team_id = b.id - LEFT JOIN department_info c ON a.department_id = c.id - LEFT JOIN enterprise_info d ON a.enterprise_id = d.id - WHERE w.project_sn = #{param.projectSn} + LEFT JOIN worker_info a ON w.worker_id = a.id + LEFT JOIN team_info b ON a.team_id = b.id + LEFT JOIN department_info c ON a.department_id = c.id + LEFT JOIN enterprise_info d ON a.enterprise_id = d.id + WHERE 1=1 + + and w.project_sn = #{param.projectSn} + and a.worker_name like CONCAT(CONCAT('%', #{param.workerName}), '%') and w.edu_id = #{param.eduId} + + AND w.project_sn in + + #{item} + +