| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.doumee.config.listener.event.IntegralEvent; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.SharesMapper; |
| | | import com.doumee.dao.business.model.Shares; |
| | | import com.doumee.service.business.SharesService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.SharesMapper; |
| | | import com.doumee.dao.business.model.Shares; |
| | | import com.doumee.service.business.SharesService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.ApplicationEventPublisher; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 用户分享信息表Service实现 |
| | |
| | | |
| | | @Override |
| | | public Integer create(Shares shares,Integer memberId) { |
| | | // LoginUserInfo userInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | Shares target = new Shares(); |
| | | // target.setCreator(userInfo.getId()); |
| | | // target.setEditor(userInfo.getId()); |
| | | target.setMemberId(memberId); |
| | | target.setObjId(shares.getObjId()); |
| | | target.setObjType(shares.getObjType()); |
| | |
| | | target.setTitle(shares.getTitle()); |
| | | target.setIntegral(new BigDecimal("0")); |
| | | sharesMapper.insert(target); |
| | | IntegralEvent<Shares> event = new IntegralEvent<>(this,target, Constants.CoffeeBeanTask.SHARE_INFO,memberId); |
| | | applicationEventPublisher.publishEvent(event); |
| | | |
| | | return shares.getId(); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Integer count(Date start, Date end, Integer memberId,List<Integer> objTypes) { |
| | | public long count(Date start, Date end, Integer memberId,List<Integer> objTypes) { |
| | | QueryWrapper<Shares> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda().eq(Shares::getMemberId,memberId) |
| | | .in(!CollectionUtils.isEmpty(objTypes),Shares::getObjType,objTypes) |