|
|
@@ -7,6 +7,7 @@ import cn.hutool.http.HttpUtil;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.cyksj.common.constant.Constant;
|
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
import com.cyksj.common.snowflake.Sequence;
|
|
|
import com.cyksj.common.util.Codec;
|
|
|
@@ -19,6 +20,7 @@ import com.cyksj.dto.CorpOauth2UserInfo;
|
|
|
import com.cyksj.dto.Result;
|
|
|
import com.cyksj.enums.GatewayResponse;
|
|
|
import com.cyksj.mapper.GroupsRelationExpiryRecordMapper;
|
|
|
+import com.cyksj.mapper.OrderDonMapper;
|
|
|
import com.cyksj.mapper.corp.CorpFollowMapper;
|
|
|
import com.cyksj.mapper.corp.CorpUserAuthMapper;
|
|
|
import com.cyksj.mapper.corp.CorpUserTagMapper;
|
|
|
@@ -96,6 +98,8 @@ public class WxCorpController {
|
|
|
|
|
|
private final ClaudeService claudeService;
|
|
|
|
|
|
+ private final OrderDonMapper orderDonMapper;
|
|
|
+
|
|
|
private final static String CORP_UUID = "corp-uuid";
|
|
|
|
|
|
/**
|
|
|
@@ -468,6 +472,24 @@ public class WxCorpController {
|
|
|
.field(TicketView::getGrStatus, List.of("validity", "outside")).op(Operator.InList)
|
|
|
.orderBy(TicketView::getExpiryTime).asc()
|
|
|
.build());
|
|
|
+ ticketViews.getDataList().forEach(ticket->{
|
|
|
+ OrderDon orderDon = orderDonMapper.selectOne(Wrappers.lambdaQuery(OrderDon.class)
|
|
|
+ .eq(OrderDon::getRelationId, ticket.getRelationId())
|
|
|
+ .eq(OrderDon::getUserId, ticket.getUserId())
|
|
|
+ .eq(OrderDon::getOrderType, 1)
|
|
|
+ .notIn(OrderDon::getStatus, Constant.noOrderAllStatus)
|
|
|
+ .orderByDesc(OrderDon::getId)
|
|
|
+ .last("limit 1"));
|
|
|
+ if (orderDon != null) {
|
|
|
+ ticket.setOrderNo(orderDon.getOrderNo());
|
|
|
+ ticket.setOrderId(orderDon.getId());
|
|
|
+ ticket.setTransactionId(orderDon.getTransactionId());
|
|
|
+ if (ticket.getSecondType() != null && ticket.getSecondType() == 1) {
|
|
|
+ //是否完成邀请 根据订单状态
|
|
|
+ ticket.setIsComplete(orderDon.getStatus() == OrderDon.Status.complete ? true : false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(ticketViews);
|
|
|
}
|
|
|
|
|
|
@@ -543,4 +565,20 @@ public class WxCorpController {
|
|
|
claudeService.clearNumByRelationId(relationId);
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取手机临时验证码
|
|
|
+ */
|
|
|
+ @GetMapping("/get/tmp/code")
|
|
|
+ public Result<String> getPhoneTmpCode(String phone) throws Exception {
|
|
|
+ String corpUuid = getCorpUuid();
|
|
|
+ if (StrUtil.isEmpty(corpUuid)) {
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
+ }
|
|
|
+ if (StrUtil.isEmpty(phone)) {
|
|
|
+ throw BusinessRuntimeException.getInstance("请输入手机号");
|
|
|
+ }
|
|
|
+ String code = corpUserService.getPhoneTmpCode(phone);
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(code);
|
|
|
+ }
|
|
|
}
|