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

Commit bf8643af authored by wanglele's avatar wanglele

兑换码相关

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