Merge branch 'dev/dev_xp' into dev/dev

# Conflicts:
#	src/main/java/com/ai/da/mapper/primary/entity/DesignItemDetailPrint.java
#	src/main/java/com/ai/da/model/vo/DesignSinglePrint.java
#	src/main/java/com/ai/da/python/PythonService.java
#	src/main/java/com/ai/da/python/vo/DesignPythonItemElement.java
#	src/main/java/com/ai/da/python/vo/DesignPythonItemPrint.java
#	src/main/java/com/ai/da/service/impl/DesignServiceImpl.java
This commit is contained in:
2025-02-10 11:21:52 +08:00
7 changed files with 27 additions and 25 deletions

View File

@@ -41,7 +41,7 @@ public class DesignItemDetailPrint {
/**
* 印花缩放比例
*/
private Double[] scale;
private String scale;
/**
* 印花旋转角度
*/

View File

@@ -29,11 +29,11 @@ public class DesignSinglePrint implements Serializable {
private String minIOPath;
@ApiModelProperty("印花位置")
private List<Double> location;
private List<Float> location;
@ApiModelProperty("印花大小")
@Range(max = 1, message = "印花缩放值需用大于等于0小于等于1的数表示")
private Double[] scale;
private List<Float> scale;
@Range(min = -360, max = 360, message = "印花旋转角度范围为-360° ~ 360°")
@ApiModelProperty("印花角度")
@@ -46,12 +46,12 @@ public class DesignSinglePrint implements Serializable {
public DesignSinglePrint() {
}
public DesignSinglePrint(String path, Double[] scale) {
public DesignSinglePrint(String path, List<Float> scale) {
this.path = path;
this.scale = scale;
}
public DesignSinglePrint(String level2Type, String path, String minIOPath, List<Double> location, Double[] scale, Double angle, Integer priority, Boolean ifSingle) {
public DesignSinglePrint(String level2Type, String path, String minIOPath, List<Float> location, List<Float> scale, Double angle, Integer priority, Boolean ifSingle) {
this.level2Type = level2Type;
this.path = path;
this.minIOPath = minIOPath;

View File

@@ -2767,13 +2767,13 @@ public class PythonService {
int size = printObject.size();
// 占位符填充数组
List<List<Double>> locationS = new ArrayList<>(Collections.nCopies(size, null));
List<Double[]> scaleS = new ArrayList<>(Collections.nCopies(size, null));
List<List<Float>> locationS = new ArrayList<>(Collections.nCopies(size, null));
List<List<Float>> scaleS = new ArrayList<>(Collections.nCopies(size, null));
List<Double> angleS = new ArrayList<>(Collections.nCopies(size, null));
ArrayList<String> pathsS = new ArrayList<>(Collections.nCopies(size, null));
List<List<Double>> locationO = new ArrayList<>(Collections.nCopies(size, null));
List<Double[]> scaleO = new ArrayList<>(Collections.nCopies(size, null));
List<List<Float>> locationO = new ArrayList<>(Collections.nCopies(size, null));
List<List<Float>> scaleO = new ArrayList<>(Collections.nCopies(size, null));
List<Double> angleO = new ArrayList<>(Collections.nCopies(size, null));
ArrayList<String> pathsO = new ArrayList<>(Collections.nCopies(size, null));
@@ -2830,8 +2830,8 @@ public class PythonService {
int size = trims.getPrints().size();
// 占位符填充数组
List<List<Double>> location = new ArrayList<>(Collections.nCopies(size, null));
List<Double[]> scale = new ArrayList<>(Collections.nCopies(size, null));
List<List<Float>> location = new ArrayList<>(Collections.nCopies(size, null));
List<List<Float>> scale = new ArrayList<>(Collections.nCopies(size, null));
List<Double> angle = new ArrayList<>(Collections.nCopies(size, null));
ArrayList<String> paths = new ArrayList<>(Collections.nCopies(size, null));
@@ -2841,6 +2841,8 @@ public class PythonService {
prints.forEach(p -> {
p.getLocation().set(0, p.getLocation().get(0));
p.getLocation().set(1, p.getLocation().get(1));
p.getScale().set(0, p.getScale().get(0));
p.getScale().set(1, p.getScale().get(1));
Integer priority = p.getPriority();
location.set(priority - 1, p.getLocation());
scale.set(priority - 1, p.getScale());

View File

@@ -10,12 +10,12 @@ import java.util.List;
public class DesignPythonItemElement {
@ApiModelProperty("print的位置 传 [[0.2, 0.2]]")
private List<List<Double>> location = new ArrayList<>();
private List<List<Float>> location = new ArrayList<>();
private List<String> element_path_list = new ArrayList<>();
@ApiModelProperty("print的缩放比例 传 [0.2, 0.2]")
private List<Double[]> element_scale_list = new ArrayList<>();
private List<List<Float>> element_scale_list = new ArrayList<>();
@ApiModelProperty("print的旋转角度 传 [0.2, 0.2]")
private List<Double> element_angle_list = new ArrayList<>();

View File

@@ -36,10 +36,10 @@ public class DesignPythonItemPrint {
@ApiModelProperty("print的位置 传 [[0.2, 0.2]]")
private List<List<Double>> location = new ArrayList<>();
private List<List<Float>> location = new ArrayList<>();
@ApiModelProperty("print的缩放比例 传 [0.2, 0.2]")
private List<Double[]> print_scale_list = new ArrayList<>();
private List<List<Float>> print_scale_list = new ArrayList<>();
@ApiModelProperty("print的旋转角度 传 [0.2, 0.2]")
private List<Double> print_angle_list = new ArrayList<>();
@@ -52,8 +52,8 @@ public class DesignPythonItemPrint {
public DesignPythonItemPrint(List<String> print_path_list, Boolean ifDesign) {
if (ifDesign){
this.print_path_list = print_path_list;
this.location = Collections.singletonList(Arrays.asList(0.0, 0.0));
this.print_scale_list = Arrays.asList(new Double[]{0.0d, 0.0d}, new Double[]{0.0d, 0.0d});
this.location = Collections.singletonList(Arrays.asList(0.0f, 0.0f));
this.print_scale_list = Collections.singletonList(Arrays.asList(0.0f, 0.0f));
this.print_angle_list = Arrays.asList(0.0, 0.0);
}

View File

@@ -816,7 +816,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
designItemDetailPrint.setPrintType(printType);
designItemDetailPrint.setLevel2Type(print.getLevel2Type());
designItemDetailPrint.setPath(print.getMinIOPath());
designItemDetailPrint.setScale(print.getScale());
designItemDetailPrint.setScale(print.getScale().toString());
designItemDetailPrint.setSingleOrOverall(printType.equals("print") ? print.getIfSingle() ? "single" : "overall" : "single");
designItemDetailPrint.setCreateDate(LocalDateTime.now(ZoneId.of(timeZone)));
// single、overall模式下都有position、angle和priority

View File

@@ -820,7 +820,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
print.setPosition("[0.0,0.0]");
// print.setScale(1d);
// todo mark 将print默认scale置为0.3
print.setScale(new Double[]{0.3d, 0.3d});
print.setScale(Arrays.toString(new Float[]{0.3f, 0.3f}));
print.setAngle(0.0);
print.setPriority(1);
QueryWrapper<CollectionElement> getPrintboardLevel2TypeQw = new QueryWrapper<>();
@@ -951,7 +951,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
print.setPosition("[0.0,0.0]");
// print.setScale(1d);
// todo mark 将print默认scale置为0.3
print.setScale(new Double[]{0.3d, 0.3d});
print.setScale(Arrays.toString(new Float[]{0.3f, 0.3f}));
print.setAngle(0.0);
print.setPriority(1);
QueryWrapper<CollectionElement> getPrintboardLevel2TypeQw = new QueryWrapper<>();
@@ -1596,12 +1596,12 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
DesignSinglePrint designSinglePrint = new DesignSinglePrint();
// designSinglePrintDTO.setIfSingle(detailPrint.getSingleOrOverall().equals("single") ? Boolean.TRUE : Boolean.FALSE);
designSinglePrint.setLevel2Type(detailPrint.getLevel2Type());
designSinglePrint.setLocation(JSONArray.parseArray(detailPrint.getPosition(), Double.class));
designSinglePrint.setLocation(JSONArray.parseArray(detailPrint.getPosition(), Float.class));
designSinglePrint.setAngle(detailPrint.getAngle());
designSinglePrint.setPriority(detailPrint.getPriority());
designSinglePrint.setPath(minioUtil.getPreSignedUrl(detailPrint.getPath(), 24 * 60));
designSinglePrint.setMinIOPath(detailPrint.getPath());
designSinglePrint.setScale(detailPrint.getScale());
designSinglePrint.setScale(JSONArray.parseArray(detailPrint.getScale(), Float.class));
designSinglePrint.setIfSingle(detailPrint.getSingleOrOverall().equals("single") ? Boolean.TRUE : Boolean.FALSE);
prints.add(designSinglePrint);
} else {
@@ -1613,8 +1613,8 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
print.getLevel2Type(),
minioUtil.getPreSignedUrl(print.getPath(), 24 * 60),
print.getPath(),
JSONArray.parseArray(print.getPosition(), Double.class),
print.getScale(),
JSONArray.parseArray(print.getPosition(), Float.class),
JSONArray.parseArray(print.getScale(), Float.class),
print.getAngle(),
print.getPriority(),
print.getSingleOrOverall().equals("single") ? Boolean.TRUE : Boolean.FALSE));
@@ -1977,7 +1977,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
print.setPosition("[0.0,0.0]");
// print.setScale(1d);
// todo mark 将print默认scale置为0.3
print.setScale(new Double[]{0.3d, 0.3d});
print.setScale(Arrays.toString(new Float[]{0.3f, 0.3f}));
print.setAngle(0.0);
print.setPriority(1);
QueryWrapper<CollectionElement> getPrintboardLevel2TypeQw = new QueryWrapper<>();