Commit d96715dd6184e42946d97461e6139b4579d36b55
1 parent
0718acb9ec
Exists in
master
and in
6 other branches
叶酸查询update
Showing 12 changed files with 756 additions and 109 deletions
- platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/FolviteMapper.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/FolviteReceiveMapper.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/FolviteQuery.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/FolviteRecordQuery.java
- platform-biz-service/src/main/resources/mainOrm/master/FolviteMapper.xml
- platform-biz-service/src/main/resources/mainOrm/master/FolviteReceiveMapper.xml
- platform-dal/src/main/java/com/lyms/platform/pojo/FolviteReceiveRecordModel.java
- platform-dal/src/main/java/com/lyms/platform/pojo/FolviteRecordModel.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/FolviteController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/FolviteService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/IBaseService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/FolviteServiceImpl.java
platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/FolviteMapper.java
View file @
d96715d
... | ... | @@ -3,7 +3,9 @@ |
3 | 3 | import com.lyms.platform.permission.model.FolviteQuery; |
4 | 4 | import com.lyms.platform.pojo.FolviteRecordModel; |
5 | 5 | |
6 | +import java.util.List; | |
6 | 7 | |
8 | + | |
7 | 9 | public interface FolviteMapper { |
8 | 10 | /** |
9 | 11 | * 查询叶酸建档记录 |
... | ... | @@ -11,5 +13,35 @@ |
11 | 13 | * @return |
12 | 14 | */ |
13 | 15 | FolviteRecordModel queryOne(FolviteQuery query); |
16 | + | |
17 | + /** | |
18 | + * 保存叶酸建档记录 | |
19 | + * | |
20 | + * @param recordModel | |
21 | + */ | |
22 | + void saveFolvite(FolviteRecordModel recordModel); | |
23 | + | |
24 | + /** | |
25 | + * 修改叶酸建档记录 | |
26 | + * | |
27 | + * @param recordModel | |
28 | + */ | |
29 | + void updateFolvite(FolviteRecordModel recordModel); | |
30 | + | |
31 | + /** | |
32 | + * 叶酸查询List | |
33 | + * | |
34 | + * @param query | |
35 | + * @return | |
36 | + */ | |
37 | + | |
38 | + List<FolviteRecordModel> queryFolviteList(FolviteQuery query); | |
39 | + | |
40 | + /** | |
41 | + * 查询总条数 | |
42 | + * @param query | |
43 | + * @return | |
44 | + */ | |
45 | + int queryFolviteListCount(FolviteQuery query); | |
14 | 46 | } |
platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/FolviteReceiveMapper.java
View file @
d96715d
1 | +package com.lyms.platform.permission.dao.master; | |
2 | + | |
3 | +import com.lyms.platform.permission.model.FolviteRecordQuery; | |
4 | +import com.lyms.platform.pojo.FolviteReceiveRecordModel; | |
5 | + | |
6 | +import java.util.List; | |
7 | + | |
8 | +/** | |
9 | + * @author: shuai-Bo | |
10 | + * @Date: 2019/10/30 0030 | |
11 | + * @Time: 14:54 | |
12 | + */ | |
13 | +public interface FolviteReceiveMapper { | |
14 | + | |
15 | + void saveFolviteReceive(FolviteReceiveRecordModel receiveRecordModel); | |
16 | + | |
17 | + void updaetFolviteReceive(FolviteReceiveRecordModel receiveRecordModel); | |
18 | + | |
19 | + FolviteReceiveRecordModel queryOneReceive(String id); | |
20 | + | |
21 | + List<FolviteReceiveRecordModel> queryFolviteReceiveList(FolviteRecordQuery query); | |
22 | + | |
23 | + int queyFolviteReceiveCount(FolviteRecordQuery query); | |
24 | +} |
platform-biz-service/src/main/java/com/lyms/platform/permission/model/FolviteQuery.java
View file @
d96715d
... | ... | @@ -26,6 +26,17 @@ |
26 | 26 | //建档医院 |
27 | 27 | private String hospitalId; |
28 | 28 | |
29 | + //妇女建档id | |
30 | + private String womanId; | |
31 | + | |
32 | + public String getWomanId() { | |
33 | + return womanId; | |
34 | + } | |
35 | + | |
36 | + public void setWomanId(String womanId) { | |
37 | + this.womanId = womanId; | |
38 | + } | |
39 | + | |
29 | 40 | public String getHospitalId() { |
30 | 41 | return hospitalId; |
31 | 42 | } |
platform-biz-service/src/main/java/com/lyms/platform/permission/model/FolviteRecordQuery.java
View file @
d96715d
1 | +package com.lyms.platform.permission.model; | |
2 | + | |
3 | +import com.lyms.platform.common.dao.BaseQuery; | |
4 | + | |
5 | +/** | |
6 | + * @author: shuai-Bo | |
7 | + * @Date: 2019/10/30 0030 | |
8 | + * @Time: 17:46 | |
9 | + */ | |
10 | +public class FolviteRecordQuery extends BaseQuery { | |
11 | + | |
12 | + //叶酸建档id | |
13 | + private String folviteId; | |
14 | + | |
15 | + | |
16 | + public String getFolviteId() { | |
17 | + return folviteId; | |
18 | + } | |
19 | + | |
20 | + public void setFolviteId(String folviteId) { | |
21 | + this.folviteId = folviteId; | |
22 | + } | |
23 | +} |
platform-biz-service/src/main/resources/mainOrm/master/FolviteMapper.xml
View file @
d96715d
... | ... | @@ -2,8 +2,46 @@ |
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.FolviteMapper"> |
4 | 4 | |
5 | - <select id="queryOne" resultType="com.lyms.platform.pojo.FolviteRecordModel" | |
6 | - parameterType="com.lyms.platform.permission.model.FolviteQuery"> | |
5 | + <resultMap id="folviteResultMap" type="com.lyms.platform.pojo.FolviteRecordModel"> | |
6 | + <result column="id" property="id"/> | |
7 | + <result column="name" property="name"/> | |
8 | + <result column="sex" property="sex"/> | |
9 | + <result column="birthday" property="birthday"/> | |
10 | + <result column="nationality" property="nationality"/> | |
11 | + <result column="nation" property="nation"/> | |
12 | + <result column="marital_status" property="maritalStatus"/> | |
13 | + <result column="certificate_type" property="certificateType"/> | |
14 | + <result column="card_no" property="cardNo"/> | |
15 | + <result column="census_type" property="censusType"/> | |
16 | + <result column="live_type" property="liveType"/> | |
17 | + <result column="education" property="education"/> | |
18 | + <result column="occupation" property="occupation"/> | |
19 | + <result column="phone" property="phone"/> | |
20 | + <result column="work_unit" property="workUnit"/> | |
21 | + <result column="habitation_province" property="habitationProvince"/> | |
22 | + <result column="habitation_city" property="habitationCity"/> | |
23 | + <result column="habitation_area" property="habitationArea"/> | |
24 | + <result column="habitation_country" property="habitationCountry"/> | |
25 | + <result column="habitation_address" property="habitationAddress"/> | |
26 | + <result column="domicile_province" property="domicileProvince"/> | |
27 | + <result column="domicile_city" property="domicileCity"/> | |
28 | + <result column="domicile_area" property="domicileArea"/> | |
29 | + <result column="domicile_country" property="domicileCountry"/> | |
30 | + <result column="domicile_address" property="domicileAddress"/> | |
31 | + <result column="woman_id" property="womanId"/> | |
32 | + <result column="isconceive" property="isconceive"/> | |
33 | + <result column="lastmenstrual" property="lastmenstrual"/> | |
34 | + <result column="ispregnancy" property="ispregnancy"/> | |
35 | + <result column="operation_doctor" property="operationDoctor"/> | |
36 | + <result column="created" property="created"/> | |
37 | + <result column="vc_card" property="vcCard"/> | |
38 | + <result column="hospitalid" property="hospitalId"/> | |
39 | + <result column="modify" property="modify"/> | |
40 | + <result column="receivesum" property="receiveSum"/> | |
41 | + </resultMap> | |
42 | + | |
43 | + | |
44 | + <select id="queryOne" parameterType="com.lyms.platform.permission.model.FolviteQuery" resultMap="folviteResultMap"> | |
7 | 45 | SELECT |
8 | 46 | id AS id, |
9 | 47 | NAME AS NAME, |
10 | 48 | |
11 | 49 | |
12 | 50 | |
... | ... | @@ -36,85 +74,145 @@ |
36 | 74 | ispregnancy AS ispregnancy, |
37 | 75 | operation_doctor AS operationDoctor, |
38 | 76 | created AS created, |
39 | - vc_card AS vcCard | |
77 | + vc_card AS vcCard, | |
78 | + receivesum as receiveSum, | |
79 | + hospitalid as hospitalId | |
40 | 80 | FROM |
41 | 81 | lyms_folvite_Info |
42 | 82 | <include refid="sqlWhere"/> |
43 | 83 | </select> |
44 | 84 | |
45 | - <insert id="folviteSave" parameterType="com.lyms.platform.pojo.FolviteRecordModel"> | |
46 | -INSERT INTO lyms_folvite_Info( | |
47 | - id, | |
48 | - name, | |
49 | - sex, | |
50 | - birthday, | |
51 | - nationality, | |
52 | - nation, | |
53 | - marital_status, | |
54 | - certificate_type, | |
55 | - card_no, | |
56 | - census_type, | |
57 | - live_type, | |
58 | - education, | |
59 | - occupation, | |
60 | - phone, | |
61 | - work_unit, | |
62 | - habitation_province, | |
63 | - habitation_city, | |
64 | - habitation_area, | |
65 | - habitation_country, | |
66 | - habitation_address, | |
67 | - domicile_province, | |
68 | - domicile_city, | |
69 | - domicile_area, | |
70 | - domicile_country, | |
71 | - domicile_address, | |
72 | - woman_id, | |
73 | - isconceive, | |
74 | - lastmenstrual, | |
75 | - ispregnancy, | |
76 | - operation_doctor, | |
77 | - created, | |
78 | - vc_card ) | |
79 | - VALUES ( | |
80 | - #{id,jdbcType=INTEGER}, | |
81 | - #{name,jdbcType=VARCHAR}, | |
82 | - #{sex,jdbcType=BIGINT}, | |
83 | - #{birthday,jdbcType=TIMESTAMP}, | |
84 | - #{nationality,jdbcType=VARCHAR}, | |
85 | - #{nation,jdbcType=VARCHAR}, | |
86 | - #{maritalStatus,jdbcType=VARCHAR}, | |
87 | - #{certificateType,jdbcType=VARCHAR}, | |
88 | - #{cardNo,jdbcType=VARCHAR}, | |
89 | - #{censusType,jdbcType=VARCHAR}, | |
90 | - #{liveType,jdbcType=VARCHAR}, | |
91 | - #{education,jdbcType=VARCHAR}, | |
92 | - #{occupation,jdbcType=VARCHAR}, | |
93 | - #{phone,jdbcType=VARCHAR}, | |
94 | - #{workUnit,jdbcType=VARCHAR}, | |
95 | - #{habitationProvince,jdbcType=VARCHAR}, | |
96 | - #{habitationCity,jdbcType=VARCHAR}, | |
97 | - #{habitationArea,jdbcType=VARCHAR}, | |
98 | - #{habitationCountry,jdbcType=VARCHAR}, | |
99 | - #{habitationAddress,jdbcType=VARCHAR}, | |
100 | - #{domicileProvince,jdbcType=VARCHAR}, | |
101 | - #{domicileCity,jdbcType=VARCHAR}, | |
102 | - #{domicileArea,jdbcType=VARCHAR}, | |
103 | - #{domicileCountry,jdbcType=VARCHAR}, | |
104 | - #{domicileAddress,jdbcType=VARCHAR}, | |
105 | - #{womanId,jdbcType=VARCHAR}, | |
106 | - #{isconceive,jdbcType=BIGINT}, | |
107 | - #{lastmenstrual,jdbcType=TIMESTAMP}, | |
108 | - #{ispregnancy,jdbcType=BIGINT}, | |
109 | - #{operationDoctor,jdbcType=VARCHAR}, | |
110 | - #{created,jdbcType=TIMESTAMP}, | |
111 | - #{vcCard,jdbcType=VARCHAR}) | |
85 | + <select id="queryFolviteListCount" parameterType="com.lyms.platform.permission.model.FolviteQuery" resultType="java.lang.Integer"> | |
86 | + select count(id) from lyms_folvite_Info | |
87 | + <include refid="sqlWhere"/> | |
88 | + </select> | |
89 | + | |
90 | + | |
91 | + | |
92 | + <select id="queryFolviteList" parameterType="com.lyms.platform.permission.model.FolviteQuery" resultMap="folviteResultMap"> | |
93 | + SELECT | |
94 | + id AS id, | |
95 | + NAME AS NAME, | |
96 | + sex AS sex, | |
97 | + birthday AS birthday, | |
98 | + nationality AS nationality, | |
99 | + nation AS nation, | |
100 | + marital_status AS maritalStatus, | |
101 | + certificate_type AS certificateType, | |
102 | + card_no AS cardNo, | |
103 | + census_type AS censusType, | |
104 | + live_type AS liveType, | |
105 | + education AS education, | |
106 | + occupation AS occupation, | |
107 | + phone AS phone, | |
108 | + work_unit AS workUnit, | |
109 | + habitation_province AS habitationProvince, | |
110 | + habitation_city AS habitationCity, | |
111 | + habitation_area AS habitationArea, | |
112 | + habitation_country AS habitationCountry, | |
113 | + habitation_address AS habitationAddress, | |
114 | + domicile_province AS domicileProvince, | |
115 | + domicile_city AS domicileCity, | |
116 | + domicile_area AS domicileArea, | |
117 | + domicile_country AS domicileCountry, | |
118 | + domicile_address AS domicileAddress, | |
119 | + woman_id AS womanId, | |
120 | + isconceive AS isconceive, | |
121 | + lastmenstrual AS lastmenstrual, | |
122 | + ispregnancy AS ispregnancy, | |
123 | + operation_doctor AS operationDoctor, | |
124 | + created AS created, | |
125 | + vc_card AS vcCard, | |
126 | + receivesum as receiveSum, | |
127 | + hospitalid as hospitalId | |
128 | + FROM | |
129 | + lyms_folvite_Info | |
130 | + <include refid="whereSql"/> | |
131 | + <include refid="orderAndLimit"/> | |
132 | + </select> | |
133 | + | |
134 | + <insert id="saveFolvite" parameterType="com.lyms.platform.pojo.FolviteRecordModel"> | |
135 | +INSERT INTO lyms_folvite_Info ( | |
136 | + id, | |
137 | + NAME, | |
138 | + sex, | |
139 | + birthday, | |
140 | + nationality, | |
141 | + nation, | |
142 | + marital_status, | |
143 | + certificate_type, | |
144 | + card_no, | |
145 | + census_type, | |
146 | + live_type, | |
147 | + education, | |
148 | + occupation, | |
149 | + phone, | |
150 | + work_unit, | |
151 | + habitation_province, | |
152 | + habitation_city, | |
153 | + habitation_area, | |
154 | + habitation_country, | |
155 | + habitation_address, | |
156 | + domicile_province, | |
157 | + domicile_city, | |
158 | + domicile_area, | |
159 | + domicile_country, | |
160 | + domicile_address, | |
161 | + woman_id, | |
162 | + isconceive, | |
163 | + lastmenstrual, | |
164 | + ispregnancy, | |
165 | + operation_doctor, | |
166 | + created, | |
167 | + vc_card, | |
168 | + hospitalid, | |
169 | + receivesum | |
170 | +) | |
171 | +VALUES | |
172 | + ( | |
173 | + #{id,jdbcType=VARCHAR}, | |
174 | + #{name,jdbcType=VARCHAR}, | |
175 | + #{sex,jdbcType=BIGINT}, | |
176 | + #{birthday,jdbcType=TIMESTAMP}, | |
177 | + #{nationality,jdbcType=VARCHAR}, | |
178 | + #{nation,jdbcType=VARCHAR}, | |
179 | + #{maritalStatus,jdbcType=VARCHAR}, | |
180 | + #{certificateType,jdbcType=VARCHAR}, | |
181 | + #{cardNo,jdbcType=VARCHAR}, | |
182 | + #{censusType,jdbcType=VARCHAR}, | |
183 | + #{liveType,jdbcType=VARCHAR}, | |
184 | + #{education,jdbcType=VARCHAR}, | |
185 | + #{occupation,jdbcType=VARCHAR}, | |
186 | + #{phone,jdbcType=VARCHAR}, | |
187 | + #{workUnit,jdbcType=VARCHAR}, | |
188 | + #{habitationProvince,jdbcType=VARCHAR}, | |
189 | + #{habitationCity,jdbcType=VARCHAR}, | |
190 | + #{habitationArea,jdbcType=VARCHAR}, | |
191 | + #{habitationCountry,jdbcType=VARCHAR}, | |
192 | + #{habitationAddress,jdbcType=VARCHAR}, | |
193 | + #{domicileProvince,jdbcType=VARCHAR}, | |
194 | + #{domicileCity,jdbcType=VARCHAR}, | |
195 | + #{domicileArea,jdbcType=VARCHAR}, | |
196 | + #{domicileCountry,jdbcType=VARCHAR}, | |
197 | + #{domicileAddress,jdbcType=VARCHAR}, | |
198 | + #{womanId,jdbcType=VARCHAR}, | |
199 | + #{isconceive,jdbcType=BIGINT}, | |
200 | + #{lastmenstrual,jdbcType=TIMESTAMP}, | |
201 | + #{ispregnancy,jdbcType=BIGINT}, | |
202 | + #{operationDoctor,jdbcType=VARCHAR}, | |
203 | + #{created,jdbcType=TIMESTAMP}, | |
204 | + #{vcCard,jdbcType=VARCHAR}, | |
205 | + #{hospitalid,jdbcType=VARCHAR}, | |
206 | + #{receivesum,jdbcType=INTEGER}) | |
112 | 207 | </insert> |
113 | 208 | |
114 | 209 | |
115 | - <sql id="sqlWhere"> | |
210 | + <sql id="whereSql"> | |
116 | 211 | <where> |
117 | 212 | 1=1 |
213 | + <if test="id != null and id !=''"> | |
214 | + and id=#{id,jdbcType=VARCHAR} | |
215 | + </if> | |
118 | 216 | <if test="certificateType != null and certificateType !='' "> |
119 | 217 | and certificate_type=#{certificateType,jdbcType=VARCHAR} |
120 | 218 | </if> |
... | ... | @@ -133,7 +231,7 @@ |
133 | 231 | </where> |
134 | 232 | </sql> |
135 | 233 | |
136 | - <update id="folviteUpdate" parameterType="com.lyms.platform.pojo.FolviteRecordModel"> | |
234 | + <update id="updateFolvite" parameterType="com.lyms.platform.pojo.FolviteRecordModel"> | |
137 | 235 | UPDATE lyms_folvite_Info |
138 | 236 | <include refid="columnUpdate"/> |
139 | 237 | where id = #{id} |
... | ... | @@ -141,9 +239,6 @@ |
141 | 239 | |
142 | 240 | <sql id="columnUpdate"> |
143 | 241 | <set> |
144 | - <if test="id != null"> | |
145 | - id=#{id,jdbcType=INTEGER}, | |
146 | - </if> | |
147 | 242 | <if test="name != null"> |
148 | 243 | name=#{name,jdbcType=VARCHAR}, |
149 | 244 | </if> |
150 | 245 | |
... | ... | @@ -237,8 +332,28 @@ |
237 | 332 | <if test="vcCard != null"> |
238 | 333 | vc_card=#{vcCard,jdbcType=VARCHAR}, |
239 | 334 | </if> |
335 | + <if test="hospitalid != null"> | |
336 | + hospitalid=#{hospitalid,jdbcType=VARCHAR}, | |
337 | + </if> | |
338 | + <if test="receivesum != null"> | |
339 | + receivesum=#{receivesum,jdbcType=INTEGER}, | |
340 | + </if> | |
341 | + <if test="modify != null"> | |
342 | + modify=#{modify,jdbcType=TIMESTAMP}, | |
343 | + </if> | |
344 | + | |
240 | 345 | </set> |
241 | 346 | </sql> |
347 | + | |
348 | + <sql id="orderAndLimit"> | |
349 | + <if test="sort != null and sort != '' "> | |
350 | + order by ${sort} | |
351 | + <if test="need != null"> | |
352 | + limit #{offset, jdbcType=INTEGER} , #{limit, jdbcType=INTEGER} | |
353 | + </if> | |
354 | + </if> | |
355 | + </sql> | |
356 | + | |
242 | 357 | |
243 | 358 | </mapper> |
platform-biz-service/src/main/resources/mainOrm/master/FolviteReceiveMapper.xml
View file @
d96715d
1 | +<?xml version="1.0" encoding="UTF-8" ?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > | |
3 | +<mapper namespace="com.lyms.platform.permission.dao.master.FolviteReceiveMapper"> | |
4 | + | |
5 | + <resultMap id="folviteReceiveResultMap" type="com.lyms.platform.pojo.FolviteRecordModel"> | |
6 | + <result column="id" property="id"/> | |
7 | + <result column="folvite_id" property="folviteId"/> | |
8 | + <result column="receive_number" property="receiveNumber"/> | |
9 | + <result column="receive_week" property="receiveWeek"/> | |
10 | + <result column="highrisk" property="highrisk"/> | |
11 | + <result column="provide_unit" property="provideUnit"/> | |
12 | + <result column="issuer" property="issuer"/> | |
13 | + <result column="receive_date" property="receiveDate"/> | |
14 | + <result column="creation_date" property="creationDate"/> | |
15 | + <result column="modified" property="modified"/> | |
16 | + </resultMap> | |
17 | + | |
18 | + <insert id="saveFolviteReceive" parameterType="com.lyms.platform.pojo.FolviteReceiveRecordModel"> | |
19 | +INSERT INTO lyms_folvite_provide ( | |
20 | + id, | |
21 | + folvite_id, | |
22 | + receive_number, | |
23 | + receive_week, | |
24 | + highrisk, | |
25 | + provide_unit, | |
26 | + ISSUER, | |
27 | + receive_date, | |
28 | + creation_date, | |
29 | + modified | |
30 | +) | |
31 | +VALUES | |
32 | + ( | |
33 | + #{id,jdbcType=VARCHAR}, | |
34 | + #{folviteId,jdbcType=VARCHAR}, | |
35 | + #{receiveNumber,jdbcType=INTEGER}, | |
36 | + #{receiveWeek,jdbcType=INTEGER}, | |
37 | + #{highrisk,jdbcType=VARCHAR}, | |
38 | + #{provideUnit,jdbcType=VARCHAR}, | |
39 | + #{issuer,jdbcType=VARCHAR}, | |
40 | + #{receiveDate,jdbcType=TIMESTAMP}, | |
41 | + #{creationDate,jdbcType=TIMESTAMP}, | |
42 | + #{modified,jdbcType=TIMESTAMP}) | |
43 | + </insert> | |
44 | + | |
45 | + <select id="queryFolviteReceiveList" parameterType="com.lyms.platform.permission.model.FolviteRecordQuery" resultMap="folviteReceiveResultMap"> | |
46 | + SELECT | |
47 | + id AS id, | |
48 | + folvite_id AS folviteId, | |
49 | + receive_number AS receiveNumber, | |
50 | + receive_week AS receiveWeek, | |
51 | + highrisk AS highrisk, | |
52 | + provide_unit AS provideUnit, | |
53 | + ISSUER AS ISSUER, | |
54 | + receive_date AS receiveDate, | |
55 | + creation_date AS creationDate, | |
56 | + modified AS modified | |
57 | + FROM | |
58 | + lyms_folvite_provide | |
59 | + <include refid="whereSql"/> | |
60 | + <include refid="orderAndLimit"/> | |
61 | + </select> | |
62 | + | |
63 | + <select id="queyFolviteReceiveCount" parameterType="com.lyms.platform.permission.model.FolviteRecordQuery" | |
64 | + resultType="java.lang.Integer"> | |
65 | + select count(id) from lyms_folvite_provide | |
66 | + <include refid="whereSql"/> | |
67 | + | |
68 | + </select> | |
69 | + | |
70 | + <sql id="whereSql"> | |
71 | + 1=1 | |
72 | + <where> | |
73 | + | |
74 | + | |
75 | + </where> | |
76 | + | |
77 | + | |
78 | + </sql> | |
79 | + | |
80 | + <update id="updaetFolviteReceive" parameterType="com.lyms.platform.pojo.FolviteReceiveRecordModel"> | |
81 | + UPDATE lyms_folvite_provide | |
82 | + <include refid="columnUpdate"/> | |
83 | + where id=#{id,jdbcType=VARCHAR} | |
84 | + </update> | |
85 | + | |
86 | + <sql id="columnUpdate"> | |
87 | + | |
88 | + <set> | |
89 | + <if test="id != null"> | |
90 | + id=#{id,jdbcType=VARCHAR}, | |
91 | + </if> | |
92 | + <if test="folviteId != null"> | |
93 | + folvite_id=#{folviteId,jdbcType=VARCHAR}, | |
94 | + </if> | |
95 | + <if test="receiveNumber != null"> | |
96 | + receive_number=#{receiveNumber,jdbcType=INTEGER}, | |
97 | + </if> | |
98 | + <if test="receiveWeek != null"> | |
99 | + receive_week=#{receiveWeek,jdbcType=INTEGER}, | |
100 | + </if> | |
101 | + <if test="highrisk != null"> | |
102 | + highrisk=#{highrisk,jdbcType=VARCHAR}, | |
103 | + </if> | |
104 | + <if test="provideUnit != null"> | |
105 | + provide_unit=#{provideUnit,jdbcType=VARCHAR}, | |
106 | + </if> | |
107 | + <if test="issuer != null"> | |
108 | + issuer=#{issuer,jdbcType=VARCHAR}, | |
109 | + </if> | |
110 | + <if test="receiveDate != null"> | |
111 | + receive_date=#{receiveDate,jdbcType=TIMESTAMP}, | |
112 | + </if> | |
113 | + <if test="creationDate != null"> | |
114 | + reation_date=#{creationDate,jdbcType=TIMESTAMP}, | |
115 | + </if> | |
116 | + <if test="modified != null"> | |
117 | + modified=#{modified,jdbcType=TIMESTAMP}, | |
118 | + </if> | |
119 | + </set> | |
120 | + </sql> | |
121 | + | |
122 | + <select id="queryOneReceive" parameterType="java.lang.String" | |
123 | + resultType="com.lyms.platform.pojo.FolviteReceiveRecordModel"> | |
124 | +SELECT | |
125 | + id AS id, | |
126 | + folvite_id AS folviteId, | |
127 | + receive_number AS receiveNumber, | |
128 | + receive_week AS receiveWeek, | |
129 | + highrisk AS highrisk, | |
130 | + provide_unit AS provideUnit, | |
131 | + ISSUER AS ISSUER, | |
132 | + receive_date AS receiveDate, | |
133 | + creation_date AS creationDate, | |
134 | + modified AS modified | |
135 | +FROM | |
136 | + lyms_folvite_provide | |
137 | +where id=#{id,jdbcType=VARCHAR} | |
138 | + | |
139 | + </select> | |
140 | + | |
141 | + <sql id="orderAndLimit"> | |
142 | + <if test="sort != null and sort != '' "> | |
143 | + order by ${sort} | |
144 | + <if test="need != null"> | |
145 | + limit #{offset, jdbcType=INTEGER} , #{limit, jdbcType=INTEGER} | |
146 | + </if> | |
147 | + </if> | |
148 | + </sql> | |
149 | +</mapper> |
platform-dal/src/main/java/com/lyms/platform/pojo/FolviteReceiveRecordModel.java
View file @
d96715d
... | ... | @@ -22,8 +22,11 @@ |
22 | 22 | private long receiveNumber; |
23 | 23 | |
24 | 24 | //领取孕周 |
25 | - private long receiveWeek; | |
25 | + private Integer receiveWeek; | |
26 | 26 | |
27 | + //孕前还是孕后 0 孕前 1孕后 | |
28 | + private Integer isconceive; | |
29 | + | |
27 | 30 | //高危风险因素 |
28 | 31 | private String highrisk; |
29 | 32 | |
30 | 33 | |
31 | 34 | |
32 | 35 | |
33 | 36 | |
34 | 37 | |
... | ... | @@ -33,18 +36,48 @@ |
33 | 36 | //发放人 |
34 | 37 | private String Issuer; |
35 | 38 | |
36 | - //发放日期 | |
39 | + //领取日期 | |
37 | 40 | private Date receiveDate; |
38 | 41 | |
39 | 42 | //创建日期 |
40 | 43 | private Date creationDate; |
41 | 44 | |
45 | + //修改日期 | |
46 | + private Date modified; | |
42 | 47 | |
48 | + //医院id | |
49 | + private String hospitalId; | |
50 | + | |
51 | + | |
52 | + public String getHospitalId() { | |
53 | + return hospitalId; | |
54 | + } | |
55 | + | |
56 | + public void setHospitalId(String hospitalId) { | |
57 | + this.hospitalId = hospitalId; | |
58 | + } | |
59 | + | |
60 | + public Date getModified() { | |
61 | + return modified; | |
62 | + } | |
63 | + | |
64 | + public void setModified(Date modified) { | |
65 | + this.modified = modified; | |
66 | + } | |
67 | + | |
43 | 68 | public FolviteReceiveRecordModel() { |
44 | - id = UUID.randomUUID().toString().replace("-", ""); | |
69 | + | |
70 | + | |
45 | 71 | } |
46 | 72 | |
73 | + public Integer getIsconceive() { | |
74 | + return isconceive; | |
75 | + } | |
47 | 76 | |
77 | + public void setIsconceive(Integer isconceive) { | |
78 | + this.isconceive = isconceive; | |
79 | + } | |
80 | + | |
48 | 81 | public String getId() { |
49 | 82 | return this.id; |
50 | 83 | } |
51 | 84 | |
... | ... | @@ -72,12 +105,11 @@ |
72 | 105 | this.receiveNumber = receiveNumber; |
73 | 106 | } |
74 | 107 | |
75 | - public long getReceiveWeek() { | |
76 | - return this.receiveWeek; | |
108 | + public Integer getReceiveWeek() { | |
109 | + return receiveWeek; | |
77 | 110 | } |
78 | 111 | |
79 | - | |
80 | - public void setReceiveWeek(long receiveWeek) { | |
112 | + public void setReceiveWeek(Integer receiveWeek) { | |
81 | 113 | this.receiveWeek = receiveWeek; |
82 | 114 | } |
83 | 115 |
platform-dal/src/main/java/com/lyms/platform/pojo/FolviteRecordModel.java
View file @
d96715d
... | ... | @@ -17,7 +17,7 @@ |
17 | 17 | //叶酸:建档用户姓名 |
18 | 18 | private String name; |
19 | 19 | |
20 | - //建档医生id | |
20 | + //建档医院id | |
21 | 21 | private String hospitalId; |
22 | 22 | |
23 | 23 | //性别 |
24 | 24 | |
25 | 25 | |
26 | 26 | |
... | ... | @@ -93,23 +93,57 @@ |
93 | 93 | private String womanId; |
94 | 94 | |
95 | 95 | //是否怀孕,0、未怀孕 1、已怀孕 |
96 | - private long isconceive = 0; | |
96 | + private Integer isconceive = 0; | |
97 | 97 | |
98 | 98 | //末次月经 |
99 | 99 | private Date lastmenstrual; |
100 | 100 | |
101 | 101 | //是否结束孕辰 0、未结束 1、已结束 |
102 | - private long ispregnancy; | |
102 | + private Integer ispregnancy; | |
103 | 103 | |
104 | 104 | //操作医生 |
105 | 105 | private String operationDoctor; |
106 | 106 | |
107 | + //建档日期 | |
108 | + private String drawTime; | |
109 | + | |
107 | 110 | //创建时间 |
108 | 111 | private Date created; |
109 | 112 | |
110 | 113 | //就诊卡卡号 |
111 | 114 | private String vcCard; |
112 | 115 | |
116 | + //可领取总数 | |
117 | + private String receiveSum; | |
118 | + | |
119 | + //修改时间 | |
120 | + private Date modify; | |
121 | + | |
122 | + public Date getModify() { | |
123 | + return modify; | |
124 | + } | |
125 | + | |
126 | + public void setModify(Date modify) { | |
127 | + this.modify = modify; | |
128 | + } | |
129 | + | |
130 | + | |
131 | + public String getDrawTime() { | |
132 | + return drawTime; | |
133 | + } | |
134 | + | |
135 | + public void setDrawTime(String drawTime) { | |
136 | + this.drawTime = drawTime; | |
137 | + } | |
138 | + | |
139 | + public String getReceiveSum() { | |
140 | + return receiveSum; | |
141 | + } | |
142 | + | |
143 | + public void setReceiveSum(String receiveSum) { | |
144 | + this.receiveSum = receiveSum; | |
145 | + } | |
146 | + | |
113 | 147 | public String getHospitalId() { |
114 | 148 | return hospitalId; |
115 | 149 | } |
... | ... | @@ -119,7 +153,7 @@ |
119 | 153 | } |
120 | 154 | |
121 | 155 | public FolviteRecordModel() { |
122 | - id = UUID.randomUUID().toString().replace("-", ""); | |
156 | + | |
123 | 157 | } |
124 | 158 | |
125 | 159 | public String getId() { |
126 | 160 | |
127 | 161 | |
... | ... | @@ -354,15 +388,22 @@ |
354 | 388 | this.womanId = womanId; |
355 | 389 | } |
356 | 390 | |
357 | - public long getIsconceive() { | |
358 | - return this.isconceive; | |
391 | + public Integer getIsconceive() { | |
392 | + return isconceive; | |
359 | 393 | } |
360 | 394 | |
361 | - | |
362 | - public void setIsconceive(long isconceive) { | |
395 | + public void setIsconceive(Integer isconceive) { | |
363 | 396 | this.isconceive = isconceive; |
364 | 397 | } |
365 | 398 | |
399 | + public Integer getIspregnancy() { | |
400 | + return ispregnancy; | |
401 | + } | |
402 | + | |
403 | + public void setIspregnancy(Integer ispregnancy) { | |
404 | + this.ispregnancy = ispregnancy; | |
405 | + } | |
406 | + | |
366 | 407 | public Date getLastmenstrual() { |
367 | 408 | return this.lastmenstrual; |
368 | 409 | } |
... | ... | @@ -372,14 +413,6 @@ |
372 | 413 | this.lastmenstrual = lastmenstrual; |
373 | 414 | } |
374 | 415 | |
375 | - public long getIspregnancy() { | |
376 | - return this.ispregnancy; | |
377 | - } | |
378 | - | |
379 | - | |
380 | - public void setIspregnancy(long ispregnancy) { | |
381 | - this.ispregnancy = ispregnancy; | |
382 | - } | |
383 | 416 | |
384 | 417 | public String getOperationDoctor() { |
385 | 418 | return this.operationDoctor; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/FolviteController.java
View file @
d96715d
... | ... | @@ -4,12 +4,12 @@ |
4 | 4 | import com.lyms.platform.common.base.BaseController; |
5 | 5 | import com.lyms.platform.common.result.BaseResponse; |
6 | 6 | import com.lyms.platform.operate.web.service.FolviteService; |
7 | +import com.lyms.platform.pojo.FolviteReceiveRecordModel; | |
8 | +import com.lyms.platform.pojo.FolviteRecordModel; | |
9 | +import org.apache.ibatis.annotations.Param; | |
7 | 10 | import org.springframework.beans.factory.annotation.Autowired; |
8 | 11 | import org.springframework.stereotype.Controller; |
9 | -import org.springframework.web.bind.annotation.RequestMapping; | |
10 | -import org.springframework.web.bind.annotation.RequestMethod; | |
11 | -import org.springframework.web.bind.annotation.RequestParam; | |
12 | -import org.springframework.web.bind.annotation.ResponseBody; | |
12 | +import org.springframework.web.bind.annotation.*; | |
13 | 13 | |
14 | 14 | import javax.servlet.http.HttpServletRequest; |
15 | 15 | |
... | ... | @@ -26,6 +26,15 @@ |
26 | 26 | @Autowired |
27 | 27 | private FolviteService folviteService; |
28 | 28 | |
29 | + /** | |
30 | + * 查询or发放叶酸 | |
31 | + * | |
32 | + * @param vcCardNo | |
33 | + * @param cardNo | |
34 | + * @param certificateTypeId | |
35 | + * @param request | |
36 | + * @return | |
37 | + */ | |
29 | 38 | @RequestMapping(value = "/queryFolvite", method = RequestMethod.GET) |
30 | 39 | @ResponseBody |
31 | 40 | @TokenRequired |
... | ... | @@ -36,6 +45,41 @@ |
36 | 45 | return folviteService.queryFolvite(vcCardNo, cardNo, certificateTypeId, getUserId(request)); |
37 | 46 | } |
38 | 47 | |
48 | + /** | |
49 | + * 添加修改叶酸建档记录 | |
50 | + * | |
51 | + * @param recordModel | |
52 | + * @param request | |
53 | + * @return | |
54 | + */ | |
55 | + @RequestMapping(value = "/saveOrUpdateFolvite", method = RequestMethod.POST) | |
56 | + @ResponseBody | |
57 | + @TokenRequired | |
58 | + public BaseResponse saveFolvite(@RequestBody FolviteRecordModel recordModel, HttpServletRequest request) { | |
59 | + | |
60 | + return folviteService.saveFolvite(recordModel, getUserId(request)); | |
61 | + } | |
62 | + | |
63 | + /** | |
64 | + * 添加叶酸发放记录 | |
65 | + * | |
66 | + * @param receiveModel | |
67 | + * @param request | |
68 | + * @return | |
69 | + */ | |
70 | + @RequestMapping(value = "saveOrUpdateProvideFolvite", method = RequestMethod.POST) | |
71 | + @ResponseBody | |
72 | + @TokenRequired | |
73 | + public BaseResponse saveProvideFolvite(@RequestBody FolviteReceiveRecordModel receiveModel, HttpServletRequest request) { | |
74 | + return folviteService.saveProvideFolvite(receiveModel, getUserId(request)); | |
75 | + | |
76 | + } | |
77 | + | |
78 | + @RequestMapping(value = "queryOneProvide/{id}", method = RequestMethod.GET) | |
79 | + public BaseResponse queryOneProvide(@PathVariable("id") String id, HttpServletRequest request) { | |
80 | + | |
81 | + return folviteService.queryOneProvide(id, getUserId(request)); | |
82 | + } | |
39 | 83 | |
40 | 84 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/FolviteService.java
View file @
d96715d
1 | 1 | package com.lyms.platform.operate.web.service; |
2 | 2 | |
3 | 3 | import com.lyms.platform.common.result.BaseResponse; |
4 | +import com.lyms.platform.permission.model.FolviteQuery; | |
5 | +import com.lyms.platform.permission.model.FolviteRecordQuery; | |
6 | +import com.lyms.platform.pojo.FolviteReceiveRecordModel; | |
7 | +import com.lyms.platform.pojo.FolviteRecordModel; | |
8 | +import com.sun.istack.internal.NotNull; | |
4 | 9 | |
10 | +import java.util.List; | |
11 | + | |
5 | 12 | /** |
6 | 13 | * @author: shuai-Bo |
7 | 14 | * @Date: 2019/10/29 0029 |
... | ... | @@ -19,5 +26,35 @@ |
19 | 26 | */ |
20 | 27 | BaseResponse queryFolvite(String vcCardNo, String cardNo, String certificateTypeId, Integer userId); |
21 | 28 | |
29 | + /** | |
30 | + * 保存叶酸建档记录 | |
31 | + * | |
32 | + * @param recordModel | |
33 | + * @return | |
34 | + */ | |
35 | + BaseResponse saveFolvite(FolviteRecordModel recordModel, Integer userId); | |
36 | + | |
37 | + | |
38 | + /** | |
39 | + * 保存叶酸发放记录 | |
40 | + * | |
41 | + * @param receiveRecordModel | |
42 | + * @return | |
43 | + */ | |
44 | + BaseResponse saveProvideFolvite(FolviteReceiveRecordModel receiveRecordModel, Integer userId); | |
45 | + | |
46 | + /** | |
47 | + * 根据id 查询叶酸历史记录 | |
48 | + * | |
49 | + * @param id | |
50 | + * @param userId | |
51 | + * @return | |
52 | + */ | |
53 | + BaseResponse queryOneProvide(@NotNull String id, Integer userId); | |
54 | + | |
55 | + | |
56 | + List<FolviteRecordModel> queryFolviteList(FolviteQuery folviteQuery); | |
57 | + | |
58 | + List<FolviteReceiveRecordModel> queryFolviteReceiveList(FolviteRecordQuery query); | |
22 | 59 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/IBaseService.java
View file @
d96715d
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/FolviteServiceImpl.java
View file @
d96715d
... | ... | @@ -13,17 +13,20 @@ |
13 | 13 | import com.lyms.platform.operate.web.utils.CollectionUtils; |
14 | 14 | import com.lyms.platform.operate.web.utils.CommonsHelper; |
15 | 15 | import com.lyms.platform.permission.dao.master.FolviteMapper; |
16 | +import com.lyms.platform.permission.dao.master.FolviteReceiveMapper; | |
16 | 17 | import com.lyms.platform.permission.model.FolviteQuery; |
18 | +import com.lyms.platform.permission.model.FolviteRecordQuery; | |
19 | +import com.lyms.platform.permission.model.Organization; | |
20 | +import com.lyms.platform.permission.service.OrganizationService; | |
21 | +import com.lyms.platform.pojo.FolviteReceiveRecordModel; | |
17 | 22 | import com.lyms.platform.pojo.FolviteRecordModel; |
18 | 23 | import com.lyms.platform.pojo.ResidentsArchiveModel; |
19 | 24 | import com.lyms.platform.query.ResidentsArchiveQuery; |
20 | -import com.mchange.v2.lang.ObjectUtils; | |
21 | 25 | import org.springframework.beans.factory.annotation.Autowired; |
22 | 26 | import org.springframework.stereotype.Service; |
23 | 27 | |
24 | -import java.util.HashMap; | |
25 | -import java.util.List; | |
26 | -import java.util.Map; | |
28 | +import javax.validation.constraints.NotNull; | |
29 | +import java.util.*; | |
27 | 30 | |
28 | 31 | /** |
29 | 32 | * @author: shuai-Bo |
... | ... | @@ -45,6 +48,12 @@ |
45 | 48 | @Autowired |
46 | 49 | private ResidentsArchiveService residentsArchiveService; |
47 | 50 | |
51 | + @Autowired | |
52 | + private FolviteReceiveMapper receiveMapper; | |
53 | + | |
54 | + @Autowired | |
55 | + private OrganizationService organizationService; | |
56 | + | |
48 | 57 | @Override |
49 | 58 | public BaseResponse queryFolvite(String vcCardNo, String cardNo, String certificateTypeId, Integer userId) { |
50 | 59 | Map<String, Object> response = new HashMap<>(); |
... | ... | @@ -95,6 +104,139 @@ |
95 | 104 | return responses; |
96 | 105 | } |
97 | 106 | |
107 | + @Override | |
108 | + public BaseResponse saveFolvite(FolviteRecordModel recordModel, Integer userId) { | |
109 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
110 | + if (StringUtils.isEmpty(recordModel.getId())) { | |
111 | + recordModel.setId(UUID.randomUUID().toString().replace("-", "")); | |
112 | + recordModel.setHospitalId(hospitalId); | |
113 | + recordModel.setCreated(new Date()); | |
114 | + recordModel.setModify(new Date()); | |
115 | + folviteMapper.saveFolvite(recordModel); | |
116 | + } else { | |
117 | + recordModel.setHospitalId(hospitalId); | |
118 | + recordModel.setModify(new Date()); | |
119 | + folviteMapper.updateFolvite(recordModel); | |
120 | + } | |
121 | + BaseResponse response = new BaseResponse(); | |
122 | + response.setObject(recordModel.getId()); | |
123 | + return response; | |
124 | + } | |
125 | + | |
126 | + @Override | |
127 | + public BaseResponse saveProvideFolvite(FolviteReceiveRecordModel receiveRecordModel, Integer userId) { | |
128 | + if (StringUtils.isNotEmpty(receiveRecordModel.getId())) { | |
129 | + receiveRecordModel.setModified(new Date()); | |
130 | + receiveMapper.updaetFolviteReceive(receiveRecordModel); | |
131 | + } else { | |
132 | + receiveRecordModel.setId(UUID.randomUUID().toString().replace("-", "")); | |
133 | + receiveRecordModel.setCreationDate(new Date()); | |
134 | + receiveRecordModel.setModified(new Date()); | |
135 | + receiveMapper.saveFolviteReceive(receiveRecordModel); | |
136 | + } | |
137 | + BaseResponse response = new BaseResponse(); | |
138 | + response.setObject(receiveRecordModel.getId()); | |
139 | + return response; | |
140 | + } | |
141 | + | |
142 | + @Override | |
143 | + public BaseResponse queryOneProvide(@NotNull String id, Integer userId) { | |
144 | + Map<String, Object> respone = new HashMap<>(); | |
145 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
146 | + //叶酸建档id | |
147 | + String folviteId = null; | |
148 | + FolviteReceiveRecordModel receiveRecordModel = receiveMapper.queryOneReceive(id); | |
149 | + Map<String, Object> provide = new HashMap<>(); | |
150 | + if (receiveRecordModel != null) { | |
151 | + provide.put("created", DateUtil.getyyyy_MM_dd(receiveRecordModel.getCreationDate())); | |
152 | + provide.put("drawCount", receiveRecordModel.getReceiveNumber()); | |
153 | + provide.put("drawTime", receiveRecordModel.getReceiveDate()); | |
154 | + provide.put("highRisk", receiveRecordModel.getHighrisk()); | |
155 | + String hospital = ""; | |
156 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(receiveRecordModel.getHospitalId())) { | |
157 | + Organization organization = organizationService.getOrganization(Integer.parseInt(receiveRecordModel.getHospitalId())); | |
158 | + if (organization != null && organization.getYn() == YnEnums.YES.getId()) { | |
159 | + hospital = organization.getName(); | |
160 | + } | |
161 | + } | |
162 | + provide.put("hospitalName", hospital); | |
163 | + provide.put("id", receiveRecordModel.getId()); | |
164 | + provide.put("operator", receiveRecordModel.getIssuer()); | |
165 | + provide.put("pregnancyWeeks", receiveRecordModel.getReceiveWeek()); | |
166 | + folviteId = receiveRecordModel.getFolviteId(); | |
167 | + } | |
168 | + FolviteQuery folviteQuery = new FolviteQuery(); | |
169 | + folviteQuery.setHospitalId(hospitalId); | |
170 | + folviteQuery.setId(folviteId); | |
171 | + FolviteRecordModel recordModel = folviteMapper.queryOne(folviteQuery); | |
172 | + String womanId = null; | |
173 | + Map<String, Object> folvite = new HashMap<>(); | |
174 | + if (recordModel != null) { | |
175 | + folvite.put("username", recordModel.getName()); | |
176 | + folvite.put("birthday", DateUtil.getyyyy_MM_dd(recordModel.getBirthday())); | |
177 | + folvite.put("certificateNum", recordModel.getCardNo()); | |
178 | + folvite.put("certificateTypeId", recordModel.getCertificateType()); | |
179 | + folvite.put("id", recordModel.getId()); | |
180 | + folvite.put("phone", recordModel.getPhone()); | |
181 | + folvite.put("residenceRegister", CommonsHelper.getResidence(recordModel.getDomicileProvince(), recordModel.getDomicileCity(), | |
182 | + recordModel.getDomicileArea(), recordModel.getDomicileCountry(), recordModel.getDomicileAddress(), basicConfigService)); | |
183 | + folvite.put("alreadySum", "已领总数"); | |
184 | + folvite.put("canSum", "可领总数"); | |
185 | + womanId = recordModel.getWomanId(); | |
186 | + } | |
187 | + FolviteQuery query = new FolviteQuery(); | |
188 | + query.setWomanId(womanId); | |
189 | + query.setCardNo(recordModel.getCardNo()); | |
190 | + List<FolviteRecordModel> recordModels = queryFolviteList(query); | |
191 | + List<List<Map<String, Object>>> list = new ArrayList(); | |
192 | + if (CollectionUtils.isNotEmpty(recordModels)) { | |
193 | + FolviteRecordQuery recordQuery = new FolviteRecordQuery(); | |
194 | + for (FolviteRecordModel folviteModel : recordModels) { | |
195 | + List<Map<String, Object>> listMap = new ArrayList<>(); | |
196 | + recordQuery.setFolviteId(folviteModel.getId()); | |
197 | + List<FolviteReceiveRecordModel> folviteRecordModels = queryFolviteReceiveList(recordQuery); | |
198 | + if (CollectionUtils.isNotEmpty(folviteRecordModels)) { | |
199 | + for (FolviteReceiveRecordModel folviteRecordModel : folviteRecordModels) { | |
200 | + Map<String, Object> recordMap = new HashMap<>(); | |
201 | + recordMap.put("drawCount", folviteRecordModel.getReceiveNumber()); | |
202 | + recordMap.put("drawTime", DateUtil.getyyyy_MM_dd(folviteRecordModel.getReceiveDate())); | |
203 | + recordMap.put("id", folviteRecordModel.getId()); | |
204 | + recordMap.put("other", folviteRecordModel.getIsconceive()); | |
205 | + if (folviteRecordModel.getIsconceive() == 0) { | |
206 | + recordMap.put("pregnancyType", "孕前"); | |
207 | + } else { | |
208 | + recordMap.put("pregnancyType", "孕" + folviteRecordModel.getReceiveWeek() + "周"); | |
209 | + } | |
210 | + listMap.add(recordMap); | |
211 | + } | |
212 | + } | |
213 | + list.add(listMap); | |
214 | + } | |
215 | + } | |
216 | + BaseResponse response = new BaseResponse(); | |
217 | + respone.put("folicAcidResult", provide); | |
218 | + respone.put("archiveResult", folvite); | |
219 | + respone.put("folicAcidHistory", list); | |
220 | + response.setObject(respone); | |
221 | + return response; | |
222 | + } | |
223 | + | |
224 | + @Override | |
225 | + public List<FolviteRecordModel> queryFolviteList(FolviteQuery folviteQuery) { | |
226 | + if (folviteQuery.getNeed() != null) { | |
227 | + folviteQuery.mysqlBuild(folviteMapper.queryFolviteListCount(folviteQuery)); | |
228 | + } | |
229 | + return folviteMapper.queryFolviteList(folviteQuery); | |
230 | + } | |
231 | + | |
232 | + @Override | |
233 | + public List<FolviteReceiveRecordModel> queryFolviteReceiveList(FolviteRecordQuery query) { | |
234 | + if (query.getNeed() != null) { | |
235 | + query.mysqlBuild(receiveMapper.queyFolviteReceiveCount(query)); | |
236 | + } | |
237 | + return receiveMapper.queryFolviteReceiveList(query); | |
238 | + } | |
239 | + | |
98 | 240 | FolviteResult result(ResidentsArchiveModel archiveModel) { |
99 | 241 | FolviteResult folviteResult = new FolviteResult(); |
100 | 242 | folviteResult.setWomanId(archiveModel.getId()); |
101 | 243 | |
102 | 244 | |
103 | 245 | |
... | ... | @@ -112,15 +254,22 @@ |
112 | 254 | folviteResult.setOccupation(archiveModel.getProfessionTypeId()); |
113 | 255 | folviteResult.setPhone(archiveModel.getPhone()); |
114 | 256 | folviteResult.setWorkUnit(archiveModel.getWorkUnit()); |
257 | + | |
258 | + | |
115 | 259 | folviteResult.setHabitationProvince(archiveModel.getProvinceId()); |
116 | - folviteResult.setHabitationCity(archiveModel.getAreaId()); | |
260 | + folviteResult.setHabitationCity(archiveModel.getCityId()); | |
261 | + folviteResult.setHabitationArea(archiveModel.getAreaId()); | |
117 | 262 | folviteResult.setHabitationCountry(archiveModel.getStreetId()); |
118 | 263 | folviteResult.setHabitationAddress(archiveModel.getAddress()); |
264 | + | |
265 | + | |
119 | 266 | folviteResult.setDomicileProvince(archiveModel.getProvinceRegisterId()); |
120 | 267 | folviteResult.setDomicileCity(archiveModel.getCityRegisterId()); |
121 | 268 | folviteResult.setDomicileArea(archiveModel.getAreaRegisterId()); |
122 | 269 | folviteResult.setDomicileCountry(archiveModel.getStreetRegisterId()); |
123 | 270 | folviteResult.setDomicileAddress(archiveModel.getAddressRegister()); |
271 | + | |
272 | + | |
124 | 273 | return folviteResult; |
125 | 274 | } |
126 | 275 |