From fcb98e4558897945a316d04555923355b8e60605 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期二, 21 七月 2026 10:16:56 +0800
Subject: [PATCH] Merge branch 'master' into master-任务组

---
 smartor/src/main/java/com/smartor/service/impl/ServiceOutPathServiceImpl.java |   58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 58 insertions(+), 0 deletions(-)

diff --git a/smartor/src/main/java/com/smartor/service/impl/ServiceOutPathServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/ServiceOutPathServiceImpl.java
index a63e655..dc3ff01 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceOutPathServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceOutPathServiceImpl.java
@@ -1,11 +1,17 @@
 package com.smartor.service.impl;
 
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.RSAPublicKeyExample;
 import com.smartor.domain.ServiceOutPath;
+import com.smartor.domain.ServiceTask;
 import com.smartor.mapper.ServiceOutPathMapper;
+import com.smartor.mapper.ServiceTaskMapper;
 import com.smartor.service.IServiceOutPathService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -18,6 +24,14 @@
 public class ServiceOutPathServiceImpl implements IServiceOutPathService {
     @Autowired
     private ServiceOutPathMapper serviceOutPathMapper;
+    @Autowired
+    private ServiceTaskMapper serviceTaskMapper;
+    @Value("${localIP}")
+    private String localIP;
+    @Value("${req_path}")
+    private String req_path;
+    @Value("${pub_key}")
+    private String pub_key;
 
     /**
      * 鏌ヨ涓婚敭
@@ -53,6 +67,40 @@
     }
 
     /**
+     * 鏂板涓婚敭
+     *
+     * @param serviceOutPath 涓婚敭
+     * @return 缁撴灉
+     */
+    @Override
+    public String addOutPath(ServiceOutPath serviceOutPath) {
+        ServiceTask serviceTask = serviceTaskMapper.selectServiceTaskByTaskid(Long.valueOf(serviceOutPath.getParam1()));
+        RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
+        String taskId = rsaPublicKeyExample.encryptedData(serviceOutPath.getParam1().toString(), pub_key);
+        String patid= rsaPublicKeyExample.encryptedData(serviceOutPath.getParam2().toString(), pub_key);
+        String subid= rsaPublicKeyExample.encryptedData(serviceOutPath.getParam6().toString(), pub_key);
+        Date now = DateUtils.getNowDate();
+        ServiceOutPath sop = new ServiceOutPath();
+        sop.setParam1(taskId);
+        sop.setParam2(patid);
+        sop.setParam3(serviceTask.getTaskName());
+        sop.setParam6(subid);
+        sop.setCreateTime(now);
+        sop.setUpdateTime(now);
+        sop.setOrgid(serviceTask.getOrgid());
+        sop.setDeptCode(serviceTask.getDeptcode());
+        sop.setWardCode(serviceTask.getLeavehospitaldistrictcode());
+        sop.setDeptName(serviceTask.getDeptname());
+        sop.setWardName(serviceTask.getLeavehospitaldistrictname());
+        serviceOutPathMapper.insertServiceOutPath(sop);
+        //杞垚16杩涘埗骞跺洖鍐檙adix鍜寀pdateTime
+        serviceOutPath.setRadix(String.format("%03X", sop.getId()));
+        serviceOutPath.setUrl(localIP + ":" + req_path + "/wt?p=" + sop.getRadix());
+        serviceOutPathMapper.updateServiceOutPath(serviceOutPath);
+        return serviceOutPath.getUrl();
+    }
+
+    /**
      * 淇敼涓婚敭
      *
      * @param serviceOutPath 涓婚敭
@@ -84,4 +132,14 @@
     public int deleteServiceOutPathById(Long id) {
         return serviceOutPathMapper.deleteServiceOutPathById(id);
     }
+
+    /**
+     * 鏌ヨ鑷ID
+     *
+     * @return ID
+     */
+    @Override
+    public Integer selectAutoId() {
+        return serviceOutPathMapper.selectAutoId();
+    }
 }

--
Gitblit v1.9.3