安徽合武项目需求增加

This commit is contained in:
pengjie 2025-02-24 18:24:07 +08:00
parent bebeab1176
commit 0af7c9ff21
17 changed files with 510 additions and 1 deletions

View File

@ -183,7 +183,7 @@
<select id="selectAiVideoTypeCountList" resultType="java.util.Map">
SELECT t1.device_type deviceType, video_name videoName
SELECT t1.device_type deviceType, video_name videoName, t1.ai_video_url aiVideoUrl, t1.cover_url coverUrl
FROM video_item t1
INNER JOIN project_video_config t2 ON t2.id = t1.video_id
WHERE t2.is_enable = 1

View File

@ -1,14 +1,21 @@
package com.zhgd.xmgl.modules.worker.controller;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.jeecg.common.system.query.QueryGenerator;
import com.zhgd.jeecg.common.util.oConvertUtils;
import com.zhgd.xmgl.entity.vo.AttendanceOfEachCompanyVo;
import com.zhgd.xmgl.entity.vo.NumberTimeTableVo;
import com.zhgd.xmgl.modules.worker.entity.WorkerAttendance;
import com.zhgd.xmgl.modules.worker.entity.dto.WorkerAttendanceDto;
import com.zhgd.xmgl.modules.worker.entity.vo.SafetyPerformanceAnalysisVo;
import com.zhgd.xmgl.modules.worker.service.IWorkerAttendanceService;
import com.zhgd.xmgl.modules.xz.entity.XzTaskProgressContent;
import com.zhgd.xmgl.security.util.SecurityUtils;
import com.zhgd.xmgl.util.ExcelUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@ -16,11 +23,17 @@ import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -101,6 +114,56 @@ public class WorkerAttendanceController {
return Result.success(workerAttendanceService.selectWorkerAttendancePage(map));
}
/**
* 列表查询
*
* @return
*/
@ApiOperation(value = "列表查询人员考勤信息安徽合武", notes = "列表查询人员考勤信息安徽合武", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目标识", dataType = "String", paramType = "body", required = true),
@ApiImplicitParam(name = "startTime", value = "开始时间", dataType = "String", paramType = "body", required = false),
@ApiImplicitParam(name = "isStatistics", value = "是否计入考勤统计,1是不计入0计入", dataType = "String", paramType = "body", required = false),
@ApiImplicitParam(name = "carNumber", value = "车牌号", dataType = "String", paramType = "body", required = false),
@ApiImplicitParam(name = "cardType", value = "卡类型 1 IC卡 2人脸识别 3 指纹识别 4补卡操作5二维码6蓝牙,7手机打卡,8车辆通行", dataType = "String", paramType = "body", required = false),
@ApiImplicitParam(name = "endTime", value = "结束时间", dataType = "String", paramType = "body", required = false),
@ApiImplicitParam(name = "workerName", value = "人员姓名", dataType = "String", paramType = "body", required = false),
@ApiImplicitParam(name = "passType", value = "考勤类型 1:进 2出", dataType = "Integer", paramType = "body", required = false),
})
@PostMapping(value = "/getList")
public Result<List<WorkerAttendanceDto>> getList(@RequestBody Map<String, Object> map) {
return Result.success(workerAttendanceService.selectWorkerAttendanceListByHwgt(map));
}
/**
* 导出
*
* @return
*/
@ApiOperation(value = "导出人员考勤信息安徽合武", notes = "导出人员考勤信息安徽合武", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目标识", dataType = "String", paramType = "body", required = true),
@ApiImplicitParam(name = "startTime", value = "开始时间", dataType = "String", paramType = "body", required = false),
@ApiImplicitParam(name = "isStatistics", value = "是否计入考勤统计,1是不计入0计入", dataType = "String", paramType = "body", required = false),
@ApiImplicitParam(name = "carNumber", value = "车牌号", dataType = "String", paramType = "body", required = false),
@ApiImplicitParam(name = "cardType", value = "卡类型 1 IC卡 2人脸识别 3 指纹识别 4补卡操作5二维码6蓝牙,7手机打卡,8车辆通行", dataType = "String", paramType = "body", required = false),
@ApiImplicitParam(name = "endTime", value = "结束时间", dataType = "String", paramType = "body", required = false),
@ApiImplicitParam(name = "workerName", value = "人员姓名", dataType = "String", paramType = "body", required = false),
@ApiImplicitParam(name = "passType", value = "考勤类型 1:进 2出", dataType = "Integer", paramType = "body", required = false),
})
@PostMapping(value = "/export")
public ModelAndView export(@RequestBody Map<String, Object> map) {
//Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
List<WorkerAttendanceDto> pageList = workerAttendanceService.selectWorkerAttendanceListByHwgt(map);
//导出文件名称
mv.addObject(NormalExcelConstants.FILE_NAME, "班前教育列表");
mv.addObject(NormalExcelConstants.CLASS, XzTaskProgressContent.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("班前教育列表数据", "导出人:" + SecurityUtils.getUser().getRealName(), "导出信息"));
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
@ApiOperation(value = "列表查询项目下最新人员考勤信息", notes = "列表查询项目下最新人员考勤信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目标识", dataType = "String", paramType = "body", required = true),

View File

@ -0,0 +1,156 @@
package com.zhgd.xmgl.modules.worker.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.zhgd.annotation.OperLog;
import com.zhgd.xmgl.modules.worker.entity.dto.WorkerHwDto;
import com.zhgd.xmgl.util.PageUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.jeecg.common.system.query.QueryGenerator;
import com.zhgd.jeecg.common.util.oConvertUtils;
import com.zhgd.xmgl.modules.worker.entity.WorkerHw;
import com.zhgd.xmgl.modules.worker.service.IWorkerHwService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import springfox.documentation.annotations.ApiIgnore;
/**
* @Title: Controller
* @Description: 安徽合武人员
* @author pengj
* @date 2025-02-24
* @version V1.0
*/
@RestController
@RequestMapping("/worker/workerHw")
@Slf4j
@Api(tags = "安徽合武人员管理")
public class WorkerHwController {
@Autowired
private IWorkerHwService workerHwService;
/**
* 树形查询
*
* @return
*/
@OperLog(operModul = "安徽合武人员管理", operType = "分页查询", operDesc = "分页列表查询安徽合武人员信息")
@ApiOperation(value = " 分页列表查询安徽合武人员信息", notes = "分页列表查询安徽合武人员信息", httpMethod = "POST")
@GetMapping(value = "/tree")
public Result<List<WorkerHwDto>> tree() {
List<WorkerHwDto> list = new ArrayList<>();
List<WorkerHw> allList = workerHwService.list(Wrappers.<WorkerHw>lambdaQuery().orderByAsc(WorkerHw::getGridSort));
List<String> stringList = allList.stream().map(a -> a.getGridName()).distinct().collect(Collectors.toList());
for (String s : stringList) {
WorkerHwDto workerHwDto = new WorkerHwDto();
workerHwDto.setName(s);
List<WorkerHwDto> first = getChildren(allList, 1, s);
for (WorkerHwDto hwDto : first) {
List<WorkerHwDto> second = getChildren(allList, 2, s);
List<WorkerHwDto> second1 = getChildren(allList, 3, s);
second.addAll(second1);
hwDto.setChildren(second);
}
workerHwDto.setChildren(first);
list.add(workerHwDto);
}
return Result.success(list);
}
private List<WorkerHwDto> getChildren(List<WorkerHw> allList, Integer type, String gridName) {
List<WorkerHwDto> list = new ArrayList<>();
List<WorkerHw> children = allList.stream().filter(a -> a.getGridName().equals(gridName) && a.getType() == type).collect(Collectors.toList());
for (WorkerHw child : children) {
WorkerHwDto workerHwDto = new WorkerHwDto();
workerHwDto.setId(child.getId());
workerHwDto.setName(child.getWorkerName());
workerHwDto.setType(child.getType());
list.add(workerHwDto);
}
return list;
}
/**
* 编辑
*
* @param workerHw
* @return
*/
@OperLog(operModul = "安徽合武人员管理", operType = "修改", operDesc = "编辑安徽合武人员信息")
@ApiOperation(value = "编辑安徽合武人员信息", notes = "编辑安徽合武人员信息", httpMethod = "POST")
@PostMapping(value = "/edit")
public Result<WorkerHw> edit(@RequestBody WorkerHw workerHw) {
Result<WorkerHw> result = new Result<WorkerHw>();
WorkerHw workerHwEntity = workerHwService.getById(workerHw.getId());
if (workerHwEntity == null) {
result.error500("未找到对应实体");
} else {
boolean ok = workerHwService.updateById(workerHw);
if (ok) {
result.success("修改成功!");
} else {
result.success("操作失败!");
}
}
return result;
}
/**
* 通过id删除
*
* @return
*/
@OperLog(operModul = "安徽合武人员管理", operType = "删除", operDesc = "删除安徽合武人员信息")
@ApiOperation(value = "删除安徽合武人员信息", notes = "删除安徽合武人员信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "安徽合武人员ID", paramType = "body", required = true, dataType = "Integer")
@PostMapping(value = "/delete")
public Result<WorkerHw> delete(@ApiIgnore @RequestBody WorkerHw workerHw) {
Result<WorkerHw> result = new Result<WorkerHw>();
WorkerHw workerHwEntity = workerHwService.getById(workerHw.getId());
if (workerHwEntity == null) {
result.error500("未找到对应实体");
} else {
boolean ok = workerHwService.removeById(workerHw.getId());
if (ok) {
result.success("删除成功!");
} else {
result.success("操作失败!");
}
}
return result;
}
}

View File

@ -778,4 +778,12 @@ public class WorkerInfoController {
public Result<List<Map<String, Object>>> getWorkerByNature(@ApiIgnore @RequestBody Map<String, Object> param) {
return Result.success(workerInfoService.getWorkerByNature(param));
}
@OperLog(operModul = "劳务管理", operType = "查询", operDesc = "安徽合武大屏人员统计")
@ApiOperation(value = "安徽合武大屏人员统计", notes = "安徽合武大屏人员统计")
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String")
@PostMapping("/selectPersonStatisticsByHwgt")
public Result<Map<String, Object>> selectPersonStatisticsByHwgt(@RequestBody Map<String, Object> map) {
return Result.success(workerInfoService.selectPersonStatisticsByHwgt(map));
}
}

View File

@ -0,0 +1,64 @@
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.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
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.ApiModelProperty;
/**
* @Description: 安徽合武人员
* @author pengj
* @date 2025-02-24
* @version V1.0
*/
@Data
@TableName("worker_hw")
@ApiModel(value = "WorkerHw实体类", description = "WorkerHw")
public class WorkerHw implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 安徽合武人员信息ID
*/
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "安徽合武人员信息ID")
private Integer id;
/**
* 人员名称
*/
@Excel(name = "人员名称", width = 15)
@ApiModelProperty(value = "人员名称")
private String workerName;
/**
* 类型(1:网格长;2网格管理员;3:网格班组长)
*/
@Excel(name = "类型(1:网格长;2网格管理员;3:网格班组长)", width = 15)
@ApiModelProperty(value = "类型(1:网格长;2网格管理员;3:网格班组长)")
private Integer type;
/**
* 网格名称
*/
@Excel(name = "网格名称", width = 15)
@ApiModelProperty(value = "网格名称")
private String gridName;
/**
* 网格排序
*/
@Excel(name = "网格排序", width = 15)
@ApiModelProperty(value = "网格排序")
private Integer gridSort;
/**
* 人员排序
*/
@Excel(name = "人员排序", width = 15)
@ApiModelProperty(value = "人员排序")
private Integer workerSort;
}

View File

@ -0,0 +1,34 @@
package com.zhgd.xmgl.modules.worker.entity.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
@Data
public class WorkerAttendanceDto {
@Excel(name = "姓名", width = 15)
@ApiModelProperty(value = "姓名")
private java.lang.String workerName;
@Excel(name = "性别", width = 15)
@ApiModelProperty(value = "性别1男2女")
private java.lang.Integer sex;
@Excel(name = "年龄", width = 15)
@ApiModelProperty(value = "年龄")
private java.lang.String age;
@Excel(name = "部门", width = 15)
@ApiModelProperty(value = "部门")
private java.lang.String departmentName;
@Excel(name = "照片", width = 15)
@ApiModelProperty(value = "照片")
private java.lang.String imageUrl;
@Excel(name = "培训时间", width = 15)
@ApiModelProperty(value = "培训时间")
private java.lang.String createTime;
}

View File

@ -0,0 +1,23 @@
package com.zhgd.xmgl.modules.worker.entity.dto;
import com.zhgd.xmgl.modules.worker.entity.WorkerHw;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class WorkerHwDto {
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "名称")
private String name;
@ApiModelProperty(value = "类型(1:网格长;2网格管理员;3:网格班组长)")
private Integer type;
@ApiModelProperty(value = "子级")
private List<WorkerHwDto> children;
}

View File

@ -8,6 +8,7 @@ import com.zhgd.xmgl.entity.vo.NumberTimeTableVo;
import com.zhgd.xmgl.modules.worker.entity.WorkerAttendance;
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.dto.WorkerAttendanceDto;
import com.zhgd.xmgl.modules.worker.entity.vo.ProjectCompanyWorkTotal;
import com.zhgd.xmgl.modules.worker.entity.vo.SafetyPerformanceAnalysisVo;
import org.apache.ibatis.annotations.Mapper;
@ -60,6 +61,8 @@ public interface WorkerAttendanceMapper extends BaseMapper<WorkerAttendance> {
*/
List<EntityMap> selectWorkerAttendancePage(@Param("param") Map<String, Object> map);
List<EntityMap> selectWorkerAttendanceListByHwgt(@Param("param") Map<String, Object> map);
/**
* 列表查询项目下最新人员考勤信息
*

View File

@ -0,0 +1,19 @@
package com.zhgd.xmgl.modules.worker.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.zhgd.xmgl.modules.worker.entity.WorkerHw;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 安徽合武人员
* @author pengj
* @date 2025-02-24
* @version V1.0
*/
@Mapper
public interface WorkerHwMapper extends BaseMapper<WorkerHw> {
}

View File

@ -88,6 +88,46 @@
</if>
order by a.create_time desc
</select>
<select id="selectWorkerAttendanceListByHwgt" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
SELECT b.worker_name, b.sex,
(case
when b.birthday != '' then year(from_days(datediff(NOW(), b.birthday)))
else '-' end) age,
d.department_name,
IF(a.image_url IS NOT NULL, a.image_url, b.id_card_big_photo_url) image_url,
a.create_time
from worker_attendance a
LEFT JOIN worker_info b ON a.person_sn = b.person_sn
LEFT JOIN department_info d ON b.department_id = d.id
WHERE a.project_sn = #{param.projectSn}
<if test="param.workerName != null and param.workerName != ''">
and b.worker_name like CONCAT(CONCAT('%', #{param.workerName}), '%')
</if>
<if test="param.passType != null and param.passType != ''">
and a.pass_type = #{param.passType}
</if>
<if test="param.startTime != null and param.startTime != ''">
AND a.create_time >= #{param.startTime}
</if>
<if test="param.endTime != null and param.endTime != ''">
and a.create_time &lt;= #{param.endTime}
</if>
<if test="param.carNumber != null and param.carNumber != ''">
and a.car_number = #{param.carNumber}
</if>
<if test="param.teamId != null and param.teamId != ''">
and b.team_id = #{param.teamId}
</if>
<if test="param.departmentId != null and param.departmentId != ''">
and b.department_id = #{param.departmentId}
</if>
<if test="param.cardType != null and param.cardType != ''">
and a.card_type = #{param.cardType}
</if>
order by a.create_time desc
</select>
<select id="selectWorkerAttendanceNewestList" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
SELECT a.*,
IF(a.image_url IS NOT NULL, a.image_url, b.id_card_big_photo_url) image_url,

View File

@ -0,0 +1,5 @@
<?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.zhgd.xmgl.modules.worker.mapper.WorkerHwMapper">
</mapper>

View File

@ -9,6 +9,7 @@ import com.zhgd.xmgl.entity.vo.AttendanceOfEachCompanyVo;
import com.zhgd.xmgl.entity.vo.NumberTimeTableVo;
import com.zhgd.xmgl.modules.worker.entity.WorkerAttendance;
import com.zhgd.xmgl.modules.worker.entity.dto.GetPassRecordDto;
import com.zhgd.xmgl.modules.worker.entity.dto.WorkerAttendanceDto;
import com.zhgd.xmgl.modules.worker.entity.vo.SafetyPerformanceAnalysisVo;
import com.zhgd.xmgl.modules.worker.entity.vo.UploadAttendanceByDevDto;
@ -64,6 +65,14 @@ public interface IWorkerAttendanceService extends IService<WorkerAttendance> {
*/
List<WorkerAttendance> selectWorkerAttendanceList(Map<String, Object> map);
/**
* 列表查询人员考勤信息
*
* @param map
* @return
*/
List<WorkerAttendanceDto> selectWorkerAttendanceListByHwgt(Map<String, Object> map);
/**
* 列表查询项目下最新人员考勤信息
*

View File

@ -0,0 +1,14 @@
package com.zhgd.xmgl.modules.worker.service;
import com.zhgd.xmgl.modules.worker.entity.WorkerHw;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 安徽合武人员
* @author pengj
* @date 2025-02-24
* @version V1.0
*/
public interface IWorkerHwService extends IService<WorkerHw> {
}

View File

@ -585,4 +585,6 @@ public interface IWorkerInfoService extends IService<WorkerInfo> {
* @return
*/
List<Map<String, Object>> getWorkerByNature(Map<String, Object> param);
Map<String, Object> selectPersonStatisticsByHwgt(Map<String, Object> param);
}

View File

@ -34,6 +34,7 @@ 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.dto.WorkerAttendanceDto;
import com.zhgd.xmgl.modules.worker.entity.vo.GetWorkerInfoByDevVo;
import com.zhgd.xmgl.modules.worker.entity.vo.ProjectCompanyWorkTotal;
import com.zhgd.xmgl.modules.worker.entity.vo.SafetyPerformanceAnalysisVo;
@ -249,6 +250,12 @@ public class WorkerAttendanceServiceImpl extends ServiceImpl<WorkerAttendanceMap
return BeanUtil.copyToList(list, WorkerAttendance.class);
}
@Override
public List<WorkerAttendanceDto> selectWorkerAttendanceListByHwgt(Map<String, Object> map) {
List<EntityMap> list = workerAttendanceMapper.selectWorkerAttendanceListByHwgt(map);
return BeanUtil.copyToList(list, WorkerAttendanceDto.class);
}
@Override
public List<EntityMap> selectWorkerAttendanceNewestList(Map<String, Object> param) {
return workerAttendanceMapper.selectWorkerAttendanceNewestList(param);

View File

@ -0,0 +1,19 @@
package com.zhgd.xmgl.modules.worker.service.impl;
import com.zhgd.xmgl.modules.worker.entity.WorkerHw;
import com.zhgd.xmgl.modules.worker.mapper.WorkerHwMapper;
import com.zhgd.xmgl.modules.worker.service.IWorkerHwService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 安徽合武人员
* @author pengj
* @date 2025-02-24
* @version V1.0
*/
@Service
public class WorkerHwServiceImpl extends ServiceImpl<WorkerHwMapper, WorkerHw> implements IWorkerHwService {
}

View File

@ -75,6 +75,7 @@ import com.zhgd.xmgl.modules.xz.service.impl.XzSupplierQualificationApplyService
import com.zhgd.xmgl.security.entity.UserInfo;
import com.zhgd.xmgl.security.util.SecurityUtils;
import com.zhgd.xmgl.util.*;
import liquibase.pro.packaged.S;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
@ -272,6 +273,9 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
@Lazy
@Autowired
private IQualityRegionService qualityRegionService;
@Lazy
@Autowired
private IWorkerAttendancePresenceService workerAttendancePresenceService;
/**
* 人员管理分页
*
@ -2680,6 +2684,45 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
return resultList;
}
@Override
public Map<String, Object> selectPersonStatisticsByHwgt(Map<String, Object> param) {
String projectSn = MapUtils.getString(param, "projectSn");
Map<String, Object> resultMap = new HashMap<>();
//在册人数
List<WorkerInfo> workerInfoList = baseMapper.selectList(Wrappers.<WorkerInfo>lambdaQuery().eq(WorkerInfo::getPersonType, 2)
.eq(WorkerInfo::getInserviceType, 1).eq(WorkerInfo::getProjectSn, projectSn));
//今日在场人员
List<String> workerAttendancePresenceList = workerAttendancePresenceService.list(Wrappers.<WorkerAttendancePresence>lambdaQuery()
.eq(WorkerAttendancePresence::getProjectSn, projectSn)).stream().map(w -> w.getPersonSn()).collect(Collectors.toList());
//今日考勤人数
List<String> workerAttendList = workerAttendanceMapper.selectList(Wrappers.<WorkerAttendance>lambdaQuery()
.eq(WorkerAttendance::getProjectSn, projectSn)).stream().map(w -> w.getPersonSn()).distinct().collect(Collectors.toList());
List<WorkerInfo> presenceWorkerList = workerInfoList.stream().filter(w -> workerAttendancePresenceList.contains(w.getPersonSn())).collect(Collectors.toList());
List<WorkerInfo> attendWorkerList = workerInfoList.stream().filter(w -> workerAttendList.contains(w.getPersonSn())).collect(Collectors.toList());
List<DepartmentInfo> departmentInfos = departmentInfoMapper.selectList(Wrappers.<DepartmentInfo>lambdaQuery().eq(DepartmentInfo::getProjectSn, projectSn));
List<Map<String, Object>> presenceList = new ArrayList<>();
for (DepartmentInfo departmentInfo : departmentInfos) {
Map<String, Object> presenceMap = new HashMap<>();
presenceMap.put("deptName", departmentInfo.getDepartmentName());
presenceMap.put("presenceNum", presenceWorkerList.stream().filter(p -> p.getDepartmentId().toString().equals(departmentInfo.getId().toString())).count());
presenceMap.put("inServiceNum", workerInfoList.stream().filter(p -> p.getDepartmentId().toString().equals(departmentInfo.getId().toString())).count());
presenceList.add(presenceMap);
}
List<Map<String, Object>> attentList = new ArrayList<>();
for (DepartmentInfo departmentInfo : departmentInfos) {
Map<String, Object> attentMap = new HashMap<>();
attentMap.put("deptName", departmentInfo.getDepartmentName());
attentMap.put("attendNum", attendWorkerList.stream().filter(p -> p.getDepartmentId().toString().equals(departmentInfo.getId().toString())).count());
attentList.add(attentMap);
}
resultMap.put("presencePerson", presenceList);
resultMap.put("attendPerson", attentList);
resultMap.put("totalAttend", workerAttendList.size());
resultMap.put("totalManager", workerInfoList.size());
return resultMap;
}
/**
* 获取是否合格
*