Authored by caoyan

Merge branch 'master' of http://git.yoho.cn/ufo/ufo-platform

... ... @@ -5,6 +5,8 @@ import com.yoho.core.common.utils.DateUtil;
import com.yoho.ufo.dal.BrandMapper;
import com.yoho.ufo.model.brand.Brand;
import com.yoho.ufo.service.IBrandService;
import com.yoho.ufo.util.ImagesConstant;
import com.yoho.ufo.util.ImagesHelper;
import com.yoho.ufo.util.OrikaUtils;
import com.yohobuy.ufo.model.common.PageModel;
import com.yohobuy.ufo.model.common.PageResponseBO;
... ... @@ -36,6 +38,7 @@ public class BrandServiceImpl implements IBrandService {
Brand brand = OrikaUtils.map(brandRequestBo, Brand.class);
brand.setEditTime(DateUtil.currentTimeSeconds());
brand.setEditPid(getUserId());
brand.setBrandLogo(ImagesHelper.getImageRelativeUrl(brand.getBrandLogo(), ImagesConstant.BUCKET_BRAND_LOGO));
if (brand.getId() == null || brand.getId() == 0) {
// 默认开启状态
brand.setStatus(1);
... ... @@ -64,6 +67,7 @@ public class BrandServiceImpl implements IBrandService {
for (Brand brand1 : brands) {
responseBo = OrikaUtils.map(brand1, BrandResponseBo.class);
responseBo.setCreateTime(DateUtil.getDateStrBySecond(brand1.getCreateTime(), DateUtil.DATE_TIME_FORMAT));
responseBo.setBrandLogo(ImagesHelper.getImageAbsoluteUrl(brand1.getBrandLogo(), ImagesConstant.BUCKET_BRAND_LOGO));
brandResponseBos.add(responseBo);
}
return new PageResponseBO<>(count, brandResponseBos, pageModel.getCurrentPage(), pageModel.getPageSize());
... ... @@ -76,6 +80,7 @@ public class BrandServiceImpl implements IBrandService {
Brand brand = brandMapper.selectOneById(id);
BrandResponseBo brandResponseBo = OrikaUtils.map(brand, BrandResponseBo.class);
brandResponseBo.setCreateTime(DateUtil.getDateStrBySecond(brand.getCreateTime(), DateUtil.DATE_TIME_FORMAT));
brandResponseBo.setBrandLogo(ImagesHelper.getImageAbsoluteUrl(brand.getBrandLogo(), ImagesConstant.BUCKET_BRAND_LOGO));
return brandResponseBo;
}
... ...
... ... @@ -12,6 +12,8 @@ import com.alibaba.fastjson.JSONObject;
import com.yoho.core.dal.datasource.annotation.Database;
import com.yoho.core.rest.client.ServiceCaller;
import com.yoho.ufo.event.model.StorageNumEvent;
import com.yoho.ufo.util.ImagesConstant;
import com.yoho.ufo.util.ImagesHelper;
import com.yohobuy.ufo.model.enums.InboxBusinessTypeEnum;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
... ... @@ -140,7 +142,7 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
} else {
gi.setIsDefault("N");
}
gi.setImageUrl(image);
gi.setImageUrl(ImagesHelper.getImageRelativeUrl(image, ImagesConstant.BUCKET_GOODS_IMG));
gi.setOrderBy(i + 1);
goodsImagesList.add(gi);
}
... ... @@ -166,8 +168,9 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
BeanUtils.copyProperties(bo, g);
g.setId(bo.getGoodsId());
g.setIsDefault("Y");
g.setGoodsName(StringUtils.isEmpty(g.getGoodsName()) ? g.getColorName() : g.getGoodsName());
if (CollectionUtils.isNotEmpty(bo.getImageUrlList())) {
g.setColorImage(bo.getImageUrlList().get(0));
g.setColorImage(ImagesHelper.getImageRelativeUrl(bo.getImageUrlList().get(0), ImagesConstant.BUCKET_GOODS_IMG));
}
return g;
}
... ... @@ -281,7 +284,7 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
bo.setColorId(goods.getColorId());
}
if (CollectionUtils.isNotEmpty(goodsImages)) {
bo.setImageUrlList(CollectionUtil.map(goodsImages, GoodsImages::getImageUrl));
bo.setImageUrlList(CollectionUtil.map(goodsImages, item -> ImagesHelper.getImageAbsoluteUrl(item.getImageUrl(), ImagesConstant.BUCKET_GOODS_IMG)));
}
if (CollectionUtils.isNotEmpty(storages)) {
bo.setStorageIdList(CollectionUtil.map(storages, Storage::getId));
... ... @@ -333,7 +336,7 @@ public static void main(String[] args) {
// 图片
Goods goods = goodsMap.get(respBo.getId());
if (goods != null) {
respBo.setColorImage(goods.getColorImage());
respBo.setColorImage(ImagesHelper.getImageAbsoluteUrl(goods.getColorImage(), ImagesConstant.BUCKET_GOODS_IMG));
}
// 分类
ProductSort maxSort = productSortMap.get(respBo.getMaxSortId());
... ...
... ... @@ -67,7 +67,7 @@
realInputName: "brandLogo",
url: contextPath + '/fileupload/upload',
queryParams: {
bucket: "goodsimg"
bucket: "brandLogo"
},
onBeforeSubmit: function () {
$.messager.progress({
... ...
... ... @@ -44,10 +44,10 @@
3 : '卖家支付超时',
4 : '卖家取消出售',
100 : '已出售',
101 : '买家手动取消',
102 : '买家超时未支付',
101 : '出售中', // 买家手动取消、买家超时未支付对应 --》skup 出售中
102 : '出售中',
200 : '平台取消出售',
201 : '鉴定失败'
201 : '已出售' // 订单鉴定失败 --》skup 已出售
}
};
function parseURL(url){
... ... @@ -82,8 +82,8 @@
prompt: "状态",
width: 200,
data: [{id: '0',text: '待付保证金'}, {id: '2',text: '卖家取消支付'}, {id: '3',text: '卖家支付超时'}, {id: '1',text: '出售中'},
{id: '4',text: '卖家取消出售'}, {id: '200',text: '平台取消出售'}, {id: '100',text: '已出售'}, {id: '101',text: '买家手动取消'},
{id: '102',text: '买家超时未支付'}, {id: '201',text: '鉴定失败'}],
{id: '4',text: '卖家取消出售'}, {id: '200',text: '平台取消出售'}, {id: '100',text: '已出售'}/*, {id: '101',text: '买家手动取消'},
{id: '102',text: '买家超时未支付'}, {id: '201',text: '鉴定失败'}*/],
valueField: "id",
textField: "text"
});
... ...