|
@@ -13,14 +13,18 @@ import com.diagbot.dto.UserOrgDTO;
|
|
|
import com.diagbot.entity.LantoneProduct;
|
|
|
import com.diagbot.entity.OpenedProducts;
|
|
|
import com.diagbot.entity.OpenedProductsIndex;
|
|
|
+import com.diagbot.entity.OrderDetailsIndex;
|
|
|
import com.diagbot.entity.ServiceInfo;
|
|
|
import com.diagbot.entity.User;
|
|
|
import com.diagbot.entity.wrapper.OpendProductWrapper;
|
|
|
import com.diagbot.entity.wrapper.ServiceInfoWrapper;
|
|
|
+import com.diagbot.entity.wrapper.UserRenewalsWrapper;
|
|
|
import com.diagbot.enums.AccessTypeEnum;
|
|
|
+import com.diagbot.enums.AuditStatusEnum;
|
|
|
import com.diagbot.enums.ChargeTypeEnum;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.enums.ProductAuditEnum;
|
|
|
+import com.diagbot.enums.RenewalsEnum;
|
|
|
import com.diagbot.enums.ServiceTypeEnum;
|
|
|
import com.diagbot.enums.StatusEnum;
|
|
|
import com.diagbot.enums.TrialStatusEnum;
|
|
@@ -59,6 +63,8 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
private OrderDetailsFacade orderDetailsFacade;
|
|
|
@Autowired
|
|
|
private ServiceInfoFacade serviceInfoFacade;
|
|
|
+ @Autowired
|
|
|
+ private UserRenewalsFacade userRenewalsFacade;
|
|
|
|
|
|
/**
|
|
|
* 产品线管理添加产品
|
|
@@ -133,10 +139,24 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
OpenedProductsIndex openedProductsIndex =new OpenedProductsIndex();
|
|
|
openedProductsIndex.setProductId(updateProductVO.getId());
|
|
|
openedProductsIndex.setServiceStatus(StatusEnum.Enable.getKey());
|
|
|
- if(openedProductsFacade.getByProductId(page,openedProductsIndex).getRecords().size()>0){
|
|
|
+ if(openedProductsFacade.getByProductId(page,openedProductsIndex).getRecords().size() > 0){
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
"用户正在使用中,停用失败");
|
|
|
}
|
|
|
+ OrderDetailsIndex orderDetailsIndex =new OrderDetailsIndex();
|
|
|
+ orderDetailsIndex.setProductId(updateProductVO.getId());
|
|
|
+ orderDetailsIndex.setAuditStatus(AuditStatusEnum.NotAudit.getKey());
|
|
|
+ if(orderDetailsFacade.seleAllOrderDetials(orderDetailsIndex).size() > 0){
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
+ "该产品无法停用,请先处理申请信息");
|
|
|
+ }
|
|
|
+ UserRenewalsWrapper renewalsInfosDTO =new UserRenewalsWrapper();
|
|
|
+ renewalsInfosDTO.setProductId(updateProductVO.getId());
|
|
|
+ renewalsInfosDTO.setRenewalsStatus(RenewalsEnum.NOT_RENEWALS.getKey());
|
|
|
+ if(userRenewalsFacade.selectUserRenewals(page,renewalsInfosDTO).getRecords().size() > 0){
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
+ "该产品无法停用,请先处理续费申请信息");
|
|
|
+ }
|
|
|
}
|
|
|
if (!updateById(lantoneProduct)) {
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|