Commit cceaa879 authored by zhangsen's avatar zhangsen

bug修改

parent 2ef25806
...@@ -460,7 +460,7 @@ public class EquipmentCategoryController extends AbstractBaseController { ...@@ -460,7 +460,7 @@ public class EquipmentCategoryController extends AbstractBaseController {
String subCode = action.getCode().replaceAll("0+$", ""); String subCode = action.getCode().replaceAll("0+$", "");
int count = StringUtils.isNotEmpty(bizOrgCode)? equipmentCategoryMapper.countByFireTypeAndCode(subCode, bizOrgCode) : 0; int count = StringUtils.isNotEmpty(bizOrgCode)? equipmentCategoryMapper.countByFireTypeAndCode(subCode, bizOrgCode) : 0;
action.setName(action.getName() + "(" + count + ")"); action.setName(action.getName() + "(" + count + ")");
action.setCode(action.getCode() + "@");
if (beginName.equals("消防设施") || beginName.equals("消防系统")) { if (beginName.equals("消防设施") || beginName.equals("消防系统")) {
action.setPatrolNum(count); action.setPatrolNum(count);
action.setParentId(-1L); action.setParentId(-1L);
......
...@@ -101,14 +101,14 @@ public class InputItemController extends AbstractBaseController { ...@@ -101,14 +101,14 @@ public class InputItemController extends AbstractBaseController {
@ApiParam(value = "树code")@RequestParam(required = false) String treeId) { @ApiParam(value = "树code")@RequestParam(required = false) String treeId) {
int inhierarchy = 1; int inhierarchy = 1;
String subCode = ""; String subCode = "";
if (StringUtil.isNotEmpty(treeId) && Long.parseLong(treeId) > 0) { if (StringUtil.isNotEmpty(treeId) && Long.parseLong(treeId.replace("@","")) > 0) {
String[] result = hierarchy.split(","); String[] result = hierarchy.split(",");
Map<Integer, Integer> map = new HashMap<>(); Map<Integer, Integer> map = new HashMap<>();
for (int i = 0; i < result.length; i++) { for (int i = 0; i < result.length; i++) {
map.put(i, Integer.valueOf(result[i])); map.put(i, Integer.valueOf(result[i]));
} }
Map<String, String> equipmentCategory = inputItemMapper.getCategoryByCode(treeId, "2"); Map<String, String> equipmentCategory = inputItemMapper.getCategoryByCode(treeId.replace("@",""), "2");
if (equipmentCategory == null) { if (equipmentCategory == null) {
throw new RuntimeException("装备定义code有误"); throw new RuntimeException("装备定义code有误");
} }
...@@ -129,7 +129,7 @@ public class InputItemController extends AbstractBaseController { ...@@ -129,7 +129,7 @@ public class InputItemController extends AbstractBaseController {
equipmentCategory = inputItemMapper.getCategoryById(equipmentCategory.get("parentId")); equipmentCategory = inputItemMapper.getCategoryById(equipmentCategory.get("parentId"));
} }
} }
subCode = treeId.substring(0, inhierarchy); subCode = treeId.replace("@","").substring(0, inhierarchy);
} }
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
//查询向上查询所属单位的bizOrgCode //查询向上查询所属单位的bizOrgCode
......
...@@ -273,20 +273,27 @@ ...@@ -273,20 +273,27 @@
<if test="bizOrgCode!=null and bizOrgCode!=''"> <if test="bizOrgCode!=null and bizOrgCode!=''">
and a.biz_org_code LIKE CONCAT (#{bizOrgCode} ,'%') and a.biz_org_code LIKE CONCAT (#{bizOrgCode} ,'%')
</if> </if>
<if test="treeId != null and treeId != '' and treeId == -1"> <if test="treeId != null and treeId != '' and treeId == '-1'">
and a.facilities_type is not null and a.facilities_type is not null
</if> </if>
<if test="treeId != null and treeId != '' and treeId == -2"> <if test="treeId != null and treeId != '' and treeId == '-2'">
and a.equipment_type is not null and a.equipment_type is not null
</if> </if>
<if test="treeId != null and treeId != '' and treeId == -4"> <if test="treeId != null and treeId != '' and treeId == '-4'">
and a.key_parts_type is not null and a.key_parts_type is not null
</if> </if>
<if test="treeId != null and treeId != '' and treeId == -5"> <if test="treeId != null and treeId != '' and treeId == '-5'">
and a.custom_type is not null and a.custom_type is not null
</if> </if>
<if test="subCode!=null and subCode!='' and subCode!=' ' and treeId != null and treeId != '' and treeId != -3 and treeId != -1 and treeId != -2 and treeId != -4 and treeId != -5"> <if test="subCode!=null and subCode!='' and subCode!=' ' and
and ((LEFT (a.facilities_type, #{inhierarchy}) = #{subCode}) or (LEFT (a.equipment_type, #{inhierarchy}) = #{subCode})) treeId != null and treeId != '' and treeId != '-3' and treeId != '-1' and
treeId != '-2' and treeId != '-4' and treeId != '-5' and treeId.contains('@'.toString())">
and LEFT (a.facilities_type, #{inhierarchy}) = #{subCode}
</if>
<if test="subCode!=null and subCode!='' and subCode!=' ' and
treeId != null and treeId != '' and treeId != '-3' and treeId != '-1' and
treeId != '-2' and treeId != '-4' and treeId != '-5' and !treeId.contains('@'.toString())">
and LEFT (a.equipment_type, #{inhierarchy}) = #{subCode}
</if> </if>
<choose> <choose>
<when test="level == '-0' ">and a.level is null</when> <when test="level == '-0' ">and a.level is null</when>
...@@ -346,20 +353,27 @@ ...@@ -346,20 +353,27 @@
<if test="bizOrgCode!=null and bizOrgCode!=''"> <if test="bizOrgCode!=null and bizOrgCode!=''">
and a.biz_org_code LIKE CONCAT (#{bizOrgCode},'%') and a.biz_org_code LIKE CONCAT (#{bizOrgCode},'%')
</if> </if>
<if test="treeId != null and treeId != '' and treeId == -1"> <if test="treeId != null and treeId != '' and treeId == '-1'">
and a.facilities_type is not null and a.facilities_type is not null
</if> </if>
<if test="treeId != null and treeId != '' and treeId == -2"> <if test="treeId != null and treeId != '' and treeId == '-2'">
and a.equipment_type is not null and a.equipment_type is not null
</if> </if>
<if test="treeId != null and treeId != '' and treeId == -4"> <if test="treeId != null and treeId != '' and treeId == '-4'">
and a.key_parts_type is not null and a.key_parts_type is not null
</if> </if>
<if test="treeId != null and treeId != '' and treeId == -5"> <if test="treeId != null and treeId != '' and treeId == '-5'">
and a.custom_type is not null and a.custom_type is not null
</if> </if>
<if test="subCode!=null and subCode!='' and subCode!=' ' and treeId != null and treeId != '' and treeId != -3 and treeId != -1 and treeId != -2 and treeId != -4 and treeId != -5"> <if test="subCode!=null and subCode!='' and subCode!=' ' and
and ((LEFT (a.facilities_type, #{inhierarchy}) = #{subCode}) or (LEFT (a.equipment_type, #{inhierarchy}) = #{subCode})) treeId != null and treeId != '' and treeId != '-3' and treeId != '-1' and
treeId != '-2' and treeId != '-4' and treeId != '-5' and treeId.contains('@'.toString())">
and LEFT (a.facilities_type, #{inhierarchy}) = #{subCode}
</if>
<if test="subCode!=null and subCode!='' and subCode!=' ' and
treeId != null and treeId != '' and treeId != '-3' and treeId != '-1' and
treeId != '-2' and treeId != '-4' and treeId != '-5' and !treeId.contains('@'.toString())">
and LEFT (a.equipment_type, #{inhierarchy}) = #{subCode}
</if> </if>
<choose> <choose>
<when test="level == '-0' ">and a.level is null</when> <when test="level == '-0' ">and a.level is null</when>
......
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