admin
2019-08-27 e6764831a890de26fcfebb4fb8f3a22e9f8cc816
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinOriginServiceImpl.java
@@ -14,9 +14,11 @@
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;
@@ -433,7 +435,7 @@
      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();
@@ -614,10 +616,12 @@
   
   @Override
   @Transactional
   public void  giveSendBack(Long uid, BigDecimal money) throws UserTaoLiJinOriginException{
      if (uid == null || money == null) {
   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);
@@ -632,6 +636,24 @@
      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);
         }
      });
   }
   
}