Merge remote-tracking branch 'origin/test' into test

This commit is contained in:
2024-09-12 10:47:36 +08:00
2 changed files with 4 additions and 6 deletions

View File

@@ -57,8 +57,7 @@ public class TbShopInfo implements Serializable {
@ApiModelProperty(value = "商户Id") @ApiModelProperty(value = "商户Id")
private String merchantId; private String merchantId;
@Column(name = "`shop_name`",nullable = false) @Column(name = "`shop_name`")
@NotBlank
@ApiModelProperty(value = "店铺名称") @ApiModelProperty(value = "店铺名称")
private String shopName; private String shopName;
@@ -190,8 +189,7 @@ public class TbShopInfo implements Serializable {
@ApiModelProperty(value = "到期时间") @ApiModelProperty(value = "到期时间")
private Long expireAt; private Long expireAt;
@Column(name = "`status`",nullable = false) @Column(name = "`status`")
@NotNull
@ApiModelProperty(value = "门店状态") @ApiModelProperty(value = "门店状态")
private Integer status; private Integer status;
@@ -282,6 +280,6 @@ public class TbShopInfo implements Serializable {
private String paymentQrcode; private String paymentQrcode;
public void copy(TbShopInfo source){ public void copy(TbShopInfo source){
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(false)); BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
} }
} }

View File

@@ -239,7 +239,7 @@ public class TbShopInfoServiceImpl implements TbShopInfoService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void update(TbShopInfo resources) { public void update(TbShopInfo resources) {
TbShopInfo tbShopInfo = tbShopInfoRepository.findById(resources.getId()).orElseGet(TbShopInfo::new); TbShopInfo tbShopInfo = tbShopInfoRepository.findById(resources.getId()).orElseGet(TbShopInfo::new);
if (!resources.getShopName().equals(tbShopInfo.getShopName())) { if (StringUtils.isNotBlank(resources.getShopName()) && !resources.getShopName().equals(tbShopInfo.getShopName())) {
shopStaffRepository.updateNameById(resources.getShopName(),resources.getId().toString()); shopStaffRepository.updateNameById(resources.getShopName(),resources.getId().toString());
userRepository.updateNickName(resources.getAccount(),resources.getShopName()); userRepository.updateNickName(resources.getAccount(),resources.getShopName());
} }