|  |  |  | 
|---|
|  |  |  | import com.doumee.service.business.PricingDetailService; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import org.apache.commons.lang3.StringUtils; | 
|---|
|  |  |  | import org.apache.shiro.authz.annotation.RequiresPermissions; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/updateById") | 
|---|
|  |  |  | @RequiresPermissions("business:pricingdetail:update") | 
|---|
|  |  |  | public ApiResponse updateById(@RequestBody PricingDetail pricingDetail) { | 
|---|
|  |  |  | pricingDetailService.updateById(pricingDetail); | 
|---|
|  |  |  | if (StringUtils.isEmpty(pricingDetail.getId())){ | 
|---|
|  |  |  | pricingDetailService.create(pricingDetail); | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | pricingDetailService.updateById(pricingDetail); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | pricingDetail.setIsdeleted(Constants.ZERO); | 
|---|
|  |  |  | return ApiResponse.success(pricingDetailService.findList(pricingDetail)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|