分类去除图片必填

This commit is contained in:
lifenlong 2021-08-11 21:12:21 +08:00
parent e1ec2b9b27
commit 38124a702a
5 changed files with 26 additions and 20 deletions

View File

@ -68,7 +68,7 @@ public class UploadController {
throw new ServiceException(ResultCode.USER_AUTHORITY_ERROR); throw new ServiceException(ResultCode.USER_AUTHORITY_ERROR);
} }
Setting setting = settingService.get(SettingEnum.OSS_SETTING.name()); Setting setting = settingService.get(SettingEnum.OSS_SETTING.name());
if (StrUtil.isEmpty(setting.getSettingValue())) { if (setting == null || StrUtil.isBlank(setting.getSettingValue())) {
throw new ServiceException(ResultCode.OSS_NOT_EXIST); throw new ServiceException(ResultCode.OSS_NOT_EXIST);
} }

View File

@ -52,7 +52,6 @@ public class Category extends BaseEntity {
@ApiModelProperty(value = "佣金比例") @ApiModelProperty(value = "佣金比例")
private Double commissionRate; private Double commissionRate;
@NotEmpty(message = "分类图标不能为空")
@ApiModelProperty(value = "分类图标") @ApiModelProperty(value = "分类图标")
private String image; private String image;

View File

@ -23,17 +23,11 @@ public class StoreCompanyDTO {
@ApiModelProperty(value = "公司名称") @ApiModelProperty(value = "公司名称")
private String companyName; private String companyName;
@NotBlank(message = "地址不能为空") @ApiModelProperty(value = "公司地址地区Id")
@ApiModelProperty(value = "地址名称, ''分割") private String companyAddressIdPath;
private String storeAddressPath;
@NotBlank(message = "地址ID不能为空") @ApiModelProperty(value = "公司地址地区")
@ApiModelProperty(value = "地址id''分割 ") private String companyAddressPath;
private String storeAddressIdPath;
@NotBlank(message = "地址详情")
@ApiModelProperty(value = "地址详情")
private String storeAddressDetail;
@Size(min = 1, max = 200) @Size(min = 1, max = 200)
@NotBlank(message = "公司地址不能为空") @NotBlank(message = "公司地址不能为空")

View File

@ -37,4 +37,16 @@ public class StoreOtherInfoDTO {
@ApiModelProperty(value = "店铺经营类目") @ApiModelProperty(value = "店铺经营类目")
private String goodsManagementCategory; private String goodsManagementCategory;
@NotBlank(message = "地址不能为空")
@ApiModelProperty(value = "地址名称, ''分割")
private String storeAddressPath;
@NotBlank(message = "地址ID不能为空")
@ApiModelProperty(value = "地址id''分割 ")
private String storeAddressIdPath;
@NotBlank(message = "地址详情")
@ApiModelProperty(value = "地址详情")
private String storeAddressDetail;
} }

View File

@ -239,15 +239,13 @@ public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements
BeanUtil.copyProperties(storeCompanyDTO, storeDetail); BeanUtil.copyProperties(storeCompanyDTO, storeDetail);
return storeDetailService.save(storeDetail); return storeDetailService.save(storeDetail);
} else { } else {
store.setStoreAddressDetail(storeCompanyDTO.getStoreAddressDetail()); BeanUtil.copyProperties(storeCompanyDTO, store);
store.setStoreAddressIdPath(storeCompanyDTO.getStoreAddressIdPath()); this.updateById(store);
store.setStoreAddressPath(storeCompanyDTO.getStoreAddressPath()); //判断是否存在店铺详情如果没有则进行新建如果存在则进行修改
this.saveOrUpdate(store); StoreDetail storeDetail = storeDetailService.getStoreDetail(store.getId());
BeanUtil.copyProperties(storeCompanyDTO, storeDetail);
return storeDetailService.updateById(storeDetail);
} }
//判断是否存在店铺详情如果没有则进行新建如果存在则进行修改
StoreDetail storeDetail = storeDetailService.getStoreDetail(store.getId());
BeanUtil.copyProperties(storeCompanyDTO, storeDetail);
return storeDetailService.updateById(storeDetail);
} }
@Override @Override
@ -265,6 +263,9 @@ public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements
public boolean applyThirdStep(StoreOtherInfoDTO storeOtherInfoDTO) { public boolean applyThirdStep(StoreOtherInfoDTO storeOtherInfoDTO) {
//获取当前操作的店铺 //获取当前操作的店铺
Store store = getStoreByMember(); Store store = getStoreByMember();
BeanUtil.copyProperties(storeOtherInfoDTO, store);
this.updateById(store);
StoreDetail storeDetail = storeDetailService.getStoreDetail(store.getId()); StoreDetail storeDetail = storeDetailService.getStoreDetail(store.getId());
//设置店铺的其他信息 //设置店铺的其他信息
BeanUtil.copyProperties(storeOtherInfoDTO, storeDetail); BeanUtil.copyProperties(storeOtherInfoDTO, storeDetail);