代码优化
This commit is contained in:
parent
4aeff5cc9e
commit
30279b31a3
@ -0,0 +1,14 @@
|
||||
package com.zhgd.xmgl.entity.vo;
|
||||
|
||||
import com.zhgd.xmgl.modules.worker.entity.vo.ProjectCompanyWorkTotal;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class AttendanceOfEachCompanyVo {
|
||||
@ApiModelProperty(value = "出勤总人数")
|
||||
private Integer attendanceNum;
|
||||
private List<ProjectCompanyWorkTotal> projectCompanyWorkTotalList;
|
||||
}
|
||||
12
src/main/java/com/zhgd/xmgl/entity/vo/NumTypeVo.java
Normal file
12
src/main/java/com/zhgd/xmgl/entity/vo/NumTypeVo.java
Normal file
@ -0,0 +1,12 @@
|
||||
package com.zhgd.xmgl.entity.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class NumTypeVo {
|
||||
@ApiModelProperty(value = "数量")
|
||||
private Integer num;
|
||||
@ApiModelProperty(value = "类型")
|
||||
private Integer type;
|
||||
}
|
||||
@ -5,6 +5,7 @@ import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.Lifter;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.vo.LifterAndDataInfoVO;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.vo.TodayOperatingStatusStatisticsVo;
|
||||
import com.zhgd.xmgl.modules.bigdevice.service.ILifterService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@ -144,5 +145,15 @@ public class LifterController {
|
||||
return Result.success(lifterService.selectLifterDevAlarmCountList(map));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询今日运行状态统计", notes = "查询今日运行状态统计", httpMethod = "GET")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "query", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "devSn", value = "设备编号", dataType = "String", paramType = "query", required = true)
|
||||
})
|
||||
@GetMapping(value = "/queryTodayOperatingStatusStatistics")
|
||||
public Result<TodayOperatingStatusStatisticsVo> queryTodayOperatingStatusStatistics(@RequestParam Map<String, Object> map) {
|
||||
return Result.success(lifterService.queryTodayOperatingStatusStatistics(map));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -12,6 +12,7 @@ import com.zhgd.xmgl.modules.basicdata.service.UploadFileService;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.Lifter;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.LifterViolation;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.vo.StatisticsElevatorNumVo;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.vo.StatisticsElevatorViolationNumVo;
|
||||
import com.zhgd.xmgl.modules.bigdevice.service.ILifterService;
|
||||
import com.zhgd.xmgl.modules.bigdevice.service.LifterViolationService;
|
||||
import com.zhgd.xmgl.util.MessageUtil;
|
||||
@ -175,7 +176,7 @@ public class LifterViolationController {
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "query", required = true, dataType = "String"),
|
||||
})
|
||||
@GetMapping(value = "/queryStatisticsViolationNum")
|
||||
public Result<StatisticsElevatorNumVo> queryStatisticsViolationNum(@RequestParam Map<String, Object> map) {
|
||||
public Result<StatisticsElevatorViolationNumVo> queryStatisticsViolationNum(@RequestParam Map<String, Object> map) {
|
||||
return Result.success(lifterViolationService.queryStatisticsViolationNum(map));
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,19 @@
|
||||
package com.zhgd.xmgl.modules.bigdevice.entity.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class StatisticsElevatorViolationNumVo {
|
||||
@ApiModelProperty(value = "今日违章次数")
|
||||
private Integer todayViolationNum;
|
||||
@ApiModelProperty(value = "昨日违章次数(同一时段)")
|
||||
private Integer yesterdayViolationNum;
|
||||
@ApiModelProperty(value = "过去30日违章次数")
|
||||
private Integer last30DayViolationNum;
|
||||
@ApiModelProperty(value = "违章次数(相比昨日同一时段)")
|
||||
private Integer todayViolationNumCompareYesterday;
|
||||
@ApiModelProperty(value = "违章次数(相比过去30日)")
|
||||
private Integer todayViolationNumCompareLast30Day;
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.zhgd.xmgl.modules.bigdevice.entity.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TodayOperatingStatusStatisticsVo {
|
||||
@ApiModelProperty(value = "工作时长(分钟)")
|
||||
private Integer workTime;
|
||||
@ApiModelProperty(value = "装载次数")
|
||||
private Integer loadingNum;
|
||||
@ApiModelProperty(value = "装载工效")
|
||||
private Integer loadingErgonomic;
|
||||
@ApiModelProperty(value = "装载重量")
|
||||
private Integer loadingWeight;
|
||||
@ApiModelProperty(value = "违章次数")
|
||||
private Integer violationNum;
|
||||
}
|
||||
@ -22,5 +22,11 @@ public interface LifterViolationMapper extends BaseMapper<LifterViolation> {
|
||||
|
||||
LifterViolation getInfoById(@Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 查询违章次数
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
Integer selectLifterViolationCount(Map<String, Object> map);
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.vo.TodayOperatingStatusStatisticsVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.LifterWorkCycle;
|
||||
@ -13,13 +14,15 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
/**
|
||||
* @Description: 升降机工作循环
|
||||
* @author: pds
|
||||
* @date: 2020-12-16
|
||||
* @date: 2020-12-16
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface LifterWorkCycleMapper extends BaseMapper<LifterWorkCycle> {
|
||||
|
||||
List<EntityMap> queryLifterWorkCyclePageList(Page<EntityMap> page, @Param("param")Map<String, Object> map);
|
||||
List<EntityMap> queryLifterWorkCyclePageList(Page<EntityMap> page, @Param("param") Map<String, Object> map);
|
||||
|
||||
List<EntityMap> selectLifterWorkCycleList(Map<String, Object> map);
|
||||
|
||||
TodayOperatingStatusStatisticsVo queryTodayWorkCycleStatusStatistics(Map<String, Object> map);
|
||||
}
|
||||
|
||||
@ -20,11 +20,25 @@
|
||||
SELECT a.*,b.dev_name
|
||||
FROM lifter_work_cycle a INNER JOIN lifter b ON a.dev_sn=b.dev_sn
|
||||
WHERE a.dev_sn=#{devSn}
|
||||
<if test="startTime!=null and startTime!=''">
|
||||
<if test="startTime != null and startTime != ''">
|
||||
AND a.start_time >=CONCAT(DATE_FORMAT(#{startTime},'%Y-%m-%d'),' 00:00:00')
|
||||
</if>
|
||||
<if test="endTime!=null and endTime!=''">
|
||||
<if test="endTime != null and endTime != ''">
|
||||
AND a.end_time <=CONCAT(DATE_FORMAT(#{endTime},'%Y-%m-%d'),' 23:59:59')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="queryTodayWorkCycleStatusStatistics"
|
||||
resultType="com.zhgd.xmgl.modules.bigdevice.entity.vo.TodayOperatingStatusStatisticsVo">
|
||||
SELECT
|
||||
ifnull(sum(ifnull(lw.work_time,0)),0) as workTime,
|
||||
count(1) as loadingNum,
|
||||
ifnull(sum(ifnull(lw.loading,0)),0) as loadingWeight
|
||||
FROM lifter_work_cycle lw
|
||||
<where>
|
||||
lw.project_sn = #{projectSn}
|
||||
and lw.dev_sn = #{devSn}
|
||||
and lw.add_time >= curdate()
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -6,6 +6,7 @@ import com.zhgd.xmgl.modules.bigdevice.entity.Lifter;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.LifterAlarm;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.LifterViolation;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.vo.LifterAndDataInfoVO;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.vo.TodayOperatingStatusStatisticsVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -49,4 +50,6 @@ public interface ILifterService extends IService<Lifter> {
|
||||
void sendViolationMessageToRectification(LifterViolation lifterViolation, Lifter lifter);
|
||||
|
||||
LifterAndDataInfoVO getRelatedInfo(String devSn);
|
||||
|
||||
TodayOperatingStatusStatisticsVo queryTodayOperatingStatusStatistics(Map<String, Object> map);
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.LifterViolation;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.vo.StatisticsElevatorNumVo;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.vo.StatisticsElevatorViolationNumVo;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ -18,5 +19,5 @@ public interface LifterViolationService extends IService<LifterViolation> {
|
||||
|
||||
LifterViolation getInfoById(Long id);
|
||||
|
||||
StatisticsElevatorNumVo queryStatisticsViolationNum(Map<String, Object> map);
|
||||
StatisticsElevatorViolationNumVo queryStatisticsViolationNum(Map<String, Object> map);
|
||||
}
|
||||
|
||||
@ -210,14 +210,17 @@ public class LifterAlarmServiceImpl extends ServiceImpl<LifterAlarmMapper, Lifte
|
||||
List<LifterAlarm> lifterAlarms = lifterAlarmMapper.queryAlarmsByTime(map);
|
||||
Map<String, Integer> countTowerAlarmByTypeMap = countLifterAlarmByType(lifterAlarms);
|
||||
List<AlarmsDistinguishedNumberByAlarmType.TypeNum> typeNums = new ArrayList<>();
|
||||
Integer alarmCount = 0;
|
||||
for (Map.Entry<String, Integer> entry : countTowerAlarmByTypeMap.entrySet()) {
|
||||
AlarmsDistinguishedNumberByAlarmType.TypeNum typeNum = new AlarmsDistinguishedNumberByAlarmType.TypeNum();
|
||||
Integer value = entry.getValue();
|
||||
typeNum.setType(entry.getKey());
|
||||
typeNum.setNum(entry.getValue());
|
||||
typeNum.setNum(value);
|
||||
typeNums.add(typeNum);
|
||||
alarmCount += value;
|
||||
}
|
||||
Integer count = countTowerAlarmByTypeMap.size();
|
||||
AlarmsDistinguishedNumberByAlarmType rt = new AlarmsDistinguishedNumberByAlarmType();
|
||||
rt.setAlarmNum(count);
|
||||
rt.setAlarmNum(alarmCount);
|
||||
rt.setTypeNumList(typeNums);
|
||||
return rt;
|
||||
}
|
||||
@ -229,58 +232,71 @@ public class LifterAlarmServiceImpl extends ServiceImpl<LifterAlarmMapper, Lifte
|
||||
*/
|
||||
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);
|
||||
for (LifterAlarm lifterAlarm : lifterAlarms) {
|
||||
if (Objects.equals(lifterAlarm.getPeopleCntAlarm(), 1)) {
|
||||
String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getPeopleCntAlarm);
|
||||
addLifterAlarmCountByType(typeNumMap, fieldName);
|
||||
typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1);
|
||||
}
|
||||
if (Objects.equals(lifterAlarm.getWeightAlarm(), 1)) {
|
||||
String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getWeightAlarm);
|
||||
addLifterAlarmCountByType(typeNumMap, fieldName);
|
||||
typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1);
|
||||
}
|
||||
if (Objects.equals(lifterAlarm.getSpeedAlarm(), 1)) {
|
||||
String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getSpeedAlarm);
|
||||
addLifterAlarmCountByType(typeNumMap, fieldName);
|
||||
typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1);
|
||||
}
|
||||
if (Objects.equals(lifterAlarm.getHeightAlarm(), 1)) {
|
||||
String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getHeightAlarm);
|
||||
addLifterAlarmCountByType(typeNumMap, fieldName);
|
||||
typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1);
|
||||
}
|
||||
if (Objects.equals(lifterAlarm.getObliguityXAlarm(), 1)) {
|
||||
String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getObliguityXAlarm);
|
||||
addLifterAlarmCountByType(typeNumMap, fieldName);
|
||||
typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1);
|
||||
}
|
||||
if (Objects.equals(lifterAlarm.getObliguityYAlarm(), 1)) {
|
||||
String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getObliguityYAlarm);
|
||||
addLifterAlarmCountByType(typeNumMap, fieldName);
|
||||
typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1);
|
||||
}
|
||||
if (Objects.equals(lifterAlarm.getWindSpeedAlarm(), 1)) {
|
||||
String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getWindSpeedAlarm);
|
||||
addLifterAlarmCountByType(typeNumMap, fieldName);
|
||||
typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1);
|
||||
}
|
||||
if (Objects.equals(lifterAlarm.getMotor1Alarm(), 1)) {
|
||||
String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getMotor1Alarm);
|
||||
addLifterAlarmCountByType(typeNumMap, fieldName);
|
||||
typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1);
|
||||
}
|
||||
if (Objects.equals(lifterAlarm.getMotor2Alarm(), 1)) {
|
||||
String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getMotor2Alarm);
|
||||
addLifterAlarmCountByType(typeNumMap, fieldName);
|
||||
typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1);
|
||||
}
|
||||
if (Objects.equals(lifterAlarm.getMotor3Alarm(), 1)) {
|
||||
String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getMotor3Alarm);
|
||||
addLifterAlarmCountByType(typeNumMap, fieldName);
|
||||
typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1);
|
||||
}
|
||||
if (Objects.equals(lifterAlarm.getTopAlarm(), 1)) {
|
||||
String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getTopAlarm);
|
||||
addLifterAlarmCountByType(typeNumMap, fieldName);
|
||||
typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1);
|
||||
}
|
||||
if (Objects.equals(lifterAlarm.getFallAlarm(), 1)) {
|
||||
String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getFallAlarm);
|
||||
addLifterAlarmCountByType(typeNumMap, fieldName);
|
||||
typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1);
|
||||
}
|
||||
if (Objects.equals(lifterAlarm.getBottomAlarm(), 1)) {
|
||||
String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getBottomAlarm);
|
||||
addLifterAlarmCountByType(typeNumMap, fieldName);
|
||||
typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1);
|
||||
}
|
||||
}
|
||||
return typeNumMap;
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
package com.zhgd.xmgl.modules.bigdevice.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -16,8 +18,10 @@ import com.zhgd.xmgl.modules.bigdevice.entity.dto.LifterDataInfoDTO;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.vo.DevWorkerVO;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.vo.DriverVO;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.vo.LifterAndDataInfoVO;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.vo.TodayOperatingStatusStatisticsVo;
|
||||
import com.zhgd.xmgl.modules.bigdevice.mapper.*;
|
||||
import com.zhgd.xmgl.modules.bigdevice.service.ILifterService;
|
||||
import com.zhgd.xmgl.modules.project.entity.SubdivisionProject;
|
||||
import com.zhgd.xmgl.util.MessageUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
@ -41,6 +45,8 @@ import java.util.stream.Collectors;
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Slf4j
|
||||
public class LifterServiceImpl extends ServiceImpl<LifterMapper, Lifter> implements ILifterService {
|
||||
@Autowired
|
||||
private LifterViolationMapper lifterViolationMapper;
|
||||
@Autowired
|
||||
private LifterMapper lifterMapper;
|
||||
@Autowired
|
||||
@ -362,4 +368,14 @@ public class LifterServiceImpl extends ServiceImpl<LifterMapper, Lifter> impleme
|
||||
}
|
||||
return new LifterAndDataInfoVO(lifterDataInfo, devWorker);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TodayOperatingStatusStatisticsVo queryTodayOperatingStatusStatistics(Map<String, Object> map) {
|
||||
TodayOperatingStatusStatisticsVo workCycleStatusStatistics = lifterWorkCycleMapper.queryTodayWorkCycleStatusStatistics(map);
|
||||
Date date = new Date();
|
||||
map.put("queryStartTime", DateUtil.today());
|
||||
Integer todayRunNum = lifterViolationMapper.selectLifterViolationCount(map);
|
||||
workCycleStatusStatistics.setViolationNum(todayRunNum);
|
||||
return workCycleStatusStatistics;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,15 +2,12 @@ package com.zhgd.xmgl.modules.bigdevice.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.LifterViolation;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.LifterWorkCycle;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.vo.StatisticsElevatorNumVo;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.vo.StatisticsElevatorViolationNumVo;
|
||||
import com.zhgd.xmgl.modules.bigdevice.mapper.LifterViolationMapper;
|
||||
import com.zhgd.xmgl.modules.bigdevice.service.LifterViolationService;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -48,23 +45,23 @@ public class LifterViolationServiceImpl extends ServiceImpl<LifterViolationMappe
|
||||
}
|
||||
|
||||
@Override
|
||||
public StatisticsElevatorNumVo queryStatisticsViolationNum(Map<String, Object> map) {
|
||||
public StatisticsElevatorViolationNumVo queryStatisticsViolationNum(Map<String, Object> map) {
|
||||
Date date = new Date();
|
||||
map.put("queryStartTime", DateUtil.today());
|
||||
map.put("queryEndTime", null);
|
||||
Integer todayRunNum = lifterViolationMapper.selectLifterViolationCount(map);
|
||||
Integer todayViolationNum = lifterViolationMapper.selectLifterViolationCount(map);
|
||||
map.put("queryStartTime", DateUtil.formatDate(DateUtil.offsetDay(date, -1)));
|
||||
map.put("queryEndTime", DateUtil.formatDateTime(DateUtil.offsetDay(date, -1)));
|
||||
Integer yesterdayRunNum = lifterViolationMapper.selectLifterViolationCount(map);
|
||||
Integer yesterdayViolationNum = lifterViolationMapper.selectLifterViolationCount(map);
|
||||
map.put("queryStartTime", DateUtil.formatDateTime(DateUtil.offsetDay(date, -30)));
|
||||
map.put("queryEndTime", null);
|
||||
Integer last30DayRunNum = lifterViolationMapper.selectLifterViolationCount(map);
|
||||
StatisticsElevatorNumVo vo = new StatisticsElevatorNumVo();
|
||||
vo.setTodayRunNum(todayRunNum);
|
||||
vo.setYesterdayRunNum(yesterdayRunNum);
|
||||
vo.setLast30DayRunNum(last30DayRunNum);
|
||||
vo.setTodayRunNumCompareYesterday(todayRunNum - yesterdayRunNum);
|
||||
vo.setTodayRunNumCompareLast30Day(todayRunNum - last30DayRunNum);
|
||||
StatisticsElevatorViolationNumVo vo = new StatisticsElevatorViolationNumVo();
|
||||
vo.setTodayViolationNum(todayViolationNum);
|
||||
vo.setYesterdayViolationNum(yesterdayViolationNum);
|
||||
vo.setLast30DayViolationNum(last30DayRunNum);
|
||||
vo.setTodayViolationNumCompareYesterday(todayViolationNum - yesterdayViolationNum);
|
||||
vo.setTodayViolationNumCompareLast30Day(todayViolationNum - last30DayRunNum);
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
|
||||
@ -564,14 +564,17 @@ public class TowerAlarmServiceImpl extends ServiceImpl<TowerAlarmMapper, TowerAl
|
||||
List<TowerAlarm> towerAlarms = towerAlarmMapper.queryAlarmsByTime(map);
|
||||
Map<String, Integer> countTowerAlarmByTypeMap = countTowerAlarmByType(towerAlarms);
|
||||
List<AlarmsDistinguishedNumberByAlarmType.TypeNum> typeNums = new ArrayList<>();
|
||||
Integer alarmCount = 0;
|
||||
for (Map.Entry<String, Integer> entry : countTowerAlarmByTypeMap.entrySet()) {
|
||||
AlarmsDistinguishedNumberByAlarmType.TypeNum typeNum = new AlarmsDistinguishedNumberByAlarmType.TypeNum();
|
||||
Integer value = entry.getValue();
|
||||
typeNum.setType(entry.getKey());
|
||||
typeNum.setNum(entry.getValue());
|
||||
typeNum.setNum(value);
|
||||
typeNums.add(typeNum);
|
||||
alarmCount += value;
|
||||
}
|
||||
Integer count = countTowerAlarmByTypeMap.size();
|
||||
AlarmsDistinguishedNumberByAlarmType rt = new AlarmsDistinguishedNumberByAlarmType();
|
||||
rt.setAlarmNum(count);
|
||||
rt.setAlarmNum(alarmCount);
|
||||
rt.setTypeNumList(typeNums);
|
||||
return rt;
|
||||
}
|
||||
@ -583,67 +586,68 @@ public class TowerAlarmServiceImpl extends ServiceImpl<TowerAlarmMapper, TowerAl
|
||||
*/
|
||||
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);
|
||||
for (TowerAlarm towerAlarm : towerAlarms) {
|
||||
if (Objects.equals(towerAlarm.getMomentAlarm(), 1)) {
|
||||
String fieldName = ReflectionUtil.getFieldName(TowerAlarm::getMomentAlarm);
|
||||
addTowerAlarmCountByType(typeNumMap, fieldName);
|
||||
typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1);
|
||||
}
|
||||
if (Objects.equals(towerAlarm.getWindSpeedAlarm(), 1)) {
|
||||
String fieldName = ReflectionUtil.getFieldName(TowerAlarm::getWindSpeedAlarm);
|
||||
addTowerAlarmCountByType(typeNumMap, fieldName);
|
||||
typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1);
|
||||
}
|
||||
if (Objects.equals(towerAlarm.getHeightAlarm(), 1)) {
|
||||
String fieldName = ReflectionUtil.getFieldName(TowerAlarm::getHeightAlarm);
|
||||
addTowerAlarmCountByType(typeNumMap, fieldName);
|
||||
typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1);
|
||||
}
|
||||
if (Objects.equals(towerAlarm.getHeightLowerAlarm(), 1)) {
|
||||
String fieldName = ReflectionUtil.getFieldName(TowerAlarm::getHeightLowerAlarm);
|
||||
addTowerAlarmCountByType(typeNumMap, fieldName);
|
||||
typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1);
|
||||
}
|
||||
if (Objects.equals(towerAlarm.getMinRangeAlarm(), 1)) {
|
||||
String fieldName = ReflectionUtil.getFieldName(TowerAlarm::getMinRangeAlarm);
|
||||
addTowerAlarmCountByType(typeNumMap, fieldName);
|
||||
typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1);
|
||||
}
|
||||
if (Objects.equals(towerAlarm.getMaxRangeAlarm(), 1)) {
|
||||
String fieldName = ReflectionUtil.getFieldName(TowerAlarm::getMaxRangeAlarm);
|
||||
addTowerAlarmCountByType(typeNumMap, fieldName);
|
||||
typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1);
|
||||
}
|
||||
if (Objects.equals(towerAlarm.getPosAngleAlarm(), 1)) {
|
||||
String fieldName = ReflectionUtil.getFieldName(TowerAlarm::getPosAngleAlarm);
|
||||
addTowerAlarmCountByType(typeNumMap, fieldName);
|
||||
typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1);
|
||||
}
|
||||
if (Objects.equals(towerAlarm.getNegAngleAlarm(), 1)) {
|
||||
String fieldName = ReflectionUtil.getFieldName(TowerAlarm::getNegAngleAlarm);
|
||||
addTowerAlarmCountByType(typeNumMap, fieldName);
|
||||
typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1);
|
||||
}
|
||||
if (Objects.equals(towerAlarm.getObliguityAlarm(), 1)) {
|
||||
String fieldName = ReflectionUtil.getFieldName(TowerAlarm::getObliguityAlarm);
|
||||
addTowerAlarmCountByType(typeNumMap, fieldName);
|
||||
typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1);
|
||||
}
|
||||
if (Objects.equals(towerAlarm.getEnvironmentAlarm(), 1)) {
|
||||
String fieldName = ReflectionUtil.getFieldName(TowerAlarm::getEnvironmentAlarm);
|
||||
addTowerAlarmCountByType(typeNumMap, fieldName);
|
||||
typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1);
|
||||
}
|
||||
if (Objects.equals(towerAlarm.getMultiAlarm(), 1)) {
|
||||
String fieldName = ReflectionUtil.getFieldName(TowerAlarm::getMultiAlarm);
|
||||
addTowerAlarmCountByType(typeNumMap, fieldName);
|
||||
typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1);
|
||||
}
|
||||
if (Objects.equals(towerAlarm.getStandardHighAlarm(), 1)) {
|
||||
String fieldName = ReflectionUtil.getFieldName(TowerAlarm::getStandardHighAlarm);
|
||||
addTowerAlarmCountByType(typeNumMap, fieldName);
|
||||
typeNumMap.put(fieldName, typeNumMap.get(fieldName) + 1);
|
||||
}
|
||||
}
|
||||
return typeNumMap;
|
||||
}
|
||||
|
||||
private void addTowerAlarmCountByType(Map<String, Integer> typeNumMap, String fieldName) {
|
||||
Integer integer = typeNumMap.get(fieldName);
|
||||
if (integer != null) {
|
||||
integer += 1;
|
||||
} else {
|
||||
integer = 1;
|
||||
}
|
||||
typeNumMap.put(fieldName, integer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -135,8 +135,7 @@ public class ProjectBimfaceServiceImpl extends ServiceImpl<ProjectBimfaceMapper,
|
||||
try {
|
||||
projectBimfaceListVO.setViewToken(bimfaceClient.getViewTokenByFileId(enableFileId));
|
||||
} catch (BimfaceException e) {
|
||||
e.printStackTrace();
|
||||
log.error(e.getMessage());
|
||||
log.error("err:", e);
|
||||
}
|
||||
} else {
|
||||
result.setMessage(fileStatus);
|
||||
|
||||
@ -6,6 +6,7 @@ import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.modules.environment.entity.ProjectTodayAlarmInfoDetailQO;
|
||||
import com.zhgd.xmgl.modules.environment.entity.ProjectTodayAlarmInfoDetailVo;
|
||||
import com.zhgd.xmgl.modules.environment.entity.ProjectTodayAlarmInfoVo;
|
||||
import com.zhgd.xmgl.modules.environment.entity.vo.EnvironmentAlarmCountTotalVo;
|
||||
import com.zhgd.xmgl.modules.environment.service.IEnvironmentAlarmService;
|
||||
import com.zhgd.xmgl.modules.project.entity.qo.QueryProjectTodayAlarmInfoQO;
|
||||
import io.swagger.annotations.Api;
|
||||
@ -38,7 +39,7 @@ import java.util.Map;
|
||||
public class EnvironmentAlarmController {
|
||||
@Autowired
|
||||
private IEnvironmentAlarmService environmentAlarmService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
|
||||
@ -91,7 +92,7 @@ public class EnvironmentAlarmController {
|
||||
@ApiImplicitParam(name = "selectType", value = "查询条件,1查询当天", paramType = "query", required = false, dataType = "String"),
|
||||
})
|
||||
@PostMapping("/selectEnvironmentAlarmCountTotal")
|
||||
public Result<Map<String, Object>> selectEnvironmentAlarmCountTotal(@RequestBody Map<String, Object> map) {
|
||||
public Result<EnvironmentAlarmCountTotalVo> selectEnvironmentAlarmCountTotal(@RequestBody Map<String, Object> map) {
|
||||
return Result.success(environmentAlarmService.selectEnvironmentAlarmCountTotal(map));
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
package com.zhgd.xmgl.modules.environment.entity.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class EnvironmentAlarmCountTotalVo {
|
||||
@ApiModelProperty(value = "报警总数")
|
||||
private String totalAlarm;
|
||||
@ApiModelProperty(value = "pm2.5报警数")
|
||||
private Integer pm25Num;
|
||||
@ApiModelProperty(value = "pm10报警数")
|
||||
private Integer pm10Num;
|
||||
@ApiModelProperty(value = "白天噪音或夜晚噪音报警数")
|
||||
private Integer noiseNum;
|
||||
@ApiModelProperty(value = "风速报警数")
|
||||
private Integer windspeedNum;
|
||||
@ApiModelProperty(value = "TSP报警数")
|
||||
private Integer tspNum;
|
||||
@ApiModelProperty(value = "温度报警数")
|
||||
private Integer temperatureNum;
|
||||
@ApiModelProperty(value = "湿度报警数")
|
||||
private Integer humidityNum;
|
||||
|
||||
}
|
||||
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.modules.environment.entity.*;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zhgd.xmgl.modules.environment.entity.vo.EnvironmentAlarmCountTotalVo;
|
||||
import com.zhgd.xmgl.modules.project.entity.qo.QueryProjectTodayAlarmInfoQO;
|
||||
|
||||
import java.util.List;
|
||||
@ -26,7 +27,7 @@ public interface IEnvironmentAlarmService extends IService<EnvironmentAlarm> {
|
||||
|
||||
Map<String,Object> selectHistoryEnvironmentAlarmList(Map<String, Object> map);
|
||||
|
||||
Map<String,Object> selectEnvironmentAlarmCountTotal(Map<String, Object> map);
|
||||
EnvironmentAlarmCountTotalVo selectEnvironmentAlarmCountTotal(Map<String, Object> map);
|
||||
|
||||
void saveEnvironmentAlarmImage(JSONObject json);
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.zhgd.xmgl.modules.environment.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.xuyanwu.spring.file.storage.FileInfo;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -13,6 +14,7 @@ import com.zhgd.xmgl.modules.basicdata.service.INoticeService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.UploadFileService;
|
||||
import com.zhgd.xmgl.modules.bigdevice.mapper.BigDeviceVideoMapper;
|
||||
import com.zhgd.xmgl.modules.environment.entity.*;
|
||||
import com.zhgd.xmgl.modules.environment.entity.vo.EnvironmentAlarmCountTotalVo;
|
||||
import com.zhgd.xmgl.modules.environment.mapper.EnvironmentAlarmMapper;
|
||||
import com.zhgd.xmgl.modules.environment.mapper.EnvironmentWarningMapper;
|
||||
import com.zhgd.xmgl.modules.environment.service.IEnvironmentAlarmService;
|
||||
@ -791,9 +793,11 @@ public class EnvironmentAlarmServiceImpl extends ServiceImpl<EnvironmentAlarmMap
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> selectEnvironmentAlarmCountTotal(Map<String, Object> map) {
|
||||
map.put("companyType","4");
|
||||
return environmentAlarmMapper.selectEnvironmentAlarmCountTotal(map);
|
||||
public EnvironmentAlarmCountTotalVo selectEnvironmentAlarmCountTotal(Map<String, Object> map) {
|
||||
map.put("companyType", "4");
|
||||
Map<String, Object> rtMap = environmentAlarmMapper.selectEnvironmentAlarmCountTotal(map);
|
||||
EnvironmentAlarmCountTotalVo vo = BeanUtil.toBeanIgnoreCase(rtMap, EnvironmentAlarmCountTotalVo.class, true);
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -647,17 +647,24 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
||||
String authorization = "hmac username=\"" + fmsMonitoringScreenUsername + "\", algorithm=\"" + algorithm + "\", headers=\"date request-line\", signature=\"" + signature + "\"";
|
||||
String accessUrl = fmsMonitoringScreenRequestHost + "/api-gateway/v2/system/getAccessToken";
|
||||
log.info("accessUrl:{},authorization:{},date:{}", accessUrl, authorization, gmtTime);
|
||||
String rs = HttpRequest.get(accessUrl)
|
||||
.header("authorization", authorization)
|
||||
.header("date", gmtTime)
|
||||
.execute().body();
|
||||
log.info("rs(获取access_token):{}", rs);
|
||||
JSONObject tokenJsonObject = com.alibaba.fastjson.JSON.parseObject(rs);
|
||||
if (!tokenJsonObject.getBoolean("success")) {
|
||||
JSONObject tokenJsonObject = null;
|
||||
String token;
|
||||
try {
|
||||
String rs = HttpRequest.get(accessUrl)
|
||||
.header("authorization", authorization)
|
||||
.header("date", gmtTime)
|
||||
.execute().body();
|
||||
log.info("rs(获取access_token):{}", rs);
|
||||
tokenJsonObject = com.alibaba.fastjson.JSON.parseObject(rs);
|
||||
if (!tokenJsonObject.getBoolean("success")) {
|
||||
throw new OpenAlertException(MessageUtil.get("thirdErr"));
|
||||
}
|
||||
JSONObject dataJSONObject = tokenJsonObject.getJSONObject("data");
|
||||
token = dataJSONObject.getString("token");
|
||||
} catch (Exception e) {
|
||||
log.error("err:", e);
|
||||
throw new OpenAlertException(MessageUtil.get("thirdErr"));
|
||||
}
|
||||
JSONObject dataJSONObject = tokenJsonObject.getJSONObject("data");
|
||||
String token = dataJSONObject.getString("token");
|
||||
|
||||
//返回url
|
||||
String url = fmsMonitoringScreenPageUrl + token;
|
||||
|
||||
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.zhgd.annotation.OperLog;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.entity.vo.AttendanceOfEachCompanyVo;
|
||||
import com.zhgd.xmgl.entity.vo.NumberTimeTableVo;
|
||||
import com.zhgd.xmgl.modules.worker.service.IWorkerAttendanceService;
|
||||
import com.zhgd.xmgl.util.ExcelUtils;
|
||||
@ -210,4 +211,16 @@ public class WorkerAttendanceController {
|
||||
return Result.success(workerAttendanceService.queryAttendanceTrendOfTheLastWeek(map));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询每个公司的出勤人数和统计人数", notes = "查询每个公司的出勤人数和统计人数", httpMethod = "GET")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "query", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "type", value = "类型,1查询前十", paramType = "query", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "userEnterpriseId", value = "用户能查看的企业", paramType = "query", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "personType", value = "人员类型 1、劳务人员 2、管理人员,不传查所有", paramType = "query", required = false, dataType = "String"),
|
||||
})
|
||||
@GetMapping(value = "/queryAttendanceOfEachCompany")
|
||||
public Result<AttendanceOfEachCompanyVo> queryAttendanceOfEachCompany(@RequestParam Map<String, Object> map) {
|
||||
return Result.success(workerAttendanceService.queryAttendanceOfEachCompany(map));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package com.zhgd.xmgl.modules.worker.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.zhgd.annotation.OperLog;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
@ -10,6 +9,7 @@ import com.zhgd.redis.annotation.ApiIdempotent;
|
||||
import com.zhgd.xmgl.modules.worker.entity.WorkerInfo;
|
||||
import com.zhgd.xmgl.modules.worker.entity.vo.DeclareAgeVO;
|
||||
import com.zhgd.xmgl.modules.worker.entity.vo.PersonnelSituationVO;
|
||||
import com.zhgd.xmgl.modules.worker.entity.vo.ProjectCompanyWorkTotal;
|
||||
import com.zhgd.xmgl.modules.worker.entity.vo.WorkerInfoDetailsVo;
|
||||
import com.zhgd.xmgl.modules.worker.service.IWorkerInfoService;
|
||||
import com.zhgd.xmgl.util.MessageUtil;
|
||||
@ -353,7 +353,7 @@ public class WorkerInfoController {
|
||||
@ApiImplicitParam(name = "personType", value = "人员类型 1、劳务人员 2、管理人员,不传查所有", paramType = "query", required = false, dataType = "String"),
|
||||
})
|
||||
@PostMapping("/selectProjectComapnyWorkTotalList")
|
||||
public Result<List<EntityMap>> selectProjectComapnyWorkTotalList(@RequestBody Map<String, Object> map) {
|
||||
public Result<List<ProjectCompanyWorkTotal>> selectProjectComapnyWorkTotalList(@RequestBody Map<String, Object> map) {
|
||||
return Result.success(workerInfoService.selectProjectComapnyWorkTotalList(map));
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
package com.zhgd.xmgl.modules.worker.entity.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ProjectCompanyWorkTotal {
|
||||
|
||||
@ApiModelProperty(value = "出勤人数")
|
||||
private Integer presencePersonNum;
|
||||
@ApiModelProperty(value = "在场人数")
|
||||
private Integer attendancePersonNum;
|
||||
@ApiModelProperty(value = "在册人数")
|
||||
private Integer totalPersonNum;
|
||||
@ApiModelProperty(value = "企业id")
|
||||
private String enterpriseId;
|
||||
@ApiModelProperty(value = "企业名称")
|
||||
private String enterpriseName;
|
||||
|
||||
}
|
||||
@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.entity.vo.AttendanceOfEachCompanyVo;
|
||||
import com.zhgd.xmgl.entity.vo.NumberTimeTableVo;
|
||||
import com.zhgd.xmgl.modules.worker.entity.WorkerAttendance;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
@ -72,4 +73,6 @@ public interface IWorkerAttendanceService extends IService<WorkerAttendance> {
|
||||
List<NumberTimeTableVo> queryTodaySAttendanceTrend(Map<String, Object> map);
|
||||
|
||||
List<NumberTimeTableVo> queryAttendanceTrendOfTheLastWeek(Map<String, Object> map);
|
||||
|
||||
AttendanceOfEachCompanyVo queryAttendanceOfEachCompany(Map<String, Object> map);
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@ import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.modules.worker.entity.WorkerInfo;
|
||||
import com.zhgd.xmgl.modules.worker.entity.vo.DeclareAgeVO;
|
||||
import com.zhgd.xmgl.modules.worker.entity.vo.PersonnelSituationVO;
|
||||
import com.zhgd.xmgl.modules.worker.entity.vo.ProjectCompanyWorkTotal;
|
||||
import com.zhgd.xmgl.modules.worker.entity.vo.WorkerInfoDetailsVo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@ -66,7 +67,7 @@ public interface IWorkerInfoService extends IService<WorkerInfo> {
|
||||
|
||||
void exporZipWorkerInfo(HttpServletResponse response, Map<String, Object> map);
|
||||
|
||||
List<EntityMap> selectProjectComapnyWorkTotalList(Map<String, Object> map);
|
||||
List<ProjectCompanyWorkTotal> selectProjectComapnyWorkTotalList(Map<String, Object> map);
|
||||
|
||||
List<EntityMap> selectProjectTeamWorkTotalList(Map<String, Object> map);
|
||||
|
||||
|
||||
@ -17,6 +17,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.async.AsyncSendAttendance;
|
||||
import com.zhgd.xmgl.entity.vo.AttendanceOfEachCompanyVo;
|
||||
import com.zhgd.xmgl.entity.vo.NumberTimeTableVo;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.ICompanyService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.UploadFileService;
|
||||
@ -26,8 +27,10 @@ import com.zhgd.xmgl.modules.project.mapper.ProjectUfaceConfigMapper;
|
||||
import com.zhgd.xmgl.modules.worker.entity.*;
|
||||
import com.zhgd.xmgl.modules.worker.entity.bo.WorkerAttendanceBo;
|
||||
import com.zhgd.xmgl.modules.worker.entity.dto.GetPassRecordDto;
|
||||
import com.zhgd.xmgl.modules.worker.entity.vo.ProjectCompanyWorkTotal;
|
||||
import com.zhgd.xmgl.modules.worker.mapper.*;
|
||||
import com.zhgd.xmgl.modules.worker.service.IWorkerAttendanceService;
|
||||
import com.zhgd.xmgl.modules.worker.service.IWorkerInfoService;
|
||||
import com.zhgd.xmgl.modules.worker.service.IWorkerMonthAttendanceStatisticsService;
|
||||
import com.zhgd.xmgl.util.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -59,6 +62,8 @@ import static com.zhgd.xmgl.config.FaceRunner.faceEngine;
|
||||
@Slf4j
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class WorkerAttendanceServiceImpl extends ServiceImpl<WorkerAttendanceMapper, WorkerAttendance> implements IWorkerAttendanceService {
|
||||
@Autowired
|
||||
private IWorkerInfoService workerInfoService;
|
||||
@Autowired
|
||||
private WorkerAttendancePresenceServiceImpl workerAttendancePresenceService;
|
||||
@Autowired
|
||||
@ -1030,6 +1035,17 @@ status 状态码 String 1表示成功;其余表示失败
|
||||
return attendances;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AttendanceOfEachCompanyVo queryAttendanceOfEachCompany(Map<String, Object> map) {
|
||||
//统计各企业出勤人数
|
||||
List<ProjectCompanyWorkTotal> projectCompanyWorkTotals = workerInfoService.selectProjectComapnyWorkTotalList(map);
|
||||
int presencePersonNum = projectCompanyWorkTotals.stream().mapToInt(ProjectCompanyWorkTotal::getPresencePersonNum).sum();
|
||||
AttendanceOfEachCompanyVo vo = new AttendanceOfEachCompanyVo();
|
||||
vo.setAttendanceNum(presencePersonNum);
|
||||
vo.setProjectCompanyWorkTotalList(projectCompanyWorkTotals);
|
||||
return vo;
|
||||
}
|
||||
|
||||
private void completeData(List<NumberTimeTableVo> attendances) {
|
||||
Map<String, NumberTimeTableVo> timeMap = attendances.stream().collect(Collectors.toMap(NumberTimeTableVo::getTime, o -> o));
|
||||
attendances.clear();
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.zhgd.xmgl.modules.worker.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
@ -29,6 +30,7 @@ import com.zhgd.xmgl.modules.project.service.IProjectUfaceConfigService;
|
||||
import com.zhgd.xmgl.modules.worker.entity.*;
|
||||
import com.zhgd.xmgl.modules.worker.entity.vo.DeclareAgeVO;
|
||||
import com.zhgd.xmgl.modules.worker.entity.vo.PersonnelSituationVO;
|
||||
import com.zhgd.xmgl.modules.worker.entity.vo.ProjectCompanyWorkTotal;
|
||||
import com.zhgd.xmgl.modules.worker.entity.vo.WorkerInfoDetailsVo;
|
||||
import com.zhgd.xmgl.modules.worker.enums.EduTypeEnum;
|
||||
import com.zhgd.xmgl.modules.worker.mapper.*;
|
||||
@ -936,7 +938,7 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EntityMap> selectProjectComapnyWorkTotalList(Map<String, Object> map) {
|
||||
public List<ProjectCompanyWorkTotal> selectProjectComapnyWorkTotalList(Map<String, Object> map) {
|
||||
List<EntityMap> list = workerInfoMapper.selectProjectEnterpriseList(map);
|
||||
if (list != null && list.size() > 0) {
|
||||
//统计各企业出勤人数
|
||||
@ -981,7 +983,8 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
List<ProjectCompanyWorkTotal> rtList = list.stream().map(e -> BeanUtil.toBeanIgnoreCase(e, ProjectCompanyWorkTotal.class, true)).collect(Collectors.toList());
|
||||
return rtList;
|
||||
}
|
||||
|
||||
private Map<String, Object> getEnterpriseToMap(List<Map<String, Object>> list) {
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
# \u73AF\u5883\u9009\u62E9
|
||||
# 环境选择
|
||||
spring.profiles.active=zjsj-gsx
|
||||
# \u56FD\u9645\u5316\u914D\u7F6E
|
||||
# 国际化配置
|
||||
spring.messages.basename=i18n/messages
|
||||
spring.messages.encoding=utf-8
|
||||
# \u540E\u53D1\u73B0\u7684bean\u4F1A\u8986\u76D6\u4E4B\u524D\u76F8\u540C\u540D\u79F0\u7684bean
|
||||
# 后发现的bean会覆盖之前相同名称的bean
|
||||
spring.main.allow-bean-definition-overriding=true
|
||||
# \u6570\u636E\u5E93\u9A71\u52A8\u7C7B
|
||||
# 数据库驱动类
|
||||
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
|
||||
#spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
# \u6570\u636E\u5E93\u8FDE\u63A5\u6C60\u914D\u7F6E
|
||||
# 数据库连接池配置
|
||||
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
|
||||
spring.datasource.hikari.minimum-idle=20
|
||||
spring.datasource.hikari.maximum-pool-size=500
|
||||
@ -20,38 +20,38 @@ spring.datasource.hikari.validation-timeout=3000
|
||||
#(wait_timeout-30)*1000
|
||||
spring.datasource.hikari.connection-timeout=50000
|
||||
spring.datasource.hikari.connection-test-query=SELECT 1
|
||||
# \u6570\u636E\u5E93\u52A0\u5BC6\u7B7E\u540D
|
||||
# 数据库加密签名
|
||||
jasypt.encryptor.password=JXJZHGDPT
|
||||
# \u5982\u679C\u67E5\u8BE2\u7ED3\u679C\u4E2D\u5305\u542B\u7A7A\u503C\u7684\u5217\uFF0C\u5219 MyBatis \u5728\u6620\u5C04\u7684\u65F6\u5019\uFF0C\u4F1A\u4E0D\u4F1A\u6620\u5C04\u8FD9\u4E2A\u5B57\u6BB5
|
||||
# 如果查询结果中包含空值的列,则 mybatis 在映射的时候,会不会映射这个字段
|
||||
mybatis-plus.configuration.call-setters-on-nulls=true
|
||||
# \u5E8F\u5217\u5316\u914D\u7F6E
|
||||
# 序列化配置
|
||||
spring.jackson.defaultPropertyInclusion=ALWAYS
|
||||
# mybatis \u914D\u7F6E
|
||||
# mybatis 配置
|
||||
mybatis-plus.mapper-locations=classpath*:com/zhgd/xmgl/**/*.xml,classpath*:com/zhwl/zw/**/*.xml
|
||||
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
# 全局逻辑删除的实体字段名(since 3.3.0,配置后可以忽略不配置步骤2)
|
||||
#mybatis-plus.global-config.db-config.logic-delete-field=flag
|
||||
mybatis-plus.global-config.db-config.logic-delete-value=1
|
||||
mybatis-plus.global-config.db-config.logic-not-delete-value=0
|
||||
# mvc \u89C6\u56FE\u5BF9\u8C61\u914D\u7F6E
|
||||
# mvc 视图对象配置
|
||||
spring.mvc.view.prefix=/
|
||||
spring.mvc.view.suffix=.html
|
||||
spring.mvc.dispatch-options-request=true
|
||||
# jwt\u7B7E\u540D
|
||||
# jwt签名
|
||||
security.jwt.token.secret-key=zhgd
|
||||
# \u6587\u4EF6\u4E0A\u4F20\u914D\u7F6E
|
||||
# 文件上传配置
|
||||
spring.servlet.multipart.enabled=true
|
||||
spring.servlet.multipart.file-size-threshold=0
|
||||
spring.servlet.multipart.max-file-size=1024MB
|
||||
spring.servlet.multipart.max-request-size=1024MB
|
||||
spring.servlet.multipart.resolve-lazily=false
|
||||
# mqtt\u670D\u52A1\u5668\u914D\u7F6E
|
||||
# mqtt服务器配置
|
||||
mqtt.username=admin
|
||||
mqtt.password=public
|
||||
#mqtt.url=tcp://139.159.226.224:1883
|
||||
#mqtt.url=ws://139.159.226.224:8083/mqtt
|
||||
mqtt.url=tcp://182.90.224.147:1883
|
||||
# \u6D88\u8D39\u8005\u548C\u63D0\u4F9B\u8005\u5BF9\u5E94\u7684\u5BA2\u6237\u7AEFid\u4EE5\u53CA\u9ED8\u8BA4topic
|
||||
# 消费者和提供者对应的客户端id以及默认topic
|
||||
mqtt.producer.clientId=mqttProd
|
||||
mqtt.producer.defaultTopic=topic1
|
||||
mqtt.consumer.clientId=mqttConsumer
|
||||
@ -63,21 +63,21 @@ server.ssl.key-store-password=Un8&yP!o^Nyd*gm#
|
||||
server.ssl.key-store-type=JKS
|
||||
server.ssl.enabled=true
|
||||
image.visit.url=
|
||||
# \u534E\u4E3A\u4E91\u914D\u7F6E
|
||||
# 华为云配置
|
||||
hw-ocr-username=szjxjzh
|
||||
hw-ocr-password=jxj27696951
|
||||
hw-ocr-domainname=szjxjzh
|
||||
hw-ocr-projectid=0633b705cc000f3e2f55c010af021eec
|
||||
hw-ocr-endpoint=cn-east-3
|
||||
hw-ocr-enable=false
|
||||
# \u8679\u8F6F\u914D\u7F6E
|
||||
# 虹软配置
|
||||
arcsoft.appId=4F9jmKsCYKsQskYBTXK7sQZLH8dFdT7LK5Yjx5XA8gkB
|
||||
arcsoft.sdkKey=FUPhPPfPXrAmFrecmCSiG5BjmHSwp86QogvdCM7g8B5k
|
||||
arcsoft.linux.sdkKey=FUPhPPfPXrAmFrecmCSiG5BjdAskGRSejyGzUuVj4F6V
|
||||
arcsoft.ufaceSorce=80
|
||||
# \u6388\u6743\u6821\u9A8C
|
||||
# 授权校验
|
||||
checkAuthEnable=false
|
||||
# \u534E\u4E3A\u4E91\u77ED\u4FE1\u670D\u52A1\u914D\u7F6E
|
||||
# 华为云短信服务配置
|
||||
sms.hw.appKey=JxU82mBx1x4l4RC78ynN1D9Q3neI
|
||||
sms.hw.appSecret=c9wi20z1z5N1YZ2T6UH2BJuTUAF4
|
||||
sms.hw.verify.signchannel=88200413256
|
||||
@ -87,7 +87,7 @@ sms.hw.notice.templateId.standardAlarm=790d907f70594b4893227fc1d97e78bc
|
||||
sms.hw.notice.templateId.standardDevState=10930770f5954d12881143e548f8483b
|
||||
sms.hw.notice.templateId.carPass=
|
||||
swagger.enable=true
|
||||
# redis\u96C6\u7FA4
|
||||
# redis集群
|
||||
#spring.redis.database=0
|
||||
#spring.redis.cluster.nodes=127.0.0.1:6379,192.168.40.156:6380
|
||||
#spring.redis.cluster.max-redirects=3
|
||||
@ -98,22 +98,22 @@ swagger.enable=true
|
||||
#spring.redis.lettuce.pool.min-idle=5
|
||||
#\u4E2A\u63A8\u914D\u7F6E
|
||||
getui.baseUrl=https://restapi.getui.com/v2/
|
||||
# \u65B0\u914D\u7F6E
|
||||
# 新配置
|
||||
getui.appId=vTqRdzRpeI8SnXKDawStZ3
|
||||
getui.appKey=wlPjAki13R8STuofcjnXM1
|
||||
getui.appSecret=Wy3FFyaXzb9MUl94FMrLo1
|
||||
getui.masterSecret=zZ5bMTOjUe5v3MFhm8gLL
|
||||
#\u5224\u65AD\u8003\u52E4\u56DE\u8C03\u662F\u5426\u9700\u8981\u56FE\u7247,1\u662F
|
||||
# \u4EBA\u5458\u8003\u52E4\u56FE\u7247\u7C7B\u578B 1\uFF1Abase64
|
||||
# 人员考勤图片类型 1:base64
|
||||
imageType=1
|
||||
# jxj\u8BBE\u5907\u56FE\u7247\u7C7B\u578B
|
||||
# jxj设备图片类型
|
||||
jxj.dev.image.type=1
|
||||
pdf.watermark=\u5B9E\u540D\u5236
|
||||
# bimface\u8BF7\u6C42URL
|
||||
# bimface请求url
|
||||
bim.getTokenURL=https://api.bimface.com/oauth2/token
|
||||
bim.deleteFileURL=https://file.bimface.com/file?fileId=%s
|
||||
bim.uploadURL=https://file.bimface.com/upload?name=%s&url=%s
|
||||
# redis \u5355\u4F53\u914D\u7F6E
|
||||
# redis 单体配置
|
||||
spring.redis.database=1
|
||||
spring.redis.host=127.0.0.1
|
||||
spring.redis.port=6379
|
||||
@ -124,28 +124,28 @@ spring.redis.lettuce.pool.max-active=8
|
||||
spring.redis.lettuce.pool.max-wait=60s
|
||||
spring.redis.lettuce.pool.max-idle=10
|
||||
spring.redis.lettuce.pool.min-idle=10
|
||||
# spring boot admin \u6240\u5728\u670D\u52A1\u5668
|
||||
# spring boot admin 所在服务器
|
||||
spring.boot.admin.client.url=http://localhost:9091
|
||||
# actuator \u914D\u7F6E\u5185\u5BB9
|
||||
# actuator 配置内容
|
||||
management.endpoints.web.exposure.include=*
|
||||
management.endpoints.enabled-by-default=true
|
||||
management.endpoints.web.base-path=/actuator
|
||||
management.endpoint.health.show-details=always
|
||||
management.endpoint.logfile.external-file=logs/logs/zhgd-all.log
|
||||
# \u643A\u7A33\u7535\u7BB1\u83B7\u53D6\u6700\u540E\u4E00\u6761\u6570\u636E
|
||||
# 携稳电箱获取最后一条数据
|
||||
xiwon.postElectricRealTimeData=http://openapi.xiwon588.com/electric/realTimeData
|
||||
# \u643A\u7A33\u5BC6\u94A5
|
||||
# 携稳密钥
|
||||
#xiwon.appId=1638947489842
|
||||
#xiwon.appSecret=36e0a5cf-02e6-421b-bf92-3b1ace11e1a2
|
||||
# \u6B63\u5F0F
|
||||
# 正式
|
||||
xiwon.appId=1672383573694
|
||||
xiwon.appSecret=5dfe1664-51fd-40af-8fbb-a15bbcaae1d1
|
||||
# \u5149\u4F0F\u53D1\u7535\u5BA2\u6237\u4FE1\u606F
|
||||
# 光伏发电客户信息
|
||||
koyoe.clientId=btxny
|
||||
koyoe.secret=akdu5sar7w
|
||||
# \u5149\u4F0F\u53D1\u7535\u8BF7\u6C42\u5730\u5740
|
||||
# 光伏发电请求地址
|
||||
koyoe.base-url=https://solar.koyoe.com
|
||||
koyoe.get-token=${koyoe.base-url}/third-party/api/token?grant_type=client_credentials
|
||||
koyoe.nowData=${koyoe.base-url}/third-party/api/nowData?sn=%s
|
||||
# \u662F\u5426\u8BC1\u4E66\u9A8C\u8BC1
|
||||
# 是否证书验证
|
||||
is-license=false
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user