Commit 68f72b83 authored by 赵啸非's avatar 赵啸非

更新资源部署

parent 8d14d538
package com.mortals.xhx.module.product.service; package com.mortals.xhx.module.product.service;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDCacheService; import com.mortals.framework.service.ICRUDCacheService;
import com.mortals.xhx.module.product.model.ProductEntity; import com.mortals.xhx.module.product.model.ProductEntity;
...@@ -18,7 +17,5 @@ public interface ProductService extends ICRUDCacheService<ProductEntity,Long>{ ...@@ -18,7 +17,5 @@ public interface ProductService extends ICRUDCacheService<ProductEntity,Long>{
void upGrade(Long productId, Context context); void upGrade(Long productId, Context context);
Rest<String> cloneProductBySite(ProductEntity productEntity, Context context);
} }
\ No newline at end of file
...@@ -168,42 +168,6 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao, ...@@ -168,42 +168,6 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao,
} }
@Override
public Rest<String> cloneProductBySite(ProductEntity productEntity, Context context) {
//拷贝应用
Long targetSiteId = productEntity.getTargetSiteId();
Long sourceSiteId = productEntity.getSourceSiteId();
Rest<SitePdu> sitePduRest = siteFeign.info(targetSiteId);
if (YesNoEnum.NO.getValue() == sitePduRest.getCode()) {
throw new AppException("未查询到当前站点!");
}
SitePdu sitePdu = sitePduRest.getData();
ProductQuery query = new ProductQuery();
query.setSiteId(sourceSiteId);
List<ProductEntity> productEntityList = this.find(query);
//如果已存在 则不复制
for (ProductEntity product : productEntityList) {
ProductQuery productQuery = new ProductQuery();
productQuery.setSiteId(targetSiteId);
productQuery.setProductCode(product.getProductCode());
int count = this.count(query, context);
if (count == 0) {
productEntity.setId(null);
productEntity.setSiteId(sitePdu.getId());
productEntity.setSiteName(sitePdu.getSiteName());
productEntity.setSiteCode(sitePdu.getSiteCode());
this.save(productEntity, context);
}
}
return Rest.ok();
}
private void buildDownloadUrl(ProductVersionEntity productVersionEntity, ProductVersionInfo productVersionInfo) { private void buildDownloadUrl(ProductVersionEntity productVersionEntity, ProductVersionInfo productVersionInfo) {
String download = ""; String download = "";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment