Search in sources :

Example 1 with CustomResult

use of com.megagao.production.ssm.domain.customize.CustomResult in project production_ssm by megagao.

the class PMeasureCheckController method deleteBatch.

@RequestMapping(value = "/delete_batch")
@ResponseBody
private CustomResult deleteBatch(String[] ids) throws Exception {
    System.out.println(ids);
    CustomResult result = pMeasureCheckService.deleteBatch(ids);
    return result;
}
Also used : CustomResult(com.megagao.production.ssm.domain.customize.CustomResult) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 2 with CustomResult

use of com.megagao.production.ssm.domain.customize.CustomResult in project production_ssm by megagao.

the class ManufactureController method deleteBatch.

@RequestMapping(value = "/delete_batch")
@ResponseBody
private CustomResult deleteBatch(String[] ids) throws Exception {
    System.out.println(ids);
    CustomResult result = manufactureService.deleteBatch(ids);
    return result;
}
Also used : CustomResult(com.megagao.production.ssm.domain.customize.CustomResult) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 3 with CustomResult

use of com.megagao.production.ssm.domain.customize.CustomResult in project production_ssm by megagao.

the class PCountCheckController method deleteBatch.

@RequestMapping(value = "/delete_batch")
@ResponseBody
private CustomResult deleteBatch(String[] ids) throws Exception {
    System.out.println(ids);
    CustomResult result = pCountCheckService.deleteBatch(ids);
    return result;
}
Also used : CustomResult(com.megagao.production.ssm.domain.customize.CustomResult) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 4 with CustomResult

use of com.megagao.production.ssm.domain.customize.CustomResult in project production_ssm by megagao.

the class PCountCheckController method insert.

@RequestMapping(value = "/insert", method = RequestMethod.POST)
@ResponseBody
private CustomResult insert(@Valid ProcessCountCheck processCountCheck, BindingResult bindingResult) throws Exception {
    CustomResult result;
    if (bindingResult.hasErrors()) {
        FieldError fieldError = bindingResult.getFieldError();
        return CustomResult.build(100, fieldError.getDefaultMessage());
    }
    result = pCountCheckService.insert(processCountCheck);
    return result;
}
Also used : FieldError(org.springframework.validation.FieldError) CustomResult(com.megagao.production.ssm.domain.customize.CustomResult) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 5 with CustomResult

use of com.megagao.production.ssm.domain.customize.CustomResult in project production_ssm by megagao.

the class OrderController method insert.

@RequestMapping(value = "/insert", method = RequestMethod.POST)
@ResponseBody
private CustomResult insert(@Valid COrder cOrder, BindingResult bindingResult) throws Exception {
    CustomResult result;
    if (bindingResult.hasErrors()) {
        FieldError fieldError = bindingResult.getFieldError();
        System.out.println(fieldError.getDefaultMessage());
        return CustomResult.build(100, fieldError.getDefaultMessage());
    }
    if (orderService.get(cOrder.getOrderId()) != null) {
        result = new CustomResult(0, "该订单编号已经存在,请更换订单编号!", null);
    } else {
        result = orderService.insert(cOrder);
    }
    return result;
}
Also used : FieldError(org.springframework.validation.FieldError) CustomResult(com.megagao.production.ssm.domain.customize.CustomResult) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

CustomResult (com.megagao.production.ssm.domain.customize.CustomResult)9 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)9 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)9 FieldError (org.springframework.validation.FieldError)5