From c9ab6b7f3f2297aa964d5489d82dfa3d13311e49 Mon Sep 17 00:00:00 2001
From: cun-nan <19819293608@163.com>
Date: Thu, 5 Sep 2024 14:37:36 +0800
Subject: [PATCH] =?UTF-8?q?=E8=90=A5=E9=94=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../openCardGift/api/separate.js | 2 +-
.../EventMarketing/openCardGift/separate.vue | 234 +++++++++++++-----
.../controller/ActivePriceRuleController.java | 4 +-
.../activePrice/entity/ActivePriceRule.java | 4 +-
.../mapper/xml/ActivePriceRuleMapper.xml | 12 +-
.../impl/ActivePriceRuleServiceImpl.java | 88 +++++--
.../activePrice/vo/ActivePriceRuleRespVO.java | 8 +-
7 files changed, 259 insertions(+), 93 deletions(-)
diff --git a/fuintAdmin/src/views/EventMarketing/openCardGift/api/separate.js b/fuintAdmin/src/views/EventMarketing/openCardGift/api/separate.js
index c1ed01385..067358135 100644
--- a/fuintAdmin/src/views/EventMarketing/openCardGift/api/separate.js
+++ b/fuintAdmin/src/views/EventMarketing/openCardGift/api/separate.js
@@ -79,7 +79,7 @@ export function editPriceRule(data) {
// 删除活动规则
export function deletePriceRule(id) {
return request({
- url: '/business/activePriceRule/del'+id,
+ url: '/business/activePriceRule/del/'+id,
method: 'delete',
})
}
diff --git a/fuintAdmin/src/views/EventMarketing/openCardGift/separate.vue b/fuintAdmin/src/views/EventMarketing/openCardGift/separate.vue
index 345c2ac29..6364cc64d 100644
--- a/fuintAdmin/src/views/EventMarketing/openCardGift/separate.vue
+++ b/fuintAdmin/src/views/EventMarketing/openCardGift/separate.vue
@@ -101,7 +101,7 @@
活动规则
- 新增活动规则
+ 新增活动规则
@@ -127,7 +127,7 @@
@@ -139,7 +139,7 @@
@@ -173,12 +173,12 @@
未生效
使用中
- 已生效
+ 已失效
@@ -194,13 +194,14 @@
修改
删除
@@ -210,8 +211,7 @@
+ width="48%">
@@ -295,19 +295,21 @@
-
-
-
-
-
-
-
+ width="60%">
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
到
-
-
+
+
-
-
+
+
到
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+ 至
+
+
+
+
+
+
@@ -418,31 +431,33 @@
至
-
-
+
+
-
- 取消
- 保存
+
+ 取消
+ 保存
@@ -457,7 +472,7 @@ import {
getID,
updateActivePrice,
deleteList,
- getPriceRuleList
+ getPriceRuleList, addPriceRule, editPriceRule, getPriceRule, deletePriceRule
} from "./api/separate";
import {oilNumberList1} from "@/api/order/oilnumgun";
import {listUserGrade} from "@/api/staff/user/usergrade";
@@ -509,23 +524,111 @@ export default {
weekList: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"],
weekDay: [],
monthDay: [],
- userLabelList:[],
- userGradeList:[]
+ userLabelList: [],
+ userGradeList: [],
+ timeShareList: [],
+ ruleForm1: {
+ activeType: 1,
+ timeType: 0,
+ paymentType: []
+ }
}
},
created() {
this.getList()
this.getRuleList()
- this.listUserGrade()
- this.getUserLabelList()
},
methods: {
+ // 重置活动规则
+ resetRule(){
+ this.ruleForm1 = {
+ activeType: 1,
+ timeType: 0,
+ paymentType: []
+ }
+ this.tindex3 = 0
+ this.weekDay = []
+ this.monthDay = []
+ },
+ // 删除活动规则
+ deleteRule(data){
+ deletePriceRule(data.id).then(res => {
+ this.$message.success("删除成功")
+ this.getRuleList()
+ })
+ },
+ // 修改活动规则
+ editRule(data) {
+ this.resetRule()
+ getPriceRule(data.id).then(res => {
+
+ this.getTimeShareList()
+ this.listUserGrade()
+ this.getUserLabelList()
+ this.showDialogVisible = true
+
+ if (res.data){
+ this.ruleForm1 = res.data
+ if (res.data.paymentType) this.ruleForm1.paymentType = res.data.paymentType.split(",")
+ if (res.data.babelIds) this.ruleForm1.babelIds = res.data.babelIds.split(",")
+
+ if (res.data.timeSlots){
+ if (res.data.timeType == "0") {
+ this.weekDay = this.ruleForm1.timeSlots.split(",")
+ } else if (this.ruleForm1.timeType == "1") {
+ this.monthDay = this.ruleForm1.timeSlots.split(",")
+ }
+ }
+ }
+ })
+ },
+ // 提交活动规则
+ submitRuleForm() {
+ this.$refs["ruleForm1"].validate((valid) => {
+ if (valid) {
+ if (this.ruleForm1.paymentType) this.ruleForm1.paymentType = this.ruleForm1.paymentType.toString()
+ if (this.ruleForm1.babelIds) this.ruleForm1.babelIds = this.ruleForm1.babelIds.toString()
+ if (this.ruleForm1.timeType == "0") {
+ this.ruleForm1.timeSlots = this.weekDay.toString()
+ } else if (this.ruleForm1.timeType == "1") {
+ this.ruleForm1.timeSlots = this.monthDay.toString()
+ }
+
+ if (this.ruleForm1.id) {
+ editPriceRule(this.ruleForm1).then(res => {
+ this.$message.success("修改成功")
+ this.getRuleList()
+ this.showDialogVisible = false
+ })
+ } else {
+ addPriceRule(this.ruleForm1).then(res => {
+ this.$message.success("添加成功")
+ this.getRuleList()
+ this.showDialogVisible = false
+ })
+ }
+ }
+ })
+ },
+ // 添加活动规则
+ addActiveRule() {
+ this.resetRule()
+ this.getTimeShareList()
+ this.listUserGrade()
+ this.getUserLabelList()
+ this.showDialogVisible = true
+ },
+ // 查询分时优惠列表信息
+ getTimeShareList() {
+ getRequestList({pageNo: 1, pageSize: 10000}).then(res => {
+ this.timeShareList = res.data.records
+ })
+ },
// 会员等级
listUserGrade() {
listUserGrade({page: 1, pageSize: 1000}).then(res => {
if (res.code == 200) {
this.userGradeList = res.data.records
- console.log(this.userGradeList)
}
})
},
@@ -537,7 +640,7 @@ export default {
},
Typeindex3(index) {
this.tindex3 = index
- this.ruleForm.timeType = index
+ this.ruleForm1.timeType = index
this.weekDay = []
this.monthDay = []
},
@@ -730,6 +833,7 @@ export default {
font-size: 14px;
color: #333333;
}
+
.d-s {
display: flex;
align-items: center;
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activePrice/controller/ActivePriceRuleController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activePrice/controller/ActivePriceRuleController.java
index 61bf8040b..b5624feba 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activePrice/controller/ActivePriceRuleController.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activePrice/controller/ActivePriceRuleController.java
@@ -80,10 +80,10 @@ public class ActivePriceRuleController extends BaseController {
* @param saveVO ActivePriceRuleSaveVO实体
* @return com.fuint.framework.web.ResponseObject
**/
- @PostMapping("/update")
+ @PutMapping("/update")
public ResponseObject update(@RequestBody ActivePriceRuleSaveVO saveVO) {
try {
- activePriceRuleService.saveActivePriceRule(true, saveVO);
+ activePriceRuleService.saveActivePriceRule(false, saveVO);
} catch (BusinessCheckException businessCheckException) {
return getFailureResult(businessCheckException.getMessage());
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activePrice/entity/ActivePriceRule.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activePrice/entity/ActivePriceRule.java
index 8f79b52ef..99046cb5d 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activePrice/entity/ActivePriceRule.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activePrice/entity/ActivePriceRule.java
@@ -37,8 +37,10 @@ public class ActivePriceRule extends Model {
/** 会员标签ids,多个以英文逗号隔开 */
private String babelIds ;
/** 生效起始时间 */
+ @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
private Date activeStartTime ;
/** 生效截止时间 */
+ @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
private Date activeEndTime ;
/** 适用实收金额下限 */
private Double moneyMin ;
@@ -62,7 +64,7 @@ public class ActivePriceRule extends Model {
private Integer dayLimitNum ;
/** 每人累计参与限制次数 */
private Integer limitNum ;
- /** 状态:0未生效;1使用中;2已生效 */
+ /** 状态:0未生效;1使用中;2已失效 */
private String status ;
/** 创建人 */
private String createBy ;
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activePrice/mapper/xml/ActivePriceRuleMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activePrice/mapper/xml/ActivePriceRuleMapper.xml
index edf6c1396..88145e329 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activePrice/mapper/xml/ActivePriceRuleMapper.xml
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activePrice/mapper/xml/ActivePriceRuleMapper.xml
@@ -14,13 +14,15 @@
ofType="com.fuint.business.userManager.entity.UserLabel"/>
-