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

This commit is contained in:
张松 2024-11-19 15:06:29 +08:00
commit a8d45a8843
3 changed files with 16 additions and 9 deletions

View File

@ -472,6 +472,9 @@ public class TbProductServiceImpl implements TbProductService {
} }
//保存到sku_result //保存到sku_result
if ("sku".equals(resources.getTypeEnum())) { if ("sku".equals(resources.getTypeEnum())) {
if (StringUtils.isNotBlank(resources.getSkuSnap())) {
resources.setSkuSnap(resources.getSkuSnap().replace("label", "name"));
}
TbProductSkuResult productSkuResult = new TbProductSkuResult(); TbProductSkuResult productSkuResult = new TbProductSkuResult();
productSkuResult.setCreatedAt(Instant.now().toEpochMilli()); productSkuResult.setCreatedAt(Instant.now().toEpochMilli());
productSkuResult.setUpdatedAt(Instant.now().toEpochMilli()); productSkuResult.setUpdatedAt(Instant.now().toEpochMilli());
@ -526,7 +529,7 @@ public class TbProductServiceImpl implements TbProductService {
if (!"group".equals(product.getTypeEnum())) { if (!"group".equals(product.getTypeEnum())) {
if (resources.getCategoryId() == null) throw new BadRequestException("商品分类不可为空"); if (resources.getCategoryId() == null) throw new BadRequestException("商品分类不可为空");
product.setGroupSnap(null); product.setGroupSnap(null);
if (resources.getNotices() != null && resources.getNotices().getId() != null) { if (resources.getNotices() != null && resources.getNotices().getId() != null && resources.getNotices().getId() > 0) {
noticeRepository.deleteById(resources.getNotices().getId()); noticeRepository.deleteById(resources.getNotices().getId());
} }
} }
@ -573,6 +576,9 @@ public class TbProductServiceImpl implements TbProductService {
} }
//保存到sku_result //保存到sku_result
if ("sku".equals(resources.getTypeEnum())) { if ("sku".equals(resources.getTypeEnum())) {
if (StringUtils.isNotBlank(resources.getSkuSnap())) {
resources.setSkuSnap(resources.getSkuSnap().replace("label", "name"));
}
TbProductSkuResult productSkuResult = new TbProductSkuResult(); TbProductSkuResult productSkuResult = new TbProductSkuResult();
productSkuResult.setCreatedAt(Instant.now().toEpochMilli()); productSkuResult.setCreatedAt(Instant.now().toEpochMilli());
productSkuResult.setUpdatedAt(Instant.now().toEpochMilli()); productSkuResult.setUpdatedAt(Instant.now().toEpochMilli());
@ -857,6 +863,8 @@ public class TbProductServiceImpl implements TbProductService {
} }
public static void main(String[] args) { public static void main(String[] args) {
String str="[{\"label\":\"温度\",\"value\":\"热,冰,少冰\"}]";
str=str.replace("label", "name");
System.out.println(str);
} }
} }

View File

@ -1,15 +1,14 @@
package cn.ysk.cashier.system.domain; package cn.ysk.cashier.system.domain;
import cn.ysk.cashier.base.BaseEntity;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import cn.ysk.cashier.base.BaseEntity;
import javax.persistence.*; import javax.persistence.*;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
/** /**
* @author Zheng Jie * @author Zheng Jie
@ -29,7 +28,7 @@ public class DictDetail extends BaseEntity implements Serializable {
private Long id; private Long id;
@JoinColumn(name = "dict_id") @JoinColumn(name = "dict_id")
@ManyToOne(fetch=FetchType.LAZY) @ManyToOne(fetch=FetchType.EAGER)
@ApiModelProperty(value = "字典", hidden = true) @ApiModelProperty(value = "字典", hidden = true)
private Dict dict; private Dict dict;

View File

@ -1,12 +1,12 @@
package cn.ysk.cashier.system.domain; package cn.ysk.cashier.system.domain;
import cn.ysk.cashier.base.BaseEntity;
import cn.ysk.cashier.utils.enums.DataScopeEnum;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import cn.ysk.cashier.base.BaseEntity;
import cn.ysk.cashier.utils.enums.DataScopeEnum;
import javax.persistence.*; import javax.persistence.*;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
@ -45,7 +45,7 @@ public class Role extends BaseEntity implements Serializable {
@ApiModelProperty(value = "菜单", hidden = true) @ApiModelProperty(value = "菜单", hidden = true)
private Set<Menu> menus; private Set<Menu> menus;
@ManyToMany @ManyToMany(fetch = FetchType.EAGER)
@JoinTable(name = "sys_roles_depts", @JoinTable(name = "sys_roles_depts",
joinColumns = {@JoinColumn(name = "role_id",referencedColumnName = "role_id")}, joinColumns = {@JoinColumn(name = "role_id",referencedColumnName = "role_id")},
inverseJoinColumns = {@JoinColumn(name = "dept_id",referencedColumnName = "dept_id")}) inverseJoinColumns = {@JoinColumn(name = "dept_id",referencedColumnName = "dept_id")})