创建商品服务1
This commit is contained in:
@@ -59,6 +59,9 @@ public class ProdController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* @PutMapping("/update")
|
||||
@Operation(summary = "更新商品")
|
||||
@PreAuthorize("@ss.hasPermission('tashow-module-product:prod:update')")
|
||||
|
||||
@@ -49,24 +49,16 @@ public class ProdAdditionalFeeDatesDO extends BaseDO {
|
||||
*/
|
||||
private String specificDates;
|
||||
/**
|
||||
* 收费方式
|
||||
* 收费方式0:''固定金额'':1:''基准价上浮
|
||||
*/
|
||||
private String chargeMode;
|
||||
private Integer chargeMode;
|
||||
/**
|
||||
* 价格或上浮百分比
|
||||
*/
|
||||
private BigDecimal price;
|
||||
/**
|
||||
* 是否启用该规则
|
||||
* 是否启用该规则是否启用该规则0关1开
|
||||
*/
|
||||
private Boolean isEnabled;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createdAt;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updatedAt;
|
||||
private Integer isEnabled;
|
||||
|
||||
}
|
||||
@@ -53,13 +53,5 @@ public class ProdAdditionalFeePeriodsDO extends BaseDO {
|
||||
* 浮动百分比
|
||||
*/
|
||||
private BigDecimal floatingPercentage;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createdAt;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.tashow.cloud.product.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -59,6 +60,17 @@ public class ProdDO extends BaseDO {
|
||||
* 品牌
|
||||
*/
|
||||
private String brand;
|
||||
|
||||
|
||||
/**
|
||||
* 是否置灰0否1是
|
||||
*/
|
||||
private Integer isProhibit;
|
||||
|
||||
/**
|
||||
* 审核备注
|
||||
*/
|
||||
private String processNotes;
|
||||
/**
|
||||
* 详细描述
|
||||
*/
|
||||
@@ -75,6 +87,12 @@ public class ProdDO extends BaseDO {
|
||||
* 商品轮播图片,以,分割
|
||||
*/
|
||||
private String imgs;
|
||||
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
private String tag;
|
||||
|
||||
/**
|
||||
* 默认是1,正常状态(出售中), 0:下架(仓库中) 2:待审核
|
||||
*/
|
||||
|
||||
@@ -43,14 +43,6 @@ public class ProdWeightRangePricesDO extends BaseDO {
|
||||
/**
|
||||
* 是否启用该规则0否1是
|
||||
*/
|
||||
private Boolean isEnabled;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createdAt;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updatedAt;
|
||||
private Integer isEnabled;
|
||||
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import com.tashow.cloud.mybatis.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.tashow.cloud.mybatis.mybatis.core.mapper.BaseMapperX;
|
||||
import com.tashow.cloud.product.dto.ProdEmergencyResponseIntervalsDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 紧急响应时间区间设置 Mapper
|
||||
@@ -16,5 +17,8 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
@Mapper
|
||||
public interface ProdEmergencyResponseIntervalsMapper extends BaseMapperX<ProdEmergencyResponseIntervalsDO> {
|
||||
|
||||
|
||||
/**
|
||||
* 删除关联
|
||||
*/
|
||||
public int deleteIntervals(@Param("configId")Long configId);
|
||||
}
|
||||
@@ -44,6 +44,14 @@ public interface ProdService {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取商品服务配置
|
||||
*
|
||||
* @param prodId 商品id
|
||||
* @return 编号
|
||||
*/
|
||||
ProdServiceVO getProdService(@Valid Integer prodId);
|
||||
|
||||
/**
|
||||
* 更新商品
|
||||
*
|
||||
|
||||
@@ -84,6 +84,7 @@ public class ProdServiceImpl implements ProdService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void createProdService(ProdServiceVO prodServiceVO) {
|
||||
ProdDO prodDO = new ProdDO();
|
||||
prodDO.setProdId(prodServiceVO.getProdId());
|
||||
@@ -101,7 +102,7 @@ public class ProdServiceImpl implements ProdService {
|
||||
ProdServiceAreasDO prodServiceAreas = prodServiceAreasMapper.selectOne(new LambdaQueryWrapper<ProdServiceAreasDO>()
|
||||
.eq(ProdServiceAreasDO::getAreaName, areaName)
|
||||
);
|
||||
if(prodServiceAreas == null){
|
||||
if(prodServiceAreas != null){
|
||||
//插入关联表
|
||||
prodServiceAreaRelevanceMapper.insert(new ProdServiceAreaRelevanceDO()
|
||||
.setProdId(prodDO.getProdId())
|
||||
@@ -198,37 +199,44 @@ public class ProdServiceImpl implements ProdService {
|
||||
//紧急响应设置
|
||||
if(Objects.equals(prodServiceVO.getEmergencySwitch(),BaseEnum.YES_ONE.getKey())){
|
||||
ProdEmergencyResponseDO prodEmergencyResponse = prodServiceVO.prodEmergencyInfoVO.getProdEmergencyResponse();
|
||||
prodEmergencyResponseMapper.insert(prodEmergencyResponse);
|
||||
for (ProdEmergencyResponseIntervalsDO prodEmergencyResponseIntervals : prodServiceVO.prodEmergencyInfoVO.getProdEmergencyResponseIntervalsList()){
|
||||
prodEmergencyResponseIntervals.setConfigId(prodEmergencyResponse.getId());
|
||||
prodEmergencyResponseIntervalsMapper.insert(prodEmergencyResponseIntervals);
|
||||
if(prodEmergencyResponse!=null){
|
||||
prodEmergencyResponseMapper.updateById(prodEmergencyResponse);
|
||||
prodEmergencyResponseIntervalsMapper.deleteIntervals(prodEmergencyResponse.getId());
|
||||
for (ProdEmergencyResponseIntervalsDO prodEmergencyResponseIntervals : prodServiceVO.prodEmergencyInfoVO.getProdEmergencyResponseIntervalsList()){
|
||||
prodEmergencyResponseIntervals.setConfigId(prodEmergencyResponse.getId());
|
||||
prodEmergencyResponseIntervalsMapper.insert(prodEmergencyResponseIntervals);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//接单上线设置
|
||||
if(Objects.equals(prodServiceVO.getOrderLimitSwitch(),BaseEnum.YES_ONE.getKey())){
|
||||
productOrderLimitMapper.insert(prodServiceVO.ProductOrderLimitVO);
|
||||
productOrderLimitMapper.updateById(prodServiceVO.ProductOrderLimitVO);
|
||||
}
|
||||
//特殊时段设置
|
||||
if(Objects.equals(prodServiceVO.getAdditionalSwitch(),BaseEnum.YES_ONE.getKey())){
|
||||
for (ProdAdditionalFeeDatesDO prodAdditionalFeeDates : prodServiceVO.getProdAdditionalFeeDatesList()){
|
||||
prodAdditionalFeeDates.setProdId(prodServiceVO.getProdId());
|
||||
prodAdditionalFeeDatesMapper.insert(prodAdditionalFeeDates);
|
||||
prodAdditionalFeeDatesMapper.updateById(prodAdditionalFeeDates);
|
||||
}
|
||||
}
|
||||
//特殊日期设置
|
||||
if(Objects.equals(prodServiceVO.getAdditionalFeeSwitch(),BaseEnum.YES_ONE.getKey())){
|
||||
for (ProdAdditionalFeePeriodsDO prodAdditionalFeePeriods : prodServiceVO.getProdAdditionalFeePeriodsList()){
|
||||
prodAdditionalFeePeriods.setProdId(prodServiceVO.getProdId());
|
||||
prodAdditionalFeePeriodsMapper.insert(prodAdditionalFeePeriods);
|
||||
prodAdditionalFeePeriodsMapper.updateById(prodAdditionalFeePeriods);
|
||||
}
|
||||
}
|
||||
//体重设置
|
||||
if(Objects.equals(prodServiceVO.getWeightSwitch(),BaseEnum.YES_ONE.getKey())){
|
||||
prodWeightRangePricesMapper.insert(prodServiceVO.prodWeightConfig);
|
||||
prodWeightRangePricesMapper.updateById(prodServiceVO.prodWeightConfig);
|
||||
}
|
||||
prodMapper.updateById(prod);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProdServiceVO getProdService(Integer prodId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProd(ProdSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
|
||||
@@ -44,6 +44,17 @@ public class ProdPageReqVO extends PageParam {
|
||||
@Schema(description = "详细描述")
|
||||
private String content;
|
||||
|
||||
|
||||
@Schema(description = "'是否置灰0否1是'")
|
||||
private Integer isProhibit;
|
||||
|
||||
@Schema(description = "审核备注")
|
||||
private String processNotes;
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
private String tag;
|
||||
|
||||
@Schema(description = "商品编号")
|
||||
private String prodNumber;
|
||||
|
||||
|
||||
@@ -80,6 +80,16 @@ public class ProdRespVO {
|
||||
@ExcelProperty("分享图")
|
||||
private String shareImage;
|
||||
|
||||
@Schema(description = "'是否置灰0否1是'")
|
||||
private Integer isProhibit;
|
||||
|
||||
@Schema(description = "审核备注")
|
||||
private String processNotes;
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
private String tag;
|
||||
|
||||
@Schema(description = "分享话术")
|
||||
@ExcelProperty("分享话术")
|
||||
private String shareContent;
|
||||
|
||||
@@ -55,6 +55,13 @@ public class ProdSaveReqVO {
|
||||
@Schema(description = "默认是1,正常状态(出售中), 0:下架(仓库中) 2:待审核", example = "2")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "'是否置灰0否1是'")
|
||||
private Integer isProhibit;
|
||||
|
||||
@Schema(description = "审核备注")
|
||||
private String processNotes;
|
||||
|
||||
|
||||
@Schema(description = "商品分类", example = "14895")
|
||||
private Long categoryId;
|
||||
|
||||
@@ -64,6 +71,11 @@ public class ProdSaveReqVO {
|
||||
@Schema(description = "分享图")
|
||||
private String shareImage;
|
||||
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
private String tag;
|
||||
|
||||
@Schema(description = "分享话术")
|
||||
private String shareContent;
|
||||
|
||||
|
||||
@@ -31,19 +31,14 @@ public class ProdAdditionalFeeDatesPageReqVO extends PageParam {
|
||||
@Schema(description = "指定日期(JSON格式存储)")
|
||||
private String specificDates;
|
||||
|
||||
@Schema(description = "收费方式")
|
||||
private String chargeMode;
|
||||
@Schema(description = "收费方式0:''固定金额'':1:''基准价上浮")
|
||||
private Integer chargeMode;
|
||||
|
||||
@Schema(description = "价格或上浮百分比", example = "17305")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "是否启用该规则")
|
||||
private Boolean isEnabled;
|
||||
@Schema(description = "是否启用该规则是否启用该规则0关1开")
|
||||
private Integer isEnabled;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -37,24 +37,16 @@ public class ProdAdditionalFeeDatesRespVO {
|
||||
@ExcelProperty("指定日期(JSON格式存储)")
|
||||
private String specificDates;
|
||||
|
||||
@Schema(description = "收费方式", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("收费方式")
|
||||
private String chargeMode;
|
||||
@Schema(description = "收费方式0:''固定金额'':1:''基准价上浮")
|
||||
private Integer chargeMode;
|
||||
|
||||
@Schema(description = "价格或上浮百分比", example = "17305")
|
||||
@ExcelProperty("价格或上浮百分比")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "是否启用该规则", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("是否启用该规则")
|
||||
private Boolean isEnabled;
|
||||
@Schema(description = "是否启用该规则是否启用该规则0关1开", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("是否启用该规则是否启用该规则0关1开")
|
||||
private Integer isEnabled;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@ExcelProperty("更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -33,21 +33,17 @@ public class ProdAdditionalFeeDatesSaveReqVO {
|
||||
@Schema(description = "指定日期(JSON格式存储)")
|
||||
private String specificDates;
|
||||
|
||||
@Schema(description = "收费方式", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@Schema(description = "收费方式0:''固定金额'':1:''基准价上浮", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "收费方式不能为空")
|
||||
private String chargeMode;
|
||||
private Integer chargeMode;
|
||||
|
||||
|
||||
@Schema(description = "价格或上浮百分比", example = "17305")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "是否启用该规则", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@Schema(description = "是否启用该规则是否启用该规则0关1开", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "是否启用该规则不能为空")
|
||||
private Boolean isEnabled;
|
||||
private Integer isEnabled;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -34,10 +34,5 @@ public class ProdAdditionalFeePeriodsPageReqVO extends PageParam {
|
||||
@Schema(description = "浮动百分比")
|
||||
private BigDecimal floatingPercentage;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -41,12 +41,5 @@ public class ProdAdditionalFeePeriodsRespVO {
|
||||
@ExcelProperty("浮动百分比")
|
||||
private BigDecimal floatingPercentage;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@ExcelProperty("更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -37,10 +37,4 @@ public class ProdAdditionalFeePeriodsSaveReqVO {
|
||||
@Schema(description = "浮动百分比")
|
||||
private BigDecimal floatingPercentage;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -19,6 +19,6 @@ public class ProdEmergencyInfoVO {
|
||||
private ProdEmergencyResponseDO prodEmergencyResponse;
|
||||
|
||||
@Schema(description = "紧急响应时间区间设置")
|
||||
private List<ProdEmergencyResponseIntervalsDO> ProdEmergencyResponseIntervalsList;
|
||||
private List<ProdEmergencyResponseIntervalsDO> prodEmergencyResponseIntervalsList;
|
||||
|
||||
}
|
||||
@@ -26,12 +26,6 @@ public class ProdWeightRangePricesPageReqVO extends PageParam {
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "是否启用该规则0否1是")
|
||||
private Boolean isEnabled;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
private Integer isEnabled;
|
||||
|
||||
}
|
||||
@@ -31,14 +31,7 @@ public class ProdWeightRangePricesRespVO {
|
||||
|
||||
@Schema(description = "是否启用该规则0否1是", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("是否启用该规则0否1是")
|
||||
private Boolean isEnabled;
|
||||
private Integer isEnabled;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@ExcelProperty("更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -29,12 +29,7 @@ public class ProdWeightRangePricesSaveReqVO {
|
||||
|
||||
@Schema(description = "是否启用该规则0否1是", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "是否启用该规则0否1是不能为空")
|
||||
private Boolean isEnabled;
|
||||
private Integer isEnabled;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -8,5 +8,7 @@
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
<delete id="deleteIntervals">
|
||||
delete from tz_prod_emergency_response_intervals where config_id = #{configId}
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user