Commit 29ff4091139d7a16f75b1649a5733f855eb2a2ee
1 parent
e33ef02608
Exists in
master
and in
6 other branches
update
Showing 5 changed files with 162 additions and 30 deletions
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/FolviteQuery.java
- platform-biz-service/src/main/resources/mainOrm/master/FolviteMapper.xml
- platform-biz-service/src/main/resources/mainOrm/master/FolviteReceiveMapper.xml
- 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/impl/FolviteServiceImpl.java
platform-biz-service/src/main/java/com/lyms/platform/permission/model/FolviteQuery.java
View file @
29ff409
... | ... | @@ -2,6 +2,8 @@ |
2 | 2 | |
3 | 3 | import com.lyms.platform.common.dao.BaseQuery; |
4 | 4 | |
5 | +import java.util.Date; | |
6 | + | |
5 | 7 | /** |
6 | 8 | * @author: shuai-Bo |
7 | 9 | * @Date: 2019/10/29 0029 |
... | ... | @@ -31,6 +33,40 @@ |
31 | 33 | |
32 | 34 | //妇女建档id |
33 | 35 | private String womanId; |
36 | + | |
37 | + //领取开始时间 | |
38 | + private Date startReceiveDate; | |
39 | + | |
40 | + //领取结束时间 | |
41 | + private Date endReceiveDate; | |
42 | + | |
43 | + //高危风险因素 | |
44 | + private String highRisk; | |
45 | + | |
46 | + | |
47 | + public Date getStartReceiveDate() { | |
48 | + return startReceiveDate; | |
49 | + } | |
50 | + | |
51 | + public void setStartReceiveDate(Date startReceiveDate) { | |
52 | + this.startReceiveDate = startReceiveDate; | |
53 | + } | |
54 | + | |
55 | + public Date getEndReceiveDate() { | |
56 | + return endReceiveDate; | |
57 | + } | |
58 | + | |
59 | + public void setEndReceiveDate(Date endReceiveDate) { | |
60 | + this.endReceiveDate = endReceiveDate; | |
61 | + } | |
62 | + | |
63 | + public String getHighRisk() { | |
64 | + return highRisk; | |
65 | + } | |
66 | + | |
67 | + public void setHighRisk(String highRisk) { | |
68 | + this.highRisk = highRisk; | |
69 | + } | |
34 | 70 | |
35 | 71 | public String getWomanId() { |
36 | 72 | return womanId; |
platform-biz-service/src/main/resources/mainOrm/master/FolviteMapper.xml
View file @
29ff409
... | ... | @@ -96,10 +96,20 @@ |
96 | 96 | <where> |
97 | 97 | 1=1 |
98 | 98 | <if test="queryNo !=null and queryNo != ''"> |
99 | - and f.name =#{queryNo} | |
99 | + and f.name =#{queryNo} or f.card_no=#{queryNo} or f.phone=#{queryNo} | |
100 | 100 | </if> |
101 | - | |
102 | - | |
101 | + <if test="hospitalId !=null and hospitalId != ''"> | |
102 | + and p.hospitalid =#{hospitalId} | |
103 | + </if> | |
104 | + <if test="startReceiveDate != null "> | |
105 | + AND <![CDATA[ p.receive_date > date_format(#{startReceiveDate},'%Y-%m-%d') ]]> | |
106 | + </if> | |
107 | + <if test="endReceiveDate != null"> | |
108 | + AND <![CDATA[ p.receive_date < date_format(#{endReceiveDate},'%Y-%m-%d') ]]> | |
109 | + </if> | |
110 | + <if test="highRisk !=null and highRisk != ''"> | |
111 | + AND p.highrisk=#{highRisk} | |
112 | + </if> | |
103 | 113 | </where> |
104 | 114 | <include refid="orderAndLimit"/> |
105 | 115 | </select> |
106 | 116 | |
... | ... | @@ -107,12 +117,30 @@ |
107 | 117 | |
108 | 118 | <select id="queryListCount" parameterType="com.lyms.platform.permission.model.FolviteQuery" |
109 | 119 | resultType="java.lang.Integer"> |
110 | - SELECT | |
111 | - count(1) | |
112 | - FROM | |
120 | + SELECT | |
121 | + count(1) | |
122 | + FROM | |
113 | 123 | lyms_folvite_provide AS p |
114 | 124 | LEFT JOIN |
115 | 125 | lyms_folvite_Info f ON p.folvite_id = f.id |
126 | + <where> | |
127 | + 1=1 | |
128 | + <if test="queryNo !=null and queryNo != ''"> | |
129 | + and f.name =#{queryNo} or f.card_no=#{queryNo} or f.phone=#{queryNo} | |
130 | + </if> | |
131 | + <if test="hospitalId !=null and hospitalId != ''"> | |
132 | + and p.hospitalid =#{hospitalId} | |
133 | + </if> | |
134 | + <if test="startReceiveDate != null "> | |
135 | + AND <![CDATA[ p.receive_date > date_format(#{startReceiveDate},'%Y-%m-%d') ]]> | |
136 | + </if> | |
137 | + <if test="endReceiveDate != null"> | |
138 | + AND <![CDATA[ p.receive_date < date_format(#{endReceiveDate},'%Y-%m-%d') ]]> | |
139 | + </if> | |
140 | + <if test="highRisk !=null and highRisk != ''"> | |
141 | + AND p.highrisk=#{highRisk} | |
142 | + </if> | |
143 | + </where> | |
116 | 144 | </select> |
117 | 145 | |
118 | 146 |
platform-biz-service/src/main/resources/mainOrm/master/FolviteReceiveMapper.xml
View file @
29ff409
... | ... | @@ -58,7 +58,7 @@ |
58 | 58 | SELECT |
59 | 59 | f.`name` as name,f.birthday,f.card_no,f.vc_card,p.isconceive,f.receivesum, |
60 | 60 | SUM(p.receive_number) as sumNumber,f.drawTime,f.domicile_address,f.domicile_area, |
61 | - f.domicile_city,f.domicile_country,f.domicile_province,p.folvite_id,p.issuer | |
61 | + f.domicile_city,f.domicile_country,f.domicile_province,p.folvite_id,p.issuer,f.phone | |
62 | 62 | FROM |
63 | 63 | lyms_folvite_provide AS p |
64 | 64 | LEFT JOIN |
... | ... | @@ -66,7 +66,7 @@ |
66 | 66 | <where> |
67 | 67 | 1=1 |
68 | 68 | <if test="queryNo != null and queryNo != ''"> |
69 | - and f.`name` =#{queryNo} | |
69 | + and f.`name` =#{queryNo} or f.phone=#{queryNo} or f.card_no =#{queryNo} or f.vc_card=#{queryNo} | |
70 | 70 | </if> |
71 | 71 | <if test="isconceive !=null"> |
72 | 72 | and p.isconceive=#{isconceive} |
... | ... | @@ -89,7 +89,8 @@ |
89 | 89 | <include refid="orderAndLimit"/> |
90 | 90 | </select> |
91 | 91 | |
92 | - <select id="listCount" parameterType="com.lyms.platform.permission.model.FolviteRecordQuery" resultType="java.lang.Integer"> | |
92 | + <select id="listCount" parameterType="com.lyms.platform.permission.model.FolviteRecordQuery" | |
93 | + resultType="java.lang.Integer"> | |
93 | 94 | SELECT |
94 | 95 | count(1) |
95 | 96 | FROM |
... | ... | @@ -99,7 +100,7 @@ |
99 | 100 | <where> |
100 | 101 | 1=1 |
101 | 102 | <if test="queryNo != null and queryNo != ''"> |
102 | - and f.`name` =#{queryNo} | |
103 | + and f.`name` =#{queryNo} or f.phone=#{queryNo} or f.card_no =#{queryNo} or f.vc_card=#{queryNo} | |
103 | 104 | </if> |
104 | 105 | <if test="isconceive !=null"> |
105 | 106 | and p.isconceive=#{isconceive} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/FolviteController.java
View file @
29ff409
... | ... | @@ -10,6 +10,7 @@ |
10 | 10 | import com.lyms.platform.permission.model.FolviteRecordQuery; |
11 | 11 | import com.lyms.platform.pojo.FolviteReceiveRecordModel; |
12 | 12 | import com.lyms.platform.pojo.FolviteRecordModel; |
13 | +import org.apache.commons.lang.StringUtils; | |
13 | 14 | import org.apache.ibatis.annotations.Param; |
14 | 15 | import org.springframework.beans.factory.annotation.Autowired; |
15 | 16 | import org.springframework.stereotype.Controller; |
... | ... | @@ -102,10 +103,6 @@ |
102 | 103 | * |
103 | 104 | * @param queryNo |
104 | 105 | * @param isconceive |
105 | - * @param startReceiveDate | |
106 | - * @param endReceiveDate | |
107 | - * @param startDrawTime | |
108 | - * @param endDrawTime | |
109 | 106 | * @return |
110 | 107 | */ |
111 | 108 | @RequestMapping(value = "queyrFolviteList", method = RequestMethod.GET) |
112 | 109 | |
113 | 110 | |
114 | 111 | |
... | ... | @@ -113,22 +110,41 @@ |
113 | 110 | @TokenRequired |
114 | 111 | public BaseResponse queryFolviteList(@Param("queryNo") String queryNo, |
115 | 112 | @Param("isconceive") Integer isconceive, |
116 | - @Param("startReceiveDate") String startReceiveDate, | |
117 | - @Param("endReceiveDate") String endReceiveDate, | |
118 | - @Param("startDrawTime") String startDrawTime, | |
119 | - @Param("endDrawTime") String endDrawTime) { | |
113 | + @Param("receiveDate") String receiveDate, | |
114 | + @Param("drawTime") String drawTime, | |
115 | + @Param("page") Integer page, | |
116 | + @Param("limit") Integer limit) { | |
120 | 117 | |
121 | 118 | FolviteRecordQuery query = new FolviteRecordQuery(); |
122 | - query.setIsconceive(isconceive); | |
123 | - query.setStartReceiveDate(DateUtil.getYmdhmDate(startReceiveDate)); | |
124 | - query.setEndReceiveDate(DateUtil.getYmdhmDate(endReceiveDate)); | |
125 | - query.setStartReceiveDate(DateUtil.getYmdhmDate(startDrawTime)); | |
126 | - query.setEndDrawTime(DateUtil.getYmdhmDate(endDrawTime)); | |
127 | - query.setQueryNo(queryNo); | |
128 | - query.setSort("created asc"); | |
129 | - query.setNeed("true"); | |
119 | + if (null != isconceive) { | |
120 | + query.setIsconceive(isconceive); | |
121 | + } | |
122 | + if (StringUtils.isNotEmpty(receiveDate)) { | |
123 | + try { | |
124 | + query.setStartReceiveDate(DateUtil.getSNDate(receiveDate)[0]); | |
125 | + query.setEndReceiveDate(DateUtil.getSNDate(receiveDate)[1]); | |
126 | + } catch (Exception e) { | |
127 | + e.printStackTrace(); | |
128 | + } | |
129 | + } | |
130 | 130 | |
131 | + if (StringUtils.isNotEmpty(drawTime)) { | |
132 | + try { | |
133 | + query.setStartDrawTime(DateUtil.getSNDate(drawTime)[0]); | |
134 | + query.setEndDrawTime(DateUtil.getSNDate(drawTime)[1]); | |
135 | + } catch (Exception e) { | |
136 | + e.printStackTrace(); | |
137 | + } | |
138 | + } | |
139 | + if (StringUtils.isNotEmpty(queryNo)) { | |
140 | + query.setQueryNo(queryNo); | |
141 | + } | |
131 | 142 | |
143 | + query.setPage(page); | |
144 | + query.setLimit(limit); | |
145 | + | |
146 | + query.setSort("created asc"); | |
147 | + query.setNeed("true"); | |
132 | 148 | List<Map<String, Object>> list = folviteService.list(query); |
133 | 149 | BaseListResponse baseResponse = new BaseListResponse(); |
134 | 150 | baseResponse.setData(list); |
135 | 151 | |
... | ... | @@ -140,9 +156,34 @@ |
140 | 156 | @RequestMapping(value = "/queryFolviteRecord", method = RequestMethod.GET) |
141 | 157 | @ResponseBody |
142 | 158 | @TokenRequired |
143 | - public BaseResponse queryFolviteRecord(@Param("queryNo") String queryNo) { | |
159 | + public BaseResponse queryFolviteRecord(@Param("queryNo") String queryNo, | |
160 | + @Param("hospitalId") String hospitalId, | |
161 | + @Param("receiveDate") String receiveDate, | |
162 | + @Param("highRisk") String highRisk, | |
163 | + @Param("page") Integer page, | |
164 | + @Param("limit") Integer limit) { | |
144 | 165 | FolviteQuery query = new FolviteQuery(); |
145 | - query.setQueryNo(queryNo); | |
166 | + if (StringUtils.isNotEmpty(queryNo)) { | |
167 | + query.setQueryNo(queryNo); | |
168 | + } | |
169 | + if (StringUtils.isNotEmpty(hospitalId)) { | |
170 | + query.setHospitalId(hospitalId); | |
171 | + } | |
172 | + if (StringUtils.isNotEmpty(receiveDate)) { | |
173 | + try { | |
174 | + query.setStartReceiveDate(DateUtil.getSNDate(receiveDate)[0]); | |
175 | + query.setEndReceiveDate(DateUtil.getSNDate(receiveDate)[1]); | |
176 | + } catch (Exception e) { | |
177 | + e.printStackTrace(); | |
178 | + } | |
179 | + } | |
180 | + if (StringUtils.isNotEmpty(highRisk)) { | |
181 | + query.setHighRisk(highRisk); | |
182 | + } | |
183 | + query.setPage(page); | |
184 | + query.setLimit(limit); | |
185 | + query.setSort("created asc"); | |
186 | + query.setNeed("true"); | |
146 | 187 | |
147 | 188 | List<Map<String, Object>> maps = folviteService.recordList(query); |
148 | 189 | BaseListResponse response = new BaseListResponse(); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/FolviteServiceImpl.java
View file @
29ff409
... | ... | @@ -243,7 +243,7 @@ |
243 | 243 | m.put("domicileCity", map.get("domicile_city")); |
244 | 244 | m.put("domicileCountry", map.get("domicile_country")); |
245 | 245 | m.put("domicileProvince", map.get("domicile_province")); |
246 | - m.put("Address", CommonsHelper.getResidence(map.get("domicile_province").toString(), map.get("domicile_city").toString(), | |
246 | + m.put("address", CommonsHelper.getResidence(map.get("domicile_province").toString(), map.get("domicile_city").toString(), | |
247 | 247 | map.get("domicile_area").toString(), map.get("domicile_country").toString(), map.get("domicile_address").toString(), basicConfigService)); |
248 | 248 | m.put("issuer", map.get("issuer")); |
249 | 249 | m.put("issuerName", usersService.getUsers(Integer.valueOf(map.get("issuer").toString())).getName()); |
250 | 250 | |
... | ... | @@ -254,10 +254,36 @@ |
254 | 254 | |
255 | 255 | @Override |
256 | 256 | public List<Map<String, Object>> recordList(FolviteQuery folviteQuery) { |
257 | + List<Map<String, Object>> data = new ArrayList<>(); | |
257 | 258 | if (folviteQuery.getNeed() != null) { |
258 | 259 | folviteQuery.mysqlBuild(folviteMapper.queryListCount(folviteQuery) == null ? 0 : folviteMapper.queryListCount(folviteQuery)); |
259 | 260 | } |
260 | - return folviteMapper.queryListMap(folviteQuery); | |
261 | + List<Map<String, Object>> list = folviteMapper.queryListMap(folviteQuery); | |
262 | + for (Map<String, Object> map : list) { | |
263 | + Map<String, Object> m = new HashMap<>(); | |
264 | + m.put("receiveNumber", map.get("receive_number")); | |
265 | + m.put("provideUnit", map.get("provide_unit")); | |
266 | + String hospital = ""; | |
267 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(map.get("provide_unit").toString())) { | |
268 | + Organization organization = organizationService.getOrganization(Integer.parseInt(map.get("provide_unit").toString())); | |
269 | + if (organization != null && organization.getYn() == YnEnums.YES.getId()) { | |
270 | + hospital = organization.getName(); | |
271 | + } | |
272 | + } | |
273 | + m.put("hospitalName", hospital); | |
274 | + m.put("highrisk", map.get("highrisk")); | |
275 | + m.put("issuerId", map.get("issuer")); | |
276 | + m.put("issuerName", usersService.getUsers(Integer.valueOf(map.get("issuer").toString())).getName()); | |
277 | + m.put("receiveDate", DateUtil.getyyyy_MM_dd((Date) map.get("receive_date"))); | |
278 | + m.put("receiveWeek", map.get("receive_week")); | |
279 | + m.put("cardNo", map.get("card_no")); | |
280 | + m.put("phone", map.get("phone")); | |
281 | + m.put("name", map.get("name")); | |
282 | + m.put("address", CommonsHelper.getResidence(map.get("habitation_province").toString(), map.get("habitation_city").toString(), | |
283 | + map.get("habitation_area").toString(), map.get("habitation_country").toString(), map.get("habitation_address").toString(), basicConfigService)); | |
284 | + data.add(m); | |
285 | + } | |
286 | + return data; | |
261 | 287 | } |
262 | 288 | |
263 | 289 | FolviteResult result(ResidentsArchiveModel archiveModel) { |