|
|
|
@ -43,6 +43,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
import java.text.DateFormat;
|
|
|
|
|
import java.text.ParseException;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
@ -174,6 +175,36 @@ public class CustomerService {
|
|
|
|
|
* @return 是否成功
|
|
|
|
|
*/
|
|
|
|
|
public void turnBack(TurnBackDTO turnBackDTOS) throws Exception {
|
|
|
|
|
String eaCode = turnBackDTOS.getEaCode();
|
|
|
|
|
// 判断是否是活动扫码
|
|
|
|
|
if(eaCode.contains(Constants.ACTIVITY_QR_CODE_PREFIX)){
|
|
|
|
|
// 活动码处理
|
|
|
|
|
handleActivity(turnBackDTOS, eaCode);
|
|
|
|
|
}else{
|
|
|
|
|
// 导购码处理
|
|
|
|
|
handleCustomer(turnBackDTOS);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 活动码处理
|
|
|
|
|
* @param turnBackDTOS 回调对象
|
|
|
|
|
* @param eaCode 二维码的state字段
|
|
|
|
|
*/
|
|
|
|
|
private void handleActivity(TurnBackDTO turnBackDTOS, String eaCode){
|
|
|
|
|
String[] strArr = eaCode.split(Constants.LINE);
|
|
|
|
|
Long instanceId = Long.parseLong(strArr[1]);
|
|
|
|
|
int type = Integer.parseInt(strArr[2]);
|
|
|
|
|
Long promoterId = Long.parseLong(strArr[3]);
|
|
|
|
|
|
|
|
|
|
// 处理逻辑
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 处理客户扫码回调的方法
|
|
|
|
|
* @param turnBackDTOS 回调对象
|
|
|
|
|
*/
|
|
|
|
|
private void handleCustomer(TurnBackDTO turnBackDTOS) throws Exception {
|
|
|
|
|
OpCustomer opCustomer = null;
|
|
|
|
|
if (turnBackDTOS.getWxData().getUnionId() == null && turnBackDTOS.getWxData().getUserId() != null) {
|
|
|
|
|
//此时说明是企业微信扫码添加
|
|
|
|
@ -186,6 +217,7 @@ public class CustomerService {
|
|
|
|
|
customerWrapper.eq("wechat_uni_id", turnBackDTOS.getWxData().getUnionId()).last("limit 1");
|
|
|
|
|
opCustomer = opCustomerDOMapper.selectOne(customerWrapper);
|
|
|
|
|
}else{
|
|
|
|
|
log.error("turn back error: " + turnBackDTOS.toString());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -283,8 +315,6 @@ public class CustomerService {
|
|
|
|
|
//有vip数据就不需要重新请求bsd的vip接口
|
|
|
|
|
vipCheck(turnBackDTOS);
|
|
|
|
|
}
|
|
|
|
|
//todo 发送websocket放开
|
|
|
|
|
// WebSocketController.sendInfo(new Gson().toJson(insertCustomer));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|