소스 검색

配置增加非空判断

liangpeile 1 년 전
부모
커밋
42fd7cd36e
1개의 변경된 파일24개의 추가작업 그리고 23개의 파일을 삭제
  1. 24 23
      crmeb-front/src/main/java/com/zbkj/front/service/impl/FrontOrderServiceImpl.java

+ 24 - 23
crmeb-front/src/main/java/com/zbkj/front/service/impl/FrontOrderServiceImpl.java

@@ -377,62 +377,63 @@ public class FrontOrderServiceImpl implements FrontOrderService {
         order.setIsRemit(2);
         order.setCancelStatus(OrderConstants.ORDER_CANCEL_STATUS_NORMAL);
         order.setLevel(OrderConstants.ORDER_LEVEL_PLATFORM);
-        if (2==user.getIsEnterpriseUser()){
+
+        if (2 == user.getIsEnterpriseUser()) {
             order.setIsEnterpriseUser(2);
-        }else if(3==user.getIsEnterpriseUser()){
+        } else if (3 == user.getIsEnterpriseUser()) {
             order.setIsEnterpriseUser(3);
-        }else{
+        } else {
             order.setIsEnterpriseUser(1);
         }
         order.setType(orderInfoVo.getType());// 默认普通订单
 
 //        采购单位
         Integer isEnterpriseUser = user.getIsEnterpriseUser();
-        if (null!=isEnterpriseUser){
-            if (2==isEnterpriseUser){
+        if (null != isEnterpriseUser) {
+            if (2 == isEnterpriseUser) {
                 LambdaQueryWrapper<UserEnterprise> enterpriseLambdaQueryWrapper = new LambdaQueryWrapper<>();
-                enterpriseLambdaQueryWrapper.eq(UserEnterprise::getIsDelete,0);
-                enterpriseLambdaQueryWrapper.eq(UserEnterprise::getUserId,user.getId());
+                enterpriseLambdaQueryWrapper.eq(UserEnterprise::getIsDelete, 0);
+                enterpriseLambdaQueryWrapper.eq(UserEnterprise::getUserId, user.getId());
                 UserEnterprise userEnterprise = userEnterpriseService.getOne(enterpriseLambdaQueryWrapper);
-                if (null!=userEnterprise){
+                if (null != userEnterprise) {
                     order.setProcureUnit(userEnterprise.getEnterpriseName());
                 }
 
-            }else if (3==isEnterpriseUser){
+            } else if (3 == isEnterpriseUser) {
                 LambdaQueryWrapper<UserBypassAccount> bypassAccountLambdaQueryWrapper = new LambdaQueryWrapper<>();
-                bypassAccountLambdaQueryWrapper.eq(UserBypassAccount::getIsDelete,0);
-                bypassAccountLambdaQueryWrapper.eq(UserBypassAccount::getUserId,user.getId());
+                bypassAccountLambdaQueryWrapper.eq(UserBypassAccount::getIsDelete, 0);
+                bypassAccountLambdaQueryWrapper.eq(UserBypassAccount::getUserId, user.getId());
                 UserBypassAccount userBypassAccount = userBypassAccountService.getOne(bypassAccountLambdaQueryWrapper);
-                if (null!=userBypassAccount){
+                if (null != userBypassAccount) {
                     Integer enterpriseId = userBypassAccount.getEnterpriseId();
                     UserEnterprise userEnterprise = userEnterpriseService.getById(enterpriseId);
                     order.setProcureUnit(userEnterprise.getEnterpriseName());
-                }else {
+                } else {
                     order.setProcureUnit("");
                 }
 
-            }else {
+            } else {
                 order.setProcureUnit("");
             }
-        }else {
+        } else {
             order.setProcureUnit("");
         }
 
         //企业子账户只能看自己企业的订单
-        if (2==user.getIsEnterpriseUser()||3==user.getIsEnterpriseUser()){
+        if (2 == user.getIsEnterpriseUser() || 3 == user.getIsEnterpriseUser()) {
             LambdaQueryWrapper<UserBypassAccount> queryWrapper = new LambdaQueryWrapper<>();
-            queryWrapper.eq(UserBypassAccount::getUserId,user.getId());
-            queryWrapper.eq(UserBypassAccount::getIsDelete,0);
+            queryWrapper.eq(UserBypassAccount::getUserId, user.getId());
+            queryWrapper.eq(UserBypassAccount::getIsDelete, 0);
             List<UserBypassAccount> list = userBypassAccountService.list();
-            if (null!=list&&list.size()>0){
+            if (null != list && list.size() > 0) {
                 Integer enterpriseId = list.get(0).getEnterpriseId();
                 order.setEnterpriseId(enterpriseId);
-            }else{
+            } else {
                 LambdaQueryWrapper<UserEnterprise> userEnterpriseLambdaQueryWrapper = new LambdaQueryWrapper<>();
-                userEnterpriseLambdaQueryWrapper.eq(UserEnterprise::getUserId,user.getId());
-                userEnterpriseLambdaQueryWrapper.eq(UserEnterprise::getIsDelete,0);
+                userEnterpriseLambdaQueryWrapper.eq(UserEnterprise::getUserId, user.getId());
+                userEnterpriseLambdaQueryWrapper.eq(UserEnterprise::getIsDelete, 0);
                 List<UserEnterprise> list1 = userEnterpriseService.list();
-                if (null!=list&&list.size()>0){
+                if (null != list && list.size() > 0) {
                     Integer enterpriseId = list1.get(0).getId();
                     order.setEnterpriseId(enterpriseId);
                 }