bug修复
This commit is contained in:
parent
1f02242018
commit
3ea38f4805
@ -1,13 +1,24 @@
|
|||||||
package com.zhgd.xmgl.modules.bigdevice.service.impl;
|
package com.zhgd.xmgl.modules.bigdevice.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.entity.BigDeviceDriverRecord;
|
import com.zhgd.xmgl.modules.bigdevice.entity.BigDeviceDriverRecord;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.mapper.BigDeviceDriverRecordMapper;
|
import com.zhgd.xmgl.modules.bigdevice.mapper.BigDeviceDriverRecordMapper;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.service.IBigDeviceDriverRecordService;
|
import com.zhgd.xmgl.modules.bigdevice.service.IBigDeviceDriverRecordService;
|
||||||
|
import com.zhgd.xmgl.modules.worker.entity.WorkerCertificate;
|
||||||
|
import com.zhgd.xmgl.modules.worker.entity.WorkerInfo;
|
||||||
|
import com.zhgd.xmgl.modules.worker.service.IWorkerCertificateService;
|
||||||
|
import com.zhgd.xmgl.modules.worker.service.IWorkerInfoService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 塔吊升降机驾驶员记录
|
* @Description: 塔吊升降机驾驶员记录
|
||||||
@ -17,6 +28,13 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class BigDeviceDriverRecordServiceImpl extends ServiceImpl<BigDeviceDriverRecordMapper, BigDeviceDriverRecord> implements IBigDeviceDriverRecordService {
|
public class BigDeviceDriverRecordServiceImpl extends ServiceImpl<BigDeviceDriverRecordMapper, BigDeviceDriverRecord> implements IBigDeviceDriverRecordService {
|
||||||
|
@Lazy
|
||||||
|
@Autowired
|
||||||
|
private IWorkerInfoService workerInfoService;
|
||||||
|
@Lazy
|
||||||
|
@Autowired
|
||||||
|
private IWorkerCertificateService workerCertificateService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void saveBigDeviceDriverRecord(List<BigDeviceDriverRecord> driverList, String bigDevId, String projectSn, int type) {
|
public void saveBigDeviceDriverRecord(List<BigDeviceDriverRecord> driverList, String bigDevId, String projectSn, int type) {
|
||||||
QueryWrapper<BigDeviceDriverRecord> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<BigDeviceDriverRecord> queryWrapper = new QueryWrapper<>();
|
||||||
@ -25,7 +43,23 @@ public class BigDeviceDriverRecordServiceImpl extends ServiceImpl<BigDeviceDrive
|
|||||||
.eq(BigDeviceDriverRecord::getType, type);
|
.eq(BigDeviceDriverRecord::getType, type);
|
||||||
baseMapper.delete(queryWrapper);
|
baseMapper.delete(queryWrapper);
|
||||||
if (driverList != null && driverList.size() > 0) {
|
if (driverList != null && driverList.size() > 0) {
|
||||||
|
List<Long> workerIds = driverList.stream().map(BigDeviceDriverRecord::getWorkerId).collect(Collectors.toList());
|
||||||
|
Map<Long, WorkerInfo> workerMap = workerInfoService.list(new LambdaQueryWrapper<WorkerInfo>()
|
||||||
|
.in(WorkerInfo::getId, workerIds)).stream().collect(Collectors.toMap(WorkerInfo::getId, Function.identity(), (o1, o2) -> o1));
|
||||||
|
Map<Long, WorkerCertificate> certificateMap = workerCertificateService.list(new LambdaQueryWrapper<WorkerCertificate>()
|
||||||
|
.in(WorkerCertificate::getWorkerId, workerIds)).stream().filter(t -> getCerType(type, t.getId())).collect(Collectors.toMap(WorkerCertificate::getWorkerId, Function.identity(), (o1, o2) -> o1));
|
||||||
for (BigDeviceDriverRecord deviceDriverRecord : driverList) {
|
for (BigDeviceDriverRecord deviceDriverRecord : driverList) {
|
||||||
|
WorkerInfo workerInfo = workerMap.get(deviceDriverRecord.getWorkerId());
|
||||||
|
if (workerInfo != null) {
|
||||||
|
deviceDriverRecord.setDriverName(workerInfo.getWorkerName());
|
||||||
|
deviceDriverRecord.setDriverIdCard(workerInfo.getIdCard());
|
||||||
|
deviceDriverRecord.setDriverPhone(workerInfo.getPhoneNumber());
|
||||||
|
deviceDriverRecord.setImageUrl(workerInfo.getFieldAcquisitionUrl());
|
||||||
|
WorkerCertificate certificate = certificateMap.get(deviceDriverRecord.getWorkerId());
|
||||||
|
if (certificate != null) {
|
||||||
|
deviceDriverRecord.setCertificateNumber(certificate.getCertificateNumber());
|
||||||
|
}
|
||||||
|
}
|
||||||
deviceDriverRecord.setProjectSn(projectSn);
|
deviceDriverRecord.setProjectSn(projectSn);
|
||||||
deviceDriverRecord.setType(type);
|
deviceDriverRecord.setType(type);
|
||||||
deviceDriverRecord.setDevSn(bigDevId);
|
deviceDriverRecord.setDevSn(bigDevId);
|
||||||
@ -33,4 +67,19 @@ public class BigDeviceDriverRecordServiceImpl extends ServiceImpl<BigDeviceDrive
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取特种证书的id
|
||||||
|
*
|
||||||
|
* @param type
|
||||||
|
* @param cerId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private boolean getCerType(int type, Long cerId) {
|
||||||
|
long b = 0L;
|
||||||
|
if (Objects.equals(type, 7)) {
|
||||||
|
b = 88L;
|
||||||
|
}
|
||||||
|
return Objects.equals(cerId, b);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,6 +48,8 @@ public interface BridgeCraneAlarmMapper extends BaseMapper<BridgeCraneAlarm> {
|
|||||||
|
|
||||||
Integer countAlarmNumToday(HashMap<String, Object> paramMap);
|
Integer countAlarmNumToday(HashMap<String, Object> paramMap);
|
||||||
|
|
||||||
|
Integer countAlarmNumYesterday(HashMap<String, Object> paramMap);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 统计昨日报警次数
|
* 统计昨日报警次数
|
||||||
*
|
*
|
||||||
|
|||||||
@ -15,14 +15,14 @@
|
|||||||
<select id="getNewestBridgeCraneAlarms"
|
<select id="getNewestBridgeCraneAlarms"
|
||||||
resultType="com.zhgd.xmgl.modules.bridgeCrane.entity.vo.NewestBridgeCraneAlarmsVo">
|
resultType="com.zhgd.xmgl.modules.bridgeCrane.entity.vo.NewestBridgeCraneAlarmsVo">
|
||||||
select
|
select
|
||||||
t.alarm_type_code
|
t.monitor_param_code
|
||||||
,max( t.alarm_time) as alarm_time
|
,max( t.alarm_time) as alarm_time
|
||||||
from bridge_crane_alarm t
|
from bridge_crane_alarm t
|
||||||
where t.project_sn=#{projectSn}
|
where t.project_sn=#{projectSn}
|
||||||
<if test="devId != null and devId != ''">
|
<if test="devId != null and devId != ''">
|
||||||
and t.dev_id = #{devId}
|
and t.dev_id = #{devId}
|
||||||
</if>
|
</if>
|
||||||
group by t.alarm_type_code
|
group by t.monitor_param_code
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="countAlarmNumToday" resultType="java.lang.Integer">
|
<select id="countAlarmNumToday" resultType="java.lang.Integer">
|
||||||
@ -36,6 +36,17 @@
|
|||||||
and t.dev_id = #{devId}
|
and t.dev_id = #{devId}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="countAlarmNumYesterday" resultType="java.lang.Integer">
|
||||||
|
select
|
||||||
|
count(*)
|
||||||
|
from bridge_crane_alarm t
|
||||||
|
where t.project_sn = #{projectSn}
|
||||||
|
and t.alarm_time >= date_sub(current_date,interval 1 day)
|
||||||
|
AND t.alarm_time <= CONCAT(date_sub(current_date,interval 1 day), ' 23:59:59')
|
||||||
|
<if test="devId != null and devId != ''">
|
||||||
|
and t.dev_id = #{devId}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="countAlarmYesterday" resultType="java.lang.Integer">
|
<select id="countAlarmYesterday" resultType="java.lang.Integer">
|
||||||
select
|
select
|
||||||
|
|||||||
@ -76,7 +76,7 @@
|
|||||||
group by dev_sn
|
group by dev_sn
|
||||||
)t1 on t.dev_sn=t1.dev_sn and t1.id=t.id
|
)t1 on t.dev_sn=t1.dev_sn and t1.id=t.id
|
||||||
) bddr on t.dev_id = bddr.dev_sn
|
) bddr on t.dev_id = bddr.dev_sn
|
||||||
where t.project_sn = #{projectSn}
|
where t.project_sn = #{projectSn} and bddr.driver_name is not null and bddr.driver_name != ''
|
||||||
<if test="devId != null and devId != ''">
|
<if test="devId != null and devId != ''">
|
||||||
and t.dev_id = #{devId}
|
and t.dev_id = #{devId}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@ -85,6 +85,8 @@ public interface IBridgeCraneAlarmService extends IService<BridgeCraneAlarm> {
|
|||||||
*/
|
*/
|
||||||
Integer countAlarmNumToday(HashMap<String, Object> paramMap);
|
Integer countAlarmNumToday(HashMap<String, Object> paramMap);
|
||||||
|
|
||||||
|
Integer countAlarmNumYesterday(HashMap<String, Object> paramMap);
|
||||||
|
|
||||||
CountBridgeCraneAlarmTodayVo countAlarmToday(HashMap<String, Object> paramMap);
|
CountBridgeCraneAlarmTodayVo countAlarmToday(HashMap<String, Object> paramMap);
|
||||||
|
|
||||||
List<CountBridgeCraneAlarmByCode> countAlarmByCode(HashMap<String, Object> paramMap);
|
List<CountBridgeCraneAlarmByCode> countAlarmByCode(HashMap<String, Object> paramMap);
|
||||||
|
|||||||
@ -226,6 +226,11 @@ public class BridgeCraneAlarmServiceImpl extends ServiceImpl<BridgeCraneAlarmMap
|
|||||||
return baseMapper.countAlarmNumToday(paramMap);
|
return baseMapper.countAlarmNumToday(paramMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer countAlarmNumYesterday(HashMap<String, Object> paramMap) {
|
||||||
|
return baseMapper.countAlarmNumYesterday(paramMap);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CountBridgeCraneAlarmTodayVo countAlarmToday(HashMap<String, Object> paramMap) {
|
public CountBridgeCraneAlarmTodayVo countAlarmToday(HashMap<String, Object> paramMap) {
|
||||||
CountBridgeCraneAlarmTodayVo vo = new CountBridgeCraneAlarmTodayVo();
|
CountBridgeCraneAlarmTodayVo vo = new CountBridgeCraneAlarmTodayVo();
|
||||||
|
|||||||
@ -125,6 +125,7 @@ public class BridgeCraneDataServiceImpl extends ServiceImpl<BridgeCraneDataMappe
|
|||||||
CountBridgeCraneDataByToday today = baseMapper.countByToday(paramMap);
|
CountBridgeCraneDataByToday today = baseMapper.countByToday(paramMap);
|
||||||
today.setAlarmNumToday(bridgeCraneAlarmService.countAlarmNumToday(paramMap));
|
today.setAlarmNumToday(bridgeCraneAlarmService.countAlarmNumToday(paramMap));
|
||||||
CountBridgeCraneDataByToday yesterday = baseMapper.countByYesterday(paramMap);
|
CountBridgeCraneDataByToday yesterday = baseMapper.countByYesterday(paramMap);
|
||||||
|
yesterday.setAlarmNumToday(bridgeCraneAlarmService.countAlarmNumYesterday(paramMap));
|
||||||
today.setLiftNumTodayThanYesterdayPct(NumberUtils.calRisePercent(today.getLiftNumToday(), yesterday.getLiftNumToday(), 2));
|
today.setLiftNumTodayThanYesterdayPct(NumberUtils.calRisePercent(today.getLiftNumToday(), yesterday.getLiftNumToday(), 2));
|
||||||
today.setAlarmNumTodayThanYesterdayPct(NumberUtils.calRisePercent(today.getAlarmNumToday(), yesterday.getAlarmNumToday(), 2));
|
today.setAlarmNumTodayThanYesterdayPct(NumberUtils.calRisePercent(today.getAlarmNumToday(), yesterday.getAlarmNumToday(), 2));
|
||||||
return today;
|
return today;
|
||||||
|
|||||||
@ -438,6 +438,9 @@ public class RiskListSourceController {
|
|||||||
source.setEffectiveTimeEnd(point.getEffectiveTimeEnd());
|
source.setEffectiveTimeEnd(point.getEffectiveTimeEnd());
|
||||||
source.setIdentificationTime(new Date());
|
source.setIdentificationTime(new Date());
|
||||||
source.setProjectSn(point.getProjectSn());
|
source.setProjectSn(point.getProjectSn());
|
||||||
|
source.setAreaLocation(point.getAreaLocation());
|
||||||
|
source.setRemark(point.getRiskSituationDescription());
|
||||||
|
source.setActivityFrequency(point.getActivityFrequency());
|
||||||
String[] pathSplit = detail.getFullPath().split("/");
|
String[] pathSplit = detail.getFullPath().split("/");
|
||||||
if (pathSplit.length >= 4) {
|
if (pathSplit.length >= 4) {
|
||||||
source.setSubProjectWorkTask(pathSplit[3]);
|
source.setSubProjectWorkTask(pathSplit[3]);
|
||||||
|
|||||||
@ -141,6 +141,7 @@ public class RiskListSourceDataCenterController {
|
|||||||
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
|
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
|
||||||
@ApiImplicitParam(name = "isInConstruction", value = "1在施", paramType = "query", required = false, dataType = "Integer"),
|
@ApiImplicitParam(name = "isInConstruction", value = "1在施", paramType = "query", required = false, dataType = "Integer"),
|
||||||
@ApiImplicitParam(name = "projectType", value = "工程类别(字典值)", paramType = "query", required = false, dataType = "Integer"),
|
@ApiImplicitParam(name = "projectType", value = "工程类别(字典值)", paramType = "query", required = false, dataType = "Integer"),
|
||||||
|
@ApiImplicitParam(name = "riskLevel", value = "风险等级:1:重大风险;2:较大风险;3:一般风险;4:低风险;", paramType = "query", required = false, dataType = "Integer"),
|
||||||
})
|
})
|
||||||
@GetMapping(value = "/countRisksByLibrary")
|
@GetMapping(value = "/countRisksByLibrary")
|
||||||
public Result<SectorVo> countRisksByLibrary(@RequestParam @ApiIgnore HashMap<String, Object> map) {
|
public Result<SectorVo> countRisksByLibrary(@RequestParam @ApiIgnore HashMap<String, Object> map) {
|
||||||
|
|||||||
@ -101,6 +101,9 @@
|
|||||||
<if test="projectType != null and projectType != ''">
|
<if test="projectType != null and projectType != ''">
|
||||||
and rll.project_type = #{projectType}
|
and rll.project_type = #{projectType}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="riskLevel != null and riskLevel != ''">
|
||||||
|
and t.risk_level = #{riskLevel}
|
||||||
|
</if>
|
||||||
group by rll.id
|
group by rll.id
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -575,6 +575,7 @@ public class VideoItemController {
|
|||||||
if (list == null || list.size() == 0) {
|
if (list == null || list.size() == 0) {
|
||||||
throw new OpenAlertException(MessageUtil.get("excelNotDataErr"));
|
throw new OpenAlertException(MessageUtil.get("excelNotDataErr"));
|
||||||
}
|
}
|
||||||
|
checkExcel(list, videoType);
|
||||||
Map<String, VideoGroup> groupMap = videoGroupService.list(new LambdaQueryWrapper<VideoGroup>()
|
Map<String, VideoGroup> groupMap = videoGroupService.list(new LambdaQueryWrapper<VideoGroup>()
|
||||||
.eq(VideoGroup::getProjectSn, projectSn)).stream().collect(Collectors.toMap(VideoGroup::getGroupName, Function.identity(), (o1, o2) -> o1));
|
.eq(VideoGroup::getProjectSn, projectSn)).stream().collect(Collectors.toMap(VideoGroup::getGroupName, Function.identity(), (o1, o2) -> o1));
|
||||||
ProjectVideoConfig videoConfig = projectVideoConfigService.getOne(new LambdaQueryWrapper<ProjectVideoConfig>()
|
ProjectVideoConfig videoConfig = projectVideoConfigService.getOne(new LambdaQueryWrapper<ProjectVideoConfig>()
|
||||||
@ -586,7 +587,6 @@ public class VideoItemController {
|
|||||||
}
|
}
|
||||||
List<VideoItem> videoItems = new ArrayList<>();
|
List<VideoItem> videoItems = new ArrayList<>();
|
||||||
List<String> sucList = new ArrayList<>();
|
List<String> sucList = new ArrayList<>();
|
||||||
List<String> failVideoList = new ArrayList<>();
|
|
||||||
List<String> failGroupList = new ArrayList<>();
|
List<String> failGroupList = new ArrayList<>();
|
||||||
for (Map<String, String> importInfo : list) {
|
for (Map<String, String> importInfo : list) {
|
||||||
VideoGroup group = groupMap.get(importInfo.get("*视频分组"));
|
VideoGroup group = groupMap.get(importInfo.get("*视频分组"));
|
||||||
@ -619,11 +619,45 @@ public class VideoItemController {
|
|||||||
videoItem.setAiVideoUrl(aiVideoUrl);
|
videoItem.setAiVideoUrl(aiVideoUrl);
|
||||||
videoItem.setDefaultStreamType(defaultStreamType);
|
videoItem.setDefaultStreamType(defaultStreamType);
|
||||||
videoItems.add(videoItem);
|
videoItems.add(videoItem);
|
||||||
|
sucList.add(videoName);
|
||||||
}
|
}
|
||||||
videoItemService.saveBatch(videoItems);
|
videoItemService.saveBatch(videoItems);
|
||||||
return Result.ok(StrUtil.format("导入完成。导入成功:你好,阿爸{};导入失败:嘉兴、囧扥就(),军方,周邓个(){}"));
|
StringJoiner joiner = new StringJoiner(";");
|
||||||
|
if (sucList.size() > 0) {
|
||||||
|
joiner.add("导入成功:" + StrUtil.join(",", sucList));
|
||||||
|
}
|
||||||
|
if (failGroupList.size() > 0) {
|
||||||
|
joiner.add("导入失败(分组不存在):" + StrUtil.join(",", failGroupList));
|
||||||
|
}
|
||||||
|
String result = "导入完成。" + (joiner.length() > 0 ? joiner.toString() : "");
|
||||||
|
return Result.ok(result);
|
||||||
|
} catch (OpenAlertException e) {
|
||||||
|
throw e;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new OpenAlertException("导入excel失败", e);
|
throw new OpenAlertException("导入excel失败", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void checkExcel(List<Map<String, String>> list, Integer videoType) {
|
||||||
|
for (Map<String, String> map : list) {
|
||||||
|
String videoName = map.get("*设备名称");
|
||||||
|
String serialNumber = map.get("*监控点");
|
||||||
|
String group = map.get("*视频分组");
|
||||||
|
String verificationCode = map.get("*通道号");
|
||||||
|
if (StrUtil.isBlank(videoName)) {
|
||||||
|
throw new OpenAlertException("设备名称不能为空");
|
||||||
|
}
|
||||||
|
if (StrUtil.isBlank(serialNumber)) {
|
||||||
|
throw new OpenAlertException("监控点不能为空");
|
||||||
|
}
|
||||||
|
if (StrUtil.isBlank(group)) {
|
||||||
|
throw new OpenAlertException("视频分组不能为空");
|
||||||
|
}
|
||||||
|
if (Objects.equals(videoType, 1)) {
|
||||||
|
if (StrUtil.isBlank(verificationCode)) {
|
||||||
|
throw new OpenAlertException("通道号不能为空");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,17 +1,15 @@
|
|||||||
package com.zhgd.xmgl.modules.worker.entity;
|
package com.zhgd.xmgl.modules.worker.entity;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 人员退场配置
|
* @Description: 人员退场配置
|
||||||
@ -62,10 +60,16 @@ public class WorkerExitConfig implements Serializable {
|
|||||||
@ApiModelProperty(value = "人员未打卡超过n天系统自动将人员退场")
|
@ApiModelProperty(value = "人员未打卡超过n天系统自动将人员退场")
|
||||||
private java.lang.Integer exitIfAbsenceDay;
|
private java.lang.Integer exitIfAbsenceDay;
|
||||||
/**
|
/**
|
||||||
* 是否将此处退场人员拉入黑名库1是0否
|
* 拉黑时是否退场1是0否
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "是否将此处退场人员拉入黑名库1是0否")
|
@ApiModelProperty(value = "拉黑时是否退场1是0否")
|
||||||
private java.lang.Integer enableBlack;
|
private java.lang.Integer enableExitWhenBlack;
|
||||||
|
/**
|
||||||
|
* 1将此处人员清除全部通行闸机授权2将此处人员退场3将此处人员拉入黑名单库
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "1将此处人员清除全部通行闸机授权2将此处人员退场3将此处人员拉入黑名单库")
|
||||||
|
private java.lang.Integer exitType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -803,6 +803,23 @@ public class XzSecurityQualityInspectionRecordController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "批量删除安全检查记录", notes = "批量删除安全检查记录", httpMethod = "POST")
|
||||||
|
@ApiImplicitParam(name = "ids", value = "安全检查记录ids(多个,分隔)", paramType = "body", required = true, dataType = "String")
|
||||||
|
@PostMapping(value = "/deleteBatch")
|
||||||
|
public Result deleteBatch(@ApiIgnore @RequestBody Map<String, Object> map) {
|
||||||
|
Result result = new Result<>();
|
||||||
|
String ids = MapUtils.getString(map, "ids");
|
||||||
|
if (ids == null || "".equals(ids.trim())) {
|
||||||
|
result.error500("参数不识别!");
|
||||||
|
} else {
|
||||||
|
for (String id : Arrays.asList(ids.split(","))) {
|
||||||
|
qualityInspectionRecordService.deleteQualityInspectionRecord(id);
|
||||||
|
}
|
||||||
|
Result.success("删除成功!");
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
public String getStatusText(Integer status) {
|
public String getStatusText(Integer status) {
|
||||||
if (status == null) {
|
if (status == null) {
|
||||||
return "";
|
return "";
|
||||||
|
|||||||
@ -41,7 +41,10 @@ import com.zhgd.xmgl.modules.worker.mapper.WorkerCertificateMapper;
|
|||||||
import com.zhgd.xmgl.modules.worker.mapper.WorkerInfoMapper;
|
import com.zhgd.xmgl.modules.worker.mapper.WorkerInfoMapper;
|
||||||
import com.zhgd.xmgl.modules.worker.service.*;
|
import com.zhgd.xmgl.modules.worker.service.*;
|
||||||
import com.zhgd.xmgl.modules.worker.service.impl.WorkerInfoServiceImpl;
|
import com.zhgd.xmgl.modules.worker.service.impl.WorkerInfoServiceImpl;
|
||||||
import com.zhgd.xmgl.modules.xz.entity.*;
|
import com.zhgd.xmgl.modules.xz.entity.XzCertificateExpireAlarmRecord;
|
||||||
|
import com.zhgd.xmgl.modules.xz.entity.XzWorkerSafeWatchAlarm;
|
||||||
|
import com.zhgd.xmgl.modules.xz.entity.XzWorkerSafeWatchConfig;
|
||||||
|
import com.zhgd.xmgl.modules.xz.entity.XzWorkerSafeWatchManager;
|
||||||
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityInspectTaskItemRecord;
|
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityInspectTaskItemRecord;
|
||||||
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityInspectTaskRecord;
|
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityInspectTaskRecord;
|
||||||
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityQualityInspectionRecord;
|
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityQualityInspectionRecord;
|
||||||
@ -56,7 +59,10 @@ import com.zhgd.xmgl.modules.xz.service.IXzWorkerSafeWatchAlarmService;
|
|||||||
import com.zhgd.xmgl.modules.xz.service.IXzWorkerSafeWatchConfigService;
|
import com.zhgd.xmgl.modules.xz.service.IXzWorkerSafeWatchConfigService;
|
||||||
import com.zhgd.xmgl.modules.xz.service.IXzWorkerSafeWatchManagerService;
|
import com.zhgd.xmgl.modules.xz.service.IXzWorkerSafeWatchManagerService;
|
||||||
import com.zhgd.xmgl.modules.xz.service.impl.XzCertificateExpireAlarmRecordServiceImpl;
|
import com.zhgd.xmgl.modules.xz.service.impl.XzCertificateExpireAlarmRecordServiceImpl;
|
||||||
import com.zhgd.xmgl.util.*;
|
import com.zhgd.xmgl.util.Base64Util;
|
||||||
|
import com.zhgd.xmgl.util.ElecardUtil;
|
||||||
|
import com.zhgd.xmgl.util.MapBuilder;
|
||||||
|
import com.zhgd.xmgl.util.NumberUtils;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.javacrumbs.shedlock.core.SchedulerLock;
|
import net.javacrumbs.shedlock.core.SchedulerLock;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
@ -75,8 +81,6 @@ import java.util.concurrent.CompletableFuture;
|
|||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static com.zhgd.xmgl.modules.project.enums.ProjectUfaceConfigSupplierTypeEnum.ZYMQTT;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @program: wisdomSite
|
* @program: wisdomSite
|
||||||
* @description: 劳务人员定时任务
|
* @description: 劳务人员定时任务
|
||||||
@ -585,7 +589,7 @@ public class WorkerTask {
|
|||||||
}
|
}
|
||||||
List<Long> alarmUserIds = getAlarmWorkerIds(record);
|
List<Long> alarmUserIds = getAlarmWorkerIds(record);
|
||||||
Integer safeWatchAlarmExceedMinute = record.getSafeWatchAlarmExceedMinute();
|
Integer safeWatchAlarmExceedMinute = record.getSafeWatchAlarmExceedMinute();
|
||||||
if (safeWatchAlarmExceedMinute >= minute) {
|
if (safeWatchAlarmExceedMinute != null && safeWatchAlarmExceedMinute >= minute) {
|
||||||
Integer mod = NumberUtils.mod(safeWatchAlarmExceedMinute, minute);
|
Integer mod = NumberUtils.mod(safeWatchAlarmExceedMinute, minute);
|
||||||
if (mod == 0) {
|
if (mod == 0) {
|
||||||
HashSet<String> noticeUserIds = configIdToNoticeUserIdsMap.get(config.getId());
|
HashSet<String> noticeUserIds = configIdToNoticeUserIdsMap.get(config.getId());
|
||||||
@ -1020,6 +1024,7 @@ public class WorkerTask {
|
|||||||
@SchedulerLock(name = "updateWorkerExit", lockAtMostFor = 1000 * 55, lockAtLeastFor = 1000 * 55)
|
@SchedulerLock(name = "updateWorkerExit", lockAtMostFor = 1000 * 55, lockAtLeastFor = 1000 * 55)
|
||||||
@RequestMapping("updateWorkerExit")
|
@RequestMapping("updateWorkerExit")
|
||||||
public void updateWorkerExit() {
|
public void updateWorkerExit() {
|
||||||
|
try {
|
||||||
Map<String, WorkerExitConfig> project2ConfigMap = workerExitConfigService.list(new LambdaQueryWrapper<WorkerExitConfig>()
|
Map<String, WorkerExitConfig> project2ConfigMap = workerExitConfigService.list(new LambdaQueryWrapper<WorkerExitConfig>()
|
||||||
.eq(WorkerExitConfig::getEnable, 1)).stream().collect(Collectors.toMap(WorkerExitConfig::getProjectSn, Function.identity(), (o1, o2) -> o1));
|
.eq(WorkerExitConfig::getEnable, 1)).stream().collect(Collectors.toMap(WorkerExitConfig::getProjectSn, Function.identity(), (o1, o2) -> o1));
|
||||||
List<Project> projects = projectMapper.selectList(new LambdaQueryWrapper<Project>());
|
List<Project> projects = projectMapper.selectList(new LambdaQueryWrapper<Project>());
|
||||||
@ -1036,16 +1041,16 @@ public class WorkerTask {
|
|||||||
param.put("departmentIdList", StrUtil.split(config.getDepartmentIds(), ","));
|
param.put("departmentIdList", StrUtil.split(config.getDepartmentIds(), ","));
|
||||||
param.put("teamIdList", StrUtil.split(config.getTeamIds(), ","));
|
param.put("teamIdList", StrUtil.split(config.getTeamIds(), ","));
|
||||||
param.put("enterpriseIdList", StrUtil.split(config.getEnterpriseIds(), ","));
|
param.put("enterpriseIdList", StrUtil.split(config.getEnterpriseIds(), ","));
|
||||||
// if (StrUtil.isNotBlank(config.getWorkerIds())) {
|
// if (StrUtil.isNotBlank(config.getWorkerIds())) {
|
||||||
// } else if (StrUtil.isNotBlank(config.getDepartmentIds()) || StrUtil.isNotBlank(config.getTeamIds())) {
|
// } else if (StrUtil.isNotBlank(config.getDepartmentIds()) || StrUtil.isNotBlank(config.getTeamIds())) {
|
||||||
// } else if (StrUtil.isNotBlank(config.getEnterpriseIds())) {
|
// } else if (StrUtil.isNotBlank(config.getEnterpriseIds())) {
|
||||||
// }
|
// }
|
||||||
List<WorkerInfo> exitWorkers = workerAttendanceService.getAutoExitWorkers(param);
|
List<WorkerInfo> exitWorkers = workerAttendanceService.getAutoExitWorkers(param);
|
||||||
if (CollUtil.isEmpty(exitWorkers)) {
|
if (CollUtil.isEmpty(exitWorkers)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
if (Objects.equals(config.getEnableBlack(), 1)) {
|
if (Objects.equals(config.getExitType(), 3)) {
|
||||||
for (WorkerInfo worker : exitWorkers) {
|
for (WorkerInfo worker : exitWorkers) {
|
||||||
WorkerBlacklist workerBlacklist = new WorkerBlacklist();
|
WorkerBlacklist workerBlacklist = new WorkerBlacklist();
|
||||||
workerBlacklist.setProjectSn(projectSn);
|
workerBlacklist.setProjectSn(projectSn);
|
||||||
@ -1056,18 +1061,27 @@ public class WorkerTask {
|
|||||||
workerBlacklist.setReason(workerBlacklist.getAddReason());
|
workerBlacklist.setReason(workerBlacklist.getAddReason());
|
||||||
workerBlacklist.setAddTime(DateUtil.now());
|
workerBlacklist.setAddTime(DateUtil.now());
|
||||||
workerBlacklist.setCreateTime(new Date());
|
workerBlacklist.setCreateTime(new Date());
|
||||||
workerBlacklist.setIsExit(1);
|
workerBlacklist.setIsExit(config.getEnableExitWhenBlack());
|
||||||
workerBlacklistService.addWorkerBlacklist(workerBlacklist);
|
workerBlacklistService.addWorkerBlacklist(workerBlacklist);
|
||||||
}
|
}
|
||||||
} else {
|
} else if (Objects.equals(config.getExitType(), 2)) {
|
||||||
workerInfoService.updateWorkerExit(new MapBuilder<String, Object>()
|
workerInfoService.updateWorkerExit(new MapBuilder<String, Object>()
|
||||||
.put("workerIdStr", exitWorkers.stream().map(w -> w.getId() + "").collect(Collectors.joining(",")))
|
.put("workerIdStr", exitWorkers.stream().map(w -> w.getId() + "").collect(Collectors.joining(",")))
|
||||||
.build());
|
.build());
|
||||||
|
} else if (Objects.equals(config.getExitType(), 1)) {
|
||||||
|
for (WorkerInfo worker : exitWorkers) {
|
||||||
|
worker.setUfaceDevId("");
|
||||||
|
worker.setUfaceDevGroupId("");
|
||||||
|
workerInfoService.editWorkerInfo(worker);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("更新人员自动退场错误", e);
|
log.error("更新人员自动退场错误", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("更新人员自动退场错误", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user