Commit d6fb810e authored by zhangjianqian's avatar zhangjianqian

更改管线巡检

parent 457a7eb1
......@@ -26,6 +26,10 @@ public class TPipeInfo extends BaseEntity
@Excel(name = "管线类型",dictType = "t_pipe_type")
private String pipeType;
/** 巡检频率 */
@Excel(name = "巡检频率",dictType = "t_cycle_type")
private String cycleType;
/** 管道长度 */
@Excel(name = "管道长度")
private String pipeLength;
......@@ -86,6 +90,14 @@ public class TPipeInfo extends BaseEntity
private String isWeiXin;
public String getCycleType() {
return cycleType;
}
public void setCycleType(String cycleType) {
this.cycleType = cycleType;
}
public void setPipeId(Long pipeId)
{
this.pipeId = pipeId;
......
......@@ -53,7 +53,12 @@ public class TPipeTask extends BaseEntity
private String finishRate;
/**计划执行日期*/
private List<Date> planExecuteDate;
private Date planExecuteDate;
/** 执行次数 */
private Integer planExecuteNum;
public String getBegindata() {
return begindata;
......@@ -140,14 +145,22 @@ public class TPipeTask extends BaseEntity
this.finishRate = finishRate;
}
public List<Date> getPlanExecuteDate() {
public Date getPlanExecuteDate() {
return planExecuteDate;
}
public void setPlanExecuteDate(List<Date> planExecuteDate) {
public void setPlanExecuteDate(Date planExecuteDate) {
this.planExecuteDate = planExecuteDate;
}
public Integer getPlanExecuteNum() {
return planExecuteNum;
}
public void setPlanExecuteNum(Integer planExecuteNum) {
this.planExecuteNum = planExecuteNum;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
package com.zehong.system.service.impl;
import cn.hutool.core.date.DateUtil;
import com.zehong.common.exception.CustomException;
import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.TPipePoint;
......@@ -76,8 +77,10 @@ public class TPipeTaskServiceImpl implements ITPipeTaskService
@Override
@Transactional(rollbackFor = Exception.class)
public int insertTPipeTask(TPipeTask tPipeTask){
if("0".equals(tPipeTask.getPipeTaskType())){
if("1".equals(tPipeTask.getPipeTaskType())){
return addHeightTask(tPipeTask);
}else if("30".equals(tPipeTask.getPipeTaskType())){
return addRiskTask(tPipeTask);
}
return addCountryTask(tPipeTask);
}
......@@ -88,11 +91,12 @@ public class TPipeTaskServiceImpl implements ITPipeTaskService
* @return
*/
private int addHeightTask(TPipeTask tPipeTask){
LocalDate startDate = LocalDate.parse(DateUtils.dateTime(tPipeTask.getPlanExecuteDate().get(0)));
LocalDate endDate = LocalDate.parse(DateUtils.dateTime(tPipeTask.getPlanExecuteDate().get(1)));
long numOfDays = ChronoUnit.DAYS.between(startDate, endDate) + 1;
// LocalDate startDate = LocalDate.parse(DateUtils.dateTime(tPipeTask.getPlanExecuteDate().get(0)));
// LocalDate endDate = LocalDate.parse(DateUtils.dateTime(tPipeTask.getPlanExecuteDate().get(1)));
LocalDate startDate = LocalDate.parse(DateUtils.dateTime(tPipeTask.getPlanExecuteDate()));
//long numOfDays = ChronoUnit.DAYS.between(startDate, endDate) + 1;
int num = 0;
for (int i = 0; i < numOfDays; i++) {
for (int i = 0; i < tPipeTask.getPlanExecuteNum(); i++) {
LocalDate currentDate = startDate.plusDays(i);
//String format = currentDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
tPipeTask.setCreateTime(DateUtils.getNowDate());
......@@ -118,14 +122,43 @@ public class TPipeTaskServiceImpl implements ITPipeTaskService
* @return
*/
private int addCountryTask(TPipeTask tPipeTask){
tPipeTask.setPushTime(tPipeTask.getPlanExecuteDate().get(0));
tPipeTask.setTaskEndTime(tPipeTask.getPlanExecuteDate().get(1));
tPipeTask.setCreateTime(DateUtils.getNowDate());
int i = tPipeTaskMapper.insertTPipeTask(tPipeTask);
List<TPipePoint> pointList = tPipePointMapper.selectAllpoint(tPipeTask.getPipeTaskType());
if(CollectionUtils.isEmpty(pointList)) throw new CustomException("未设置管线、打卡点或管线未分配人员");
tPipeTaskInspectMapper.inserts(pointList,tPipeTask.getId(),tPipeTask.getCreateTime());
return i;
int num = 0;
int stageNum = Integer.parseInt(tPipeTask.getPipeTaskType());
for (int i = 0; i < tPipeTask.getPlanExecuteNum(); i++) {
tPipeTask.setPushTime(DateUtils.addDays(tPipeTask.getPlanExecuteDate(),stageNum * i));
tPipeTask.setTaskEndTime(DateUtil.parse(DateUtil.format(DateUtils.addDays(tPipeTask.getPlanExecuteDate(),(i > 0 ? stageNum : stageNum-1) * (i + 1)), "yyyy-MM-dd 23:59:59")));
tPipeTask.setCreateTime(DateUtils.getNowDate());
tPipeTaskMapper.insertTPipeTask(tPipeTask);
List<TPipePoint> pointList = tPipePointMapper.selectAllpoint(tPipeTask.getPipeTaskType());
if(CollectionUtils.isEmpty(pointList)) throw new CustomException("未设置管线、打卡点或管线未分配人员");
tPipeTaskInspectMapper.inserts(pointList,tPipeTask.getId(),tPipeTask.getCreateTime());
num++;
}
return num;
}
/**
* 新增风险管线任务
* @param tPipeTask 任务实体
* @return
*/
private int addRiskTask(TPipeTask tPipeTask){
int num = 0;
for (int i = 0; i < tPipeTask.getPlanExecuteNum(); i++) {
tPipeTask.setPushTime(DateUtils.addMonths(tPipeTask.getPlanExecuteDate(),i));
Date end = DateUtils.addMonths(tPipeTask.getPlanExecuteDate(),i+1);
tPipeTask.setTaskEndTime(DateUtil.parse(DateUtil.format(DateUtils.addDays(end,-1), "yyyy-MM-dd 23:59:59")));
tPipeTask.setCreateTime(DateUtils.getNowDate());
tPipeTaskMapper.insertTPipeTask(tPipeTask);
List<TPipePoint> pointList = tPipePointMapper.selectAllpoint(tPipeTask.getPipeTaskType());
if(CollectionUtils.isEmpty(pointList)) throw new CustomException("未设置管线、打卡点或管线未分配人员");
tPipeTaskInspectMapper.inserts(pointList,tPipeTask.getId(),tPipeTask.getCreateTime());
num++;
}
return num;
}
/**
......
......@@ -27,6 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="isDel" column="is_del" />
<result property="remarks" column="remarks" />
<result property="pointNum" column="point_num"/>
<result property="cycleType" column="cycle_type"/>
</resultMap>
<sql id="selectTPipeInfoVo">
......@@ -52,6 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
pipe.update_time,
pipe.is_del,
pipe.remarks,
pipe.cycle_type,
(select count(1) from t_pipe_point point WHERE point.pipe_id = pipe.pipe_id) AS point_num
FROM
t_pipe_info pipe
......@@ -139,6 +141,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">update_time,</if>
<if test="isDel != null">is_del,</if>
<if test="remarks != null">remarks,</if>
<if test="cycleType!=null">cycle_type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="pipeName != null">#{pipeName},</if>
......@@ -161,6 +164,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">#{updateTime},</if>
<if test="isDel != null">#{isDel},</if>
<if test="remarks != null">#{remarks},</if>
<if test="cycleType!=null">#{cycleType},</if>
</trim>
</insert>
......@@ -187,6 +191,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="remarks != null">remarks = #{remarks},</if>
<if test="cycleType!=null">cycle_type = #{cycleType},</if>
</trim>
where pipe_id = #{pipeId}
</update>
......
......@@ -56,7 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN sys_user sysUs ON sysUs.user_id = u.user_id
<where>
u.user_id is not NULL AND sysUs.status = '0'
<if test="pipeType != null and pipeType != ''">and pipe.pipe_type = #{pipeType}</if>
<if test="pipeType != null and pipeType != ''">and pipe.cycle_type = #{pipeType}</if>
</where>
</select>
<select id="selectTPipePointById" parameterType="Long" resultMap="TPipePointResult">
......@@ -132,7 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN sys_user sysUs ON sysUs.user_id = us.user_id
<where>
sysUs.user_id IS NOT NULL AND sysUs.status = '0'
<if test="pipeType != null and pipeType != ''">and pipe.pipe_type = #{pipeType}</if>
<if test="pipeType != null and pipeType != ''">and pipe.cycle_type = #{pipeType}</if>
</where>
</select>
</mapper>
\ No newline at end of file
......@@ -154,24 +154,33 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="管道长度(m)" prop="pipeLength">
<el-input v-model="form.pipeLength" placeholder="请输入管道长度"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="巡检频率" prop="cycleType">
<el-select style="width: 100%" v-model="form.cycleType" placeholder="请选择巡检频率">
<el-option
v-for="dict in cycleTypeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="管径(mm)" prop="pipeDiameter">
<el-input v-model="form.pipeDiameter" placeholder="请输入管径"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="管道壁厚(mm)" prop="pipeThickness">
<el-input v-model="form.pipeThickness" placeholder="请输入管道壁厚"/>
......@@ -184,9 +193,7 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="材质" prop="pipeMaterial">
<el-select v-model="form.pipeMaterial" palceholder="请选择材质" style="width: 100%" >
......@@ -205,9 +212,7 @@
<el-input v-model="form.pipeAddr" placeholder="请输入管道地址" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="敷设方式" prop="layType">
<el-select v-model="form.layType" placeholder="请选择敷设方式" style="width: 100%" >
......@@ -227,9 +232,7 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="架空高度(m)" prop="overhead">
<el-input v-model="form.overhead" placeholder="请输入架空高度" type="number"/>
......@@ -343,6 +346,9 @@ export default {
pipeType: [
{ required: true, message: "请选择管线类型", trigger: "change" },
],
cycleType: [
{ required: true, message: "请选择巡检频率", trigger: "change" },
],
pipeLength: [
{ required: true, message: "管道长度不能为空", trigger: "blur" },
],
......@@ -366,6 +372,7 @@ export default {
referPointData: [],
referMarkerList: [],
pipeTypeOptions: [],
cycleTypeOptions:[],
deviceType:{
1 : "调压箱",
2 : "阀门井",
......@@ -392,6 +399,9 @@ export default {
this.getLayType();
this.getList();
this.getPipeType();
this.getDicts("t_cycle_type").then(response => {
this.cycleTypeOptions = response.data;
});
},
methods: {
/** 查询管道信息列表 */
......@@ -414,6 +424,7 @@ export default {
pipeId: null,
pipeName: null,
pipeType: null,
cycleType:null,
pipeLength: null,
pipeDiameter: null,
pipeThickness: null,
......
......@@ -182,7 +182,7 @@
<el-form-item label="归档人">
<span v-if="dangerDetailInfo.fileName">{{
dangerDetailInfo.fileName
}}</span>
}}</span>6
<span v-else>-</span>
</el-form-item>
</el-col>
......
......@@ -48,7 +48,7 @@
created(){
console.log("-----------------------------")
this.$parent.$parent.$parent.queryParams.pageNum = 1;
this.$parent.$parent.$parent.queryParams.pipeTaskType = 0;
//this.$parent.$parent.$parent.queryParams.pipeTaskType = 0;
this.$parent.$parent.$parent.getList();
}
}
......
......@@ -39,7 +39,8 @@
},
methods: {
getPointDetail(pipeType){
selectPointDetail({pipeType:pipeType}).then(res =>{
console.log(pipeType)
selectPointDetail({pipeType:pipeType.toString()}).then(res =>{
if(res.code == 200){
this.pointDetailList = res.data;
}
......
......@@ -82,12 +82,16 @@
</el-row>
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="中高压管线任务" name="height">
<HeightTaskTable v-if="activeName == 'height'"/>
</el-tab-pane>
<el-tab-pane label="村内管线任务" name="country">
<CountryTaskTable v-if="activeName == 'country'"/>
<el-tab-pane v-for="item in pipeTaskTypeOptions " :label="item.dictLabel" :name="item.remark">
<HeightTaskTable v-if="activeName == item.remark"/>
</el-tab-pane>
<!--<el-tab-pane label="中高压管线任务" name="height">-->
<!--<HeightTaskTable v-if="activeName == 'height'"/>-->
<!--</el-tab-pane>-->
<!--<el-tab-pane label="村内管线任务" name="country">-->
<!--<CountryTaskTable v-if="activeName == 'country'"/>-->
<!--</el-tab-pane>-->
</el-tabs>
......@@ -120,16 +124,20 @@
</el-col>
<el-col :span="12">
<el-form-item label="执行日期" prop="planExecuteDate">
<el-form-item label="开始日期" prop="planExecuteDate">
<el-date-picker clearable size="small"
v-model="form.planExecuteDate"
type="daterange"
range-separator="至"
type="date"
:picker-options="pickerOptions"
placeholder="选择发布日期">
placeholder="选择开始日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="执行次数" prop="planExecuteNum">
<el-input v-model="form.planExecuteNum" placeholder="请输入执行次数" type="number" :min="1" :max="10" @input="handleInput"/>
</el-form-item>
</el-col>
</el-row>
<PointDetailInfo
......@@ -235,15 +243,18 @@ export default {
planExecuteDate: [
{ required: true, message: "请选择执行日期", trigger: "change" },
],
planExecuteNum: [
{ required: true, message: "执行次数不能空", trigger: "change" },
],
},
activeName: "height",
activeName:"day",
pipeTaskTypeOptions: [],
pipeType: "0"
pipeType: "1"
};
},
created() {
//this.getList();
this.getDicts("t_pipe_task_type").then(response => {
this.getDicts("t_cycle_type").then(response => {
this.pipeTaskTypeOptions = response.data;
});
},
......@@ -259,6 +270,7 @@ export default {
this.queryParams.enddata = null;
}
this.loading = true;
this.queryParams.pipeTaskType = this.pipeType;
console.log(this.queryParams)
listTask(this.queryParams).then(response => {
this.taskList = response.rows;
......@@ -280,7 +292,8 @@ export default {
pushTime: null,
adminId: null,
createTime: null,
planExecuteDate: null
planExecuteDate: null,
planExecuteNum:null
};
this.resetForm("form");
},
......@@ -377,11 +390,15 @@ export default {
},
handleClick(tab,event){
this.activeName = tab.name;
if('height' == tab.name){
this.pipeType = '0';
}
if('country' == tab.name){
this.pipeType = '1';
var model = this.pipeTaskTypeOptions.find(item => item.remark == tab.name);
this.pipeType = model.dictValue;
},
handleInput(value) {
// 实时限制输入范围
if (value < 0) {
this.form.planExecuteNum = 1
} else if (value > 10) {
this.form.planExecuteNum = 10
}
},
pipeTaskTypeChange(val){
......
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