Bladeren bron

条件租户条件判断

tags/v1.0.0^2
chengwang 1 jaar geleden
bovenliggende
commit
36558870d6
3 gewijzigde bestanden met toevoegingen van 9 en 2 verwijderingen
  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 Bestand weergeven

@@ -16,5 +16,5 @@ public interface InspectionFileMapper extends BaseMapper<InspectionFile> {
//查询当前登录人处理问题总数
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 Bestand weergeven

@@ -365,6 +365,12 @@ public class InspectionFileServiceImpl implements IInspectionFileService {
if (null == user.getRoleId()) {
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());
//一周前的时间
@@ -378,7 +384,7 @@ public class InspectionFileServiceImpl implements IInspectionFileService {
InspectionFileCountVo vo = new InspectionFileCountVo();
vo.setCheckTime(s);
//查询当日登录用户的已处理问题总数,创建时间
Integer num = inspectionFileMapper.getInspectionFileHandleCount(s, user.getId());
Integer num = inspectionFileMapper.getInspectionFileHandleCount(s, tenantId);
if (null != num) {
vo.setInspectionHandleSum(num);
}

+ 1
- 0
tuoheng-service/tuoheng-miniprogram/src/main/resources/mapper/InspectionFileMapper.xml Bestand weergeven

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

Laden…
Annuleren
Opslaan