update
This commit is contained in:
@ -20,6 +20,8 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.support.ExcelTypeEnum;
|
||||
import com.pictc.enums.BusinessCode;
|
||||
import com.xjrsoft.common.exception.BusinessException;
|
||||
import com.xjrsoft.common.model.result.R;
|
||||
import com.xjrsoft.common.page.PageOutput;
|
||||
import com.xjrsoft.common.utils.ExcelUtil;
|
||||
@ -32,6 +34,7 @@ import com.xjrsoft.module.dayPlan.vo.LngPngDemandPageVo;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -81,6 +84,9 @@ public class DemandController {
|
||||
@ApiOperation(value = "新增LngPngDemand")
|
||||
@SaCheckPermission("demand:add")
|
||||
public R add(@Valid @RequestBody UpdateLngPngDemandDto dto){
|
||||
if(StrUtil.isBlank(dto.getCuCode())) {
|
||||
throw new BusinessException(BusinessCode.of(10500,"客户编码不能为空!"));
|
||||
}
|
||||
return R.ok(demandService.add(dto));
|
||||
}
|
||||
|
||||
@ -88,6 +94,9 @@ public class DemandController {
|
||||
@ApiOperation(value = "编辑LngPngDemand")
|
||||
@SaCheckPermission("demand:edit")
|
||||
public R update(@Valid @RequestBody UpdateLngPngDemandDto dto){
|
||||
if(StrUtil.isBlank(dto.getCuCode())) {
|
||||
throw new BusinessException(BusinessCode.of(10500,"客户编码不能为空!"));
|
||||
}
|
||||
demandService.update(dto);
|
||||
return R.ok();
|
||||
}
|
||||
@ -96,6 +105,9 @@ public class DemandController {
|
||||
@ApiOperation(value = "保存并提交LngPngDemand")
|
||||
//@SaCheckPermission("demand:edit")
|
||||
public R saveAndSubmit(@Valid @RequestBody UpdateLngPngDemandDto dto){
|
||||
if(StrUtil.isBlank(dto.getCuCode())) {
|
||||
throw new BusinessException(BusinessCode.of(10500,"客户编码不能为空!"));
|
||||
}
|
||||
demandService.saveAndSubmit(dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user