Commit 5da34a8929e1ce463cd6031d7489ab03ef2b8716

Authored by 陈翱
1 parent 7dc2d5c8

优化了入库单,出库单页面按钮状态显示,新增了参数设置审核流程开关

ant-design-vue-jeecg/src/api/api.js
... ... @@ -227,6 +227,17 @@ export const auditReceipt = (params) => getAction("/audit/audit/auditReceipt", p
227 227 //查询审核流程进度
228 228 export const searchAuditFlow = (params) => getAction("/audit/audit/searchAuditFlow", params);
229 229  
  230 +//出库单提交审核
  231 +export const createShipmentAuditFlow = (params) => getAction("/audit/audit/createShipmentAuditFlow", params);
  232 +//出库单审核
  233 +export const auditShipment = (params) => getAction("/audit/audit/auditShipment", params);
  234 +
  235 +//查询是否开启审核流程
  236 +export const getDocumentAduitFlow = (params) => getAction("/config/parameterConfiguration/getDocumentAduitFlow", params);
  237 +
  238 +
  239 +
  240 +
230 241 //批量快速出整托
231 242 export const shipmentInventoryHeader = (params) => postAction('/inventory/inventoryHeader/shipmentInventoryHeader', params);
232 243 //批量快速出库存详情
... ...
ant-design-vue-jeecg/src/views/system/flow/FlowProcess.vue
... ... @@ -24,16 +24,16 @@
24 24 <a-step v-for="(sa,index) in flowInfo.list" :title="sa.auditor">
25 25 <div style="fontSize: 12px; color: rgba(0, 0, 0, 0.45); position: relative; left:8px;"
26 26 slot="description">
27   - <div v-if="sa.sequence=='0'" style="margin: 8px 0 4px;font-size:16px;" >
  27 + <div v-if="sa.sequence=='0'&&sa.status=='1'" style="margin: 8px 0 4px;font-size:16px;" >
28 28 创建单据
29 29 </div>
30   - <div v-if="sa.status=='1'&&index!=flowInfo.list.length-1" style="margin: 8px 0 4px;font-size:16px;color: #00DB00">
  30 + <div v-if="sa.status=='1'&&index!=flowInfo.list.length-1&&sa.sequence!='0'" style="margin: 8px 0 4px;font-size:16px;color: #00DB00">
31 31 审核通过
32 32 </div>
33 33 <div v-if="sa.status=='2'" style="margin: 8px 0 4px;font-size:16px;color: red">
34 34 审核驳回
35 35 </div>
36   - <div v-if="sa.status==null&&sa.sequence!='0'" style="margin: 8px 0 4px;font-size:16px;color:lightseagreen">
  36 + <div v-if="sa.status=='0'" style="margin: 8px 0 4px;font-size:16px;color:lightseagreen">
37 37 待审核
38 38 </div>
39 39 <div v-if="sa.status=='1'&&index==flowInfo.list.length-1" style="margin: 8px 0 4px;font-size:16px;color: #50bfff">
... ... @@ -87,11 +87,19 @@ export default {
87 87 this.visible = false;
88 88 this.$refs.form.clearValidate();
89 89 },
90   - edit(record) {
  90 + edit(record,type) {
91 91 this.visible = true;
92   - let params={
  92 + let params=[];
  93 + if (type=='1'){
  94 + params={
93 95 receiptId:record.id,
  96 + }
  97 + }else{
  98 + params={
  99 + shipmentId:record.id
  100 + }
94 101 }
  102 +
95 103 searchAuditFlow(params).then((res) => {
96 104 this.flowInfo=res;
97 105 });
... ...
ant-design-vue-jeecg/src/views/system/flow/modules/FlowHeaderModal.vue
... ... @@ -36,8 +36,8 @@
36 36 </a-form-model-item>
37 37 </a-col>
38 38 <a-col :span="24">
39   - <a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
40   - <j-dict-select-tag placeholder="请选择流程状态" v-model="model.status" dictCode="flowStatus"/>
  39 + <a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
  40 + <j-dict-select-tag placeholder="请选择流程状态" v-model="model.flowStatus" dictCode="flowStatus"/>
41 41 </a-form-model-item>
42 42 </a-col>
43 43 </a-row>
... ...
ant-design-vue-jeecg/src/views/system/receipt/ReceiptHeaderList.vue
... ... @@ -176,15 +176,15 @@
176 176 <a-popconfirm v-has="'receiptHeader:back'" v-if="record.lastStatus == 800" title="确定回传吗?" @confirm="() => hanleBack(record)">
177 177 <a><a-button type="default">回传</a-button><a-divider type="vertical"/></a>
178 178 </a-popconfirm>
179   - <a v-if="record.lastStatus < 800 && record.firstStatus ==15 " @click="receive(record)" v-has="'receiptHeader:receive'"><a-button type="primary">组盘</a-button><a-divider type="vertical"/></a>
180   - <a v-if="record.firstStatus == '0' " @click="createAudit(record)"><a-button type="primary">提交审核</a-button><a-divider type="vertical"/></a>
181   - <a v-if="record.nextAuditor == username " @click="audit(record)"><a-button type="primary">审核</a-button><a-divider type="vertical"/></a>
  179 + <a v-if="(record.lastStatus < 800 && record.firstStatus ==15 && record.firstStatus!='20') ||flowOff=='0'&&record.lastStatus < 800 " @click="receive(record)" v-has="'receiptHeader:receive'"><a-button type="primary">组盘</a-button><a-divider type="vertical"/></a>
  180 + <a v-if="record.firstStatus == '0'&&flowOff=='1'" @click="createAudit(record)"><a-button type="primary">提交审核</a-button><a-divider type="vertical"/></a>
  181 + <a v-if="record.nextAuditor == username&&flowOff=='1'" @click="audit(record)"><a-button type="primary">审核</a-button><a-divider type="vertical"/></a>
182 182 <a v-if="record.lastStatus == 850" @click="viewReason(record)"><a-button type="danger">原因</a-button><a-divider type="vertical"/></a>
183 183 <a-dropdown>
184 184 <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
185 185 <a-menu slot="overlay">
186   - <a-menu-item v-has="'receiptHeader:edit'">
187   - <a v-if="record.firstStatus > 0 " @click="openProcess(record)"><a-button type="primary">审核进度</a-button><a-divider type="vertical"/></a>
  186 + <a-menu-item >
  187 + <a v-if="record.firstStatus > 0 && flowOff=='1' " @click="openProcess(record)"><a-button type="primary">审核进度</a-button><a-divider type="vertical"/></a>
188 188 </a-menu-item>
189 189 <a-menu-item v-has="'receiptHeader:edit'">
190 190 <a @click="handleEdit(record)">编辑</a>
... ... @@ -226,7 +226,7 @@ import {initDictOptions, filterMultiDictText} from &#39;@/components/dict/JDictSelec
226 226 import '@/assets/less/TableExpand.less'
227 227 import {getCompanyList} from '@/api/api'
228 228 import {getReceiptTypeList} from '@/api/api'
229   -import {getSupplierList, backErpReceipt,createReceiptAuditFlow} from '@/api/api'
  229 +import {getSupplierList, backErpReceipt,createReceiptAuditFlow,getDocumentAduitFlow} from '@/api/api'
230 230 import ReceiveModal from "./modules/ReceiveModal";
231 231 import { notification } from 'ant-design-vue';
232 232 import FlowProcess from "../flow/FlowProcess";
... ... @@ -250,6 +250,7 @@ export default {
250 250 companyList: [],
251 251 receiptTypeList: [],
252 252 supplierList: [],
  253 + flowOff:'',
253 254 // 表头
254 255 columns: [
255 256 {
... ... @@ -378,6 +379,7 @@ export default {
378 379 this.getSuperFieldList();
379 380 this.loadFrom();
380 381 this.username = store.getters.userInfo.username
  382 + this.getDocumentAduitFlowStaus();
381 383 },
382 384 computed: {
383 385 importExcelUrl: function () {
... ... @@ -385,6 +387,11 @@ export default {
385 387 }
386 388 },
387 389 methods: {
  390 + getDocumentAduitFlowStaus(){
  391 + getDocumentAduitFlow().then((res) => {
  392 + this.flowOff=res.message;
  393 + })
  394 + },
388 395 getStatusColor(status) {
389 396 const colors = {
390 397 '新建': 'green',
... ... @@ -436,7 +443,7 @@ export default {
436 443 createReceiptAuditFlow(params).then((res) => {
437 444 if (res.success) {
438 445 //this.$message.success(res.message)
439   - this.$refs.porcessForm.edit(record)
  446 + this.$refs.porcessForm.edit(record,'1')
440 447 this.loadData();
441 448 }else {
442 449 this.$message.error(res.message)
... ... @@ -444,7 +451,7 @@ export default {
444 451 });
445 452 },
446 453 openProcess(record){
447   - this.$refs.porcessForm.edit(record)
  454 + this.$refs.porcessForm.edit(record,'1' )
448 455 },
449 456 onSelectChange(selectedRowKeys, selectionRows) {
450 457 this.selectedMainId = selectedRowKeys[0].toString();
... ...
ant-design-vue-jeecg/src/views/system/shipment/ShipmentDetailList.vue
... ... @@ -76,7 +76,7 @@
76 76 </template>
77 77  
78 78 <span slot="action" slot-scope="text, record">
79   - <a @click="combine(record)"><a-button type="primary">配盘</a-button></a>
  79 + <a v-if="flowStatus=='15'&&flowStatus!='20'||flowOff=='0'" @click="combine(record)"><a-button type="primary">配盘</a-button></a>
80 80 <a-divider type="vertical"/>
81 81 <a-dropdown>
82 82 <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
... ... @@ -126,6 +126,16 @@ export default {
126 126 type: String,
127 127 default: '',
128 128 required: false
  129 + },
  130 + flowStatus: {
  131 + type: String,
  132 + default: '',
  133 + required: false
  134 + },
  135 + flowOff: {
  136 + type: String,
  137 + default: '',
  138 + required: false
129 139 }
130 140 },
131 141 watch: {
... ... @@ -252,6 +262,7 @@ export default {
252 262 }
253 263 },
254 264 created() {
  265 +
255 266 },
256 267 computed: {
257 268 importExcelUrl() {
... ...
ant-design-vue-jeecg/src/views/system/shipment/ShipmentHeaderList.vue
... ... @@ -189,13 +189,18 @@
189 189 </a-button>
190 190 </template>
191 191 <span slot="action" slot-scope="text, record">
  192 + <a v-if="record.firstStatus == '0'&&flowOff=='1'" @click="createAudit(record)"><a-button type="primary">提交审核</a-button><a-divider type="vertical"/></a>
  193 + <a v-if="record.nextAuditor == username&&flowOff=='1' " @click="audit(record)"><a-button type="primary">审核</a-button><a-divider type="vertical"/></a>
192 194 <a-popconfirm v-has="'shipmentHeader:back'" v-if="record.lastStatus == 800" title="确定回传吗?" @confirm="() => hanleBack(record)">
193 195 <a><a-button type="default">回传</a-button><a-divider type="vertical"/></a>
194 196 </a-popconfirm>
195   - <a v-if="record.lastStatus < 800" @click="autoShipmentCombine(record)" v-has="'shipmentHeader:autoShipmentCombine'"><a-button type="primary">自动配盘</a-button> <a-divider type="vertical"/></a>
  197 + <a v-if="(record.firstStatus>15&&record.firstStatus!='20'&&record.lastStatus < 800)||flowOff=='0'&&record.lastStatus < 800 " @click="autoShipmentCombine(record)" v-has="'shipmentHeader:autoShipmentCombine'"><a-button type="primary">自动配盘</a-button> <a-divider type="vertical"/></a>
196 198 <a-dropdown>
197 199 <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
198 200 <a-menu slot="overlay">
  201 + <a-menu-item >
  202 + <a v-if="record.firstStatus > 0 &&flowOff=='1' " @click="openProcess(record)"><a-button type="primary">审核进度</a-button><a-divider type="vertical"/></a>
  203 + </a-menu-item>
199 204 <a-menu-item v-has="'shipmentHeader:edit'">
200 205 <a @click="handleEdit(record)">编辑</a>
201 206 </a-menu-item>
... ... @@ -213,11 +218,13 @@
213 218  
214 219 <a-tabs defaultActiveKey="1">
215 220 <a-tab-pane tab="出库单详情" key="1">
216   - <ShipmentDetailList :mainId="selectedMainId"/>
  221 + <ShipmentDetailList :mainId="selectedMainId" :flowStatus="flowStatus" :flowOff="flowOff"/>
217 222 </a-tab-pane>
218 223 </a-tabs>
219 224  
220 225 <shipmentHeader-modal ref="modalForm" @ok="modalFormOk"></shipmentHeader-modal>
  226 + <shipment-audit-modal ref="auditForm"></shipment-audit-modal>
  227 + <flow-process ref="porcessForm"></flow-process>
221 228 </a-card>
222 229 </template>
223 230  
... ... @@ -233,13 +240,19 @@ import {getCompanyList, backErpShipment} from &#39;@/api/api&#39;
233 240 import {getShipmentTypeList} from '@/api/api'
234 241 import {getCustomerList} from '@/api/api'
235 242 import {autoCombination} from '@/api/api'
  243 +import {createShipmentAuditFlow,getDocumentAduitFlow} from '@/api/api'
  244 +import store from '@/store'
  245 +import ShipmentAuditModal from "./modules/ShipmentAuditModal";
  246 +import FlowProcess from "../flow/FlowProcess";
236 247  
237 248 export default {
238 249 name: "ShipmentHeaderList",
239 250 mixins: [JeecgListMixin],
240 251 components: {
  252 + ShipmentAuditModal,
241 253 ShipmentDetailList,
242   - ShipmentHeaderModal
  254 + ShipmentHeaderModal,
  255 + FlowProcess
243 256 },
244 257 data() {
245 258 return {
... ... @@ -247,6 +260,9 @@ export default {
247 260 companyList: [],
248 261 shipmentTypeList: [],
249 262 customerList: [],
  263 + username:'',
  264 + flowStatus:'',
  265 + flowOff:'',
250 266 // 表头
251 267 columns: [
252 268 {
... ... @@ -374,6 +390,8 @@ export default {
374 390 created() {
375 391 this.getSuperFieldList();
376 392 this.loadFrom();
  393 + this.username = store.getters.userInfo.username
  394 + this.getDocumentAduitFlowStaus();
377 395 },
378 396 computed: {
379 397 importExcelUrl: function () {
... ... @@ -381,6 +399,11 @@ export default {
381 399 }
382 400 },
383 401 methods: {
  402 + getDocumentAduitFlowStaus(){
  403 + getDocumentAduitFlow().then((res) => {
  404 + this.flowOff=res.message;
  405 + })
  406 + },
384 407 getStatusColor(status) {
385 408 const colors = {
386 409 '新建': 'green',
... ... @@ -414,6 +437,7 @@ export default {
414 437 this.selectedMainId = selectedRowKeys[0].toString();
415 438 this.selectedRowKeys = selectedRowKeys;
416 439 this.selectionRows = selectionRows;
  440 + this.flowStatus=selectionRows[0].firstStatus;
417 441 },
418 442 hanleBack(record) {
419 443 backErpShipment(record).then((res) => {
... ... @@ -425,6 +449,28 @@ export default {
425 449 this.searchQuery();
426 450 });
427 451 },
  452 + audit(record){
  453 + this.$refs.auditForm.edit(record,this.username)
  454 + },
  455 + createAudit(record){
  456 + let params={
  457 + shipmentId:record.id,
  458 + type:record.type,
  459 + createBy:record.createBy
  460 + }
  461 + createShipmentAuditFlow(params).then((res) => {
  462 + if (res.success) {
  463 + //this.$message.success(res.message)
  464 + this.$refs.porcessForm.edit(record,'2')
  465 + this.loadData();
  466 + }else {
  467 + this.$message.error(res.message)
  468 + }
  469 + });
  470 + },
  471 + openProcess(record){
  472 + this.$refs.porcessForm.edit(record,'2')
  473 + },
428 474 loadFrom() {
429 475 getCompanyList().then((res) => {
430 476 if (res.success) {
... ...
ant-design-vue-jeecg/src/views/system/shipment/modules/ShipmentAuditModal.vue 0 → 100644
  1 +<template>
  2 + <j-modal
  3 + :title="title"
  4 + :width="width"
  5 + :visible="visible"
  6 + :confirmLoading="confirmLoading"
  7 + switchFullscreen
  8 + @ok="handleOk"
  9 + @cancel="handleCancel"
  10 + cancelText="关闭">
  11 + <a-spin :spinning="confirmLoading">
  12 + <a-form-model ref="form" :model="model" >
  13 + <a-row>
  14 + <a-col :span="24">
  15 + <a-form-model-item label="审核结果" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="companyCode">
  16 + <j-dict-select-tag placeholder="请选择流程类型" v-model="model.status" dictCode="auditStatus" />
  17 + </a-form-model-item>
  18 + </a-col>
  19 +
  20 + <a-col :span="24">
  21 + <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="type">
  22 + <a-input v-model="model.remark" placeholder="请输入..." ></a-input>
  23 + </a-form-model-item>
  24 + </a-col>
  25 +
  26 +
  27 +
  28 + </a-row>
  29 + </a-form-model>
  30 + </a-spin>
  31 + </j-modal>
  32 +</template>
  33 +
  34 +<script>
  35 +
  36 +import {httpAction} from '@/api/manage'
  37 +import {auditShipment} from '@/api/api'
  38 +
  39 +export default {
  40 + name: "ShipmentAuditModal",
  41 + components: {},
  42 + data() {
  43 + return {
  44 + title: "操作",
  45 + width: 800,
  46 + visible: false,
  47 + model: {},
  48 + shipmentId: '',
  49 + username: '',
  50 + labelCol: {
  51 + xs: {span: 24},
  52 + sm: {span: 5},
  53 + },
  54 + wrapperCol: {
  55 + xs: {span: 24},
  56 + sm: {span: 16},
  57 + },
  58 +
  59 + confirmLoading: false,
  60 + url: {
  61 + add: "/receipt/receiptHeader/add",
  62 + edit: "/receipt/receiptHeader/edit",
  63 + }
  64 +
  65 + }
  66 + },
  67 + created() {
  68 + //备份model原始值
  69 + this.modelDefault = JSON.parse(JSON.stringify(this.model));
  70 + },
  71 + methods: {
  72 + edit(record,username) {
  73 + this.shipmentId=record.id
  74 + this.username=username
  75 + this.model = Object.assign({}, record);
  76 + this.visible = true;
  77 + },
  78 + close() {
  79 + this.$emit('close');
  80 + this.visible = false;
  81 + this.$refs.form.clearValidate();
  82 + },
  83 + handleOk() {
  84 + let params={
  85 + shipmentId:this.shipmentId,
  86 + status:this.model.status,
  87 + remark:this.model.remark,
  88 + auditorid:this.username
  89 + }
  90 + auditShipment(params).then((res) => {
  91 + if (res.success) {
  92 + this.$message.success(res.message)
  93 + this.visible = false;
  94 + this.loadData();
  95 + }else {
  96 + this.$message.error(res.message)
  97 + }
  98 + });
  99 + },
  100 + handleCancel() {
  101 + this.close()
  102 + },
  103 +
  104 +
  105 + }
  106 +}
  107 +</script>
0 108 \ No newline at end of file
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/audit/controller/AuditController.java
... ... @@ -187,4 +187,17 @@ public class AuditController extends JeecgController&lt;Audit, IAuditService&gt; {
187 187 return auditService.searchAuditFlow(audit);
188 188 }
189 189  
  190 + @ApiOperation(value="提交出库单审核", notes="提交出库单审核")
  191 + @GetMapping(value = "/createShipmentAuditFlow")
  192 + public Result<Audit> createShipmentAuditFlow(Audit audit) {
  193 + return auditService.createShipmentAuditFlow(audit);
  194 + }
  195 +
  196 + @ApiOperation(value="出库单审核", notes="出库单审核")
  197 + @GetMapping(value = "/auditShipment")
  198 + public Result<Audit> auditShipment(Audit audit) {
  199 + return auditService.auditShipment(audit);
  200 + }
  201 +
  202 +
190 203 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/audit/entity/Audit.java
... ... @@ -68,7 +68,7 @@ public class Audit implements Serializable {
68 68 @Excel(name = "审核序号", width = 15)
69 69 @ApiModelProperty(value = "审核序号")
70 70 private Integer sequence;
71   - /**审核状态*/
  71 + /**审核状态 (0:待审核,1:通过,2驳回)*/
72 72 @Excel(name = "审核状态", width = 15)
73 73 @ApiModelProperty(value = "审核状态")
74 74 private Integer status;
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/audit/service/IAuditService.java
... ... @@ -18,6 +18,11 @@ public interface IAuditService extends IService&lt;Audit&gt; {
18 18 */
19 19 Result<Audit> auditReceipt(Audit audit);
20 20  
  21 + /**
  22 + * 审核出库单据
  23 + */
  24 + Result<Audit> auditShipment(Audit audit);
  25 +
21 26  
22 27 /**
23 28 * 查询下一个审核人
... ... @@ -41,6 +46,11 @@ public interface IAuditService extends IService&lt;Audit&gt; {
41 46 Result<Audit>createReceiptAuditFlow(Audit audit);
42 47  
43 48 /**
  49 + * 出库单提交审核
  50 + */
  51 + Result<Audit>createShipmentAuditFlow(Audit audit);
  52 +
  53 + /**
44 54 * 查询单据审核进度
45 55 */
46 56 AuditFlow searchAuditFlow(Audit audit);
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/audit/service/impl/AuditServiceImpl.java
... ... @@ -12,9 +12,13 @@ import org.jeecg.modules.wms.audit.mapper.AuditMapper;
12 12 import org.jeecg.modules.wms.audit.service.IAuditService;
13 13 import org.jeecg.modules.wms.flow.entity.FlowDetail;
14 14 import org.jeecg.modules.wms.flow.service.IFlowDetailService;
  15 +import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail;
15 16 import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader;
  17 +import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptDetailService;
16 18 import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptHeaderService;
  19 +import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail;
17 20 import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentHeader;
  21 +import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentDetailService;
18 22 import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentHeaderService;
19 23 import org.jeecg.utils.StringUtils;
20 24 import org.jeecg.utils.constant.QuantityConstant;
... ... @@ -41,6 +45,10 @@ public class AuditServiceImpl extends ServiceImpl&lt;AuditMapper, Audit&gt; implements
41 45 private IShipmentHeaderService shipmentHeaderService;
42 46 @Resource
43 47 private IFlowDetailService iFlowDetailService;
  48 + @Resource
  49 + private IReceiptDetailService receiptDetailService;
  50 + @Resource
  51 + private IShipmentDetailService shipmentDetailService;
44 52  
45 53  
46 54  
... ... @@ -102,6 +110,62 @@ public class AuditServiceImpl extends ServiceImpl&lt;AuditMapper, Audit&gt; implements
102 110 }
103 111  
104 112 @Override
  113 + public Result<Audit> auditShipment(Audit audit) {
  114 + //根据出库单id,用户名称,找到审核数据
  115 + LambdaQueryWrapper<Audit>lambdaQueryWrapper=new LambdaQueryWrapper<>();
  116 + lambdaQueryWrapper.eq(Audit::getReceiptId,audit.getShipmentId())
  117 + .eq(Audit::getAuditorid,audit.getAuditorid()).last("limit 1");
  118 + Audit audit1=this.getOne(lambdaQueryWrapper);
  119 + if (StringUtils.isNotNull(audit1)){
  120 + audit1.setStatus(audit.getStatus());
  121 + audit1.setRemark(audit.getRemark());
  122 + if(this.updateById(audit1)){
  123 + if (audit.getStatus().equals(QuantityConstant.AUDIT_YES_STATUS)){
  124 + ShipmentHeader shipmentHeader=new ShipmentHeader();
  125 + shipmentHeader.setId(Integer.parseInt(audit1.getReceiptId()));
  126 + //查询下一个审核人
  127 + Audit nextAudit=searchNextAuditor(audit1);
  128 + if (StringUtils.isNull(nextAudit)){
  129 + shipmentHeader.setNextAuditor(String.valueOf(QuantityConstant.RECEIPT_HEADER_FINSH));
  130 + shipmentHeader.setFirstStatus(QuantityConstant.RECEIPT_HEADER_FINSH);
  131 + shipmentHeader.setLastStatus(QuantityConstant.RECEIPT_HEADER_FINSH);
  132 + shipmentHeaderService.updateById(shipmentHeader);
  133 + return Result.ok("审核流程结束!");
  134 + }else{
  135 + shipmentHeader.setFirstStatus(QuantityConstant.RECEIPT_HEADER_VERIFYING);
  136 + shipmentHeader.setLastStatus(QuantityConstant.RECEIPT_HEADER_VERIFYING);
  137 + shipmentHeader.setNextAuditor(String.valueOf(nextAudit.getAuditorid()));
  138 + shipmentHeaderService.updateById(shipmentHeader);
  139 + return Result.ok("审核通过,下一审核人:"+nextAudit.getAuditor());
  140 + }
  141 +
  142 + }else{
  143 + //驳回
  144 + ShipmentHeader shipmentHeader=new ShipmentHeader();
  145 + shipmentHeader.setId(Integer.parseInt(audit1.getReceiptId()));
  146 + //查询上一个审核人
  147 + Audit nextAudit=searchPreviousAuditor(audit1);
  148 + if (StringUtils.isNull(nextAudit)){
  149 + //驳回到创建人
  150 + shipmentHeader.setNextAuditor(null);
  151 + shipmentHeader.setFirstStatus(QuantityConstant.RECEIPT_HEADER_BUILD);
  152 + shipmentHeader.setLastStatus(QuantityConstant.RECEIPT_HEADER_BUILD);
  153 + shipmentHeaderService.updateById(shipmentHeader);
  154 + return Result.ok("驳回到创建人!");
  155 + }else {
  156 + shipmentHeader.setNextAuditor(String.valueOf(nextAudit.getAuditorid()));
  157 + shipmentHeader.setFirstStatus(QuantityConstant.RECEIPT_HEADER_REJECTED);
  158 + shipmentHeader.setLastStatus(QuantityConstant.RECEIPT_HEADER_REJECTED);
  159 + shipmentHeaderService.updateById(shipmentHeader);
  160 + return Result.ok("审核驳回,下一审核人:"+nextAudit.getAuditor());
  161 + }
  162 + }
  163 + }
  164 + }
  165 + return Result.error("审核失败!!");
  166 + }
  167 +
  168 + @Override
105 169 public Audit searchNextAuditor(Audit audit) {
106 170 LambdaQueryWrapper<Audit>lambdaQueryWrapper=new LambdaQueryWrapper<>();
107 171 lambdaQueryWrapper.eq(StringUtils.isNotEmpty(audit.getReceiptId()),Audit::getReceiptId,audit.getReceiptId())
... ... @@ -142,6 +206,11 @@ public class AuditServiceImpl extends ServiceImpl&lt;AuditMapper, Audit&gt; implements
142 206 @Override
143 207 @Transactional
144 208 public Result<Audit> createReceiptAuditFlow(Audit audit) {
  209 + //判断入库单有无明细
  210 + List<ReceiptDetail>receiptDetailList=receiptDetailService.selectByMainId(audit.getReceiptId());
  211 + if (receiptDetailList.size()<1){
  212 + return Result.error("当前入库单据,没有单据明细,不能提交审核!");
  213 + }
145 214 //先把提交人加入审核表
146 215 LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
147 216 if (!sysUser.getRealname().equals(audit.getCreateBy())){
... ... @@ -155,6 +224,7 @@ public class AuditServiceImpl extends ServiceImpl&lt;AuditMapper, Audit&gt; implements
155 224 audit0.setAuditor(sysUser.getRealname());
156 225 audit0.setAuditorid(sysUser.getUsername());
157 226 audit0.setSequence(0);
  227 + audit0.setStatus(1);
158 228 if (!this.save(audit0)){
159 229 throw new JeecgBootException("提交审核失败!!");
160 230 }
... ... @@ -164,6 +234,7 @@ public class AuditServiceImpl extends ServiceImpl&lt;AuditMapper, Audit&gt; implements
164 234 audit1.setAuditor(flowDetail.getAuditor());
165 235 audit1.setAuditorid(flowDetail.getAuditorId());
166 236 audit1.setSequence(flowDetail.getSequence());
  237 + audit1.setStatus(0);
167 238 audit1.setReceiptId(String.valueOf(audit.getReceiptId()));
168 239 auditList.add(audit1);
169 240 }
... ... @@ -189,6 +260,61 @@ public class AuditServiceImpl extends ServiceImpl&lt;AuditMapper, Audit&gt; implements
189 260 }
190 261  
191 262 @Override
  263 + public Result<Audit> createShipmentAuditFlow(Audit audit) {
  264 + //判断出库单有无明细
  265 + List<ShipmentDetail>shipmentDetailList=shipmentDetailService.selectByMainId(audit.getShipmentId());
  266 + if (shipmentDetailList.size()<1){
  267 + return Result.error("当前出库单据,没有单据明细,不能提交审核!");
  268 + }
  269 + //先把提交人加入审核表
  270 + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
  271 + if (!sysUser.getRealname().equals(audit.getCreateBy())){
  272 + return Result.error("当前单据提交人,不是单据创建人!!!");
  273 + }
  274 + //查询当前单据是否有审核流程
  275 + List<FlowDetail> flowDetailList=iFlowDetailService.getFlowDetailList(QuantityConstant.SHIPMENT_AUDIT,audit.getType());
  276 + if (flowDetailList.size()>0){
  277 + Audit audit0=new Audit();
  278 + audit0.setShipmentId(String.valueOf(audit.getShipmentId()));
  279 + audit0.setAuditor(sysUser.getRealname());
  280 + audit0.setAuditorid(sysUser.getUsername());
  281 + audit0.setSequence(0);
  282 + audit0.setStatus(1);
  283 + if (!this.save(audit0)){
  284 + throw new JeecgBootException("提交审核失败!!");
  285 + }
  286 + List<Audit>auditList=new ArrayList<>();
  287 + for (FlowDetail flowDetail:flowDetailList){
  288 + Audit audit1=new Audit();
  289 + audit1.setAuditor(flowDetail.getAuditor());
  290 + audit1.setAuditorid(flowDetail.getAuditorId());
  291 + audit1.setSequence(flowDetail.getSequence());
  292 + audit1.setStatus(0);
  293 + audit1.setShipmentId(audit.getShipmentId());
  294 + auditList.add(audit1);
  295 + }
  296 + if(this.saveBatch(auditList)){
  297 + //更新出库单头表,下一个审核人id
  298 + ShipmentHeader shipmentHeader=new ShipmentHeader();
  299 + shipmentHeader.setId(Integer.valueOf(audit.getShipmentId()));
  300 + shipmentHeader.setFirstStatus(QuantityConstant.RECEIPT_HEADER_VERIFYING);
  301 + shipmentHeader.setLastStatus(QuantityConstant.RECEIPT_HEADER_VERIFYING);
  302 + shipmentHeader.setNextAuditor(flowDetailList.get(0).getAuditorId());
  303 + shipmentHeaderService.updateById(shipmentHeader);
  304 + }
  305 + return Result.ok("提交审核成功,下一审核人:"+flowDetailList.get(0).getAuditor());
  306 + }else{
  307 + //没有审核流程,直接审核完成
  308 + ShipmentHeader shipmentHeader=new ShipmentHeader();
  309 + shipmentHeader.setId(Integer.valueOf(audit.getShipmentId()));
  310 + shipmentHeader.setFirstStatus(QuantityConstant.RECEIPT_HEADER_FINSH);
  311 + shipmentHeader.setLastStatus(QuantityConstant.RECEIPT_HEADER_FINSH);
  312 + shipmentHeaderService.updateById(shipmentHeader);
  313 + return Result.ok("当前单据没有审核流程,直接完成!!");
  314 + }
  315 + }
  316 +
  317 + @Override
192 318 public AuditFlow searchAuditFlow(Audit audit) {
193 319 AuditFlow auditFlow=new AuditFlow();
194 320 //查询单据信息
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/parameterConfiguration/controller/ParameterConfigurationController.java
... ... @@ -24,6 +24,7 @@ import lombok.extern.slf4j.Slf4j;
24 24 import org.jeecg.modules.wms.config.parameterConfiguration.entity.ParameterConfiguration;
25 25 import org.jeecg.modules.wms.config.parameterConfiguration.service.IParameterConfigurationService;
26 26 import org.jeecg.utils.StringUtils;
  27 +import org.jeecg.utils.constant.QuantityConstant;
27 28 import org.jeecgframework.poi.excel.ExcelImportUtil;
28 29 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
29 30 import org.jeecgframework.poi.excel.entity.ExportParams;
... ... @@ -169,4 +170,15 @@ public class ParameterConfigurationController extends JeecgController&lt;ParameterC
169 170 return super.importExcel(request, response, ParameterConfiguration.class);
170 171 }
171 172  
  173 + /**
  174 + * 查询审核流程是否开启
  175 + * @param request
  176 + * @param response
  177 + * @return
  178 + */
  179 + @RequestMapping(value = "/getDocumentAduitFlow")
  180 + public Result<?> getDocumentAduitFlow(HttpServletRequest request, HttpServletResponse response) {
  181 + return Result.OK(parameterConfigurationService.getValueByCode(QuantityConstant.RULE_DOCUMEMT_AUDIT_FLOW));
  182 + }
  183 +
172 184 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/flow/controller/FlowHeaderController.java
... ... @@ -96,8 +96,13 @@ public class FlowHeaderController extends JeecgController&lt;FlowHeader, IFlowHeade
96 96 @ApiOperation(value="流程头表-添加", notes="流程头表-添加")
97 97 @PostMapping(value = "/add")
98 98 public Result<String> add(@RequestBody FlowHeader flowHeader) {
99   - flowHeaderService.save(flowHeader);
100   - return Result.OK("添加成功!");
  99 + if (flowHeaderService.getFlowHead(flowHeader.getFlowType(),flowHeader.getDocumentType())){
  100 + flowHeaderService.save(flowHeader);
  101 + return Result.OK("添加成功!");
  102 + }else {
  103 + return Result.error("不能存在相同的流程!!");
  104 + }
  105 +
101 106 }
102 107  
103 108 /**
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/flow/service/IFlowHeaderService.java
... ... @@ -20,11 +20,13 @@ public interface IFlowHeaderService extends IService&lt;FlowHeader&gt; {
20 20 * 删除一对多
21 21 */
22 22 public void delMain (String id);
23   -
  23 +
24 24 /**
25 25 * 批量删除一对多
26 26 */
27 27 public void delBatchMain (Collection<? extends Serializable> idList);
28 28  
  29 + boolean getFlowHead(String flowType,String documentType);
  30 +
29 31  
30 32 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/flow/service/impl/FlowHeaderServiceImpl.java
1 1 package org.jeecg.modules.wms.flow.service.impl;
2 2  
  3 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
3 4 import org.jeecg.modules.wms.flow.entity.FlowHeader;
4 5 import org.jeecg.modules.wms.flow.entity.FlowDetail;
5 6 import org.jeecg.modules.wms.flow.mapper.FlowDetailMapper;
6 7 import org.jeecg.modules.wms.flow.mapper.FlowHeaderMapper;
7 8 import org.jeecg.modules.wms.flow.service.IFlowHeaderService;
  9 +import org.jeecg.utils.StringUtils;
8 10 import org.springframework.stereotype.Service;
9 11 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
10 12 import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -26,7 +28,7 @@ public class FlowHeaderServiceImpl extends ServiceImpl&lt;FlowHeaderMapper, FlowHea
26 28 private FlowHeaderMapper flowHeaderMapper;
27 29 @Autowired
28 30 private FlowDetailMapper flowDetailMapper;
29   -
  31 +
30 32 @Override
31 33 @Transactional
32 34 public void delMain(String id) {
... ... @@ -42,5 +44,17 @@ public class FlowHeaderServiceImpl extends ServiceImpl&lt;FlowHeaderMapper, FlowHea
42 44 flowHeaderMapper.deleteById(id);
43 45 }
44 46 }
45   -
  47 +
  48 + @Override
  49 + public boolean getFlowHead(String flowType, String documentType) {
  50 + LambdaQueryWrapper<FlowHeader>lambdaQueryWrapper=new LambdaQueryWrapper<>();
  51 + lambdaQueryWrapper.eq(StringUtils.isNotEmpty(flowType),FlowHeader::getFlowType,flowType)
  52 + .eq(StringUtils.isNotEmpty(documentType),FlowHeader::getDocumentType,documentType);
  53 + List<FlowHeader>list=this.list(lambdaQueryWrapper);
  54 + if (list.size()<1){
  55 + return true;
  56 + }else{
  57 + return false;
  58 + }
  59 + }
46 60 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/entity/ShipmentHeader.java
... ... @@ -100,4 +100,6 @@ public class ShipmentHeader implements Serializable {
100 100 /** 更新日期 */
101 101 @ApiModelProperty(value = "更新日期")
102 102 private Date updateTime;
  103 + /** 下一个人的审核账号 */
  104 + private String nextAuditor;
103 105 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java
... ... @@ -480,6 +480,7 @@ public class QuantityConstant {
480 480 public static final String EXCEPTION_TO_CACHE = "exceptionToCache";
481 481 public static final String CONTAINER_SPEC = "containerSpec";
482 482 public static final String LOCAL_SERVER_IP = "localServerIP";
  483 + public static final String RULE_DOCUMEMT_AUDIT_FLOW = "documentAduitFlow";
483 484  
484 485 public static final String EMPTY_ROADWAY_DEFAULT = "emptyRoadWayDefault";
485 486  
... ...