Merge branch 'feature_day_1102' into 'main'
工作许可申请提交工作流管理 See merge request likehai/ytr-god!23
This commit is contained in:
commit
39fbc9ccec
@ -101,4 +101,14 @@ public class QyzyPermitReportController extends BaseController
|
||||
{
|
||||
return toAjax(qyzyPermitReportService.deleteQyzyPermitReportByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交流程
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/subProcess/{id}")
|
||||
public AjaxResult subProcess(@PathVariable("id") String id){
|
||||
return toAjax(qyzyPermitReportService.subProcess(id));
|
||||
}
|
||||
}
|
||||
|
@ -22,6 +22,10 @@
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.god</groupId>
|
||||
<artifactId>god-system</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
@ -0,0 +1,41 @@
|
||||
package com.god.passenger.operation.listener;
|
||||
|
||||
import com.god.common.utils.DateUtils;
|
||||
import com.god.common.utils.ip.AddressUtils;
|
||||
import com.god.common.utils.spring.SpringUtils;
|
||||
import com.god.passenger.operation.service.IQyzyPermitReportService;
|
||||
import org.flowable.engine.delegate.TaskListener;
|
||||
import org.flowable.engine.impl.el.FixedValue;
|
||||
import org.flowable.task.service.delegate.DelegateTask;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 工作许可申请监听
|
||||
*
|
||||
* @author wangyan21
|
||||
* @date 2023年11月2号
|
||||
*
|
||||
*/
|
||||
@Component("workPermitApplyListener")
|
||||
public class WorkPermitApplyListener implements TaskListener {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(WorkPermitApplyListener.class);
|
||||
|
||||
public FixedValue state;
|
||||
public FixedValue getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(FixedValue state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notify(DelegateTask delegateTask) {
|
||||
String processInstanceId = delegateTask.getProcessInstanceId();
|
||||
IQyzyPermitReportService qyzyPermitReportService= SpringUtils.getBean("qyzyPermitReportService");
|
||||
qyzyPermitReportService.updateState(processInstanceId,getState().getExpressionText());
|
||||
LOGGER.info("-->>工作许可审批时间:{},--->>审批状态:{}", DateUtils.dateTimeNow(),getState().toString());
|
||||
}
|
||||
}
|
@ -3,6 +3,7 @@ package com.god.passenger.operation.mapper;
|
||||
import java.util.List;
|
||||
|
||||
import com.god.passenger.operation.domain.QyzyPermitReport;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 工作许可报备Mapper接口
|
||||
@ -58,4 +59,12 @@ public interface QyzyPermitReportMapper {
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQyzyPermitReportByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 更新单据状态
|
||||
* @param id
|
||||
* @param eventType
|
||||
* @return
|
||||
*/
|
||||
public int updateState(@Param("id") String id, @Param("eventType") String eventType);
|
||||
}
|
||||
|
@ -58,4 +58,21 @@ public interface IQyzyPermitReportService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQyzyPermitReportById(String id);
|
||||
|
||||
/**
|
||||
* 提交流程
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public int subProcess(String id);
|
||||
|
||||
/**
|
||||
* 更新单据状态
|
||||
*
|
||||
* @param id
|
||||
* @param state
|
||||
* @return
|
||||
*/
|
||||
public int updateState(String id, String state);
|
||||
}
|
||||
|
@ -1,26 +1,41 @@
|
||||
package com.god.passenger.operation.service.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.god.common.utils.DateUtils;
|
||||
import com.god.common.utils.SecurityUtils;
|
||||
import com.god.common.utils.StringUtils;
|
||||
import com.god.common.utils.uuid.IdUtils;
|
||||
import com.god.passenger.operation.listener.WorkPermitApplyListener;
|
||||
import org.flowable.engine.IdentityService;
|
||||
import org.flowable.engine.RuntimeService;
|
||||
import org.flowable.engine.runtime.ProcessInstance;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.god.passenger.operation.mapper.QyzyPermitReportMapper;
|
||||
import com.god.passenger.operation.domain.QyzyPermitReport;
|
||||
import com.god.passenger.operation.service.IQyzyPermitReportService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 工作许可报备Service业务层处理
|
||||
*
|
||||
* @author wangyan
|
||||
* @date 2023-10-30
|
||||
*/
|
||||
@Service
|
||||
@Service("qyzyPermitReportService")
|
||||
public class QyzyPermitReportServiceImpl implements IQyzyPermitReportService {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(QyzyPermitReportServiceImpl.class);
|
||||
@Autowired
|
||||
private QyzyPermitReportMapper qyzyPermitReportMapper;
|
||||
@Resource
|
||||
private RuntimeService runtimeService;
|
||||
@Resource
|
||||
IdentityService identityService;
|
||||
|
||||
/**
|
||||
* 查询工作许可报备
|
||||
@ -91,4 +106,33 @@ public class QyzyPermitReportServiceImpl implements IQyzyPermitReportService {
|
||||
public int deleteQyzyPermitReportById(String id) {
|
||||
return qyzyPermitReportMapper.deleteQyzyPermitReportById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交流程
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public int subProcess(String id) {
|
||||
Long userId = SecurityUtils.getLoginUser().getUserId();
|
||||
identityService.setAuthenticatedUserId(String.valueOf(userId));
|
||||
HashMap<String, Object> variables = new HashMap<>();
|
||||
variables.put("INITIATOR", String.valueOf(userId));//设置流程发起人
|
||||
runtimeService.startProcessInstanceByKey("work_permit_apply_two", String.valueOf(id), variables);
|
||||
QyzyPermitReport qyzyPermitReport = qyzyPermitReportMapper.selectQyzyPermitReportById(id);
|
||||
qyzyPermitReport.setEventType("待审批");
|
||||
return qyzyPermitReportMapper.updateQyzyPermitReport(qyzyPermitReport);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新单据状态
|
||||
*
|
||||
* @param instanceId
|
||||
* @param state
|
||||
* @return
|
||||
*/
|
||||
public int updateState(String instanceId, String state) {
|
||||
ProcessInstance process = runtimeService.createProcessInstanceQuery().processInstanceId(instanceId).singleResult();
|
||||
return qyzyPermitReportMapper.updateState(process.getBusinessKey(), state);
|
||||
}
|
||||
}
|
||||
|
@ -126,4 +126,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="updateState" parameterType="String">
|
||||
update qyzy_permit_report
|
||||
set event_type = #{eventType}
|
||||
where id = #{id}
|
||||
</update>
|
||||
</mapper>
|
@ -42,3 +42,10 @@ export function delReport(id) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function subProcess(id){
|
||||
return request({
|
||||
url: '/permit/report/subProcess/'+id,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
274
god-ui/src/views/operation/application/detail.vue
Normal file
274
god-ui/src/views/operation/application/detail.vue
Normal file
@ -0,0 +1,274 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 添加或修改工作许可报备对话框 -->
|
||||
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="作业名称" prop="workName">
|
||||
<el-input v-model="form.workName" placeholder="请输入作业名称" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="申请人" prop="applyName">
|
||||
<el-input v-model="form.applyName" placeholder="请输入申请人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="部门" prop="applyDept">
|
||||
<el-input v-model="form.applyDept" placeholder="请输入部门" />
|
||||
</el-form-item>
|
||||
<el-form-item label="电话" prop="phoneInfo">
|
||||
<el-input v-model="form.phoneInfo" placeholder="请输入申请人电话" />
|
||||
</el-form-item>
|
||||
<el-form-item label="申请日期" prop="applyTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.applyTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择申请日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="作业内容" prop="workContent">
|
||||
<el-input v-model="form.workContent" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm" v-if="showBtn">确 定</el-button>
|
||||
<!-- <el-button @click="cancel">取 消</el-button>-->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listReport, getReport, delReport, addReport, updateReport } from "@/api/operation/report";
|
||||
|
||||
export default {
|
||||
//工作许可申请
|
||||
name: "WorkApplicationDetail",
|
||||
props: {
|
||||
businessInfo: {
|
||||
type: Object,
|
||||
default: null
|
||||
},
|
||||
doapproved: {
|
||||
type: Function,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
businessInfo: {
|
||||
deep: true,
|
||||
handler(value) {
|
||||
console.log("-->>查看监听内容:",value);
|
||||
this.businessId = value.bussinesskey
|
||||
this.operType = value.operType
|
||||
if ('detail' === this.operType) {
|
||||
this.disabled = true
|
||||
this.showBtn = false
|
||||
this.edit = true
|
||||
} else if ('edit' === this.operType) {
|
||||
this.disabled = true
|
||||
this.showBtn = false
|
||||
this.edit = false
|
||||
} else {
|
||||
this.disabled = false
|
||||
this.showBtn = true
|
||||
this.edit = true
|
||||
}
|
||||
//获取表单详情
|
||||
this.getdetail();
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
dicts: ['qyzy_event_type','qyzy_apply_status'],
|
||||
data() {
|
||||
return {
|
||||
value: [],
|
||||
managementIndex: [],
|
||||
options: [
|
||||
{
|
||||
value: '',
|
||||
label: ''
|
||||
}],
|
||||
businessId: '',
|
||||
operType: '',
|
||||
disabled: false,
|
||||
showBtn: false,
|
||||
deit: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 工作许可报备表格数据
|
||||
reportList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 安全措施时间范围
|
||||
daterangeApplyTime: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
applyName: null,
|
||||
applyDept: null,
|
||||
phoneInfo: null,
|
||||
applyTime: null,
|
||||
applyReason: null,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
workContent: null,
|
||||
eventType: null,
|
||||
dataType: "工作许可申请",
|
||||
applyEvent: null,
|
||||
workName: null,
|
||||
hazardInfo: null,
|
||||
safetyInfo: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
//获取详情信息
|
||||
getdetail() {
|
||||
this.reset()
|
||||
if (this.businessId !== '' && this.businessId != null) {
|
||||
getReport(this.businessId).then(response => {
|
||||
this.form = response.data
|
||||
})
|
||||
}
|
||||
},
|
||||
/** 查询工作许可申请列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.queryParams.params = {};
|
||||
if (null != this.daterangeApplyTime && '' != this.daterangeApplyTime) {
|
||||
this.queryParams.params["beginApplyTime"] = this.daterangeApplyTime[0];
|
||||
this.queryParams.params["endApplyTime"] = this.daterangeApplyTime[1];
|
||||
}
|
||||
listReport(this.queryParams).then(response => {
|
||||
this.reportList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.reset();
|
||||
this.$emit('close');
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
applyName: null,
|
||||
applyDept: null,
|
||||
phoneInfo: null,
|
||||
applyTime: null,
|
||||
applyReason: null,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
workContent: null,
|
||||
eventType: null,
|
||||
dataType: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
applyEvent: null,
|
||||
workName: null,
|
||||
hazardInfo: null,
|
||||
safetyInfo: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.daterangeApplyTime = [];
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getReport(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改工作许可申请";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
// console.log("-->>业务ID:",this.businessId);
|
||||
if (this.doapproved) {
|
||||
this.doapproved()
|
||||
}
|
||||
|
||||
// this.$refs["form"].validate(valid => {
|
||||
// if (valid) {
|
||||
// if (this.form.id != null) {
|
||||
// updateReport(this.form).then(response => {
|
||||
// this.$modal.msgSuccess("修改成功");
|
||||
// this.open = false;
|
||||
// this.getList();
|
||||
// });
|
||||
// } else {
|
||||
// addReport(this.form).then(response => {
|
||||
// this.$modal.msgSuccess("新增成功");
|
||||
// this.open = false;
|
||||
// this.getList();
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除工作许可申请编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delReport(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/report/export', {
|
||||
...this.queryParams
|
||||
}, `report_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -159,6 +159,13 @@
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:report:remove']"
|
||||
>删除</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-user"
|
||||
@click="handleSub(scope.row)"
|
||||
>提交审批
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -251,11 +258,16 @@
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog >
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listReport, getReport, delReport, addReport, updateReport } from "@/api/operation/report";
|
||||
import { listReport, getReport, delReport, addReport, updateReport ,subProcess} from "@/api/operation/report";
|
||||
|
||||
|
||||
export default {
|
||||
//工作许可申请
|
||||
@ -313,6 +325,20 @@ export default {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
//提交工作流审批
|
||||
handleSub(row) {
|
||||
this.loading = true
|
||||
subProcess(row.id).then((response) => {
|
||||
this.$modal.msgSuccess(response.msg)
|
||||
this.getList()
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
//关闭修改、详情页
|
||||
coloseDetail() {
|
||||
this.open = false
|
||||
this.getList()
|
||||
},
|
||||
/** 查询工作许可申请列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
|
Loading…
Reference in New Issue
Block a user