物资类型删除

This commit is contained in:
mashuai 2024-10-25 16:22:05 +08:00
parent 86cec30880
commit 9f9641ae7e
6 changed files with 18 additions and 12 deletions

View File

@ -61,11 +61,11 @@ public class TypeController extends BaseController {
*/ */
@ApiOperation(value = "根据左列表类型id查询右表格") @ApiOperation(value = "根据左列表类型id查询右表格")
@GetMapping("/getListByMaType") @GetMapping("/getListByMaType")
public AjaxResult getListByMaType(Type type) { public AjaxResult getListByMaType(MaTypeListVo type) {
List<Integer> parentIds = typeService.selectParentId(type); List<Integer> parentIds = typeService.selectParentId(type);
List<MaTypeListVo> listByMaType = new ArrayList<>(); List<MaTypeListVo> listByMaType = new ArrayList<>();
for (Integer parentId : parentIds) { for (Integer parentId : parentIds) {
listByMaType.addAll(typeService.getListByParentId(parentId.longValue(), type.getTypeName())); listByMaType.addAll(typeService.getListByParentId(parentId.longValue(), type));
} }
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1); Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10); Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);

View File

@ -160,6 +160,8 @@ public class Type extends BaseEntity {
@ApiModelProperty(value = "推送智慧工程定义的门类分类机具编码") @ApiModelProperty(value = "推送智慧工程定义的门类分类机具编码")
private String intelligentCode; private String intelligentCode;
private String keyword;
/** 子节点 */ /** 子节点 */
@JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonInclude(JsonInclude.Include.NON_EMPTY)
private List<Type> children = new ArrayList<>(); private List<Type> children = new ArrayList<>();

View File

@ -29,7 +29,7 @@ public interface TypeMapper {
* 根据level层级和typeID 查询父级ID * 根据level层级和typeID 查询父级ID
* @param type * @param type
*/ */
List<Integer> selectParentId(Type type); List<Integer> selectParentId(MaTypeListVo type);
/** /**
* 根据物资仓库的ID查询物资类型列表 * 根据物资仓库的ID查询物资类型列表
@ -37,7 +37,7 @@ public interface TypeMapper {
*/ */
List<MaTypeSelectVo> selectMaTypeListByHouseId(Long houseId); List<MaTypeSelectVo> selectMaTypeListByHouseId(Long houseId);
List<MaTypeListVo> getListByTypeName(@Param("typeId") Long typeId, @Param("typeName") String typeName); List<MaTypeListVo> getListByTypeName(@Param("typeId") Long typeId, @Param("type") MaTypeListVo type);
/** /**
* 查询物资类型下拉树结构--根据上级ID * 查询物资类型下拉树结构--根据上级ID

View File

@ -23,13 +23,13 @@ public interface ITypeService {
*/ */
Type selectTypeByTypeId(Long typeId); Type selectTypeByTypeId(Long typeId);
List<Integer> selectParentId(Type type); List<Integer> selectParentId(MaTypeListVo type);
List<Type> getEquipmentType(Long typeId, String typeName); List<Type> getEquipmentType(Long typeId, String typeName);
List<MaTypeSelectVo> selectMaTypeListByHouseId(Long houseId); List<MaTypeSelectVo> selectMaTypeListByHouseId(Long houseId);
List<MaTypeListVo> getListByParentId(Long typeId, String typeName); List<MaTypeListVo> getListByParentId(Long typeId, MaTypeListVo type);
/** /**
* 查询物资类型下拉树结构--根据上级ID * 查询物资类型下拉树结构--根据上级ID

View File

@ -64,7 +64,7 @@ public class TypeServiceImpl implements ITypeService {
} }
@Override @Override
public List<Integer> selectParentId(Type type) { public List<Integer> selectParentId(MaTypeListVo type) {
return typeMapper.selectParentId(type); return typeMapper.selectParentId(type);
} }
@ -100,11 +100,11 @@ public class TypeServiceImpl implements ITypeService {
* 根据组织树parent_id查询结果 * 根据组织树parent_id查询结果
* *
* @param typeId 父级id * @param typeId 父级id
* @param typeName 名称筛选 * @param type 名称筛选
*/ */
@Override @Override
public List<MaTypeListVo> getListByParentId(Long typeId, String typeName) { public List<MaTypeListVo> getListByParentId(Long typeId, MaTypeListVo type) {
return typeMapper.getListByTypeName(typeId, typeName); return typeMapper.getListByTypeName(typeId, type);
} }
@Override @Override

View File

@ -436,8 +436,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN ma_type m3 ON m2.parent_id = m3.type_id LEFT JOIN ma_type m3 ON m2.parent_id = m3.type_id
and m3.del_flag = '0' and m3.del_flag = '0'
WHERE m.parent_id = #{typeId} and m.del_flag = '0' WHERE m.parent_id = #{typeId} and m.del_flag = '0'
<if test="typeName != null and typeName !=''"> <if test="keyword != null and keyword !=''">
AND m.type_name like concat('%',#{typeName},'%') AND (m.type_name like concat('%',#{keyword},'%')
or m1.type_name like concat('%',#{keyword},'%')
or m2.type_name like concat('%',#{keyword},'%')
or m3.type_name like concat('%',#{keyword},'%')
)
</if> </if>
</select> </select>
<select id="queryByName" resultType="com.bonus.material.ma.domain.Type"> <select id="queryByName" resultType="com.bonus.material.ma.domain.Type">