This commit is contained in:
wangh 2023-11-30 09:06:13 +08:00
commit cb14e279c2
29 changed files with 517 additions and 507 deletions

View File

@ -245,7 +245,7 @@
</el-card>
<!-- 添加会员信息选择是否批量录入-->
<el-dialog :close-on-click-modal="false" :title="title" width="55%" :visible.sync="openUser" append-to-body>
<el-dialog :title="title" width="55%" :visible.sync="openUser" append-to-body>
<el-alert
type="info"
:closable="false">
@ -334,7 +334,7 @@
<el-row>
<el-col :span="24">
<el-form-item label="会员初始积分" prop="points">
<el-input v-model="form.points" placeholder="0" maxlength="30"/>
<el-input v-model="form.points" placeholder="请输入会员初始积分" maxlength="30"/>
</el-form-item>
</el-col>
</el-row>
@ -348,7 +348,7 @@
<el-row>
<el-col :span="24">
<el-form-item label="储值通用余额" prop="cardBalance">
<el-input v-model="form.cardBalance" placeholder="0" maxlength="30"/>
<el-input v-model="form.cardBalance" placeholder="请输入储值卡初始余额" maxlength="30"/>
</el-form-item>
</el-col>
</el-row>
@ -528,8 +528,9 @@ export default {
//
defaultSort: {prop: 'updateTime', order: 'descending'},
//
form: { id: '', name: '', gradeId: '', mobile: '', userNo: '',point:'0', startTime: '', endTime: '', refuelMoney:'0',official:'wgz',
cardBalance:'0', literCard:'0', sex: 1, idcard: '', birthday: '', address: '', status: "qy", description: '' },
form: { id: '', name: '', gradeId: '', mobile: '', userNo: '',points:0, startTime: '',
endTime: '', refuelMoney:'0',official:'wgz',
cardBalance:0, literCard:'0', sex: 1, idcard: '', birthday: '', address: '', status: "qy", description: '' },
//
queryParams: {
page: 1,
@ -555,6 +556,7 @@ export default {
status: [{ required: true, message: "请选择会员状态", trigger: "blur" }],
mobile: [
{ required: true, message: "请输入手机号", trigger: "blur" },
{ min: 8, max: 11, message: '请输入正确的手机号', trigger: 'blur' }
],
}
};
@ -708,15 +710,14 @@ export default {
//
reset() {
this.resetForm("form");
this.form= { id: '', name: '', gradeId: '', mobile: '', userNo: '',point:'0', startTime: '', endTime: '',
refuelMoney:'0',official:'wgz',cardBalance:'0', literCard:'0', sex: 1, idcard: '', birthday: '', address: '',
this.form= { id: '', name: '', gradeId: '', mobile: '', userNo: '',points:0, startTime: '', endTime: '',
refuelMoney:'0',official:'wgz',cardBalance:0, literCard:'0', sex: 1, idcard: '', birthday: '', address: '',
status: "qy", description: ''
}
},
//
cancel() {
this.open = false;
this.openUser = false;
this.reset();
},
//
@ -753,7 +754,6 @@ export default {
const id = row.id || this.ids;
getUser(id).then(response => {
this.form = response.data;
console.log(this.form)
this.open = true;
this.title = "编辑会员";
});
@ -786,6 +786,7 @@ export default {
</script>
<style scoped>
.app-container{
width: 100%;
height: 100%;

View File

@ -47,6 +47,16 @@ public class ActiveConsumptionController extends BaseController {
return getSuccessResult(this.activeConsumptionService.select(page, activeConsumption));
}
/**
* 查询所有数据(小程序端)
* @param activeConsumption
* @return
*/
@GetMapping("appletList")
public ResponseObject selectAllApplet(@Param("cardFuelDiesel") ActiveConsumption activeConsumption) {
return getSuccessResult(this.activeConsumptionService.selectAllApplet(activeConsumption));
}
/**
* 通过主键查询单条数据
*

View File

@ -5,9 +5,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.marketingActivity.activeConsumption.dto.ActiveConsumptionDTO;
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumption;
import com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumptionAppletVO;
import com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumptionVO;
import java.io.Serializable;
import java.util.List;
/**
* 消费有礼活动(ActiveConsumption)表服务接口
@ -45,5 +47,12 @@ public interface ActiveConsumptionService extends IService<ActiveConsumption> {
* @return
*/
Boolean updateOneById(ActiveConsumptionDTO activeConsumptionDTO);
/**
* 查询所有数据(小程序端)
* @param activeConsumption
* @return
*/
List<ActiveConsumptionAppletVO> selectAllApplet(ActiveConsumption activeConsumption);
}

View File

@ -11,7 +11,9 @@ import com.fuint.business.marketingActivity.activeConsumption.mapper.ActiveConsu
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumption;
import com.fuint.business.marketingActivity.activeConsumption.service.ActiveConsumptionChildService;
import com.fuint.business.marketingActivity.activeConsumption.service.ActiveConsumptionService;
import com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumptionAppletVO;
import com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumptionVO;
import com.fuint.business.petrolStationManagement.service.OilNameService;
import com.fuint.business.store.service.StoreService;
import com.fuint.business.userManager.service.LJUserGradeService;
import com.fuint.common.util.TokenUtil;
@ -23,6 +25,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
@ -42,6 +45,8 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
private ActiveConsumptionChildService activeConsumptionChildService;
@Autowired
private LJUserGradeService userGradeService;
@Resource
private OilNameService oilNameService;
/**
* 新增数据
* @param activeConsumptionDTO
@ -212,6 +217,51 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
return update;
}
/**
* 查询所有数据(小程序端)
* @param activeConsumption
* @return
*/
@Override
public List<ActiveConsumptionAppletVO> selectAllApplet(ActiveConsumption activeConsumption) {
//获取本油站消费有礼活动列表
IPage page = select(new Page(1, 9999), activeConsumption);
List<ActiveConsumptionVO> activeConsumptionVOList = page.getRecords();
List<ActiveConsumptionAppletVO> appletVOList = activeConsumptionVOList.stream().map(s -> {
ActiveConsumptionAppletVO activeConsumptionAppletVO = new ActiveConsumptionAppletVO();
//适用用户名
String adaptUserType = "";
if (s.getAdaptUserType().equals("0")){
adaptUserType = "全部用户";
}else if (s.getAdaptUserType().equals("1")){
adaptUserType = "全部会员";
}else {
adaptUserType = arrayToString(s.getDieselUserLevel());
}
//赠送优惠券兑换券实物
String card = "";
String goods = "";
if (CollectionUtils.isNotEmpty(s.getActiveConsumptionChildList())){
for (ActiveConsumptionChild activeConsumptionChild : s.getActiveConsumptionChildList()) {
if (activeConsumptionChild.getActiveGift().equals("1") || activeConsumptionChild.getActiveGift().equals("2")){
card = activeConsumptionChild.getGiftCardDetail()+"的券";
}else {
goods = activeConsumptionChild.getGoodsName()+activeConsumptionChild.getGoodsTotal()+"";
}
}
}
//油号名字
String oilName = "";
for (Integer id : s.getAdaptOil()) {
oilName += oilNameService.selectOilNameById(id).getOilName()+",";
}
activeConsumptionAppletVO.setActiveDescribe(s.getName() + ""+"本活动"+oilName+"油品可用,消费需满"+
s.getParticipationConditionMoney()+"元,"+ adaptUserType+"可用,赠送券:"+card+" 赠送物品:"+goods+" 赠送积分:"+s.getPoints()+"积分。");
return activeConsumptionAppletVO;
}).collect(Collectors.toList());
return appletVOList;
}
/**
* 数组转字符串
* @param array

View File

@ -0,0 +1,11 @@
package com.fuint.business.marketingActivity.activeConsumption.vo;
import lombok.Data;
import java.io.Serializable;
@Data
public class ActiveConsumptionAppletVO implements Serializable {
//活动描述
private String activeDescribe;
}

View File

@ -48,6 +48,16 @@ public class ActiveDiscountController extends BaseController {
return getSuccessResult(this.activeDiscountService.select(page,activeDiscount));
}
/**
* 查询所有数据(小程序端)
* @param activeDiscount
* @return
*/
@GetMapping("appletList")
public ResponseObject selectAllApplet(@Param("cardFuelDiesel") ActiveDiscount activeDiscount) {
return getSuccessResult(this.activeDiscountService.selectAllApplet(activeDiscount));
}
/**
* 通过主键查询单条数据
*

View File

@ -5,9 +5,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.marketingActivity.activeDiscount.dto.ActiveDiscountDTO;
import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscount;
import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountAppletVO;
import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountVO;
import java.io.Serializable;
import java.util.List;
/**
* 折扣营销表(ActiveDiscount)表服务接口
@ -45,5 +47,12 @@ public interface ActiveDiscountService extends IService<ActiveDiscount> {
* @return
*/
Boolean updateOneById(ActiveDiscountDTO activeDiscountDTO);
/**
* 查询所有数据(小程序端)
* @param activeDiscount
* @return
*/
List<ActiveDiscountAppletVO> selectAllApplet(ActiveDiscount activeDiscount);
}

View File

@ -14,7 +14,9 @@ import com.fuint.business.marketingActivity.activeDiscount.mapper.ActiveDiscount
import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscount;
import com.fuint.business.marketingActivity.activeDiscount.service.ActiveDiscountChildService;
import com.fuint.business.marketingActivity.activeDiscount.service.ActiveDiscountService;
import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountAppletVO;
import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountVO;
import com.fuint.business.petrolStationManagement.service.OilNameService;
import com.fuint.business.store.service.StoreService;
import com.fuint.business.userManager.service.LJUserGradeService;
import com.fuint.common.util.TokenUtil;
@ -45,6 +47,8 @@ public class ActiveDiscountServiceImpl extends ServiceImpl<ActiveDiscountMapper,
private ActiveDiscountChildService activeDiscountChildService;
@Autowired
private LJUserGradeService userGradeService;
@Resource
private OilNameService oilNameService;
/**
* 新增数据
* @param activeDiscountDTO
@ -208,6 +212,37 @@ public class ActiveDiscountServiceImpl extends ServiceImpl<ActiveDiscountMapper,
return update;
}
@Override
public List<ActiveDiscountAppletVO> selectAllApplet(ActiveDiscount activeDiscount) {
IPage page = select(new Page(1, 9999), activeDiscount);
List<ActiveDiscountVO> activeDiscountVOList = page.getRecords();
List<ActiveDiscountAppletVO> activeDiscountAppletVOS = activeDiscountVOList.stream().map(s -> {
ActiveDiscountAppletVO activeDiscountAppletVO = new ActiveDiscountAppletVO();
//油号名字
String oilName = "";
for (Integer id : s.getAdaptOil()) {
oilName += oilNameService.selectOilNameById(id).getOilName() + ",";
}
//适用用户名
String adaptUserType = "";
adaptUserType = arrayToString(s.getDieselUserLevel());
//活动规则满足金额
double amount = 0.0;
//折扣
double discount = 0.0;
if (CollectionUtils.isNotEmpty(s.getActiveDiscountChildList())) {
for (ActiveDiscountChild activeDiscountChild : s.getActiveDiscountChildList()) {
amount = activeDiscountChild.getAmount();
discount = activeDiscountChild.getDiscount();
}
}
activeDiscountAppletVO.setDiscountActiveDescribe(s.getName() + ":本活动:适用用户为:"+adaptUserType+"购买如下油品:" + oilName + ",享受满" +
amount + "元,打" + discount + "折。");
return activeDiscountAppletVO;
}).collect(Collectors.toList());
return activeDiscountAppletVOS;
}
/**
* 数组转字符串
* @param array

View File

@ -0,0 +1,9 @@
package com.fuint.business.marketingActivity.activeDiscount.vo;
import lombok.Data;
import java.io.Serializable;
@Data
public class ActiveDiscountAppletVO implements Serializable {
private String discountActiveDescribe;
}

View File

@ -3,6 +3,7 @@ package com.fuint.business.marketingActivity.activeFullminus.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscount;
import com.fuint.business.marketingActivity.activeDiscount.service.ActiveDiscountChildService;
import com.fuint.business.marketingActivity.activeFullminus.dto.ActiveFullminusDTO;
import com.fuint.business.marketingActivity.activeFullminus.entity.ActiveFullminus;
@ -59,6 +60,16 @@ public class ActiveFullminusController extends BaseController {
return getSuccessResult(this.activeFullminusService.getOneById(id));
}
/**
* 查询所有数据(小程序端)
* @param activeFullminus
* @return
*/
@GetMapping("appletList")
public ResponseObject selectAllApplet(@Param("activeFullminus") ActiveFullminus activeFullminus) {
return getSuccessResult(this.activeFullminusService.selectAllApplet(activeFullminus));
}
/**
* 新增数据
*

View File

@ -5,9 +5,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.marketingActivity.activeFullminus.dto.ActiveFullminusDTO;
import com.fuint.business.marketingActivity.activeFullminus.entity.ActiveFullminus;
import com.fuint.business.marketingActivity.activeFullminus.vo.ActiveFullminusAppletVO;
import com.fuint.business.marketingActivity.activeFullminus.vo.ActiveFullminusVO;
import java.io.Serializable;
import java.util.List;
/**
* 满减营销表(ActiveFullminus)表服务接口
@ -45,5 +47,12 @@ public interface ActiveFullminusService extends IService<ActiveFullminus> {
* @return
*/
Boolean updateOneById(ActiveFullminusDTO activeFullminusDTO);
/**
* 查询所有数据(小程序端)
* @param activeFullminus
* @return
*/
List<ActiveFullminusAppletVO> selectAllApplet(ActiveFullminus activeFullminus);
}

View File

@ -8,12 +8,15 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscount;
import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscountChild;
import com.fuint.business.marketingActivity.activeDiscount.service.ActiveDiscountChildService;
import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountAppletVO;
import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountVO;
import com.fuint.business.marketingActivity.activeFullminus.dto.ActiveFullminusDTO;
import com.fuint.business.marketingActivity.activeFullminus.mapper.ActiveFullminusMapper;
import com.fuint.business.marketingActivity.activeFullminus.entity.ActiveFullminus;
import com.fuint.business.marketingActivity.activeFullminus.service.ActiveFullminusService;
import com.fuint.business.marketingActivity.activeFullminus.vo.ActiveFullminusAppletVO;
import com.fuint.business.marketingActivity.activeFullminus.vo.ActiveFullminusVO;
import com.fuint.business.petrolStationManagement.service.OilNameService;
import com.fuint.business.store.service.StoreService;
import com.fuint.business.userManager.service.LJUserGradeService;
import com.fuint.common.util.TokenUtil;
@ -43,6 +46,8 @@ public class ActiveFullminusServiceImpl extends ServiceImpl<ActiveFullminusMappe
private ActiveDiscountChildService activeDiscountChildService;
@Autowired
private LJUserGradeService userGradeService;
@Resource
private OilNameService oilNameService;
/**
* 新增数据
* @param activeFullminusDTO
@ -202,6 +207,42 @@ public class ActiveFullminusServiceImpl extends ServiceImpl<ActiveFullminusMappe
return update;
}
/**
* 查询所有数据(小程序端)
* @param activeFullminus
* @return
*/
@Override
public List<ActiveFullminusAppletVO> selectAllApplet(ActiveFullminus activeFullminus) {
IPage page = select(new Page(1, 9999), activeFullminus);
List<ActiveFullminusVO> activeFullminusVOList = page.getRecords();
List<ActiveFullminusAppletVO> activeFullminusAppletVOList = activeFullminusVOList.stream().map(s -> {
ActiveFullminusAppletVO activeFullminusAppletVO = new ActiveFullminusAppletVO();
//油号名字
String oilName = "";
for (Integer id : s.getAdaptOil()) {
oilName += oilNameService.selectOilNameById(id).getOilName() + ",";
}
//适用用户名
String adaptUserType = "";
adaptUserType = arrayToString(s.getDieselUserLevel());
//活动规则满足金额
double amount = 0.0;
//折扣
double discount = 0.0;
if (CollectionUtils.isNotEmpty(s.getActiveDiscountChildList())) {
for (ActiveDiscountChild activeDiscountChild : s.getActiveDiscountChildList()) {
amount = activeDiscountChild.getAmount();
discount = activeDiscountChild.getDeductionAmount();
}
}
activeFullminusAppletVO.setFullminusActiveDescribe(s.getName() + ":本活动:适用用户为:"+adaptUserType+"购买如下油品:" + oilName + ",享受满" +
amount + "元,减" + discount + "元。");
return activeFullminusAppletVO;
}).collect(Collectors.toList());
return activeFullminusAppletVOList;
}
/**
* 数组转字符串
* @param array

View File

@ -0,0 +1,10 @@
package com.fuint.business.marketingActivity.activeFullminus.vo;
import lombok.Data;
import java.io.Serializable;
@Data
public class ActiveFullminusAppletVO implements Serializable {
//活动描述
private String fullminusActiveDescribe;
}

View File

@ -2,11 +2,7 @@ package com.fuint.business.marketingActivity.activeNewlyweds.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.api.ApiController;
import com.baomidou.mybatisplus.extension.api.R;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscount;
import com.fuint.business.marketingActivity.activeNewlyweds.dto.ActiveNewlywedsDTO;
import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlyweds;
import com.fuint.business.marketingActivity.activeNewlyweds.service.ActiveNewlywedsChildService;
@ -63,6 +59,15 @@ public class ActiveNewlywedsController extends BaseController {
return getSuccessResult(this.activeNewlywedsService.getOneById(id));
}
/**
* 查询单条数据(小程序端)
* @return 单条数据
*/
@GetMapping("applet")
public ResponseObject selectApplet() {
return getSuccessResult(this.activeNewlywedsService.selectApplet());
}
/**
* 新增数据
*

View File

@ -0,0 +1,15 @@
package com.fuint.business.marketingActivity.activeNewlyweds.controller.vo;
import lombok.Data;
import java.io.Serializable;
@Data
public class ActiveNewlywedsAppletVO implements Serializable {
//活动描述获得券
private String NewlywedsActiveDescribe;
//积分
private String point;
//成长值
private String growValue;
}

View File

@ -4,12 +4,12 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlywedsChild;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
public class ActiveNewlywedsVO implements Serializable {
@Data
public class ActiveNewlywedsVO {
//主键id
@TableId(type = IdType.AUTO)
private Integer id;
@ -53,156 +53,4 @@ public class ActiveNewlywedsVO implements Serializable {
//更新时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
public String getActiveCode() {
return activeCode;
}
public void setActiveCode(String activeCode) {
this.activeCode = activeCode;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getChainStoreId() {
return chainStoreId;
}
public void setChainStoreId(Integer chainStoreId) {
this.chainStoreId = chainStoreId;
}
public Integer getStoreId() {
return storeId;
}
public void setStoreId(Integer storeId) {
this.storeId = storeId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Date getActiveStartTime() {
return activeStartTime;
}
public void setActiveStartTime(Date activeStartTime) {
this.activeStartTime = activeStartTime;
}
public Date getActiveEndTime() {
return activeEndTime;
}
public void setActiveEndTime(Date activeEndTime) {
this.activeEndTime = activeEndTime;
}
public String[] getCourtesyReward() {
return courtesyReward;
}
public void setCourtesyReward(String[] courtesyReward) {
this.courtesyReward = courtesyReward;
}
public String getIsonline() {
return isonline;
}
public void setIsonline(String isonline) {
this.isonline = isonline;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public Integer getRemainderTotal() {
return remainderTotal;
}
public void setRemainderTotal(Integer remainderTotal) {
this.remainderTotal = remainderTotal;
}
public Integer getPoints() {
return points;
}
public void setPoints(Integer points) {
this.points = points;
}
public Integer getGrowthValue() {
return growthValue;
}
public void setGrowthValue(Integer growthValue) {
this.growthValue = growthValue;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public List<ActiveNewlywedsChild> getActiveNewlywedsChildList() {
return activeNewlywedsChildList;
}
public void setActiveNewlywedsChildList(List<ActiveNewlywedsChild> activeNewlywedsChildList) {
this.activeNewlywedsChildList = activeNewlywedsChildList;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}

View File

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
@ -16,6 +17,7 @@ import java.io.Serializable;
* @since 2023-11-13 13:17:14
*/
@SuppressWarnings("serial")
@Data
public class ActiveNewlywedsChild extends Model<ActiveNewlywedsChild> {
//主键id
@TableId(type = IdType.AUTO)
@ -34,6 +36,8 @@ public class ActiveNewlywedsChild extends Model<ActiveNewlywedsChild> {
private String giftCardType;
//券详情
private String giftCardDetail;
//生效日期类型 0 12
private String timeType;
//券有效期
private Integer giftCardTime;
//有效期0
@ -54,143 +58,5 @@ public class ActiveNewlywedsChild extends Model<ActiveNewlywedsChild> {
//更新时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
public Integer getValidityZero() {
return validityZero;
}
public void setValidityZero(Integer validityZero) {
this.validityZero = validityZero;
}
public Integer getValidityOne() {
return validityOne;
}
public void setValidityOne(Integer validityOne) {
this.validityOne = validityOne;
}
public Integer getValidityTwo() {
return validityTwo;
}
public void setValidityTwo(Integer validityTwo) {
this.validityTwo = validityTwo;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getActiveNewlywedsId() {
return activeNewlywedsId;
}
public void setActiveNewlywedsId(Integer activeNewlywedsId) {
this.activeNewlywedsId = activeNewlywedsId;
}
public String getActiveGift() {
return activeGift;
}
public void setActiveGift(String activeGift) {
this.activeGift = activeGift;
}
public Integer getVouchersId() {
return vouchersId;
}
public void setVouchersId(Integer vouchersId) {
this.vouchersId = vouchersId;
}
public String getGiftCardName() {
return giftCardName;
}
public void setGiftCardName(String giftCardName) {
this.giftCardName = giftCardName;
}
public String getGiftCardType() {
return giftCardType;
}
public void setGiftCardType(String giftCardType) {
this.giftCardType = giftCardType;
}
public String getGiftCardDetail() {
return giftCardDetail;
}
public void setGiftCardDetail(String giftCardDetail) {
this.giftCardDetail = giftCardDetail;
}
public Integer getGiftCardTime() {
return giftCardTime;
}
public void setGiftCardTime(Integer giftCardTime) {
this.giftCardTime = giftCardTime;
}
public Integer getGiftCardTotal() {
return giftCardTotal;
}
public void setGiftCardTotal(Integer giftCardTotal) {
this.giftCardTotal = giftCardTotal;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* 获取主键值
*
* @return 主键值
*/
@Override
protected Serializable pkVal() {
return this.id;
}
}

View File

@ -3,6 +3,7 @@ package com.fuint.business.marketingActivity.activeNewlyweds.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.fuint.business.marketingActivity.activeNewlyweds.controller.vo.ActiveNewlywedsAppletVO;
import com.fuint.business.marketingActivity.activeNewlyweds.controller.vo.ActiveNewlywedsVO;
import com.fuint.business.marketingActivity.activeNewlyweds.dto.ActiveNewlywedsDTO;
import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlyweds;
@ -45,5 +46,11 @@ public interface ActiveNewlywedsService extends IService<ActiveNewlyweds> {
* @return
*/
Boolean updateOneById(ActiveNewlywedsDTO activeNewlywedsDTO);
/**
* 查询单条数据(小程序端)
* @return
*/
ActiveNewlywedsAppletVO selectApplet();
}

View File

@ -5,10 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscount;
import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscountChild;
import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountVO;
import com.fuint.business.marketingActivity.activeFullminus.entity.ActiveFullminus;
import com.fuint.business.marketingActivity.activeNewlyweds.controller.vo.ActiveNewlywedsAppletVO;
import com.fuint.business.marketingActivity.activeNewlyweds.controller.vo.ActiveNewlywedsVO;
import com.fuint.business.marketingActivity.activeNewlyweds.dto.ActiveNewlywedsDTO;
import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlywedsChild;
@ -16,7 +13,10 @@ import com.fuint.business.marketingActivity.activeNewlyweds.mapper.ActiveNewlywe
import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlyweds;
import com.fuint.business.marketingActivity.activeNewlyweds.service.ActiveNewlywedsChildService;
import com.fuint.business.marketingActivity.activeNewlyweds.service.ActiveNewlywedsService;
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommend;
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommendChild;
import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendAppletVO;
import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendVO;
import com.fuint.business.store.service.StoreService;
import com.fuint.common.util.TokenUtil;
import org.apache.commons.lang3.ObjectUtils;
@ -25,6 +25,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@ -49,7 +50,36 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
@Override
public Boolean add(ActiveNewlywedsDTO activeNewlywedsDTO) {
boolean save = false;
//获取当前店铺的id和连锁店id
Integer storeId = TokenUtil.getNowAccountInfo().getStoreId();
//根据店铺id查询
LambdaQueryWrapper<ActiveNewlyweds> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ActiveNewlyweds::getStoreId,storeId);
ActiveNewlyweds one = getOne(lambdaQueryWrapper);
if (ObjectUtils.isNotEmpty(one)){
activeNewlywedsDTO.setId(one.getId());
save = updateOneById(activeNewlywedsDTO);
}else {
if (ObjectUtils.isNotEmpty(TokenUtil.getNowAccountInfo().getStoreId())) {
activeNewlywedsDTO.setStoreId(TokenUtil.getNowAccountInfo().getStoreId());
activeNewlywedsDTO.setChainStoreId(storeService.getById(TokenUtil.getNowAccountInfo().getStoreId()).getChainStoreId());
}
//新增折扣营销活动模板
ActiveNewlyweds activeNewlyweds = new ActiveNewlyweds();
if (ObjectUtils.isNotEmpty(activeNewlywedsDTO)){
BeanUtils.copyProperties(activeNewlywedsDTO,activeNewlyweds);
//有礼奖励
activeNewlyweds.setCourtesyReward(arrayToString(activeNewlywedsDTO.getCourtesyReward()));
save = save(activeNewlyweds);
}
//新增兑换物品
List<ActiveNewlywedsChild> list = activeNewlywedsDTO.getActiveNewlywedsChildList();
list.stream().map(s ->{
s.setActiveNewlywedsId(activeNewlyweds.getId());
return s;
}).collect(Collectors.toList());
save = activeNewlywedsChildService.saveBatch(list);
}
/* //获取当前店铺的id和连锁店id
if (ObjectUtils.isNotEmpty(TokenUtil.getNowAccountInfo().getStoreId())) {
activeNewlywedsDTO.setStoreId(TokenUtil.getNowAccountInfo().getStoreId());
activeNewlywedsDTO.setChainStoreId(storeService.getById(TokenUtil.getNowAccountInfo().getStoreId()).getChainStoreId());
@ -68,7 +98,7 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
s.setActiveNewlywedsId(activeNewlyweds.getId());
return s;
}).collect(Collectors.toList());
save = activeNewlywedsChildService.saveBatch(list);
save = activeNewlywedsChildService.saveBatch(list);*/
return save;
}
@ -114,25 +144,37 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
}
/**
* 通过主键查询单条数据
* 通过店铺查询单条数据
* @param id
* @return
*/
@Override
public ActiveNewlywedsVO getOneById(Serializable id) {
Integer storeId = TokenUtil.getNowAccountInfo().getStoreId();
ActiveNewlywedsVO activeNewlywedsVO = new ActiveNewlywedsVO();
if (ObjectUtils.isNotEmpty(id)){
activeNewlywedsVO.setCourtesyReward(new String[0]);
if (ObjectUtils.isNotEmpty(storeId)){
//获取新人有礼活动信息
ActiveNewlyweds activeNewlyweds = getById(id);
LambdaQueryWrapper<ActiveNewlyweds> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ActiveNewlyweds::getStoreId,TokenUtil.getNowAccountInfo().getStoreId());
ActiveNewlyweds activeNewlyweds = getOne(lambdaQueryWrapper);
//获取兑换物品信息
LambdaQueryWrapper<ActiveNewlywedsChild> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ActiveNewlywedsChild::getActiveNewlywedsId,id);
queryWrapper.orderByDesc(ActiveNewlywedsChild::getCreateTime);
List<ActiveNewlywedsChild> activeNewlywedsChildList = activeNewlywedsChildService.list(queryWrapper);
if (CollectionUtils.isNotEmpty(activeNewlywedsChildList)){
//封装VO返回
if (ObjectUtils.isNotEmpty(activeNewlyweds)){
LambdaQueryWrapper<ActiveNewlywedsChild> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ActiveNewlywedsChild::getActiveNewlywedsId,activeNewlyweds.getId());
queryWrapper.orderByDesc(ActiveNewlywedsChild::getCreateTime);
List<ActiveNewlywedsChild> activeNewlywedsChildList = activeNewlywedsChildService.list(queryWrapper);
BeanUtils.copyProperties(activeNewlyweds,activeNewlywedsVO);
//封装VO返回
activeNewlywedsVO.setCourtesyReward(activeNewlyweds.getCourtesyReward().split(","));
if (CollectionUtils.isNotEmpty(activeNewlywedsChildList)){
activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildList);
}else {
ArrayList<ActiveNewlywedsChild> activeNewlywedsChildLists = new ArrayList<>();
activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildLists);
}
}else {
ArrayList<ActiveNewlywedsChild> activeNewlywedsChildList = new ArrayList<>();
activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildList);
}
}
@ -173,6 +215,40 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
return update;
}
@Override
public ActiveNewlywedsAppletVO selectApplet() {
ActiveNewlywedsAppletVO activeNewlywedsAppletVO = new ActiveNewlywedsAppletVO();
//获取本店铺的推荐有礼活动
ActiveNewlywedsVO activeNewlywedsVO = getOneById(1);
//邀请人获得
if (ObjectUtils.isNotEmpty(activeNewlywedsVO) && ObjectUtils.isNotEmpty(activeNewlywedsVO.getPoints())){
//积分
activeNewlywedsAppletVO.setPoint(activeNewlywedsVO.getPoints().toString());
}
if (ObjectUtils.isNotEmpty(activeNewlywedsVO) && ObjectUtils.isNotEmpty(activeNewlywedsVO.getGrowthValue())){
//成长值
activeNewlywedsAppletVO.setGrowValue(activeNewlywedsVO.getGrowthValue().toString());
}
//邀请人赠送优惠券兑换券
String cardi1 = "";
String cardo1 = "";
if (CollectionUtils.isNotEmpty(activeNewlywedsVO.getActiveNewlywedsChildList())){
for (ActiveNewlywedsChild activeNewlywedsChild : activeNewlywedsVO.getActiveNewlywedsChildList()) {
if (activeNewlywedsChild.getActiveGift().equals("1")){
//优惠券
cardi1 += activeNewlywedsChild.getGiftCardName()+"的券("+activeNewlywedsChild.getGiftCardDetail()+");";
}
if (activeNewlywedsChild.getActiveGift().equals("2")){
//兑换券
cardo1 += activeNewlywedsChild.getGiftCardName()+"的券;";
}
}
}
//邀请人的券
activeNewlywedsAppletVO.setNewlywedsActiveDescribe("优惠券:"+cardi1+"兑换券:"+cardo1);
return activeNewlywedsAppletVO;
}
/**
* 数组转字符串
* @param array

View File

@ -63,6 +63,15 @@ public class ActiveRecommendController extends BaseController {
return getSuccessResult(this.activeRecommendService.getOneById(id));
}
/**
* 查询单条数据(小程序端)
* @return 单条数据
*/
@GetMapping("applet")
public ResponseObject selectApplet() {
return getSuccessResult(this.activeRecommendService.selectApplet());
}
/**
* 新增数据
*

View File

@ -18,6 +18,7 @@ import java.io.Serializable;
@SuppressWarnings("serial")
public class ActiveRecommend extends Model<ActiveRecommend> {
//主键id
@TableId(type = IdType.AUTO)
private Integer id;
//所属连锁店id
private Integer chainStoreId;

View File

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
@ -16,6 +17,7 @@ import java.io.Serializable;
* @since 2023-11-13 15:10:17
*/
@SuppressWarnings("serial")
@Data
public class ActiveRecommendChild extends Model<ActiveRecommendChild> {
//主键id
@TableId(type = IdType.AUTO)
@ -38,6 +40,8 @@ public class ActiveRecommendChild extends Model<ActiveRecommendChild> {
private String giftCardDetail;
//券有效期
private Integer giftCardTime;
//生效日期类型 0 12
private String timeType;
//有效期0
private Integer validityZero;
//有效期1
@ -56,151 +60,5 @@ public class ActiveRecommendChild extends Model<ActiveRecommendChild> {
//更新时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
public Integer getValidityZero() {
return validityZero;
}
public void setValidityZero(Integer validityZero) {
this.validityZero = validityZero;
}
public Integer getValidityOne() {
return validityOne;
}
public void setValidityOne(Integer validityOne) {
this.validityOne = validityOne;
}
public Integer getValidityTwo() {
return validityTwo;
}
public void setValidityTwo(Integer validityTwo) {
this.validityTwo = validityTwo;
}
public String getGiftUserType() {
return giftUserType;
}
public void setGiftUserType(String giftUserType) {
this.giftUserType = giftUserType;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getActiveRecommendId() {
return activeRecommendId;
}
public void setActiveRecommendId(Integer activeRecommendId) {
this.activeRecommendId = activeRecommendId;
}
public String getActiveGift() {
return activeGift;
}
public void setActiveGift(String activeGift) {
this.activeGift = activeGift;
}
public Integer getVouchersId() {
return vouchersId;
}
public void setVouchersId(Integer vouchersId) {
this.vouchersId = vouchersId;
}
public String getGiftCardName() {
return giftCardName;
}
public void setGiftCardName(String giftCardName) {
this.giftCardName = giftCardName;
}
public String getGiftCardType() {
return giftCardType;
}
public void setGiftCardType(String giftCardType) {
this.giftCardType = giftCardType;
}
public String getGiftCardDetail() {
return giftCardDetail;
}
public void setGiftCardDetail(String giftCardDetail) {
this.giftCardDetail = giftCardDetail;
}
public Integer getGiftCardTime() {
return giftCardTime;
}
public void setGiftCardTime(Integer giftCardTime) {
this.giftCardTime = giftCardTime;
}
public Integer getGiftCardTotal() {
return giftCardTotal;
}
public void setGiftCardTotal(Integer giftCardTotal) {
this.giftCardTotal = giftCardTotal;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* 获取主键值
*
* @return 主键值
*/
@Override
protected Serializable pkVal() {
return this.id;
}
}

View File

@ -3,6 +3,7 @@ package com.fuint.business.marketingActivity.activeRecommend.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.marketingActivity.activeRecommend.dto.ActiveRecommendDTO;
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommend;
import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendAppletVO;
import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendVO;
import java.io.Serializable;
@ -35,5 +36,11 @@ public interface ActiveRecommendService extends IService<ActiveRecommend> {
* @return
*/
Boolean updateOneById(ActiveRecommendDTO activeRecommendDTO);
/**
* 查询单条数据(小程序端)
* @return
*/
ActiveRecommendAppletVO selectApplet();
}

View File

@ -3,17 +3,15 @@ package com.fuint.business.marketingActivity.activeRecommend.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscountChild;
import com.fuint.business.marketingActivity.activeNewlyweds.controller.vo.ActiveNewlywedsVO;
import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlyweds;
import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlywedsChild;
import com.fuint.business.marketingActivity.activeRecommend.dto.ActiveRecommendDTO;
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommendChild;
import com.fuint.business.marketingActivity.activeRecommend.mapper.ActiveRecommendMapper;
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommend;
import com.fuint.business.marketingActivity.activeRecommend.service.ActiveRecommendChildService;
import com.fuint.business.marketingActivity.activeRecommend.service.ActiveRecommendService;
import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendAppletVO;
import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendVO;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableService;
import com.fuint.business.store.service.StoreService;
import com.fuint.common.util.TokenUtil;
import org.apache.commons.lang3.ObjectUtils;
@ -23,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@ -39,6 +38,8 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
private StoreService storeService;
@Resource
private ActiveRecommendChildService activeRecommendChildService;
@Resource
private CardFavorableService cardFavorableService;
/**
* 新增数据
* @param activeRecommendDTO
@ -48,9 +49,13 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
@Transactional
public Boolean add(ActiveRecommendDTO activeRecommendDTO) {
boolean save = false;
//根据id查询
ActiveRecommendVO activeRecommendVO = getOneById(activeRecommendDTO.getId());
if (ObjectUtils.isNotEmpty(activeRecommendVO.getId())){
Integer storeId = TokenUtil.getNowAccountInfo().getStoreId();
//根据店铺id查询
LambdaQueryWrapper<ActiveRecommend> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ActiveRecommend::getStoreId,storeId);
ActiveRecommend one = getOne(lambdaQueryWrapper);
if (ObjectUtils.isNotEmpty(one)){
activeRecommendDTO.setId(one.getId());
save = updateOneById(activeRecommendDTO);
}else {
//获取当前店铺的id和连锁店id
@ -64,12 +69,14 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
BeanUtils.copyProperties(activeRecommendDTO, activeRecommend);
//邀请人礼品类型
activeRecommend.setInviterGiftType(arrayToString(activeRecommendDTO.getInviterGiftType()));
activeRecommend.setId(null);
save = save(activeRecommend);
}
//礼品
List<ActiveRecommendChild> list = activeRecommendDTO.getActiveRecommendChildList();
if (CollectionUtils.isNotEmpty(list)) {
list.stream().map(s -> {
//s.setTimeType(cardFavorableService.selectOneById(s.getId()).getTimeType());
s.setActiveRecommendId(activeRecommend.getId());
return s;
}).collect(Collectors.toList());
@ -80,33 +87,39 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
}
/**
* 通过主键查询单条数据
* 通过店铺id查询单条数据
* @param id
* @return
*/
@Override
public ActiveRecommendVO getOneById(Serializable id) {
Integer storeId = TokenUtil.getNowAccountInfo().getStoreId();
ActiveRecommendVO activeRecommendVO = new ActiveRecommendVO();
activeRecommendVO.setInviterGiftType(new String[0]);
if (ObjectUtils.isNotEmpty(id)){
if (ObjectUtils.isNotEmpty(storeId)){
//获取新人有礼活动信息
LambdaQueryWrapper<ActiveRecommend> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ActiveRecommend::getId,id);
lambdaQueryWrapper.eq(ActiveRecommend::getStoreId,TokenUtil.getNowAccountInfo().getStoreId());
ActiveRecommend activeRecommend = getOne(lambdaQueryWrapper);
//ActiveRecommend activeRecommend = getById(id);
//获取兑换物品信息
LambdaQueryWrapper<ActiveRecommendChild> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ActiveRecommendChild::getActiveRecommendId,id);
queryWrapper.orderByDesc(ActiveRecommendChild::getCreateTime);
List<ActiveRecommendChild> activeRecommendChildList = activeRecommendChildService.list(queryWrapper);
//封装VO返回
if (ObjectUtils.isNotEmpty(activeRecommend)){
LambdaQueryWrapper<ActiveRecommendChild> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ActiveRecommendChild::getActiveRecommendId,activeRecommend.getId());
queryWrapper.orderByDesc(ActiveRecommendChild::getCreateTime);
List<ActiveRecommendChild> activeRecommendChildList = activeRecommendChildService.list(queryWrapper);
BeanUtils.copyProperties(activeRecommend,activeRecommendVO);
activeRecommendVO.setInviterGiftType(activeRecommend.getInviterGiftType().split(","));
if (CollectionUtils.isNotEmpty(activeRecommendChildList)){
activeRecommendVO.setActiveRecommendChildList(activeRecommendChildList);
}else {
ArrayList<ActiveRecommendChild> activeRecommendChildren = new ArrayList<>();
activeRecommendVO.setActiveRecommendChildList(activeRecommendChildren);
}
}else {
ArrayList<ActiveRecommendChild> activeRecommendChildren = new ArrayList<>();
activeRecommendVO.setActiveRecommendChildList(activeRecommendChildren);
}
activeRecommendVO.setActiveRecommendChildList(activeRecommendChildList);
}
return activeRecommendVO;
}
@ -142,6 +155,50 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
return update;
}
/**
* 查询单条数据(小程序端)
* @return
*/
@Override
public ActiveRecommendAppletVO selectApplet() {
ActiveRecommendAppletVO activeRecommendAppletVO = new ActiveRecommendAppletVO();
//获取本店铺的推荐有礼活动
ActiveRecommendVO activeRecommendVO = getOneById(1);
//邀请人获得
if (ObjectUtils.isNotEmpty(activeRecommendVO) && ObjectUtils.isNotEmpty(activeRecommendVO.getPoints())){
//积分
activeRecommendAppletVO.setPoint(activeRecommendVO.getPoints().toString());
}
if (ObjectUtils.isNotEmpty(activeRecommendVO) && ObjectUtils.isNotEmpty(activeRecommendVO.getGrowthValue())){
//成长值
activeRecommendAppletVO.setGrowValue(activeRecommendVO.getGrowthValue().toString());
}
//邀请人赠送优惠券兑换券
String cardi1 = "";
String cardo1 = "";
//被邀请人赠送优惠券
String cardi2 = "";
if (CollectionUtils.isNotEmpty(activeRecommendVO.getActiveRecommendChildList())){
for (ActiveRecommendChild activeRecommendChild : activeRecommendVO.getActiveRecommendChildList()) {
if (activeRecommendChild.getGiftUserType().equals("0") && activeRecommendChild.getActiveGift().equals("1")){
//优惠券
cardi1 += activeRecommendChild.getGiftCardName()+"的券("+activeRecommendChild.getGiftCardDetail()+");";
}else if (activeRecommendChild.getGiftUserType().equals("0") && activeRecommendChild.getActiveGift().equals("2")){
//兑换券
cardo1 += activeRecommendChild.getGiftCardName()+"的券;";
}else if (activeRecommendChild.getGiftUserType().equals("1") && activeRecommendChild.getActiveGift().equals("1")){
//优惠券
cardi2 += activeRecommendChild.getGiftCardName()+"的券("+activeRecommendChild.getGiftCardDetail()+");";
}
}
}
//邀请人的券
activeRecommendAppletVO.setRecommendActiveDescribeIn("优惠券:"+cardi1+"兑换券:"+cardo1);
//被邀请人的券
activeRecommendAppletVO.setRecommendActiveDescribeOut("优惠券:"+cardi2);
return activeRecommendAppletVO;
}
/**
* 数组转字符串
* @param array

View File

@ -0,0 +1,16 @@
package com.fuint.business.marketingActivity.activeRecommend.vo;
import lombok.Data;
import java.io.Serializable;
@Data
public class ActiveRecommendAppletVO implements Serializable {
//活动描述邀请人获得券
private String RecommendActiveDescribeIn;
//活动描述被邀请人获得券
private String RecommendActiveDescribeOut;
//积分
private String point;
//成长值
private String growValue;
}

View File

@ -6,9 +6,9 @@
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="userId" column="userId" jdbcType="INTEGER"/>
<result property="storeId" column="storeId" jdbcType="INTEGER"/>
<result property="chainstoreId" column="chain_store_id" jdbcType="INTEGER"/>
<result property="inviterId" column="inviterId" jdbcType="INTEGER"/>
<result property="chainStoreId" column="chain_store_id" jdbcType="INTEGER"/>
<result property="inviterId" column="inviterId" jdbcType="INTEGER"/>
<result property="staffId" column="staffId" jdbcType="INTEGER"/>
<result property="status" column="status" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="createBy" column="create_by" jdbcType="VARCHAR"/>
@ -19,7 +19,7 @@
<!--查询单个-->
<select id="queryById" resultMap="MtInvitationMap">
select
id, userId, storeId, inviterId, inviterId, status, create_time, create_by, update_time, update_by
id, userId, storeId, inviterId, staffId,chain_store_id, status, create_time, create_by, update_time, update_by
from mt_invitation
where id = #{id}
</select>
@ -28,7 +28,7 @@
<!--查询单个-->
<select id="queryByStoreId" resultMap="MtInvitationMap">
select
id, userId, storeId, inviterId, inviterId, status, create_time, create_by, update_time, update_by
id, userId, storeId, inviterId, staffId,chain_store_id, status, create_time, create_by, update_time, update_by
from mt_invitation
where storeId = #{storeId} and userId = #{userId}
</select>
@ -36,7 +36,7 @@
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="MtInvitationMap">
select
id, userId, storeId, inviterId, inviterId, status, create_time, create_by, update_time, update_by
id, userId, storeId, inviterId, staffId,chain_store_id, status, create_time, create_by, update_time, update_by
from mt_invitation
<where>
<if test="id != null">
@ -51,8 +51,8 @@
<if test="inviterId != null">
and inviterId = #{inviterId}
</if>
<if test="inviterId != null">
and inviterId = #{inviterId}
<if test="staffId != null">
and staffId = #{staffId}
</if>
<if test="status != null and status != ''">
and status = #{status}
@ -89,8 +89,8 @@
<if test="inviterId != null">
and inviterId = #{inviterId}
</if>
<if test="inviterId != null">
and inviterId = #{inviterId}
<if test="staffId != null">
and staffId = #{staffId}
</if>
<if test="status != null and status != ''">
and status = #{status}
@ -112,23 +112,25 @@
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into mt_invitation(userId, storeId, inviterId, inviterId, status, create_time, create_by, update_time, update_by,chain_store_id)
values (#{userId}, #{storeId}, #{inviterId}, #{inviterId}, #{status}, #{createTime}, #{createBy}, #{updateTime}, #{updateBy},#{chainStoreId})
insert into mt_invitation(userId, storeId, inviterId, staffId,chain_store_id, status, create_time, create_by, update_time, update_by)
values (#{userId}, #{storeId}, #{inviterId}, #{staffId}, #{chainStoreId}, #{status}, #{createTime},
#{createBy}, #{updateTime}, #{updateBy})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into mt_invitation(userId, storeId, inviterId, inviterId, status, create_time, create_by, update_time, update_by)
insert into mt_invitation(userId, storeId, inviterId,staffId,chain_store_id, status, create_time, create_by, update_time, update_by)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.userId}, #{entity.storeId}, #{entity.inviterId}, #{entity.inviterId}, #{entity.status}, #{entity.createTime}, #{entity.createBy}, #{entity.updateTime}, #{entity.updateBy})
(#{entity.userId}, #{entity.storeId}, #{entity.inviterId}, #{entity.staffId}, #{entity.chainStoreId},
#{entity.status}, #{entity.createTime}, #{entity.createBy}, #{entity.updateTime}, #{entity.updateBy})
</foreach>
</insert>
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into mt_invitation(userId, storeId, inviterId, inviterId, status, create_time, create_by, update_time, update_by)
insert into mt_invitation(userId, storeId, inviterId, staffId,chain_store_id, status, create_time, create_by, update_time, update_by)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.userId}, #{entity.storeId}, #{entity.inviterId}, #{entity.inviterId}, #{entity.status}, #{entity.createTime}, #{entity.createBy}, #{entity.updateTime}, #{entity.updateBy})
(#{entity.userId}, #{entity.storeId}, #{entity.inviterId}, #{entity.staffId}, #{entity.chainStoreId}, #{entity.status}, #{entity.createTime}, #{entity.createBy}, #{entity.updateTime}, #{entity.updateBy})
</foreach>
on duplicate key update
userId = values(userId),
@ -155,8 +157,8 @@
<if test="inviterId != null">
inviterId = #{inviterId},
</if>
<if test="inviterId != null">
inviterId = #{inviterId},
<if test="staffId != null">
staffId = #{staffId},
</if>
<if test="status != null and status != ''">
status = #{status},

View File

@ -45,6 +45,13 @@ public interface LJUserGradeService extends IService<LJUserGrade> {
*/
public LJUserGrade selectUserGradeByName(String name);
/**
* 根据storeId查询会员最低等级信息
* @param storeId
* @return
*/
public LJUserGrade selectUserGradeByStoreId(int storeId);
/**
* 根据id删除会员等级信息
* @param id

View File

@ -75,6 +75,15 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
return ljUserGrade;
}
@Override
public LJUserGrade selectUserGradeByStoreId(int storeId) {
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("store_id",storeId);
queryWrapper.orderByAsc("grade");
List<LJUserGrade> list = baseMapper.selectList(queryWrapper);
return list.get(0);
}
@Override
public void deleteUserGradeById(Integer id) {
baseMapper.deleteById(id);

View File

@ -7,18 +7,17 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.storeInformation.entity.LJStore;
import com.fuint.business.storeInformation.service.ILJStoreService;
import com.fuint.business.userManager.entity.CertifiedMember;
import com.fuint.business.userManager.entity.LJUser;
import com.fuint.business.userManager.entity.MtInvitation;
import com.fuint.business.userManager.entity.UserBalance;
import com.fuint.business.userManager.entity.*;
import com.fuint.business.userManager.mapper.CertifiedMemberMapper;
import com.fuint.business.userManager.mapper.LJUserMapper;
import com.fuint.business.userManager.mapper.MtInvitationMapper;
import com.fuint.business.userManager.service.LJUserGradeService;
import com.fuint.business.userManager.service.LJUserService;
import com.fuint.business.userManager.service.MtInvitationService;
import com.fuint.business.userManager.service.UserBalanceService;
import com.fuint.business.userManager.vo.LJUserVo;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.StringUtils;
import com.fuint.common.util.TokenUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -154,6 +153,8 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
private ILJStoreService storeService;
@Autowired
private MtInvitationMapper invitationMapper;
@Autowired
private LJUserGradeService userGradeService;
/**
* 添加会员信息
@ -193,7 +194,13 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
user1.setUserNo(user.getUserNo());
}
user1.setAvatar(user.getAvatar());
user1.setName(user.getName());
if (StringUtils.isEmpty(user.getName()) || user.getName().equals("")){
String before = user.getMobile().substring(0, 3);
String after = user.getMobile().substring(7);
user1.setName(before+"****"+after);
}else {
user1.setName(user.getName());
}
user1.setOpenId(user.getOpenId());
user1.setMobile(user.getMobile());
user1.setIdcard(user.getIdcard());
@ -214,7 +221,12 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
balance.setCardBalance(user.getCardBalance());
balance.setPoints(user.getPoints());
balance.setStoreId(storeId);
balance.setGradeId(user.getGradeId());
if (user.getGradeId()!=null){
balance.setGradeId(user.getGradeId());
}else {
LJUserGrade ljUserGrade = userGradeService.selectUserGradeByStoreId(storeId);
balance.setGradeId(ljUserGrade.getId());
}
balance.setConsumeNum(user.getConsumeNum());
balance.setSecondCard(user.getSecondCard());
balance.setFixingLevel(user.getFixingLevel());