|
|
@@ -36,13 +36,29 @@ public class AmbApiController extends CertifyApiController {
|
|
|
public Result updateAmb( InputAmb in){
|
|
|
Result res =new Result();
|
|
|
if (in.getId()==null){
|
|
|
- res.getError().add(getErrorMessageParams(ErrorConstants.PARAM_EMPTY_ERROR,"巴编号"));
|
|
|
+ res.getError().add(buildErrorMessageParams(ErrorConstants.PARAM_EMPTY_ERROR,"巴编号"));
|
|
|
return res;
|
|
|
}
|
|
|
res.data(ambService.updateAmb(in));
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
+ @RequestMapping(value="/delete",method = RequestMethod.POST)
|
|
|
+ public Result deleteAmb( InputAmb in){
|
|
|
+ Result res =new Result();
|
|
|
+ if (in.getId()==null){
|
|
|
+ res.getError().add(buildErrorMessageParams(ErrorConstants.PARAM_EMPTY_ERROR,"巴编号"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ int i=ambService.checkAmb(in);
|
|
|
+ if (i==-1){
|
|
|
+ res.getError().add(buildError("巴存在子项目,请先删除所有子项"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ res.data(ambService.deleteAmb(in));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
@RequestMapping(value="/select",method = RequestMethod.GET)
|
|
|
public Result selectAmb( InputAmb in){
|