修改bug
This commit is contained in:
parent
16facda583
commit
dec4de7dd4
@ -21,10 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
@ -589,4 +586,16 @@ public class WorkerInfoController {
|
||||
public Result<PresenceAndTotalNumberOfEngineeringPersonnelVo> queryThePresenceAndTotalNumberOfEngineeringPersonnel() {
|
||||
return Result.success(workerInfoService.queryThePresenceAndTotalNumberOfEngineeringPersonnel());
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计特殊工种人员
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getSpecialWorkerStatics")
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "query", required = true, dataType = "String")
|
||||
public Result<SpecialWorkerStaticsVo> getSpecialWorkerStatics(@RequestParam HashMap<String, Object> map) {
|
||||
return Result.success(workerInfoService.getSpecialWorkerStatics(map));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
package com.zhgd.xmgl.modules.worker.entity.vo;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SpecialWorkerStaticsVo {
|
||||
@ApiModelProperty(value = "总人数")
|
||||
private Integer totalNum;
|
||||
@ApiModelProperty(value = "在场人数")
|
||||
private Integer inService;
|
||||
}
|
||||
@ -10,6 +10,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -227,4 +228,6 @@ public interface WorkerInfoMapper extends BaseMapper<WorkerInfo> {
|
||||
List<PresenceAndTotalNumberOfEngineeringPersonnelVo.Count> queryTotalNum();
|
||||
|
||||
List<TypeNumVo> countWorkerNumGroupByWorkerType(Map<String, Object> map);
|
||||
|
||||
SpecialWorkerStaticsVo getSpecialWorkerStatics(HashMap<String, Object> map);
|
||||
}
|
||||
|
||||
@ -172,26 +172,30 @@
|
||||
<select id="selectWorkerInfoByPersonSn" resultType="com.zhgd.xmgl.modules.worker.entity.WorkerInfo">
|
||||
select *
|
||||
from worker_info
|
||||
where person_sn = #{personSn} LIMIT 1
|
||||
where person_sn = #{personSn}
|
||||
LIMIT 1
|
||||
</select>
|
||||
<select id="selectWorkWorkerInfoWithIDCard" resultType="com.zhgd.xmgl.modules.worker.entity.WorkerInfo">
|
||||
select *
|
||||
from worker_info
|
||||
where project_sn = #{projectSn}
|
||||
and id_card = #{idCard}
|
||||
and inService_type = 1 LIMIT 1
|
||||
and inService_type = 1
|
||||
LIMIT 1
|
||||
</select>
|
||||
<select id="selectWorkWorkerInfoWithAttendanceNumber" resultType="com.zhgd.xmgl.modules.worker.entity.WorkerInfo">
|
||||
select *
|
||||
from worker_info
|
||||
where project_sn = #{projectSn}
|
||||
and attendance_number = #{attendanceNumber}
|
||||
and inService_type = 1 LIMIT 1
|
||||
and inService_type = 1
|
||||
LIMIT 1
|
||||
</select>
|
||||
<select id="getNotifyPersonList" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
|
||||
select *
|
||||
from worker_info
|
||||
where FIND_IN_SET(id, #{notifyPerson}) LIMIT 1
|
||||
where FIND_IN_SET(id, #{notifyPerson})
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="getProjectWorkerStatistics" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
|
||||
@ -2302,4 +2306,14 @@
|
||||
LEFT JOIN worker_info wi ON (ti.id = wi.team_id and wi.inService_type = 1)
|
||||
GROUP BY wt.type_name
|
||||
</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.id = 11
|
||||
and w.project_sn = #{projectSn}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -9,6 +9,7 @@ import com.zhgd.xmgl.modules.worker.entity.vo.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -116,4 +117,6 @@ public interface IWorkerInfoService extends IService<WorkerInfo> {
|
||||
PresenceAndTotalNumberOfEngineeringPersonnelVo queryThePresenceAndTotalNumberOfEngineeringPersonnel();
|
||||
|
||||
List<TypeNumVo> countWorkerNumGroupByWorkerType(Map<String, Object> map);
|
||||
|
||||
SpecialWorkerStaticsVo getSpecialWorkerStatics(HashMap<String, Object> map);
|
||||
}
|
||||
|
||||
@ -1738,6 +1738,12 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
|
||||
return rtList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpecialWorkerStaticsVo getSpecialWorkerStatics(HashMap<String, Object> map) {
|
||||
SpecialWorkerStaticsVo vo = workerInfoMapper.getSpecialWorkerStatics(map);
|
||||
return vo;
|
||||
}
|
||||
|
||||
private long getAttendanceNumber(String projectSn) {
|
||||
AtomicLong number = new AtomicLong(0);
|
||||
// 人员分组
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user