| | |
| | | import com.yeshi.fanli.dao.mybatis.redpack.RedPackDetailMapper;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackDetail;
|
| | | import com.yeshi.fanli.service.inter.redpack.RedPackDetailService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.vo.redpack.RedPackDetailVO;
|
| | | import com.yeshi.fanli.vo.redpack.RedPackMonthVO;
|
| | |
| | | public void insertSelective(RedPackDetail record) {
|
| | | redPackDetailMapper.insertSelective(record);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public void updateByPrimaryKeySelective(RedPackDetail record) {
|
| | | redPackDetailMapper.updateByPrimaryKeySelective(record);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public RedPackDetail getByIdentifyCode(String identifyCode) {
|
| | | return redPackDetailMapper.getByIdentifyCode(identifyCode);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public BigDecimal countAddMoneyByDate(long uid, int dateType) {
|
| | | return redPackDetailMapper.countAddMoneyByDate(uid, dateType);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public BigDecimal countUseMoneyByDate(long uid, int dateType) {
|
| | | return redPackDetailMapper.countUseMoneyByDate(uid, dateType);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public List<RedPackDetailVO> listUserMoneyDetailForClient(Long uid, Long detailId, Date maxTime) {
|
| | | List<RedPackDetailVO> finalList = new ArrayList<>();
|
| | |
| | | keys = monthMap.keySet().iterator();
|
| | | while (keys.hasNext()) {
|
| | | Integer key = keys.next();
|
| | | |
| | |
|
| | | BigDecimal expend = new BigDecimal(voList.get(p).getExpend());
|
| | | BigDecimal income = new BigDecimal(voList.get(p).getIncome());
|
| | | |
| | |
|
| | | // 去除支出负号
|
| | | finalList.get(key).getMonth().setExpend(expend.setScale(2).toString().replace("-", ""));
|
| | | finalList.get(key).getMonth().setIncome(income.setScale(2).toString());
|
| | |
| | | return finalList;
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public long countUserMoneyDetailForClient(Long uid, Long detailId, Date maxTime) {
|
| | | long monthCount = 0L;
|
| | |
| | | if (maxTime == null) {
|
| | | detailCount = redPackDetailMapper.selectCountByUid(uid);
|
| | | // 用于表示当前所有
|
| | | monthCount = redPackDetailMapper.selectMonthCountByUid(uid, new Date(System.currentTimeMillis() + 1000 * 60 * 60L));
|
| | | monthCount = redPackDetailMapper.selectMonthCountByUid(uid,
|
| | | new Date(System.currentTimeMillis() + 1000 * 60 * 60L));
|
| | | } else {// 通过时间筛选了的,需要查询所有
|
| | | detailCount = redPackDetailMapper.selectCountByUidAndMaxCreateTime(uid, maxTime);
|
| | | monthCount = redPackDetailMapper.selectMonthCountByUid(uid, maxTime);
|
| | |
| | |
|
| | | return monthCount + detailCount;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void changeDisplayByIdentifyCode(String code, boolean disPlay) {
|
| | | if (StringUtil.isNullOrEmpty(code))
|
| | | return;
|
| | | RedPackDetail oldDetail = getByIdentifyCode(code);
|
| | | if (oldDetail != null) {// 外显红包详情
|
| | | RedPackDetail update = new RedPackDetail();
|
| | | update.setId(oldDetail.getId());
|
| | | update.setDisplay(true);
|
| | | redPackDetailMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public BigDecimal countWinMoneyByDate(long uid, int dateType) {
|
| | | return redPackDetailMapper.countWinMoneyByDate(uid, dateType);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public BigDecimal countReduceMoneyByDate(long uid, int dateType) {
|
| | | return redPackDetailMapper.countReduceMoneyByDate(uid, dateType);
|
| | | }
|
| | | |
| | | @Override
|
| | | public List<RedPackDetail> query(Integer start, Integer count, String key, Long uid, Integer type){
|
| | | return redPackDetailMapper.query(start, count, key, uid, type);
|
| | | }
|
| | | |
| | | @Override
|
| | | public long count(String key,Long uid, Integer type){
|
| | | return redPackDetailMapper.count(key, uid, type);
|
| | | }
|
| | | |
| | | @Override
|
| | | public Long countNumByDay(String preDay) {
|
| | | return redPackDetailMapper.countNumByDay(preDay);
|
| | | }
|
| | |
|
| | |
|
| | | |
| | | |
| | | @Override
|
| | | public BigDecimal countMoneyByDay(String preDay) {
|
| | | return redPackDetailMapper.countMoneyByDay(preDay);
|
| | | }
|
| | | }
|