‘linchangsheng’ 4 недель назад
Родитель
Сommit
a36a047b21

+ 11 - 5
src/main/java/com/gree/mall/miniapp/logic/order/OrderLogic.java

@@ -33,10 +33,7 @@ import com.gree.mall.miniapp.logic.user.PayLogic;
 import com.gree.mall.miniapp.logic.user.UserLogic;
 import com.gree.mall.miniapp.plus.entity.*;
 import com.gree.mall.miniapp.plus.service.*;
-import com.gree.mall.miniapp.utils.ArithUtils;
-import com.gree.mall.miniapp.utils.CommonUtils;
-import com.gree.mall.miniapp.utils.DateUtils;
-import com.gree.mall.miniapp.utils.IpUtil;
+import com.gree.mall.miniapp.utils.*;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
@@ -149,6 +146,7 @@ public class OrderLogic {
     GoodsApplyItemService goodsApplyItemService;
 
 
+
     /**
      * 立即购买
      */
@@ -584,6 +582,14 @@ public class OrderLogic {
             orderInfo.setPosition(user.getPosition());
         }
 
+        if (user.getType().equals(UserTypeEnum.GENERAL.toString()) && !StringUtil.isEmpty(user.getServiceId())){
+
+            User userServiceById = userService.getById(user.getServiceId());
+            orderInfo.setWorkerId(userServiceById.getUserId());
+            orderInfo.setWorkerName(userServiceById.getNickName());
+            orderInfo.setWorkerPhone(user.getMobile());
+        }
+
         return new ServiceWorkerBean();
     }
 
@@ -597,7 +603,7 @@ public class OrderLogic {
         OrderInfo orderInfo = orderInfoService.getById(orderId);
         //订单
         CurrentCompanyWechat currentCompanyWechat = commonLogic.getCurrentCompanyWechat(request);
-        String newOrderId = currentCompanyWechat.getOrderPrefix() + IdWorker.getIdStr();
+        String newOrderId = IdWorker.getIdStr();
 
         if (orderInfo.getPromotionApplyStatus() != null && orderInfo.getPromotionApplyStatus() == 1) {
             throw new RemoteServiceException("正在申请优惠中请耐心等待");

+ 2 - 0
src/main/java/com/gree/mall/miniapp/logic/user/UserLogic.java

@@ -595,6 +595,8 @@ public class UserLogic {
     public void addVisit(HttpServletRequest request, String userId) {
         try {
             CurrentCompanyWechat currentCompanyWechat = commonLogic.getCurrentCompanyWechat(request);
+            if (StringUtil.isEmpty(currentCompanyWechat.getUser().getWebsitId()))
+                return;
             UserVisit userVisit = new UserVisit();
             userVisit.setUserId(userId);
             userVisit.setVisitTime(new Date());