From d98140b5f0ea30bfdbe1e05f067ad0f9ad371b38 Mon Sep 17 00:00:00 2001 From: congcong Date: Mon, 4 May 2020 00:23:37 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=A8=E8=AF=8A=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../back/controller/MenZhenController.java | 98 +- .../java/com/his/back/dao/drugMapper.java | 10 +- .../java/com/his/back/dao/memberMapper.java | 10 +- .../his/back/dao/patient_projectMapper.java | 27 +- .../java/com/his/back/dao/tempateMapper.java | 28 + .../java/com/his/back/mapper/drugMapper.xml | 44 +- .../java/com/his/back/mapper/memberMapper.xml | 82 +- .../his/back/mapper/patient_drugMapper.xml | 14 +- .../com/his/back/mapper/tempateMapper.xml | 126 + .../src/main/java/com/his/back/pojo/drug.java | 33 + .../main/java/com/his/back/pojo/member.java | 35 +- .../java/com/his/back/pojo/patient_drug.java | 10 + .../main/java/com/his/back/pojo/procost.java | 51 + .../main/java/com/his/back/pojo/tempate.java | 65 + .../com/his/back/service/MenZhenService.java | 44 +- .../serviceImpl/MenZhenServiceimpl.java | 155 +- front/src/components/views/MenZhen.vue | 2054 +++++++++++++++-- 17 files changed, 2525 insertions(+), 361 deletions(-) create mode 100644 back/src/main/java/com/his/back/dao/tempateMapper.java create mode 100644 back/src/main/java/com/his/back/mapper/tempateMapper.xml create mode 100644 back/src/main/java/com/his/back/pojo/procost.java create mode 100644 back/src/main/java/com/his/back/pojo/tempate.java 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 a93734e..c1cbc2b 100644 --- a/back/src/main/java/com/his/back/controller/MenZhenController.java +++ b/back/src/main/java/com/his/back/controller/MenZhenController.java @@ -3,11 +3,10 @@ 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.pojo.*; 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; @@ -72,6 +71,23 @@ public class MenZhenController { @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; + } + + @RequestMapping("/deletePro") + public int deletePro(@RequestBody String postInfo){ System.out.println(postInfo); JsonParser jp = new JsonParser(); JsonObject jo = jp.parse(postInfo).getAsJsonObject(); @@ -82,8 +98,84 @@ public class MenZhenController { 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()); + num += menZhenService.deletePro(patientId,proJNameList.get(i).getAsString()); } return num; } + + @RequestMapping("/getApplyTemList") + public List selectTemByType(@RequestParam String type){ + return menZhenService.selectTemByType(type); + } + + @RequestMapping("/getTemPro") + public List getTemProList(@RequestParam String temName, @RequestParam String type){ + return menZhenService.getTemProList(temName,type); + } + + @RequestMapping("/selectProCost") + public List selectProCost(@RequestParam String patientId,@RequestParam String type){ + //System.out.println(menZhenService.selectProCost(patientId,type)); + return menZhenService.selectProCost(patientId,type); + } + + @RequestMapping("/getXiData") + public String selectSolveXi(@RequestParam String patientId){ + return menZhenService.selectSolveXi(patientId); + } + + @RequestMapping("/getZhongData") + public String selectSolveZhong(@RequestParam String patientId){ + return menZhenService.selectSolveZhong(patientId); + } + + @RequestMapping("/getJianchaData") + public List> selectJianchaData(@RequestParam String patientId){ + return menZhenService.selectJianchaData(patientId); + } + + @RequestMapping("/getJianyanData") + public List> selectJianyanData(@RequestParam String patientId){ + return menZhenService.selectJianyanData(patientId); + } + + @RequestMapping("/updateQuezhen") + public int updateQuezhen(@RequestBody String postInfo){ + JsonParser jp = new JsonParser(); + JsonObject jo = jp.parse(postInfo).getAsJsonObject(); + String solveXi = jo.get("solveXi").getAsString(); + String solveZhong = jo.get("solveZhong").getAsString(); + String patientId = jo.get("patientId").getAsString(); + return menZhenService.updatePatientSolve(patientId,solveXi,solveZhong); + } + + @RequestMapping("/selectDrugByType") + public List selectDrugByType(@RequestParam String type){ + return menZhenService.selectDrugByType(type); + } + + @RequestMapping("/searchTemByName") + public List> selectTemByName(@RequestParam String content, @RequestParam String type){ + return menZhenService.selectTemByName(content,type); + } + + @RequestMapping("/searchTemContent") + public List searchTemContent(@RequestParam String temName){ + return menZhenService.searchTemContent(temName); + } + + @RequestMapping("/submitChufang") + public int updateChufang(@RequestBody String postInfo){ + return menZhenService.updateChufang(postInfo); + } + + @RequestMapping("/deleteChufang") + public int deleteChufang(@RequestBody String postInfo){ + return menZhenService.deleteChufang(postInfo); + } + + @RequestMapping("/zhenbi") + public int updateMemberState(@RequestParam String patientId){ + return menZhenService.updateMemberState(patientId); + } } diff --git a/back/src/main/java/com/his/back/dao/drugMapper.java b/back/src/main/java/com/his/back/dao/drugMapper.java index 39a64e9..932d38f 100644 --- a/back/src/main/java/com/his/back/dao/drugMapper.java +++ b/back/src/main/java/com/his/back/dao/drugMapper.java @@ -16,12 +16,16 @@ public interface drugMapper { * * @mbggenerated */ - List patientOpen(String id, Date date); + List patientOpen(Integer id, Date date); - List patientCancel(String id, Date date); + List patientCancel(Integer id, Date date); List search(String query); + List selectDrugByType(String type); + + drug selectDrugByName(String drugName); + int deleteByPrimaryKey(Integer drugId); /** @@ -63,4 +67,6 @@ public interface drugMapper { * @mbggenerated */ int updateByPrimaryKey(drug record); + + int selectDrugIdByName(String drugName); } \ No newline at end of file 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 0a9d584..440a19a 100644 --- a/back/src/main/java/com/his/back/dao/memberMapper.java +++ b/back/src/main/java/com/his/back/dao/memberMapper.java @@ -1,6 +1,5 @@ package com.his.back.dao; -import com.his.back.pojo.ExMember; import com.his.back.pojo.member; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -15,9 +14,6 @@ public interface memberMapper { * find like content */ member find(String contnet); - //wangxiao - ExMember findExMember(String patientId); - List searchPatient(String content); @@ -29,6 +25,12 @@ public interface memberMapper { int updatePatientSolve(String patientId, String solveXi, String solveZhong); + String selectSolveXi(String patientId); + + String selectSolveZhong(String patientId); + + int updateMemberState(String patientId); + /** * This method was generated by MyBatis Generator. 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 fa620e1..155a4da 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 @@ -1,12 +1,17 @@ package com.his.back.dao; -import com.his.back.pojo.*; +import com.his.back.pojo.patient_project; +import com.his.back.pojo.patient_projectKey; +import com.his.back.pojo.procost; +import com.his.back.pojo.project; +import org.apache.ibatis.annotations.MapKey; 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; +import java.util.Map; @Mapper @Component("patient_projectMapper") @@ -14,16 +19,6 @@ public interface patient_projectMapper { List findProjC(String patientId); List findProjY(String patientId); List findProjZ(String patientId); - - List findExPatiPro(@Param("patientId") String patientId, @Param("stateId") Integer stateId); - - List findRelatedInvoice(String patientId); - - List findProDetail(String invoiceId); - - List findProCost(@Param("patientId") String patientId, - @Param("startTime")Date startTime,@Param("endTime")Date endTime); - /** * This method was generated by MyBatis Generator. * This method corresponds to the database table patient_project @@ -75,4 +70,14 @@ public interface patient_projectMapper { String selectProResult(String patientId, String projName); int insertPro(@Param("patientId") String patientId,@Param("projName") String projName,@Param("time") Date time); + + List selectProCostByType(String patientId, String type); + + List selectAllProCost(String patientId); + + @MapKey("project_name") + List> selectJianchaData(String patientId); + + @MapKey("project_name") + List> selectJianyanData(String patientId); } \ No newline at end of file diff --git a/back/src/main/java/com/his/back/dao/tempateMapper.java b/back/src/main/java/com/his/back/dao/tempateMapper.java new file mode 100644 index 0000000..3293cc4 --- /dev/null +++ b/back/src/main/java/com/his/back/dao/tempateMapper.java @@ -0,0 +1,28 @@ +package com.his.back.dao; + +import com.his.back.pojo.tempate; +import org.apache.ibatis.annotations.MapKey; + +import java.util.List; +import java.util.Map; + +public interface tempateMapper { + int deleteByPrimaryKey(String temName); + + int insert(tempate record); + + int insertSelective(tempate record); + + tempate selectByPrimaryKey(String temName); + + int updateByPrimaryKeySelective(tempate record); + + int updateByPrimaryKey(tempate record); + + List selectTemByType(String type); + + String selectProList(String temName); + + @MapKey("tem_name") + List> selectTemByName(String temName,String type); +} \ No newline at end of file diff --git a/back/src/main/java/com/his/back/mapper/drugMapper.xml b/back/src/main/java/com/his/back/mapper/drugMapper.xml index 1516391..744de5e 100644 --- a/back/src/main/java/com/his/back/mapper/drugMapper.xml +++ b/back/src/main/java/com/his/back/mapper/drugMapper.xml @@ -13,25 +13,32 @@ + + + - drug_id, drug_name, drug_standard, drug_unit, drug_unitPrice, drug_dosageForm, drug_type + drug_id, drug_name, drug_standard, drug_unit, drug_unitPrice, drug_dosageForm, drug_type, + drug_use, drug_fre, drug_dose + + + + + + + + + + + select + + from drug + where drug_id = #{drugId,jdbcType=INTEGER} + - - - - - - - - - - - - - - - - - - - - - - - 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, drug_list, cost, solve_xi, solve_zhong + room_id, doctor_id, is_use_doc, register_time, state_id, patient_info,cost, solve_xi, solve_zhong - - - 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, deptName , payTypeName ,registerLevelName - - - + + select solve_xi + from member + where patient_id = #{patientId,jdbcType=VARCHAR} + + + + insert into patient_drug (patient_id, drug_id, drug_num, - drug_datetime, state_id, invoice_id + drug_datetime, state_id, invoice_id, prescription ) values (#{patientId,jdbcType=VARCHAR}, #{drugId,jdbcType=INTEGER}, #{drugNum,jdbcType=INTEGER}, - #{drugDatetime,jdbcType=TIMESTAMP}, #{stateId,jdbcType=INTEGER}, #{invoiceId,jdbcType=VARCHAR} + #{drugDatetime,jdbcType=TIMESTAMP}, #{stateId,jdbcType=INTEGER}, #{invoiceId,jdbcType=VARCHAR}, + #{prescription,jdbcType=VARCHAR} ) @@ -118,6 +120,9 @@ invoice_id = #{invoiceId,jdbcType=VARCHAR}, + + prescription = #{prescription,jdbcType=VARCHAR}, + where patient_id = #{patientId,jdbcType=VARCHAR} and drug_id = #{drugId,jdbcType=INTEGER} @@ -131,7 +136,8 @@ set drug_num = #{drugNum,jdbcType=INTEGER}, drug_datetime = #{drugDatetime,jdbcType=TIMESTAMP}, state_id = #{stateId,jdbcType=INTEGER}, - invoice_id = #{invoiceId,jdbcType=VARCHAR} + invoice_id = #{invoiceId,jdbcType=VARCHAR}, + prescription= #{prescription,jdbcType=VARCHAR} where patient_id = #{patientId,jdbcType=VARCHAR} and drug_id = #{drugId,jdbcType=INTEGER} diff --git a/back/src/main/java/com/his/back/mapper/tempateMapper.xml b/back/src/main/java/com/his/back/mapper/tempateMapper.xml new file mode 100644 index 0000000..1c49a01 --- /dev/null +++ b/back/src/main/java/com/his/back/mapper/tempateMapper.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + tem_name, tem_type, tem_time, scope, type, pro_list + + + + + + + + + + + delete from tempate + where tem_name = #{temName,jdbcType=VARCHAR} + + + insert into tempate (tem_name, tem_type, tem_time, + scope, type, pro_list + ) + values (#{temName,jdbcType=VARCHAR}, #{temType,jdbcType=VARCHAR}, #{temTime,jdbcType=TIMESTAMP}, + #{scope,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{proList,jdbcType=VARCHAR} + ) + + + insert into tempate + + + tem_name, + + + tem_type, + + + tem_time, + + + scope, + + + type, + + + pro_list, + + + + + #{temName,jdbcType=VARCHAR}, + + + #{temType,jdbcType=VARCHAR}, + + + #{temTime,jdbcType=TIMESTAMP}, + + + #{scope,jdbcType=VARCHAR}, + + + #{type,jdbcType=VARCHAR}, + + + #{proList,jdbcType=VARCHAR}, + + + + + update tempate + + + tem_type = #{temType,jdbcType=VARCHAR}, + + + tem_time = #{temTime,jdbcType=TIMESTAMP}, + + + scope = #{scope,jdbcType=VARCHAR}, + + + type = #{type,jdbcType=VARCHAR}, + + + pro_list = #{proList,jdbcType=VARCHAR}, + + + where tem_name = #{temName,jdbcType=VARCHAR} + + + update tempate + set tem_type = #{temType,jdbcType=VARCHAR}, + tem_time = #{temTime,jdbcType=TIMESTAMP}, + scope = #{scope,jdbcType=VARCHAR}, + type = #{type,jdbcType=VARCHAR}, + pro_list = #{proList,jdbcType=VARCHAR} + where tem_name = #{temName,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/back/src/main/java/com/his/back/pojo/drug.java b/back/src/main/java/com/his/back/pojo/drug.java index 6aa9b73..d30f3c1 100644 --- a/back/src/main/java/com/his/back/pojo/drug.java +++ b/back/src/main/java/com/his/back/pojo/drug.java @@ -57,6 +57,12 @@ public class drug { */ private String drugType; + private String drugUse; + + private Integer drugFre; + + private Integer drugDose; + @Override public String toString() { return "drug{" + @@ -67,9 +73,36 @@ public class drug { ", drugUnitprice=" + drugUnitprice + ", drugDosageform='" + drugDosageform + '\'' + ", drugType='" + drugType + '\'' + + ", drugUse='" + drugUse + '\'' + + ", drugFre=" + drugFre + + ", drugDose=" + drugDose + '}'; } + public String getDrugUse() { + return drugUse; + } + + public Integer getDrugFre() { + return drugFre; + } + + public Integer getDrugDose() { + return drugDose; + } + + public void setDrugUse(String drugUse) { + this.drugUse = drugUse; + } + + public void setDrugFre(Integer drugFre) { + this.drugFre = drugFre; + } + + public void setDrugDose(Integer drugDose) { + this.drugDose = drugDose; + } + /** * This method was generated by MyBatis Generator. * This method returns the value of the database column drug.drug_id diff --git a/back/src/main/java/com/his/back/pojo/member.java b/back/src/main/java/com/his/back/pojo/member.java index 2ec4845..2070215 100644 --- a/back/src/main/java/com/his/back/pojo/member.java +++ b/back/src/main/java/com/his/back/pojo/member.java @@ -77,10 +77,9 @@ public class member { ", registerTime=" + registerTime + ", stateId=" + stateId + ", patientInfo='" + patientInfo + '\'' + - ", drugList='" + drugList + '\'' + - ", cost=" + cost + + ", cost=" + cost + '\'' + ", solveXi='" + solveXi + '\'' + - ", solveZhong='" + solveZhong + '\'' + + ", solveZhong='" + solveZhong + '}'; } @@ -148,14 +147,6 @@ public class member { */ private String patientInfo; - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column member.drug_list - * - * @mbggenerated - */ - private String drugList; - /** * This field was generated by MyBatis Generator. * This field corresponds to the database column member.cost @@ -528,29 +519,7 @@ public class member { } - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column member.drug_list - * - * @return the value of member.drug_list - * - * @mbggenerated - */ - public String getDrugList() { - return drugList; - } - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column member.drug_list - * - * @param drugList the value for member.drug_list - * - * @mbggenerated - */ - public void setDrugList(String drugList) { - this.drugList = drugList == null ? null : drugList.trim(); - } /** * This method was generated by MyBatis Generator. diff --git a/back/src/main/java/com/his/back/pojo/patient_drug.java b/back/src/main/java/com/his/back/pojo/patient_drug.java index 1c1d0a6..175c519 100644 --- a/back/src/main/java/com/his/back/pojo/patient_drug.java +++ b/back/src/main/java/com/his/back/pojo/patient_drug.java @@ -35,6 +35,16 @@ public class patient_drug extends patient_drugKey { */ private String invoiceId; + private String prescription; + + public String getPrescription() { + return prescription; + } + + public void setPrescription(String prescription) { + this.prescription = prescription; + } + /** * This method was generated by MyBatis Generator. * This method returns the value of the database column patient_drug.drug_num diff --git a/back/src/main/java/com/his/back/pojo/procost.java b/back/src/main/java/com/his/back/pojo/procost.java new file mode 100644 index 0000000..c2f6274 --- /dev/null +++ b/back/src/main/java/com/his/back/pojo/procost.java @@ -0,0 +1,51 @@ +package com.his.back.pojo; + +import java.util.Date; + +public class procost { + private Date time; + private String name; + private Double price; + private Integer number; + private Double cost; + + public Date getTime() { + return time; + } + + public String getName() { + return name; + } + + public Double getPrice() { + return price; + } + + public Integer getNumber() { + return number; + } + + public Double getCost() { + return cost; + } + + public void setTime(Date time) { + this.time = time; + } + + public void setName(String name) { + this.name = name; + } + + public void setPrice(Double price) { + this.price = price; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public void setCost(Double cost) { + this.cost = cost; + } +} diff --git a/back/src/main/java/com/his/back/pojo/tempate.java b/back/src/main/java/com/his/back/pojo/tempate.java new file mode 100644 index 0000000..d7e6f2a --- /dev/null +++ b/back/src/main/java/com/his/back/pojo/tempate.java @@ -0,0 +1,65 @@ +package com.his.back.pojo; + +import java.util.Date; + +public class tempate { + private String temName; + + private String temType; + + private Date temTime; + + private String scope; + + private String type; + + private String proList; + + public String getTemName() { + return temName; + } + + public void setTemName(String temName) { + this.temName = temName == null ? null : temName.trim(); + } + + public String getTemType() { + return temType; + } + + public void setTemType(String temType) { + this.temType = temType == null ? null : temType.trim(); + } + + public Date getTemTime() { + return temTime; + } + + public void setTemTime(Date temTime) { + this.temTime = temTime; + } + + public String getScope() { + return scope; + } + + public void setScope(String scope) { + this.scope = scope == null ? null : scope.trim(); + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + public String getProList() { + return proList; + } + + public void setProList(String proList) { + this.proList = proList == null ? null : proList.trim(); + } +} \ No newline at end of file diff --git a/back/src/main/java/com/his/back/service/MenZhenService.java b/back/src/main/java/com/his/back/service/MenZhenService.java index 1a3fc76..8566fbc 100644 --- a/back/src/main/java/com/his/back/service/MenZhenService.java +++ b/back/src/main/java/com/his/back/service/MenZhenService.java @@ -1,11 +1,11 @@ package com.his.back.service; -import com.his.back.pojo.member; -import com.his.back.pojo.project; +import com.his.back.pojo.*; import org.springframework.stereotype.Service; import java.util.Date; import java.util.List; +import java.util.Map; @Service public interface MenZhenService { @@ -63,5 +63,45 @@ public interface MenZhenService { */ String selectProResult(String patientId, String projName); + /** + * 插入项目 + * @param patientId + * @param projName + * @return + */ int insertPro(String patientId, String projName); + + /** + * 删除项目 + * @param patientId + * @param projName + * @return + */ + int deletePro(String patientId, String projName); + + List selectTemByType(String type); + + List getTemProList(String temName, String type); + + List selectProCost(String patientId,String type); + + String selectSolveXi(String patientid); + + String selectSolveZhong(String patientid); + + List> selectJianchaData(String patientid); + + List> selectJianyanData(String patientid); + + List selectDrugByType(String type); + + List> selectTemByName(String temName, String type); + + List searchTemContent(String temName); + + int updateChufang(String postInfo); + + int deleteChufang(String postInfo); + + int updateMemberState(String patientId); } diff --git a/back/src/main/java/com/his/back/service/serviceImpl/MenZhenServiceimpl.java b/back/src/main/java/com/his/back/service/serviceImpl/MenZhenServiceimpl.java index f833d7d..36cbf06 100644 --- a/back/src/main/java/com/his/back/service/serviceImpl/MenZhenServiceimpl.java +++ b/back/src/main/java/com/his/back/service/serviceImpl/MenZhenServiceimpl.java @@ -1,16 +1,18 @@ package com.his.back.service.serviceImpl; -import com.his.back.dao.patient_projectMapper; -import com.his.back.pojo.project; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import com.his.back.dao.*; +import com.his.back.pojo.*; import com.his.back.service.MenZhenService; -import com.his.back.dao.memberMapper; -import com.his.back.dao.projectMapper; -import com.his.back.pojo.member; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Map; @Service public class MenZhenServiceimpl implements MenZhenService{ @@ -20,6 +22,12 @@ public class MenZhenServiceimpl implements MenZhenService{ projectMapper projectMapper; @Autowired patient_projectMapper patient_projectMapper; + @Autowired + tempateMapper tempateMapper; + @Autowired + patient_drugMapper patient_drugMapper; + @Autowired + drugMapper drugMapper; @Override public List searchPatient(String content){ @@ -61,4 +69,141 @@ public class MenZhenServiceimpl implements MenZhenService{ Date time = new Date(); return patient_projectMapper.insertPro(patientId,projName,time); } + + @Override + public int deletePro(String patientId, String projName){ + patient_projectKey patient_projectKey = new patient_projectKey(); + patient_projectKey.setPatientId(patientId); + patient_projectKey.setProjectName(projName); + return patient_projectMapper.deleteByPrimaryKey(patient_projectKey); + } + + @Override + public List selectTemByType(String type){ + return tempateMapper.selectTemByType(type); + } + + @Override + public List getTemProList(String temName, String type){ + String proNamaeList = tempateMapper.selectProList(temName); + System.out.println(proNamaeList); + String []proNameList = proNamaeList.split(","); + ArrayList proList = new ArrayList<>(); + for(int i = 0; i < proNameList.length; i ++){ + proList.add(projectMapper.selectByPrimaryKey(proNameList[i])); + } + return proList; + } + + @Override + public List selectProCost(String patientId, String type){ + if(type.equals("任何")){ + return patient_projectMapper.selectAllProCost(patientId); + }else{ + return patient_projectMapper.selectProCostByType(patientId,type); + } + } + + @Override + public String selectSolveXi(String patientId){ + return memberMapper.selectSolveXi(patientId); + } + + @Override + public String selectSolveZhong(String patientId){ + return memberMapper.selectSolveZhong(patientId); + } + + @Override + public List> selectJianchaData(String patientId){ + return patient_projectMapper.selectJianchaData(patientId); + } + + @Override + public List> selectJianyanData(String patientId){ + return patient_projectMapper.selectJianyanData(patientId); + } + + @Override + public List selectDrugByType(String type){ + if(type.equals("zhong")){ + return drugMapper.selectDrugByType("中"); + }else{ + return drugMapper.selectDrugByType("西"); + } + } + + @Override + public List> selectTemByName(String temName,String type){ + return tempateMapper.selectTemByName(temName,type); + } + + @Override + public List searchTemContent(String temName){ + String drugListStr = tempateMapper.selectProList(temName); + String[] drugNameList = drugListStr.split(","); + List drugList = new ArrayList(); + for(int i = 0; i < drugNameList.length; i ++){ + drugList.add(drugMapper.selectDrugByName(drugNameList[i])); + } + return drugList; + } + + @Override + public int updateChufang(String postInfo){ + //System.out.println(postInfo); + int count = 0; + JsonParser jp = new JsonParser(); + JsonObject jo = jp.parse(postInfo).getAsJsonObject(); + String patientId = jo.get("patientId").getAsString(); + JsonArray chufangList = jo.get("chufang").getAsJsonArray(); + for(int i = 0; i < chufangList.size(); i ++){ + JsonObject chufang = chufangList.get(i).getAsJsonObject(); + String prescription = chufang.get("name").getAsString(); + JsonArray drugList = chufang.get("drugList").getAsJsonArray(); + for(int j = 0; j < drugList.size(); j ++) { + JsonObject drug = drugList.get(j).getAsJsonObject(); + //System.out.println(drug); + String drugName = drug.get("name").getAsString(); + int drugId = drugMapper.selectDrugIdByName(drugName); + patient_drug pd = new patient_drug(); + pd.setPatientId(patientId); + pd.setDrugId(drugId); + pd.setDrugNum(drug.get("num").getAsInt()); + pd.setPrescription(prescription); + pd.setDrugDatetime(new Date()); + count += patient_drugMapper.insert(pd); + } + } + return count; + } + + @Override + public int deleteChufang(String postInfo){ + int count = 0; + JsonParser jp = new JsonParser(); + JsonObject jo = jp.parse(postInfo).getAsJsonObject(); + String patientId = jo.get("patientId").getAsString(); + JsonArray chufangList = jo.get("chufang").getAsJsonArray(); + for(int i = 0; i < chufangList.size(); i ++){ + JsonObject chufang = chufangList.get(i).getAsJsonObject(); + String prescription = chufang.get("name").getAsString(); + JsonArray drugList = chufang.get("drugList").getAsJsonArray(); + for(int j = 0; j < drugList.size(); j ++) { + JsonObject drug = drugList.get(j).getAsJsonObject(); + String drugName = drug.get("name").getAsString(); + int drugId = drugMapper.selectDrugIdByName(drugName); + patient_drugKey pdk = new patient_drugKey(); + pdk.setDrugId(drugId); + pdk.setPatientId(patientId); + count += patient_drugMapper.deleteByPrimaryKey(pdk); + } + } + return count; + } + + @Override + public int updateMemberState(String patientId){ + return memberMapper.updateMemberState(patientId); + } } diff --git a/front/src/components/views/MenZhen.vue b/front/src/components/views/MenZhen.vue index caae08d..6c938de 100644 --- a/front/src/components/views/MenZhen.vue +++ b/front/src/components/views/MenZhen.vue @@ -83,7 +83,7 @@

未选中患者

- 诊毕 + 诊毕 @@ -136,6 +136,7 @@ class="tb-edit" highlight-current-row :data="xiData" + :row-class-name="tableRowClassName" @selection-change="handleXiSelectionChange"> @@ -173,6 +174,7 @@ class="tb-edit" highlight-current-row :data="zhongData" + :row-class-name="tableRowClassName" @selection-change="handleZhongSelectionChange"> @@ -225,6 +227,7 @@
@@ -239,18 +242,19 @@ 删除项目 暂存项目 - 开立项目 - 作废项目 + 开立项目 + 作废项目 刷新 本项目金额合计 - 0元 + {{this.jianchaCost}}元 @@ -285,9 +289,14 @@ {{scope.row.price}} - -