Commit cb3672ef38500f3dbbfb98fc920d008d21080ee7

Authored by jiangjiazhi
1 parent 8bf8fe48ee

全部孕妇管理增加按照排序

Showing 1 changed file with 33 additions and 27 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/TempFacade.java View file @ cb3672e
... ... @@ -162,7 +162,7 @@
162 162 data.put("vcCardNo", patients.getVcCardNo());
163 163 data.put("cardNo", patients.getCardNo());
164 164 data.put("certeTypeId", patients.getPcerteTypeId());
165   - data.put("status", null==tmp.getNow()?"":getTempStatus(Double.valueOf(tmp.getNow())));
  165 + data.put("status", null == tmp.getNow() ? "" : getTempStatus(Double.valueOf(tmp.getNow())));
166 166 data.put("level", commonService.findRiskLevel(patients.getRiskLevelId()));
167 167 data.put("rFactor", commonService.resloveFactor(patients.getRiskFactorId()));
168 168 data.put("dueDate", DateUtil.getyyyy_MM_dd(patients.getDueDate()));
... ... @@ -174,18 +174,18 @@
174 174 return new BaseListResponse().setData(dataList).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
175 175 }
176 176  
177   - private String getTempStatus(double temp){
178   - String str="";
179   - if(37.5<=temp&&37.9>=temp){
180   - str="低热";
181   - }else if(38.0<=temp&&38.9>=temp){
182   - str="中等度热";
183   - }else if(39.0<=temp&&40.9>=temp){
184   - str="高热";
185   - }else if(temp>=41){
186   - str="超高热";
187   - }else if(36<=temp&&37>=temp){
188   - str="标准";
  177 + private String getTempStatus(double temp) {
  178 + String str = "";
  179 + if (37.5 <= temp && 37.9 >= temp) {
  180 + str = "低热";
  181 + } else if (38.0 <= temp && 38.9 >= temp) {
  182 + str = "中等度热";
  183 + } else if (39.0 <= temp && 40.9 >= temp) {
  184 + str = "高热";
  185 + } else if (temp >= 41) {
  186 + str = "超高热";
  187 + } else if (36 <= temp && 37 >= temp) {
  188 + str = "标准";
189 189 }
190 190 return str;
191 191 }
192 192  
... ... @@ -203,12 +203,12 @@
203 203 Assert.notNull(tem, "查看的记录已被删除");
204 204 LinkedHashMap<String, Double> data = tem.getTempList();
205 205 Map map = new HashMap();
206   - map.put("errorcode",ErrorCodeConstants.SUCCESS);
  206 + map.put("errorcode", ErrorCodeConstants.SUCCESS);
207 207 map.put("errormsg", "成功");
208 208 List<String> time = new ArrayList<>();
209   - List<String> temp=new ArrayList<>();
210   - map.put("time",time);
211   - map.put("temp",temp);
  209 + List<String> temp = new ArrayList<>();
  210 + map.put("time", time);
  211 + map.put("temp", temp);
212 212 if (null == data || data.isEmpty()) {
213 213 return map;
214 214 }
... ... @@ -232,7 +232,7 @@
232 232 LinkedHashMap data = temp == null ? new LinkedHashMap<String, Double>() : temp.getTempList();
233 233 data.put(DateUtil.getYyyyMmDd(new Date()), Double.valueOf(tempModel.getNow()));
234 234 tempModel.setTempList(data);
235   - if(temp != null) {
  235 + if (temp != null) {
236 236 temp.setNow(tempModel.getNow());
237 237 temp.setTempList(data);
238 238 temp.setModified(date);
... ... @@ -242,7 +242,7 @@
242 242 tempModel.setCreated(date);
243 243 tempModel.setCreatedTime(DateUtil.getyyyy_MM_dd(date));
244 244 Patients patients = mongoTemplate.findById(tempModel.getParentId(), Patients.class);
245   - if(patients != null) {
  245 + if (patients != null) {
246 246 tempModel.setPid(patients.getPid());
247 247 }
248 248 tempService.addOneTemp(tempModel);
249 249  
... ... @@ -252,16 +252,22 @@
252 252  
253 253 public BaseResponse getTemp(String parentId) {
254 254 List<Map<String, Object>> restList = new ArrayList<>();
255   - TempModel temp = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(parentId)), TempModel.class);
256   - if(temp != null && MapUtils.isNotEmpty(temp.getTempList())) {
257   - LinkedHashMap<String, Double> tempList = temp.getTempList();
258   - for (Map.Entry<String, Double> entry : tempList.entrySet()) {
259   - Map<String, Object> map = new HashMap<>();
260   - map.put("date", entry.getKey());
261   - map.put("temp", entry.getValue());
262   - restList.add(map);
  255 + List<TempModel> tempList = mongoTemplate.find(Query.query(Criteria.where("pid").is(parentId)), TempModel.class);
  256 + if (CollectionUtils.isNotEmpty(tempList)) {
  257 +
  258 + for (TempModel temp : tempList) {
  259 + if (temp != null && MapUtils.isNotEmpty(temp.getTempList())) {
  260 + LinkedHashMap<String, Double> tempList1 = temp.getTempList();
  261 + for (Map.Entry<String, Double> entry : tempList1.entrySet()) {
  262 + Map<String, Object> map = new HashMap<>();
  263 + map.put("date", entry.getKey());
  264 + map.put("temp", entry.getValue());
  265 + restList.add(map);
  266 + }
  267 + }
263 268 }
264 269 }
  270 +
265 271 com.lyms.platform.operate.web.utils.CollectionUtils.reverseList(restList);
266 272 return RespBuilder.buildSuccess(restList);
267 273 }