Commit ddb5c510a1a87d7d532994647ad3727695b11434

Authored by Administrator
1 parent d58c38edf4

update

Showing 4 changed files with 50 additions and 44 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RegionController.java View file @ ddb5c51
... ... @@ -41,7 +41,7 @@
41 41 * Created by Administrator on 2015/9/17 0017.
42 42 */
43 43 @Controller
44   -public class RegionController extends BaseController{
  44 +public class RegionController extends BaseController {
45 45  
46 46 @Autowired
47 47 private BasicConfigService basicConfigService;
48 48  
49 49  
50 50  
... ... @@ -53,14 +53,15 @@
53 53 * mongo 里面省市区的id
54 54 */
55 55 public static final String CHINA_BASIC_ID = "f6c505dd-835a-43d7-b0bb-fdb9eb0b7b31";
  56 +
56 57 @TokenRequired
57   - @RequestMapping(value = "/regions",method = RequestMethod.GET)
  58 + @RequestMapping(value = "/regions", method = RequestMethod.GET)
58 59 public void getRegions(@RequestParam(value = "parentId", required = false) String parentId,
59   - HttpServletResponse httpServletResponse, HttpServletRequest request ){
  60 + HttpServletResponse httpServletResponse, HttpServletRequest request) {
60 61 //获取登录用户
61 62 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
62 63 Users user = usersService.getUsers(loginState.getId());
63   - if(null == user) {
  64 + if (null == user) {
64 65 ResultUtils.buildResultAndWrite(httpServletResponse, ErrorCodeConstants.SYSTEM_ERROR, "not find login user!");
65 66 return;
66 67 }
67 68  
... ... @@ -68,14 +69,15 @@
68 69 query.setYn(YnEnums.YES.getId());
69 70 query.setTypeId("b7ea005c-dfac-4c2a-bdae-25239b3f44fd");
70 71  
71   - if(UserTypeEnum.NORMAL_USER.getId().equals(user.getType())) {
72   - if(null == user.getOrgId()) {
  72 + if (UserTypeEnum.NORMAL_USER.getId().equals(user.getType())) {
  73 + if (null == user.getOrgId()) {
73 74 ResultUtils.buildResultAndWrite(httpServletResponse, ErrorCodeConstants.SYSTEM_ERROR, "user not defined orgId error!");
74 75 return;
75 76 }
76 77 Organization organization = organizationService.getOrganization(user.getOrgId());
77   - if("0".equals(parentId)){
78   - parentId = SystemConfig.CHINA_BASIC_ID;;
  78 + if ("0".equals(parentId)) {
  79 + parentId = SystemConfig.CHINA_BASIC_ID;
  80 + ;
79 81 }
80 82 /* if (null != organization.getProvinceId() && null==parentId) {
81 83 parentId = organization.getProvinceId();
82 84  
... ... @@ -91,9 +93,9 @@
91 93 parentId = organization.getStreetId();
92 94 query.setId(parentId);
93 95 }else {*/
94   - query.setParentId(parentId);
  96 + query.setParentId(parentId);
95 97 // }
96   - }else{
  98 + } else {
97 99 query.setParentId(parentId);
98 100 }
99 101  
100 102  
... ... @@ -105,14 +107,14 @@
105 107 query.setEnable(1);
106 108  
107 109 List<BasicConfig> configList = basicConfigService.queryBasicConfig(query);
108   - List<Map<String,Object>> list =new ArrayList<Map<String, Object>>();
109   - if (CollectionUtils.isNotEmpty(configList)){
110   - for (BasicConfig config :configList){
111   - Map<String,Object> region=new HashMap<String, Object>();
112   - region.put("id",config.getId());
113   - region.put("regionName",config.getName());
  110 + List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
  111 + if (CollectionUtils.isNotEmpty(configList)) {
  112 + for (BasicConfig config : configList) {
  113 + Map<String, Object> region = new HashMap<String, Object>();
  114 + region.put("id", config.getId());
  115 + region.put("regionName", config.getName());
114 116 region.put("parentId", config.getParentId());
115   - region.put("code", config.getCode() );
  117 + region.put("code", config.getCode());
116 118 list.add(region);
117 119 }
118 120 }
119 121  
120 122  
121 123  
122 124  
... ... @@ -120,16 +122,16 @@
120 122 }
121 123  
122 124  
123   - @RequestMapping(value = "/queryRegions",method = RequestMethod.GET)
  125 + @RequestMapping(value = "/queryRegions", method = RequestMethod.GET)
124 126 public void queryRegions(@RequestParam(value = "parentId", required = false) String parentId,
125 127 @RequestParam(value = "id", required = false) String id,
126   - HttpServletResponse httpServletResponse, HttpServletRequest request ){
  128 + HttpServletResponse httpServletResponse, HttpServletRequest request) {
127 129 BasicConfigQuery query = new BasicConfigQuery();
128   - if(StringUtils.isBlank(parentId) && StringUtils.isBlank(id)) {
  130 + if (StringUtils.isBlank(parentId) && StringUtils.isBlank(id)) {
129 131 query.setParentId(SystemConfig.CHINA_BASIC_ID);
130   - } else if(StringUtils.isNotBlank(parentId)){
  132 + } else if (StringUtils.isNotBlank(parentId)) {
131 133 query.setParentId(parentId);
132   - }else if(StringUtils.isNotBlank(id)) {
  134 + } else if (StringUtils.isNotBlank(id)) {
133 135 query.setId(id);
134 136 }
135 137  
136 138  
137 139  
138 140  
139 141  
140 142  
... ... @@ -137,44 +139,41 @@
137 139 query.setTypeId("b7ea005c-dfac-4c2a-bdae-25239b3f44fd");
138 140  
139 141 List<BasicConfig> configList = basicConfigService.queryBasicConfig(query);
140   - List<Map<String,Object>> list =new ArrayList<Map<String, Object>>();
141   - if (CollectionUtils.isNotEmpty(configList)){
142   - for (BasicConfig config :configList){
143   - Map<String,Object> region=new HashMap<String, Object>();
144   - region.put("id",config.getId());
145   - region.put("name",config.getName());
146   - region.put("code",config.getCode());
  142 + List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
  143 + if (CollectionUtils.isNotEmpty(configList)) {
  144 + for (BasicConfig config : configList) {
  145 + Map<String, Object> region = new HashMap<String, Object>();
  146 + region.put("id", config.getId());
  147 + region.put("name", config.getName());
  148 + region.put("code", config.getCode());
147 149 list.add(region);
148 150 }
149 151 }
150 152 ResultUtils.buildSuccessResultAndWrite(httpServletResponse, list);
151 153 }
152   - @RequestMapping(value = "/getAddress",method = RequestMethod.GET)
  154 +
  155 + @RequestMapping(value = "/getAddress", method = RequestMethod.GET)
153 156 public void getAddress() {
154 157 BasicConfigQuery regionsQuery = new BasicConfigQuery();
155 158 regionsQuery.setParentId(CHINA_BASIC_ID);
156 159 regionsQuery.setYn(YnEnums.YES.getId());
157 160 List<BasicConfig> basicConfigList = basicConfigService.queryBasicConfig(regionsQuery);
158 161 List<String> list = new ArrayList<>();
159   - for(BasicConfig bc : basicConfigList)
160   - {
  162 + for (BasicConfig bc : basicConfigList) {
161 163 list.add(bc.getName());
162 164 regionsQuery.setParentId(bc.getId());
163 165 List<BasicConfig> list1 = basicConfigService.queryBasicConfig(regionsQuery);
164   - for(BasicConfig bc1 : list1)
165   - {
  166 + for (BasicConfig bc1 : list1) {
166 167 list.add(bc1.getName());
167 168  
168 169 regionsQuery.setParentId(bc1.getId());
169 170 List<BasicConfig> list2 = basicConfigService.queryBasicConfig(regionsQuery);
170   - for(BasicConfig bc2 : list2)
171   - {
  171 + for (BasicConfig bc2 : list2) {
172 172 list.add(bc2.getName());
173 173  
174 174 regionsQuery.setParentId(bc2.getId());
175 175 List<BasicConfig> list3 = basicConfigService.queryBasicConfig(regionsQuery);
176   - for(BasicConfig bc3 : list3)
177   - {
  176 + for (BasicConfig bc3 : list3) {
178 177 list.add(bc3.getName());
179 178 }
180 179  
181 180  
... ... @@ -194,12 +193,13 @@
194 193  
195 194 /**
196 195 * 解析身份证地址
  196 + *
197 197 * @param address
198 198 * @return
199 199 */
200 200 @RequestMapping(value = "/getAddressItems", method = RequestMethod.GET)
201 201 @ResponseBody
202   - public BaseObjectResponse getAddressItems(@RequestParam(required = true)String address) throws UnsupportedEncodingException {
  202 + public BaseObjectResponse getAddressItems(@RequestParam(required = true) String address) throws UnsupportedEncodingException {
203 203 //address = new String(address.getBytes("ISO-8859-1"),"utf-8");
204 204 return basicConfigService.getAddressItems(address);
205 205 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java View file @ ddb5c51
... ... @@ -2429,7 +2429,7 @@
2429 2429 BabyCheckModel checkModel = babyCheckModels.get(0);
2430 2430  
2431 2431 int month = DateUtil.getMonth(model.getBirth(), checkModel.getCheckDate());
2432   - if (month == 0 || month > 36) {
  2432 + if (month > 36) {
2433 2433 return new BaseObjectResponse().setData(data).setErrorcode(ErrorCodeConstants.NO_DATA).setErrormsg("月龄范围没有报告");
2434 2434 }
2435 2435  
... ... @@ -2445,7 +2445,9 @@
2445 2445 baseInfo.put("heightEvaluate", checkModel.getHeightEvaluate());
2446 2446 baseInfo.put("month", month);
2447 2447  
2448   -
  2448 + if (month == 0) {
  2449 + month = 1;
  2450 + }
2449 2451 String kaupEvaluate = "";
2450 2452 if (StringUtils.isNotEmpty(checkModel.getWeight()) && StringUtils.isNotEmpty(checkModel.getHeight())) {
2451 2453 String bmi = patientWeightService.getBmi(checkModel.getWeight(), checkModel.getHeight());
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java View file @ ddb5c51
... ... @@ -6282,8 +6282,12 @@
6282 6282 if (null != checkModel) {
6283 6283 result.setCheckDate(DateUtil.getyyyy_MM_dd(checkModel.getCheckDate()));
6284 6284 result.setMonthAge(DateUtil.getBabyMonthAge(checkModel.getBirth(), checkModel.getCheckDate()));
6285   - result.setWeight(StringUtils.isNotEmpty(checkModel.getWeight()) ? checkModel.getWeight() + "kg,评价:" + checkModel.getWeightEvaluate() : "");
6286   - result.setHeight(StringUtils.isNotEmpty(checkModel.getHeight()) ? checkModel.getHeight() + "cm,评价:" + checkModel.getHeightEvaluate() : "");
  6285 + String weight = StringUtils.isNotEmpty(checkModel.getWeight()) ? checkModel.getWeight() + "kg," : "";
  6286 + String height = StringUtils.isNotEmpty(checkModel.getHeight()) ? checkModel.getHeight() + "cm," : "";
  6287 + String weightEvaluate = StringUtils.isNotEmpty(checkModel.getWeightEvaluate()) ? "评价:" + checkModel.getWeightEvaluate() : "";
  6288 + String heightEvaluate = StringUtils.isNotEmpty(checkModel.getHeightEvaluate()) ? "评价:" + checkModel.getHeightEvaluate() : "";
  6289 + result.setWeight(weight + weightEvaluate);
  6290 + result.setHeight(height + heightEvaluate);
6287 6291 result.setWeightOrHeight(checkModel.getHeightWeight());
6288 6292 result.setPhysiqueInfo(checkModel.getGrowthEvaluate());
6289 6293 result.setHeadCircumference(checkModel.getHead());
platform-operate-api/src/main/java/com/lyms/platform/operate/web/session/SessionProvider.java View file @ ddb5c51
... ... @@ -90,7 +90,7 @@
90 90 public LoginContext register(Integer userId, String phone, String account, String pwd) {
91 91 ISessionProvider iSessionProvider = iSessionProviderMap.get(currentStrateger);
92 92 if (null != iSessionProvider) {
93   - return iSessionProvider.register(userId, phone, account,pwd);
  93 + return iSessionProvider.register(userId, phone, account, pwd);
94 94 }
95 95 if (null != defaultSessionProvider) {
96 96 return defaultSessionProvider.register(userId, phone, account, pwd);