bug修复
This commit is contained in:
parent
103906e10c
commit
ff43ac9ec3
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -208,13 +208,14 @@ public class LifterAlarmServiceImpl extends ServiceImpl<LifterAlarmMapper, Lifte
|
||||
map.putIfAbsent("queryEndTime", queryEndTime);
|
||||
map.putIfAbsent("queryStartTime", queryStartTime);
|
||||
List<LifterAlarm> lifterAlarms = lifterAlarmMapper.queryAlarmsByTime(map);
|
||||
Map<String, Integer> countTowerAlarmByTypeMap = countLifterAlarmByType(lifterAlarms);
|
||||
Map<String, AlarmsDistinguishedNumberByAlarmType.TypeNum> countTowerAlarmByTypeMap = countLifterAlarmByType(lifterAlarms);
|
||||
List<AlarmsDistinguishedNumberByAlarmType.TypeNum> typeNums = new ArrayList<>();
|
||||
Integer alarmCount = 0;
|
||||
for (Map.Entry<String, Integer> entry : countTowerAlarmByTypeMap.entrySet()) {
|
||||
for (Map.Entry<String, AlarmsDistinguishedNumberByAlarmType.TypeNum> 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<LifterAlarmMapper, Lifte
|
||||
*
|
||||
* @param lifterAlarms
|
||||
*/
|
||||
private Map<String, Integer> countLifterAlarmByType(List<LifterAlarm> lifterAlarms) {
|
||||
Map<String, Integer> 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<String, AlarmsDistinguishedNumberByAlarmType.TypeNum> countLifterAlarmByType(List<LifterAlarm> lifterAlarms) {
|
||||
Map<String, AlarmsDistinguishedNumberByAlarmType.TypeNum> 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<String, Integer> typeNumMap, String fieldName) {
|
||||
Integer integer = typeNumMap.get(fieldName);
|
||||
if (integer != null) {
|
||||
integer += 1;
|
||||
} else {
|
||||
integer = 1;
|
||||
}
|
||||
typeNumMap.put(fieldName, integer);
|
||||
public void setTypeNum(Map<String, AlarmsDistinguishedNumberByAlarmType.TypeNum> typeNumMap, String fieldName) {
|
||||
AlarmsDistinguishedNumberByAlarmType.TypeNum typeNum = typeNumMap.get(fieldName);
|
||||
if (typeNum != null) {
|
||||
typeNum.setNum(typeNum.getNum() + 1);
|
||||
}
|
||||
}
|
||||
|
||||
public AlarmsDistinguishedNumberByAlarmType.TypeNum getNewTypeNum(String typeName) {
|
||||
AlarmsDistinguishedNumberByAlarmType.TypeNum typeNum = new AlarmsDistinguishedNumberByAlarmType.TypeNum(typeName);
|
||||
typeNum.setNum(0);
|
||||
return typeNum;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -44,6 +44,8 @@ public class TowerAlarmServiceImpl extends ServiceImpl<TowerAlarmMapper, TowerAl
|
||||
@Autowired
|
||||
private TowerAlarmMapper towerAlarmMapper;
|
||||
@Autowired
|
||||
private LifterAlarmServiceImpl lifterAlarmService;
|
||||
@Autowired
|
||||
private TowerMapper towerMapper;
|
||||
@Autowired
|
||||
private TowerCurrentDataMapper towerCurrentDataMapper;
|
||||
@ -562,13 +564,14 @@ public class TowerAlarmServiceImpl extends ServiceImpl<TowerAlarmMapper, TowerAl
|
||||
map.putIfAbsent("queryEndTime", queryEndTime);
|
||||
map.putIfAbsent("queryStartTime", queryStartTime);
|
||||
List<TowerAlarm> towerAlarms = towerAlarmMapper.queryAlarmsByTime(map);
|
||||
Map<String, Integer> countTowerAlarmByTypeMap = countTowerAlarmByType(towerAlarms);
|
||||
Map<String, AlarmsDistinguishedNumberByAlarmType.TypeNum> countTowerAlarmByTypeMap = countTowerAlarmByType(towerAlarms);
|
||||
List<AlarmsDistinguishedNumberByAlarmType.TypeNum> typeNums = new ArrayList<>();
|
||||
Integer alarmCount = 0;
|
||||
for (Map.Entry<String, Integer> entry : countTowerAlarmByTypeMap.entrySet()) {
|
||||
for (Map.Entry<String, AlarmsDistinguishedNumberByAlarmType.TypeNum> 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<TowerAlarmMapper, TowerAl
|
||||
*
|
||||
* @param towerAlarms
|
||||
*/
|
||||
private Map<String, Integer> countTowerAlarmByType(List<TowerAlarm> towerAlarms) {
|
||||
Map<String, Integer> 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<String, AlarmsDistinguishedNumberByAlarmType.TypeNum> countTowerAlarmByType(List<TowerAlarm> towerAlarms) {
|
||||
Map<String, AlarmsDistinguishedNumberByAlarmType.TypeNum> 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -373,7 +373,7 @@ public class SjSafeEnvironmentFileServiceImpl extends ServiceImpl<SjSafeEnvironm
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private List<String> getProjectSnList(String sn) {
|
||||
public List<String> getProjectSnList(String sn) {
|
||||
if (StringUtils.isBlank(sn)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -325,7 +325,7 @@ public class WorkerInfoController {
|
||||
@ApiImplicitParam(name = "sn", value = "项目sn", paramType = "query", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping("/selectProjectWorkerStatistics")
|
||||
public Result<Map<String, Object>> selectProjectWorkerStatistics(@RequestBody Map<String, Object> map) {
|
||||
public Result<ProjectWorkerStatisticsVo> selectProjectWorkerStatistics(@RequestBody Map<String, Object> map) {
|
||||
return Result.success(workerInfoService.selectProjectWorkerStatistics(map));
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -39,13 +39,22 @@
|
||||
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}
|
||||
WHERE 1=1
|
||||
<if test="param.projectSn != null and param.projectSn != ''">
|
||||
and w.project_sn = #{param.projectSn}
|
||||
</if>
|
||||
<if test="param.workerName != null and param.workerName != ''">
|
||||
and a.worker_name like CONCAT(CONCAT('%', #{param.workerName}), '%')
|
||||
</if>
|
||||
<if test="param.eduId != null and param.eduId != ''">
|
||||
and w.edu_id = #{param.eduId}
|
||||
</if>
|
||||
<if test="param.projectSnList != null">
|
||||
AND w.project_sn in
|
||||
<foreach collection="param.projectSnList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectSafeEducationWorkerPage" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
|
||||
SELECT w.*,
|
||||
|
||||
@ -55,7 +55,7 @@ public interface IWorkerInfoService extends IService<WorkerInfo> {
|
||||
|
||||
Map<String, Object> selectWorkerManageEnterpriseStatistics(Map<String, Object> map);
|
||||
|
||||
Map<String, Object> selectProjectWorkerStatistics(Map<String, Object> map);
|
||||
ProjectWorkerStatisticsVo selectProjectWorkerStatistics(Map<String, Object> map);
|
||||
|
||||
List<EntityMap> selectProjectPresentWorkerList(Map<String, Object> map);
|
||||
|
||||
|
||||
@ -725,7 +725,7 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> selectProjectWorkerStatistics(Map<String, Object> map) {
|
||||
public ProjectWorkerStatisticsVo selectProjectWorkerStatistics(Map<String, Object> map) {
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
map.put("companyType", "4");
|
||||
Map<String, Object> devcount = projectMapper.selectDevStatisticsCount(map);
|
||||
@ -738,7 +738,8 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
|
||||
data.put("presencecount", presencecount);
|
||||
data.put("educationPersonNum", educationPersonNum);
|
||||
data.put("attendancePersonNum", attendancePersonNum);
|
||||
return data;
|
||||
ProjectWorkerStatisticsVo vo = BeanUtil.toBean(data, ProjectWorkerStatisticsVo.class);
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -20,6 +20,7 @@ import com.zhgd.xmgl.modules.edu.mapper.SafeEducationQuestionAnswerMapper;
|
||||
import com.zhgd.xmgl.modules.edu.mapper.SafeEducationQuestionMapper;
|
||||
import com.zhgd.xmgl.modules.edu.mapper.SafeEducationQuestionOptionMapper;
|
||||
import com.zhgd.xmgl.modules.project.mapper.ProjectMapper;
|
||||
import com.zhgd.xmgl.modules.sanjiang.service.impl.SjSafeEnvironmentFileServiceImpl;
|
||||
import com.zhgd.xmgl.modules.worker.entity.WorkerInfo;
|
||||
import com.zhgd.xmgl.modules.worker.entity.WorkerSafeEducation;
|
||||
import com.zhgd.xmgl.modules.worker.entity.WorkerSafeEducationWorker;
|
||||
@ -33,6 +34,7 @@ import com.zhgd.xmgl.modules.worker.mapper.WorkerSafeEducationWorkerMapper;
|
||||
import com.zhgd.xmgl.modules.worker.service.IWorkerSafeEducationService;
|
||||
import com.zhgd.xmgl.util.JxlExcelUtils;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -54,6 +56,8 @@ public class WorkerSafeEducationServiceImpl extends ServiceImpl<WorkerSafeEducat
|
||||
@Autowired
|
||||
private WorkerSafeEducationMapper workerSafeEducationMapper;
|
||||
@Autowired
|
||||
private SjSafeEnvironmentFileServiceImpl sjSafeEnvironmentFileService;
|
||||
@Autowired
|
||||
private WorkerSafeEducationWorkerMapper workerSafeEducationWorkerMapper;
|
||||
@Autowired
|
||||
private CompanyMapper companyMapper;
|
||||
@ -261,6 +265,12 @@ public class WorkerSafeEducationServiceImpl extends ServiceImpl<WorkerSafeEducat
|
||||
int pageNo = Integer.parseInt(map.getOrDefault("pageNo", 1).toString());
|
||||
int pageSize = Integer.parseInt(map.getOrDefault("pageSize", 10).toString());
|
||||
Page<EntityMap> page = new Page<>(pageNo, pageSize);
|
||||
String projectSn = MapUtils.getString(map, "projectSn");
|
||||
if (StringUtils.isNotBlank(projectSn)) {
|
||||
List<String> projectSnList = sjSafeEnvironmentFileService.getProjectSnList(projectSn);
|
||||
map.put("projectSnList", projectSnList);
|
||||
map.remove("projectSn");
|
||||
}
|
||||
List<EntityMap> list = workerSafeEducationWorkerMapper.selectAnswerWorkerPage(page, map);
|
||||
return page.setRecords(list);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user