|
|
|
|
@ -14,6 +14,7 @@ import com.flossom.common.core.enums.Status;
|
|
|
|
|
import com.flossom.common.core.mapper.WxUserIntegralLogMapper;
|
|
|
|
|
import com.flossom.common.core.mapper.WxUserMemberMapper;
|
|
|
|
|
import com.flossom.common.core.utils.DateUtils;
|
|
|
|
|
import com.flossom.common.security.utils.SecurityUtils;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@ -139,12 +140,16 @@ public class WxUserIntegralLogServiceImpl implements IWxUserIntegralLogService {
|
|
|
|
|
|
|
|
|
|
// 3、计算该用户得过期积分,并保存到用户信息表得过期积分中
|
|
|
|
|
// 当增加的大于扣除的就直接扣减
|
|
|
|
|
WxUserMember updateEntity = new WxUserMember();
|
|
|
|
|
if (increaseIntegral > reduceIntegral) {
|
|
|
|
|
userMember.setExpireCredit(increaseIntegral.intValue() - reduceIntegral.intValue());
|
|
|
|
|
updateEntity.setExpireCredit(increaseIntegral.intValue() - reduceIntegral.intValue());
|
|
|
|
|
} else {
|
|
|
|
|
userMember.setExpireCredit(0);
|
|
|
|
|
updateEntity.setExpireCredit(0);
|
|
|
|
|
}
|
|
|
|
|
wxUserMemberMapper.updateWxUserMember(userMember);
|
|
|
|
|
updateEntity.setId(userMember.getId());
|
|
|
|
|
updateEntity.setUpdateBy(SecurityUtils.getUsername());
|
|
|
|
|
updateEntity.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
|
wxUserMemberMapper.updateWxUserMember(updateEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|