diff --git a/ant-design-vue-jeecg/src/views/jeecg/JeecgDemoList.vue b/ant-design-vue-jeecg/src/views/jeecg/JeecgDemoList.vue index accf6d3..7a33e4b 100644 --- a/ant-design-vue-jeecg/src/views/jeecg/JeecgDemoList.vue +++ b/ant-design-vue-jeecg/src/views/jeecg/JeecgDemoList.vue @@ -94,10 +94,9 @@ <template slot="content"> <a-checkbox-group @change="onColSettingsChange" v-model="settingColumns" :defaultValue="settingColumns"> <a-row style="width: 400px"> - <template v-for="(item,index) in defColumns"> + <template v-for="(item) in defColumns"> <template v-if="item.key!='rowIndex'&& item.dataIndex!='action'"> - <a-col :span="12"><a-checkbox :value="item.dataIndex"><j-ellipsis :value="item.title" - :length="10"></j-ellipsis></a-checkbox></a-col> + <a-col :span="12"><a-checkbox :value="item.dataIndex"><j-ellipsis :value="item.title" :length="10"></j-ellipsis></a-checkbox></a-col> </template> </template> </a-row> @@ -124,7 +123,7 @@ <a-card> <a-checkbox-group @change="onColSettingsChange" v-model="settingColumns" :defaultValue="settingColumns"> <a-row style="width: 400px"> - <template v-for="(item,index) in defColumns"> + <template v-for="(item) in defColumns"> <template v-if="item.key!='rowIndex'&& item.dataIndex!='action'"> <a-col :span="12"> <a-checkbox :value="item.dataIndex"> diff --git a/ant-design-vue-jeecg/src/views/system/monitor/OperationLog.vue b/ant-design-vue-jeecg/src/views/system/monitor/OperationLog.vue new file mode 100644 index 0000000..73e81df --- /dev/null +++ b/ant-design-vue-jeecg/src/views/system/monitor/OperationLog.vue @@ -0,0 +1,219 @@ +<template> + <a-card :bordered="false"> + <!-- 查询区域 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="业务ID"> + <a-input placeholder="请输入业务ID" v-model="queryParam.bizId"></a-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="业务类型"> + <a-input placeholder="请输入业务类型" v-model="queryParam.bizType"></a-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="操作内容"> + <j-input placeholder="请输入操作内容" v-model="queryParam.operationMsg"></j-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> + <a-button type="primary" @click="searchQuery" icon="search">查询</a-button> + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> + </span> + </a-col> + </a-row> + </a-form> + </div> + <!-- 查询区域-END --> + + <!-- 操作按钮区域 --> + <div class="table-operator"> + <a-button type="primary" icon="download" @click="handleExportXls('操作记录表')">导出</a-button> + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> + <a-button type="primary" icon="import">导入</a-button> + </a-upload> + </div> + + <!-- table区域-begin --> + <div> + <a-table + ref="table" + size="middle" + :scroll="{x:true}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + @change="handleTableChange"> + + <template slot="htmlSlot" slot-scope="text"> + <div v-html="text"></div> + </template> + <template slot="imgSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> + <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> + </template> + <template slot="fileSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> + <a-button + v-else + :ghost="true" + type="primary" + icon="download" + size="small" + @click="downloadFile(text)"> + 下载 + </a-button> + </template> + + <span slot="action" slot-scope="text, record"> + <a v-has="'operationLog:edit'" @click="handleEdit(record)">编辑</a> + <a @click="handleDetail(record)">详情</a> + </span> + </a-table> + </div> + + <operation-log-modal ref="modalForm" @ok="modalFormOk"></operation-log-modal> + </a-card> +</template> + +<script> + import {filterObj} from '@/utils/util'; + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import OperationLogModal from './modules/OperationLogModal' + + export default { + name: 'OperationLogList', + mixins:[JeecgListMixin, mixinDevice], + components: { + OperationLogModal + }, + data () { + return { + description: '操作记录表管理页面', + // 表头 + columns: [ + { + title:'业务ID', + align:"center", + dataIndex: 'bizId' + }, + { + title:'业务类型', + align:"center", + dataIndex: 'bizType' + }, + { + title:'操作内容', + align:"center", + dataIndex: 'operationMsg' + }, + { + title:'操作时间', + align:"center", + dataIndex: 'operationTime' + }, + { + title:'操作结果状态', + align:"center", + dataIndex: 'operationStatus' + }, + { + title:'操作耗时', + align:"center", + dataIndex: 'operationCostTime' + }, + { + title:'方法返回内容', + align:"center", + dataIndex: 'contentReturn' + }, + { + title:'方法异常内容', + align:"center", + dataIndex: 'contentException' + }, + { + title:'操作人ID', + align:"center", + dataIndex: 'operatorId' + }, + { + title:'操作人姓名', + align:"center", + dataIndex: 'operatorName' + }, + { + title: '操作', + dataIndex: 'action', + align: "center", + fixed: "right", + width: 147, + scopedSlots: {customRender: 'action'} + } + ], + url: { + list: "/config/operationLog/list", + delete: "/config/operationLog/delete", + deleteBatch: "/config/operationLog/deleteBatch", + exportXlsUrl: "/config/operationLog/exportXls", + importExcelUrl: "config/operationLog/importExcel", + + }, + dictOptions:{}, + superFieldList:[], + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + getQueryParams() { + // 重写查询条件 + let sqp = {} + if (this.superQueryParams) { + sqp['superQueryParams'] = encodeURI(this.superQueryParams) + sqp['superQueryMatchType'] = this.superQueryMatchType + } + var param = Object.assign(sqp, this.queryParam, {}, this.filters) + param.field = this.getQueryField() + param.pageNo = this.ipagination.current + param.pageSize = this.ipagination.pageSize + return filterObj(param) + }, + initDictConfig(){ + }, + getSuperFieldList(){ + let fieldList=[]; + fieldList.push({type:'string',value:'bizId',text:'业务ID',dictCode:''}) + fieldList.push({type:'string',value:'bizType',text:'业务类型',dictCode:''}) + fieldList.push({type:'string',value:'operationMsg',text:'操作内容',dictCode:''}) + fieldList.push({type:'datetime',value:'operationTime',text:'操作时间'}) + fieldList.push({type:'int',value:'operationStatus',text:'操作结果状态',dictCode:''}) + fieldList.push({type:'int',value:'operationCostTime',text:'操作耗时',dictCode:''}) + fieldList.push({type:'string',value:'contentReturn',text:'方法返回内容',dictCode:''}) + fieldList.push({type:'string',value:'contentException',text:'方法异常内容',dictCode:''}) + fieldList.push({type:'string',value:'operatorId',text:'操作人ID',dictCode:''}) + fieldList.push({type:'string',value:'operatorName',text:'操作人姓名',dictCode:''}) + this.superFieldList = fieldList + } + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/system/monitor/modules/OperationLogForm.vue b/ant-design-vue-jeecg/src/views/system/monitor/modules/OperationLogForm.vue new file mode 100644 index 0000000..9f4fabc --- /dev/null +++ b/ant-design-vue-jeecg/src/views/system/monitor/modules/OperationLogForm.vue @@ -0,0 +1,149 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="24"> + <a-form-model-item label="业务ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bizId"> + <a-input v-model="model.bizId" placeholder="请输入业务ID" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="业务类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bizType"> + <a-input v-model="model.bizType" placeholder="请输入业务类型" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="操作内容" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operationMsg"> + <a-input v-model="model.operationMsg" placeholder="请输入操作内容" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="操作时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operationTime"> + <j-date placeholder="请选择操作时间" v-model="model.operationTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="操作结果状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operationStatus"> + <a-input-number v-model="model.operationStatus" placeholder="请输入操作结果状态" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="操作耗时" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operationCostTime"> + <a-input-number v-model="model.operationCostTime" placeholder="请输入操作耗时" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="方法返回内容" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="contentReturn"> + <a-input v-model="model.contentReturn" placeholder="请输入方法返回内容" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="方法异常内容" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="contentException"> + <a-input v-model="model.contentException" placeholder="请输入方法异常内容" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="操作人ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operatorId"> + <a-input v-model="model.operatorId" placeholder="请输入操作人ID" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="操作人姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operatorName"> + <a-input v-model="model.operatorName" placeholder="请输入操作人姓名" ></a-input> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: 'OperationLogForm', + components: { + }, + props: { + //表单禁用 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, +validatorRules: { +}, + url: { + add: "/config/operationLog/add", + edit: "/config/operationLog/edit", + queryById: "/config/operationLog/queryById" + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + //备份model原始值 + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + submitForm () { + const that = this; + // 触发表单验证 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/system/monitor/modules/OperationLogModal.Style#Drawer.vue b/ant-design-vue-jeecg/src/views/system/monitor/modules/OperationLogModal.Style#Drawer.vue new file mode 100644 index 0000000..8ecac58 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/system/monitor/modules/OperationLogModal.Style#Drawer.vue @@ -0,0 +1,84 @@ +<template> + <a-drawer + :title="title" + :width="width" + placement="right" + :closable="false" + @close="close" + destroyOnClose + :visible="visible"> + <operationLog-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></operationLog-form> + <div class="drawer-footer"> + <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button> + <a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button> + </div> + </a-drawer> +</template> + +<script> + + import OperationLogForm from './OperationLogForm' + + export default { + name: 'OperationLogModal', + components: { + OperationLogForm + }, + data () { + return { + title:"操作", + width:800, + visible: false, + disableSubmit: false + } + }, + methods: { + add () { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.add(); + }) + }, + edit (record) { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.edit(record); + }); + }, + close () { + this.$emit('close'); + this.visible = false; + }, + submitCallback(){ + this.$emit('ok'); + this.visible = false; + }, + handleOk () { + this.$refs.realForm.submitForm(); + }, + handleCancel () { + this.close() + } + } + } +</script> + +<style lang="less" scoped> +/** Button按钮间距 */ + .ant-btn { + margin-left: 30px; + margin-bottom: 30px; + float: right; + } + .drawer-footer{ + position: absolute; + bottom: -8px; + width: 100%; + border-top: 1px solid #e8e8e8; + padding: 10px 16px; + text-align: right; + left: 0; + background: #fff; + border-radius: 0 0 2px 2px; + } +</style> \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/system/monitor/modules/OperationLogModal.vue b/ant-design-vue-jeecg/src/views/system/monitor/modules/OperationLogModal.vue new file mode 100644 index 0000000..3dbebea --- /dev/null +++ b/ant-design-vue-jeecg/src/views/system/monitor/modules/OperationLogModal.vue @@ -0,0 +1,60 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="关闭"> + <operationLog-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></operationLog-form> + </j-modal> +</template> + +<script> + + import OperationLogForm from './OperationLogForm' + export default { + name: 'OperationLogModal', + components: { + OperationLogForm + }, + data () { + return { + title:'', + width:800, + visible: false, + disableSubmit: false + } + }, + methods: { + add () { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.add(); + }) + }, + edit (record) { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.edit(record); + }) + }, + close () { + this.$emit('close'); + this.visible = false; + }, + handleOk () { + this.$refs.realForm.submitForm(); + }, + submitCallback(){ + this.$emit('ok'); + this.visible = false; + }, + handleCancel () { + this.close() + } + } + } +</script> \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/system/receipt/ReceiptHeaderList.vue b/ant-design-vue-jeecg/src/views/system/receipt/ReceiptHeaderList.vue index c198d19..1cd447e 100644 --- a/ant-design-vue-jeecg/src/views/system/receipt/ReceiptHeaderList.vue +++ b/ant-design-vue-jeecg/src/views/system/receipt/ReceiptHeaderList.vue @@ -16,7 +16,6 @@ show-search placeholder="请选择货主" option-filter-prop="children" - :filter-option="filterOption" v-model="queryParam.companyCode"> <a-select-option v-for="item in companyList" :key="item.name" :value="item.code">{{ item.name @@ -32,7 +31,6 @@ show-search placeholder="请选择入库单类型" option-filter-prop="children" - :filter-option="filterOption" v-model="queryParam.type"> <a-select-option v-for="item in receiptTypeList" :key="item.name" :value="item.code">{{ item.name @@ -65,7 +63,6 @@ show-search placeholder="请选择供应商" option-filter-prop="children" - :filter-option="filterOption" v-model="queryParam.supplierCode"> <a-select-option v-for="item in supplierList" :key="item.name" :value="item.code">{{ item.name @@ -116,12 +113,6 @@ <!-- table区域-begin --> <div> - <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> - <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a - style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 - <a style="margin-left: 24px" @click="onClearSelected">清空</a> - </div> - <a-table ref="table" size="middle" diff --git a/ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiptHeaderModal.vue b/ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiptHeaderModal.vue index 68326b1..9e14b17 100644 --- a/ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiptHeaderModal.vue +++ b/ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiptHeaderModal.vue @@ -17,7 +17,6 @@ show-search placeholder="请选择货主" option-filter-prop="children" - :filter-option="filterOption" v-model="model.companyCode"> <a-select-option v-for="item in companyList" :key="item.name" :value="item.code">{{ item.name @@ -33,7 +32,6 @@ show-search placeholder="请选择入库单类型" option-filter-prop="children" - :filter-option="filterOption" v-model="model.type"> <a-select-option v-for="item in receiptTypeList" :key="item.name" :value="item.code">{{ item.name @@ -49,7 +47,6 @@ show-search placeholder="请选择供应商" option-filter-prop="children" - :filter-option="filterOption" v-model="model.supplierCode"> <a-select-option v-for="item in supplierList" :key="item.name" :value="item.code">{{ item.name diff --git a/ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiveModal.vue b/ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiveModal.vue index 682643f..c858d24 100644 --- a/ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiveModal.vue +++ b/ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiveModal.vue @@ -25,7 +25,6 @@ rowKey="id" size="middle" :columns="columns" - :loading="loading" :dataSource="dataSource" :pagination="false"> <span slot="action" slot-scope="text, record"> diff --git a/huaheng-wms-core/pom.xml b/huaheng-wms-core/pom.xml index f403e5d..96a6bef 100644 --- a/huaheng-wms-core/pom.xml +++ b/huaheng-wms-core/pom.xml @@ -42,7 +42,11 @@ <groupId>org.redisson</groupId> <artifactId>redisson</artifactId> </dependency> - + <dependency> + <groupId>cn.monitor4all</groupId> + <artifactId>log-record-starter</artifactId> + <version>1.4.1</version> + </dependency> <dependency> <groupId>com.github.abel533</groupId> <artifactId>ECharts</artifactId> diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/erp/service/impl/ErpServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/erp/service/impl/ErpServiceImpl.java index bbbe41a..43c4519 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/erp/service/impl/ErpServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/erp/service/impl/ErpServiceImpl.java @@ -155,6 +155,7 @@ public class ErpServiceImpl implements IErpService { ReceiptDetail receiptDetail = new ReceiptDetail(); receiptDetail.setWarehouseCode(warehouseCode); receiptDetail.setCompanyCode(companyCode); + receiptDetail.setReferCode(referCode); receiptDetail.setReceiptCode(receiptHeader.getCode()); receiptDetail.setReceiptId(receiptHeader.getId()); receiptDetail.setStatus(QuantityConstant.RECEIPT_HEADER_BUILD); diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/aspectj/ApiAuthenticationAspect.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/aspectj/ApiAuthenticationAspect.java index 8afe603..e06a286 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/aspectj/ApiAuthenticationAspect.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/aspectj/ApiAuthenticationAspect.java @@ -81,7 +81,7 @@ public class ApiAuthenticationAspect { JWTVerifier verifier = JWT.require(algorithm).withIssuer(HuahengJwtUtil.HUAHENG_SYSTEM_ID).build(); DecodedJWT jwt = verifier.verify(token); new ApiAuthentication.ApiAuthenticationBuild().operator(jwt.getClaim("operator").asString()).audience(jwt.getAudience().get(0)).issuer(jwt.getIssuer()) - .issuedAt(jwt.getIssuedAt()).expireDateTime(jwt.getExpiresAt()).bulid();; + .issuedAt(jwt.getIssuedAt()).expireDateTime(jwt.getExpiresAt()).bulid(); } catch (JWTVerificationException e) { log.error(e.getMessage()); throw e; diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/aspectj/dto/ApiAuthentication.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/aspectj/dto/ApiAuthentication.java index 1be5037..9b007f0 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/aspectj/dto/ApiAuthentication.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/aspectj/dto/ApiAuthentication.java @@ -27,10 +27,10 @@ public class ApiAuthentication { /** Token签发方(WMS) */ private String issuer = HuahengJwtUtil.HUAHENG_SYSTEM_ID; - /** 签发时间 */ + /** Token签发时间 */ private Date issuedAt; - /** 失效时间 */ + /** Token失效时间 */ private Date expireDateTime; public ApiAuthentication() {} @@ -67,10 +67,10 @@ public class ApiAuthentication { /** Token签发方(WMS) */ private String issuer = HuahengJwtUtil.HUAHENG_SYSTEM_ID; - /** 签发时间 */ + /** Token签发时间 */ private Date issuedAt; - /** 失效时间 */ + /** Token失效时间 */ private Date expireDateTime; public ApiAuthenticationBuild operator(String operator) { diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/operation/controller/OperationLogController.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/operation/controller/OperationLogController.java new file mode 100644 index 0000000..246fa50 --- /dev/null +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/operation/controller/OperationLogController.java @@ -0,0 +1,155 @@ +package org.jeecg.modules.wms.monitor.operation.controller; + +import java.util.Arrays; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.modules.wms.monitor.operation.entity.OperationLog; +import org.jeecg.modules.wms.monitor.operation.service.IOperationLogService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.ModelAndView; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; + +/** + * @Description: 操作记录表 + * @Author: jeecg-boot + * @Date: 2023-02-20 + * @Version: V1.0 + */ +@Api(tags = "操作记录表") +@RestController +@RequestMapping("/config/operationLog") +@Slf4j +public class OperationLogController extends JeecgController<OperationLog, IOperationLogService> { + @Autowired + private IOperationLogService operationLogService; + + /** + * 分页列表查询 + * @param operationLog + * @param pageNo + * @param pageSize + * @param req + * @return + */ + // @AutoLog(value = "操作记录表-分页列表查询") + @ApiOperation(value = "操作记录表-分页列表查询", notes = "操作记录表-分页列表查询") + @GetMapping(value = "/list") + public Result<IPage<OperationLog>> queryPageList(OperationLog operationLog, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { + QueryWrapper<OperationLog> queryWrapper = QueryGenerator.initQueryWrapper(operationLog, req.getParameterMap()); + Page<OperationLog> page = new Page<OperationLog>(pageNo, pageSize); + IPage<OperationLog> pageList = operationLogService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * @param operationLog + * @return + */ + @AutoLog(value = "操作记录表-添加") + @ApiOperation(value = "操作记录表-添加", notes = "操作记录表-添加") + @PostMapping(value = "/add") + public Result<String> add(@RequestBody OperationLog operationLog) { + operationLogService.save(operationLog); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * @param operationLog + * @return + */ + @AutoLog(value = "操作记录表-编辑") + @ApiOperation(value = "操作记录表-编辑", notes = "操作记录表-编辑") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) + public Result<String> edit(@RequestBody OperationLog operationLog) { + operationLogService.updateById(operationLog); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * @param id + * @return + */ + @AutoLog(value = "操作记录表-通过id删除") + @ApiOperation(value = "操作记录表-通过id删除", notes = "操作记录表-通过id删除") + @DeleteMapping(value = "/delete") + public Result<String> delete(@RequestParam(name = "id", required = true) String id) { + operationLogService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * @param ids + * @return + */ + @AutoLog(value = "操作记录表-批量删除") + @ApiOperation(value = "操作记录表-批量删除", notes = "操作记录表-批量删除") + @DeleteMapping(value = "/deleteBatch") + public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { + this.operationLogService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * @param id + * @return + */ + // @AutoLog(value = "操作记录表-通过id查询") + @ApiOperation(value = "操作记录表-通过id查询", notes = "操作记录表-通过id查询") + @GetMapping(value = "/queryById") + public Result<OperationLog> queryById(@RequestParam(name = "id", required = true) String id) { + OperationLog operationLog = operationLogService.getById(id); + if (operationLog == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(operationLog); + } + + /** + * 导出excel + * @param request + * @param operationLog + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, OperationLog operationLog) { + return super.exportXls(request, operationLog, OperationLog.class, "操作记录表"); + } + + /** + * 通过excel导入数据 + * @param request + * @param response + * @return + */ + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, OperationLog.class); + } + +} diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/operation/entity/OperationLog.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/operation/entity/OperationLog.java new file mode 100644 index 0000000..4830014 --- /dev/null +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/operation/entity/OperationLog.java @@ -0,0 +1,78 @@ +package org.jeecg.modules.wms.monitor.operation.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: 操作记录表 + * @Author: jeecg-boot + * @Date: 2023-02-20 + * @Version: V1.0 + */ +@Data +@TableName("operation_log") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="operation_log对象", description="操作记录表") +public class OperationLog implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.AUTO) + @ApiModelProperty(value = "主键") + private java.lang.Integer id; + /**业务ID*/ + @Excel(name = "业务ID", width = 15) + @ApiModelProperty(value = "业务ID") + private java.lang.String bizId; + /**业务类型*/ + @Excel(name = "业务类型", width = 15) + @ApiModelProperty(value = "业务类型") + private java.lang.String bizType; + /**操作内容*/ + @Excel(name = "操作内容", width = 15) + @ApiModelProperty(value = "操作内容") + private java.lang.String operationMsg; + /**操作时间*/ + @Excel(name = "操作时间", width = 15) + @ApiModelProperty(value = "操作时间") + private java.util.Date operationTime; + /**操作结果状态*/ + @Excel(name = "操作结果状态", width = 15) + @ApiModelProperty(value = "操作结果状态") + private java.lang.Integer operationStatus; + /**操作耗时*/ + @Excel(name = "操作耗时", width = 15) + @ApiModelProperty(value = "操作耗时") + private java.lang.Long operationCostTime; + /**方法返回内容*/ + @Excel(name = "方法返回内容", width = 15) + @ApiModelProperty(value = "方法返回内容") + private java.lang.String contentReturn; + /**方法异常内容*/ + @Excel(name = "方法异常内容", width = 15) + @ApiModelProperty(value = "方法异常内容") + private java.lang.String contentException; + /**操作人ID*/ + @Excel(name = "操作人ID", width = 15) + @ApiModelProperty(value = "操作人ID") + private java.lang.String operatorId; + /**操作人姓名*/ + @Excel(name = "操作人姓名", width = 15) + @ApiModelProperty(value = "操作人姓名") + private java.lang.String operatorName; +} diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/operation/mapper/OperationLogMapper.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/operation/mapper/OperationLogMapper.java new file mode 100644 index 0000000..637e97c --- /dev/null +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/operation/mapper/OperationLogMapper.java @@ -0,0 +1,15 @@ +package org.jeecg.modules.wms.monitor.operation.mapper; + +import org.jeecg.modules.wms.monitor.operation.entity.OperationLog; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 操作记录表 + * @Author: jeecg-boot + * @Date: 2023-02-20 + * @Version: V1.0 + */ +public interface OperationLogMapper extends BaseMapper<OperationLog> { + +} diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/operation/mapper/xml/OperationLogMapper.xml b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/operation/mapper/xml/OperationLogMapper.xml new file mode 100644 index 0000000..1a867db --- /dev/null +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/operation/mapper/xml/OperationLogMapper.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="org.jeecg.modules.wms.monitor.operation.mapper.OperationLogMapper"> + +</mapper> \ No newline at end of file diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/operation/service/IOperationLogService.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/operation/service/IOperationLogService.java new file mode 100644 index 0000000..3a63e6c --- /dev/null +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/operation/service/IOperationLogService.java @@ -0,0 +1,15 @@ +package org.jeecg.modules.wms.monitor.operation.service; + +import org.jeecg.modules.wms.monitor.operation.entity.OperationLog; + +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 操作记录表 + * @Author: jeecg-boot + * @Date: 2023-02-20 + * @Version: V1.0 + */ +public interface IOperationLogService extends IService<OperationLog> { + +} diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/operation/service/impl/OperationLogServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/operation/service/impl/OperationLogServiceImpl.java new file mode 100644 index 0000000..49e9753 --- /dev/null +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/operation/service/impl/OperationLogServiceImpl.java @@ -0,0 +1,51 @@ +package org.jeecg.modules.wms.monitor.operation.service.impl; + +import org.jeecg.modules.wms.monitor.operation.entity.OperationLog; +import org.jeecg.modules.wms.monitor.operation.mapper.OperationLogMapper; +import org.jeecg.modules.wms.monitor.operation.service.IOperationLogService; +import org.springframework.stereotype.Service; + +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +import cn.monitor4all.logRecord.bean.LogDTO; +import cn.monitor4all.logRecord.service.IOperationLogGetService; +import lombok.extern.slf4j.Slf4j; + +/** + * @Description: 操作记录表 + * @Author: jeecg-boot + * @Date: 2023-02-20 + * @Version: V1.0 + */ +@Slf4j +@Service +public class OperationLogServiceImpl extends ServiceImpl<OperationLogMapper, OperationLog> implements IOperationLogService, IOperationLogGetService { + + @Override + public boolean createLog(LogDTO logDTO) throws Exception { + try { + log.debug(">>>>>> create OperationLog: [{}]", JSON.toJSONString(logDTO)); + if (null == logDTO.getBizId()) { + log.error(">>>>>> create OperationLog bizId is null"); + return false; + } + OperationLog operationLog = new OperationLog(); + operationLog.setBizId(logDTO.getBizId()); + operationLog.setBizType(logDTO.getBizType()); + operationLog.setContentException(logDTO.getException()); + operationLog.setContentReturn(logDTO.getReturnStr()); + operationLog.setOperationCostTime(logDTO.getExecutionTime()); + operationLog.setOperationMsg(logDTO.getMsg()); + operationLog.setOperationStatus(logDTO.getSuccess().equals(true) ? 1 : 0); + operationLog.setOperationTime(logDTO.getOperateDate()); + operationLog.setOperatorId(logDTO.getOperatorId()); + operationLog.setOperatorName(logDTO.getOperatorId()); + this.save(operationLog); + return true; + } catch (Exception e) { + log.error(">>>>>> create OperationLog error:{}", e.getMessage(), e); + return false; + } + } +} diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/entity/ReceiptHeader.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/entity/ReceiptHeader.java index 7d7b076..6eecdd4 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/entity/ReceiptHeader.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/entity/ReceiptHeader.java @@ -9,6 +9,10 @@ import com.baomidou.mybatisplus.annotation.TableName; import org.jeecgframework.poi.excel.annotation.Excel; import lombok.Data; import com.fasterxml.jackson.annotation.JsonFormat; + +import cn.monitor4all.logRecord.annotation.LogRecordDiffField; +import cn.monitor4all.logRecord.annotation.LogRecordDiffObject; + import org.springframework.format.annotation.DateTimeFormat; import org.jeecg.common.aspect.annotation.Dict; import io.swagger.annotations.ApiModel; @@ -23,6 +27,7 @@ import io.swagger.annotations.ApiModelProperty; @Data @TableName("receipt_header") @ApiModel(value = "receipt_header对象", description = "入库表主表") +@LogRecordDiffObject public class ReceiptHeader implements Serializable { private static final long serialVersionUID = 1L; @@ -33,6 +38,7 @@ public class ReceiptHeader implements Serializable { /** 编码 */ @Excel(name = "编码", width = 15) @ApiModelProperty(value = "编码") + @LogRecordDiffField(alias = "入库单编码") private String code; /** 仓库编码 */ @Excel(name = "仓库编码", width = 15) diff --git a/huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java b/huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java index 5b607fe..599ccd0 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java @@ -1,26 +1,27 @@ package org.jeecg.utils.constant; /** - * 数字自定义常量 + * 数字自定义常量 + * 1、入库单状态 + * 2、出库单状态 + * 3、单据上传状态 + * 4、入库组盘状态 + * 5、出库组盘状态 + * 6、任务类型 + * 7、任务状态 + * 8、波次状态 + * 9、质检状态 + * 10、盘点状态 + * 11、INVENTORY_TRANSACTION_RECEIPT + * 12、调整单状态 + * 13、任务内部类型 + * 14、质检单类型 + * 16、请求类型 * @author ricard */ public class QuantityConstant { /** - * 1、入库单状态 - * 2、出库单状态 - * 3、单据上传状态 - * 4、入库组盘状态 - * 5、出库组盘状态 - * 6、任务类型 - * 7、任务状态 - * 8、波次状态 - * 9、质检状态 - * 10、盘点状态 - * 11、INVENTORY_TRANSACTION_RECEIPT - * 12、调整单状态 - * 13、任务内部类型 - * 14、质检单类型 - * 16、请求类型 + */ // 1、入库单状态 @@ -708,9 +709,8 @@ public class QuantityConstant { public static final String ERP_LCID = "2052"; public static final String ERP_ServerUrl = "http://erptest.gani.com.cn/K3Cloud/"; - public static final String UPSTREAM_DELETE_RECEIPT="上游删除"; - public static final String BACK_DELETE_RECEIPT="回传删除"; - public static final String WMS_DELETE_RECEIPT="WMS删除"; - + public static final String UPSTREAM_DELETE_RECEIPT = "上游删除"; + public static final String BACK_DELETE_RECEIPT = "回传删除"; + public static final String WMS_DELETE_RECEIPT = "WMS删除"; } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/config/HuahengBatisInterceptor.java b/huaheng-wms-core/src/main/java/org/jeecg/utils/interceptor/HuahengBatisInterceptor.java index 2b638c6..f480e1b 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/config/HuahengBatisInterceptor.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/utils/interceptor/HuahengBatisInterceptor.java @@ -1,4 +1,4 @@ -package org.jeecg.modules.wms.framework.config; +package org.jeecg.utils.interceptor; import java.lang.reflect.Field; import java.util.Date;