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.setPage(1L);
query.setPageSize(20L); query.setPageSize(20L);
} }
Page<BomNewEbomParentVO> result = this.getBaseMapper().workDetailsListByPageNew(new Page<>(query.getPage() Page<BomNewEbomParentVO> result;
, query.getPageSize()), query, userRoleService.getUserJob(), SessionUtil.getUserCode(), SessionUtil.getDepartRowId());
if (StrUtil.isBlank(query.getMaterialNo()) && StrUtil.isBlank(query.getDrawingNo())) { 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); materialMainService.intiMaterialInfo(result.getRecords(), EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
return result; 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() List<BomNewEbomParentVO> roots = result.getRecords().stream()

View File

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