Commit 6b540ec59e2c776d4dc5c8a70d007824534ab972

Authored by 陈翱
1 parent 787e3ec7

审核流程配置,入库单审核

Showing 26 changed files with 1943 additions and 2 deletions
ant-design-vue-jeecg/src/views/system/flow/FlowDetailList.vue 0 → 100644
  1 +<template>
  2 + <a-card :bordered="false" :class="'cust-erp-sub-tab'">
  3 + <!-- 操作按钮区域 -->
  4 + <div class="table-operator" v-if="mainId">
  5 + <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  6 + <a-button type="primary" icon="download" @click="handleExportXls('流程配置明细')">导出</a-button>
  7 + <a-upload
  8 + name="file"
  9 + :showUploadList="false"
  10 + :multiple="false"
  11 + :headers="tokenHeader"
  12 + :action="importExcelUrl"
  13 + @change="handleImportExcel">
  14 + <a-button type="primary" icon="import">导入</a-button>
  15 + </a-upload>
  16 + <a-dropdown v-if="selectedRowKeys.length > 0">
  17 + <a-menu slot="overlay">
  18 + <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  19 + </a-menu>
  20 + <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  21 + </a-dropdown>
  22 + </div>
  23 +
  24 + <!-- table区域-begin -->
  25 + <div>
  26 + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  27 + <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  28 + <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  29 + </div>
  30 +
  31 + <a-table
  32 + ref="table"
  33 + size="middle"
  34 + bordered
  35 + rowKey="id"
  36 + :scroll="{x:true}"
  37 + :columns="columns"
  38 + :dataSource="dataSource"
  39 + :pagination="ipagination"
  40 + :loading="loading"
  41 + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  42 + @change="handleTableChange">
  43 +
  44 + <template slot="htmlSlot" slot-scope="text">
  45 + <div v-html="text"></div>
  46 + </template>
  47 + <template slot="imgSlot" slot-scope="text">
  48 + <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  49 + <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  50 + </template>
  51 + <template slot="fileSlot" slot-scope="text">
  52 + <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  53 + <a-button
  54 + v-else
  55 + :ghost="true"
  56 + type="primary"
  57 + icon="download"
  58 + size="small"
  59 + @click="downloadFile(text)">
  60 + 下载
  61 + </a-button>
  62 + </template>
  63 +
  64 + <span slot="action" slot-scope="text, record">
  65 + <a @click="handleEdit(record)">编辑</a>
  66 + <a-divider type="vertical" />
  67 + <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  68 + <a>删除</a>
  69 + </a-popconfirm>
  70 + </span>
  71 +
  72 + </a-table>
  73 + </div>
  74 +
  75 + <flowDetail-modal ref="modalForm" @ok="modalFormOk" :mainId="mainId"></flowDetail-modal>
  76 + </a-card>
  77 +</template>
  78 +
  79 +<script>
  80 +
  81 + import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  82 + import FlowDetailModal from './modules/FlowDetailModal'
  83 +
  84 + export default {
  85 + name: "FlowDetailList",
  86 + mixins:[JeecgListMixin],
  87 + components: { FlowDetailModal },
  88 + props:{
  89 + mainId:{
  90 + type:String,
  91 + default:'',
  92 + required:false
  93 + }
  94 + },
  95 + watch:{
  96 + mainId:{
  97 + immediate: true,
  98 + handler(val) {
  99 + if(!this.mainId){
  100 + this.clearList()
  101 + }else{
  102 + this.queryParam['headId'] = val
  103 + this.loadData(1);
  104 + }
  105 + }
  106 + }
  107 + },
  108 + data () {
  109 + return {
  110 + description: '流程头表管理页面',
  111 + disableMixinCreated:true,
  112 + // 表头
  113 + columns: [
  114 + {
  115 + title: '#',
  116 + dataIndex: '',
  117 + key:'rowIndex',
  118 + width:60,
  119 + align:"center",
  120 + customRender:function (t,r,index) {
  121 + return parseInt(index)+1;
  122 + }
  123 + },
  124 + {
  125 + title:'审核人',
  126 + align:"center",
  127 + dataIndex: 'auditor'
  128 + },
  129 + {
  130 + title:'审核顺序',
  131 + align:"center",
  132 + dataIndex: 'sequence'
  133 + },
  134 + {
  135 + title:'备注',
  136 + align:"center",
  137 + dataIndex: 'remark'
  138 + },
  139 + {
  140 + title: '操作',
  141 + dataIndex: 'action',
  142 + align:"center",
  143 + fixed:"right",
  144 + width:147,
  145 + scopedSlots: { customRender: 'action' },
  146 + }
  147 + ],
  148 + url: {
  149 + list: "/flow/flowHeader/listFlowDetailByMainId",
  150 + delete: "/flow/flowHeader/deleteFlowDetail",
  151 + deleteBatch: "/flow/flowHeader/deleteBatchFlowDetail",
  152 + exportXlsUrl: "/flow/flowHeader/exportFlowDetail",
  153 + importUrl: "/flow/flowHeader/importFlowDetail",
  154 + },
  155 + dictOptions:{
  156 + }
  157 + }
  158 + },
  159 + created() {
  160 + },
  161 + computed: {
  162 + importExcelUrl(){
  163 + return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`;
  164 + }
  165 + },
  166 + methods: {
  167 + clearList(){
  168 + this.dataSource=[]
  169 + this.selectedRowKeys=[]
  170 + this.ipagination.current = 1
  171 + }
  172 +
  173 + }
  174 + }
  175 +</script>
  176 +<style scoped>
  177 + @import '~@assets/less/common.less'
  178 +</style>
... ...
ant-design-vue-jeecg/src/views/system/flow/FlowHeaderList.vue 0 → 100644
  1 +<template>
  2 + <a-card :bordered="false">
  3 + <!-- 查询区域 -->
  4 + <div class="table-page-search-wrapper">
  5 + <a-form layout="inline" @keyup.enter.native="searchQuery">
  6 + <a-row :gutter="24">
  7 + </a-row>
  8 + </a-form>
  9 + </div>
  10 + <!-- 查询区域-END -->
  11 +
  12 + <!-- 操作按钮区域 -->
  13 + <div class="table-operator">
  14 + <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  15 + <a-button type="primary" icon="download" @click="handleExportXls('流程头表')">导出</a-button>
  16 + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  17 + <a-button type="primary" icon="import">导入</a-button>
  18 + </a-upload>
  19 + <!-- 高级查询区域 -->
  20 + <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
  21 + </div>
  22 +
  23 + <!-- table区域-begin -->
  24 + <div>
  25 + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  26 + <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  27 + <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  28 + </div>
  29 +
  30 + <a-table
  31 + ref="table"
  32 + size="middle"
  33 + bordered
  34 + rowKey="id"
  35 + class="j-table-force-nowrap"
  36 + :scroll="{x:true}"
  37 + :columns="columns"
  38 + :dataSource="dataSource"
  39 + :pagination="ipagination"
  40 + :loading="loading"
  41 + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}"
  42 + :customRow="clickThenSelect"
  43 + @change="handleTableChange">
  44 +
  45 + <template slot="htmlSlot" slot-scope="text">
  46 + <div v-html="text"></div>
  47 + </template>
  48 + <template slot="imgSlot" slot-scope="text">
  49 + <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  50 + <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  51 + </template>
  52 + <template slot="fileSlot" slot-scope="text">
  53 + <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  54 + <a-button
  55 + v-else
  56 + :ghost="true"
  57 + type="primary"
  58 + icon="download"
  59 + size="small"
  60 + @click="downloadFile(text)">
  61 + 下载
  62 + </a-button>
  63 + </template>
  64 +
  65 + <span slot="action" slot-scope="text, record">
  66 + <a @click="handleEdit(record)">编辑</a>
  67 +
  68 + <a-divider type="vertical" />
  69 + <a-dropdown>
  70 + <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  71 + <a-menu slot="overlay">
  72 + <a-menu-item>
  73 + <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  74 + <a>删除</a>
  75 + </a-popconfirm>
  76 + </a-menu-item>
  77 + </a-menu>
  78 + </a-dropdown>
  79 + </span>
  80 +
  81 + </a-table>
  82 + </div>
  83 +
  84 + <a-tabs defaultActiveKey="1">
  85 + <a-tab-pane tab="流程配置明细" key="1" >
  86 + <FlowDetailList :mainId="selectedMainId" />
  87 + </a-tab-pane>
  88 + </a-tabs>
  89 +
  90 + <flowHeader-modal ref="modalForm" @ok="modalFormOk"></flowHeader-modal>
  91 + </a-card>
  92 +</template>
  93 +
  94 +<script>
  95 +
  96 + import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  97 + import FlowHeaderModal from './modules/FlowHeaderModal'
  98 + import { getAction } from '@/api/manage'
  99 + import FlowDetailList from './FlowDetailList'
  100 + import '@/assets/less/TableExpand.less'
  101 +
  102 + export default {
  103 + name: "FlowHeaderList",
  104 + mixins:[JeecgListMixin],
  105 + components: {
  106 + FlowDetailList,
  107 + FlowHeaderModal
  108 + },
  109 + data () {
  110 + return {
  111 + description: '流程头表管理页面',
  112 + // 表头
  113 + columns: [
  114 + {
  115 + title:'流程名称',
  116 + align:"center",
  117 + dataIndex: 'flowName'
  118 + },
  119 + {
  120 + title:'流程类型',
  121 + align:"center",
  122 + dataIndex: 'flowType_dictText'
  123 + },
  124 + {
  125 + title:'单据类型',
  126 + align:"center",
  127 + dataIndex: 'documentType',
  128 + },
  129 + {
  130 + title:'状态',
  131 + align:"center",
  132 + dataIndex: 'flowStatus_dictText'
  133 + },
  134 + {
  135 + title: '操作',
  136 + dataIndex: 'action',
  137 + align:"center",
  138 + fixed:"right",
  139 + width:147,
  140 + scopedSlots: { customRender: 'action' },
  141 + }
  142 + ],
  143 + url: {
  144 + list: "/flow/flowHeader/list",
  145 + delete: "/flow/flowHeader/delete",
  146 + deleteBatch: "/flow/flowHeader/deleteBatch",
  147 + exportXlsUrl: "/flow/flowHeader/exportXls",
  148 + importExcelUrl: "flow/flowHeader/importExcel",
  149 + },
  150 + dictOptions:{
  151 + },
  152 + /* 分页参数 */
  153 + ipagination:{
  154 + current: 1,
  155 + pageSize: 5,
  156 + pageSizeOptions: ['5', '10', '50'],
  157 + showTotal: (total, range) => {
  158 + return range[0] + "-" + range[1] + " 共" + total + "条"
  159 + },
  160 + showQuickJumper: true,
  161 + showSizeChanger: true,
  162 + total: 0
  163 + },
  164 + selectedMainId:'',
  165 + superFieldList:[],
  166 + }
  167 + },
  168 + created() {
  169 + this.getSuperFieldList();
  170 + },
  171 + computed: {
  172 + importExcelUrl: function(){
  173 + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  174 + }
  175 + },
  176 + methods: {
  177 + initDictConfig(){
  178 + },
  179 + clickThenSelect(record) {
  180 + return {
  181 + on: {
  182 + click: () => {
  183 + this.onSelectChange(record.id.split(","), [record]);
  184 + }
  185 + }
  186 + }
  187 + },
  188 + onClearSelected() {
  189 + this.selectedRowKeys = [];
  190 + this.selectionRows = [];
  191 + this.selectedMainId=''
  192 + },
  193 + onSelectChange(selectedRowKeys, selectionRows) {
  194 + this.selectedMainId=selectedRowKeys[0]
  195 + this.selectedRowKeys = selectedRowKeys;
  196 + this.selectionRows = selectionRows;
  197 + },
  198 + loadData(arg) {
  199 + if(!this.url.list){
  200 + this.$message.error("请设置url.list属性!")
  201 + return
  202 + }
  203 + //加载数据 若传入参数1则加载第一页的内容
  204 + if (arg === 1) {
  205 + this.ipagination.current = 1;
  206 + }
  207 + this.onClearSelected()
  208 + var params = this.getQueryParams();//查询条件
  209 + this.loading = true;
  210 + getAction(this.url.list, params).then((res) => {
  211 + if (res.success) {
  212 + this.dataSource = res.result.records;
  213 + this.ipagination.total = res.result.total;
  214 + }
  215 + if(res.code===510){
  216 + this.$message.warning(res.message)
  217 + }
  218 + this.loading = false;
  219 + })
  220 + },
  221 + getSuperFieldList(){
  222 + let fieldList=[];
  223 + fieldList.push({type:'string',value:'flowName',text:'流程名称',dictCode:''})
  224 + fieldList.push({type:'string',value:'flowType',text:'流程类型',dictCode:''})
  225 + fieldList.push({type:'string',value:'documentType',text:'单据类型',dictCode:''})
  226 + fieldList.push({type:'int',value:'status',text:'状态',dictCode:''})
  227 + this.superFieldList = fieldList
  228 + }
  229 + }
  230 + }
  231 +</script>
  232 +<style scoped>
  233 + @import '~@assets/less/common.less'
  234 +</style>
0 235 \ No newline at end of file
... ...
ant-design-vue-jeecg/src/views/system/flow/modules/FlowDetailModal.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" :rules="validatorRules">
  13 + <a-row>
  14 + <a-col :span="24">
  15 + <a-form-model-item label="选择审核人" prop="multiUser" :labelCol="labelCol" :wrapperCol="wrapperCol">
  16 + <j-select-multi-user v-model="model.auditorId" :query-config="selectUserQueryConfig"/>
  17 + </a-form-model-item>
  18 + </a-col>
  19 +
  20 + <a-col v-if="this.flag" :span="24">
  21 + <a-form-model-item label="审核顺序" prop="multiUser" :labelCol="labelCol" :wrapperCol="wrapperCol">
  22 + <a-input v-model="model.sequence"placeholder="请输入顺序" ></a-input>
  23 + </a-form-model-item>
  24 + </a-col>
  25 +
  26 + <a-col :span="24">
  27 + <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark">
  28 + <a-input v-model="model.remark"placeholder="请输入备注" ></a-input>
  29 + </a-form-model-item>
  30 + </a-col>
  31 +
  32 + </a-row>
  33 + </a-form-model>
  34 + </a-spin>
  35 + </j-modal>
  36 +</template>
  37 +
  38 +<script>
  39 +
  40 + import { httpAction } from '@/api/manage'
  41 + import { validateDuplicateValue } from '@/utils/util'
  42 +
  43 + export default {
  44 + name: "FlowDetailModal",
  45 + components: {
  46 + },
  47 + props:{
  48 + mainId:{
  49 + type:String,
  50 + required:false,
  51 + default:''
  52 + }
  53 + },
  54 + data () {
  55 + return {
  56 + title:"操作",
  57 + width:800,
  58 + visible: false,
  59 + flag:false,
  60 + model:{
  61 + },
  62 + labelCol: {
  63 + xs: { span: 24 },
  64 + sm: { span: 5 },
  65 + },
  66 + wrapperCol: {
  67 + xs: { span: 24 },
  68 + sm: { span: 16 },
  69 + },
  70 + // 选择用户查询条件配置
  71 + selectUserQueryConfig: [
  72 + {key: 'phone', label: '电话'},
  73 + ],
  74 + confirmLoading: false,
  75 + validatorRules: {
  76 + },
  77 + url: {
  78 + add: "/flow/flowHeader/addFlowDetail",
  79 + edit: "/flow/flowHeader/editFlowDetail",
  80 + }
  81 +
  82 + }
  83 + },
  84 + created () {
  85 + //备份model原始值
  86 + this.modelDefault = JSON.parse(JSON.stringify(this.model));
  87 + },
  88 + methods: {
  89 + add () {
  90 + this.edit(this.modelDefault,'0');
  91 + },
  92 + edit (record,str) {
  93 + if (str!='0'){
  94 + this.flag=true;
  95 + }
  96 + this.model = Object.assign({}, record);
  97 + this.visible = true;
  98 + },
  99 + close () {
  100 + this.$emit('close');
  101 + this.visible = false;
  102 + this.$refs.form.clearValidate();
  103 + },
  104 + handleOk () {
  105 + const that = this;
  106 + // 触发表单验证
  107 + this.$refs.form.validate(valid => {
  108 + if (valid) {
  109 + that.confirmLoading = true;
  110 + let httpurl = '';
  111 + let method = '';
  112 + if(!this.model.id){
  113 + httpurl+=this.url.add;
  114 + method = 'post';
  115 + }else{
  116 + let strArr=this.model.auditorId.split(',');
  117 + if(strArr.length>1){
  118 + that.$message.error("编辑时,只能选择单个审核人!!");
  119 + that.confirmLoading = false;
  120 + that.close();
  121 + return false;
  122 + }
  123 + httpurl+=this.url.edit;
  124 + method = 'put';
  125 + }
  126 + this.model['headId'] = this.mainId
  127 + httpAction(httpurl,this.model,method).then((res)=>{
  128 + if(res.success){
  129 + that.$message.success(res.message);
  130 + that.$emit('ok');
  131 + }else{
  132 + that.$message.warning(res.message);
  133 + }
  134 + }).finally(() => {
  135 + that.confirmLoading = false;
  136 + that.close();
  137 + })
  138 + }else{
  139 + return false
  140 + }
  141 + })
  142 + },
  143 + handleCancel () {
  144 + this.close()
  145 + },
  146 +
  147 +
  148 + }
  149 + }
  150 +</script>
... ...
ant-design-vue-jeecg/src/views/system/flow/modules/FlowHeaderModal.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" :rules="validatorRules">
  13 + <a-row>
  14 + <a-col :span="24">
  15 + <a-form-model-item label="流程名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="flowName">
  16 + <a-input v-model="model.flowName" placeholder="请输入流程名称" ></a-input>
  17 + </a-form-model-item>
  18 + </a-col>
  19 + <a-col :span="24">
  20 + <a-form-model-item label="流程类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="flowType">
  21 + <j-dict-select-tag placeholder="请选择流程类型" v-model="model.flowType" dictCode="flowType" @change="getDocumentTypeList"/>
  22 + </a-form-model-item>
  23 + </a-col>
  24 + <a-col :span="24">
  25 + <a-form-model-item label="单据类型" :labelCol="labelCol" :wrapperCol="wrapperCol" >
  26 + <a-select
  27 + show-search
  28 + placeholder="请选择单据类型"
  29 + option-filter-prop="children"
  30 + v-model="model.documentType">
  31 + <a-select-option v-for="item in documentTypeList" :key="item.name" :value="item.code">{{
  32 + item.name
  33 + }}
  34 + </a-select-option>
  35 + </a-select>
  36 + </a-form-model-item>
  37 + </a-col>
  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"/>
  41 + </a-form-model-item>
  42 + </a-col>
  43 + </a-row>
  44 + </a-form-model>
  45 + </a-spin>
  46 + </j-modal>
  47 +</template>
  48 +
  49 +<script>
  50 +
  51 + import { httpAction } from '@/api/manage'
  52 + import { validateDuplicateValue } from '@/utils/util'
  53 + import {getReceiptTypeList,getShipmentTypeList} from '@/api/api'
  54 +
  55 + export default {
  56 + name: "FlowHeaderModal",
  57 + components: {
  58 + },
  59 + data () {
  60 + return {
  61 + title:"操作",
  62 + width:800,
  63 + visible: false,
  64 + documentTypeList:[],
  65 + model:{
  66 + },
  67 + labelCol: {
  68 + xs: { span: 24 },
  69 + sm: { span: 5 },
  70 + },
  71 + wrapperCol: {
  72 + xs: { span: 24 },
  73 + sm: { span: 16 },
  74 + },
  75 +
  76 + confirmLoading: false,
  77 +validatorRules: {
  78 + flowName: [
  79 + { required: true, message: '请输入流程名称!'},
  80 + ],
  81 + flowType: [
  82 + { required: true, message: '请输入流程类型!'},
  83 + ],
  84 +},
  85 + url: {
  86 + add: "/flow/flowHeader/add",
  87 + edit: "/flow/flowHeader/edit",
  88 + }
  89 +
  90 + }
  91 + },
  92 + created () {
  93 + //备份model原始值
  94 + this.modelDefault = JSON.parse(JSON.stringify(this.model));
  95 + },
  96 + methods: {
  97 + add () {
  98 + this.edit(this.modelDefault);
  99 + },
  100 + edit (record) {
  101 + this.model = Object.assign({}, record);
  102 + this.updateDocumentTypeList(record.flowType);
  103 + this.visible = true;
  104 + },
  105 + close () {
  106 + this.$emit('close');
  107 + this.visible = false;
  108 + this.$refs.form.clearValidate();
  109 + },
  110 + getDocumentTypeList(){
  111 + this.updateDocumentTypeList(this.model.flowType);
  112 + },
  113 +
  114 + updateDocumentTypeList(code){
  115 + this.documentTypeList=[];
  116 + if(code=='1'){
  117 + getReceiptTypeList().then((res) => {
  118 + if (res.success) {
  119 + this.documentTypeList = res.result
  120 + }
  121 + });
  122 + }
  123 + if(code=='2'){
  124 + getShipmentTypeList().then((res) => {
  125 + if (res.success) {
  126 + this.documentTypeList = res.result
  127 + }
  128 + });
  129 + }
  130 + },
  131 + handleOk () {
  132 + const that = this;
  133 + // 触发表单验证
  134 + this.$refs.form.validate(valid => {
  135 + if (valid) {
  136 + that.confirmLoading = true;
  137 + let httpurl = '';
  138 + let method = '';
  139 + if(!this.model.id){
  140 + httpurl+=this.url.add;
  141 + method = 'post';
  142 + }else{
  143 + httpurl+=this.url.edit;
  144 + method = 'put';
  145 + }
  146 + httpAction(httpurl,this.model,method).then((res)=>{
  147 + if(res.success){
  148 + that.$message.success(res.message);
  149 + that.$emit('ok');
  150 + }else{
  151 + that.$message.warning(res.message);
  152 + }
  153 + }).finally(() => {
  154 + that.confirmLoading = false;
  155 + that.close();
  156 + })
  157 + }else{
  158 + return false
  159 + }
  160 + })
  161 + },
  162 + handleCancel () {
  163 + this.close()
  164 + },
  165 +
  166 +
  167 + }
  168 + }
  169 +</script>
0 170 \ No newline at end of file
... ...
ant-design-vue-jeecg/src/views/system/receipt/ReceiptHeaderList.vue
... ... @@ -176,7 +176,8 @@
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" @click="receive(record)" v-has="'receiptHeader:receive'"><a-button type="primary">组盘</a-button><a-divider type="vertical"/></a>
  179 + <a v-if="record.lastStatus < 800 && record.nextAuditor ==null " @click="receive(record)" v-has="'receiptHeader:receive'"><a-button type="primary">组盘</a-button><a-divider type="vertical"/></a>
  180 + <a v-if="record.nextAuditor == username " @click="audit(record)"><a-button type="primary">审核</a-button><a-divider type="vertical"/></a>
180 181 <a v-if="record.lastStatus == 850" @click="viewReason(record)"><a-button type="danger">原因</a-button><a-divider type="vertical"/></a>
181 182 <a-dropdown>
182 183 <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
... ... @@ -205,6 +206,7 @@
205 206  
206 207 <receiptHeader-modal ref="modalForm" @ok="modalFormOk"></receiptHeader-modal>
207 208 <receive-modal ref="modalForm2" @ok="modalFormOk"></receive-modal>
  209 + <receipt-audit-modal ref="auditForm"></receipt-audit-modal>
208 210 </a-card>
209 211 </template>
210 212  
... ... @@ -212,6 +214,7 @@
212 214  
213 215 import {JeecgListMixin} from '@/mixins/JeecgListMixin'
214 216 import ReceiptHeaderModal from './modules/ReceiptHeaderModal'
  217 +import ReceiptAuditModal from "./modules/ReceiptAuditModal";
215 218 import {getAction} from '@/api/manage'
216 219 import ReceiptDetailList from './ReceiptDetailList'
217 220 import {initDictOptions, filterMultiDictText} from '@/components/dict/JDictSelectUtil'
... ... @@ -221,15 +224,18 @@ import {getReceiptTypeList} from &#39;@/api/api&#39;
221 224 import {getSupplierList, backErpReceipt} from '@/api/api'
222 225 import ReceiveModal from "./modules/ReceiveModal";
223 226 import { notification } from 'ant-design-vue';
  227 +import store from '@/store'
224 228  
225 229  
226 230 export default {
227 231 name: "ReceiptHeaderList",
228 232 mixins: [JeecgListMixin],
229 233 components: {
  234 + ReceiptAuditModal,
230 235 ReceiveModal,
231 236 ReceiptDetailList,
232   - ReceiptHeaderModal
  237 + ReceiptHeaderModal,
  238 + username:''
233 239 },
234 240 data() {
235 241 return {
... ... @@ -364,6 +370,7 @@ export default {
364 370 created() {
365 371 this.getSuperFieldList();
366 372 this.loadFrom();
  373 + this.username = store.getters.userInfo.username
367 374 },
368 375 computed: {
369 376 importExcelUrl: function () {
... ... @@ -410,6 +417,10 @@ export default {
410 417 this.selectionRows = [];
411 418 this.selectedMainId = ''
412 419 },
  420 + audit(record){
  421 + this.$refs.auditForm.edit(record)
  422 +
  423 + },
413 424 onSelectChange(selectedRowKeys, selectionRows) {
414 425 this.selectedMainId = selectedRowKeys[0].toString();
415 426 this.selectedRowKeys = selectedRowKeys;
... ...
ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiptAuditModal.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" :rules="validatorRules">
  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 {validateDuplicateValue} from '@/utils/util'
  38 +import {getCompanyList} from '@/api/api'
  39 +import {getReceiptTypeList} from '@/api/api'
  40 +import {getSupplierList} from '@/api/api'
  41 +
  42 +export default {
  43 + name: "ReceiptAuditModal",
  44 + components: {},
  45 + data() {
  46 + return {
  47 + title: "操作",
  48 + width: 800,
  49 + visible: false,
  50 + model: {},
  51 + labelCol: {
  52 + xs: {span: 24},
  53 + sm: {span: 5},
  54 + },
  55 + wrapperCol: {
  56 + xs: {span: 24},
  57 + sm: {span: 16},
  58 + },
  59 +
  60 + confirmLoading: false,
  61 + url: {
  62 + add: "/receipt/receiptHeader/add",
  63 + edit: "/receipt/receiptHeader/edit",
  64 + }
  65 +
  66 + }
  67 + },
  68 + created() {
  69 + //备份model原始值
  70 + this.modelDefault = JSON.parse(JSON.stringify(this.model));
  71 + },
  72 + methods: {
  73 + edit(record) {
  74 + this.model = Object.assign({}, record);
  75 + this.visible = true;
  76 + },
  77 + close() {
  78 + this.$emit('close');
  79 + this.visible = false;
  80 + this.$refs.form.clearValidate();
  81 + },
  82 + handleOk() {
  83 + const that = this;
  84 + // 触发表单验证
  85 + this.$refs.form.validate(valid => {
  86 + if (valid) {
  87 + that.confirmLoading = true;
  88 + let httpurl = '';
  89 + let method = '';
  90 + if (!this.model.id) {
  91 + httpurl += this.url.add;
  92 + method = 'post';
  93 + } else {
  94 + httpurl += this.url.edit;
  95 + method = 'put';
  96 + }
  97 + httpAction(httpurl, this.model, method).then((res) => {
  98 + if (res.success) {
  99 + that.$message.success(res.message);
  100 + that.$emit('ok');
  101 + } else {
  102 + that.$message.warning(res.message);
  103 + }
  104 + }).finally(() => {
  105 + that.confirmLoading = false;
  106 + that.close();
  107 + })
  108 + } else {
  109 + return false
  110 + }
  111 + })
  112 + },
  113 + handleCancel() {
  114 + this.close()
  115 + },
  116 +
  117 +
  118 + }
  119 +}
  120 +</script>
0 121 \ No newline at end of file
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/audit/controller/AuditController.java 0 → 100644
  1 +package org.jeecg.modules.wms.audit.controller;
  2 +
  3 +import java.util.Arrays;
  4 +import java.util.List;
  5 +import java.util.Map;
  6 +import java.util.stream.Collectors;
  7 +import java.io.IOException;
  8 +import java.io.UnsupportedEncodingException;
  9 +import java.net.URLDecoder;
  10 +import javax.servlet.http.HttpServletRequest;
  11 +import javax.servlet.http.HttpServletResponse;
  12 +import org.jeecg.common.api.vo.Result;
  13 +import org.jeecg.common.system.query.QueryGenerator;
  14 +import org.jeecg.common.util.oConvertUtils;
  15 +import org.jeecg.modules.wms.audit.entity.Audit;
  16 +import org.jeecg.modules.wms.audit.service.IAuditService;
  17 +
  18 +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  19 +import com.baomidou.mybatisplus.core.metadata.IPage;
  20 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  21 +import lombok.extern.slf4j.Slf4j;
  22 +
  23 +import org.jeecgframework.poi.excel.ExcelImportUtil;
  24 +import org.jeecgframework.poi.excel.def.NormalExcelConstants;
  25 +import org.jeecgframework.poi.excel.entity.ExportParams;
  26 +import org.jeecgframework.poi.excel.entity.ImportParams;
  27 +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
  28 +import org.jeecg.common.system.base.controller.JeecgController;
  29 +import org.springframework.beans.factory.annotation.Autowired;
  30 +import org.springframework.web.bind.annotation.*;
  31 +import org.springframework.web.multipart.MultipartFile;
  32 +import org.springframework.web.multipart.MultipartHttpServletRequest;
  33 +import org.springframework.web.servlet.ModelAndView;
  34 +import com.alibaba.fastjson.JSON;
  35 +import io.swagger.annotations.Api;
  36 +import io.swagger.annotations.ApiOperation;
  37 +import org.jeecg.common.aspect.annotation.AutoLog;
  38 +
  39 + /**
  40 + * @Description: 审核表
  41 + * @Author: jeecg-boot
  42 + * @Date: 2023-07-26
  43 + * @Version: V1.0
  44 + */
  45 +@Api(tags="审核表")
  46 +@RestController
  47 +@RequestMapping("/audit/audit")
  48 +@Slf4j
  49 +public class AuditController extends JeecgController<Audit, IAuditService> {
  50 + @Autowired
  51 + private IAuditService auditService;
  52 +
  53 + /**
  54 + * 分页列表查询
  55 + *
  56 + * @param audit
  57 + * @param pageNo
  58 + * @param pageSize
  59 + * @param req
  60 + * @return
  61 + */
  62 + //@AutoLog(value = "审核表-分页列表查询")
  63 + @ApiOperation(value="审核表-分页列表查询", notes="审核表-分页列表查询")
  64 + @GetMapping(value = "/list")
  65 + public Result<IPage<Audit>> queryPageList(Audit audit,
  66 + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
  67 + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
  68 + HttpServletRequest req) {
  69 + QueryWrapper<Audit> queryWrapper = QueryGenerator.initQueryWrapper(audit, req.getParameterMap());
  70 + Page<Audit> page = new Page<Audit>(pageNo, pageSize);
  71 + IPage<Audit> pageList = auditService.page(page, queryWrapper);
  72 + return Result.OK(pageList);
  73 + }
  74 +
  75 + /**
  76 + * 添加
  77 + *
  78 + * @param audit
  79 + * @return
  80 + */
  81 + @AutoLog(value = "审核表-添加")
  82 + @ApiOperation(value="审核表-添加", notes="审核表-添加")
  83 + @PostMapping(value = "/add")
  84 + public Result<String> add(@RequestBody Audit audit) {
  85 + auditService.save(audit);
  86 + return Result.OK("添加成功!");
  87 + }
  88 +
  89 + /**
  90 + * 编辑
  91 + *
  92 + * @param audit
  93 + * @return
  94 + */
  95 + @AutoLog(value = "审核表-编辑")
  96 + @ApiOperation(value="审核表-编辑", notes="审核表-编辑")
  97 + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
  98 + public Result<String> edit(@RequestBody Audit audit) {
  99 + auditService.updateById(audit);
  100 + return Result.OK("编辑成功!");
  101 + }
  102 +
  103 + /**
  104 + * 通过id删除
  105 + *
  106 + * @param id
  107 + * @return
  108 + */
  109 + @AutoLog(value = "审核表-通过id删除")
  110 + @ApiOperation(value="审核表-通过id删除", notes="审核表-通过id删除")
  111 + @DeleteMapping(value = "/delete")
  112 + public Result<String> delete(@RequestParam(name="id",required=true) String id) {
  113 + auditService.removeById(id);
  114 + return Result.OK("删除成功!");
  115 + }
  116 +
  117 + /**
  118 + * 批量删除
  119 + *
  120 + * @param ids
  121 + * @return
  122 + */
  123 + @AutoLog(value = "审核表-批量删除")
  124 + @ApiOperation(value="审核表-批量删除", notes="审核表-批量删除")
  125 + @DeleteMapping(value = "/deleteBatch")
  126 + public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
  127 + this.auditService.removeByIds(Arrays.asList(ids.split(",")));
  128 + return Result.OK("批量删除成功!");
  129 + }
  130 +
  131 + /**
  132 + * 通过id查询
  133 + *
  134 + * @param id
  135 + * @return
  136 + */
  137 + //@AutoLog(value = "审核表-通过id查询")
  138 + @ApiOperation(value="审核表-通过id查询", notes="审核表-通过id查询")
  139 + @GetMapping(value = "/queryById")
  140 + public Result<Audit> queryById(@RequestParam(name="id",required=true) String id) {
  141 + Audit audit = auditService.getById(id);
  142 + if(audit==null) {
  143 + return Result.error("未找到对应数据");
  144 + }
  145 + return Result.OK(audit);
  146 + }
  147 +
  148 + /**
  149 + * 导出excel
  150 + *
  151 + * @param request
  152 + * @param audit
  153 + */
  154 + @RequestMapping(value = "/exportXls")
  155 + public ModelAndView exportXls(HttpServletRequest request, Audit audit) {
  156 + return super.exportXls(request, audit, Audit.class, "审核表");
  157 + }
  158 +
  159 + /**
  160 + * 通过excel导入数据
  161 + *
  162 + * @param request
  163 + * @param response
  164 + * @return
  165 + */
  166 + @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
  167 + public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
  168 + return super.importExcel(request, response, Audit.class);
  169 + }
  170 +
  171 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/audit/entity/Audit.java 0 → 100644
  1 +package org.jeecg.modules.wms.audit.entity;
  2 +
  3 +import java.io.Serializable;
  4 +import java.io.UnsupportedEncodingException;
  5 +import java.util.Date;
  6 +import java.math.BigDecimal;
  7 +import com.baomidou.mybatisplus.annotation.IdType;
  8 +import com.baomidou.mybatisplus.annotation.TableId;
  9 +import com.baomidou.mybatisplus.annotation.TableName;
  10 +import lombok.Data;
  11 +import com.fasterxml.jackson.annotation.JsonFormat;
  12 +import org.springframework.format.annotation.DateTimeFormat;
  13 +import org.jeecgframework.poi.excel.annotation.Excel;
  14 +import org.jeecg.common.aspect.annotation.Dict;
  15 +import io.swagger.annotations.ApiModel;
  16 +import io.swagger.annotations.ApiModelProperty;
  17 +import lombok.EqualsAndHashCode;
  18 +import lombok.experimental.Accessors;
  19 +
  20 +/**
  21 + * @Description: 审核表
  22 + * @Author: jeecg-boot
  23 + * @Date: 2023-07-26
  24 + * @Version: V1.0
  25 + */
  26 +@Data
  27 +@TableName("audit")
  28 +@Accessors(chain = true)
  29 +@EqualsAndHashCode(callSuper = false)
  30 +@ApiModel(value="audit对象", description="审核表")
  31 +public class Audit implements Serializable {
  32 + private static final long serialVersionUID = 1L;
  33 +
  34 + /**主键*/
  35 + @TableId(type = IdType.ASSIGN_ID)
  36 + @ApiModelProperty(value = "主键")
  37 + private String id;
  38 + /**创建人*/
  39 + @ApiModelProperty(value = "创建人")
  40 + private String createBy;
  41 + /**创建日期*/
  42 + @ApiModelProperty(value = "创建日期")
  43 + private Date createTime;
  44 + /**更新人*/
  45 + @ApiModelProperty(value = "更新人")
  46 + private String updateBy;
  47 + /**更新日期*/
  48 + @ApiModelProperty(value = "更新日期")
  49 + private Date updateTime;
  50 + /**入库单头id*/
  51 + @Excel(name = "入库单头id", width = 15)
  52 + @ApiModelProperty(value = "入库单头id")
  53 + private String receiptId;
  54 + /**出库单id*/
  55 + @Excel(name = "出库单id", width = 15)
  56 + @ApiModelProperty(value = "出库单id")
  57 + private String shipmentId;
  58 + /**审核人*/
  59 + @Excel(name = "审核人", width = 15)
  60 + @ApiModelProperty(value = "审核人")
  61 + private String auditor;
  62 + /**审核人账号*/
  63 + @Excel(name = "审核人账号", width = 15)
  64 + @ApiModelProperty(value = "审核人账号")
  65 + private String auditorid;
  66 + /**审核序号*/
  67 + @Excel(name = "审核序号", width = 15)
  68 + @ApiModelProperty(value = "审核序号")
  69 + private Integer sequence;
  70 + /**审核状态*/
  71 + @Excel(name = "审核状态", width = 15)
  72 + @ApiModelProperty(value = "审核状态")
  73 + private Integer status;
  74 + /**备注*/
  75 + @Excel(name = "备注", width = 15)
  76 + @ApiModelProperty(value = "备注")
  77 + private String remark;
  78 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/audit/mapper/AuditMapper.java 0 → 100644
  1 +package org.jeecg.modules.wms.audit.mapper;
  2 +
  3 +import java.util.List;
  4 +
  5 +import org.apache.ibatis.annotations.Param;
  6 +import org.jeecg.modules.wms.audit.entity.Audit;
  7 +import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  8 +
  9 +/**
  10 + * @Description: 审核表
  11 + * @Author: jeecg-boot
  12 + * @Date: 2023-07-26
  13 + * @Version: V1.0
  14 + */
  15 +public interface AuditMapper extends BaseMapper<Audit> {
  16 +
  17 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/audit/mapper/xml/AuditMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="org.jeecg.modules.wms.audit.mapper.AuditMapper">
  4 +
  5 +</mapper>
0 6 \ No newline at end of file
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/audit/service/IAuditService.java 0 → 100644
  1 +package org.jeecg.modules.wms.audit.service;
  2 +
  3 +import org.jeecg.modules.wms.audit.entity.Audit;
  4 +import com.baomidou.mybatisplus.extension.service.IService;
  5 +
  6 +/**
  7 + * @Description: 审核表
  8 + * @Author: jeecg-boot
  9 + * @Date: 2023-07-26
  10 + * @Version: V1.0
  11 + */
  12 +public interface IAuditService extends IService<Audit> {
  13 + /**
  14 + * 审核入库单据
  15 + */
  16 + boolean auditReceipt(Audit audit);
  17 +
  18 +
  19 + /**
  20 + * 查询下一个审核人
  21 + */
  22 + Audit searchNextAuditor(Audit audit);
  23 +
  24 + /**
  25 + * 查询上一个审核人
  26 + */
  27 + Audit searchPreviousAuditor(Audit audit);
  28 +
  29 +
  30 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/audit/service/impl/AuditServiceImpl.java 0 → 100644
  1 +package org.jeecg.modules.wms.audit.service.impl;
  2 +
  3 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  4 +import org.jeecg.modules.wms.audit.entity.Audit;
  5 +import org.jeecg.modules.wms.audit.mapper.AuditMapper;
  6 +import org.jeecg.modules.wms.audit.service.IAuditService;
  7 +import org.jeecg.utils.StringUtils;
  8 +import org.springframework.stereotype.Service;
  9 +
  10 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  11 +
  12 +/**
  13 + * @Description: 审核表
  14 + * @Author: jeecg-boot
  15 + * @Date: 2023-07-26
  16 + * @Version: V1.0
  17 + */
  18 +@Service
  19 +public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements IAuditService {
  20 + @Override
  21 + public boolean auditReceipt(Audit audit) {
  22 + //根据入库单id,用户名称,找到审核数据
  23 + LambdaQueryWrapper<Audit>lambdaQueryWrapper=new LambdaQueryWrapper<>();
  24 + lambdaQueryWrapper.eq(Audit::getReceiptId,audit.getReceiptId())
  25 + .eq(Audit::getAuditorid,audit.getAuditorid()).last("limit 1");
  26 + Audit audit1=this.getOne(lambdaQueryWrapper);
  27 + if (StringUtils.isNotNull(audit1)){
  28 + audit1.setStatus(audit.getStatus());
  29 + audit1.setRemark(audit.getRemark());
  30 + this.updateById(audit1);
  31 + }
  32 +
  33 + return false;
  34 + }
  35 +
  36 + @Override
  37 + public Audit searchNextAuditor(Audit audit) {
  38 + LambdaQueryWrapper<Audit>lambdaQueryWrapper=new LambdaQueryWrapper<>();
  39 + lambdaQueryWrapper.eq(Audit::getReceiptId,audit.getReceiptId())
  40 + .gt(Audit::getSequence,audit.getSequence())
  41 + .orderByAsc(Audit::getSequence).last("limit 1");
  42 + Audit audit1=this.getOne(lambdaQueryWrapper);
  43 + return audit1;
  44 + }
  45 +
  46 + @Override
  47 + public Audit searchPreviousAuditor(Audit audit) {
  48 + LambdaQueryWrapper<Audit>lambdaQueryWrapper=new LambdaQueryWrapper<>();
  49 + lambdaQueryWrapper.eq(Audit::getReceiptId,audit.getReceiptId())
  50 + .lt(Audit::getSequence,audit.getSequence())
  51 + .orderByDesc(Audit::getSequence).last("limit 1");
  52 + Audit audit1=this.getOne(lambdaQueryWrapper);
  53 + return audit1;
  54 + }
  55 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/flow/controller/FlowHeaderController.java 0 → 100644
  1 +package org.jeecg.modules.wms.flow.controller;
  2 +
  3 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  4 +import org.jeecg.common.system.query.QueryGenerator;
  5 +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  6 +import com.baomidou.mybatisplus.core.metadata.IPage;
  7 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  8 +import lombok.extern.slf4j.Slf4j;
  9 +import org.jeecg.common.system.base.controller.JeecgController;
  10 +import org.jeecg.common.api.vo.Result;
  11 +import org.jeecg.modules.system.entity.SysUser;
  12 +import org.jeecg.modules.system.service.ISysUserService;
  13 +import org.springframework.beans.factory.annotation.Autowired;
  14 +import org.springframework.web.bind.annotation.*;
  15 +
  16 +import javax.annotation.Resource;
  17 +import javax.servlet.http.HttpServletRequest;
  18 +import javax.servlet.http.HttpServletResponse;
  19 +import org.springframework.web.servlet.ModelAndView;
  20 +
  21 +import java.util.ArrayList;
  22 +import java.util.Arrays;
  23 +import org.jeecg.common.util.oConvertUtils;
  24 +import org.jeecg.modules.wms.flow.entity.FlowDetail;
  25 +import org.jeecg.modules.wms.flow.entity.FlowHeader;
  26 +import org.jeecg.modules.wms.flow.service.IFlowHeaderService;
  27 +import org.jeecg.modules.wms.flow.service.IFlowDetailService;
  28 +import io.swagger.annotations.Api;
  29 +import io.swagger.annotations.ApiOperation;
  30 +import org.jeecg.common.aspect.annotation.AutoLog;
  31 +import org.apache.shiro.SecurityUtils;
  32 +import org.jeecg.common.system.vo.LoginUser;
  33 +import org.jeecgframework.poi.excel.ExcelImportUtil;
  34 +import org.jeecgframework.poi.excel.def.NormalExcelConstants;
  35 +import org.jeecgframework.poi.excel.entity.ExportParams;
  36 +import org.jeecgframework.poi.excel.entity.ImportParams;
  37 +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
  38 +import org.springframework.web.multipart.MultipartFile;
  39 +import org.springframework.web.multipart.MultipartHttpServletRequest;
  40 +import java.io.IOException;
  41 +import java.util.List;
  42 +import java.util.Map;
  43 +import java.util.stream.Collectors;
  44 +
  45 + /**
  46 + * @Description: 流程头表
  47 + * @Author: jeecg-boot
  48 + * @Date: 2023-07-25
  49 + * @Version: V1.0
  50 + */
  51 +@Api(tags="流程头表")
  52 +@RestController
  53 +@RequestMapping("/flow/flowHeader")
  54 +@Slf4j
  55 +public class FlowHeaderController extends JeecgController<FlowHeader, IFlowHeaderService> {
  56 +
  57 + @Autowired
  58 + private IFlowHeaderService flowHeaderService;
  59 +
  60 + @Autowired
  61 + private IFlowDetailService flowDetailService;
  62 +
  63 + @Resource
  64 + private ISysUserService iSysUserService;
  65 +
  66 +
  67 + /*---------------------------------主表处理-begin-------------------------------------*/
  68 +
  69 + /**
  70 + * 分页列表查询
  71 + * @param flowHeader
  72 + * @param pageNo
  73 + * @param pageSize
  74 + * @param req
  75 + * @return
  76 + */
  77 + //@AutoLog(value = "流程头表-分页列表查询")
  78 + @ApiOperation(value="流程头表-分页列表查询", notes="流程头表-分页列表查询")
  79 + @GetMapping(value = "/list")
  80 + public Result<IPage<FlowHeader>> queryPageList(FlowHeader flowHeader,
  81 + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
  82 + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
  83 + HttpServletRequest req) {
  84 + QueryWrapper<FlowHeader> queryWrapper = QueryGenerator.initQueryWrapper(flowHeader, req.getParameterMap());
  85 + Page<FlowHeader> page = new Page<FlowHeader>(pageNo, pageSize);
  86 + IPage<FlowHeader> pageList = flowHeaderService.page(page, queryWrapper);
  87 + return Result.OK(pageList);
  88 + }
  89 +
  90 + /**
  91 + * 添加
  92 + * @param flowHeader
  93 + * @return
  94 + */
  95 + @AutoLog(value = "流程头表-添加")
  96 + @ApiOperation(value="流程头表-添加", notes="流程头表-添加")
  97 + @PostMapping(value = "/add")
  98 + public Result<String> add(@RequestBody FlowHeader flowHeader) {
  99 + flowHeaderService.save(flowHeader);
  100 + return Result.OK("添加成功!");
  101 + }
  102 +
  103 + /**
  104 + * 编辑
  105 + * @param flowHeader
  106 + * @return
  107 + */
  108 + @AutoLog(value = "流程头表-编辑")
  109 + @ApiOperation(value="流程头表-编辑", notes="流程头表-编辑")
  110 + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
  111 + public Result<String> edit(@RequestBody FlowHeader flowHeader) {
  112 + flowHeaderService.updateById(flowHeader);
  113 + return Result.OK("编辑成功!");
  114 + }
  115 +
  116 + /**
  117 + * 通过id删除
  118 + * @param id
  119 + * @return
  120 + */
  121 + @AutoLog(value = "流程头表-通过id删除")
  122 + @ApiOperation(value="流程头表-通过id删除", notes="流程头表-通过id删除")
  123 + @DeleteMapping(value = "/delete")
  124 + public Result<String> delete(@RequestParam(name="id",required=true) String id) {
  125 + flowHeaderService.delMain(id);
  126 + return Result.OK("删除成功!");
  127 + }
  128 +
  129 + /**
  130 + * 批量删除
  131 + * @param ids
  132 + * @return
  133 + */
  134 + @AutoLog(value = "流程头表-批量删除")
  135 + @ApiOperation(value="流程头表-批量删除", notes="流程头表-批量删除")
  136 + @DeleteMapping(value = "/deleteBatch")
  137 + public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
  138 + this.flowHeaderService.delBatchMain(Arrays.asList(ids.split(",")));
  139 + return Result.OK("批量删除成功!");
  140 + }
  141 +
  142 + /**
  143 + * 导出
  144 + * @return
  145 + */
  146 + @RequestMapping(value = "/exportXls")
  147 + public ModelAndView exportXls(HttpServletRequest request, FlowHeader flowHeader) {
  148 + return super.exportXls(request, flowHeader, FlowHeader.class, "流程头表");
  149 + }
  150 +
  151 + /**
  152 + * 导入
  153 + * @return
  154 + */
  155 + @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
  156 + public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
  157 + return super.importExcel(request, response, FlowHeader.class);
  158 + }
  159 + /*---------------------------------主表处理-end-------------------------------------*/
  160 +
  161 +
  162 + /*--------------------------------子表处理-流程配置明细-begin----------------------------------------------*/
  163 + /**
  164 + * 通过主表ID查询
  165 + * @return
  166 + */
  167 + //@AutoLog(value = "流程配置明细-通过主表ID查询")
  168 + @ApiOperation(value="流程配置明细-通过主表ID查询", notes="流程配置明细-通过主表ID查询")
  169 + @GetMapping(value = "/listFlowDetailByMainId")
  170 + public Result<IPage<FlowDetail>> listFlowDetailByMainId(FlowDetail flowDetail,
  171 + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
  172 + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
  173 + HttpServletRequest req) {
  174 + QueryWrapper<FlowDetail> queryWrapper = QueryGenerator.initQueryWrapper(flowDetail, req.getParameterMap());
  175 + Page<FlowDetail> page = new Page<FlowDetail>(pageNo, pageSize);
  176 + queryWrapper.orderByAsc("sequence");
  177 + IPage<FlowDetail> pageList = flowDetailService.page(page, queryWrapper);
  178 + return Result.OK(pageList);
  179 + }
  180 +
  181 + /**
  182 + * 添加
  183 + * @param flowDetail
  184 + * @return
  185 + */
  186 + @AutoLog(value = "流程配置明细-添加")
  187 + @ApiOperation(value="流程配置明细-添加", notes="流程配置明细-添加")
  188 + @PostMapping(value = "/addFlowDetail")
  189 + public Result<String> addFlowDetail(@RequestBody FlowDetail flowDetail) {
  190 + String [] users=flowDetail.getAuditorId().split(",");
  191 + //批量新增的时候,按前台选择用户的顺序,生成审核顺序
  192 + LambdaQueryWrapper<FlowDetail>lambdaQueryWrapper=new LambdaQueryWrapper<>();
  193 + lambdaQueryWrapper.eq(FlowDetail::getHeadId,flowDetail.getHeadId())
  194 + .orderByAsc(FlowDetail::getSequence).last("limit 1");
  195 + FlowDetail detail=flowDetailService.getOne(lambdaQueryWrapper);
  196 + Integer sequence=0;
  197 + if (detail!=null){
  198 + sequence=detail.getSequence();
  199 + }
  200 + List<FlowDetail>flowDetailList=new ArrayList<>();
  201 + for (int i=0;i<users.length;i++){
  202 + sequence++;
  203 + FlowDetail flowDetail1=new FlowDetail();
  204 + flowDetail1.setHeadId(flowDetail.getHeadId());
  205 + flowDetail1.setSequence(sequence);
  206 + flowDetail1.setRemark(flowDetail.getRemark());
  207 + //查询用户姓名
  208 + SysUser user=iSysUserService.getUserByName(users[i]);
  209 + flowDetail1.setAuditor(user.getRealname());
  210 + flowDetail1.setAuditorId(users[i]);
  211 + flowDetailList.add(flowDetail1);
  212 + }
  213 + flowDetailService.saveBatch(flowDetailList);
  214 + return Result.OK("添加成功!");
  215 + }
  216 +
  217 + /**
  218 + * 编辑
  219 + * @param flowDetail
  220 + * @return
  221 + */
  222 + @AutoLog(value = "流程配置明细-编辑")
  223 + @ApiOperation(value="流程配置明细-编辑", notes="流程配置明细-编辑")
  224 + @RequestMapping(value = "/editFlowDetail", method = {RequestMethod.PUT,RequestMethod.POST})
  225 + public Result<String> editFlowDetail(@RequestBody FlowDetail flowDetail) {
  226 + flowDetailService.updateById(flowDetail);
  227 + return Result.OK("编辑成功!");
  228 + }
  229 +
  230 + /**
  231 + * 通过id删除
  232 + * @param id
  233 + * @return
  234 + */
  235 + @AutoLog(value = "流程配置明细-通过id删除")
  236 + @ApiOperation(value="流程配置明细-通过id删除", notes="流程配置明细-通过id删除")
  237 + @DeleteMapping(value = "/deleteFlowDetail")
  238 + public Result<String> deleteFlowDetail(@RequestParam(name="id",required=true) String id) {
  239 + flowDetailService.removeById(id);
  240 + return Result.OK("删除成功!");
  241 + }
  242 +
  243 + /**
  244 + * 批量删除
  245 + * @param ids
  246 + * @return
  247 + */
  248 + @AutoLog(value = "流程配置明细-批量删除")
  249 + @ApiOperation(value="流程配置明细-批量删除", notes="流程配置明细-批量删除")
  250 + @DeleteMapping(value = "/deleteBatchFlowDetail")
  251 + public Result<String> deleteBatchFlowDetail(@RequestParam(name="ids",required=true) String ids) {
  252 + this.flowDetailService.removeByIds(Arrays.asList(ids.split(",")));
  253 + return Result.OK("批量删除成功!");
  254 + }
  255 +
  256 + /**
  257 + * 导出
  258 + * @return
  259 + */
  260 + @RequestMapping(value = "/exportFlowDetail")
  261 + public ModelAndView exportFlowDetail(HttpServletRequest request, FlowDetail flowDetail) {
  262 + // Step.1 组装查询条件
  263 + QueryWrapper<FlowDetail> queryWrapper = QueryGenerator.initQueryWrapper(flowDetail, request.getParameterMap());
  264 + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
  265 +
  266 + // Step.2 获取导出数据
  267 + List<FlowDetail> pageList = flowDetailService.list(queryWrapper);
  268 + List<FlowDetail> exportList = null;
  269 +
  270 + // 过滤选中数据
  271 + String selections = request.getParameter("selections");
  272 + if (oConvertUtils.isNotEmpty(selections)) {
  273 + List<String> selectionList = Arrays.asList(selections.split(","));
  274 + exportList = pageList.stream().filter(item -> selectionList.contains(item.getId())).collect(Collectors.toList());
  275 + } else {
  276 + exportList = pageList;
  277 + }
  278 +
  279 + // Step.3 AutoPoi 导出Excel
  280 + ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
  281 + mv.addObject(NormalExcelConstants.FILE_NAME, "流程配置明细"); //此处设置的filename无效 ,前端会重更新设置一下
  282 + mv.addObject(NormalExcelConstants.CLASS, FlowDetail.class);
  283 + mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("流程配置明细报表", "导出人:" + sysUser.getRealname(), "流程配置明细"));
  284 + mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
  285 + return mv;
  286 + }
  287 +
  288 + /**
  289 + * 导入
  290 + * @return
  291 + */
  292 + @RequestMapping(value = "/importFlowDetail/{mainId}")
  293 + public Result<?> importFlowDetail(HttpServletRequest request, HttpServletResponse response, @PathVariable("mainId") String mainId) {
  294 + MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
  295 + Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
  296 + for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
  297 + MultipartFile file = entity.getValue();// 获取上传文件对象
  298 + ImportParams params = new ImportParams();
  299 + params.setTitleRows(2);
  300 + params.setHeadRows(1);
  301 + params.setNeedSave(true);
  302 + try {
  303 + List<FlowDetail> list = ExcelImportUtil.importExcel(file.getInputStream(), FlowDetail.class, params);
  304 + for (FlowDetail temp : list) {
  305 + temp.setHeadId(mainId);
  306 + }
  307 + long start = System.currentTimeMillis();
  308 + flowDetailService.saveBatch(list);
  309 + log.info("消耗时间" + (System.currentTimeMillis() - start) + "毫秒");
  310 + return Result.OK("文件导入成功!数据行数:" + list.size());
  311 + } catch (Exception e) {
  312 + log.error(e.getMessage(), e);
  313 + return Result.error("文件导入失败:" + e.getMessage());
  314 + } finally {
  315 + try {
  316 + file.getInputStream().close();
  317 + } catch (IOException e) {
  318 + e.printStackTrace();
  319 + }
  320 + }
  321 + }
  322 + return Result.error("文件导入失败!");
  323 + }
  324 +
  325 + /*--------------------------------子表处理-流程配置明细-end----------------------------------------------*/
  326 +
  327 +
  328 +
  329 +
  330 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/flow/entity/FlowDetail.java 0 → 100644
  1 +package org.jeecg.modules.wms.flow.entity;
  2 +
  3 +import java.io.Serializable;
  4 +import com.baomidou.mybatisplus.annotation.IdType;
  5 +import com.baomidou.mybatisplus.annotation.TableId;
  6 +import com.baomidou.mybatisplus.annotation.TableName;
  7 +import org.jeecg.common.aspect.annotation.Dict;
  8 +import lombok.Data;
  9 +import com.fasterxml.jackson.annotation.JsonFormat;
  10 +import org.springframework.format.annotation.DateTimeFormat;
  11 +import org.jeecgframework.poi.excel.annotation.Excel;
  12 +import java.util.Date;
  13 +import io.swagger.annotations.ApiModel;
  14 +import io.swagger.annotations.ApiModelProperty;
  15 +import java.io.UnsupportedEncodingException;
  16 +
  17 +/**
  18 + * @Description: 流程配置明细
  19 + * @Author: jeecg-boot
  20 + * @Date: 2023-07-25
  21 + * @Version: V1.0
  22 + */
  23 +@Data
  24 +@TableName("flow_detail")
  25 +@ApiModel(value="flow_detail对象", description="流程配置明细")
  26 +public class FlowDetail implements Serializable {
  27 + private static final long serialVersionUID = 1L;
  28 +
  29 + /**主键*/
  30 + @TableId(type = IdType.ASSIGN_ID)
  31 + @ApiModelProperty(value = "主键")
  32 + private String id;
  33 + /**创建人*/
  34 + @ApiModelProperty(value = "创建人")
  35 + private String createBy;
  36 + /**创建日期*/
  37 + @ApiModelProperty(value = "创建日期")
  38 + private Date createTime;
  39 + /**更新人*/
  40 + @ApiModelProperty(value = "更新人")
  41 + private String updateBy;
  42 + /**更新日期*/
  43 + @ApiModelProperty(value = "更新日期")
  44 + private Date updateTime;
  45 + /**审核人*/
  46 + @Excel(name = "审核人", width = 15)
  47 + @ApiModelProperty(value = "审核人")
  48 + private String auditor;
  49 + /**审核人id*/
  50 + @Excel(name = "审核人id", width = 15)
  51 + @ApiModelProperty(value = "审核人id")
  52 + private String auditorId;
  53 + /**审核顺序*/
  54 + @Excel(name = "审核顺序", width = 15)
  55 + @ApiModelProperty(value = "审核顺序")
  56 + private Integer sequence;
  57 + /**备注*/
  58 + @Excel(name = "备注", width = 15)
  59 + @ApiModelProperty(value = "备注")
  60 + private String remark;
  61 + /**头id*/
  62 + @ApiModelProperty(value = "头id")
  63 + private String headId;
  64 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/flow/entity/FlowHeader.java 0 → 100644
  1 +package org.jeecg.modules.wms.flow.entity;
  2 +
  3 +import java.io.Serializable;
  4 +import java.io.UnsupportedEncodingException;
  5 +import java.util.Date;
  6 +import com.baomidou.mybatisplus.annotation.IdType;
  7 +import com.baomidou.mybatisplus.annotation.TableId;
  8 +import com.baomidou.mybatisplus.annotation.TableName;
  9 +import org.jeecgframework.poi.excel.annotation.Excel;
  10 +import lombok.Data;
  11 +import com.fasterxml.jackson.annotation.JsonFormat;
  12 +import org.springframework.format.annotation.DateTimeFormat;
  13 +import org.jeecg.common.aspect.annotation.Dict;
  14 +import io.swagger.annotations.ApiModel;
  15 +import io.swagger.annotations.ApiModelProperty;
  16 +
  17 +/**
  18 + * @Description: 流程头表
  19 + * @Author: jeecg-boot
  20 + * @Date: 2023-07-25
  21 + * @Version: V1.0
  22 + */
  23 +@Data
  24 +@TableName("flow_header")
  25 +@ApiModel(value="flow_header对象", description="流程头表")
  26 +public class FlowHeader implements Serializable {
  27 + private static final long serialVersionUID = 1L;
  28 +
  29 + /**主键*/
  30 + @TableId(type = IdType.ASSIGN_ID)
  31 + @ApiModelProperty(value = "主键")
  32 + private String id;
  33 + /**创建人*/
  34 + @ApiModelProperty(value = "创建人")
  35 + private String createBy;
  36 + /**创建日期*/
  37 + @ApiModelProperty(value = "创建日期")
  38 + private Date createTime;
  39 + /**更新人*/
  40 + @ApiModelProperty(value = "更新人")
  41 + private String updateBy;
  42 + /**更新日期*/
  43 + @ApiModelProperty(value = "更新日期")
  44 + private Date updateTime;
  45 + /**流程名称*/
  46 + @Excel(name = "流程名称", width = 15)
  47 + @ApiModelProperty(value = "流程名称")
  48 + private String flowName;
  49 + /**流程类型*/
  50 + @Excel(name = "流程类型", width = 15)
  51 + @ApiModelProperty(value = "流程类型")
  52 +
  53 + @Dict(dicCode = "flowType")
  54 + private String flowType;
  55 + /**单据类型*/
  56 + @Excel(name = "单据类型", width = 15)
  57 + @ApiModelProperty(value = "单据类型")
  58 + private String documentType;
  59 + /**状态*/
  60 + @Excel(name = "状态", width = 15)
  61 + @ApiModelProperty(value = "状态")
  62 + @Dict(dicCode = "flowStatus")
  63 + private Integer flowStatus;
  64 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/flow/mapper/FlowDetailMapper.java 0 → 100644
  1 +package org.jeecg.modules.wms.flow.mapper;
  2 +
  3 +import java.util.List;
  4 +import org.jeecg.modules.wms.flow.entity.FlowDetail;
  5 +import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  6 +import org.apache.ibatis.annotations.Param;
  7 +
  8 +/**
  9 + * @Description: 流程配置明细
  10 + * @Author: jeecg-boot
  11 + * @Date: 2023-07-25
  12 + * @Version: V1.0
  13 + */
  14 +public interface FlowDetailMapper extends BaseMapper<FlowDetail> {
  15 +
  16 + public boolean deleteByMainId(@Param("mainId") String mainId);
  17 +
  18 + public List<FlowDetail> selectByMainId(@Param("mainId") String mainId);
  19 +
  20 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/flow/mapper/FlowHeaderMapper.java 0 → 100644
  1 +package org.jeecg.modules.wms.flow.mapper;
  2 +
  3 +import java.util.List;
  4 +
  5 +import org.apache.ibatis.annotations.Param;
  6 +import org.jeecg.modules.wms.flow.entity.FlowHeader;
  7 +import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  8 +
  9 +/**
  10 + * @Description: 流程头表
  11 + * @Author: jeecg-boot
  12 + * @Date: 2023-07-25
  13 + * @Version: V1.0
  14 + */
  15 +public interface FlowHeaderMapper extends BaseMapper<FlowHeader> {
  16 +
  17 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/flow/mapper/xml/FlowDetailMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="org.jeecg.modules.wms.flow.mapper.FlowDetailMapper">
  4 + <delete id="deleteByMainId" parameterType="java.lang.String">
  5 + DELETE
  6 + FROM flow_detail
  7 + WHERE head_id = #{mainId}
  8 + </delete>
  9 +
  10 +</mapper>
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/flow/mapper/xml/FlowHeaderMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="org.jeecg.modules.wms.flow.mapper.FlowHeaderMapper">
  4 +
  5 +</mapper>
0 6 \ No newline at end of file
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/flow/service/IFlowDetailService.java 0 → 100644
  1 +package org.jeecg.modules.wms.flow.service;
  2 +
  3 +import org.jeecg.modules.wms.flow.entity.FlowDetail;
  4 +import com.baomidou.mybatisplus.extension.service.IService;
  5 +import java.util.List;
  6 +
  7 +/**
  8 + * @Description: 流程配置明细
  9 + * @Author: jeecg-boot
  10 + * @Date: 2023-07-25
  11 + * @Version: V1.0
  12 + */
  13 +public interface IFlowDetailService extends IService<FlowDetail> {
  14 +
  15 + public List<FlowDetail> selectByMainId(String mainId);
  16 +
  17 + /**
  18 + * 根据流程类型,单据类型获取审核流程明细
  19 + */
  20 + public List<FlowDetail> getFlowDetailList(Integer flowType,String documentType);
  21 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/flow/service/IFlowHeaderService.java 0 → 100644
  1 +package org.jeecg.modules.wms.flow.service;
  2 +
  3 +import org.jeecg.modules.wms.flow.entity.FlowDetail;
  4 +import org.jeecg.modules.wms.flow.entity.FlowHeader;
  5 +import com.baomidou.mybatisplus.extension.service.IService;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import java.io.Serializable;
  8 +import java.util.Collection;
  9 +import java.util.List;
  10 +
  11 +/**
  12 + * @Description: 流程头表
  13 + * @Author: jeecg-boot
  14 + * @Date: 2023-07-25
  15 + * @Version: V1.0
  16 + */
  17 +public interface IFlowHeaderService extends IService<FlowHeader> {
  18 +
  19 + /**
  20 + * 删除一对多
  21 + */
  22 + public void delMain (String id);
  23 +
  24 + /**
  25 + * 批量删除一对多
  26 + */
  27 + public void delBatchMain (Collection<? extends Serializable> idList);
  28 +
  29 +
  30 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/flow/service/impl/FlowDetailServiceImpl.java 0 → 100644
  1 +package org.jeecg.modules.wms.flow.service.impl;
  2 +
  3 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  4 +import org.jeecg.modules.wms.flow.entity.FlowDetail;
  5 +import org.jeecg.modules.wms.flow.entity.FlowHeader;
  6 +import org.jeecg.modules.wms.flow.mapper.FlowDetailMapper;
  7 +import org.jeecg.modules.wms.flow.service.IFlowDetailService;
  8 +import org.jeecg.modules.wms.flow.service.IFlowHeaderService;
  9 +import org.jeecg.utils.StringUtils;
  10 +import org.springframework.stereotype.Service;
  11 +
  12 +import java.util.ArrayList;
  13 +import java.util.List;
  14 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  15 +import org.springframework.beans.factory.annotation.Autowired;
  16 +
  17 +import javax.annotation.Resource;
  18 +
  19 +/**
  20 + * @Description: 流程配置明细
  21 + * @Author: jeecg-boot
  22 + * @Date: 2023-07-25
  23 + * @Version: V1.0
  24 + */
  25 +@Service
  26 +public class FlowDetailServiceImpl extends ServiceImpl<FlowDetailMapper, FlowDetail> implements IFlowDetailService {
  27 +
  28 + @Autowired
  29 + private FlowDetailMapper flowDetailMapper;
  30 +
  31 + @Resource
  32 + private IFlowHeaderService iFlowHeaderService;
  33 +
  34 + @Override
  35 + public List<FlowDetail> selectByMainId(String mainId) {
  36 + return flowDetailMapper.selectByMainId(mainId);
  37 + }
  38 +
  39 + @Override
  40 + public List<FlowDetail> getFlowDetailList(Integer flowType, String documentType) {
  41 + //根据单据类型查询是否存在审核流程
  42 + LambdaQueryWrapper<FlowHeader>lambdaQueryWrapper=new LambdaQueryWrapper<>();
  43 + lambdaQueryWrapper.eq(FlowHeader::getDocumentType,documentType)
  44 + .eq(FlowHeader::getFlowType,flowType)
  45 + .orderByDesc(FlowHeader::getId).last("limit 1");
  46 + FlowHeader flowHeader=iFlowHeaderService.getOne(lambdaQueryWrapper);
  47 + //没有根据单据类型,找到流程就根据入库单类型查找
  48 + if (StringUtils.isNull(flowHeader)){
  49 + lambdaQueryWrapper=new LambdaQueryWrapper<>();
  50 + lambdaQueryWrapper.eq(FlowHeader::getFlowType,flowType)
  51 + .orderByDesc(FlowHeader::getId).last("limit 1");
  52 + flowHeader=iFlowHeaderService.getOne(lambdaQueryWrapper);
  53 + }
  54 + List<FlowDetail>list=new ArrayList<>();
  55 + if (StringUtils.isNotNull(flowHeader)){
  56 + LambdaQueryWrapper<FlowDetail>detailLambdaQueryWrapper=new LambdaQueryWrapper<>();
  57 + detailLambdaQueryWrapper.eq(FlowDetail::getHeadId,flowHeader.getId())
  58 + .orderByAsc(FlowDetail::getSequence);
  59 + list=this.list(detailLambdaQueryWrapper);
  60 + }
  61 + return list;
  62 + }
  63 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/flow/service/impl/FlowHeaderServiceImpl.java 0 → 100644
  1 +package org.jeecg.modules.wms.flow.service.impl;
  2 +
  3 +import org.jeecg.modules.wms.flow.entity.FlowHeader;
  4 +import org.jeecg.modules.wms.flow.entity.FlowDetail;
  5 +import org.jeecg.modules.wms.flow.mapper.FlowDetailMapper;
  6 +import org.jeecg.modules.wms.flow.mapper.FlowHeaderMapper;
  7 +import org.jeecg.modules.wms.flow.service.IFlowHeaderService;
  8 +import org.springframework.stereotype.Service;
  9 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  10 +import org.springframework.beans.factory.annotation.Autowired;
  11 +import org.springframework.transaction.annotation.Transactional;
  12 +import java.io.Serializable;
  13 +import java.util.List;
  14 +import java.util.Collection;
  15 +
  16 +/**
  17 + * @Description: 流程头表
  18 + * @Author: jeecg-boot
  19 + * @Date: 2023-07-25
  20 + * @Version: V1.0
  21 + */
  22 +@Service
  23 +public class FlowHeaderServiceImpl extends ServiceImpl<FlowHeaderMapper, FlowHeader> implements IFlowHeaderService {
  24 +
  25 + @Autowired
  26 + private FlowHeaderMapper flowHeaderMapper;
  27 + @Autowired
  28 + private FlowDetailMapper flowDetailMapper;
  29 +
  30 + @Override
  31 + @Transactional
  32 + public void delMain(String id) {
  33 + flowDetailMapper.deleteByMainId(id);
  34 + flowHeaderMapper.deleteById(id);
  35 + }
  36 +
  37 + @Override
  38 + @Transactional
  39 + public void delBatchMain(Collection<? extends Serializable> idList) {
  40 + for(Serializable id:idList) {
  41 + flowDetailMapper.deleteByMainId(id.toString());
  42 + flowHeaderMapper.deleteById(id);
  43 + }
  44 + }
  45 +
  46 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/entity/ReceiptHeader.java
... ... @@ -110,4 +110,7 @@ public class ReceiptHeader implements Serializable {
110 110 /** 更新日期 */
111 111 @ApiModelProperty(value = "更新日期")
112 112 private Date updateTime;
  113 +
  114 + /** 下一个人的审核账号 */
  115 + private String nextAuditor;
113 116 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/impl/ReceiptHeaderServiceImpl.java
... ... @@ -3,6 +3,7 @@ package org.jeecg.modules.wms.receipt.receiptHeader.service.impl;
3 3 import java.io.Serializable;
4 4 import java.math.BigDecimal;
5 5 import java.text.SimpleDateFormat;
  6 +import java.util.ArrayList;
6 7 import java.util.Collection;
7 8 import java.util.Date;
8 9 import java.util.List;
... ... @@ -11,8 +12,12 @@ import javax.annotation.Resource;
11 12  
12 13 import org.jeecg.common.api.vo.Result;
13 14 import org.jeecg.common.exception.JeecgBootException;
  15 +import org.jeecg.modules.wms.audit.entity.Audit;
  16 +import org.jeecg.modules.wms.audit.service.IAuditService;
14 17 import org.jeecg.modules.wms.config.receiptType.entity.ReceiptType;
15 18 import org.jeecg.modules.wms.config.receiptType.service.IReceiptTypeService;
  19 +import org.jeecg.modules.wms.flow.entity.FlowDetail;
  20 +import org.jeecg.modules.wms.flow.service.IFlowDetailService;
16 21 import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail;
17 22 import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader;
18 23 import org.jeecg.modules.wms.receipt.receiptHeader.mapper.ReceiptDetailMapper;
... ... @@ -54,6 +59,10 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl&lt;ReceiptHeaderMapper, R
54 59 private IReceiptHeaderService receiptHeaderService;
55 60 @Resource
56 61 private IReceiptHeaderHistoryService receiptHeaderHistoryService;
  62 + @Resource
  63 + private IFlowDetailService iFlowDetailService;
  64 + @Resource
  65 + private IAuditService iAuditService;
57 66  
58 67 /**
59 68 * @param id 入库单主表id
... ... @@ -114,6 +123,29 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl&lt;ReceiptHeaderMapper, R
114 123 if (!success) {
115 124 return Result.OK("添加失败!");
116 125 }
  126 + //查询当前单据是否有审核流程
  127 + List<FlowDetail>flowDetailList=iFlowDetailService.getFlowDetailList(QuantityConstant.RECEIPT_AUDIT,receiptHeader.getType());
  128 + if (flowDetailList.size()>0){
  129 + List<Audit>auditList=new ArrayList<>();
  130 + for (FlowDetail flowDetail:flowDetailList){
  131 + Audit audit=new Audit();
  132 + audit.setAuditor(flowDetail.getAuditor());
  133 + audit.setAuditorid(flowDetail.getAuditorId());
  134 + audit.setSequence(flowDetail.getSequence());
  135 + audit.setReceiptId(String.valueOf(receiptHeader.getId()));
  136 + auditList.add(audit);
  137 + }
  138 + if(iAuditService.saveBatch(auditList)){
  139 + //更新入库单头表,下一个审核人id
  140 + ReceiptHeader receiptHeader1=new ReceiptHeader();
  141 + receiptHeader1.setId(receiptHeader.getId());
  142 + receiptHeader1.setNextAuditor(flowDetailList.get(0).getAuditorId());
  143 + receiptHeaderService.updateById(receiptHeader1);
  144 + }
  145 + }
  146 + if (!success) {
  147 + return Result.OK("添加失败!");
  148 + }
117 149 return Result.OK("添加成功!", receiptHeader);
118 150 }
119 151  
... ...
huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java
... ... @@ -29,6 +29,9 @@ public class QuantityConstant {
29 29 // 等待审核
30 30 public static final Integer RECEIPT_HEADER_VERIFYING = 10;
31 31  
  32 + //审核完成
  33 + public static final Integer RECEIPT_HEADER_FINSH = 15;
  34 +
32 35 // 驳回
33 36 public static final Integer RECEIPT_HEADER_REJECTED = 20;
34 37  
... ... @@ -73,6 +76,15 @@ public class QuantityConstant {
73 76 // 新建
74 77 public static final Integer SHIPMENT_HEADER_BUILD = 0;
75 78  
  79 + // 等待审核
  80 + public static final Integer SHIPMENT_HEADER_VERIFYING = 10;
  81 +
  82 + //审核完成
  83 + public static final Integer SHIPMENT_HEADER_FINSH = 15;
  84 +
  85 + // 驳回
  86 + public static final Integer SHIPMENT_HEADER_REJECTED = 20;
  87 +
76 88 // 订单池
77 89 public static final Integer SHIPMENT_HEADER_POOL = 100;
78 90  
... ... @@ -370,6 +382,12 @@ public class QuantityConstant {
370 382 // 16、请求类型
371 383 public static final String WMS_TYPE = "WMS";
372 384  
  385 + // 入库单审核流程
  386 + public static final Integer RECEIPT_AUDIT = 1;
  387 +
  388 + // 出库单审核流程
  389 + public static final Integer SHIPMENT_AUDIT = 2;
  390 +
373 391 // WCS库位信息查询
374 392 public static final String ADDRESS_WCS_LOCATION_INFO = "WCS_LOCATION_INFO";
375 393  
... ...