From cd8795008a6c7cf0046ecb7ee794e43032bfb798 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期日, 27 四月 2025 18:37:39 +0800
Subject: [PATCH] 代码提交
---
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java | 81 ++++++++++++++++++++++++++++++++--------
1 files changed, 64 insertions(+), 17 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 30d1d81..537d205 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;
@@ -71,6 +72,9 @@
private IPatMedInhospService iPatMedInhospService;
@Autowired
+ private IPatMedOuthospService iPatMedOuthospService;
+
+ @Autowired
private IPatMedOperationService iPatMedOperationService;
@Autowired
@@ -99,6 +103,9 @@
@Value("${req_path}")
private String req_path;
+
+ @Value("${visitHosp}")
+ private Integer visitHosp;
@Autowired
private ServiceTaskMapper serviceTaskMapper;
@@ -132,6 +139,9 @@
@Value("${hosp_info_url}")
private String hospInfoUrl;
+
+ @Value("${appid}")
+ private String appid;
public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) {
System.out.println(StringUtils.format("鎵ц澶氬弬鏂规硶锛� 瀛楃涓茬被鍨媨}锛屽竷灏旂被鍨媨}锛岄暱鏁村瀷{}锛屾诞鐐瑰瀷{}锛屾暣褰}", s, b, l, d, i));
@@ -219,7 +229,7 @@
public void dealHisData2() {
//灏嗘偅鑰呬俊鎭�佸嚭闄€�侀棬璇婃暟鎹叏閮ㄩ噰闆�
// 鎸囧畾鐨勫紑濮嬫棩鏈�
- LocalDate endDate = LocalDate.of(2024, 9, 1);
+ LocalDate endDate = LocalDate.of(2025, 3, 3);
// 褰撳墠鏃ユ湡
LocalDate currentDate = LocalDate.now();
// 瀹氫箟鏃ユ湡鏍煎紡
@@ -238,7 +248,12 @@
* 澶勭悊鎮h�呬俊鎭紝杩涘叆瀛愪换鍔¤〃
*/
public void dealOutHospInfo() {
+ //鍑洪櫌琛�
iPatMedInhospService.dealOutHospInfo();
+ //闂ㄨ瘖琛�
+ if (visitHosp != 1) {
+ iPatMedOuthospService.dealOutpatientInfo();
+ }
}
@@ -334,6 +349,14 @@
//濡備綍浠诲姟琚�滄殏鍋溾�濇垨鈥滅粓姝⑩��
break;
}
+ if (org.apache.commons.lang3.StringUtils.isEmpty(serviceSubtask.getPhone())) {
+ serviceSubtask.setRemark("鎵嬫満鍙蜂负绌�");
+ serviceSubtask.setSendstate(4L);
+ serviceSubtask.setResult("error");
+ serviceSubtask.setFinishtime(new Date());
+ serviceSubtaskMapper.updateServiceSubtask(serviceSubtask);
+ continue;
+ }
boolean dateToday = isDateToday(serviceSubtask.getLongSendTime());
//璇存槑鏄珛鍗冲彂閫�(鍏堟妸娑堟伅鏀惧埌cache-0涓紝 displayNo涓嶇煡閬撴�庝箞閰嶇疆)
if (dateToday) {
@@ -369,7 +392,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());
@@ -389,9 +413,24 @@
//灏嗗瓙浠诲姟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());
+ ssvo.setSendname(serviceSubtask.getSendname());
+ ssvo.setSfzh(serviceSubtask.getSfzh());
+ List<ServiceSubtask> serviceSubtaskListByCreateTime = serviceSubtaskMapper.selectServiceSubtaskListByCreateTime(ssvo);
+ if (CollectionUtils.isEmpty(serviceSubtaskListByCreateTime))
+ serviceSubtaskMapper.insertServiceSubtask(serviceSubtask);
}
}
} else if (descByCode.equals("鐭俊")) {
@@ -414,12 +453,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());
@@ -492,7 +533,10 @@
String patid = rsaPublicKeyExample.encryptedData(serviceSubtask.getPatid().toString(), pub_key);
String url = null;
url = ip + ":" + req_path + "/outsideChainwt?param1=" + taskId + "¶m2=" + patid + "¶m3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "¶m5=false";
- String wxCode = getWXCode(serviceSubtask.getSfzh(), url, serviceSubtask.getTaskName(), serviceSubtask.getTaskDesc(), "鏃�");
+// String wxCode = getWXCode(serviceSubtask.getSfzh(), url, serviceSubtask.getTaskName(), serviceSubtask.getTaskDesc(), "鏃�");
+
+ String wxCode = getWXCode(serviceSubtask.getSfzh(), url, serviceSubtask.getTaskName(), serviceSubtask.getTaskDesc(), patArchive.getTelcode(), serviceSubtask.getSendname(), patArchive.getPatientno());
+
Map<String, Object> map = JSONObject.parseObject(wxCode, Map.class);
//浠诲姟鍙戦�佽褰�
@@ -573,7 +617,7 @@
String filename = null;
if (cry.equals("0")) filename = "鍏ラ櫌淇℃伅" + System.currentTimeMillis();
if (cry.equals("1")) filename = "鍑洪櫌淇℃伅" + System.currentTimeMillis();
- File file = new File("D:\\public\\鍗庡崜闆嗘垚骞冲彴鏁版嵁\\" + filename);
+ File file = new File("D:\\public\\HIS鏁版嵁閲囬泦\\" + filename);
if (!file.exists()) {
// 濡傛灉鏂囦欢涓嶅瓨鍦紝鍒欏垱寤烘柊鏂囦欢
try {
@@ -623,10 +667,10 @@
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()));
+ patArchive.setBirthdate(new SimpleDateFormat("yyyy-MM-dd").parse(thiedInhospInfo.getPatiBirthday()));
} catch (ParseException e) {
e.printStackTrace();
}
@@ -655,6 +699,7 @@
patMedInhosp.setNurseId(thiedInhospInfo.getNurseId());
patMedInhosp.setNurseName(thiedInhospInfo.getNurseName());
patMedInhosp.setSerialnum(thiedInhospInfo.getInpatientId());
+ patMedInhosp.setFuflag("1");
if (cry.equals("0")) {
patMedInhosp.setInhospstate("0");
} else if (cry.equals("1")) {
@@ -698,6 +743,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());
@@ -746,22 +792,23 @@
return key;
}
- private String getWXCode(String idcard, String url, String taskName, String taskDesc, String submitprompt) {
+ private String getWXCode(String idcard, String url, String taskName, String taskDesc, String phone, String setPatientname, String setPatientid) {
XinHuaWXReq xinHuaWXReq = new XinHuaWXReq();
xinHuaWXReq.setIdcard(idcard);
xinHuaWXReq.setUrl(url);
- xinHuaWXReq.setKeyword1("娴欎腑鍖诲ぇ浜岄櫌鍑洪櫌闅忚");
- xinHuaWXReq.setKeyword2(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
- xinHuaWXReq.setKeyword3(taskName);
- xinHuaWXReq.setKeyword4("鐤剧梾搴峰娉ㄦ剰浜嬮」");
-
+ xinHuaWXReq.setPatientid(setPatientid);
+ xinHuaWXReq.setPatientname(setPatientname);
+ xinHuaWXReq.setMobile(phone);
+ xinHuaWXReq.setMedcardno(null);
+ xinHuaWXReq.setTitlename(taskName);
+ xinHuaWXReq.setContent(taskDesc);
+ xinHuaWXReq.setAppid(appid);
+ log.error("----getWXCode---xinHuaWXReq鐨勫嚭鍙備负锛歿}", xinHuaWXReq);
String result = HttpUtils.sendPost(thirdWXUrl, new Gson().toJson(xinHuaWXReq));
JSONObject jsonObject = JSONObject.parseObject(result);
- log.error("jsonObject鐨勬暟鎹负锛歿}", jsonObject.toString());
-// String code = (String) jsonObject.get("code");
- return jsonObject.toString();
+ String code = (String) jsonObject.toString();
+ return code;
}
-
// public static void main(String[] args) {
// LocalDateTime originalDateTime = LocalDateTime.now();
// LocalDateTime startOfDay = originalDateTime.with(LocalTime.MIN);
--
Gitblit v1.9.3