fix: 优化代码

This commit is contained in:
paulGao 2022-11-02 19:54:57 +08:00
parent 52a2caaa6d
commit 9df9e33ce1
7 changed files with 0 additions and 174 deletions

View File

@ -8,7 +8,6 @@ import cn.lili.common.enums.ResultCode;
import cn.lili.common.exception.ServiceException;
import cn.lili.modules.goods.entity.dto.DraftGoodsDTO;
import cn.lili.modules.goods.entity.dto.GoodsOperationDTO;
import cn.lili.modules.goods.entity.dto.GoodsOperationFuLuDTO;
import cn.lili.modules.goods.entity.enums.GoodsAuthEnum;
import cn.lili.modules.goods.entity.enums.GoodsSalesModeEnum;
import cn.lili.modules.goods.entity.enums.GoodsStatusEnum;

View File

@ -1,137 +0,0 @@
package cn.lili.modules.goods.entity.dto;
import cn.lili.common.validation.EnumValue;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;
import javax.validation.Valid;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
/**
* 商品编辑DTO
*
* @author pikachu
* @since 2020-02-24 19:27:20
*/
@Data
@ToString
public class GoodsOperationFuLuDTO implements Serializable {
private static final long serialVersionUID = -509667581371776913L;
@ApiModelProperty(hidden = true)
private String goodsId;
@ApiModelProperty(value = "商品价格", required = true)
@NotNull(message = "商品价格不能为空")
@Min(value = 0, message = "商品价格不能为负数")
@Max(value = 99999999, message = "商品价格不能超过99999999")
private Double price;
@ApiModelProperty(value = "分类path")
private String categoryPath;
@ApiModelProperty(value = "店铺分类id", required = true)
@Size(max = 200, message = "选择了太多店铺分类")
private String storeCategoryPath;
@ApiModelProperty(value = "品牌id")
@Min(value = 0, message = "品牌值不正确")
private String brandId;
@ApiModelProperty(value = "商品名称", required = true)
@NotEmpty(message = "商品名称不能为空")
@Length(max = 50, message = "商品名称不能超过50个字符")
private String goodsName;
@ApiModelProperty(value = "详情")
private String intro;
@ApiModelProperty(value = "商品移动端详情")
private String mobileIntro;
@ApiModelProperty(value = "库存")
@Min(value = 0, message = "库存不能为负数")
@Max(value = 99999999, message = "库存不能超过99999999")
private Integer quantity;
@ApiModelProperty(value = "是否立即发布")
private Boolean release;
@ApiModelProperty(value = "是否是推荐商品")
private Boolean recommend;
@ApiModelProperty(value = "商品参数")
private List<GoodsParamsDTO> goodsParamsDTOList;
@ApiModelProperty(value = "商品图片")
private List<String> goodsGalleryList;
@ApiModelProperty(value = "运费模板id,不需要运费模板时值是0", required = true)
@NotNull(message = "运费模板不能为空没有运费模板时传值0")
@Min(value = 0, message = "运费模板值不正确")
private String templateId;
@ApiModelProperty(value = "sku列表")
@Valid
private List<Map<String, Object>> skuList;
@ApiModelProperty(value = "卖点")
private String sellingPoint;
@ApiModelProperty(value = "销售模式", required = true)
private String salesModel;
@ApiModelProperty(value = "是否有规格", hidden = true)
private String haveSpec;
@ApiModelProperty(value = "销售模式", required = true)
private String goodsUnit;
@ApiModelProperty(value = "商品描述")
private String info;
@ApiModelProperty(value = "是否重新生成sku数据")
private Boolean regeneratorSkuFlag = true;
/**
* @see cn.lili.modules.goods.entity.enums.GoodsTypeEnum
*/
@ApiModelProperty(value = "商品类型")
@EnumValue(strValues = {"PHYSICAL_GOODS", "VIRTUAL_GOODS", "E_COUPON"}, message = "商品类型参数值错误")
private String goodsType;
/**
* 商品视频
*/
@ApiModelProperty(value = "商品视频")
private String goodsVideo;
public String getGoodsName() {
//对商品对名称做一个极限处理这里没有用xss过滤是因为xss过滤为全局过滤影响很大
// 业务中全局代码中只有商品名称不能拥有英文逗号是由于商品名称存在一个数据库联合查询结果要根据逗号分组
return goodsName.replace(",", "");
}
//福禄所需参数
@ApiModelProperty(value = "商品编号", required = true)
@Length(max = 30, message = "商品编号太长不能超过30个字符")
private String sn;
@ApiModelProperty(value = "市场价格", required = true)
@NotNull(message = "市场价格不能为空")
private Double cost;
@ApiModelProperty(value = "重量", required = true)
@NotNull(message = "商品重量不能为空")
@Min(value = 0, message = "重量不能为负数")
@Max(value = 99999999, message = "重量不能超过99999999")
private Double weight;
}

View File

@ -2,7 +2,6 @@ package cn.lili.modules.goods.service;
import cn.lili.modules.goods.entity.dos.Goods;
import cn.lili.modules.goods.entity.dto.GoodsOperationDTO;
import cn.lili.modules.goods.entity.dto.GoodsOperationFuLuDTO;
import cn.lili.modules.goods.entity.dto.GoodsSearchParams;
import cn.lili.modules.goods.entity.enums.GoodsAuthEnum;
import cn.lili.modules.goods.entity.enums.GoodsStatusEnum;

View File

@ -18,7 +18,6 @@ import cn.lili.modules.goods.entity.dos.Goods;
import cn.lili.modules.goods.entity.dos.GoodsGallery;
import cn.lili.modules.goods.entity.dos.Wholesale;
import cn.lili.modules.goods.entity.dto.GoodsOperationDTO;
import cn.lili.modules.goods.entity.dto.GoodsOperationFuLuDTO;
import cn.lili.modules.goods.entity.dto.GoodsParamsDTO;
import cn.lili.modules.goods.entity.dto.GoodsSearchParams;
import cn.lili.modules.goods.entity.enums.GoodsAuthEnum;

View File

@ -1,23 +0,0 @@
package cn.lili.modules.store.entity.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 店铺福禄配置
*
* @author pikachu
* @since 2021-01-11 15:10:51
*/
@Data
public class FuLuConfigureDTO {
@ApiModelProperty(value = "福禄app密钥")
private String appSecretKey;
@ApiModelProperty(value = "福禄商户号")
private String merchantNumber;
@ApiModelProperty(value = "福禄appKEY商户key")
private String appMerchantKey;
}

View File

@ -2,7 +2,6 @@ package cn.lili.modules.store.mapper;
import cn.hutool.core.date.DateTime;
import cn.lili.modules.store.entity.dos.StoreDetail;
import cn.lili.modules.store.entity.dto.FuLuConfigureDTO;
import cn.lili.modules.store.entity.dto.StoreAfterSaleAddressDTO;
import cn.lili.modules.store.entity.dto.StoreDeliverGoodsAddressDTO;
import cn.lili.modules.store.entity.dto.StoreSettlementDay;
@ -62,15 +61,6 @@ public interface StoreDetailMapper extends BaseMapper<StoreDetail> {
"from li_store_detail s where s.store_id=#{storeId}")
StoreAfterSaleAddressDTO getStoreAfterSaleAddressDTO(String storeId);
/**
* 获取店铺福禄配置DTO
*
* @param storeId 店铺ID
* @return 店铺店铺福禄配置DTO
*/
@Select("select s.app_secret_key,s.merchant_number,s.app_merchant_key from li_store_detail s where s.store_id =#{storeId}")
FuLuConfigureDTO getFuLuConfigureDTO(String storeId);
/**
* 获取待结算店铺列表
*

View File

@ -3,7 +3,6 @@ package cn.lili.controller.settings;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.store.entity.dto.FuLuConfigureDTO;
import cn.lili.modules.store.entity.dto.StoreAfterSaleAddressDTO;
import cn.lili.modules.store.entity.dto.StoreDeliverGoodsAddressDTO;
import cn.lili.modules.store.entity.dto.StoreSettingDTO;