Commit 5ba47548 authored by KeYong's avatar KeYong

Merge remote-tracking branch 'origin/dev_upgrade' into dev_upgrade

parents f8b583d3 3d46920d
package com.yeejoin.amos.fas.dao.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import java.util.Date;
/**
* @author Gao Jianqiang
* @title: PlanMessage
* <pre>
* @description: TODO
* </pre>
* @date 2023/3/8 11:20
*/
@Entity
@Table(name = "c_plan_message")
@NamedQuery(name = "PlanMessage.findAll", query = "SELECT e FROM PlanMessage e")
public class PlanMessage extends BasicEntity {
@Column(name = "batch_no")
private String batchNo;
@Column(name = "step_code")
private String stepCode;
@Column(name = "step_index")
private Integer stepIndex;
@Column(name = "equip_name")
private String equipName;
@Column(name = "index_key")
private String indexKey;
@Column(name = "index_name")
private String indexName;
@Column(name = "index_value")
private String indexValue;
@Column(name = "index_value_desc")
private String indexValueDesc;
@Column(name = "index_create_time")
private Date indexCreateTime;
}
......@@ -20,7 +20,6 @@ import com.yeejoin.amos.fas.business.dao.mapper.PlanOperationRecordMapper;
import com.yeejoin.amos.fas.business.dao.repository.IContingencyPlanInstanceRepository;
import com.yeejoin.amos.fas.business.dao.repository.IPlanDetailDao;
import com.yeejoin.amos.fas.business.dao.repository.IPlanOperationRecordDao;
import com.yeejoin.amos.fas.business.feign.JcsFeign;
import com.yeejoin.amos.fas.business.feign.RemoteSecurityService;
import com.yeejoin.amos.fas.business.service.impl.RuleRunigSnapshotServiceImpl;
import com.yeejoin.amos.fas.business.service.intfc.*;
......@@ -857,16 +856,11 @@ public class ContingencyAction implements CustomerAction {
ContingencyRo contingencyRo = (ContingencyRo) paramObj;
String batchNo = contingencyRo.getBatchNo();
if (!findByBatchNoAndStatus(batchNo)) {
// String contingencyPlanId = getContingencyPlanId(contingencyRo.getBatchNo(), actionName, icon, tips, buttonJson);
ContingencyPlanInstance contingencyPlanInstance = getContingencyPlan(contingencyRo.getBatchNo(), actionName, icon, tips, buttonJson);
String contingencyPlanId = contingencyPlanInstance.getId();
try {
// ContingencyPlanInstance instance = contingencyInstance.getMessageById(contingencyPlanId);
// if (contingencyPlanInstance != null) {
contingencyPlanInstance.setRoleCode(planStepService.getPlanStepRoleCodeByButtonCode(buttonCode));
// contingencyPlanInstanceMapper.updateMessageById(contingencyPlanInstance);
contingencyPlanInstanceRepository.save(contingencyPlanInstance);
// }
contingencyInstance.fire(contingencyRo.getBatchNo(), stepCode, buttonJson, contingencyPlanId, buttonCode, confirm, stepState, "true", RequestContext.getToken(), RequestContext.getProduct(), RequestContext.getAppKey(), null);
} catch (Exception e) {
e.printStackTrace();
......
package com.yeejoin.amos.fas.business.controller;
import com.yeejoin.amos.fas.business.service.intfc.IPlanMessageService;
import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
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;
/**
* 预案报文 Controller 接口
*
* @author Gao Jianqiang
* @date 2023-03-08
*/
@RestController
@RequestMapping(value = "/planMessage")
@Api(tags = "重点设备配套设施调整Api")
public class PlanMessageController extends BaseController {
@Autowired
private IPlanMessageService planMessageService;
@ApiOperation(httpMethod = "GET", value = "获取预案指定步骤报文集合", notes = "获取预案指定步骤报文集合")
@RequestMapping(value = "/getPlanMessageList", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse getPlanMessageList(@RequestParam String batchNo, @RequestParam Integer stepIndex) {
return CommonResponseUtil.success(planMessageService.getPlanMessageList(batchNo, stepIndex));
}
}
package com.yeejoin.amos.fas.business.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.fas.dao.entity.PlanMessage;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
/**
* 预案报文 Mapper 接口
*
* @author Gao Jianqiang
* @date 2023-03-08
*/
@Repository
public interface PlanMessageMapper extends BaseMapper<PlanMessage> {
List<Map<String, String>> getPlanMessageList(String batchNo, Integer stepIndex);
}
......@@ -13,4 +13,6 @@ import org.apache.ibatis.annotations.Param;
public interface WarehouseStructureMapper extends BaseMapper<WarehouseStructure> {
WarehouseStructure getMessageById(@Param("id")Long id);
WarehouseStructure getMessageByRiskId(@Param("id")Long id);
}
package com.yeejoin.amos.fas.business.dao.repository;
import com.yeejoin.amos.fas.dao.entity.PlanMessage;
import org.springframework.stereotype.Repository;
/**
* <h1><h1>
*
* @author tiantao
* @date 2021/1/15 10:36
*/
@Repository
public interface IPlanMessageDao extends BaseDao<PlanMessage, Long> {
}
......@@ -227,7 +227,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
instanceInfo.setName(detail.getPlanName());
instanceInfo.setOrgCode(detail.getOrgCode());
WarehouseStructure warehouseStructure = warehouseStructureMapper.getMessageById(equipmentSpecific.getWarehouseStructureId());
WarehouseStructure warehouseStructure = warehouseStructureMapper.getMessageByRiskId(equipmentSpecific.getId());
if (warehouseStructure != null) {
instanceInfo.setPosition(warehouseStructure.getName());
}
......
package com.yeejoin.amos.fas.business.service.impl;
import com.yeejoin.amos.fas.business.dao.mapper.PlanMessageMapper;
import com.yeejoin.amos.fas.business.service.intfc.IPlanMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* 预案报文 Service 接口
*
* @author Gao Jianqiang
* @date 2023-03-08
*/
@Service
public class PlanMessageServiceImpl implements IPlanMessageService {
@Autowired
private PlanMessageMapper planMessageMapper;
@Override
public List<Map<String, String>> getPlanMessageList(String batchNo, Integer stepIndex) {
return planMessageMapper.getPlanMessageList(batchNo, stepIndex);
}
}
package com.yeejoin.amos.fas.business.service.intfc;
import java.util.List;
import java.util.Map;
/**
* 预案报文 IPlanMessageService 接口
*
* @author Gao Jianqiang
* @date 2023-03-08
*/
public interface IPlanMessageService {
List<Map<String, String>> getPlanMessageList(String batchNo, Integer stepIndex);
}
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.fas.business.dao.mapper.PlanMessageMapper">
<select id="getPlanMessageList" resultType="java.util.Map">
SELECT
m.equip_name AS equipName,
m.index_name AS indexName,
m.index_key AS `indexKey`,
m.index_value AS indexValue,
m.index_value_desc AS indexValueDesc,
m.index_create_time AS indexCreateTime
FROM
c_plan_message m
<where>
<if test="batchNo != null and batchNo != ''">
m.batch_no = #{batchNo}
</if>
<if test="stepIndex != null">
AND m.step_index = ${stepIndex}
</if>
</where>
ORDER BY
m.index_create_time DESC
</select>
</mapper>
\ No newline at end of file
......@@ -7,4 +7,12 @@
select * from wl_warehouse_structure where id = #{id}
</select>
<select id="getMessageByRiskId" resultType="com.yeejoin.amos.fas.dao.entity.WarehouseStructure">
select * from wl_warehouse_structure where id = (
SELECT risk_source_id from f_equipment where id = (
select equipment_id from f_equipment_fire_equipment where fire_equipment_id = #{id}
)
)
</select>
</mapper>
\ No newline at end of file
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