Merge remote-tracking branch 'origin/activity' into activity

This commit is contained in:
wanghuayue 2021-04-12 15:47:57 +08:00
commit 4172953518
33 changed files with 1716 additions and 193 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -7,10 +7,7 @@ import java.util.List;
import com.alibaba.fastjson.JSON;
import com.sinosoft.activity.domain.ActConfig;
import com.sinosoft.activity.domain.DrawInfo;
import com.sinosoft.activity.domain.DrawPrizeInfo;
import com.sinosoft.activity.domain.DrawRule;
import com.sinosoft.activity.domain.*;
import com.sinosoft.activity.service.*;
import com.sinosoft.activity.vo.ActVO;
import org.apache.shiro.authz.annotation.RequiresPermissions;
@ -76,39 +73,46 @@ public class DrawInfoController extends BaseController
@ResponseBody
public AjaxResult addSave(@RequestBody ActVO vo)
{
logger.info("前台传参"+ JSON.toJSONString(vo));
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmssSSS");
Date date = new Date();
//新增基本信息
vo.getDrawInfo().setCREATETIMESTAMP(date);
String code = format.format(date);
vo.getDrawInfo().setDRAWCODE(code);
drawInfoService.insertDrawInfo(vo.getDrawInfo());
try{
logger.info("前台传参"+ JSON.toJSONString(vo));
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmssSSS");
Date date = new Date();
//新增基本信息
vo.getDrawInfo().setCREATETIMESTAMP(date);
String code = format.format(date);
vo.getDrawInfo().setDRAWCODE(code);
drawInfoService.insertDrawInfo(vo.getDrawInfo());
//新增展示内容
vo.getActPageConfigGuide().setCreateTime(date);
vo.getActPageConfigGuide().setActCode(code);
iActPageConfigGuideService.insertActPageConfigGuide(vo.getActPageConfigGuide());
//新增展示内容
vo.getActPageConfigGuide().setCreateTime(date);
vo.getActPageConfigGuide().setActCode(code);
iActPageConfigGuideService.insertActPageConfigGuide(vo.getActPageConfigGuide());
//新增选择玩法
vo.getDrawRule().setCREATETIMESTAMP(date);
vo.getDrawRule().setDRAWCODE(code);
iDrawRuleService.insertDrawRule(vo.getDrawRule());
//新增选择玩法
vo.getDrawRule().setCREATETIMESTAMP(date);
vo.getDrawRule().setDRAWCODE(code);
iDrawRuleService.insertDrawRule(vo.getDrawRule());
//新增收集信息
vo.getActPageConfigUserinfo().setCreateTime(date);
vo.getActPageConfigUserinfo().setActCode(code);
iActPageConfigUserinfoService.insertActPageConfigUserinfo(vo.getActPageConfigUserinfo());
//新增收集信息
vo.getActPageConfigUserinfo().setCreateTime(date);
vo.getActPageConfigUserinfo().setActCode(code);
iActPageConfigUserinfoService.insertActPageConfigUserinfo(vo.getActPageConfigUserinfo());
//新增分享信息
vo.getActConfig().setCreateTime(date);
vo.getActConfig().setActCode(code);
iActConfigService.insertActConfig(vo.getActConfig());
//新增二维码信息
vo.getActPageConfigSubscribe().setCreateTime(date);
vo.getActPageConfigSubscribe().setActCode(code);
int i = iActPageConfigSubscribeService.insertActPageConfigSubscribe(vo.getActPageConfigSubscribe());
return toAjax(i);
//新增分享信息
vo.getActConfig().setCreateTime(date);
vo.getActConfig().setActCode(code);
vo.getActConfig().setActName(vo.getDrawInfo().getDRAWNAME());
iActConfigService.insertActConfig(vo.getActConfig());
//新增二维码信息
vo.getActPageConfigSubscribe().setCreateTime(date);
vo.getActPageConfigSubscribe().setActCode(code);
int i = iActPageConfigSubscribeService.insertActPageConfigSubscribe(vo.getActPageConfigSubscribe());
return toAjax(i);
}
catch (Exception e){
e.printStackTrace();
return AjaxResult.error("系统繁忙");
}
}
/**
* 查询抽奖活动管理列表
@ -154,8 +158,26 @@ public class DrawInfoController extends BaseController
@GetMapping("/edit/{DRAWID}")
public String edit(@PathVariable("DRAWID") String DRAWID, ModelMap mmap)
{
ActVO vo = new ActVO();
//查询基本信息
DrawInfo drawInfo = drawInfoService.selectDrawInfoById(DRAWID);
mmap.put("drawInfo", drawInfo);
vo.setDrawInfo(drawInfo);
//查询展示内容
ActPageConfigGuide actPageConfigGuide = iActPageConfigGuideService.selectActPageConfigGuideByCode(drawInfo.getDRAWCODE());
vo.setActPageConfigGuide(actPageConfigGuide);
//查询选择玩法
DrawRule drawRule = iDrawRuleService.selectDrawRuleByCode(drawInfo.getDRAWCODE());
vo.setDrawRule(drawRule);
//查询收集信息
ActPageConfigUserinfo actPageConfigUserinfo= iActPageConfigUserinfoService.selectActPageConfigUserinfoByCode(drawInfo.getDRAWCODE());
vo.setActPageConfigUserinfo(actPageConfigUserinfo);
//查询分享信息
ActConfig actConfig = iActConfigService.selectActConfigByCode(drawInfo.getDRAWCODE());
vo.setActConfig(actConfig);
//查询二维码信息
ActPageConfigSubscribe actPageConfigSubscribe= iActPageConfigSubscribeService.selectActPageConfigSubscribeByCode(drawInfo.getDRAWCODE());
vo.setActPageConfigSubscribe(actPageConfigSubscribe);
mmap.put("vo",vo);
return prefix + "/edit";
}

View File

@ -5,6 +5,7 @@ import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import java.util.Date;
import java.util.List;
/**
* 抽奖活动管理对象 draw_info
@ -78,6 +79,15 @@ public class DrawInfo extends BaseEntity
/** */
private String VALIDATETYPE;
private List<String> drawId;
public List<String> getDrawId() {
return drawId;
}
public void setDrawId(List<String> drawId) {
this.drawId = drawId;
}
public void setDRAWID(String DRAWID)
{

View File

@ -57,6 +57,18 @@ public class DrawPrizeInfo extends BaseEntity
/** 积分项目编码 */
@Excel(name = "积分项目编码")
private String INTEGRALPROJECTCODE;
/**
* 奖品图片
*/
private String PRIZEIMG;
public String getPRIZEIMG() {
return PRIZEIMG;
}
public void setPRIZEIMG(String PRIZEIMG) {
this.PRIZEIMG = PRIZEIMG;
}
public void setPRIZEID(int PRIZEID)
{

View File

@ -58,4 +58,16 @@ public interface ActConfigMapper
* @return 结果
*/
public int deleteActConfigByIds(String[] ids);
/**
* 根据活动编码查询
* @param drawCode
* @return
*/
public ActConfig selectActConfigByCode(String drawCode);
/**
* 根据活动代码删除活动配置信息
* @param toStrArray
*/
public void deleteActConfigByCode(String[] toStrArray);
}

View File

@ -58,4 +58,16 @@ public interface ActPageConfigGuideMapper
* @return 结果
*/
public int deleteActPageConfigGuideByIds(String[] ids);
/**
* 根据活动编码查询
* @param drawCode
* @return
*/
public ActPageConfigGuide selectActPageConfigGuideByCode(String drawCode);
/**
* 根据活动代码删除活动展示内容配置信息
* @param toStrArray
*/
public void deleteActPageConfigGuideByCode(String[] toStrArray);
}

View File

@ -58,4 +58,16 @@ public interface ActPageConfigSubscribeMapper
* @return 结果
*/
public int deleteActPageConfigSubscribeByIds(String[] ids);
/**
* 根据活动编码查询
* @param drawCode
* @return
*/
public ActPageConfigSubscribe selectActPageConfigSubscribeByCode(String drawCode);
/**
* 根据活动代码删除活动配置信息
* @param toStrArray
*/
public void deleteActPageConfigSubscribeByCode(String[] toStrArray);
}

View File

@ -58,4 +58,16 @@ public interface ActPageConfigUserinfoMapper
* @return 结果
*/
public int deleteActPageConfigUserinfoByIds(String[] ids);
/**
* 根据活动编码查询
* @param drawCode
* @return
*/
public ActPageConfigUserinfo selectActPageConfigUserinfoByCode(String drawCode);
/**
* 根据活动代码删除活动收集配置信息
* @param toStrArray
*/
public void deleteActPageConfigUserinfoByCode(String[] toStrArray);
}

View File

@ -59,4 +59,16 @@ public interface DrawRuleMapper
* @return 结果
*/
public int deleteDrawRuleByIds(String[] DRAWRULEIDs);
/**
* 根据活动编码查询
* @param drawCode
* @return
*/
public DrawRule selectDrawRuleByCode(String drawCode);
/**
* 根据活动代码删除抽奖活动管理信息
* @param toStrArray
*/
public void deleteDrawRuleByIdCode(String[] toStrArray);
}

View File

@ -58,4 +58,10 @@ public interface IActConfigService
* @return 结果
*/
public int deleteActConfigById(Integer id);
/**
* 根据活动编码查询
* @param drawCode
* @return
*/
public ActConfig selectActConfigByCode(String drawCode);
}

View File

@ -58,4 +58,11 @@ public interface IActPageConfigGuideService
* @return 结果
*/
public int deleteActPageConfigGuideById(Integer id);
/**
* 根据活动编码查询
* @param drawCode
* @return
*/
public ActPageConfigGuide selectActPageConfigGuideByCode(String drawCode);
}

View File

@ -58,4 +58,10 @@ public interface IActPageConfigSubscribeService
* @return 结果
*/
public int deleteActPageConfigSubscribeById(Integer id);
/**
* 根据活动编码查询
* @param drawCode
* @return
*/
public ActPageConfigSubscribe selectActPageConfigSubscribeByCode(String drawCode);
}

View File

@ -58,4 +58,11 @@ public interface IActPageConfigUserinfoService
* @return 结果
*/
public int deleteActPageConfigUserinfoById(Integer id);
/**
* 根据活动编码查询
* @param drawCode
* @return
*/
public ActPageConfigUserinfo selectActPageConfigUserinfoByCode(String drawCode);
}

View File

@ -66,4 +66,6 @@ public interface IDrawInfoService
* @return 结果
*/
public int deleteDrawInfoById(String DRAWID);
}

View File

@ -60,4 +60,11 @@ public interface IDrawRuleService
* @return 结果
*/
public int deleteDrawRuleById(String DRAWRULEID);
/**
* 根据活动编码查询
* @param drawCode
* @return
*/
public DrawRule selectDrawRuleByCode(String drawCode);
}

View File

@ -93,4 +93,13 @@ public class ActConfigServiceImpl implements IActConfigService
{
return actConfigMapper.deleteActConfigById(id);
}
/**
* 根据活动编码查询
* @param drawCode
* @return
*/
@Override
public ActConfig selectActConfigByCode(String drawCode) {
return actConfigMapper.selectActConfigByCode(drawCode);
}
}

View File

@ -93,4 +93,14 @@ public class ActPageConfigGuideServiceImpl implements IActPageConfigGuideService
{
return actPageConfigGuideMapper.deleteActPageConfigGuideById(id);
}
/**
* 根活动代码查询
* @param drawCode
* @return
*/
@Override
public ActPageConfigGuide selectActPageConfigGuideByCode(String drawCode) {
return actPageConfigGuideMapper.selectActPageConfigGuideByCode(drawCode);
}
}

View File

@ -93,4 +93,13 @@ public class ActPageConfigSubscribeServiceImpl implements IActPageConfigSubscrib
{
return actPageConfigSubscribeMapper.deleteActPageConfigSubscribeById(id);
}
/**
* 根据活动编码查询
* @param drawCode
* @return
*/
@Override
public ActPageConfigSubscribe selectActPageConfigSubscribeByCode(String drawCode) {
return actPageConfigSubscribeMapper.selectActPageConfigSubscribeByCode(drawCode);
}
}

View File

@ -93,4 +93,13 @@ public class ActPageConfigUserinfoServiceImpl implements IActPageConfigUserinfoS
{
return actPageConfigUserinfoMapper.deleteActPageConfigUserinfoById(id);
}
/**
* 根据活动编码查询
* @param drawCode
* @return
*/
@Override
public ActPageConfigUserinfo selectActPageConfigUserinfoByCode(String drawCode) {
return actPageConfigUserinfoMapper.selectActPageConfigUserinfoByCode(drawCode);
}
}

View File

@ -1,9 +1,11 @@
package com.sinosoft.activity.service.impl;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import com.sinosoft.activity.domain.DrawInfo;
import com.sinosoft.activity.mapper.DrawInfoMapper;
import com.sinosoft.activity.mapper.*;
import com.sinosoft.activity.service.IDrawInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -21,6 +23,17 @@ public class DrawInfoServiceImpl implements IDrawInfoService
{
@Autowired
private DrawInfoMapper drawInfoMapper;
@Autowired
private ActConfigMapper actConfigMapper;
@Autowired
private ActPageConfigGuideMapper actPageConfigGuideMapper;
@Autowired
private ActPageConfigSubscribeMapper actPageConfigSubscribeMapper;
@Autowired
private ActPageConfigUserinfoMapper actPageConfigUserinfoMapper;
@Autowired
private DrawRuleMapper drawRuleMapper;
/**
* 查询抽奖活动管理对象
@ -76,7 +89,7 @@ public class DrawInfoServiceImpl implements IDrawInfoService
}
/**
* 删除抽奖活动管理对象对象
* 删除抽奖活动管理及其相关活动配置信息
*
* @param ids 需要删除的数据ID
* @return 结果
@ -84,7 +97,28 @@ public class DrawInfoServiceImpl implements IDrawInfoService
@Override
public int deleteDrawInfoByIds(String ids)
{
return drawInfoMapper.deleteDrawInfoByIds(Convert.toStrArray(ids));
DrawInfo drawInfo = new DrawInfo();
String[] string = ids.split(",");
List<String> code = Arrays.asList(string);
drawInfo.setDrawId(code);
//根据ID查询抽奖活动信息
List<DrawInfo> drawInfos = drawInfoMapper.selectDrawInfoList(drawInfo);
//删除活动管理信息
int i = drawInfoMapper.deleteDrawInfoByIds(Convert.toStrArray(ids));
List<String> collect = drawInfos.stream().map(DrawInfo::getDRAWCODE).collect(Collectors.toList());
String policyEndorseNos = String.join(",",collect);
//根据活动代码删除活动配置信息
actConfigMapper.deleteActConfigByCode(Convert.toStrArray(policyEndorseNos));
//根据活动代码删除活动展示内容配置信息
actPageConfigGuideMapper.deleteActPageConfigGuideByCode(Convert.toStrArray(policyEndorseNos));
//根据活动代码删除活动配置信息
actPageConfigSubscribeMapper.deleteActPageConfigSubscribeByCode(Convert.toStrArray(policyEndorseNos));
//根据活动代码删除活动收集配置信息
actPageConfigUserinfoMapper.deleteActPageConfigUserinfoByCode(Convert.toStrArray(policyEndorseNos));
//根据活动代码删除抽奖活动管理信息
drawRuleMapper.deleteDrawRuleByIdCode(Convert.toStrArray(policyEndorseNos));
return i;
}
/**

View File

@ -93,4 +93,14 @@ public class DrawRuleServiceImpl implements IDrawRuleService
{
return drawRuleMapper.deleteDrawRuleById(DRAWRULEID);
}
/**
* 根据活动编码查询
* @param drawCode
* @return
*/
@Override
public DrawRule selectDrawRuleByCode(String drawCode) {
return drawRuleMapper.selectDrawRuleByCode(drawCode);
}
}

View File

@ -40,7 +40,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectActConfigVo"/>
where id = #{id}
</select>
<select id="selectActConfigByCode" resultMap="ActConfigResult">
<include refid="selectActConfigVo"/>
where act_code = #{drawCode}
</select>
<insert id="insertActConfig" parameterType="ActConfig" useGeneratedKeys="true" keyProperty="id">
insert into act_config
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -96,5 +100,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<delete id="deleteActConfigByCode" parameterType="String">
delete from act_config where act_code in
<foreach item="actCode" collection="array" open="(" separator="," close=")">
#{actCode}
</foreach>
</delete>
</mapper>

View File

@ -40,7 +40,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectActPageConfigGuideVo"/>
where id = #{id}
</select>
<select id="selectActPageConfigGuideByCode" resultMap="ActPageConfigGuideResult">
<include refid="selectActPageConfigGuideVo"/>
where act_code = #{drawCode}
</select>
<insert id="insertActPageConfigGuide" parameterType="ActPageConfigGuide" useGeneratedKeys="true" keyProperty="id">
insert into act_page_config_guide
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -96,5 +100,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<delete id="deleteActPageConfigGuideByCode" parameterType="String">
delete from act_page_config_guide where act_code in
<foreach item="actCode" collection="array" open="(" separator="," close=")">
#{actCode}
</foreach>
</delete>
</mapper>

View File

@ -32,7 +32,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectActPageConfigSubscribeVo"/>
where id = #{id}
</select>
<select id="selectActPageConfigSubscribeByCode" resultMap="ActPageConfigSubscribeResult">
<include refid="selectActPageConfigSubscribeVo"/>
where act_code = #{drawCode}
</select>
<insert id="insertActPageConfigSubscribe" parameterType="ActPageConfigSubscribe" useGeneratedKeys="true" keyProperty="id">
insert into act_page_config_subscribe
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -76,5 +80,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<delete id="deleteActPageConfigSubscribeByCode" parameterType="String">
delete from act_page_config_subscribe where act_code in
<foreach item="actCode" collection="array" open="(" separator="," close=")">
#{actCode}
</foreach>
</delete>
</mapper>

View File

@ -54,7 +54,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectActPageConfigUserinfoVo"/>
where id = #{id}
</select>
<select id="selectActPageConfigUserinfoByCode" resultMap="ActPageConfigUserinfoResult">
<include refid="selectActPageConfigUserinfoVo"/>
where act_code = #{drawCode}
</select>
<insert id="insertActPageConfigUserinfo" parameterType="ActPageConfigUserinfo" useGeneratedKeys="true" keyProperty="id">
insert into act_page_config_userinfo
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -131,5 +135,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<delete id="deleteActPageConfigUserinfoByCode" parameterType="String">
delete from act_page_config_userinfo where act_code in
<foreach item="actCode" collection="array" open="(" separator="," close=")">
#{actCode}
</foreach>
</delete>
</mapper>

View File

@ -20,17 +20,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="UPDATEFLAG" column="UPDATEFLAG" />
<result property="RULEDESCRIPTION" column="RULEDESCRIPTION" />
<result property="VALIDATETYPE" column="VALIDATETYPE" />
<result property="DRAWRULEID" column="DRAWRULEID" />
<result property="FIRSTFLAG" column="FIRSTFLAG" />
<result property="FIRSTAWARDPRIZE" column="FIRSTAWARDPRIZE" />
<result property="DAILYFLAG" column="DAILYFLAG" />
<result property="DAILYSTARTTIME" column="DAILYSTARTTIME" />
<result property="DAILYENDTIME" column="DAILYENDTIME" />
<result property="DAILYNUMBER" column="DAILYNUMBER" />
<result property="WILLDRAWFLAG" column="WILLDRAWFLAG" />
<result property="WILLDRAWAWARDPRIZE" column="WILLDRAWAWARDPRIZE" />
<result property="WILLDRAWAWARDNUMBER" column="WILLDRAWAWARDNUMBER" />
</resultMap>
<sql id="selectDrawInfoVo">
@ -39,7 +28,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectDrawInfoList" parameterType="DrawInfo" resultMap="DrawInfoResult">
<include refid="selectDrawInfoVo"/>
<where>
<where>
<if test="drawId != null and drawId != '' ">
and DRAWID in
<foreach item="DRAWID" collection="drawId" open="(" separator="," close=")">
#{DRAWID}
</foreach>
</if>
<if test="DRAWCODE != null and DRAWCODE != ''"> and DRAWCODE = #{DRAWCODE}</if>
<if test="DRAWTYPE != null and DRAWTYPE != ''"> and DRAWTYPE = #{DRAWTYPE}</if>
<if test="DRAWNAME != null and DRAWNAME != ''"> and DRAWNAME like concat('%', #{DRAWNAME}, '%')</if>
@ -62,29 +57,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectDrawInfoById" parameterType="String" resultMap="DrawInfoResult">
SELECT
i.DRAWID,
i.DRAWNAME,
i.STATUS,
i.EXPENO,
i.EXPENOVALUE,
i.STARTTIME,
i.ENDTIME,
r.FIRSTFLAG,
r.FIRSTAWARDPRIZE,
r.DAILYFLAG,
r.DAILYNUMBER,
r.DAILYSTARTTIME,
r.DAILYENDTIME,
r.WILLDRAWFLAG,
r.WILLDRAWAWARDNUMBER,
r.WILLDRAWAWARDPRIZE,
r.DRAWRULEID
FROM
draw_info i
LEFT JOIN draw_rule r ON i.DRAWCODE = r.DRAWCODE
WHERE
DRAWID = #{DRAWID}
<include refid="selectDrawInfoVo"/>
WHERE
DRAWID = #{DRAWID}
</select>
<insert id="insertDrawInfo" parameterType="DrawInfo">

View File

@ -15,10 +15,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="LASTUPDATETIMESTAMP" column="LASTUPDATETIMESTAMP" />
<result property="STATUS" column="STATUS" />
<result property="INTEGRALPROJECTCODE" column="INTEGRALPROJECTCODE" />
<result property="PRIZEIMG" column="PRIZEIMG" />
</resultMap>
<sql id="selectDrawPrizeInfoVo">
select PRIZEID, PRIZECODE, PRIZENAME, PRIZETYPE, PRIZEVALUE, COMMENTS, CREATETIMESTAMP, LASTUPDATETIMESTAMP, STATUS, INTEGRALPROJECTCODE from draw_prize_info
select PRIZEID, PRIZECODE, PRIZENAME, PRIZETYPE, PRIZEVALUE, COMMENTS, CREATETIMESTAMP, LASTUPDATETIMESTAMP, STATUS, INTEGRALPROJECTCODE, PRIZEIMG from draw_prize_info
</sql>
<select id="selectDrawPrizeInfoByDrawCode" parameterType="com.sinosoft.activity.vo.PrizeInfo" resultMap="DrawPrizeInfoResult">
@ -69,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="LASTUPDATETIMESTAMP != null">LASTUPDATETIMESTAMP,</if>
<if test="STATUS != null">STATUS,</if>
<if test="INTEGRALPROJECTCODE != null">INTEGRALPROJECTCODE,</if>
<if test="PRIZEIMG != null">PRIZEIMG,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="PRIZEID != null">#{PRIZEID},</if>
@ -81,6 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="LASTUPDATETIMESTAMP != null">#{LASTUPDATETIMESTAMP},</if>
<if test="STATUS != null">#{STATUS},</if>
<if test="INTEGRALPROJECTCODE != null">#{INTEGRALPROJECTCODE},</if>
<if test="PRIZEIMG != null">#{PRIZEIMG},</if>
</trim>
</insert>
@ -96,6 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="LASTUPDATETIMESTAMP != null">LASTUPDATETIMESTAMP = #{LASTUPDATETIMESTAMP},</if>
<if test="STATUS != null">STATUS = #{STATUS},</if>
<if test="INTEGRALPROJECTCODE != null">INTEGRALPROJECTCODE = #{INTEGRALPROJECTCODE},</if>
<if test="PRIZEIMG != null">PRIZEIMG = #{PRIZEIMG},</if>
</trim>
where PRIZEID = #{PRIZEID}
</update>

View File

@ -46,7 +46,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectDrawRuleVo"/>
where DRAWRULEID = #{DRAWRULEID}
</select>
<select id="selectDrawRuleByCode" resultType="com.sinosoft.activity.domain.DrawRule">
<include refid="selectDrawRuleVo"/>
where DRAWCODE = #{drawCode}
</select>
<insert id="insertDrawRule" parameterType="DrawRule">
insert into draw_rule
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -110,5 +115,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{DRAWRULEID}
</foreach>
</delete>
<delete id="deleteDrawRuleByIdCode" parameterType="String">
delete from draw_rule where DRAWCODE in
<foreach item="drawCode" collection="array" open="(" separator="," close=")">
#{drawCode}
</foreach>
</delete>
</mapper>

View File

@ -15,8 +15,8 @@
.leftarea {
float: left;
width: 50%;
height: 300px;
width: 60%;
height: 500px;
}
.sw > .tab-content {
@ -140,21 +140,19 @@
/* 配置分享信息*/
.drawShareTitlePri {
text-align: center;
position: absolute;
top: 40%;
top: 45%;
font-size: 20px;
left: 28%;
left: 73%;
color: #F00;
width: 100%;
}
.drawShareDescribePri {
text-align: center;
position: absolute;
top: 50%;
font-size: 10px;
left: 25%;
left: 73%;
color: #F00;
width: 100%;
}
@ -162,9 +160,9 @@
.drawShareImgPic {
text-align: center;
position: absolute;
top: 50%;
top: 52%;
font-size: 37px;
left: 35%;
left: 38%;
color: #F00;
width: 100%;
}
@ -317,12 +315,14 @@
<div>
<h4 class="form-header h4">第2步-选择UI模板</h4>
<div th:with="type=${@dict.getType('activityTemplate')}">
<a id="activityTemplate" class="btn btn-rounded" href="#" th:each="dict : ${type}" th:text="${dict.dictLabel}"
<a id="activityTemplate" th:if="${dict.dictValue} != '0'" class="btn btn-rounded" href="#" th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}" onclick="activityTemplate(this)"></a>
<a id="activityTemplate" th:if="${dict.dictValue} eq '0'" class="btn btn-success btn-rounded" href="#" th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}" onclick="activityTemplate(this)"></a>
</div>
<input id="activityTemplateval" name="actConfig-pageStyle" value="" type="hidden">
<h4 id="activityTemplateh4" class="form-header h4"></h4>
<img id="activityTemplateimg" src="../../img/act/1.jpg" width="60%" height="500">
<h4 id="activityTemplateh4" class="form-header h4">暂不选择</h4>
<img id="activityTemplateimg" src="../../img/yun.jpg" width="60%" height="500">
</div>
</div>
<div id="step-3" class="tab-pane" role="tabpanel" aria-labelledby="step-3">
@ -444,13 +444,15 @@
<div id="step-4" class="tab-pane" role="tabpanel" aria-labelledby="step-4">
<h4 class="form-header h4">第4步-选择玩法</h4>
<div th:with="type=${@dict.getType('activityPlay')}">
<a id="activityPlay" class="btn btn-rounded" href="#" th:each="dict : ${type}" th:text="${dict.dictLabel}"
<a id="activityPlay" th:if="${dict.dictValue} != '0'" class="btn btn-rounded" href="#" th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}" onclick="activityTemplate(this)"></a>
<a id="activityPlay" th:if="${dict.dictValue} eq '0'" class="btn btn-success btn-rounded" href="#" th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}" onclick="activityTemplate(this)"></a>
</div>
<input type="hidden" name="actConfig-actType" id="activityPlayval" value="">
<img id="activityPlayimg" src="../../img/act/1.jpg" width="60%" height="300">
<img id="activityPlayimg" src="../../img/act/0.jpg" width="60%" height="300">
<h4 class="form-header h4">活动规则</h4>
<div class="row">
<div class="row" id="activityPlaydiv" style="display: none">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">首次中奖配置:</label>
@ -474,101 +476,98 @@
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">时间段抽奖配置:</label>
<div class="col-sm-8">
<select name="drawRule-dailyflag" id="DAILYFLAG" onchange="dailyflag()"
class="form-control"
th:with="type=${@dict.getType('is_boolean')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">时间段抽奖配置:</label>
<div class="col-sm-8">
<select name="drawRule-dailyflag" id="DAILYFLAG" onchange="dailyflag()"
class="form-control"
th:with="type=${@dict.getType('is_boolean')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">时间段限制次数:</label>
<div class="col-sm-8">
<input name="drawRule-dailynumber" id="dailynumber" placeholder="时间段限制次数"
class="form-control" type="text" maxlength="30" disabled>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">抽奖限制开始时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="drawRule-dailystarttime" id="dailystarttime" class="form-control"
placeholder="HH:mm:ss" type="text" disabled>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">时间段限制次数:</label>
<div class="col-sm-8">
<input name="drawRule-dailynumber" id="dailynumber" placeholder="时间段限制次数"
class="form-control" type="text" maxlength="30" disabled>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">抽奖限制结束时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="drawRule-dailyendtime" id="dailyendtime" class="form-control"
placeholder="HH:mm:ss" type="text" disabled>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">抽奖限制开始时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="drawRule-dailystarttime" id="dailystarttime"
class="form-control"
placeholder="HH:mm:ss" type="text" disabled>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">抽奖限制结束时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="drawRule-dailyendtime" id="dailyendtime" class="form-control"
placeholder="HH:mm:ss" type="text" disabled>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">抽奖必中配置:</label>
<div class="col-sm-8">
<select name="drawRule-willdrawflag" id="WILLDRAWFLAG" onchange="willdrawflag()"
class="form-control" th:with="type=${@dict.getType('is_boolean')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">抽奖必中配置:</label>
<div class="col-sm-8">
<select name="drawRule-willdrawflag" id="WILLDRAWFLAG" onchange="willdrawflag()"
class="form-control" th:with="type=${@dict.getType('is_boolean')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">抽奖必中计数:</label>
<div class="col-sm-8">
<input name="drawRule-willdrawawardnumber" id="willdrawawardnumber"
placeholder="抽奖必中计数"
class="form-control" type="text" maxlength="30" disabled>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">抽奖必中计数:</label>
<div class="col-sm-8">
<input name="drawRule-willdrawawardnumber" id="willdrawawardnumber"
placeholder="抽奖必中计数"
class="form-control" type="text" maxlength="30" disabled>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">抽奖必中奖品:</label>
<div class="col-sm-8">
<select name="drawRule-willdrawawardprize" class="form-control"
id="willdrawawardprize"
disabled>
</select>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">抽奖必中奖品:</label>
<div class="col-sm-8">
<select name="drawRule-willdrawawardprize" class="form-control"
id="willdrawawardprize"
disabled>
</select>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="step-5" class="tab-pane" role="tabpanel" aria-labelledby="step-5">
<div style="height: 610px">
<div style="height: 810px">
<div class="leftarea">
<h4 class="form-header h4">第五步-配置收集信息</h4>
<div class="row">
@ -600,9 +599,8 @@
<div class="form-group">
<label class="col-sm-4 control-label is-required">协议内容:</label>
<div class="col-sm-8">
<input id="agreement" name="actPageConfigUserinfo-agreement" height="100px"
class="form-control" type="text"
maxlength="30" onkeyup="updatePri(this)">
<textarea id="agreement" name="actPageConfigUserinfo-agreement" cols="40" rows="6" onkeyup="updatePri(this)">
</textarea>
</div>
</div>
</div>
@ -784,9 +782,8 @@
<div class="form-group">
<label class="col-sm-4 control-label is-required">分享描述:</label>
<div class="col-sm-8">
<input id="shareDescribe" name="actConfig-shareDesc"
placeholder="例如:参与活动,赢大奖" class="form-control" type="text"
maxlength="30" onkeyup="updatePri(this)">
<textarea id="shareDescribe" name="actConfig-shareDesc" cols="40" rows="6" onkeyup="updatePri(this)">
</textarea>
</div>
</div>
</div>
@ -814,7 +811,7 @@
<h4 class="form-header h4">效果图</h4>
<div style="height: 210px">
<div class="drawShareImg2Pic">
<img id="ss" src="../../img/shj.jpg" width="254" height="142">
<img id="ss" src="../../img/bj.png" height="170" width="340">
</div>
<div class="drawShareImgPic">
<img id="shareImgimg" src="../../img/shj.jpg" width="50" height="50">
@ -940,10 +937,7 @@
});
function submitHandler() {
var data = $("#form-info-add").serializeArray();
$.operate.saveModal(prefix + "/add", data);
}
//时间段抽奖配置
function dailyflag() {
@ -1035,24 +1029,16 @@
.on('click', function () {
//添加保存逻辑
var data = customSerialize("form-info-add", true);
alert(data);
$.ajax({
url: prefix + "/add",
data: data,
type: "post",
contentType: "application/json;charset=UTF-8",
success: function (result) {
if (result.code == web_status.SUCCESS) {
layer.msg("保存成功,正在刷新数据请稍后……", {
icon: 1,
time: 500,
shade: [0.1, '#8F8F8F']
}, function () {
location.reload();
});
} else {
alert(result.msg);
if (typeof callback == "function") {
callback(result);
}
$.operate.successTabCallback(result);
}
})
});
@ -1223,6 +1209,11 @@
$("#"+id+"val").val(valus);
$("#"+id+"h4").text(val.text);
$("#"+id+"img").attr("src",path+valus+".jpg");
if (valus != "0"){
$("#activityPlaydiv").css('display','block');//显示
}else{
$("#activityPlaydiv").css('display','none');//隐藏
}
}

View File

@ -188,7 +188,7 @@
function submitHandler() {
if ($.validate.form()) {
$.operate.saveModal(prefix + "/edit", $('#form-info-edit').serialize());
$.operate.saveTab(prefix + "/edit", $('#form-info-edit').serialize());
}
}
/**获取奖品及信息列表*/

File diff suppressed because it is too large Load Diff

View File

@ -38,7 +38,7 @@
<a class="btn btn-success" onclick="$.operate.addTab()" shiro:hasPermission="activity:info:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.editFull()" shiro:hasPermission="activity:info:edit">
<a class="btn btn-primary single disabled" onclick="$.operate.editTab()" shiro:hasPermission="activity:info:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="activity:info:remove">

View File

@ -3,6 +3,7 @@
<head>
<th:block th:include="include :: header('新增存储奖品的基础信息')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: jasny-bootstrap-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
@ -34,6 +35,24 @@
<input name="PRIZEVALUE" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">背景图片:</label>
<div class="col-sm-8">
<div class="fileinput fileinput-new" data-provides="fileinput">
<div class="fileinput-preview thumbnail" data-trigger="fileinput"
style="width: 200px; height: 150px;"></div>
<div>
<span class="btn btn-white btn-file"><span
class="fileinput-new">选择图片</span><span class="fileinput-exists">更改</span>
<input type="file" id="pic" name="actPageConfigGuide-bgImg"
onchange="syncPic(this)"></span>
<a href="#" class="btn btn-white fileinput-exists"
data-dismiss="fileinput">清除</a>
</div>
</div>
</div>
<input id="picval" type="hidden" name="PRIZEIMG" value="">
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
@ -81,6 +100,7 @@
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: jasny-bootstrap-js"/>
<script th:inline="javascript">
var prefix = ctx + "activity/prize"
$("#form-info-add").validate({
@ -104,6 +124,15 @@
minView: "month",
autoclose: true
});
function syncPic(val){
//传递值
var id = val.id;
var reader = new FileReader();
reader.onload = function (e) {
$("#"+id+"val").val(e.target.result);
}
reader.readAsDataURL(val.files[0]);
}
</script>
</body>
</html>