| | |
| | | package com.yeshi.fanli.service.impl.money;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | |
| | | || record.getPreRecieveTime() == null)
|
| | | throw new ParamsException(1, "参数不完整");
|
| | |
|
| | | TeamEincomeRecord oldRecord = teamEincomeRecordMapper.selectByUidAndPreRecieveTimeAndType(record.getUid(),
|
| | | record.getPreRecieveTime(), record.getType());
|
| | | TeamEincomeRecord oldRecord = teamEincomeRecordMapper.selectByUidAndPreRecieveTimeAndTypeAndSourceType(record.getUid(),
|
| | | record.getPreRecieveTime(), record.getType(),record.getSourceType());
|
| | | if (oldRecord != null)
|
| | | throw new TeamEincomeRecordException(1, "已存在");
|
| | | if (record.getCreateTime() == null)
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<TeamEincomeRecord> listCanRecieveRecord(Date preRecieveTime, Long uid) {
|
| | | public List<TeamEincomeRecord> listCanRecieveRecord(Date preRecieveTime, Long uid, List<Integer> typeList) {
|
| | |
|
| | | return teamEincomeRecordMapper.listByUidAndPreRecieveTimeAndState(uid, preRecieveTime,
|
| | | return teamEincomeRecordMapper.listByUidAndPreRecieveTimeAndState(uid, preRecieveTime, typeList,
|
| | | TeamEincomeRecord.STATE_NOT_RECIEVE);
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public BigDecimal getEstimateDividents(Date preGetTime, Long uid) {
|
| | | List<Integer> typeList = new ArrayList<Integer>();
|
| | | List<TeamEincomeRecord> list = listCanRecieveRecord(preGetTime, uid, typeList);
|
| | | BigDecimal money = new BigDecimal(0);
|
| | | if (list != null)
|
| | | for (TeamEincomeRecord record : list) {
|
| | | money = money.add(record.getMoney());
|
| | | }
|
| | | return money;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Long> listCanRecieveUid(Date preRecieveTime, List<Integer> typeList, int page, int pageSize) {
|
| | | return teamEincomeRecordMapper.listCanRecieveUid(preRecieveTime, typeList, (page - 1) * pageSize, pageSize);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countCanRecieveUid(Date preRecieveTime, List<Integer> typeList) {
|
| | | return teamEincomeRecordMapper.countCanRecieveUid(preRecieveTime, typeList);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public BigDecimal sumRecieveByType(Long uid, int type) {
|
| | | BigDecimal money = teamEincomeRecordMapper.sumRecieveByType(uid, type);
|
| | | if (money == null) {
|
| | | money = new BigDecimal(0);
|
| | | }
|
| | | return money;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | }
|