From 8f5a4a882870ce0dcfbdb5716b55ec55887924d6 Mon Sep 17 00:00:00 2001
From: sinake <sinake1@qq.com>
Date: 星期一, 01 九月 2025 18:12:30 +0800
Subject: [PATCH] 接口题目层增加answerps字段
---
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java | 11 ++-
ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/CollectHISServiceImpl.java | 66 +++++++++++++++-------
ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/CollectHISController.java | 69 +++++++++++++++++++++++
smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml | 4 +
ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ICollectHISService.java | 2
5 files changed, 125 insertions(+), 27 deletions(-)
diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/CollectHISController.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/CollectHISController.java
new file mode 100644
index 0000000..a5b760f
--- /dev/null
+++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/CollectHISController.java
@@ -0,0 +1,69 @@
+package com.ruoyi.quartz.controller;
+
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysDept;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.quartz.service.ICollectHISService;
+import com.smartor.domain.HnDataGatherVO;
+import com.smartor.domain.Icd10;
+import com.smartor.service.IHNGatherPatArchiveService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@Slf4j
+@RestController
+@RequestMapping("/monitor/his")
+@Api(description = "閲囬泦鎮h�呬俊鎭帴鍙�")
+public class CollectHISController extends BaseController {
+ @Autowired
+ private ICollectHISService ichService;
+
+ /**
+ * 娌冲崡鏁版嵁閲囬泦
+ */
+ @PostMapping("/collect")
+ @ApiOperation("鍚屾鐥呬汉鐩稿叧鏁版嵁")
+ public AjaxResult hnDataGather(@RequestBody HnDataGatherVO hnDataGatherVO) {
+ log.info("寮�濮嬫寜澶╁悓姝ョ敤鎴锋暟鎹紝鏃堕棿鑼冨洿: {} 鍒� {}", hnDataGatherVO.getStartTime(), hnDataGatherVO.getEndTime());
+ Boolean aBoolean = ichService.hnDataGather(hnDataGatherVO);
+ return AjaxResult.success(aBoolean);
+ }
+
+ /**
+ * 鏌ヨ鐤剧梾鍒楄〃鏁版嵁閲囬泦
+ */
+ @PostMapping("/collectIcd10")
+ @ApiOperation("鍚屾鏍囧噯璇婃柇")
+ public AjaxResult selectIcd10List(@RequestBody Icd10 icd10) {
+ Integer integer = ichService.selectIcd10List(icd10);
+ return AjaxResult.success(integer);
+ }
+
+ /**
+ * 鐢ㄦ埛淇℃伅闆嗗悎淇℃伅鏁版嵁閲囬泦
+ */
+ @PostMapping("/collectUser")
+ @ApiOperation("鍚屾鐢ㄦ埛淇℃伅")
+ public AjaxResult selectUserList(@RequestBody SysUser sysUser) {
+ Integer integer = ichService.selectUserList(sysUser);
+ return AjaxResult.success(integer);
+ }
+
+ /**
+ * 閮ㄩ棬淇℃伅闆嗗悎淇℃伅鏁版嵁閲囬泦
+ */
+ @PostMapping("/collectDept")
+ @ApiOperation("鍚屾绉戝淇℃伅")
+ public AjaxResult selectDeptList(@RequestBody SysDept sysDept) {
+ Integer integer = ichService.selectDeptList(sysDept);
+ return AjaxResult.success(integer);
+ }
+
+}
diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ICollectHISMapperService.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ICollectHISService.java
similarity index 96%
rename from ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ICollectHISMapperService.java
rename to ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ICollectHISService.java
index bc65cb3..6a38783 100644
--- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ICollectHISMapperService.java
+++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ICollectHISService.java
@@ -6,7 +6,7 @@
import java.util.List;
-public interface ICollectHISMapperService {
+public interface ICollectHISService {
/**
* 鏌ヨ鎮h�呮。妗堝垪琛�
*
diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/CollectHISMapperServiceImpl.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/CollectHISServiceImpl.java
similarity index 77%
rename from ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/CollectHISMapperServiceImpl.java
rename to ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/CollectHISServiceImpl.java
index 69b042c..954d2b6 100644
--- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/CollectHISMapperServiceImpl.java
+++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/CollectHISServiceImpl.java
@@ -1,21 +1,16 @@
package com.ruoyi.quartz.service.impl;
-import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.entity.SysUserDept;
import com.ruoyi.common.core.domain.entity.SysUserRole;
-import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.quartz.mapper.CollectHISMapper;
-import com.ruoyi.quartz.service.ICollectHISMapperService;
+import com.ruoyi.quartz.service.ICollectHISService;
import com.smartor.domain.*;
import com.smartor.mapper.*;
-import com.smartor.service.impl.PatArchiveServiceImpl;
-import com.smartor.service.impl.PatMedInhospServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Service;
@@ -27,9 +22,9 @@
@Slf4j
@Service
-public class CollectHISMapperServiceImpl implements ICollectHISMapperService {
+public class CollectHISServiceImpl implements ICollectHISService {
@Autowired
- private HNGatherPatArchiveMapper hnGatherPatArchiveMapper;
+ private CollectHISMapper chMapper;
@Autowired
private SysUser2Mapper sysUser2Mapper;
@@ -68,7 +63,7 @@
@Override
public List<PatArchive> selectPatArchiveList(PatArchive patArchive) {
- return hnGatherPatArchiveMapper.selectPatArchiveList(patArchive);
+ return chMapper.selectPatArchiveList(patArchive);
}
// @Override
@@ -86,11 +81,11 @@
@Override
public Integer selectPatMedInhospList(PatMedInhosp patMedInhosp) {
- List<PatMedInhosp> patMedInhospList = hnGatherPatArchiveMapper.selectPatMedInhospList(patMedInhosp);
+ List<PatMedInhosp> patMedInhospList = chMapper.selectPatMedInhospList(patMedInhosp);
for (PatMedInhosp pm : patMedInhospList) {
PatArchive patArchive = new PatArchive();
patArchive.setPatientno(pm.getPatno());
- List<PatArchive> patArchives = hnGatherPatArchiveMapper.selectPatArchiveList(patArchive);
+ List<PatArchive> patArchives = chMapper.selectPatArchiveList(patArchive);
if (CollectionUtils.isEmpty(patArchives)) {
//绌轰簡鐩存帴涓㈡帀
continue;
@@ -104,7 +99,27 @@
patArchiveMapper.insertPatArchiveSingle(patArchives.get(0));
pm.setPatid(patArchives.get(0).getId());
}
- patMedInhospMapper.insertPatMedInhosp(pm);
+ if (!Objects.isNull(patMedInhosp.getStartInHospTime()) && !Objects.isNull(patMedInhosp.getEndInHospTime())) {
+ //鍏ラ櫌
+ pm.setInhospstate("0");
+ pm.setCreateTime(new Date());
+ patMedInhospMapper.insertPatMedInhosp(pm);
+ } else if (!Objects.isNull(patMedInhosp.getStartOutHospTime()) && !Objects.isNull(patMedInhosp.getEndOutHospTime())) {
+ //鍑洪櫌
+ pm.setInhospstate("1");
+ pm.setUpdateTime(new Date());
+ PatMedInhosp pmi = new PatMedInhosp();
+ pmi.setSerialnum(pm.getSerialnum());
+ List<PatMedInhosp> patMedInhospList1 = patMedInhospMapper.selectPatMedInhospList(pmi);
+ if (CollectionUtils.isEmpty(patMedInhospList1)) {
+ pm.setCreateTime(new Date());
+ patMedInhospMapper.insertPatMedInhosp(pm);
+ } else {
+ pm.setInhospid(patMedInhospList1.get(0).getInhospid());
+ patMedInhospMapper.updatePatMedInhosp(pm);
+ }
+
+ }
}
return 0;
}
@@ -119,16 +134,25 @@
// 寰幆澶勭悊姣忎竴澶�
for (LocalDate currentDate = startDate; !currentDate.isAfter(endDate); currentDate = currentDate.plusDays(1)) {
PatMedInhosp dailyCondition = new PatMedInhosp();
+ //澶勭悊鍏ラ櫌
LocalDateTime dayStart = currentDate.atStartOfDay();
LocalDateTime dayEnd = currentDate.atTime(23, 59, 59);
+ dailyCondition.setStartInHospTime(Date.from(dayStart.atZone(ZoneId.systemDefault()).toInstant()));
+ dailyCondition.setEndInHospTime(Date.from(dayEnd.atZone(ZoneId.systemDefault()).toInstant()));
+ selectPatMedInhospList(dailyCondition);
+
+ //澶勭悊鍑洪櫌
+ dailyCondition.setStartInHospTime(null);
+ dailyCondition.setEndInHospTime(null);
dailyCondition.setStartOutHospTime(Date.from(dayStart.atZone(ZoneId.systemDefault()).toInstant()));
dailyCondition.setEndOutHospTime(Date.from(dayEnd.atZone(ZoneId.systemDefault()).toInstant()));
- Integer pi = selectPatMedInhospList(dailyCondition);
+ selectPatMedInhospList(dailyCondition);
+ //澶勭悊闂ㄨ瘖
PatMedOuthosp patMedOuthosp = new PatMedOuthosp();
patMedOuthosp.setBeginTime(Date.from(dayStart.atZone(ZoneId.systemDefault()).toInstant()));
patMedOuthosp.setEndTime(Date.from(dayEnd.atZone(ZoneId.systemDefault()).toInstant()));
- po = selectPatMedOuthospList(patMedOuthosp);
+ selectPatMedOuthospList(patMedOuthosp);
}
return true;
}
@@ -136,14 +160,14 @@
@Override
public Integer selectPatMedOuthospList(PatMedOuthosp patMedOuthosp) {
- List<PatMedOuthosp> patMedOuthosps = hnGatherPatArchiveMapper.selectPatMedOuthospList(patMedOuthosp);
+ List<PatMedOuthosp> patMedOuthosps = chMapper.selectPatMedOuthospList(patMedOuthosp);
log.info("selectPatMedOuthospList鐨勯噰闆嗗埌鐨勬暟閲忎负锛歿}", patMedOuthosps.size());
Integer i = null;
for (PatMedOuthosp patMedOuthosp1 : patMedOuthosps) {
//鑾峰彇鎮h�呭熀鏈俊鎭�
PatArchive patArchive = new PatArchive();
patArchive.setPatientno(patMedOuthosp1.getPatno());
- List<PatArchive> patArchives = hnGatherPatArchiveMapper.selectPatArchiveList(patArchive);
+ List<PatArchive> patArchives = chMapper.selectPatArchiveList(patArchive);
//鏍规嵁patno鍒ゆ柇鏈湴鎮h�呭熀鏈俊鎭槸鍚﹀瓨鍦�
PatArchive pa = new PatArchive();
@@ -166,7 +190,7 @@
@Override
public Integer selectIcd10List(Icd10 icd10) {
- List<Icd10> icd10s = hnGatherPatArchiveMapper.selectIcd10List(icd10);
+ List<Icd10> icd10s = chMapper.selectIcd10List(icd10);
log.info("selectIcd10List鐨勯噰闆嗗埌鐨勬暟閲忎负锛歿}", icd10s.size());
int i = icd10Mapper.batchIcd10(icd10s);
return i;
@@ -174,14 +198,14 @@
@Override
public Integer selectUserList(SysUser sysUser) {
- List<SysUser> sysUserList = hnGatherPatArchiveMapper.selectUserList(sysUser);
+ List<SysUser> sysUserList = chMapper.selectUserList(sysUser);
log.info("sysUserList鐨勯噰闆嗗埌鐨勬暟閲忎负锛歿}", sysUserList.size());
int i = sysUser2Mapper.batchUser(sysUserList);
for (SysUser sysUser1 : sysUserList) {
log.info("sysUser1鐨処D涓猴細{}", sysUser1.getUserId());
log.info("sysUser1鐨凥ISUSERID涓猴細{}", sysUser1.getHisUserId());
//鏂板鐢ㄦ埛涓庤鑹�
- SysUserRole yhyjsxx = hnGatherPatArchiveMapper.yhyjsxx(sysUser1);
+ SysUserRole yhyjsxx = chMapper.yhyjsxx(sysUser1);
if (yhyjsxx == null) continue;
yhyjsxx.setUserId(sysUser1.getUserId());
List<SysUserRole> userRoleList = new ArrayList<>();
@@ -190,7 +214,7 @@
//鏂板鐢ㄦ埛涓庨儴闂�
if (StringUtils.isEmpty(sysUser1.getHisUserId())) continue;
- SysUserDept sysUserDept = hnGatherPatArchiveMapper.yhyksxx(sysUser1);
+ SysUserDept sysUserDept = chMapper.yhyksxx(sysUser1);
if (Objects.isNull(sysUserDept) || sysUserDept.getDeptId() == null) continue;
SysDept dept = new SysDept();
dept.setHisDeptId(sysUserDept.getDeptId().toString());
@@ -209,7 +233,7 @@
@Override
public Integer selectDeptList(SysDept dept) {
- List<SysDept> sysDepts = hnGatherPatArchiveMapper.selectDeptList(dept);
+ List<SysDept> sysDepts = chMapper.selectDeptList(dept);
log.info("selectDeptList鐨勯噰闆嗗埌鐨勬暟閲忎负锛歿}", sysDepts.size());
int i = sysDept2Mapper.batchDept(sysDepts);
return i;
diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
index 938a6c2..30ae035 100644
--- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
+++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
@@ -14,8 +14,7 @@
import com.ruoyi.common.utils.RSAPublicKeyExample;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.http.HttpUtils;
-import com.ruoyi.quartz.service.ICollectHISMapperService;
-import com.ruoyi.quartz.service.impl.CollectHISMapperServiceImpl;
+import com.ruoyi.quartz.service.ICollectHISService;
import com.smartor.common.LSHospTokenUtil;
import com.smartor.domain.*;
import com.smartor.mapper.HeLibraryMapper;
@@ -87,6 +86,10 @@
@Autowired
private HeLibraryMapper heLibraryMapper;
+ @Autowired
+ private ICollectHISService ichService;
+
+
@Value("${localIP}")
private String localIP;
@@ -134,7 +137,7 @@
IXHGatherPatArchiveService ixhGatherPatArchiveService;
@Autowired
- ICollectHISMapperService icollectHis;
+ ICollectHISService icollectHis;
@Value("${appid}")
@@ -770,7 +773,7 @@
// HIS鏁版嵁閲囬泦
HnDataGatherVO hnDataGatherVO = new HnDataGatherVO();
log.info("銆恉ealHisData銆慔IS寮�濮嬮噰闆嗘暟鎹�");
- ihnGatherPatArchiveService.hnDataGather(hnDataGatherVO);
+ ichService.hnDataGather(hnDataGatherVO);
log.info("銆恉ealHisData銆慔IS缁撴潫閲囬泦鏁版嵁");
} catch (Exception e) {
log.error("銆恉ealHisData銆慔IS鏁版嵁閲囬泦寮傚父", e);
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml
index 761ca97..bec2bd9 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml
@@ -54,6 +54,7 @@
<result property="patid" column="patid"/>
<result property="guid" column="guid"/>
<result property="extemplateText" column="extemplate_text"/>
+ <result property="answerps" column="answerps"/>
</resultMap>
<resultMap type="com.smartor.domain.ServiceSubtaskDetailTarget" id="ServiceSubtaskDetailTargetResult">
<result property="targetid" column="targetid"/>
@@ -111,7 +112,8 @@
update_by,
update_time,
value_type,
- create_by
+ create_by,
+ answerps
from service_subtask_detail
</sql>
--
Gitblit v1.9.3