This commit is contained in:
PQZ 2024-09-09 22:29:15 +08:00
parent 211e67a8f6
commit 6c60f63089
10 changed files with 141 additions and 37 deletions

View File

@ -11,7 +11,7 @@ VUE_APP_BASE_API = '/dev-api'
VUE_APP_PUBLIC_PATH = '/' VUE_APP_PUBLIC_PATH = '/'
# 后端接口地址 # 后端接口地址
VUE_APP_SERVER_URL = 'http://192.168.31.178:8080/' VUE_APP_SERVER_URL = 'http://127.0.0.1:8080/'
# http://192.168.0.121:8080/ # http://192.168.0.121:8080/

View File

@ -0,0 +1,10 @@
import request from "@/utils/request";
// 查询油罐列表
export function pageActive(data) {
return request({
url: 'business/marketingActivity/activeApplet/page',
method: 'get',
params: data
})
}

View File

@ -233,7 +233,7 @@
width="55"> width="55">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="name" prop="type"
label="活动类型" label="活动类型"
> >
</el-table-column> </el-table-column>
@ -243,32 +243,27 @@
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="name" prop="discountActiveDescribe"
label="活动内容" label="活动内容"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="date" prop="time"
label="活动时间" label="活动时间"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="name" prop="adaptUserType"
label="适用会员等级" label="适用会员等级"
> >
</el-table-column> </el-table-column>
<el-table-column
prop="name"
label="活动详情"
>
</el-table-column>
<el-table-column <el-table-column
prop="name" prop="name"
label="已领数量" label="已领数量"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="name" prop="activeStatus"
label="状态" label="状态"
> >
</el-table-column> </el-table-column>
@ -282,10 +277,6 @@
label="创建时间" label="创建时间"
> >
</el-table-column> </el-table-column>
<el-table-column
prop="address"
label="地址">
</el-table-column>
<el-table-column prop="date" label="操作" align="center" > <el-table-column prop="date" label="操作" align="center" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -306,6 +297,13 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div> </div>
<div class="bai-box" v-show="tabindex == 2"></div> <div class="bai-box" v-show="tabindex == 2"></div>
</div> </div>
@ -390,6 +388,7 @@ import activeNewlyweds from '../activeNewlyweds/index'
import activeConsumption from '../activeConsumption/index' import activeConsumption from '../activeConsumption/index'
import activeFullminus from '../activeFullminus/index' import activeFullminus from '../activeFullminus/index'
import activeRecommend from '../activeRecommend/index' import activeRecommend from '../activeRecommend/index'
import {pageActive} from "@/api/active/active";
export default { export default {
name: 'Exchange', name: 'Exchange',
data() { data() {
@ -399,7 +398,7 @@ export default {
tabindex:0, tabindex:0,
options: [{ options: [{
value: '选项1', value: '选项1',
label: '黄金糕' label: '黄金糕1'
}, { }, {
value: '选项2', value: '选项2',
label: '双皮奶' label: '双皮奶'
@ -434,18 +433,33 @@ export default {
"营销活动", "营销活动",
"当前活动列表", "当前活动列表",
"历史活动列表" "历史活动列表"
] ],
queryParams:{
page:0,
pageSize:10
},
total:0
} }
}, },
created() { created() {
this.getList();
}, },
components:{ components:{
activeNewlyweds,activeConsumption,activeDiscount,activeFullminus,activeRecommend activeNewlyweds,activeConsumption,activeDiscount,activeFullminus,activeRecommend
}, },
methods: { methods: {
/**
* 查询列表
*/
getList() {
pageActive(this.queryParams).then(res=>{
this.tableData = res.data.records
this.total = res.data.total
})
},
routerPush(id){ routerPush(id){
this.$router.push({ this.$router.push({
path: '/EventMarketing/openCardGift/index', path: '/EventMarketing/openCardGift/index',

View File

@ -1,11 +1,15 @@
package com.fuint.business.marketingActivity.activeApplet.controller; package com.fuint.business.marketingActivity.activeApplet.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.activeApplet.entity.ActiveApplet; import com.fuint.business.marketingActivity.activeApplet.entity.ActiveApplet;
import com.fuint.business.marketingActivity.activeApplet.service.ActiveAppletService; import com.fuint.business.marketingActivity.activeApplet.service.ActiveAppletService;
import com.fuint.business.marketingActivity.activePrice.vo.ActivePriceReqVO;
import com.fuint.business.marketingActivity.activePrice.vo.ActivePriceRespVO;
import com.fuint.business.setting.entity.SysLog; import com.fuint.business.setting.entity.SysLog;
import com.fuint.business.setting.service.SysLogService; import com.fuint.business.setting.service.SysLogService;
import com.fuint.framework.web.BaseController; import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject; import com.fuint.framework.web.ResponseObject;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -41,6 +45,24 @@ public class ActiveAppletController extends BaseController {
return getSuccessResult(this.activeAppletService.applet(activeApplet)); return getSuccessResult(this.activeAppletService.applet(activeApplet));
} }
/**
* 分页查询主表信息
*
* @param pageNo 分页参数
* @param pageSize 分页参数
* @param activeApplet ActiveApplet实体
* @return com.fuint.framework.web.ResponseObject
* @author PQZ
* @date 21:36 2024/9/9
**/
@GetMapping("/page")
public ResponseObject page(@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
@Param("actPriceReq") ActiveApplet activeApplet) {
Page<ActiveApplet> pageActive = new Page<>(page, pageSize);
return getSuccessResult(activeAppletService.pageActive(pageActive,activeApplet));
}
/** /**
* 查询所有数据 * 查询所有数据
* *
@ -53,7 +75,6 @@ public class ActiveAppletController extends BaseController {
} }
/** /**
* 通过主键查询单条数据 * 通过主键查询单条数据
* *
@ -74,12 +95,13 @@ public class ActiveAppletController extends BaseController {
@PostMapping @PostMapping
public ResponseObject insert(@RequestBody ActiveApplet activeApplet) { public ResponseObject insert(@RequestBody ActiveApplet activeApplet) {
try { try {
SysLog sysLog =new SysLog(); SysLog sysLog = new SysLog();
sysLog.setSystemName("2"); sysLog.setSystemName("2");
sysLog.setMoudle("营销中心"); sysLog.setMoudle("营销中心");
sysLog.setContent("新增油站活动"); sysLog.setContent("新增油站活动");
sysLogService.saveVo(sysLog); sysLogService.saveVo(sysLog);
}catch (Exception ignored){} } catch (Exception ignored) {
}
return getSuccessResult(this.activeAppletService.save(activeApplet)); return getSuccessResult(this.activeAppletService.save(activeApplet));
} }
@ -93,12 +115,13 @@ public class ActiveAppletController extends BaseController {
@PutMapping @PutMapping
public ResponseObject update(@RequestBody ActiveApplet activeApplet) { public ResponseObject update(@RequestBody ActiveApplet activeApplet) {
try { try {
SysLog sysLog =new SysLog(); SysLog sysLog = new SysLog();
sysLog.setSystemName("2"); sysLog.setSystemName("2");
sysLog.setMoudle("营销中心"); sysLog.setMoudle("营销中心");
sysLog.setContent("更新油站活动"); sysLog.setContent("更新油站活动");
sysLogService.saveVo(sysLog); sysLogService.saveVo(sysLog);
}catch (Exception ignored){} } catch (Exception ignored) {
}
return getSuccessResult(this.activeAppletService.updateById(activeApplet)); return getSuccessResult(this.activeAppletService.updateById(activeApplet));
} }
@ -112,12 +135,13 @@ public class ActiveAppletController extends BaseController {
@DeleteMapping @DeleteMapping
public ResponseObject delete(@RequestParam("idList") List<Long> idList) { public ResponseObject delete(@RequestParam("idList") List<Long> idList) {
try { try {
SysLog sysLog =new SysLog(); SysLog sysLog = new SysLog();
sysLog.setSystemName("2"); sysLog.setSystemName("2");
sysLog.setMoudle("营销中心"); sysLog.setMoudle("营销中心");
sysLog.setContent("删除油站活动"); sysLog.setContent("删除油站活动");
sysLogService.saveVo(sysLog); sysLogService.saveVo(sysLog);
}catch (Exception ignored){} } catch (Exception ignored) {
}
return getSuccessResult(this.activeAppletService.removeByIds(idList)); return getSuccessResult(this.activeAppletService.removeByIds(idList));
} }

View File

@ -1,7 +1,11 @@
package com.fuint.business.marketingActivity.activeApplet.mapper; package com.fuint.business.marketingActivity.activeApplet.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.activeApplet.entity.ActiveApplet; import com.fuint.business.marketingActivity.activeApplet.entity.ActiveApplet;
import com.fuint.business.marketingActivity.activePrice.vo.ActivePriceReqVO;
import com.fuint.business.marketingActivity.activePrice.vo.ActivePriceRespVO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -16,6 +20,17 @@ public interface ActiveAppletMapper extends BaseMapper<ActiveApplet> {
List<ActiveApplet> selectApplet(@Param("activeApplet") ActiveApplet activeApplet); List<ActiveApplet> selectApplet(@Param("activeApplet") ActiveApplet activeApplet);
List<ActiveApplet> appletActiveByType(@Param("activeApplet")ActiveApplet activeApplet); List<ActiveApplet> appletActiveByType(@Param("activeApplet") ActiveApplet activeApplet);
/**
* 分页查询活动主表信息
*
* @param page 分页参数
* @param entity 实体
* @return com.baomidou.mybatisplus.core.metadata.IPage<com.fuint.business.marketingActivity.activeApplet.entity.ActiveApplet>
* @author PQZ
* @date 21:39 2024/9/9
**/
IPage<ActiveApplet> pageActive(@Param("page") Page<ActiveApplet> page, @Param("entity") ActiveApplet entity);
} }

View File

@ -26,5 +26,20 @@
and store_id = #{activeApplet.storeId} and isonline = '0' and store_id = #{activeApplet.storeId} and isonline = '0'
ORDER BY create_time desc ORDER BY create_time desc
</select> </select>
<select id="pageActive" resultType="com.fuint.business.marketingActivity.activeApplet.entity.ActiveApplet">
SELECT
*
FROM
active_applet
<where>
<if test="entity.name != null and entity.name != ''">
AND name like concat('%', #{entity.name}, '%')
</if>
<if test="entity.name != null and entity.name != ''">
AND type = #{entity.type}
</if>
</where>
ORDER BY create_time desc
</select>
</mapper> </mapper>

View File

@ -1,7 +1,11 @@
package com.fuint.business.marketingActivity.activeApplet.service; package com.fuint.business.marketingActivity.activeApplet.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.marketingActivity.activeApplet.entity.ActiveApplet; import com.fuint.business.marketingActivity.activeApplet.entity.ActiveApplet;
import com.fuint.business.marketingActivity.activePrice.vo.ActivePriceReqVO;
import com.fuint.business.marketingActivity.activePrice.vo.ActivePriceRespVO;
import java.util.List; import java.util.List;
@ -14,8 +18,20 @@ import java.util.List;
public interface ActiveAppletService extends IService<ActiveApplet> { public interface ActiveAppletService extends IService<ActiveApplet> {
List<ActiveApplet> applet(ActiveApplet activeApplet); List<ActiveApplet> applet(ActiveApplet activeApplet);
List<ActiveApplet> appletActiveByType(ActiveApplet activeApplet); List<ActiveApplet> appletActiveByType(ActiveApplet activeApplet);
void updateIsonline(Integer storeId,String type,Integer activeId,String isonline); void updateIsonline(Integer storeId, String type, Integer activeId, String isonline);
/**
* 分页查询活动信息
*
* @param page 分页参数
* @param activeApplet ActiveApplet实体
* @return com.baomidou.mybatisplus.core.metadata.IPage<com.fuint.business.marketingActivity.activeApplet.entity.ActiveApplet>
* @author PQZ
* @date 21:37 2024/9/9
**/
IPage<ActiveApplet> pageActive(Page<ActiveApplet> page, ActiveApplet activeApplet);
} }

View File

@ -2,6 +2,8 @@ package com.fuint.business.marketingActivity.activeApplet.service.impl;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.marketingActivity.activeApplet.mapper.ActiveAppletMapper; import com.fuint.business.marketingActivity.activeApplet.mapper.ActiveAppletMapper;
import com.fuint.business.marketingActivity.activeApplet.entity.ActiveApplet; import com.fuint.business.marketingActivity.activeApplet.entity.ActiveApplet;
@ -47,5 +49,19 @@ public class ActiveAppletServiceImpl extends ServiceImpl<ActiveAppletMapper, Act
baseMapper.updateById(activeApplet); baseMapper.updateById(activeApplet);
} }
} }
/**
* 分页查询活动信息
*
* @param page 分页参数
* @param activeApplet 实体
* @return com.baomidou.mybatisplus.core.metadata.IPage<com.fuint.business.marketingActivity.activeApplet.entity.ActiveApplet>
* @author PQZ
* @date 21:37 2024/9/9
**/
@Override
public IPage<ActiveApplet> pageActive(Page<ActiveApplet> page, ActiveApplet activeApplet) {
return activeAppletMapper.pageActive(page,activeApplet);
}
} }

View File

@ -81,20 +81,13 @@ public class ActivePriceServiceImpl extends ServiceImpl<ActivePriceMapper, Activ
//实体类转换 //实体类转换
ActivePrice activePrice = new ActivePrice(); ActivePrice activePrice = new ActivePrice();
BeanUtils.copyProperties(saveVO, activePrice); BeanUtils.copyProperties(saveVO, activePrice);
// 插入店铺信息id //插入店铺信息id
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
activePrice.setChainStorId(nowAccountInfo.getChainStoreId()); activePrice.setChainStorId(nowAccountInfo.getChainStoreId());
activePrice.setStoreId(nowAccountInfo.getStoreId()); activePrice.setStoreId(nowAccountInfo.getStoreId());
/*3、数据保存*/ /*3、数据保存*/
//保存营销活动 //保存营销活动
saveOrUpdate(activePrice); saveOrUpdate(activePrice);
// 如果是增加的话查询活动id信息
if (isAdd) {
IPage<ActivePriceRespVO> activePriceRespVOIPage = this.pageActivePrice(new Page<>(), new ActivePriceReqVO());
activePrice = activePriceRespVOIPage.getRecords().get(0);
}
//保存关联油品信息 //保存关联油品信息
activePriceOilService.saveOilList(activePrice.getId(), saveVO.getOilList()); activePriceOilService.saveOilList(activePrice.getId(), saveVO.getOilList());
/*4、日志操作*/ /*4、日志操作*/

View File

@ -4,7 +4,8 @@ env.profile=dev
#env.properties.path=D:/workspaces/oil-stations/fuintBackend/configure/ #env.properties.path=D:/workspaces/oil-stations/fuintBackend/configure/
#env.properties.path=F:/work/oilSystem/fuintBackend/configure/ #env.properties.path=F:/work/oilSystem/fuintBackend/configure/
#env.properties.path=D:/oil/new-oil/oilSystem/fuintBackend/configure/ #env.properties.path=D:/oil/new-oil/oilSystem/fuintBackend/configure/
env.properties.path=D:/code/bulidmap/oil-station/fuintBackend/configure/ #env.properties.path=D:/code/bulidmap/oil-station/fuintBackend/configure
env.properties.path=D:/Code/yuzhan/oil-station/fuintBackend/configure
#env.properties.path=/www/wwwroot/shenlanshuke/oilAdmin/ #env.properties.path=/www/wwwroot/shenlanshuke/oilAdmin/
# \u6570\u636E\u5E93\u914D\u7F6E # \u6570\u636E\u5E93\u914D\u7F6E