积分设置
This commit is contained in:
parent
a1138b726d
commit
46e0745947
28
fuintAdmin/src/api/integral/settings.js
Normal file
28
fuintAdmin/src/api/integral/settings.js
Normal file
@ -0,0 +1,28 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 查询油罐列表
|
||||
export function getSettingsApi(data) {
|
||||
return request({
|
||||
url: 'business/integral/integralSettings/getSettings',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
// 新增有关信息
|
||||
export function insertSettingsApi(data) {
|
||||
return request({
|
||||
url: 'business/integral/integralSettings',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 修改有关信息
|
||||
export function updateSettingsApi(data) {
|
||||
return request({
|
||||
url: 'business/integral/integralSettings',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -1078,7 +1078,6 @@ export default {
|
||||
type: file.data.type,
|
||||
fileName: file.data.fileName
|
||||
}
|
||||
console.log("giftImages",this.giftImages)
|
||||
if (this.giftImages == undefined) {
|
||||
this.giftImages = [];
|
||||
|
||||
@ -1088,7 +1087,6 @@ export default {
|
||||
},
|
||||
|
||||
handleRemove(file, fileList) {
|
||||
console.log("file.response.data.fileName",file);
|
||||
|
||||
this.giftImages.forEach((image, index) => {
|
||||
if (file.url === image.url) {
|
||||
@ -1106,7 +1104,6 @@ export default {
|
||||
|
||||
|
||||
handleChildValue(value) {
|
||||
console.log("value",value)
|
||||
this.dataForm.detailedDescription = value
|
||||
},
|
||||
|
||||
|
379
fuintAdmin/src/views/integral/settings/index.vue
Normal file
379
fuintAdmin/src/views/integral/settings/index.vue
Normal file
@ -0,0 +1,379 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>积分设置</span>
|
||||
</div>
|
||||
<div>
|
||||
<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
|
||||
<el-tab-pane label="加油返积分" name="first">
|
||||
<div>
|
||||
<el-form :model="dataForm" ref="dataForm" :rules="rules" size="small" :inline="true" label-width="100px">
|
||||
<el-row>
|
||||
<el-form-item label="积分规则" prop="refuelPointsRules" >
|
||||
<el-radio-group v-model="dataForm.refuelPointsRules">
|
||||
<el-radio :label='0'>默认规则</el-radio>
|
||||
<el-radio :label='1'>积分活动规则</el-radio>
|
||||
</el-radio-group>
|
||||
<span style="display: block; width: 800px; color: rgb(128, 128, 128);font-size: 10px;">
|
||||
默认规则:使用当前页面简版设置,适用于对积分规则要求不高的油站积分活动规则:积分获取按照积分活动(活动营销-积分活动)进行处理,积分活动功能可实现指定日期、指定油品、指定周、指定等级等使用不同积分规则</span>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<template v-if="dataForm.refuelPointsRules == 1">
|
||||
<span style="color: red;border-left: 40px;padding-left: 100px;">请前往活动营销-积分活动页面创建积分规则</span>
|
||||
</template>
|
||||
<template v-if="dataForm.refuelPointsRules == 0">
|
||||
<el-row>
|
||||
<el-form-item label="积分功能" prop="refuelPointsFunction" >
|
||||
<el-radio-group v-model="dataForm.refuelPointsFunction">
|
||||
<el-radio :label='0'>启用</el-radio>
|
||||
<el-radio :label='1'>禁用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="场景类型" prop="refuelSceneType" >
|
||||
<el-radio-group v-model="dataForm.refuelSceneType">
|
||||
<el-radio :label='0'>按金额</el-radio>
|
||||
<el-radio :label='1'>实付金额</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
|
||||
<template v-if="dataForm.refuelSceneType == 0">
|
||||
<el-row>
|
||||
<el-form-item label="金额类型" prop="refuelAmountType" >
|
||||
<el-radio-group v-model="dataForm.refuelAmountType">
|
||||
<el-radio :label='0'>订单金额</el-radio>
|
||||
<el-radio :label='1'>实付金额</el-radio>
|
||||
</el-radio-group>
|
||||
<span style="display: block; width: 800px; color: rgb(128, 128, 128);font-size: 10px;">
|
||||
计算积分的金额类型 </span>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row v-if="dataForm.refuelAmountType == 1">
|
||||
<el-form-item label="储值参与" prop="refuelValueParticipation" >
|
||||
<el-radio-group v-model="dataForm.refuelValueParticipation">
|
||||
<el-radio :label='0'>储值金额不参与</el-radio>
|
||||
<el-radio :label='1'>储值金额参与</el-radio>
|
||||
</el-radio-group>
|
||||
<span style="display: block; width: 800px; color: rgb(128, 128, 128);font-size: 10px;">
|
||||
按照实付金额计算积分,实付金额是否包含储值卡付款金额部分 如参与 则实付金额 = 储值金额+其它实际付款金额
|
||||
</span>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-row>
|
||||
<el-form-item label="场景规则" prop="refuelSceneRules" >
|
||||
<el-radio-group v-model="dataForm.refuelSceneRules">
|
||||
<el-radio :label='0'>通用规则</el-radio>
|
||||
<el-radio :label='1'>油品区分</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
|
||||
|
||||
<template v-if="dataForm.refuelSceneRules == 0">
|
||||
<el-row>
|
||||
<el-form-item label="消费金额" prop="refuelConsumptionAmount" label-width="90px">
|
||||
<el-input style="width: 500px;" v-model="dataForm.refuelConsumptionAmount" placeholder="???">
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="积多少分" prop="refuelPoints" label-width="90px">
|
||||
<el-input style="width: 500px;" v-model="dataForm.refuelPoints" placeholder="???">
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</template>
|
||||
<template v-if="dataForm.refuelSceneRules == 1">
|
||||
<div class="conten-bottom">
|
||||
<div v-for="(item, index) in dataForm.refuelConsumptionAmount" class="cardbox">
|
||||
<div style="height:40px; ">
|
||||
<span>92#汽油</span>
|
||||
</div>
|
||||
<div style=" width: 99%;height: 99%;">
|
||||
<el-form-item label="消费金额" prop="refuelPointsRules" label-width="90px">
|
||||
<el-input style="width: 200px;" v-model="dataForm.refuelPointsRules" placeholder="???">
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="积多少分" prop="refuelPointsRules" label-width="90px">
|
||||
<el-input style="width: 200px;" v-model="dataForm.refuelPointsRules" placeholder="???">
|
||||
<template slot="append">积分</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
</el-form>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="充值积分" name="second">
|
||||
<div>
|
||||
<el-alert
|
||||
title="充值赠送积分详细规则请在充值活动对应规则内配置"
|
||||
type="warning"
|
||||
show-icon>
|
||||
</el-alert>
|
||||
<el-form :model="refuelForm" ref="refuelForm" :rules="rules" size="small" :inline="true" label-width="100px">
|
||||
<el-row>
|
||||
<el-form-item label="充值赠送" prop="rechargeGive" >
|
||||
<el-radio-group v-model="dataForm.rechargeGive">
|
||||
<el-radio :label='0'>启用</el-radio>
|
||||
<el-radio :label='1'>禁用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="邀请用户" name="third">
|
||||
<div>
|
||||
<el-alert
|
||||
title="邀请用户为推荐有礼活动赠送积分规则、邀请新人后将获得的积分"
|
||||
type="info"
|
||||
show-icon>
|
||||
</el-alert>
|
||||
<el-form :model="refuelForm" ref="refuelForm" :rules="rules" size="small" :inline="true" label-width="100px">
|
||||
<el-row>
|
||||
<el-form-item label="邀请赠送" prop="inviteGive" >
|
||||
<el-radio-group v-model="dataForm.inviteGive">
|
||||
<el-radio :label='0'>启用</el-radio>
|
||||
<el-radio :label='1'>禁用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="充值赠送" prop="inviteGiveRules" >
|
||||
<el-input v-model="dataForm.inviteGiveRules" placeholder="???">
|
||||
<template slot="prepend">每邀请一人赠送</template>
|
||||
<template slot="append">积分</template>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="每日签到" name="fourth">
|
||||
<div>
|
||||
<el-alert
|
||||
title="每日积分签到"
|
||||
type="info"
|
||||
description="签到规则为连续签到、如中途漏签一天将重置从第一天开始"
|
||||
show-icon>
|
||||
</el-alert>
|
||||
<el-form :model="dataForm" ref="dataForm" :rules="rules" size="small" :inline="true" label-width="100px">
|
||||
|
||||
<div style="width: 100%; margin-top: 20px;">
|
||||
|
||||
<el-form-item style="width: 24%" v-for="item, index in dataForm.pointsObtained" :key="index" :prop="'pointsObtained' + index" :label="item.day">
|
||||
<el-input v-model="item.integral" placeholder="???">
|
||||
<template slot="append">积分</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="23">
|
||||
<el-form-item label="签到规则" prop="signInRules" >
|
||||
<el-input style="width: 900px;" :rows="3" type="textarea" v-model="dataForm.signInRules"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="15">
|
||||
<el-form-item label="签到功能" prop="signInFunction" >
|
||||
<el-radio-group v-model="dataForm.signInFunction">
|
||||
<el-radio :label='0'>启用</el-radio>
|
||||
<el-radio :label='1'>禁用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="积分规则" name="five">
|
||||
<div>
|
||||
<el-form :model="refuelForm" ref="refuelForm" :rules="rules" size="small" :inline="true" label-width="100px">
|
||||
<!-- <el-row> -->
|
||||
<span style="margin-bottom: 20px;">积分说明</span>
|
||||
<Editor style="margin-top: 20px;"></Editor>
|
||||
<!-- </el-row> -->
|
||||
</el-form>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<div style="float: right; margin-bottom: 20px;">
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getSettingsApi,insertSettingsApi } from "@/api/integral/settings";
|
||||
import Editor from '@/components/Editor/index'
|
||||
|
||||
export default {
|
||||
name: "index",
|
||||
components: {Editor},
|
||||
|
||||
data() {
|
||||
return {
|
||||
activeName: 'first',
|
||||
|
||||
|
||||
rules:{},
|
||||
dataForm: {
|
||||
// 积分设置ID
|
||||
id: null,
|
||||
// 加油积分规则
|
||||
refuelPointsRules: 0,
|
||||
// 加油积分功能
|
||||
refuelPointsFunction: 0,
|
||||
// 加油场景类型
|
||||
refuelSceneType: 0,
|
||||
// 加油金额类型
|
||||
refuelAmountType: 0,
|
||||
// 加油储值参与
|
||||
refuelValueParticipation: 0,
|
||||
// 加油场景规则
|
||||
refuelSceneRules: 0,
|
||||
// 加油消费金额
|
||||
refuelConsumptionAmount: '',
|
||||
// 加油积分
|
||||
refuelPoints: 0,
|
||||
// 加油油品金额
|
||||
refuelFuelAmount: 0.0,
|
||||
// 加油油品升数
|
||||
refuelFuelVolume: 0.0,
|
||||
// 充值赠送
|
||||
rechargeGive: 0,
|
||||
// 邀请赠送
|
||||
inviteGive: 0,
|
||||
// 邀请赠送规则
|
||||
inviteGiveRules: '',
|
||||
// 签到功能
|
||||
signInFunction: 0,
|
||||
// 签到规则
|
||||
signInRules: '',
|
||||
// 签到获得
|
||||
pointsObtained: [
|
||||
{
|
||||
day:'第1天获得',
|
||||
integral:0,
|
||||
},
|
||||
{
|
||||
day:'第2天获得',
|
||||
integral:0,
|
||||
},
|
||||
{
|
||||
day:'第3天获得',
|
||||
integral:0,
|
||||
},
|
||||
{
|
||||
day:'第4天获得',
|
||||
integral:0,
|
||||
},
|
||||
{
|
||||
day:'第5天获得',
|
||||
integral:0,
|
||||
},
|
||||
{
|
||||
day:'第6天获得',
|
||||
integral:0,
|
||||
},
|
||||
{
|
||||
day:'第7天获得',
|
||||
integral:0,
|
||||
},
|
||||
{
|
||||
day:'超8天获得',
|
||||
integral:0,
|
||||
}
|
||||
],
|
||||
|
||||
// 积分规则
|
||||
pointsRules: ''
|
||||
|
||||
},
|
||||
|
||||
|
||||
refuelForm:{
|
||||
refuelPointsRules:'',
|
||||
},
|
||||
signInForm: {}
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getData()
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
this.dataForm.pointsObtained = JSON.stringify(this.dataForm.pointsObtained);
|
||||
|
||||
getSettingsApi(this.dataForm).then(res=>{
|
||||
this.dataForm = res.data
|
||||
this.dataForm.pointsObtained = JSON.parse(this.dataForm.pointsObtained)
|
||||
})
|
||||
},
|
||||
submit() {
|
||||
this.dataForm.pointsObtained = JSON.stringify(this.dataForm.pointsObtained);
|
||||
insertSettingsApi(this.dataForm).then(res=>{
|
||||
this.$modal.msgSuccess("添加成功");
|
||||
|
||||
}).catch(res=>{
|
||||
this.$modal.msgSuccess("添加失败");
|
||||
|
||||
})
|
||||
},
|
||||
cancel() {},
|
||||
handleClick(tab, event) {
|
||||
console.log(tab, event);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.app-container{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f6f8f9;
|
||||
}
|
||||
.conten-bottom{
|
||||
box-sizing: border-box;
|
||||
padding: 20px 20px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.cardbox{
|
||||
margin-right: 20px;
|
||||
margin-bottom: 20px;
|
||||
box-sizing: border-box;
|
||||
padding: 10px;
|
||||
border-radius: 10px;
|
||||
width: 23%;
|
||||
height: 150px;
|
||||
background-size:40% 70%;
|
||||
background-color: #f9f9f9;
|
||||
border: 1px solid rgb(196, 196, 196)
|
||||
}
|
||||
</style>
|
@ -45,7 +45,7 @@
|
||||
<el-form :model="gunForm" :rules="rules" ref="gunForm" label-width="100px" class="demo-ruleForm">
|
||||
<el-form-item label="油枪名称" prop="gunName">
|
||||
|
||||
<el-input placeholder="请输入内容"v-model="gunForm.gunName" class="input-with-select">
|
||||
<el-input placeholder="请输入内容" v-model="gunForm.gunName" class="input-with-select">
|
||||
<el-select v-model="gunForm.select" slot="append" placeholder="选择油枪" @change="chooseName">
|
||||
<el-option
|
||||
v-for="option in 50"
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.fuint.business.integral.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.integral.entity.IntegralGift;
|
||||
import com.fuint.business.integral.service.IntegralGiftService;
|
||||
import com.fuint.business.integral.vo.IntegralGiftVO;
|
||||
@ -38,7 +39,7 @@ public class IntegralGiftController extends BaseController {
|
||||
public ResponseObject queryByPage(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
|
||||
@Param("integralGift") IntegralGift integralGift) {
|
||||
com.baomidou.mybatisplus.extension.plugins.pagination.Page page = new com.baomidou.mybatisplus.extension.plugins.pagination.Page(pageNo, pageSize);
|
||||
Page page = new Page(pageNo, pageSize);
|
||||
IPage<IntegralGiftVO> integralGiftCategoryIPage = this.integralGiftService.queryByPage(page, integralGift);
|
||||
return getSuccessResult(integralGiftCategoryIPage);
|
||||
}
|
||||
@ -55,6 +56,8 @@ public class IntegralGiftController extends BaseController {
|
||||
return getSuccessResult(this.integralGiftService.queryById(id));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
|
@ -0,0 +1,103 @@
|
||||
package com.fuint.business.integral.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.integral.entity.IntegralGift;
|
||||
import com.fuint.business.integral.entity.IntegralSettings;
|
||||
import com.fuint.business.integral.service.IntegralSettingsService;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.lettuce.core.dynamic.annotation.Param;
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 积分设置表(IntegralSettings)表控制层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-09 10:13:20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("business/integral/integralSettings")
|
||||
public class IntegralSettingsController extends BaseController {
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Resource
|
||||
private IntegralSettingsService integralSettingsService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param integralSettings 筛选条件
|
||||
* @param pageNo 分页对象
|
||||
* @return 查询结果
|
||||
*/
|
||||
@GetMapping("queryByPage")
|
||||
public ResponseObject queryByPage(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
|
||||
@Param("integralSettings") IntegralSettings integralSettings) {
|
||||
Page page = new Page(pageNo, pageSize);
|
||||
|
||||
IPage< IntegralSettings> iPageList = this.integralSettingsService.queryByPage(page, integralSettings);
|
||||
return getSuccessResult(iPageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 单条数据
|
||||
*/
|
||||
@GetMapping("{id}")
|
||||
public ResponseObject queryById(@PathVariable("id") Integer id) {
|
||||
return getSuccessResult(this.integralSettingsService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过店铺的规则
|
||||
*
|
||||
* @return 单条数据
|
||||
*/
|
||||
@GetMapping("getSettings")
|
||||
public ResponseObject getSettings(IntegralSettings integralSettings) {
|
||||
return getSuccessResult(this.integralSettingsService.getSettings(integralSettings));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param integralSettings 实体
|
||||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping
|
||||
public ResponseObject add(@RequestBody IntegralSettings integralSettings) {
|
||||
return getSuccessResult(this.integralSettingsService.insert(integralSettings));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑数据
|
||||
*
|
||||
* @param integralSettings 实体
|
||||
* @return 编辑结果
|
||||
*/
|
||||
@PutMapping
|
||||
public ResponseObject edit(@RequestBody IntegralSettings integralSettings) {
|
||||
return getSuccessResult(this.integralSettingsService.update(integralSettings));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 删除是否成功
|
||||
*/
|
||||
@DeleteMapping
|
||||
public ResponseObject deleteById(Integer id) {
|
||||
return getSuccessResult(this.integralSettingsService.deleteById(id));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,94 @@
|
||||
package com.fuint.business.integral.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fuint.repository.model.base.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 积分设置表(IntegralSettings)实体类
|
||||
*
|
||||
* @author wangh
|
||||
* @since 2023-11-09 10:13:20
|
||||
*/
|
||||
@Data
|
||||
public class IntegralSettings extends BaseEntity {
|
||||
private static final long serialVersionUID = 584440463835012416L;
|
||||
/**
|
||||
* 积分设置ID
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 加油积分规则
|
||||
*/
|
||||
private Integer refuelPointsRules;
|
||||
/**
|
||||
* 加油积分功能
|
||||
*/
|
||||
private Integer refuelPointsFunction;
|
||||
/**
|
||||
* 加油场景类型
|
||||
*/
|
||||
private Integer refuelSceneType;
|
||||
/**
|
||||
* 加油金额类型
|
||||
*/
|
||||
private Integer refuelAmountType;
|
||||
/**
|
||||
* 加油储值参与
|
||||
*/
|
||||
private Integer refuelValueParticipation;
|
||||
/**
|
||||
* 加油场景规则
|
||||
*/
|
||||
private Integer refuelSceneRules;
|
||||
/**
|
||||
* 加油消费金额
|
||||
*/
|
||||
private Double refuelConsumptionAmount;
|
||||
/**
|
||||
* 加油积分
|
||||
*/
|
||||
private Integer refuelPoints;
|
||||
/**
|
||||
* 加油油品金额
|
||||
*/
|
||||
private Double refuelFuelAmount;
|
||||
/**
|
||||
* 加油油品升数
|
||||
*/
|
||||
private Double refuelFuelVolume;
|
||||
/**
|
||||
* 充值赠送
|
||||
*/
|
||||
private Integer rechargeGive;
|
||||
/**
|
||||
* 邀请赠送
|
||||
*/
|
||||
private Integer inviteGive;
|
||||
/**
|
||||
* 邀请赠送规则
|
||||
*/
|
||||
private String inviteGiveRules;
|
||||
/**
|
||||
* 签到功能
|
||||
*/
|
||||
private Integer signInFunction;
|
||||
/**
|
||||
* 签到规则
|
||||
*/
|
||||
private String signInRules;
|
||||
/**
|
||||
* 签到获得
|
||||
*/
|
||||
private String pointsObtained;
|
||||
/**
|
||||
* 积分规则
|
||||
*/
|
||||
private String pointsRules;
|
||||
/**
|
||||
* 店铺ID
|
||||
*/
|
||||
private Integer storeId;
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,87 @@
|
||||
package com.fuint.business.integral.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.integral.entity.IntegralSettings;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 积分设置表(IntegralSettings)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-09 10:13:20
|
||||
*/
|
||||
public interface IntegralSettingsMapper {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
IntegralSettings queryById(Integer id);
|
||||
|
||||
/**
|
||||
* 查询指定行数据
|
||||
*
|
||||
* @param integralSettings 查询条件
|
||||
* @param page 分页对象
|
||||
* @return 对象列表
|
||||
*/
|
||||
IPage<IntegralSettings> queryAllByLimit(@Param("page") Page page, @Param("integralSettings") IntegralSettings integralSettings);
|
||||
|
||||
|
||||
IntegralSettings getSettings(@Param("integralSettings") IntegralSettings integralSettings);
|
||||
/**
|
||||
* 统计总行数
|
||||
*
|
||||
* @param integralSettings 查询条件
|
||||
* @return 总行数
|
||||
*/
|
||||
long count(IntegralSettings integralSettings);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param integralSettings 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(IntegralSettings integralSettings);
|
||||
|
||||
/**
|
||||
* 批量新增数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<IntegralSettings> 实例对象列表
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insertBatch(@Param("entities") List<IntegralSettings> entities);
|
||||
|
||||
/**
|
||||
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<IntegralSettings> 实例对象列表
|
||||
* @return 影响行数
|
||||
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
|
||||
*/
|
||||
int insertOrUpdateBatch(@Param("entities") List<IntegralSettings> entities);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param integralSettings 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(IntegralSettings integralSettings);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,259 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fuint.business.integral.mapper.IntegralSettingsMapper">
|
||||
|
||||
<resultMap type="com.fuint.business.integral.entity.IntegralSettings" id="IntegralSettingsMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="refuelPointsRules" column="refuel_points_rules" jdbcType="VARCHAR"/>
|
||||
<result property="refuelPointsFunction" column="refuel_points_function" jdbcType="VARCHAR"/>
|
||||
<result property="refuelSceneType" column="refuel_scene_type" jdbcType="VARCHAR"/>
|
||||
<result property="refuelAmountType" column="refuel_amount_type" jdbcType="VARCHAR"/>
|
||||
<result property="refuelValueParticipation" column="refuel_value_participation" jdbcType="VARCHAR"/>
|
||||
<result property="refuelSceneRules" column="refuel_scene_rules" jdbcType="VARCHAR"/>
|
||||
<result property="refuelConsumptionAmount" column="refuel_consumption_amount" jdbcType="NUMERIC"/>
|
||||
<result property="refuelPoints" column="refuel_points" jdbcType="INTEGER"/>
|
||||
<result property="refuelFuelAmount" column="refuel_fuel_amount" jdbcType="NUMERIC"/>
|
||||
<result property="refuelFuelVolume" column="refuel_fuel_volume" jdbcType="NUMERIC"/>
|
||||
<result property="rechargeGive" column="recharge_give" jdbcType="INTEGER"/>
|
||||
<result property="inviteGive" column="invite_give" jdbcType="INTEGER"/>
|
||||
<result property="inviteGiveRules" column="invite_give_rules" jdbcType="VARCHAR"/>
|
||||
<result property="signInFunction" column="sign_in_function" jdbcType="VARCHAR"/>
|
||||
<result property="signInRules" column="sign_in_rules" jdbcType="VARCHAR"/>
|
||||
<result property="pointsObtained" column="points_obtained" jdbcType="VARCHAR"/>
|
||||
<result property="pointsRules" column="points_rules" jdbcType="VARCHAR"/>
|
||||
<result property="storeId" column="store_id" jdbcType="INTEGER"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="createBy" column="create_by" jdbcType="INTEGER"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="IntegralSettingsMap">
|
||||
select
|
||||
id, refuel_points_rules, refuel_points_function, refuel_scene_type, refuel_amount_type, refuel_value_participation, refuel_scene_rules, refuel_consumption_amount, refuel_points, refuel_fuel_amount, refuel_fuel_volume, recharge_give, invite_give, invite_give_rules, sign_in_function, sign_in_rules, points_obtained, points_rules, store_id, create_time, update_time, create_by, update_by
|
||||
from integral_settings
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="IntegralSettingsMap">
|
||||
select
|
||||
id, refuel_points_rules, refuel_points_function, refuel_scene_type, refuel_amount_type, refuel_value_participation, refuel_scene_rules, refuel_consumption_amount, refuel_points, refuel_fuel_amount, refuel_fuel_volume, recharge_give, invite_give, invite_give_rules, sign_in_function, sign_in_rules, points_obtained, points_rules, store_id, create_time, update_time, create_by, update_by
|
||||
from integral_settings
|
||||
<where>
|
||||
store_id = #{integralSettings.storeId}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--统计总行数-->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from integral_settings
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="refuelPointsRules != null and refuelPointsRules != ''">
|
||||
and refuel_points_rules = #{refuelPointsRules}
|
||||
</if>
|
||||
<if test="refuelPointsFunction != null and refuelPointsFunction != ''">
|
||||
and refuel_points_function = #{refuelPointsFunction}
|
||||
</if>
|
||||
<if test="refuelSceneType != null and refuelSceneType != ''">
|
||||
and refuel_scene_type = #{refuelSceneType}
|
||||
</if>
|
||||
<if test="refuelAmountType != null and refuelAmountType != ''">
|
||||
and refuel_amount_type = #{refuelAmountType}
|
||||
</if>
|
||||
<if test="refuelValueParticipation != null and refuelValueParticipation != ''">
|
||||
and refuel_value_participation = #{refuelValueParticipation}
|
||||
</if>
|
||||
<if test="refuelSceneRules != null and refuelSceneRules != ''">
|
||||
and refuel_scene_rules = #{refuelSceneRules}
|
||||
</if>
|
||||
<if test="refuelConsumptionAmount != null">
|
||||
and refuel_consumption_amount = #{refuelConsumptionAmount}
|
||||
</if>
|
||||
<if test="refuelPoints != null">
|
||||
and refuel_points = #{refuelPoints}
|
||||
</if>
|
||||
<if test="refuelFuelAmount != null">
|
||||
and refuel_fuel_amount = #{refuelFuelAmount}
|
||||
</if>
|
||||
<if test="refuelFuelVolume != null">
|
||||
and refuel_fuel_volume = #{refuelFuelVolume}
|
||||
</if>
|
||||
<if test="rechargeGive != null">
|
||||
and recharge_give = #{rechargeGive}
|
||||
</if>
|
||||
<if test="inviteGive != null">
|
||||
and invite_give = #{inviteGive}
|
||||
</if>
|
||||
<if test="inviteGiveRules != null and inviteGiveRules != ''">
|
||||
and invite_give_rules = #{inviteGiveRules}
|
||||
</if>
|
||||
<if test="signInFunction != null and signInFunction != ''">
|
||||
and sign_in_function = #{signInFunction}
|
||||
</if>
|
||||
<if test="signInRules != null and signInRules != ''">
|
||||
and sign_in_rules = #{signInRules}
|
||||
</if>
|
||||
<if test="pointsObtained != null and pointsObtained != ''">
|
||||
and points_obtained = #{pointsObtained}
|
||||
</if>
|
||||
<if test="pointsRules != null and pointsRules != ''">
|
||||
and points_rules = #{pointsRules}
|
||||
</if>
|
||||
<if test="storeId != null">
|
||||
and store_id = #{storeId}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
and create_time = #{createTime}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
and create_by = #{createBy}
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<!--查询指定行数据-->
|
||||
<select id="getSettings" resultMap="IntegralSettingsMap">
|
||||
select
|
||||
id, refuel_points_rules, refuel_points_function, refuel_scene_type, refuel_amount_type, refuel_value_participation, refuel_scene_rules, refuel_consumption_amount, refuel_points, refuel_fuel_amount, refuel_fuel_volume, recharge_give, invite_give, invite_give_rules, sign_in_function, sign_in_rules, points_obtained, points_rules, store_id, create_time, update_time, create_by, update_by
|
||||
from integral_settings
|
||||
<where>
|
||||
store_id = #{integralSettings.storeId}
|
||||
</where>
|
||||
</select>
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into integral_settings(refuel_points_rules, refuel_points_function, refuel_scene_type, refuel_amount_type, refuel_value_participation, refuel_scene_rules, refuel_consumption_amount, refuel_points, refuel_fuel_amount, refuel_fuel_volume, recharge_give, invite_give, invite_give_rules, sign_in_function, sign_in_rules, points_obtained, points_rules, store_id, create_time, update_time, create_by, update_by)
|
||||
values (#{refuelPointsRules}, #{refuelPointsFunction}, #{refuelSceneType}, #{refuelAmountType}, #{refuelValueParticipation}, #{refuelSceneRules}, #{refuelConsumptionAmount}, #{refuelPoints}, #{refuelFuelAmount}, #{refuelFuelVolume}, #{rechargeGive}, #{inviteGive}, #{inviteGiveRules}, #{signInFunction}, #{signInRules}, #{pointsObtained}, #{pointsRules}, #{storeId}, #{createTime}, #{createTime}, #{createBy}, #{updateBy})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into integral_settings(refuel_points_rules, refuel_points_function, refuel_scene_type, refuel_amount_type, refuel_value_participation, refuel_scene_rules, refuel_consumption_amount, refuel_points, refuel_fuel_amount, refuel_fuel_volume, recharge_give, invite_give, invite_give_rules, sign_in_function, sign_in_rules, points_obtained, points_rules, store_id, create_time, update_time, create_by, update_by)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.refuelPointsRules}, #{entity.refuelPointsFunction}, #{entity.refuelSceneType}, #{entity.refuelAmountType}, #{entity.refuelValueParticipation}, #{entity.refuelSceneRules}, #{entity.refuelConsumptionAmount}, #{entity.refuelPoints}, #{entity.refuelFuelAmount}, #{entity.refuelFuelVolume}, #{entity.rechargeGive}, #{entity.inviteGive}, #{entity.inviteGiveRules}, #{entity.signInFunction}, #{entity.signInRules}, #{entity.pointsObtained}, #{entity.pointsRules}, #{entity.storeId}, #{entity.createTime}, #{entity.updateTime}, #{entity.createBy}, #{entity.updateBy})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into integral_settings(refuel_points_rules, refuel_points_function, refuel_scene_type, refuel_amount_type, refuel_value_participation, refuel_scene_rules, refuel_consumption_amount, refuel_points, refuel_fuel_amount, refuel_fuel_volume, recharge_give, invite_give, invite_give_rules, sign_in_function, sign_in_rules, points_obtained, points_rules, store_id, create_time, update_time, create_by, update_by)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.refuelPointsRules}, #{entity.refuelPointsFunction}, #{entity.refuelSceneType}, #{entity.refuelAmountType}, #{entity.refuelValueParticipation}, #{entity.refuelSceneRules}, #{entity.refuelConsumptionAmount}, #{entity.refuelPoints}, #{entity.refuelFuelAmount}, #{entity.refuelFuelVolume}, #{entity.rechargeGive}, #{entity.inviteGive}, #{entity.inviteGiveRules}, #{entity.signInFunction}, #{entity.signInRules}, #{entity.pointsObtained}, #{entity.pointsRules}, #{entity.storeId}, #{entity.createTime}, #{entity.updateTime}, #{entity.createBy}, #{entity.updateBy})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
refuel_points_rules = values(refuel_points_rules),
|
||||
refuel_points_function = values(refuel_points_function),
|
||||
refuel_scene_type = values(refuel_scene_type),
|
||||
refuel_amount_type = values(refuel_amount_type),
|
||||
refuel_value_participation = values(refuel_value_participation),
|
||||
refuel_scene_rules = values(refuel_scene_rules),
|
||||
refuel_consumption_amount = values(refuel_consumption_amount),
|
||||
refuel_points = values(refuel_points),
|
||||
refuel_fuel_amount = values(refuel_fuel_amount),
|
||||
refuel_fuel_volume = values(refuel_fuel_volume),
|
||||
recharge_give = values(recharge_give),
|
||||
invite_give = values(invite_give),
|
||||
invite_give_rules = values(invite_give_rules),
|
||||
sign_in_function = values(sign_in_function),
|
||||
sign_in_rules = values(sign_in_rules),
|
||||
points_obtained = values(points_obtained),
|
||||
points_rules = values(points_rules),
|
||||
store_id = values(store_id),
|
||||
create_time = values(create_time),
|
||||
update_time = values(update_time),
|
||||
create_by = values(create_by),
|
||||
update_by = values(update_by)
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update integral_settings
|
||||
<set>
|
||||
<if test="refuelPointsRules != null and refuelPointsRules != ''">
|
||||
refuel_points_rules = #{refuelPointsRules},
|
||||
</if>
|
||||
<if test="refuelPointsFunction != null and refuelPointsFunction != ''">
|
||||
refuel_points_function = #{refuelPointsFunction},
|
||||
</if>
|
||||
<if test="refuelSceneType != null and refuelSceneType != ''">
|
||||
refuel_scene_type = #{refuelSceneType},
|
||||
</if>
|
||||
<if test="refuelAmountType != null and refuelAmountType != ''">
|
||||
refuel_amount_type = #{refuelAmountType},
|
||||
</if>
|
||||
<if test="refuelValueParticipation != null and refuelValueParticipation != ''">
|
||||
refuel_value_participation = #{refuelValueParticipation},
|
||||
</if>
|
||||
<if test="refuelSceneRules != null and refuelSceneRules != ''">
|
||||
refuel_scene_rules = #{refuelSceneRules},
|
||||
</if>
|
||||
<if test="refuelConsumptionAmount != null">
|
||||
refuel_consumption_amount = #{refuelConsumptionAmount},
|
||||
</if>
|
||||
<if test="refuelPoints != null">
|
||||
refuel_points = #{refuelPoints},
|
||||
</if>
|
||||
<if test="refuelFuelAmount != null">
|
||||
refuel_fuel_amount = #{refuelFuelAmount},
|
||||
</if>
|
||||
<if test="refuelFuelVolume != null">
|
||||
refuel_fuel_volume = #{refuelFuelVolume},
|
||||
</if>
|
||||
<if test="rechargeGive != null">
|
||||
recharge_give = #{rechargeGive},
|
||||
</if>
|
||||
<if test="inviteGive != null">
|
||||
invite_give = #{inviteGive},
|
||||
</if>
|
||||
<if test="inviteGiveRules != null and inviteGiveRules != ''">
|
||||
invite_give_rules = #{inviteGiveRules},
|
||||
</if>
|
||||
<if test="signInFunction != null and signInFunction != ''">
|
||||
sign_in_function = #{signInFunction},
|
||||
</if>
|
||||
<if test="signInRules != null and signInRules != ''">
|
||||
sign_in_rules = #{signInRules},
|
||||
</if>
|
||||
<if test="pointsObtained != null and pointsObtained != ''">
|
||||
points_obtained = #{pointsObtained},
|
||||
</if>
|
||||
<if test="pointsRules != null and pointsRules != ''">
|
||||
points_rules = #{pointsRules},
|
||||
</if>
|
||||
<if test="storeId != null">
|
||||
store_id = #{storeId},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
create_by = #{createBy},
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
update_by = #{updateBy},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete from integral_settings where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
@ -24,6 +24,7 @@ public interface IntegralGiftService {
|
||||
*/
|
||||
IntegralGift queryById(Integer id);
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
|
@ -0,0 +1,66 @@
|
||||
package com.fuint.business.integral.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.integral.entity.IntegralGift;
|
||||
import com.fuint.business.integral.entity.IntegralSettings;
|
||||
import io.lettuce.core.dynamic.annotation.Param;
|
||||
|
||||
|
||||
/**
|
||||
* 积分设置表(IntegralSettings)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-09 10:13:20
|
||||
*/
|
||||
public interface IntegralSettingsService {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
IntegralSettings queryById(Integer id);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param integralSettings 筛选条件
|
||||
* @param page 分页对象
|
||||
* @return 查询结果
|
||||
*/
|
||||
IPage<IntegralSettings> queryByPage(@Param("page") Page page, IntegralSettings integralSettings);
|
||||
|
||||
/**
|
||||
* 查询店铺的数据
|
||||
*
|
||||
* @return 实例对象
|
||||
*/
|
||||
IntegralSettings getSettings(IntegralSettings integralSettings);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param integralSettings 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
IntegralSettings insert(IntegralSettings integralSettings);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param integralSettings 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
IntegralSettings update(IntegralSettings integralSettings);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Integer id);
|
||||
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
package com.fuint.business.integral.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.integral.entity.IntegralGift;
|
||||
import com.fuint.business.integral.entity.IntegralGiftCategory;
|
||||
import com.fuint.business.integral.mapper.IntegralGiftMapper;
|
||||
import com.fuint.business.integral.service.IntegralGiftService;
|
||||
import com.fuint.business.integral.vo.IntegralGiftVO;
|
||||
@ -10,9 +10,6 @@ import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@ -38,6 +35,8 @@ public class IntegralGiftServiceImpl implements IntegralGiftService {
|
||||
return this.integralGiftDao.queryById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
@ -46,7 +45,7 @@ public class IntegralGiftServiceImpl implements IntegralGiftService {
|
||||
* @return 查询结果
|
||||
*/
|
||||
@Override
|
||||
public IPage<IntegralGiftVO> queryByPage(@Param("page") com.baomidou.mybatisplus.extension.plugins.pagination.Page page, @Param("integralGiftCategory") IntegralGift integralGift) {
|
||||
public IPage<IntegralGiftVO> queryByPage(@Param("page") Page page, @Param("integralGiftCategory") IntegralGift integralGift) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
integralGift.setStoreId(nowAccountInfo.getStoreId());
|
||||
return integralGiftDao.queryAllByLimit(page, integralGift);
|
||||
|
@ -0,0 +1,106 @@
|
||||
package com.fuint.business.integral.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.integral.entity.IntegralGift;
|
||||
import com.fuint.business.integral.entity.IntegralSettings;
|
||||
import com.fuint.business.integral.mapper.IntegralSettingsMapper;
|
||||
import com.fuint.business.integral.service.IntegralSettingsService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import io.lettuce.core.dynamic.annotation.Param;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 积分设置表(IntegralSettings)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-09 10:13:20
|
||||
*/
|
||||
@Service("integralSettingsService")
|
||||
public class IntegralSettingsServiceImpl implements IntegralSettingsService {
|
||||
@Resource
|
||||
private IntegralSettingsMapper integralSettingsMapper;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public IntegralSettings queryById(Integer id) {
|
||||
return this.integralSettingsMapper.queryById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param integralSettings 筛选条件
|
||||
* @param page 分页对象
|
||||
* @return 查询结果
|
||||
*/
|
||||
@Override
|
||||
public IPage<IntegralSettings> queryByPage(@Param("page") Page page, IntegralSettings integralSettings) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
integralSettings.setStoreId(nowAccountInfo.getStoreId());
|
||||
return integralSettingsMapper.queryAllByLimit(page,integralSettings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IntegralSettings getSettings(IntegralSettings integralSettings) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
integralSettings.setStoreId(nowAccountInfo.getStoreId());
|
||||
IntegralSettings settings = this.integralSettingsMapper.getSettings(integralSettings);
|
||||
if (settings != null) {
|
||||
return settings;
|
||||
}
|
||||
insert(integralSettings);
|
||||
return integralSettings;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param integralSettings 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public IntegralSettings insert(IntegralSettings integralSettings) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
integralSettings.setStoreId(nowAccountInfo.getStoreId());
|
||||
integralSettings.setCreateBy(nowAccountInfo.getStaffId().toString());
|
||||
|
||||
this.integralSettingsMapper.insert(integralSettings);
|
||||
return integralSettings;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param integralSettings 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public IntegralSettings update(IntegralSettings integralSettings) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
integralSettings.setUpdateBy(nowAccountInfo.getStaffId().toString());
|
||||
this.integralSettingsMapper.update(integralSettings);
|
||||
return this.queryById(integralSettings.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Integer id) {
|
||||
return this.integralSettingsMapper.deleteById(id) > 0;
|
||||
}
|
||||
}
|
@ -0,0 +1,90 @@
|
||||
package com.fuint.business.userManager.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.userManager.entity.MtUserExpressAddress;
|
||||
import com.fuint.business.userManager.service.MtUserExpressAddressService;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import io.lettuce.core.dynamic.annotation.Param;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 会员快递信息表(MtUserExpressAddress)表控制层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-09 09:31:12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/business/userManager/mtUserExpressAddress")
|
||||
public class MtUserExpressAddressController extends BaseController {
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Resource
|
||||
private MtUserExpressAddressService mtUserExpressAddressService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param mtUserExpressAddress 筛选条件
|
||||
* @param pageNo 分页对象
|
||||
* @return 查询结果
|
||||
*/
|
||||
@GetMapping("queryByPage")
|
||||
public ResponseObject queryByPage(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
|
||||
@Param("mtUserExpressAddress") MtUserExpressAddress mtUserExpressAddress) {
|
||||
Page page = new Page(pageNo, pageSize);
|
||||
IPage<MtUserExpressAddress> ipageList = this.mtUserExpressAddressService.queryByPage(page, mtUserExpressAddress);
|
||||
return getSuccessResult(ipageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 单条数据
|
||||
*/
|
||||
@GetMapping("{id}")
|
||||
public ResponseObject queryById(@PathVariable("id") Integer id) {
|
||||
return getSuccessResult(this.mtUserExpressAddressService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param mtUserExpressAddress 实体
|
||||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping
|
||||
public ResponseObject add(@RequestBody MtUserExpressAddress mtUserExpressAddress) {
|
||||
return getSuccessResult(this.mtUserExpressAddressService.insert(mtUserExpressAddress));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑数据
|
||||
*
|
||||
* @param mtUserExpressAddress 实体
|
||||
* @return 编辑结果
|
||||
*/
|
||||
@PutMapping
|
||||
public ResponseObject edit(@RequestBody MtUserExpressAddress mtUserExpressAddress) {
|
||||
return getSuccessResult(this.mtUserExpressAddressService.update(mtUserExpressAddress));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 删除是否成功
|
||||
*/
|
||||
@DeleteMapping
|
||||
public ResponseObject deleteById(Integer id) {
|
||||
return getSuccessResult(this.mtUserExpressAddressService.deleteById(id));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,44 @@
|
||||
package com.fuint.business.userManager.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fuint.repository.model.base.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 会员快递信息表(MtUserExpressAddress)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-09 09:31:12
|
||||
*/
|
||||
@Data
|
||||
public class MtUserExpressAddress extends BaseEntity {
|
||||
private static final long serialVersionUID = -79175411933260284L;
|
||||
|
||||
private Integer id;
|
||||
/**
|
||||
* 关联用户ID
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 名字
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 联系方式
|
||||
*/
|
||||
private String mobile;
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 是否默认,0表示否,1表示是
|
||||
*/
|
||||
private String ifDefault;
|
||||
/**
|
||||
* 店铺ID
|
||||
*/
|
||||
private Integer storeId;
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,85 @@
|
||||
package com.fuint.business.userManager.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.userManager.entity.MtUserExpressAddress;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员快递信息表(MtUserExpressAddress)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-09 09:31:12
|
||||
*/
|
||||
public interface MtUserExpressAddressMapper {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
MtUserExpressAddress queryById(Integer id);
|
||||
|
||||
/**
|
||||
* 查询指定行数据
|
||||
*
|
||||
* @param mtUserExpressAddress 查询条件
|
||||
* @param page 分页对象
|
||||
* @return 对象列表
|
||||
*/
|
||||
IPage<MtUserExpressAddress> queryAllByLimit(@Param("page") Page page,@Param("mtUserExpressAddress") MtUserExpressAddress mtUserExpressAddress);
|
||||
|
||||
/**
|
||||
* 统计总行数
|
||||
*
|
||||
* @param mtUserExpressAddress 查询条件
|
||||
* @return 总行数
|
||||
*/
|
||||
long count(MtUserExpressAddress mtUserExpressAddress);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param mtUserExpressAddress 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(MtUserExpressAddress mtUserExpressAddress);
|
||||
|
||||
/**
|
||||
* 批量新增数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<MtUserExpressAddress> 实例对象列表
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insertBatch(@Param("entities") List<MtUserExpressAddress> entities);
|
||||
|
||||
/**
|
||||
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<MtUserExpressAddress> 实例对象列表
|
||||
* @return 影响行数
|
||||
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
|
||||
*/
|
||||
int insertOrUpdateBatch(@Param("entities") List<MtUserExpressAddress> entities);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param mtUserExpressAddress 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(MtUserExpressAddress mtUserExpressAddress);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,167 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fuint.business.userManager.mapper.MtUserExpressAddressMapper">
|
||||
|
||||
<resultMap type="com.fuint.business.userManager.entity.MtUserExpressAddress" id="MtUserExpressAddressMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="userId" column="user_id" jdbcType="INTEGER"/>
|
||||
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||
<result property="mobile" column="mobile" jdbcType="VARCHAR"/>
|
||||
<result property="address" column="address" jdbcType="VARCHAR"/>
|
||||
<result property="ifDefault" column="if_default" jdbcType="VARCHAR"/>
|
||||
<result property="storeId" column="store_id" jdbcType="INTEGER"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="createBy" column="create_by" jdbcType="INTEGER"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="MtUserExpressAddressMap">
|
||||
select
|
||||
id, user_id, name, mobile, address, if_default, store_id, create_time, update_time, create_by, update_by
|
||||
from mt_user_express_address
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="MtUserExpressAddressMap">
|
||||
select
|
||||
id, user_id, name, mobile, address, if_default, store_id, create_time, update_time, create_by, update_by
|
||||
from mt_user_express_address
|
||||
<where>
|
||||
store_id = #{storeId}
|
||||
<if test="mtUserExpressAddress.id != null">
|
||||
and id = #{mtUserExpressAddress.id}
|
||||
</if>
|
||||
<if test="mtUserExpressAddress.userId != null">
|
||||
and user_id = #{mtUserExpressAddressuserId}
|
||||
</if>
|
||||
<if test="mtUserExpressAddress.name != null and mtUserExpressAddress.name != ''">
|
||||
and name = #{mtUserExpressAddress.name}
|
||||
</if>
|
||||
<if test="mtUserExpressAddress.mobile != null and mtUserExpressAddress.mobile != ''">
|
||||
and mobile = #{mtUserExpressAddress.mobile}
|
||||
</if>
|
||||
<if test="mtUserExpressAddress.ifDefault != null and mtUserExpressAddress.ifDefault != ''">
|
||||
and if_default = #{mtUserExpressAddress.ifDefault}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--统计总行数-->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from mt_user_express_address
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
and user_id = #{userId}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
and name = #{name}
|
||||
</if>
|
||||
<if test="mobile != null and mobile != ''">
|
||||
and mobile = #{mobile}
|
||||
</if>
|
||||
<if test="address != null and address != ''">
|
||||
and address = #{address}
|
||||
</if>
|
||||
<if test="ifDefault != null and ifDefault != ''">
|
||||
and if_default = #{ifDefault}
|
||||
</if>
|
||||
<if test="storeId != null">
|
||||
and store_id = #{storeId}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
and create_time = #{createTime}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
and create_by = #{createBy}
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mt_user_express_address(user_id, name, mobile, address, if_default, store_id, create_time, update_time, create_by, update_by)
|
||||
values (#{userId}, #{name}, #{mobile}, #{address}, #{ifDefault}, #{storeId}, #{createTime}, #{createTime}, #{createBy}, #{updateBy})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mt_user_express_address(user_id, name, mobile, address, if_default, store_id, create_time, update_time, create_by, update_by)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.userId}, #{entity.name}, #{entity.mobile}, #{entity.address}, #{entity.ifDefault}, #{entity.storeId}, #{entity.createTime}, #{entity.updateTime}, #{entity.createBy}, #{entity.updateBy})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mt_user_express_address(user_id, name, mobile, address, if_default, store_id, create_time, update_time, create_by, update_by)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.userId}, #{entity.name}, #{entity.mobile}, #{entity.address}, #{entity.ifDefault}, #{entity.storeId}, #{entity.createTime}, #{entity.updateTime}, #{entity.createBy}, #{entity.updateBy})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
user_id = values(user_id),
|
||||
name = values(name),
|
||||
mobile = values(mobile),
|
||||
address = values(address),
|
||||
if_default = values(if_default),
|
||||
store_id = values(store_id),
|
||||
create_time = values(create_time),
|
||||
update_time = values(update_time),
|
||||
create_by = values(create_by),
|
||||
update_by = values(update_by)
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update mt_user_express_address
|
||||
<set>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId},
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
name = #{name},
|
||||
</if>
|
||||
<if test="mobile != null and mobile != ''">
|
||||
mobile = #{mobile},
|
||||
</if>
|
||||
<if test="address != null and address != ''">
|
||||
address = #{address},
|
||||
</if>
|
||||
<if test="ifDefault != null and ifDefault != ''">
|
||||
if_default = #{ifDefault},
|
||||
</if>
|
||||
<if test="storeId != null">
|
||||
store_id = #{storeId},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = NOW(),
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
create_by = #{createBy},
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
update_by = #{updateBy},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete from mt_user_express_address where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
@ -0,0 +1,57 @@
|
||||
package com.fuint.business.userManager.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.userManager.entity.MtUserExpressAddress;
|
||||
import io.lettuce.core.dynamic.annotation.Param;
|
||||
|
||||
/**
|
||||
* 会员快递信息表(MtUserExpressAddress)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-09 09:31:33
|
||||
*/
|
||||
public interface MtUserExpressAddressService {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
MtUserExpressAddress queryById(Integer id);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param mtUserExpressAddress 筛选条件
|
||||
* @param page 分页对象
|
||||
* @return 查询结果
|
||||
*/
|
||||
IPage<MtUserExpressAddress> queryByPage(@Param("page") Page page, MtUserExpressAddress mtUserExpressAddress);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param mtUserExpressAddress 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
MtUserExpressAddress insert(MtUserExpressAddress mtUserExpressAddress);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param mtUserExpressAddress 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
MtUserExpressAddress update(MtUserExpressAddress mtUserExpressAddress);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Integer id);
|
||||
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
package com.fuint.business.userManager.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.userManager.entity.MtUserExpressAddress;
|
||||
import com.fuint.business.userManager.mapper.MtUserExpressAddressMapper;
|
||||
import com.fuint.business.userManager.service.MtUserExpressAddressService;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import io.lettuce.core.dynamic.annotation.Param;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 会员快递信息表(MtUserExpressAddress)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-09 09:31:33
|
||||
*/
|
||||
@Service("mtUserExpressAddressService")
|
||||
public class MtUserExpressAddressServiceImpl implements MtUserExpressAddressService {
|
||||
@Resource
|
||||
private MtUserExpressAddressMapper mtUserExpressAddressMapper;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public MtUserExpressAddress queryById(Integer id) {
|
||||
return this.mtUserExpressAddressMapper.queryById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param mtUserExpressAddress 筛选条件
|
||||
* @param page 分页对象
|
||||
* @return 查询结果
|
||||
*/
|
||||
@Override
|
||||
public IPage<MtUserExpressAddress> queryByPage(@Param("page") Page page, MtUserExpressAddress mtUserExpressAddress) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
mtUserExpressAddress.setStoreId(nowAccountInfo.getStoreId());
|
||||
return mtUserExpressAddressMapper.queryAllByLimit(page,mtUserExpressAddress);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param mtUserExpressAddress 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public MtUserExpressAddress insert(MtUserExpressAddress mtUserExpressAddress) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
mtUserExpressAddress.setStoreId(nowAccountInfo.getStoreId());
|
||||
mtUserExpressAddress.setCreateBy(nowAccountInfo.getStaffId().toString());
|
||||
this.mtUserExpressAddressMapper.insert(mtUserExpressAddress);
|
||||
return mtUserExpressAddress;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param mtUserExpressAddress 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public MtUserExpressAddress update(MtUserExpressAddress mtUserExpressAddress) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
mtUserExpressAddress.setUpdateBy(nowAccountInfo.getStaffId().toString());
|
||||
|
||||
this.mtUserExpressAddressMapper.update(mtUserExpressAddress);
|
||||
return this.queryById(mtUserExpressAddress.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Integer id) {
|
||||
return this.mtUserExpressAddressMapper.deleteById(id) > 0;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user