From 1ccb709f723a759597dcdc7239d8885cef84d3ce Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期三, 04 十二月 2024 17:56:19 +0800
Subject: [PATCH] 代码提交

---
 smartor/src/main/java/com/smartor/mapper/ServicePatientTempMapper.java                       |   63 ++++
 smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java                  |    2 
 ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java                                 |  145 ++++++++++
 smartor/src/main/resources/mapper/smartor/ServicePatientTempMapper.xml                       |  158 ++++++++++++
 smartor/src/main/java/com/smartor/domain/ServicePatientTemp.java                             |   81 ++++++
 smartor/src/main/java/com/smartor/service/IServicePatientTempService.java                    |   61 ++++
 ruoyi-admin/src/main/resources/application-druid.yml                                         |    4 
 smartor/src/main/java/com/smartor/domain/ThiedInhospInfo.java                                |    7 
 ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml                       |    5 
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServicePatientTempController.java |  109 ++++++++
 smartor/src/main/java/com/smartor/service/impl/ServicePatientTempServiceImpl.java            |   96 +++++++
 11 files changed, 714 insertions(+), 17 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServicePatientTempController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServicePatientTempController.java
new file mode 100644
index 0000000..e073a10
--- /dev/null
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServicePatientTempController.java
@@ -0,0 +1,109 @@
+package com.ruoyi.web.controller.smartor;
+
+import java.util.List;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.smartor.domain.ServicePatientTemp;
+import com.smartor.service.IServicePatientTempService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 銆愭偅鑰呮ā鏉垮叧鑱斻�慍ontroller
+ *
+ * @author lihu
+ * @date 2024-12-03
+ */
+@Api("鎮h�呮ā鏉垮叧鑱�")
+@RestController
+@RequestMapping("/smartor/tempxch")
+public class ServicePatientTempController extends BaseController {
+    @Autowired
+    private IServicePatientTempService servicePatientTempService;
+
+    /**
+     * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛�
+     */
+    @ApiOperation("鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛�")
+    //@PreAuthorize("@ss.hasPermi('smartor:temp:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(ServicePatientTemp servicePatientTemp) {
+        startPage();
+        List<ServicePatientTemp> list = servicePatientTempService.selectServicePatientTempList(servicePatientTemp);
+        return getDataTable(list);
+    }
+
+    /**
+     * 瀵煎嚭銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛�
+     */
+    @ApiOperation("瀵煎嚭銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛�")
+    //@PreAuthorize("@ss.hasPermi('smartor:temp:export')")
+    @Log(title = "銆愯濉啓鍔熻兘鍚嶇О銆�", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, ServicePatientTemp servicePatientTemp) {
+        List<ServicePatientTemp> list = servicePatientTempService.selectServicePatientTempList(servicePatientTemp);
+        ExcelUtil<ServicePatientTemp> util = new ExcelUtil<ServicePatientTemp>(ServicePatientTemp.class);
+        util.exportExcel(response, list, "銆愯濉啓鍔熻兘鍚嶇О銆戞暟鎹�");
+    }
+
+    /**
+     * 鑾峰彇銆愯濉啓鍔熻兘鍚嶇О銆戣缁嗕俊鎭�
+     */
+    @ApiOperation("鑾峰彇銆愯濉啓鍔熻兘鍚嶇О銆戣缁嗕俊鎭�")
+    //@PreAuthorize("@ss.hasPermi('smartor:temp:query')")
+    @GetMapping(value = "/getInfo/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return success(servicePatientTempService.selectServicePatientTempById(id));
+    }
+
+    /**
+     * 鏂板銆愯濉啓鍔熻兘鍚嶇О銆�
+     */
+    @ApiOperation("鏂板銆愯濉啓鍔熻兘鍚嶇О銆�")
+    //@PreAuthorize("@ss.hasPermi('smartor:temp:add')")
+    @Log(title = "銆愯濉啓鍔熻兘鍚嶇О銆�", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    public AjaxResult add(@RequestBody ServicePatientTemp servicePatientTemp) {
+        return toAjax(servicePatientTempService.insertServicePatientTemp(servicePatientTemp));
+    }
+
+    /**
+     * 淇敼銆愯濉啓鍔熻兘鍚嶇О銆�
+     */
+    @ApiOperation("淇敼銆愯濉啓鍔熻兘鍚嶇О銆�")
+    //@PreAuthorize("@ss.hasPermi('smartor:temp:edit')")
+    @Log(title = "銆愯濉啓鍔熻兘鍚嶇О銆�", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    public AjaxResult edit(@RequestBody ServicePatientTemp servicePatientTemp) {
+        return toAjax(servicePatientTempService.updateServicePatientTemp(servicePatientTemp));
+    }
+
+    /**
+     * 鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆�
+     */
+    @ApiOperation("鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆�")
+    //@PreAuthorize("@ss.hasPermi('smartor:temp:remove')")
+    @Log(title = "銆愯濉啓鍔熻兘鍚嶇О銆�", businessType = BusinessType.DELETE)
+    @GetMapping("/remove/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(servicePatientTempService.deleteServicePatientTempByIds(ids));
+    }
+}
diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml
index e3166a7..2459146 100644
--- a/ruoyi-admin/src/main/resources/application-druid.yml
+++ b/ruoyi-admin/src/main/resources/application-druid.yml
@@ -170,9 +170,9 @@
 app_key_yq: ZurNHpaQLq6P55YS
 
 #鏈� 鍦� 鐭俊璇锋眰鍦板潃(杩欎釜鏈嶅姟鏄垜浠嚜宸卞啓鐨�)
-#xhsmsPath: http://192.168.2.13:8092/sendSms
+xhsmsPath: http://192.168.2.13:8092/sendSms
 #鏂板崕鐭俊璇锋眰鍦板潃(杩欎釜鏈嶅姟鏄垜浠嚜宸卞啓鐨�)
-xhsmsPath: http://192.16.4.220:8092/sendSms
+#xhsmsPath: http://192.16.4.220:8092/sendSms
 #甯愬彿
 xhsmsAccount: 911124
 #鎺ュ彛瀵嗙爜
diff --git a/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml b/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml
index c946c09..65cfcd6 100644
--- a/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml
+++ b/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml
@@ -60,7 +60,6 @@
     <select id="selectGenTableList" parameterType="GenTable" resultMap="GenTableResult">
 		<include refid="selectGenTableVo"/>
 		<where>
-			del_flag= 0
 			<if test="tableName != null and tableName != ''">
 				AND lower(table_name) like lower(concat('%', #{tableName}, '%'))
 			</if>
@@ -116,7 +115,7 @@
 			   c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
 		FROM gen_table t
 			 LEFT JOIN gen_table_column c ON t.table_id = c.table_id
-		where del_flag= 0 and t.table_id = #{tableId} order by c.sort
+		where  t.table_id = #{tableId} order by c.sort
 	</select>
 
 	<select id="selectGenTableByName" parameterType="String" resultMap="GenTableResult">
@@ -190,7 +189,7 @@
             <if test="remark != null">remark = #{remark},</if>
             update_time = sysdate()
         </set>
-        where table_id = #{tableId} and del_flag= 0
+        where table_id = #{tableId}
     </update>
 
     <delete id="deleteGenTableByIds" parameterType="Long">
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 32064d9..3d8dfb0 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);
 
@@ -224,8 +237,102 @@
         iPatMedInhospService.dealOutHospInfo();
     }
 
+//    /**
+//     * 澶勭悊鎮h�呬俊鎭紝杩涘叆瀛愪换鍔¤〃(寰俊灏忕▼搴�)
+//     */
+//    public void dealOutHospInfoXHC() {
+//        PatMedInhosp patMedInhosp = new PatMedInhosp();
+//        //鑾峰彇鏈鐞嗙殑鏁版嵁
+//        List<ServicePatientTemp> servicePatientTemps = iServicePatientTempService.selectServicePatientTempList(new ServicePatientTemp());
+//
+//        for (ServicePatientTemp servicePatientTemp : servicePatientTemps) {
+//            Long tid = null;
+//            if (servicePatientTemp.getType() != null && servicePatientTemp.getType() == 1) {
+//                IvrTaskTemplate ivrTaskTemplate = iIvrTaskTemplateService.selectIvrTaskTemplateByID(servicePatientTemp.getTempId());
+//                tid = ivrTaskTemplate.getTaskid();
+//            } else if (servicePatientTemp.getType() != null && servicePatientTemp.getType() == 2) {
+//                SvyTaskTemplate svyTaskTemplate = svyTaskTemplateService.selectSvyTaskTemplateBySvyid(servicePatientTemp.getTempId());
+//                tid = svyTaskTemplate.getTaskid();
+//            }
+//
+//            ServiceTask serviceTask = serviceTaskMapper.selectServiceTaskByTaskid(tid);
+//            ServiceSubtask serviceSubtask = DtoConversionUtils.sourceToTarget(serviceTask, ServiceSubtask.class);
+//            serviceSubtask.setTaskid(serviceTask.getTaskid());
+//            serviceSubtask.setTemplateid(servicePatientTemp.getTempId());
+//            serviceSubtask.setTemplatename(stt.getTemplateName());
+//            serviceSubtask.setPatid(patArchive.getId());
+//            serviceSubtask.setSendname(patArchive.getName());
+//            serviceSubtask.setSfzh(patArchive.getIdcardno());
+//            serviceSubtask.setPhone(patArchive.getTelcode());
+//            serviceSubtask.setSex(patArchive.getSex());
+//            serviceSubtask.setAge(patArchive.getAge());
+//            serviceSubtask.setSendstate(2L);
+//            serviceSubtask.setStarttime(patMedInhosp1.getStarttime());
+//            serviceSubtask.setEndtime(patMedInhosp1.getEndtime());
+//            serviceSubtask.setServiceType("2");
+//            serviceSubtask.setPreachform(serviceTask.getPreachform());
+//            serviceSubtask.setHospType("2");
+//            serviceSubtask.setCreateTime(new Date());
+//            serviceSubtask.setUpdateTime(new Date());
+//            serviceSubtask.setCreateBy(patMedInhosp1.getNurseName());
+//            serviceSubtask.setLeavehospitaldistrictcode(patMedInhosp1.getLeavehospitaldistrictcode());
+//            serviceSubtask.setLeavehospitaldistrictname(patMedInhosp1.getLeavehospitaldistrictname());
+//            //璁剧疆鍙戦�佹椂闂�
+//            Date newDate = addDays(patMedInhosp1.getEndtime(), stt.getSendDay());
+//            serviceSubtask.setLongSendTime(newDate);
+//            //鎮h�呭彂閫佹椂闂�
+//            if (StringUtils.isNotEmpty(patArchive.getNotrequiredFlag()) && patArchive.getNotrequiredFlag().equals("1")) {
+//                remark = patArchive.getNotrequiredreason();
+//                serviceSubtask.setRemark(remark);
+//                serviceSubtask.setResult("error");
+//                serviceSubtask.setFinishtime(new Date());
+//                //涓嶆墽琛�
+//                serviceSubtask.setSendstate(4L);
+//            }
+//
+//            //鍦ㄦ柊澧炰箣鍓嶏紝鍏堥�氳繃鎮h�匢D锛宻endstate=2鏌ヨ涓�涓嬶紝鍦ㄦ墍鏈夐暱鏈熶换鍔′腑锛屾槸涓嶆槸杩樻湁璇ユ偅鑰呭緟鎵ц鐨勪换鍔★紝鏈夌殑璇�,姣旇緝涔嬪墠鐨別ndtime鏄惁灏忎簬褰撳墠鐨別ndtaime,濡傛灉涔嬪墠鐨勫皬浜庣幇鍦ㄧ殑锛屽垯鐩存帴灏嗕箣鍓嶇殑鍋滄帀锛堝師鍥犲啀鍏ラ櫌锛�
+//            ServiceSubtaskVO subtask = new ServiceSubtaskVO();
+//            subtask.setPatid(patArchive.getId());
+//            subtask.setSendstate(2L);
+//            List<ServiceSubtask> selectServiceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(subtask);
+//            log.error("璇ユ偅鑰呭緟鎵ц鐨勪换鍔�:{}", selectServiceSubtaskList);
+//            if (CollectionUtils.isNotEmpty(selectServiceSubtaskList) && selectServiceSubtaskList.size() > 0) {
+//                for (ServiceSubtask serviceSubtask1 : selectServiceSubtaskList) {
+//                    if (Objects.isNull(serviceSubtask1.getLongSendTime())) {
+//                        //涓嶆槸闀挎湡浠诲姟锛屼笉澶勭悊
+//                        continue;
+//                    }
+//                    if (serviceSubtask1.getEndtime().before(serviceSubtask.getEndtime())) {
+//                        //濡傛灉褰撳墠寰幆鐨勫瓙浠诲姟鐨勫嚭闄㈡椂闂村湪鈥滃噯澶囨柊澧炵殑瀛愪换鍔♀�濈殑鍑洪櫌鏃堕棿涔嬪墠锛屽垯灏嗗惊鐜殑瀛愪换鍔″仠鎺�
+//                        serviceSubtask1.setSendstate(4L);
+//                        serviceSubtask1.setRemark("鎮h�呭啀鍏ラ櫌");
+//                        serviceSubtask1.setResult("error");
+//                        serviceSubtask1.setFinishtime(new Date());
+//                        serviceSubtaskMapper.updateServiceSubtask(serviceSubtask1);
+//                    } else {
+//                        //鐩稿弽,鍒欏皢褰撴湁鐨勬暟鎹仠鎺�
+//                        serviceSubtask.setResult("error");
+//                        serviceSubtask.setFinishtime(new Date());
+//                        serviceSubtask.setSendstate(4L);
+//                        serviceSubtask.setRemark("鎮h�呭啀鍏ラ櫌");
+//                    }
+//                }
+//            }
+//
+//            serviceSubtaskMapper.insertServiceSubtask(serviceSubtask);
+//            //灏哻heck_flag鏀规垚1锛堝凡澶勭悊锛�
+//            PatMedInhosp patMedInhosp2 = new PatMedInhosp();
+//            patMedInhosp2.setInhospid(patMedInhosp1.getInhospid());
+//            patMedInhosp2.setCheckFlag("1");
+//            patMedInhospMapper.updatePatMedInhosp(patMedInhosp2);
+//        }
+//
+//        return 1;
+//    }
+
+
     /**
-     * 闀挎湡浠诲姟鎵ц
+     * 闀挎湡浠诲姟鎵ц锛堢數璇濓級
      */
     public void longTaskSend() {
         //鑾峰彇浠诲姟淇℃伅
@@ -302,12 +409,12 @@
 //                                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() + ",";
-                                    }
+                                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();
@@ -355,6 +462,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);
@@ -507,8 +621,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));
@@ -631,8 +745,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();
                 }
@@ -667,8 +781,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);
                 }
 
@@ -720,4 +836,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);
+//    }
 }
diff --git a/smartor/src/main/java/com/smartor/domain/ServicePatientTemp.java b/smartor/src/main/java/com/smartor/domain/ServicePatientTemp.java
new file mode 100644
index 0000000..3b18390
--- /dev/null
+++ b/smartor/src/main/java/com/smartor/domain/ServicePatientTemp.java
@@ -0,0 +1,81 @@
+package com.smartor.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 銆愯濉啓鍔熻兘鍚嶇О銆戝璞� service_patient_temp
+ *
+ * @author lihu
+ * @date 2024-12-03
+ */
+@Data
+@ApiModel("銆愯濉啓鍔熻兘鍚嶇О銆�")
+public class ServicePatientTemp extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * $column.columnComment
+     */
+    @ApiModelProperty("$column.columnComment")
+    //鏁版嵁搴撹嚜澧炴敼鎴怈TableId(type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 鎮h�匢D
+     */
+    @ApiModelProperty("鎮h�匢D")
+    @Excel(name = "鎮h�匢D")
+    private Long userId;
+
+    /**
+     * 妯℃澘ID
+     */
+    @ApiModelProperty("妯℃澘ID")
+    @Excel(name = "妯℃澘ID")
+    private Long tempId;
+
+    /**
+     * 妯℃澘绫诲瀷:    1:ivr    2:svy
+     */
+    @ApiModelProperty("妯℃澘绫诲瀷:    1:ivr    2:svy")
+    @Excel(name = "妯℃澘绫诲瀷:    1:ivr    2:svy")
+    private Integer type;
+
+    /**
+     * 寮�濮嬫椂闂�
+     */
+    @ApiModelProperty("寮�濮嬫椂闂�")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "寮�濮嬫椂闂�", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date startTime;
+
+    /**
+     * 缁撴潫鏃堕棿
+     */
+    @ApiModelProperty("缁撴潫鏃堕棿")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "缁撴潫鏃堕棿", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date endTime;
+
+    /**
+     * 闂撮殧澶╂暟
+     */
+    @ApiModelProperty("闂撮殧澶╂暟")
+    @Excel(name = "闂撮殧澶╂暟")
+    private Long dayNum;
+
+    /**
+     * 0鏈垹闄�    1鍒犻櫎
+     */
+    @ApiModelProperty("0鏈垹闄�    1鍒犻櫎")
+    private String delFlag;
+
+}
+
diff --git a/smartor/src/main/java/com/smartor/domain/ThiedInhospInfo.java b/smartor/src/main/java/com/smartor/domain/ThiedInhospInfo.java
index 8987dd5..8a32f46 100644
--- a/smartor/src/main/java/com/smartor/domain/ThiedInhospInfo.java
+++ b/smartor/src/main/java/com/smartor/domain/ThiedInhospInfo.java
@@ -449,6 +449,13 @@
     private String preoutDate;
 
     /**
+     * 缁撹处鏃ユ湡
+     */
+    @ApiModelProperty("缁撹处鏃ユ湡")
+    @Excel(name = "缁撹处鏃ユ湡")
+    private String cashDate;
+
+    /**
      * 鐥呬汉鍑洪櫌鏃ユ湡
      */
     @ApiModelProperty("鐥呬汉鍑洪櫌鏃ユ湡")
diff --git a/smartor/src/main/java/com/smartor/mapper/ServicePatientTempMapper.java b/smartor/src/main/java/com/smartor/mapper/ServicePatientTempMapper.java
new file mode 100644
index 0000000..5c987eb
--- /dev/null
+++ b/smartor/src/main/java/com/smartor/mapper/ServicePatientTempMapper.java
@@ -0,0 +1,63 @@
+package com.smartor.mapper;
+
+import java.util.List;
+import org.apache.ibatis.annotations.Mapper;
+import com.smartor.domain.ServicePatientTemp;
+
+/**
+ * 銆愯濉啓鍔熻兘鍚嶇О銆慚apper鎺ュ彛
+ *
+ * @author lihu
+ * @date 2024-12-03
+ */
+@Mapper
+public interface ServicePatientTempMapper
+{
+    /**
+     * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆�
+     *
+     * @param id 銆愯濉啓鍔熻兘鍚嶇О銆戜富閿�
+     * @return 銆愯濉啓鍔熻兘鍚嶇О銆�
+     */
+    public ServicePatientTemp selectServicePatientTempById(Long id);
+
+    /**
+     * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛�
+     *
+     * @param servicePatientTemp 銆愯濉啓鍔熻兘鍚嶇О銆�
+     * @return 銆愯濉啓鍔熻兘鍚嶇О銆戦泦鍚�
+     */
+    public List<ServicePatientTemp> selectServicePatientTempList(ServicePatientTemp servicePatientTemp);
+
+    /**
+     * 鏂板銆愯濉啓鍔熻兘鍚嶇О銆�
+     *
+     * @param servicePatientTemp 銆愯濉啓鍔熻兘鍚嶇О銆�
+     * @return 缁撴灉
+     */
+    public int insertServicePatientTemp(ServicePatientTemp servicePatientTemp);
+
+    /**
+     * 淇敼銆愯濉啓鍔熻兘鍚嶇О銆�
+     *
+     * @param servicePatientTemp 銆愯濉啓鍔熻兘鍚嶇О銆�
+     * @return 缁撴灉
+     */
+    public int updateServicePatientTemp(ServicePatientTemp servicePatientTemp);
+
+    /**
+     * 鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆�
+     *
+     * @param id 銆愯濉啓鍔熻兘鍚嶇О銆戜富閿�
+     * @return 缁撴灉
+     */
+    public int deleteServicePatientTempById(Long id);
+
+    /**
+     * 鎵归噺鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆�
+     *
+     * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁涓婚敭闆嗗悎
+     * @return 缁撴灉
+     */
+    public int deleteServicePatientTempByIds(Long[] ids);
+}
diff --git a/smartor/src/main/java/com/smartor/service/IServicePatientTempService.java b/smartor/src/main/java/com/smartor/service/IServicePatientTempService.java
new file mode 100644
index 0000000..5ba16f0
--- /dev/null
+++ b/smartor/src/main/java/com/smartor/service/IServicePatientTempService.java
@@ -0,0 +1,61 @@
+package com.smartor.service;
+
+import java.util.List;
+import com.smartor.domain.ServicePatientTemp;
+
+/**
+ * 銆愯濉啓鍔熻兘鍚嶇О銆慡ervice鎺ュ彛
+ * 
+ * @author lihu
+ * @date 2024-12-03
+ */
+public interface IServicePatientTempService 
+{
+    /**
+     * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆�
+     * 
+     * @param id 銆愯濉啓鍔熻兘鍚嶇О銆戜富閿�
+     * @return 銆愯濉啓鍔熻兘鍚嶇О銆�
+     */
+    public ServicePatientTemp selectServicePatientTempById(Long id);
+
+    /**
+     * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛�
+     * 
+     * @param servicePatientTemp 銆愯濉啓鍔熻兘鍚嶇О銆�
+     * @return 銆愯濉啓鍔熻兘鍚嶇О銆戦泦鍚�
+     */
+    public List<ServicePatientTemp> selectServicePatientTempList(ServicePatientTemp servicePatientTemp);
+
+    /**
+     * 鏂板銆愯濉啓鍔熻兘鍚嶇О銆�
+     * 
+     * @param servicePatientTemp 銆愯濉啓鍔熻兘鍚嶇О銆�
+     * @return 缁撴灉
+     */
+    public int insertServicePatientTemp(ServicePatientTemp servicePatientTemp);
+
+    /**
+     * 淇敼銆愯濉啓鍔熻兘鍚嶇О銆�
+     * 
+     * @param servicePatientTemp 銆愯濉啓鍔熻兘鍚嶇О銆�
+     * @return 缁撴灉
+     */
+    public int updateServicePatientTemp(ServicePatientTemp servicePatientTemp);
+
+    /**
+     * 鎵归噺鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆�
+     * 
+     * @param ids 闇�瑕佸垹闄ょ殑銆愯濉啓鍔熻兘鍚嶇О銆戜富閿泦鍚�
+     * @return 缁撴灉
+     */
+    public int deleteServicePatientTempByIds(Long[] ids);
+
+    /**
+     * 鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆戜俊鎭�
+     * 
+     * @param id 銆愯濉啓鍔熻兘鍚嶇О銆戜富閿�
+     * @return 缁撴灉
+     */
+    public int deleteServicePatientTempById(Long id);
+}
diff --git a/smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java
index d4e6cfb..b7d4855 100644
--- a/smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java
@@ -205,7 +205,7 @@
         patMedInhosp.setCheckFlag("0");
         patMedInhosp.setInhospstate("1");
         List<PatMedInhosp> patMedInhosps = patMedInhospMapper.selectPatMedInhospList(patMedInhosp);
-
+        log.error("dealOutHospInfo闇�瑕佸鐞嗙殑鍑洪櫌鎮h�呬俊鎭細{}", patMedInhosps);
         for (PatMedInhosp patMedInhosp1 : patMedInhosps) {
             //鏍规嵁鎮h�呮墍鍦ㄧ瀹わ紝鑾峰彇璇ョ瀹ょ殑闀挎湡浠诲姟妯℃澘
             Long taskid = null;
diff --git a/smartor/src/main/java/com/smartor/service/impl/ServicePatientTempServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/ServicePatientTempServiceImpl.java
new file mode 100644
index 0000000..f55ca43
--- /dev/null
+++ b/smartor/src/main/java/com/smartor/service/impl/ServicePatientTempServiceImpl.java
@@ -0,0 +1,96 @@
+package com.smartor.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.smartor.mapper.ServicePatientTempMapper;
+import com.smartor.domain.ServicePatientTemp;
+import com.smartor.service.IServicePatientTempService;
+
+/**
+ * 銆愯濉啓鍔熻兘鍚嶇О銆慡ervice涓氬姟灞傚鐞�
+ * 
+ * @author lihu
+ * @date 2024-12-03
+ */
+@Service
+public class ServicePatientTempServiceImpl implements IServicePatientTempService 
+{
+    @Autowired
+    private ServicePatientTempMapper servicePatientTempMapper;
+
+    /**
+     * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆�
+     * 
+     * @param id 銆愯濉啓鍔熻兘鍚嶇О銆戜富閿�
+     * @return 銆愯濉啓鍔熻兘鍚嶇О銆�
+     */
+    @Override
+    public ServicePatientTemp selectServicePatientTempById(Long id)
+    {
+        return servicePatientTempMapper.selectServicePatientTempById(id);
+    }
+
+    /**
+     * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛�
+     * 
+     * @param servicePatientTemp 銆愯濉啓鍔熻兘鍚嶇О銆�
+     * @return 銆愯濉啓鍔熻兘鍚嶇О銆�
+     */
+    @Override
+    public List<ServicePatientTemp> selectServicePatientTempList(ServicePatientTemp servicePatientTemp)
+    {
+        return servicePatientTempMapper.selectServicePatientTempList(servicePatientTemp);
+    }
+
+    /**
+     * 鏂板銆愯濉啓鍔熻兘鍚嶇О銆�
+     * 
+     * @param servicePatientTemp 銆愯濉啓鍔熻兘鍚嶇О銆�
+     * @return 缁撴灉
+     */
+    @Override
+    public int insertServicePatientTemp(ServicePatientTemp servicePatientTemp)
+    {
+        servicePatientTemp.setCreateTime(DateUtils.getNowDate());
+        return servicePatientTempMapper.insertServicePatientTemp(servicePatientTemp);
+    }
+
+    /**
+     * 淇敼銆愯濉啓鍔熻兘鍚嶇О銆�
+     * 
+     * @param servicePatientTemp 銆愯濉啓鍔熻兘鍚嶇О銆�
+     * @return 缁撴灉
+     */
+    @Override
+    public int updateServicePatientTemp(ServicePatientTemp servicePatientTemp)
+    {
+        servicePatientTemp.setUpdateTime(DateUtils.getNowDate());
+        return servicePatientTempMapper.updateServicePatientTemp(servicePatientTemp);
+    }
+
+    /**
+     * 鎵归噺鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆�
+     * 
+     * @param ids 闇�瑕佸垹闄ょ殑銆愯濉啓鍔熻兘鍚嶇О銆戜富閿�
+     * @return 缁撴灉
+     */
+    @Override
+    public int deleteServicePatientTempByIds(Long[] ids)
+    {
+        return servicePatientTempMapper.deleteServicePatientTempByIds(ids);
+    }
+
+    /**
+     * 鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆戜俊鎭�
+     * 
+     * @param id 銆愯濉啓鍔熻兘鍚嶇О銆戜富閿�
+     * @return 缁撴灉
+     */
+    @Override
+    public int deleteServicePatientTempById(Long id)
+    {
+        return servicePatientTempMapper.deleteServicePatientTempById(id);
+    }
+}
diff --git a/smartor/src/main/resources/mapper/smartor/ServicePatientTempMapper.xml b/smartor/src/main/resources/mapper/smartor/ServicePatientTempMapper.xml
new file mode 100644
index 0000000..b11d313
--- /dev/null
+++ b/smartor/src/main/resources/mapper/smartor/ServicePatientTempMapper.xml
@@ -0,0 +1,158 @@
+<?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.smartor.mapper.ServicePatientTempMapper">
+
+    <resultMap type="com.smartor.domain.ServicePatientTemp" id="ServicePatientTempResult">
+        <result property="id" column="id"/>
+        <result property="userId" column="user_id"/>
+        <result property="tempId" column="temp_id"/>
+        <result property="type" column="type"/>
+        <result property="startTime" column="start_time"/>
+        <result property="endTime" column="end_time"/>
+        <result property="dayNum" column="day_num"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+
+    <sql id="selectServicePatientTempVo">
+        select id,
+               user_id,
+               temp_id,
+               type,
+               start_time,
+               end_time,
+               day_num,
+               del_flag,
+               create_time,
+               update_time
+        from service_patient_temp
+    </sql>
+
+    <select id="selectServicePatientTempList" parameterType="com.smartor.domain.ServicePatientTemp"
+            resultMap="ServicePatientTempResult">
+        <include refid="selectServicePatientTempVo"/>
+        <where>
+            <if test="userId != null ">
+                and user_id = #{userId}
+            </if>
+            <if test="tempId != null ">
+                and temp_id = #{tempId}
+            </if>
+            <if test="type != null ">
+                and type = #{type}
+            </if>
+            <if test="startTime != null ">
+                and start_time = #{startTime}
+            </if>
+            <if test="endTime != null ">
+                and end_time = #{endTime}
+            </if>
+            <if test="dayNum != null ">
+                and day_num = #{dayNum}
+            </if>
+        </where>
+    </select>
+
+    <select id="selectServicePatientTempById" parameterType="Long"
+            resultMap="ServicePatientTempResult">
+        <include refid="selectServicePatientTempVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertServicePatientTemp" parameterType="com.smartor.domain.ServicePatientTemp">
+        insert into service_patient_temp
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,
+            </if>
+            <if test="userId != null">user_id,
+            </if>
+            <if test="tempId != null">temp_id,
+            </if>
+            <if test="type != null">type,
+            </if>
+            <if test="startTime != null">start_time,
+            </if>
+            <if test="endTime != null">end_time,
+            </if>
+            <if test="dayNum != null">day_num,
+            </if>
+            <if test="delFlag != null">del_flag,
+            </if>
+            <if test="createTime != null">create_time,
+            </if>
+            <if test="updateTime != null">update_time,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},
+            </if>
+            <if test="userId != null">#{userId},
+            </if>
+            <if test="tempId != null">#{tempId},
+            </if>
+            <if test="type != null">#{type},
+            </if>
+            <if test="startTime != null">#{startTime},
+            </if>
+            <if test="endTime != null">#{endTime},
+            </if>
+            <if test="dayNum != null">#{dayNum},
+            </if>
+            <if test="delFlag != null">#{delFlag},
+            </if>
+            <if test="createTime != null">#{createTime},
+            </if>
+            <if test="updateTime != null">#{updateTime},
+            </if>
+        </trim>
+    </insert>
+
+    <update id="updateServicePatientTemp" parameterType="com.smartor.domain.ServicePatientTemp">
+        update service_patient_temp
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="userId != null">user_id = #{userId},
+            </if>
+            <if test="tempId != null">temp_id = #{tempId},
+            </if>
+            <if test="type != null">type = #{type},
+            </if>
+            <if test="startTime != null">start_time = #{startTime},
+            </if>
+            <if test="endTime != null">end_time = #{endTime},
+            </if>
+            <if test="dayNum != null">day_num = #{dayNum},
+            </if>
+            <if test="delFlag != null">del_flag = #{delFlag},
+            </if>
+            <if test="createTime != null">create_time = #{createTime},
+            </if>
+            <if test="updateTime != null">update_time = #{updateTime},
+            </if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <update id="deleteServicePatientTempById" parameterType="Long">
+        update service_patient_temp
+        <trim prefix="SET" suffixOverrides=",">
+            del_flag =1
+        </trim>
+        where id = #{id}
+    </update>
+
+    <update id="deleteServicePatientTempByIds" parameterType="String">
+        update service_patient_temp
+        <trim prefix="SET" suffixOverrides=",">
+            del_flag =1
+        </trim>
+        where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </update>
+
+
+</mapper>

--
Gitblit v1.9.3