浏览代码

代码优化

wangyu 6 年之前
父节点
当前提交
841bf311e7

+ 4 - 4
diagbotman-service/src/main/java/com/diagbot/facade/LantoneProductFacade.java

@@ -145,11 +145,11 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
             throw new CommonException(CommonErrorCode.NOT_EXISTS,
                     "该产品已删除,请刷新页面");
         }
-        if(updateProductVO.getServiceStatus() == lantoneProduct.getServiceStatus() && updateProductVO.getServiceStatus() == StatusEnum.Enable.getKey()){
+        if(updateProductVO.getServiceStatus().intValue() == lantoneProduct.getServiceStatus().intValue() && updateProductVO.getServiceStatus().intValue() == StatusEnum.Enable.getKey()){
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
                     "该产品已启用,启用失败");
         }
-        if(updateProductVO.getServiceStatus() == lantoneProduct.getServiceStatus() && updateProductVO.getServiceStatus() == StatusEnum.Disable.getKey()){
+        if(updateProductVO.getServiceStatus().intValue() == lantoneProduct.getServiceStatus().intValue() && updateProductVO.getServiceStatus().intValue() == StatusEnum.Disable.getKey()){
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
                     "该产品已停用,停用失败");
         }
@@ -203,7 +203,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
             throw new CommonException(CommonErrorCode.NOT_EXISTS,
                     "该产品已删除,请刷新页面");
         }
-        if(lantoneProduct.getServiceStatus()==StatusEnum.Enable.getKey()){
+        if(lantoneProduct.getServiceStatus().intValue() == StatusEnum.Enable.getKey()){
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
                     "当前产品正在使用中不可删除");
         }
@@ -351,7 +351,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
         BeanUtil.copyProperties(oppendedProductVO,page);
         OpenedProductsIndex openedProductsIndex = new OpenedProductsIndex();
         BeanUtil.copyProperties(oppendedProductVO, openedProductsIndex);
-        if(oppendedProductVO.getOrgName()!=null&&oppendedProductVO.getOrgName()!=""){
+        if(oppendedProductVO.getOrgName() != null && oppendedProductVO.getOrgName() != ""){
             RespDTO<List<Long>> rlist = userServiceClient.getUserByOrgName(oppendedProductVO.getOrgName());
             if(rlist.data.size() == 0){
                 rlist.data.add(-1L);

+ 3 - 3
diagbotman-service/src/main/java/com/diagbot/facade/OrderDetailsFacade.java

@@ -80,14 +80,14 @@ public class OrderDetailsFacade extends OrderDetailsServiceImpl {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
                     "订单明细不存在");
         }
-        if(orderDetails.getAuditStatus() != AuditStatusEnum.NotAudit.getKey()){
+        if(orderDetails.getAuditStatus().intValue() != AuditStatusEnum.NotAudit.getKey()){
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
                     "该订单已被审核请勿重复操作");
         }
         orderDetails.setGmtModified(DateUtil.now());
         orderDetails.setModifier(UserUtils.getCurrentPrincipleID());
         orderDetails.setAuditStatus(auditStatusVO.getAuditStatus());
-        if(auditStatusVO.getAuditStatus()== AuditStatusEnum.Veto.getKey()){
+        if(auditStatusVO.getAuditStatus().intValue() == AuditStatusEnum.Veto.getKey()){
             if(auditStatusVO.getRejectReason() != null && !auditStatusVO.getRejectReason().equals("") ){
                 orderDetails.setRejectType(-1);
                 if(auditStatusVO.getRejectReason().length()>100){
@@ -177,7 +177,7 @@ public class OrderDetailsFacade extends OrderDetailsServiceImpl {
             if(bean.getRejectType().intValue() != 0){
                 bean.setRejectTypeName(NotPassEnum.getName(bean.getRejectType()));
             }
-            if(bean.getAuditStatus() == AuditStatusEnum.Adopt.getKey()){
+            if(bean.getAuditStatus().intValue() == AuditStatusEnum.Adopt.getKey()){
                 for (UserAndProdutDTO openedProducts:openedProductTime) {
                     if(bean.getUserId().intValue() == openedProducts.getUserId().intValue() && bean.getProductId().intValue() == openedProducts.getProductId().intValue()){
                         bean.setStartTime(openedProducts.getStartTime());

+ 13 - 23
diagbotman-service/src/main/java/com/diagbot/facade/ProductOrderFacade.java

@@ -1,23 +1,9 @@
 package com.diagbot.facade;
 
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletResponse;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-import org.springframework.transaction.annotation.Transactional;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.diagbot.client.UserServiceClient;
 import com.diagbot.dto.AuthDetailDTO;
-import com.diagbot.dto.HasPermissionDTO;
 import com.diagbot.dto.OrderDetialsDTO;
 import com.diagbot.dto.ProductAuthProgressDTO;
 import com.diagbot.dto.ProductLineDTO;
@@ -26,20 +12,17 @@ import com.diagbot.dto.ProductOrderExportDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.UserOrgDTO;
 import com.diagbot.dto.WaitExamOrderCouDTO;
-import com.diagbot.entity.OpenedProducts;
 import com.diagbot.entity.OrderDetailStatus;
 import com.diagbot.entity.OrderDetails;
 import com.diagbot.entity.ProductOrder;
 import com.diagbot.entity.ProductOrderIndex;
 import com.diagbot.entity.User;
 import com.diagbot.entity.wrapper.ProductOrderWrapper;
-import com.diagbot.entity.wrapper.ServiceTokenWrapper;
 import com.diagbot.enums.AuditStatusEnum;
 import com.diagbot.enums.AuthStatusEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.NotPassEnum;
 import com.diagbot.enums.StatusEnum;
-import com.diagbot.enums.TokenTypeEnum;
 import com.diagbot.enums.VisibleIdTypeEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
@@ -50,13 +33,20 @@ import com.diagbot.util.DateUtil;
 import com.diagbot.util.EntityUtil;
 import com.diagbot.util.ExportBeanExcelUtil;
 import com.diagbot.util.GsonUtil;
-import com.diagbot.util.ListUtil;
 import com.diagbot.util.UserUtils;
 import com.diagbot.vo.AddOrderVO;
-import com.diagbot.vo.OpenProductCheckVO;
 import com.diagbot.vo.OrderDetialsVO;
 import com.diagbot.vo.ProductOrderExportVO;
 import com.diagbot.vo.ProductOrderVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 /**
  * 订单业务
@@ -181,7 +171,7 @@ public class ProductOrderFacade extends ProductOrderServiceImpl {
         }
         Map<Long, UserOrgDTO> dataMap =mapRespDTO.data;
         UserOrgDTO uo =dataMap.get(userId);
-        if(uo.getAuStatus() != AuthStatusEnum.Authorized.getKey()){
+        if(uo.getAuStatus().intValue() != AuthStatusEnum.Authorized.getKey()){
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
                     "账号信息系不完善,请先认证");
         }
@@ -197,12 +187,12 @@ public class ProductOrderFacade extends ProductOrderServiceImpl {
                 }
             }
             for (int j =0; j<opendId.size();j++){
-                if(addOrderVO.getProductId().get(i)==opendId.get(j)){
+                if(addOrderVO.getProductId().get(i).longValue() == opendId.get(j).longValue()){
                     throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "请勿重复提交已开通产品");
                 }
             }
             for (int k =0; k<orderDetailsId.size();k++){
-                if(addOrderVO.getProductId().get(i)==orderDetailsId.get(k)){
+                if(addOrderVO.getProductId().get(i).longValue() == orderDetailsId.get(k).longValue()){
                     throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "产品正在审核中请勿重复提交");
                 }
             }
@@ -283,7 +273,7 @@ public class ProductOrderFacade extends ProductOrderServiceImpl {
 		ProductOrderIndex productOrderIndex =new ProductOrderIndex();
 		BeanUtil.copyProperties(productOrderVO, productOrderIndex);
 		//TODO
-        if(productOrderVO.getOrgName()!=null&&productOrderVO.getOrgName()!=""){
+        if(productOrderVO.getOrgName() != null && productOrderVO.getOrgName()!=""){
             RespDTO<List<Long>> rlist = userServiceClient.getUserByOrgName(productOrderVO.getOrgName());
             if(rlist == null || !"0".equals(rlist.code) ) {
                 throw new CommonException(CommonErrorCode.RPC_ERROR,