Commit 3075cccb authored by 张森's avatar 张森

Merge remote-tracking branch 'origin/develop_dl' into develop_dl_bugfix

parents a8cdcfa2 16b57e64
...@@ -28,6 +28,8 @@ public class EquipTypeImgAmountVO { ...@@ -28,6 +28,8 @@ public class EquipTypeImgAmountVO {
private String iotCode; private String iotCode;
@ApiModelProperty(value = "单位数量名称") @ApiModelProperty(value = "单位数量名称")
private String unitName; private String unitName;
@ApiModelProperty(value = "单位Id")
private String unitId;
@ApiModelProperty(value = "规格型号") @ApiModelProperty(value = "规格型号")
private String standard; private String standard;
@ApiModelProperty(value = "图片") @ApiModelProperty(value = "图片")
...@@ -38,6 +40,8 @@ public class EquipTypeImgAmountVO { ...@@ -38,6 +40,8 @@ public class EquipTypeImgAmountVO {
private String systemName; private String systemName;
@ApiModelProperty(value = "供应商名") @ApiModelProperty(value = "供应商名")
private String manufacturerName; private String manufacturerName;
@ApiModelProperty(value = "供应商Id")
private String manufacturerId;
@ApiModelProperty(value = "状态:在位。。。") @ApiModelProperty(value = "状态:在位。。。")
private String status; private String status;
@ApiModelProperty(value = "装备类型") @ApiModelProperty(value = "装备类型")
......
...@@ -187,6 +187,13 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -187,6 +187,13 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Lazy @Lazy
IWlCarMileageService iWlCarMileageService; IWlCarMileageService iWlCarMileageService;
@Autowired
private UnitMapper unitMapper;
@Autowired
private ManufacturerInfoMapper manufacturerInfoMapper;
@Override @Override
public List<EquipCountBySystemVO> getEquipCountBySystemId(Long systemId) { public List<EquipCountBySystemVO> getEquipCountBySystemId(Long systemId) {
return this.baseMapper.getEquipCountBySystemId(systemId); return this.baseMapper.getEquipCountBySystemId(systemId);
...@@ -1020,6 +1027,10 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1020,6 +1027,10 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
IPage<EquipTypeImgAmountVO> list = fireFightingSystemMapper IPage<EquipTypeImgAmountVO> list = fireFightingSystemMapper
.getColaCategoryAmountEquList(equipTypeAmountPage.getPage(), hierarchy, codeHead, equipTypeAmountPage); .getColaCategoryAmountEquList(equipTypeAmountPage.getPage(), hierarchy, codeHead, equipTypeAmountPage);
ArrayList<String> systemIds = new ArrayList<>(); ArrayList<String> systemIds = new ArrayList<>();
ArrayList<String> unitList = new ArrayList<>();
ArrayList<String> manufacturerIds = new ArrayList<>();
list.getRecords().forEach(x -> { list.getRecords().forEach(x -> {
if (!x.getEqtype().startsWith("4") && StringUtil.isNotEmpty(x.getAmount())) { if (!x.getEqtype().startsWith("4") && StringUtil.isNotEmpty(x.getAmount())) {
x.setAmount(x.getAmount().split("\\.")[0]); x.setAmount(x.getAmount().split("\\.")[0]);
...@@ -1028,22 +1039,57 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1028,22 +1039,57 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
List<String> systemId = Arrays.asList(x.getSystemId().split(",")); List<String> systemId = Arrays.asList(x.getSystemId().split(","));
systemIds.addAll(systemId); systemIds.addAll(systemId);
} }
if (StringUtil.isNotEmpty(x.getUnitId())) {
unitList.add(x.getUnitId());
}
if (StringUtil.isNotEmpty(x.getManufacturerId())) {
manufacturerIds.add(x.getManufacturerId());
}
}); });
// 系统名称处理
Map<String, String> systemNameMap = new HashMap<>();
if (CollUtil.isNotEmpty(systemIds)) { if (CollUtil.isNotEmpty(systemIds)) {
LambdaQueryWrapper<FireFightingSystemEntity> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<FireFightingSystemEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.in(FireFightingSystemEntity::getId, systemIds); wrapper.in(FireFightingSystemEntity::getId, systemIds);
List<FireFightingSystemEntity> fireSystemList = fireFightingSystemMapper.selectList(wrapper); List<FireFightingSystemEntity> fireSystemList = fireFightingSystemMapper.selectList(wrapper);
Map<String, String> systemNameMap = fireSystemList.stream().collect(Collectors.toMap(t -> t.getId().toString(), FireFightingSystemEntity::getName)); systemNameMap = fireSystemList.stream().collect(Collectors.toMap(t -> t.getId().toString(), FireFightingSystemEntity::getName));
}
Map<String, String> finalSystemNameMap = systemNameMap;
Map<String, String> unitNameMap = new HashMap<>();
if (CollUtil.isNotEmpty(unitList)) {
LambdaQueryWrapper<Unit> wrapper = new LambdaQueryWrapper<>();
wrapper.in(Unit::getId, unitList);
List<Unit> units = unitMapper.selectList(wrapper);
unitNameMap = units.stream().collect(Collectors.toMap(t -> t.getId().toString(), Unit::getName));
}
Map<String, String> finalUnitNameMap = unitNameMap;
Map<String, String> manufacturerIdMap = new HashMap<>();
if (CollUtil.isNotEmpty(manufacturerIds)) {
LambdaQueryWrapper<ManufacturerInfo> wrapper = new LambdaQueryWrapper<>();
wrapper.in(ManufacturerInfo::getId, manufacturerIds);
List<ManufacturerInfo> manufacturerInfoList = manufacturerInfoMapper.selectList(wrapper);
manufacturerIdMap = manufacturerInfoList.stream().collect(Collectors.toMap(t -> t.getId().toString(), ManufacturerInfo::getName));
}
Map<String, String> finalManufacturerIdMap = manufacturerIdMap;
list.getRecords().parallelStream().forEach(item -> { list.getRecords().parallelStream().forEach(item -> {
if (StringUtil.isNotEmpty(item.getSystemId())) { if (StringUtil.isNotEmpty(item.getSystemId()) && !ObjectUtils.isEmpty(finalSystemNameMap)) {
ArrayList<String> systemNames = new ArrayList<>(); ArrayList<String> systemNames = new ArrayList<>();
List<String> systemIdList = Arrays.asList(item.getSystemId().split(",")); List<String> systemIdList = Arrays.asList(item.getSystemId().split(","));
systemIdList.parallelStream().forEach(id -> systemNames.add(systemNameMap.getOrDefault(id, ""))); systemIdList.parallelStream().forEach(id -> systemNames.add(finalSystemNameMap.getOrDefault(id, "")));
String join = String.join(",", systemNames); String join = String.join(",", systemNames);
item.setSystemName(join); item.setSystemName(join);
} }
}); if (StringUtil.isNotEmpty(item.getUnitId()) && !ObjectUtils.isEmpty(finalUnitNameMap)) {
item.setUnitName(finalUnitNameMap.getOrDefault(item.getUnitId(), ""));
}
if (StringUtil.isNotEmpty(item.getManufacturerId()) && !ObjectUtils.isEmpty(finalManufacturerIdMap)) {
item.setManufacturerName(finalManufacturerIdMap.getOrDefault(item.getManufacturerId(), ""));
} }
});
return list; return list;
} }
......
...@@ -2109,28 +2109,16 @@ ...@@ -2109,28 +2109,16 @@
CONCAT('01#',wles.qr_code) fullqrCode, CONCAT('01#',wles.qr_code) fullqrCode,
wled.standard, wled.standard,
wle.img, wle.img,
wle.unit_id as unitId,
wles.name equipmentName, wles.name equipmentName,
wec.name as systemType, wec.name as systemType,
concat_ws('-',wlws.full_name,wled.area) as full_name, concat_ws('-',wlws.full_name,wled.area) as full_name,
wlws.name as belongBuildName, wlws.name as belongBuildName,
wlun.NAME unitName,
wles.system_id as systemId, wles.system_id as systemId,
wlsd.amount,
wlsd.id as stockDetailId,
'equipment' as type, 'equipment' as type,
wlai.`name` manufacturerName, wled.manufacturer_id as manufacturerId,
wles.code, wles.code,
wles.iot_code as iotCode, 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, wles.create_date as createDate,
wled.code as eqtype, wled.code as eqtype,
wles.biz_org_code as bizOrgCode, wles.biz_org_code as bizOrgCode,
...@@ -2139,18 +2127,14 @@ ...@@ -2139,18 +2127,14 @@
wec.industry_code as industryCode, wec.industry_code as industryCode,
wle.is_iot as wleIsIot wle.is_iot as wleIsIot
FROM FROM
(select id,name,qr_code,code ,iot_code ,biz_org_code,team_id ,biz_org_name,create_date ,equipment_detail_id ,system_id,equip_status from wl_equipment_specific) wles (select id,name,qr_code,code ,iot_code ,biz_org_code,team_id ,biz_org_name,create_date ,equipment_detail_id ,system_id,equip_status, warehouse_structure_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 wles.warehouse_structure_id = wlws.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 (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_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 LEFT JOIN wl_equipment_category wec ON wle.category_id = wec.id
WHERE 1=1 WHERE 1=1
<if test="codeHead!=null and codeHead!='' and codeHead!=' '"> <if test="codeHead!=null and codeHead!='' and codeHead!=' '">
and LEFT (wle.CODE, #{hierarchy}) = #{codeHead} and LEFT (wle.CODE, #{hierarchy}) = #{codeHead}
<!-- and wec.`code` like concat(#{codeHead}, '%')-->
</if> </if>
<if test="equipTypeAmountPage.teamId!=null"> <if test="equipTypeAmountPage.teamId!=null">
...@@ -2166,7 +2150,7 @@ ...@@ -2166,7 +2150,7 @@
and wled.is_import = #{equipTypeAmountPage.isImport} and wled.is_import = #{equipTypeAmountPage.isImport}
</if> </if>
<if test="equipTypeAmountPage.warehouseStructureId!=null"> <if test="equipTypeAmountPage.warehouseStructureId!=null">
and wlsd.warehouse_structure_id in ( and wles.warehouse_structure_id in (
select id from wl_warehouse_structure where parent_id in( select id from wl_warehouse_structure where parent_id in(
select id from wl_warehouse_structure where parent_id = #{equipTypeAmountPage.warehouseStructureId}) select id from wl_warehouse_structure where parent_id = #{equipTypeAmountPage.warehouseStructureId})
union union
...@@ -2175,11 +2159,11 @@ ...@@ -2175,11 +2159,11 @@
) )
</if> </if>
<if test="equipTypeAmountPage.status == 1"> <if test="equipTypeAmountPage.status == 1">
and wlsd.warehouse_structure_id is null and wles.warehouse_structure_id is null
</if> </if>
<if test="equipTypeAmountPage.status == 0"> <if test="equipTypeAmountPage.status == 0">
and wlsd.warehouse_structure_id is not null and wles.warehouse_structure_id is not null
</if> </if>
<if test="equipTypeAmountPage.equipmentName!=null and equipTypeAmountPage.equipmentName!=''"> <if test="equipTypeAmountPage.equipmentName!=null and equipTypeAmountPage.equipmentName!=''">
AND wled.name LIKE CONCAT('%',#{equipTypeAmountPage.equipmentName},'%') AND wled.name LIKE CONCAT('%',#{equipTypeAmountPage.equipmentName},'%')
...@@ -2200,13 +2184,11 @@ ...@@ -2200,13 +2184,11 @@
<if test="equipTypeAmountPage.bizOrgCode!=null and equipTypeAmountPage.bizOrgCode!=''"> <if test="equipTypeAmountPage.bizOrgCode!=null and equipTypeAmountPage.bizOrgCode!=''">
AND wles.biz_org_code LIKE CONCAT(#{equipTypeAmountPage.bizOrgCode},'%') AND wles.biz_org_code LIKE CONCAT(#{equipTypeAmountPage.bizOrgCode},'%')
</if> </if>
group by wles.id
having 1 = 1
<if test="equipTypeAmountPage.industryCode!=null"> <if test="equipTypeAmountPage.industryCode!=null">
AND industryCode = #{equipTypeAmountPage.industryCode} AND wec.industry_code = #{equipTypeAmountPage.industryCode}
</if> </if>
<if test="equipTypeAmountPage.isIot!=null"> <if test="equipTypeAmountPage.isIot!=null">
AND wleIsIot = #{equipTypeAmountPage.isIot} AND wle.is_iot = #{equipTypeAmountPage.isIot}
</if> </if>
order by createDate DESC order by createDate DESC
</select> </select>
......
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