Commit 5084fa4f00cfebefba9d6eec20b169a06e8fbc00
1 parent
aacc13d1cb
Exists in
master
and in
6 other branches
听力诊断模块
Showing 5 changed files with 281 additions and 149 deletions
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/PatientService.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/PatientServiceQuery.java
- platform-biz-service/src/main/resources/mainOrm/master/PatientService.xml
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientServiceController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientServiceFacade.java
platform-biz-service/src/main/java/com/lyms/platform/permission/model/PatientService.java
View file @
5084fa4
... | ... | @@ -3,18 +3,55 @@ |
3 | 3 | import java.util.Date; |
4 | 4 | |
5 | 5 | public class PatientService { |
6 | + | |
6 | 7 | private String id; |
8 | + /** | |
9 | + * 孕妇id | |
10 | + */ | |
7 | 11 | private String parentid; |
12 | + /** | |
13 | + * personId | |
14 | + */ | |
8 | 15 | private String pid; |
16 | + /** | |
17 | + * 服务类型(1-高危精准指导、2-体重、3-血糖、4-血压、5-专家咨询) | |
18 | + */ | |
9 | 19 | private Integer serType; |
20 | + /** | |
21 | + * 开通医生 | |
22 | + */ | |
10 | 23 | private String serDoct; |
24 | + /** | |
25 | + * 创建时间 | |
26 | + */ | |
11 | 27 | private Date createDate; |
28 | + /** | |
29 | + * 创建用户名称 | |
30 | + */ | |
12 | 31 | private String createUserName; |
32 | + /** | |
33 | + * 创建用户id | |
34 | + */ | |
13 | 35 | private String createUser; |
36 | + /** | |
37 | + * 服务状态(1-开通、2-退订、3-过期、4-暂停) | |
38 | + */ | |
14 | 39 | private Integer serStatus; |
40 | + /** | |
41 | + * 修改时间 | |
42 | + */ | |
15 | 43 | private Date updateDate; |
44 | + /** | |
45 | + * 修改用户名称 | |
46 | + */ | |
16 | 47 | private String updateUserName; |
48 | + /** | |
49 | + * 修改用户id | |
50 | + */ | |
17 | 51 | private String updateUser; |
52 | + /** | |
53 | + * 医院ID | |
54 | + */ | |
18 | 55 | private String hospitalId; |
19 | 56 | |
20 | 57 | public String getHospitalId() { |
platform-biz-service/src/main/java/com/lyms/platform/permission/model/PatientServiceQuery.java
View file @
5084fa4
... | ... | @@ -13,6 +13,8 @@ |
13 | 13 | private Integer serType; |
14 | 14 | private String serDoct; |
15 | 15 | private Date createDate; |
16 | + private Date createStartDate; | |
17 | + private Date createEndDate; | |
16 | 18 | private String createUserName; |
17 | 19 | private String createUser; |
18 | 20 | private Integer serStatus; |
... | ... | @@ -20,6 +22,22 @@ |
20 | 22 | private String updateUserName; |
21 | 23 | private String updateUser; |
22 | 24 | private String hospitalId; |
25 | + | |
26 | + public Date getCreateStartDate() { | |
27 | + return createStartDate; | |
28 | + } | |
29 | + | |
30 | + public void setCreateStartDate(Date createStartDate) { | |
31 | + this.createStartDate = createStartDate; | |
32 | + } | |
33 | + | |
34 | + public Date getCreateEndDate() { | |
35 | + return createEndDate; | |
36 | + } | |
37 | + | |
38 | + public void setCreateEndDate(Date createEndDate) { | |
39 | + this.createEndDate = createEndDate; | |
40 | + } | |
23 | 41 | |
24 | 42 | public String getHospitalId() { |
25 | 43 | return hospitalId; |
platform-biz-service/src/main/resources/mainOrm/master/PatientService.xml
View file @
5084fa4
... | ... | @@ -2,156 +2,166 @@ |
2 | 2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
3 | 3 | <mapper namespace="com.lyms.platform.permission.dao.master.PatientServiceMapper"> |
4 | 4 | |
5 | -<resultMap id="PatientServiceResultMap" type="com.lyms.platform.permission.model.PatientService"> | |
6 | -<id column="id" property="id" jdbcType="VARCHAR" /> | |
7 | -<result column="parentid" property="parentid" jdbcType="VARCHAR" /> | |
8 | -<result column="pid" property="pid" jdbcType="VARCHAR" /> | |
9 | -<result column="ser_type" property="serType" jdbcType="INTEGER" /> | |
10 | -<result column="ser_doct" property="serDoct" jdbcType="VARCHAR" /> | |
11 | -<result column="create_date" property="createDate" jdbcType="TIMESTAMP" /> | |
12 | -<result column="create_user_name" property="createUserName" jdbcType="VARCHAR" /> | |
13 | -<result column="create_user" property="createUser" jdbcType="VARCHAR" /> | |
14 | -<result column="ser_status" property="serStatus" jdbcType="INTEGER" /> | |
15 | -<result column="update_date" property="updateDate" jdbcType="TIMESTAMP" /> | |
16 | -<result column="update_user_name" property="updateUserName" jdbcType="VARCHAR" /> | |
17 | -<result column="update_user" property="updateUser" jdbcType="VARCHAR" /> | |
18 | -<result column="hospital_id" property="hospitalId" jdbcType="VARCHAR" /> | |
19 | -</resultMap> | |
5 | + <resultMap id="PatientServiceResultMap" type="com.lyms.platform.permission.model.PatientService"> | |
6 | + <id column="id" property="id" jdbcType="VARCHAR"/> | |
7 | + <result column="parentid" property="parentid" jdbcType="VARCHAR"/> | |
8 | + <result column="pid" property="pid" jdbcType="VARCHAR"/> | |
9 | + <result column="ser_type" property="serType" jdbcType="INTEGER"/> | |
10 | + <result column="ser_doct" property="serDoct" jdbcType="VARCHAR"/> | |
11 | + <result column="create_date" property="createDate" jdbcType="TIMESTAMP"/> | |
12 | + <result column="create_user_name" property="createUserName" jdbcType="VARCHAR"/> | |
13 | + <result column="create_user" property="createUser" jdbcType="VARCHAR"/> | |
14 | + <result column="ser_status" property="serStatus" jdbcType="INTEGER"/> | |
15 | + <result column="update_date" property="updateDate" jdbcType="TIMESTAMP"/> | |
16 | + <result column="update_user_name" property="updateUserName" jdbcType="VARCHAR"/> | |
17 | + <result column="update_user" property="updateUser" jdbcType="VARCHAR"/> | |
18 | + <result column="hospital_id" property="hospitalId" jdbcType="VARCHAR"/> | |
19 | + </resultMap> | |
20 | 20 | |
21 | 21 | |
22 | - | |
23 | -<insert id="addPatientService" parameterType="com.lyms.platform.permission.model.PatientService"> | |
22 | + <insert id="addPatientService" parameterType="com.lyms.platform.permission.model.PatientService"> | |
24 | 23 | insert into patient_service (id,parentid,pid,ser_type,ser_doct,create_date,create_user_name,create_user,ser_status,update_date,update_user_name,update_user,hospital_id) values (#{id},#{parentid},#{pid},#{serType},#{serDoct},#{createDate},#{createUserName},#{createUser},#{serStatus},#{updateDate},#{updateUserName},#{updateUser},#{hospitalId}) |
25 | 24 | </insert> |
26 | 25 | |
27 | 26 | |
27 | + <update id="updatePatientService" parameterType="com.lyms.platform.permission.model.PatientService"> | |
28 | + update patient_service | |
29 | + <set> | |
30 | + <if test="parentid != null and parentid != ''"> | |
31 | + parentid = #{parentid,jdbcType=VARCHAR}, | |
32 | + </if> | |
33 | + <if test="pid != null and pid != ''"> | |
34 | + pid = #{pid,jdbcType=VARCHAR}, | |
35 | + </if> | |
36 | + <if test="serType != null and serType >= 0"> | |
37 | + ser_type = #{serType,jdbcType=INTEGER}, | |
38 | + </if> | |
39 | + <if test="serDoct != null and serDoct != ''"> | |
40 | + ser_doct = #{serDoct,jdbcType=VARCHAR}, | |
41 | + </if> | |
42 | + <if test="createDate != null"> | |
43 | + create_date = #{createDate,jdbcType=TIMESTAMP}, | |
44 | + </if> | |
45 | + <if test="createUserName != null and createUserName != ''"> | |
46 | + create_user_name = #{createUserName,jdbcType=VARCHAR}, | |
47 | + </if> | |
48 | + <if test="createUser != null and createUser != ''"> | |
49 | + create_user = #{createUser,jdbcType=VARCHAR}, | |
50 | + </if> | |
51 | + <if test="serStatus != null and serStatus >= 0"> | |
52 | + ser_status = #{serStatus,jdbcType=INTEGER}, | |
53 | + </if> | |
54 | + <if test="updateDate != null"> | |
55 | + update_date = #{updateDate,jdbcType=TIMESTAMP}, | |
56 | + </if> | |
57 | + <if test="updateUserName != null and updateUserName != ''"> | |
58 | + update_user_name = #{updateUserName,jdbcType=VARCHAR}, | |
59 | + </if> | |
60 | + <if test="updateUser != null and updateUser != ''"> | |
61 | + update_user = #{updateUser,jdbcType=VARCHAR}, | |
62 | + </if> | |
63 | + <if test="hospitalId != null and hospitalId != ''"> | |
64 | + hospital_id = #{hospitalId,jdbcType=VARCHAR}, | |
65 | + </if> | |
66 | + </set> | |
67 | + where id = #{id,jdbcType=VARCHAR} | |
68 | + </update> | |
28 | 69 | |
29 | -<update id="updatePatientService" parameterType="com.lyms.platform.permission.model.PatientService"> | |
30 | -update patient_service <set><if test="parentid != null and parentid != ''"> | |
31 | -parentid = #{parentid,jdbcType=VARCHAR}, | |
32 | -</if> | |
33 | -<if test="pid != null and pid != ''"> | |
34 | -pid = #{pid,jdbcType=VARCHAR}, | |
35 | -</if> | |
36 | -<if test="serType != null and serType >= 0"> | |
37 | -ser_type = #{serType,jdbcType=INTEGER}, | |
38 | -</if> | |
39 | -<if test="serDoct != null and serDoct != ''"> | |
40 | -ser_doct = #{serDoct,jdbcType=VARCHAR}, | |
41 | -</if> | |
42 | -<if test="createDate != null"> | |
43 | -create_date = #{createDate,jdbcType=TIMESTAMP}, | |
44 | -</if> | |
45 | -<if test="createUserName != null and createUserName != ''"> | |
46 | -create_user_name = #{createUserName,jdbcType=VARCHAR}, | |
47 | -</if> | |
48 | -<if test="createUser != null and createUser != ''"> | |
49 | -create_user = #{createUser,jdbcType=VARCHAR}, | |
50 | -</if> | |
51 | -<if test="serStatus != null and serStatus >= 0"> | |
52 | -ser_status = #{serStatus,jdbcType=INTEGER}, | |
53 | -</if> | |
54 | -<if test="updateDate != null"> | |
55 | -update_date = #{updateDate,jdbcType=TIMESTAMP}, | |
56 | -</if> | |
57 | -<if test="updateUserName != null and updateUserName != ''"> | |
58 | -update_user_name = #{updateUserName,jdbcType=VARCHAR}, | |
59 | -</if> | |
60 | -<if test="updateUser != null and updateUser != ''"> | |
61 | -update_user = #{updateUser,jdbcType=VARCHAR}, | |
62 | -</if> | |
63 | -<if test="hospitalId != null and hospitalId != ''"> | |
64 | - hospital_id = #{hospitalId,jdbcType=VARCHAR}, | |
65 | -</if> | |
66 | -</set> | |
67 | -where id = #{id,jdbcType=VARCHAR} | |
68 | -</update> | |
69 | 70 | |
70 | - | |
71 | -<delete id="deletePatientService" parameterType="java.lang.String"> | |
71 | + <delete id="deletePatientService" parameterType="java.lang.String"> | |
72 | 72 | delete from patient_service where id = #{id,jdbcType=VARCHAR} |
73 | 73 | </delete> |
74 | 74 | |
75 | 75 | |
76 | - | |
77 | -<select id="getPatientService" resultMap="PatientServiceResultMap" parameterType="java.lang.String"> | |
76 | + <select id="getPatientService" resultMap="PatientServiceResultMap" parameterType="java.lang.String"> | |
78 | 77 | select id,parentid,pid,ser_type,ser_doct,create_date,create_user_name,create_user,ser_status,update_date,update_user_name,update_user,hospital_id |
79 | 78 | from patient_service where id = #{id,jdbcType=VARCHAR} |
80 | 79 | </select> |
81 | 80 | |
82 | 81 | |
83 | -<sql id="orderAndLimit"> | |
84 | -<if test="sort != null and sort != '' "> | |
85 | -order by ${sort} | |
86 | -<if test="need != null"> | |
87 | -limit #{offset, jdbcType=INTEGER} , #{limit, jdbcType=INTEGER} | |
88 | -</if> | |
89 | -</if> | |
90 | -</sql> | |
82 | + <sql id="orderAndLimit"> | |
83 | + <if test="sort != null and sort != '' "> | |
84 | + order by ${sort} | |
85 | + <if test="need != null"> | |
86 | + limit #{offset, jdbcType=INTEGER} , #{limit, jdbcType=INTEGER} | |
87 | + </if> | |
88 | + </if> | |
89 | + </sql> | |
91 | 90 | |
92 | 91 | |
92 | + <sql id="PatientServiceCondition"> | |
93 | + <where> | |
94 | + 1 = 1 | |
95 | + <if test="id != null and id != ''"> | |
96 | + and id = #{id,jdbcType=VARCHAR} | |
97 | + </if> | |
98 | + <if test="parentid != null and parentid != ''"> | |
99 | + and parentid = #{parentid,jdbcType=VARCHAR} | |
100 | + </if> | |
101 | + <if test="pid != null and pid != ''"> | |
102 | + and pid = #{pid,jdbcType=VARCHAR} | |
103 | + </if> | |
104 | + <if test="serType != null and serType >= 0"> | |
105 | + and ser_type = #{serType,jdbcType=INTEGER} | |
106 | + </if> | |
107 | + <if test="serDoct != null and serDoct != ''"> | |
108 | + and ser_doct = #{serDoct,jdbcType=VARCHAR} | |
109 | + </if> | |
110 | + <if test="createDate != null"> | |
111 | + and create_date = #{createDate,jdbcType=TIMESTAMP} | |
112 | + </if> | |
113 | + <if test="createStartDate != null"> | |
114 | + AND | |
115 | + <![CDATA[ | |
116 | + DATEDIFF(#{createStartDate},create_date)<=0 | |
117 | + ]]> | |
118 | + </if> | |
119 | + <if test="createEndDate != null"> | |
120 | + AND | |
121 | + <![CDATA[ | |
122 | + DATEDIFF(#{createEndDate},create_date)>=0 | |
123 | + ]]> | |
124 | + </if> | |
125 | + <if test="createUserName != null and createUserName != ''"> | |
126 | + and create_user_name = #{createUserName,jdbcType=VARCHAR} | |
127 | + </if> | |
128 | + <if test="createUser != null and createUser != ''"> | |
129 | + and create_user = #{createUser,jdbcType=VARCHAR} | |
130 | + </if> | |
131 | + <if test="serStatus != null and serStatus >= 0"> | |
132 | + and ser_status = #{serStatus,jdbcType=INTEGER} | |
133 | + </if> | |
134 | + <if test="updateDate != null"> | |
135 | + and update_date = #{updateDate,jdbcType=TIMESTAMP} | |
136 | + </if> | |
137 | + <if test="updateUserName != null and updateUserName != ''"> | |
138 | + and update_user_name = #{updateUserName,jdbcType=VARCHAR} | |
139 | + </if> | |
140 | + <if test="updateUser != null and updateUser != ''"> | |
141 | + and update_user = #{updateUser,jdbcType=VARCHAR} | |
142 | + </if> | |
143 | + <if test="hospitalId != null and hospitalId != ''"> | |
144 | + and hospital_id = #{hospitalId,jdbcType=VARCHAR} | |
145 | + </if> | |
146 | + </where> | |
147 | + </sql> | |
93 | 148 | |
94 | -<sql id="PatientServiceCondition"> | |
95 | -<where> | |
96 | - 1 = 1 | |
97 | -<if test="id != null and id != ''"> | |
98 | -and id = #{id,jdbcType=VARCHAR} | |
99 | -</if> | |
100 | -<if test="parentid != null and parentid != ''"> | |
101 | -and parentid = #{parentid,jdbcType=VARCHAR} | |
102 | -</if> | |
103 | -<if test="pid != null and pid != ''"> | |
104 | -and pid = #{pid,jdbcType=VARCHAR} | |
105 | -</if> | |
106 | -<if test="serType != null and serType >= 0"> | |
107 | -and ser_type = #{serType,jdbcType=INTEGER} | |
108 | -</if> | |
109 | -<if test="serDoct != null and serDoct != ''"> | |
110 | -and ser_doct = #{serDoct,jdbcType=VARCHAR} | |
111 | -</if> | |
112 | -<if test="createDate != null"> | |
113 | -and create_date = #{createDate,jdbcType=TIMESTAMP} | |
114 | -</if> | |
115 | -<if test="createUserName != null and createUserName != ''"> | |
116 | -and create_user_name = #{createUserName,jdbcType=VARCHAR} | |
117 | -</if> | |
118 | -<if test="createUser != null and createUser != ''"> | |
119 | -and create_user = #{createUser,jdbcType=VARCHAR} | |
120 | -</if> | |
121 | -<if test="serStatus != null and serStatus >= 0"> | |
122 | -and ser_status = #{serStatus,jdbcType=INTEGER} | |
123 | -</if> | |
124 | -<if test="updateDate != null"> | |
125 | -and update_date = #{updateDate,jdbcType=TIMESTAMP} | |
126 | -</if> | |
127 | -<if test="updateUserName != null and updateUserName != ''"> | |
128 | -and update_user_name = #{updateUserName,jdbcType=VARCHAR} | |
129 | -</if> | |
130 | -<if test="updateUser != null and updateUser != ''"> | |
131 | -and update_user = #{updateUser,jdbcType=VARCHAR} | |
132 | -</if> | |
133 | -<if test="hospitalId != null and hospitalId != ''"> | |
134 | -and hospital_id = #{hospitalId,jdbcType=VARCHAR} | |
135 | -</if> | |
136 | -</where> | |
137 | -</sql> | |
138 | 149 | |
150 | + <select id="queryPatientService" resultMap="PatientServiceResultMap" | |
151 | + parameterType="com.lyms.platform.permission.model.PatientServiceQuery"> | |
152 | + select | |
153 | + id,parentid,pid,ser_type,ser_doct,create_date,create_user_name,create_user,ser_status,update_date,update_user_name,update_user,hospital_id | |
154 | + from patient_service | |
155 | + <include refid="PatientServiceCondition"/> | |
156 | + <include refid="orderAndLimit"/> | |
157 | + </select> | |
139 | 158 | |
140 | 159 | |
141 | -<select id="queryPatientService" resultMap="PatientServiceResultMap" parameterType="com.lyms.platform.permission.model.PatientServiceQuery"> | |
142 | -select id,parentid,pid,ser_type,ser_doct,create_date,create_user_name,create_user,ser_status,update_date,update_user_name,update_user,hospital_id | |
143 | - from patient_service | |
144 | -<include refid="PatientServiceCondition" /> | |
145 | -<include refid="orderAndLimit" /> | |
146 | -</select> | |
147 | - | |
148 | - | |
149 | - | |
150 | -<select id="queryPatientServiceCount" resultType="int" parameterType="com.lyms.platform.permission.model.PatientServiceQuery"> | |
151 | -select count(1) from patient_service | |
152 | -<include refid="PatientServiceCondition" /> | |
153 | -</select> | |
154 | - | |
160 | + <select id="queryPatientServiceCount" resultType="int" | |
161 | + parameterType="com.lyms.platform.permission.model.PatientServiceQuery"> | |
162 | + select count(1) from patient_service | |
163 | + <include refid="PatientServiceCondition"/> | |
164 | + </select> | |
155 | 165 | |
156 | 166 | |
157 | 167 | </mapper> |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientServiceController.java
View file @
5084fa4
... | ... | @@ -3,18 +3,18 @@ |
3 | 3 | import com.lyms.platform.common.annotation.TokenRequired; |
4 | 4 | import com.lyms.platform.common.base.BaseController; |
5 | 5 | import com.lyms.platform.common.base.LoginContext; |
6 | +import com.lyms.platform.common.result.BaseListResponse; | |
6 | 7 | import com.lyms.platform.common.result.BaseResponse; |
7 | 8 | import com.lyms.platform.common.utils.StringUtils; |
8 | 9 | import com.lyms.platform.operate.web.facade.PatientServiceFacade; |
10 | +import com.lyms.platform.operate.web.request.BasePageQueryRequest; | |
9 | 11 | import com.lyms.platform.permission.model.PatientService; |
10 | 12 | import org.springframework.beans.factory.annotation.Autowired; |
11 | 13 | import org.springframework.stereotype.Controller; |
12 | -import org.springframework.web.bind.annotation.PathVariable; | |
13 | -import org.springframework.web.bind.annotation.RequestMapping; | |
14 | -import org.springframework.web.bind.annotation.RequestMethod; | |
15 | -import org.springframework.web.bind.annotation.ResponseBody; | |
14 | +import org.springframework.web.bind.annotation.*; | |
16 | 15 | |
17 | 16 | import javax.servlet.http.HttpServletRequest; |
17 | +import java.util.Date; | |
18 | 18 | |
19 | 19 | /** |
20 | 20 | * @auther yangfei |
... | ... | @@ -22,7 +22,6 @@ |
22 | 22 | * @discription |
23 | 23 | */ |
24 | 24 | @Controller |
25 | -@RequestMapping("/patient") | |
26 | 25 | public class PatientServiceController extends BaseController { |
27 | 26 | |
28 | 27 | @Autowired |
... | ... | @@ -63,7 +62,7 @@ |
63 | 62 | @RequestMapping(value = "/patSer", method = RequestMethod.POST) |
64 | 63 | public BaseResponse addOrUpdatePatientService(PatientService ps, HttpServletRequest request){ |
65 | 64 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
66 | - if(StringUtils.isNotEmpty(ps.getId())){ | |
65 | + if(StringUtils.isEmpty(ps.getId())){ | |
67 | 66 | return patientServiceFacade.addPatientService(ps,loginState.getId()); |
68 | 67 | }else{ |
69 | 68 | return patientServiceFacade.updatePatientService(ps,loginState.getId()); |
70 | 69 | |
71 | 70 | |
72 | 71 | |
... | ... | @@ -71,19 +70,40 @@ |
71 | 70 | } |
72 | 71 | |
73 | 72 | /** |
74 | - * 根据Id获取开通继续 | |
73 | + * 根据Id获取开通记录 | |
75 | 74 | * @param id 开通服务id |
76 | - * @param request | |
77 | 75 | * @return |
78 | 76 | */ |
79 | 77 | @ResponseBody |
80 | 78 | @TokenRequired |
81 | 79 | @RequestMapping(value = "/patSer/{id}", method = RequestMethod.GET) |
82 | - public BaseResponse findOnePatientService(@PathVariable String id, HttpServletRequest request){ | |
80 | + public BaseResponse findOnePatientService(@PathVariable String id){ | |
83 | 81 | return patientServiceFacade.findOnePatientService(id); |
84 | 82 | } |
85 | 83 | |
86 | - | |
84 | + /** | |
85 | + * 根据条件查询开通服务记录 | |
86 | + * @param serType 服务类型(1-高危精准指导、2-体重、3-血糖、4-血压、5-专家咨询) | |
87 | + * @param serDoct 服务医生 | |
88 | + * @param createStartDate 开通开始时间 | |
89 | + * @param createEndDate 开通结束时间 | |
90 | + * @param serStatus 开通状态(1-开通、2-退订、3-过期、4-暂停) | |
91 | + * @return | |
92 | + */ | |
93 | + @ResponseBody | |
94 | + @TokenRequired | |
95 | + @RequestMapping(value = "/patSer/list", method = RequestMethod.GET) | |
96 | + public BaseListResponse getPatientService(@RequestParam(value = "serType",required = false) Integer serType, | |
97 | + @RequestParam(value = "serDoct",required = false) String serDoct, | |
98 | + @RequestParam(value = "createStartDate",required = false) Date createStartDate, | |
99 | + @RequestParam(value = "createEndDate",required = false) Date createEndDate, | |
100 | + @RequestParam(value = "serStatus",required = false) Integer serStatus, | |
101 | + BasePageQueryRequest pageInfo, | |
102 | + HttpServletRequest request | |
103 | + ){ | |
104 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
105 | + return patientServiceFacade.getPatientService(serType,serDoct,createStartDate,createEndDate,serStatus,pageInfo,loginState.getId()); | |
106 | + } | |
87 | 107 | |
88 | 108 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientServiceFacade.java
View file @
5084fa4
... | ... | @@ -2,9 +2,11 @@ |
2 | 2 | |
3 | 3 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
4 | 4 | import com.lyms.platform.common.enums.PatientSerEnums; |
5 | +import com.lyms.platform.common.result.BaseListResponse; | |
5 | 6 | import com.lyms.platform.common.result.BaseObjectResponse; |
6 | 7 | import com.lyms.platform.common.result.BaseResponse; |
7 | 8 | import com.lyms.platform.common.utils.DateUtil; |
9 | +import com.lyms.platform.operate.web.request.BasePageQueryRequest; | |
8 | 10 | import com.lyms.platform.operate.web.result.PatientSerResult; |
9 | 11 | import com.lyms.platform.permission.model.PatientService; |
10 | 12 | import com.lyms.platform.permission.model.PatientServiceQuery; |
... | ... | @@ -37,7 +39,7 @@ |
37 | 39 | public BaseResponse patientServiceInit() { |
38 | 40 | Map map = new HashMap(); |
39 | 41 | //服务类型 |
40 | - map.put("serType", PatientSerEnums.getSerType()); | |
42 | + map.put("serTypes", PatientSerEnums.getSerType()); | |
41 | 43 | //服务状态 |
42 | 44 | map.put("serStatus", PatientSerEnums.getSerStatus()); |
43 | 45 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION).setData(map); |
44 | 46 | |
... | ... | @@ -93,9 +95,10 @@ |
93 | 95 | * @param id |
94 | 96 | * @return |
95 | 97 | */ |
96 | - public BaseResponse addPatientService(PatientService ps,Integer id){ | |
98 | + public BaseResponse addPatientService(PatientService ps, Integer id){ | |
97 | 99 | //根据用户id获取医院ID |
98 | 100 | String hospitalId = autoMatchFacade.getHospitalId(id); |
101 | + ps.setId(UUID.randomUUID().toString().replace("-","")); | |
99 | 102 | ps.setHospitalId(hospitalId); |
100 | 103 | ps.setCreateDate(new Date()); |
101 | 104 | ps.setCreateUser(String.valueOf(id)); |
... | ... | @@ -132,6 +135,9 @@ |
132 | 135 | * @return |
133 | 136 | */ |
134 | 137 | public PatientSerResult convertToResult(PatientService ps){ |
138 | + if(ps==null){ | |
139 | + return null; | |
140 | + } | |
135 | 141 | PatientSerResult result = new PatientSerResult(); |
136 | 142 | result.setId(ps.getId()); |
137 | 143 | result.setParentid(ps.getParentid()); |
... | ... | @@ -153,6 +159,47 @@ |
153 | 159 | } |
154 | 160 | result.setSerDoct(ps.getSerDoct()); |
155 | 161 | return result; |
162 | + } | |
163 | + | |
164 | + /** | |
165 | + * 根据条件查询开通服务记录 | |
166 | + * @param serType 服务类型(1-高危精准指导、2-体重、3-血糖、4-血压、5-专家咨询) | |
167 | + * @param serDoct 服务医生 | |
168 | + * @param createStartDate 开通开始时间 | |
169 | + * @param createEndDate 开通结束时间 | |
170 | + * @param pageInfo 分页信息 | |
171 | + * @param serStatus 开通状态(1-开通、2-退订、3-过期、4-暂停) | |
172 | + * @return | |
173 | + */ | |
174 | + public BaseListResponse getPatientService(Integer serType, String serDoct, Date createStartDate, Date createEndDate, Integer serStatus, BasePageQueryRequest pageInfo,Integer id) { | |
175 | +//根据用户id获取医院ID | |
176 | + String hospitalId = autoMatchFacade.getHospitalId(id); | |
177 | + PatientServiceQuery patientQuery = new PatientServiceQuery(); | |
178 | + patientQuery.setHospitalId(hospitalId); | |
179 | + patientQuery.setSerType(serType); | |
180 | + patientQuery.setSerDoct(serDoct); | |
181 | + patientQuery.setCreateStartDate(createStartDate); | |
182 | + patientQuery.setCreateEndDate(createEndDate); | |
183 | + patientQuery.setSerStatus(serStatus); | |
184 | + patientQuery.setSort("create_date"); | |
185 | + patientQuery.setNeed("y"); | |
186 | + patientQuery.setOffset((pageInfo.getPage()-1)*pageInfo.getLimit()); | |
187 | + patientQuery.setLimit(pageInfo.getLimit()); | |
188 | + patientQuery.setPage(pageInfo.getPage()); | |
189 | + List<PatientService> patientServices = patientServiceService.queryPatientService(patientQuery); | |
190 | + | |
191 | + List<PatientSerResult> patientSerResults = new ArrayList<>(); | |
192 | + for(PatientService ps : patientServices){ | |
193 | + PatientSerResult patientSerResult = convertToResult(ps); | |
194 | + patientSerResults.add(patientSerResult); | |
195 | + } | |
196 | + | |
197 | + BaseListResponse baseResponse = new BaseListResponse(); | |
198 | + baseResponse.setData(patientSerResults); | |
199 | + baseResponse.setPageInfo(patientQuery.getPageInfo()); | |
200 | + baseResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
201 | + baseResponse.setErrormsg("成功"); | |
202 | + return baseResponse; | |
156 | 203 | } |
157 | 204 | } |