Authored by caoyan

发售日历

... ... @@ -114,6 +114,8 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
@Autowired
private BatchService batchService;
private static final Integer NOT_SYN_CALENDER = 0;
@Override
public ApiResponse<Void> addOrUpdate(ProductRequestBo bo, boolean isCheckUrl) {
... ... @@ -323,17 +325,15 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
p.setCreateTime((int) (System.currentTimeMillis() / 1000));
p.setMinPrice(new BigDecimal(bo.getMinPrice()));
p.setMaxPrice(new BigDecimal(bo.getMaxPrice()));
p.setIsSynCalender(bo.getIsSynCalender());
p.setIsSynCalender(null == bo.getIsSynCalender() ? NOT_SYN_CALENDER : bo.getIsSynCalender());
p.setOfferPrice(StringUtils.isEmpty(bo.getOfferPrice()) ? BigDecimal.valueOf(0.00) : new BigDecimal(bo.getOfferPrice()));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
try {
p.setSaleTime((int) (sdf.parse(bo.getSaleTime()).getTime() / 1000));
} catch (ParseException e) {
}
if(StringUtils.isNotEmpty(bo.getOfferPrice())) {
p.setOfferPrice(new BigDecimal(bo.getOfferPrice()));
}
p.setGender(bo.getGender().toString());
return p;
}
... ... @@ -387,9 +387,9 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
if ((bo.getId() == null || bo.getId() < 1) && CollectionUtils.isEmpty(bo.getSizeIdList())) {
throw new CommonException(400, "请选择至少选择一个尺寸");
}
if (isCheckUrl && CollectionUtils.isEmpty(bo.getImageUrlList())) {
throw new CommonException(400, "请上传至少一张图片");
}
// if (isCheckUrl && CollectionUtils.isEmpty(bo.getImageUrlList())) {
// throw new CommonException(400, "请上传至少一张图片");
// }
List<String> limitInfo = bo.getLimitSaleInfo();
if (CollectionUtils.isNotEmpty(limitInfo)) {
Set<Integer> uids = new HashSet<>();
... ... @@ -476,7 +476,7 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
bo.setProductIntro(productIntroService.selectProductIntroById(product.getId()));
bo.setLimitSaleInfo(CollectionUtil.distinct(productLimitSaleMapper.selectByProductId(product.getId()), limit-> limit.getUid()+" "+limit.getProfitRate()));
bo.setIsSynCalender(product.getIsSynCalender());
bo.setOfferPrice(product.getOfferPrice().toString());
bo.setOfferPrice(product.getOfferPrice().compareTo(BigDecimal.valueOf(0.00)) == 0 ? null : product.getOfferPrice().toString());
return new ApiResponse<ProductEditResponceBo>(bo);
}
... ...
... ... @@ -219,13 +219,13 @@ public class SecondhandProductService implements ISecondhandProductService{
List<SecondhandImages> secondhandImagesList = skupImageMap.get(skup);
rebuiltImageList(secondhandImagesList, flawMap);
rsp.setImageList(secondhandImagesList);
rsp.setProductImage(getProductImage(secondhandImagesList));
rsp.setDescribeInfo(item.getDescribeInfo());
rsp.setSku(storagePrice.getStorageId());
SellerOrderGoods sellerGoods = sellerGoodsMap.get(skup);
if(null == sellerGoods) {
continue;
}
rsp.setProductImage(ImagesHelper.getImageAbsoluteUrl(sellerGoods.getImageUrl(), "goodsimg"));
rsp.setColorName(sellerGoods.getColorName());
rsp.setSizeName(sellerGoods.getSizeName());
rsp.setSellerUid(storagePrice.getSellerUid());
... ...
... ... @@ -181,7 +181,7 @@
<li>
<div class="label" style="align-self: flex-start;">同步至发售日历:</div>
<div class="base-info-item">
<label><input type="checkbox" name="isSynCalender" value="1" /></label>
<label><input type="checkbox" name="isSynCalender" value="1" checked/></label>
</div>
</li>
<li>
... ... @@ -299,6 +299,8 @@
if(detail.isSynCalender == 1){
$('input[name=isSynCalender]').attr('checked','checked');
}else if(detail.isSynCalender == 0){
$('input[name=isSynCalender]').attr('checked',false);
}
this.dom.editOfferPrice.textbox('setValue', detail.offerPrice);
... ... @@ -772,11 +774,11 @@
return false;
}
if (imageUrlList.length == 0) {
/* if (imageUrlList.length == 0) {
$.messager.alert('操作提示', '至少添加一张图片!');
that.submitFlag = false;
return false;
}
} */
if (!$('#productDetail').form("validate")) {
that.submitFlag = false;
... ...