diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/ActConstants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/ActConstants.java new file mode 100644 index 000000000..f94020f4f --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/ActConstants.java @@ -0,0 +1,116 @@ +package com.ruoyi.common.constant; + +import java.util.ArrayList; +import java.util.List; + +/** + * TODO + * + * @author dy + * @version 1.0 + * @date 2021/4/19 10:58 + */ +public class ActConstants { + public static final String DATE_FORMAT1 = "yyyyMMddHHmmssSSS"; + public static final String DATE_FORMAT2 = "yyyy-MM-dd-HH:mm:ss"; + public static final String DATE_FORMAT3 = "yyyyMMdd"; + public static final String DATE_FORMAT4 = "HHmmssSSS"; + /** 任务完成通知记录状态 **/ + /** 有效 **/ + public static final String TASK_NOTIFY_RECORD_STATUS_EFFECTIVE = "1"; + /** 失效 **/ + public static final String TASK_NOTIFY_RECORD_STATUS_EXPIRE = "0"; + /** 活动状态 **/ + /** 有效 **/ + public static final String DRAW_STATUS_EFFECTIVE = "1"; + /** 失效 **/ + public static final String DRAW_STATUS_EXPIRE = "0"; + /** 奖项配置状态 **/ + /** 有效 */ + public static final String DRAW_CONFIG_STATUS_EFFECTIVE = "1"; + /** 失效 **/ + public static final String DRAW_CONFIG_STATUS_EXPIRE = "0"; + /** 抽奖类型 **/ + /** 积分抽奖 **/ + public static final String DRAW_EXPE_INTEGRAL = "integral"; + /** 次数抽奖 **/ + public static final String DRAW_EXPE_TASK = "task"; + /** 抽奖记录状态 **/ + /** 没中奖 **/ + public static final String DRAW_RECORD_RESULT_NONE = "0"; + /** 中奖待发奖---发奖失败 **/ + public static final String DRAW_RECORD_RESULT_PRIZE = "1"; + /** 发奖成功 **/ + public static final String DRAW_RECORD_RESULT_AWARDS = "2"; + /** 奖品级别--空奖 1654**/ + public static final String PRIZE_LEVEL_BLANK = "blank"; + /** 奖品类型 ***/ + public static final String PRIZE_TYPE_BLANK = "empty"; + /**一账通**/ + public static final String PRIZE_TYPE_VOCHER = "vocher"; + /**实物**/ + public static final String PRIZE_TYPE_MATERIALOBJECT = "materialObject"; + /**积分**/ + public static final String PRIZE_TYPE_INTEGRAL = "integral"; + /**i购券**/ + public static final String PRIZE_TYPE_IEMALL = "iemall"; + /**公开码电子券**/ + public static final String PRIZE_TYPE_PCOUPON = "pcoupon"; + /**隐藏码电子券**/ + public static final String PRIZE_TYPE_SCOUPON = "scoupon"; + /**1656 积分平台虚拟电子券**/ + public static final String PRIZE_TYPE_VCOUPON = "vcoupon"; + /**服务奖品**/ + public static final String PRIZE_TYPE_SERVICE = "service"; + /**保险奖品**/ + public static final String PRIZE_TYPE_INSURANCE = "insurance"; + /**随机红包**/ + public static final String PRIZE_TYPE_WELFARE = "welfare"; + /**一账通现金红包 1654**/ + public static final String PRIZE_TYPE_CASH = "cash"; + /**发奖结果**/ + public static final String AWARD_RESULT_SUCCESS="1"; + public static final String AWARD_RESULT_FAIL="0"; + /**活动类型-转盘抽奖**/ + public static final String DRAW_TYPE_TURN_TABLE="turnTable"; + /**奖品发放通知类型**/ + public static final List AWARD_TYPE=new ArrayList(); + static{ + AWARD_TYPE.add("001"); + AWARD_TYPE.add("002"); + AWARD_TYPE.add("003"); + AWARD_TYPE.add("004"); + AWARD_TYPE.add("005"); + AWARD_TYPE.add("006"); + } + /**异步发列表**/ + /**请求类型**/ + public static final String TASK_TYPE_VALIDATE="1"; + public static final String TASK_TYPE_SHARE="2"; + public static final String TASK_TYPE_OTHER="3"; + /** + * 1654 + * 一账通支付 + */ + public static final String TASK_TYPE_PAY="9"; + /**一账通验证状态**/ + public static final String TASK_NOTIFY_VSTATE_TRUE="1"; + public static final String TASK_NOTIFY_VSTATE_FALSE="0"; + /**发将限制规则**/ + public static final String AWARD_TYPE_NONE="none"; + /**单个活动限制**/ + public static final String AWARD_TYPE_DISTINCTION="distinction"; + /**不区分活动限制**/ + public static final String AWARD_TYPE_NODISTINCTION="nodistinction"; + /**用户等级**/ + /**一般用户**/ + public static final String USER_LEVEL_ORDINARY="1"; + /**高价值客户**/ + public static final String USER_LEVEL_SENIOR="2"; + + /**领奖方式**/ + /**自动领取**/ + public static final String AWARD_METHOD_AUTO="1"; + /**手动领取**/ + public static final String AWARD_METHOD_MANAL="0"; +} diff --git a/sino-act-web/src/main/java/com/ruoyi/web/controller/draw/DrawController.java b/sino-act-web/src/main/java/com/ruoyi/web/controller/draw/DrawController.java index cb70f545c..690abb9a5 100644 --- a/sino-act-web/src/main/java/com/ruoyi/web/controller/draw/DrawController.java +++ b/sino-act-web/src/main/java/com/ruoyi/web/controller/draw/DrawController.java @@ -14,6 +14,7 @@ import com.sinosoft.activity.service.IDrawTaskNotifyService; import com.sinosoft.activity.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import me.chanjar.weixin.common.bean.WxOAuth2UserInfo; import me.chanjar.weixin.common.bean.oauth2.WxOAuth2AccessToken; @@ -61,6 +62,8 @@ public class DrawController { @Autowired private IActPageConfigUserinfoService iActPageConfigUserinfoService; + @Autowired + private IDrawTaskNotifyService taskNotifyService; private WxOAuth2UserInfo getUserInfo(HttpServletRequest request, String code) throws Exception { // if (!this.wxService.switchover(appid)) { @@ -240,6 +243,19 @@ public class DrawController { } return result; } + + /** + * 增加抽奖次数 + * @param request + * @param drawCode + * @param taskType + * @return + */ + @ApiOperation("增加抽奖次数") + @ApiImplicitParams({ + @ApiImplicitParam(name = "drawCode", value = "活动编码", required = true, dataType = "string", paramType = "path"), + @ApiImplicitParam(name = "taskType", value = "第三方活动编码", required = true, dataType = "string", paramType = "path") + }) @RequestMapping(value="/addDrawNum", method = RequestMethod.POST) @ResponseBody public Result addDrawNum(HttpServletRequest request, String drawCode, String taskType) { @@ -255,6 +271,13 @@ public class DrawController { return result; } String openId = userInfo.getOpenid(); + DrawTaskNotify drawTaskNotify = new DrawTaskNotify(); + drawTaskNotify.setISSPECIALFLAG("0"); + drawTaskNotify.setUSERID(openId); + drawTaskNotify.setTASKTYPE(taskType); + drawTaskNotify.setADDNUMBER(1); + drawTaskNotify.setDRAWCODE(drawCode); + taskNotifyService.addDrawNum(drawTaskNotify); //赠送抽奖机会 // TaskNotifyRequestBody requestBody = new TaskNotifyRequestBody(); // requestBody.setTaskId(""); diff --git a/sino-act-web/src/main/resources/public/act/guide.html b/sino-act-web/src/main/resources/public/act/guide.html index c6f0760ad..1747c83f9 100644 --- a/sino-act-web/src/main/resources/public/act/guide.html +++ b/sino-act-web/src/main/resources/public/act/guide.html @@ -14,7 +14,7 @@ - +