| | |
| | | import com.hx.phip.config.ApproveConfig; |
| | | import com.hx.phip.config.CustomParameter; |
| | | import com.hx.phip.dao.mapper.*; |
| | | import com.hx.phip.model.ApplyParameter; |
| | | import com.hx.phip.model.SysParameter; |
| | | import com.hx.phip.service.OrdersTotalService; |
| | | import com.hx.phip.service.ProjectService; |
| | | import com.hx.phip.service.SystemParameterService; |
| | | import com.hx.phip.service.deduction.DeductionSingleService; |
| | | import com.hx.phip.service.init.OrderInitService; |
| | | import com.hx.phip.service.order.OrderRiseService; |
| | | import com.hx.phip.service.order.OrderServiceV2; |
| | | import com.hx.phip.service.userLevel.UserLevelRuleService; |
| | | import com.hx.phip.tool.ApplyParameterTool; |
| | | import com.hx.phip.tool.SendSMSTool; |
| | | import com.hx.phip.tool.deduction.UserDeductionSingleTool; |
| | | import com.hx.phip.util.OrdersSnapshotUtil; |
| | | import com.hx.phip.util.api.ApiPlatformUtil; |
| | |
| | | import com.platform.entity.ThirtApplication; |
| | | import com.platform.exception.PlatTipsException; |
| | | import com.platform.resultTool.PlatformCode; |
| | | import com.platform.resultTool.SystemCode; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.scheduling.annotation.Async; |
| | |
| | | private DeductionSingleService deductionSingleService; |
| | | @Resource |
| | | private OrderRiseService orderRiseService; |
| | | @Resource |
| | | private SystemParameterService systemParameterService; |
| | | |
| | | /** |
| | | * @param opShopId 操作人门店 |
| | |
| | | message=e.getMessage(); |
| | | } |
| | | |
| | | //结账成功发送公众号通知给用户 -异步 |
| | | // 结账成功发送公众号通知给用户 -异步 |
| | | try { |
| | | sendPublicNo(ordersTotal.getId(),commonService); |
| | | } catch (TipsException | PlatTipsException e){ |
| | |
| | | logger.info("结账成功发送公众号通知给用户异常 -异步:{}", e.getMessage(),e); |
| | | } |
| | | |
| | | // 结账成功发送短信通知给用户 -异步 |
| | | try { |
| | | sentSMSInfo(ordersTotal.getId(), commonService); |
| | | } catch (Exception e){ |
| | | logger.info("结账成功发送短信通知给用户异常 -异步:{}", e.getMessage(),e); |
| | | } |
| | | |
| | | //返回phis订单号、phis订单id |
| | | data.put("orderId",ordersTotal.getId()); |
| | |
| | | |
| | | @Override |
| | | @Async |
| | | public void sentSMSInfo(String orderId, CommonService commonService){ |
| | | // 跳转链接 |
| | | String secondaryItemStr = getSMSUrl(); |
| | | // 添加定时器任务处理 |
| | | TimerHandleTool.addTask(commonService, TimerHandleItem.TYPE_ORDER_CONFIRM_SMS_INFO, orderId, secondaryItemStr); |
| | | } |
| | | |
| | | /** |
| | | * 生成需要发送短信的地址 |
| | | * @return 返回 |
| | | */ |
| | | private String getSMSUrl() { |
| | | // 生成小程序链接 |
| | | String urlLink = null; |
| | | // 正式区在拿取链接 |
| | | if (PlatformPattern.PROD.equals(customParameter.getPlatformPatternMoney())) { |
| | | // 获取用户CRM小程序token |
| | | ApplyParameter applyParameter = ApplyParameterTool.getMpParameter("wx71e6babac80abcee", commonService); |
| | | if (applyParameter == null) { |
| | | throw new PlatTipsException(PlatformCode.ERROR_TIPS, "mpId is error"); |
| | | } |
| | | // 获取范围密钥 |
| | | SysParameter sysParameter = systemParameterService.getAccessToken(applyParameter.getMpAppId(), applyParameter.getMpSecretKey()); |
| | | if (sysParameter == null) { |
| | | throw new PlatTipsException(PlatformCode.ERROR_SYSTEM, "服务错误" + SystemCode.ERROR_GET_CORP_TOKEN); |
| | | } |
| | | |
| | | // 更换链接 原CRM 1.0 /pages/recharge/incrementInfo |
| | | String result = SendSMSTool.getAooLetUrl(sysParameter.getParamValue(), "/packages/order/orderConfirm", "", "release"); |
| | | if (!StringUtils.isEmpty(result)) { |
| | | JSONObject jsonObject = JSON.parseObject(result); |
| | | if (jsonObject.getInteger("errcode") != 0) { |
| | | throw new PlatTipsException(PlatformCode.ERROR_SYSTEM, "生成短信小程序路径错误:" + jsonObject.getString("msg") + SystemCode.ERROR_GET_CORP_TOKEN); |
| | | } |
| | | urlLink = jsonObject.getString("url_link"); |
| | | } |
| | | } else { |
| | | // 测试区跳转百度 |
| | | urlLink = "https://wxaurl.cn/6666"; |
| | | } |
| | | return urlLink; |
| | | } |
| | | |
| | | @Override |
| | | @Async |
| | | public void sendUserConsultant(String userId,String orderNo,String orderId,JSONObject commissionObject, CommonService commonService) { |
| | | OrdersTotal ordersTotal=commonService.selectOneByKeyBlob(OrdersTotalMapper.class,orderId); |
| | | if(ordersTotal!=null){ |