修改bug

This commit is contained in:
Administrator 2023-06-27 09:11:50 +08:00
parent 16facda583
commit dec4de7dd4
6 changed files with 279 additions and 231 deletions

View File

@ -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));
}
}

View File

@ -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;
}

View File

@ -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);
}

View File

@ -37,16 +37,16 @@
LEFT JOIN enterprise_info en ON en.id = a.enterprise_id
WHERE 1 = 1
<if test="param.chargePersonName != null and param.chargePersonName != ''">
and c.charge_person_name like CONCAT(CONCAT('%',#{param.chargePersonName}),'%')
and c.charge_person_name like CONCAT(CONCAT('%', #{param.chargePersonName}), '%')
</if>
<if test="param.leaderName != null and param.leaderName != ''">
and b.leader_name like CONCAT(CONCAT('%',#{param.leaderName}),'%')
and b.leader_name like CONCAT(CONCAT('%', #{param.leaderName}), '%')
</if>
<if test="param.belongingSection != null and param.belongingSection != ''">
and c.belonging_section like CONCAT(CONCAT('%',#{param.belongingSection}),'%')
and c.belonging_section like CONCAT(CONCAT('%', #{param.belongingSection}), '%')
</if>
<if test="param.belongingSection != null and param.belongingSection != ''">
and c.belonging_section like CONCAT(CONCAT('%',#{param.belongingSection}),'%')
and c.belonging_section like CONCAT(CONCAT('%', #{param.belongingSection}), '%')
</if>
<if test="param.projectSn != null and param.projectSn != ''">
and a.project_sn = #{param.projectSn}
@ -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">
@ -535,7 +539,7 @@
INNER JOIN company b ON cp.parent_id = b.company_id
INNER JOIN enterprise_info p ON p.id = w1.enterprise_id
Left JOIN company f ON b.parent_id = f.company_id
INNER JOIN project_enterprise pe ON pe.enterprise_id = p.id and a.project_sn=pe.project_sn
INNER JOIN project_enterprise pe ON pe.enterprise_id = p.id and a.project_sn = pe.project_sn
WHERE w1.inService_type = 1
<if test="projectName != null and projectName != ''">
and a.project_name like CONCAT(CONCAT('%', #{projectName}), '%')
@ -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>

View File

@ -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);
}

View File

@ -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);
// 人员分组