Commit 7c6bf997d7a3f74763ad69b8e2b0f494f7dc6291
1 parent
2abd93dc62
Exists in
master
and in
2 other branches
增加问题修改
Showing 1 changed file with 32 additions and 14 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/HospitalCheckItemConfController.java
View file @
7c6bf99
| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | import com.lyms.platform.common.base.BaseController; |
| 5 | 5 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 6 | 6 | import com.lyms.platform.common.enums.YnEnums; |
| 7 | +import com.lyms.platform.common.result.BaseResponse; | |
| 7 | 8 | import com.lyms.platform.common.utils.ResultUtils; |
| 8 | 9 | import com.lyms.platform.common.utils.StringUtils; |
| 9 | 10 | import com.lyms.platform.operate.web.result.FrontEndResult; |
| 10 | 11 | |
| 11 | 12 | |
| 12 | 13 | |
| 13 | 14 | |
| ... | ... | @@ -106,19 +107,26 @@ |
| 106 | 107 | } |
| 107 | 108 | |
| 108 | 109 | @RequestMapping(method = RequestMethod.POST, value = "/add") |
| 110 | + @ResponseBody | |
| 109 | 111 | @TokenRequired |
| 110 | - public void addHospitalCheckItemConf(@RequestBody HospitalCheckItemConf checkItemConf, HttpServletResponse response){ | |
| 112 | + public BaseResponse addHospitalCheckItemConf(@RequestBody HospitalCheckItemConf checkItemConf){ | |
| 111 | 113 | |
| 114 | + BaseResponse baseResponse = new BaseResponse(); | |
| 115 | + baseResponse.setErrorcode(0); | |
| 116 | + baseResponse.setErrormsg("成功"); | |
| 117 | + | |
| 112 | 118 | if(checkItemConf.getHospitalId()== null || |
| 113 | 119 | checkItemConf.getStartWeek() == null|| |
| 114 | 120 | checkItemConf.getEndWeek() == null){ |
| 115 | - ResultUtils.buildParameterErrorResultAndWrite(response, "请填写必须项!"); | |
| 116 | - return; | |
| 121 | + baseResponse.setErrorcode(1); | |
| 122 | + baseResponse.setErrormsg("请填写必须项!"); | |
| 123 | + return baseResponse; | |
| 117 | 124 | } |
| 118 | 125 | |
| 119 | 126 | if(checkItemConf.getStartWeek() > checkItemConf.getEndWeek()){ |
| 120 | - ResultUtils.buildParameterErrorResultAndWrite(response, "起始周不能大于结束周!"); | |
| 121 | - return; | |
| 127 | + baseResponse.setErrorcode(1); | |
| 128 | + baseResponse.setErrormsg("起始周不能大于结束周!"); | |
| 129 | + return baseResponse; | |
| 122 | 130 | } |
| 123 | 131 | HospitalCheckItemConfQuery query = new HospitalCheckItemConfQuery(); |
| 124 | 132 | query.setHospitalId(checkItemConf.getHospitalId()); |
| 125 | 133 | |
| 126 | 134 | |
| 127 | 135 | |
| 128 | 136 | |
| 129 | 137 | |
| ... | ... | @@ -140,24 +148,32 @@ |
| 140 | 148 | checkItemConf.setCreateTime(new Date()); |
| 141 | 149 | checkItemConf.setUpdateTime(new Date()); |
| 142 | 150 | hospitalCheckItemConfService.addHospitalCheckItemConf(checkItemConf); |
| 143 | - ResultUtils.buildSuccessResultAndWrite(response); | |
| 151 | + return baseResponse; | |
| 144 | 152 | }else{ |
| 145 | - ResultUtils.buildParameterErrorResultAndWrite(response, "此范围孕周与已有数据有重合,请确认!"); | |
| 153 | + baseResponse.setErrorcode(1); | |
| 154 | + baseResponse.setErrormsg("此范围孕周与已有数据有重合,请确认!"); | |
| 155 | + return baseResponse; | |
| 146 | 156 | } |
| 147 | 157 | |
| 148 | 158 | } |
| 149 | 159 | |
| 150 | 160 | @RequestMapping(method = RequestMethod.POST, value = "/update") |
| 161 | + @ResponseBody | |
| 151 | 162 | @TokenRequired |
| 152 | - public void updateHospitalCheckItemConf(@RequestBody HospitalCheckItemConf checkItemConf, HttpServletResponse response){ | |
| 163 | + public BaseResponse updateHospitalCheckItemConf(@RequestBody HospitalCheckItemConf checkItemConf){ | |
| 164 | + BaseResponse baseResponse = new BaseResponse(); | |
| 165 | + baseResponse.setErrorcode(0); | |
| 166 | + baseResponse.setErrormsg("成功"); | |
| 153 | 167 | |
| 154 | 168 | if (null == checkItemConf.getId()) { |
| 155 | - ResultUtils.buildParameterErrorResultAndWrite(response, "请选择要修改的数据"); | |
| 156 | - return; | |
| 169 | + baseResponse.setErrorcode(0); | |
| 170 | + baseResponse.setErrormsg("请选择要修改的数据"); | |
| 171 | + return baseResponse; | |
| 157 | 172 | } |
| 158 | 173 | if (checkItemConf.getStartWeek() > checkItemConf.getEndWeek()) { |
| 159 | - ResultUtils.buildParameterErrorResultAndWrite(response, "起始周不能大于结束周!"); | |
| 160 | - return; | |
| 174 | + baseResponse.setErrorcode(0); | |
| 175 | + baseResponse.setErrormsg("起始周不能大于结束周!"); | |
| 176 | + return baseResponse; | |
| 161 | 177 | } |
| 162 | 178 | |
| 163 | 179 | HospitalCheckItemConfQuery query = new HospitalCheckItemConfQuery(); |
| 164 | 180 | |
| ... | ... | @@ -180,9 +196,11 @@ |
| 180 | 196 | checkItemConf.setYn(YnEnums.YES.getId()); |
| 181 | 197 | checkItemConf.setUpdateTime(new Date()); |
| 182 | 198 | hospitalCheckItemConfService.updateHospitalCheckItemConf(checkItemConf); |
| 183 | - ResultUtils.buildSuccessResultAndWrite(response); | |
| 199 | + return baseResponse; | |
| 184 | 200 | }else{ |
| 185 | - ResultUtils.buildParameterErrorResultAndWrite(response, "此范围孕周与已有数据有重合,请确认!"); | |
| 201 | + baseResponse.setErrorcode(0); | |
| 202 | + baseResponse.setErrormsg("此范围孕周与已有数据有重合,请确认!"); | |
| 203 | + return baseResponse; | |
| 186 | 204 | } |
| 187 | 205 | |
| 188 | 206 | } |