yeguodong 2 ay önce
ebeveyn
işleme
7e5b3432d2

+ 4 - 4
pom.xml

@@ -8,11 +8,11 @@
         <version>2.4.1</version>
         <relativePath/>
     </parent>
-    <groupId>thyyxxk</groupId>
-    <artifactId>web-server</artifactId>
+    <groupId>com.huaihai</groupId>
+    <artifactId>lis_web_service</artifactId>
     <version>12.6.5</version>
-    <name>web-server</name>
-    <description>server for yibao-web</description>
+    <name>lis_web_service</name>
+    <description>lis_web_service</description>
     <properties>
         <java.version>1.8</java.version>
         <druid.version>1.1.10</druid.version>

+ 15 - 0
src/main/java/com/webserver/common/result/LisResult.java

@@ -0,0 +1,15 @@
+package com.webserver.common.result;
+
+public class LisResult {
+
+    private String result;
+
+    public String getResult() {
+        return result;
+    }
+
+    public void setResult(String result) {
+        this.result = result;
+    }
+
+}

+ 16 - 0
src/main/java/com/webserver/core/ward/mapper/WardMapper.java

@@ -0,0 +1,16 @@
+package com.webserver.core.ward.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.webserver.core.ward.model.Ward;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Mapper
+public interface WardMapper extends BaseMapper<Ward> {
+
+    @Select("select code as wardno,name as wardname, name as His_wardno from zd_unit_code where PATINDEX('8%',code)>0 order by code")
+    List<Ward> getWardList();
+}

+ 32 - 0
src/main/java/com/webserver/core/ward/model/Ward.java

@@ -0,0 +1,32 @@
+package com.webserver.core.ward.model;
+
+public class Ward {
+
+    private String wardno;
+    private String wardname;
+    private String His_wardno;
+
+    public String getWardno() {
+        return wardno;
+    }
+
+    public void setWardno(String wardno) {
+        this.wardno = wardno;
+    }
+
+    public String getWardname() {
+        return wardname;
+    }
+
+    public void setWardname(String wardname) {
+        this.wardname = wardname;
+    }
+
+    public String getHis_wardno() {
+        return His_wardno;
+    }
+
+    public void setHis_wardno(String his_wardno) {
+        His_wardno = his_wardno;
+    }
+}

+ 51 - 0
src/main/java/com/webserver/core/ward/result/ResponseData.java

@@ -0,0 +1,51 @@
+package com.webserver.core.ward.result;
+
+import com.webserver.core.ward.model.Ward;
+
+import javax.jws.WebResult;
+import javax.xml.bind.annotation.*;
+import java.util.ArrayList;
+import java.util.List;
+
+@XmlRootElement(name = "response")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class ResponseData {
+    // 类定义
+    
+    @XmlElement(name = "result")
+    private String result;
+    
+    @XmlElement(name = "message")
+    private String message;
+    
+    @XmlElementWrapper(name = "content")
+    @XmlElement(name = "data")
+    private List<Ward> content = new ArrayList<>();
+    
+    // Getters and Setters
+
+
+    public String getResult() {
+        return result;
+    }
+
+    public void setResult(String result) {
+        this.result = result;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+    public void setMessage(String message) {
+        this.message = message;
+    }
+
+    public List<Ward> getContent() {
+        return content;
+    }
+
+    public void setContent(List<Ward> content) {
+        this.content = content;
+    }
+}

+ 22 - 0
src/main/java/com/webserver/core/ward/result/WardResult.java

@@ -0,0 +1,22 @@
+package com.webserver.core.ward.result;
+
+import com.webserver.common.result.LisResult;
+import com.webserver.core.ward.model.Ward;
+
+import javax.xml.bind.annotation.XmlSeeAlso;
+import java.util.ArrayList;
+import java.util.List;
+
+@XmlSeeAlso({ArrayList.class})
+public class WardResult extends LisResult {
+
+    private List<Ward> content;
+
+    public List<Ward> getContent() {
+        return content;
+    }
+
+    public void setContent(List<Ward> content) {
+        this.content = content;
+    }
+}

+ 34 - 0
src/main/java/com/webserver/core/ward/service/WardService.java

@@ -0,0 +1,34 @@
+package com.webserver.core.ward.service;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.webserver.common.result.LisResult;
+import com.webserver.core.ward.mapper.WardMapper;
+import com.webserver.core.ward.model.Ward;
+import com.webserver.core.ward.result.ResponseData;
+import com.webserver.core.ward.result.WardResult;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import java.util.List;
+
+@Service
+@WebService
+public class WardService {
+
+    @Autowired
+    private WardMapper wardMapper;
+
+    @WebMethod
+    public ResponseData test(@WebParam(name="name") String name) {
+        ResponseData lisResult = new ResponseData();
+        lisResult.setResult("1");
+        List<Ward> wardList = wardMapper.getWardList();
+        lisResult.setContent(wardList);
+        System.out.println(wardList);
+        return lisResult;
+    }
+}

+ 1 - 1
src/main/resources/application-dev.yml

@@ -20,7 +20,7 @@ spring:
         his:
           url: "jdbc:sqlserver://localhost:1433;databaseName=hisdb"
           username: "sa"
-          password: "root"
+          password: "Symhyy@123"
           driver-class-name: "com.microsoft.sqlserver.jdbc.SQLServerDriver"
         demo:
           url: "jdbc:sqlserver://localhost:1433;databaseName=demohisdb"