Merge remote-tracking branch 'origin/score_shop' into score_shop
14 files added
6 files modified
New file |
| | |
| | | package com.matrix.system.activity.action; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.activity.dto.SignWriteoffDto; |
| | | import com.matrix.system.activity.dto.SignWriteoffListDto; |
| | | import com.matrix.system.activity.dto.WriteoffCodeSubmitDto; |
| | | import com.matrix.system.activity.service.ActivitySignWriteoffService; |
| | | import com.matrix.system.activity.vo.SignWriteoffListVo; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | /** |
| | | * @description 核销记录 |
| | | * @author yourName |
| | | * @date 2021-04-08 14:25 |
| | | */ |
| | | @RestController |
| | | @RequestMapping(value = "admin/activitySignWriteoff") |
| | | public class ActivitySignWriteoffAction { |
| | | |
| | | @Autowired |
| | | private ActivitySignWriteoffService activitySignWriteoffService; |
| | | |
| | | /** |
| | | * 核销记录 |
| | | */ |
| | | @ApiOperation(value = "核销记录") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "OK", response = SignWriteoffListVo.class) |
| | | }) |
| | | @PostMapping(value = "/findSignWriteoffList") |
| | | public @ResponseBody |
| | | AjaxResult findSignWriteoffList(@RequestBody SignWriteoffListDto signWriteoffListDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(signWriteoffListDto); |
| | | //排序 |
| | | if(StringUtils.isBlank(signWriteoffListDto.getSort())){ |
| | | signWriteoffListDto.setSort("create_time"); |
| | | signWriteoffListDto.setOrder("desc"); |
| | | } |
| | | Page<SignWriteoffListVo> page = new Page(signWriteoffListDto.getPageNum(), signWriteoffListDto.getPageSize()); |
| | | IPage<SignWriteoffListVo> rows = activitySignWriteoffService.findSignWriteoffList(page,signWriteoffListDto); |
| | | AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal()); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | *进入核销 |
| | | */ |
| | | @ApiOperation(value = "进入核销") |
| | | @PostMapping(value = "/findSignWriteoff") |
| | | public @ResponseBody |
| | | AjaxResult findSignWriteoff(@RequestBody SignWriteoffDto signWriteoffDto) { |
| | | return activitySignWriteoffService.findSignWriteoff(signWriteoffDto); |
| | | } |
| | | |
| | | /** |
| | | *核销验证 |
| | | */ |
| | | @ApiOperation(value = "核销验证") |
| | | @PostMapping(value = "/writeoffCodeSubmit") |
| | | public @ResponseBody |
| | | AjaxResult writeoffCodeSubmit(@RequestBody WriteoffCodeSubmitDto writeoffCodeSubmitDto) { |
| | | return activitySignWriteoffService.writeoffCodeSubmit(writeoffCodeSubmitDto); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.dao; |
| | | |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.system.activity.dto.SignWriteoffListDto; |
| | | import com.matrix.system.activity.entity.ActivitySignWriteoff; |
| | | import com.matrix.system.activity.vo.SignWriteoffListVo; |
| | | import com.matrix.system.activity.vo.ZjrVo; |
| | | |
| | | /** |
| | | * @description 核销记录 |
| | | * @author yourName |
| | | * @date 2021-04-08 14:25 |
| | | */ |
| | | public interface ActivitySignWriteoffDao extends BaseMapper<ActivitySignWriteoff>{ |
| | | |
| | | IPage<SignWriteoffListVo> findSignWriteoffList(Page<SignWriteoffListVo> page, |
| | | @Param("record")SignWriteoffListDto signWriteoffListDto); |
| | | |
| | | ZjrVo selectUsernameByUserId(@Param("userId")Long userId, @Param("receiveId")Long receiveId); |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "SignWriteoffDto", description = "查询参数") |
| | | public class SignWriteoffDto { |
| | | |
| | | @ApiModelProperty(value ="核销ID") |
| | | private long writeoffId; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.dto; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "SignWriteoffListDto", description = "查询参数") |
| | | public class SignWriteoffListDto extends BasePageQueryDto { |
| | | |
| | | @ApiModelProperty(value ="中奖者姓名") |
| | | private String zjzxm; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "WriteoffCodeSubmitDto", description = "查询参数") |
| | | public class WriteoffCodeSubmitDto { |
| | | |
| | | @ApiModelProperty(value ="核销ID") |
| | | private long writeoffId; |
| | | |
| | | @ApiModelProperty(value ="兑奖码") |
| | | private String writeOffCode; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.matrix.core.anotations.Extend; |
| | | import com.matrix.system.score.entity.BaseEntity; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * @description 核销记录 |
| | | * @author yourName |
| | | * @date 2021-04-08 14:25 |
| | | */ |
| | | @Data |
| | | @TableName("activity_sign_writeoff") |
| | | public class ActivitySignWriteoff extends BaseEntity{ |
| | | @Extend |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 核销时间 |
| | | */ |
| | | |
| | | |
| | | private Date writeoffTime; |
| | | |
| | | /** |
| | | * 核销员 |
| | | */ |
| | | |
| | | |
| | | private String writeoffUser; |
| | | |
| | | /** |
| | | * 兑奖码 |
| | | */ |
| | | |
| | | |
| | | private String writeoffCode; |
| | | |
| | | /** |
| | | * 活动ID |
| | | */ |
| | | |
| | | |
| | | private Long actId; |
| | | |
| | | /** |
| | | * 奖品ID |
| | | */ |
| | | |
| | | |
| | | private Long awardId; |
| | | |
| | | /** |
| | | * 中奖时间 |
| | | */ |
| | | |
| | | |
| | | private Date winTime; |
| | | |
| | | /** |
| | | * 状态(1:待兑换 2:待发货 3:已兑换 ) |
| | | */ |
| | | private Integer state; |
| | | public static final int STATE_ONE = 1; |
| | | public static final int STATE_TWO = 2; |
| | | public static final int STATE_THREE = 3; |
| | | |
| | | /** |
| | | * 中奖者ID |
| | | */ |
| | | |
| | | |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 物流ID |
| | | */ |
| | | |
| | | |
| | | private Long logisticsId; |
| | | |
| | | /** |
| | | * 中奖记录ID |
| | | */ |
| | | |
| | | |
| | | private Long receiveId; |
| | | |
| | | /** |
| | | * 公司ID |
| | | */ |
| | | |
| | | |
| | | private Long companyId; |
| | | |
| | | /** |
| | | * 店铺ID |
| | | */ |
| | | |
| | | |
| | | private Long shopId; |
| | | |
| | | /** |
| | | * 核销员ID |
| | | */ |
| | | |
| | | |
| | | private Long writeoffUserid; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | //获取当前登录人员信息 |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | Long companyId = user.getCompanyId(); |
| | | /** |
| | | * todo签到活动的唯一性 |
| | | */ |
| | | |
| | | //新增活动主表信息 |
| | | ShopActivities shopActivities = new ShopActivities(); |
New file |
| | |
| | | package com.matrix.system.activity.service; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | 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.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.activity.dao.ActivitySignAwardSetDao; |
| | | import com.matrix.system.activity.dao.ActivitySignReceiveRecordDao; |
| | | import com.matrix.system.activity.dao.ActivitySignWriteoffDao; |
| | | import com.matrix.system.activity.dto.SignWriteoffDto; |
| | | import com.matrix.system.activity.dto.SignWriteoffListDto; |
| | | import com.matrix.system.activity.dto.WriteoffCodeSubmitDto; |
| | | import com.matrix.system.activity.entity.ActivitySignAwardSet; |
| | | import com.matrix.system.activity.entity.ActivitySignReceiveRecord; |
| | | import com.matrix.system.activity.entity.ActivitySignWriteoff; |
| | | import com.matrix.system.activity.vo.SignWriteoffListVo; |
| | | import com.matrix.system.activity.vo.SignWriteoffVo; |
| | | import com.matrix.system.activity.vo.ZjrVo; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.system.shopXcx.bean.ShopActivities; |
| | | import com.matrix.system.shopXcx.dao.ShopActivitiesDao; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @description 核销记录 |
| | | * @author yourName |
| | | * @date 2021-04-08 14:25 |
| | | */ |
| | | @Service |
| | | public class ActivitySignWriteoffService extends ServiceImpl<ActivitySignWriteoffDao, ActivitySignWriteoff>{ |
| | | |
| | | @Autowired |
| | | ActivitySignWriteoffDao activitySignWriteoffDao; |
| | | @Autowired |
| | | ShopActivitiesDao shopActivitiesDao; |
| | | @Autowired |
| | | ActivitySignAwardSetDao activitySignAwardSetDao; |
| | | @Autowired |
| | | ActivitySignReceiveRecordDao activitySignReceiveRecordDao; |
| | | @Autowired |
| | | SysVipInfoDao sysVipInfoDao; |
| | | |
| | | public IPage<SignWriteoffListVo> findSignWriteoffList(Page<SignWriteoffListVo> page, |
| | | SignWriteoffListDto signWriteoffListDto) { |
| | | return activitySignWriteoffDao.findSignWriteoffList(page,signWriteoffListDto); |
| | | } |
| | | |
| | | public AjaxResult findSignWriteoff(SignWriteoffDto signWriteoffDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(signWriteoffDto); |
| | | Long writeoffId = signWriteoffDto.getWriteoffId(); |
| | | AjaxResult result= AjaxResult.buildSuccessInstance("成功"); |
| | | //获取核销信息 |
| | | SignWriteoffVo signWriteoffVo = new SignWriteoffVo(); |
| | | ActivitySignWriteoff activitySignWriteoff = activitySignWriteoffDao.selectById(writeoffId); |
| | | if(ObjectUtil.isNotEmpty(activitySignWriteoff)) { |
| | | //获取奖品信息 |
| | | ActivitySignAwardSet activitySignAwardSet = activitySignAwardSetDao.selectById(activitySignWriteoff.getAwardId()); |
| | | signWriteoffVo.setJpmc(activitySignAwardSet.getAwardName()); |
| | | signWriteoffVo.setJptp(activitySignAwardSet.getIntroduceImg()); |
| | | signWriteoffVo.setSl(1); |
| | | signWriteoffVo.setDjfs(activitySignAwardSet.getAwardWay()); |
| | | //获取中奖人信息 |
| | | ZjrVo zjrVo = activitySignWriteoffDao.selectUsernameByUserId(activitySignWriteoff.getUserId(),activitySignAwardSet.getId()); |
| | | signWriteoffVo.setZjr(zjrVo.getZjr()); |
| | | signWriteoffVo.setZjsj(zjrVo.getZjsj()); |
| | | signWriteoffVo.setDjsj(activitySignWriteoff.getWriteoffTime()); |
| | | signWriteoffVo.setState(activitySignWriteoff.getState()); |
| | | //获取活动主表信息 |
| | | ShopActivities shopActivities = shopActivitiesDao.selectById(activitySignWriteoff.getActId()); |
| | | signWriteoffVo.setHdmc(shopActivities.getActName()); |
| | | signWriteoffVo.setHdbh(shopActivities.getActCode()); |
| | | } |
| | | result.putInMap("signWriteoffVo", signWriteoffVo); |
| | | return result; |
| | | } |
| | | |
| | | @Transactional |
| | | public AjaxResult writeoffCodeSubmit(WriteoffCodeSubmitDto writeoffCodeSubmitDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(writeoffCodeSubmitDto); |
| | | SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); |
| | | Long writeoffId = writeoffCodeSubmitDto.getWriteoffId(); |
| | | String writeOffCode = writeoffCodeSubmitDto.getWriteOffCode(); |
| | | /** |
| | | * 验证核销码是不是匹配 |
| | | * 更新核销记录 |
| | | * 更新领取记录 |
| | | */ |
| | | //验证核销码是不是匹配 |
| | | ActivitySignWriteoff activitySignWriteoff = activitySignWriteoffDao.selectById(writeoffId); |
| | | if(ObjectUtil.isNotEmpty(activitySignWriteoff)) { |
| | | String writeoffCodeReal = activitySignWriteoff.getWriteoffCode(); |
| | | if(!writeoffCodeReal.equals(writeOffCode)) { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "兑奖码无效"); |
| | | } |
| | | } |
| | | //更新核销记录 |
| | | activitySignWriteoff.setState(ActivitySignWriteoff.STATE_THREE); |
| | | activitySignWriteoff.setWriteoffTime(new Date()); |
| | | activitySignWriteoff.setWriteoffUser(sysUsers.getSuName()); |
| | | activitySignWriteoff.setWriteoffUserid(sysUsers.getSuId()); |
| | | activitySignWriteoffDao.updateById(activitySignWriteoff); |
| | | //更新领取记录 |
| | | ActivitySignReceiveRecord activitySignReceiveRecord = activitySignReceiveRecordDao.selectById(activitySignWriteoff.getReceiveId()); |
| | | activitySignReceiveRecord.setState(ActivitySignReceiveRecord.STATE_DONE); |
| | | activitySignReceiveRecordDao.updateById(activitySignReceiveRecord); |
| | | |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "核销成功"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.matrix.system.activity.vo; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class SignReceiveListVo { |
| | |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty(value = "签到时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8") |
| | | private Date reciveTime; |
| | | |
| | | @ApiModelProperty(value = "连续签到天数") |
| | |
| | | @ApiModelProperty(value = "获得奖励") |
| | | private String awardName; |
| | | |
| | | @ApiModelProperty(value ="奖项规则(1:每日奖励(默认)2:累计签到天数)") |
| | | private int awardRule; |
| | | @ApiModelProperty(value ="是否已领取(1:待领取2:已领取)") |
| | | private int state; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class SignWriteoffListVo { |
| | | |
| | | |
| | | private Long id; |
| | | |
| | | /** |
| | | * 核销时间 |
| | | */ |
| | | @ApiModelProperty(value ="核销时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8") |
| | | private Date writeoffTime; |
| | | |
| | | /** |
| | | * 核销员 |
| | | */ |
| | | @ApiModelProperty(value ="核销员") |
| | | private String writeoffUser; |
| | | |
| | | /** |
| | | * 兑奖码 |
| | | */ |
| | | @ApiModelProperty(value ="兑奖码") |
| | | private String writeoffCode; |
| | | |
| | | /** |
| | | * 活动名称 |
| | | */ |
| | | @ApiModelProperty(value ="活动名称") |
| | | private String actName; |
| | | |
| | | /** |
| | | * 奖品名称 |
| | | */ |
| | | @ApiModelProperty(value ="奖品名称") |
| | | private String awardName; |
| | | |
| | | /** |
| | | * 中奖时间 |
| | | */ |
| | | @ApiModelProperty(value ="中奖时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8") |
| | | private Date winTime; |
| | | |
| | | /** |
| | | * 状态 |
| | | */ |
| | | @ApiModelProperty(value ="状态(1:待兑换 2:待发货 3:已兑换)") |
| | | private int state; |
| | | |
| | | /** |
| | | * 兑奖方式 |
| | | */ |
| | | @ApiModelProperty(value ="兑奖方式(1:线下兑换2:物流配送3:客服兑换)") |
| | | private int awardWay; |
| | | |
| | | /** |
| | | * 中奖者 |
| | | */ |
| | | @ApiModelProperty(value ="中奖者") |
| | | private String receiveName; |
| | | |
| | | /** |
| | | * 收货地址 |
| | | */ |
| | | @ApiModelProperty(value ="收货地址") |
| | | private String receiveAddress; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.vo; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class SignWriteoffVo { |
| | | |
| | | @ApiModelProperty(value ="奖品名称") |
| | | private String jpmc; |
| | | |
| | | @ApiModelProperty(value ="奖品图片") |
| | | private String jptp; |
| | | |
| | | @ApiModelProperty(value ="数量") |
| | | private int sl; |
| | | |
| | | @ApiModelProperty(value ="中奖人") |
| | | private String zjr; |
| | | |
| | | @ApiModelProperty(value ="中奖时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone="GMT+8") |
| | | private Date zjsj; |
| | | |
| | | @ApiModelProperty(value ="活动名称") |
| | | private String hdmc; |
| | | |
| | | @ApiModelProperty(value ="活动编号") |
| | | private String hdbh; |
| | | |
| | | @ApiModelProperty(value ="兑奖方式") |
| | | private int djfs; |
| | | |
| | | @ApiModelProperty(value ="兑奖状态") |
| | | private int state; |
| | | |
| | | @ApiModelProperty(value ="兑奖时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone="GMT+8") |
| | | private Date djsj; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.vo; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | @Data |
| | | public class ZjrVo { |
| | | |
| | | @ApiModelProperty(value ="中奖人") |
| | | private String zjr; |
| | | |
| | | @ApiModelProperty(value ="中奖时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8") |
| | | private Date zjsj; |
| | | |
| | | } |
| | |
| | | import com.matrix.system.activity.dao.ActivitySignAwardSetDao; |
| | | import com.matrix.system.activity.dao.ActivitySignReceiveRecordDao; |
| | | import com.matrix.system.activity.dao.ActivitySignRecordDao; |
| | | import com.matrix.system.activity.dao.ActivitySignWriteoffDao; |
| | | import com.matrix.system.activity.entity.ActivitySignAwardSet; |
| | | import com.matrix.system.activity.entity.ActivitySignReceiveRecord; |
| | | import com.matrix.system.activity.entity.ActivitySignRecord; |
| | | import com.matrix.system.activity.entity.ActivitySignWriteoff; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.shopXcx.api.dto.ClickSignDTO; |
| | | import com.matrix.system.shopXcx.api.vo.ActivitySignAwardSetVo; |
| | |
| | | |
| | | @Autowired |
| | | private ActivitySignReceiveRecordDao activitySignReceiveRecordDao; |
| | | |
| | | @Autowired |
| | | private ActivitySignWriteoffDao activitySignWriteoffDao; |
| | | |
| | | @Autowired |
| | | private ActivitySignRecordDao activitySignRecordDao; |
| | |
| | | * 是否已领取 |
| | | * 查询是否有签到奖品 |
| | | * 日常奖励和自定义奖品 |
| | | * 生成核销记录 |
| | | */ |
| | | //活动是否存在 |
| | | ShopActivities shopActivities = shopActivitiesDao.selectById(actId); |
| | |
| | | signSuccessVo.setNormalAwardImg(activitySignAwardSetNormal.getIntroduceImg()); |
| | | } |
| | | //获取当前累计天数 |
| | | int cumulativeDay = getCumulativeDay(actId, userId, date, 1); |
| | | int cumulativeDay = getCumulativeDay(actId, userId, date, 0); |
| | | //自定义奖励 |
| | | QueryWrapper<ActivitySignAwardSet> queryWrapperCumulativeDay = new QueryWrapper<>(); |
| | | queryWrapperCumulativeDay.eq("award_rule",ActivitySignAwardSet.AWARDRULE_CUMULATIVEDAY); |
| | |
| | | signSuccessVo.setCouponName(activitySignAwardSetCumulativeDay.getCouponName()); |
| | | } |
| | | activitySignReceiveRecordDao.insert(activitySignReceiveRecord); |
| | | //生成核销记录 |
| | | if(ActivitySignAwardSet.AWARDTYPE_CUSTOMIZE == activitySignAwardSetCumulativeDay.getAwardType()) { |
| | | ActivitySignWriteoff activitySignWriteoff = new ActivitySignWriteoff(); |
| | | //线下兑换和客服兑换 |
| | | if(ActivitySignAwardSet.AWARDWAY_ONE == activitySignAwardSetCumulativeDay.getAwardWay() |
| | | || ActivitySignAwardSet.AWARDWAY_THREE == activitySignAwardSetCumulativeDay.getAwardWay()) { |
| | | activitySignWriteoff.setWriteoffCode(activitySignReceiveRecord.getWriteOffCode()); |
| | | } |
| | | activitySignWriteoff.setActId(actId); |
| | | activitySignWriteoff.setAwardId(activitySignAwardSetCumulativeDay.getId()); |
| | | activitySignWriteoff.setWinTime(date); |
| | | if(ActivitySignAwardSet.AWARDWAY_TWO == activitySignAwardSetCumulativeDay.getAwardWay()) { |
| | | activitySignWriteoff.setState(ActivitySignWriteoff.STATE_TWO); |
| | | }else { |
| | | activitySignWriteoff.setState(ActivitySignWriteoff.STATE_ONE); |
| | | } |
| | | activitySignWriteoff.setUserId(userId); |
| | | activitySignWriteoff.setCompanyId(companyId); |
| | | activitySignWriteoff.setReceiveId(activitySignReceiveRecord.getId()); |
| | | activitySignWriteoff.setCreateBy(user.getName()); |
| | | activitySignWriteoff.setCreateTime(new Date()); |
| | | activitySignWriteoff.setUpdateBy(user.getName()); |
| | | activitySignWriteoff.setUpdateTime(new Date()); |
| | | activitySignWriteoffDao.insert(activitySignWriteoff); |
| | | } |
| | | } |
| | | |
| | | AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("签到成功"); |
| | |
| | | |
| | | ALTER TABLE `activity_sign_receive_record` |
| | | CHANGE COLUMN `open_id` `user_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'openID' AFTER `id`; |
| | | |
| | | /** |
| | | * 核销记录 |
| | | * @author yourName |
| | | * @date 2021-04-08 14:25 |
| | | */ |
| | | CREATE TABLE activity_sign_writeoff( |
| | | create_by varchar(100) NOT NULL COMMENT '创建人', |
| | | create_time datetime NOT NULL COMMENT '创建时间', |
| | | update_by varchar(100) NOT NULL COMMENT '更新人', |
| | | update_time datetime NOT NULL COMMENT '更新时间', |
| | | id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', |
| | | |
| | | writeoff_time datetime COMMENT '核销时间', |
| | | |
| | | writeoff_user varchar(100) COMMENT '核销员', |
| | | |
| | | writeoff_code varchar(100) COMMENT '兑奖码', |
| | | |
| | | act_id bigint(20) COMMENT '活动ID', |
| | | |
| | | award_id bigint(20) COMMENT '奖品ID', |
| | | |
| | | win_time datetime COMMENT '中奖时间', |
| | | |
| | | state int(4) COMMENT '状态', |
| | | |
| | | user_id bigint(20) COMMENT '中奖者ID', |
| | | |
| | | logistics_id bigint(20) COMMENT '物流ID', |
| | | |
| | | receive_id bigint(20) COMMENT '中奖记录ID', |
| | | |
| | | company_id bigint(20) COMMENT '公司ID', |
| | | |
| | | shop_id bigint(20) COMMENT '店铺ID', |
| | | |
| | | writeoff_userid bigint(20) COMMENT '核销员ID', |
| | | |
| | | PRIMARY KEY(id) |
| | | )ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='核销记录'; |
| | | |
| | | |
| | | |
| | |
| | | a.id id, |
| | | b.nick_name nickName, |
| | | a.receive_time reciveTime, |
| | | a.state, |
| | | c.cumulative_day cumulativeDay, |
| | | c.award_type awardType, |
| | | c.award_name awardName |
| | | c.award_name awardName, |
| | | c.award_rule awardRule |
| | | FROM |
| | | activity_sign_receive_record a |
| | | LEFT JOIN biz_user b ON a.open_id = b.open_id |
| | | LEFT JOIN biz_user b ON a.user_id = b.user_id |
| | | LEFT JOIN activity_sign_award_set c ON a.award_id = c.id |
| | | <where> |
| | | a.company_id = #{record.companyId} |
New file |
| | |
| | | <?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.matrix.system.activity.dao.ActivitySignWriteoffDao"> |
| | | <!-- 定义ActivitySignWriteoff 的复杂关联map --> |
| | | <resultMap type="com.matrix.system.activity.entity.ActivitySignWriteoff" id="ActivitySignWriteoffMap"> |
| | | <id property="id" column="id" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="writeoffTime" column="writeoff_time" /> |
| | | <result property="writeoffUser" column="writeoff_user" /> |
| | | <result property="writeoffCode" column="writeoff_code" /> |
| | | <result property="actId" column="act_id" /> |
| | | <result property="awardId" column="award_id" /> |
| | | <result property="winTime" column="win_time" /> |
| | | <result property="state" column="state" /> |
| | | <result property="userId" column="user_id" /> |
| | | <result property="logisticsId" column="logistics_id" /> |
| | | <result property="receiveId" column="receive_id" /> |
| | | <result property="companyId" column="company_id" /> |
| | | <result property="shopId" column="shop_id" /> |
| | | <result property="writeoffUserid" column="writeoff_userid" /> |
| | | </resultMap> |
| | | |
| | | |
| | | <!-- 定义ActivitySignWriteoff 的简单map ,本map不添加其他的关联属性 --> |
| | | <resultMap type="com.matrix.system.activity.entity.ActivitySignWriteoff" id="ActivitySignWriteoffSimpleMap"> |
| | | <id property="id" column="id" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="writeoffTime" column="writeoff_time" /> |
| | | <result property="writeoffUser" column="writeoff_user" /> |
| | | <result property="writeoffCode" column="writeoff_code" /> |
| | | <result property="actId" column="act_id" /> |
| | | <result property="awardId" column="award_id" /> |
| | | <result property="winTime" column="win_time" /> |
| | | <result property="state" column="state" /> |
| | | <result property="userId" column="user_id" /> |
| | | <result property="logisticsId" column="logistics_id" /> |
| | | <result property="receiveId" column="receive_id" /> |
| | | <result property="companyId" column="company_id" /> |
| | | <result property="shopId" column="shop_id" /> |
| | | <result property="writeoffUserid" column="writeoff_userid" /> |
| | | </resultMap> |
| | | |
| | | <select id="findSignWriteoffList" resultType="com.matrix.system.activity.vo.SignWriteoffListVo"> |
| | | SELECT |
| | | a.id id, |
| | | a.writeoff_time writeoffTime, |
| | | a.writeoff_user writeoffUser, |
| | | a.writeoff_code writeoffCode, |
| | | a.state state, |
| | | b.nick_name receiveName, |
| | | c.act_name actName, |
| | | d.award_way awardWay, |
| | | d.award_name awardName, |
| | | e.receive_time winTime, |
| | | f.receive_address receiveAddress |
| | | FROM |
| | | activity_sign_writeoff a |
| | | left join biz_user b on a.user_id= b.user_id |
| | | left join shop_activities c on a.act_id= c.id |
| | | left join activity_sign_award_set d on a.award_id= d.id |
| | | left join activity_sign_receive_record e on a.receive_id= e.id |
| | | left join shop_delivery_info f on a.logistics_id= f.id |
| | | <where> |
| | | a.company_id = #{record.companyId} |
| | | <if test="record.zjzxm != null and record.zjzxm != ''"> |
| | | and b.nick_name like concat('%',#{record.zjzxm},'%') |
| | | </if> |
| | | </where> |
| | | <if test="record.sort !=null"> |
| | | order by |
| | | a.${record.sort} ${record.order} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectUsernameByUserId" resultType="com.matrix.system.activity.vo.ZjrVo"> |
| | | SELECT |
| | | a.receive_time zjsj, |
| | | b.nick_name zjr |
| | | FROM |
| | | activity_sign_receive_record a |
| | | left join biz_user b on a.user_id= b.user_id |
| | | where a.user_id = #{userId} and a.award_id = #{receiveId} |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <!DOCTYPE HTML> |
| | | <html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> |
| | | <meta name="renderer" content="webkit|ie-comp|ie-stand"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" |
| | | content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> |
| | | <meta http-equiv="Cache-Control" content="no-siteapp"/> |
| | | <!-- 本框架基本脚本和样式 --> |
| | | <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> |
| | | <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> |
| | | <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}"> |
| | | <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> |
| | | |
| | | <style> |
| | | |
| | | .el-aside { |
| | | background-color: #D3DCE6; |
| | | color: #333; |
| | | } |
| | | .el-main { |
| | | background-color: #E9EEF3; |
| | | color: #333; |
| | | } |
| | | body > .el-container { |
| | | margin-bottom: 1000px; |
| | | } |
| | | |
| | | </style> |
| | | </head> |
| | | |
| | | <body> |
| | | <div class="ibox-content" id="app" v-cloak> |
| | | |
| | | <el-container> |
| | | <el-aside width="50%"> |
| | | <el-row style="padding: 20px"> |
| | | <p class="el-big-title">中奖信息</p> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px;"> |
| | | <el-col> |
| | | <el-form :model="formSelect"> |
| | | <el-row> |
| | | <el-form-item label="奖品名称:" :label-width="formLabelWidth"> |
| | | {{formSelect.jpmc}} |
| | | </el-form-item> |
| | | </el-row> |
| | | <el-row style="display:flex;"> |
| | | <el-col> |
| | | <el-form-item label="奖品图片:" :label-width="formLabelWidth"> |
| | | {{formSelect.jptp}} |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col> |
| | | <el-form-item label="数量:" :label-width="formLabelWidth"> |
| | | {{formSelect.sl}} |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="display:flex;"> |
| | | <el-col> |
| | | <el-form-item label="中奖人:" :label-width="formLabelWidth"> |
| | | {{formSelect.zjr}} |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col> |
| | | <el-form-item label="中奖时间:" :label-width="formLabelWidth"> |
| | | {{formSelect.zjsj}} |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="display:flex;"> |
| | | <el-col> |
| | | <el-form-item label="活动名称:" :label-width="formLabelWidth"> |
| | | {{formSelect.hdmc}} |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col> |
| | | <el-form-item label="活动编号:" :label-width="formLabelWidth"> |
| | | {{formSelect.hdbh}} |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="display:flex;"> |
| | | <el-col> |
| | | <el-form-item label="兑奖方式:" :label-width="formLabelWidth"> |
| | | <span v-if="formSelect.djfs == 1">线下兑换</span> |
| | | <span v-if="formSelect.djfs == 2">物流配送</span> |
| | | <span v-if="formSelect.djfs == 3">客服兑换</span> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col> |
| | | <el-form-item label="兑奖时间:" :label-width="formLabelWidth"> |
| | | {{formSelect.djsj}} |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row style="padding: 20px"> |
| | | <p class="el-big-title">收货地址</p> |
| | | </el-row> |
| | | <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px"> |
| | | <el-row style="padding: 10px"> |
| | | <el-col class="col-sm-10" > |
| | | <el-form-item label="收货人:" prop="shr"> |
| | | <el-input v-model="ruleForm.shr"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="padding: 10px"> |
| | | <el-col class="col-sm-10" > |
| | | <el-form-item label="联系电话:" prop="lxdh"> |
| | | <el-input v-model="ruleForm.lxdh"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="padding: 10px"> |
| | | <el-col class="col-sm-10" > |
| | | <el-form-item label="收货地址:" prop="shdz"> |
| | | <el-input v-model="ruleForm.shdz"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row style="padding: 20px"> |
| | | <p class="el-big-title">发货信息</p> |
| | | </el-row> |
| | | <el-row style="padding: 10px"> |
| | | <el-col class="col-sm-10" > |
| | | <el-form-item label="配送方式:" > |
| | | <span>物流配送</span> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="padding: 10px"> |
| | | <el-col class="col-sm-10" > |
| | | <el-form-item label="快递公司:" prop="kdgs"> |
| | | <el-input v-model="ruleForm.kdgs"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="padding: 10px"> |
| | | <el-col class="col-sm-10" > |
| | | <el-form-item label="快递单号:" prop="kddh"> |
| | | <el-input v-model="ruleForm.kddh"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="padding: 10px"> |
| | | <el-col class="col-sm-12 text-center"> |
| | | <el-button type="primary" v-if="formSelect.state == 1" @click="dataSubmit('ruleForm')">发货</el-button> |
| | | <el-button type="danger" @click="cancelSubmit">关闭</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </el-aside> |
| | | |
| | | <el-main width="50%"> |
| | | <el-row> |
| | | <p class="el-big-title">物流跟踪</p> |
| | | </el-row> |
| | | |
| | | <el-row style="padding: 10px"> |
| | | <el-steps :active="active" simple> |
| | | <el-step :title="item.title" :icon="item.icon" v-for="item in stepData" :key ="item.index"></el-step> |
| | | </el-steps> |
| | | </el-row> |
| | | |
| | | </el-main> |
| | | |
| | | </el-container> |
| | | </div> |
| | | </body> |
| | | <script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> |
| | | <script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> |
| | | <script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> |
| | | |
| | | <script> |
| | | var writeoffId = $.query.get("writeoffId"); |
| | | var app = new Vue({ |
| | | el: '#app', |
| | | data: { |
| | | formLabelWidth: '120px', |
| | | //基本信息 |
| | | formSelect: { |
| | | jpmc: '', |
| | | jptp: '', |
| | | sl: '', |
| | | zjr: '', |
| | | zjsj: '', |
| | | hdmc: '', |
| | | hdbh: '', |
| | | djfs: '', |
| | | state: '', |
| | | djsj: '' |
| | | }, |
| | | //物流信息 |
| | | ruleForm : { |
| | | shr:'', |
| | | lxdh:'', |
| | | shdz:'', |
| | | kdgs:'', |
| | | kddh:'', |
| | | }, |
| | | active: 0, // 控制步骤条及填写条目的显示 |
| | | stepData: [{index: 0, title: '步骤1', icon: 'el-icon-edit'}, |
| | | {index: 1, title: '步骤2', icon: 'el-icon-edit'}, |
| | | {index: 2, title: '步骤3', icon: 'el-icon-edit'}], |
| | | rules : { |
| | | shr : [ |
| | | { required: true, message: '请输入收货人', trigger: 'blur' } |
| | | ], |
| | | lxdh : [ |
| | | { required: true, message: '请输入联系电话', trigger: 'blur' } |
| | | ], |
| | | shdz : [ |
| | | { required: true, message: '请输入收货地址', trigger: 'blur' } |
| | | ], |
| | | kdgs : [ |
| | | { required: true, message: '请选择快递公司', trigger: 'blur' } |
| | | ], |
| | | kddh : [ |
| | | { required: true, message: '请输入快递单号', trigger: 'blur' } |
| | | ], |
| | | }, |
| | | }, |
| | | created: function () { |
| | | this.loadInfo(); |
| | | }, |
| | | mounted: function () { |
| | | }, |
| | | methods: { |
| | | //加载分类 |
| | | loadInfo() { |
| | | let _this = this; |
| | | //加载配置 |
| | | AjaxProxy.requst({ |
| | | app: _this, |
| | | data: {writeoffId}, |
| | | url: basePath + '/admin/activitySignWriteoff/findSignWriteoff', |
| | | callback: function (data) { |
| | | _this.formSelect = data.mapInfo.signWriteoffVo; |
| | | } |
| | | }); |
| | | }, |
| | | //核销 |
| | | dataSubmit : function(formName) { |
| | | const _this = this; |
| | | _this.$refs[formName].validate((valid) => { |
| | | if (!valid) { |
| | | return; |
| | | } |
| | | }); |
| | | let resultData = { |
| | | writeoffId : writeoffId, |
| | | writeOffCode : _this.ruleForm.writeOffCode, |
| | | } |
| | | AjaxProxy.requst({ |
| | | app: _this, |
| | | data: resultData, |
| | | url: basePath + '/admin/activitySignWriteoff/writeoffCodeSubmit', |
| | | callback: function (data) { |
| | | _this.$message({ |
| | | message: data.info, |
| | | type: 'success', |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | cancelSubmit() { |
| | | this.closeFrame(); |
| | | }, |
| | | closeFrame() { |
| | | parent.layer.close(parent.layer.getFrameIndex(window.name)); |
| | | }, |
| | | } |
| | | }) |
| | | </script> |
| | | |
| | | </body> |
| | | </html> |
| | |
| | | show-overflow-tooltip> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="cumulativeDay" |
| | | label="连续签到天数" |
| | | label="状态" |
| | | show-overflow-tooltip> |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.row.state == 1">待领取</span> |
| | | <span v-if="scope.row.state == 2">已领取</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="奖励类型"> |
| | | label="签到类型" |
| | | show-overflow-tooltip> |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.row.awardRule == 1">日常奖励</span> |
| | | <span v-if="scope.row.awardRule == 2">累计签到奖励</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="连续签到天数" |
| | | show-overflow-tooltip> |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.row.awardRule == 2">{{scope.row.cumulativeDay}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="奖品类型"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.row.awardType == 1">自定义礼品</span> |
| | | <span v-if="scope.row.awardType == 2">积分</span> |
New file |
| | |
| | | <!DOCTYPE HTML> |
| | | <html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> |
| | | <meta name="renderer" content="webkit|ie-comp|ie-stand"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" |
| | | content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> |
| | | <meta http-equiv="Cache-Control" content="no-siteapp"/> |
| | | <!-- 本框架基本脚本和样式 --> |
| | | <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> |
| | | <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> |
| | | <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}"> |
| | | <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> |
| | | </head> |
| | | |
| | | <body> |
| | | <div class="ibox-content" id="app" v-cloak> |
| | | <el-row> |
| | | <p class="el-big-title">中奖信息</p> |
| | | </el-row> |
| | | <el-row style="margin-top: 20px;"> |
| | | <el-col> |
| | | <el-form :model="formSelect"> |
| | | <el-row> |
| | | <el-form-item label="奖品名称:" :label-width="formLabelWidth"> |
| | | {{formSelect.jpmc}} |
| | | </el-form-item> |
| | | </el-row> |
| | | <el-row style="display:flex;"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="奖品图片:" :label-width="formLabelWidth"> |
| | | {{formSelect.jptp}} |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="数量:" :label-width="formLabelWidth"> |
| | | {{formSelect.sl}} |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="display:flex;"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="中奖人:" :label-width="formLabelWidth"> |
| | | {{formSelect.zjr}} |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="中奖时间:" :label-width="formLabelWidth"> |
| | | {{formSelect.zjsj}} |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="display:flex;"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="活动名称:" :label-width="formLabelWidth"> |
| | | {{formSelect.hdmc}} |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="活动编号:" :label-width="formLabelWidth"> |
| | | {{formSelect.hdbh}} |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="display:flex;"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="兑奖方式:" :label-width="formLabelWidth"> |
| | | <span v-if="formSelect.djfs == 1">线下兑换</span> |
| | | <span v-if="formSelect.djfs == 2">物流配送</span> |
| | | <span v-if="formSelect.djfs == 3">客服兑换</span> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="兑奖时间:" :label-width="formLabelWidth"> |
| | | {{formSelect.djsj}} |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row style="margin-top: 20px;"> |
| | | <el-col class="col-sm-2" > |
| | | <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" v-if="formSelect.state == 1"> |
| | | <el-form-item label="兑奖码" prop="writeOffCode"> |
| | | <el-input v-model="ruleForm.writeOffCode" placeholder="请输入兑奖码"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-col> |
| | | <el-col class="col-sm-2 text-center"> |
| | | <el-button type="primary" v-if="formSelect.state == 1" @click="dataSubmit('ruleForm')">核销</el-button> |
| | | <el-button type="danger" @click="cancelSubmit">关闭</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </body> |
| | | <script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> |
| | | <script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> |
| | | <script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> |
| | | |
| | | <script> |
| | | var writeoffId = $.query.get("writeoffId"); |
| | | var app = new Vue({ |
| | | el: '#app', |
| | | data: { |
| | | formLabelWidth: '120px', |
| | | formSelect: { |
| | | jpmc: '', |
| | | jptp: '', |
| | | sl: '', |
| | | zjr: '', |
| | | zjsj: '', |
| | | hdmc: '', |
| | | hdbh: '', |
| | | djfs: '', |
| | | state: '', |
| | | djsj: '' |
| | | }, |
| | | ruleForm : { |
| | | writeOffCode:'', |
| | | }, |
| | | rules : { |
| | | writeOffCode : [ |
| | | { required: true, message: '请输入兑奖码', trigger: 'blur' } |
| | | ], |
| | | }, |
| | | }, |
| | | created: function () { |
| | | this.loadInfo(); |
| | | }, |
| | | mounted: function () { |
| | | }, |
| | | methods: { |
| | | //加载分类 |
| | | loadInfo() { |
| | | let _this = this; |
| | | //加载配置 |
| | | AjaxProxy.requst({ |
| | | app: _this, |
| | | data: {writeoffId}, |
| | | url: basePath + '/admin/activitySignWriteoff/findSignWriteoff', |
| | | callback: function (data) { |
| | | _this.formSelect = data.mapInfo.signWriteoffVo; |
| | | } |
| | | }); |
| | | }, |
| | | //核销 |
| | | dataSubmit : function(formName) { |
| | | const _this = this; |
| | | let flag = false; |
| | | _this.$refs[formName].validate((valid) => { |
| | | if (!valid) { |
| | | flag = true; |
| | | return; |
| | | } |
| | | }); |
| | | if (flag) { |
| | | return; |
| | | } |
| | | let resultData = { |
| | | writeoffId : writeoffId, |
| | | writeOffCode : _this.ruleForm.writeOffCode, |
| | | } |
| | | AjaxProxy.requst({ |
| | | app: _this, |
| | | data: resultData, |
| | | url: basePath + '/admin/activitySignWriteoff/writeoffCodeSubmit', |
| | | callback: function (data) { |
| | | _this.$message({ |
| | | message: data.info, |
| | | type: 'success', |
| | | }); |
| | | parent.layer.close(parent.layer.getFrameIndex(window.name)); |
| | | parent.location.reload(); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | cancelSubmit() { |
| | | this.closeFrame(); |
| | | }, |
| | | closeFrame() { |
| | | parent.layer.close(parent.layer.getFrameIndex(window.name)); |
| | | parent.location.reload(); |
| | | }, |
| | | } |
| | | }) |
| | | </script> |
| | | |
| | | </body> |
| | | </html> |
New file |
| | |
| | | <!DOCTYPE HTML> |
| | | <html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> |
| | | <meta name="renderer" content="webkit|ie-comp|ie-stand"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" |
| | | content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> |
| | | <meta http-equiv="Cache-Control" content="no-siteapp"/> |
| | | <!-- 本框架基本脚本和样式 --> |
| | | <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> |
| | | <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> |
| | | <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}"> |
| | | <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> |
| | | |
| | | <!-- 富文本编辑器 --> |
| | | <script type="text/javascript" charset="utf-8" |
| | | th:src="@{/plugin/beditor/ueditor.config.js}"></script> |
| | | <script type="text/javascript" charset="utf-8" |
| | | th:src="@{/plugin/beditor/ueditor.all.js}"> |
| | | </script> |
| | | <script type="text/javascript" charset="utf-8" |
| | | th:src="@{/plugin/beditor/lang/zh-cn/zh-cn.js}"></script> |
| | | <style> |
| | | .panel-body{ |
| | | overflow: hidden; |
| | | } |
| | | .paginationStyle{ |
| | | background: #ffffff; |
| | | padding: 10px 10px; |
| | | margin: 0px 0px 10px 0px; |
| | | text-align: right; |
| | | } |
| | | </style> |
| | | </head> |
| | | |
| | | <body> |
| | | <div class="panel-body" id="app" v-cloak> |
| | | <el-row> |
| | | <el-row style="display:flex;"> |
| | | <el-col> |
| | | <el-form ref="form" :model="form" inline > |
| | | <el-form-item label="中奖人名称" prop="yhmc" > |
| | | <el-input v-model="form.yhmc" placeholder="中奖人名称"></el-input> |
| | | </el-form-item> |
| | | <el-button type="primary" @click="searchFormSignReceive" >搜索</el-button> |
| | | <el-button @click="resetFormSignReceive('form')">重置</el-button> |
| | | </el-form> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row class="table-style" > |
| | | <el-table ref="multipleTable" |
| | | :data="signWriteoffList.rows" |
| | | :height="height" |
| | | stripe:true |
| | | @sort-change="sortChange"> |
| | | <el-table-column |
| | | prop="writeoffTime" |
| | | label="核销时间" |
| | | show-overflow-tooltip> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="writeoffUser" |
| | | label="核销员" |
| | | show-overflow-tooltip> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="兑奖码" |
| | | show-overflow-tooltip> |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.row.state == 3">{{scope.row.writeoffCode}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="actName" |
| | | label="活动名称" |
| | | show-overflow-tooltip> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="awardName" |
| | | label="奖品名称" |
| | | show-overflow-tooltip> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="winTime" |
| | | label="中奖时间" |
| | | show-overflow-tooltip> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="状态"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.row.state == 1">待兑换</span> |
| | | <span v-if="scope.row.state == 2">待发货</span> |
| | | <span v-if="scope.row.state == 3">已兑换</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="兑奖方式"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.row.awardWay == 1">线下兑换</span> |
| | | <span v-if="scope.row.awardWay == 2">物流配送</span> |
| | | <span v-if="scope.row.awardWay == 3">客服兑换</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="receiveName" |
| | | label="中奖者" |
| | | show-overflow-tooltip> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="receiveAddress" |
| | | label="收货地址" |
| | | show-overflow-tooltip> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="200"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="primary" v-if="scope.row.awardWay == 2 && scope.row.state == 2" @click="jumpTologistics(scope.row)" size="mini">发货</el-button> |
| | | <el-button type="primary" v-if="scope.row.awardWay != 2 && scope.row.state == 1" @click="jumpToWriteOff(scope.row)" size="mini">核销</el-button> |
| | | |
| | | <el-button type="primary" v-if="scope.row.awardWay == 2" @click="jumpTologistics(scope.row)" size="mini">查看</el-button> |
| | | <el-button type="primary" v-if="scope.row.awardWay != 2" @click="jumpToWriteOff(scope.row)" size="mini">查看</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | </el-table> |
| | | </el-row> |
| | | <el-row class="paginationStyle" > |
| | | <el-pagination background |
| | | @size-change="changePageSignReceive" |
| | | @current-change="changeCurrentPageSignReceive" |
| | | :current-page="signWriteoffList.currentPage" |
| | | :page-sizes="[10, 20, 30, 50]" |
| | | :page-size="signWriteoffList.pageSize" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="signWriteoffList.total"> |
| | | </el-pagination> |
| | | </el-row> |
| | | </el-row> |
| | | </div> |
| | | </body> |
| | | <script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> |
| | | <script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> |
| | | <script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> |
| | | <script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script> |
| | | <script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> |
| | | |
| | | <script> |
| | | //获取传输的活动对象 |
| | | var actId = $.query.get("actId"); |
| | | |
| | | var app = new Vue({ |
| | | el: '#app', |
| | | data: { |
| | | height:'calc(100vh - 200px)', |
| | | //--时间选择 |
| | | pickerOptions: { |
| | | shortcuts: [{ |
| | | text: '最近一周', |
| | | onClick(picker) { |
| | | const end = new Date(); |
| | | const start = new Date(); |
| | | start.setTime(start.getTime() - 3600 * 1000 * 24 * 7); |
| | | picker.$emit('pick', [start, end]); |
| | | } |
| | | }, { |
| | | text: '最近一个月', |
| | | onClick(picker) { |
| | | const end = new Date(); |
| | | const start = new Date(); |
| | | start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); |
| | | picker.$emit('pick', [start, end]); |
| | | } |
| | | }, { |
| | | text: '最近三个月', |
| | | onClick(picker) { |
| | | const end = new Date(); |
| | | const start = new Date(); |
| | | start.setTime(start.getTime() - 3600 * 1000 * 24 * 90); |
| | | picker.$emit('pick', [start, end]); |
| | | } |
| | | }] |
| | | }, |
| | | // 条件查询 |
| | | form:{ |
| | | yhmc:'', |
| | | order:'', |
| | | sort:'' |
| | | }, |
| | | //核销列表 |
| | | signWriteoffList:{ |
| | | rows:[], |
| | | total:0, |
| | | pageSize:10, |
| | | currentPage:1, |
| | | }, |
| | | }, |
| | | created: function () { |
| | | this.loadInfo(); |
| | | }, |
| | | mounted: function () { |
| | | }, |
| | | methods: { |
| | | //加载分类 |
| | | loadInfo() { |
| | | let _this = this; |
| | | _this.loadSignWriteoffList(); |
| | | }, |
| | | //跳转到核销 |
| | | jumpToWriteOff(row){ |
| | | layer.full(layer.open({ |
| | | type: 2, |
| | | title: "核销", |
| | | maxmin: true, |
| | | area: [MUI.SIZE_L, '500px'], |
| | | content : [ basePath + '/admin/redirect/activity/activity-sign-writeoff-info?writeoffId=' + row.id] |
| | | })); |
| | | }, |
| | | //跳转到发货 |
| | | jumpTologistics(row){ |
| | | layer.full(layer.open({ |
| | | type: 2, |
| | | title: "核销", |
| | | maxmin: true, |
| | | area: [MUI.SIZE_L, '500px'], |
| | | content : [ basePath + '/admin/redirect/activity/activity-sign-logistics-info?writeoffId=' + row.id] |
| | | })); |
| | | }, |
| | | //--列表 |
| | | loadSignWriteoffList() { |
| | | let _this = this; |
| | | let data=_this.getRequestParamSignWriteoff(); |
| | | data.pageSize=_this.signWriteoffList.pageSize; |
| | | data.pageNum=_this.signWriteoffList.currentPage; |
| | | AjaxProxy.requst({ |
| | | app: _this, |
| | | data:data, |
| | | url: basePath + '/admin/activitySignWriteoff/findSignWriteoffList', |
| | | callback: function (data) { |
| | | _this.signWriteoffList.rows = data.rows; |
| | | _this.signWriteoffList.total = data.total; |
| | | } |
| | | }); |
| | | }, |
| | | //查询参数 |
| | | getRequestParamSignWriteoff(){ |
| | | let _this = this; |
| | | return { |
| | | zjzxm:_this.form.yhmc, |
| | | order:_this.form.order, |
| | | sort:_this.form.sort, |
| | | } |
| | | }, |
| | | //查询 |
| | | searchFormSignReceive:function(){ |
| | | this.signWriteoffList.currentPage=1; |
| | | this.loadSignWriteoffList(); |
| | | }, |
| | | //重置 |
| | | resetFormSignReceive(formName) { |
| | | this.$refs[formName].resetFields(); |
| | | }, |
| | | changePageSignReceive(val) { |
| | | this.signWriteoffList.pageSize = val; |
| | | this.loadSignWriteoffList(); |
| | | }, |
| | | changeCurrentPageSignReceive(val) { |
| | | this.signWriteoffList.currentPage = val; |
| | | this.loadSignWriteoffList(); |
| | | }, |
| | | //排序 |
| | | sortChange:function (column){ |
| | | if(column.order){ |
| | | if(column.order.indexOf("desc")){ |
| | | this.form.order="desc"; |
| | | }else{ |
| | | this.form.order="asc"; |
| | | } |
| | | this.form.sort=column.prop; |
| | | this.loadInfo(); |
| | | } |
| | | }, |
| | | } |
| | | }) |
| | | </script> |
| | | |
| | | </body> |
| | | </html> |