|
@@ -6,6 +6,7 @@ import com.diagbot.client.UserServiceClient;
|
|
import com.diagbot.dto.RespDTO;
|
|
import com.diagbot.dto.RespDTO;
|
|
import com.diagbot.dto.UserOrgDTO;
|
|
import com.diagbot.dto.UserOrgDTO;
|
|
import com.diagbot.entity.LantoneProduct;
|
|
import com.diagbot.entity.LantoneProduct;
|
|
|
|
+import com.diagbot.entity.OpenedProducts;
|
|
import com.diagbot.entity.OpenedProductsIndex;
|
|
import com.diagbot.entity.OpenedProductsIndex;
|
|
import com.diagbot.entity.wrapper.LantoneProductWrapper;
|
|
import com.diagbot.entity.wrapper.LantoneProductWrapper;
|
|
import com.diagbot.entity.wrapper.OpendProductWrapper;
|
|
import com.diagbot.entity.wrapper.OpendProductWrapper;
|
|
@@ -83,15 +84,12 @@ 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());
|
|
- //TODO 判断是否还有用户使用此产品
|
|
|
|
- OpenedProductsIndex openedProductsIndex =new OpenedProductsIndex();
|
|
|
|
- openedProductsIndex.setId(updateProductVO.getId());
|
|
|
|
- openedProductsIndex.setServiceStatus(StatusEnum.Enable.getKey());
|
|
|
|
- if(openedProductsFacade.getByProductId(openedProductsIndex).size()!=0){
|
|
|
|
- if (!updateById(lantoneProduct)) {
|
|
|
|
|
|
+ OpenedProducts openedProducts= new OpenedProducts();
|
|
|
|
+ openedProducts.setId(updateProductVO.getId());
|
|
|
|
+ openedProducts.setServiceStatus(StatusEnum.Enable.getKey());
|
|
|
|
+ if(openedProductsFacade.getOpendById(openedProducts).size()!=0){
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
"本产品还有用户使用,删除失败");
|
|
"本产品还有用户使用,删除失败");
|
|
- }
|
|
|
|
}
|
|
}
|
|
lantoneProduct.setModifier(UserUtils.getCurrentPrincipleID());
|
|
lantoneProduct.setModifier(UserUtils.getCurrentPrincipleID());
|
|
lantoneProduct.setGmtModified(DateUtil.now());
|
|
lantoneProduct.setGmtModified(DateUtil.now());
|