签到问题处理
This commit is contained in:
parent
f51774c077
commit
bf667e2aa6
@ -1,2 +1,4 @@
|
||||
/** 新增已退货数量 **/
|
||||
ALTER TABLE li_order_item ADD return_goods_number int DEFAULT 0 COMMENT '退货数量 ';
|
||||
/** 增加签到日期 **/
|
||||
ALTER TABLE li_member_sign ADD day int DEFAULT NULL COMMENT '签到日 ';
|
||||
ALTER TABLE li_member_sign DROP INDEX uk_member_day;
|
||||
ALTER TABLE li_member_sign add unique uk_member_day (member_id, day) COMMENT 'uk_member_day';
|
@ -20,6 +20,15 @@ public class DateUtil {
|
||||
public static final String FULL_DATE = "yyyyMMddHHmmss";
|
||||
|
||||
|
||||
/**
|
||||
* 当天的开始时间
|
||||
*
|
||||
* @return 今天开始时间
|
||||
*/
|
||||
public static Long getDayOfStart() {
|
||||
return DateUtil.getDateline()/(60*24*60);
|
||||
}
|
||||
|
||||
/**
|
||||
* 当天的开始时间
|
||||
*
|
||||
|
@ -42,4 +42,8 @@ public class MemberSign extends BaseIdEntity {
|
||||
@ApiModelProperty(value = "连续签到天数")
|
||||
private Integer signDay;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "签到日 为数字 从现在减去19700101 的日期")
|
||||
private Integer day;
|
||||
|
||||
}
|
||||
|
@ -77,8 +77,8 @@ public class MemberSignServiceImpl extends ServiceImpl<MemberSignMapper, MemberS
|
||||
} else {
|
||||
memberSign.setSignDay(1);
|
||||
}
|
||||
//手动写入创建时间,以保证唯一索引生效
|
||||
memberSign.setCreateTime(DateUtil.getCurrentDayEndTime());
|
||||
|
||||
memberSign.setDay(DateUtil.getDayOfStart().intValue());
|
||||
try {
|
||||
this.baseMapper.insert(memberSign);
|
||||
//签到成功后发送消息赠送积分
|
||||
|
@ -27,8 +27,7 @@ public class MyMetaObjectHandler implements MetaObjectHandler {
|
||||
this.setFieldValByName("createBy", "SYSTEM", metaObject);
|
||||
}
|
||||
//有创建时间字段,切字段值为空
|
||||
if (metaObject.hasGetter("createTime")
|
||||
&& metaObject.getValue("createTime") == null) {
|
||||
if (metaObject.hasGetter("createTime")) {
|
||||
this.setFieldValByName("createTime", new Date(), metaObject);
|
||||
}
|
||||
//有值,则写入
|
||||
|
Loading…
x
Reference in New Issue
Block a user