|
|
|
@ -1,5 +1,8 @@ |
|
|
|
package com.zdxt.enforcementcode.service.impl; |
|
|
|
|
|
|
|
import com.zdxt.enforcementcode.common.commonenum.MsgSourceTypeEnum; |
|
|
|
import com.zdxt.enforcementcode.common.commonenum.PlatformTypeEnums; |
|
|
|
import com.zdxt.enforcementcode.service.ISysMessageViewLogService; |
|
|
|
import org.dromara.common.core.utils.MapstructUtils; |
|
|
|
import org.dromara.common.core.utils.StringUtils; |
|
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|
|
|
@ -9,6 +12,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.dromara.common.satoken.utils.LoginHelper; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import com.zdxt.enforcementcode.domain.bo.EfcodeCpTaskBo; |
|
|
|
import com.zdxt.enforcementcode.domain.vo.EfcodeCpTaskVo; |
|
|
|
@ -39,7 +43,7 @@ public class EfcodeCpTaskServiceImpl implements IEfcodeCpTaskService { |
|
|
|
|
|
|
|
private final EfcodeCpTaskMapper baseMapper; |
|
|
|
private final EfcodeCpPlanMapper cpPlanMapper; |
|
|
|
|
|
|
|
private final ISysMessageViewLogService sysMessageViewLogService; |
|
|
|
/** |
|
|
|
* 查询行政执法检查计划-任务 |
|
|
|
* |
|
|
|
@ -179,6 +183,10 @@ public class EfcodeCpTaskServiceImpl implements IEfcodeCpTaskService { |
|
|
|
} |
|
|
|
detail.setAssociatedPlans(associated); |
|
|
|
} |
|
|
|
// 插入查看记录(调用公共方法)
|
|
|
|
if (detail != null) { |
|
|
|
sysMessageViewLogService.insertViewLog(planId, MsgSourceTypeEnum.ZFRW.getKey()); |
|
|
|
} |
|
|
|
return detail; |
|
|
|
} |
|
|
|
|
|
|
|
@ -269,6 +277,7 @@ public class EfcodeCpTaskServiceImpl implements IEfcodeCpTaskService { |
|
|
|
return task.getId(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 校验并批量删除行政执法检查计划-任务信息 |
|
|
|
* |
|
|
|
@ -283,4 +292,27 @@ public class EfcodeCpTaskServiceImpl implements IEfcodeCpTaskService { |
|
|
|
} |
|
|
|
return baseMapper.deleteByIds(ids) > 0; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 统计当前用户未读任务数量 |
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
public Long countUnreadTasksForCurrentUser() { |
|
|
|
Integer platformType = LoginHelper.getPlatformType(); |
|
|
|
Long userId = LoginHelper.getUserId(); |
|
|
|
// 默认来源类型:执法任务
|
|
|
|
final Integer sourceType = 4; |
|
|
|
// 执法端:根据用户ID统计
|
|
|
|
if (PlatformTypeEnums.ENFORCEMENT.getKey().equals(platformType)) { |
|
|
|
if (userId == null) { |
|
|
|
log.warn("当前用户未登录,无法统计未读执法任务消息"); |
|
|
|
return 0L; |
|
|
|
} |
|
|
|
return baseMapper.countTasksForCurrentUser(userId,sourceType); |
|
|
|
} |
|
|
|
return 0L; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|