This commit is contained in:
parent
5b3b82a292
commit
ca91951233
|
|
@ -180,7 +180,8 @@ public class TypeController extends BaseController {
|
|||
@ApiOperation(value = "获取物资类型连动式下拉框")
|
||||
@GetMapping("/equipmentType")
|
||||
public AjaxResult equipmentType(@RequestParam(required = false) Long typeId, @RequestParam(required = false) String typeName) {
|
||||
List<Type> listByMaType = typeService.getEquipmentType(typeId, typeName);
|
||||
Long deptId = typeService.getUserDeptId();
|
||||
List<Type> listByMaType = typeService.getEquipmentType(typeId, typeName, deptId);
|
||||
return success(listByMaType);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public interface TypeMapper {
|
|||
// 查询物资类型的内部租赁价
|
||||
BigDecimal selectLeasePriceByTypeId(Long typeId);
|
||||
|
||||
List<Type> selectMaTypeList(@Param("typeId") Long typeId,@Param("typeName") String typeName);
|
||||
List<Type> selectMaTypeList(@Param("typeId") Long typeId, @Param("typeName") String typeName, @Param("companyId") Long companyId);
|
||||
|
||||
/**
|
||||
* 查询物资类型3级--前端联动式下拉框
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public interface ITypeService {
|
|||
|
||||
List<Integer> selectParentId(MaTypeVo type);
|
||||
|
||||
List<Type> getEquipmentType(Long typeId, String typeName);
|
||||
List<Type> getEquipmentType(Long typeId, String typeName, Long deptId);
|
||||
|
||||
/**
|
||||
* 查询物资类型3级--前端联动式下拉框
|
||||
|
|
|
|||
|
|
@ -93,8 +93,8 @@ public class TypeServiceImpl implements ITypeService {
|
|||
* @param typeName 类型名称
|
||||
*/
|
||||
@Override
|
||||
public List<Type> getEquipmentType(Long typeId, String typeName) {
|
||||
List<Type> maTypes = typeMapper.selectMaTypeList(typeId, typeName);
|
||||
public List<Type> getEquipmentType(Long typeId, String typeName, Long deptId) {
|
||||
List<Type> maTypes = typeMapper.selectMaTypeList(typeId, typeName, deptId);
|
||||
List<Type> roots = maTypes.stream()
|
||||
.filter(t -> t.getParentId() == 0)
|
||||
.collect(Collectors.toList());
|
||||
|
|
|
|||
|
|
@ -599,6 +599,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="typeId != null and typeId !=''">
|
||||
AND m.type_id = #{typeId}
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
AND m.company_id = #{companyId}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
|
|
|||
Loading…
Reference in New Issue