bug修复

This commit is contained in:
Administrator 2023-07-10 09:15:05 +08:00
parent 27df1993ec
commit 1d68194234
19 changed files with 295 additions and 156 deletions

View File

@ -15,6 +15,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -73,19 +74,22 @@ public class ProjectOperationsAnalysisController {
@ApiOperation(value = " 查询考勤统计列表", notes = "查询考勤统计列表", httpMethod = "GET")
@ApiImplicitParam(name = "projectSnList", value = "项目SN列表", paramType = "query", required = false, dataType = "String")
@RequestMapping(value = "/selectAttendanceDetailByPage", method = {RequestMethod.GET, RequestMethod.POST})
public Result<Page<WorkerMonthAttendanceStatisticsVo>> selectAttendanceDetailByPage(@RequestBody(required = false) HashMap<String, Object> map, @RequestParam(name = "workerName", required = false) String workerName,
@RequestParam(name = "projectSn", required = false) String projectSn,
@RequestParam(name = "personType", required = false) String personType,
@RequestParam(name = "groupId", required = false) Long groupId,
@RequestParam(name = "workerTypeId", required = false) Long workerTypeId,
@RequestParam(name = "time", required = false) String time,
@RequestParam(name = "queryTime", required = false) String queryTime,
@RequestParam(name = "personSn", required = false) String personSn,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
@RequestMapping(value = "/selectAttendanceDetailByPage", method = {RequestMethod.GET})
public Result<Page<WorkerMonthAttendanceStatisticsVo>> selectAttendanceDetailByPage(@RequestParam(required = false) HashMap<String, Object> map) {
Result<Page<WorkerMonthAttendanceStatisticsVo>> result = new Result<>();
Page<WorkerMonthAttendanceStatisticsVo> list = projectOperationsAnalysisService.selectAttendanceDetailByPage(map, workerName, projectSn, groupId, workerTypeId, time, queryTime, personSn, pageNo, pageSize, personType);
Page<WorkerMonthAttendanceStatisticsVo> list = projectOperationsAnalysisService.selectAttendanceDetailByPage(map);
result.setResult(list);
result.setSuccess(true);
result.setCode(200);
return result;
}
@ApiOperation(value = " 查询考勤统计列表", notes = "查询考勤统计列表", httpMethod = "POST")
@ApiImplicitParam(name = "projectSnList", value = "项目SN列表", paramType = "query", required = false, dataType = "String")
@RequestMapping(value = "/selectAttendanceDetailByPage", method = {RequestMethod.POST})
public Result<Page<WorkerMonthAttendanceStatisticsVo>> selectAttendanceDetailByPagePost(@RequestBody(required = false) HashMap<String, Object> map) {
Result<Page<WorkerMonthAttendanceStatisticsVo>> result = new Result<>();
Page<WorkerMonthAttendanceStatisticsVo> list = projectOperationsAnalysisService.selectAttendanceDetailByPage(map);
result.setResult(list);
result.setSuccess(true);
result.setCode(200);

View File

@ -1,20 +1,25 @@
package com.zhgd.xmgl.modules.realnamestatistics.entity.vo;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.io.Serializable;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class WorkerMonthAttendanceStatisticsVo {
/**考勤人员唯一标识*/
/**
* 考勤人员唯一标识
*/
@Excel(name = "考勤人员唯一标识", width = 15)
@ApiModelProperty(value="考勤人员唯一标识")
private java.lang.String workerName ;
@ApiModelProperty(value = "考勤人员唯一标识")
private java.lang.String workerName;
private java.lang.String personSn ;
@ -125,27 +130,34 @@ public class WorkerMonthAttendanceStatisticsVo {
/**day27*/
@Excel(name = "day27", width = 15)
@ApiModelProperty(value="day27")
private java.lang.Integer day27 ;
/**day28*/
private java.lang.Integer day27;
/**
* day28
*/
@Excel(name = "day28", width = 15)
@ApiModelProperty(value="day28")
private java.lang.Integer day28 ;
/**day29*/
@ApiModelProperty(value = "day28")
private java.lang.Integer day28;
/**
* day29
*/
@Excel(name = "day29", width = 15)
@ApiModelProperty(value = "day29")
private java.lang.Integer day29;
@JsonInclude(value = JsonInclude.Include.NON_NULL)
private Integer day29;
/**
* day30
*/
@Excel(name = "day30", width = 15)
@ApiModelProperty(value = "day30")
private java.lang.Integer day30;
@JsonInclude(value = JsonInclude.Include.NON_NULL)
private Integer day30;
/**
* day31
*/
@Excel(name = "day31", width = 15)
@ApiModelProperty(value = "day31")
private java.lang.Integer day31;
@JsonInclude(value = JsonInclude.Include.NON_NULL)
private Integer day31;
@ApiModelProperty(value = "项目名称")
private String projectName;
@ApiModelProperty(value = "身份证头像")

View File

@ -24,7 +24,7 @@ public interface ProjectOperationsAnalysisMapper extends BaseMapper<ProjectOpera
List<ProjectOperationsAnalysis> getAllDetails();
Page<WorkerMonthAttendanceStatisticsVo> selectAttendanceDetailByPage(Page<WorkerMonthAttendanceStatisticsVo> page, @Param("paramMap") HashMap<String, Object> map, @Param("workerName") String workerName, @Param("projectSn") String projectSn, @Param("groupId") Long groupId, @Param("workerTypeId") Long workerTypeId, @Param("time") String time, @Param("queryTime") String queryTime, @Param("personSn") String personSn, @Param("personType") String personType);
Page<WorkerMonthAttendanceStatisticsVo> selectAttendanceDetailByPage(Page<WorkerMonthAttendanceStatisticsVo> page, @Param("p") HashMap<String, Object> map);
Page<TodayAttendance> selectWorkerTodayAttendancePageList(Page<TodayAttendance> page, @Param("projectSn") String projectSn);

View File

@ -73,18 +73,15 @@
IFNULL(day26,0) day26,
IFNULL(day27,0) day27,
IFNULL(day28,0) day28,
IFNULL(day29,0) day29,
IFNULL(day30,0) day30,
IFNULL(day31,0) day31,
IF(29>DAY(last_day(str_to_date(CONCAT(#{p.queryTime},'-01'),'%Y-%m-%d'))),NULL,day29) day29,
IF(30>DAY(last_day(str_to_date(CONCAT(#{p.queryTime},'-01'),'%Y-%m-%d'))),NULL,day30) day30,
IF(31>DAY(last_day(str_to_date(CONCAT(#{p.queryTime},'-01'),'%Y-%m-%d'))),NULL,day31) day31,
p.project_name,i.id_card_big_photo_url,ei.enterprise_name
from worker_info i
INNER JOIN project p on i.project_sn=p.project_sn
LEFT JOIN worker_month_attendance_statistics s on (i.person_sn=s.person_sn
<if test="queryTime != null and queryTime != ''">
AND s.query_time=#{queryTime}
</if>
<if test="time != null and time != ''">
AND s.query_time=#{time}
<if test="p.queryTime != null and p.queryTime != ''">
AND s.query_time=#{p.queryTime}
</if>
)
LEFT JOIN team_info tm on tm.id=i.team_id
@ -92,30 +89,30 @@
LEFT JOIN department_info d on d.id=i.department_id
LEFT JOIN enterprise_info ei on ei.id=tm.enterprise_id
where 1=1
<if test="paramMap.projectSnList != null">
<if test="p.projectSnList != null">
and i.project_sn in
<foreach collection="paramMap.projectSnList" item="item" index="index"
<foreach collection="p.projectSnList" item="item" index="index"
separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="projectSn != null and projectSn != ''">
AND i.project_sn=#{projectSn}
<if test="p.projectSn != null and p.projectSn != ''">
AND i.project_sn=#{p.projectSn}
</if>
<if test="personType != null and personType != ''">
AND i.person_type=#{personType}
<if test="p.personType != null and p.personType != ''">
AND i.person_type=#{p.personType}
</if>
<if test="groupId != null and groupId != ''">
AND i.team_id = #{groupId}
<if test="p.groupId != null and p.groupId != ''">
AND i.team_id = #{p.groupId}
</if>
<if test="workerTypeId != null and workerTypeId != ''">
AND t.id = #{workerTypeId}
<if test="p.workerTypeId != null and p.workerTypeId != ''">
AND t.id = #{p.workerTypeId}
</if>
<if test="workerName != null and workerName != ''">
AND i.worker_name like concat ('%',#{workerName},'%')
<if test="p.workerName != null and p.workerName != ''">
AND i.worker_name like concat ('%',#{p.workerName},'%')
</if>
<if test="personSn != null and personSn != ''">
AND i.person_sn=#{personSn}
<if test="p.personSn != null and p.personSn != ''">
AND i.person_sn=#{p.personSn}
</if>
order by s.query_time desc
</select>

View File

@ -30,7 +30,7 @@ public interface IProjectOperationsAnalysisService extends IService<ProjectOpera
List<WorkerType> getAllWorkerType(String projectSn);
Page<WorkerMonthAttendanceStatisticsVo> selectAttendanceDetailByPage(HashMap<String, Object> map, String workerName, String projectSn, Long groupId, Long workerTypeId, String time, String queryTime, String personSn, Integer pageNo, Integer pageSize, String personnelType);
Page<WorkerMonthAttendanceStatisticsVo> selectAttendanceDetailByPage(HashMap<String, Object> map);
Page<TodayAttendance> selectWorkerTodayAttendancePageList(String projectSn, Integer pageNo, Integer pageSize, String personType);

View File

@ -1,8 +1,9 @@
package com.zhgd.xmgl.modules.realnamestatistics.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import com.alibaba.fastjson.JSON;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -23,13 +24,12 @@ import com.zhgd.xmgl.modules.worker.service.IWorkerTypeService;
import com.zhgd.xmgl.util.ProfileJudgeUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* <p>
@ -142,9 +142,18 @@ public class ProjectOperationsAnalysisServiceImpl extends ServiceImpl<ProjectOpe
}
@Override
public Page<WorkerMonthAttendanceStatisticsVo> selectAttendanceDetailByPage(HashMap<String, Object> map, String workerName, String projectSn, Long groupId, Long workerTypeId, String time, String queryTime, String personSn, Integer pageNo, Integer pageSize, String personType) {
public Page<WorkerMonthAttendanceStatisticsVo> selectAttendanceDetailByPage(HashMap<String, Object> map) {
long pageNo = Optional.ofNullable(MapUtils.getInteger(map, "pageNo")).orElse(1);
long pageSize = Optional.ofNullable(MapUtils.getInteger(map, "pageSize")).orElse(10);
if (StrUtil.isBlank(MapUtils.getString(map, "queryTime"))) {
map.put("queryTime", MapUtils.getString(map, "time"));
if (StrUtil.isBlank(MapUtils.getString(map, "queryTime"))) {
map.put("queryTime", DateUtil.format(new Date(), "yyyy-MM"));
}
}
Page<WorkerMonthAttendanceStatisticsVo> page = new Page<>(pageNo, pageSize);
Page<WorkerMonthAttendanceStatisticsVo> rPage = baseMapper.selectAttendanceDetailByPage(page, map, workerName, projectSn, groupId, workerTypeId, time, queryTime, personSn, personType);
Page<WorkerMonthAttendanceStatisticsVo> rPage = baseMapper.selectAttendanceDetailByPage(page, map);
try {
Integer noAttendanceType = 0;
Integer normalType = 1;
@ -164,7 +173,6 @@ public class ProjectOperationsAnalysisServiceImpl extends ServiceImpl<ProjectOpe
e.printStackTrace();
}
return rPage;
}
private int calculateNum(Integer type, WorkerMonthAttendanceStatisticsVo e) {

View File

@ -22,8 +22,8 @@ import io.swagger.annotations.ApiModelProperty;
@ApiModel(value="ReceivingForwardingUnit实体类",description="ReceivingForwardingUnit")
public class ReceivingForwardingUnit implements Serializable {
private static final long serialVersionUID = 1L;
/**主键id*/
/**主键id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value="主键id")
private java.lang.Long id ;

View File

@ -370,12 +370,12 @@ public class WorkerInfoController {
return Result.success(workerInfoService.selectProjectComapnyWorkTotalList(map));
}
@ApiOperation(value = "查询项目下所有部门出勤人数列表", notes = "查询项目下所有部门出勤人数列表")
@ApiOperation(value = "分页查询项目下所有部门出勤人数列表", notes = "分页查询项目下所有部门出勤人数列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "query", required = true, dataType = "String"),
})
@PostMapping("/selectProjectTeamWorkTotalList")
public Result<List<EntityMap>> selectProjectTeamWorkTotalList(@RequestBody Map<String, Object> map) {
public Result<List<ProjectTeamWorkTotalVo>> selectProjectTeamWorkTotalList(@RequestBody Map<String, Object> map) {
return Result.success(workerInfoService.selectProjectTeamWorkTotalList(map));
}
@ -480,10 +480,11 @@ public class WorkerInfoController {
@ApiImplicitParam(name = "projectSns", value = "项目SNS", paramType = "query", required = false, dataType = "String"),
@ApiImplicitParam(name = "startDate", value = "开始时间,yyyy-MM-dd", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "endDate", value = "结束时间,yyyy-MM-dd", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "inServiceType", value = "inServiceType", paramType = "query", dataType = "String"),
})
@GetMapping(value = "/getDeclareAge")
public Result<DeclareAgeVO> getDeclareAge(String projectSn, String startDate, String endDate, String projectSns) {
return Result.success(workerInfoService.getDeclareAge(projectSn, startDate, endDate, projectSns));
public Result<DeclareAgeVO> getDeclareAge(@RequestParam(required = false) HashMap<String, Object> map) {
return Result.success(workerInfoService.getDeclareAge(map));
}

View File

@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -31,6 +33,7 @@ public class TeamInfo implements Serializable {
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
@JsonSerialize(using = ToStringSerializer.class)
private java.lang.Long id;
/**
* 班组名称
@ -61,7 +64,7 @@ public class TeamInfo implements Serializable {
*/
@Excel(name = "工种id", width = 15)
@ApiModelProperty(value = "工种id")
@JsonSerialize(using = ToStringSerializer.class)
private java.lang.Long workerTypeId;
/**
* 班组类型
@ -92,7 +95,7 @@ public class TeamInfo implements Serializable {
*/
@Excel(name = "所属企业id", width = 15)
@ApiModelProperty(value = "所属企业id")
@JsonSerialize(using = ToStringSerializer.class)
private java.lang.Long enterpriseId;
@ApiModelProperty(value = "是否特殊工种0否1是")

View File

@ -0,0 +1,10 @@
package com.zhgd.xmgl.modules.worker.entity.vo;
import lombok.Data;
@Data
public class ProjectTeamWorkTotalVo {
private String teamName;
private String attendancePersonNum;
private String totalPersonNum;
}

View File

@ -80,7 +80,7 @@ public interface WorkerInfoMapper extends BaseMapper<WorkerInfo> {
List<Map<String, Object>> selectEnterprisePresenceWorkerCount(Map<String, Object> map);
List<EntityMap> selectProjectTeamWorkTotalList(Map<String, Object> map);
Page<ProjectTeamWorkTotalVo> selectProjectTeamWorkTotalList(Page<ProjectTeamWorkTotalVo> page, @Param("p") Map<String, Object> map);
List<AllProjectTeamVo> selectAllProjectTeamList(Map<String, Object> map);
@ -215,7 +215,7 @@ public interface WorkerInfoMapper extends BaseMapper<WorkerInfo> {
List<WorkerInfo> getPersonnelList(@Param("projectSn") String projectSn);
List<String> getDeclareAge(@Param("projectSn") String projectSn, @Param("startDate") String startDate, @Param("endDate") String endDate);
List<String> getDeclareAge(@Param("p") HashMap<String, Object> map);
PersonnelSituationVO getPersonnelSituation(String projectSn);

View File

@ -831,8 +831,8 @@
<!--and p.create_time>=CONCAT(DATE_FORMAT(now(),"%Y-%m-%d"),' 00:00:00')-->
group by w1.enterprise_id
</select>
<select id="selectProjectTeamWorkTotalList" resultType="com.zhgd.jeecg.common.mybatis.EntityMap"
parameterType="map">
<select id="selectProjectTeamWorkTotalList"
resultType="com.zhgd.xmgl.modules.worker.entity.vo.ProjectTeamWorkTotalVo">
SELECT e.team_name,
IFNULL(tp2.total_person_num, 0) total_person_num,
IFNULL(tp.person_num, 0) attendance_person_num
@ -843,8 +843,8 @@
WHERE p.create_time >= CONCAT(DATE_FORMAT(now(), "%Y-%m-%d"), ' 00:00:00')
and w1.inService_type = 1
AND w1.person_type = 1
<if test="projectSn != null and projectSn != ''">
and w1.project_sn = #{projectSn}
<if test="p.projectSn != null and p.projectSn != ''">
and w1.project_sn = #{p.projectSn}
</if>
group by w1.team_id
) tp ON e.id = tp.team_id
@ -852,16 +852,16 @@
FROM worker_info w1
where w1.inService_type = 1
AND w1.person_type = 1
<if test="projectSn != null and projectSn != ''">
and w1.project_sn = #{projectSn}
<if test="p.projectSn != null and p.projectSn != ''">
and w1.project_sn = #{p.projectSn}
</if>
group by w1.team_id
) tp2 ON e.id = tp2.team_id
WHERE 1=1
<if test="projectSn != null and projectSn != ''">
and e.project_sn = #{projectSn}
<if test="p.projectSn != null and p.projectSn != ''">
and e.project_sn = #{p.projectSn}
</if>
order by attendance_person_num desc LIMIT 10
order by attendance_person_num desc
</select>
<select id="selectAllProjectTeamList" resultType="com.zhgd.xmgl.modules.worker.entity.vo.AllProjectTeamVo"
parameterType="map">
@ -2239,15 +2239,19 @@
<select id="getDeclareAge" resultType="java.lang.String">
select birthday
from worker_info
where project_sn = #{projectSn}
<if test="startDate != null and startDate != ''">
and birthday >= #{startDate}
from worker_info wi
join project p on p.project_sn = wi.project_sn
where wi.project_sn = #{p.projectSn}
<if test="p.startDate != null and p.startDate != ''">
and wi.birthday >= #{p.startDate}
</if>
<if test="endDate != null and endDate != ''">
and birthday <![CDATA[<=]]> #{endDate}
<if test="p.endDate != null and p.endDate != ''">
and wi.birthday <![CDATA[<=]]> #{p.endDate}
</if>
and birthday is not null and birthday != ''
<if test="p.inServiceType != null and p.inServiceType != ''">
and wi.inService_type = 1
</if>
and wi.birthday is not null and wi.birthday != ''
</select>
<!-- <select id="getPersonnelSituation" resultType="com.zhgd.xmgl.modules.worker.entity.vo.PersonnelSituationVO">-->
<!-- select-->
@ -2382,12 +2386,18 @@
</select>
<select id="getSpecialWorkerStatics" resultType="com.zhgd.xmgl.modules.worker.entity.vo.SpecialWorkerStaticsVo">
SELECT COUNT(w.id) totalNum,
ifnull((SELECT COUNT(id) FROM worker_attendance_presence WHERE person_sn = w.person_sn),0) inService
FROM worker_info w
RIGHT JOIN team_info t ON w.team_id = t.id
RIGHT JOIN worker_type wt ON t.worker_type_id = wt.id
WHERE wt.type_name = '特殊工种' and wt.project_sn = #{projectSn}
and w.project_sn = #{projectSn}
SELECT COUNT( w.id ) totalNum,COUNT(t.person_sn) inService
FROM
worker_info w
JOIN team_info t ON w.team_id = t.id
JOIN worker_type wt ON t.worker_type_id = wt.id
LEFT JOIN (SELECT COUNT( w1.id ) inService,w1.person_sn FROM worker_attendance_presence w1 join worker_info w
WHERE w1.person_sn = w.person_sn
)t ON t.person_sn=w.person_sn
WHERE
wt.type_name = '特殊工种'
and w.inService_type=1
AND wt.project_sn = #{projectSn}
AND w.project_sn = #{projectSn}
</select>
</mapper>

View File

@ -8,11 +8,12 @@
day1, day2, day3,
day4, day5, day6, day7, day8, day9, day10, day11, day12, day13, day14, day15, day16,
day17, day18, day19, day20, day21, day22, day23, day24, day25, day26, day27, day28,
day29, day30, day31
IF(29>DAY(last_day(str_to_date(CONCAT(#{param.monthTime},'-01'),'%Y-%m-%d'))),NULL,day29) day29,
IF(30>DAY(last_day(str_to_date(CONCAT(#{param.monthTime},'-01'),'%Y-%m-%d'))),NULL,day30) day30,
IF(31>DAY(last_day(str_to_date(CONCAT(#{param.monthTime},'-01'),'%Y-%m-%d'))),NULL,day31) day31
from worker_info a
INNER JOIN worker_month_attendance_statistics c ON a.person_sn=c.person_sn
LEFT JOIN worker_month_attendance_statistics c ON a.person_sn=c.person_sn AND c.query_time=#{param.monthTime}
where a.project_sn=#{param.projectSn} and a.inService_type=#{param.inserviceType}
AND c.query_time=#{param.monthTime}
<if test="param.personType!=null and param.personType!=''">
and a.person_type=#{param.personType}
</if>
@ -193,4 +194,4 @@
and person_sn = #{personSn}
and query_time = date_format(#{inputTime}, '%Y-%m')
</select>
</mapper>
</mapper>

View File

@ -49,22 +49,22 @@
</select>
<select id="selectSafeEducationWorkerPage" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
SELECT w.*,
a.worker_name,
b.team_name,
c.department_name,
d.enterprise_name,
a.sex,
(case
when a.birthday != '' then year(from_days(datediff(NOW(), a.birthday)))
else '-' end) age,
IFNULL(w1.edu_type, 0) edu_type,
IFNULL(w1.edu_course_name, '培训学校培训') edu_course_name
FROM worker_info a
INNER JOIN worker_safe_education_worker w ON a.id_card = w.id_card
LEFT JOIN team_info b ON a.team_id = b.id
LEFT JOIN department_info c ON a.department_id = c.id
LEFT JOIN enterprise_info d ON a.enterprise_id = d.id
LEFT JOIN worker_safe_education w1 ON w.edu_id = w1.id
a.worker_name,
b.team_name,
c.department_name,
d.enterprise_name,
a.sex,
(case
when a.birthday != '' then year(from_days(datediff(NOW(), a.birthday)))
else '-' end) age,
IFNULL(w1.edu_type, 0) edu_type,
IFNULL(w1.edu_course_name, '培训学校培训') edu_course_name
FROM worker_safe_education_worker w
JOIN worker_info a ON w.worker_id = a.id
JOIN worker_safe_education w1 ON w.edu_id = w1.id
LEFT JOIN team_info b ON a.team_id = b.id
LEFT JOIN department_info c ON a.department_id = c.id
LEFT JOIN enterprise_info d ON a.enterprise_id = d.id
WHERE a.project_sn = #{param.projectSn}
<if test="param.workerName != null and param.workerName != ''">
and a.worker_name like CONCAT(CONCAT('%', #{param.workerName}), '%')
@ -87,4 +87,4 @@
FROM worker_safe_education_worker
WHERE project_sn = #{projectSn}
</select>
</mapper>
</mapper>

View File

@ -131,9 +131,12 @@
<if test="personType != null and personType != ''">
and a.person_type = #{personType}
</if>
<if test="payStatus != null and payStatus != '' or payStatus == 0">
<if test="payStatus != null and payStatus == '0'.toString()">
and IFNULL(wp.pay_status, 0) = #{payStatus}
</if>
<if test="payStatus != null and payStatus == '1'.toString()">
and wp.pay_status = #{payStatus}
</if>
</select>
<select id="getProjectPaymentStatistics" resultType="com.zhgd.xmgl.modules.worker.entity.vo.PaymentStatisticsVo">

View File

@ -67,7 +67,7 @@ public interface IWorkerInfoService extends IService<WorkerInfo> {
List<ProjectCompanyWorkTotal> selectProjectComapnyWorkTotalList(Map<String, Object> map);
List<EntityMap> selectProjectTeamWorkTotalList(Map<String, Object> map);
List<ProjectTeamWorkTotalVo> selectProjectTeamWorkTotalList(Map<String, Object> map);
Map<String, Object> viewWorkerInfoDetail(Map<String, Object> map);
@ -110,7 +110,7 @@ public interface IWorkerInfoService extends IService<WorkerInfo> {
PersonnelSituationVO getPersonnelSituation(String projectSn);
DeclareAgeVO getDeclareAge(String projectSn, String startDate, String endDate, String projectSns);
DeclareAgeVO getDeclareAge(HashMap<String, Object> map);
Result<IPage<WorkerInfoDetailsVo>> getWorkerInfoDetails(Integer pageNo, Integer pageSize, String projectSn);

View File

@ -453,20 +453,20 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
if (list != null && list.size() > 0) {
//查询各班组总人数
List<Map<String, Object>> toaltPerson = workerInfoMapper.selectWorkerTeamTotal(map);
Map<Integer, Integer> personMap = getListToMap(toaltPerson, "teamId", "totalPerson");
Map<Long, Long> personMap = getListToMap(toaltPerson, "teamId", "totalPerson");
//查询各班组在场总人数
List<Map<String, Object>> presencePerson = workerInfoMapper.selectPresenceWorkerTeamTotal(map);
Map<Integer, Integer> presenceMap = getListToMap(presencePerson, "teamId", "totalPerson");
Map<Long, Long> presenceMap = getListToMap(presencePerson, "teamId", "totalPerson");
//查询各班组出勤人数
List<Map<String, Object>> attendancePerson = workerInfoMapper.selectAttendanceWorkerTeamTotal(map);
Map<Integer, Integer> attendanceMap = getListToMap(attendancePerson, "teamId", "totalPerson");
Map<Long, Long> attendanceMap = getListToMap(attendancePerson, "teamId", "totalPerson");
//汇总各班组的总人数在场人数出勤人数
for (TeamInfo teamInfo : list) {
Map<String, Object> data = new HashMap<>();
data.put("teamId", teamInfo.getId());
data.put("teamName", teamInfo.getTeamName());
data.put("name", teamInfo.getTeamName());
Integer totalPerson = 0;
Long totalPerson = 0L;
//获取班组总人数
/*if(toaltPerson!=null&&toaltPerson.size()>0){
for (Map<String,Object> person:toaltPerson){
@ -480,7 +480,7 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
totalPerson = personMap.get(teamInfo.getId());
}
data.put("totalPerson", totalPerson);
Integer presencePersonTotal = 0;
Long presencePersonTotal = 0L;
//获取班组在场人数
/*if(presencePerson!=null&&presencePerson.size()>0){
for (Map<String,Object> person:presencePerson){
@ -493,7 +493,7 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
if (presenceMap != null && presenceMap.size() > 0 && presenceMap.containsKey(teamInfo.getId())) {
presencePersonTotal = presenceMap.get(teamInfo.getId());
}
Integer attendancePersonTotal = 0;
Long attendancePersonTotal = 0L;
//获取班组出勤人数
/*if(attendancePerson!=null&&attendancePerson.size()>0){
for (Map<String,Object> person:attendancePerson){
@ -515,11 +515,11 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
return voList;
}
private Map<Integer, Integer> getListToMap(List<Map<String, Object>> list, String key, String value) {
Map<Integer, Integer> map = new HashMap<>();
private Map<Long, Long> getListToMap(List<Map<String, Object>> list, String key, String value) {
Map<Long, Long> map = new HashMap<>();
if (list != null && list.size() > 0) {
for (Map<String, Object> data : list) {
map.put(MapUtils.getInteger(data, "key"), MapUtils.getInteger(data, "value"));
map.put(MapUtils.getLong(data, key), MapUtils.getLong(data, value));
}
}
return map;
@ -535,20 +535,20 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
if (list != null && list.size() > 0) {
//查询各部门考勤人数
List<Map<String, Object>> toaltPerson = workerInfoMapper.selectWorkerDepartmentTotal(map);
Map<Integer, Integer> personMap = getListToMap(toaltPerson, "departmentId", "totalPerson");
Map<Long, Long> personMap = getListToMap(toaltPerson, "departmentId", "totalPerson");
//查询各部门在场人数
List<Map<String, Object>> presencePerson = workerInfoMapper.selectPresenceWorkerDepartmentTotal(map);
Map<Integer, Integer> presenceMap = getListToMap(presencePerson, "departmentId", "totalPerson");
Map<Long, Long> presenceMap = getListToMap(presencePerson, "departmentId", "totalPerson");
//查询各部门出勤人数
List<Map<String, Object>> attendancePerson = workerInfoMapper.selectAttendanceWorkerDepartmentTotal(map);
Map<Integer, Integer> attendanceMap = getListToMap(attendancePerson, "departmentId", "totalPerson");
Map<Long, Long> attendanceMap = getListToMap(attendancePerson, "departmentId", "totalPerson");
//汇总各部门的总人数在场人数出勤人数
for (DepartmentInfo departmentInfo : list) {
Map<String, Object> data = new HashMap<>();
data.put("departmentId", departmentInfo.getId());
data.put("departmentName", departmentInfo.getDepartmentName());
data.put("name", departmentInfo.getDepartmentName());
Integer totalPerson = 0;
Long totalPerson = 0L;
//获取部门的总人数
/*if(toaltPerson!=null&&toaltPerson.size()>0){
for (Map<String,Object> person:toaltPerson){
@ -563,7 +563,7 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
}
data.put("totalPerson", totalPerson);
//获取部门的在场人数
Integer presencePersonTotal = 0;
Long presencePersonTotal = 0L;
/*if(presencePerson!=null&&presencePerson.size()>0){
for (Map<String,Object> person:presencePerson){
if(MapUtils.getInteger(person,"departmentId")!=null&&departmentInfo.getId().intValue()==MapUtils.getInteger(person,"departmentId")){
@ -576,7 +576,7 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
presencePersonTotal = presenceMap.get(departmentInfo.getId());
}
//获取部门的考勤人数
Integer attendancePersonTotal = 0;
Long attendancePersonTotal = 0L;
/*if(attendancePerson!=null&&attendancePerson.size()>0){
for (Map<String,Object> person:attendancePerson){
if(MapUtils.getInteger(person,"departmentId")!=null&&departmentInfo.getId().intValue()==MapUtils.getInteger(person,"departmentId")){
@ -998,8 +998,12 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
}
@Override
public List<EntityMap> selectProjectTeamWorkTotalList(Map<String, Object> map) {
return workerInfoMapper.selectProjectTeamWorkTotalList(map);
public List<ProjectTeamWorkTotalVo> selectProjectTeamWorkTotalList(Map<String, Object> map) {
int pageNo = Integer.parseInt(map.getOrDefault("pageNo", 1).toString());
int pageSize = Integer.parseInt(map.getOrDefault("pageSize", 10000).toString());
Page<ProjectTeamWorkTotalVo> page = new Page<>(pageNo, pageSize);
Page<ProjectTeamWorkTotalVo> rp = workerInfoMapper.selectProjectTeamWorkTotalList(page, map);
return rp.getRecords();
}
@Override
@ -1681,42 +1685,41 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
}
@Override
public DeclareAgeVO getDeclareAge(String projectSn, String startDate, String endDate, String projectSns) {
DeclareAgeVO declareAgeVO = new DeclareAgeVO();
if (StringUtils.isBlank(projectSn)) {
List<String> snList = new ArrayList<>();
if (StringUtils.isNotBlank(projectSns)) {
String[] snArr = StringUtils.split(projectSns, ",");
Collections.addAll(snList, snArr);
} else {
//查询全部
List<Project> allProjects = projectMapper.selectList(null);
snList = allProjects.stream().map(Project::getProjectSn).collect(Collectors.toList());
}
for (String projectSn1 : snList) {
DeclareAgeVO v1 = getDeclareAgeVO(projectSn1, startDate, endDate);
declareAgeVO.setEighteenToTwentyFour(declareAgeVO.getEighteenToTwentyFour() + v1.getEighteenToTwentyFour());
declareAgeVO.setTwentyFiveToThirtyFour(declareAgeVO.getTwentyFiveToThirtyFour() + v1.getTwentyFiveToThirtyFour());
declareAgeVO.setThirtyFiveToFortyNine(declareAgeVO.getThirtyFiveToFortyNine() + v1.getThirtyFiveToFortyNine());
declareAgeVO.setFiftyToFiftyFive(declareAgeVO.getFiftyToFiftyFive() + v1.getFiftyToFiftyFive());
declareAgeVO.setNotRegistered(declareAgeVO.getNotRegistered() + v1.getNotRegistered());
}
return declareAgeVO;
} else {
return getDeclareAgeVO(projectSn, startDate, endDate);
public DeclareAgeVO getDeclareAge(HashMap<String, Object> map) {
String projectSn = MapUtils.getString(map, "projectSn");
String startDate = MapUtils.getString(map, "startDate");
String endDate = MapUtils.getString(map, "endDate");
String projectSns = MapUtils.getString(map, "projectSns");
if (StringUtils.isNotBlank(projectSn)) {
return getDeclareAgeVO(map);
}
if (StringUtils.isBlank(projectSns)) {
throw new OpenAlertException("项目projectSns不能为空");
}
List<String> snList = new ArrayList<>();
String[] snArr = StringUtils.split(projectSns, ",");
Collections.addAll(snList, snArr);
DeclareAgeVO vo = new DeclareAgeVO();
for (String sn : snList) {
map.put("projectSn", sn);
DeclareAgeVO v1 = getDeclareAgeVO(map);
vo.setEighteenToTwentyFour(vo.getEighteenToTwentyFour() + v1.getEighteenToTwentyFour());
vo.setTwentyFiveToThirtyFour(vo.getTwentyFiveToThirtyFour() + v1.getTwentyFiveToThirtyFour());
vo.setThirtyFiveToFortyNine(vo.getThirtyFiveToFortyNine() + v1.getThirtyFiveToFortyNine());
vo.setFiftyToFiftyFive(vo.getFiftyToFiftyFive() + v1.getFiftyToFiftyFive());
vo.setNotRegistered(vo.getNotRegistered() + v1.getNotRegistered());
}
return vo;
}
@NotNull
private DeclareAgeVO getDeclareAgeVO(String projectSn, String startDate, String endDate) {
List<String> ageList = workerInfoMapper.getDeclareAge(projectSn, startDate, endDate);
private DeclareAgeVO getDeclareAgeVO(HashMap<String, Object> map) {
List<String> ageList = workerInfoMapper.getDeclareAge(map);
Set<Map.Entry<Integer, List<String>>> ageSet = ageList.stream().collect(Collectors.groupingBy(DateUtil::ageOfNow)).entrySet();
DeclareAgeVO result = new DeclareAgeVO();
for (Map.Entry<Integer, List<String>> ageItem : ageSet) {
Integer age = ageItem.getKey();
int size = ageItem.getValue().size();
if (age == null) {
result.setNotRegistered(result.getNotRegistered() + size);
} else if (age >= 18 && age <= 24) {

View File

@ -1,6 +1,7 @@
package com.zhgd.xmgl.modules.worker.service.impl;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -70,16 +71,22 @@ public class WorkerWagesPaymentServiceImpl extends ServiceImpl<WorkerWagesPaymen
QueryWrapper<WorkerWagesPayment> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(WorkerWagesPayment::getPersonSn, workerWagesPayment.getPersonSn())
.eq(WorkerWagesPayment::getPayMonth, workerWagesPayment.getPayMonth());
List<WorkerWagesPayment> list = workerWagesPaymentMapper.selectList(queryWrapper);
if (workerWagesPayment.getPayNet() != null) {
workerWagesPayment.setPayStatus(1);
}
List<WorkerWagesPayment> list = workerWagesPaymentMapper.selectList(queryWrapper);
if (list != null && list.size() > 0) {
for (WorkerWagesPayment data : list) {
workerWagesPayment.setId(data.getId());
if (!Objects.equals(workerWagesPayment.getPayNet(), data.getPayNet())) {
workerWagesPayment.setBalanceDate(DateUtil.now());
}
workerWagesPaymentMapper.updateById(workerWagesPayment);
}
} else {
if (workerWagesPayment.getPayNet() != null) {
workerWagesPayment.setBalanceDate(DateUtil.now());
}
workerWagesPaymentMapper.insert(workerWagesPayment);
}
}

View File

@ -0,0 +1,80 @@
http.port=12355
spring.datasource.url=jdbc:mysql://localhost:3306/wisdomsite_zhangjiang?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&useSSL=false
spring.datasource.username=ENC(XR4C/hvTYCUqudS49Wh/jA==)
spring.datasource.password=ENC(LsKaVL2ycDu+uUNoPndYLA==)
server.port=35212
basePath=C:/jxj/prod/backEnd/itbgpImage/
arcsoft.dllPath=C:/jxj/prod/backEnd/dll
security.enable=false
isGetStandardData=false
isGetEnvironmentData=false
isGetFaceFeatureDate=false
#\u6D77\u5EB7\u89C6\u9891\u62A5\u8B66\u56FE\u7247IP\u7AEF\u53E3\u66FF\u6362
video.alarm.newUrl=223.82.100.80:6040
wx-appid=
wx-AppSecret=
mqtt.username=admin
mqtt.password=public
#mqtt.url=tcp://139.159.226.224:1883
mqtt.url=ws://121.196.214.246:8083/mqtt
mqtt.producer.clientId=mqttProd
mqtt.producer.defaultTopic=topic1
mqtt.consumer.clientId=mqttConsumer
mqtt.consumer.defaultTopic=topic1
mqtt-scope=prodTopic
serverUrl=http://192.168.34.221:12350
#\u89C6\u9891\u5206\u6790url
video-analysis-url=
#\u9ED8\u8BA4\u653F\u52A1\u521B\u5EFA\u9879\u76EE\u6240\u5C5E\u4F01\u4E1A
defaultZwComapnySn=
#\u6587\u4EF6\u5B58\u50A8\u914D\u7F6E
#\u9ED8\u8BA4\u4F7F\u7528\u7684\u5B58\u50A8\u5E73\u53F0
spring.file-storage.default-platform=local
#".min.jpg" #\u7F29\u7565\u56FE\u540E\u7F00\uFF0C\u4F8B\u5982\u3010.min.jpg\u3011\u3010.png\u3011
spring.file-storage.thumbnail-suffix=.jpg
# \u672C\u5730\u5B58\u50A8\uFF0C\u4E0D\u4F7F\u7528\u7684\u60C5\u51B5\u4E0B\u53EF\u4EE5\u4E0D\u5199
# \u5B58\u50A8\u5E73\u53F0\u6807\u8BC6
spring.file-storage.local[0].platform=local
#\u542F\u7528\u5B58\u50A8
spring.file-storage.local[0].enable-storage=true
#\u542F\u7528\u8BBF\u95EE\uFF08\u7EBF\u4E0A\u8BF7\u4F7F\u7528 Nginx \u914D\u7F6E\uFF0C\u6548\u7387\u66F4\u9AD8\uFF09
spring.file-storage.local[0].enable-access=false
# \u8BBF\u95EE\u57DF\u540D\uFF0C\u4F8B\u5982\uFF1A\u201Chttp://127.0.0.1:6023/image/\u201D\uFF0C\u6CE8\u610F\u540E\u9762\u8981\u548C path-patterns \u4FDD\u6301\u4E00\u81F4\uFF0C\u201C/\u201D\u7ED3\u5C3E\uFF0C\u672C\u5730\u5B58\u50A8\u5EFA\u8BAE\u4F7F\u7528\u76F8\u5BF9\u8DEF\u5F84\uFF0C\u65B9\u4FBF\u540E\u671F\u66F4\u6362\u57DF\u540D
spring.file-storage.local[0].domain=
# \u5B58\u50A8\u5730\u5740
spring.file-storage.local[0].base-path=C:/jxj/prod/backEnd/itbgpImage/
# \u8BBF\u95EE\u8DEF\u5F84\uFF0C\u5F00\u542F enable-access \u540E\uFF0C\u901A\u8FC7\u6B64\u8DEF\u5F84\u53EF\u4EE5\u8BBF\u95EE\u5230\u4E0A\u4F20\u7684\u6587\u4EF6
spring.file-storage.local[0].path-patterns=
spring.file-storage.aliyun-oss[0].platform=aliyun-oss
spring.file-storage.aliyun-oss[0].enable-storage=false
spring.file-storage.aliyun-oss[0].access-key=
spring.file-storage.aliyun-oss[0].secret-key=
spring.file-storage.aliyun-oss[0].end-point=
spring.file-storage.aliyun-oss[0].bucket-name=
# \u8BBF\u95EE\u57DF\u540D\uFF0C\u6CE8\u610F\u201C/\u201D\u7ED3\u5C3E\uFF0C\u4F8B\u5982\uFF1Ahttps://abc.oss-cn-shanghai.aliyuncs.com/
spring.file-storage.aliyun-oss[0].domain=
spring.file-storage.aliyun-oss[0].base-path=
#\u5BA2\u6237\u7AEF License\u76F8\u5173\u914D\u7F6E
#license.licensePath=D:/license_demo/client/license.lic
#license.publicKeysStorePath=D:/license_demo/client/publicCerts.keystore
#redis
spring.redis.database=1
spring.redis.host=127.0.0.1
spring.redis.port=6379
spring.redis.password=
spring.redis.timeout=2000s
spring.redis.lettuce.pool.max-active=8
spring.redis.lettuce.pool.max-wait=60s
spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.min-idle=10
server.tomcat.basedir=C:/tempImage/
license.licensePath=C:/license/license.lic
license.publicKeysStorePath=C:/license/publicCerts.keystore
govt.host=
server.ssl.enabled=false
# admin\u4E2D\u5BF9\u5E94\u7684\u5730\u5740\u53CA\u5B9E\u4F8B\u540D
spring.boot.admin.client.instance.service-url=http://localhost:18070
spring.boot.admin.client.instance.name=zjsj
# \u6C34\u7535\u6570\u636E\u63A8\u9001\u5730\u5740
double-carbon.water-data-url=http://test.cesms.net
double-carbon.ammeter-data-url=http://test.cesms.net