Commit 1d144cda authored by tianbo's avatar tianbo

bugfix:

1、增加根据父级Code获取子设备分类列表接口
parent 4c17a1dd
......@@ -681,4 +681,17 @@ public class CommonController extends BaseController {
public Integer checkFactoryNumUniquenessForVehicleCylinder(@RequestParam("factoryNum") String factoryNum) {
return commonService.checkFactoryNumUniquenessForVehicleCylinder(factoryNum,null);
}
/**
* 根据父级code查询子设备分类
*
* @param parentCode 父级code
* @return list
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getSubEquCategoryByParent")
@ApiOperation(httpMethod = "GET", value = "根据父级code查询子设备分类", notes = "根据父级code查询子设备分类")
public ResponseModel<List<EquipmentCategoryDto>> getSubEquCategoryByParent(@RequestParam(value = "parentCode") String parentCode) {
return ResponseHelper.buildResponse(commonService.getSubEquCategoryByParentCode(parentCode));
}
}
......@@ -241,4 +241,6 @@ public interface ICommonService {
List<EquipmentCategoryDto> equipmentClassificationNoPipeline(String type);
List<EquipmentCategoryDto> getEquDefineByParentId(String parentId);
List<EquipmentCategoryDto> getSubEquCategoryByParentCode(String parentCode);
}
......@@ -792,7 +792,7 @@ public class CommonServiceImpl implements ICommonService {
result.forEach(x -> convertAndAddToUnitList(x, unitList));
}
// 使用单位追加 三环认领的(业主可能未注册系统,别人帮忙认领的,帮忙认领后会保存一份原使用单位的数据到字典)
if ("使用单位".equals(type)) {
if ("使用单位".equals(type) && "gasCylindersForCars".equals(business)) {
List<DictionarieValueModel> result = Systemctl.dictionarieClient.dictValues("OLD_USE_UNIT").getResult();
result.forEach(x -> convertAndAddToUnitList(x, unitList));
}
......@@ -2122,6 +2122,11 @@ public class CommonServiceImpl implements ICommonService {
return equipmentCategoryMapper.getEquDefineByParentId(parentId);
}
@Override
public List<EquipmentCategoryDto> getSubEquCategoryByParentCode(String parentCode) {
return equipmentCategoryMapper.getSubEquCategoryByParentCode(parentCode);
}
/**
* 排序 :页面列表排序功能支持,将 "字段,ascend" 或 "字段,descend" 转化为对应JSONObject
*
......
......@@ -100,5 +100,8 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
@Select("SELECT * FROM tz_equipment_category WHERE parent_id = #{parentId}")
List<EquipmentCategoryDto> getEquDefineByParentId(String parentId);
@Select("SELECT * FROM tz_equipment_category WHERE parent_id = ( SELECT ID FROM tz_equipment_category WHERE code = #{parentCode} )")
List<EquipmentCategoryDto> getSubEquCategoryByParentCode(String parentCode);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment