Commit a37159ca authored by 单奇雲's avatar 单奇雲

Merge

parents c43a0f75 21a6cb98
......@@ -82,10 +82,13 @@ public class ExcelController extends BaseController {
String title = "监测点";
Class cls = null;
if ("point".equals(modelName)) {
title = "消防点位";
cls = FireEquipmentPointParam.class;
} else if ("equipment".equals(modelName)) {
title = "消防资源";
cls = FireEquipmentParam.class;
} else if ("water".equals(modelName)) {
title = "水资源";
cls = WaterResourceParam.class;
}
if (cls != null) {
......
......@@ -30,9 +30,12 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping(value = "/api/visual")
@Api(tags="预案可视化API")
@Api(tags = "预案可视化API")
public class PlanVisual3dController extends BaseController {
private final Logger log = LoggerFactory.getLogger(PlanVisual3dController.class);
......@@ -109,10 +112,26 @@ public class PlanVisual3dController extends BaseController {
/**
* 资源设备信息查询
*/
@ApiOperation(httpMethod = "GET",value = "资源查询",notes = "资源查询")
@ApiOperation(httpMethod = "GET", value = "资源查询", notes = "资源查询")
@Authorization(ingore = true)
@GetMapping(value="/resource/{type}/list")
public CommonResponse getResourceList(@ApiParam(value = "资源类型", required = true) @PathVariable String type){
@GetMapping(value = "/resource/{type}/list")
public CommonResponse getResourceList(@ApiParam(value = "资源类型", required = true) @PathVariable String type) {
return planVisual3dService.getResourceListByType(type);
}
/**
* 资源设备数据项查询
*
* @param id
* @return
*/
@Authorization(ingore = true)
@GetMapping(value = "/{type}/detail/{id}")
@ApiOperation(value = "数据项查询", notes = "按照分类及id查询数据项")
public CommonResponse getResourceDetail(
@ApiParam(value = "资源类型", required = true) @PathVariable String type,
@ApiParam(value = "主键id", required = true) @PathVariable Long id) {
List<Map<String, Object>> list = planVisual3dService.getResourceById(type, id);
return CommonResponseUtil.success(list);
}
}
......@@ -22,12 +22,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
......@@ -170,4 +165,10 @@ public class RiskModelController extends BaseController {
Page<HashMap<String, Object>> fmeaList = fmeaService.queryFmeaList(param);
return CommonResponseUtil.success(fmeaList);
}
@ApiOperation(value = "Fmea是否关联对象查询", notes = "Fmea是否关联对象查询")
@GetMapping(value = "/fmea/{ids}/controlObjCount")
public CommonResponse queryFmeaControlObj(@ApiParam(value = "fmea ids") @PathVariable(value = "ids", required = true) String[] ids) {
return CommonResponseUtil.success(fmeaService.queryControlObjCount(ids));
}
}
......@@ -3,7 +3,10 @@ package com.yeejoin.amos.fas.business.dao.mapper;
import org.apache.ibatis.annotations.Param;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public interface PlanVisual3dMapper extends BaseMapper {
List<HashMap<String,String>> getResourceListByType(@Param("type") String type);
Map<String, Object> queryOneByTypeAndId(@Param("type") String type, @Param("id") Long id);
}
......@@ -38,4 +38,10 @@ public interface IFmeaDao extends BaseDao<Fmea, Long> {
Fmea findById(Long id);
@Query(value = "SELECT count(1) FROM `f_fmea_point_inputitem` WHERE fmea_id in ?1", nativeQuery = true)
int countAssociatedInputItemByIds(String[] ids);
@Query(value = "SELECT count(1) FROM `f_fmea_equipment_point` WHERE fmea_id in ?1", nativeQuery = true)
int countAssociatedEquipPointByIds(String[] ids);
}
......@@ -36,6 +36,8 @@ public class PointListParam extends CommonPageable{
*/
private String orgCode;
private String[] bindingPointIds;
public String getPointNo() {
return pointNo;
}
......@@ -91,4 +93,12 @@ public class PointListParam extends CommonPageable{
public void setFmeaId(Long fmeaId) {
this.fmeaId = fmeaId;
}
public String[] getBindingPointIds() {
return bindingPointIds;
}
public void setBindingPointIds(String[] bindingPointIds) {
this.bindingPointIds = bindingPointIds;
}
}
package com.yeejoin.amos.fas.business.param;
import java.util.HashMap;
import java.util.List;
import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.core.common.request.CommonRequest;
import org.springframework.util.StringUtils;
import java.util.List;
public class QueryParamUtil {
......@@ -15,18 +15,22 @@ public class QueryParamUtil {
for (int i = 0; i < queryRequests.size(); i++) {
String name = queryRequests.get(i).getName();
String value = toString(queryRequests.get(i).getValue());
if (!StringUtils.isEmpty(value)) {
if ("departmentId".equals(name)) {
param.setDepartmentId(Long.valueOf(value));
}else if("pointNo".equals(name)){
} else if ("pointNo".equals(name)) {
param.setPointNo(value);
}else if("pointName".equals(name)){
} else if ("pointName".equals(name)) {
param.setPointName(value);
}else if("pointId".equals(name)){
} else if ("pointId".equals(name)) {
param.setPointId(Long.valueOf(value));
}else if("inputType".equals(name)){
} else if ("inputType".equals(name)) {
param.setInputType(value);
}else if("fmeaId".equals(name)){
} else if ("fmeaId".equals(name)) {
param.setFmeaId(Long.valueOf(value));
} else if ("bindPointIds".equals(name)) {
param.setBindingPointIds(value.split(","));
}
}
}
if (commonPageable != null) {
......
......@@ -109,6 +109,16 @@ public class FmeaServiceImpl implements IFmeaService {
}
@Override
public int queryControlObjCount(String[] ids) {
int count1 = iFmeaDao.countAssociatedEquipPointByIds(ids);
int count2 = iFmeaDao.countAssociatedInputItemByIds(ids);
if (count1 > 0 || count2 > 0) {
return count1 + count2;
}
return 0;//没有关联对象
}
private boolean asymbleWithParent(String bacthNo, List<RiskSource> riskSourceList, String from) throws Exception {
if (!CollectionUtils.isEmpty(riskSourceList)) {
for (RiskSource riskSource : riskSourceList) {
......
......@@ -16,10 +16,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
@Service("planVisual3dService")
public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
......@@ -42,7 +40,7 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
CommonResponse response = maasVisualServer.getTree();
List<TreeSubjectVo> treeSubjectVos = Lists.newArrayList();
if (null != response.getDataList()) {
List<Object> res = (List<Object>)response.getDataList();
List<Object> res = (List<Object>) response.getDataList();
if (!CollectionUtils.isEmpty(res)) {
treeSubjectVos = listToTree(res);
}
......@@ -134,11 +132,47 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
dict.setDictCode(FasConstant.PLAN_SOURCE_TYPE);
dict.setDictValue(type);
List<Dict> dictList = dictService.getDictList(dict);
if(CollectionUtils.isEmpty(dictList)){
if (CollectionUtils.isEmpty(dictList)) {
return CommonResponseUtil.failure(type + "字典类型不存在");
}
//2.返回存在的数据
return CommonResponseUtil.success(planVisual3dMapper.getResourceListByType(type));
}
@Override
public List<Map<String, Object>> getResourceById(String type, Long id) {
//1.查询出要返回数据
Map<String, Object> map = planVisual3dMapper.queryOneByTypeAndId(type, id);
//1.1无数据则返回
if (CollectionUtils.isEmpty(map)) {
return new ArrayList<>();
}
//2.加工数据
//2.0查询出中英文对照字典映射
Dict dict = new Dict();
dict.setDictCode(type);
List<Dict> dictList = dictService.getDictList(dict);
Map<String, String> dicts = dictList.stream().collect(
Collectors.toMap(Dict::getDictValue, Dict::getDictName, (key1, key2) -> key2));
//2.1换key为中文
Map<String, Object> tempMap = new HashMap<String, Object>();
map.forEach((k, v) -> {
if (dicts.containsKey(k)) {
tempMap.put(dicts.get(k), v);
}
});
//2.2map转list
List<Map<String, Object>> list = new ArrayList<>();
list = tempMap.entrySet().stream().map(e -> {
Map<String, Object> newMap = new HashMap<String, Object>();
newMap.put("label", e.getKey());
newMap.put("value", e.getValue());
return newMap;
}).collect(Collectors.toList());
return list;
}
}
......@@ -38,4 +38,12 @@ public interface IFmeaService {
void updateRpniInfo(Long riskSourceId);
/**
* 查询关联的关联对象个数
*
* @param ids
* @return count 关联对象个数
*/
int queryControlObjCount(String[] ids);
}
......@@ -33,4 +33,6 @@ public interface IPlanVisual3dService {
TextPlan getTextPlanInfoById(Long id);
CommonResponse getResourceListByType(String type);
List<Map<String,Object>> getResourceById(String type,Long id);
}
......@@ -27,7 +27,7 @@
(select a.id,a.`name`,a.`code` from f_equipment a) as rs
</when>
<when test="type=='fireStrength'">
(select a.id,a.`name`,a.`code` from f_equipment a) as rs
(select a.id,a.`username` as name ,a.`code` from f_fire_strength a) as rs
</when>
<when test="type=='fireChamber'">
(select a.id,a.`name`,a.`code` from f_fire_station a where a.type = '1') as rs
......@@ -43,4 +43,46 @@
</when>
</choose>
</select>
<select id="queryOneByTypeAndId" resultType="hashmap">
SELECT
*
from
<choose>
<when test="type=='fireCar'">
(SELECT * FROM `f_fire_car` a) as rs
</when>
<when test="type=='monitorEquipment'">
(select * from f_fire_equipment a where a.equip_classify = 0) as rs
</when>
<when test="type=='fireConsumables'">
(select * from f_fire_equipment a where a.equip_classify = 1) as rs
</when>
<when test="type=='video'">
(select * from f_fire_equipment a where a.equip_classify = 2) as rs
</when>
<when test="type=='fireEquipment'">
(select * from f_fire_equipment a where a.equip_classify = 3) as rs
</when>
<when test="type=='impEquipment'">
(select * from f_equipment a) as rs
</when>
<when test="type=='fireStrength'">
(select * from f_fire_strength a) as rs
</when>
<when test="type=='fireChamber'">
(select * from f_fire_station a where a.type = '1') as rs
</when>
<when test="type=='fireFoamRoom'">
(select * from f_fire_station a where a.type = '2') as rs
</when>
<when test="type=='hydrant'">
(SELECT * FROM `f_water_resource` a where a.type = '1') as rs
</when>
<when test="type=='pool'">
(SELECT * FROM `f_water_resource` a where a.type = '2') as rs
</when>
</choose>
where rs.id = #{id}
</select>
</mapper>
\ No newline at end of file
......@@ -13,6 +13,11 @@
<if test="pointNo!=null"> and p.point_no like concat(concat("%",#{pointNo}),"%") </if>
<if test="pointId!=null"> and p.id = #{pointId} </if>
<if test="pointName!=null"> and p.name like concat(concat("%",#{pointName}),"%")</if>
<if test="bindingPointIds!=null"> and p.id not in
<foreach collection="bindingPointIds" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
</select>
<select id="getPointList" resultType="java.util.HashMap">
SELECT
......@@ -27,6 +32,11 @@
<if test="pointNo!=null"> and p.point_no like concat(concat("%",#{pointNo}),"%") </if>
<if test="pointId!=null"> and p.id = #{pointId} </if>
<if test="pointName!=null"> and p.name like concat(concat("%",#{pointName}),"%")</if>
<if test="bindingPointIds!=null"> and p.id not in
<foreach collection="bindingPointIds" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
order by p.point_no
<choose>
<when test="pageSize==-1"></when>
......
......@@ -32,7 +32,9 @@
fems.coefficient AS evaluationS,
femo.coefficient AS evaluationO,
femd.coefficient AS evaluationD,
femo1.coefficient AS newEvaluationO,
fm.rpni,
fm.rpn,
fm.engineering,
fm.management,
fm.train,
......@@ -53,7 +55,8 @@
concat(fems.influence,'-',fems.describe) as influence,
fm.identify_user as identifyUser,
(select name from s_user where id = fm.identify_user) as identifyUserName,
fm.identify_method as identifyMethod
fm.identify_method as identifyMethod,
fr.name AS level
FROM
(
SELECT
......@@ -67,8 +70,10 @@
LEFT JOIN f_evaluation_model fems ON fems.id = fm.evaluation_sid
LEFT JOIN f_evaluation_model femo ON femo.id = fm.evaluation_oid
LEFT JOIN f_evaluation_model femd ON femd.id = fm.evaluation_did
LEFT JOIN f_evaluation_model femo1 ON femo1.id = fm.new_evaluation_oid
LEFT JOIN f_risk_factor rf ON rf.id = fm.risk_factors_id
LEFT JOIN f_accident_type fat ON fat.id = rf.accident_type_id
LEFT JOIN f_risk_level fr ON fm.rpn BETWEEN fr.down_limit and fr.top_limit
order by fm.id desc
<choose>
<when test="pageSize==-1"></when>
......
......@@ -77,7 +77,7 @@
sd.department_name as depName,
su.name as username,
su.telephone as tel,
group_concat(pii.name) as inputItems
group_concat(concat(pii.name, '##', a.state) SEPARATOR <![CDATA[ '\n' ]]>) as inputItems
from
f_fmea_point_inputitem a
inner join
......
......@@ -394,6 +394,7 @@
rl.`name` as level,
rs.risk_level_id,
rs.rpni,
rs.rpn,
rs.is_region,
rs.floor3d,
rs.is_indoor,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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