optimize: 优化数据验证
This commit is contained in:
parent
1d50b4686d
commit
4efbf98253
|
|
@ -19,7 +19,6 @@ import com.nflg.product.bomnew.pojo.vo.*;
|
|||
import com.nflg.product.bomnew.service.*;
|
||||
import com.nflg.product.bomnew.util.EecExcelUtil;
|
||||
import com.nflg.product.bomnew.util.VUtils;
|
||||
import com.nflg.product.bomnew.util.VersionUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import nflg.product.common.constant.STATE;
|
||||
|
|
@ -37,11 +36,7 @@ import javax.validation.Valid;
|
|||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
|
@ -395,7 +390,7 @@ public class EbomApi extends BaseApi {
|
|||
@PostMapping("temporary")
|
||||
@ApiOperation("暂存")
|
||||
@LogRecord(success = "Ebom-暂存,物料编码:{{#dto.parent.materialNo}}-版本:{{#dto.parent.currentVersion}},操作结果:{{#_ret.state}} {{#_ret.msg}}", bizNo = "{{#dto.parent.rowId}}", type = "Ebom-暂存")
|
||||
public ResultVO<BomNewEbomParentVO> temporary(@RequestBody BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException {
|
||||
public ResultVO<BomNewEbomParentVO> temporary(@Valid @RequestBody BomNewEBomParentEditDTO dto) {
|
||||
|
||||
checkDeleteRule(dto);
|
||||
bomNewEbomParentService.deleteBomChild(dto.getDelDatas(), dto.getParent());
|
||||
|
|
@ -407,7 +402,7 @@ public class EbomApi extends BaseApi {
|
|||
@PostMapping("temporaryAdd")
|
||||
@ApiOperation("暂存添加")
|
||||
@LogRecord(success = "Ebom-暂存添加,物料编码:{{#dto.parent.materialNo}}-版本:{{#dto.parent.currentVersion}},操作结果:{{#_ret.state}} {{#_ret.msg}}", bizNo = "{{#dto.parent.rowId}}", type = "Ebom-暂存添加")
|
||||
public ResultVO<BomNewEbomParentVO> temporaryAdd(@RequestBody BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException {
|
||||
public ResultVO<BomNewEbomParentVO> temporaryAdd(@Valid @RequestBody BomNewEBomParentEditDTO dto) {
|
||||
checkDeleteRule(dto);
|
||||
bomNewEbomParentService.deleteBomChild(dto.getDelDatas(), dto.getParent());
|
||||
BomNewEbomParentVO temporary = bomNewEbomParentService.temporary(dto);
|
||||
|
|
@ -418,7 +413,7 @@ public class EbomApi extends BaseApi {
|
|||
@PostMapping("submitAdd")
|
||||
@ApiOperation("提交添加")
|
||||
@LogRecord(success = "Ebom-提交添加,物料编码:{{#dto.parent.materialNo}}-版本:{{#dto.parent.currentVersion}},操作结果:{{#_ret.state}} {{#_ret.msg}}", bizNo = "{{#dto.parent.rowId}}", type = "Ebom-提交添加")
|
||||
public ResultVO<Boolean> submitAdd(@RequestBody BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException {
|
||||
public ResultVO<Boolean> submitAdd(@Valid @RequestBody BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException {
|
||||
checkDeleteRule(dto);
|
||||
bomNewEbomParentService.deleteBomChild(dto.getDelDatas(), dto.getParent());
|
||||
return ResultVO.success(bomNewEbomParentService.submit(dto));
|
||||
|
|
@ -428,7 +423,7 @@ public class EbomApi extends BaseApi {
|
|||
@PostMapping("submit")
|
||||
@ApiOperation("提交")
|
||||
@LogRecord(success = "Ebom-提交,物料编码:{{#dto.parent.materialNo}}-版本:{{#dto.parent.currentVersion}},操作结果:{{#_ret.state}} {{#_ret.msg}}", bizNo = "{{#dto.parent.rowId}}", type = "Ebom-提交")
|
||||
public ResultVO<Boolean> submit(@RequestBody BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException {
|
||||
public ResultVO<Boolean> submit(@Valid @RequestBody BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException {
|
||||
checkDeleteRule(dto);
|
||||
bomNewEbomParentService.deleteBomChild(dto.getDelDatas(), dto.getParent());
|
||||
return ResultVO.success(bomNewEbomParentService.submit(dto));
|
||||
|
|
|
|||
|
|
@ -4,11 +4,13 @@ import com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO;
|
|||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class BomNewEBomParentEditDTO extends BomNewEBomParentCreateDTO{
|
||||
@ApiModelProperty("上层")
|
||||
@NotNull
|
||||
private BomNewEbomParentVO parent;
|
||||
|
||||
@ApiModelProperty("删除的列表")
|
||||
|
|
|
|||
|
|
@ -1937,7 +1937,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
*/
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public BomNewEbomParentVO temporary(BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException {
|
||||
public BomNewEbomParentVO temporary(BomNewEBomParentEditDTO dto) {
|
||||
|
||||
|
||||
checkUserRoleAuth(dto.getParent().getCreatedBy());
|
||||
|
|
@ -2390,7 +2390,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
for (int index = 0, count = query.size(); index < count; index++) {
|
||||
BomExceptionQuery bom = query.get(index);
|
||||
BomExceptionVO vo = new BomExceptionVO();
|
||||
if (index == 0) {
|
||||
if (index == 0 && bom.getBomRowId() > 0) {
|
||||
BomNewEbomParentEntity parent = getById(bom.getBomRowId());
|
||||
VUtils.isTure(Objects.isNull(parent)).throwMessage(bom.getMaterialNo() + "不存在");
|
||||
|
||||
|
|
@ -2403,7 +2403,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
VUtils.isTure(Objects.isNull(child)).throwMessage(bom.getMaterialNo() + "不存在");
|
||||
|
||||
vo.setMaterialNo(child.getMaterialNo());
|
||||
if (Objects.equals(child.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue())) {
|
||||
if (Objects.equals(child.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue()) && bom.getBomRowId() > 0) {
|
||||
BomNewEbomParentEntity parent = getById(bom.getBomRowId());
|
||||
vo.setExceptionStatus(parent.getExceptionStatus());
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue