1、 单层反查
This commit is contained in:
parent
bf5797669d
commit
d64fecddbe
|
|
@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.nflg.product.base.core.api.BaseApi;
|
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.ReportConstant;
|
import com.nflg.product.bomnew.constant.ReportConstant;
|
||||||
|
|
@ -52,11 +53,7 @@ public class BomReportApi extends BaseApi {
|
||||||
@ApiOperation("bom-反查")
|
@ApiOperation("bom-反查")
|
||||||
public ResultVO<List<ReverseReportVO>> reverseReport(@Valid @RequestBody ReverseReportQuery query) {
|
public ResultVO<List<ReverseReportVO>> reverseReport(@Valid @RequestBody ReverseReportQuery query) {
|
||||||
|
|
||||||
//原始BOM
|
VUtils.isTure(!ImmutableList.of(1,2).contains(query.getBomType())).throwMessage("只能查询EBom和PBom");
|
||||||
if (query.getBomType().equals(0)) {
|
|
||||||
VUtils.isTure(StrUtil.isBlank(query.getDrawingNo())).throwMessage("图号不能为空");
|
|
||||||
return ResultVO.success(reverseReportService.queryOriginalBom(query));
|
|
||||||
}
|
|
||||||
VUtils.isTure(StrUtil.isBlank(query.getMaterialNo())).throwMessage("物料编码不能为空");
|
VUtils.isTure(StrUtil.isBlank(query.getMaterialNo())).throwMessage("物料编码不能为空");
|
||||||
if(query.getBomType().equals(1)){
|
if(query.getBomType().equals(1)){
|
||||||
return ResultVO.success(reverseReportService.queryEBom(query));
|
return ResultVO.success(reverseReportService.queryEBom(query));
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ public interface BomNewEbomParentMapper extends BaseMapper<BomNewEbomParentEntit
|
||||||
|
|
||||||
Integer checkIsUserRoot(@Param("materialNo")String materialNo, @Param("jobNo")String jobNo);
|
Integer checkIsUserRoot(@Param("materialNo")String materialNo, @Param("jobNo")String jobNo);
|
||||||
|
|
||||||
List<ReverseReportVO> eBomReverseReport(@Param("bomVersionRowId")Long bomVersionRowId,@Param("startDate") String startDate, @Param("endDate")String endDate, @Param("materialNos")List<String> materialNos);
|
List<ReverseReportVO> eBomReverseReport(@Param("bomVersionRowId")Long bomVersionRowId,@Param("startDate") String startDate, @Param("endDate")String endDate, @Param("materialNo")String materialNo);
|
||||||
Integer getCountForWaitReviewByMaterialNo(@Param("materialNo") String materialNo);
|
Integer getCountForWaitReviewByMaterialNo(@Param("materialNo") String materialNo);
|
||||||
|
|
||||||
void updateRootForWaitReview();
|
void updateRootForWaitReview();
|
||||||
|
|
|
||||||
|
|
@ -54,13 +54,20 @@ public class EBomQueryService {
|
||||||
*/
|
*/
|
||||||
public List<ReverseReportVO> singleLevelReport(ReverseReportQuery queryParam) {
|
public List<ReverseReportVO> singleLevelReport(ReverseReportQuery queryParam) {
|
||||||
Long bomVersionRowId=0L;
|
Long bomVersionRowId=0L;
|
||||||
if(StrUtil.isNotBlank(queryParam.getBomVersion())){
|
//指定版本
|
||||||
|
if(queryParam.getVersionStrategy().equals(2) && StrUtil.isNotBlank(queryParam.getBomVersion())){
|
||||||
BomNewEbomParentFormalEntity one = ebomParentFormalService.lambdaQuery().eq(BomNewEbomParentFormalEntity::getMaterialNo, queryParam.getMaterialNo())
|
BomNewEbomParentFormalEntity one = ebomParentFormalService.lambdaQuery().eq(BomNewEbomParentFormalEntity::getMaterialNo, queryParam.getMaterialNo())
|
||||||
.eq(BomNewEbomParentFormalEntity::getCurrentVersion, queryParam.getBomVersion()).one();
|
.eq(BomNewEbomParentFormalEntity::getCurrentVersion, queryParam.getBomVersion()).one();
|
||||||
bomVersionRowId= Objects.nonNull(one)? one.getRowId():0L;
|
bomVersionRowId= Objects.nonNull(one)? one.getRowId():0L;
|
||||||
|
}//最新版本
|
||||||
|
else if(queryParam.getVersionStrategy().equals(0)){
|
||||||
|
BomNewEbomParentFormalEntity one = ebomParentFormalService.lambdaQuery().eq(BomNewEbomParentFormalEntity::getMaterialNo, queryParam.getMaterialNo())
|
||||||
|
.last(" order by current_version desc limit 1").one();
|
||||||
|
if(Objects.nonNull(one)){
|
||||||
|
bomVersionRowId=one.getRowId();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return ebomParentService.getBaseMapper().eBomReverseReport(bomVersionRowId,queryParam.getStartDate(),queryParam.getEndDate(), queryParam.getMaterialNo());
|
||||||
return ebomParentService.getBaseMapper().eBomReverseReport(bomVersionRowId,queryParam.getStartDate(),queryParam.getEndDate(), ImmutableList.of(queryParam.getMaterialNo()));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -347,10 +347,7 @@
|
||||||
<if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
|
<if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
|
||||||
and b.convert_to_ebom_time >= #{startDate} and b.expire_end_time <=#{endDate}
|
and b.convert_to_ebom_time >= #{startDate} and b.expire_end_time <=#{endDate}
|
||||||
</if>
|
</if>
|
||||||
and a.material_no in
|
and a.material_no =#{materialNo}
|
||||||
<foreach collection="materialNos" item="materialNo" open="(" separator="," close=")">
|
|
||||||
#{materialNo}
|
|
||||||
</foreach>
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getCountForWaitReviewByMaterialNo" resultType="java.lang.Integer">
|
<select id="getCountForWaitReviewByMaterialNo" resultType="java.lang.Integer">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue