大屏统计规则修改

This commit is contained in:
pengjie 2023-02-27 17:24:39 +08:00
parent 9772d9dcfa
commit fd8e854656
3 changed files with 15 additions and 0 deletions

View File

@ -216,4 +216,6 @@ public interface WorkerInfoMapper extends BaseMapper<WorkerInfo> {
List<String> getDeclareAge(@Param("projectSn") String projectSn, @Param("startDate") String startDate, @Param("endDate") String endDate); List<String> getDeclareAge(@Param("projectSn") String projectSn, @Param("startDate") String startDate, @Param("endDate") String endDate);
PersonnelSituationVO getPersonnelSituation(String projectSn); PersonnelSituationVO getPersonnelSituation(String projectSn);
Long selectSceneTotal(String project);
} }

View File

@ -364,6 +364,16 @@
and FIND_IN_SET(w1.enterprise_id, #{userEnterpriseId}) and FIND_IN_SET(w1.enterprise_id, #{userEnterpriseId})
</if> </if>
</select> </select>
<select id="selectSceneTotal" resultType="java.lang.Long" parameterType="java.lang.String">
SELECT COUNT(1) totalPerson
from worker_info w1
INNER JOIN worker_attendance_presence p ON w1.person_sn = p.person_sn
Left JOIN team_info g ON (w1.project_sn = g.project_sn and w1.team_id = g.id)
WHERE w1.project_sn = #{projectSn}
and w1.inService_type = 1
</select>
<select id="selectWorkerTeamTotal" resultType="java.util.Map" parameterType="java.util.Map"> <select id="selectWorkerTeamTotal" resultType="java.util.Map" parameterType="java.util.Map">
SELECT team_id teamId, SELECT team_id teamId,
COUNT(1) totalPerson COUNT(1) totalPerson

View File

@ -1585,10 +1585,13 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
@Override @Override
public PersonnelSituationVO getPersonnelSituation(String projectSn) { public PersonnelSituationVO getPersonnelSituation(String projectSn) {
// 现场
Long scene = workerInfoMapper.selectSceneTotal(projectSn);
PersonnelSituationVO personnelSituation = workerInfoMapper.getPersonnelSituation(projectSn); PersonnelSituationVO personnelSituation = workerInfoMapper.getPersonnelSituation(projectSn);
Long bePresent = personnelSituation.getBePresent(); Long bePresent = personnelSituation.getBePresent();
// 今日出勤率 // 今日出勤率
personnelSituation.setAtteRatio(bePresent == null || bePresent == 0L ? 0F : NumberUtil.round(personnelSituation.getTodayAtte() * 100F / bePresent, 2).floatValue()); personnelSituation.setAtteRatio(bePresent == null || bePresent == 0L ? 0F : NumberUtil.round(personnelSituation.getTodayAtte() * 100F / bePresent, 2).floatValue());
personnelSituation.setScene(scene);
return personnelSituation; return personnelSituation;
} }