| | |
| | | //没有数据正常 |
| | | user.setExaminationType("0"); |
| | | } else { |
| | | int count = 0; |
| | | user.setExaminationType("1"); |
| | | for (int i = 0; i < res.length(); i++) { |
| | | if (res.getJSONObject(i).get("zdrylbjh").toString() != null |
| | | && res.getJSONObject(i).get("zdrylbjh").toString() != "") { |
| | | && res.getJSONObject(i).get("zdrylbjh").toString() != "" |
| | | && res.getJSONObject(i).get("zdrylbjh").toString() != "null" |
| | | ) { |
| | | user.setExaminationMx(res.getJSONObject(i).get("zdrylbjh").toString()); |
| | | //更新用户数据 |
| | | userService.updateById(user); |
| | | break; |
| | | } |
| | | if (res.getJSONObject(i).get("zdryxlmc").toString() != null |
| | | && res.getJSONObject(i).get("zdryxlmc").toString() != "") { |
| | | && res.getJSONObject(i).get("zdryxlmc").toString() != "" |
| | | && res.getJSONObject(i).get("zdryxlmc").toString() != "null" |
| | | ) { |
| | | user.setExaminationMx(res.getJSONObject(i).get("zdryxlmc").toString()); |
| | | //更新用户数据 |
| | | userService.updateById(user); |
| | | break; |
| | | } |
| | | if (res.getJSONObject(i).get("ztrylx").toString() != null |
| | | && res.getJSONObject(i).get("ztrylx").toString() != "") { |
| | | && res.getJSONObject(i).get("ztrylx").toString() != "" |
| | | && res.getJSONObject(i).get("ztrylx").toString() != "null" |
| | | ) { |
| | | user.setExaminationMx(res.getJSONObject(i).get("ztrylx").toString()); |
| | | //更新用户数据 |
| | | userService.updateById(user); |
| | | break; |
| | | } |
| | | if (res.getJSONObject(i).get("ajlbmc").toString() != null |
| | | && res.getJSONObject(i).get("ajlbmc").toString() != "") { |
| | | user.setExaminationMx(res.getJSONObject(i).get("ajlbmc").toString()); |
| | | //更新用户数据 |
| | | // if (res.getJSONObject(i).get("ajlbmc").toString() != null |
| | | // && res.getJSONObject(i).get("ajlbmc").toString() != "") { |
| | | // user.setExaminationMx(res.getJSONObject(i).get("ajlbmc").toString()); |
| | | // //更新用户数据 |
| | | // userService.updateById(user); |
| | | // break; |
| | | // } |
| | | count++; |
| | | //条件中的数据都为空,则审查为正常 |
| | | if (count==res.length()){ |
| | | //更新用户数据,设为正常 |
| | | user.setExaminationType("0"); |
| | | userService.updateById(user); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/investigate/testBody") |
| | | public String testBody(@RequestBody String body){ |
| | | public R testBody(@RequestBody String body){ |
| | | JSONObject jsonObject = new JSONObject(body); |
| | | Object data = jsonObject.get("data"); |
| | | JSONObject jsonData = new JSONObject(data.toString()); |
| | | JSONArray jsonArray = jsonData.getJSONArray("res"); |
| | | if (jsonArray.length()>0){ |
| | | String zdxsfzqkry = jsonArray.getJSONObject(0).get("zdxsfzqkry").toString(); |
| | | return zdxsfzqkry; |
| | | JSONArray res = jsonData.getJSONArray("res"); |
| | | User user = new User(); |
| | | if (res.length()>0){ |
| | | // String zdxsfzqkry = res.getJSONObject(0).get("zdxsfzqkry").toString(); |
| | | int count = 0; |
| | | for (int i = 0; i < res.length(); i++) { |
| | | System.out.println("res.length() =" + res.length()); |
| | | if (res.getJSONObject(i).get("zdrylbjh").toString() != null |
| | | && res.getJSONObject(i).get("zdrylbjh").toString() != "" |
| | | && res.getJSONObject(i).get("zdrylbjh").toString() != "null" |
| | | ) { |
| | | user.setExaminationMx(res.getJSONObject(i).get("zdrylbjh").toString()); |
| | | //更新用户数据 |
| | | userService.updateById(user); |
| | | break; |
| | | } |
| | | if (res.getJSONObject(i).get("zdryxlmc").toString() != null |
| | | && res.getJSONObject(i).get("zdryxlmc").toString() != "" |
| | | && res.getJSONObject(i).get("zdryxlmc").toString() != "null" |
| | | ) { |
| | | user.setExaminationMx(res.getJSONObject(i).get("zdryxlmc").toString()); |
| | | //更新用户数据 |
| | | userService.updateById(user); |
| | | break; |
| | | } |
| | | if (res.getJSONObject(i).get("ztrylx").toString() != null |
| | | && res.getJSONObject(i).get("ztrylx").toString() != "" |
| | | && res.getJSONObject(i).get("ztrylx").toString() != "null" |
| | | ) { |
| | | user.setExaminationMx(res.getJSONObject(i).get("ztrylx").toString()); |
| | | //更新用户数据 |
| | | userService.updateById(user); |
| | | break; |
| | | } |
| | | count++; |
| | | System.out.println("count = " + count); |
| | | // if (res.getJSONObject(i).get("ajlbmc").toString() != null |
| | | // && res.getJSONObject(i).get("ajlbmc").toString() != "" |
| | | // && res.getJSONObject(i).get("ajlbmc").toString() != "null" |
| | | // ) { |
| | | // user.setExaminationMx(res.getJSONObject(i).get("ajlbmc").toString()); |
| | | // //更新用户数据 |
| | | // userService.updateById(user); |
| | | // break; |
| | | // } |
| | | } |
| | | return R.data(user); |
| | | } |
| | | return null; |
| | | } |