|
@@ -8,19 +8,25 @@ import com.diagbot.dto.LantoneProductDTO;
|
|
|
import com.diagbot.dto.LantoneProductOrgDTO;
|
|
|
import com.diagbot.dto.OpendProductDTO;
|
|
|
import com.diagbot.dto.ProductLineDTO;
|
|
|
+import com.diagbot.dto.RenewalsInfosDTO;
|
|
|
import com.diagbot.dto.RespDTO;
|
|
|
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.CancelRenewalsEnum;
|
|
|
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 +65,8 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
private OrderDetailsFacade orderDetailsFacade;
|
|
|
@Autowired
|
|
|
private ServiceInfoFacade serviceInfoFacade;
|
|
|
+ @Autowired
|
|
|
+ private UserRenewalsFacade userRenewalsFacade;
|
|
|
|
|
|
/**
|
|
|
* 产品线管理添加产品
|
|
@@ -133,10 +141,25 @@ 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());
|
|
|
+ List<RenewalsInfosDTO> list = userRenewalsFacade.selectUserRenewals(page,renewalsInfosDTO).getRecords();
|
|
|
+ if(list.contains(RenewalsEnum.NOT_RENEWALS.getKey()) && list.contains(CancelRenewalsEnum.NOT_CANCEL.getKey())){
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
+ "该产品无法停用,请先处理续费申请信息");
|
|
|
+ }
|
|
|
}
|
|
|
if (!updateById(lantoneProduct)) {
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
@@ -341,7 +364,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
}
|
|
|
String[] strs1 = acssName.split(",");
|
|
|
for (int j = 0; j<strs1.length;j++){
|
|
|
- acssNamebc += AccessTypeEnum.getName(Integer.parseInt(strs[j]))+",";
|
|
|
+ acssNamebc += AccessTypeEnum.getName(Integer.parseInt(strs1[j]))+",";
|
|
|
}
|
|
|
lantoneProductDTO.setChargeTypeName(charNamebc);
|
|
|
lantoneProductDTO.setAccessTypeName(acssNamebc);
|