This commit is contained in:
parent
cf1662caae
commit
6099e46245
|
|
@ -6,6 +6,7 @@ import com.nflg.product.base.core.api.BaseApi;
|
||||||
import com.nflg.product.base.core.exception.NflgBusinessException;
|
import com.nflg.product.base.core.exception.NflgBusinessException;
|
||||||
import com.nflg.product.bomnew.constant.MBomConstantEnum;
|
import com.nflg.product.bomnew.constant.MBomConstantEnum;
|
||||||
import com.nflg.product.bomnew.pojo.query.BomNewMbomParentQuery;
|
import com.nflg.product.bomnew.pojo.query.BomNewMbomParentQuery;
|
||||||
|
import com.nflg.product.bomnew.pojo.vo.BomNewMbomDetailVO;
|
||||||
import com.nflg.product.bomnew.pojo.vo.BomNewMbomParentVO;
|
import com.nflg.product.bomnew.pojo.vo.BomNewMbomParentVO;
|
||||||
import com.nflg.product.bomnew.service.BomNewMbomDetailService;
|
import com.nflg.product.bomnew.service.BomNewMbomDetailService;
|
||||||
import com.nflg.product.bomnew.service.BomNewMbomParentService;
|
import com.nflg.product.bomnew.service.BomNewMbomParentService;
|
||||||
|
|
@ -18,6 +19,7 @@ import nflg.product.common.vo.ResultVO;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -55,6 +57,16 @@ public class MBomApi extends BaseApi {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("superSaterialList")
|
||||||
|
@ApiOperation("设置超级物料列表")
|
||||||
|
public ResultVO<List<BomNewMbomDetailVO>> superSaterialList(@RequestParam(value = "rowId") Long rowId ) {
|
||||||
|
if (Objects.isNull(rowId)) {
|
||||||
|
throw new NflgBusinessException(STATE.ParamErr, "选择行后操作");
|
||||||
|
}
|
||||||
|
|
||||||
|
return ResultVO.success(bomNewMbomDetailService.superSaterialList(rowId));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("superSaterialStatus")
|
@PostMapping("superSaterialStatus")
|
||||||
@ApiOperation("设置超级物料")
|
@ApiOperation("设置超级物料")
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ package com.nflg.product.bomnew.service;
|
||||||
|
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.convert.Convert;
|
||||||
|
import cn.hutool.core.lang.TypeReference;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.extra.spring.SpringUtil;
|
import cn.hutool.extra.spring.SpringUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
|
@ -12,6 +14,7 @@ import com.nflg.product.bomnew.constant.MBomConstantEnum;
|
||||||
import com.nflg.product.bomnew.mapper.master.BomNewMbomDetailMapper;
|
import com.nflg.product.bomnew.mapper.master.BomNewMbomDetailMapper;
|
||||||
import com.nflg.product.bomnew.pojo.entity.BomNewMbomDetailEntity;
|
import com.nflg.product.bomnew.pojo.entity.BomNewMbomDetailEntity;
|
||||||
import com.nflg.product.bomnew.pojo.entity.BomNewMbomParentEntity;
|
import com.nflg.product.bomnew.pojo.entity.BomNewMbomParentEntity;
|
||||||
|
import com.nflg.product.bomnew.pojo.vo.BomNewMbomDetailVO;
|
||||||
import nflg.product.common.constant.STATE;
|
import nflg.product.common.constant.STATE;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
@ -30,6 +33,28 @@ import java.util.Objects;
|
||||||
public class BomNewMbomDetailService extends ServiceImpl<BomNewMbomDetailMapper, BomNewMbomDetailEntity> {
|
public class BomNewMbomDetailService extends ServiceImpl<BomNewMbomDetailMapper, BomNewMbomDetailEntity> {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public List<BomNewMbomDetailVO> superSaterialList(Long rowId){
|
||||||
|
QueryWrapper<BomNewMbomDetailEntity> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.lambda().eq(BomNewMbomDetailEntity::getParentRowId,rowId);
|
||||||
|
List<BomNewMbomDetailEntity> list= this.list(queryWrapper);
|
||||||
|
List<BomNewMbomDetailVO> voList= Convert.convert(new TypeReference<List<BomNewMbomDetailVO>>() {
|
||||||
|
} ,list);
|
||||||
|
|
||||||
|
return voList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 超级物料标签
|
* 超级物料标签
|
||||||
* <p>
|
* <p>
|
||||||
|
|
@ -45,7 +70,6 @@ public class BomNewMbomDetailService extends ServiceImpl<BomNewMbomDetailMapper,
|
||||||
if (entity == null) {
|
if (entity == null) {
|
||||||
throw new NflgBusinessException(STATE.Error, "设置超级物料数据不存在");
|
throw new NflgBusinessException(STATE.Error, "设置超级物料数据不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
BomNewMbomParentEntity parentEntity = SpringUtil.getBean(BomNewMbomParentService.class).getById(entity.getBomRowId());
|
BomNewMbomParentEntity parentEntity = SpringUtil.getBean(BomNewMbomParentService.class).getById(entity.getBomRowId());
|
||||||
if (parentEntity == null) {
|
if (parentEntity == null) {
|
||||||
throw new NflgBusinessException(STATE.Error, "根数据不存在");
|
throw new NflgBusinessException(STATE.Error, "根数据不存在");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue