feat(feature/DM/nflg-bom): 原始bom明细表查询参数添加“是否仅显示自己的数据”
This commit is contained in:
parent
ba19d4f1be
commit
e04e638f03
|
|
@ -1,6 +1,5 @@
|
|||
package com.nflg.product.bomnew.pojo.query;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -8,7 +7,6 @@ import lombok.Data;
|
|||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -20,8 +18,6 @@ import java.util.List;
|
|||
@ApiModel(value = "com-nflg-product-bom-obom-pojo-query-BomOriginalParentEntityQuery")
|
||||
public class OriginalBomQuery extends BasePageQuery {
|
||||
|
||||
|
||||
|
||||
@ApiModelProperty(value = "图号集合,英文逗号隔开")
|
||||
private String drawingNoList;
|
||||
|
||||
|
|
@ -45,12 +41,10 @@ public class OriginalBomQuery extends BasePageQuery {
|
|||
@ApiModelProperty(value = "状态:1=待转换、2=已转换")
|
||||
private Integer status;
|
||||
|
||||
|
||||
|
||||
private String startDate;
|
||||
|
||||
private String endDate;
|
||||
|
||||
|
||||
|
||||
@ApiModelProperty(value = "是否仅显示自己的数据:0=所有人的数据;1=仅自己的数据,默认为0")
|
||||
private Integer showMySelfOnly = 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -145,11 +145,9 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
|
|||
Page<BomOriginalListVO> result = new Page<>();
|
||||
//物料编码搜索或图号搜索
|
||||
if (CollUtil.isNotEmpty(query.getMaterialNos()) || CollUtil.isNotEmpty(query.getDrawingNos())) {
|
||||
List<String> queryDrawingNos = new ArrayList<>();
|
||||
queryDrawingNos.addAll(query.getDrawingNos());
|
||||
List<String> drawingParentNos=new ArrayList<>();
|
||||
List<String> queryDrawingNos = new ArrayList<>(query.getDrawingNos());
|
||||
if (CollUtil.isNotEmpty(query.getMaterialNos())) {
|
||||
drawingParentNos = this.getBaseMapper().getDrawingNoByMaterialNos(query.getMaterialNos());
|
||||
List<String> drawingParentNos = this.getBaseMapper().getDrawingNoByMaterialNos(query.getMaterialNos());
|
||||
if (CollUtil.isNotEmpty(drawingParentNos)) {
|
||||
queryDrawingNos.addAll(drawingParentNos);
|
||||
}
|
||||
|
|
@ -160,7 +158,7 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
|
|||
if(query.getStatus().equals(1) && CollUtil.isEmpty(materialBoms)){
|
||||
return result;
|
||||
}
|
||||
List<String> parentDrawingNos = getParentDrawingNoByMaterialNo(queryDrawingNos).stream().collect(Collectors.toList());
|
||||
List<String> parentDrawingNos = new ArrayList<>(getParentDrawingNoByMaterialNo(queryDrawingNos));
|
||||
parentDrawingNos.addAll(queryDrawingNos);
|
||||
if (CollUtil.isNotEmpty(parentDrawingNos)) {
|
||||
List<BomOriginalListVO> parents = this.getBaseMapper().getParentForDrawingNoSeach(parentDrawingNos, query.getStatus());
|
||||
|
|
@ -173,8 +171,11 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
|
|||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
result = this.getBaseMapper().getOriginalBomListPage(new Page<>(query.getPage(), query.getPageSize()), query, SessionUtil.getUserCode());
|
||||
String userCode = null;
|
||||
if (query.getShowMySelfOnly() == 1) {
|
||||
userCode = SessionUtil.getUserCode();
|
||||
}
|
||||
result = this.getBaseMapper().getOriginalBomListPage(new Page<>(query.getPage(), query.getPageSize()), query, userCode);
|
||||
materialMainService.intiMaterialInfo(result.getRecords());
|
||||
}
|
||||
return result;
|
||||
|
|
@ -201,7 +202,7 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
|
|||
|
||||
if (CollUtil.isNotEmpty(childEntities)) {
|
||||
//删除行
|
||||
List<Long> delRowIds = bom.getBomList().stream().filter(u -> u.getRowId() > 0).map(u -> u.getRowId()).collect(Collectors.toList());
|
||||
List<Long> delRowIds = bom.getBomList().stream().map(BomOriginalListVO::getRowId).filter(rowId -> rowId > 0).collect(Collectors.toList());
|
||||
originalChildService.getBaseMapper().delOriginalChildNotInRowIds(delRowIds, bom.getParentRowId());
|
||||
originalChildService.saveOrUpdateBatch(childEntities);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,6 +70,9 @@
|
|||
<if test="query.startDate!=null and query.startDate!=''">
|
||||
and created_time between #{query.startDate} and DATE_ADD(#{query.endDate}, INTERVAL 1 DAY)
|
||||
</if>
|
||||
<if test="userCode!=null">
|
||||
and created_by=#{userCode}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<!--获取原始bom列表-->
|
||||
|
|
|
|||
Loading…
Reference in New Issue