From d3a9feeeee6f70462d12e48db5fd1cab9b183bc8 Mon Sep 17 00:00:00 2001 From: yujian <yujian@123.com> Date: 星期二, 17 九月 2019 17:14:54 +0800 Subject: [PATCH] 更改goodsType --- fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinOriginServiceImpl.java | 51 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 47 insertions(+), 4 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinOriginServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinOriginServiceImpl.java index 01846fc..9e52f6d 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinOriginServiceImpl.java +++ b/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; @@ -27,6 +29,7 @@ import com.yeshi.fanli.entity.bus.user.UserRank; import com.yeshi.fanli.exception.tlj.UserTaoLiJinOriginException; import com.yeshi.fanli.log.LogHelper; +import com.yeshi.fanli.service.inter.money.UserMoneyExtraService; import com.yeshi.fanli.service.inter.msg.UserOtherMsgNotificationService; import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService; import com.yeshi.fanli.service.inter.tlj.DeviceTaoLiJinRecordService; @@ -35,7 +38,6 @@ import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinRecordService; import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinReportService; import com.yeshi.fanli.service.inter.user.UserInfoExtraService; -import com.yeshi.fanli.service.inter.user.UserMoneyExtraService; import com.yeshi.fanli.util.MoneyBigDecimalUtil; import com.yeshi.fanli.util.StringUtil; @@ -399,8 +401,6 @@ }); } - - @Override public void overdueHongBao(Long uid) { @@ -435,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(); @@ -612,4 +612,47 @@ 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); + } + }); + + } + } -- Gitblit v1.8.0