Browse Source

Merge branch 'feature/relation_type_item' of http://47.101.143.145:8090/77975466/pco into feature/relation_type_item

qzyReal 3 years ago
parent
commit
b0e31e53ac

+ 1 - 3
sp-server/src/main/java/com/pj/project/tb_business/TbBusinessController.java

@@ -192,9 +192,7 @@ public class TbBusinessController {
     public AjaxJson getOtherBusiness() {
         SoMap so = SoMap.getRequestSoMap();
         String currentCustomerId = StpUserUtil.getCustomerId();
-        TbCostomer currentCustomer = tbCostomerService.getById(currentCustomerId);
-        if (!currentCustomerId.equals(UserTypeEnum.PLATFORM_ADMIN.getCustomerId())
-                && currentCustomer.getType().equals(TbCostomer.CustomerEnum.BUSINESS_TYPE.getType())) {
+        if (!currentCustomerId.equals(UserTypeEnum.PLATFORM_ADMIN.getCustomerId())) {
             so.put("createByCustomerId", currentCustomerId);
         }
         List<TbBusiness> list = tbBusinessService.getList(so.startPage());

+ 8 - 1
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarController.java

@@ -11,6 +11,7 @@ import com.pj.project.tb_business.TbBusiness;
 import com.pj.project.tb_business.TbBusinessService;
 import com.pj.project.tb_business_item.TbBusinessItem;
 import com.pj.project.tb_costomer.TbCostomer;
+import com.pj.project.tb_costomer.TbCostomerService;
 import com.pj.utils.so.SoMap;
 import org.aspectj.weaver.loadtime.Aj;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -40,6 +41,8 @@ public class TbBusinessCarController {
      */
     @Autowired
     TbBusinessCarService tbBusinessCarService;
+    @Resource
+    TbCostomerService tbCostomerService;
 
 
     /**
@@ -107,7 +110,11 @@ public class TbBusinessCarController {
         SoMap so = SoMap.getRequestSoMap();
         String currentCustomerId = StpUserUtil.getCustomerId();
         if (!currentCustomerId.equals(UserTypeEnum.PLATFORM_ADMIN.getCustomerId())) {
-            so.put("customerId", currentCustomerId);
+            TbCostomer currentCustomer = tbCostomerService.getById(currentCustomerId);
+            if (!currentCustomerId.equals(UserTypeEnum.PLATFORM_ADMIN.getCustomerId())
+                    && currentCustomer.getType().equals(TbCostomer.CustomerEnum.BUSINESS_TYPE.getType())) {
+                so.put("customerId", currentCustomerId);
+            }
         }
         String limitDay = so.getString("limitDay");
         if (StrUtil.isNotEmpty(limitDay)){