|
@@ -20,6 +20,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
+import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
import static com.yc.ship.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
import static com.yc.ship.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
@@ -126,10 +127,21 @@ public class PriceTemplateServiceImpl implements PriceTemplateService {
|
|
|
|
|
|
//插入区域加价
|
|
//插入区域加价
|
|
List<PriceAreaDO> areaList = vo.getAreaList();
|
|
List<PriceAreaDO> areaList = vo.getAreaList();
|
|
|
|
+ List<PriceAreaDO> insertAreaList = new ArrayList<>();
|
|
areaList.stream().forEach(area -> {
|
|
areaList.stream().forEach(area -> {
|
|
area.setObjectId(objectId);
|
|
area.setObjectId(objectId);
|
|
|
|
+ insertAreaList.add(area);
|
|
|
|
+ List<PriceAreaDO> children = area.getChildren();
|
|
|
|
+ if (children != null) {
|
|
|
|
+ children.stream().forEach(child -> {
|
|
|
|
+ child.setObjectId(objectId);
|
|
|
|
+ child.setParentAreaId(area.getAreaId());
|
|
|
|
+ child.setParentAreaName(area.getAreaName());
|
|
|
|
+ insertAreaList.add(child);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
});
|
|
});
|
|
- priceAreaMapper.insertBatch(areaList);
|
|
|
|
|
|
+ priceAreaMapper.insertBatch(insertAreaList);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|