优化项目
This commit is contained in:
parent
d039e9b6a8
commit
762526edbd
|
@ -2,6 +2,11 @@ package com.snow.web.controller.common;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.fasterxml.uuid.impl.UUIDUtil;
|
||||
import com.snow.common.utils.uuid.IdUtils;
|
||||
import com.snow.common.utils.uuid.UUID;
|
||||
import org.apache.logging.log4j.core.util.UuidUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -80,6 +85,7 @@ public class CommonController
|
|||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("fileKey",IdUtils.fastUUID());
|
||||
ajax.put("fileName", fileName);
|
||||
ajax.put("url", url);
|
||||
return ajax;
|
||||
|
|
|
@ -54,26 +54,30 @@ public class FlowController extends BaseController {
|
|||
* 跳转完成任务界面
|
||||
* @return
|
||||
*/
|
||||
//@RequiresPermissions("modeler:flow:view")
|
||||
@GetMapping("/toFinishTask")
|
||||
public String toFinishTask(String businessKey,String taskId,ModelMap mmap)
|
||||
public String toFinishTask(String taskId,ModelMap mmap)
|
||||
{
|
||||
Task task = flowableService.getTask(taskId);
|
||||
HistoricProcessInstance historicProcessInstance= flowableService.getHistoricProcessInstanceById(task.getProcessInstanceId());
|
||||
String processDefinitionKey = historicProcessInstance.getProcessDefinitionKey();
|
||||
if(processDefinitionKey.equals("snow_oa_leave")){
|
||||
SysOaLeave sysOaLeave=new SysOaLeave();
|
||||
sysOaLeave.setLeaveNo(businessKey);
|
||||
List<SysOaLeave> sysOaLeaves = sysOaLeaveService.selectSysOaLeaveList(sysOaLeave);
|
||||
if(StringUtils.isEmpty(sysOaLeaves)){
|
||||
throw new BusinessException("跳转请假申请页面异常");
|
||||
}
|
||||
mmap.put("sysOaLeave", sysOaLeaves.get(0));
|
||||
mmap.put("taskId", taskId);
|
||||
}
|
||||
//获取业务参数
|
||||
AppForm appFrom = appFormService.getAppFrom(task.getProcessInstanceId());
|
||||
mmap.put("appFrom", appFrom);
|
||||
mmap.put("taskId", taskId);
|
||||
return task.getFormKey();
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成任务
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/finishTask")
|
||||
@ResponseBody
|
||||
public AjaxResult finishTask(CompleteTaskDTO completeTaskDTO)
|
||||
{
|
||||
SysUser sysUser = ShiroUtils.getSysUser();
|
||||
completeTaskDTO.setUserId(String.valueOf(sysUser.getUserId()));
|
||||
flowableService.completeTask(completeTaskDTO);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
/**
|
||||
* 获取所有节点
|
||||
* @param processInstanceId
|
||||
|
|
|
@ -7,18 +7,23 @@ import java.util.List;
|
|||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.ExcelReader;
|
||||
import com.alibaba.excel.read.metadata.ReadSheet;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.snow.common.constant.SequenceContants;
|
||||
import com.snow.common.utils.poi.EasyExcelUtil;
|
||||
import com.snow.flowable.domain.leave.SysOaLeaveForm;
|
||||
import com.snow.flowable.domain.purchaseOrder.PurchaseOrderForm;
|
||||
import com.snow.flowable.service.FlowableService;
|
||||
import com.snow.framework.excel.FinanceAlipayFlowListener;
|
||||
import com.snow.framework.excel.PurchaseOrderListener;
|
||||
import com.snow.framework.util.ShiroUtils;
|
||||
import com.snow.system.domain.FinanceAlipayFlowImport;
|
||||
import com.snow.system.domain.PurchaseOrderImport;
|
||||
import com.snow.system.domain.SysUser;
|
||||
import com.snow.system.domain.*;
|
||||
import com.snow.system.service.ISysSequenceService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.flowable.engine.runtime.ProcessInstance;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
|
@ -28,7 +33,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||
import com.snow.common.annotation.Log;
|
||||
import com.snow.common.enums.BusinessType;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import com.snow.system.domain.PurchaseOrderMain;
|
||||
import com.snow.system.service.IPurchaseOrderMainService;
|
||||
import com.snow.common.core.controller.BaseController;
|
||||
import com.snow.common.core.domain.AjaxResult;
|
||||
|
@ -52,6 +56,8 @@ public class PurchaseOrderController extends BaseController
|
|||
|
||||
@Autowired
|
||||
private IPurchaseOrderMainService purchaseOrderMainService;
|
||||
@Autowired
|
||||
private FlowableService flowableService;
|
||||
|
||||
@Autowired
|
||||
private ISysSequenceService sequenceService;
|
||||
|
@ -174,17 +180,31 @@ public class PurchaseOrderController extends BaseController
|
|||
}
|
||||
|
||||
/**
|
||||
* 修改保存采购单主表
|
||||
* 修改保存采购单并发起申请
|
||||
*/
|
||||
@RequiresPermissions("system:purchaseOrder:edit")
|
||||
@Log(title = "采购单主表", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
@Transactional
|
||||
public AjaxResult editSave(PurchaseOrderMain purchaseOrderMain)
|
||||
{
|
||||
SysUser sysUser = ShiroUtils.getSysUser();
|
||||
purchaseOrderMain.setUpdateBy(String.valueOf(sysUser.getUserId()));
|
||||
return toAjax(purchaseOrderMainService.updatePurchaseOrderMain(purchaseOrderMain));
|
||||
int i = purchaseOrderMainService.updatePurchaseOrderMain(purchaseOrderMain);
|
||||
PurchaseOrderMain newPurchaseOrderMain = purchaseOrderMainService.selectPurchaseOrderMainById(purchaseOrderMain.getId());
|
||||
//发起审批
|
||||
PurchaseOrderForm purchaseOrderForm=new PurchaseOrderForm();
|
||||
BeanUtils.copyProperties(newPurchaseOrderMain,purchaseOrderForm);
|
||||
purchaseOrderForm.setBusinessKey(purchaseOrderMain.getOrderNo());
|
||||
purchaseOrderForm.setStartUserId(String.valueOf(sysUser.getUserId()));
|
||||
purchaseOrderForm.setBusVarJson(JSON.toJSONString(purchaseOrderForm));
|
||||
purchaseOrderForm.setClassPackName(PurchaseOrderForm.class.getCanonicalName());
|
||||
purchaseOrderForm.setBusVarUrl("/system/purchaseOrder/detail");
|
||||
ProcessInstance processInstance = flowableService.startProcessInstanceByAppForm(purchaseOrderForm);
|
||||
//推进任务节点
|
||||
flowableService.automaticTask(processInstance.getProcessInstanceId());
|
||||
return toAjax(i);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -50,6 +50,8 @@
|
|||
doc.write("<link type='text/css' rel='stylesheet' href='" + $(this).attr("href") + "' />");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (opt.printContainer) { doc.write($element.outer()); }
|
||||
|
|
|
@ -161,22 +161,21 @@
|
|||
title: 'taskId',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'processDefinitionName',
|
||||
title: '流程名称'
|
||||
},
|
||||
{
|
||||
field: 'businessKey',
|
||||
title: '单号'
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
field: 'taskName',
|
||||
title: '审批节点'
|
||||
|
||||
},
|
||||
|
||||
/* {
|
||||
field: 'name',
|
||||
title: '任务名称'
|
||||
},*/
|
||||
|
||||
{
|
||||
field: 'startUserName',
|
||||
title: '流程发起人'
|
||||
|
@ -195,7 +194,7 @@
|
|||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="cancelTask(\'' + row.businessKey + '\',\''+row.taskId+'\')"><i class="fa fa-edit"></i>处理</a> ');
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="cancelTask(\''+row.taskId+'\')"><i class="fa fa-edit"></i>处理</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="getProcessDiagram(\'' + row.processInstanceId + '\')"><i class="fa fa-eye"></i>流程图</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
|
@ -204,9 +203,9 @@
|
|||
$.table.init(options);
|
||||
});
|
||||
|
||||
function cancelTask(businessKey,taskId) {
|
||||
function cancelTask(taskId) {
|
||||
console.log(JSON.stringify(taskId));
|
||||
var preViewUrl=prefixFlow+'/toFinishTask?businessKey='+businessKey+'&taskId='+taskId;
|
||||
var preViewUrl=prefixFlow+'/toFinishTask?taskId='+taskId;
|
||||
$.modal.openTab("审批", preViewUrl);
|
||||
}
|
||||
function getProcessDiagram(processInstanceId) {
|
||||
|
|
|
@ -17,16 +17,16 @@
|
|||
</div>
|
||||
<br/>
|
||||
<input class="form-control" type="hidden" name="taskId" th:value="*{taskId}"/>
|
||||
<input class="form-control" type="hidden" name="businessKey" th:value="${sysOaLeave.leaveNo}"/>
|
||||
<input class="form-control" type="hidden" name="businessKey" th:value="${appFrom.leaveNo}"/>
|
||||
<h4 class="form-header h4">请假信息</h4>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">单号:</label>
|
||||
<div class="form-control-static" th:text="${sysOaLeave.leaveNo}">
|
||||
<div class="form-control-static" th:text="${appFrom.leaveNo}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">标题:</label>
|
||||
<div class="form-control-static" th:text="${sysOaLeave.name}">
|
||||
<div class="form-control-static" th:text="${appFrom.name}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
@ -35,17 +35,17 @@
|
|||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">开始时间:</label>
|
||||
<div class="form-control-static" th:text="${#dates.format(sysOaLeave.startTime, 'yyyy-MM-dd hh:mm:ss')}">
|
||||
<div class="form-control-static" th:text="${#dates.format(appFrom.startTime, 'yyyy-MM-dd hh:mm:ss')}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">结束时间:</label>
|
||||
<div class="form-control-static" th:text="${#dates.format(sysOaLeave.endTime, 'yyyy-MM-dd HH:mm:ss')}">
|
||||
<div class="form-control-static" th:text="${#dates.format(appFrom.endTime, 'yyyy-MM-dd HH:mm:ss')}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">申请人:</label>
|
||||
<div class="form-control-static" th:text="${sysOaLeave.applyPerson}">
|
||||
<div class="form-control-static" th:text="${appFrom.applyPerson}">
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="form-header h4">填写信息</h4>
|
||||
|
@ -72,7 +72,7 @@
|
|||
<th:block th:include="include :: bootstrap-fileinput-js"/>
|
||||
<script th:inline="javascript">
|
||||
$(function() {
|
||||
var reason = [[${sysOaLeave.reason}]];
|
||||
var reason = [[${appFrom.reason}]];
|
||||
console.log(reason);
|
||||
if ($.common.isNotEmpty(reason) && reason.length < 2000) {
|
||||
$("#reason").text(reason);
|
||||
|
|
|
@ -20,12 +20,12 @@
|
|||
<h4 class="form-header h4">请假信息</h4>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">单号:</label>
|
||||
<div class="form-control-static" th:text="${sysOaLeave.leaveNo}">
|
||||
<div class="form-control-static" th:text="${appFrom.leaveNo}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">标题:</label>
|
||||
<div class="form-control-static" th:text="${sysOaLeave.name}">
|
||||
<div class="form-control-static" th:text="${appFrom.name}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
@ -34,17 +34,17 @@
|
|||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">开始时间:</label>
|
||||
<div class="form-control-static" th:text="${#dates.format(sysOaLeave.startTime, 'yyyy-MM-dd hh:mm:ss')}">
|
||||
<div class="form-control-static" th:text="${#dates.format(appFrom.startTime, 'yyyy-MM-dd hh:mm:ss')}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">结束时间:</label>
|
||||
<div class="form-control-static" th:text="${#dates.format(sysOaLeave.endTime, 'yyyy-MM-dd HH:mm:ss')}">
|
||||
<div class="form-control-static" th:text="${#dates.format(appFrom.endTime, 'yyyy-MM-dd HH:mm:ss')}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">申请人:</label>
|
||||
<div class="form-control-static" th:text="${sysOaLeave.applyPerson}">
|
||||
<div class="form-control-static" th:text="${appFrom.applyPerson}">
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="form-header h4">填写信息</h4>
|
||||
|
@ -72,7 +72,7 @@
|
|||
<th:block th:include="include :: bootstrap-fileinput-js"/>
|
||||
<script th:inline="javascript">
|
||||
$(function() {
|
||||
var reason = [[${sysOaLeave.reason}]];
|
||||
var reason = [[${appFrom.reason}]];
|
||||
console.log(reason);
|
||||
if ($.common.isNotEmpty(reason) && reason.length < 2000) {
|
||||
$("#reason").text(reason);
|
||||
|
|
|
@ -132,7 +132,7 @@
|
|||
align: 'center',
|
||||
title: '货物编号',
|
||||
formatter: function(value, row, index) {
|
||||
var html = $.common.sprintf("<input class='form-control' type='text' name='purchaseOrderItemList[%s].createTime' value='%s'>", index, value);
|
||||
var html = $.common.sprintf("<input class='form-control' type='text' name='purchaseOrderItemList[%s].goodsNo' value='%s'>", index, value);
|
||||
return html;
|
||||
}
|
||||
},
|
||||
|
|
|
@ -0,0 +1,207 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet" />
|
||||
<link th:href="@{/css/font-awesome.min.css}" rel="stylesheet" />
|
||||
<!-- bootstrap-table 表格插件样式 -->
|
||||
<link th:href="@{/ajax/libs/bootstrap-table/bootstrap-table.min.css}" rel="stylesheet"/>
|
||||
<link th:href="@{/css/animate.css}" rel="stylesheet" />
|
||||
<link th:href="@{/css/style.css}" rel="stylesheet" />
|
||||
<link th:href="@{/ruoyi/css/ry-ui.css}" rel="stylesheet" />
|
||||
<th:block th:include="include :: bootstrap-fileinput-css"/>
|
||||
</head>
|
||||
<body class="white-bg" >
|
||||
<form class="form-horizontal m-t" id="signupForm">
|
||||
<input class="form-control" type="hidden" name="taskId" th:value="*{taskId}"/>
|
||||
<input class="form-control" type="hidden" name="businessKey" th:value="${appFrom.orderNo}"/>
|
||||
<input name="id" th:value="${appFrom.id}" type="hidden">
|
||||
<br/>
|
||||
<h2 class="form-header h2" >采购单信息</h2>
|
||||
<div class="row">
|
||||
<div class="col-xs-4 col-sm-5 col-md-offset-1">
|
||||
<label>单号:</label>
|
||||
<span th:text="${appFrom.orderNo}"/>
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-3">
|
||||
<label>采购标题:</label>
|
||||
<span th:text="${appFrom.title}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-3 col-sm-4 col-md-offset-1">
|
||||
<label>供应商:</label>
|
||||
<span th:text="${appFrom.supplierName}"/>
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-3">
|
||||
<label >订货日期:</label>
|
||||
<span th:text="${#dates.format(appFrom.orderTime, 'yyyy-MM-dd')}"/>
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-3">
|
||||
<label>交货日期:</label>
|
||||
<span th:text="${#dates.format(appFrom.deliveryDate, 'yyyy-MM-dd')}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-3 col-sm-4 col-md-offset-1">
|
||||
<label >采购人:</label>
|
||||
<span th:text="${appFrom.belongUser}"/>
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-3">
|
||||
<label >总数量:</label>
|
||||
<span th:text="${appFrom.totalQuantity}"/>
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-3">
|
||||
<label >总金额:</label>
|
||||
<span th:text="${appFrom.totalPrice}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-10 col-sm-10 col-md-offset-1">
|
||||
<label>备注:</label>
|
||||
<span th:text="${appFrom.remark}"/>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="form-header h4">采购单明细</h4>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<h4 class="form-header h4">填写信息</h4>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">审批结果:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="radio-box" th:each="dict : ${@dict.getType('process_check_status')}">
|
||||
<input type="radio" th:id="${dict.dictCode}" name="isPass" th:value="${dict.dictValue}" required>
|
||||
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">审批意见:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="comment" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">审批附件:</label>
|
||||
<div class="col-sm-8">
|
||||
<!--<input type="hidden" name="files" >-->
|
||||
<div class="file-loading">
|
||||
<input class="form-control file-upload" id="files" name="file" type="file" multiple>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-6 col-sm-10">
|
||||
<button type="button" class="btn btn-sm btn-success" onclick="submitCheckHandler()"><i class="fa fa-check"></i>提 交</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: bootstrap-fileinput-js"/>
|
||||
<script th:inline="javascript">
|
||||
var files=new Array();
|
||||
$(".file-upload").each(function (i) {
|
||||
var val = $("input[name='" + this.id + "']").val();
|
||||
$(this).fileinput({
|
||||
'uploadUrl': '/common/upload',
|
||||
initialPreviewAsData: true,
|
||||
allowedFileExtensions: ['jpg', 'gif', 'png',".docx","doc","ppt","pptx","xls","xlsx","vsd","rtf","wps","pdf","txt"],//接收的文件后缀
|
||||
initialPreview: [val],
|
||||
maxFileCount: 1,
|
||||
autoReplace: true
|
||||
}).on('fileuploaded', function (event, data, previewId, index) {
|
||||
files.push({"key": data.response.fileKey,"name": data.response.fileName, "url":data.response.url});
|
||||
// $("input[name='" + event.currentTarget.id + "']").val(data.response.url)
|
||||
}).on('fileremoved', function (event, id, index) {
|
||||
$("input[name='" + event.currentTarget.id + "']").val('')
|
||||
})
|
||||
$(this).fileinput('_initFileActions');
|
||||
});
|
||||
|
||||
<!--提交审核结果-->
|
||||
function submitCheckHandler() {
|
||||
if ($.validate.form()) {
|
||||
var data = $("#signupForm").serializeArray();
|
||||
for(var i=0;i<data.length;i++){
|
||||
if(data[i].name=='comment'&&(data[i].value==''||data[i].value==null)){
|
||||
$.modal.alertError("请填写审批意见");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(files!=null||files!=''){
|
||||
for(var i=0;i<files.length;i++){
|
||||
data.push({"name": "files["+i+"].key", "value":files[i].key});
|
||||
data.push({"name": "files["+i+"].name", "value":files[i].name});
|
||||
data.push({"name": "files["+i+"].url", "value":files[i].url});
|
||||
}
|
||||
}
|
||||
console.log(data);
|
||||
$.operate.saveTab("/flow/finishTask", data);
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
data: [[${appFrom.purchaseOrderItemList}]],
|
||||
pagination: false,
|
||||
showSearch: false,
|
||||
showRefresh: false,
|
||||
showToggle: false,
|
||||
showColumns: false,
|
||||
sidePagination: "client",
|
||||
columns: [
|
||||
{
|
||||
field: 'index',
|
||||
align: 'center',
|
||||
title: "序号",
|
||||
formatter: function (value, row, index) {
|
||||
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
|
||||
return columnIndex + $.table.serialNumber(index);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'goodsNo',
|
||||
align: 'center',
|
||||
title: '货物编号'
|
||||
},
|
||||
{
|
||||
field: 'goodsName',
|
||||
align: 'center',
|
||||
title: '名称'
|
||||
},
|
||||
{
|
||||
field: 'goodsSize',
|
||||
align: 'center',
|
||||
title: '规格'
|
||||
},
|
||||
{
|
||||
field: 'goodsQuantity',
|
||||
align: 'center',
|
||||
title: '数量'
|
||||
},
|
||||
{
|
||||
field: 'goodsPrice',
|
||||
align: 'center',
|
||||
title: '单价'
|
||||
},
|
||||
{
|
||||
field: 'totalPrice',
|
||||
align: 'center',
|
||||
title: '总价'
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
align: 'center',
|
||||
title: '备注'
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,95 +1,70 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('人事审批')" />
|
||||
<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet" />
|
||||
<link th:href="@{/css/font-awesome.min.css}" rel="stylesheet" />
|
||||
<!-- bootstrap-table 表格插件样式 -->
|
||||
<link th:href="@{/ajax/libs/bootstrap-table/bootstrap-table.min.css}" rel="stylesheet"/>
|
||||
<link th:href="@{/css/animate.css}" rel="stylesheet" />
|
||||
<link th:href="@{/css/style.css}" rel="stylesheet" />
|
||||
<link th:href="@{/ruoyi/css/ry-ui.css}" rel="stylesheet" />
|
||||
<th:block th:include="include :: jsonview-css" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
|
||||
<form class="form-horizontal m-t" id="signupForm">
|
||||
<div class="row">
|
||||
<div class="col-sm-offset-0 col-sm-10">
|
||||
<button type="button" class="btn btn-success btn-sm" onclick="printData()"><i class="fa fa-plus"> 打印</i></button>
|
||||
<!--<button type="button" class="btn btn-sm btn-primary" onclick="submitCheckHandler()"><i class="fa fa-check"></i>通 过</button>
|
||||
<button type="button" class="btn btn-sm btn-danger" onclick="submitHandler()"><i class="fa fa-remove"></i>驳 回</button> -->
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
</head>
|
||||
<body class="white-bg" >
|
||||
<form class="form-horizontal m-t" id="signupForm">
|
||||
<!--<input class="form-control" type="hidden" name="taskId" th:value="*{taskId}"/>
|
||||
<input class="form-control" type="hidden" name="businessKey" th:value="${sysOaLeave.leaveNo}"/>-->
|
||||
<input name="id" th:value="${purchaseOrder.id}" type="hidden">
|
||||
<h2 class="form-header h4" align="center" >采购单信息</h2>
|
||||
<h2 class="form-header h2" align="center" >采购单信息</h2>
|
||||
<br/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">单号:</label>
|
||||
<div class="col-sm-2">
|
||||
<div class="form-control-static" style="float:left">
|
||||
<span th:text="${purchaseOrder.orderNo}"/>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-4 col-sm-5 col-md-offset-1">
|
||||
<label>单号:</label>
|
||||
<span th:text="${purchaseOrder.orderNo}"/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">采购标题:</label>
|
||||
<div class="col-sm-6">
|
||||
<div class="form-control-static" style="float:left">
|
||||
<span th:text="${purchaseOrder.title}"/>
|
||||
</div>
|
||||
<div class="col-xs-4 col-sm-6">
|
||||
<label>采购标题:</label>
|
||||
<span th:text="${purchaseOrder.title}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">供应商:</label>
|
||||
<div class="col-sm-2">
|
||||
<div class="form-control-static" style="float:left">
|
||||
<span th:text="${purchaseOrder.supplierName}"/>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-3 col-sm-4 col-md-offset-1">
|
||||
<label>供应商:</label>
|
||||
<span th:text="${purchaseOrder.supplierName}"/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">订货日期:</label>
|
||||
<div class="col-sm-2">
|
||||
<div class="form-control-static" style="float:left">
|
||||
<span th:text="${#dates.format(purchaseOrder.orderTime, 'yyyy-MM-dd')}"/>
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-3">
|
||||
<label >订货日期:</label>
|
||||
<span th:text="${#dates.format(purchaseOrder.orderTime, 'yyyy-MM-dd')}"/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">交货日期:</label>
|
||||
<div class="col-sm-2">
|
||||
<div class="form-control-static" style="float:left">
|
||||
<span th:text="${#dates.format(purchaseOrder.deliveryDate, 'yyyy-MM-dd')}"/>
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-3">
|
||||
<label>交货日期:</label>
|
||||
<span th:text="${#dates.format(purchaseOrder.deliveryDate, 'yyyy-MM-dd')}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">采购人:</label>
|
||||
<div class="col-sm-2">
|
||||
<div class="form-control-static" style="float:left">
|
||||
<span th:text="${purchaseOrder.belongUser}"/>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-3 col-sm-4 col-md-offset-1">
|
||||
<label >采购人:</label>
|
||||
<span th:text="${purchaseOrder.belongUser}"/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">总数量:</label>
|
||||
<div class="col-sm-2">
|
||||
<div class="form-control-static" style="float:left">
|
||||
<span th:text="${purchaseOrder.totalQuantity}"/>
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-3">
|
||||
<label >总数量:</label>
|
||||
<span th:text="${purchaseOrder.totalQuantity}"/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">采购总金额:</label>
|
||||
<div class="col-sm-2">
|
||||
<div class="form-control-static" style="float:left">
|
||||
<span th:text="${purchaseOrder.totalPrice}"/>
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-3">
|
||||
<label >总金额:</label>
|
||||
<span th:text="${purchaseOrder.totalPrice}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注:</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="form-control-static"><pre id="reason"></pre></div>
|
||||
<div class="row">
|
||||
<div class="col-xs-10 col-sm-10 col-md-offset-1">
|
||||
<label>备注:</label>
|
||||
<span th:text="${purchaseOrder.remark}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h4 class="form-header h4">采购单明细</h4>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<!-- <button type="button" class="btn btn-success btn-sm" onclick="addColumn()"><i class="fa fa-plus"> 增加</i></button>
|
||||
<button type="button" class="btn btn-warning btn-sm" onclick="sub.delColumn()"><i class="fa fa-minus"> 删除</i></button>-->
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
|
@ -98,14 +73,20 @@
|
|||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: jsonview-js" />
|
||||
<!-- <th:block th:include="include :: jsonview-js" />-->
|
||||
<script src="http://www.jq22.com/jquery/jquery-migrate-1.2.1.min.js"></script>
|
||||
<script th:src="@{/js/jquery.jqprint-0.3.js}"></script>
|
||||
<script th:inline="javascript">
|
||||
|
||||
function printData(){
|
||||
$("#signupForm").jqprint();
|
||||
}
|
||||
$("#signupForm").jqprint({
|
||||
debug: false,
|
||||
importCSS: true,
|
||||
printContainer: true,
|
||||
operaSupport: false
|
||||
});
|
||||
};
|
||||
|
||||
$(function() {
|
||||
var reason = [[${purchaseOrder.remark}]];
|
||||
console.log(reason);
|
||||
|
|
|
@ -0,0 +1,186 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet" />
|
||||
<link th:href="@{/css/font-awesome.min.css}" rel="stylesheet" />
|
||||
<!-- bootstrap-table 表格插件样式 -->
|
||||
<link th:href="@{/ajax/libs/bootstrap-table/bootstrap-table.min.css}" rel="stylesheet"/>
|
||||
<link th:href="@{/css/animate.css}" rel="stylesheet" />
|
||||
<link th:href="@{/css/style.css}" rel="stylesheet" />
|
||||
<link th:href="@{/ruoyi/css/ry-ui.css}" rel="stylesheet" />
|
||||
<th:block th:include="include :: bootstrap-fileinput-css"/>
|
||||
</head>
|
||||
<body class="white-bg" >
|
||||
<form class="form-horizontal m-t" id="signupForm">
|
||||
<input class="form-control" type="hidden" name="taskId" th:value="*{taskId}"/>
|
||||
<input class="form-control" type="hidden" name="businessKey" th:value="${purchaseOrder.orderNo}"/>
|
||||
<input name="id" th:value="${purchaseOrder.id}" type="hidden">
|
||||
<h2 class="form-header h2" align="center" >采购单信息</h2>
|
||||
<br/>
|
||||
<div class="row">
|
||||
<div class="col-xs-4 col-sm-5 col-md-offset-1">
|
||||
<label>单号:</label>
|
||||
<span th:text="${purchaseOrder.orderNo}"/>
|
||||
</div>
|
||||
<div class="col-xs-4 col-sm-6">
|
||||
<label>采购标题:</label>
|
||||
<span th:text="${purchaseOrder.title}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-3 col-sm-4 col-md-offset-1">
|
||||
<label>供应商:</label>
|
||||
<span th:text="${purchaseOrder.supplierName}"/>
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-3">
|
||||
<label >订货日期:</label>
|
||||
<span th:text="${#dates.format(purchaseOrder.orderTime, 'yyyy-MM-dd')}"/>
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-3">
|
||||
<label>交货日期:</label>
|
||||
<span th:text="${#dates.format(purchaseOrder.deliveryDate, 'yyyy-MM-dd')}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-3 col-sm-4 col-md-offset-1">
|
||||
<label >采购人:</label>
|
||||
<span th:text="${purchaseOrder.belongUser}"/>
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-3">
|
||||
<label >总数量:</label>
|
||||
<span th:text="${purchaseOrder.totalQuantity}"/>
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-3">
|
||||
<label >总金额:</label>
|
||||
<span th:text="${purchaseOrder.totalPrice}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-10 col-sm-10 col-md-offset-1">
|
||||
<label>备注:</label>
|
||||
<span th:text="${purchaseOrder.remark}"/>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="form-header h4">采购单明细</h4>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<h4 class="form-header h4">填写信息</h4>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">审批意见:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="suggestion" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">审批附件:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" name="suggestionFileUrl" >
|
||||
<div class="file-loading">
|
||||
<input class="form-control file-upload" id="suggestionFileUrl" name="file" type="file">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script src="http://www.jq22.com/jquery/jquery-migrate-1.2.1.min.js"></script>
|
||||
<script th:src="@{/js/jquery.jqprint-0.3.js}"></script>
|
||||
<th:block th:include="include :: bootstrap-fileinput-js"/>
|
||||
<script th:inline="javascript">
|
||||
|
||||
$(".file-upload").each(function (i) {
|
||||
var val = $("input[name='" + this.id + "']").val();
|
||||
$(this).fileinput({
|
||||
'uploadUrl': '/common/upload',
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: [val],
|
||||
maxFileCount: 1,
|
||||
autoReplace: true
|
||||
}).on('fileuploaded', function (event, data, previewId, index) {
|
||||
$("input[name='" + event.currentTarget.id + "']").val(data.response.url)
|
||||
}).on('fileremoved', function (event, id, index) {
|
||||
$("input[name='" + event.currentTarget.id + "']").val('')
|
||||
})
|
||||
$(this).fileinput('_initFileActions');
|
||||
});
|
||||
|
||||
function submitCheckHandler() {
|
||||
if ($.validate.form()) {
|
||||
var data = $("#signupForm").serializeArray();
|
||||
data.push({"name": "checkStatus", "value": 0});
|
||||
$.operate.saveTab("/system/leave/managerFinishTask", data);
|
||||
}
|
||||
}
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
var data = $("#signupForm").serializeArray();
|
||||
data.push({"name": "checkStatus", "value": 1});
|
||||
$.operate.saveTab("/system/leave/managerFinishTask", data);
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
data: [[${purchaseOrder.purchaseOrderItemList}]],
|
||||
pagination: false,
|
||||
showSearch: false,
|
||||
showRefresh: false,
|
||||
showToggle: false,
|
||||
showColumns: false,
|
||||
sidePagination: "client",
|
||||
columns: [
|
||||
{
|
||||
field: 'index',
|
||||
align: 'center',
|
||||
title: "序号",
|
||||
formatter: function (value, row, index) {
|
||||
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
|
||||
return columnIndex + $.table.serialNumber(index);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'goodsNo',
|
||||
align: 'center',
|
||||
title: '货物编号'
|
||||
},
|
||||
{
|
||||
field: 'goodsName',
|
||||
align: 'center',
|
||||
title: '名称'
|
||||
},
|
||||
{
|
||||
field: 'goodsSize',
|
||||
align: 'center',
|
||||
title: '规格'
|
||||
},
|
||||
{
|
||||
field: 'goodsQuantity',
|
||||
align: 'center',
|
||||
title: '数量'
|
||||
},
|
||||
{
|
||||
field: 'goodsPrice',
|
||||
align: 'center',
|
||||
title: '单价'
|
||||
},
|
||||
{
|
||||
field: 'totalPrice',
|
||||
align: 'center',
|
||||
title: '总价'
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
align: 'center',
|
||||
title: '备注'
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -139,9 +139,14 @@
|
|||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="printPur(\'' + row.id + '\')"><i class="fa fa-print"></i>详情</a> ');
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
if(row.processStatus!=0) {
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="printPur(\'' + row.id + '\')"><i class="fa fa-print"></i>打印</a> ');
|
||||
}
|
||||
|
||||
if(row.processStatus==0) {
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>发起审批</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
}
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
|
@ -153,7 +158,7 @@
|
|||
var detailUrl=prefix + "/detail/"+id;
|
||||
var index = layer.open({
|
||||
type: 2,
|
||||
area: [ '500px', '500px'],
|
||||
area: [ '100%', '100%'],
|
||||
fix: false,
|
||||
//不固定
|
||||
maxmin: true,
|
||||
|
@ -164,9 +169,8 @@
|
|||
// 弹层外区域关闭
|
||||
shadeClose: true,
|
||||
yes: function(index, layero) {
|
||||
printData();
|
||||
var iframeWin = layero.find('iframe')[0];
|
||||
iframeWin.contentWindow.submitHandler(index, layero);
|
||||
//当点击‘确定’按钮的时候,获取弹出层返回的值
|
||||
var res = window["layui-layer-iframe" + index].printData();
|
||||
},
|
||||
cancel: function(index) {
|
||||
return true;
|
||||
|
|
|
@ -9,7 +9,7 @@ package com.snow.flowable.common.enums;
|
|||
public enum FlowDefEnum {
|
||||
SNOW_OA_LEAVE("snow_oa_leave", "请假申请流程"),
|
||||
|
||||
NO_FINISHED("snow_oa_leave111", "请假申请流程111");
|
||||
PURCHASE_ORDER_PROCESS("purchase_order_process", "采购审批流程");
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
|
|
@ -50,4 +50,6 @@ public class CompleteTaskDTO implements Serializable {
|
|||
private Map<String,Object> paramMap;
|
||||
|
||||
public final static String IS_PASS="isPass";
|
||||
|
||||
private String attachments;
|
||||
}
|
||||
|
|
|
@ -13,6 +13,8 @@ import java.io.Serializable;
|
|||
public class FileEntry implements Serializable {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 7310292292228252227L;
|
||||
|
||||
private String key;
|
||||
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ import java.util.Date;
|
|||
*/
|
||||
@Data
|
||||
public class SysOaLeaveForm extends AppForm {
|
||||
|
||||
/** id */
|
||||
private Integer id;
|
||||
|
||||
|
|
|
@ -0,0 +1,73 @@
|
|||
package com.snow.flowable.domain.purchaseOrder;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.snow.common.annotation.Excel;
|
||||
import com.snow.flowable.common.enums.FlowDefEnum;
|
||||
import com.snow.flowable.domain.AppForm;
|
||||
import com.snow.system.domain.PurchaseOrderItem;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @program: snow
|
||||
* @description
|
||||
* @author: 没用的阿吉
|
||||
* @create: 2021-01-09 20:59
|
||||
**/
|
||||
@Data
|
||||
public class PurchaseOrderForm extends AppForm implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -7230087438862354631L;
|
||||
/** id */
|
||||
private Integer id;
|
||||
|
||||
/** 订单号 */
|
||||
|
||||
private String orderNo;
|
||||
|
||||
/** 总数量 */
|
||||
|
||||
private BigDecimal totalQuantity;
|
||||
|
||||
/** 采购总金额 */
|
||||
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
/** 采购标题 */
|
||||
|
||||
private String title;
|
||||
|
||||
/** 供应商名称 */
|
||||
|
||||
private String supplierName;
|
||||
|
||||
/** 订货日期 */
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date orderTime;
|
||||
|
||||
/** 交货日期 */
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date deliveryDate;
|
||||
|
||||
/** 审批状态 */
|
||||
|
||||
private Long processStatus;
|
||||
|
||||
/** 采购人 */
|
||||
|
||||
private String belongUser;
|
||||
|
||||
|
||||
private String remark;
|
||||
|
||||
private List<PurchaseOrderItem> purchaseOrderItemList;
|
||||
|
||||
@Override
|
||||
public FlowDefEnum getFlowDef() {
|
||||
return FlowDefEnum.PURCHASE_ORDER_PROCESS;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package com.snow.flowable.listener.purchaseOrder;
|
||||
|
||||
import com.snow.common.enums.ProcessStatus;
|
||||
import com.snow.flowable.domain.purchaseOrder.PurchaseOrderForm;
|
||||
import com.snow.flowable.listener.AbstractExecutionListener;
|
||||
import com.snow.flowable.service.FlowableService;
|
||||
import com.snow.system.domain.PurchaseOrderMain;
|
||||
import com.snow.system.mapper.PurchaseOrderMainMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @program: snow
|
||||
* @description
|
||||
* @author: 没用的阿吉
|
||||
* @create: 2021-01-09 21:15
|
||||
**/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class PurchaseOrderStartListener extends AbstractExecutionListener<PurchaseOrderForm> {
|
||||
|
||||
@Autowired
|
||||
private PurchaseOrderMainMapper purchaseOrderMainMapper;
|
||||
|
||||
@Override
|
||||
protected void process() {
|
||||
String processInstanceId = getProcessInstanceId();
|
||||
String businessKey= getBusinessKey();
|
||||
PurchaseOrderMain purchaseOrderMain=new PurchaseOrderMain();
|
||||
purchaseOrderMain.setProcessStatus((long)ProcessStatus.CHECKING.ordinal());
|
||||
purchaseOrderMain.setOrderNo(businessKey);
|
||||
purchaseOrderMainMapper.updatePurchaseOrderMainByOrderNo(purchaseOrderMain);
|
||||
|
||||
}
|
||||
}
|
|
@ -84,6 +84,13 @@ public interface FlowableService {
|
|||
*/
|
||||
ProcessInstance startProcessInstanceByAppForm(AppForm appForm);
|
||||
|
||||
|
||||
/**
|
||||
* 自动完成任务
|
||||
* @param processInstanceId
|
||||
*/
|
||||
void automaticTask(String processInstanceId);
|
||||
|
||||
/**
|
||||
* 根据任务ID获取代办
|
||||
* @param taskId
|
||||
|
|
|
@ -309,7 +309,15 @@ public class FlowableServiceImpl implements FlowableService {
|
|||
return processInstance;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void automaticTask(String processInstanceId){
|
||||
CompleteTaskDTO completeTaskDTO=new CompleteTaskDTO();
|
||||
Task task=getTaskProcessInstanceById(processInstanceId);
|
||||
completeTaskDTO.setTaskId(task.getId());
|
||||
completeTaskDTO.setIsPass(true);
|
||||
completeTaskDTO.setUserId(task.getAssignee());
|
||||
completeTask(completeTaskDTO);
|
||||
}
|
||||
@Override
|
||||
public Task getTask(String taskId) {
|
||||
Task task = taskService.createTaskQuery()
|
||||
|
|
|
@ -43,12 +43,12 @@ public class PurchaseOrderMain extends BaseEntity
|
|||
private String supplierName;
|
||||
|
||||
/** 订货日期 */
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "订货日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date orderTime;
|
||||
|
||||
/** 交货日期 */
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "交货日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date deliveryDate;
|
||||
|
||||
|
|
|
@ -44,6 +44,12 @@ public interface PurchaseOrderMainMapper
|
|||
*/
|
||||
public int updatePurchaseOrderMain(PurchaseOrderMain purchaseOrderMain);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param purchaseOrderMain
|
||||
* @return
|
||||
*/
|
||||
public int updatePurchaseOrderMainByOrderNo(PurchaseOrderMain purchaseOrderMain);
|
||||
/**
|
||||
* 删除采购单主表
|
||||
*
|
||||
|
|
|
@ -130,6 +130,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updatePurchaseOrderMainByOrderNo" parameterType="PurchaseOrderMain">
|
||||
update purchase_order_main
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
|
||||
<if test="totalQuantity != null">total_quantity = #{totalQuantity},</if>
|
||||
<if test="totalPrice != null">total_price = #{totalPrice},</if>
|
||||
<if test="title != null">title = #{title},</if>
|
||||
<if test="supplierName != null">supplier_name = #{supplierName},</if>
|
||||
<if test="orderTime != null">order_time = #{orderTime},</if>
|
||||
<if test="deliveryDate != null">delivery_date = #{deliveryDate},</if>
|
||||
<if test="processStatus != null">process_status = #{processStatus},</if>
|
||||
<if test="belongUser != null">belong_user = #{belongUser},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where order_no = #{orderNo}
|
||||
</update>
|
||||
|
||||
|
||||
<delete id="deletePurchaseOrderMainById" parameterType="Integer">
|
||||
delete from purchase_order_main where id = #{id}
|
||||
</delete>
|
||||
|
|
Loading…
Reference in New Issue