| | |
| | | import com.hx.phiappt.common.OriginChannelConstants; |
| | | import com.hx.phiappt.constants.tool.money.UserMoneyTool; |
| | | import com.hx.phiappt.model.*; |
| | | import com.hx.phiappt.model.order.OrderItem; |
| | | import com.hx.phiappt.model.order.OrdersTotal; |
| | | import com.hx.phip.common.wx.corp.WeiXinMpUtil; |
| | | import com.hx.phip.dao.mapper.*; |
| | | import com.hx.phip.model.ApplyParameter; |
| | |
| | | int count = userMoneyUnclaimedMapper.insert(userMoneyUnclaimed); |
| | | if (count != 1) { |
| | | throw new TipsException("新增失败!"); |
| | | } else { |
| | | // 重新获取下数据 |
| | | UserMoneyUnclaimed checkUserMoneyUnclaimed = userMoneyUnclaimedMapper.selectOneByKey(userMoneyUnclaimed.getId()); |
| | | if(checkUserMoneyUnclaimed != null) { |
| | | // 过滤待领取的数据 |
| | | this.handlerReceiveData(checkUserMoneyUnclaimed, BaseEntity.YES); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | // 判断订单 先不判断订单 |
| | | /*if(!StringUtils.isEmpty(userMoneyUnclaimed.getOrderId())){ |
| | | if(!StringUtils.isEmpty(userMoneyUnclaimed.getOrderId())){ |
| | | OrdersTotal ordersTotal = commonService.selectOneByKey(OrdersTotalMapper.class, userMoneyUnclaimed.getOrderId()); |
| | | if(ordersTotal == null){ |
| | | throw new PlatTipsException(PlatformCode.ERROR_TIPS, "主订单的信息不存在"); |
| | |
| | | throw new PlatTipsException(PlatformCode.ERROR_TIPS, "子订单的信息与主订单的信息不匹配"); |
| | | } |
| | | } |
| | | }*/ |
| | | } |
| | | |
| | | // 获取有效期时间配置 待领取默认30天领取 |
| | | Date validityTime = UserMoneyTool.getUnclaimedValidityTime(commonService); |
| | |
| | | private void checkIsNeedSentSMS(UserMoneyUnclaimed userMoneyUnclaimed){ |
| | | if(!StringUtils.isEmpty(userMoneyUnclaimed.getOriginChannel()) && userMoneyUnclaimed.getOpType() == UserMoneyUnclaimed.OP_TYPE_RECEIVE) { |
| | | // CRM不用发送短信领取其他平台需要发送短信领取 |
| | | if(!OriginChannelConstants.ORIGIN_CHANNEL_CRM.equals(userMoneyUnclaimed.getOriginChannel())) { |
| | | userMoneyUnclaimed.setIsSentSMS(BaseEntity.YES); |
| | | String url = getSMSUrl(); |
| | | if(StringUtils.isEmpty(url)){ |
| | | throw new PlatTipsException(PlatformCode.ERROR_TIPS, "获取发送短信链接地址出现异常!"); |
| | | } |
| | | userMoneyUnclaimed.setSMSUrl(url); |
| | | // if(!OriginChannelConstants.ORIGIN_CHANNEL_CRM.equals(userMoneyUnclaimed.getOriginChannel())) { |
| | | userMoneyUnclaimed.setIsSentSMS(BaseEntity.YES); |
| | | String url = getSMSUrl(); |
| | | if (StringUtils.isEmpty(url)) { |
| | | throw new PlatTipsException(PlatformCode.ERROR_TIPS, "获取发送短信链接地址出现异常!"); |
| | | } |
| | | userMoneyUnclaimed.setSMSUrl(url); |
| | | //} |
| | | } |
| | | } |
| | | |