| | |
| | | import org.yeshi.utils.DateUtil;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.tlj.UserTaoLiJinOriginMapper;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherGiveContentDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
|
| | | import com.yeshi.fanli.entity.bus.tlj.DeviceTaoLiJinRecord;
|
| | | import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinDetail;
|
| | | import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinGiveRecord;
|
| | | import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinDetail.TaoLiJinDetailTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinOrigin;
|
| | | import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinOrigin.TaoLiJinOriginEnum;
|
| | |
| | | });
|
| | | }
|
| | |
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public void overdueHongBao(Long uid) {
|
| | |
| | |
|
| | | BigDecimal total = new BigDecimal(0);
|
| | | for (UserTaoLiJinOrigin userTaoLiJinOrigin : list) {
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH.mm");
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
|
| | | String time = sd.format(userTaoLiJinOrigin.getCreateTime());
|
| | |
|
| | | BigDecimal moneySurplus = userTaoLiJinOrigin.getMoneySurplus();
|
| | |
| | | return origin;
|
| | | }
|
| | |
|
| | | |
| | | |
| | | @Override
|
| | | @Transactional
|
| | | public void giveSendBack(Long uid, UserTaoLiJinGiveRecord record) throws UserTaoLiJinOriginException{
|
| | | if (uid == null || record == null) {
|
| | | throw new UserTaoLiJinOriginException(1, "参数不能为空");
|
| | | }
|
| | | |
| | | BigDecimal money = record.getAmount();
|
| | | |
| | | // 添加红包余额
|
| | | userMoneyExtraService.addTaoLiJin(uid, money, false);
|
| | | // 添加新增记录
|
| | | saveOrigin(uid, 1, money, TaoLiJinOriginEnum.giveSendBack);
|
| | | // 红包明细
|
| | | UserTaoLiJinDetail detail = new UserTaoLiJinDetail();
|
| | | detail.setUid(uid);
|
| | | detail.setMoney(money);
|
| | | detail.setType(TaoLiJinDetailTypeEnum.giveBack);
|
| | | detail.setTitle(TaoLiJinDetailTypeEnum.giveBack.getDesc());
|
| | | detail.setCreateTime(new Date());
|
| | | userTaoLiJinDetailService.insertSelective(detail);
|
| | | |
| | | |
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | // 退回消息
|
| | | String beiZhu = "请到我的-推广红包查看";
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
|
| | | MsgOtherGiveContentDTO msgOther = new MsgOtherGiveContentDTO();
|
| | | msgOther.setType(MsgOtherGiveContentDTO.TYEP_TLJ);
|
| | | msgOther.setTitle("推广红包退回");
|
| | | msgOther.setGiveType("你赠送的¥"+ money + "元推广红包未被领取");
|
| | | msgOther.setGiveTime(sd.format(record.getGiveTime()));
|
| | | msgOther.setReturnTime(sd.format(new Date()));
|
| | | userOtherMsgNotificationService.tokenGiveMsg(record.getGiveUid(), beiZhu, msgOther);
|
| | | }
|
| | | });
|
| | | |
| | | }
|
| | | |
| | | }
|