From 1e0c8c2a1a3e67cf95a4ccc60012cc3c6dad26be Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期五, 25 四月 2025 11:27:54 +0800
Subject: [PATCH] 代码初始化
---
server/src/main/java/com/doumee/dao/business/vo/WorkorderDcaChildDto.java | 6
admin/src/components/business/OperaManagersWindow.vue | 67 +++
admin/src/assets/style/style.scss | 13
admin/src/components/business/OperaCategoryImportWindow.vue | 96 ++++++
admin/src/api/business/category.js | 9
server/src/main/java/com/doumee/config/mybatis/MyBatisInterceptor.java | 4
server/src/main/java/com/doumee/core/constants/Constants.java | 46 ++
admin/src/components/business/OperaWorkorderDetailDcaWindow.vue | 19
admin/src/views/business/workorderDcaChild.vue | 20 +
server/src/main/java/com/doumee/dao/business/vo/WorkorderDbhDto.java | 9
server/src/main/java/com/doumee/service/business/impl/CategoryServiceImpl.java | 377 +++++++++++++++++++++++
admin/src/components/business/OperaWorkorderDetailDbhWindow.vue | 12
server/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java | 5
server/src/main/java/com/doumee/service/business/impl/WorkorderServiceImpl.java | 9
admin/src/views/business/managersShe.vue | 2
server/src/main/java/com/doumee/api/business/CategoryController.java | 26 +
server/src/main/java/com/doumee/dao/business/vo/CategoryDcaProblemDto.java | 30 +
server/src/main/java/com/doumee/service/business/impl/ManagersServiceImpl.java | 78 +++-
admin/src/views/business/categoryDcaProblem.vue | 27 +
admin/src/components/business/OperaWorkorderDetailSheWindow.vue | 4
server/src/main/java/com/doumee/dao/business/model/Managers.java | 10
admin/src/components/business/OperaWorkorderDetailDcaInfoWindow.vue | 4
admin/src/views/business/managersSheNotice.vue | 2
server/src/main/java/com/doumee/config/mybatis/DmStdOutImpl.java | 16 +
server/src/main/java/com/doumee/dao/business/model/Category.java | 7
admin/src/views/business/workorderDbh.vue | 18
server/src/main/resources/application.yml | 8
server/src/main/java/com/doumee/dao/business/model/Workorder.java | 3
server/src/main/java/com/doumee/service/business/CategoryService.java | 6
server/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java | 5
30 files changed, 860 insertions(+), 78 deletions(-)
diff --git a/admin/src/api/business/category.js b/admin/src/api/business/category.js
index 5ed8bda..569e286 100644
--- a/admin/src/api/business/category.js
+++ b/admin/src/api/business/category.js
@@ -24,6 +24,15 @@
download: true
})
}
+export function importDcaExcel (data) {
+ return request.post('/business/category/importDcaExcel', data)
+}
+export function exportDcaExcel (data) {
+ return request.post('/business/category/exportDcaExcel', encryptData(data), {
+ trim: true,
+ download: true
+ })
+}
// 鍒涘缓
export function create (data) {
diff --git a/admin/src/assets/style/style.scss b/admin/src/assets/style/style.scss
index 6965c4e..a2ed35a 100644
--- a/admin/src/assets/style/style.scss
+++ b/admin/src/assets/style/style.scss
@@ -30,6 +30,19 @@
.el-transfer__buttons {
padding: 0 16px !important;
}
+.tip-warn {
+ margin: 4px 0 25px 0;
+ font-size: 12px;
+ color: #999;
+ line-height: 25px;
+ i {
+ color: orange;
+ margin-right: 4px;
+ font-size: 14px;
+ position: relative;
+ top: 1px;
+ }
+}
// dialog
.eva-dialog {
diff --git a/admin/src/components/business/OperaCategoryImportWindow.vue b/admin/src/components/business/OperaCategoryImportWindow.vue
new file mode 100644
index 0000000..1d10dc1
--- /dev/null
+++ b/admin/src/components/business/OperaCategoryImportWindow.vue
@@ -0,0 +1,96 @@
+<template>
+ <el-dialog
+ class="center-title"
+ :title="title"
+ width="55%"
+ top="30vh"
+ :visible.sync="visible"
+ :confirm-working="isWorking"
+ @confirm="confirm"
+ >
+ <p class="tip-warn"><i class="el-icon-warning"></i>瀵煎叆璇存槑锛�<br>
+ 1.璇峰厛涓嬭浇鏂囦欢妯℃澘锛屽苟鎸夌収妯℃澘瑕佸幓濉啓琛ㄦ牸鍐呭;<br>
+ 2.涓嬭浇妯$増涓哄綋鍓嶇郴缁熷凡褰曞叆鐨勫叏閲忎富棰樿瀵熼」鏁版嵁;<br>
+ 3.姣忔鍏ㄩ噺瀵煎叆灏嗚鐩栨洿鏂颁笌琛ㄦ牸鏁版嵁銆佸眰绾у叧绯讳笉涓�鑷寸殑鏁版嵁閰嶇疆椤癸紝璇疯皑鎱庢搷浣滐紒<br>
+ </p>
+ <el-form class="demo-form-inline" >
+ <el-form-item label="閫夋嫨瀵煎叆鏂囦欢" required>
+ <div style="width: 100%;display: flex;align-items: center;">
+ <el-button type="primary" @click="clickRef">鐐瑰嚮涓婁紶</el-button>
+ <el-button type="text" @click="exportTemplate" :loading="exporting">鐐瑰嚮涓嬭浇妯$増.EXCEL</el-button>
+ </div>
+ <div style="font-size: 14px; color: black;" v-if="fileName">{{fileName}}</div>
+ </el-form-item>
+ </el-form>
+ <input type="file" style="position: fixed; left: 0; top: -50px;" accept=".xlsx" ref="fileExcel" @change="result" />
+ <template v-slot:footer>
+ <el-button @click="visible=false">杩斿洖</el-button>
+ </template>
+ </el-dialog>
+</template>
+
+<script>
+import BaseOpera from '@/components/base/BaseOpera'
+import { importDcaExcel, exportDcaExcel } from '@/api/business/category'
+export default {
+ name: 'OperaCategoryImportWindow',
+ extends: BaseOpera,
+ components: {},
+ data () {
+ return {
+ exporting: false,
+ importing: false,
+ fileName: ''
+ }
+ },
+ methods: {
+ open (title, companyType) {
+ this.title = title
+ this.fileName = ''
+ this.visible = true
+ },
+ // 瀵煎嚭妯℃澘
+ exportTemplate () {
+ this.$dialog.exportConfirm('纭瀵煎嚭涓嬭浇妯$増鍚楋紵')
+ .then(() => {
+ this.exporting = true
+ exportDcaExcel({}).then(response => {
+ this.exporting = false
+ this.download(response)
+ })
+ .catch(e => {
+ this.$tip.apiFailed(e)
+ })
+ .finally(() => {
+ this.exporting = false
+ })
+ })
+ .catch(() => {})
+ },
+ clickRef () {
+ this.$refs.fileExcel.click()
+ },
+ result (e) {
+ const data = new FormData()
+ data.append('file', e.target.files[0])
+ importDcaExcel(data)
+ .then(res => {
+ this.$message.success('瀵煎叆鎴愬姛')
+ this.$emit('success')
+ this.visible = false
+ })
+ .catch(err => {
+ this.$message.error(err)
+ this.fileName = ''
+ })
+ .finally(() => {
+ this.$refs.fileExcel.value = null
+ })
+ }
+ }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>
diff --git a/admin/src/components/business/OperaManagersWindow.vue b/admin/src/components/business/OperaManagersWindow.vue
index e106aac..e2a169c 100644
--- a/admin/src/components/business/OperaManagersWindow.vue
+++ b/admin/src/components/business/OperaManagersWindow.vue
@@ -6,8 +6,26 @@
@confirm="confirm"
>
<el-form :model="form" ref="form" :rules="rules">
- <el-form-item label="閫夋嫨璐熻矗浜猴細" prop="memberId">
- <el-select v-model="form.memberId" filterable remote :remote-method="loadMember" :loading="loading" placeholder="鍙緭鍏ュ鍚� | 鎵嬫満鍙� | 閮ㄩ棬鍚嶇О杩涜鎼滅储">
+ <el-form-item label="璁剧疆鑼冨洿" prop="isMember" :required="true">
+ <el-radio-group v-model="form.isMember">
+ <el-radio :label="0">鐩村睘閮ㄩ棬鍛樺伐</el-radio>
+ <el-radio :label="1">閮ㄩ棬鍙婂叾涓嬬骇閮ㄩ棬鍛樺伐</el-radio>
+ <el-radio :label="2">鎸囧畾浜哄憳</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ <el-form-item label="鎵�灞炵粍缁�" prop="companyId" v-if="form.isMember==0 || form.isMember==1" :required="true">
+ <treeselect
+ v-model="form.companyId"
+ placeholder="璇烽�夋嫨"
+ :options="companyTree"
+ :normalizer="normalizeOptions"
+ :default-expand-level="1"
+ noChildrenText="娌℃湁瀛愰�夐」"
+ noOptionsText="娌℃湁鍙�夐」"
+ noResultsText="娌℃湁鍖归厤鐨勭粨鏋�" />
+ </el-form-item>
+ <el-form-item label="閫夋嫨璐熻矗浜猴細" prop="memberIds" v-if="form.isMember==2" :required="true">
+ <el-select v-model="form.memberIds" filterable :multiple="true" :loading="loading" placeholder="鍙緭鍏ュ鍚� | 鎵嬫満鍙� | 閮ㄩ棬鍚嶇О杩涜鎼滅储">
<el-option
v-for="item in memberList"
:key="item.id"
@@ -35,6 +53,7 @@
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
import { allList } from '@/api/business/member'
+import { treeList } from '@/api/business/company'
export default {
name: 'OperaManagersWindow',
@@ -45,17 +64,27 @@
// 琛ㄥ崟鏁版嵁
form: {
type: '',
+ companyId: null,
memberId: '',
+ memberIds: [],
remark: '',
isQw: 0,
- isEmail: 0
+ isEmail: 0,
+ isMember: 0
},
+ companyTree: [],
loading: false,
memberList: [],
// 楠岃瘉瑙勫垯
rules: {
- memberId: [
- { required: true, message: '璇烽�夋嫨璐熻矗浜�' }
+ memberIds: [
+ { required: true ,message: '璇烽�夋嫨璐熻矗浜�' }
+ ],
+ companyId: [
+ { required: true, message: '璇烽�夋嫨閮ㄩ棬' }
+ ],
+ isMember: [
+ { required: true, message: '閫夋嫨璁剧疆鑼冨洿' }
]
}
}
@@ -67,10 +96,33 @@
})
},
methods: {
+ getfindCompanyTreePage () {
+ treeList({})
+ .then(res => {
+ if (res && res.length > 0) {
+ res[0].fsStatus = 1
+ this.companyTree = res
+ // this.searchForm.erpOrgId = res[0].erpId
+ }
+ })
+ },
+
+ // 瑙勮寖鍖栭�夐」鏁版嵁鐨勬柟娉�
+ normalizeOptions (node) {
+ if (node.childList && !node.childList.length) {
+ delete node.childList
+ }
+ return {
+ id: node.id,
+ label: node.name,
+ children: node.childList
+ }
+ },
loadMember (query) {
this.memberList = []
+ console.log(query)
if (!query || query == '') {
- return
+ // return
}
this.loading = true
allList({
@@ -95,7 +147,8 @@
this.form[this.configData['field.id']] = null
})
this.memberList = []
- // this.loadMember()
+ this.getfindCompanyTreePage()
+ this.loadMember()
}
}
}
diff --git a/admin/src/components/business/OperaWorkorderDetailDbhWindow.vue b/admin/src/components/business/OperaWorkorderDetailDbhWindow.vue
index 2931dd3..a0ea013 100644
--- a/admin/src/components/business/OperaWorkorderDetailDbhWindow.vue
+++ b/admin/src/components/business/OperaWorkorderDetailDbhWindow.vue
@@ -148,11 +148,11 @@
info: {},
statusMap: {
0: '寰呭垎閰峎TS',
- 1: '寰呭垎閰嶄换鍔�',
- 2: '寰呭伐绋嬪笀澶勭悊',
- 3: '宸茶В鍐�',
- 4: '宸茶В鍐�',
- 5: '宸茶В鍐�'
+ 1: '寰呭垎閰嶅伐绋嬪笀',
+ 2: '寰呭垎閰嶄换鍔�',
+ 3: 'SHE鍏抽棴',
+ 4: 'WTS鍏抽棴',
+ 5: '宸ョ▼甯堝叧闂�'
},
cateList: {
0: 'SHE浜嬩欢宸ュ崟',
@@ -231,7 +231,7 @@
.modal_wrap {
display: flex;
- height: 100%;
+ height: aotu;
.modal_content {
flex: 1;
diff --git a/admin/src/components/business/OperaWorkorderDetailDcaInfoWindow.vue b/admin/src/components/business/OperaWorkorderDetailDcaInfoWindow.vue
index ed6b287..1fc299f 100644
--- a/admin/src/components/business/OperaWorkorderDetailDcaInfoWindow.vue
+++ b/admin/src/components/business/OperaWorkorderDetailDcaInfoWindow.vue
@@ -148,7 +148,7 @@
statusMap: {
0: '寰呭垎閰峎TS',
1: '寰呭垎閰嶄换鍔�',
- 2: '寰呭伐绋嬪笀澶勭悊',
+ 2: '寰呭垎閰嶄换鍔�',
3: '宸茶В鍐�',
4: '宸茶В鍐�',
5: '宸茶В鍐�'
@@ -230,7 +230,7 @@
.modal_wrap {
display: flex;
- height: 100%;
+ height: auto;
overflow: hidden;
.modal_content {
diff --git a/admin/src/components/business/OperaWorkorderDetailDcaWindow.vue b/admin/src/components/business/OperaWorkorderDetailDcaWindow.vue
index 2d0e79d..b0c5718 100644
--- a/admin/src/components/business/OperaWorkorderDetailDcaWindow.vue
+++ b/admin/src/components/business/OperaWorkorderDetailDcaWindow.vue
@@ -91,11 +91,16 @@
<el-table-column label="浜岀骇涓婚" prop="categoryName" min-width="60"> </el-table-column>
<el-table-column label="瑙傚療椤�" prop="problemTitle" min-width="100"> </el-table-column>
<el-table-column label="涓嶇鍚堝師鍥�" prop="eventInfo" min-width="120" />
- <el-table-column label="澶勭悊鐘舵��" prop="status" min-width="80">
+ <el-table-column label="鐘舵��" prop="status" min-width="80">
<template slot-scope="{row}">
<!-- <span :class="'statusInfo'+row.status" v-if="row.status ==0">寰呭鐞�</span>-->
<span :class="'statusInfo'+row.status" v-if="row.status ==3 ||row.status ==4||row.status ==5">宸插鐞�</span>
<span :class="'statusInfo'+row.status" v-else>澶勭悊涓�</span>
+ </template>
+ </el-table-column>
+ <el-table-column prop="statusInfo" label="鐘舵�佹弿杩�" min-width="100px">
+ <template slot-scope="{row}">
+ <span :class="'statusInfo'+row.status" >{{ row.statusName }}</span>
</template>
</el-table-column>
<el-table-column label="鎿嶄綔" prop="status" min-width="80">
@@ -146,11 +151,11 @@
dataList2: [],
statusMap: {
0: '寰呭垎閰峎TS',
- 1: '寰呭垎閰嶄换鍔�',
- 2: '寰呭伐绋嬪笀澶勭悊',
- 3: '宸茶В鍐�',
- 4: '宸茶В鍐�',
- 5: '宸茶В鍐�'
+ 1: '寰呭垎閰嶅伐绋嬪笀',
+ 2: '寰呭垎閰嶄换鍔�',
+ 3: 'SHE鍏抽棴',
+ 4: 'WTS鍏抽棴',
+ 5: '宸ョ▼甯堝叧闂�'
},
cateList: {
0: 'SHE浜嬩欢宸ュ崟',
@@ -249,7 +254,7 @@
.modal_wrap {
display: flex;
- height: 100%;
+ height: auto;
.modal_content {
flex: 1;
diff --git a/admin/src/components/business/OperaWorkorderDetailSheWindow.vue b/admin/src/components/business/OperaWorkorderDetailSheWindow.vue
index 9b99c9b..db08016 100644
--- a/admin/src/components/business/OperaWorkorderDetailSheWindow.vue
+++ b/admin/src/components/business/OperaWorkorderDetailSheWindow.vue
@@ -181,7 +181,7 @@
statusMap: {
0: '寰呭垎閰峎TS',
1: '寰呭垎閰嶄换鍔�',
- 2: '寰呭伐绋嬪笀澶勭悊',
+ 2: '寰呭垎閰嶄换鍔�',
3: '宸茶В鍐�',
4: '宸茶В鍐�',
5: '宸茶В鍐�'
@@ -263,7 +263,7 @@
.modal_wrap {
display: flex;
- height: 100%;
+ height: auto;
.modal_content {
flex: 1;
diff --git a/admin/src/views/business/categoryDcaProblem.vue b/admin/src/views/business/categoryDcaProblem.vue
index d35b9d3..fb32829 100644
--- a/admin/src/views/business/categoryDcaProblem.vue
+++ b/admin/src/views/business/categoryDcaProblem.vue
@@ -25,9 +25,11 @@
<!-- 琛ㄦ牸鍜屽垎椤� -->
<template v-slot:table-wrap>
<ul class="toolbar" v-if="containPermissions(['business:category:create', 'business:category:delete' ])" >
+ <li> <el-button type="primary" :loading="isWorking.export" icon="el-icon-download" @click="exportDcaExcel">瀵煎嚭鍏ㄩ儴</el-button></li>
<li><el-button type="primary"
@click="$refs.operaCategoryWindow.open('鏂板缓DCA涓婚鍜岃瀵熼」', null,categoryList ,4,searchForm.parentId)" icon="el-icon-plus"
v-permissions="['business:category:create']">鏂板缓</el-button></li>
+ <li> <el-button type="primary" :loading="importing" icon="el-icon-plus" @click="$refs.OperaCategoryImportWindow.open('鎵归噺瀵煎叆涓婚瑙傚療椤�')">鍏ㄩ噺瀵煎叆</el-button></li>
<li><el-button type="danger" @click="deleteByIdInBatch(true,getfindTreePage)" icon="el-icon-delete" v-permissions="['business:category:delete']">鎵归噺鍒犻櫎</el-button></li>
</ul>
<el-table :height="tableHeightNew" v-loading="isWorking.search" :data="tableData.list" stripe @selection-change="handleSelectionChange">
@@ -54,6 +56,7 @@
<pagination @size-change="handleSizeChange" @current-change="handlePageChange" :pagination="tableData.pagination">
</pagination>
<OperaCategoryDcaProblemWindow ref="operaCategoryWindow" @success="handlePageChangeDo"/>
+ <OperaCategoryImportWindow ref="OperaCategoryImportWindow" @success="handlePageChangeDo" />
</template>
</TableLayout1>
</template>
@@ -65,14 +68,16 @@
import Pagination from '@/components/common/Pagination'
import Tree from '@/components/common/Tree'
import { treeList } from '@/api/business/category'
+import OperaCategoryImportWindow from '@/components/business/OperaCategoryImportWindow'
export default {
name: 'categoryDcaProblem',
extends: BaseTable,
- components: { TableLayout1, Pagination, Tree, OperaCategoryDcaProblemWindow },
+ components: { TableLayout1, Pagination, Tree, OperaCategoryDcaProblemWindow ,OperaCategoryImportWindow},
data () {
return {
TreeList: [],
level: 0,
+ importing: false,
// 鎼滅储
searchForm: {
name: '',
@@ -100,6 +105,24 @@
this.getfindTreePage()
},
methods: {
+ exportDcaExcel () {
+ this.__checkApi()
+ this.$dialog.exportConfirm('纭瀵煎嚭鍚楋紵')
+ .then(() => {
+ this.isWorking.export = true
+ this.api.exportDcaExcel({})
+ .then(response => {
+ this.download(response)
+ })
+ .catch(e => {
+ this.$tip.apiFailed(e)
+ })
+ .finally(() => {
+ this.isWorking.export = false
+ })
+ })
+ .catch(() => {})
+ },
handlePageChangeDo () {
this.searchForm.isRoot = 1
this.searchForm.level = 1
@@ -163,7 +186,7 @@
this.searchForm.parentId = row.id
this.searchForm.isRoot = null
this.searchForm.parentIdPath = row.idPath
- this.level= row.level
+ this.level = row.level
if (row.level === 2) {
this.searchForm.type = 6
} else {
diff --git a/admin/src/views/business/managersShe.vue b/admin/src/views/business/managersShe.vue
index 9c97840..d36d96a 100644
--- a/admin/src/views/business/managersShe.vue
+++ b/admin/src/views/business/managersShe.vue
@@ -16,7 +16,7 @@
<template v-slot:table-wrap>
<ul class="toolbar" v-permissions="['business:managers:create', 'business:managers:delete']">
<li><el-button type="primary" @click="$refs.operaManagersWindow.open('鏂板缓SHE璐d换浜�',{type:0})" icon="el-icon-plus" v-permissions="['business:managers:create']">鏂板缓</el-button></li>
- <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:managers:delete']">鍒犻櫎</el-button></li>
+ <li><el-button type="danger" @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:managers:delete']">鍒犻櫎</el-button></li>
</ul>
<el-table
:height="tableHeightNew"
diff --git a/admin/src/views/business/managersSheNotice.vue b/admin/src/views/business/managersSheNotice.vue
index bb99811..67cd24c 100644
--- a/admin/src/views/business/managersSheNotice.vue
+++ b/admin/src/views/business/managersSheNotice.vue
@@ -16,7 +16,7 @@
<template v-slot:table-wrap>
<ul class="toolbar" v-permissions="['business:managers:create', 'business:managers:delete']">
<li><el-button type="primary" @click="$refs.operaManagersWindow.open('鏂板缓浜嬩欢閫氱煡浜虹鐞�',{type:3})" icon="el-icon-plus" v-permissions="['business:managers:create']">鏂板缓</el-button></li>
- <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:managers:delete']">鍒犻櫎</el-button></li>
+ <li><el-button type="danger" @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:managers:delete']">鍒犻櫎</el-button></li>
</ul>
<el-table
:height="tableHeightNew"
diff --git a/admin/src/views/business/workorderDbh.vue b/admin/src/views/business/workorderDbh.vue
index 4be20da..a913132 100644
--- a/admin/src/views/business/workorderDbh.vue
+++ b/admin/src/views/business/workorderDbh.vue
@@ -23,6 +23,15 @@
<el-form-item label="宸ュ崟鍙�" prop="code">
<el-input v-model="searchForm.code" clearable placeholder="璇疯緭鍏ュ伐鍗曞彿" @keypress.enter.native="search"></el-input>
</el-form-item>
+ <el-form-item label="鐘舵�佹弿杩�" prop="status">
+ <el-select v-model="searchForm.status" placeholder="璇烽�夋嫨">
+ <el-option label="寰呭垎閰峎TS" value="0"></el-option>
+ <el-option label="寰呭垎閰嶅伐绋嬪笀" value="1"></el-option>
+ <el-option label="SHE鍏抽棴" value="2"></el-option>
+ <el-option label="WTS鍏抽棴" value="3"></el-option>
+ <el-option label="宸ョ▼甯堝叧闂�" value="4"></el-option>
+ </el-select>
+ </el-form-item>
<el-form-item label="鎻愪氦鏃堕棿" prop="queryStartTime">
<el-date-picker type="datetime" v-model="searchForm.queryStartTime" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="璇烽�夋嫨寮�濮嬫椂闂�" @change="changeRadio" />
@@ -64,11 +73,13 @@
<el-table-column prop="typeName" label="椋庨櫓绫诲瀷" min-width="100px"></el-table-column>
<el-table-column prop="status" label="鐘舵��" min-width="100px">
<template slot-scope="{row}">
-<!--
- <span :class="'statusInfo'+row.status" v-if="row.status ==0">寰呭鐞�</span>
--->
<span :class="'statusInfo'+row.status" v-if="row.status ==3 ||row.status ==4||row.status ==5">宸插鐞�</span>
<span :class="'statusInfo'+row.status" v-else>鏈鐞�</span>
+ </template>
+ </el-table-column>
+ <el-table-column prop="statusInfo" label="鐘舵�佹弿杩�" min-width="100px">
+ <template slot-scope="{row}">
+ <span :class="'statusInfo'+row.status" >{{ row.statusName }}</span>
</template>
</el-table-column>
<el-table-column prop="submitDate" label="涓婃姤鏃堕棿" min-width="150px"></el-table-column>
@@ -132,6 +143,7 @@
typeId: null,
typeIdPath: null,
code: '',
+ status: null,
categoryList: []
},
categoryprops: {
diff --git a/admin/src/views/business/workorderDcaChild.vue b/admin/src/views/business/workorderDcaChild.vue
index 4238c5b..af54536 100644
--- a/admin/src/views/business/workorderDcaChild.vue
+++ b/admin/src/views/business/workorderDcaChild.vue
@@ -29,6 +29,15 @@
<el-form-item label="宸ュ崟鍙�" prop="code">
<el-input v-model="searchForm.code" style="width: 120px" clearable placeholder="宸ュ崟鍙�" @keypress.enter.native="search"></el-input>
</el-form-item>
+ <el-form-item label="鐘舵�佹弿杩�" prop="status">
+ <el-select v-model="searchForm.status" placeholder="璇烽�夋嫨">
+ <el-option label="寰呭垎閰峎TS" value="0"></el-option>
+ <el-option label="寰呭垎閰嶅伐绋嬪笀" value="1"></el-option>
+ <el-option label="SHE鍏抽棴" value="2"></el-option>
+ <el-option label="WTS鍏抽棴" value="3"></el-option>
+ <el-option label="宸ョ▼甯堝叧闂�" value="4"></el-option>
+ </el-select>
+ </el-form-item>
<el-form-item label="鎻愪氦鏃堕棿" prop="queryStartTime">
<el-date-picker type="datetime" v-model="searchForm.queryStartTime" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="寮�濮嬫椂闂�" @change="changeRadio" />
@@ -62,7 +71,7 @@
stripe
@selection-change="handleSelectionChange"
>
- <el-table-column prop="code" label="宸ュ崟鍙�" min-width="150px" fixed>
+ <el-table-column prop="code" label="宸ュ崟鍙�" min-width="160px" fixed>
<template slot-scope="{row}">
<span style="color: #2E68EC;cursor: pointer" @click="$refs.operaWorkorderWindow.open('DCA浜嬩欢宸ュ崟璇︽儏', row)" >{{ row.code || '-'}}</span>
</template>
@@ -71,15 +80,17 @@
<template slot-scope="{row}"> {{row.typeName}}/{{row.categoryName}}
</template>
</el-table-column>
-<!--
- <el-table-column prop="categoryName" label="浜岀骇涓婚" min-width="100px"></el-table-column>
--->
<el-table-column prop="problemTitle" label="涓嶇鍚堥」" min-width="250px"></el-table-column>
<el-table-column prop="status" label="鐘舵��" min-width="100px">
<template slot-scope="{row}">
<!-- <span :class="'statusInfo'+row.status" v-if="row.status ==0">寰呭鐞�</span>-->
<span :class="'statusInfo'+row.status" v-if="row.status ==3 ||row.status ==4||row.status ==5">宸插鐞�</span>
<span :class="'statusInfo'+row.status" v-else>澶勭悊涓�</span>
+ </template>
+ </el-table-column>
+ <el-table-column prop="statusInfo" label="鐘舵�佹弿杩�" min-width="100px">
+ <template slot-scope="{row}">
+ <span :class="'statusInfo'+row.status" >{{ row.statusName}}</span>
</template>
</el-table-column>
<el-table-column prop="locationName" label="浣嶇疆" min-width="150px"></el-table-column>
@@ -142,6 +153,7 @@
categoryId: '',
typeId: '',
code: '',
+ status: null,
categoryList: []
},
categoryprops: {
diff --git a/server/src/main/java/com/doumee/api/business/CategoryController.java b/server/src/main/java/com/doumee/api/business/CategoryController.java
index 1a46aa7..43b93f4 100644
--- a/server/src/main/java/com/doumee/api/business/CategoryController.java
+++ b/server/src/main/java/com/doumee/api/business/CategoryController.java
@@ -9,14 +9,17 @@
import com.doumee.core.model.PageWrap;
import com.doumee.core.model.PageData;
import com.doumee.dao.business.model.Category;
+import com.doumee.dao.business.vo.CategoryDcaProblemDto;
import com.doumee.service.business.CategoryService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
+import io.swagger.annotations.*;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
import javax.servlet.http.HttpServletResponse;
+import java.io.File;
import java.util.List;
/**
@@ -95,6 +98,13 @@
public void exportExcel (@RequestBody PageWrap<Category> pageWrap, HttpServletResponse response) {
ExcelExporter.build(Category.class).export(categoryService.findPage(pageWrap).getRecords(), "鍒嗙被淇℃伅琛�", response);
}
+ @ApiOperation("瀵煎嚭DCAExcel")
+ @PostMapping("/exportDcaExcel")
+ @EncryptionReq
+ @RequiresPermissions("business:category:exportExcel")
+ public void exportDcaExcel (@RequestBody Category pageWrap, HttpServletResponse response) {
+ ExcelExporter.build(CategoryDcaProblemDto.class).export(categoryService.findListForDca(pageWrap), "DCA浜嬩欢涓婚鍜岃瀵熼」閰嶇疆_"+System.currentTimeMillis(), response);
+ }
@ApiOperation("鏍规嵁ID鏌ヨ")
@GetMapping("/{id}")
@@ -114,5 +124,13 @@
public ApiResponse<List<Category>> tree (@RequestBody Category param){
return ApiResponse.success(categoryService.treeList(param));
}
-
+ @ApiOperation(value = "DCA涓婚鍜岃瀵熼」淇℃伅瀵煎叆" ,notes = "淇濆崟鐢宠")
+ @PostMapping("/importDcaExcel")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "file", value = "file", required = true, paramType = "query", dataType = "file", dataTypeClass = File.class),
+ })
+ @RequiresPermissions("business:member:create")
+ public ApiResponse<String> imporimportDcaExceltExcel (@ApiParam(value = "file") MultipartFile file ) {
+ return ApiResponse.success(categoryService.importDcaBatch(file));
+ }
}
diff --git a/server/src/main/java/com/doumee/config/mybatis/DmStdOutImpl.java b/server/src/main/java/com/doumee/config/mybatis/DmStdOutImpl.java
index bab3e2e..1f5d305 100644
--- a/server/src/main/java/com/doumee/config/mybatis/DmStdOutImpl.java
+++ b/server/src/main/java/com/doumee/config/mybatis/DmStdOutImpl.java
@@ -5,9 +5,22 @@
@Slf4j
public class DmStdOutImpl extends StdOutImpl {
+ private Boolean isOff = false;
+
+ public Boolean isOff() {
+ return isOff;
+ }
+
+ public void setOff(Boolean off) {
+ isOff = off;
+ }
public DmStdOutImpl(String clazz) {
super(clazz);
+ }
+ public DmStdOutImpl(String clazz,Boolean off) {
+ super(clazz);
+ this.isOff = off;
}
public boolean isDebugEnabled() {
@@ -30,6 +43,9 @@
}
public void debug(String s) {
+ if(isOff!=null && isOff()){
+ return;
+ }
log.info(s);
// System.out.println(s);
}
diff --git a/server/src/main/java/com/doumee/config/mybatis/MyBatisInterceptor.java b/server/src/main/java/com/doumee/config/mybatis/MyBatisInterceptor.java
index ac540c8..a4c4d48 100644
--- a/server/src/main/java/com/doumee/config/mybatis/MyBatisInterceptor.java
+++ b/server/src/main/java/com/doumee/config/mybatis/MyBatisInterceptor.java
@@ -4,6 +4,7 @@
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.binding.MapperMethod;
import org.apache.ibatis.executor.Executor;
+import org.apache.ibatis.logging.Log;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.mapping.SqlCommandType;
import org.apache.ibatis.plugin.*;
@@ -11,7 +12,9 @@
import org.springframework.stereotype.Component;
import org.springframework.util.ReflectionUtils;
+import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
+import java.lang.reflect.Method;
import java.util.*;
/**
@@ -41,6 +44,7 @@
MappedStatement mappedStatement = (MappedStatement) invocation.getArgs()[0];
SqlCommandType sqlCommandType = mappedStatement.getSqlCommandType();
Object target = invocation.getArgs()[1];
+
if(target instanceof MapperMethod.ParamMap) {
try {
target = ((MapperMethod.ParamMap) target).get("param1");
diff --git a/server/src/main/java/com/doumee/core/constants/Constants.java b/server/src/main/java/com/doumee/core/constants/Constants.java
index a3daead..75cd22f 100644
--- a/server/src/main/java/com/doumee/core/constants/Constants.java
+++ b/server/src/main/java/com/doumee/core/constants/Constants.java
@@ -57,7 +57,9 @@
*/
interface CacheKey {
}
-
+ public interface RedisKeys {
+ public static final String IMPORTING_CATEGORY = "IMPORTING_CATEGORY";
+ }
/**
* 鎿嶄綔绫诲瀷锛岀敤浜庡仛鎺ュ彛楠岃瘉鍒嗙粍
*/
@@ -226,31 +228,41 @@
public enum WorkOrderStatus{
- waitConfirm( 0, "寰呭垎閰峎TS","{title}涓婃姤",""),
- waitAllocation(1, "寰呭垎閰嶄换鍔�","寰呭垎閰嶄换鍔�",""),
- waitDeal(2, "寰呭鐞�","寰呭鐞�",""),
- sheClose(3, "宸茶В鍐�","SHE宸插叧闂�",""),
- wtsClose(4, "宸茶В鍐�","WTS宸插叧闂�",""),
- close(5, "宸茶В鍐�","宸茶В鍐�",""),
- urge (6, "鍌績","","")
+ waitConfirm( 0, "寰呭垎閰峎TS","{title}涓婃姤","","寰呭垎閰峎TS" ),
+ waitAllocation(1, "寰呭垎閰嶄换鍔�","寰呭垎閰嶄换鍔�","","寰呭垎閰嶄换鍔�"),
+ waitDeal(2, "寰呭鐞�","寰呭鐞�","","寰呭伐绋嬪笀澶勭悊"),
+ sheClose(3, "宸茶В鍐�","SHE宸插叧闂�","","SHE宸插叧闂�"),
+ wtsClose(4, "宸茶В鍐�","WTS宸插叧闂�","","WTS宸插叧闂�"),
+ close(5, "宸茶В鍐�","宸茶В鍐�","","宸ョ▼甯堝叧闂�"),
+ urge (6, "鍌績","","","")
;
private int status;
private String statusInfo;
+ private String statusName;
private String logTitle;
private String noticeContent;
// 鏋勯�犳柟娉�
- WorkOrderStatus(int status, String statusInfo,String logTitle,String noticeContent ) {
+ WorkOrderStatus(int status, String statusInfo,String logTitle,String noticeContent,String statusName ) {
this.status = status;
this.statusInfo = statusInfo;
this.logTitle = logTitle;
this.noticeContent = noticeContent;
+ this.statusName = statusName;
}
public static String getName(int index) {
for (WorkOrderStatus c : WorkOrderStatus.values()) {
if (c.getKey() == index) {
return c.statusInfo;
+ }
+ }
+ return null;
+ }
+ public static String getStatusName(int index) {
+ for (WorkOrderStatus c : WorkOrderStatus.values()) {
+ if (c.getKey() == index) {
+ return c.statusName;
}
}
return null;
@@ -264,6 +276,22 @@
this.status = status;
}
+ public int getStatus() {
+ return status;
+ }
+
+ public void setStatus(int status) {
+ this.status = status;
+ }
+
+ public String getStatusName() {
+ return statusName;
+ }
+
+ public void setStatusName(String statusName) {
+ this.statusName = statusName;
+ }
+
public String getStatusInfo() {
return statusInfo;
}
diff --git a/server/src/main/java/com/doumee/dao/business/model/Category.java b/server/src/main/java/com/doumee/dao/business/model/Category.java
index 9f9f611..b6547f5 100644
--- a/server/src/main/java/com/doumee/dao/business/model/Category.java
+++ b/server/src/main/java/com/doumee/dao/business/model/Category.java
@@ -71,6 +71,9 @@
@ApiModelProperty(value = "涓婄骇鍚嶇О")
@TableField(exist = false)
private String parentName;
+ @ApiModelProperty(value = "涓婁笂绾у悕绉�")
+ @TableField(exist = false)
+ private String rootName;
@ApiModelProperty(value = "鎿嶄綔浜哄悕瀛�")
@TableField(exist = false)
private String editorName;
@@ -83,4 +86,8 @@
@ApiModelProperty(value = "瀛愰泦闆嗗悎")
@TableField(exist = false)
private List<Category> childList;
+
+ @ApiModelProperty(value = "瀛愰泦闆嗗悎(鎵归噺瀵煎叆瀵规瘮涓嬮泦锛�")
+ @TableField(exist = false)
+ private List<Category> childMatchList;
}
diff --git a/server/src/main/java/com/doumee/dao/business/model/Managers.java b/server/src/main/java/com/doumee/dao/business/model/Managers.java
index 7e78c07..9d3bed8 100644
--- a/server/src/main/java/com/doumee/dao/business/model/Managers.java
+++ b/server/src/main/java/com/doumee/dao/business/model/Managers.java
@@ -9,6 +9,7 @@
import lombok.Data;
import java.util.Date;
+import java.util.List;
/**
* 璐d换浜轰俊鎭〃
@@ -87,4 +88,13 @@
@ApiModelProperty(value = "鍛樺伐浼佸井ID")
@TableField(exist = false)
private String memberQwId;
+ @ApiModelProperty(value = "鍛樺伐缂栫爜闆嗗悎")
+ @TableField(exist = false)
+ private List<Integer> memberIds;
+ @ApiModelProperty(value = "缁勭粐缂栫爜ID")
+ @TableField(exist = false)
+ private Integer companyId;
+ @ApiModelProperty(value = "璁剧疆鑼冨洿 0鐩村睘閮ㄩ棬鍛樺伐 1閮ㄩ棬鍙婂叾涓嬬骇甯冩仼鍛樺伐 2鎸囧畾浜哄憳")
+ @TableField(exist = false)
+ private Integer isMember;
}
diff --git a/server/src/main/java/com/doumee/dao/business/model/Workorder.java b/server/src/main/java/com/doumee/dao/business/model/Workorder.java
index 6067883..22ea41f 100644
--- a/server/src/main/java/com/doumee/dao/business/model/Workorder.java
+++ b/server/src/main/java/com/doumee/dao/business/model/Workorder.java
@@ -218,6 +218,9 @@
@ApiModelProperty(value = "瑙e喅鎯呭喌锛堟煡璇娇鐢級锛�0=鍚︼紱1=鏄紱",hidden = true)
@TableField(exist = false)
private Integer dealStatus;
+ @ApiModelProperty(value = "鐘舵�佹弿杩帮紱",hidden = true)
+ @TableField(exist = false)
+ private String statusName;
@ApiModelProperty(value = "缁熻鏁帮紱",hidden = true)
@TableField(exist = false)
private Long num;
diff --git a/server/src/main/java/com/doumee/dao/business/vo/CategoryDcaProblemDto.java b/server/src/main/java/com/doumee/dao/business/vo/CategoryDcaProblemDto.java
new file mode 100644
index 0000000..1f2522f
--- /dev/null
+++ b/server/src/main/java/com/doumee/dao/business/vo/CategoryDcaProblemDto.java
@@ -0,0 +1,30 @@
+package com.doumee.dao.business.vo;
+
+import com.doumee.core.annotation.excel.ExcelColumn;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * Created by IntelliJ IDEA.
+ *
+ * @Author : Rk
+ * @create 2023/7/13 10:40
+ */
+@Data
+@ApiModel("DCA涓婚瑙傚療椤瑰鍑轰俊鎭�")
+public class CategoryDcaProblemDto {
+ @ApiModelProperty(value = "搴忓彿")
+ @ExcelColumn(name="搴忓彿",index =1 ,width = 4)
+ private Long index;
+ @ApiModelProperty(value = "涓�绾т富棰�")
+ @ExcelColumn(name="涓�绾ц瀵熶富棰�",index =2 ,width = 10)
+ private String parentName;
+ @ApiModelProperty("浜岀骇瑙傚療涓婚")
+ @ExcelColumn(name="浜岀骇瑙傚療涓婚",index =3,width = 10)
+ private String typeName;
+ @ApiModelProperty(value = "瑙傚療椤�" )
+ @ExcelColumn(name="瑙傚療椤�",index =4,width = 40 )
+ private String problem;
+
+}
diff --git a/server/src/main/java/com/doumee/dao/business/vo/WorkorderDbhDto.java b/server/src/main/java/com/doumee/dao/business/vo/WorkorderDbhDto.java
index afd73f1..1b288ce 100644
--- a/server/src/main/java/com/doumee/dao/business/vo/WorkorderDbhDto.java
+++ b/server/src/main/java/com/doumee/dao/business/vo/WorkorderDbhDto.java
@@ -28,14 +28,17 @@
@ApiModelProperty(value = "鐘舵�� 鐘舵�� 0寰呯‘璁�/寰呭垵瀹� 1寰呭垎閰�/寰呯粓瀹� 2寰呭鐞� 4WTS鍏抽棴 5宸ョ▼甯堝叧闂�", example = "1")
@ExcelColumn(name="鐘舵��",index =4,width = 4, valueMapping = "0=寰呭鐞�;1=澶勭悊涓�;2=澶勭悊涓�;3=宸插鐞�;4=宸插鐞�;5=宸插鐞�;")
private Integer status;
+ @ApiModelProperty(value = "鐘舵�佹弿杩�")
+ @ExcelColumn(name="鐘舵�佹弿杩�",index =5,width = 8)
+ private String statusName;
@ApiModelProperty(value = "涓婃姤鏃堕棿", example = "1")
- @ExcelColumn(name="涓婃姤鏃堕棿",index =5 ,dateFormat = "yyyy-MM-dd HH:mm:ss",width = 10)
+ @ExcelColumn(name="涓婃姤鏃堕棿",index =6 ,dateFormat = "yyyy-MM-dd HH:mm:ss",width = 10)
private Date submitDate;
@ApiModelProperty(value = "鍙戠幇鏃堕棿", example = "1")
- @ExcelColumn(name="鍙戠幇鏃堕棿",index =6 ,dateFormat = "yyyy-MM-dd HH:mm:ss",width = 10)
+ @ExcelColumn(name="鍙戠幇鏃堕棿",index =7 ,dateFormat = "yyyy-MM-dd HH:mm:ss",width = 10)
private Date happenTime;
@ApiModelProperty(value = "鍙戠敓鍦扮偣", example = "1")
- @ExcelColumn(name="鍙戠敓鍦扮偣",index =7 ,width = 6)
+ @ExcelColumn(name="鍙戠敓鍦扮偣",index =8 ,width = 6)
private String locationName;
@ApiModelProperty(value = "椋庨櫓鎻忚堪", example = "1")
@ExcelColumn(name="椋庨櫓鎻忚堪",index =11,width = 10)
diff --git a/server/src/main/java/com/doumee/dao/business/vo/WorkorderDcaChildDto.java b/server/src/main/java/com/doumee/dao/business/vo/WorkorderDcaChildDto.java
index 53ffd98..c6528e7 100644
--- a/server/src/main/java/com/doumee/dao/business/vo/WorkorderDcaChildDto.java
+++ b/server/src/main/java/com/doumee/dao/business/vo/WorkorderDcaChildDto.java
@@ -4,6 +4,8 @@
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
+import org.apache.ibatis.logging.nologging.NoLoggingImpl;
+import org.apache.ibatis.logging.slf4j.Slf4jImpl;
import java.util.Date;
@@ -34,6 +36,9 @@
@ApiModelProperty(value = "鐘舵�� 鐘舵�� 0寰呯‘璁�/寰呭垵瀹� 1寰呭垎閰�/寰呯粓瀹� 2寰呭鐞� 4WTS鍏抽棴 5宸ョ▼甯堝叧闂�", example = "1")
@ExcelColumn(name="鐘舵��",index =6,width = 4, valueMapping = "0=寰呭鐞�;1=澶勭悊涓�;2=澶勭悊涓�;3=宸插鐞�;4=宸插鐞�;5=宸插鐞�;")
private Integer status;
+ @ApiModelProperty(value = "鐘舵�佹弿杩�")
+ @ExcelColumn(name="鐘舵�佹弿杩�",index =5,width = 8)
+ private String statusName;
@ApiModelProperty(value = "涓婃姤鏃堕棿", example = "1")
@ExcelColumn(name="涓婃姤鏃堕棿",index =7 ,dateFormat = "yyyy-MM-dd HH:mm:ss",width = 10)
private Date submitDate;
@@ -43,6 +48,7 @@
@ApiModelProperty(value = "浣嶇疆", example = "1")
@ExcelColumn(name="浣嶇疆",index =9 ,width = 6)
private String locationName;
+
@ApiModelProperty(value = "涓嶇鍚堝師鍥�", example = "1")
@ExcelColumn(name="涓嶇鍚堝師鍥�",index =10,width = 10)
private String eventInfo;
diff --git a/server/src/main/java/com/doumee/service/business/CategoryService.java b/server/src/main/java/com/doumee/service/business/CategoryService.java
index d96ce32..69d9486 100644
--- a/server/src/main/java/com/doumee/service/business/CategoryService.java
+++ b/server/src/main/java/com/doumee/service/business/CategoryService.java
@@ -3,7 +3,9 @@
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.dao.business.model.Category;
+import com.doumee.dao.business.vo.CategoryDcaProblemDto;
import com.doumee.dao.web.vo.CategoryVO;
+import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@@ -103,10 +105,14 @@
* @return
*/
List<CategoryVO> getCategoryVOTree(String categoryType,Integer categoryId);
+ List<CategoryDcaProblemDto> findListForDca(Category category);
List<CategoryVO> getCategoryVOList(Integer categoryType,Integer isRoot);
List<CategoryVO> getCategoryVOForGCXTree(Integer categoryId);
List<Category> treeList(Category param );
+
+ String importDcaBatch(MultipartFile file);
+ String initRedis();
}
diff --git a/server/src/main/java/com/doumee/service/business/impl/CategoryServiceImpl.java b/server/src/main/java/com/doumee/service/business/impl/CategoryServiceImpl.java
index 8ba0af2..85abc89 100644
--- a/server/src/main/java/com/doumee/service/business/impl/CategoryServiceImpl.java
+++ b/server/src/main/java/com/doumee/service/business/impl/CategoryServiceImpl.java
@@ -1,6 +1,6 @@
package com.doumee.service.business.impl;
-import com.doumee.core.constants.Constants;
+import com.doumee.core.annotation.excel.ExcelImporter;
import com.doumee.core.constants.Constants;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
@@ -10,14 +10,12 @@
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.CategoryMapper;
import com.doumee.dao.business.model.Category;
-import com.doumee.dao.business.model.Member;
+import com.doumee.dao.business.model.Company;
+import com.doumee.dao.business.vo.CategoryDcaProblemDto;
import com.doumee.dao.business.vo.CompanyTree;
import com.doumee.dao.web.vo.CategoryVO;
import com.doumee.dao.web.vo.CategoryVOTree;
-import com.doumee.dao.business.model.Company;
-import com.doumee.dao.business.model.Managers;
import com.doumee.dao.business.vo.CategoryTree;
-import com.doumee.dao.business.vo.CompanyTree;
import com.doumee.dao.system.model.SystemUser;
import com.doumee.service.business.CategoryService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -25,17 +23,24 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import io.swagger.models.auth.In;
import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.ss.usermodel.CellType;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
+import org.springframework.web.multipart.MultipartFile;
+import javax.annotation.PostConstruct;
+import javax.annotation.Resource;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
-import java.util.UUID;
import java.util.stream.Collectors;
/**
@@ -46,6 +51,8 @@
@Service
public class CategoryServiceImpl implements CategoryService {
+ @Resource(name="sessionRedisTemplate")
+ private RedisTemplate<Object, Serializable> redisTemplate;
@Autowired
private CategoryMapper categoryMapper;
@@ -375,8 +382,366 @@
}
return categoryVOList;
}
+ public List<Category> findAllListForDca() {
+ List<Category> categoryList = categoryMapper.selectList(new QueryWrapper<Category>().lambda()
+ .eq(Category::getIsdeleted, Constants.ZERO)
+ .in(Category::getType, Constants.FOUR, Constants.SIX)//涓婚鍜岃瀵熼」
+ .orderByAsc(Category::getSortnum)
+ );
+ return categoryList;
+ }
+ public List<Category> findListForDcaTree( List<Category> categoryList) {
+ if (com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(categoryList)) {
+ long index = 1;
+ List<Category> pList = new ArrayList<>();
+ for (Category category : categoryList) {
+ if (category.getParentId() == null) {
+ category.setChildList(new ArrayList<>());
+ for (Category cc : categoryList) {
+ if (Constants.equalsInteger(cc.getParentId(), category.getId())) {
+ cc.setChildList(new ArrayList<>());
+ for (Category ccc : categoryList) {
+ if (Constants.equalsInteger(ccc.getParentId(), cc.getId())) {
+ cc.getChildList().add(ccc);
+ }
+ }
+ category.getChildList().add(cc);
+ }
+ }
+ pList.add(category);
+ }
+ }
+ return pList;
+ }
+ return null;
+ }
+ public List<Category> findImportTreeForDca ( List<CategoryDcaProblemDto> categoryList,LoginUserInfo user, Date date) {
+ List<Category> pList = new ArrayList<>();
+ if (com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(categoryList)) {
+ Integer index = 1;
+ for (CategoryDcaProblemDto categoryDcaProblemDto : categoryList) {
+ if(StringUtils.isBlank(categoryDcaProblemDto.getProblem())
+ &&StringUtils.isBlank(categoryDcaProblemDto.getParentName())
+ &&StringUtils.isBlank(categoryDcaProblemDto.getTypeName()) ){
+ //鍘荤┖琛�
+ continue;
+ }
+ if(StringUtils.isBlank(categoryDcaProblemDto.getParentName())){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"瀵逛笉璧凤紝琛ㄦ牸绗��"+(index + 1)+"銆戣涓�绾т富棰樹俊鎭笉鑳戒负绌猴紝璇疯繑鍥炴鏌ヨ〃鏍间俊鎭紒");
+ }
+ categoryDcaProblemDto.setProblem(StringUtils.defaultString(categoryDcaProblemDto.getProblem(),"").trim());
+ categoryDcaProblemDto.setTypeName(StringUtils.defaultString(categoryDcaProblemDto.getTypeName(),"").trim());
+ categoryDcaProblemDto.setParentName(StringUtils.defaultString(categoryDcaProblemDto.getParentName(),"").trim());
+ Category first = getNewCateFromListByName(categoryDcaProblemDto.getParentName(), pList);
+ if(first == null){
+ first = new Category();
+ first.setIsdeleted(Constants.ZERO);
+ first.setCreateDate(date);
+ first.setCreator(user.getId());
+ first.setIsdeleted(Constants.ZERO);
+ first.setStatus(Constants.ZERO);
+ first.setEditDate(date);
+ first.setEditor(user.getId());
+ first.setName(categoryDcaProblemDto.getParentName());
+ first.setType(Constants.FOUR);//涓婚
+ first.setSortnum(index++);
+ first.setChildList(new ArrayList<>());
+ pList.add(first);
+ List<Category> childList = getSecondListFromImport(first,0,categoryList);
+ first.setChildList(childList);
+ }
+ }
+ }
+ return pList;
+ }
+
+ private List<Category> getSecondListFromImport(Category parent,int type, List<CategoryDcaProblemDto> categoryList) {
+ List<Category> pList = new ArrayList<>();
+ Integer index = 1;
+ for (CategoryDcaProblemDto categoryDcaProblemDto : categoryList) {
+ if(type ==0 && (StringUtils.isBlank(categoryDcaProblemDto.getTypeName()) || StringUtils.isBlank(categoryDcaProblemDto.getProblem()))){
+ //鍘荤┖琛�
+ continue;
+ }
+ if(type ==1 &&(StringUtils.isBlank(categoryDcaProblemDto.getProblem()))){
+ //鍘荤┖琛�
+ continue;
+ }
+ if(type ==0 && StringUtils.isBlank(categoryDcaProblemDto.getTypeName())){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"瀵逛笉璧凤紝琛ㄦ牸绗��"+(index + 1)+"銆戣浜岀骇涓婚淇℃伅涓嶈兘涓虹┖锛岃杩斿洖妫�鏌ヨ〃鏍间俊鎭紒");
+ }
+ if(type == 0 && !StringUtils.equals(categoryDcaProblemDto.getParentName(),parent.getName())){
+ //鍙鐞嗗瓙绾�
+ continue;
+ }
+ if(type == 1 && !StringUtils.equals(categoryDcaProblemDto.getTypeName(),parent.getName())){
+ //鍙鐞嗗瓙绾�
+ continue;
+ }
+ Category model = getNewCateFromListByName(type == 0 ?categoryDcaProblemDto.getTypeName():categoryDcaProblemDto.getProblem(), pList);
+ if(model == null){
+ model = new Category();
+ model.setIsdeleted(Constants.ZERO);
+ model.setCreateDate(parent.getCreateDate());
+ model.setCreator(parent.getCreator());
+ model.setIsdeleted(Constants.ZERO);
+ model.setStatus(Constants.ZERO);
+ model.setEditDate(parent.getCreateDate());
+ model.setEditor(parent.getCreator());
+ model.setName(type == 0 ?categoryDcaProblemDto.getTypeName():categoryDcaProblemDto.getProblem());
+ model.setType(type == 0 ? Constants.FOUR:Constants.SIX);//
+ model.setSortnum(index++);
+ model.setChildList(new ArrayList<>());
+ pList.add(model);
+ }
+ if(type == 0){
+ //濡傛灉鏄簩绾т富棰樺鐞嗚幏鍙栧瓙闆嗛儴闂�
+ List<Category> childList = getSecondListFromImport(model,1,categoryList);
+ model.setChildList(childList);
+ }
+ }
+ return pList;
+ }
+
+ private Category getNewCateFromListByName(String parentName, List<Category> pList) {
+ if(pList ==null){
+ return null;
+ }
+ for(Category cate : pList){
+ if(StringUtils.equals(parentName,cate.getName())){
+ return cate;
+ }
+ }
+ return null;
+ }
+ private Category getNewCateFromListByNameAndParent(String parentName,int type,boolean isRoot, List<Category> pList) {
+ for(Category cate : pList){
+ if(StringUtils.equals(parentName,cate.getName()) && Constants.equalsInteger(cate.getType(),type)){
+ if(isRoot && cate.getParentId()==null){
+ return cate;
+ }else if(isRoot && cate.getParentId()==null){
+ return cate;
+ }
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public List<CategoryDcaProblemDto> findListForDca(Category param){
+ long index =1;
+ List<CategoryDcaProblemDto> categoryVOList = new ArrayList<>();
+ List<Category> pList = findListForDcaTree( findAllListForDca());
+ for (Category category:pList) {
+ if(category.getChildList().size() ==0){
+ CategoryDcaProblemDto categoryVO = new CategoryDcaProblemDto();
+ categoryVO.setIndex(index);
+ categoryVO.setParentName(category.getName());
+ index++;
+ categoryVOList.add(categoryVO);
+ }else{
+ for (Category cc:category.getChildList()) {
+ if(cc.getChildList().size() ==0){
+ CategoryDcaProblemDto categoryVO = new CategoryDcaProblemDto();
+ categoryVO.setIndex(index);
+ categoryVO.setParentName(category.getName());
+ categoryVO.setTypeName(cc.getName());
+ index++;
+ categoryVOList.add(categoryVO);
+ }else{
+ for (Category ccc:cc.getChildList()) {
+ CategoryDcaProblemDto categoryVO = new CategoryDcaProblemDto();
+ categoryVO.setIndex(index);
+ categoryVO.setParentName(category.getName());
+ categoryVO.setTypeName(cc.getName());
+ categoryVO.setProblem(ccc.getName());
+ index++;
+ categoryVOList.add(categoryVO);
+
+ }
+ }
+ }
+ }
+ }
+ return categoryVOList;
+ }
+ @Override
+ @PostConstruct
+ public String initRedis(){
+ redisTemplate.delete(Constants.RedisKeys.IMPORTING_CATEGORY);
+ return "";
+ }
+ @Override
+ @Transactional(rollbackFor = {BusinessException.class,Exception.class})
+ public String importDcaBatch(MultipartFile file){
+ Boolean importing = (Boolean) redisTemplate.opsForValue().get(Constants.RedisKeys.IMPORTING_CATEGORY);
+ if(importing!=null && importing){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"瀵逛笉璧凤紝宸插瓨鍦ㄥ憳宸ュ鍏ヤ换鍔℃鍦ㄦ墽琛屼腑锛岃绋嶅悗鍐嶈瘯锛�");
+ }
+ redisTemplate.opsForValue().set(Constants.RedisKeys.IMPORTING_CATEGORY,true);
+ try {
+ ExcelImporter ie = null;
+ List<CategoryDcaProblemDto> dataList =null;
+ try {
+ ie = new ExcelImporter(file,0,0, CellType.STRING); // 纭繚鍗曞厓鏍肩被鍨嬩负瀛楃涓�);
+ dataList = ie.getDataList(CategoryDcaProblemDto.class,null);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ if(dataList == null || dataList.size() ==0){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"瀵逛笉璧凤紝褰曞叆鏁版嵁涓虹┖锛�");
+ }
+ Date date = new Date();
+ LoginUserInfo user = (LoginUserInfo)SecurityUtils.getSubject().getPrincipal();
+ List<Category> treeImportList = findImportTreeForDca(dataList,user,date);//鏌ヨ鐜版湁鐨勫叏閮ㄤ富棰樿瀵熼」鏁版嵁
+ if(treeImportList == null || treeImportList.size() ==0){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"瀵逛笉璧凤紝褰曞叆鐨勬湁鏁堟暟鎹负绌猴紒");
+ }
+ //鏌ヨ鐜版湁鐨勫叏閮ㄤ富棰樿瀵熼」鏁版嵁
+ List<Category> list = categoryMapper.selectJoinList(Category.class,new MPJLambdaWrapper<Category>()
+ .selectAll(Category.class)
+// .select("t1.name",Category::getParentName)
+// .select("t2.name",Category::getRootName)
+// .leftJoin(Category.class,Category::getId,Category::getParentId)
+// .leftJoin( "category t2 on t1.parent_id=t2.id")
+ .eq(Category::getIsdeleted, Constants.ZERO)
+ .in(Category::getType, Constants.FOUR, Constants.SIX)//涓婚鍜岃瀵熼」
+ .orderByAsc(Category::getSortnum)
+ ) ;
+ List<Category> treeList = findListForDcaTree(list);//鏌ヨ鐜版湁鐨勫叏閮ㄤ富棰樿瀵熼」鏁版嵁
+ List<Integer> allUpdateIds = new ArrayList<>();
+ dealImportNewOrUpdateBiz(treeList,treeImportList,allUpdateIds);
+ dealDeletedList(list,allUpdateIds,user,date);//澶勭悊鍒犻櫎鐨勬暟鎹俊鎭�
+ dealTreePathInfo(treeImportList);
+ return "瀵煎叆鎴愬姛";
+ }catch (BusinessException e){
+ throw e;
+ }catch (Exception e){
+ throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"鍛樺伐淇℃伅瀵煎叆澶辫触锛岃绋嶅悗閲嶈瘯");
+ }finally {
+ redisTemplate.delete(Constants.RedisKeys.IMPORTING_CATEGORY);
+ }
+ }
+ private void dealImportNewOrUpdateBiz(List<Category> treeList, List<Category> treeImportList, List<Integer> allUpdateIds) {
+ List<Category> newList = new ArrayList<>();
+ List<Category> updateList = new ArrayList<>();
+ for(Category tmodel :treeImportList){
+
+ //澶勭悊涓�绾т富棰樺鏀归�昏緫
+ //鏌ヨ鏄惁瀛樺湪鍚嶇О鐩稿悓鐨勪竴绾т富棰橈紝瀛樺湪鍒欐洿鏂帮紝涓嶅瓨鍦ㄥ垯鏂板
+ Category first = getNewCateFromListByName(tmodel.getName(),treeList);
+ if(first!=null){
+ tmodel.setId(first.getId());
+ tmodel.setChildMatchList(first.getChildList());
+ allUpdateIds.add(first.getId());
+ updateList.add(tmodel);
+ }else{
+ newList.add(tmodel);
+ }
+ }
+
+ //鍏堟壒閲忓鐞嗕竴绾т富棰樼殑澧炴敼鏁版嵁锛屽埛鏂颁竴绾т富棰樺璞$殑缂栫爜
+ if(newList.size() >0){
+ categoryMapper.insert(newList);
+ }
+ if( updateList.size() >0){
+ for(Category update :updateList){
+ categoryMapper.updateById(update);
+ }
+ }
+ dealSecChildList(newList,updateList,allUpdateIds,1);//澶勭悊浜岀骇鏁版嵁
+ }
+
+ private void dealDeletedList(List<Category> list, List<Integer> allUpdateIds, LoginUserInfo user, Date date) {
+ List<Integer> deleteList = new ArrayList<>();
+ for(Category cate : list){
+ for(Integer nowId : allUpdateIds){
+ if(Constants.equalsInteger(cate.getId(),nowId)){
+ continue;
+ }
+ deleteList.add(cate.getId());
+ }
+ }
+ if(deleteList.size() >0){
+ //鍒犻櫎涓嶅瓨鍦ㄧ殑
+ categoryMapper.update(null,new UpdateWrapper<Category>().lambda()
+ .set(Category::getIsdeleted,Constants.ONE)
+ .set(Category::getEditor,user.getId())
+ .set(Category::getEditDate,date)
+ .in(Category::getId,deleteList));
+ }
+ }
+
+ private void dealSecChildList(List<Category> newList, List<Category> updateList,List<Integer> allUpdateIds,int level) {
+ List<Category> childNewList = new ArrayList<>();
+ List<Category> childUpdateList = new ArrayList<>();
+ if(newList.size() >0 || updateList.size()>0) {
+ for(Category c : newList){
+ if(c.getChildList()!=null && c.getChildList().size()>0){
+ for(Category sec : c.getChildList()){
+ sec.setParentId(c.getId());
+ }
+ childNewList.addAll(c.getChildList());
+ }
+ }
+ for(Category c : updateList){
+ if(c.getChildList()!=null && c.getChildList().size()>0){
+ List<Category> tList = c.getChildMatchList();
+ for(Category sec : c.getChildList()){
+ sec.setParentId(c.getId());
+ Category mmodel = getNewCateFromListByName(sec.getName(),tList);
+ if(mmodel!=null){
+ sec.setId(mmodel.getId());
+ sec.setChildMatchList(mmodel.getChildList());
+ allUpdateIds.add(mmodel.getId());
+ childUpdateList.add(sec);
+ }else{
+ childNewList.add(sec);
+ }
+ }
+ }
+ }
+ }
+ if(childNewList.size() >0){
+ categoryMapper.insert(childNewList);
+ }
+ if( childUpdateList.size() >0){
+ for(Category update :childUpdateList){
+ categoryMapper.updateById(update);
+ }
+ }
+ if(level == 1){
+ dealSecChildList(childNewList,childUpdateList,allUpdateIds,2);//澶勭悊涓夌骇绾ф暟鎹�
+ }
+ }
+ private void dealTreePathInfo(List<Category> tree) {
+ if(tree!=null || tree.size()>0){
+ for(Category t : tree){
+ t.setIdPath(t.getId()+"/");
+ t.setNamePath(t.getName());
+ categoryMapper.updateById(t);
+ dealChildParentId(t,t.getChildList());
+ }
+ }
+ }
+
+ private void dealChildParentId(Category t, List<Category> childList) {
+ if(childList ==null || childList.size()==0){
+ return;
+ }
+ for(Category c : childList){
+ c.setParentId(t.getId());
+ c.setIdPath(t.getIdPath()+c.getId()+"/");
+ c.setNamePath(t.getNamePath()+"/"+c.getName());
+ categoryMapper.updateById(c);
+ if(t.getChildList()!=null || t.getChildList().size()==0){
+ //閫掑綊澶勭悊瀛愰泦
+ dealChildParentId(c,c.getChildList());
+ }
+ }
+ }
}
diff --git a/server/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java b/server/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java
index fe36d4b..4fa54b3 100644
--- a/server/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java
+++ b/server/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java
@@ -24,9 +24,12 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
+import javax.annotation.Resource;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -40,6 +43,8 @@
@Service
public class CompanyServiceImpl implements CompanyService {
+ @Resource(name="sessionRedisTemplate")
+ private RedisTemplate<Object, Serializable> redisTemplate;
@Autowired
private CompanyMapper companyMapper;
@Autowired
diff --git a/server/src/main/java/com/doumee/service/business/impl/ManagersServiceImpl.java b/server/src/main/java/com/doumee/service/business/impl/ManagersServiceImpl.java
index c4b3fbd..ba394a1 100644
--- a/server/src/main/java/com/doumee/service/business/impl/ManagersServiceImpl.java
+++ b/server/src/main/java/com/doumee/service/business/impl/ManagersServiceImpl.java
@@ -8,8 +8,10 @@
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Utils;
+import com.doumee.dao.business.CompanyMapper;
import com.doumee.dao.business.ManagersMapper;
import com.doumee.dao.business.MemberMapper;
+import com.doumee.dao.business.model.Company;
import com.doumee.dao.business.model.Managers;
import com.doumee.dao.business.model.Member;
import com.doumee.dao.system.model.SystemUser;
@@ -23,8 +25,10 @@
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
+import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -40,29 +44,69 @@
private ManagersMapper managersMapper;
@Autowired
private MemberMapper memberMapper;
+ @Autowired
+ private CompanyMapper companyMapper;
@Override
+ @Transactional(rollbackFor = {BusinessException.class,Exception.class})
public Integer create(Managers managers) {
- Member member =memberMapper.selectById(managers.getMemberId());
- if(member == null || Constants.equalsInteger(member.getIsdeleted(),Constants.ONE)){
- throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"瀵逛笉璧凤紝璇ヨ礋璐d汉淇℃伅涓嶅瓨鍦紝璇峰埛鏂伴〉闈㈤噸璇曪紒");
+
+ List<Managers> newList = new ArrayList<>();
+ if( managers.getIsMember() == null || managers.getType() == null){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST);
}
- Managers model =managersMapper.selectOne(new LambdaQueryWrapper<Managers>().eq(Managers::getMemberId,managers.getMemberId())
- .eq(Managers::getType,managers.getType())
- .eq(Managers::getIsdeleted,Constants.ZERO)
- );
- if(model !=null){
- throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"璇ヤ汉鍛樹俊鎭凡璁剧疆锛屾棤闇�閲嶆柊娣诲姞");
+ List<Member> memberList = new ArrayList<>();
+ List<Integer> memberIdList = new ArrayList<>();
+
+ //璁剧疆鑼冨洿 0鐩村睘閮ㄩ棬鍛樺伐 1閮ㄩ棬鍙婂叾涓嬬骇甯冩仼鍛樺伐 2鎸囧畾浜哄憳
+ if(Constants.equalsInteger(managers.getIsMember(),Constants.ZERO) || Constants.equalsInteger(managers.getIsMember(),Constants.ONE)){
+ //鐩村睘閮ㄩ棬 鎴� 閮ㄩ棬鍙婂叾瀛愰儴闂�
+ if(managers.getCompanyId() ==null ){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST);
+ }
+ Company company = companyMapper.selectById(managers.getCompanyId());
+ if(company == null || Constants.equalsInteger(company.getIsdeleted(),Constants.ONE)){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"瀵逛笉璧凤紝閮ㄩ棬淇℃伅涓嶅瓨鍦紝璇峰埛鏂伴〉闈㈤噸璇曪紒");
+ }
+ memberList =memberMapper.selectJoinList(Member.class,new MPJLambdaWrapper<Member>()
+ .selectAll(Member.class)
+ .eq(Member::getIsdeleted,Constants.ZERO)
+ .exists(Constants.equalsInteger(managers.getIsMember(),Constants.ZERO),"select (cm.id) from company_member cm where cm.company_id='"+company.getId()+"' and cm.member_id=t.id")
+ .exists(Constants.equalsInteger(managers.getIsMember(),Constants.ONE),"select (cm.id) from company_member cm where cm.company_id_path like '"+company.getIdPath()+"%' and cm.member_id=t.id"));
+ }else{
+ if(managers.getMemberIds()==null || managers.getMemberIds().size()==0){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"瀵逛笉璧凤紝璇锋寜瑕佹眰閫夋嫨鎸囧畾鍛樺伐淇℃伅锛�");
+ }
+ memberList =memberMapper.selectList(new LambdaQueryWrapper<Member>()
+ .eq(Member::getIsdeleted,Constants.ZERO)
+ .in(Member::getId,managers.getMemberIds()));
+ }
+ if(memberList.size() ==0){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"瀵逛笉璧凤紝閫夋嫨鑼冨洿鏈煡璇㈠埌鐩稿叧鍛樺伐淇℃伅锛屾娆¤缃棤鏁堬紒");
}
LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
- managers.setCreator(user.getId());
- managers.setCreateDate(new Date());
- managers.setIsdeleted(Constants.ZERO);
- managers.setEditor(managers.getCreator());
- managers.setEditDate(managers.getCreateDate());
- managers.setStatus(Constants.ZERO);
- managersMapper.insert(managers);
- return managers.getId();
+
+ for(Member m :memberList){
+ Managers mm = new Managers();
+ mm.setCreator(user.getId());
+ mm.setCreateDate(new Date());
+ mm.setIsdeleted(Constants.ZERO);
+ mm.setEditor(managers.getCreator());
+ mm.setEditDate(managers.getCreateDate());
+ mm.setStatus(Constants.ZERO);
+ mm.setType(managers.getType());
+ mm.setMemberId(m.getId());
+ mm.setRemark(managers.getRemark());
+ memberIdList.add(m.getId());
+ newList.add(mm);
+ }
+ //娓呯┖鍘熸湁鐨勮缃俊鎭�
+ managersMapper.delete(new UpdateWrapper<Managers>().lambda()
+ .eq(Managers::getType,managers.getType())
+ .in(Managers::getMemberId,memberIdList)
+ );
+ managersMapper.insert(newList);
+ return newList.size();
}
@Override
diff --git a/server/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java b/server/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java
index d81bb83..c206767 100644
--- a/server/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java
+++ b/server/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java
@@ -29,11 +29,14 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
+import javax.annotation.Resource;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -47,6 +50,8 @@
@Service
public class MemberServiceImpl implements MemberService {
+ @Resource(name="sessionRedisTemplate")
+ private RedisTemplate<Object, Serializable> redisTemplate;
@Autowired
private SystemDictDataBiz systemDictDataBiz;
@Autowired
diff --git a/server/src/main/java/com/doumee/service/business/impl/WorkorderServiceImpl.java b/server/src/main/java/com/doumee/service/business/impl/WorkorderServiceImpl.java
index 1b6ba87..f15f886 100644
--- a/server/src/main/java/com/doumee/service/business/impl/WorkorderServiceImpl.java
+++ b/server/src/main/java/com/doumee/service/business/impl/WorkorderServiceImpl.java
@@ -502,6 +502,7 @@
throw new BusinessException(ResponseStatus.DATA_EMPTY);
}
+ workorder.setStatusName(Constants.WorkOrderStatus.getStatusName(workorder.getStatus()));
this.dealButton(workorder,member);
//鏌ヨ闄勪欢淇℃伅
List<Multifile> multifileList = multifileMapper.selectList(new QueryWrapper<Multifile>().lambda().eq(Multifile::getIsdeleted,Constants.ZERO)
@@ -777,7 +778,13 @@
Utils.MP.blankToNull(pageWrap.getModel());
pageWrap.getModel().setIsdeleted(Constants.ZERO);
MPJLambdaWrapper<Workorder> queryWrapper = getJoinQueryMapper(pageWrap.getModel());
- return PageData.from(workorderMapper.selectJoinPage(page,Workorder.class, queryWrapper));
+ PageData<Workorder> result = PageData.from(workorderMapper.selectJoinPage(page,Workorder.class, queryWrapper));
+ if(result!=null && result.getRecords()!=null){
+ for(Workorder w : result.getRecords()){
+ w.setStatusName(Constants.WorkOrderStatus.getStatusName(w.getStatus()));
+ }
+ }
+ return result;
}
@Override
diff --git a/server/src/main/resources/application.yml b/server/src/main/resources/application.yml
index d119626..d2aa372 100644
--- a/server/src/main/resources/application.yml
+++ b/server/src/main/resources/application.yml
@@ -9,7 +9,7 @@
spring:
profiles:
- active: test
+ active: dev
# JSON杩斿洖閰嶇疆
jackson:
# 榛樿鏃跺尯
@@ -33,6 +33,8 @@
configuration:
map-underscore-to-camel-case: true
log-impl: com.doumee.config.mybatis.DmStdOutImpl
+# log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
+# log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
# 缂撳瓨鍐呭璁剧疆
@@ -60,7 +62,7 @@
# 鏃ュ織閰嶇疆
logback:
- level: INFO
+ level: ERROR
appender: ${project.env}
# dao灞傜殑鏃ュ織璁剧疆涓篸ebug锛屾柟渚挎煡鐪媠ql
logging:
@@ -70,7 +72,7 @@
com.doumee.dao.system.SystemJobListMapper: ERROR
com.doumee.dao.system.SystemJobSnippetMapper: ERROR
com.doumee.dao.system.SystemJobLogMapper: ERROR
- com.doumee.dao.business: DEBUG
+ com.doumee.dao.business: ERROR
auth:
jwt:
enabled: true #鏄惁寮�鍚疛WT鐧诲綍璁よ瘉鍔熻兘
--
Gitblit v1.9.3