分类去除图片必填

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);
}
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);
}

View File

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

View File

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

View File

@ -37,4 +37,16 @@ public class StoreOtherInfoDTO {
@ApiModelProperty(value = "店铺经营类目")
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);
return storeDetailService.save(storeDetail);
} else {
store.setStoreAddressDetail(storeCompanyDTO.getStoreAddressDetail());
store.setStoreAddressIdPath(storeCompanyDTO.getStoreAddressIdPath());
store.setStoreAddressPath(storeCompanyDTO.getStoreAddressPath());
this.saveOrUpdate(store);
BeanUtil.copyProperties(storeCompanyDTO, store);
this.updateById(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
@ -265,6 +263,9 @@ public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements
public boolean applyThirdStep(StoreOtherInfoDTO storeOtherInfoDTO) {
//获取当前操作的店铺
Store store = getStoreByMember();
BeanUtil.copyProperties(storeOtherInfoDTO, store);
this.updateById(store);
StoreDetail storeDetail = storeDetailService.getStoreDetail(store.getId());
//设置店铺的其他信息
BeanUtil.copyProperties(storeOtherInfoDTO, storeDetail);