|
|
@@ -552,11 +552,18 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
goods.setUpdateDate(goods.getCreatedDate());
|
|
|
goods.setEnUU(SystemSession.getUser().getEnterprise().getUu());
|
|
|
goods.setEnterpriseName(SystemSession.getUser().getEnterprise().getEnName());
|
|
|
+ setStoreName(goods, goods);
|
|
|
if (StringUtils.isEmpty(goods.getPublisherName())) {
|
|
|
goods.setPublisherName(SystemSession.getUser().getUserName());
|
|
|
goods.setPublisherUU(SystemSession.getUser().getUserUU());
|
|
|
goods.setPublishPhone(SystemSession.getUser().getUserTel());
|
|
|
}
|
|
|
+ // 若B2C上架的商品必须有发布人姓名和发布人联系电话
|
|
|
+ if (goods.getSourceId() == null) {
|
|
|
+ if (goods.getPublisherName() == null || goods.getPublishPhone() == null) {
|
|
|
+ throw new IllegalOperatorException("缺少发布人姓名或发布人联系电话");
|
|
|
+ }
|
|
|
+ }
|
|
|
if (goods.getBreakUp() == null) {
|
|
|
goods.setBreakUp(Boolean.TRUE);
|
|
|
}
|
|
|
@@ -605,26 +612,11 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
}
|
|
|
// 设置默认税率
|
|
|
goods.setTaxRate();
|
|
|
- // 若B2C上架的商品必须有发布人姓名和发布人联系电话
|
|
|
- if (goods.getSourceId() == null) {
|
|
|
- if (goods.getPublisherName() == null || goods.getPublishPhone() == null) {
|
|
|
- throw new IllegalOperatorException("缺少发布人姓名或发布人联系电话");
|
|
|
- }
|
|
|
- }
|
|
|
// 计算未税价格
|
|
|
goods.setWithOutTaxRMBPrice();
|
|
|
goods.setWithOutTaxUSDPrice();
|
|
|
// 计算本批最小价格
|
|
|
goods.setMaxAndMinPrice();
|
|
|
-
|
|
|
- if (!StringUtils.isEmpty(goods.getStoreid())) {
|
|
|
- StoreIn storeIn = storeInDao.findByUuid(goods.getStoreid());
|
|
|
- if (storeIn == null || storeIn.getStatus() != StoreStatus.OPENED) {
|
|
|
- throw new IllegalOperatorException("该公司还为开店铺,不能选择自营销售");
|
|
|
- } else {
|
|
|
- goods.setStoreName(storeIn.getStoreName());
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
|