Commit e1d7ec4e authored by KeYong's avatar KeYong

修改接口

parent 66e5d377
......@@ -166,12 +166,11 @@ public class FireFightingSystemController extends AbstractBaseController {
}
//查询系统下设备状态
@RequestMapping(value = "/getEquip", method = RequestMethod.GET)
@RequestMapping(value = "/alarmSystem/info", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("通过id查询消防系统信息")
public List<Map<String,Object>> getEquip(Long id) {
return fireFightingSystemService.getEquip(id);
public List<Map<String,Object>> getEquip() {
return fireFightingSystemService.getEquip();
}
......
......@@ -642,5 +642,5 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
List<Map<String, Object>> selectAllDays();
List<Map<String, Object>> getEquip(@Param("id") Long id);
List<Map<String, Object>> getEquip();
}
......@@ -170,7 +170,8 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
* @return FireFightingSystemEntity
*/
FireFightingSystemEntity getDetailByCode(String systemCode);
List<Map<String,Object>> getEquip(Long id);
List<Map<String,Object>> getEquip();
/**
* 集成页面系统数据
*
......
......@@ -35,8 +35,9 @@ import com.yeejoin.equipmanage.fegin.JcsFeign;
import com.yeejoin.equipmanage.mapper.*;
import com.yeejoin.equipmanage.remote.RemoteSecurityService;
import com.yeejoin.equipmanage.service.*;
import org.apache.commons.beanutils.BeanUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
......@@ -50,7 +51,6 @@ import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
......@@ -62,8 +62,8 @@ import java.net.SocketException;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.stream.Collectors;
import static java.lang.String.valueOf;
import org.apache.commons.io.IOUtils;
@Slf4j
@Service
......@@ -977,8 +977,23 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}
@Override
public List<Map<String, Object>> getEquip(Long id) {
return fireFightingSystemMapper.getEquip(id);
public List<Map<String, Object>> getEquip() {
List<Map<String, Object>> list = fireFightingSystemMapper.getEquip();
List<Map<String, Object>> resList = new ArrayList<>();
int i = 1;
if (0 < list.size()) {
for (Map<String, Object> m : list) {
Map<String, Object> map = new HashMap<>();
map.put("key", i);
map.put("name", m.get("equipmentName"));
map.put("code", m.get("code"));
map.put("value", m.get("flag"));
map.put("unit", "");
resList.add(map);
i++;
}
}
return resList;
}
@Override
......
......@@ -5604,23 +5604,29 @@
<select id="getEquip" resultType="java.util.Map">
SELECT spe.id,
det.`name` equipment_name,
SELECT
spe.id,
det.`name` equipmentName,
spe.`code`,
( CASE (select count(*) from wl_equipment_specific_alarm where wl_equipment_specific_alarm.equipment_specific_id=spe.id and status=1)
WHEN 0 THEN
'正常'
ELSE
'异常'
END ) flag
det.`code` equipmentCode,
(
CASE
( SELECT count(*) FROM wl_equipment_specific_alarm wesa WHERE wesa.equipment_specific_id = spe.id AND STATUS = 1 )
WHEN 0 THEN
'正常' ELSE '异常'
END
) flag
FROM
wl_equipment_specific AS spe
LEFT JOIN wl_equipment_detail AS det ON spe.equipment_detail_id = det.id
LEFT JOIN wl_equipment AS wle ON wle.id = det.equipment_id
LEFT JOIN wl_stock_detail AS wlsd on wlsd.equipment_detail_id = det.id
WHERE
find_in_set(#{id},spe.system_id) and spe.single = true and wlsd.`status` = 1
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET( fs.id, spe.system_id )
LEFT JOIN wl_equipment_detail AS det ON spe.equipment_detail_id = det.id
LEFT JOIN wl_equipment AS wle ON wle.id = det.equipment_id
LEFT JOIN wl_stock_detail AS wlsd ON wlsd.equipment_detail_id = det.id
WHERE
fs.system_type_code IS NOT NULL
AND fs.system_type_code = 'fireAlarmSys'
AND wlsd.`status` = 1
GROUP BY det.`code`
</select>
</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