|
@@ -17,6 +17,7 @@ import com.diagbot.entity.OpenedProductsIndex;
|
|
import com.diagbot.entity.OrderDetailsIndex;
|
|
import com.diagbot.entity.OrderDetailsIndex;
|
|
import com.diagbot.entity.ServiceInfo;
|
|
import com.diagbot.entity.ServiceInfo;
|
|
import com.diagbot.entity.User;
|
|
import com.diagbot.entity.User;
|
|
|
|
+import com.diagbot.entity.UserRenewals;
|
|
import com.diagbot.entity.wrapper.OpendProductWrapper;
|
|
import com.diagbot.entity.wrapper.OpendProductWrapper;
|
|
import com.diagbot.entity.wrapper.ServiceInfoWrapper;
|
|
import com.diagbot.entity.wrapper.ServiceInfoWrapper;
|
|
import com.diagbot.entity.wrapper.UserRenewalsWrapper;
|
|
import com.diagbot.entity.wrapper.UserRenewalsWrapper;
|
|
@@ -107,6 +108,10 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
"产品名称重复");
|
|
"产品名称重复");
|
|
}
|
|
}
|
|
LantoneProduct lantoneProduct = this.getById(updateProductVO.getId());
|
|
LantoneProduct lantoneProduct = this.getById(updateProductVO.getId());
|
|
|
|
+ if(lantoneProduct.getIsDeleted().equals(IsDeleteEnum.Y)){
|
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
|
+ "该产品已删除");
|
|
|
|
+ }
|
|
BeanUtil.copyProperties(updateProductVO, lantoneProduct);
|
|
BeanUtil.copyProperties(updateProductVO, lantoneProduct);
|
|
lantoneProduct.setModifier(UserUtils.getCurrentPrincipleID());
|
|
lantoneProduct.setModifier(UserUtils.getCurrentPrincipleID());
|
|
lantoneProduct.setGmtModified(DateUtil.now());
|
|
lantoneProduct.setGmtModified(DateUtil.now());
|
|
@@ -135,6 +140,10 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
*/
|
|
*/
|
|
public Boolean stopProduct(UpdateProductVO updateProductVO) {
|
|
public Boolean stopProduct(UpdateProductVO updateProductVO) {
|
|
LantoneProduct lantoneProduct = this.getById(updateProductVO.getId());
|
|
LantoneProduct lantoneProduct = this.getById(updateProductVO.getId());
|
|
|
|
+ if(lantoneProduct.getIsDeleted().equals(IsDeleteEnum.Y)){
|
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
|
+ "该产品已删除");
|
|
|
|
+ }
|
|
if(updateProductVO.getServiceStatus() == lantoneProduct.getServiceStatus() && updateProductVO.getServiceStatus() == StatusEnum.Enable.getKey()){
|
|
if(updateProductVO.getServiceStatus() == lantoneProduct.getServiceStatus() && updateProductVO.getServiceStatus() == StatusEnum.Enable.getKey()){
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
"该产品已启用,启用失败");
|
|
"该产品已启用,启用失败");
|
|
@@ -166,7 +175,10 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
renewalsInfosDTO.setProductId(updateProductVO.getId());
|
|
renewalsInfosDTO.setProductId(updateProductVO.getId());
|
|
renewalsInfosDTO.setRenewalsStatus(RenewalsEnum.NOT_RENEWALS.getKey());
|
|
renewalsInfosDTO.setRenewalsStatus(RenewalsEnum.NOT_RENEWALS.getKey());
|
|
List<RenewalsInfosDTO> list = userRenewalsFacade.selectUserRenewals(page,renewalsInfosDTO).getRecords();
|
|
List<RenewalsInfosDTO> list = userRenewalsFacade.selectUserRenewals(page,renewalsInfosDTO).getRecords();
|
|
- if(list.contains(RenewalsEnum.NOT_RENEWALS.getKey()) && list.contains(CancelRenewalsEnum.NOT_CANCEL.getKey())){
|
|
|
|
|
|
+ UserRenewals userRenewals = new UserRenewals();
|
|
|
|
+ userRenewals.setRenewalsStatus(RenewalsEnum.NOT_RENEWALS.getKey());
|
|
|
|
+ userRenewals.setCancelRenewals(CancelRenewalsEnum.NOT_CANCEL.getKey());
|
|
|
|
+ if(list.contains(userRenewals)){
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
"该产品无法停用,请先处理续费申请信息");
|
|
"该产品无法停用,请先处理续费申请信息");
|
|
}
|
|
}
|
|
@@ -186,6 +198,10 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
*/
|
|
*/
|
|
public Boolean deleteProduct(UpdateProductVO updateProductVO) {
|
|
public Boolean deleteProduct(UpdateProductVO updateProductVO) {
|
|
LantoneProduct lantoneProduct = getById(updateProductVO.getId());
|
|
LantoneProduct lantoneProduct = getById(updateProductVO.getId());
|
|
|
|
+ if(lantoneProduct.getIsDeleted().equals(IsDeleteEnum.Y)){
|
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
|
+ "该产品已删除");
|
|
|
|
+ }
|
|
if(lantoneProduct.getServiceStatus()==StatusEnum.Enable.getKey()){
|
|
if(lantoneProduct.getServiceStatus()==StatusEnum.Enable.getKey()){
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
"当前产品正在使用中不可删除");
|
|
"当前产品正在使用中不可删除");
|
|
@@ -204,12 +220,9 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
"产品删除失败");
|
|
"产品删除失败");
|
|
}
|
|
}
|
|
- List<OpenedProducts> list = openedProductsFacade.getOpendById(openedProducts);
|
|
|
|
- if(list.size() != 0){
|
|
|
|
- if(!productServiceFacade.deleteByProductId(updateProductVO.getId())){
|
|
|
|
|
|
+ if(!productServiceFacade.deleteByProductId(updateProductVO.getId())){
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
"产品令牌删除失败");
|
|
"产品令牌删除失败");
|
|
- }
|
|
|
|
}
|
|
}
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
@@ -314,6 +327,11 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
* @return 当条产品线下所有订单信息
|
|
* @return 当条产品线下所有订单信息
|
|
*/
|
|
*/
|
|
public IPage<OpendProductDTO> opendedProduct(OppendedProductVO oppendedProductVO) {
|
|
public IPage<OpendProductDTO> opendedProduct(OppendedProductVO oppendedProductVO) {
|
|
|
|
+ LantoneProduct lantoneProduct = getById(oppendedProductVO.getProductId());
|
|
|
|
+ if(lantoneProduct.getIsDeleted().equals(IsDeleteEnum.Y)){
|
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
|
+ "该产品已删除");
|
|
|
|
+ }
|
|
Page page =new Page();
|
|
Page page =new Page();
|
|
BeanUtil.copyProperties(oppendedProductVO,page);
|
|
BeanUtil.copyProperties(oppendedProductVO,page);
|
|
OpenedProductsIndex openedProductsIndex = new OpenedProductsIndex();
|
|
OpenedProductsIndex openedProductsIndex = new OpenedProductsIndex();
|