From be98ac797643d1e01c313e9bbe8d9a10a0d9019c Mon Sep 17 00:00:00 2001 From: congcong Date: Mon, 27 Apr 2020 20:30:59 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=A8=E8=AF=8A=E5=8C=BB=E7=94=9F=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../back/controller/MenZhenController.java | 78 ++- .../java/com/his/back/dao/memberMapper.java | 21 +- .../his/back/dao/patient_projectMapper.java | 6 + .../java/com/his/back/dao/projectMapper.java | 4 + .../java/com/his/back/mapper/memberMapper.xml | 172 ++--- .../his/back/mapper/patient_projectMapper.xml | 14 + .../com/his/back/mapper/projectMapper.xml | 25 +- .../main/java/com/his/back/pojo/member.java | 225 +------ .../main/java/com/his/back/pojo/project.java | 13 +- .../com/his/back/service/MenZhenService.java | 53 +- .../serviceImpl/MenZhenServiceimpl.java | 49 +- front/src/components/views/MenZhen.vue | 615 ++++++++++++++++-- 12 files changed, 887 insertions(+), 388 deletions(-) diff --git a/back/src/main/java/com/his/back/controller/MenZhenController.java b/back/src/main/java/com/his/back/controller/MenZhenController.java index b46c111..a93734e 100644 --- a/back/src/main/java/com/his/back/controller/MenZhenController.java +++ b/back/src/main/java/com/his/back/controller/MenZhenController.java @@ -1,10 +1,18 @@ package com.his.back.controller; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import com.his.back.pojo.project; import com.his.back.service.MenZhenService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import com.his.back.pojo.member; +import java.util.List; +import java.util.Map; + + @RestController @CrossOrigin(origins = "*", maxAge = 3600) @RequestMapping("/menZhen") @@ -12,10 +20,70 @@ public class MenZhenController { @Autowired MenZhenService menZhenService; - @RequestMapping("/find") - public member find(@RequestParam String content){ - System.out.println("find ->content: "+content); - System.out.println("-> member: "+menZhenService.find("%"+content+"%").toString()); - return menZhenService.find("%"+content+"%"); + @RequestMapping("/searchPatient") + public List searchPatient(@RequestParam String content){ + //System.out.println("find ->content: "+content); + //System.out.println("-> member: "+ menZhenService.find("%"+content+"%").toString()); + return menZhenService.searchPatient("%"+content+"%"); + } + + @RequestMapping("/getUserMemberList") + public List getUserMemberList(@RequestParam String userId, @RequestParam int stateId){ + //System.out.print("getUserMemberList->"); + //System.out.println("userId: " + userId + " stateId:" + stateId); + //System.out.print("memberList: "); + //System.out.println(menZhenService.getUserMemberList(userId,stateId).toString()); + return menZhenService.getUserMemberList(userId,stateId); + } + + @RequestMapping("/getDeptMemberList") + public List getDeptMemberList(@RequestParam String deptId, @RequestParam int stateId){ + //System.out.print("getDeptMemberList->"); + //System.out.println("deptId: " + deptId + " stateId:" + stateId); + //System.out.println("memberList: "); + //System.out.println(menZhenService.getDeptMemberList(deptId,stateId).toString()); + return menZhenService.getDeptMemberList(deptId,stateId); + } + + @RequestMapping("/updatePatientInfo") + public int updatePatientInfo(@RequestBody String postInfo){ + //System.out.println(postInfo); + JsonParser jp = new JsonParser(); + JsonObject jo = jp.parse(postInfo).getAsJsonObject(); + String patientInfo = jo.get("patientInfo").getAsString(); + String solveXi = jo.get("solveXi").getAsString(); + String solveZhong = jo.get("solveZhong").getAsString(); + //System.out.println("patientInfo:" + patientInfo); + String patientId = jo.get("patientId").getAsString(); + //System.out.println("patientId:" + patientId); + //System.out.println(menZhenService.updatePatientInfo(patientInfo)); + return menZhenService.updatePatientInfo(patientId,patientInfo) + menZhenService.updatePatientSolve(patientId,solveXi,solveZhong); + } + + @RequestMapping("/getPro") + public List selectProByType(@RequestParam String projType){ + return menZhenService.selectProByType(projType); + } + + @RequestMapping("/getProResult") + public String selectProResult(@RequestParam String patientId, @RequestParam String projName){ + return menZhenService.selectProResult(patientId,projName); + } + + @RequestMapping("/insertPro") + public int updatePro(@RequestBody String postInfo){ + System.out.println(postInfo); + JsonParser jp = new JsonParser(); + JsonObject jo = jp.parse(postInfo).getAsJsonObject(); + String patientId = jo.get("patientId").getAsString(); + JsonArray proJNameList = jo.get("projNameList").getAsJsonArray(); + System.out.println(patientId); + System.out.println(proJNameList); + int num = 0; + for(int i = 0; i < proJNameList.size(); i ++){ + //System.out.println((proJNameList.get(i).getAsString())); + num += menZhenService.insertPro(patientId,proJNameList.get(i).getAsString()); + } + return num; } } diff --git a/back/src/main/java/com/his/back/dao/memberMapper.java b/back/src/main/java/com/his/back/dao/memberMapper.java index 7ea3641..d0cf8dc 100644 --- a/back/src/main/java/com/his/back/dao/memberMapper.java +++ b/back/src/main/java/com/his/back/dao/memberMapper.java @@ -2,17 +2,30 @@ package com.his.back.dao; import com.his.back.pojo.member; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Component; +import java.util.List; + @Mapper @Component("memberMapper") public interface memberMapper { /** * find like content */ - member find(String patientId); + member find(String contnet); + + List searchPatient(String content); + + List getUserMemberList(@Param("userId") String userId, @Param("stateId") int stateId); + + List getDeptMemberList(@Param("deptId") String deptId, @Param("stateId") int stateId); + + int updatePatientInfo(String patientId, String patientInfo); + + int updatePatientSolve(String patientId, String solveXi, String solveZhong); + - member findRegisterMember(String patientId); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table member @@ -21,8 +34,6 @@ public interface memberMapper { */ int deleteByPrimaryKey(String patientId); - - /** * This method was generated by MyBatis Generator. * This method corresponds to the database table member @@ -62,6 +73,4 @@ public interface memberMapper { * @mbggenerated */ int updateByPrimaryKey(member record); - - //void pushMember(String patientId); } \ No newline at end of file diff --git a/back/src/main/java/com/his/back/dao/patient_projectMapper.java b/back/src/main/java/com/his/back/dao/patient_projectMapper.java index 4ebb4f4..d384a2a 100644 --- a/back/src/main/java/com/his/back/dao/patient_projectMapper.java +++ b/back/src/main/java/com/his/back/dao/patient_projectMapper.java @@ -4,8 +4,10 @@ import com.his.back.pojo.patient_project; import com.his.back.pojo.patient_projectKey; import com.his.back.pojo.project; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Component; +import java.util.Date; import java.util.List; @Mapper @@ -61,4 +63,8 @@ public interface patient_projectMapper { * @mbggenerated */ int updateByPrimaryKey(patient_project record); + + String selectProResult(String patientId, String projName); + + int insertPro(@Param("patientId") String patientId,@Param("projName") String projName,@Param("time") Date time); } \ No newline at end of file diff --git a/back/src/main/java/com/his/back/dao/projectMapper.java b/back/src/main/java/com/his/back/dao/projectMapper.java index 38500ce..419b955 100644 --- a/back/src/main/java/com/his/back/dao/projectMapper.java +++ b/back/src/main/java/com/his/back/dao/projectMapper.java @@ -4,6 +4,8 @@ import com.his.back.pojo.project; import org.apache.ibatis.annotations.Mapper; import org.springframework.stereotype.Component; +import java.util.List; + @Mapper @Component("projectMapper") public interface projectMapper { @@ -54,4 +56,6 @@ public interface projectMapper { * @mbggenerated */ int updateByPrimaryKey(project record); + + List selectProByType(String projType); } \ No newline at end of file diff --git a/back/src/main/java/com/his/back/mapper/memberMapper.xml b/back/src/main/java/com/his/back/mapper/memberMapper.xml index afcaf15..fbc955f 100644 --- a/back/src/main/java/com/his/back/mapper/memberMapper.xml +++ b/back/src/main/java/com/his/back/mapper/memberMapper.xml @@ -1,8 +1,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - patient_id, name, gender, age, birthday, identified, address, pay_type_id, register_lever_id, - room_id, doctor_id, is_use_doc, register_time, state_id, patient_info, ICD_zhong, - name_zhong, time_zhong, ICD_xi, name_xi, time_xi, drug_list, cost + room_id, doctor_id, is_use_doc, register_time, state_id, patient_info, drug_list, cost, solve_xi, solve_zhong - select from member - where patient_id = #{patientId,jdbcType=VARCHAR} and state_id = 0 + where patient_id like #{content,jdbcType=VARCHAR} or name like #{content,jdbcType=VARCHAR} + + + + + + + + update member + set patient_info = #{patientInfo,jdbcType=VARCHAR} + where patient_id = #{patientId,jdbcType=VARCHAR} + + + + update member + set solve_xi = #{solveXi,jdbcType=VARCHAR}, + solve_zhong = #{solveZhong,jdbcType=VARCHAR} + where patient_id = #{patientId,jdbcType=VARCHAR} +