From 38124a702a8781171761647a7c81e68340b5888c Mon Sep 17 00:00:00 2001 From: lifenlong Date: Wed, 11 Aug 2021 21:12:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E7=B1=BB=E5=8E=BB=E9=99=A4=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E5=BF=85=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/common/UploadController.java | 2 +- .../lili/modules/goods/entity/dos/Category.java | 1 - .../store/entity/dto/StoreCompanyDTO.java | 14 ++++---------- .../store/entity/dto/StoreOtherInfoDTO.java | 12 ++++++++++++ .../store/serviceimpl/StoreServiceImpl.java | 17 +++++++++-------- 5 files changed, 26 insertions(+), 20 deletions(-) diff --git a/common-api/src/main/java/cn/lili/controller/common/UploadController.java b/common-api/src/main/java/cn/lili/controller/common/UploadController.java index d57c2d7a..82003a58 100644 --- a/common-api/src/main/java/cn/lili/controller/common/UploadController.java +++ b/common-api/src/main/java/cn/lili/controller/common/UploadController.java @@ -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); } diff --git a/framework/src/main/java/cn/lili/modules/goods/entity/dos/Category.java b/framework/src/main/java/cn/lili/modules/goods/entity/dos/Category.java index 4dc0933e..d35e73df 100644 --- a/framework/src/main/java/cn/lili/modules/goods/entity/dos/Category.java +++ b/framework/src/main/java/cn/lili/modules/goods/entity/dos/Category.java @@ -52,7 +52,6 @@ public class Category extends BaseEntity { @ApiModelProperty(value = "佣金比例") private Double commissionRate; - @NotEmpty(message = "分类图标不能为空") @ApiModelProperty(value = "分类图标") private String image; diff --git a/framework/src/main/java/cn/lili/modules/store/entity/dto/StoreCompanyDTO.java b/framework/src/main/java/cn/lili/modules/store/entity/dto/StoreCompanyDTO.java index 022538bb..c6761160 100644 --- a/framework/src/main/java/cn/lili/modules/store/entity/dto/StoreCompanyDTO.java +++ b/framework/src/main/java/cn/lili/modules/store/entity/dto/StoreCompanyDTO.java @@ -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 = "公司地址不能为空") diff --git a/framework/src/main/java/cn/lili/modules/store/entity/dto/StoreOtherInfoDTO.java b/framework/src/main/java/cn/lili/modules/store/entity/dto/StoreOtherInfoDTO.java index ab6caa35..08d35795 100644 --- a/framework/src/main/java/cn/lili/modules/store/entity/dto/StoreOtherInfoDTO.java +++ b/framework/src/main/java/cn/lili/modules/store/entity/dto/StoreOtherInfoDTO.java @@ -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; + } diff --git a/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreServiceImpl.java b/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreServiceImpl.java index 60614ced..2e78ed5a 100644 --- a/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreServiceImpl.java @@ -239,15 +239,13 @@ public class StoreServiceImpl extends ServiceImpl 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 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);