Commit 9f410732 authored by tangwei's avatar tangwei

修改bug

parent 76735089
...@@ -351,9 +351,9 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -351,9 +351,9 @@ public class FireFightingSystemController extends AbstractBaseController {
} }
} }
return fireFightingSystemService.getColaCategoryAmountList(inhierarchy, equipTypeAmountPage.getEquipmentClassificationCode().substring(0, inhierarchy), equipTypeAmountPage); return fireFightingSystemService.getColaCategoryAmountListIot(inhierarchy, equipTypeAmountPage.getEquipmentClassificationCode().substring(0, inhierarchy), equipTypeAmountPage);
} else { } else {
return fireFightingSystemService.getColaCategoryAmountList(0, null, equipTypeAmountPage); return fireFightingSystemService.getColaCategoryAmountListIot(0, null, equipTypeAmountPage);
} }
} }
......
...@@ -110,7 +110,10 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -110,7 +110,10 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
@Param("hierarchy")int hierarchy, @Param("hierarchy")int hierarchy,
@Param("codeHead")String codeHead, @Param("codeHead")String codeHead,
@Param("equipTypeAmountPage")EquipTypeAmountPageDTO equipTypeAmountPage); @Param("equipTypeAmountPage")EquipTypeAmountPageDTO equipTypeAmountPage);
IPage<EquipTypeImgAmountVO> getColaCategoryAmountListIot(@Param("page")IPage page,
@Param("hierarchy")int hierarchy,
@Param("codeHead")String codeHead,
@Param("equipTypeAmountPage")EquipTypeAmountPageDTO equipTypeAmountPage);
IPage<EquipTypeImgAmountVO> getColaCategoryAmountCarList(@Param("page")IPage page, IPage<EquipTypeImgAmountVO> getColaCategoryAmountCarList(@Param("page")IPage page,
@Param("hierarchy")int hierarchy, @Param("hierarchy")int hierarchy,
@Param("codeHead")String codeHead, @Param("codeHead")String codeHead,
......
...@@ -130,7 +130,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -130,7 +130,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
IPage<EquipTypeImgAmountVO> getColaCategoryAmountList(int hierarchy, String codeHead, EquipTypeAmountPageDTO equipTypeAmountPage); IPage<EquipTypeImgAmountVO> getColaCategoryAmountList(int hierarchy, String codeHead, EquipTypeAmountPageDTO equipTypeAmountPage);
IPage<EquipTypeImgAmountVO> getColaCategoryAmountListIot(int hierarchy, String codeHead, EquipTypeAmountPageDTO equipTypeAmountPage);
IPage<EquipTypeImgAmountVO> getColaCategoryAmountCarList(int hierarchy, String codeHead, EquipTypeAmountPageDTO equipTypeAmountPage); IPage<EquipTypeImgAmountVO> getColaCategoryAmountCarList(int hierarchy, String codeHead, EquipTypeAmountPageDTO equipTypeAmountPage);
IPage<EquipTypeImgAmountVO> getColaCategoryAmountEquList(int hierarchy, String codeHead, EquipTypeAmountPageDTO equipTypeAmountPage); IPage<EquipTypeImgAmountVO> getColaCategoryAmountEquList(int hierarchy, String codeHead, EquipTypeAmountPageDTO equipTypeAmountPage);
......
...@@ -699,7 +699,23 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -699,7 +699,23 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}); });
return list; return list;
} }
@Override
public IPage<EquipTypeImgAmountVO> getColaCategoryAmountListIot(int hierarchy, String codeHead,
EquipTypeAmountPageDTO equipTypeAmountPage) {
String type = equipTypeAmountPage.getType();
if (!"".equals(type) && "car".equals(type)) {
equipTypeAmountPage.setSystemId(null);
equipTypeAmountPage.setStatus(null);
}
IPage<EquipTypeImgAmountVO> list = fireFightingSystemMapper
.getColaCategoryAmountListIot(equipTypeAmountPage.getPage(), hierarchy, codeHead, equipTypeAmountPage);
list.getRecords().forEach(x -> {
if (!x.getEqtype().startsWith("4") && StringUtil.isNotEmpty(x.getAmount())) {
x.setAmount(x.getAmount().split("\\.")[0]);
}
});
return list;
}
@Override @Override
public IPage<EquipTypeImgAmountVO> getColaCategoryAmountCarList(int hierarchy, String codeHead, public IPage<EquipTypeImgAmountVO> getColaCategoryAmountCarList(int hierarchy, String codeHead,
EquipTypeAmountPageDTO equipTypeAmountPage) { EquipTypeAmountPageDTO equipTypeAmountPage) {
...@@ -1010,11 +1026,21 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1010,11 +1026,21 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} }
public Object iotrefreshEquipmentTypeAndCount(String bizOrgCode) { public Object iotrefreshEquipmentTypeAndCount(String bizOrgCode) {
// List<EquipmentCategory> responseList = this.typeList();
// if (responseList == null || responseList.size() < 1) {
// return null;
// }
// List<EquipmentCategory> list = typeListTree(responseList, bizOrgCode, SourceTypeEnum.IOT);
List<EquipmentCategory> responseList = this.typeList(); List<EquipmentCategory> responseList = this.typeList();
if (responseList == null || responseList.size() < 1) { if (responseList == null || responseList.size() < 1) {
return null; return null;
} }
List<EquipmentCategory> list = typeListTree(responseList, bizOrgCode, SourceTypeEnum.IOT); List<EquipmentCategory> equipmentTypeList = responseList.stream()
.filter(i -> !i.getCode().startsWith("2") && "2".equals(i.getIndustryCode()))
.collect(Collectors.toList());
List<EquipmentCategory> list = typeListTree(equipmentTypeList, bizOrgCode, SourceTypeEnum.EQUIPMENT);
redisUtils.set("iotTypeAndCount" + bizOrgCode, list, 86400); redisUtils.set("iotTypeAndCount" + bizOrgCode, list, 86400);
return list; return list;
} }
......
...@@ -624,22 +624,22 @@ ...@@ -624,22 +624,22 @@
<select id="queryCompanyIotStaData" resultType="java.util.Map"> <select id="queryCompanyIotStaData" resultType="java.util.Map">
SELECT -- SELECT
s.biz_org_code as bizOrgCode, -- s.biz_org_code as bizOrgCode,
c.code as categoryCode, -- c.code as categoryCode,
count(1) as total -- count(1) as total
FROM -- FROM
`wl_car` s, -- `wl_car` s,
wl_equipment e, -- wl_equipment e,
wl_equipment_category c -- wl_equipment_category c
where -- where
e.is_iot=1 -- e.is_iot=1
and s.equipment_id = e.`id` -- and s.equipment_id = e.`id`
and e.category_id = c.id -- and e.category_id = c.id
and s.biz_org_code is not null -- and s.biz_org_code is not null
GROUP BY s.biz_org_code ,c.code -- GROUP BY s.biz_org_code ,c.code
--
UNION -- UNION
SELECT SELECT
s.biz_org_code as bizOrgCode, s.biz_org_code as bizOrgCode,
......
...@@ -1867,4 +1867,114 @@ FROM ...@@ -1867,4 +1867,114 @@ FROM
</select> </select>
<select id="getColaCategoryAmountListIot" resultMap="CategoryAmountList">
<if test="equipTypeAmountPage.type == 'equipment' or codeHead==null or codeHead=='' or codeHead==' '">
select * from (
SELECT
wles.id,
wles.qr_code,
CONCAT('01#',wles.qr_code) fullqrCode,
wled.standard,
wle.img,
wled.NAME equipmentName,
concat_ws('-',wlws.full_name,wled.area) as full_name,
wlun.NAME unitName,
(SELECT GROUP_CONCAT(fem.name) FROM `f_fire_fighting_system` fem WHERE find_in_set(fem.id,wles.system_id))
as systemName,
wlsd.amount,
wlsd.id as stockDetailId,
'equipment' as type,
wlai.`name` manufacturerName,
wles.code,
wles.iot_code as iotCode,
case wlsd.`status`
when '1' then '在位'
when '2' then '执勤'
when '3' then '维修'
when '6' then '退役'
when '7' then '报废'
when '10' then '车载'
when '11' then '损耗'
when '12' then '配装'
else '未入库' END as status,
wles.create_date as createDate,
wled.code as eqtype,
wles.biz_org_code as bizOrgCode,
wles.biz_org_name as bizOrgName
FROM
(select id,qr_code,code ,iot_code ,biz_org_code ,team_id,biz_org_name,create_date ,equipment_detail_id ,system_id from wl_equipment_specific) wles
LEFT JOIN (select id,amount,status,equipment_specific_id,warehouse_structure_id from wl_stock_detail ) wlsd on wlsd.equipment_specific_id = wles.id
LEFT JOIN wl_warehouse_structure wlws on wlsd.warehouse_structure_id = wlws.id
LEFT JOIN (select id,standard ,name ,area ,code, equipment_id ,manufacturer_id,is_import from wl_equipment_detail) wled on wles.equipment_detail_id = wled.id
LEFT JOIN wl_equipment wle ON wle.id = wled.equipment_id
LEFT JOIN wl_unit wlun ON wle.unit_id = wlun.id
LEFT JOIN wl_manufacturer_info wlai on wled.manufacturer_id=wlai.id
LEFT JOIN wl_equipment_category wec ON wle.category_id = wec.id
WHERE 1=1
<if test="codeHead!=null and codeHead!='' and codeHead!=' '">
and LEFT (wle.CODE, #{hierarchy}) = #{codeHead}
</if>
<if test="equipTypeAmountPage.isIot!=null">
and wle.is_iot=1
</if>
<if test="equipTypeAmountPage.industryCode!=null">
and wec.industry_code = #{equipTypeAmountPage.industryCode}
</if>
<if test="equipTypeAmountPage.teamId!=null">
and wles.team_id = #{equipTypeAmountPage.teamId}
</if>
<if test="equipTypeAmountPage.systemId!=null">
and wles.system_id = #{equipTypeAmountPage.systemId}
</if>
<if test="equipTypeAmountPage.manufacturerId!=null">
and wled.manufacturer_id = #{equipTypeAmountPage.manufacturerId}
</if>
<if test="equipTypeAmountPage.isImport!=null">
and wled.is_import = #{equipTypeAmountPage.isImport}
</if>
<if test="equipTypeAmountPage.warehouseStructureId!=null">
and wlsd.warehouse_structure_id in (
select id from wl_warehouse_structure where parent_id in(
select id from wl_warehouse_structure where parent_id = #{equipTypeAmountPage.warehouseStructureId})
union
select id from wl_warehouse_structure where parent_id = #{equipTypeAmountPage.warehouseStructureId} or
id = #{equipTypeAmountPage.warehouseStructureId}
)
</if>
<if test="equipTypeAmountPage.status == 1">
and wlsd.warehouse_structure_id is null
</if>
<if test="equipTypeAmountPage.status == 0">
and wlsd.warehouse_structure_id is not null
</if>
<if test="equipTypeAmountPage.equipmentName!=null and equipTypeAmountPage.equipmentName!=''">
AND wled.name LIKE CONCAT('%',#{equipTypeAmountPage.equipmentName},'%')
</if>
<if test="equipTypeAmountPage.code!=null and equipTypeAmountPage.code!=''">
AND wles.code LIKE CONCAT('%',#{equipTypeAmountPage.code},'%')
</if>
<if test="equipTypeAmountPage.iotCode!=null and equipTypeAmountPage.iotCode!=''">
AND wles.iot_code LIKE CONCAT('%',#{equipTypeAmountPage.iotCode},'%')
</if>
)s1
<if test="equipTypeAmountPage.warehouseStructureName!=null and equipTypeAmountPage.warehouseStructureName!=''">
where s1.full_name LIKE CONCAT('%',#{equipTypeAmountPage.warehouseStructureName},'%')
</if>
<if test="equipTypeAmountPage.bizOrgCode!=null and equipTypeAmountPage.bizOrgCode!=''">
where s1.bizOrgCode LIKE CONCAT(#{equipTypeAmountPage.bizOrgCode},'%')
</if>
</if>
order by createDate DESC
</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