活动管理-抽奖活动管理修改

This commit is contained in:
xu0625 2021-04-12 16:15:31 +08:00
parent 95e26a93a4
commit 376a461ec0
9 changed files with 74 additions and 24 deletions

View File

@ -188,16 +188,20 @@ public class DrawInfoController extends BaseController
@Log(title = "抽奖活动管理", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(DrawInfo drawInfo)
{
logger.info("修改存储抽奖特殊规则对象传参:"+JSON.toJSONString(drawInfo));
drawInfo.setLASTUPDATETIMESTAMP(new Date());
drawInfoService.updateDrawInfo(drawInfo);
DrawRule drawRule = new DrawRule();
BeanUtils.copyProperties(drawInfo,drawRule);
logger.info("修改存储抽奖特殊规则对象入参:"+JSON.toJSONString(drawRule));
int i = iDrawRuleService.updateDrawRule(drawRule);
return toAjax(i);
public AjaxResult editSave(ActVO vo)
{
try{
logger.info("前台传参"+ JSON.toJSONString(vo));
Date date = new Date();
int i = drawInfoService.updateActVO(vo);
return toAjax(i);
}
catch (Exception e) {
e.printStackTrace();
return AjaxResult.error("系统繁忙");
}
}
/**
@ -209,6 +213,8 @@ public class DrawInfoController extends BaseController
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(drawInfoService.deleteDrawInfoByIds(ids));
}

View File

@ -70,5 +70,5 @@ public interface DrawRuleMapper
* 根据活动代码删除抽奖活动管理信息
* @param toStrArray
*/
public void deleteDrawRuleByIdCode(String[] toStrArray);
public int deleteDrawRuleByIdCode(String[] toStrArray);
}

View File

@ -2,6 +2,7 @@ package com.sinosoft.activity.service;
import com.sinosoft.activity.domain.DrawInfo;
import com.sinosoft.activity.vo.ActVO;
import java.util.List;
@ -68,4 +69,5 @@ public interface IDrawInfoService
public int deleteDrawInfoById(String DRAWID);
public int updateActVO(ActVO vo);
}

View File

@ -1,12 +1,14 @@
package com.sinosoft.activity.service.impl;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import com.sinosoft.activity.domain.DrawInfo;
import com.sinosoft.activity.domain.*;
import com.sinosoft.activity.mapper.*;
import com.sinosoft.activity.service.IDrawInfoService;
import com.sinosoft.activity.vo.ActVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -85,6 +87,7 @@ public class DrawInfoServiceImpl implements IDrawInfoService
@Override
public int updateDrawInfo(DrawInfo drawInfo)
{
return drawInfoMapper.updateDrawInfo(drawInfo);
}
@ -104,7 +107,7 @@ public class DrawInfoServiceImpl implements IDrawInfoService
//根据ID查询抽奖活动信息
List<DrawInfo> drawInfos = drawInfoMapper.selectDrawInfoList(drawInfo);
//删除活动管理信息
int i = drawInfoMapper.deleteDrawInfoByIds(Convert.toStrArray(ids));
drawInfoMapper.deleteDrawInfoByIds(Convert.toStrArray(ids));
List<String> collect = drawInfos.stream().map(DrawInfo::getDRAWCODE).collect(Collectors.toList());
String policyEndorseNos = String.join(",",collect);
@ -117,7 +120,7 @@ public class DrawInfoServiceImpl implements IDrawInfoService
//根据活动代码删除活动收集配置信息
actPageConfigUserinfoMapper.deleteActPageConfigUserinfoByCode(Convert.toStrArray(policyEndorseNos));
//根据活动代码删除抽奖活动管理信息
drawRuleMapper.deleteDrawRuleByIdCode(Convert.toStrArray(policyEndorseNos));
int i = drawRuleMapper.deleteDrawRuleByIdCode(Convert.toStrArray(policyEndorseNos));
return i;
}
@ -132,4 +135,48 @@ public class DrawInfoServiceImpl implements IDrawInfoService
{
return drawInfoMapper.deleteDrawInfoById(DRAWID);
}
@Override
public int updateActVO(ActVO vo) {
Date date = new Date();
DrawInfo drawInfo = vo.getDrawInfo();
drawInfo.setLASTUPDATETIMESTAMP(date);
//修改抽奖活动管理对象
String drawcode = drawInfo.getDRAWCODE();
drawInfoMapper.updateDrawInfo(drawInfo);
//修改活动配置
ActConfig actConfig = vo.getActConfig();
actConfig.setUpdateTime(date);
actConfig.setActCode(drawcode);
actConfigMapper.updateActConfig(actConfig);
//修改活动展示内容配置
ActPageConfigGuide actPageConfigGuide = vo.getActPageConfigGuide();
actPageConfigGuide.setUpdateTime(date);
actPageConfigGuide.setActCode(drawcode);
actPageConfigGuideMapper.updateActPageConfigGuide(actPageConfigGuide);
//修改活动收集配置
ActPageConfigSubscribe actPageConfigSubscribe = vo.getActPageConfigSubscribe();
actPageConfigSubscribe.setUpdateTime(date);
actPageConfigSubscribe.setActCode(drawcode);
actPageConfigSubscribeMapper.updateActPageConfigSubscribe(actPageConfigSubscribe);
//修改活动用户信息
ActPageConfigUserinfo actPageConfigUserinfo = vo.getActPageConfigUserinfo();
actPageConfigUserinfo.setUpdateTime(date);
actPageConfigUserinfo.setActCode(drawcode);
actPageConfigUserinfoMapper.updateActPageConfigUserinfo(actPageConfigUserinfo);
//修改查询抽奖活动管理对象
DrawRule drawRule = vo.getDrawRule();
drawRule.setDRAWCODE(drawcode);
drawRule.setLASTUPDATETIMESTAMP(date);
int i = drawRuleMapper.updateDrawRule(drawRule);
return i;
}
}

View File

@ -78,7 +78,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="SET" suffixOverrides=",">
<if test="pageStyle != null">page_style = #{pageStyle},</if>
<if test="actType != null">act_type = #{actType},</if>
<if test="actCode != null and actCode != ''">act_code = #{actCode},</if>
<if test="actName != null">act_name = #{actName},</if>
<if test="shareTitle != null">share_title = #{shareTitle},</if>
<if test="shareDesc != null">share_desc = #{shareDesc},</if>
@ -87,7 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
where act_code = #{actCode}
</update>
<delete id="deleteActConfigById" parameterType="Integer">

View File

@ -76,7 +76,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateActPageConfigGuide" parameterType="ActPageConfigGuide">
update act_page_config_guide
<trim prefix="SET" suffixOverrides=",">
<if test="actCode != null and actCode != ''">act_code = #{actCode},</if>
<if test="actTitle != null">act_title = #{actTitle},</if>
<if test="actDesc != null">act_desc = #{actDesc},</if>
<if test="bgImg != null">bg_img = #{bgImg},</if>
@ -87,7 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
where act_code = #{actCode}
</update>
<delete id="deleteActPageConfigGuideById" parameterType="Integer">

View File

@ -60,14 +60,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateActPageConfigSubscribe" parameterType="ActPageConfigSubscribe">
update act_page_config_subscribe
<trim prefix="SET" suffixOverrides=",">
<if test="actCode != null and actCode != ''">act_code = #{actCode},</if>
<if test="description != null">description = #{description},</if>
<if test="bgImg != null">bg_img = #{bgImg},</if>
<if test="qrCode != null">qr_code = #{qrCode},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
where act_code = #{actCode}
</update>
<delete id="deleteActPageConfigSubscribeById" parameterType="Integer">

View File

@ -104,7 +104,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateActPageConfigUserinfo" parameterType="ActPageConfigUserinfo">
update act_page_config_userinfo
<trim prefix="SET" suffixOverrides=",">
<if test="actCode != null and actCode != ''">act_code = #{actCode},</if>
<if test="title != null">title = #{title},</if>
<if test="description != null">description = #{description},</if>
<if test="bgImg != null">bg_img = #{bgImg},</if>
@ -122,7 +121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
where act_code = #{actCode}
</update>
<delete id="deleteActPageConfigUserinfoById" parameterType="Integer">

View File

@ -89,7 +89,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateDrawRule" parameterType="DrawRule">
update draw_rule
<trim prefix="SET" suffixOverrides=",">
<if test="DRAWCODE != null and DRAWCODE != ''">DRAWCODE = #{DRAWCODE},</if>
<if test="FIRSTFLAG != null">FIRSTFLAG = #{FIRSTFLAG},</if>
<if test="FIRSTAWARDPRIZE != null">FIRSTAWARDPRIZE = #{FIRSTAWARDPRIZE},</if>
<if test="DAILYFLAG != null">DAILYFLAG = #{DAILYFLAG},</if>
@ -102,7 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="LASTUPDATETIMESTAMP != null">LASTUPDATETIMESTAMP = #{LASTUPDATETIMESTAMP},</if>
<if test="WILLDRAWAWARDNUMBER != null">WILLDRAWAWARDNUMBER = #{WILLDRAWAWARDNUMBER},</if>
</trim>
where DRAWRULEID = #{DRAWRULEID}
where DRAWCODE = #{DRAWCODE}
</update>
<delete id="deleteDrawRuleById" parameterType="String">