修改员工导出bug及大屏睡眠人数
This commit is contained in:
+7
@@ -5,7 +5,9 @@ import com.renkang.watch.entity.WatchStatUserInfoDaySleep;
|
||||
import com.renkang.watch.vo.UserData.res.sleep.WatchDataSleepRes;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -28,4 +30,9 @@ public interface WatchStatUserInfoDaySleepMapper extends BaseMapper<WatchStatUse
|
||||
void insertStat(WatchStatUserInfoDaySleep watchStatUserInfoDaySleep);
|
||||
|
||||
void updateStat(WatchStatUserInfoDaySleep watchStatUserInfoDaySleep);
|
||||
|
||||
|
||||
Integer countDistinctUser(@Param("startDate") Date startDate,
|
||||
@Param("endDate") Date endDate,
|
||||
@Param("orgCode") String orgCode);
|
||||
}
|
||||
|
||||
+11
@@ -43,6 +43,7 @@
|
||||
and data_date <= DATE(#{endTime})
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertStat">
|
||||
insert into watch_stat_user_info_day_sleep(id, user_id, long_count, long_duration_max, long_duration_min,
|
||||
long_duration_total, short_count, short_duration_max, short_duration_min,
|
||||
@@ -127,4 +128,14 @@
|
||||
where stat.user_id = #{userId,jdbcType=VARCHAR}
|
||||
and stat.data_date = #{dataDate,jdbcType=DATE};
|
||||
</update>
|
||||
|
||||
<select id="countDistinctUser" resultType="java.lang.Integer">
|
||||
SELECT COUNT(DISTINCT user_id)
|
||||
FROM watch_stat_user_info_day_sleep
|
||||
WHERE data_date BETWEEN #{startDate} AND #{endDate}
|
||||
AND user_id IS NOT NULL
|
||||
<if test="orgCode != null and orgCode != ''">
|
||||
AND org_code LIKE CONCAT(#{orgCode},'%')
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
+5
-2
@@ -1,5 +1,6 @@
|
||||
package com.renkang.watch.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateField;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
@@ -1053,10 +1054,12 @@ public class WatchDataServiceImpl extends ServiceImpl<WatchDataMapper, WatchData
|
||||
if (!StrUtil.isNotBlank(dto.getType())) {
|
||||
ExceptionAssertsUtil.fail("时间不能为空");
|
||||
}
|
||||
Date startDate = dateByType(dto.getType(),false);
|
||||
Date endDate = dateByType(dto.getType(),true);
|
||||
//调用之前的接口查询柱状图数据
|
||||
List<BigScreenSleepVo> sleepInfo = getSleep(dto);
|
||||
//todo 查询存在睡眠数据的人数
|
||||
vo.setPeopleSum(0);
|
||||
Integer userCount = watchStatUserInfoDaySleepMapper.countDistinctUser(startDate, endDate, dto.getOrgCode());
|
||||
vo.setPeopleSum(userCount == null ? 0 : userCount);
|
||||
vo.setSleepInfo(sleepInfo);
|
||||
return vo;
|
||||
}
|
||||
|
||||
+6
-1
@@ -1111,7 +1111,12 @@ public class HealthUserEmployeeExServiceImpl extends ServiceImpl<HealthUserEmplo
|
||||
if (Objects.nonNull(userEmployee.getSecondDepart())) {
|
||||
userEmployeeVo.setUnit(userEmployee.getSecondDepart().getDepartName());
|
||||
}
|
||||
//部门
|
||||
//三级部门
|
||||
if (Objects.nonNull(userEmployee.getOrgCode())) {
|
||||
SysDepart thirdDepart = sysCache.getDepartByOrgCode(GlobalUtils.getThirdDepartOrgCode(userEmployee.getOrgCode()));
|
||||
userEmployeeVo.setThreeDepart(thirdDepart.getDepartName());
|
||||
}
|
||||
//四级部门
|
||||
if (Objects.nonNull(userEmployee.getDepart())) {
|
||||
userEmployeeVo.setDepart(userEmployee.getDepart().getDepartName());
|
||||
}
|
||||
|
||||
+3
-1
@@ -23,7 +23,9 @@ public class UserEmployeeVo implements Serializable {
|
||||
private String idCard;
|
||||
@Excel(name = "单位(必填)", width = 15)
|
||||
private String unit;
|
||||
@Excel(name = "部门(必填)", width = 18)
|
||||
@Excel(name = "部门名称(必填)", width = 18)
|
||||
private String threeDepart;
|
||||
@Excel(name = "四级部门名称(必填)", width = 18)
|
||||
private String depart;
|
||||
@Excel(name = "出生日期", width = 15, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
|
||||
Reference in New Issue
Block a user