Commit 44e0239b by YG8429

时长日志增加类型字段

parent 333eb5e9
package share.common.enums;
public enum DurationTypeEnum {
RECHARGE(0, "充值"),
ORDER(1,"订单消费"),
SHARE(2, "分享赠送"),
ORDER_REFUND(3,"订单消费退款"),
;
private Integer code;
private String name;
DurationTypeEnum() {
}
DurationTypeEnum(Integer code, String name) {
this.code = code;
this.name = name;
}
DurationTypeEnum(Integer code) {
this.code = code;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
}
......@@ -7,6 +7,7 @@ import org.springframework.web.bind.annotation.RestController;
import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult;
import share.common.core.page.TableDataInfo;
import share.common.enums.DurationTypeEnum;
import share.system.domain.SConsumer;
import share.system.domain.vo.DurationLogVo;
import share.system.domain.vo.FrontTokenComponent;
......@@ -45,4 +46,13 @@ public class DurationLogController extends BaseController {
List<DurationLogVo> list = durationLogService.selectDurationLogList(durationLog);
return success(list);
}
@GetMapping("/queryDurationType")
public AjaxResult queryDurationType(DurationLogVo durationLog) {
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
durationLog.setConsumerId(user.getId());
durationLog.setDurationType(DurationTypeEnum.SHARE.getCode());
List<DurationLogVo> list = durationLogService.selectDurationTypeList(durationLog);
return success(list);
}
}
......@@ -67,6 +67,9 @@ public class DurationLog extends BaseEntity {
@TableField(select = false)
private Long isDelete;
@Excel(name = "时长类型0-充值赠送,1-订单消费,2-分享赠送,3-订单退款")
private Integer durationType;
@Override
public String toString() {
......
......@@ -60,4 +60,6 @@ public interface DurationLogService extends IService<DurationLog> {
* @return 结果
*/
public int deleteDurationLogById(Long id);
List<DurationLogVo> selectDurationTypeList(DurationLogVo durationLog);
}
package share.system.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import share.common.enums.DurationTypeEnum;
import share.common.utils.DateUtils;
import share.system.domain.DurationLog;
import share.system.domain.vo.DurationLogVo;
import share.system.mapper.DurationLogMapper;
import share.system.service.DurationLogService;
import java.util.Collections;
import java.util.List;
/**
......@@ -89,4 +92,11 @@ public class DurationLogServiceImpl extends ServiceImpl<DurationLogMapper, Durat
public int deleteDurationLogById(Long id) {
return durationLogMapper.deleteDurationLogById(id);
}
@Override
public List<DurationLogVo> selectDurationTypeList(DurationLogVo durationLog) {
return durationLogMapper.selectDurationLogList(durationLog);
}
}
......@@ -16,10 +16,7 @@ import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.util.ObjectUtils;
import share.common.core.page.TableDataInfo;
import share.common.core.redis.RedisUtil;
import share.common.enums.OrderStatusEnum;
import share.common.enums.ReceiptRdeisEnum;
import share.common.enums.RefundStatusEnum;
import share.common.enums.YesNoEnum;
import share.common.enums.*;
import share.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -266,6 +263,7 @@ public class EquityFundExcessServiceImpl extends ServiceImpl<EquityFundExcessMap
durationLog.setVariableDuration(anHour);
durationLog.setCurrentDuration(accumulateEquityFund);
durationLog.setOperationType(YesNoEnum.yes.getIndex());
durationLog.setDurationType(DurationTypeEnum.SHARE.getCode());
durationLog.setOperationTime(DateUtils.getNowDate());
durationLogService.insertDurationLog(durationLog);
consumerWalletService.updateConsumerWallet(consumerWallet);
......
......@@ -20,6 +20,7 @@
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
<result property="durationType" column="duration_type"/>
</resultMap>
<sql id="selectDurationLogVo">
......@@ -34,7 +35,8 @@
create_time,
update_by,
update_time,
remark
remark,
duration_type
from s_duration_log
</sql>
......@@ -53,7 +55,8 @@
d.create_time,
d.update_by,
d.update_time,
d.remark
d.remark,
d.duration_type
from s_duration_log d join s_consumer c on d.consumer_id = c.id
<where>
<if test="nickName != null and nickName != ''">and c.nick_name like concat('%', #{nickName},'%')
......@@ -66,6 +69,7 @@
<if test="operationType != null ">and d.operation_type = #{operationType}</if>
<if test="operationTime != null ">and d.operation_time = #{operationTime}</if>
<if test="isDelete != null ">and d.is_delete = #{isDelete}</if>
<if test="durationType != null ">and d.duration_type = #{durationType}</if>
</where>
ORDER BY d.operation_time DESC
</select>
......@@ -89,6 +93,7 @@
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="durationType != null">duration_type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="consumerId != null">#{consumerId},</if>
......@@ -102,6 +107,7 @@
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="durationType != null">#{durationType},</if>
</trim>
</insert>
......@@ -119,6 +125,7 @@
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="durationType != null">duration_type = #{durationType}</if>
</trim>
where id = #{id}
</update>
......
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