|
@@ -9,11 +9,13 @@ import com.yc.ship.module.product.dal.dataobject.pricearea.PriceAreaDO;
|
|
|
import com.yc.ship.module.product.dal.dataobject.pricefloor.PriceFloorDO;
|
|
import com.yc.ship.module.product.dal.dataobject.pricefloor.PriceFloorDO;
|
|
|
import com.yc.ship.module.product.dal.dataobject.priceroommodel.PriceRoomModelDO;
|
|
import com.yc.ship.module.product.dal.dataobject.priceroommodel.PriceRoomModelDO;
|
|
|
import com.yc.ship.module.product.dal.dataobject.pricesinglesetting.PriceSingleSettingDO;
|
|
import com.yc.ship.module.product.dal.dataobject.pricesinglesetting.PriceSingleSettingDO;
|
|
|
|
|
+import com.yc.ship.module.product.dal.dataobject.pricespu.PriceSpuDO;
|
|
|
import com.yc.ship.module.product.dal.dataobject.pricetemplate.PriceTemplateDO;
|
|
import com.yc.ship.module.product.dal.dataobject.pricetemplate.PriceTemplateDO;
|
|
|
import com.yc.ship.module.product.dal.mysql.pricearea.PriceAreaMapper;
|
|
import com.yc.ship.module.product.dal.mysql.pricearea.PriceAreaMapper;
|
|
|
import com.yc.ship.module.product.dal.mysql.pricefloor.PriceFloorMapper;
|
|
import com.yc.ship.module.product.dal.mysql.pricefloor.PriceFloorMapper;
|
|
|
import com.yc.ship.module.product.dal.mysql.priceroommodel.PriceRoomModelMapper;
|
|
import com.yc.ship.module.product.dal.mysql.priceroommodel.PriceRoomModelMapper;
|
|
|
import com.yc.ship.module.product.dal.mysql.pricesinglesetting.PriceSingleSettingMapper;
|
|
import com.yc.ship.module.product.dal.mysql.pricesinglesetting.PriceSingleSettingMapper;
|
|
|
|
|
+import com.yc.ship.module.product.dal.mysql.pricespu.PriceSpuMapper;
|
|
|
import com.yc.ship.module.product.dal.mysql.pricetemplate.PriceTemplateMapper;
|
|
import com.yc.ship.module.product.dal.mysql.pricetemplate.PriceTemplateMapper;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -50,6 +52,9 @@ public class PriceTemplateServiceImpl implements PriceTemplateService {
|
|
|
@Resource
|
|
@Resource
|
|
|
private PriceAreaMapper priceAreaMapper;
|
|
private PriceAreaMapper priceAreaMapper;
|
|
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private PriceSpuMapper priceSpuMapper;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Long createPriceTemplate(PriceTemplateSaveReqVO createReqVO) {
|
|
public Long createPriceTemplate(PriceTemplateSaveReqVO createReqVO) {
|
|
@@ -143,6 +148,13 @@ public class PriceTemplateServiceImpl implements PriceTemplateService {
|
|
|
});
|
|
});
|
|
|
priceAreaMapper.insertBatch(insertAreaList);
|
|
priceAreaMapper.insertBatch(insertAreaList);
|
|
|
|
|
|
|
|
|
|
+ // 插入附加产品
|
|
|
|
|
+ List<PriceSpuDO> spuList = vo.getSpuList();
|
|
|
|
|
+ spuList.stream().forEach(spu -> {
|
|
|
|
|
+ spu.setObjectId(objectId);
|
|
|
|
|
+ });
|
|
|
|
|
+ priceSpuMapper.insertBatch(spuList);
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void deleteRelation(Long objectId) {
|
|
private void deleteRelation(Long objectId) {
|
|
@@ -150,6 +162,7 @@ public class PriceTemplateServiceImpl implements PriceTemplateService {
|
|
|
priceFloorMapper.deleteByObjectId(objectId);
|
|
priceFloorMapper.deleteByObjectId(objectId);
|
|
|
priceSingleSettingMapper.deleteByObjectId(objectId);
|
|
priceSingleSettingMapper.deleteByObjectId(objectId);
|
|
|
priceAreaMapper.deleteByObjectId(objectId);
|
|
priceAreaMapper.deleteByObjectId(objectId);
|
|
|
|
|
+ priceSpuMapper.deleteByObjectId(objectId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|