sinake
2 天以前 2a3d4e4c082403aeb31d4c1c499a6107ffa835af
同步数据接口和随访率改成只有已完成
已添加2个文件
已修改17个文件
474 ■■■■■ 文件已修改
.idea/jarRepositories.xml 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/pom.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/resources/application.yml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUserDept.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/utils/sms/smsUtils.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/CollectHISController.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/CollectHISMapper.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/UtilsMapper.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ICollectHISService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/CollectHISServiceImpl.java 239 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/resources/mapper/quartz/CollectHISMapper.xml 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/resources/mapper/quartz/UtilsMapper.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PatArchive.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PatMedInhosp.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PatMedOuthosp.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/mapper/PatMedInhospMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/jarRepositories.xml
@@ -9,6 +9,11 @@
    <remote-repository>
      <option name="id" value="central" />
      <option name="name" value="Central Repository" />
      <option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
    </remote-repository>
    <remote-repository>
      <option name="id" value="central" />
      <option name="name" value="Central Repository" />
      <option name="url" value="https://repo.maven.apache.org/maven2" />
    </remote-repository>
    <remote-repository>
@@ -32,14 +37,19 @@
      <option name="url" value="https://repo1.maven.org/maven2" />
    </remote-repository>
    <remote-repository>
      <option name="id" value="aliyun" />
      <option name="name" value="aliyun" />
      <option name="url" value="https://maven.aliyun.com/repository/public" />
    </remote-repository>
    <remote-repository>
      <option name="id" value="snapshots" />
      <option name="name" value="Snapshot Repositories" />
      <option name="url" value="http://211.90.241.109:7008/repository/maven-snapshots/" />
    </remote-repository>
    <remote-repository>
      <option name="id" value="aliyun" />
      <option name="name" value="aliyun" />
      <option name="url" value="https://maven.aliyun.com/repository/public" />
      <option name="id" value="central" />
      <option name="name" value="central" />
      <option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
    </remote-repository>
    <remote-repository>
      <option name="id" value="central" />
ruoyi-admin/pom.xml
@@ -180,6 +180,12 @@
            <artifactId>postgresql</artifactId>
            <version>42.6.0</version> <!-- è¯·æ ¹æ®éœ€è¦é€‰æ‹©æœ€æ–°ç‰ˆæœ¬ -->
        </dependency>
        <!--oracle-->
        <dependency>
            <groupId>com.oracle.database.jdbc</groupId>
            <artifactId>ojdbc8</artifactId>
            <scope>runtime</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
ruoyi-admin/src/main/resources/application.yml
@@ -114,8 +114,8 @@
  mapperLocations: classpath*:mapper/**/*Mapper.xml
  # åŠ è½½å…¨å±€çš„é…ç½®æ–‡ä»¶
  configLocation: classpath:mybatis/mybatis-config.xml
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
  #configuration:
  #  log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# æ²³å—SSO配置(丽水用不到)
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUserDept.java
@@ -32,6 +32,13 @@
    private Long userId;
    /**
     * ç”¨æˆ·ç¼–号
     */
    @ApiModelProperty("用户编号")
    @Excel(name = "用户编号")
    private String userCode;
    /**
     * éƒ¨é—¨ç±»åž‹
     */
    @ApiModelProperty("部门类型")
ruoyi-common/src/main/java/com/ruoyi/common/utils/sms/smsUtils.java
@@ -36,7 +36,8 @@
                "\"timestamp\": " + timestamp + "," +
                "\"sign\": \"" + sign + "\"" +
                "}";
        return HttpUtil.postJsonRequest(url, jsonMsg);
        String sendMsg=HttpUtil.postJsonRequest(url, jsonMsg);
        return sendMsg;
    }
}
ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/CollectHISController.java
@@ -31,9 +31,10 @@
    @PostMapping("/collect")
    @ApiOperation("同步病人相关数据")
    public AjaxResult hnDataGather(@RequestBody HnDataGatherVO hnDataGatherVO) {
        log.info("开始按天同步用户数据,时间范围: {} åˆ° {}", hnDataGatherVO.getStartTime(), hnDataGatherVO.getEndTime());
        Boolean aBoolean = ichService.hnDataGather(hnDataGatherVO);
        return AjaxResult.success(aBoolean);
        //Boolean aBoolean = ichService.hnDataGather(hnDataGatherVO);
       Integer count= ichService.sync();
        return AjaxResult.success(count);
    }
    /**
ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/CollectHISMapper.java
@@ -12,6 +12,8 @@
import com.smartor.domain.PatMedOuthosp;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.List;
import java.util.Map;
@@ -43,7 +45,7 @@
     * @param sysUser
     * @return
     */
    public SysUserDept yhyksxx(SysUser sysUser);
    public List<SysUserDept> yhyksxx(SysUser sysUser);
    /**
     * å‡ºå…¥é™¢ä¿¡æ¯
@@ -94,4 +96,28 @@
     * @return éƒ¨é—¨ä¿¡æ¯é›†åˆ
     */
    public List<SysDept> selectDeptList(SysDept dept);
    /**
     * æŸ¥è¯¢è¿”回strign sql
     * @param sql
     * @return
     */
    @Select({"${sql}"})
    String getSqlString(@Param("sql") String sql);
    /**
     * æŸ¥è¯¢sql
     * @param sql
     * @return
     */
    @Select({"${sql}"})
    List<Map<String, Object>> getList(@Param("sql") String sql);
    /**
     * æŸ¥è¯¢sql
     * @param sql
     */
    @Update({"${sql}"})
    Integer updateSql(@Param("sql") String sql);
}
ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/UtilsMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
package com.ruoyi.quartz.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.List;
import java.util.Map;
@Mapper
public interface UtilsMapper {
    /**
     * æŸ¥è¯¢sql
     * @param sql
     * @return
     */
    @Select({"${sql}"})
    List<Map<String, Object>> getList(@Param("sql") String sql);
    /**
     * æ›´æ–°sql
     * @param sql
     */
    @Update({"${sql}"})
    Integer updateSql(@Param("sql") String sql);
}
ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ICollectHISService.java
@@ -7,6 +7,15 @@
import java.util.List;
public interface ICollectHISService {
    /**
     * æ•°æ®é‡‡é›†
     *
     * @param
     * @return
     */
    public Integer sync();
    /**
     * æŸ¥è¯¢æ‚£è€…档案列表
     *
@@ -24,7 +33,7 @@
    public Integer selectPatMedInhospList(PatMedInhosp patMedInhosp);
    /**
     * æ²³å—数据采集
     * æ•°æ®é‡‡é›†
     *
     * @param patMedInhosp
     * @return
ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/CollectHISServiceImpl.java
@@ -6,6 +6,7 @@
import com.ruoyi.common.core.domain.entity.SysUserRole;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.quartz.mapper.CollectHISMapper;
import com.ruoyi.quartz.mapper.UtilsMapper;
import com.ruoyi.quartz.service.ICollectHISService;
import com.smartor.domain.*;
import com.smartor.mapper.*;
@@ -20,6 +21,7 @@
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@Service
@@ -57,6 +59,9 @@
    @Autowired
    private ShardingMapper shardingMapper;
    @Autowired
    private UtilsMapper utilsMapper;
    private static final long SHARDING_THRESHOLD = 5_000_000L;
    private static final String PAT_ARCHIVE_TABLE = "pat_archive";
    private static final String PAT_MED_INHOSP_TABLE = "pat_med_inhosp";
@@ -79,6 +84,189 @@
//        return 0; // è¿”回0表示任务已提交到后台执行
//    }
    /**
     * åŒæ­¥ä»»åŠ¡
     * @param
     * @return
     */
    @Override
    public Integer sync() {
        Integer count = 0;
        List<Map<String, Object>> syncList = utilsMapper.getList("SELECT id,syncName,DATE_FORMAT(ADDDATE(startTime, INTERVAL -1 MINUTE), '%Y-%m-%d %H:%i:%s') startTime  FROM sys_sync_time  where state=0");
        if (syncList.size() > 0) {
            String endTime = chMapper.getSqlString("select sysdate from healthy_inhosp where rownum=1");
            //同步患者基本信息
//            List<Map<String, Object>> syncTemp = syncList.stream().filter(row -> row.get("syncName").equals("pat_archive")).collect(Collectors.toList());
//            if (syncTemp.size() > 0) {
//                count+=syncArchive(syncTemp.get(0).get("startTime") + "", endTime);
//                utilsMapper.updateSql("update sys_sync_time set startTime='"+endTime+"' where syncName='pat_archive' ");
//            }
            //同步住院病人信息
            List<Map<String, Object>> syncTemp = syncList.stream().filter(row -> row.get("syncName").equals("pat_med_inhosp")).collect(Collectors.toList());
            if (syncTemp.size() > 0) {
                count+=syncMedInhosp(syncTemp.get(0).get("startTime") + "", endTime);
                utilsMapper.updateSql("update sys_sync_time set startTime='"+endTime+"' where syncName='pat_med_inhosp' ");
            }
            //同步门诊信息
            syncTemp = syncList.stream().filter(row -> row.get("syncName").equals("pat_med_outhosp")).collect(Collectors.toList());
            if (syncTemp.size() > 0) {
                count+=syncOuthosp(syncTemp.get(0).get("startTime") + "", endTime);
                utilsMapper.updateSql("update sys_sync_time set startTime='"+endTime+"' where syncName='pat_med_outhosp' ");
            }
        } else {
            log.info("同步任务时间sys_sync_time表中没有需要同步的任务");
        }
        return count;
    }
    /**
     * åŒæ­¥æ‚£è€…基本信息
     * @param
     * @return
     */
    private  Integer syncArchive(String startTime,String endTime) {
        Integer count = 0;
        PatArchive pa = new PatArchive();
        pa.setLastStartTime(startTime);
        pa.setLastEndTime(endTime);
        List<PatArchive> patArchives = chMapper.selectPatArchiveList(pa);
        log.info("可同患者基本信息数量" + patArchives.size());
        for (PatArchive pm : patArchives) {
            try {
                PatArchive pa1 = new PatArchive();
                pa1.setPatientno(pm.getPatientno());
                List<PatArchive> patArchives1 = patArchiveMapper.selectPatArchiveList(pa1);
                if (CollectionUtils.isNotEmpty(patArchives1)) {
                    pm.setId(patArchives1.get(0).getId());
                    pm.setUpdateTime(new Date());
                    count += patArchiveMapper.updatePatArchive(pm);
                } else {
                    pm.setCreateTime(new Date());
                    count += patArchiveMapper.insertPatArchiveSingle(pm);
                }
            }catch (Exception ex){
                log.info("可同患者基本信息:"+ex.getMessage());
            }
        }
        return count;
    }
    /**
     * åŒæ­¥å‡ºå…¥é™¢ä¿¡æ¯
     * @param
     * @return
     */
    private  Integer syncMedInhosp(String startTime,String endTime) {
        Integer count = 0;
        PatMedInhosp patMedInhosp = new PatMedInhosp();
        patMedInhosp.setLastStartTime(startTime);
        patMedInhosp.setLastEndTime(endTime);
        List<PatMedInhosp> patMedInhospList = chMapper.selectPatMedInhospList(patMedInhosp);
        log.info("可同步出入院数量" + patMedInhospList.size());
        for (PatMedInhosp pm : patMedInhospList) {
            try {
                //患者基本信息
                PatArchive patArchive = new PatArchive();
                patArchive.setPatientno(pm.getPatno());
                List<PatArchive> patArchives = chMapper.selectPatArchiveList(patArchive);
                if (patArchives.size() > 0) {
                    PatArchive pa1 = new PatArchive();
                    pa1.setPatientno(pm.getPatno());
                    List<PatArchive> patArchives1 = patArchiveMapper.selectPatArchiveList(pa1);
                    if (CollectionUtils.isNotEmpty(patArchives1)) {
                        patArchives.get(0).setId(patArchives1.get(0).getId());
                        patArchives.get(0).setUpdateTime(new Date());
                        count += patArchiveMapper.updatePatArchive(patArchives.get(0));
                    } else {
                        patArchives.get(0).setCreateTime(new Date());
                        count += patArchiveMapper.insertPatArchiveSingle(patArchives.get(0));
                    }
                }
            }catch (Exception ex) {
                log.info("同患者基本信息:" + ex.getMessage());
            }
            try {
                //同步出入院
                PatMedInhosp pmi = new PatMedInhosp();
                pmi.setSerialnum(pm.getSerialnum());
                List<PatMedInhosp> patMedInhospList1 = patMedInhospMapper.selectPatMedInhospListBySerialnum(pmi);
                if (patMedInhospList1.size() == 0) {
                    pm.setCreateTime(new Date());
                    count += patMedInhospMapper.insertPatMedInhosp(pm);
                } else {
                    pm.setInhospid(patMedInhospList1.get(0).getInhospid());
                    pm.setUpdateTime(new Date());
                    count += patMedInhospMapper.updatePatMedInhosp(pm);
                }
            } catch (Exception ex) {
                log.info("同步出入院:" + ex.getMessage());
            }
        }
        return count;
    }
    /**
     * åŒæ­¥é—¨è¯Šä¿¡æ¯
     * @param
     * @return
     */
    private  Integer syncOuthosp(String startTime,String endTime) {
        Integer count = 0;
        PatMedOuthosp patMedOuthosp = new PatMedOuthosp();
        patMedOuthosp.setLastStartTime(startTime);
        patMedOuthosp.setLastEndTime(endTime);
        List<PatMedOuthosp> patMedOuthosps = chMapper.selectPatMedOuthospList(patMedOuthosp);
        log.info("同步门诊信息数量" + patMedOuthosps.size());
        for (PatMedOuthosp patMedOuthosp1 : patMedOuthosps) {
            try {
                //患者基本信息
                PatArchive patArchive = new PatArchive();
                patArchive.setPatientno(patMedOuthosp1.getPatno());
                List<PatArchive> patArchives = chMapper.selectPatArchiveList(patArchive);
                if (patArchives.size() > 0) {
                    PatArchive pa1 = new PatArchive();
                    pa1.setPatientno(patMedOuthosp1.getPatno());
                    List<PatArchive> patArchives1 = patArchiveMapper.selectPatArchiveList(pa1);
                    if (CollectionUtils.isNotEmpty(patArchives1)) {
                        patArchives.get(0).setId(patArchives1.get(0).getId());
                        patArchives.get(0).setUpdateTime(new Date());
                        count += patArchiveMapper.updatePatArchive(patArchives.get(0));
                    } else {
                        patArchives.get(0).setCreateTime(new Date());
                        count += patArchiveMapper.insertPatArchiveSingle(patArchives.get(0));
                    }
                }
            }catch (Exception ex) {
                log.info("同患者基本信息:" + ex.getMessage());
            }
            try {
                PatMedOuthosp patMedOuthospTemp = new PatMedOuthosp();
                patMedOuthospTemp.setSerialnum(patMedOuthosp1.getSerialnum());
                List<PatMedOuthosp> patMedOuthospsTemp = chMapper.selectPatMedOuthospList(patMedOuthosp);
                if (patMedOuthospsTemp.size() > 0) {
                    patMedOuthosp1.setUpdateTime(new Date());
                    patMedOuthosp1.setId(patMedOuthospsTemp.get(0).getId());
                    count += patMedOuthospMapper.updatePatMedOuthosp(patMedOuthosp1);
                } else {
                    patMedOuthosp1.setCreateTime(new Date());
                    count += patMedOuthospMapper.insertPatMedOuthosp(patMedOuthosp1);
                }
            } catch (Exception ex) {
                log.info("同步出入院:" + ex.getMessage());
            }
        }
        return count;
    }
    @Override
    public Integer selectPatMedInhospList(PatMedInhosp patMedInhosp) {
@@ -221,32 +409,39 @@
    public Integer selectUserList(SysUser sysUser) {
        List<SysUser> sysUserList = chMapper.selectUserList(sysUser);
        log.info("sysUserList的采集到的数量为:{}", sysUserList.size());
        int i = sysUser2Mapper.batchUser(sysUserList);
        int i =0;// sysUser2Mapper.batchUser(sysUserList);
        for (SysUser sysUser1 : sysUserList) {
            log.info("sysUser1的ID为:{}", sysUser1.getUserId());
            log.info("sysUser1的HISUSERID为:{}", sysUser1.getHisUserId());
            //新增用户与角色
            SysUserRole yhyjsxx = chMapper.yhyjsxx(sysUser1);
            if (yhyjsxx == null) continue;
            yhyjsxx.setUserId(sysUser1.getUserId());
            List<SysUserRole> userRoleList = new ArrayList<>();
            userRoleList.add(yhyjsxx);
            sysUserRoleMapper.batchUserRole(userRoleList);
//            log.info("sysUser1的ID为:{}", sysUser1.getUserId());
//            log.info("sysUser1的HISUSERID为:{}", sysUser1.getHisUserId());
//            //新增用户与角色
//            SysUserRole yhyjsxx = chMapper.yhyjsxx(sysUser1);
//            if (yhyjsxx != null&&yhyjsxx.getUserId()!=null) {
//                yhyjsxx.setUserId(sysUser1.getUserId());
//                List<SysUserRole> userRoleList = new ArrayList<>();
//                userRoleList.add(yhyjsxx);
//                sysUserRoleMapper.batchUserRole(userRoleList);
//            }
            if (StringUtils.isEmpty(sysUser1.getHisUserId())) continue;
            SysUser suTemp=new SysUser();
            suTemp.setHisUserId(sysUser1.getHisUserId());
            List<SysUser> usersTemp= sysUser2Mapper.selectUserList(suTemp);
            if (usersTemp.size()>0) {
                sysUser1.setUserId(usersTemp.get(0).getUserId());
                sysUser2Mapper.updateUser(sysUser1);
            }else{
                sysUser2Mapper.insertUser(sysUser1);
                usersTemp= sysUser2Mapper.selectUserList(suTemp);
            }
            //新增用户与部门
            if (StringUtils.isEmpty(sysUser1.getHisUserId())) continue;
            SysUserDept sysUserDept = chMapper.yhyksxx(sysUser1);
            if (Objects.isNull(sysUserDept) || sysUserDept.getDeptId() == null) continue;
            SysDept dept = new SysDept();
            dept.setHisDeptId(sysUserDept.getDeptId().toString());
            List<SysDept> sysDepts = sysDept2Mapper.selectDeptList(dept);
            if (CollectionUtils.isNotEmpty(sysDepts)) {
                sysUserDept.setDeptId(sysDepts.get(0).getDeptId());
                sysUserDept.setDeptCode(sysDepts.get(0).getDeptCode());
            }
            sysUserDept.setUserId(sysUser1.getUserId());
            sysUserDeptMapper.insertSysUserDept(sysUserDept);
            List<SysUserDept> sysUserDept = chMapper.yhyksxx(sysUser1);
            for(SysUserDept sud :sysUserDept) {
                if (usersTemp.size()>0) {
                    sud.setUserId(usersTemp.get(0).getUserId());
                    sysUserDeptMapper.insertSysUserDept(sud);
                }
            }
        }
        return i;
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
@@ -771,9 +771,8 @@
    public void collectHIS() {
        try {
            // HIS数据采集
            HnDataGatherVO hnDataGatherVO = new HnDataGatherVO();
            log.info("【dealHisData】HIS开始采集数据");
            ichService.hnDataGather(hnDataGatherVO);
            ichService.sync();
            log.info("【dealHisData】HIS结束采集数据");
        } catch (Exception e) {
            log.error("【dealHisData】HIS数据采集异常", e);
ruoyi-quartz/src/main/resources/mapper/quartz/CollectHISMapper.xml
@@ -372,8 +372,7 @@
    </select>
    <select id="yhyksxx" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserDeptResult">
        select user_id, user_code, dept_type,dept_code as
        dept_id,dept_name,deptparent,del_flag,orgid
        select user_id, user_code, dept_type,dept_code as dept_id,dept_code,dept_name,deptparent,del_flag,orgid
        FROM healthy_user_dept
        <where>
            user_id != 'admin'
@@ -414,6 +413,12 @@
            <if test="casePersonAge != null ">and case_person_age = #{casePersonAge}</if>
            <if test="filterDrname != null ">and filter_drname = #{filterDrname}</if>
            <if test="filterDrcode != null ">and filter_drcode = #{filterDrcode}</if>
            <if test="lastStartTime != null and lastStartTime != ''">
                and to_char(last_Update_Time, 'YYYY-MM-DD HH24:MI:SS') >= #{lastStartTime}
            </if>
            <if test="lastEndTime != null and lastEndTime != ''">
                and to_char(last_Update_Time, 'YYYY-MM-DD HH24:MI:SS') &lt;= #{lastEndTime}
            </if>
        </where>
    </select>
@@ -511,6 +516,12 @@
            <if test="outWayId != null ">and b.out_way_id = #{outWayId}</if>
            <if test="outWayName != null ">and b.out_way_name = #{outWayName}</if>
            <if test="orgid != null ">and b.orgid = #{orgid}</if>
            <if test="lastStartTime != null and lastStartTime != ''">
                and to_char(last_Update_Time, 'YYYY-MM-DD HH24:MI:SS') >= #{lastStartTime}
            </if>
            <if test="lastEndTime != null and lastEndTime != ''">
                and to_char(last_Update_Time, 'YYYY-MM-DD HH24:MI:SS') &lt;= #{lastEndTime}
            </if>
        </where>
    </select>
@@ -546,7 +557,12 @@
            <if test="endTime != null ">
                and to_char(admitdate, 'YYYY-MM-DD HH24:MI:SS') &lt;= to_char(#{endTime}, 'YYYY-MM-DD HH24:MI:SS')
            </if>
            <if test="lastStartTime != null and lastStartTime != ''">
                and to_char(last_Update_Time, 'YYYY-MM-DD HH24:MI:SS') >= #{lastStartTime}
            </if>
            <if test="lastEndTime != null and lastEndTime != ''">
                and to_char(last_Update_Time, 'YYYY-MM-DD HH24:MI:SS') &lt;= #{lastEndTime}
            </if>
        </where>
    </select>
ruoyi-quartz/src/main/resources/mapper/quartz/UtilsMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.quartz.mapper.UtilsMapper">
</mapper>
smartor/src/main/java/com/smartor/domain/PatArchive.java
@@ -416,4 +416,10 @@
    @ApiModelProperty("ps")
    private Integer ps;
    @ApiModelProperty(value = "最后开始时间")
    private String lastStartTime;
    @ApiModelProperty(value = "最后结束时间")
    private String lastEndTime;
}
smartor/src/main/java/com/smartor/domain/PatMedInhosp.java
@@ -463,4 +463,10 @@
    @ApiModelProperty("经管医生")
    @Excel(name = " ç»ç®¡åŒ»ç”Ÿ ")
    private String managementDoctorCode;
    @ApiModelProperty(value = "最后开始时间")
    private String lastStartTime;
    @ApiModelProperty(value = "最后结束时间")
    private String lastEndTime;
}
smartor/src/main/java/com/smartor/domain/PatMedOuthosp.java
@@ -229,6 +229,10 @@
    @ApiModelProperty(value = "是否有随访0没有;>=1有随访 ")
    private String serverState;
    @ApiModelProperty(value = "最后开始时间")
    private String lastStartTime;
    @ApiModelProperty(value = "最后结束时间")
    private String lastEndTime;
}
smartor/src/main/java/com/smartor/mapper/PatMedInhospMapper.java
@@ -35,6 +35,8 @@
     */
    public List<PatMedInhosp> selectPatMedInhospList(PatMedInhosp patMedInhosp);
    public List<PatMedInhosp> selectPatMedInhospListBySerialnum(PatMedInhosp patMedInhosp);
    public List<PatMedInhosp> selectPatMedInhospListByCondition(PatMedInhospVO patMedInhospVO);
    /**
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -2312,7 +2312,7 @@
                if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 2) {
                    serviceSubtaskStatistic.setPendingFollowUp(serviceSubtaskStatistic.getPendingFollowUp() + 1L);
                }
                if (serviceSubtask.getSendstate() != null && (serviceSubtask.getSendstate() == 1 || serviceSubtask.getSendstate() == 3 || serviceSubtask.getSendstate() == 6)) {
                if (serviceSubtask.getSendstate() != null && ( serviceSubtask.getSendstate() == 6)) {
                    serviceSubtaskStatistic.setFollowUpSuccess(serviceSubtaskStatistic.getFollowUpSuccess() + 1L);
                }
                if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 5) {
smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml
@@ -300,6 +300,78 @@
            order by b.starttime desc
        </if>
    </select>
    <select id="selectPatMedInhospListBySerialnum" parameterType="com.smartor.domain.PatMedInhosp" resultMap="PatMedInhospResult">
        select
        b.inhospid,
        b.nurse_id,
        b.nurse_name,
        b.patname,
        b.management_doctor,
        b.management_doctor_code,
        b.out_way_id,
        b.out_way_name,
        b.deptcheck_flag,
        b.wardcheck_flag,
        b.diagcheck_flag,
        b.inhospstate,
        b.patno,
        b.inhospno,
        b.serialnum,
        b.hospitalname,
        b.hospitalcode,
        b.hospitaldistrictcode,
        b.hospitaldistrictname,
        b.icd10code,
        b.diagname,
        b.starttime,
        b.endtime,
        b.deptcode,
        b.deptname,
        b.roomno,
        b.bed_no,
        b.orgid,
        b.del_flag,
        b.update_by,
        b.update_time,
        b.create_by,
        b.create_time,
        b.isupload,
        b.upload_time,
        b.patid,
        b.leavediagname,
        b.leaveicd10code,
        b.drcode,
        b.drname,
        b.schemestatus,
        b.generalschemestatus,
        b.leaveldeptcode,
        b.leaveldeptname,
        b.hospitaldistrictid,
        b.leavehospitaldistrictcode,
        b.leavehospitaldistrictname,
        b.leavehospitaldistrictid,
        b.deptid,
        b.leaveldeptid,
        b.long_task_reason,
        b.schemetime,
        b.fuflag,
        b.fudate,
        b.fuperiod,
        b.futypecode,
        b.futypedesc,
        b.fuadvice,
        b.fuspecialadvice
        FROM
        pat_med_inhosp b
        <where>
            <if test="serialnum != null ">and b.serialnum = #{serialnum}</if>
        </where>
        order by b.inhospid desc
    </select>
    <select id="selectPatMedInhospListByCondition" parameterType="com.smartor.domain.PatMedInhospVO"
            resultMap="PatMedInhospResult">
        select CONCAT( a.age, a.age_unit ) AS age,
@@ -415,6 +487,7 @@
        order by b.inhospid desc
    </select>
    <select id="getTagnameBypatid" parameterType="Long" resultType="string">
        SELECT GROUP_CONCAT(d.tagname, ', ')
        FROM pat_archivetag d