From 10aaa035f5be0312304d20f022bdb714a8f4900a Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期三, 11 十二月 2024 22:16:23 +0800
Subject: [PATCH] 代码提交
---
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java | 81 +++++++++++++++++++++++++++++++---------
1 files changed, 62 insertions(+), 19 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 e6ebece..dd4509f 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
@@ -24,6 +24,7 @@
import com.smartor.service.*;
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.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@@ -43,6 +44,7 @@
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
+import java.time.LocalTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.*;
@@ -69,6 +71,9 @@
@Autowired
private IServiceSubtaskService iServiceSubtaskService;
+
+ @Autowired
+ private IServicePatientTempService iServicePatientTempService;
@Autowired
private PlatformTransactionManager transactionManager;
@@ -117,6 +122,9 @@
@Autowired
ISvyTaskTemplateService svyTaskTemplateService;
+
+ @Autowired
+ IIvrTaskTemplateService iIvrTaskTemplateService;
@Value("${hosp_info_url}")
private String hospInfoUrl;
@@ -187,8 +195,13 @@
//灏嗘偅鑰呬俊鎭�佸嚭闄€�侀棬璇婃暟鎹叏閮ㄩ噰闆�
// 鑾峰彇褰撳墠鏃ユ湡鍜屾椂闂�
LocalDateTime endTime = LocalDateTime.now();
+ endTime = endTime.with(LocalTime.MIN);
+// String dateStr = "2024/11/30 00:00:00";
+// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
+// LocalDateTime endTime = LocalDateTime.parse(dateStr, formatter);
// 鑾峰彇鍓嶄竴澶╃殑鏃ユ湡鍜屾椂闂�
LocalDateTime startTime = endTime.minusDays(1);
+ startTime = startTime.with(LocalTime.MIN);
getInHospInfo("0", startTime, endTime);
getInHospInfo("1", startTime, endTime);
@@ -225,7 +238,18 @@
}
/**
- * 闀挎湡浠诲姟鎵ц
+ * 澶勭悊鎮h�呬俊鎭紝杩涘叆瀛愪换鍔¤〃(寰俊灏忕▼搴�)
+ */
+ public void dealOutHospInfoXHC() {
+ PatMedInhosp patMedInhosp = new PatMedInhosp();
+ //鑾峰彇鏈鐞嗙殑鏁版嵁
+ List<ServicePatientTemp> servicePatientTemps = iServicePatientTempService.selectServicePatientTempList(new ServicePatientTemp());
+
+ }
+
+
+ /**
+ * 闀挎湡浠诲姟鎵ц锛堢數璇濓級
*/
public void longTaskSend() {
//鑾峰彇浠诲姟淇℃伅
@@ -298,17 +322,17 @@
//璇存槑鏄珛鍗冲彂閫�(鍏堟妸娑堟伅鏀惧埌cache-0涓紝 displayNo涓嶇煡閬撴�庝箞閰嶇疆)
if (dateToday) {
try {
- ServiceSubtaskVO serviceSubtask1 = new ServiceSubtaskVO();
- serviceSubtask1.setTaskid(ivrTask.getTaskid());
- List<ServiceSubtask> selectServiceSubtaskList1 = iServiceSubtaskService.selectServiceSubtaskList(serviceSubtask1);
- for (ServiceSubtask serviceSubtask2 : selectServiceSubtaskList1) {
- if (StringUtils.isEmpty(value)) {
- value = "," + serviceSubtask2.getId().toString() + ",";
- } else {
- if (!value.contains("," + serviceSubtask2.getId().toString()))
- value = value + "," + serviceSubtask2.getId().toString() + ",";
- }
+// ServiceSubtaskVO serviceSubtask1 = new ServiceSubtaskVO();
+// serviceSubtask1.setTaskid(ivrTask.getTaskid());
+// List<ServiceSubtask> selectServiceSubtaskList1 = iServiceSubtaskService.selectServiceSubtaskList(serviceSubtask1);
+// for (ServiceSubtask serviceSubtask2 : selectServiceSubtaskList1) {
+ if (StringUtils.isEmpty(value)) {
+ value = "," + serviceSubtask.getId().toString() + ",";
+ } else {
+ if (!value.contains("," + serviceSubtask.getId().toString()))
+ value = value + "," + serviceSubtask.getId().toString() + ",";
}
+// }
} catch (Exception e) {
String guid = UUID.randomUUID().toString();
log.error("闀挎湡浠诲姟锛岀數璇濆彂閫佸け璐ュ師鍥狅細{},{}", e.getMessage(), guid);
@@ -323,7 +347,7 @@
//鍦ㄥ瓙浠诲姟琛ㄩ噷璁板綍涓�涓�
String uuid = UUID.randomUUID().toString();
serviceSubtask.setResult("success");
- serviceSubtask.setRemark("鐢佃瘽鍙戦�佹垚鍔�");
+ serviceSubtask.setRemark("闀挎湡浠诲姟锛岀數璇濊繘鍏ラ槦鍒楁垚鍔�");
serviceSubtask.setGuid(uuid);
serviceSubtask.setSendstate(3L);
serviceSubtask.setFinishtime(new Date());
@@ -337,7 +361,7 @@
serviceSubtaskRecord.setTasktype(serviceSubtask.getType());
serviceSubtaskRecord.setPreachform("3");
serviceSubtaskRecord.setStartTime(System.currentTimeMillis());
- serviceSubtaskRecord.setRemark("鐢佃瘽鍙戦�佹垚鍔�");
+ serviceSubtaskRecord.setRemark("闀挎湡浠诲姟锛岀數璇濊繘鍏ラ槦鍒楁垚鍔�");
serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord);
}
@@ -355,6 +379,13 @@
//澶氬獟浣�
} else if (descByCode.equals("绾歌川")) {
//绾歌川
+ } else if (descByCode.equals("寰俊灏忕▼搴�")) {
+ //寰俊灏忕▼搴�
+ for (ServiceSubtask serviceSubtask : selectServiceSubtaskList) {
+ log.error("寰俊灏忕▼搴忔湡浠诲姟鍙戦��---------杩涙潵浜嗗悧锛焮}", serviceSubtask);
+
+
+ }
} else if (descByCode.equals("鐭俊")) {
RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
String taskId = rsaPublicKeyExample.encryptedData(ivrTask1.getTaskid().toString(), pub_key);
@@ -410,6 +441,7 @@
serviceSubtask.setSendstate(3L);
if (StringUtils.isNotEmpty(isSuccess) && !isSuccess.equals("true")) {
serviceSubtask.setResult("success");
+ serviceSubtask.setRemark("鐭俊鍙戦�佹垚鍔�");
} else {
serviceSubtask.setResult("error");
serviceSubtask.setSendstate(5L);
@@ -506,8 +538,8 @@
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.S");
Map<String, String> req = new HashMap<>();
if (cry.equals("1")) {
- req.put("startTime", startTime.format(formatter));
- req.put("endTime", endTime.format(formatter));
+ req.put("cashStartDate", startTime.format(formatter));
+ req.put("cashEndDate", endTime.format(formatter));
req.put("currStatus", "4");
} else if (cry.equals("0")) {
req.put("admissStartDate", startTime.format(formatter));
@@ -576,7 +608,7 @@
patArchive.setNotrequiredreason(thiedInhospInfo.getOutWayName());
}
if (cry.equals("1") && StringUtils.isEmpty(thiedInhospInfo.getOutWayId())) {
- //濡傛灉涓�4灏辨槸姝讳骸
+ //鍑洪櫌鏂瑰紡涓虹┖
patArchive.setNotrequiredFlag("1");
patArchive.setNotrequiredreason("鍑洪櫌鏂瑰紡涓虹┖");
}
@@ -604,7 +636,9 @@
patArchive.setName(thiedInhospInfo.getPatiRecordName());
patArchiveService.insertPatArchive(patArchive);
} else {
- patArchive = patArchives.get(0);
+ patArchive.setId(patArchives.get(0).getId());
+ patArchiveService.update(patArchive);
+// patArchive = patArchives.get(0);
}
log.error("鍏ュ弬鐨刾atArchive锛歿}", patArchive);
@@ -630,8 +664,8 @@
e.printStackTrace();
}
try {
- if (StringUtils.isNotEmpty(thiedInhospInfo.getOutDate()))
- patMedInhosp.setEndtime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(thiedInhospInfo.getOutDate()));
+ if (StringUtils.isNotEmpty(thiedInhospInfo.getCashDate()))
+ patMedInhosp.setEndtime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(thiedInhospInfo.getCashDate()));
} catch (ParseException e) {
e.printStackTrace();
}
@@ -666,8 +700,10 @@
log.error("鏄惁闇�瑕佹洿鏂帮細{}", patMedInhosps.size());
if (CollectionUtils.isNotEmpty(patMedInhosps)) {
patMedInhosp.setInhospid(patMedInhosps.get(0).getInhospid());
+ log.error("------鎮h�呭嚭鍏ラ櫌淇敼淇℃伅锛歿}", patMedInhosp);
patMedInhospService.updatePatMedInhosp(patMedInhosp);
} else {
+ log.error("----鎮h�呭嚭鍏ラ櫌鏂板淇℃伅锛歿}", patMedInhosp);
patMedInhospService.insertPatMedInhosp(patMedInhosp);
}
@@ -719,4 +755,11 @@
// String code = (String) jsonObject.get("code");
return jsonObject.toString();
}
+
+// public static void main(String[] args) {
+// LocalDateTime originalDateTime = LocalDateTime.now();
+// LocalDateTime startOfDay = originalDateTime.with(LocalTime.MIN);
+// System.out.println("Original DateTime: " + originalDateTime);
+// System.out.println("Start of Day: " + startOfDay);
+// }
}
--
Gitblit v1.9.3