Commit 4917cae2 authored by chenhao's avatar chenhao

Merge branch 'develop_ccs' of http://172.16.10.76/moa/amos-boot-biz into develop_ccs

parents b4b34be4 a41fb8be
......@@ -77,7 +77,7 @@ public class FireTeamDto extends BaseDto {
@ApiModelProperty(value = "联系人id")
private Long contactUserId;
@ExplicitConstraint(indexNum = 7, sourceClass = CommonExplicitConstraint.class,method = "getFirefighters") //动态下拉内容
@ExplicitConstraint(indexNum = 7, sourceClass = CommonExplicitConstraint.class,method = "getFireTeamContactUser") //动态下拉内容
@ExcelProperty(value = "联系人", index = 7)
@ApiModelProperty(value = "联系人")
private String contactUser;
......
......@@ -181,7 +181,7 @@ public class KeySiteController extends BaseController {
@RequestParam(required = false) String fireEnduranceRate,
@RequestParam(required = false) String useNature,
@RequestParam(required = false) String fireFacilitiesInfo,
@RequestParam String bizOrgCode) {
@RequestParam(required = false) String bizOrgCode) {
Page<KeySiteDto> page = new Page<KeySiteDto>();
page.setCurrent(current);
page.setSize(size);
......
......@@ -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 {
return fireFightingSystemService.getColaCategoryAmountList(0, null, equipTypeAmountPage);
return fireFightingSystemService.getColaCategoryAmountListIot(0, null, equipTypeAmountPage);
}
}
......
......@@ -110,7 +110,10 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
@Param("hierarchy")int hierarchy,
@Param("codeHead")String codeHead,
@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,
@Param("hierarchy")int hierarchy,
@Param("codeHead")String codeHead,
......
......@@ -130,7 +130,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
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> getColaCategoryAmountEquList(int hierarchy, String codeHead, EquipTypeAmountPageDTO equipTypeAmountPage);
......
......@@ -699,7 +699,23 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
});
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
public IPage<EquipTypeImgAmountVO> getColaCategoryAmountCarList(int hierarchy, String codeHead,
EquipTypeAmountPageDTO equipTypeAmountPage) {
......@@ -1010,11 +1026,21 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}
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();
if (responseList == null || responseList.size() < 1) {
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);
return list;
}
......
......@@ -211,6 +211,23 @@ public class DataSourcesImpl implements DataSources {
return str;
}
private String[] getFireTeamContactUser() {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
// 权限处理
PermissionInterceptorContext.setDataAuthRule("fire_team_info");
Map<String, Object> map = new HashMap<>();
map.put("bizOrgCode",reginParams.getPersonIdentity().getBizOrgCode());
IPage<Map<String, Object>> mapIPage = iOrgUsrService.pagePerson(null, null, map);
List<Map<String, Object>> records = mapIPage.getRecords();
List<String> carNameList = Lists.newArrayList();
records.forEach(result -> {
carNameList.add(result.get("bizOrgName") + "@" + result.get("sequenceNbr"));
});
String[] str = carNameList.toArray(new String[carNameList.size()]);
return str;
}
private String[] getFireTeam() {
// Page<FireTeamCardDto> pageBean = new Page<>(0, Integer.MAX_VALUE);
......@@ -288,13 +305,9 @@ public class DataSourcesImpl implements DataSources {
}
private String[] getCompanyList() throws Exception {
// 导出模板增加权限
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
// 权限处理
PermissionInterceptorContext.setDataAuthRule("fire_fighters_info");
List<OrgMenuDto> orgUsrTree = iOrgUsrService.companyTreeByUserAndType(reginParams, OrgPersonEnum.公司.getKey());
// List<OrgMenuDto> orgUsrTree = orgUsrService.getTree(null, orgUsrService.selectCompanyDepartmentMsg(),
// OrgUsr.class.getName(), "getSequenceNbr", 2, "getBizOrgName", "getParentId", "getBizOrgType");
List<OrgMenuDto> orgUsrTree = orgUsrService.getTree(null, orgUsrService.selectCompanyDepartmentMsg(),
OrgUsr.class.getName(), "getSequenceNbr", 2, "getBizOrgName", "getParentId", "getBizOrgType");
List<String> stringList = new ArrayList<String>();
initCompanyList(orgUsrTree, stringList);
String[] str = stringList.toArray(new String[stringList.size()]);
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.interceptors.PermissionInterceptorContext;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceTypeDto;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StopWatch;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author DELL
......@@ -26,11 +33,20 @@ public class EquipmentServiceImpl {
@Autowired
WaterResourceServiceImpl waterResourceServiceImpl;
@Autowired
private RedisUtils redisUtils;
public List<MenuFrom> getFireSystemList() {
// 导出模板增加权限
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
// 权限处理
PermissionInterceptorContext.setDataAuthRule("fire_water_info");
ResponseModel<Object> response = equipFeignClient.getFireSystemListAll();
List<Map<String, Object>> fireSystemMapList = (List<Map<String, Object>>) response.getResult();
List<MenuFrom> fireSystemDtoList = Lists.newArrayList();
fireSystemMapList.forEach(system -> {
fireSystemMapList.stream().filter(
result -> result.get("bizOrgCode") != null && result.get("bizOrgCode").toString().startsWith(reginParams.getPersonIdentity().getBizOrgCode()))
.forEach(
system -> {
MenuFrom menuFrom = new MenuFrom((String) system.get("id"), (String) system.get("name"), "0", "0");
fireSystemDtoList.add(menuFrom);
});
......
......@@ -624,22 +624,22 @@
<select id="queryCompanyIotStaData" resultType="java.util.Map">
SELECT
s.biz_org_code as bizOrgCode,
c.code as categoryCode,
count(1) as total
FROM
`wl_car` s,
wl_equipment e,
wl_equipment_category c
where
e.is_iot=1
and s.equipment_id = e.`id`
and e.category_id = c.id
and s.biz_org_code is not null
GROUP BY s.biz_org_code ,c.code
UNION
-- SELECT
-- s.biz_org_code as bizOrgCode,
-- c.code as categoryCode,
-- count(1) as total
-- FROM
-- `wl_car` s,
-- wl_equipment e,
-- wl_equipment_category c
-- where
-- e.is_iot=1
-- and s.equipment_id = e.`id`
-- and e.category_id = c.id
-- and s.biz_org_code is not null
-- GROUP BY s.biz_org_code ,c.code
--
-- UNION
SELECT
s.biz_org_code as bizOrgCode,
......
......@@ -366,7 +366,7 @@
FROM
wl_stock_detail
) AS detail ON detail.equipment_specific_id = spec.id
LEFT JOIN wl_warehouse_structure structure ON detail.warehouse_structure_id = structure.id
LEFT JOIN wl_warehouse_structure structure ON spec.warehouse_structure_id = structure.id
LEFT JOIN (
SELECT
s.id,
......
......@@ -1867,4 +1867,114 @@ FROM
</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>
......@@ -88,7 +88,7 @@
MAX( CASE WHEN a.field_name = 'code' THEN a.field_value END ) AS code,
MAX( CASE WHEN a.field_name = 'isRisk' THEN a.field_value END ) AS isRisk,
MAX( CASE WHEN a.field_name = 'address' THEN a.field_value END ) AS address,
MAX( CASE WHEN a.field_name = 'bizOrgCode' THEN a.field_value END ) AS bizOrgCode,
MAX( CASE WHEN a.field_name = 'orgCode' THEN a.field_value END ) AS bizOrgCode,
MAX( CASE WHEN a.field_name = 'bizOrgName' THEN a.field_value END ) AS bizOrgName
FROM
`wl_form_instance` a
......
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