From 7aa87d2ffab20f73ffba7384c67d4bbb659aa6a3 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期四, 06 三月 2025 16:22:48 +0800
Subject: [PATCH] 代码提交

---
 ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java |   29 +++++++++++++++++++++++++----
 1 files changed, 25 insertions(+), 4 deletions(-)

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 ad7ae73..fe5f22b 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
@@ -22,6 +22,7 @@
 import com.smartor.mapper.ServiceTaskMapper;
 import com.smartor.mapper.SysUserImportMapper;
 import com.smartor.service.*;
+import com.sun.org.apache.bcel.internal.generic.NEW;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.ObjectUtils;
@@ -69,6 +70,9 @@
 
     @Autowired
     private IPatMedInhospService iPatMedInhospService;
+
+    @Autowired
+    private IPatMedOperationService iPatMedOperationService;
 
     @Autowired
     private IServiceSubtaskService iServiceSubtaskService;
@@ -243,7 +247,7 @@
      * 澶勭悊鎵嬫湳淇℃伅锛岃繘鍏ュ瓙浠诲姟琛�
      */
     public void dealOperationInfo() {
-        iPatMedInhospService.dealOutHospInfo();
+        iPatMedOperationService.dealOperationInfo();
     }
 
     /**
@@ -366,7 +370,8 @@
                     //绾歌川
                 } else if (descByCode.equals("寰俊灏忕▼搴�")) {
                     //寰俊灏忕▼搴�
-                    if (ivrTask1.getPatCycle() == 1) {
+                    log.error("ivrTask1鐨勫�间负锛歿}", ivrTask1);
+                    if (ObjectUtils.isNotEmpty(ivrTask1) && ivrTask1.getPatCycle() == 1) {
                         //璇存槑璇ヤ换鍔$殑鎮h�呮槸寰幆鎵ц鐨�
                         ServiceSubtaskVO serviceSubtaskVO = new ServiceSubtaskVO();
                         serviceSubtaskVO.setTaskid(ivrTask1.getTaskid());
@@ -386,9 +391,22 @@
                             //灏嗗瓙浠诲姟ID鍒犻櫎 銆乻endstate鏀规垚3
                             serviceSubtask.setSendstate(3L);
                             serviceSubtask.setId(null);
+                            serviceSubtask.setFinishtime(null);
                             serviceSubtask.setCreateTime(new Date());
                             serviceSubtask.setUpdateTime(new Date());
-                            serviceSubtaskMapper.insertServiceSubtask(serviceSubtask);
+                            //澶勭悊閲嶅鏂板闂锛屽厛鏌ヤ竴涓嬩粖澶╂槸涓嶆槸鏈夋柊澧炶繃锛屾柊澧炶繃灏变笉鏂板浜�
+                            ServiceSubtaskVO ssvo = new ServiceSubtaskVO();
+                            LocalDate today = LocalDate.now();
+                            LocalTime startOfDay = LocalTime.of(0, 0, 0);
+                            LocalTime endOfDay = LocalTime.of(23, 59, 59);
+                            Date startOfDayDate = Date.from(today.atTime(startOfDay).atZone(ZoneId.systemDefault()).toInstant());
+                            Date endOfDayDate = Date.from(today.atTime(endOfDay).atZone(ZoneId.systemDefault()).toInstant());
+                            ssvo.setCreateStartTime(startOfDayDate);
+                            ssvo.setCreateEndTime(endOfDayDate);
+                            ssvo.setCreateBy(serviceSubtask.getCreateBy());
+                            List<ServiceSubtask> serviceSubtaskListByCreateTime = serviceSubtaskMapper.selectServiceSubtaskListByCreateTime(ssvo);
+                            if (CollectionUtils.isEmpty(serviceSubtaskListByCreateTime))
+                                serviceSubtaskMapper.insertServiceSubtask(serviceSubtask);
                         }
                     }
                 } else if (descByCode.equals("鐭俊")) {
@@ -411,12 +429,14 @@
                                     continue;
                                 }
                                 String patid = rsaPublicKeyExample.encryptedData(serviceSubtask.getPatid().toString(), pub_key);
+                                String subId = rsaPublicKeyExample.encryptedData(serviceSubtask.getId().toString(), pub_key);
                                 SendMagParam sendMagParam = new SendMagParam();
                                 sendMagParam.setType("4");
                                 ServiceOutPath serviceOutPath = new ServiceOutPath();
                                 serviceOutPath.setParam1(taskId);
                                 serviceOutPath.setParam2(patid);
                                 serviceOutPath.setParam3(ivrTask1.getTaskName());
+                                serviceOutPath.setParam6(subId);
                                 serviceOutPath.setCreateTime(new Date());
                                 iServiceOutPathService.insertServiceOutPath(serviceOutPath);
                                 String format = String.format("%03X", serviceOutPath.getId());
@@ -620,7 +640,7 @@
                     patArchive.setSex(thiedInhospInfo.getPatiRecordGender().equals("鐢�") ? 1L : 2L);
                     patArchive.setNation(thiedInhospInfo.getPatiNation());
                     patArchive.setNativePlace(thiedInhospInfo.getPatiNationality());
-                    patArchive.setPlaceOfResidence(thiedInhospInfo.getPatiHomeAddr());
+                    patArchive.setPlaceOfResidence(StringUtils.isNotEmpty(thiedInhospInfo.getPatiHomeAddr()) ? thiedInhospInfo.getPatiHomeAddr().replace("null", "") : "");
                     try {
                         if (StringUtils.isNotEmpty(thiedInhospInfo.getPatiBirthday()))
                             patArchive.setBirthdate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(thiedInhospInfo.getPatiBirthday()));
@@ -695,6 +715,7 @@
                 patMedInhosp.setLeavehospitaldistrictcode(thiedInhospInfo.getCurrWardId());
                 patMedInhosp.setLeavehospitaldistrictname(thiedInhospInfo.getCurrWardName());
                 patMedInhosp.setLeaveldeptid(thiedInhospInfo.getCurrDeptCode());
+                patMedInhosp.setOrgid("1");
                 //濡傛灉鏄嚭闄紝鍏堥�氳繃鎮h�呯紪鍙峰拰娴佹按鍙峰幓鏌ヤ竴涓嬶紝鎮h�呮槸鍚﹀瓨鍦紝濡傛灉瀛樺湪锛屽垯杩涜淇敼
                 PatMedInhosp inhosp = new PatMedInhosp();
                 inhosp.setPatno(patArchive.getPatientno());

--
Gitblit v1.9.3