Commit 91c06195 authored by lisong's avatar lisong

修改接口

parent c12583ea
package com.yeejoin.amos.fas.dao.entity; package com.yeejoin.amos.fas.dao.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model; import com.baomidou.mybatisplus.extension.activerecord.Model;
...@@ -42,6 +43,8 @@ public class ContingencyInstanceInfo extends Model<ContingencyInstanceInfo>{ ...@@ -42,6 +43,8 @@ public class ContingencyInstanceInfo extends Model<ContingencyInstanceInfo>{
private String orgCode; private String orgCode;
@TableField
private String duration;
} }
...@@ -78,6 +78,16 @@ public class ContingencyPlanInstance extends BusinessEntity{ ...@@ -78,6 +78,16 @@ public class ContingencyPlanInstance extends BusinessEntity{
@Column(name = "person_img") @Column(name = "person_img")
private String personImg; private String personImg;
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPersonImg() { public String getPersonImg() {
return personImg; return personImg;
} }
......
...@@ -223,7 +223,7 @@ public class PlanVisual3dController extends BaseController { ...@@ -223,7 +223,7 @@ public class PlanVisual3dController extends BaseController {
} }
@Permission @Permission
@ApiOperation(httpMethod = "GET", value = "分页查询处置详情信息", notes = "分页查询处置详情信息") @ApiOperation(httpMethod = "GET", value = "分页查询预案下处置动作列表", notes = "分页查询预案下处置动作列表")
@GetMapping(value = "/plan/selectDisposalActionPage") @GetMapping(value = "/plan/selectDisposalActionPage")
public ResponseModel selectDisposalActionPage(@RequestParam(value = "current") int current, public ResponseModel selectDisposalActionPage(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size, @RequestParam(value = "size") int size,
...@@ -243,7 +243,7 @@ public class PlanVisual3dController extends BaseController { ...@@ -243,7 +243,7 @@ public class PlanVisual3dController extends BaseController {
} }
@Permission @Permission
@ApiOperation(httpMethod = "GET", value = "分页查询处置详情信息", notes = "分页查询处置详情信息") @ApiOperation(httpMethod = "GET", value = "查询预案下处置动作列表", notes = "查询预案下处置动作列表")
@GetMapping(value = "/plan/selectDisposalActionList") @GetMapping(value = "/plan/selectDisposalActionList")
public ResponseModel selectDisposalActionList(@RequestParam(value = "batchNo") String batchNo, public ResponseModel selectDisposalActionList(@RequestParam(value = "batchNo") String batchNo,
@RequestParam(value = "dataType") int dataType @RequestParam(value = "dataType") int dataType
......
...@@ -7,6 +7,7 @@ import com.yeejoin.amos.fas.core.util.DateUtil; ...@@ -7,6 +7,7 @@ import com.yeejoin.amos.fas.core.util.DateUtil;
import com.yeejoin.amos.fas.dao.entity.ContingencyInstanceInfo; import com.yeejoin.amos.fas.dao.entity.ContingencyInstanceInfo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -21,7 +22,12 @@ public class ContingencyInstanceInfoServiceImpl implements ContingencyInstanceIn ...@@ -21,7 +22,12 @@ public class ContingencyInstanceInfoServiceImpl implements ContingencyInstanceIn
@Override @Override
public ContingencyInstanceInfo selectDisposalDetails(String disposalId) { public ContingencyInstanceInfo selectDisposalDetails(String disposalId) {
return contingencyInstanceInfoMapper.selectDisposalDetails(disposalId); ContingencyInstanceInfo instanceInfo = contingencyInstanceInfoMapper.selectDisposalDetails(disposalId);
if (!ObjectUtils.isEmpty(instanceInfo.getStartTime()) && !ObjectUtils.isEmpty(instanceInfo.getEndTime())){
String datePoorToMin = getDatePoorToMin(instanceInfo.getEndTime(), instanceInfo.getStartTime());
instanceInfo.setDuration(datePoorToMin);
}
return instanceInfo;
} }
@Override @Override
...@@ -38,6 +44,12 @@ public class ContingencyInstanceInfoServiceImpl implements ContingencyInstanceIn ...@@ -38,6 +44,12 @@ public class ContingencyInstanceInfoServiceImpl implements ContingencyInstanceIn
start = 0; start = 0;
} }
List<ContingencyInstanceInfo> infoList = contingencyInstanceInfoMapper.selectDisposalListPage((int) start, size, orgCode); List<ContingencyInstanceInfo> infoList = contingencyInstanceInfoMapper.selectDisposalListPage((int) start, size, orgCode);
for (ContingencyInstanceInfo instanceInfo : infoList) {
if (!ObjectUtils.isEmpty(instanceInfo.getStartTime()) && !ObjectUtils.isEmpty(instanceInfo.getEndTime())){
String datePoorToMin = getDatePoorToMin(instanceInfo.getEndTime(), instanceInfo.getStartTime());
instanceInfo.setDuration(datePoorToMin);
}
}
page.setRecords(infoList); page.setRecords(infoList);
} }
return page; return page;
...@@ -64,5 +76,23 @@ public class ContingencyInstanceInfoServiceImpl implements ContingencyInstanceIn ...@@ -64,5 +76,23 @@ public class ContingencyInstanceInfoServiceImpl implements ContingencyInstanceIn
} }
return false; return false;
} }
public static String getDatePoorToMin(Date endDate, Date nowDate) {
long nd = 1000 * 24 * 60 * 60;
long nh = 1000 * 60 * 60;
long nm = 1000 * 60;
long ns = 1000;
// 获得两个时间的毫秒时间差异
long diff = endDate.getTime() - nowDate.getTime();
// 计算差多少天
long day = diff / nd;
// 计算差多少小时
long hour = diff / nh;
// 计算差多少分钟
long min = diff % nh / nm;
// 计算差多少秒//输出结果
long sec = diff % nd % nh % nm / ns;
return hour + "小时" + min + "分钟 " + sec + "秒";
}
} }
...@@ -35,28 +35,33 @@ ...@@ -35,28 +35,33 @@
where is_delete = 0 and org_code = #{orgCode} where is_delete = 0 and org_code = #{orgCode}
</select> </select>
<select id="selectDisposalActionPage" resultType="com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance"> <select id="selectDisposalActionPage" resultType="com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance">
select `id`, `record_type`, `category`, `content`, `icon`, `sort`, `sequence_num` select cpi.id, cpi.`record_type`, cpi.`category`, cpi.`content`, cpi.`icon`, cpi.`sort`, cpi.`sequence_num`
, `batch_no`, `create_date`, `create_user`, `update_date` , cpi.`batch_no`, cpi.`create_date`, cpi.`create_user`, cpi.`update_date`
, `update_user`, `is_delete`, `tips`, IFNULL(`runstate`, 0) AS runstate, `file_path` , cpi.`update_user`, cpi.`is_delete`, cpi.`tips`, IFNULL(cpi.`runstate`, 0) AS runstate, cpi.`file_path`
, `file_type`, `role_name`, `role_code`, `start_user_name` , `file_type`, `role_name`, `role_code`, `start_user_name`
, `start_user_id`, `person_img` from contingency_plan_instance , cpi.`start_user_id`, cpi.`person_img`,cii.name
from contingency_plan_instance cpi left join contingency_instance_info cii
on cpi.batch_no = cii.id
<where> <where>
<if test="batchNo != null and batchNo != ''"> <if test="batchNo != null and batchNo != ''">
batch_no = #{batchNo} cpi.batch_no = #{batchNo}
</if> </if>
<if test="type != null and type != ''"> <if test="type != null and type != ''">
and record_type = #{type} and cpi.record_type = #{type}
</if> </if>
<if test="status != null and status != ''"> <if test="status != null and status != ''">
and runstate = #{status} and cpi.runstate is null
</if> </if>
<if test="list != null and list.size() >0"> <if test="list != null and list.size() >0">
<foreach collection="list" item="role" index="index" open="and (" close=") " separator="or"> <foreach collection="list" item="role" index="index" open="and (" close=") " separator="or">
role_code like concat('%',#{role},'%') cpi.role_code like concat('%',#{role},'%')
</foreach> </foreach>
</if> </if>
</where> </where>
order by cpi.`create_date`
LIMIT #{current}, #{size} LIMIT #{current}, #{size}
</select> </select>
<select id="selectCountDisposalActionPage" resultType="java.lang.Integer"> <select id="selectCountDisposalActionPage" resultType="java.lang.Integer">
...@@ -69,7 +74,7 @@ ...@@ -69,7 +74,7 @@
and record_type = #{type} and record_type = #{type}
</if> </if>
<if test="status != null and status != ''"> <if test="status != null and status != ''">
and runstate = #{status} and runstate is null
</if> </if>
<if test="list != null and list.size() >0"> <if test="list != null and list.size() >0">
...@@ -81,30 +86,31 @@ ...@@ -81,30 +86,31 @@
</select> </select>
<select id="selectDisposalActionList" resultType="com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance"> <select id="selectDisposalActionList" resultType="com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance">
select `id`, `record_type`, `category`, `content`, `icon`, `sort`, `sequence_num` select cpi.id, cpi.`record_type`, cpi.`category`, cpi.`content`, cpi.`icon`, cpi.`sort`, cpi.`sequence_num`
, `batch_no`, `create_date`, `create_user`, `update_date` , cpi.`batch_no`, cpi.`create_date`, cpi.`create_user`, cpi.`update_date`
, `update_user`, `is_delete`, `tips`, IFNULL(`runstate`, 0) AS runstate, `file_path` , cpi.`update_user`, cpi.`is_delete`, cpi.`tips`, IFNULL(cpi.`runstate`, 0) AS runstate, cpi.`file_path`
, `file_type`, `role_name`, `role_code`, `start_user_name` , `file_type`, `role_name`, `role_code`, `start_user_name`
, `start_user_id`, `person_img` , cpi.`start_user_id`, cpi.`person_img`,cii.name
from contingency_plan_instance cpi left join contingency_instance_info cii
from contingency_plan_instance on cpi.batch_no = cii.id
<where> <where>
<if test="batchNo != null and batchNo != ''"> <if test="batchNo != null and batchNo != ''">
batch_no = #{batchNo} cpi.batch_no = #{batchNo}
</if> </if>
<if test="type != null and type != ''"> <if test="type != null and type != ''">
and record_type = #{type} and cpi.record_type = #{type}
</if> </if>
<if test="status != null and status != ''"> <if test="status != null and status != ''">
and runstate = #{status} and cpi.runstate is null
</if> </if>
<if test="list != null and list.size() >0"> <if test="list != null and list.size() >0">
<foreach collection="list" item="role" index="index" open="and (" close=") " separator="or"> <foreach collection="list" item="role" index="index" open="and (" close=") " separator="or">
role_code like concat('%',#{role},'%') cpi.role_code like concat('%',#{role},'%')
</foreach> </foreach>
</if> </if>
</where> </where>
order by cpi.`create_date`
</select> </select>
</mapper> </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