From 71c893964b732f2026fccc573502a1b503f985fd Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期二, 15 四月 2025 11:15:12 +0800
Subject: [PATCH] 代码初始化
---
admin/src/views/business/categoryDbhType.vue | 9 ++++
admin/src/components/base/BaseOpera.vue | 17 +++++++-
admin/src/views/business/workorderShe.vue | 2
admin/src/views/business/categorySheLocaltion.vue | 9 ++++
server/src/main/java/com/doumee/service/business/impl/WorkorderServiceImpl.java | 1
admin/src/views/business/categorySheType.vue | 9 ++++
admin/src/views/business/categoryDcaProblem.vue | 6 +-
admin/src/components/business/OperaCategoryWindow.vue | 3 +
admin/src/plugins/messagebox.js | 7 +++
admin/src/views/business/categoryDcaLocaltion.vue | 9 ++++
admin/src/views/business/categoryDbhLocaltion.vue | 9 ++++
server/src/main/java/com/doumee/service/business/impl/CategoryServiceImpl.java | 25 ++++++++++++
server/src/main/java/com/doumee/service/common/EmailService.java | 2
admin/src/components/business/OperaCategoryDcaProblemWindow.vue | 1
14 files changed, 94 insertions(+), 15 deletions(-)
diff --git a/admin/src/components/base/BaseOpera.vue b/admin/src/components/base/BaseOpera.vue
index 0b439c0..0c07a27 100644
--- a/admin/src/components/base/BaseOpera.vue
+++ b/admin/src/components/base/BaseOpera.vue
@@ -1,4 +1,6 @@
<script>
+import { memberSync } from '@/api/business/member'
+
export default {
name: 'BaseOpera',
data () {
@@ -76,11 +78,20 @@
}
// 璋冪敤鏂板缓鎺ュ彛
this.isWorking = true
+ var that = this
this.api.create(this.form)
.then(() => {
- this.visible = false
- this.$tip.apiSuccess('鏂板缓鎴愬姛')
- this.$emit('success')
+ // that.$tip.apiSuccess('鏂板缓鎴愬姛')
+ that.$dialog.actionConfirmButton('鏄惁鍋滅暀璇ラ〉闈㈢户缁柊寤烘暟鎹紵', '鏂板缓鎴愬姛','缁х画娣诲姞','鍏抽棴杩斿洖')
+ .then(() => {
+ that.$refs.form.resetFields()
+ that.form[this.configData['field.id']] = null
+ that.$emit('success')
+ })
+ .catch(() => {
+ that.visible = false
+ that.$emit('success')
+ })
})
.catch(e => {
this.$tip.apiFailed(e)
diff --git a/admin/src/components/business/OperaCategoryDcaProblemWindow.vue b/admin/src/components/business/OperaCategoryDcaProblemWindow.vue
index 5453131..bfec319 100644
--- a/admin/src/components/business/OperaCategoryDcaProblemWindow.vue
+++ b/admin/src/components/business/OperaCategoryDcaProblemWindow.vue
@@ -67,6 +67,7 @@
},
methods: {
handleChangeCategory (value) {
+ this.form.parentId = null
if (this.form.categoryList && this.form.categoryList.length >= 1) {
this.form.parentId = this.form.categoryList[this.form.categoryList.length - 1]
}
diff --git a/admin/src/components/business/OperaCategoryWindow.vue b/admin/src/components/business/OperaCategoryWindow.vue
index 181d604..829f064 100644
--- a/admin/src/components/business/OperaCategoryWindow.vue
+++ b/admin/src/components/business/OperaCategoryWindow.vue
@@ -18,7 +18,7 @@
</el-cascader>
</el-form-item>
<el-form-item label="鎺掑簭鐮�" prop="sortnum">
- <el-input v-model="form.sortnum" placeholder="璇疯緭鍏ユ帓搴忕爜锛堝崌搴忥級" v-trim/>
+ <el-input v-model="form.sortnum" type="number" placeholder="璇疯緭鍏ユ帓搴忕爜锛堝崌搴忥級" v-trim/>
</el-form-item>
<el-form-item label="澶囨敞" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="璇疯緭鍏ュ娉�" v-trim/>
@@ -67,6 +67,7 @@
},
methods: {
handleChangeCategory (value) {
+ this.form.parentId = null
if (this.form.categoryList && this.form.categoryList.length >= 1) {
this.form.parentId = this.form.categoryList[this.form.categoryList.length - 1]
}
diff --git a/admin/src/plugins/messagebox.js b/admin/src/plugins/messagebox.js
index f0df75d..d6eabbf 100644
--- a/admin/src/plugins/messagebox.js
+++ b/admin/src/plugins/messagebox.js
@@ -66,4 +66,11 @@
type: 'warning'
})
},
+ actionConfirmButton (message, title,confirmButtonText,cancelButtonText) {
+ return MessageBox.confirm(message, title, {
+ confirmButtonText: confirmButtonText || '纭',
+ cancelButtonText: cancelButtonText ||'鍙栨秷',
+ type: 'warning'
+ })
+ }
}
diff --git a/admin/src/views/business/categoryDbhLocaltion.vue b/admin/src/views/business/categoryDbhLocaltion.vue
index 81f2068..adeafa4 100644
--- a/admin/src/views/business/categoryDbhLocaltion.vue
+++ b/admin/src/views/business/categoryDbhLocaltion.vue
@@ -8,7 +8,7 @@
</el-form-item>
<section>
<el-button type="primary" @click="search">鎼滅储</el-button>
- <el-button type="primary" @click="refresh">鏄剧ず椤跺眰</el-button>
+ <el-button type="primary" @click="refresh">鏄剧ず鍏ㄩ儴</el-button>
<el-button @click="reset">閲嶇疆</el-button>
</section>
</el-form>
@@ -34,6 +34,7 @@
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column prop="name" label="鍚嶇О" min-width="100px"></el-table-column>
<el-table-column prop="parentName" label="鐖剁骇" min-width="150px"></el-table-column>
+ <el-table-column prop="namePath" label="瀹屾暣璺緞" min-width="150px"></el-table-column>
<el-table-column prop="editorName" label="鎿嶄綔浜�" min-width="100px"></el-table-column>
<el-table-column prop="editDate" label="鏈�鍚庢搷浣滄椂闂�" min-width="150px"></el-table-column>
<el-table-column v-if="containPermissions(['business:category:update', 'business:category:delete' ])" label="鎿嶄綔" min-width="280">
@@ -91,6 +92,12 @@
this.getfindTreePage()
},
methods: {
+ refresh () {
+ this.searchForm.parentId = null
+ this.searchForm.isRoot = null
+ this.getfindTreePage()
+ this.handlePageChange()
+ },
handlePageChangeDo () {
this.searchForm.isRoot = 1
this.searchForm.parentId = null
diff --git a/admin/src/views/business/categoryDbhType.vue b/admin/src/views/business/categoryDbhType.vue
index 71ab6b9..448ad11 100644
--- a/admin/src/views/business/categoryDbhType.vue
+++ b/admin/src/views/business/categoryDbhType.vue
@@ -8,7 +8,7 @@
</el-form-item>
<section>
<el-button type="primary" @click="search">鎼滅储</el-button>
- <el-button type="primary" @click="refresh">鏄剧ず椤跺眰</el-button>
+ <el-button type="primary" @click="refresh">鏄剧ず鍏ㄩ儴</el-button>
<el-button @click="reset">閲嶇疆</el-button>
</section>
</el-form>
@@ -34,6 +34,7 @@
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column prop="name" label="鍚嶇О" min-width="100px"></el-table-column>
<el-table-column prop="parentName" label="鐖剁骇" min-width="150px"></el-table-column>
+ <el-table-column prop="namePath" label="瀹屾暣璺緞" min-width="150px"></el-table-column>
<el-table-column prop="editorName" label="鎿嶄綔浜�" min-width="100px"></el-table-column>
<el-table-column prop="editDate" label="鏈�鍚庢搷浣滄椂闂�" min-width="150px"></el-table-column>
<el-table-column v-if="containPermissions(['business:category:update', 'business:category:delete' ])" label="鎿嶄綔" min-width="280">
@@ -91,6 +92,12 @@
this.getfindTreePage()
},
methods: {
+ refresh () {
+ this.searchForm.parentId = null
+ this.searchForm.isRoot = null
+ this.getfindTreePage()
+ this.handlePageChange()
+ },
handlePageChangeDo () {
this.searchForm.parentId = null
this.searchForm.isRoot = 1
diff --git a/admin/src/views/business/categoryDcaLocaltion.vue b/admin/src/views/business/categoryDcaLocaltion.vue
index d4c63a6..79ee9fc 100644
--- a/admin/src/views/business/categoryDcaLocaltion.vue
+++ b/admin/src/views/business/categoryDcaLocaltion.vue
@@ -8,7 +8,7 @@
</el-form-item>
<section>
<el-button type="primary" @click="search">鎼滅储</el-button>
- <el-button type="primary" @click="refresh">鏄剧ず椤跺眰</el-button>
+ <el-button type="primary" @click="refresh">鏄剧ず鍏ㄩ儴</el-button>
<el-button @click="reset">閲嶇疆</el-button>
</section>
</el-form>
@@ -34,6 +34,7 @@
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column prop="name" label="鍚嶇О" min-width="100px"></el-table-column>
<el-table-column prop="parentName" label="鐖剁骇" min-width="150px"></el-table-column>
+ <el-table-column prop="namePath" label="瀹屾暣璺緞" min-width="150px"></el-table-column>
<el-table-column prop="editorName" label="鎿嶄綔浜�" min-width="100px"></el-table-column>
<el-table-column prop="editDate" label="鏈�鍚庢搷浣滄椂闂�" min-width="150px"></el-table-column>
<el-table-column v-if="containPermissions(['business:category:update', 'business:category:delete' ])" label="鎿嶄綔" min-width="280">
@@ -91,6 +92,12 @@
this.getfindTreePage()
},
methods: {
+ refresh () {
+ this.searchForm.parentId = null
+ this.searchForm.isRoot = null
+ this.getfindTreePage()
+ this.handlePageChange()
+ },
handlePageChangeDo () {
this.searchForm.isRoot = 1
this.searchForm.parentId = null
diff --git a/admin/src/views/business/categoryDcaProblem.vue b/admin/src/views/business/categoryDcaProblem.vue
index 55f6eae..529e288 100644
--- a/admin/src/views/business/categoryDcaProblem.vue
+++ b/admin/src/views/business/categoryDcaProblem.vue
@@ -8,7 +8,7 @@
</el-form-item>
<section>
<el-button type="primary" @click="search">鎼滅储</el-button>
- <el-button type="primary" @click="refresh">鏄剧ず椤跺眰</el-button>
+ <el-button type="primary" @click="refresh">涓�绾т富棰�</el-button>
<el-button @click="reset">閲嶇疆</el-button>
</section>
</el-form>
@@ -44,7 +44,7 @@
<el-table-column prop="editorName" label="鎿嶄綔浜�" min-width="100px"></el-table-column>
<el-table-column prop="editDate" label="鏈�鍚庢搷浣滄椂闂�" min-width="150px"></el-table-column>
<el-table-column prop="remark" label="澶囨敞" min-width="100px"></el-table-column>
- <el-table-column v-if="containPermissions(['business:category:update', 'business:category:delete' ])" label="鎿嶄綔" min-width="280">
+ <el-table-column fixed="right" v-if="containPermissions(['business:category:update', 'business:category:delete' ])" label="鎿嶄綔" min-width="120">
<template slot-scope="{row}">
<el-button type="text" icon="el-icon-edit" @click="$refs.operaCategoryWindow.open('缂栬緫DCA涓婚鍜岃瀵熼」', row, categoryList,row.type)" v-permissions="['business:category:update']">缂栬緫</el-button>
<el-button type="text" icon="el-icon-delete" @click="deleteById(row,true, getfindTreePage)" style="color: red" v-permissions="['business:category:delete']">鍒犻櫎</el-button>
@@ -72,7 +72,7 @@
data () {
return {
TreeList: [],
- level: 1,
+ level: 0,
// 鎼滅储
searchForm: {
name: '',
diff --git a/admin/src/views/business/categorySheLocaltion.vue b/admin/src/views/business/categorySheLocaltion.vue
index ab86ac3..6d2242a 100644
--- a/admin/src/views/business/categorySheLocaltion.vue
+++ b/admin/src/views/business/categorySheLocaltion.vue
@@ -8,7 +8,7 @@
</el-form-item>
<section>
<el-button type="primary" @click="search">鎼滅储</el-button>
- <el-button type="primary" @click="refresh">鏄剧ず椤跺眰</el-button>
+ <el-button type="primary" @click="refresh">鏄剧ず鍏ㄩ儴</el-button>
<el-button @click="reset">閲嶇疆</el-button>
</section>
</el-form>
@@ -34,6 +34,7 @@
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column prop="name" label="鍚嶇О" min-width="100px"></el-table-column>
<el-table-column prop="parentName" label="鐖剁骇" min-width="150px"></el-table-column>
+ <el-table-column prop="namePath" label="瀹屾暣璺緞" min-width="150px"></el-table-column>
<el-table-column prop="editorName" label="鎿嶄綔浜�" min-width="100px"></el-table-column>
<el-table-column prop="editDate" label="鏈�鍚庢搷浣滄椂闂�" min-width="150px"></el-table-column>
<el-table-column v-if="containPermissions(['business:category:update', 'business:category:delete' ])" label="鎿嶄綔" min-width="280">
@@ -91,6 +92,12 @@
this.getfindTreePage()
},
methods: {
+ refresh () {
+ this.searchForm.parentId = null
+ this.searchForm.isRoot = null
+ this.getfindTreePage()
+ this.handlePageChange()
+ },
handlePageChangeDo () {
this.searchForm.isRoot = 1
this.searchForm.parentId = null
diff --git a/admin/src/views/business/categorySheType.vue b/admin/src/views/business/categorySheType.vue
index 04f5ecc..cb803e4 100644
--- a/admin/src/views/business/categorySheType.vue
+++ b/admin/src/views/business/categorySheType.vue
@@ -8,7 +8,7 @@
</el-form-item>
<section>
<el-button type="primary" @click="search">鎼滅储</el-button>
- <el-button type="primary" @click="refresh">鏄剧ず椤跺眰</el-button>
+ <el-button type="primary" @click="refresh">鏄剧ず鍏ㄩ儴</el-button>
<el-button @click="reset">閲嶇疆</el-button>
</section>
</el-form>
@@ -34,6 +34,7 @@
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column prop="name" label="鍚嶇О" min-width="100px"></el-table-column>
<el-table-column prop="parentName" label="鐖剁骇" min-width="150px"></el-table-column>
+ <el-table-column prop="namePath" label="瀹屾暣璺緞" min-width="150px"></el-table-column>
<el-table-column prop="editorName" label="鎿嶄綔浜�" min-width="100px"></el-table-column>
<el-table-column prop="editDate" label="鏈�鍚庢搷浣滄椂闂�" min-width="150px"></el-table-column>
<el-table-column v-if="containPermissions(['business:category:update', 'business:category:delete' ])" label="鎿嶄綔" min-width="280">
@@ -91,6 +92,12 @@
this.getfindTreePage()
},
methods: {
+ refresh () {
+ this.searchForm.parentId = null
+ this.searchForm.isRoot = null
+ this.getfindTreePage()
+ this.handlePageChange()
+ },
handlePageChangeDo () {
this.searchForm.parentId = null
this.searchForm.isRoot = 1
diff --git a/admin/src/views/business/workorderShe.vue b/admin/src/views/business/workorderShe.vue
index dc3fe97..4f25d39 100644
--- a/admin/src/views/business/workorderShe.vue
+++ b/admin/src/views/business/workorderShe.vue
@@ -40,7 +40,7 @@
<span style="color: #2E68EC;cursor: pointer" @click="$refs.operaWorkorderWindow.open('SHE浜嬩欢宸ュ崟璇︽儏', row)" >{{ row.code || '-'}}</span>
</template>
</el-table-column>
- <el-table-column prop="typeName" label="浼ゅ绫诲瀷" min-width="100px"></el-table-column>
+ <el-table-column prop="typeNamePath" label="浼ゅ绫诲瀷" min-width="100px"></el-table-column>
<el-table-column prop="submitDate" label="涓婃姤鏃堕棿" min-width="150px"></el-table-column>
<el-table-column prop="status" label="鐘舵��" min-width="100px">
<template slot-scope="{row}">
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 928e60e..aa0f18f 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
@@ -123,6 +123,9 @@
if( category.getId() == null){
throw new BusinessException(ResponseStatus.BAD_REQUEST);
}
+ if(Constants.equalsInteger(category.getId(),category.getParentId())){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"瀵逛笉璧凤紝鐖剁骇涓嶈兘璁剧疆涓鸿嚜韬紒");
+ }
category.setType(null);//绫诲瀷涓嶆敮鎸佷慨鏀�
Category model = categoryMapper.selectById(category.getId());
if(model ==null || Constants.equalsInteger(model.getIsdeleted(),Constants.ONE)) {
@@ -136,6 +139,8 @@
.eq(Category::getIsdeleted,Constants.ZERO)) >0){
throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "瀵逛笉璧凤紝鍚嶇О涓嶈兘閲嶅~");
}*/
+ String oldIdPath = model.getIdPath();
+ String oldNamePath = model.getNamePath();
LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
category.setIdPath(category.getId()+"/");//鍚嶇О璺緞
category.setNamePath(category.getName());//鍚嶇О璺緞
@@ -150,7 +155,25 @@
}
category.setEditDate(new Date());
category.setEditor(user.getId());
- categoryMapper.updateById(category);
+ categoryMapper.update(null,new UpdateWrapper<Category>().lambda()
+ .eq(Category::getId,category.getId())
+ .set(Category::getEditDate,category.getEditDate())
+ .set(Category::getEditor,category.getEditor())
+ .set(Category::getName,category.getName())
+ .set(Category::getParentId,category.getParentId())
+ .set(Category::getSortnum,category.getSortnum())
+ .set(Category::getRemark,category.getRemark())
+ .set(Category::getNamePath,category.getNamePath())
+ .set(Category::getIdPath,category.getId())
+ );
+ //淇敼鍏ㄩ儴涓嬬骇鐨勭紪鐮佸拰鍚嶇О璺緞
+ categoryMapper.update(null,new UpdateWrapper<Category>().lambda()
+ .likeRight(Category::getIdPath,oldIdPath)
+ .set(Category::getEditDate,category.getEditDate())
+ .set(Category::getEditor,category.getEditor())
+ .setSql("id_path=replace(id_path,'"+oldIdPath+"','"+category.getIdParentPath()+"')")
+ .setSql("name_path=replace(name_path,'"+oldNamePath+"/','"+category.getName()+"/')")
+ );
}
@Override
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 cfad8ac..4c7c1bf 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
@@ -549,6 +549,7 @@
.selectAs(Member::getPhone,Workorder::getMemberPhone)
.select(" c2.name ",Workorder::getCategoryName)
.select(" c3.name ",Workorder::getTypeName)
+ .select(" c3.name_path ",Workorder::getTypeNamePath)
.leftJoin(Member.class,Member::getId,Workorder::getMemberId)
.leftJoin(" category c3 on t.TYPE_ID = c3.id ") //椋庨櫓绫诲瀷
.leftJoin(" category c2 on t.CATEGORY_ID = c2.id ") //DCA涓�绾ч棶棰樼紪鐮�
diff --git a/server/src/main/java/com/doumee/service/common/EmailService.java b/server/src/main/java/com/doumee/service/common/EmailService.java
index 6467d4c..e511c37 100644
--- a/server/src/main/java/com/doumee/service/common/EmailService.java
+++ b/server/src/main/java/com/doumee/service/common/EmailService.java
@@ -63,7 +63,7 @@
content += "<div style='display:block;'> ";
for (String f : imgList){
// 璁剧疆闄勪欢
- content += "<img style='width:200px;margin:5px' src='"+f+"'/>";
+ content += "<a href='"+f+"' target='blank'><img style='width:200px;margin:5px' src='"+f+"'/></a>";
}
}
content += "</div></body><html>";
--
Gitblit v1.9.3