Browse Source

条件租户条件判断

tags/v1.0.0^2
chengwang 1 year ago
parent
commit
36558870d6
3 changed files with 9 additions and 2 deletions
  1. +1
    -1
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/dao/InspectionFileMapper.java
  2. +7
    -1
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/InspectionFileServiceImpl.java
  3. +1
    -0
      tuoheng-service/tuoheng-miniprogram/src/main/resources/mapper/InspectionFileMapper.xml

+ 1
- 1
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/dao/InspectionFileMapper.java View File

//查询当前登录人处理问题总数 //查询当前登录人处理问题总数
Integer getInspectionFileCount(@Param("today") String s,@Param("userId") String id); Integer getInspectionFileCount(@Param("today") String s,@Param("userId") String id);


Integer getInspectionFileHandleCount(@Param("today") String s,@Param("userId") String id);
Integer getInspectionFileHandleCount(@Param("today") String s,@Param("tenantId") String id);
} }

+ 7
- 1
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/InspectionFileServiceImpl.java View File

if (null == user.getRoleId()) { if (null == user.getRoleId()) {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL); throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
} }
//获取当前租户id
String tenantId = CurrentUserUtil.getTenantId();
if(StringUtils.isEmpty(tenantId)){
return JsonResult.error(InspectionFileEnum.TENANT_ID_IS_NULL.getCode(),InspectionFileEnum.TENANT_ID_IS_NULL.getMsg());
}

//今日 //今日
DateTime endTime = DateUtil.endOfDay(DateUtil.date()); DateTime endTime = DateUtil.endOfDay(DateUtil.date());
//一周前的时间 //一周前的时间
InspectionFileCountVo vo = new InspectionFileCountVo(); InspectionFileCountVo vo = new InspectionFileCountVo();
vo.setCheckTime(s); vo.setCheckTime(s);
//查询当日登录用户的已处理问题总数,创建时间 //查询当日登录用户的已处理问题总数,创建时间
Integer num = inspectionFileMapper.getInspectionFileHandleCount(s, user.getId());
Integer num = inspectionFileMapper.getInspectionFileHandleCount(s, tenantId);
if (null != num) { if (null != num) {
vo.setInspectionHandleSum(num); vo.setInspectionHandleSum(num);
} }

+ 1
- 0
tuoheng-service/tuoheng-miniprogram/src/main/resources/mapper/InspectionFileMapper.xml View File

from th_inspection_file from th_inspection_file
where date_format(update_time, '%Y-%m-%d') = #{today} where date_format(update_time, '%Y-%m-%d') = #{today}
and mark = 1 and mark = 1
and tenant_id = #{tenantId}
</select> </select>
</mapper> </mapper>

Loading…
Cancel
Save