安全履职分析
This commit is contained in:
parent
125294835f
commit
290d43f749
@ -7,6 +7,7 @@ import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
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.vo.SafetyPerformanceAnalysisVo;
|
||||
import com.zhgd.xmgl.modules.worker.service.IWorkerAttendanceService;
|
||||
import com.zhgd.xmgl.util.ExcelUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
@ -266,4 +267,13 @@ public class WorkerAttendanceController {
|
||||
return Result.success(workerAttendanceService.queryAttendanceOfEachCompany(map));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "安全履职分析", notes = "安全履职分析", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/safetyPerformanceAnalysis")
|
||||
public Result<SafetyPerformanceAnalysisVo> safetyPerformanceAnalysis(@ApiIgnore @RequestBody Map<String ,Object> paramMap) {
|
||||
return Result.success(workerAttendanceService.safetyPerformanceAnalysis(paramMap));
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.async.AsyncAttendance;
|
||||
import com.zhgd.xmgl.modules.worker.entity.vo.SafetyPerformanceAnalysisVo;
|
||||
import com.zhgd.xmgl.modules.worker.service.IWorkerMonthAttendanceStatisticsService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@ -15,6 +16,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ -92,4 +94,6 @@ public class WorkerMonthAttendanceStatisticsController {
|
||||
public Result<Map<String, Integer>> selectWorkerMonthAttendanceType(@RequestBody Map<String,Object> map) {
|
||||
return Result.success(workerMonthAttendanceStatisticsService.selectWorkerMonthAttendanceType(map));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,32 @@
|
||||
package com.zhgd.xmgl.modules.worker.entity.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class SafetyPerformanceAnalysisVo {
|
||||
@ApiModelProperty("未履职人员总数")
|
||||
private Integer notPerformNum;
|
||||
@ApiModelProperty("在职总数")
|
||||
private Integer inServiceNum;
|
||||
@ApiModelProperty("项目经理未履职人员总数")
|
||||
private Integer xmjlNotPerformNum;
|
||||
@ApiModelProperty("项目经理在职总数")
|
||||
private Integer xmjlInServiceNum;
|
||||
@ApiModelProperty("安全员未履职人员总数")
|
||||
private Integer aqyNotPerformNum;
|
||||
@ApiModelProperty("安全员在职总数")
|
||||
private Integer aqyInServiceNum;
|
||||
@ApiModelProperty("质量员未履职人员总数")
|
||||
private Integer zlyNotPerformNum;
|
||||
@ApiModelProperty("质量员在职总数")
|
||||
private Integer zlyInServiceNum;
|
||||
@ApiModelProperty("监理未履职人员总数")
|
||||
private Integer jlNotPerformNum;
|
||||
@ApiModelProperty("监理在职总数")
|
||||
private Integer jlInServiceNum;
|
||||
|
||||
private List<SafetyPerformanceAnalysisVo> list;
|
||||
}
|
||||
@ -1,20 +1,21 @@
|
||||
package com.zhgd.xmgl.modules.worker.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.base.entity.vo.TrendOneVo;
|
||||
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.vo.SafetyPerformanceAnalysisVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.zhgd.xmgl.modules.worker.entity.WorkerAttendance;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 人员考勤
|
||||
* @author: pds
|
||||
@ -88,4 +89,7 @@ public interface WorkerAttendanceMapper extends BaseMapper<WorkerAttendance> {
|
||||
List<WorkerAttendance> queryPresenceList(Map<String, Object> map);
|
||||
|
||||
List<TrendOneVo> queryTodayAttendanceTrend(Map<String, Object> map);
|
||||
|
||||
List<SafetyPerformanceAnalysisVo> safetyPerformanceAnalysis(@Param("param") Map<String, Object> paramMap);
|
||||
|
||||
}
|
||||
|
||||
@ -823,4 +823,26 @@
|
||||
WHERE project_sn = #{projectSn}
|
||||
group by DATE_FORMAT(a.create_time, '%Y-%m-%d %H:00')
|
||||
</select>
|
||||
|
||||
<select id="safetyPerformanceAnalysis"
|
||||
resultType="com.zhgd.xmgl.modules.worker.entity.vo.SafetyPerformanceAnalysisVo">
|
||||
select
|
||||
count(*) as inServiceNum,
|
||||
ifnull(sum(if(t1.person_sn is null,1,0)),0) as notPerformNum,
|
||||
ifnull(sum(if(wi.job_type=50,1,0)),0) as xmjlInServiceNum,
|
||||
ifnull(sum(if(wi.job_type=50 and t1.person_sn is null,1,0)),0) as xmjlNotPerformNum,
|
||||
ifnull(sum(if(wi.job_type=44,1,0)),0) as aqyInServiceNum,
|
||||
ifnull(sum(if(wi.job_type=44 and t1.person_sn is null,1,0)),0) as aqyNotPerformNum,
|
||||
ifnull(sum(if(wi.job_type=46,1,0)),0) as zlyInServiceNum,
|
||||
ifnull(sum(if(wi.job_type=46 and t1.person_sn is null,1,0)),0) as zlyNotPerformNum,
|
||||
ifnull(sum(if(wi.job_type=37,1,0)),0) as jlInServiceNum,
|
||||
ifnull(sum(if(wi.job_type=37 and t1.person_sn is null,1,0)),0) as jlNotPerformNum
|
||||
from enterprise_info t
|
||||
join worker_info wi on wi.enterprise_id=t.id
|
||||
left join (select person_sn from worker_attendance where project_sn=#{param.projectSn}
|
||||
and create_time >= CURRENT_DATE
|
||||
group by person_sn) t1 on t1.person_sn=wi.person_sn
|
||||
where wi.project_sn=#{param.projectSn} AND wi.inService_type = 1
|
||||
group by t.id
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -2,14 +2,14 @@ package com.zhgd.xmgl.modules.worker.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.entity.vo.AttendanceOfEachCompanyVo;
|
||||
import com.zhgd.xmgl.entity.vo.NumberTimeTableVo;
|
||||
import com.zhgd.xmgl.modules.worker.entity.WorkerAttendance;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zhgd.xmgl.modules.worker.entity.dto.GetPassRecordDto;
|
||||
import com.zhgd.xmgl.modules.worker.entity.vo.GetWorkerInfoByDevVo;
|
||||
import com.zhgd.xmgl.modules.worker.entity.vo.SafetyPerformanceAnalysisVo;
|
||||
import com.zhgd.xmgl.modules.worker.entity.vo.UploadAttendanceByDevDto;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@ -79,4 +79,6 @@ public interface IWorkerAttendanceService extends IService<WorkerAttendance> {
|
||||
AttendanceOfEachCompanyVo queryAttendanceOfEachCompany(Map<String, Object> map);
|
||||
|
||||
String uploadAttendanceByDev(UploadAttendanceByDevDto dto);
|
||||
|
||||
SafetyPerformanceAnalysisVo safetyPerformanceAnalysis(Map<String, Object> paramMap);
|
||||
}
|
||||
|
||||
@ -36,4 +36,4 @@ public interface IWorkerMonthAttendanceStatisticsService extends IService<Worker
|
||||
List<EntityMap> selectProjectMonthAttendanceList(HashMap<String, Object> param);
|
||||
|
||||
List<EntityMap> getListByProjectSn(String projectSn);
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,6 +32,7 @@ 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.vo.GetWorkerInfoByDevVo;
|
||||
import com.zhgd.xmgl.modules.worker.entity.vo.ProjectCompanyWorkTotal;
|
||||
import com.zhgd.xmgl.modules.worker.entity.vo.SafetyPerformanceAnalysisVo;
|
||||
import com.zhgd.xmgl.modules.worker.entity.vo.UploadAttendanceByDevDto;
|
||||
import com.zhgd.xmgl.modules.worker.mapper.*;
|
||||
import com.zhgd.xmgl.modules.worker.service.IWorkerAttendanceService;
|
||||
@ -1122,6 +1123,56 @@ status 状态码 String 1表示成功;其余表示失败
|
||||
return JSON.toJSONString(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SafetyPerformanceAnalysisVo safetyPerformanceAnalysis(Map<String, Object> paramMap) {
|
||||
List<SafetyPerformanceAnalysisVo> vos = baseMapper.safetyPerformanceAnalysis(paramMap);
|
||||
SafetyPerformanceAnalysisVo vo = new SafetyPerformanceAnalysisVo();
|
||||
vo.setList(vos);
|
||||
Integer notPerformNum = 0;
|
||||
Integer inServiceNum = 0;
|
||||
Integer xmjlNotPerformNum = 0;
|
||||
Integer xmjlInServiceNum = 0;
|
||||
Integer aqyNotPerformNum = 0;
|
||||
Integer aqyInServiceNum = 0;
|
||||
Integer zlyNotPerformNum = 0;
|
||||
Integer zlyInServiceNum = 0;
|
||||
Integer jlNotPerformNum = 0;
|
||||
Integer jlInServiceNum = 0;
|
||||
for (SafetyPerformanceAnalysisVo one : vos) {
|
||||
Integer notPerformNum1 = one.getNotPerformNum();
|
||||
Integer inServiceNum1 = one.getInServiceNum();
|
||||
Integer xmjlNotPerformNum1 = one.getXmjlNotPerformNum();
|
||||
Integer xmjlInServiceNum1 = one.getXmjlInServiceNum();
|
||||
Integer aqyNotPerformNum1 = one.getAqyNotPerformNum();
|
||||
Integer aqyInServiceNum1 = one.getAqyInServiceNum();
|
||||
Integer zlyNotPerformNum1 = one.getZlyNotPerformNum();
|
||||
Integer zlyInServiceNum1 = one.getZlyInServiceNum();
|
||||
Integer jlNotPerformNum1 = one.getJlNotPerformNum();
|
||||
Integer jlInServiceNum1 = one.getJlInServiceNum();
|
||||
notPerformNum += notPerformNum1;
|
||||
inServiceNum += notPerformNum1;
|
||||
xmjlNotPerformNum += notPerformNum1;
|
||||
xmjlInServiceNum += notPerformNum1;
|
||||
aqyNotPerformNum += notPerformNum1;
|
||||
aqyInServiceNum += notPerformNum1;
|
||||
zlyNotPerformNum += notPerformNum1;
|
||||
zlyInServiceNum += notPerformNum1;
|
||||
jlNotPerformNum += notPerformNum1;
|
||||
jlInServiceNum += notPerformNum1;
|
||||
}
|
||||
vo.setNotPerformNum(notPerformNum);
|
||||
vo.setInServiceNum(inServiceNum);
|
||||
vo.setXmjlNotPerformNum(xmjlNotPerformNum);
|
||||
vo.setXmjlInServiceNum(xmjlInServiceNum);
|
||||
vo.setAqyNotPerformNum(aqyNotPerformNum);
|
||||
vo.setAqyInServiceNum(aqyInServiceNum);
|
||||
vo.setZlyNotPerformNum(zlyNotPerformNum);
|
||||
vo.setZlyInServiceNum(zlyInServiceNum);
|
||||
vo.setJlNotPerformNum(jlNotPerformNum);
|
||||
vo.setJlInServiceNum(jlInServiceNum);
|
||||
return vo;
|
||||
}
|
||||
|
||||
private Integer getCardType(String type) {
|
||||
if (StringUtils.isBlank(type)) {
|
||||
return null;
|
||||
|
||||
@ -115,6 +115,7 @@ public class WorkerMonthAttendanceStatisticsServiceImpl extends ServiceImpl<Work
|
||||
return workerMonthAttendanceStatisticsMapper.getListByProjectSn(projectSn);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void getMonthAttendanceStatistics(String inputTime) {
|
||||
try {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user