配置管理
This commit is contained in:
parent
3eedf15712
commit
1ed4dd8950
18
.idea/compiler.xml
Normal file
18
.idea/compiler.xml
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<annotationProcessing>
|
||||
<profile name="Maven default annotation processors profile" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<module name="fuint-application" />
|
||||
<module name="fuint-utils" />
|
||||
<module name="fuint-repository" />
|
||||
<module name="fuint-framework" />
|
||||
<module name="fuint-payment" />
|
||||
<module name="fuint-quartz" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
</component>
|
||||
</project>
|
19
.idea/encodings.xml
Normal file
19
.idea/encodings.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/fuintBackend/fuint-application/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/fuintBackend/fuint-application/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/fuintBackend/fuint-framework/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/fuintBackend/fuint-framework/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/fuintBackend/fuint-payment/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/fuintBackend/fuint-payment/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/fuintBackend/fuint-quartz/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/fuintBackend/fuint-quartz/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/fuintBackend/fuint-repository/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/fuintBackend/fuint-repository/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/fuintBackend/fuint-utils/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/fuintBackend/fuint-utils/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/fuintBackend/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/fuintBackend/src/main/resources" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
20
.idea/jarRepositories.xml
Normal file
20
.idea/jarRepositories.xml
Normal file
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Central Repository" />
|
||||
<option name="url" value="https://repo.maven.apache.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
@ -1,6 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="MavenProjectsManager">
|
||||
<option name="originalFiles">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/fuintBackend/pom.xml" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
@ -134,3 +134,12 @@ export function delOilTag(id) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 删除员工
|
||||
export function getStaffByDeptId(deptId) {
|
||||
return request({
|
||||
url: '/business/member/staff/getStaffByDeptId/' + deptId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ import request from '@/utils/request'
|
||||
|
||||
|
||||
// 分页查询所有的订单信息
|
||||
export function getListApi(query) {
|
||||
export function getCostListApi(query) {
|
||||
return request({
|
||||
url: 'MessageCost',
|
||||
method: 'get',
|
||||
@ -18,14 +18,14 @@ export function getInfoApi(id) {
|
||||
})
|
||||
}
|
||||
//
|
||||
export function deleteApi(id) {
|
||||
export function deleteCostApi(id) {
|
||||
return request({
|
||||
url: 'MessageCost/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
//
|
||||
export function saveApi(data) {
|
||||
export function saveCostApi(data) {
|
||||
return request({
|
||||
url: 'MessageCost',
|
||||
method: 'post',
|
||||
@ -34,7 +34,7 @@ export function saveApi(data) {
|
||||
}
|
||||
|
||||
// 保存修改信息
|
||||
export function updateApi(data) {
|
||||
export function updateCostApi(data) {
|
||||
return request({
|
||||
url: 'MessageCost',
|
||||
method: 'put',
|
||||
|
@ -2,12 +2,13 @@
|
||||
<div class="app-container">
|
||||
|
||||
<div class="tab-box">
|
||||
<div class="f-box" v-for="(item,index) in tablist" :key="index" @click="getindex(index)"
|
||||
:class="{ 'active' :activeindex==index}">{{ item.name }}
|
||||
<div class="tab_" :class="{active:index== tabindex }" @click="getindex(index)" v-for="(item,index) in tabs"
|
||||
:key="index">
|
||||
{{ item.name }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-change" style="margin: 20px" v-if="activeindex == 0">
|
||||
<div class="card-change" style="margin: 20px" v-if="tabindex == 0">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="180px">
|
||||
<el-form-item label="" prop="name">
|
||||
<el-input
|
||||
@ -57,16 +58,32 @@
|
||||
<div style="height: 70vh;overflow: auto">
|
||||
<el-table :data="tableData" border style="width: 100%">
|
||||
<el-table-column type="index" label="序号"></el-table-column>
|
||||
<el-table-column prop="messageId" label="短信模板ID"></el-table-column>
|
||||
<el-table-column prop="name" label="短信名称"></el-table-column>
|
||||
<el-table-column prop="content" label="短信模板内容"></el-table-column>
|
||||
<el-table-column prop="messageId" label="短信模板ID">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.messageId}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="短信名称">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.name}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="content" label="短信模板内容">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.content}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="image" label="短信图片">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <ImagePreview :src="scope.row.image"></ImagePreview>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column prop="deptNames" label="适用范围"></el-table-column>-->
|
||||
<el-table-column prop="roleIds" label="接收角色"></el-table-column>
|
||||
<el-table-column prop="roleIds" label="接收角色">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.roleIds}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="status" label="短信状态">
|
||||
<template slot-scope="scope">
|
||||
@ -78,8 +95,16 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createName" label="创建人"></el-table-column>
|
||||
<el-table-column prop="createTime" label="创建时间"></el-table-column>
|
||||
<el-table-column prop="createName" label="创建人">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.createName}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="创建时间">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.createTime}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
@ -111,7 +136,7 @@
|
||||
/>
|
||||
|
||||
</div>
|
||||
<div class="card-change" style="margin: 20px" v-if="activeindex == 1">
|
||||
<div class="card-change" style="margin: 20px" v-if="tabindex == 1">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="180px">
|
||||
|
||||
<el-form-item label="" prop="status">
|
||||
@ -143,12 +168,28 @@
|
||||
</el-form>
|
||||
|
||||
<div style="height: 70vh;overflow: auto">
|
||||
<el-table :data="tableData" border style="width: 100%">
|
||||
<el-table :data="messageRecordList" border style="width: 100%">
|
||||
<el-table-column type="index" label="序号"></el-table-column>
|
||||
<el-table-column prop="name" label="短信名称"></el-table-column>
|
||||
<el-table-column prop="content" label="短信内容"></el-table-column>
|
||||
<el-table-column prop="roleIds" label="接收角色"></el-table-column>
|
||||
<el-table-column prop="roleIds" label="短信发送记录"></el-table-column>
|
||||
<el-table-column prop="name" label="短信名称">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.name}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="content" label="短信内容">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.content}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="roleIds" label="接收角色">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.name}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="successNum" label="短信发送记录">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.successNum || 0}}/{{scope.row.sendNum || 0}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="status" label="发送状态">
|
||||
<template slot-scope="scope">
|
||||
@ -160,8 +201,16 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createName" label="发送人"></el-table-column>
|
||||
<el-table-column prop="createTime" label="发送时间"></el-table-column>
|
||||
<el-table-column prop="createName" label="发送人">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.createName}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="发送时间">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.createTime}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<pagination
|
||||
@ -173,7 +222,7 @@
|
||||
/>
|
||||
|
||||
</div>
|
||||
<div class="card-change" style="margin: 20px" v-if="activeindex == 2">
|
||||
<div class="card-change" style="margin: 20px" v-if="tabindex == 2">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="180px">
|
||||
|
||||
<el-form-item label="" prop="status">
|
||||
@ -213,15 +262,51 @@
|
||||
<div style="height: 70vh;overflow: auto">
|
||||
<el-table :data="messageCostList" border style="width: 100%">
|
||||
<el-table-column type="index" align="center" label="序号"></el-table-column>
|
||||
<el-table-column prop="storeId" align="center" label="机构名称"></el-table-column>
|
||||
<el-table-column prop="contacts" align="center" label="联系人"></el-table-column>
|
||||
<el-table-column prop="mobile" align="center" label="联系方式"></el-table-column>
|
||||
<el-table-column prop="balance" align="center" label="短信余额"></el-table-column>
|
||||
<el-table-column prop="messageNum" align="center" label="累计已发短信条数"></el-table-column>
|
||||
<el-table-column prop="residueNum" align="center" label="剩余短信条数"></el-table-column>
|
||||
<el-table-column prop="rechargeRecord" align="center" label="短信充值记录"></el-table-column>
|
||||
<el-table-column prop="createName" align="center" label="操作人"></el-table-column>
|
||||
<el-table-column prop="createTime" align="center" label="操作时间"></el-table-column>
|
||||
<el-table-column prop="storeId" align="center" label="机构名称">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.storeId}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="contacts" align="center" label="联系人">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.contacts}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="mobile" align="center" label="联系方式">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.mobile}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="balance" align="center" label="短信余额">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.balance}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="messageNum" align="center" label="累计已发短信条数">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.messageNum}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="residueNum" align="center" label="剩余短信条数">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.residueNum}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="rechargeRecord" align="center" label="短信充值记录">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.rechargeRecord}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createName" align="center" label="操作人">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.name}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" align="center" label="操作时间">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.createTime}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
@ -288,16 +373,17 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="submitForm('form')">提交</el-button>
|
||||
<el-button @click="open = false">取 消</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="open2" width="35%" append-to-body>
|
||||
<el-form ref="form" :rules="rules" :model="form2" label-width="120px">
|
||||
<el-form ref="form2" :rules="rules" :model="form2" label-width="120px">
|
||||
|
||||
<el-form-item label="机构名称" prop="deptIdList">
|
||||
<el-select v-model="form.deptIdList" multiple placeholder="请选择所属机构" style="width: 300px">
|
||||
<el-form-item label="机构名称" prop="deptId">
|
||||
<el-select v-model="form2.deptId" placeholder="请选择所属机构" @change="getStaff(form2.deptId)" style="width: 300px">
|
||||
<el-option
|
||||
v-for="item in deptListSelect"
|
||||
:key="item.deptId"
|
||||
@ -306,23 +392,24 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人" prop="content">
|
||||
<el-input type="textarea" v-model="form.content" style="width: 300px"></el-input>
|
||||
<el-form-item label="联系人" prop="contacts">
|
||||
<el-input v-model="form2.contacts" style="width: 300px"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系方式" prop="content">
|
||||
<el-input type="textarea" v-model="form.content" style="width: 300px"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="submitForm('form')">提交</el-button>
|
||||
<el-form-item label="联系方式" prop="mobile">
|
||||
<el-input v-model="form2.mobile" style="width: 300px"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm2">确 定</el-button>
|
||||
<el-button @click="open3 = false">取 消</el-button>
|
||||
</div>
|
||||
|
||||
</el-dialog>
|
||||
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="open3" width="35%" append-to-body>
|
||||
<el-form ref="form" :rules="rules" :model="form3" label-width="120px">
|
||||
|
||||
<el-form-item label="机构名称" prop="deptIdList">
|
||||
<el-select v-model="form.deptIdList" multiple placeholder="请选择所属机构" style="width: 300px">
|
||||
<el-select v-model="form3.deptIdList" multiple placeholder="请选择所属机构" style="width: 300px">
|
||||
<el-option
|
||||
v-for="item in deptListSelect"
|
||||
:key="item.deptId"
|
||||
@ -332,17 +419,18 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="充值金额" prop="content">
|
||||
<el-input type="textarea" v-model="form.content" style="width: 300px"></el-input>
|
||||
<el-input type="textarea" v-model="form3.content" style="width: 300px"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="短信单价" prop="content">
|
||||
<el-input type="textarea" v-model="form.content" style="width: 300px"></el-input>
|
||||
<el-input type="textarea" v-model="form3.content" style="width: 300px"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="短信条数" prop="content">
|
||||
<el-input type="textarea" v-model="form.content" style="width: 300px"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="submitForm('form')">提交</el-button>
|
||||
<el-input type="textarea" v-model="form3.content" style="width: 300px"></el-input>
|
||||
</el-form-item>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm3">确 定</el-button>
|
||||
<el-button @click="open3 = false">取 消</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
</el-dialog>
|
||||
@ -356,6 +444,8 @@ import {deleteApi, getListApi, saveApi, updateApi} from "../../api/sys/message";
|
||||
import {getToken} from '../../utils/auth'
|
||||
import {selectChildByDeptId} from "../../api/system/Site/site";
|
||||
import NotifyMode from "./page/mode.vue";
|
||||
import {getCostListApi, saveCostApi, updateCostApi} from "@/api/sys/messageCost";
|
||||
import {getStaffByDeptId} from "@/api/staff/staff";
|
||||
|
||||
export default {
|
||||
name: "printIndex",
|
||||
@ -363,8 +453,8 @@ export default {
|
||||
dicts: ['dept_ids', 'message_status'],
|
||||
data() {
|
||||
return {
|
||||
activeindex: 0,
|
||||
tablist: [
|
||||
tabindex: 0,
|
||||
tabs: [
|
||||
{
|
||||
name: '短信模板',
|
||||
},
|
||||
@ -404,7 +494,7 @@ export default {
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
messageRecordList:[],
|
||||
messageRecordList: [],
|
||||
|
||||
total2: 0,
|
||||
// 查询参数
|
||||
@ -412,11 +502,11 @@ export default {
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
messageCostList:[],
|
||||
open2:false,
|
||||
form2:{},
|
||||
open3:false,
|
||||
form3:{},
|
||||
messageCostList: [],
|
||||
open2: false,
|
||||
form2: {},
|
||||
open3: false,
|
||||
form3: {},
|
||||
|
||||
// 上传地址
|
||||
uploadAction: process.env.VUE_APP_BASE_API + 'backendApi/file/upload',
|
||||
@ -444,6 +534,15 @@ export default {
|
||||
],
|
||||
content: [
|
||||
{required: true, message: "短信介绍不能为空", trigger: "blur"}
|
||||
],
|
||||
deptId: [
|
||||
{required: true, message: "机构名称不能为空", trigger: "blur"}
|
||||
],
|
||||
contacts: [
|
||||
{required: true, message: "联系人不能为空", trigger: "blur"}
|
||||
],
|
||||
mobile: [
|
||||
{required: true, message: "联系方式不能为空", trigger: "blur"}
|
||||
]
|
||||
}
|
||||
};
|
||||
@ -453,12 +552,79 @@ export default {
|
||||
this.selectChildByDeptIdApi()
|
||||
},
|
||||
methods: {
|
||||
handleAdd2(){
|
||||
getStaff(deptId){
|
||||
getStaffByDeptId(deptId).then(res => {
|
||||
this.form2.contacts = res.data.realName
|
||||
this.form2.mobile = res.data.mobile
|
||||
this.$forceUpdate()
|
||||
})
|
||||
},
|
||||
// 提交按钮
|
||||
submitForm2: function () {
|
||||
this.$refs["form2"].validate(valid => {
|
||||
if (valid) {
|
||||
if (!this.form2.id) {
|
||||
saveCostApi(this.form2).then(res => {
|
||||
if (res.data==1){
|
||||
this.$message.success("添加成功")
|
||||
this.open2 = false
|
||||
this.queryParams2.page = 1;
|
||||
this.getMessageCostList()
|
||||
}else {
|
||||
this.$message.error("添加失败,机构名称不可重复!")
|
||||
}
|
||||
})
|
||||
} else {
|
||||
updateCostApi(this.form).then(res => {
|
||||
if (res.data==1) {
|
||||
this.$message.success("修改成功")
|
||||
this.open = false
|
||||
this.queryParams.page = 1;
|
||||
this.getList()
|
||||
}else {
|
||||
this.$message.error("添加失败,机构名称不可重复!")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 提交按钮
|
||||
submitForm3: function () {
|
||||
this.$refs["form3"].validate(valid => {
|
||||
if (valid) {
|
||||
if (!this.form3.id) {
|
||||
// saveLinkManageApi(this.form).then(res => {
|
||||
// if (res.data==1){
|
||||
// this.$message.success("添加成功")
|
||||
// this.open = false
|
||||
// this.queryParams.page = 1;
|
||||
// this.getList()
|
||||
// }else {
|
||||
// this.$message.error("添加失败,页面/功能名称不可重复")
|
||||
// }
|
||||
// })
|
||||
} else {
|
||||
// updateLinkManageApi(this.form).then(res => {
|
||||
// if (res.data==1) {
|
||||
// this.$message.success("修改成功")
|
||||
// this.open = false
|
||||
// this.queryParams.page = 1;
|
||||
// this.getList()
|
||||
// }else {
|
||||
// this.$message.error("添加失败,页面/功能名称不可重复")
|
||||
// }
|
||||
// })
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
handleAdd2() {
|
||||
this.open2 = true
|
||||
},
|
||||
getMessageCostList(){
|
||||
getListApi(this.queryParams2).then(res => {
|
||||
this.messageCostList = res.data
|
||||
getMessageCostList() {
|
||||
getCostListApi(this.queryParams2).then(res => {
|
||||
this.messageCostList = res.data.records
|
||||
this.total2 = res.data.total
|
||||
})
|
||||
},
|
||||
@ -636,24 +802,32 @@ export default {
|
||||
|
||||
.tab-box {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
background: #fff;
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
padding: 0px 50px;
|
||||
margin-bottom: 25px;
|
||||
|
||||
}
|
||||
|
||||
.f-box {
|
||||
height: 40px;
|
||||
color: #999999;
|
||||
margin-right: 50px;
|
||||
.tab_ {
|
||||
width: 85px;
|
||||
height: 100%;
|
||||
//border-bottom: 2px solid #FF770F;
|
||||
display: flex;
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
color: #999999;
|
||||
align-items: center;
|
||||
|
||||
justify-content: center;
|
||||
margin-left: 50px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.active {
|
||||
color: #FF9655 !important;
|
||||
border-bottom: 2px solid #FF9655 !important;
|
||||
border-bottom: 2px solid #FF770F !important;
|
||||
color: #FF770F !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
@ -198,4 +198,14 @@ public class LJStaffController extends BaseController {
|
||||
public ResponseObject queryStaffList(@PathVariable Integer storeId){
|
||||
return getSuccessResult(mtStaffService.queryStaffs(storeId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据机构id查询员工信息
|
||||
* @param deptId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getStaffByDeptId/{deptId}")
|
||||
public ResponseObject selectStaffByDeptId(@PathVariable Long deptId){
|
||||
return getSuccessResult(mtStaffService.selectStaffByDeptId(deptId));
|
||||
}
|
||||
}
|
||||
|
@ -107,4 +107,11 @@ public interface ILJStaffService extends IService<LJStaff> {
|
||||
* @return
|
||||
*/
|
||||
LJStaff selectStaffByStoreId(int storeId);
|
||||
|
||||
/**
|
||||
* 根据机构id查询员工信息
|
||||
* @param deptId
|
||||
* @return
|
||||
*/
|
||||
LJStaff selectStaffByDeptId(Long deptId);
|
||||
}
|
||||
|
@ -62,6 +62,7 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
|
||||
|
||||
/**
|
||||
* 根据条件分页查询员工信息
|
||||
*
|
||||
* @param page
|
||||
* @param staff
|
||||
* @return
|
||||
@ -76,14 +77,14 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
|
||||
staff.setStoreId(storeId);
|
||||
IPage<LJStaff> ljStaffIPage = baseMapper.selectLJStaffList(page, staff);
|
||||
List<LJStaff> records = ljStaffIPage.getRecords();
|
||||
if (CollectionUtils.isNotEmpty(records)){
|
||||
if (CollectionUtils.isNotEmpty(records)) {
|
||||
for (LJStaff record : records) {
|
||||
LambdaQueryWrapper<TagCodeRecord> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(TagCodeRecord::getStaffId,record.getId());
|
||||
queryWrapper.eq(TagCodeRecord::getStaffId, record.getId());
|
||||
List<TagCodeRecord> list = tagCodeRecordService.list(queryWrapper);
|
||||
if (ObjectUtils.isNotEmpty(list)){
|
||||
if (ObjectUtils.isNotEmpty(list)) {
|
||||
record.setTagStatus("1");
|
||||
}else {
|
||||
} else {
|
||||
record.setTagStatus("0");
|
||||
}
|
||||
}
|
||||
@ -93,6 +94,7 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
|
||||
|
||||
/**
|
||||
* 查询所有员工信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@ -100,25 +102,25 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
Integer storeId = nowAccountInfo.getStoreId();
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("store_id",storeId);
|
||||
queryWrapper.eq("status","qy");
|
||||
queryWrapper.eq("if_delete","0");
|
||||
queryWrapper.eq("store_id", storeId);
|
||||
queryWrapper.eq("status", "qy");
|
||||
queryWrapper.eq("if_delete", "0");
|
||||
List list = baseMapper.selectList(queryWrapper);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LJStaff> queryStaffLists(Integer storeId) {
|
||||
if (storeId==null){
|
||||
if (storeId == null) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
storeId = nowAccountInfo.getStoreId();
|
||||
}
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("store_id",storeId);
|
||||
queryWrapper.eq("status","qy");
|
||||
queryWrapper.eq("store_id", storeId);
|
||||
queryWrapper.eq("status", "qy");
|
||||
/*queryWrapper.eq("role_id","15");*/
|
||||
queryWrapper.eq("if_delete","0");
|
||||
queryWrapper.eq("is_refuel","xs");
|
||||
queryWrapper.eq("if_delete", "0");
|
||||
queryWrapper.eq("is_refuel", "xs");
|
||||
List list = baseMapper.selectList(queryWrapper);
|
||||
return list;
|
||||
}
|
||||
@ -126,17 +128,18 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
|
||||
@Override
|
||||
public List<LJStaff> queryStaffLists1(Integer storeId) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("store_id",storeId);
|
||||
queryWrapper.eq("status","qy");
|
||||
queryWrapper.eq("role_id","15");
|
||||
queryWrapper.eq("if_delete","0");
|
||||
queryWrapper.eq("is_refuel","xs");
|
||||
queryWrapper.eq("store_id", storeId);
|
||||
queryWrapper.eq("status", "qy");
|
||||
queryWrapper.eq("role_id", "15");
|
||||
queryWrapper.eq("if_delete", "0");
|
||||
queryWrapper.eq("is_refuel", "xs");
|
||||
List list = baseMapper.selectList(queryWrapper);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询员工信息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ -151,19 +154,20 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
|
||||
|
||||
/**
|
||||
* 根据手机号查询员工信息
|
||||
*
|
||||
* @param mobile
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public LJStaff selectStaffByMobile(String mobile,Integer storeId) {
|
||||
if (ObjectUtil.isEmpty(storeId)){
|
||||
public LJStaff selectStaffByMobile(String mobile, Integer storeId) {
|
||||
if (ObjectUtil.isEmpty(storeId)) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
storeId = nowAccountInfo.getStoreId();
|
||||
}
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("mobile",mobile);
|
||||
queryWrapper.eq("store_id",storeId);
|
||||
queryWrapper.eq("if_delete","0");
|
||||
queryWrapper.eq("mobile", mobile);
|
||||
queryWrapper.eq("store_id", storeId);
|
||||
queryWrapper.eq("if_delete", "0");
|
||||
LJStaff staff = baseMapper.selectOne(queryWrapper);
|
||||
return staff;
|
||||
}
|
||||
@ -172,26 +176,28 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
|
||||
@Override
|
||||
public LJStaff selectStaffByMobile2(String mobile) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("mobile",mobile);
|
||||
queryWrapper.eq("status","qy");
|
||||
queryWrapper.eq("if_delete","0");
|
||||
queryWrapper.eq("mobile", mobile);
|
||||
queryWrapper.eq("status", "qy");
|
||||
queryWrapper.eq("if_delete", "0");
|
||||
LJStaff staff = baseMapper.selectOne(queryWrapper);
|
||||
return staff;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id批量删除员工信息
|
||||
*
|
||||
* @param ids
|
||||
*/
|
||||
@Override
|
||||
public void deleteStaffByIds(Integer[] ids) {
|
||||
for (int id : ids){
|
||||
for (int id : ids) {
|
||||
this.deleteStaffById(id);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id删除员工信息
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
@Override
|
||||
@ -203,6 +209,7 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
|
||||
|
||||
/**
|
||||
* 添加用户信息
|
||||
*
|
||||
* @param staff
|
||||
* @return
|
||||
*/
|
||||
@ -213,17 +220,17 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
|
||||
if (ObjectUtil.isNotEmpty(staff.getStoreId())) {
|
||||
storeId = staff.getStoreId();
|
||||
}
|
||||
LJStaff staff2 = this.selectStaffByMobile(staff.getMobile(),storeId);
|
||||
LJStaff staff2 = this.selectStaffByMobile(staff.getMobile(), storeId);
|
||||
if (ObjectUtil.isNotEmpty(staff2)) return 0;
|
||||
staff.setStoreId(storeId);
|
||||
if (StringUtils.isNotEmpty(staff.getRefundPassword())){
|
||||
if (StringUtils.isNotEmpty(staff.getRefundPassword())) {
|
||||
this.entryptPassword(staff);
|
||||
}
|
||||
int row = baseMapper.insert(staff);
|
||||
LJStaff staff1 = this.selectStaffByMobile(staff.getMobile(),storeId);
|
||||
if (ObjectUtil.isNotEmpty(staff1)){
|
||||
LJStaff staff1 = this.selectStaffByMobile(staff.getMobile(), storeId);
|
||||
if (ObjectUtil.isNotEmpty(staff1)) {
|
||||
// 添加员工码
|
||||
staff1.setStaffCode("https://oilapi.youkerr.com/oilRefuel?storeId="+storeId+"&staffId="+staff1.getId());
|
||||
staff1.setStaffCode("https://oilapi.youkerr.com/oilRefuel?storeId=" + storeId + "&staffId=" + staff1.getId());
|
||||
this.updateStaff(staff1);
|
||||
}
|
||||
|
||||
@ -232,11 +239,11 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
|
||||
TAccount account = new TAccount();
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
String timestamp = dateFormat.format(new Date());
|
||||
String randomString = UUID.randomUUID().toString().replace("-","").substring(0,6);
|
||||
account.setAccountKey(timestamp+randomString);
|
||||
if (ObjectUtil.isNotEmpty(staff.getAccountName())){
|
||||
String randomString = UUID.randomUUID().toString().replace("-", "").substring(0, 6);
|
||||
account.setAccountKey(timestamp + randomString);
|
||||
if (ObjectUtil.isNotEmpty(staff.getAccountName())) {
|
||||
account.setAccountName(staff.getAccountName());
|
||||
}else {
|
||||
} else {
|
||||
account.setAccountName(staff.getMobile());
|
||||
}
|
||||
account.setAccountStatus(1);
|
||||
@ -249,27 +256,27 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
|
||||
LJStore store = storeService.selectStoreByStoreId(storeId);
|
||||
account.setDeptId(store.getContractDeptId());
|
||||
|
||||
if (StringUtils.isNotEmpty(staff.getRefundPassword())){
|
||||
if (StringUtils.isNotEmpty(staff.getRefundPassword())) {
|
||||
account.setPassword(staff.getPassword());
|
||||
}else {
|
||||
} else {
|
||||
account.setPassword("123456");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(staff.getPassword())){
|
||||
if (StringUtils.isNotEmpty(staff.getPassword())) {
|
||||
account.setPassword(staff.getPassword());
|
||||
}else {
|
||||
} else {
|
||||
account.setPassword("123456");
|
||||
}
|
||||
TDuty tDuty = new TDuty();
|
||||
tDuty.setDutyId(Integer.valueOf(staff1.getRoleId()));
|
||||
accountService.createAccountInfo(account,tDutyService.getDutyList(tDuty));
|
||||
accountService.createAccountInfo(account, tDutyService.getDutyList(tDuty));
|
||||
return row;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addStaff(LJStaff staff,TAccount tAccount) {
|
||||
public int addStaff(LJStaff staff, TAccount tAccount) {
|
||||
int row = baseMapper.insert(staff);
|
||||
LJStaff staff1 = this.selectStaffByMobile(staff.getMobile(),null);
|
||||
if (ObjectUtil.isNotEmpty(staff1)){
|
||||
LJStaff staff1 = this.selectStaffByMobile(staff.getMobile(), null);
|
||||
if (ObjectUtil.isNotEmpty(staff1)) {
|
||||
tAccount.setStaffId(staff1.getId());
|
||||
accountService.updateAccount(tAccount);
|
||||
}
|
||||
@ -278,23 +285,24 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
|
||||
|
||||
/**
|
||||
* 修改用户信息
|
||||
*
|
||||
* @param staff
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int updateStaff(LJStaff staff) {
|
||||
int row = 0;
|
||||
LJStaff staff1 = this.selectStaffByMobile(staff.getMobile(),staff.getStoreId());
|
||||
if (ObjectUtil.isNotEmpty(staff1) && !staff1.getId().equals(staff.getId())){
|
||||
LJStaff staff1 = this.selectStaffByMobile(staff.getMobile(), staff.getStoreId());
|
||||
if (ObjectUtil.isNotEmpty(staff1) && !staff1.getId().equals(staff.getId())) {
|
||||
row = 0;
|
||||
return row;
|
||||
}
|
||||
if (StringUtils.isEmpty(staff.getStaffCode())){
|
||||
if (StringUtils.isEmpty(staff.getStaffCode())) {
|
||||
// 添加员工码
|
||||
staff.setStaffCode("https://oilapi.youkerr.com/oilRefuel?storeId="+staff.getStoreId()+"&staffId="+staff.getId());
|
||||
staff.setStaffCode("https://oilapi.youkerr.com/oilRefuel?storeId=" + staff.getStoreId() + "&staffId=" + staff.getId());
|
||||
}
|
||||
row = baseMapper.updateById(staff);
|
||||
if (StringUtils.isNotEmpty(staff.getPassword())){
|
||||
if (StringUtils.isNotEmpty(staff.getPassword())) {
|
||||
TAccount tAccount = accountService.selectAccountByStaffId(staff.getId());
|
||||
if (ObjectUtil.isNotEmpty(tAccount)) {
|
||||
if (StringUtils.isNotEmpty(staff.getPassword())) {
|
||||
@ -311,7 +319,7 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
TAccount tAccount = accountService.selectAccountByStaffId(staff.getId());
|
||||
if (ObjectUtil.isNotEmpty(tAccount)) {
|
||||
if (tAccount.getAccountName().matches("\\d+")) {
|
||||
@ -350,19 +358,19 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
|
||||
// }
|
||||
String url = staff.getStaffCode();
|
||||
String area = store.getName();
|
||||
String finalPath="/temp/qrCode/" + area + ".jpg";
|
||||
String finalPath = "/temp/qrCode/" + area + ".jpg";
|
||||
InputStream backgroundStream = this.getClass().getClassLoader().getResourceAsStream(backgroundImage);
|
||||
InputStream logoStream = this.getClass().getClassLoader().getResourceAsStream(logoImage);
|
||||
//背景图片路径 loge图片 二维码 输出地址
|
||||
qrCodeUtils.createLogoCodePicture(backgroundStream, logoStream, url, finalPath, staff.getId(),store.getId(),null);
|
||||
qrCodeUtils.createLogoCodePicture(backgroundStream, logoStream, url, finalPath, staff.getId(), store.getId(), null);
|
||||
File file1 = new File("/temp/qrCode/");
|
||||
// 判断目录是否存在
|
||||
if (!file1.exists()) {
|
||||
file1.mkdir();
|
||||
}
|
||||
|
||||
File file =new File(finalPath);
|
||||
FileInputStream fileInputStream =new FileInputStream(file);
|
||||
File file = new File(finalPath);
|
||||
FileInputStream fileInputStream = new FileInputStream(file);
|
||||
MultipartFile resFile = new MockMultipartFile("file", file.getName(), null, fileInputStream);
|
||||
// 返回图片路径
|
||||
String saveFile = backendFileController.saveFile(resFile);
|
||||
@ -379,16 +387,16 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
|
||||
@Override
|
||||
public int auditPrem(String auditPrem) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
int row = baseMapper.auditPrem(nowAccountInfo.getStaffId(),auditPrem);
|
||||
int row = baseMapper.auditPrem(nowAccountInfo.getStaffId(), auditPrem);
|
||||
return row;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LJStaff> queryStaffs(int storeId) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("store_id",storeId);
|
||||
queryWrapper.eq("status","qy");
|
||||
queryWrapper.eq("if_delete","0");
|
||||
queryWrapper.eq("store_id", storeId);
|
||||
queryWrapper.eq("status", "qy");
|
||||
queryWrapper.eq("if_delete", "0");
|
||||
List<LJStaff> list = baseMapper.selectList(queryWrapper);
|
||||
return list;
|
||||
}
|
||||
@ -397,18 +405,27 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
|
||||
public LJStaff selectStaffByStoreId(int storeId) {
|
||||
|
||||
|
||||
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("store_id",storeId);
|
||||
queryWrapper.eq("status","qy");
|
||||
queryWrapper.eq("if_delete","0");
|
||||
queryWrapper.eq("store_id", storeId);
|
||||
queryWrapper.eq("status", "qy");
|
||||
queryWrapper.eq("if_delete", "0");
|
||||
//queryWrapper.eq("role_id","12");
|
||||
queryWrapper.orderByAsc("create_time");
|
||||
List<LJStaff> list = baseMapper.selectList(queryWrapper);
|
||||
LJStaff staff = null;
|
||||
if (list.size()>0){
|
||||
if (list.size() > 0) {
|
||||
staff = list.get(0);
|
||||
}
|
||||
return staff;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LJStaff selectStaffByDeptId(Long deptId) {
|
||||
LJStaff ljStaff = null;
|
||||
LJStore ljStore = storeService.selectStoreByDeptId(deptId);
|
||||
if (ObjectUtil.isNotEmpty(ljStore)) {
|
||||
ljStaff = this.selectStaffByStoreId(ljStore.getId());
|
||||
}
|
||||
return ljStaff;
|
||||
}
|
||||
}
|
||||
|
@ -37,6 +37,10 @@ public class MessageCost extends BaseEntity implements Serializable {
|
||||
* 油站id
|
||||
*/
|
||||
private Integer storeId;
|
||||
/**
|
||||
* 机构id
|
||||
*/
|
||||
private Integer deptId;
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
|
@ -27,6 +27,8 @@ public interface MessageCostService {
|
||||
*/
|
||||
MessageCost queryById(Integer id);
|
||||
|
||||
MessageCost selectByDeptId(Integer deptId);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
|
@ -1,13 +1,19 @@
|
||||
package com.fuint.business.setting.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.setting.entity.MessageCost;
|
||||
import com.fuint.business.setting.mapper.MessageCostMapper;
|
||||
import com.fuint.business.setting.service.MessageCostService;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* 短信费用信息表(MessageCost)表服务实现类
|
||||
@ -34,6 +40,13 @@ public class MessageCostServiceImpl extends ServiceImpl<MessageCostMapper,Messag
|
||||
return baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MessageCost selectByDeptId(Integer deptId) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("dept_id",deptId);
|
||||
return baseMapper.selectOne(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
@ -42,6 +55,13 @@ public class MessageCostServiceImpl extends ServiceImpl<MessageCostMapper,Messag
|
||||
*/
|
||||
@Override
|
||||
public int insert(MessageCost messageCost) {
|
||||
MessageCost messageCost1 = selectByDeptId(messageCost.getDeptId());
|
||||
if (ObjectUtil.isNotEmpty(messageCost1)){
|
||||
return 0;
|
||||
}
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
messageCost.setChainStoreId(nowAccountInfo.getChainStoreId());
|
||||
messageCost.setStoreId(nowAccountInfo.getStoreId());
|
||||
return baseMapper.insert(messageCost);
|
||||
}
|
||||
|
||||
@ -53,6 +73,10 @@ public class MessageCostServiceImpl extends ServiceImpl<MessageCostMapper,Messag
|
||||
*/
|
||||
@Override
|
||||
public int update(MessageCost messageCost) {
|
||||
MessageCost messageCost1 = selectByDeptId(messageCost.getDeptId());
|
||||
if (ObjectUtil.isNotEmpty(messageCost1) && !Objects.equals(messageCost1.getId(), messageCost.getId())){
|
||||
return 0;
|
||||
}
|
||||
return baseMapper.updateById(messageCost);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user