fix(ebom): 修复精确搜索的bug

This commit is contained in:
曹鹏飞 2024-06-03 15:34:35 +08:00
parent 76b549fdeb
commit 1011bda857
2 changed files with 14 additions and 8 deletions

View File

@ -2223,13 +2223,17 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
query.setPage(1L);
query.setPageSize(20L);
}
Page<BomNewEbomParentVO> result = this.getBaseMapper().workDetailsListByPageNew(new Page<>(query.getPage()
, query.getPageSize()), query, userRoleService.getUserJob(), SessionUtil.getUserCode(), SessionUtil.getDepartRowId());
Page<BomNewEbomParentVO> result;
if (StrUtil.isBlank(query.getMaterialNo()) && StrUtil.isBlank(query.getDrawingNo())) {
result = this.getBaseMapper().workDetailsListByPageNew(new Page<>(query.getPage()
, query.getPageSize()), query, userRoleService.getUserJob(), SessionUtil.getUserCode(), SessionUtil.getDepartRowId());
//列表搜索
materialMainService.intiMaterialInfo(result.getRecords(), EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
return result;
}
query.setShowMySelfOnly(0);
result = this.getBaseMapper().workDetailsListByPageNew(new Page<>(query.getPage()
, query.getPageSize()), query, userRoleService.getUserJob(), SessionUtil.getUserCode(), SessionUtil.getDepartRowId());
//根据编号或图号搜索
//从顶级开始查找
List<BomNewEbomParentVO> roots = result.getRecords().stream()

View File

@ -457,12 +457,14 @@
, b.*
FROM t_bom_new_ebom_child b
LEFT JOIN t_bom_new_ebom_parent a ON a.material_no = b.material_no
<if test="materialNo!=null and materialNo!=''">
WHERE b.material_no = #{materialNo}
</if>
<if test="drawingNo!=null and drawingNo!=''">
WHERE b.drawingNo = #{drawingNo}
</if>
<where>
<if test="materialNo!=null and materialNo!=''">
AND b.material_no = #{materialNo}
</if>
<if test="drawingNo!=null and drawingNo!=''">
AND b.drawing_no = #{drawingNo}
</if>
</where>
ORDER BY b.order_number
</select>