记得上下班打卡 | git大法好,push需谨慎

Commit bf8643af authored by wanglele's avatar wanglele

兑换码相关

parent e1683add
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<result column="code" property="code" jdbcType="VARCHAR"/> <result column="code" property="code" jdbcType="VARCHAR"/>
<result column="sku_id" property="skuId" jdbcType="VARCHAR"/> <result column="sku_id" property="skuId" jdbcType="VARCHAR"/>
<result column="box_sku_id" property="boxSkuId" jdbcType="VARCHAR"/> <result column="box_sku_id" property="boxSkuId" jdbcType="VARCHAR"/>
<result column="state" property="state" jdbcType="INTEGER" /> <result column="state" property="state" jdbcType="INTEGER"/>
<result column="redeem_uid" property="redeemUid" jdbcType="VARCHAR"/> <result column="redeem_uid" property="redeemUid" jdbcType="VARCHAR"/>
<result column="redeem_at" property="redeemAt" jdbcType="TIMESTAMP"/> <result column="redeem_at" property="redeemAt" jdbcType="TIMESTAMP"/>
<result column="admin_uid" property="adminUid" jdbcType="VARCHAR"/> <result column="admin_uid" property="adminUid" jdbcType="VARCHAR"/>
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</resultMap> </resultMap>
<select id="selectByIds" resultMap="BeseResult"> <select id="selectByIds" resultMap="BeseResult">
select code_id,activity_id,state from goblin_nft_ex_code select code_id,activity_id,state,code from goblin_nft_ex_code
where code_id in where code_id in
<foreach collection="codeIds.split(',')" item="codeId" open="(" separator="," close=")"> <foreach collection="codeIds.split(',')" item="codeId" open="(" separator="," close=")">
#{codeId,jdbcType=VARCHAR} #{codeId,jdbcType=VARCHAR}
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
</select> </select>
<select id="selectGoblinNftCodeByCode" resultMap="BeseResult"> <select id="selectGoblinNftCodeByCode" resultMap="BeseResult">
select code_id,activity_id,code,box_sku_id select code_id, activity_id, code, box_sku_id
</select> </select>
<insert id="addGoblinNftExCodes"> <insert id="addGoblinNftExCodes">
...@@ -45,12 +45,13 @@ ...@@ -45,12 +45,13 @@
</insert> </insert>
<update id="updateCodes"> <update id="updateCodes">
<foreach collection="goblinNftExCodes" item="goblinNftExCode" open="" close="" separator=";" > update goblin_nft_ex_code
update goblin_nft_ex_code <set>
<set> state = 3 , updated_at = now()
state = #{goblinNftExCode.state} and updated_at = #{goblinNftExCode.updatedAt} </set>
</set> where code_id in
where code_id = #{goblinNftExCode.codeId} <foreach collection="goblinNftExCodes" item="goblinNftExCode" index="index" open="(" separator="," close=")">
#{goblinNftExCode.codeId}
</foreach> </foreach>
</update> </update>
...@@ -61,7 +62,7 @@ ...@@ -61,7 +62,7 @@
<if test="code != null and code != ''"> <if test="code != null and code != ''">
and code = #{code,jdbcType=VARCHAR} and code = #{code,jdbcType=VARCHAR}
</if> </if>
<if test="activityId != null and activityId != null"> <if test="activityId != null and activityId != ''">
and activity_id = #{activityId,jdbcType=VARCHAR} and activity_id = #{activityId,jdbcType=VARCHAR}
</if> </if>
<if test="state != null"> <if test="state != null">
......
...@@ -4,8 +4,10 @@ import com.alibaba.excel.EasyExcel; ...@@ -4,8 +4,10 @@ import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.support.ExcelTypeEnum; import com.alibaba.excel.support.ExcelTypeEnum;
import com.alibaba.excel.write.metadata.style.WriteCellStyle; import com.alibaba.excel.write.metadata.style.WriteCellStyle;
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.StringUtil; import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.goblin.dto.vo.GoblinNftExActivityVo; import com.liquidnet.service.goblin.dto.vo.GoblinNftExActivityVo;
import com.liquidnet.service.goblin.dto.vo.GoblinNftExCodeVo; import com.liquidnet.service.goblin.dto.vo.GoblinNftExCodeVo;
...@@ -30,6 +32,7 @@ import java.io.OutputStream; ...@@ -30,6 +32,7 @@ import java.io.OutputStream;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -139,8 +142,6 @@ public class GoblinNftExCodeServiceImpl implements IGoblinNftExCodeService { ...@@ -139,8 +142,6 @@ public class GoblinNftExCodeServiceImpl implements IGoblinNftExCodeService {
@Override @Override
public Boolean defDrivLoseCode(String codeIds) { public Boolean defDrivLoseCode(String codeIds) {
LocalDateTime now = LocalDateTime.now();
// 获取兑换码 // 获取兑换码
List<GoblinNftExCode> goblinNftExCodes = goblinNftExCodeMapper.selectByIds(codeIds); List<GoblinNftExCode> goblinNftExCodes = goblinNftExCodeMapper.selectByIds(codeIds);
...@@ -151,7 +152,7 @@ public class GoblinNftExCodeServiceImpl implements IGoblinNftExCodeService { ...@@ -151,7 +152,7 @@ public class GoblinNftExCodeServiceImpl implements IGoblinNftExCodeService {
// redis 主动失效 // redis 主动失效
codes.add(goblinNftExCode.getCode()); codes.add(goblinNftExCode.getCode());
goblinNftExCode.setState(3); goblinNftExCode.setState(3);
goblinNftExCode.setUpdatedAt(now); goblinNftExCode.setUpdatedAt(LocalDateTime.now());
String skuId = ""; String skuId = "";
if (StringUtil.isNotBlank(goblinNftExCode.getSkuId())) { if (StringUtil.isNotBlank(goblinNftExCode.getSkuId())) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment