Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
c0f0ea7f8d
|
|
@ -12,11 +12,15 @@ public class BusinessConstants {
|
|||
public static final int TYPE = 1;
|
||||
public static final int TYPE2 = 2;
|
||||
public static final int TYPE3 = 0;
|
||||
public static final Long PARENT_ID = 0l;
|
||||
public static final Long PARENT_ID = 0L;
|
||||
public static final Integer LEVEL = 4;
|
||||
|
||||
/** 资源类型 1-人员*/
|
||||
public static final String RESOURCE_TYPE_USER = "1";
|
||||
|
||||
/** 资源类型 6-临时人员*/
|
||||
public static final String RESOURCE_TYPE_USERTEMP = "6";
|
||||
|
||||
public final static String XLSX = ".xlsx";
|
||||
|
||||
public final static String XLS = ".xls";
|
||||
|
|
@ -41,6 +45,9 @@ public class BusinessConstants {
|
|||
/** 在施状态值*/
|
||||
public final static Integer WORK_STATUS = 0;
|
||||
|
||||
public static final String LAT = "纬度";
|
||||
public static final String LON = "经度";
|
||||
|
||||
|
||||
public final static Integer CELL_1 = 1;
|
||||
public final static Integer CELL_2 = 2;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,41 @@
|
|||
package com.bonus.common.entity.bracelet.exportVo;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @className:QueryConstructionExportVo
|
||||
* @version:1.0
|
||||
* @description:施工记录导出-vo
|
||||
*/
|
||||
@Data
|
||||
public class QueryConstructionExportVo {
|
||||
|
||||
@Excel(name = "序号", width = 10.0,height = 20.0, orderNum = "0")
|
||||
private String id;
|
||||
|
||||
@Excel(name = "工程名称", width = 20.0,height = 15.0,orderNum = "1")
|
||||
private String proName;
|
||||
|
||||
@Excel(name = "项目部名称", width = 20.0,height = 15.0,orderNum = "2")
|
||||
private String departName;
|
||||
|
||||
@Excel(name = "施工班组", width = 20.0,height = 15.0,orderNum = "3")
|
||||
private String teamName;
|
||||
|
||||
@Excel(name = "班组负责人", width = 20.0,height = 15.0,orderNum = "4")
|
||||
private String teamLeader;
|
||||
|
||||
@Excel(name = "班组施工人数", width = 20.0,height = 15.0,orderNum = "5")
|
||||
private int teamNum;
|
||||
|
||||
@Excel(name = "临时人数", width = 20.0,height = 15.0,orderNum = "6")
|
||||
private int tempNum;
|
||||
|
||||
@Excel(name = "施工时间", width = 20.0,height = 15.0,orderNum = "7")
|
||||
private String lyTime;
|
||||
|
||||
@Excel(name = "施工预警次数", width = 20.0,height = 15.0,orderNum = "8")
|
||||
private int warnNum;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.bonus.common.entity.bracelet.exportVo;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @className:WarnHistoryExportVo
|
||||
* @version:1.0
|
||||
* @description:预警历史记录导出-vo
|
||||
*/
|
||||
@Data
|
||||
public class WarnHistoryExportVo {
|
||||
|
||||
@Excel(name = "序号", width = 10.0,height = 20.0, orderNum = "0")
|
||||
private String id;
|
||||
|
||||
@Excel(name = "设备类型", width = 20.0,height = 15.0,orderNum = "1")
|
||||
private String devTypeName;
|
||||
|
||||
@Excel(name = "设备名称", width = 20.0,height = 15.0,orderNum = "2")
|
||||
private String devName;
|
||||
|
||||
@Excel(name = "预警时间", width = 20.0,height = 15.0,orderNum = "3")
|
||||
private String warnTime;
|
||||
|
||||
@Excel(name = "预警内容", width = 20.0,height = 15.0,orderNum = "4")
|
||||
private String warnContent;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.bonus.common.entity.bracelet.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:PersonTreeVo
|
||||
* @author:cwchen
|
||||
* @date:2024-08-09-10:38
|
||||
* @version:1.0
|
||||
* @description:班组人员树
|
||||
*/
|
||||
@Data
|
||||
public class PersonTreeVo {
|
||||
|
||||
/**id*/
|
||||
private String id;
|
||||
/**名称*/
|
||||
private String label;
|
||||
/**是否班组长*/
|
||||
private Long isTeamLeader;
|
||||
/**是否告警*/
|
||||
private Integer isWarn;
|
||||
|
||||
/**层级*/
|
||||
private Integer level;
|
||||
/**父ID*/
|
||||
private String parentId;
|
||||
|
||||
private List<PersonTreeVo> children = new ArrayList<>();
|
||||
}
|
||||
|
|
@ -106,6 +106,11 @@ public class PersonVo implements Serializable {
|
|||
*/
|
||||
private Integer certificateNum;
|
||||
|
||||
/**
|
||||
* 资源类型
|
||||
*/
|
||||
private String sourceType;
|
||||
|
||||
/**
|
||||
* 删除的文件ID
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ public class QueryConstruction extends BaseEntity
|
|||
@Excel(name = "班组负责人")
|
||||
private String teamLeader;
|
||||
|
||||
/** 班组负责人 */
|
||||
@Excel(name = "班组负责人")
|
||||
/** 班组负责人电话 */
|
||||
@Excel(name = "班组负责人电话")
|
||||
private String teamPhone;
|
||||
|
||||
/** 班组施工人数 */
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
package com.bonus.common.entity.bracelet.vo;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @className:BallWarnVo
|
||||
|
|
@ -27,4 +31,26 @@ public class WarnInfoVo {
|
|||
private String base64Url;
|
||||
/**人员姓名*/
|
||||
private String name;
|
||||
|
||||
/** 班组id */
|
||||
@Excel(name = "班组id")
|
||||
private Long teamId;
|
||||
|
||||
/** 请求参数 */
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
private Map<String, Object> params;
|
||||
|
||||
public Map<String, Object> getParams()
|
||||
{
|
||||
if (params == null)
|
||||
{
|
||||
params = new HashMap<>();
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
public void setParams(Map<String, Object> params)
|
||||
{
|
||||
this.params = params;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,4 +65,41 @@ public class ConsControlController extends BaseController {
|
|||
List<WarnInfoVo> list = service.getWarnLists(dto);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 人员管控-人员树
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @author cwchen
|
||||
* @date 2024/8/9 10:34
|
||||
*/
|
||||
@GetMapping("getPersonsTree")
|
||||
@SysLog(title = "施工管控", businessType = OperaType.QUERY, logType = 0, module = "施工管控->人员管控", details = "人员管控")
|
||||
public AjaxResult getPersonsTree(BraceletParamsDto dto){
|
||||
return service.getPersonsTree(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 今日施工班组/施工人数/安全帽信息
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @author cwchen
|
||||
* @date 2024/8/9 13:12
|
||||
*/
|
||||
@GetMapping("getWorkInfo")
|
||||
public AjaxResult getWorkInfo(BraceletParamsDto dto){
|
||||
return service.getWorkInfo(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取整个班组人员/班组临时人员的定位/杆塔的定位以及施工范围的半径
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @author cwchen
|
||||
* @date 2024/8/9 14:36
|
||||
*/
|
||||
@GetMapping("getPersonsInfo")
|
||||
public AjaxResult getPersonsInfo(BraceletParamsDto dto){
|
||||
return service.getPersonsInfo(dto);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,6 +61,12 @@ public class ExportFileController {
|
|||
@Resource(name = "IDeviceLyRecordService")
|
||||
private IDeviceLyRecordService iDeviceLyRecordService;
|
||||
|
||||
@Autowired
|
||||
private IQueryConstructionService iQueryConstructionService;
|
||||
|
||||
@Resource(name = "IWarnHistoryService")
|
||||
private IWarnHistoryService iWarnHistoryService;
|
||||
|
||||
@Autowired
|
||||
private IBaseProjectService iBaseProjectService;
|
||||
|
||||
|
|
@ -276,4 +282,61 @@ public class ExportFileController {
|
|||
log.error(e.toString(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("exportConstructionRecord")
|
||||
public void exportConstructionRecord(HttpServletRequest request, HttpServletResponse response, QueryConstruction dto) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
try {
|
||||
List<QueryConstructionExportVo> queryConstructionExportVoList = new ArrayList<>();
|
||||
List<QueryConstruction> queryConstructionLists = iQueryConstructionService.selectConstructionList(dto);
|
||||
for (int i = 0; i < queryConstructionLists.size(); i++) {
|
||||
QueryConstructionExportVo exportVo = new QueryConstructionExportVo();
|
||||
QueryConstruction vo = queryConstructionLists.get(i);
|
||||
BeanUtils.copyProperties(vo, exportVo);
|
||||
exportVo.setId((i + 1) + "");
|
||||
exportVo.setTeamLeader(vo.getTeamLeader()+ "\\" +vo.getTeamPhone());
|
||||
exportVo.setLyTime(sdf.format(vo.getLyTime()));
|
||||
queryConstructionExportVoList.add(exportVo);
|
||||
}
|
||||
ExportParams exportParams = new ExportParams("施工记录", "施工记录", ExcelType.XSSF);
|
||||
exportParams.setStyle(ExcelStyleUtil.class);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, QueryConstructionExportVo.class, queryConstructionExportVoList);
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("施工记录" + ".xlsx", "UTF-8"));
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
workbook.write(outputStream);
|
||||
outputStream.close();
|
||||
workbook.close();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("exportWarnHistory")
|
||||
public void exportWarnHistory(HttpServletRequest request, HttpServletResponse response, WarnInfoVo dto) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
try {
|
||||
List<WarnHistoryExportVo> warnHistoryExportVoList = new ArrayList<>();
|
||||
List<WarnInfoVo> warnHistoryLists = iWarnHistoryService.getWarnLists(dto);
|
||||
for (int i = 0; i < warnHistoryLists.size(); i++) {
|
||||
WarnHistoryExportVo exportVo = new WarnHistoryExportVo();
|
||||
WarnInfoVo vo = warnHistoryLists.get(i);
|
||||
BeanUtils.copyProperties(vo, exportVo);
|
||||
exportVo.setId((i + 1) + "");
|
||||
exportVo.setWarnTime(sdf.format(vo.getWarnTime()));
|
||||
warnHistoryExportVoList.add(exportVo);
|
||||
}
|
||||
ExportParams exportParams = new ExportParams("预警历史记录", "预警历史记录", ExcelType.XSSF);
|
||||
exportParams.setStyle(ExcelStyleUtil.class);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, WarnHistoryExportVo.class, warnHistoryExportVoList);
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("预警历史记录" + ".xlsx", "UTF-8"));
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
workbook.write(outputStream);
|
||||
outputStream.close();
|
||||
workbook.close();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,7 +116,10 @@ public class PersonMgeController extends BaseController {
|
|||
if(delhighfile != null) {
|
||||
for (int i = 0; i < delhighfile.length; i++) {
|
||||
String high = String.valueOf(delhighfile[i]);
|
||||
int certicificateId = mapper.getHighId(high);
|
||||
Integer certicificateId = mapper.getHighId(high);
|
||||
if(certicificateId==null){
|
||||
return AjaxResult.error("被删除的高出作业证图片资源无法找到");
|
||||
}
|
||||
mapper.delHigh(certicificateId);
|
||||
mapper.delHighFile(high, certicificateId);
|
||||
remoteFileService.delFile(high, SecurityConstants.INNER);
|
||||
|
|
@ -125,7 +128,10 @@ public class PersonMgeController extends BaseController {
|
|||
if(delelectfile != null) {
|
||||
for (int i = 0; i < delelectfile.length; i++) {
|
||||
String elect = String.valueOf(delelectfile[i]);
|
||||
int certicificateId = mapper.getElectId(elect);
|
||||
Integer certicificateId = mapper.getElectId(elect);
|
||||
if(certicificateId==null){
|
||||
return AjaxResult.error("被删除的电工作业证作业证图片资源无法找到");
|
||||
}
|
||||
mapper.delElect(certicificateId);
|
||||
mapper.delElectFile(elect,certicificateId);
|
||||
remoteFileService.delFile(elect,SecurityConstants.INNER);
|
||||
|
|
@ -134,7 +140,10 @@ public class PersonMgeController extends BaseController {
|
|||
if(delelsefile != null){
|
||||
for (int i = 0; i < delelsefile.length; i++) {
|
||||
String elseFile = String.valueOf(delelsefile[i]);
|
||||
int certicificateId = mapper.getElseId(elseFile);
|
||||
Integer certicificateId = mapper.getElseId(elseFile);
|
||||
if(certicificateId==null){
|
||||
return AjaxResult.error("被删除的其他作业证作业证图片资源无法找到");
|
||||
}
|
||||
mapper.delElse(certicificateId);
|
||||
mapper.delElseFile(elseFile,certicificateId);
|
||||
remoteFileService.delFile(elseFile,SecurityConstants.INNER);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.bonus.common.core.web.page.TableDataInfo;
|
|||
import com.bonus.common.entity.bracelet.vo.PersonVo;
|
||||
import com.bonus.common.entity.bracelet.vo.QueryConstruction;
|
||||
import com.bonus.common.entity.bracelet.vo.SidebandDeviceVo;
|
||||
import com.bonus.common.entity.bracelet.vo.WarnInfoVo;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
|
|
@ -91,4 +92,17 @@ public class QueryConstructionController extends BaseController
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 施工预警信息列表
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("listWarn")
|
||||
@SysLog(title = "综合查询", businessType = OperaType.QUERY, module = "综合查询->施工记录管理", details = "查询施工预警信息列表")
|
||||
public TableDataInfo listWarn(QueryConstruction data) {
|
||||
startPage();
|
||||
List<WarnInfoVo> list = constructionService.getWarnLists(data);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,39 @@
|
|||
package com.bonus.bracelet.controller;
|
||||
|
||||
import com.bonus.bracelet.service.IDeviceLyRecordService;
|
||||
import com.bonus.bracelet.service.IWarnHistoryService;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.entity.bracelet.vo.EquipmentReqVo;
|
||||
import com.bonus.common.entity.bracelet.vo.WarnInfoVo;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:WarnHistoryController
|
||||
* @description:预警历史记录-web层
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/warnHistory/")
|
||||
@Slf4j
|
||||
public class WarnHistoryController extends BaseController {
|
||||
|
||||
@Resource(name = "IWarnHistoryService")
|
||||
private IWarnHistoryService service;
|
||||
|
||||
@GetMapping("listWarn")
|
||||
@SysLog(title = "综合查询", businessType = OperaType.QUERY,module = "综合查询->预警历史记录",details ="查询预警历史列表")
|
||||
public TableDataInfo listWarn(WarnInfoVo dto) {
|
||||
startPage();
|
||||
List<WarnInfoVo> list = service.getWarnLists(dto);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -2,10 +2,14 @@ package com.bonus.bracelet.mapper;
|
|||
|
||||
import com.bonus.common.entity.bracelet.BraceletParamsDto;
|
||||
import com.bonus.common.entity.bracelet.vo.BallTreeVo;
|
||||
import com.bonus.common.entity.bracelet.vo.PersonTreeVo;
|
||||
import com.bonus.common.entity.bracelet.vo.WarnInfoVo;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @className:ConsControlMapper
|
||||
|
|
@ -42,4 +46,69 @@ public interface ConsControlMapper {
|
|||
* @date 2024/8/9 9:45
|
||||
*/
|
||||
List<WarnInfoVo> getWarnLists(BraceletParamsDto dto);
|
||||
|
||||
/**
|
||||
* 人员管控-人员树
|
||||
* @param dto
|
||||
* @return List<PersonTreeVo>
|
||||
* @author cwchen
|
||||
* @date 2024/8/9 10:44
|
||||
*/
|
||||
List<PersonTreeVo> getPersonsTree(BraceletParamsDto dto);
|
||||
|
||||
/**
|
||||
* 获取今日施工班组
|
||||
* @param dto
|
||||
* @return List<Integer>
|
||||
* @author cwchen
|
||||
* @date 2024/8/9 13:16
|
||||
*/
|
||||
List<Integer> getWorkNum(BraceletParamsDto dto);
|
||||
|
||||
/**
|
||||
* 安全帽绑定信息
|
||||
* @param dto
|
||||
* @return List<Map<String,Object>>
|
||||
* @author cwchen
|
||||
* @date 2024/8/9 13:49
|
||||
*/
|
||||
@MapKey("id")
|
||||
List<Map<String, Object>> getSafetyHatInfo(BraceletParamsDto dto);
|
||||
|
||||
/**
|
||||
* 获取杆塔坐标
|
||||
* @return Map<String,Object>
|
||||
* @author cwchen
|
||||
* @date 2024/8/9 15:13
|
||||
*/
|
||||
@MapKey("id")
|
||||
Map<String, Object> getTowerInfo(BraceletParamsDto dto);
|
||||
|
||||
/**
|
||||
* 获取施工距离
|
||||
* @return String
|
||||
* @author cwchen
|
||||
* @date 2024/8/9 15:16
|
||||
*/
|
||||
String getDistance();
|
||||
|
||||
/**
|
||||
* 获取绑定手环的施工班组人员、临时人员信息
|
||||
* @param dto
|
||||
* @return List<Map<String,Object>>
|
||||
* @author cwchen
|
||||
* @date 2024/8/9 15:23
|
||||
*/
|
||||
@MapKey("id")
|
||||
List<Map<String, Object>> getWorkPersonInfo(BraceletParamsDto dto);
|
||||
|
||||
/**
|
||||
* 获取已绑手环的定位信息
|
||||
* @param map
|
||||
* @return Map<String,Object>
|
||||
* @author cwchen
|
||||
* @date 2024/8/9 16:30
|
||||
*/
|
||||
@MapKey("id")
|
||||
List<Map<String, Object>> getShDeviceInfo(Map<String, Object> map);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ public interface PersonMgeMapper {
|
|||
* @param filepath
|
||||
* @return
|
||||
*/
|
||||
int getHighId(String filepath);
|
||||
Integer getHighId(String filepath);
|
||||
|
||||
/**
|
||||
* 删除高工证书信息
|
||||
|
|
@ -155,7 +155,7 @@ public interface PersonMgeMapper {
|
|||
* @param filepath
|
||||
* @return
|
||||
*/
|
||||
int getElectId(String filepath);
|
||||
Integer getElectId(String filepath);
|
||||
|
||||
/**
|
||||
* 删除电工证书信息
|
||||
|
|
@ -168,7 +168,7 @@ public interface PersonMgeMapper {
|
|||
* @param filepath
|
||||
* @return
|
||||
*/
|
||||
int getElseId(String filepath);
|
||||
Integer getElseId(String filepath);
|
||||
|
||||
/**
|
||||
* 删除其他证书信息
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.bracelet.mapper;
|
|||
import com.bonus.common.entity.bracelet.vo.PersonVo;
|
||||
import com.bonus.common.entity.bracelet.vo.QueryConstruction;
|
||||
import com.bonus.common.entity.bracelet.vo.SidebandDeviceVo;
|
||||
import com.bonus.common.entity.bracelet.vo.WarnInfoVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -35,4 +36,12 @@ public interface QueryConstructionMapper
|
|||
*/
|
||||
List<PersonVo> getTempLists(PersonVo data);
|
||||
|
||||
/**
|
||||
* 施工预警信息列表
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<WarnInfoVo> getWarnLists(QueryConstruction data);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
package com.bonus.bracelet.mapper;
|
||||
|
||||
import com.bonus.common.entity.bracelet.vo.EquipmentReqVo;
|
||||
import com.bonus.common.entity.bracelet.vo.WarnInfoVo;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:DeviceLyRecordMapper
|
||||
* @description:设备领用记录-mapper
|
||||
*/
|
||||
@Repository(value = "WarnHistoryMapper")
|
||||
public interface WarnHistoryMapper {
|
||||
/**
|
||||
* 预警历史记录列表
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<WarnInfoVo> getWarnLists(WarnInfoVo dto);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -40,4 +40,31 @@ public interface IConsControlService {
|
|||
* @date 2024/8/9 9:44
|
||||
*/
|
||||
List<WarnInfoVo> getWarnLists(BraceletParamsDto dto);
|
||||
|
||||
/**
|
||||
* 人员管控-人员树
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @author cwchen
|
||||
* @date 2024/8/9 10:36
|
||||
*/
|
||||
AjaxResult getPersonsTree(BraceletParamsDto dto);
|
||||
|
||||
/**
|
||||
* 今日施工班组/施工人数/安全帽信息
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @author cwchen
|
||||
* @date 2024/8/9 13:14
|
||||
*/
|
||||
AjaxResult getWorkInfo(BraceletParamsDto dto);
|
||||
|
||||
/**
|
||||
* 获取整个班组人员/班组临时人员的定位/杆塔的定位以及施工范围的半径
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @author cwchen
|
||||
* @date 2024/8/9 14:40
|
||||
*/
|
||||
AjaxResult getPersonsInfo(BraceletParamsDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.bracelet.service;
|
|||
import com.bonus.common.entity.bracelet.vo.PersonVo;
|
||||
import com.bonus.common.entity.bracelet.vo.QueryConstruction;
|
||||
import com.bonus.common.entity.bracelet.vo.SidebandDeviceVo;
|
||||
import com.bonus.common.entity.bracelet.vo.WarnInfoVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -33,4 +34,12 @@ public interface IQueryConstructionService
|
|||
* @return
|
||||
*/
|
||||
List<PersonVo> getTempLists(PersonVo data);
|
||||
|
||||
/**
|
||||
* 施工预警信息列表
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<WarnInfoVo> getWarnLists(QueryConstruction data);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
package com.bonus.bracelet.service;
|
||||
|
||||
import com.bonus.common.entity.bracelet.vo.EquipmentReqVo;
|
||||
import com.bonus.common.entity.bracelet.vo.WarnInfoVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:IWarnHistoryService
|
||||
* @description:预警历史记录-serivice
|
||||
*/
|
||||
public interface IWarnHistoryService {
|
||||
/**
|
||||
* 预警历史记录列表
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<WarnInfoVo> getWarnLists(WarnInfoVo dto);
|
||||
|
||||
}
|
||||
|
|
@ -3,28 +3,31 @@ package com.bonus.bracelet.service.impl;
|
|||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.bonus.app.entity.BraceletEntity;
|
||||
import com.bonus.bracelet.mapper.ConsControlMapper;
|
||||
import com.bonus.bracelet.service.IConsControlService;
|
||||
import com.bonus.common.core.constant.BusinessConstants;
|
||||
import com.bonus.common.core.constant.HttpStatus;
|
||||
import com.bonus.common.core.constant.SecurityConstants;
|
||||
import com.bonus.common.core.domain.R;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.utils.HaversineUtil;
|
||||
import com.bonus.common.core.utils.StringHelper;
|
||||
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.entity.bracelet.BraceletParamsDto;
|
||||
import com.bonus.common.core.utils.BuildTreeUtil;
|
||||
import com.bonus.common.entity.bracelet.vo.BallTreeVo;
|
||||
import com.bonus.common.entity.bracelet.vo.PersonTreeVo;
|
||||
import com.bonus.common.entity.bracelet.vo.WarnInfoVo;
|
||||
import com.bonus.system.api.RemoteFileService;
|
||||
import com.bonus.system.api.domain.SysFile;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @className:ConsControlServiceImpl
|
||||
|
|
@ -77,19 +80,20 @@ public class ConsControlServiceImpl implements IConsControlService {
|
|||
vo.setBase64Url(imgBase64);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return warnInfoVoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取违章识别图片的base64
|
||||
*
|
||||
* @param base64Url
|
||||
* @return String
|
||||
* @author cwchen
|
||||
* @date 2024/8/8 18:36
|
||||
*/
|
||||
public String getImgBase64(String base64Url){
|
||||
public String getImgBase64(String base64Url) {
|
||||
try {
|
||||
R<SysFile> result = remoteFileService.getImgBase64(base64Url, SecurityConstants.INNER);
|
||||
if (result != null && result.getCode() == HttpStatus.SUCCESS && result.getData() != null) {
|
||||
|
|
@ -99,7 +103,7 @@ public class ConsControlServiceImpl implements IConsControlService {
|
|||
return base64;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
@ -110,8 +114,136 @@ public class ConsControlServiceImpl implements IConsControlService {
|
|||
try {
|
||||
warnInfoVoList = mapper.getWarnLists(dto);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return warnInfoVoList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getPersonsTree(BraceletParamsDto dto) {
|
||||
JSONArray resultTree = new JSONArray();
|
||||
try {
|
||||
List<PersonTreeVo> list = new ArrayList<>();
|
||||
list = mapper.getPersonsTree(dto);
|
||||
for (PersonTreeVo vo : list) {
|
||||
//忽略工程数据、杆塔、班组数据 1.工程 2.杆塔 3.班组 4.班组成员/临时人员
|
||||
if (!Objects.equals(vo.getLevel(), BusinessConstants.LEVEL)) {
|
||||
continue;
|
||||
}
|
||||
String[] valArr = vo.getLabel().split("-");
|
||||
if (StringUtils.isNotEmpty(valArr[1])) {
|
||||
vo.setLabel(valArr[0] + "-" + Sm4Utils.decode(valArr[1]));
|
||||
}
|
||||
}
|
||||
//构建人员树
|
||||
resultTree = BuildTreeUtil.listInfoToTree(JSONArray.parseArray(JSON.toJSONString(list)), "id", "parentId", "children");
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return AjaxResult.success(resultTree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getWorkInfo(BraceletParamsDto dto) {
|
||||
Map<String, Object> mapData = new HashMap<>();
|
||||
try {
|
||||
// 获取施工班组、施工人数(包含班组人员和临时人员))、安全帽绑定信息
|
||||
List<Integer> workTeamList = mapper.getWorkNum(dto);
|
||||
List<Map<String, Object>> safetyHatLists = mapper.getSafetyHatInfo(dto);
|
||||
if (CollectionUtils.isNotEmpty(safetyHatLists)) {
|
||||
for (Map<String, Object> map : safetyHatLists) {
|
||||
if (map.get("phone") != null) {
|
||||
map.put("phone", Sm4Utils.decode(String.valueOf(map.get("phone"))));
|
||||
}
|
||||
}
|
||||
}
|
||||
mapData.put("workTeamNum", workTeamList.get(0));
|
||||
mapData.put("workUserNum", workTeamList.get(1) + workTeamList.get(2));
|
||||
mapData.put("safetyHatList", safetyHatLists);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return AjaxResult.success(mapData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getPersonsInfo(BraceletParamsDto dto) {
|
||||
Map<String, Object> mapData = new HashMap<>();
|
||||
try {
|
||||
// 获取杆塔信息、施工距离、绑定手环的班组施工人员/临时人员 位置信息
|
||||
Map<String, Object> towerMap = mapper.getTowerInfo(dto);
|
||||
String distance = mapper.getDistance();
|
||||
Double distanceValue = 0D;
|
||||
if (StringUtils.isEmpty(distance)) {
|
||||
distanceValue = StringUtils.isEmpty(distance) ? 50 : Double.parseDouble(distance);
|
||||
}
|
||||
List<Map<String, Object>> personList = mapper.getWorkPersonInfo(dto);
|
||||
if (CollectionUtils.isNotEmpty(personList)) {
|
||||
for (Map<String, Object> map : personList) {
|
||||
if (map.get("phone") != null) {
|
||||
map.put("phone", Sm4Utils.decode(String.valueOf(map.get("phone"))));
|
||||
}
|
||||
// 获取已绑手环的定位信息
|
||||
List<Map<String, Object>> shMapDataList = mapper.getShDeviceInfo(map);
|
||||
map = getLatAndLon(shMapDataList,map);
|
||||
// 验证施工人员是否超出施工范围
|
||||
Integer isAbnormal = isAbnormal(distanceValue, map, towerMap);
|
||||
map.put("isWarn", isAbnormal);
|
||||
}
|
||||
}
|
||||
mapData.put("towerInfo", towerMap);
|
||||
mapData.put("distance", distanceValue);
|
||||
mapData.put("personList", personList);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return AjaxResult.success(mapData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 班组人员/临时人员 是否超出正常施工范围
|
||||
*
|
||||
* @param distance
|
||||
* @param map
|
||||
* @return Integer
|
||||
* @author cwchen
|
||||
* @date 2024/8/9 15:56
|
||||
*/
|
||||
public Integer isAbnormal(Double distance, Map<String, Object> map, Map<String, Object> towerMap) {
|
||||
Integer isWarn = 0;
|
||||
if(map.get("lon") == null || map.get("lat") == null){
|
||||
return isWarn;
|
||||
}
|
||||
Double lat = Double.parseDouble(String.valueOf(towerMap.get("lat")));
|
||||
Double lon = Double.parseDouble(String.valueOf(towerMap.get("lon")));
|
||||
Double sgLat = Double.parseDouble(String.valueOf(map.get("lat")));
|
||||
Double sgLon = Double.parseDouble(String.valueOf(map.get("lon")));
|
||||
double len = HaversineUtil.vincentyDistance(sgLat, sgLon, lat, lon);
|
||||
if (len > distance) {
|
||||
isWarn = 1;
|
||||
}
|
||||
return isWarn;
|
||||
}
|
||||
|
||||
/**
|
||||
* 赋值手环设备的经纬度
|
||||
* @param shMapDataList
|
||||
* @param map
|
||||
* @return Map<String, Object>
|
||||
* @author cwchen
|
||||
* @date 2024/8/9 16:56
|
||||
*/
|
||||
public Map<String, Object> getLatAndLon(List<Map<String, Object>> shMapDataList, Map<String, Object> map) {
|
||||
if (CollectionUtils.isEmpty(shMapDataList)) {
|
||||
return map;
|
||||
}
|
||||
for (Map<String, Object> mapData : shMapDataList) {
|
||||
if (Objects.equals(String.valueOf(map.get("dataCode")), BusinessConstants.LAT)) {
|
||||
map.put("lat", mapData.get("dataVal"));
|
||||
} else if (Objects.equals(String.valueOf(map.get("dataCode")), BusinessConstants.LON)) {
|
||||
map.put("lon", mapData.get("dataVal"));
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,26 @@
|
|||
package com.bonus.bracelet.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.bonus.bracelet.mapper.QueryConstructionMapper;
|
||||
import com.bonus.bracelet.service.IQueryConstructionService;
|
||||
import com.bonus.common.core.constant.BusinessConstants;
|
||||
import com.bonus.common.core.constant.HttpStatus;
|
||||
import com.bonus.common.core.constant.SecurityConstants;
|
||||
import com.bonus.common.core.domain.R;
|
||||
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
||||
import com.bonus.common.entity.bracelet.vo.BaseProject;
|
||||
import com.bonus.common.entity.bracelet.vo.PersonVo;
|
||||
import com.bonus.common.entity.bracelet.vo.QueryConstruction;
|
||||
|
||||
import com.bonus.common.entity.bracelet.vo.WarnInfoVo;
|
||||
import com.bonus.system.api.RemoteFileService;
|
||||
import com.bonus.system.api.domain.SysFile;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -26,6 +37,8 @@ public class QueryConstructionServiceImpl implements IQueryConstructionService
|
|||
@Autowired
|
||||
private QueryConstructionMapper constructionMapper;
|
||||
|
||||
@Resource
|
||||
private RemoteFileService remoteFileService;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -50,8 +63,12 @@ public class QueryConstructionServiceImpl implements IQueryConstructionService
|
|||
@Override
|
||||
public List<PersonVo> getTeamLists(PersonVo data) {
|
||||
List<PersonVo> list = new ArrayList<>();
|
||||
data.setSourceType(BusinessConstants.RESOURCE_TYPE_USER);
|
||||
try {
|
||||
list = constructionMapper.getTeamLists(data);
|
||||
for (PersonVo vo : list) {
|
||||
vo = handleData(vo);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
|
|
@ -67,8 +84,42 @@ public class QueryConstructionServiceImpl implements IQueryConstructionService
|
|||
@Override
|
||||
public List<PersonVo> getTempLists(PersonVo data) {
|
||||
List<PersonVo> list = new ArrayList<>();
|
||||
data.setSourceType(BusinessConstants.RESOURCE_TYPE_USERTEMP);
|
||||
try {
|
||||
list = constructionMapper.getTempLists(data);
|
||||
for (PersonVo vo : list) {
|
||||
vo = handleData(vo);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public PersonVo handleData(PersonVo vo) {
|
||||
vo.setIdCard(Sm4Utils.decode(vo.getIdCard()));
|
||||
vo.setPhone(Sm4Utils.decode(vo.getPhone()));
|
||||
R<SysFile> result = remoteFileService.getImgBase64(vo.getFilePath(), SecurityConstants.INNER);
|
||||
if (result != null && result.getCode() == HttpStatus.SUCCESS && result.getData() != null) {
|
||||
String jsonString = JSON.toJSONString(result.getData());
|
||||
JSONObject item = JSON.parseObject(jsonString);
|
||||
String base64 = item.getString("url");
|
||||
vo.setBase64Url(base64);
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 施工预警信息
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<WarnInfoVo> getWarnLists(QueryConstruction data) {
|
||||
List<WarnInfoVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = constructionMapper.getWarnLists(data);
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
package com.bonus.bracelet.service.impl;
|
||||
|
||||
import com.bonus.bracelet.mapper.DeviceLyRecordMapper;
|
||||
import com.bonus.bracelet.mapper.WarnHistoryMapper;
|
||||
import com.bonus.bracelet.service.IDeviceLyRecordService;
|
||||
import com.bonus.bracelet.service.IWarnHistoryService;
|
||||
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
||||
import com.bonus.common.entity.bracelet.vo.EquipmentReqVo;
|
||||
import com.bonus.common.entity.bracelet.vo.WarnInfoVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:DeviceLyRecordServiceImpl
|
||||
* @description:设备领用记录-serviceImpl
|
||||
*/
|
||||
@Slf4j
|
||||
@Service(value = "IWarnHistoryService")
|
||||
public class WarnHistorympl implements IWarnHistoryService {
|
||||
|
||||
@Resource(name = "WarnHistoryMapper")
|
||||
private WarnHistoryMapper mapper;
|
||||
|
||||
@Override
|
||||
public List<WarnInfoVo> getWarnLists(WarnInfoVo dto) {
|
||||
List<WarnInfoVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getWarnLists(dto);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectProjectList" parameterType="com.bonus.common.entity.bracelet.vo.BaseProject" resultMap="BaseProjectResult">
|
||||
select a.id, depart_name, head_name, contact_information,count(b.source_id) as appnum, remarks,a.create_user,a.update_user
|
||||
from tb_project_depart a
|
||||
left join sys_file_source b on a.id = b.source_id and b.del_flag = 0
|
||||
left join sys_file_source b on a.id = b.source_id and b.source_type = 5 and b.del_flag = 0
|
||||
<where>
|
||||
a.del_flag = 0
|
||||
<if test="projectDepartName != null and projectDepartName != ''">
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="roleCode=='depart'">
|
||||
AND a.departId = #{departId}
|
||||
</if>
|
||||
AND a.departId IS NOT NULL
|
||||
</where>
|
||||
ORDER BY a.orderTime DESC
|
||||
</select>
|
||||
|
|
@ -94,4 +95,184 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</where>
|
||||
ORDER BY tw.create_time DESC
|
||||
</select>
|
||||
<!--人员管控-人员树-->
|
||||
<select id="getPersonsTree" resultType="com.bonus.common.entity.bracelet.vo.PersonTreeVo">
|
||||
SELECT * FROM (
|
||||
SELECT tp.id,
|
||||
tp.pro_name AS label,
|
||||
tp.depart_id AS departId,
|
||||
0 AS parentId,
|
||||
1 AS level,
|
||||
0 AS isTeamLeader,
|
||||
0 AS isWarn
|
||||
FROM tb_project tp
|
||||
WHERE tp.del_flag = 0
|
||||
UNION ALL
|
||||
SELECT CONCAT('tower','-',tpp.id),
|
||||
tpp.power_name AS label,
|
||||
tp.depart_id AS departId,
|
||||
tpp.pro_id AS parentId,
|
||||
2 AS level,
|
||||
0 AS isTeamLeader,
|
||||
0 AS isWarn
|
||||
FROM tb_project_power tpp
|
||||
LEFT JOIN tb_project tp ON tpp.pro_id = tp.id AND tp.del_flag = 0
|
||||
WHERE tpp.del_flag = 0
|
||||
UNION ALL
|
||||
SELECT CONCAT('team','-',twt.team_id) AS id,
|
||||
twt.team_name AS label,
|
||||
tp.depart_id AS departId,
|
||||
CONCAT('tower','-',tdu.gt_id) AS parentId,
|
||||
3 AS level,
|
||||
0 AS isTeamLeader,
|
||||
0 AS isWarn
|
||||
FROM tb_dev_use tdu
|
||||
LEFT JOIN tb_dev_use_bid tdub ON tdu.id = tdub.id
|
||||
LEFT JOIN t_work_team twt ON tdu.team_id = twt.team_id AND twt.del_flag = 0
|
||||
LEFT JOIN tb_project tp ON twt.pro_id = tp.id AND tp.del_flag = 0
|
||||
WHERE tdub.dev_type = 'shx' AND tdub.gh_time IS NULL
|
||||
UNION ALL
|
||||
SELECT tpe.id,
|
||||
CONCAT(tpe.name,'-',tpe.phone) AS label,
|
||||
tp.depart_id AS departId,
|
||||
CONCAT('team','-',tpe.team_id) AS parentId,
|
||||
4 AS level,
|
||||
IF(twt.team_leader_id = tpe.id,1,0) AS isTeamLeader,
|
||||
0 AS isWarn
|
||||
FROM tb_dev_use tdu
|
||||
LEFT JOIN tb_dev_use_bid tdub ON tdu.id = tdub.id
|
||||
LEFT JOIN t_work_team twt ON tdu.team_id = twt.team_id AND twt.del_flag = 0
|
||||
LEFT JOIN tb_people tpe ON twt.team_id = tpe.team_id AND tpe.del_flag = 0
|
||||
LEFT JOIN tb_project tp ON twt.pro_id = tp.id AND tp.del_flag = 0
|
||||
WHERE tdub.dev_type = 'shx' AND tdub.gh_time IS NULL
|
||||
UNION ALL
|
||||
SELECT tlu.id,
|
||||
CONCAT(tlu.name,'-',tlu.phone) AS label,
|
||||
tp.depart_id AS departId,
|
||||
CONCAT('team','-',tlu.team_id) AS parentId,
|
||||
4 AS level,
|
||||
0 AS isTeamLeader,
|
||||
0 AS isWarn
|
||||
FROM tb_dev_use tdu
|
||||
LEFT JOIN tb_dev_use_bid tdub ON tdu.id = tdub.id
|
||||
LEFT JOIN t_work_team twt ON tdu.team_id = twt.team_id AND twt.del_flag = 0
|
||||
LEFT JOIN tb_ls_user tlu ON twt.team_id = tlu.team_id
|
||||
LEFT JOIN tb_project tp ON twt.pro_id = tp.id AND tp.del_flag = 0
|
||||
WHERE tdub.dev_type = 'shx' AND tdub.gh_time IS NULL
|
||||
) a
|
||||
<where>
|
||||
<if test="roleCode!='administrators' and roleCode!='depart'">
|
||||
a.departId = -1
|
||||
</if>
|
||||
<if test="roleCode=='depart'">
|
||||
AND a.departId = #{departId}
|
||||
</if>
|
||||
AND a.departId IS NOT NULL
|
||||
</where>
|
||||
</select>
|
||||
<!--获取今日施工班组/班组施工人数/临时人员施工数量-->
|
||||
<select id="getWorkNum" resultType="java.lang.Integer">
|
||||
SELECT COUNT(*)
|
||||
FROM t_work_team twt
|
||||
LEFT JOIN tb_project tp ON twt.pro_id = tp.id AND tp.del_flag = 0
|
||||
WHERE twt.team_status = 1 AND twt.del_flag = 0
|
||||
<if test="roleCode!='administrators' and roleCode!='depart'">
|
||||
AND tp.depart_id = -1
|
||||
</if>
|
||||
<if test="roleCode=='depart'">
|
||||
AND tp.depart_id = #{departId}
|
||||
</if>
|
||||
AND tp.depart_id IS NOT NULL
|
||||
UNION ALL
|
||||
SELECT COUNT(*)
|
||||
FROM t_work_team twt
|
||||
LEFT JOIN tb_project tp ON twt.pro_id = tp.id AND tp.del_flag = 0
|
||||
LEFT JOIN tb_people tpe ON twt.team_id = tpe.team_id AND tpe.del_flag = 0
|
||||
INNER JOIN tb_bracelet tb ON tpe.id = tb.bid_id AND tb.del_flag = 0 AND tb.peopel_type = 0
|
||||
WHERE twt.team_status = 1 AND twt.del_flag = 0
|
||||
<if test="roleCode!='administrators' and roleCode!='depart'">
|
||||
AND tp.depart_id = -1
|
||||
</if>
|
||||
<if test="roleCode=='depart'">
|
||||
AND tp.depart_id = #{departId}
|
||||
</if>
|
||||
AND tp.depart_id IS NOT NULL
|
||||
UNION ALL
|
||||
SELECT COUNT(*)
|
||||
FROM t_work_team twt
|
||||
LEFT JOIN tb_project tp ON twt.pro_id = tp.id AND tp.del_flag = 0
|
||||
LEFT JOIN tb_ls_user tls ON twt.team_id = tls.team_id
|
||||
INNER JOIN tb_bracelet tb ON tls.id = tb.bid_id AND tb.del_flag = 0 AND tb.peopel_type = 1
|
||||
WHERE twt.team_status = 1 AND twt.del_flag = 0
|
||||
<if test="roleCode!='administrators' and roleCode!='depart'">
|
||||
AND tp.depart_id = -1
|
||||
</if>
|
||||
<if test="roleCode=='depart'">
|
||||
AND tp.depart_id = #{departId}
|
||||
</if>
|
||||
AND tp.depart_id IS NOT NULL
|
||||
</select>
|
||||
<!--安全帽绑定信息-->
|
||||
<select id="getSafetyHatInfo" resultType="java.util.Map">
|
||||
SELECT td.id,
|
||||
tpe.name,
|
||||
tpe.phone,
|
||||
td.dev_name AS devName,
|
||||
td.dev_code AS devCode,
|
||||
td.dev_index AS devIndex,
|
||||
td.dev_status AS devStatus
|
||||
FROM tb_device td
|
||||
LEFT JOIN tb_dev_ly tdl ON td.id = tdl.dev_id
|
||||
LEFT JOIN tb_project tp ON tdl.pro_id = tp.id AND tp.del_flag = 0
|
||||
LEFT JOIN tb_people tpe ON tdl.ly_user = tpe.id AND tpe.del_flag = 0
|
||||
WHERE td.dev_type = 'aqm' AND tdl.ly_user IS NOT NULL
|
||||
<if test="roleCode!='administrators' and roleCode!='depart'">
|
||||
AND tp.depart_id = -1
|
||||
</if>
|
||||
<if test="roleCode=='depart'">
|
||||
AND tp.depart_id = #{departId}
|
||||
</if>
|
||||
AND tp.depart_id IS NOT NULL
|
||||
</select>
|
||||
<!--获取杆塔坐标-->
|
||||
<select id="getTowerInfo" resultType="java.util.Map">
|
||||
SELECT id,
|
||||
power_name AS powerName,
|
||||
lon,
|
||||
lat
|
||||
FROM tb_project_power
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
<!--获取施工距离-->
|
||||
<select id="getDistance" resultType="java.lang.String">
|
||||
SELECT dict_value
|
||||
FROM sys_dict_data
|
||||
WHERE dict_type = 'sys_sg_distance'
|
||||
LIMIT 1
|
||||
</select>
|
||||
<!--获取绑定手环的施工班组人员、临时人员信息-->
|
||||
<select id="getWorkPersonInfo" resultType="java.util.Map">
|
||||
SELECT tpe.id,tpe.name,tpe.phone,tb.id AS devId,0 AS type
|
||||
FROM t_work_team twt
|
||||
LEFT JOIN tb_people tpe ON twt.team_id = tpe.team_id AND tpe.del_flag = 0
|
||||
INNER JOIN tb_bracelet tb ON tpe.id = tb.bid_id AND tb.del_flag = 0 AND tb.peopel_type = 0
|
||||
WHERE twt.team_id = #{teamId}
|
||||
UNION ALL
|
||||
SELECT tls.id,tls.name,tls.phone,tb.id AS devId,1 AS type
|
||||
FROM t_work_team twt
|
||||
LEFT JOIN tb_ls_user tls ON twt.team_id = tls.team_id
|
||||
INNER JOIN tb_bracelet tb ON tls.id = tb.bid_id AND tb.del_flag = 0 AND tb.peopel_type = 1
|
||||
WHERE twt.team_id = #{teamId}
|
||||
</select>
|
||||
<!--获取已绑手环的信息-->
|
||||
<select id="getShDeviceInfo" resultType="java.util.Map">
|
||||
SELECT id ,
|
||||
data_name AS dataName,
|
||||
data_val AS dataVal,
|
||||
data_unit AS dataUnit,
|
||||
data_code AS dataCode,
|
||||
data_time AS dataTime
|
||||
FROM tb_dev_details
|
||||
WHERE dev_id=#{devId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -20,13 +20,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join tb_warn tw on tw.team_id = a.teamid and tw.del_flag = 0
|
||||
<where>
|
||||
<if test="proName != null and proName != ''">
|
||||
and tp.pro_name = #{proName}
|
||||
and INSTR(tp.pro_name,#{proName}) > 0
|
||||
</if>
|
||||
<if test="departName != null and departName != ''">
|
||||
and tpd.depart_name = #{departName}
|
||||
and INSTR(tpd.depart_name,#{departName}) > 0
|
||||
</if>
|
||||
<if test="teamName != null and teamName != ''">
|
||||
and twt.team_name = #{teamName}
|
||||
and INSTR(twt.team_name,#{teamName}) > 0
|
||||
</if>
|
||||
<if test="lyTime != null ">
|
||||
and date_format(a.lytime,'%y%m%d') = date_format(#{lyTime},'%y%m%d')
|
||||
|
|
@ -39,33 +39,51 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<!--班组人员设备列表-->
|
||||
<select id="getTeamLists" resultType="com.bonus.common.entity.bracelet.vo.PersonVo">
|
||||
select tp.id as id,tp.name as name,tp.sex as sex,tp.id_card as idCard,tp.phone as phone,tp.aqm_code as aqmCode,tp.mj_code as mjCode
|
||||
select tp.id as id,tp.name as name,tp.sex as sex,tp.id_card as idCard,tp.phone as phone,
|
||||
tp.aqm_code as aqmCode,tp.mj_code as mjCode,sfs.file_path AS filePath,sfs.id AS fileId
|
||||
from t_work_team twt
|
||||
left join tb_people tp on twt.team_id = tp.team_id and tp.del_flag = 0
|
||||
left join sys_file_source sfs on tp.id = sfs.source_id AND sfs.source_type = #{sourceType} AND sfs.del_flag = 0
|
||||
<where>
|
||||
twt.team_id = #{teamId} and twt.del_flag = 0
|
||||
<if test="name != null and name!=''">
|
||||
AND INSTR(tp.name,#{name}) > 0
|
||||
</if>
|
||||
<if test="sex != null ">
|
||||
AND INSTR(tp.sex,#{sex}) > 0
|
||||
AND tp.sex = #{sex}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--临时人员设备列表-->
|
||||
<select id="getTempLists" resultType="com.bonus.common.entity.bracelet.vo.PersonVo">
|
||||
select tlu.id as id,tlu.name as name,tlu.sex as sex,tlu.id_card as idCard,tlu.phone as phone
|
||||
select tlu.id as id,tlu.name as name,tlu.sex as sex,tlu.id_card as idCard,tlu.phone as phone,
|
||||
sfs.file_path AS filePath,sfs.id AS fileId
|
||||
from t_work_team twt
|
||||
left join tb_ls_user tlu on twt.team_id = tlu.team_id
|
||||
left join sys_file_source sfs on tlu.id = sfs.source_id AND sfs.source_type = #{sourceType} AND sfs.del_flag = 0
|
||||
<where>
|
||||
twt.team_id = #{teamId} and twt.del_flag = 0
|
||||
<if test="name != null and name!=''">
|
||||
AND INSTR(tlu.name,#{name}) > 0
|
||||
</if>
|
||||
<if test="sex != null ">
|
||||
AND INSTR(tlu.sex,#{sex}) > 0
|
||||
AND tlu.sex =#{sex}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--施工预警信息列表-->
|
||||
<select id="getWarnLists" resultType="com.bonus.common.entity.bracelet.vo.WarnInfoVo">
|
||||
select sdd.dict_label as devTypeName,tb.dev_name as devName,tw.warn_time as warnTime,tw.warn_content as warnContent
|
||||
from tb_warn tw
|
||||
left join tb_device tb on tw.dev_id = tb.id and tb.del_flag = 0
|
||||
left join sys_dict_data sdd on sdd.dict_value = tb.dev_type and sdd.dict_type = 'sys_device_type'
|
||||
where tw.team_id = #{teamId} and tw.dev_type = 1 and tw.del_flag = 0
|
||||
union all
|
||||
select '手环箱' as warnType,'\\' as deviceName,tw.warn_time as warnTime,tw.warn_content as warnContent
|
||||
from tb_warn tw
|
||||
left join tb_bracelet tbb on tw.dev_id = tbb.id and tbb.del_flag = 0
|
||||
where tw.team_id = #{teamId} and tw.dev_type = 0 and tw.del_flag = 0
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.bracelet.mapper.WarnHistoryMapper">
|
||||
<!--设备领用列表-->
|
||||
<select id="getWarnLists" resultType="com.bonus.common.entity.bracelet.vo.WarnInfoVo">
|
||||
select * from(
|
||||
select sdd.dict_label as devTypeName,tb.dev_name as devName,tw.warn_time as warnTime,tw.warn_content as warnContent
|
||||
from tb_warn tw
|
||||
left join tb_device tb on tw.dev_id = tb.id and tb.del_flag = 0
|
||||
left join sys_dict_data sdd on sdd.dict_value = tb.dev_type and sdd.dict_type = 'sys_device_type'
|
||||
where tw.dev_type = 1 and tw.del_flag = 0
|
||||
<if test="devTypeName!=null and devTypeName!='' and devTypeName != 'shx'">
|
||||
AND tb.dev_type = #{devTypeName}
|
||||
</if>
|
||||
<if test="devTypeName!=null and devTypeName!='' and devTypeName == 'shx'">
|
||||
AND tb.id = -1
|
||||
</if>
|
||||
union all
|
||||
select '手环箱' as warnType,'\\' as deviceName,tw.warn_time as warnTime,tw.warn_content as warnContent
|
||||
from tb_warn tw
|
||||
left join tb_bracelet tbb on tw.dev_id = tbb.id and tbb.del_flag = 0
|
||||
where tw.dev_type = 0 and tw.del_flag = 0
|
||||
<if test="devTypeName!=null and devTypeName!='' and devTypeName != 'shx'">
|
||||
AND tbb.id = -1
|
||||
</if>
|
||||
) a
|
||||
<where>
|
||||
<if test="devName!=null and devName!=''">
|
||||
AND INSTR(a.devName,#{devName}) > 0
|
||||
</if>
|
||||
<if test="warnContent!=null and warnContent!=''">
|
||||
AND INSTR(a.warnContent,#{warnContent}) > 0
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(a.warnTime,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and date_format(a.warnTime,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue