liusheng
5 天以前 0bbbd746e8c39d91ad7b47a4e36e29ab972dc98c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package com.ruoyi.task.api.contract;
 
import com.ruoyi.common.core.service.SubtaskStatApi;
import com.ruoyi.common.core.service.dto.PatMedReq;
import com.ruoyi.common.core.service.dto.PatMedRes;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.ruoyi.task.mapper.ServiceSubtaskMapper;
 
/**
 * 【过渡实现·临时】{@link SubtaskStatApi} 在 smartor 侧的桥接。
 *
 * <h3>为什么需要它</h3>
 * 门诊随访统计({@code selectPatMedOuthospCount})要把"门诊人次/人数"与
 * "随访人次/人数"合并返回,后者查的是 {@code service_subtask}(子任务域)。
 * 随访模块不能依赖 smartor,故按既有套路把这一层"查"下沉成 ruoyi-common 契约。
 *
 * <h3>⚠️ 纯搬运</h3>
 * 本方法只做"转发到原 Mapper",不加工参数、不设默认值。
 * 原实现里 {@code patMedRes.setRc(count)}(把本域算出的门诊人次塞回去)属门诊域,
 * 留在调用方。
 *
 * <h3>原实现对应</h3>
 * 门诊 {@code PatMedOuthospServiceImpl#selectPatMedOuthospCount} L345:
 * {@code serviceSubtaskMapper.selectVisitCount(patMedReq)}。
 *
 * <h3>将来动作</h3>
 * 「随访任务创建模块」落地后把它的实现注册进容器,本类整体删除即可。
 */
@Slf4j
@Component
public class SubtaskStatApiImpl implements SubtaskStatApi {
 
    @Autowired
    private ServiceSubtaskMapper serviceSubtaskMapper;
 
    @Override
    public PatMedRes countVisitForStat(PatMedReq req) {
        return serviceSubtaskMapper.selectVisitCount(req);
    }
}