Commit 5297af3f authored by tangwei's avatar tangwei

解决冲突

parents 3ec231ac 099cf363
...@@ -67,6 +67,10 @@ public class EquipmentCategory extends BaseEntity implements TreeNode<EquipmentC ...@@ -67,6 +67,10 @@ public class EquipmentCategory extends BaseEntity implements TreeNode<EquipmentC
@ApiModelProperty(value = "个数") @ApiModelProperty(value = "个数")
private Double count; private Double count;
@TableField(exist=false)
@ApiModelProperty(value = "个数")
private String countName;
@ApiModelProperty(value = "类型(car:车辆 equipment:装备)") @ApiModelProperty(value = "类型(car:车辆 equipment:装备)")
@TableField(exist=false) @TableField(exist=false)
private String type; private String type;
......
...@@ -286,6 +286,35 @@ public class EquipmentCategoryController extends AbstractBaseController { ...@@ -286,6 +286,35 @@ public class EquipmentCategoryController extends AbstractBaseController {
return list; return list;
} }
@RequestMapping(value = "/itemType-tree", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "检查项类型统计树", notes = "检查项类型统计树")
public List<EquipmentCategory> countItemTree() {
ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode();
List<EquipmentCategory> list = new ArrayList<>();
List<EquipmentCategory> equipmentCategories = this.listEquip();
List<EquipmentCategory> fireCategories = this.listFire();
fireCategories.get(0).setId(-2L);
fireCategories.get(0).setCode("-2");
List<EquipmentCategory> treeListByCustom = getTreeListByCustom(bizOrgCode);
list.addAll(equipmentCategories);
list.addAll(fireCategories);
list.addAll(treeListByCustom);
EquipmentCategory equipmentCategory = new EquipmentCategory();
equipmentCategory.setChildren(list);
equipmentCategory.setCode("-3");
equipmentCategory.setName("全部类型");
equipmentCategory.setId(-3L);
int countAll = StringUtils.isNotEmpty(bizOrgCode) ? equipmentCategoryMapper.countAll(bizOrgCode) : 0;
equipmentCategory.setCountName("全部类型" + "(" + countAll + ")");
equipmentCategory.setHasLowerClassification(true);
List<EquipmentCategory> result = new ArrayList<>();
result.add(equipmentCategory);
return result;
}
/** /**
* 除消防设施全量数据树形结构返回 * 除消防设施全量数据树形结构返回
...@@ -296,8 +325,12 @@ public class EquipmentCategoryController extends AbstractBaseController { ...@@ -296,8 +325,12 @@ public class EquipmentCategoryController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "除消防设施全量数据树形结构返回", notes = "除消防设施全量数据树形结构返回") @ApiOperation(httpMethod = "GET", value = "除消防设施全量数据树形结构返回", notes = "除消防设施全量数据树形结构返回")
public List<EquipmentCategory> listEquip() { public List<EquipmentCategory> listEquip() {
ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode();
List<EquipmentCategory> equipmentCategorys = this.iEquipmentCategoryService List<EquipmentCategory> equipmentCategorys = this.iEquipmentCategoryService
.getEquipmentCategoryListNotFacilities(Integer.valueOf(equipmentCategoryLeftTypeCode)); .getEquipmentCategoryListNotFacilities(Integer.valueOf(equipmentCategoryLeftTypeCode),bizOrgCode);
List<EquipmentCategory> list = new ArrayList<>(); List<EquipmentCategory> list = new ArrayList<>();
List<EquipmentCategory> result = new ArrayList<>(); List<EquipmentCategory> result = new ArrayList<>();
Map<String, List<EquipmentCategory>> tmpMap = new HashMap<String, List<EquipmentCategory>>(); Map<String, List<EquipmentCategory>> tmpMap = new HashMap<String, List<EquipmentCategory>>();
...@@ -316,11 +349,13 @@ public class EquipmentCategoryController extends AbstractBaseController { ...@@ -316,11 +349,13 @@ public class EquipmentCategoryController extends AbstractBaseController {
} }
} }
}); });
String equipItemCount = iEquipmentCategoryService.getEquipItemCount(bizOrgCode);
getChildren(list, tmpMap); getChildren(list, tmpMap);
EquipmentCategory equipmentCategory = new EquipmentCategory(); EquipmentCategory equipmentCategory = new EquipmentCategory();
equipmentCategory.setChildren(list); equipmentCategory.setChildren(list);
equipmentCategory.setCode("-1"); equipmentCategory.setCode("-1");
equipmentCategory.setName("消防设备"); equipmentCategory.setName("消防设备");
equipmentCategory.setCountName("消防设备"+equipItemCount);
equipmentCategory.setId(0L); equipmentCategory.setId(0L);
equipmentCategory.setHasLowerClassification(true); equipmentCategory.setHasLowerClassification(true);
...@@ -336,9 +371,14 @@ public class EquipmentCategoryController extends AbstractBaseController { ...@@ -336,9 +371,14 @@ public class EquipmentCategoryController extends AbstractBaseController {
@RequestMapping(value = "/list-tree-fire", method = RequestMethod.GET) @RequestMapping(value = "/list-tree-fire", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "消防设施分类定义树", notes = "消防设施分类定义树") @ApiOperation(httpMethod = "GET", value = "消防设施分类定义树", notes = "消防设施分类定义树")
public List<EquipmentCategory> listFire() { public ResponseModel<List<EquipmentCategory>> listFire() {
ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode();
if (redisUtils.hasKey(EQUIP_AND_FIRE_TREE + bizOrgCode)) {
return CommonResponseUtil.success(redisUtils.get(EQUIP_AND_FIRE_TREE + bizOrgCode));
}
List<EquipmentCategory> equipmentCategorys = this.iEquipmentCategoryService List<EquipmentCategory> equipmentCategorys = this.iEquipmentCategoryService
.getEquipmentCategoryListByFacilities(Integer.valueOf(equipmentCategoryLeftTypeCode)); .getEquipmentCategoryListByFacilities(Integer.valueOf(equipmentCategoryLeftTypeCode),bizOrgCode);
List<EquipmentCategory> list = new ArrayList<>(); List<EquipmentCategory> list = new ArrayList<>();
List<EquipmentCategory> result = new ArrayList<>(); List<EquipmentCategory> result = new ArrayList<>();
Map<String, List<EquipmentCategory>> tmpMap = new HashMap<String, List<EquipmentCategory>>(); Map<String, List<EquipmentCategory>> tmpMap = new HashMap<String, List<EquipmentCategory>>();
...@@ -358,16 +398,18 @@ public class EquipmentCategoryController extends AbstractBaseController { ...@@ -358,16 +398,18 @@ public class EquipmentCategoryController extends AbstractBaseController {
} }
}); });
getChildren(list, tmpMap); getChildren(list, tmpMap);
String fireItemCount = iEquipmentCategoryService.getFireItemCount(bizOrgCode);
EquipmentCategory equipmentCategory = new EquipmentCategory(); EquipmentCategory equipmentCategory = new EquipmentCategory();
equipmentCategory.setChildren(list); equipmentCategory.setChildren(list);
equipmentCategory.setCode("-1"); equipmentCategory.setCode("-1");
equipmentCategory.setName("消防设施"); equipmentCategory.setName("消防设施");
equipmentCategory.setCountName("消防设施"+fireItemCount);
equipmentCategory.setId(0L); equipmentCategory.setId(0L);
equipmentCategory.setHasLowerClassification(true); equipmentCategory.setHasLowerClassification(true);
result.add(equipmentCategory); result.add(equipmentCategory);
return result; redisUtils.set(EQUIP_AND_FIRE_TREE + bizOrgCode, result, 172800);
return CommonResponseUtil.success(result);
} }
...@@ -388,9 +430,9 @@ public class EquipmentCategoryController extends AbstractBaseController { ...@@ -388,9 +430,9 @@ public class EquipmentCategoryController extends AbstractBaseController {
} }
List<EquipmentCategory> result = new ArrayList<>(); List<EquipmentCategory> result = new ArrayList<>();
List<EquipmentCategory> listFireCategories = listFirePrivate(bizOrgCode); List<EquipmentCategory> listFireCategories = listFirePrivate(bizOrgCode);
List<EquipmentCategory> listEquipCategories = listEquipPrivate(bizOrgCode); //List<EquipmentCategory> listEquipCategories = listEquipPrivate(bizOrgCode);
List<EquipmentCategory> treeListByCustom = getTreeListByCustom(bizOrgCode); List<EquipmentCategory> treeListByCustom = getTreeListByCustom(bizOrgCode);
listFireCategories.addAll(listEquipCategories); //listFireCategories.addAll(listEquipCategories);
listFireCategories.addAll(treeListByCustom); listFireCategories.addAll(treeListByCustom);
EquipmentCategory equipmentCategory = new EquipmentCategory(); EquipmentCategory equipmentCategory = new EquipmentCategory();
equipmentCategory.setChildren(listFireCategories); equipmentCategory.setChildren(listFireCategories);
...@@ -416,6 +458,7 @@ public class EquipmentCategoryController extends AbstractBaseController { ...@@ -416,6 +458,7 @@ public class EquipmentCategoryController extends AbstractBaseController {
int keyPartsTypeCount = StringUtils.isNotEmpty(bizOrgCode) ? equipmentCategoryMapper.countByKeyPartsType(bizOrgCode) : 0; int keyPartsTypeCount = StringUtils.isNotEmpty(bizOrgCode) ? equipmentCategoryMapper.countByKeyPartsType(bizOrgCode) : 0;
equipmentCategory.setCode("-4"); equipmentCategory.setCode("-4");
equipmentCategory.setName("重点部位" + "(" + keyPartsTypeCount + ")"); equipmentCategory.setName("重点部位" + "(" + keyPartsTypeCount + ")");
equipmentCategory.setCountName("重点部位" + "(" + keyPartsTypeCount + ")");
equipmentCategory.setPatrolNum(keyPartsTypeCount); equipmentCategory.setPatrolNum(keyPartsTypeCount);
equipmentCategory.setId(-4L); equipmentCategory.setId(-4L);
equipmentCategory.setParentId(-3L); equipmentCategory.setParentId(-3L);
...@@ -425,6 +468,7 @@ public class EquipmentCategoryController extends AbstractBaseController { ...@@ -425,6 +468,7 @@ public class EquipmentCategoryController extends AbstractBaseController {
int customTypeCount = StringUtils.isNotEmpty(bizOrgCode) ? equipmentCategoryMapper.countByCustomType(bizOrgCode) : 0; int customTypeCount = StringUtils.isNotEmpty(bizOrgCode) ? equipmentCategoryMapper.countByCustomType(bizOrgCode) : 0;
equipmentCategory2.setCode("-5"); equipmentCategory2.setCode("-5");
equipmentCategory2.setName("自定义巡查点" + "(" + customTypeCount + ")"); equipmentCategory2.setName("自定义巡查点" + "(" + customTypeCount + ")");
equipmentCategory2.setCountName("自定义巡查点" + "(" + customTypeCount + ")");
equipmentCategory2.setPatrolNum(customTypeCount); equipmentCategory2.setPatrolNum(customTypeCount);
equipmentCategory2.setId(-5L); equipmentCategory2.setId(-5L);
equipmentCategory2.setParentId(-3L); equipmentCategory2.setParentId(-3L);
...@@ -435,7 +479,7 @@ public class EquipmentCategoryController extends AbstractBaseController { ...@@ -435,7 +479,7 @@ public class EquipmentCategoryController extends AbstractBaseController {
private List<EquipmentCategory> listFirePrivate(String bizOrgCode) { private List<EquipmentCategory> listFirePrivate(String bizOrgCode) {
List<EquipmentCategory> equipmentCategorys = this.iEquipmentCategoryService List<EquipmentCategory> equipmentCategorys = this.iEquipmentCategoryService
.getEquipmentCategoryListByFacilities(Integer.valueOf(equipmentCategoryLeftTypeCode)); .getEquipmentCategoryListByFacilities(Integer.valueOf(equipmentCategoryLeftTypeCode),bizOrgCode);
List<EquipmentCategory> list = new ArrayList<>(); List<EquipmentCategory> list = new ArrayList<>();
List<EquipmentCategory> result = new ArrayList<>(); List<EquipmentCategory> result = new ArrayList<>();
Map<String, List<EquipmentCategory>> tmpMap = new HashMap<String, List<EquipmentCategory>>(); Map<String, List<EquipmentCategory>> tmpMap = new HashMap<String, List<EquipmentCategory>>();
...@@ -475,7 +519,7 @@ public class EquipmentCategoryController extends AbstractBaseController { ...@@ -475,7 +519,7 @@ public class EquipmentCategoryController extends AbstractBaseController {
} }
private List<EquipmentCategory> listEquipPrivate(String bizOrgCode) { /* private List<EquipmentCategory> listEquipPrivate(String bizOrgCode) {
List<EquipmentCategory> equipmentCategorys = this.iEquipmentCategoryService List<EquipmentCategory> equipmentCategorys = this.iEquipmentCategoryService
.getEquipmentCategoryListNotFacilities(Integer.valueOf(equipmentCategoryLeftTypeCode)); .getEquipmentCategoryListNotFacilities(Integer.valueOf(equipmentCategoryLeftTypeCode));
List<EquipmentCategory> list = new ArrayList<>(); List<EquipmentCategory> list = new ArrayList<>();
...@@ -510,7 +554,7 @@ public class EquipmentCategoryController extends AbstractBaseController { ...@@ -510,7 +554,7 @@ public class EquipmentCategoryController extends AbstractBaseController {
equipmentCategory.setParentId(-3L); equipmentCategory.setParentId(-3L);
result.add(equipmentCategory); result.add(equipmentCategory);
return result; return result;
} }*/
/** /**
* *
......
...@@ -53,9 +53,14 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> { ...@@ -53,9 +53,14 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
int checkUsed( String id ); int checkUsed( String id );
List<EquipmentCategory> getEquipmentCategoryList(Integer head); List<EquipmentCategory> getEquipmentCategoryList(Integer head);
List<EquipmentCategory> getEquipmentCategoryListNotFacilities(Integer head); List<EquipmentCategory> getEquipmentCategoryListNotFacilities(Integer head,String bizOrgCode);
List<EquipmentCategory> getEquipmentCategoryListByFacilities(Integer head); String getEquipItemCount(String bizOrgCode) ;
String getFireItemCount(String bizOrgCode) ;
List<EquipmentCategory> getEquipmentCategoryListByFacilities(Integer head,String bizOrgCode);
int countByFireTypeAndCode(@Param("code") String code, @Param("bizOrgCode") String bizOrgCode); int countByFireTypeAndCode(@Param("code") String code, @Param("bizOrgCode") String bizOrgCode);
......
...@@ -47,9 +47,14 @@ public interface IEquipmentCategoryService extends IService<EquipmentCategory> { ...@@ -47,9 +47,14 @@ public interface IEquipmentCategoryService extends IService<EquipmentCategory> {
List<EquipmentCategory> getEquipmentCategoryList(Integer head); List<EquipmentCategory> getEquipmentCategoryList(Integer head);
List<EquipmentCategory> getEquipmentCategoryListNotFacilities(Integer head) ; List<EquipmentCategory> getEquipmentCategoryListNotFacilities(Integer head,String bizOrgCode) ;
List<EquipmentCategory> getEquipmentCategoryListByFacilities(Integer head) ;
String getEquipItemCount(String bizOrgCode) ;
String getFireItemCount(String bizOrgCode) ;
List<EquipmentCategory> getEquipmentCategoryListByFacilities(Integer head,String bizOrgCode) ;
/** /**
* 根据分类定义id获取对应所有子分类id * 根据分类定义id获取对应所有子分类id
......
...@@ -386,13 +386,24 @@ public class EquipmentCategoryServiceImpl extends ServiceImpl<EquipmentCategoryM ...@@ -386,13 +386,24 @@ public class EquipmentCategoryServiceImpl extends ServiceImpl<EquipmentCategoryM
return this.baseMapper.getEquipmentCategoryList(head); return this.baseMapper.getEquipmentCategoryList(head);
} }
public List<EquipmentCategory> getEquipmentCategoryListNotFacilities(Integer head) { public List<EquipmentCategory> getEquipmentCategoryListNotFacilities(Integer head,String bizOrgCode) {
return this.baseMapper.getEquipmentCategoryListNotFacilities(head); return this.baseMapper.getEquipmentCategoryListNotFacilities(head,bizOrgCode);
} }
public List<EquipmentCategory> getEquipmentCategoryListByFacilities(Integer head) { public String getFireItemCount(String bizOrgCode) {
return this.baseMapper.getEquipmentCategoryListByFacilities(head); return this.baseMapper.getFireItemCount(bizOrgCode);
}
public String getEquipItemCount(String bizOrgCode) {
return this.baseMapper.getEquipItemCount(bizOrgCode);
}
public List<EquipmentCategory> getEquipmentCategoryListByFacilities(Integer head,String bizOrgCode) {
return this.baseMapper.getEquipmentCategoryListByFacilities(head,bizOrgCode);
} }
......
...@@ -309,6 +309,23 @@ ...@@ -309,6 +309,23 @@
ec.parent_id, ec.parent_id,
ec.CODE, ec.CODE,
ec.NAME, ec.NAME,
CONCAT(
ec.NAME,
CONCAT(
'(',
(
SELECT
count( 1 )
FROM
p_input_item pit
WHERE
pit.equipment_type = ec.CODE
AND pit.is_delete = 0
AND pit.biz_org_code LIKE concat( '%', #{bizOrgCode}, '%' )
),
')'
)
) AS countNAME,
ec.is_consumptive, ec.is_consumptive,
ec.description, ec.description,
ec.industry_code, ec.industry_code,
...@@ -329,6 +346,23 @@ ...@@ -329,6 +346,23 @@
ec.parent_id, ec.parent_id,
ec.CODE, ec.CODE,
ec.NAME, ec.NAME,
CONCAT(
ec.NAME,
CONCAT(
'(',
(
SELECT
count( 1 )
FROM
p_input_item pit
WHERE
pit.equipment_type = ec.CODE
AND pit.is_delete = 0
AND pit.biz_org_code LIKE concat( '%', #{bizOrgCode}, '%' )
),
')'
)
) AS countNAME,
ec.is_consumptive, ec.is_consumptive,
ec.description, ec.description,
ec.industry_code, ec.industry_code,
...@@ -346,6 +380,23 @@ ...@@ -346,6 +380,23 @@
ec.parent_id, ec.parent_id,
ec.code as CODE, ec.code as CODE,
ec.NAME, ec.NAME,
CONCAT(
ec.NAME,
CONCAT(
'(',
(
SELECT
count( 1 )
FROM
p_input_item pit
WHERE
pit.equipment_type = ec.CODE
AND pit.is_delete = 0
AND pit.biz_org_code LIKE concat( '%', 'LSHLZ1yOrS3WfXqzjn', '%' )
),
')'
)
) AS countNAME,
ec.is_consumptive, ec.is_consumptive,
ec.description, ec.description,
ec.industry_code, ec.industry_code,
...@@ -357,7 +408,7 @@ ...@@ -357,7 +408,7 @@
FROM wl_equipment_category ec FROM wl_equipment_category ec
left join wl_industry i on ec.industry_code = i.code left join wl_industry i on ec.industry_code = i.code
WHERE WHERE
<!-- (ec.code LIKE CONCAT ('92','%') and ec.parent_id = '1302863809086623746') or (ec.code LIKE CONCAT ('92','%') and ec.parent_id = '846')--> <!-- (ec.code LIKE CONCAT ('92','%') and ec.parent_id = '1302863809086623746') or (ec.code LIKE CONCAT ('92','%') and ec.parent_id = '846')-->
ec.code like CONCAT ('92', '%') ec.code like CONCAT ('92', '%')
</select> </select>
...@@ -555,4 +606,24 @@ ...@@ -555,4 +606,24 @@
AND is_delete = '0' AND is_delete = '0'
AND input_type!='1' AND input_type!='1'
</select> </select>
<select id="getEquipItemCount" resultType="java.lang.String">
SELECT
CONCAT('(' , COUNT(1) ,')') as countName
FROM
p_input_item pit
WHERE
pit.equipment_type is not null
AND is_delete = 0
AND pit.biz_org_code LIKE concat( '%', #{bizOrgCode}, '%' )
</select>
<select id="getFireItemCount" resultType="java.lang.String">
SELECT
CONCAT('(' , COUNT(1) ,')') as countName
FROM
p_input_item pit
WHERE
pit.facilities_type is not null
AND is_delete = 0
AND pit.biz_org_code LIKE concat( '%', #{bizOrgCode}, '%' )
</select>
</mapper> </mapper>
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