Merge remote-tracking branch 'origin/div' into div
| | |
| | | data.put("weiXinTip", "系统已发送提醒,邀请人添加微信后你可复制,如对方迟迟不添加,你可联系人工客服寻求帮助");
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | out.print(JsonUtil.loadFalseResult("提醒失败"));
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | * @param dateFormat |
| | | * @return |
| | | */ |
| | | List<IntegralMonthVO> selectMonthMoneyByUid(@Param("uid") Long uid, @Param("dateFormat") List<String> dateFormat, @Param("type")Integer type); |
| | | List<IntegralMonthVO> selectMonthMoneyByUid(@Param("uid") Long uid, @Param("dateFormat") List<String> dateFormat); |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dto.msg;
|
| | |
|
| | | /**
|
| | | * 奖励积分
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class MsgOtherRewardIntegralDTO {
|
| | | private String title;
|
| | | private String source;// 来源
|
| | | private String num;// 订单号
|
| | | private String total;// 剩余
|
| | | private String explain;// 说明
|
| | |
|
| | | public String getTitle() {
|
| | | return title;
|
| | | }
|
| | |
|
| | | public void setTitle(String title) {
|
| | | this.title = title;
|
| | | }
|
| | |
|
| | | public String getSource() {
|
| | | return source;
|
| | | }
|
| | |
|
| | | public void setSource(String source) {
|
| | | this.source = source;
|
| | | }
|
| | |
|
| | | public String getNum() {
|
| | | return num;
|
| | | }
|
| | |
|
| | | public void setNum(String num) {
|
| | | this.num = num;
|
| | | }
|
| | |
|
| | | public String getTotal() {
|
| | | return total;
|
| | | }
|
| | |
|
| | | public void setTotal(String total) {
|
| | | this.total = total;
|
| | | }
|
| | |
|
| | | public String getExplain() {
|
| | | return explain;
|
| | | }
|
| | |
|
| | | public void setExplain(String explain) {
|
| | | this.explain = explain;
|
| | | }
|
| | | }
|
| | |
| | | public enum MsgTypeOtherTypeEnum {
|
| | | couponMianDan("免单券"), couponWelfareMianDan("福利免单券"), freeCouponBuy("自购免单券"),
|
| | | freeCouponGive("赠送免单券"), couponReward("奖励券"), taoLiJin("推广红包"), give("赠送"), exchange("金币兑换")
|
| | | , couponActivate("免单券激活");
|
| | | , couponActivate("免单券激活"), firstOrderReward("队员首单奖励邀请人金币");
|
| | |
|
| | | private final String desc;
|
| | |
|
| | |
| | |
|
| | |
|
| | | /**
|
| | | * 每天00:10 赠送退回已过期淘礼金
|
| | | * 每2个小时 赠送退回已过期淘礼金
|
| | | */
|
| | | @Scheduled(cron = "0 10 0 * * ? ")
|
| | | @Scheduled(cron = "0 0 0/2 * * ? ")
|
| | | public void giveSendBack() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | |
| | | LEFT JOIN (SELECT DATE_FORMAT(d.`td_create_time`,'%Y-%m') AS `time`,SUM(d.`td_money`)AS money |
| | | FROM `yeshi_ec_integral_detail` d |
| | | WHERE d.`td_uid`=#{uid} AND d.`td_money`<![CDATA[>=]]>0 AND DATE_FORMAT(d.`td_create_time`,'%Y-%m')=#{item} |
| | | <if test="type == 1">AND d.td_money <![CDATA[>]]> 0</if> |
| | | <if test="type == 2">AND d.td_money <![CDATA[<]]> 0</if> |
| | | GROUP BY DATE_FORMAT(d.`td_create_time`,'%Y-%m') |
| | | ) a ON a.time=c.time |
| | | |
| | | LEFT JOIN(SELECT DATE_FORMAT(d.`td_create_time`,'%Y-%m') AS `time`,SUM(d.`td_money`) AS money |
| | | FROM `yeshi_ec_integral_detail` d |
| | | WHERE d.`td_uid`=#{uid} AND d.`td_money` <![CDATA[<]]>0 AND DATE_FORMAT(d.`td_create_time`,'%Y-%m')=#{item} |
| | | <if test="type == 1">AND d.td_money <![CDATA[>]]> 0</if> |
| | | <if test="type == 2">AND d.td_money <![CDATA[<]]> 0</if> |
| | | GROUP BY DATE_FORMAT(d.`td_create_time`,'%Y-%m') |
| | | ) b ON c.time=b.time |
| | | </trim> |
| | |
| | | |
| | | <select id="overdueList" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_user_taolijin_give_record d |
| | | WHERE d.`tgr_state` = 0 AND d.`tgr_end_time` IS NOT NULL AND d.`tgr_end_time` <![CDATA[<]]> CURDATE() |
| | | WHERE d.`tgr_state` = 0 AND d.`tgr_end_time` IS NOT NULL AND d.`tgr_end_time` <![CDATA[<]]> NOW() |
| | | LIMIT #{count} |
| | | </select> |
| | | </mapper> |
| | |
| | |
|
| | | <select id="countMoneyByDate" resultType="java.math.BigDecimal">
|
| | | SELECT IFNULL(SUM(t.`uto_money`),0) FROM `yeshi_ec_user_taolijin_origin` t
|
| | | WHERE t.`uto_uid` = #{uid} AND t.`uto_origin` <![CDATA[<>]]>'refund'
|
| | | WHERE t.`uto_uid` = #{uid} AND t.`uto_origin` <![CDATA[<>]]>'refund' AND t.`uto_origin` <![CDATA[<>]]>'giveSendBack'
|
| | | <if test="dateType == 1"> <!-- 今日 -->
|
| | | AND TO_DAYS(t.`uto_create_time`) = TO_DAYS(NOW());
|
| | | </if>
|
| | |
| | | ? "0" + monthMap.get(key).getMonth().getMonth() : monthMap.get(key).getMonth().getMonth();
|
| | | dateFormat.add(date);
|
| | | }
|
| | | List<IntegralMonthVO> voList = integralDetailMapper.selectMonthMoneyByUid(uid, dateFormat, type);
|
| | | List<IntegralMonthVO> voList = integralDetailMapper.selectMonthMoneyByUid(uid, dateFormat);
|
| | |
|
| | | int p = 0;
|
| | | keys = monthMap.keySet().iterator();
|
| | |
| | | import org.yeshi.utils.DateUtil;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.integral.IntegralTaskRecordMapper;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherRewardIntegralDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.integral.IntegralDetail;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTask;
|
| | |
| | | import com.yeshi.fanli.exception.integral.IntegralTaskRecordException;
|
| | | import com.yeshi.fanli.exception.user.UserInfoExtraException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralDetailService;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralTaskClassService;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralTaskRecordService;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralTaskService;
|
| | | import com.yeshi.fanli.service.inter.msg.UserOtherMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | |
|
| | | @Service
|
| | |
| | |
|
| | | @Resource
|
| | | private IntegralTaskClassService integralTaskClassService;
|
| | | |
| | | @Resource
|
| | | private UserOtherMsgNotificationService userOtherMsgNotificationService;
|
| | | |
| | | @Resource
|
| | | private ConfigService configService;
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public Integer getTotalGoldCoin(long uid, Long cid, Integer dateType) {
|
| | |
| | | if (userInfoExtra == null) {
|
| | | throw new IntegralTaskRecordException(1, "用户信息不全");
|
| | | }
|
| | |
|
| | | |
| | | Integer totalGoldCoin = 0;
|
| | | for (Long id : idList) {
|
| | | IntegralTaskRecord record = integralTaskRecordMapper.selectByPrimaryKey(id);
|
| | |
| | | public List<IntegralTaskRecord> listByUidAndTaskId(Long uid, Long taskId, int page, int count) {
|
| | | return integralTaskRecordMapper.listByUidAndTaskId(uid, taskId, (page - 1) * count, count);
|
| | | }
|
| | | |
| | | /**
|
| | | * 被邀请人下了首单(第一笔返利订单) 直接给邀请人一笔金币
|
| | | * @param uid
|
| | | */
|
| | | @Override
|
| | | public void firstOrderRewardInviter(Long uid, String beizu) {
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra == null) |
| | | return;
|
| | | |
| | | String reward = configService.get("first_order_reward_boss");
|
| | | if (StringUtil.isNullOrEmpty(reward)) |
| | | return;
|
| | | |
| | | Integer goldCoin = userInfoExtra.getGoldCoin();
|
| | | if (goldCoin == null)
|
| | | goldCoin = 0;
|
| | | |
| | | int addGoldCoin = Integer.parseInt(reward);
|
| | | goldCoin = goldCoin + addGoldCoin;
|
| | | |
| | | try {
|
| | | // 增加金币
|
| | | UserInfoExtra extra = new UserInfoExtra();
|
| | | extra.setId(userInfoExtra.getId());
|
| | | extra.setGoldCoin(goldCoin);
|
| | | userInfoExtraService.saveUserInfoExtra(extra);
|
| | | } catch (UserInfoExtraException e) {
|
| | | e.printStackTrace();
|
| | | return;
|
| | | }
|
| | |
|
| | | // 金币详情
|
| | | IntegralDetail detail = new IntegralDetail();
|
| | | detail.setTitle("队员首笔奖励");
|
| | | detail.setUid(uid);
|
| | | detail.setMoney(addGoldCoin);
|
| | | detail.setRemark(beizu);
|
| | | detail.setCreateTime(new Date());
|
| | | integralDetailService.insertSelective(detail);
|
| | | |
| | | // 消息
|
| | | MsgOtherRewardIntegralDTO msgOther = new MsgOtherRewardIntegralDTO();
|
| | | msgOther.setTitle("金币奖励");
|
| | | msgOther.setSource("一级队员首笔下单,系统奖励邀请人金币");
|
| | | msgOther.setNum(addGoldCoin + "金币");
|
| | | msgOther.setTotal(goldCoin + "金币");
|
| | | msgOther.setExplain("仅一级队员首笔下单奖励(已到账)");
|
| | | userOtherMsgNotificationService.firstOrderRewardMsg(uid, "", msgOther);
|
| | | }
|
| | | |
| | | }
|
| | |
| | | } else if (detail.getType() == MsgTypeOtherTypeEnum.couponActivate) {
|
| | | msgOtherDetailMapper.insertSelective(detail);
|
| | | userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | } else if (detail.getType() == MsgTypeOtherTypeEnum.firstOrderReward) {
|
| | | msgOtherDetailMapper.insertSelective(detail);
|
| | | userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | import com.yeshi.fanli.dto.msg.MsgOtherCouponContentDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherExchangeContentDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherGiveContentDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherRewardIntegralDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail.MsgTypeOtherTypeEnum;
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | @Override
|
| | | public void firstOrderRewardMsg(Long uid, String beiZhu, MsgOtherRewardIntegralDTO content) {
|
| | | try {
|
| | | MsgOtherDetail detail = new MsgOtherDetail();
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setRead(false);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setContent(new Gson().toJson(content));
|
| | | detail.setType(MsgTypeOtherTypeEnum.firstOrderReward);
|
| | | msgOtherDetailService.addMsgOtherDetail(detail);
|
| | | } catch (MsgOtherDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | // 添加红包余额
|
| | | userMoneyExtraService.addTaoLiJin(uid, money, false);
|
| | | // 添加新增记录
|
| | | UserTaoLiJinOrigin origin = saveOrigin(uid, 1, money, TaoLiJinOriginEnum.giveSendBack);
|
| | | saveOrigin(uid, 1, money, TaoLiJinOriginEnum.giveSendBack);
|
| | | // 红包明细
|
| | | userTaoLiJinDetailService.createAddDetail(origin);
|
| | | UserTaoLiJinDetail detail = new UserTaoLiJinDetail();
|
| | | detail.setUid(uid);
|
| | | detail.setMoney(money);
|
| | |
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
|
| | | MsgOtherGiveContentDTO msgOther = new MsgOtherGiveContentDTO();
|
| | | msgOther.setType(MsgOtherGiveContentDTO.TYEP_TLJ);
|
| | | msgOther.setTitle("赠送推广红包退回");
|
| | | msgOther.setGiveType("你赠送的"+ money + "推广红包未被成功领取");
|
| | | msgOther.setTitle("推广红包退回");
|
| | | msgOther.setGiveType("你赠送的"+ money.setScale(0) + "元推广红包未被成功领取");
|
| | | msgOther.setGiveTime(sd.format(record.getGiveTime()));
|
| | | msgOther.setReturnTime(sd.format(new Date()));
|
| | | userOtherMsgNotificationService.tokenGiveMsg(record.getGiveUid(), beiZhu, msgOther);
|
| | |
| | | */
|
| | | public long countByCidAndUidAndCreateTime(Long cid,Long uid, Date minTime, Date maxTime);
|
| | |
|
| | | /**
|
| | | * 被邀请人下了首单(第一笔返利订单),则直接给邀请人一笔金币进入到金币余额中(金币的额度暂定为1500金币)
|
| | | * @param uid 邀请人id
|
| | | * @param beizu 备注信息
|
| | | */
|
| | | public void firstOrderRewardInviter(Long uid, String beizu);
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.dto.msg.MsgOtherCouponActivateDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherExchangeContentDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherGiveContentDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherRewardIntegralDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail.MsgTypeOtherTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | |
| | | */
|
| | | public void giveCouponActivateMsg(Long uid, String beiZhu, MsgOtherCouponActivateDTO content);
|
| | |
|
| | | /**
|
| | | * 队员首单奖励邀请人
|
| | | * @param uid
|
| | | * @param beiZhu
|
| | | * @param content
|
| | | */
|
| | | public void firstOrderRewardMsg(Long uid, String beiZhu, MsgOtherRewardIntegralDTO content);
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.dto.msg.MsgOtherCouponContentDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherExchangeContentDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherGiveContentDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherRewardIntegralDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail.MsgTypeAccountTypeEnum;
|
| | |
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | | userMsgVO.setContentItems(items);
|
| | | return userMsgVO;
|
| | | } else if (msg.getType() == MsgTypeOtherTypeEnum.firstOrderReward) {
|
| | | if (StringUtil.isNullOrEmpty(msg.getContent()))
|
| | | return null;
|
| | |
|
| | | MsgOtherRewardIntegralDTO dto = new Gson().fromJson(msg.getContent(), MsgOtherRewardIntegralDTO.class);
|
| | | if (dto == null)
|
| | | return null;
|
| | |
|
| | | icon = "http://img.flqapp.com/resource/msg/icon_msg_other_integral.png";
|
| | | |
| | | List<ClientTextStyleVO> contentList = new ArrayList<>();
|
| | | |
| | | if (!StringUtil.isNullOrEmpty(dto.getSource())) {
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(dto.getSource() + "", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("来源", COLOR_TITLE), contentList));
|
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(dto.getNum())) {
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(dto.getNum() + "", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("数量", COLOR_TITLE), contentList));
|
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(dto.getTotal())) {
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(dto.getTotal() + "", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("剩余", COLOR_TITLE), contentList));
|
| | | }
|
| | | |
| | | if (!StringUtil.isNullOrEmpty(dto.getExplain())) {
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(dto.getExplain() + "", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("说明", COLOR_TITLE), contentList));
|
| | | }
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
|
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | | |
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setIcon(icon);
|
| | | userMsgVO.setTitle(dto.getTitle());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | | userMsgVO.setContentItems(items);
|
| | | return userMsgVO;
|
| | | }
|
| | |
|
| | |
|
| | | return new UserMsgVO(icon, msg.getType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | }
|