Commit 6597e0966a38ece00d7c79712836c3f15af541f3
1 parent
3950130947
Exists in
master
and in
6 other branches
1
Showing 1 changed file with 62 additions and 25 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/LisCrisisItemController.java
View file @
6597e09
... | ... | @@ -6,9 +6,7 @@ |
6 | 6 | import com.lyms.platform.common.annotation.TokenRequired; |
7 | 7 | import com.lyms.platform.common.base.BaseController; |
8 | 8 | import com.lyms.platform.common.result.CommonResult; |
9 | -import com.lyms.platform.common.utils.DateUtil; | |
10 | -import com.lyms.platform.common.utils.ResultUtils; | |
11 | -import com.lyms.platform.common.utils.StringUtils; | |
9 | +import com.lyms.platform.common.utils.*; | |
12 | 10 | import com.lyms.platform.pojo.LisCrisisItem; |
13 | 11 | import com.lyms.platform.pojo.Patients; |
14 | 12 | import com.lyms.platform.query.LisCrisisItemQuery; |
15 | 13 | |
... | ... | @@ -16,11 +14,13 @@ |
16 | 14 | import org.apache.commons.collections.CollectionUtils; |
17 | 15 | import org.springframework.beans.factory.annotation.Autowired; |
18 | 16 | import org.springframework.stereotype.Controller; |
17 | +import org.springframework.web.bind.annotation.RequestHeader; | |
19 | 18 | import org.springframework.web.bind.annotation.RequestMapping; |
20 | 19 | import org.springframework.web.bind.annotation.RequestMethod; |
21 | 20 | import org.springframework.web.bind.annotation.RequestParam; |
22 | 21 | |
23 | 22 | import javax.servlet.http.HttpServletResponse; |
23 | +import java.text.MessageFormat; | |
24 | 24 | import java.util.*; |
25 | 25 | |
26 | 26 | /** |
... | ... | @@ -45,7 +45,7 @@ |
45 | 45 | public void getEmergenceTreatments(HttpServletResponse response, |
46 | 46 | @RequestParam("page") int page, |
47 | 47 | @RequestParam("limit") int limit, |
48 | - @RequestParam(value = "queryNo",required = false) String queryNo, | |
48 | + @RequestParam(value = "queryNo", required = false) String queryNo, | |
49 | 49 | @RequestParam(value = "id", required = false) String id, |
50 | 50 | @RequestParam(value = "cardNo", required = false) String cardNo, |
51 | 51 | @RequestParam(value = "phone", required = false) String phone, |
... | ... | @@ -82,7 +82,7 @@ |
82 | 82 | |
83 | 83 | if (CollectionUtils.isNotEmpty(patientses)) { |
84 | 84 | List<String> parentIds = new LinkedList<>(); |
85 | - for(Patients pa:patientses){ | |
85 | + for (Patients pa : patientses) { | |
86 | 86 | parentIds.add(pa.getId()); |
87 | 87 | } |
88 | 88 | query.setParentIds(parentIds); |
... | ... | @@ -118,7 +118,7 @@ |
118 | 118 | map.put("phone", data.getPhone()); |
119 | 119 | map.put("serviceType", data.getServiceType()); |
120 | 120 | map.put("serviceStatus", data.getServiceStatus()); |
121 | - map.put("lastMenses", data.getLastMenses() ==null ?0:data.getLastMenses().getTime()); | |
121 | + map.put("lastMenses", data.getLastMenses() == null ? 0 : data.getLastMenses().getTime()); | |
122 | 122 | |
123 | 123 | if (data.getWeek() >= 42) { |
124 | 124 | map.put("week", "已分娩"); |
125 | 125 | |
126 | 126 | |
127 | 127 | |
... | ... | @@ -136,27 +136,64 @@ |
136 | 136 | result.setList(list); |
137 | 137 | result.setPageInfo(query.getPageInfo()); |
138 | 138 | ResultUtils.buildSuccessResultAndWrite(response, result); |
139 | - // LisCrisisItem data = new LisCrisisItem(); | |
140 | -// data.setName("黄小希"); | |
141 | -// data.setAge(30); | |
142 | -// data.setWeeks("17+3"); | |
143 | -// data.setItemCode("123456789dfdsafsdafsdaf"); | |
144 | -// data.setItemName("血红蛋白"); | |
145 | -// data.setClassify("8"); | |
146 | -// data.setClassifyName("血常规"); | |
147 | -// data.setFlag("1"); | |
148 | -// data.setRef("120~200"); | |
149 | -// data.setResult("500"); | |
150 | -// data.setUnit("g/L"); | |
151 | -// data.setApplyDoctorCode("fsdfsdfsdaf4544fsdaf"); | |
152 | -// data.setApplyDoctorName("王大伟"); | |
153 | -// data.setPublishTime(new Date()); | |
154 | -// data.setStatus(1); | |
155 | -// data.setStatusName("待处理"); | |
156 | -// lisCrisisItemDao.addLisCrisisItem(data); | |
139 | + } | |
157 | 140 | |
141 | + /** | |
142 | + * 获取该医院的危机数据 | |
143 | + * | |
144 | + * @param response | |
145 | + * @param page | |
146 | + * @param limit | |
147 | + * @param lasttime | |
148 | + * @param token | |
149 | + */ | |
150 | + public void fuckUm(HttpServletResponse response, | |
151 | + @RequestParam(value = "page", defaultValue = "1") Integer page, | |
152 | + @RequestParam(value = "limit", defaultValue = "15") Integer limit, | |
153 | + @RequestParam(value = "lasttime") Long lasttime, | |
154 | + @RequestHeader("Authorization") String token) { | |
158 | 155 | |
159 | - } | |
156 | + if (!"3d19960bf3e81e7d816c4f26051c49ba".equals(token)) { | |
157 | + ExceptionUtils.catchException("The request token is " + token); | |
158 | + writeString(response, "Token is error"); | |
159 | + return; | |
160 | + } | |
160 | 161 | |
162 | + LisCrisisItemQuery query = new LisCrisisItemQuery(); | |
163 | + query.setPage(page); | |
164 | + query.setLimit(limit); | |
165 | + query.setNeed("y"); | |
166 | + query.setSort("id asc"); | |
167 | + if (null != lasttime) { | |
168 | + query.setGteCreated(new Date(lasttime)); | |
169 | + query.setGteModified(new Date(lasttime)); | |
170 | + } | |
171 | + | |
172 | + List<LisCrisisItem> lisCrisisItemList = lisCrisisItemService.query(query); | |
173 | + List<Map> list = new ArrayList<>(); | |
174 | + | |
175 | + if (CollectionUtils.isNotEmpty(lisCrisisItemList)) { | |
176 | + for (LisCrisisItem data : lisCrisisItemList) { | |
177 | + Map<String, Object> map = new HashMap<>(); | |
178 | + Map<String, Object> content = new HashMap<>(); | |
179 | + map.put("emergenceId", data.getId()); | |
180 | + map.put("hospitalId", data.getHospitalId()); | |
181 | + content.put("type", data.getItemName()); | |
182 | + content.put("ref", data.getRef() + " " + data.getUnit()); | |
183 | + content.put("real", data.getResult() + " " + data.getUnit()); | |
184 | + map.put("content", JsonUtil.obj2JsonString(content)); | |
185 | + map.put("applyDoctorCode", data.getApplyDoctorCode()); | |
186 | + map.put("applyDoctorName", data.getApplyDoctorName()); | |
187 | + map.put("publishTime", DateUtil.getyyyy_MM_dd(data.getPublishTime())); | |
188 | + map.put("status", data.getStatus()); | |
189 | + map.put("statusName", data.getStatusName()); | |
190 | + map.put("patientId", data.getPatientId()); | |
191 | + list.add(map); | |
192 | + } | |
193 | + } | |
194 | + Map<String, Object> map = new HashMap<>(); | |
195 | + map.put("data", list); | |
196 | + ResultUtils.buildSuccessResultAndWrite(response, map); | |
197 | + } | |
161 | 198 | } |