bug修复
This commit is contained in:
parent
c73dc341c7
commit
e29b68ad1b
@ -6,6 +6,7 @@ import com.zhgd.jeecg.common.api.vo.Result;
|
|||||||
import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatData;
|
import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatData;
|
||||||
import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatDev;
|
import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatDev;
|
||||||
import com.zhgd.xmgl.modules.safetyhat.service.ISafetyHatDataService;
|
import com.zhgd.xmgl.modules.safetyhat.service.ISafetyHatDataService;
|
||||||
|
import com.zhgd.xmgl.modules.worker.entity.WorkerInfo;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
|
|||||||
@ -94,4 +94,8 @@ public class SafetyHatData implements Serializable {
|
|||||||
@ApiModelProperty(value = "人员名称")
|
@ApiModelProperty(value = "人员名称")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private java.lang.String workerName;
|
private java.lang.String workerName;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
@ApiModelProperty(value = "身份证号")
|
||||||
|
private java.lang.String idCard;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,18 +1,20 @@
|
|||||||
package com.zhgd.xmgl.modules.safetyhat.entity;
|
package com.zhgd.xmgl.modules.safetyhat.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.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
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 com.zhgd.xmgl.modules.worker.entity.WorkerInfo;
|
||||||
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.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 智能安全帽-围栏
|
* @Description: 智能安全帽-围栏
|
||||||
@ -92,4 +94,8 @@ public class SafetyHatFence implements Serializable {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
@ApiModelProperty(value = "围栏内人数")
|
@ApiModelProperty(value = "围栏内人数")
|
||||||
private Integer workerNum;
|
private Integer workerNum;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
@ApiModelProperty(value = "围栏内人员列表")
|
||||||
|
private List<WorkerInfo> workerListInFence;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatData;
|
import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatData;
|
||||||
|
import com.zhgd.xmgl.modules.worker.entity.WorkerInfo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
@ -25,7 +26,8 @@ public interface SafetyHatDataMapper extends BaseMapper<SafetyHatData> {
|
|||||||
|
|
||||||
List<SafetyHatData> queryList(@Param(Constants.WRAPPER) QueryWrapper<SafetyHatData> queryWrapper);
|
List<SafetyHatData> queryList(@Param(Constants.WRAPPER) QueryWrapper<SafetyHatData> queryWrapper);
|
||||||
|
|
||||||
List<SafetyHatData> getNewestData(String projectSn);
|
List<SafetyHatData> getNewestDataGroupByDevSn(String projectSn);
|
||||||
|
|
||||||
List<SafetyHatData> getNewestList(HashMap<String, Object> paramMap);
|
List<SafetyHatData> getNewestList(HashMap<String, Object> paramMap);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,13 +8,16 @@
|
|||||||
${ew.customSqlSegment}
|
${ew.customSqlSegment}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getNewestData" resultType="com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatData">
|
<select id="getNewestDataGroupByDevSn" resultType="com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatData">
|
||||||
select *
|
select shd.*,wi.worker_name,wi.id_card
|
||||||
from safety_hat_data shd
|
from safety_hat_data shd
|
||||||
join (select max(create_time) as create_time, dev_sn
|
join (select max(create_time) as create_time, dev_sn
|
||||||
from safety_hat_data
|
from safety_hat_data
|
||||||
where project_sn = #{projectSn}
|
where project_sn = #{projectSn}
|
||||||
group by dev_sn) t on t.create_time = shd.create_time and t.dev_sn=shd.dev_sn
|
group by dev_sn) t on t.create_time = shd.create_time and t.dev_sn=shd.dev_sn
|
||||||
|
join safety_hat_dev shd2 on shd2.dev_sn = shd.dev_sn
|
||||||
|
left join worker_info wi on wi.id = shd.worker_info_id
|
||||||
|
where shd2.online=1
|
||||||
group by shd.dev_sn
|
group by shd.dev_sn
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatData;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatDev;
|
import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatDev;
|
||||||
|
import com.zhgd.xmgl.modules.worker.entity.WorkerInfo;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -29,4 +30,5 @@ public interface ISafetyHatDataService extends IService<SafetyHatData> {
|
|||||||
List<SafetyHatData> getNewestList(HashMap<String, Object> paramMap);
|
List<SafetyHatData> getNewestList(HashMap<String, Object> paramMap);
|
||||||
|
|
||||||
void updateStatus(SafetyHatDev safetyHatDev);
|
void updateStatus(SafetyHatDev safetyHatDev);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,6 +19,7 @@ import com.zhgd.xmgl.modules.safetyhat.mapper.SafetyHatDevMapper;
|
|||||||
import com.zhgd.xmgl.modules.safetyhat.mapper.SafetyHatFenceMapper;
|
import com.zhgd.xmgl.modules.safetyhat.mapper.SafetyHatFenceMapper;
|
||||||
import com.zhgd.xmgl.modules.safetyhat.service.ISafetyHatAlarmService;
|
import com.zhgd.xmgl.modules.safetyhat.service.ISafetyHatAlarmService;
|
||||||
import com.zhgd.xmgl.modules.safetyhat.service.ISafetyHatDataService;
|
import com.zhgd.xmgl.modules.safetyhat.service.ISafetyHatDataService;
|
||||||
|
import com.zhgd.xmgl.modules.worker.entity.WorkerInfo;
|
||||||
import com.zhgd.xmgl.util.PageUtil;
|
import com.zhgd.xmgl.util.PageUtil;
|
||||||
import com.zhgd.xmgl.util.RefUtil;
|
import com.zhgd.xmgl.util.RefUtil;
|
||||||
import com.zhgd.xmgl.util.RegionUtil;
|
import com.zhgd.xmgl.util.RegionUtil;
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatFence;
|
|||||||
import com.zhgd.xmgl.modules.safetyhat.mapper.SafetyHatDataMapper;
|
import com.zhgd.xmgl.modules.safetyhat.mapper.SafetyHatDataMapper;
|
||||||
import com.zhgd.xmgl.modules.safetyhat.mapper.SafetyHatFenceMapper;
|
import com.zhgd.xmgl.modules.safetyhat.mapper.SafetyHatFenceMapper;
|
||||||
import com.zhgd.xmgl.modules.safetyhat.service.ISafetyHatFenceService;
|
import com.zhgd.xmgl.modules.safetyhat.service.ISafetyHatFenceService;
|
||||||
|
import com.zhgd.xmgl.modules.worker.entity.WorkerInfo;
|
||||||
import com.zhgd.xmgl.util.RegionUtil;
|
import com.zhgd.xmgl.util.RegionUtil;
|
||||||
import org.apache.commons.collections.MapUtils;
|
import org.apache.commons.collections.MapUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
@ -19,6 +20,7 @@ import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
|||||||
import com.zhgd.xmgl.util.PageUtil;
|
import com.zhgd.xmgl.util.PageUtil;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@ -59,8 +61,10 @@ public class SafetyHatFenceServiceImpl extends ServiceImpl<SafetyHatFenceMapper,
|
|||||||
|
|
||||||
private List<SafetyHatFence> dealList(List<SafetyHatFence> list, HashMap<String, Object> paramMap) {
|
private List<SafetyHatFence> dealList(List<SafetyHatFence> list, HashMap<String, Object> paramMap) {
|
||||||
String projectSn = MapUtils.getString(paramMap, "projectSn");
|
String projectSn = MapUtils.getString(paramMap, "projectSn");
|
||||||
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
|
List<SafetyHatData> dataList = safetyHatDataMapper.getNewestDataGroupByDevSn(projectSn);
|
||||||
for (SafetyHatFence fence : list) {
|
for (SafetyHatFence fence : list) {
|
||||||
List<SafetyHatData> dataList = safetyHatDataMapper.getNewestData(projectSn);
|
ArrayList<WorkerInfo> workerInfos = new ArrayList<>();
|
||||||
int workerNum = 0;
|
int workerNum = 0;
|
||||||
if (CollUtil.isNotEmpty(dataList)) {
|
if (CollUtil.isNotEmpty(dataList)) {
|
||||||
for (SafetyHatData d : dataList) {
|
for (SafetyHatData d : dataList) {
|
||||||
@ -85,9 +89,15 @@ public class SafetyHatFenceServiceImpl extends ServiceImpl<SafetyHatFenceMapper,
|
|||||||
}
|
}
|
||||||
if (inFence) {
|
if (inFence) {
|
||||||
workerNum++;
|
workerNum++;
|
||||||
|
WorkerInfo workerInfo = new WorkerInfo();
|
||||||
|
workerInfo.setWorkerName(d.getWorkerName());
|
||||||
|
workerInfo.setIdCard(d.getIdCard());
|
||||||
|
workerInfos.add(workerInfo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fence.setWorkerNum(workerNum);
|
fence.setWorkerNum(workerNum);
|
||||||
|
fence.setWorkerListInFence(workerInfos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user