|
@@ -6,6 +6,7 @@ import com.diagbot.client.UserServiceClient;
|
|
|
import com.diagbot.dto.AuthDetailDTO;
|
|
|
import com.diagbot.dto.OrderDetialsDTO;
|
|
|
import com.diagbot.dto.ProductAuthProgressDTO;
|
|
|
+import com.diagbot.dto.ProductLineDTO;
|
|
|
import com.diagbot.dto.ProductOrderDTO;
|
|
|
import com.diagbot.dto.ProductOrderExportDTO;
|
|
|
import com.diagbot.dto.RespDTO;
|
|
@@ -19,7 +20,9 @@ import com.diagbot.entity.User;
|
|
|
import com.diagbot.entity.wrapper.ProductOrderWrapper;
|
|
|
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.VisibleIdTypeEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
@@ -44,7 +47,6 @@ import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 订单业务
|
|
@@ -69,6 +71,8 @@ public class ProductOrderFacade extends ProductOrderServiceImpl {
|
|
|
private ProductOrderFacade productOrderFacade;
|
|
|
@Autowired
|
|
|
private OpenedProductsFacade openedProductsFacade;
|
|
|
+ @Autowired
|
|
|
+ private ServiceTokenFacade serviceTokenFacade;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -157,6 +161,7 @@ public class ProductOrderFacade extends ProductOrderServiceImpl {
|
|
|
Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
|
|
|
List<Long> opendId = openedProductsFacade.getOpendCountByUserId(userId);
|
|
|
List<Long> orderDetailsId = orderDetailsFacade.getOrderDetailsByUser(userId);
|
|
|
+ List<ProductLineDTO> productList = lantoneProductFacade.productLinesB();
|
|
|
List<Long> userIdList =new ArrayList<>();
|
|
|
userIdList.add(userId);
|
|
|
RespDTO<Map<Long, UserOrgDTO>> mapRespDTO = userServiceClient.getUserAndOrg(userIdList);
|
|
@@ -166,18 +171,28 @@ 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,
|
|
|
"账号信息系不完善,请先认证");
|
|
|
}
|
|
|
for (int i =0; i<addOrderVO.getProductId().size();i++){
|
|
|
+ for(int l = 0; l< productList.size(); l++){
|
|
|
+ if(addOrderVO.getProductId().get(i).intValue() == productList.get(l).getId().intValue() && productList.get(l).getIsDeleted().equals(IsDeleteEnum.Y.getKey())){
|
|
|
+ throw new CommonException(CommonErrorCode.NOT_EXISTS,
|
|
|
+ "【"+productList.get(l).getName()+"】已删除,请刷新重试");
|
|
|
+ }
|
|
|
+ if(addOrderVO.getProductId().get(i).intValue() == productList.get(l).getId().intValue() && productList.get(l).getServiceStatus().intValue() == StatusEnum.Disable.getKey()){
|
|
|
+ throw new CommonException(CommonErrorCode.NOT_EXISTS,
|
|
|
+ "【"+productList.get(l).getName()+"】已停用,请刷新重试");
|
|
|
+ }
|
|
|
+ }
|
|
|
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, "产品正在审核中请勿重复提交");
|
|
|
}
|
|
|
}
|
|
@@ -245,8 +260,7 @@ public class ProductOrderFacade extends ProductOrderServiceImpl {
|
|
|
waitExamOrderCouDTO.setCount(baseMapper.waitExamOrderCou(userIds));
|
|
|
return waitExamOrderCouDTO;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 产品申请查询所有订单信息
|
|
|
*
|
|
@@ -259,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,
|