mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
生产单新增逻辑
This commit is contained in:
@@ -21,6 +21,7 @@ target/
|
||||
*.iml
|
||||
*.ipr
|
||||
*.class
|
||||
*.json
|
||||
target/*
|
||||
|
||||
### NetBeans ###
|
||||
|
||||
+1
@@ -63,6 +63,7 @@ public class FileController {
|
||||
@PermitAll
|
||||
@Operation(summary = "下载文件")
|
||||
@Parameter(name = "configId", description = "配置编号", required = true)
|
||||
@OperateLog(enable = false)
|
||||
public void getFileContent(HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
@PathVariable("configId") Long configId) throws Exception {
|
||||
|
||||
+4
-2
@@ -4,6 +4,7 @@ import com.cf.imes.framework.organ.core.aop.OrganIgnore;
|
||||
import com.cf.imes.module.infra.service.logger.ApiAccessLogService;
|
||||
/*import com.xxl.job.core.handler.annotation.XxlJob;*/
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -30,11 +31,12 @@ public class AccessLogCleanJob {
|
||||
*/
|
||||
private static final Integer DELETE_LIMIT = 100;
|
||||
|
||||
/* @XxlJob("accessLogCleanJob")
|
||||
/* @XxlJob("accessLogCleanJob")*/
|
||||
@OrganIgnore
|
||||
/* @Scheduled(cron = "0 0 * * * ?")*/
|
||||
public void execute() {
|
||||
Integer count = apiAccessLogService.cleanAccessLog(JOB_CLEAN_RETAIN_DAY, DELETE_LIMIT);
|
||||
log.info("[execute][定时执行清理访问日志数量 ({}) 个]", count);
|
||||
}*/
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+4
-2
@@ -4,6 +4,7 @@ import com.cf.imes.framework.organ.core.aop.OrganIgnore;
|
||||
import com.cf.imes.module.infra.service.logger.ApiErrorLogService;
|
||||
/*import com.xxl.job.core.handler.annotation.XxlJob;*/
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -30,11 +31,12 @@ public class ErrorLogCleanJob {
|
||||
*/
|
||||
private static final Integer DELETE_LIMIT = 100;
|
||||
|
||||
/* @XxlJob("errorLogCleanJob")
|
||||
/*@XxlJob("errorLogCleanJob")*/
|
||||
@OrganIgnore
|
||||
/*@Scheduled(cron = "0 0 2 * * ?")*/
|
||||
public void execute() {
|
||||
Integer count = apiErrorLogService.cleanErrorLog(JOB_CLEAN_RETAIN_DAY,DELETE_LIMIT);
|
||||
log.info("[execute][定时执行清理错误日志数量 ({}) 个]", count);
|
||||
}*/
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -129,6 +129,10 @@
|
||||
<groupId>jakarta.servlet</groupId>
|
||||
<artifactId>jakarta.servlet-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>uk.co.jemos.podam</groupId>
|
||||
<artifactId>podam</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<!-- 设置构建的 jar 包名 -->
|
||||
|
||||
+18
-3
@@ -4,7 +4,9 @@ import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.operatelog.core.annotations.OperateLog;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.*;
|
||||
import com.cf.imes.module.executor.service.optimizeplan.OptimizePlanService;
|
||||
import com.cf.imes.module.system.api.dataSource.DataSourceApi;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@@ -15,6 +17,7 @@ import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author there
|
||||
@@ -74,11 +77,23 @@ public class OptimizePlanController {
|
||||
}
|
||||
|
||||
@GetMapping("/getOptimizePlanParam")
|
||||
@Operation(summary = "获取优化排单参数 (未完成)")
|
||||
@Operation(summary = "获取优化排单参数 (mock)")
|
||||
@PreAuthorize("@ss.hasPermission('executor:optimize-plate:create')")
|
||||
public CommonResult<OptimizeParamRespVO> getOptimizePlanParam (@RequestParam @Valid @NotNull(message = "排单id不能空") Long planId) {
|
||||
@Parameter(name = "planId", description = "排单id", required = false)
|
||||
public CommonResult<OptimizeParamRespVO> getOptimizePlanParam (@RequestParam (required = false) Long planId) {
|
||||
/* OptimizeParamRespVO data = RandomUtils.randomPojo(OptimizeParamRespVO.class);
|
||||
return CommonResult.success(data);*/
|
||||
//todo
|
||||
return CommonResult.success(optimizePlanService.getOptimizePlanParam(planId));
|
||||
OptimizeParamRespVO optimizePlanParam = optimizePlanService.getOptimizePlanParam(planId);
|
||||
return CommonResult.success(optimizePlanParam);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getLabelDataSourceValue")
|
||||
@Operation(summary = "获取标签数据源value")
|
||||
@PreAuthorize("@ss.hasPermission('executor:optimize-plate:create')")
|
||||
public CommonResult<Map<String,Object>> getLabelDataSourceValue(@Valid GetSourceDataReq req ) {
|
||||
return CommonResult.success( optimizePlanService.getLabelDataSourceValue(req));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class BlockPlaceMessage {
|
||||
|
||||
@Schema(description = "自增板信息")
|
||||
private String zzInfo;
|
||||
@Schema(description = "大板ID")
|
||||
private Integer bi;
|
||||
@Schema(description = "小板号")
|
||||
private Long bo;
|
||||
@Schema(description = "位置X")
|
||||
private Double x;
|
||||
@Schema(description = "位置Y")
|
||||
private Double y;
|
||||
@Schema(description = "优化顺序")
|
||||
private Double pi;
|
||||
@Schema(description = "放置方式")
|
||||
private Double ps;
|
||||
@Schema(description = "开料顺序")
|
||||
private Double ci;
|
||||
@Schema(description = "下刀点位置")
|
||||
private Double ca;
|
||||
@Schema(description = "下刀点")
|
||||
private Double cp;
|
||||
@Schema(description = "未移动")
|
||||
private Boolean ia;
|
||||
@Schema(description = "是否重叠isOverlap")
|
||||
private Boolean io;
|
||||
@Schema(description = "是否排钻")
|
||||
private Boolean dh;
|
||||
@Schema(description = "是否造型")
|
||||
private Boolean dm;
|
||||
@Schema(description = "超限板 标识")
|
||||
private Integer of;
|
||||
@Schema(description = "板类型 普通=0 自增=1 ,余料=2(失效)")
|
||||
private Integer type;
|
||||
@Schema(description = "点阵")
|
||||
private List<Point> points;
|
||||
@Schema(description = "原造型偏移信息")
|
||||
private OldSizeOutOff olgSizeOutOff;
|
||||
@Schema(description = "尺寸扩展信息(造型)")
|
||||
private SizeOutOff sizeOutOff;
|
||||
@Schema(description = "跟优化位置 漂移多少?X")
|
||||
private Double placeOffX;
|
||||
@Schema(description = "跟优化位置 漂移多少?Y")
|
||||
private Double placeOffY;
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.dto;
|
||||
|
||||
import java.awt.Point;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class ContourData {
|
||||
private ArrayList<Point> pts; //点集(二维向量(x,y))
|
||||
private Integer[] buls; //凸度(0直线段 >0逆时针方向 <0顺时针方向)
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
/**
|
||||
* @projectName: cf_imes_server
|
||||
* @author: 晨丰科技
|
||||
* @date: 2024/3/22 16:58
|
||||
*/
|
||||
@Data
|
||||
public class HoleDetail {
|
||||
|
||||
private Integer holeId;
|
||||
@Schema(description = "孔类别 大孔 = 0, 小孔 = 10, 木削 = 20, 木削大孔 = 21, 层板钉 = 30, 通孔 = 40, 造型孔 = -10, 连接杆 = 50")
|
||||
private Integer holeType;
|
||||
@Schema(description = "面 正面 = 0, 反面 = 1, 侧面 = 2, 左侧面 = 21, 右侧面 = 22, 上侧面 = 23, 下侧面 = 24, 弧形侧面 = 29, 异形侧面 = 30")
|
||||
private Integer face;
|
||||
@Schema(description = "坐标x")
|
||||
private Integer pointX;
|
||||
@Schema(description = "坐标y")
|
||||
private Integer pointY;
|
||||
@Schema(description = "坐标z")
|
||||
private Integer pointZ;
|
||||
@Schema(description = "半径")
|
||||
private Integer radius;
|
||||
@Schema(description = "深度")
|
||||
private Integer depth;
|
||||
@Schema(description = "起点坐标")
|
||||
private Integer endPoint;
|
||||
private Integer pointX2;
|
||||
private Integer pointY2;
|
||||
private Integer angle;
|
||||
|
||||
}
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class Material {
|
||||
|
||||
@Schema(description = "生产单id")
|
||||
private String orderId;
|
||||
@Schema(description = "商品id")
|
||||
private Integer goodsId;
|
||||
@Schema(description = "商品名称")
|
||||
private String goodsName;
|
||||
@Schema(description = "规范")
|
||||
private String specification;
|
||||
@Schema(description = "材质")
|
||||
private String metrial;
|
||||
@Schema(description = "颜色")
|
||||
private String color;
|
||||
@Schema(description = "品牌")
|
||||
private String brank;
|
||||
@Schema(description = "宽")
|
||||
private Integer width;
|
||||
@Schema(description = "长")
|
||||
private Integer length;
|
||||
@Schema(description = "厚")
|
||||
private Integer thickness;
|
||||
@Schema(description = "修边值")
|
||||
private Integer border;
|
||||
@Schema(description = "开料刀直径")
|
||||
private Integer cutDia;
|
||||
@Schema(description = "开料间隙")
|
||||
private Integer cutGap;
|
||||
@Schema(description = "IsSorted")
|
||||
private Boolean isSorted;
|
||||
@Schema(description = "大板数")
|
||||
private Integer boardCount;
|
||||
@Schema(description = "最小大板ID")
|
||||
private Integer minBoardId;
|
||||
@Schema(description = "最大大板ID")
|
||||
private Integer maxBoardId;
|
||||
@Schema(description = "平均利用率")
|
||||
private Double avgLyr_All;
|
||||
@Schema(description = "前N平均利用率")
|
||||
private Integer avgLyr_NoLastOne;
|
||||
@Schema(description = "尾张利用率")
|
||||
private Double lyr_LastOne;
|
||||
@Schema(description = "组织id")
|
||||
private Integer organId;
|
||||
@Schema(description = "使用板信息列表")
|
||||
private List<UsedBoardMessage> usedBoardMessageList;
|
||||
@Schema(description = "小板信息列表")
|
||||
private List<BlockPlaceMessage> blockPlaceMessageList;
|
||||
@Schema(description = "状态")
|
||||
private Integer state;
|
||||
@Schema(description = "有波纹")
|
||||
private Boolean hasWave;
|
||||
@Schema(description = "板材原宽")
|
||||
private Integer orgWidth;
|
||||
@Schema(description = "板材原长")
|
||||
private Integer orgLength;
|
||||
@Schema(description = "余料板数")
|
||||
private Integer boardCountRemain;
|
||||
@Schema(description = "余料板情况")
|
||||
private String remainBoardMessage;
|
||||
@Schema(description = "预洗值")
|
||||
private Integer preCutValue;
|
||||
@Schema(description = "废料板列表")
|
||||
private List<ScrapBoard> scrapBoardList;
|
||||
@Schema(description = "是否辅助开料")
|
||||
private Boolean helpCut;
|
||||
@Schema(description = "同刀辅助 厚度")
|
||||
private Integer sameKnifeHelpCutGap;
|
||||
@Schema(description = "开料刀ID")
|
||||
private Integer cutKnifeID;
|
||||
@Schema(description = "辅助刀ID")
|
||||
private Integer helpKnifeID;
|
||||
@Schema(description = "最后保存时间")
|
||||
private Date lastSaveDate;
|
||||
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @projectName: cf_imes_server
|
||||
* @author: 晨丰科技
|
||||
* @date: 2024/3/22 16:53
|
||||
*/
|
||||
@Data
|
||||
public class ModelDetail {
|
||||
|
||||
@Schema(description = "造型ID")
|
||||
private Integer modelId;
|
||||
@Schema(description = "线ID")
|
||||
private Integer lineId;
|
||||
@Schema(description = "面 正面 = 0, 反面 = 1, 侧面 = 2, 左侧面 = 21, 右侧面 = 22, 上侧面 = 23, 下侧面 = 24, 弧形侧面 = 29, 异形侧面 = 30")
|
||||
private Integer face;
|
||||
@Schema(description = "刀号")
|
||||
private String knifeName;
|
||||
@Schema(description = "刀半径")
|
||||
private Integer knifeRadius;
|
||||
@Schema(description = "深度")
|
||||
private Integer depth;
|
||||
@Schema(description = "造型轮廓")
|
||||
private OriginModelingData originModeling;
|
||||
private List<ModelPoint> modelPoint;
|
||||
private List<ModelOffSet> modelOffSet;
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* @projectName: cf_imes_server
|
||||
* @author: 晨丰科技
|
||||
* @date: 2024/3/22 16:51
|
||||
*/
|
||||
public class ModelOffSet {
|
||||
|
||||
private String name;
|
||||
@Schema(description = "面 正面 = 0, 反面 = 1, 侧面 = 2, 左侧面 = 21, 右侧面 = 22, 上侧面 = 23, 下侧面 = 24, 弧形侧面 = 29, 异形侧面 = 30")
|
||||
private Integer face;
|
||||
private Integer value;
|
||||
private Integer radius;
|
||||
private Integer deep;
|
||||
private Integer angle;
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.dto;
|
||||
|
||||
/**
|
||||
* @projectName: cf_imes_server
|
||||
* @author: 晨丰科技
|
||||
* @date: 2024/3/22 16:49
|
||||
*/
|
||||
public class ModelPoint {
|
||||
private Integer lineId;
|
||||
private Integer pointId;
|
||||
private Integer pointX;
|
||||
private Integer pointY;
|
||||
private Integer radius;
|
||||
private Integer depth;
|
||||
private Integer curve;
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @projectName: cf_imes_server
|
||||
* @author: 晨丰科技
|
||||
* @date: 2024/3/22 17:00
|
||||
*/
|
||||
@Data
|
||||
public class OldPointDetail {
|
||||
@Schema(description = "点id")
|
||||
private Long pointId;
|
||||
@Schema(description = "x")
|
||||
private Double pointX;
|
||||
@Schema(description = "y")
|
||||
private Double pointY;
|
||||
@Schema(description = "曲线")
|
||||
private Double curve;
|
||||
@Schema(description = "密封尺寸")
|
||||
private Double sealSize;
|
||||
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class OldSizeOutOff {
|
||||
private Integer left;
|
||||
private Integer right;
|
||||
private Integer upper;
|
||||
private Integer under;
|
||||
@Schema(description = "板外扩宽")
|
||||
private Integer width;
|
||||
@Schema(description = "板外扩长")
|
||||
private Integer length;
|
||||
@Schema(description = "排版外扩宽")
|
||||
private Integer outWidth;
|
||||
@Schema(description = "排版外扩长")
|
||||
private Integer outLength;
|
||||
private Boolean hasDone;
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import java.util.Dictionary;
|
||||
|
||||
public class OriginModelingData {
|
||||
@Schema(description = "轮郭")
|
||||
private ContourData outline;
|
||||
@Schema(description = "孔轮廓")
|
||||
private Dictionary<String, ContourData> holes;
|
||||
@Schema(description ="厚度" )
|
||||
private Integer thickness;
|
||||
@Schema(description = "0正面、1反面、2侧面")
|
||||
private Integer dir;
|
||||
@Schema(description = "刀半径")
|
||||
private Integer knifeRadius;
|
||||
@Schema(description = "槽加长")
|
||||
private Integer addLen;
|
||||
@Schema(description = "槽加宽")
|
||||
private Integer addWidth;
|
||||
@Schema(description = "槽加深")
|
||||
private Integer addDepth;
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class Point {
|
||||
private Double x;
|
||||
private Double y;
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @projectName: cf_imes_server
|
||||
* @author: 晨丰科技
|
||||
* @date: 2024/3/22 16:57
|
||||
*/
|
||||
@Data
|
||||
public class PointDetail {
|
||||
|
||||
@Schema(description = "点id")
|
||||
private Long pointId;
|
||||
@Schema(description = "x")
|
||||
private Double pointX;
|
||||
@Schema(description = "y")
|
||||
private Double pointY;
|
||||
@Schema(description = "曲线")
|
||||
private Double curve;
|
||||
@Schema(description = "密封尺寸")
|
||||
private Double sealSize;
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class ScrapBlock {
|
||||
@Schema(description = "余料号")
|
||||
private Long scrapNo;
|
||||
@Schema(description = "是否异形")
|
||||
private Boolean isUnRegular;
|
||||
@Schema(description = "是否重叠")
|
||||
private Boolean isOverlap;
|
||||
@Schema(description = "是否已录入")
|
||||
private Boolean isInstored;
|
||||
private List<Point> points;
|
||||
private String remark;
|
||||
@Schema(description = "坐标X")
|
||||
private Double placeX;
|
||||
@Schema(description = "坐标Y")
|
||||
private Double placeY;
|
||||
@Schema(description = "开料宽")
|
||||
private Double placeWidth;
|
||||
@Schema(description = "开料长")
|
||||
private Double placeLength;
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class ScrapBoard {
|
||||
|
||||
@Schema(description ="源排单号")
|
||||
private String planCode;
|
||||
@Schema(description ="使用排单号")
|
||||
private String usedPlanCode;
|
||||
@Schema(description ="ID")
|
||||
private Long id;
|
||||
@Schema(description ="排单ID")
|
||||
private Long planId;
|
||||
@Schema(description ="源排单ID")
|
||||
private Long oldPlanId;
|
||||
@Schema(description ="未使用 = 0, 已使用 = 1")
|
||||
private Integer status;
|
||||
@Schema(description ="正面 = 0, 正面右转 = 1, 正面后转 = 2, 正面左转 = 3, 反面 = 4, 反面右转 = 5, 反面后转 = 6, 反面左转 = 7")
|
||||
private Integer placedStyle;
|
||||
@Schema(description ="仓库")
|
||||
private String storeHouse;
|
||||
@Schema(description ="Count")
|
||||
private Integer count;
|
||||
@Schema(description ="备注")
|
||||
private String remark;
|
||||
@Schema(description ="OutLineJson")
|
||||
private String outLineJson;
|
||||
@Schema(description ="组织id")
|
||||
private Integer organId;
|
||||
@Schema(description ="原始多段线")
|
||||
private List<ScrapPt> basePolyline;
|
||||
@Schema(description ="放置的多段线")
|
||||
private List<ScrapPt> placedPolyline;
|
||||
private Boolean isUsed;
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class ScrapPt {
|
||||
private Double x;
|
||||
private Double y;
|
||||
private Double bul;
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @projectName: cf_imes_server
|
||||
* @author: 晨丰科技
|
||||
* @date: 2024/3/22 18:02
|
||||
*/
|
||||
@Data
|
||||
public class SideHoleDetail {
|
||||
|
||||
private Integer holeID;
|
||||
private Integer holeType; // 请定义HoleType枚举类型
|
||||
private Integer face; // 请定义FaceType枚举类型
|
||||
private Integer pointX;
|
||||
private Integer pointY;
|
||||
private Integer pointZ;
|
||||
private Integer radius;
|
||||
private Integer depth;
|
||||
private String endPoint;
|
||||
private Integer pointX2;
|
||||
private Integer pointY2;
|
||||
private Integer angle;
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @projectName: cf_imes_server
|
||||
* @author: 晨丰科技
|
||||
* @date: 2024/3/22 17:59
|
||||
*/
|
||||
@Data
|
||||
public class SideModelDetail {
|
||||
|
||||
private Integer modelId;
|
||||
private Integer lineId;
|
||||
private int face;
|
||||
private String knifeName;
|
||||
private Integer knifeRadius;
|
||||
private Integer depth;
|
||||
private OriginModelingData originModeling;
|
||||
private List<ModelPoint> modelPoint;
|
||||
private List<ModelOffSet> modelOffSet;
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class SizeOutOff {
|
||||
private Double left;
|
||||
private Double right;
|
||||
private Double upper;
|
||||
private Double under;
|
||||
@Schema(description = "板外扩宽")
|
||||
private Double width;
|
||||
@Schema(description = "板外扩长")
|
||||
private Double length;
|
||||
@Schema(description = "排版外扩 宽")
|
||||
private Double outWidth;
|
||||
@Schema(description = "排版外扩 长")
|
||||
private Double outLength;
|
||||
private Boolean hasDone;
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class UsedBoardMessage {
|
||||
@Schema(description = "大板id")
|
||||
private Integer bi;
|
||||
@Schema(description = "宽")
|
||||
private Integer w;
|
||||
@Schema(description = "长度")
|
||||
private Integer l;
|
||||
@Schema(description = "余料板ID")
|
||||
private Integer si;
|
||||
@Schema(description = "仓库号")
|
||||
private String so;
|
||||
@Schema(description = "余料板号,大板为空")
|
||||
private String no;
|
||||
@Schema(description = "RM")
|
||||
private String rm;
|
||||
@Schema(description = "是否锁定")
|
||||
private Boolean lK;
|
||||
@Schema(description = "余料母板")
|
||||
private List<ScrapPt> scrapPtList;
|
||||
@Schema(description = "余料空间")
|
||||
private List<ScrapBlock> scrapBlocks;
|
||||
@Schema(description = "左边不能加工区域,有造型")
|
||||
private Boolean le;
|
||||
@Schema(description = "右边不能加工区域,有造型")
|
||||
private Boolean re;
|
||||
@Schema(description = "WLs")
|
||||
private List<String> wLs;
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "")
|
||||
public class GetSourceDataReq {
|
||||
@Schema(description = "生产单id")
|
||||
@NotNull(message = "生产单id不能空")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "数据源id")
|
||||
@NotNull(message = "数据源id不能空")
|
||||
private Long dataSourceId;
|
||||
|
||||
@Schema(description = "排单id")
|
||||
private Long planId;
|
||||
|
||||
@Schema(description = "包裹id")
|
||||
private Long packageId;
|
||||
|
||||
|
||||
}
|
||||
+17
-10
@@ -1,12 +1,14 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.vo;
|
||||
|
||||
import com.cf.imes.module.executor.controller.admin.goods.vo.GoodsRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.dto.Material;
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateRespVO;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -17,6 +19,9 @@ import static com.cf.imes.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class OptimizeParamRespVO {
|
||||
@Schema(description = "排单id")
|
||||
private Long planId;
|
||||
@@ -28,12 +33,11 @@ public class OptimizeParamRespVO {
|
||||
private Integer type;
|
||||
@Schema(description = "排单状态 0 新单,1 板材已申请,2 开料中,3 已开料")
|
||||
private Integer status;
|
||||
@Schema(description = "是否支付")
|
||||
private Boolean isPay;
|
||||
@Schema(description = "机台 ID")
|
||||
private Long machineId;
|
||||
@Schema(description = "计划时间")
|
||||
private LocalDateTime planTime;
|
||||
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
|
||||
private Date planTime;
|
||||
@Schema(description = "生产单号")
|
||||
private String orderNos;
|
||||
@Schema(description = "排单优化文件地址")
|
||||
@@ -47,13 +51,16 @@ public class OptimizeParamRespVO {
|
||||
@Schema(description = "生产时间")
|
||||
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
|
||||
private Date produceTime;
|
||||
|
||||
@Schema(description = "生产单列表")
|
||||
private List<OrderResp> orderList;
|
||||
|
||||
@Schema(description = "商品列表")
|
||||
private List<GoodsRespVO> goodsList;
|
||||
|
||||
@Schema(description = "大板使用信息列表")
|
||||
private List<Material> materialList;
|
||||
/*@Schema(description = "商品列表")
|
||||
private List<GoodsRespVO> goodsList;*/
|
||||
@Schema(description = "小板列表")
|
||||
private List<PlateRespVO> plateList;
|
||||
@Schema(description = "区域删除")
|
||||
private Boolean areaDeleted;
|
||||
@Schema(description = "源id")
|
||||
private Long sourceNo;
|
||||
}
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plate.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class KaiLiaoSize {
|
||||
private Double width;
|
||||
private Double height;
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plate.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class OffSet {
|
||||
private Integer x;
|
||||
private Integer y;
|
||||
private Integer z;
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plate.vo;
|
||||
|
||||
import com.cf.imes.module.executor.controller.admin.plan.dto.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class PlateDetailVO {
|
||||
|
||||
@Schema(description = "生产单id")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "点详情列表")
|
||||
private List<PointDetail> pointDetailList;
|
||||
|
||||
@Schema(description = "孔详情列表")
|
||||
private List<HoleDetail> holeDetailList;
|
||||
|
||||
@Schema(description = "造型列表")
|
||||
private List<ModelDetail> modelDetailList;
|
||||
|
||||
@Schema(description = "偏移量")
|
||||
private OffSet offSet;
|
||||
|
||||
@Schema(description = "是否新版本")
|
||||
private Boolean newVersion;
|
||||
|
||||
@Schema(description = "原始点详情列表")
|
||||
private List<OldPointDetail> olgPointDetailList;
|
||||
|
||||
@Schema(description = "开料尺寸")
|
||||
private KaiLiaoSize kaiLiaoSize;
|
||||
|
||||
@Schema(description = "边模型详情列表")
|
||||
private List<SideModelDetail> sideModelDetails;
|
||||
|
||||
@Schema(description = "边孔详情")
|
||||
private List<SideHoleDetail> sideHoleDetailList;
|
||||
|
||||
}
|
||||
+7
@@ -9,6 +9,9 @@ import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Schema(description = "管理后台 - 生产单板件 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@@ -163,4 +166,8 @@ public class PlateRespVO {
|
||||
|
||||
@Schema(description = "板材材质")
|
||||
private String material;
|
||||
@Schema(description = "小板详情列表")
|
||||
private List<PlateDetailVO> plateDetailList;
|
||||
|
||||
|
||||
}
|
||||
+2
@@ -17,6 +17,7 @@ import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 生产单表 order_{N} Mapper
|
||||
@@ -88,4 +89,5 @@ public interface OrderMapper extends BaseMapperX<OrderDO> {
|
||||
return selectList(wrapper);
|
||||
}
|
||||
|
||||
Map<String, Object> selectDynamicSqlString(@Param("sqlStr") String sqlStr);
|
||||
}
|
||||
|
||||
+1
@@ -1,6 +1,7 @@
|
||||
package com.cf.imes.module.executor.framework.rpc.config;
|
||||
|
||||
import com.cf.imes.module.infra.api.file.FileApi;
|
||||
import com.cf.imes.module.system.api.dataSource.DataSourceApi;
|
||||
import com.cf.imes.module.system.api.machine.MachineApi;
|
||||
import com.cf.imes.module.system.api.process.ProcessGroupApi;
|
||||
import com.cf.imes.module.system.api.user.AdminUserApi;
|
||||
|
||||
+3
@@ -3,6 +3,7 @@ package com.cf.imes.module.executor.service.optimizeplan;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface OptimizePlanService {
|
||||
List<PlateOptimize> getPlateListByPlanId(Long planId);
|
||||
@@ -16,4 +17,6 @@ public interface OptimizePlanService {
|
||||
OptimizeParamResVO getOptimizeParam(Long planId);
|
||||
|
||||
OptimizeParamRespVO getOptimizePlanParam(Long planId);
|
||||
|
||||
Map<String, Object> getLabelDataSourceValue(GetSourceDataReq req);
|
||||
}
|
||||
|
||||
+43
-1
@@ -5,7 +5,9 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.cf.imes.framework.common.util.json.JsonUtils;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.dto.Material;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.*;
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateDetailVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderItem.OrderItemDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plan.PlanDO;
|
||||
@@ -15,12 +17,15 @@ import com.cf.imes.module.executor.dal.dataobject.remainplaten.OutlineDTO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.remainplaten.PointDTO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.remainplaten.RemainPlateDO;
|
||||
import com.cf.imes.module.executor.dal.mysql.goods.GoodsMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.order.OrderMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.plan.PlanMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.plate.PlateMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.remainplaten.RemainPlateMapper;
|
||||
import com.cf.imes.module.executor.util.RandomUtils;
|
||||
import com.cf.imes.module.executor.util.RectangleChecker;
|
||||
import com.cf.imes.module.infra.api.file.FileApi;
|
||||
import com.cf.imes.module.infra.api.file.dto.FileCreateReqDTO;
|
||||
import com.cf.imes.module.system.api.dataSource.DataSourceApi;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -58,6 +63,12 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
@Resource
|
||||
private GoodsMapper goodsMapper;
|
||||
|
||||
@Resource
|
||||
private DataSourceApi dataSourceApi;
|
||||
|
||||
@Resource
|
||||
private OrderMapper orderMapper;
|
||||
|
||||
@Override
|
||||
public List<PlateOptimize> getPlateListByPlanId(Long planId) {
|
||||
return planMapper.selectPlateListByPlanId(planId);
|
||||
@@ -202,7 +213,38 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
|
||||
@Override
|
||||
public OptimizeParamRespVO getOptimizePlanParam(Long planId) {
|
||||
return planMapper.getOptimizePlanParam(planId);
|
||||
|
||||
OptimizeParamRespVO optimizePlanParam = planMapper.getOptimizePlanParam(planId);
|
||||
|
||||
if(Objects.isNull(optimizePlanParam)) {
|
||||
return RandomUtils.randomPojo(OptimizeParamRespVO.class);
|
||||
}
|
||||
//暂时先mock
|
||||
ArrayList<Material> list = new ArrayList<>();
|
||||
list.add(RandomUtils.randomPojo(Material.class));
|
||||
list.add(RandomUtils.randomPojo(Material.class));
|
||||
ArrayList<PlateDetailVO> plateDetailVOS = new ArrayList<>();
|
||||
plateDetailVOS.add(RandomUtils.randomPojo(PlateDetailVO.class));
|
||||
plateDetailVOS.add(RandomUtils.randomPojo(PlateDetailVO.class));
|
||||
plateDetailVOS.add(RandomUtils.randomPojo(PlateDetailVO.class));
|
||||
if( CollectionUtil.isNotEmpty(optimizePlanParam.getPlateList())) {
|
||||
optimizePlanParam.getPlateList().get(0).setPlateDetailList(plateDetailVOS);
|
||||
}
|
||||
optimizePlanParam.setMaterialList(list);
|
||||
return optimizePlanParam;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getLabelDataSourceValue(GetSourceDataReq req) {
|
||||
String sqlStr = dataSourceApi.getSqlById(req.getDataSourceId()).getCheckedData();
|
||||
String sql = sqlStr.replace("#{orderId}", req.getOrderId() + "");
|
||||
if(!Objects.isNull(req.getPackageId())) {
|
||||
sql = sql.replace("#{packageId}", req.getPackageId() + "");
|
||||
}
|
||||
if(!Objects.isNull(req.getPlanId())) {
|
||||
sql = sql.replace("#{planId}", req.getPlanId() + "");
|
||||
}
|
||||
return orderMapper.selectDynamicSqlString(sql);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+137
@@ -0,0 +1,137 @@
|
||||
package com.cf.imes.module.executor.util;
|
||||
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.cf.imes.framework.common.enums.CommonStatusEnum;
|
||||
import uk.co.jemos.podam.api.PodamFactory;
|
||||
import uk.co.jemos.podam.api.PodamFactoryImpl;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* 随机工具类
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
public class RandomUtils {
|
||||
|
||||
private static final int RANDOM_STRING_LENGTH = 10;
|
||||
|
||||
private static final int TINYINT_MAX = 127;
|
||||
|
||||
private static final int RANDOM_DATE_MAX = 30;
|
||||
|
||||
private static final int RANDOM_COLLECTION_LENGTH = 5;
|
||||
|
||||
private static final PodamFactory PODAM_FACTORY = new PodamFactoryImpl();
|
||||
|
||||
static {
|
||||
// 字符串
|
||||
PODAM_FACTORY.getStrategy().addOrReplaceTypeManufacturer(String.class,
|
||||
(dataProviderStrategy, attributeMetadata, map) -> randomString());
|
||||
// Integer
|
||||
PODAM_FACTORY.getStrategy().addOrReplaceTypeManufacturer(Integer.class, (dataProviderStrategy, attributeMetadata, map) -> {
|
||||
// 如果是 status 的字段,返回 0 或 1
|
||||
if ("status".equals(attributeMetadata.getAttributeName())) {
|
||||
return RandomUtil.randomEle(CommonStatusEnum.values()).getStatus();
|
||||
}
|
||||
// 如果是 type、status 结尾的字段,返回 tinyint 范围
|
||||
if (StrUtil.endWithAnyIgnoreCase(attributeMetadata.getAttributeName(),
|
||||
"type", "status", "category", "scope", "result")) {
|
||||
return RandomUtil.randomInt(0, TINYINT_MAX + 1);
|
||||
}
|
||||
return RandomUtil.randomInt();
|
||||
});
|
||||
// LocalDateTime
|
||||
PODAM_FACTORY.getStrategy().addOrReplaceTypeManufacturer(LocalDateTime.class,
|
||||
(dataProviderStrategy, attributeMetadata, map) -> randomLocalDateTime());
|
||||
// Boolean
|
||||
PODAM_FACTORY.getStrategy().addOrReplaceTypeManufacturer(Boolean.class, (dataProviderStrategy, attributeMetadata, map) -> {
|
||||
// 如果是 deleted 的字段,返回非删除
|
||||
if ("deleted".equals(attributeMetadata.getAttributeName())) {
|
||||
return false;
|
||||
}
|
||||
return RandomUtil.randomBoolean();
|
||||
});
|
||||
}
|
||||
|
||||
public static String randomString() {
|
||||
return RandomUtil.randomString(RANDOM_STRING_LENGTH);
|
||||
}
|
||||
|
||||
public static Long randomLongId() {
|
||||
return RandomUtil.randomLong(0, Long.MAX_VALUE);
|
||||
}
|
||||
|
||||
public static Integer randomInteger() {
|
||||
return RandomUtil.randomInt(0, Integer.MAX_VALUE);
|
||||
}
|
||||
|
||||
public static Date randomDate() {
|
||||
return RandomUtil.randomDay(0, RANDOM_DATE_MAX);
|
||||
}
|
||||
|
||||
public static LocalDateTime randomLocalDateTime() {
|
||||
// 设置 Nano 为零的原因,避免 MySQL、H2 存储不到时间戳
|
||||
return LocalDateTimeUtil.of(randomDate()).withNano(0);
|
||||
}
|
||||
|
||||
public static Short randomShort() {
|
||||
return (short) RandomUtil.randomInt(0, Short.MAX_VALUE);
|
||||
}
|
||||
|
||||
public static <T> Set<T> randomSet(Class<T> clazz) {
|
||||
return Stream.iterate(0, i -> i).limit(RandomUtil.randomInt(1, RANDOM_COLLECTION_LENGTH))
|
||||
.map(i -> randomPojo(clazz)).collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
public static Integer randomCommonStatus() {
|
||||
return RandomUtil.randomEle(CommonStatusEnum.values()).getStatus();
|
||||
}
|
||||
|
||||
public static String randomEmail() {
|
||||
return randomString() + "@qq.com";
|
||||
}
|
||||
|
||||
public static String randomURL() {
|
||||
return "https://www.cf.com/" + randomString();
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
public static <T> T randomPojo(Class<T> clazz, Consumer<T>... consumers) {
|
||||
T pojo = PODAM_FACTORY.manufacturePojo(clazz);
|
||||
// 非空时,回调逻辑。通过它,可以实现 Pojo 的进一步处理
|
||||
if (ArrayUtil.isNotEmpty(consumers)) {
|
||||
Arrays.stream(consumers).forEach(consumer -> consumer.accept(pojo));
|
||||
}
|
||||
return pojo;
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
public static <T> T randomPojo(Class<T> clazz, Type type, Consumer<T>... consumers) {
|
||||
T pojo = PODAM_FACTORY.manufacturePojo(clazz, type);
|
||||
// 非空时,回调逻辑。通过它,可以实现 Pojo 的进一步处理
|
||||
if (ArrayUtil.isNotEmpty(consumers)) {
|
||||
Arrays.stream(consumers).forEach(consumer -> consumer.accept(pojo));
|
||||
}
|
||||
return pojo;
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
public static <T> List<T> randomPojoList(Class<T> clazz, Consumer<T>... consumers) {
|
||||
int size = RandomUtil.randomInt(1, RANDOM_COLLECTION_LENGTH);
|
||||
return Stream.iterate(0, i -> i).limit(size).map(o -> randomPojo(clazz, consumers))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
}
|
||||
+18
-8
@@ -1,11 +1,13 @@
|
||||
package com.cf.imes.module.executor.util.deviseData;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.Dictionary;
|
||||
|
||||
/**
|
||||
@@ -18,12 +20,20 @@ import java.util.Dictionary;
|
||||
@Accessors(chain = false) // 设置 chain = false,避免生产单导入有问
|
||||
public class IOriginModelingData {
|
||||
|
||||
private IContourData outline; //轮郭
|
||||
private Dictionary<String, IContourData> holes; //孔轮廓
|
||||
private Integer thickness; //厚度
|
||||
private Integer dir; // 0正面、1反面、2侧面
|
||||
private Integer knifeRadius; //刀半径
|
||||
private Integer addLen; //槽加长
|
||||
private Integer addWidth; //槽加宽
|
||||
private Integer addDepth; //槽加深
|
||||
@Schema(description = "轮郭")
|
||||
private IContourData outline;
|
||||
@Schema(description = "孔轮廓")
|
||||
private Dictionary<String, IContourData> holes;
|
||||
@Schema(description ="厚度" )
|
||||
private Integer thickness;
|
||||
@Schema(description = "0正面、1反面、2侧面")
|
||||
private Integer dir;
|
||||
@Schema(description = "刀半径")
|
||||
private Integer knifeRadius;
|
||||
@Schema(description = "槽加长")
|
||||
private Integer addLen;
|
||||
@Schema(description = "槽加宽")
|
||||
private Integer addWidth;
|
||||
@Schema(description = "槽加深")
|
||||
private Integer addDepth;
|
||||
}
|
||||
|
||||
+4
@@ -12,4 +12,8 @@
|
||||
${ew.customSqlSegment}
|
||||
group by orderId, p.id
|
||||
</select>
|
||||
|
||||
<select id="selectDynamicSqlString" resultType="java.util.Map">
|
||||
${sqlStr}
|
||||
</select>
|
||||
</mapper>
|
||||
+53
-25
@@ -20,25 +20,26 @@
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="optimizeMap" type="com.cf.imes.module.executor.controller.admin.plan.vo.OptimizeParamRespVO">
|
||||
<result column="planId" property="planId"/>
|
||||
<result column="plan_id" property="planId"/>
|
||||
<result column="plan_no" property="planNo"/>
|
||||
<result column="sort" property="sort"/>
|
||||
<result column="type" property="type"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="is_pay" property="isPay"/>
|
||||
<result column="op_type" property="type"/>
|
||||
<result column="op_status" property="status"/>
|
||||
<result column="machine_id" property="machineId"/>
|
||||
<result column="plan_time" property="planTime"/>
|
||||
<result column="remark" property="remark"/>
|
||||
<collection property="goodsList" javaType="java.util.List" ofType="com.cf.imes.module.executor.controller.admin.goods.vo.GoodsRespVO"/>
|
||||
<collection property="orderList" javaType="java.util.List" ofType="com.cf.imes.module.executor.controller.admin.plan.vo.OrderResp"/>
|
||||
<result column="op_remark" property="remark"/>
|
||||
<result column="produce_time" property="produceTime" />
|
||||
<result column="operator" property="operator"/>
|
||||
<collection property="plateList" javaType="java.util.List" ofType="com.cf.imes.module.executor.controller.admin.plate.vo.PlateRespVO" >
|
||||
<result column="plateId" property="id"/>
|
||||
<result column="plan_no" property="plateNo"/>
|
||||
<result column="type" property="type"/>
|
||||
<result column="goods_id" property="goodsId"/>
|
||||
<result column="width" property="width"/>
|
||||
<result column="height" property="height"/>
|
||||
<result column="thickness" property="thickness"/>
|
||||
<result column="opl_order_id" property="orderId"/>
|
||||
<result column="opl_type" property="type"/>
|
||||
<result column="opl_name" property="name"/>
|
||||
<result column="opl_goods_id" property="goodsId"/>
|
||||
<result column="opl_width" property="width"/>
|
||||
<result column="opl_height" property="height"/>
|
||||
<result column="opl_thickness" property="thickness"/>
|
||||
<result column="split_width" property="splitWidth"/>
|
||||
<result column="split_height" property="splitHeight"/>
|
||||
<result column="split_thickness" property="splitThickness"/>
|
||||
@@ -54,21 +55,58 @@
|
||||
<result property="frontHoleCount" column="front_hole_count"/>
|
||||
<result property="backHoleCount" column="back_hole_count"/>
|
||||
<result property="sideHoleCount" column="side_hole_count"/>
|
||||
<result property="frontModelCount" column="front_model_count"/>
|
||||
<result property="backModelCount" column="back_model_count"/>
|
||||
<result property="isDoor" column="is_door"/>
|
||||
<result property="openDoorType" column="open_door_type"/>
|
||||
<result property="offsetX" column="offset_x"/>
|
||||
<result property="offsetY" column="offset_y"/>
|
||||
<result property="isArcAcross" column="is_arc_across"/>
|
||||
<result property="moduleTypeId" column="module_typeId"/>
|
||||
<result property="filterType" column="filter_type"/>
|
||||
<result property="moduleTypeId" column="module_type_id"/>
|
||||
<result property="filterType" column="filter_type"/>
|
||||
<result property="isCancel" column="is_cancel"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="remark" column="opl_remark"/>
|
||||
<result property="createTime" column="opl_create_time"/>
|
||||
</collection>
|
||||
<collection property="orderList" javaType="java.util.List" ofType="com.cf.imes.module.executor.controller.admin.plan.vo.OrderResp">
|
||||
<result property="orderId" column="o_id"/>
|
||||
<result property="type" column="o_type"/>
|
||||
<result property="status" column="o_status"/>
|
||||
<result property="dataType" column="data_type"/>
|
||||
<result property="customOrderNo" column="custom_order_no"/>
|
||||
<result column="customer" property="customer"/>
|
||||
<result column="address" property="address"/>
|
||||
<result column="phone_number" property="phoneNumber"/>
|
||||
<result column="dealer" property="dealer"/>
|
||||
<result column="dealer_phone_number" property="dealerPhoneNumber"/>
|
||||
<result column="salesman" property="salesman"/>
|
||||
<result column="splitter" property="splitter"/>
|
||||
<result column="o_status" property="status"/>
|
||||
<result column="delivery_date" property="deliveryDate"/>
|
||||
<result column="o_remark" property="remark"/>
|
||||
</collection>
|
||||
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="getOptimizePlanParam" resultMap="optimizeMap">
|
||||
select op.id as plan_id, op.plan_no, op.type as op_type, op.status as op_status, op.machine_id, op.plan_time, op.produce_time, op.remark as op_remark, op.operator,
|
||||
oi.order_id, opl.id as plateId, opl.order_id opl_order_id, opl.name opl_name, opl.plate_no, opl.type as opl_type, opl.goods_id as opl_goods_id, opl.width opl_width,
|
||||
opl.height opl_height, opl.thickness as opl_thickness, opl.split_width, opl.split_height, opl.split_thickness, opl.seal_left, opl.seal_right,
|
||||
opl.seal_up, opl.seal_down, opl.area, opl.texture, opl.hole_face, opl.hole_arrange, opl.unregular_point_count, opl.front_hole_count,
|
||||
opl.back_hole_count, opl.side_hole_count, opl.front_model_count, opl.back_model_count, opl.is_door, opl.open_door_type, opl.offset_x, opl.offset_y,
|
||||
opl.is_arc_across, opl.module_type_id, opl.filter_type, opl.remark opl_remark, opl.is_cancel, opl.create_time as opl_create_time,
|
||||
o.id as o_id, o.type as o_type, o.data_type, o.status o_status, o.custom_order_no, o.customer,
|
||||
o.address, o.phone_number, o.dealer, o.dealer_phone_number, o.salesman, o.splitter, o.remark as o_remark, o.delivery_date
|
||||
from order_plan op
|
||||
left JOIN order_plan_item opi on op.id = opi.plan_id
|
||||
left join order_item oi on opi.item_id = oi.id
|
||||
left join order_plate opl on oi.plate_id = opl.id
|
||||
left join `order` o on oi.order_id = o.id
|
||||
where op.id = #{planId}
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectPlateListByPlanId"
|
||||
resultType="com.cf.imes.module.executor.controller.admin.plan.vo.PlateOptimize">
|
||||
select a.goods_id, a.goods_name, a.material, a.color, a.width, a.height, a.thickness, count(b.id) as plateNum, d.*
|
||||
@@ -81,14 +119,4 @@
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getOptimizePlanParam" resultMap="optimizeMap">
|
||||
select op.*, oi.order_id, opl.id as plateId, opl.*, og.*
|
||||
from order_plan op
|
||||
left JOIN order_plan_item opi on op.id = opi.plan_id
|
||||
left join order_item oi on opi.item_id = oi.id
|
||||
left join order_plate opl on oi.plate_id = opl.id
|
||||
left join order_goods og on opl.goods_id = og.goods_id
|
||||
where op.id = #{planId}
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.cf.imes.module.system.api.dataSource;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.module.system.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 晨丰:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 数据源")
|
||||
public interface DataSourceApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/dataSource";
|
||||
|
||||
@GetMapping(PREFIX + "/getSqlById")
|
||||
@Operation(summary = "获得数据源sql")
|
||||
CommonResult<String> getSqlById(@RequestParam(value = "id") Long id);
|
||||
}
|
||||
+3
@@ -183,10 +183,13 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode MACHINE_NOT_EXISTS = new ErrorCode(1_002_029_000, "机台不存在");
|
||||
ErrorCode MACHINE_TEMPLATE_NOT_EXISTS = new ErrorCode(1_002_029_001, "机台模板不存在");
|
||||
ErrorCode DEFAULT_TEMPLATE_COUNT = new ErrorCode(1_002_029_002, "默认模板数量异常");
|
||||
ErrorCode DEFAULT_TEMPLATE_NOT_EXISTS = new ErrorCode(1_002_029_003, "该类型机台默认模板不存在");
|
||||
|
||||
// ========== 标签模板 1-002-300-000 ==========
|
||||
ErrorCode LABEL_TEMPLATE_NOT_EXISTS = new ErrorCode(1_002_300_000, "标签模板不存在");
|
||||
ErrorCode LABEL_NOT_EXISTS = new ErrorCode(1_002_300_001, "标签不存在");
|
||||
ErrorCode DEFAULT_LABEL_NOT_EXISTS = new ErrorCode(1_002_300_002, "该类型标签默认模板不存在");
|
||||
ErrorCode MACHINE_USE_LABEL = new ErrorCode(1_002_300_003, "无法删除已有机台使用标签");
|
||||
|
||||
// ========== 系统数据源 1_002_301_000 ==========
|
||||
ErrorCode DATA_SOURCE_NOT_EXISTS = new ErrorCode(1_002_301_000, "系统数据源不存在");
|
||||
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.cf.imes.module.system.api.datasource;
|
||||
|
||||
import com.cf.imes.framework.common.exception.ErrorCode;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.module.system.api.dataSource.DataSourceApi;
|
||||
import com.cf.imes.module.system.dal.dataobject.datasource.DataSourceDO;
|
||||
import com.cf.imes.module.system.dal.mysql.datasource.DataSourceMapper;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
@RestController
|
||||
public class DataSourceApiImpl implements DataSourceApi {
|
||||
|
||||
@Resource
|
||||
private DataSourceMapper dataSourceMapper;
|
||||
|
||||
@Override
|
||||
public CommonResult<String> getSqlById(Long id) {
|
||||
DataSourceDO dataSourceDO = dataSourceMapper.selectById(id);
|
||||
if(Objects.isNull(dataSourceDO)) {
|
||||
throw exception(new ErrorCode(2133,"数据源不存在"));
|
||||
}
|
||||
return CommonResult.success(dataSourceDO.getSqlStr()) ;
|
||||
}
|
||||
}
|
||||
+7
-6
@@ -39,7 +39,7 @@ public class DataSourceController {
|
||||
@Resource
|
||||
private DataSourceService dataSourceService;
|
||||
|
||||
@PostMapping("/create")
|
||||
/* @PostMapping("/create")
|
||||
@Operation(summary = "创建系统数据源")
|
||||
@PreAuthorize("@ss.hasPermission('system:data-source:create')")
|
||||
public CommonResult<Long> createDataSource(@Valid @RequestBody DataSourceSaveReqVO createReqVO) {
|
||||
@@ -78,15 +78,16 @@ public class DataSourceController {
|
||||
public CommonResult<PageResult<DataSourceRespVO>> getDataSourcePage(@Valid DataSourcePageReqVO pageReqVO) {
|
||||
PageResult<DataSourceDO> pageResult = dataSourceService.getDataSourcePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DataSourceRespVO.class));
|
||||
}
|
||||
}*/
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得系统数据源列表")
|
||||
@Parameter(name = "type", description = "类型", required = false)
|
||||
@PreAuthorize("@ss.hasPermission('system:data-source:query')")
|
||||
public CommonResult<List<DataSourceRespVO>> list( @RequestParam(value = "type", required = false) Integer type) {
|
||||
List<DataSourceDO> list = dataSourceService.list(type);
|
||||
return success(BeanUtils.toBean(list, DataSourceRespVO.class));
|
||||
public CommonResult<List<DataSourceRespVO>> list( ) {
|
||||
return success(dataSourceService.list());
|
||||
|
||||
/*List<DataSourceDO> list =
|
||||
return success(BeanUtils.toBean(list, DataSourceRespVO.class));*/
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ public class DataSourcePageReqVO extends PageParam {
|
||||
private String name;
|
||||
|
||||
@Schema(description = "sql")
|
||||
private String sql;
|
||||
private String sqlStr;
|
||||
|
||||
@Schema(description = "数据源类型", example = "2")
|
||||
private Integer type;
|
||||
|
||||
+5
-1
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.system.controller.admin.datasource.vo;
|
||||
|
||||
import com.cf.imes.module.system.dal.dataobject.datasource.DataSourceFiledDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
@@ -23,7 +24,7 @@ public class DataSourceRespVO {
|
||||
|
||||
@Schema(description = "sql", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("sql")
|
||||
private String sql;
|
||||
private String sqlStr;
|
||||
|
||||
@Schema(description = "数据源类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("数据源类型")
|
||||
@@ -33,4 +34,7 @@ public class DataSourceRespVO {
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "字段列表")
|
||||
private List<DataSourceFiledDO> filedList;
|
||||
|
||||
}
|
||||
+7
-13
@@ -6,12 +6,10 @@ import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.framework.excel.core.util.ExcelUtils;
|
||||
import com.cf.imes.framework.operatelog.core.annotations.OperateLog;
|
||||
import com.cf.imes.module.system.controller.admin.label.vo.LabelElementRespVO;
|
||||
import com.cf.imes.module.system.controller.admin.label.vo.LabelPageReqVO;
|
||||
import com.cf.imes.module.system.controller.admin.label.vo.LabelRespVO;
|
||||
import com.cf.imes.module.system.controller.admin.label.vo.LabelSaveReqVO;
|
||||
import com.cf.imes.module.system.dal.dataobject.lable.LabelDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.lable.LabelElementDO;
|
||||
import com.cf.imes.module.system.service.lable.LabelService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
@@ -40,6 +38,7 @@ public class LabelController {
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建标签")
|
||||
@PreAuthorize("@ss.hasPermission('system:label:create')")
|
||||
@OperateLog(enable = false)
|
||||
public CommonResult<Long> createLabel(@Valid @RequestBody LabelSaveReqVO createReqVO) {
|
||||
return success(labelService.createLabel(createReqVO));
|
||||
}
|
||||
@@ -47,6 +46,7 @@ public class LabelController {
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新标签")
|
||||
@PreAuthorize("@ss.hasPermission('system:label:update')")
|
||||
@OperateLog(enable = false)
|
||||
public CommonResult<Boolean> updateLabel(@Valid @RequestBody LabelSaveReqVO updateReqVO) {
|
||||
labelService.updateLabel(updateReqVO);
|
||||
return success(true);
|
||||
@@ -65,6 +65,7 @@ public class LabelController {
|
||||
@Operation(summary = "获得标签")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:label:query')")
|
||||
@OperateLog(enable = false)
|
||||
public CommonResult<LabelRespVO> getLabel(@RequestParam("id") Long id) {
|
||||
return success(labelService.getLabel(id));
|
||||
}
|
||||
@@ -72,6 +73,7 @@ public class LabelController {
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得标签分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:label:query')")
|
||||
@OperateLog(enable = false)
|
||||
public CommonResult<PageResult<LabelRespVO>> getLabelPage(@Valid LabelPageReqVO pageReqVO) {
|
||||
PageResult<LabelDO> pageResult = labelService.getLabelPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, LabelRespVO.class));
|
||||
@@ -81,13 +83,15 @@ public class LabelController {
|
||||
@Operation(summary = "获得标签列表")
|
||||
@Parameter(name = "type", description = "类型", required = false, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:label:query')")
|
||||
public CommonResult<List<LabelRespVO>> getLabel(@RequestParam("type") String type) {
|
||||
@OperateLog(enable = false)
|
||||
public CommonResult<List<LabelRespVO>> getList(@RequestParam("type") String type) {
|
||||
return success(BeanUtils.toBean(labelService.list(type), LabelRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/group-list")
|
||||
@Operation(summary = "获得分组标签列表")
|
||||
@PreAuthorize("@ss.hasPermission('system:label:query')")
|
||||
@OperateLog(enable = false)
|
||||
public CommonResult<Map<String, List<LabelRespVO>>> getGroupList() {
|
||||
return success(labelService.getGroupList());
|
||||
}
|
||||
@@ -105,14 +109,4 @@ public class LabelController {
|
||||
BeanUtils.toBean(list, LabelRespVO.class));
|
||||
}
|
||||
|
||||
// ==================== 子表(标签元素) ====================
|
||||
|
||||
@GetMapping("/label-element/list-by-label-id")
|
||||
@Operation(summary = "获得标签元素列表")
|
||||
@Parameter(name = "labelId", description = "标签id")
|
||||
@PreAuthorize("@ss.hasPermission('system:label:query')")
|
||||
public CommonResult<List<LabelElementRespVO>> getLabelElementListByLabelId(@RequestParam("labelId") Long labelId) {
|
||||
return success(labelService.getLabelElementListByLabelId(labelId));
|
||||
}
|
||||
|
||||
}
|
||||
+10
-1
@@ -1,10 +1,17 @@
|
||||
package com.cf.imes.module.system.controller.admin.label.vo;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cf.imes.module.system.dal.dataobject.labelelementproperty.LabelElementPropertyDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class LabelElementRespVO {
|
||||
|
||||
@Schema(description = "主键")
|
||||
@@ -17,6 +24,8 @@ public class LabelElementRespVO {
|
||||
private String type;
|
||||
@Schema(description = "数据源id")
|
||||
private Long sourceId;
|
||||
/*@Schema(description = "标签元素属性")
|
||||
private LabelElementPropertyDO propertyDO;*/
|
||||
@Schema(description = "标签元素属性")
|
||||
private LabelElementPropertyDO propertyDO;
|
||||
private JSONObject propertyDO;
|
||||
}
|
||||
|
||||
+4
-1
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.system.controller.admin.label.vo;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cf.imes.module.system.dal.dataobject.labelelementproperty.LabelElementPropertyDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@@ -19,6 +20,8 @@ public class LabelElementSaveReqVO {
|
||||
private String type;
|
||||
@Schema(description = "数据源id")
|
||||
private Long sourceId;
|
||||
/*@Schema(description = "标签元素属性")
|
||||
private LabelElementPropertyDO propertyDO;*/
|
||||
@Schema(description = "标签元素属性")
|
||||
private LabelElementPropertyDO propertyDO;
|
||||
private JSONObject propertyDO;
|
||||
}
|
||||
|
||||
+5
-2
@@ -46,7 +46,10 @@ public class LabelRespVO {
|
||||
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "标签元素模板列表")
|
||||
private List<LabelElementRespVO> labelElements;
|
||||
/*@Schema(description = "标签元素模板列表")
|
||||
private List<LabelElementRespVO> labelElements;*/
|
||||
|
||||
@Schema(description = "配置")
|
||||
private String template;
|
||||
|
||||
}
|
||||
+6
-2
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.system.controller.admin.label.vo;
|
||||
|
||||
import co.elastic.clients.elasticsearch.watcher.DeactivateWatchRequest;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -34,7 +35,10 @@ public class LabelSaveReqVO {
|
||||
@NotNull(message = "高度不能为空")
|
||||
private Integer height;
|
||||
|
||||
@Schema(description = "标签元素模板列表")
|
||||
private List<LabelElementSaveReqVO> elements;
|
||||
/*@Schema(description = "标签元素模板列表")
|
||||
private List<LabelElementSaveReqVO> elements;*/
|
||||
|
||||
@Schema(description = "配置")
|
||||
private String template;
|
||||
|
||||
}
|
||||
+14
-15
@@ -1,27 +1,21 @@
|
||||
package com.cf.imes.module.system.controller.admin.labeltemplate;
|
||||
|
||||
import com.cf.imes.module.system.dal.dataobject.labeltemplate.LabelElementTemplateDO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.cf.imes.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.cf.imes.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.cf.imes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.cf.imes.module.system.controller.admin.labeltemplate.vo.*;
|
||||
import com.cf.imes.module.system.dal.dataobject.labeltemplate.LabelTemplateDO;
|
||||
import com.cf.imes.module.system.service.labeltemplate.LabelTemplateService;
|
||||
@@ -41,6 +35,7 @@ public class LabelTemplateController {
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建标签模板")
|
||||
@PreAuthorize("@ss.hasPermission('system:label-template:create')")
|
||||
@OperateLog(enable = false)
|
||||
public CommonResult<Long> createLabelTemplate(@Valid @RequestBody LabelTemplateSaveReqVO createReqVO) {
|
||||
return success(labelTemplateService.createLabelTemplate(createReqVO));
|
||||
}
|
||||
@@ -48,6 +43,7 @@ public class LabelTemplateController {
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新标签模板")
|
||||
@PreAuthorize("@ss.hasPermission('system:label-template:update')")
|
||||
@OperateLog(enable = false)
|
||||
public CommonResult<Boolean> updateLabelTemplate(@Valid @RequestBody LabelTemplateSaveReqVO updateReqVO) {
|
||||
labelTemplateService.updateLabelTemplate(updateReqVO);
|
||||
return success(true);
|
||||
@@ -66,6 +62,7 @@ public class LabelTemplateController {
|
||||
@Operation(summary = "获得标签模板")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:label-template:query')")
|
||||
@OperateLog(enable = false)
|
||||
public CommonResult<LabelTemplateRespVO> getLabelTemplate(@RequestParam("id") Long id) {
|
||||
return success(labelTemplateService.getLabelTemplate(id));
|
||||
}
|
||||
@@ -73,6 +70,7 @@ public class LabelTemplateController {
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得标签模板分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:label-template:query')")
|
||||
@OperateLog(enable = false)
|
||||
public CommonResult<PageResult<LabelTemplateRespVO>> getLabelTemplatePage(@Valid LabelTemplatePageReqVO pageReqVO) {
|
||||
PageResult<LabelTemplateDO> pageResult = labelTemplateService.getLabelTemplatePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, LabelTemplateRespVO.class));
|
||||
@@ -81,10 +79,20 @@ public class LabelTemplateController {
|
||||
@GetMapping("/group-list")
|
||||
@Operation(summary = "获得分组标签模板列表")
|
||||
@PreAuthorize("@ss.hasPermission('system:label-template:query')")
|
||||
@OperateLog(enable = false)
|
||||
public CommonResult<Map<String, List<LabelTemplateRespVO>>> getGroupList() {
|
||||
return success(labelTemplateService.getGroupList());
|
||||
}
|
||||
|
||||
@GetMapping("/getDefault")
|
||||
@Operation(summary = "获得默认标签模板")
|
||||
@Parameter(name = "type", description = "标签类型", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:label-template:query')")
|
||||
@OperateLog(enable = false)
|
||||
public CommonResult<LabelTemplateRespVO> getDefaultLabelTemplate(@RequestParam("type") String type) {
|
||||
return success(labelTemplateService.getDefaultLabelTemplate(type));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出标签模板 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('system:label-template:export')")
|
||||
@@ -98,14 +106,5 @@ public class LabelTemplateController {
|
||||
BeanUtils.toBean(list, LabelTemplateRespVO.class));
|
||||
}
|
||||
|
||||
// ==================== 子表(标签元素模板) ====================
|
||||
|
||||
@GetMapping("/label-element-template/list-by-label-template-id")
|
||||
@Operation(summary = "获得标签元素模板列表")
|
||||
@Parameter(name = "labelTemplateId", description = "标签模板id")
|
||||
@PreAuthorize("@ss.hasPermission('system:label-template:query')")
|
||||
public CommonResult<List<LabelElementTemplateRespVO>> getLabelElementTemplateListByLabelTemplateId(@RequestParam("labelTemplateId") Long labelTemplateId) {
|
||||
return success(labelTemplateService.getLabelElementTemplateListByLabelTemplateId(labelTemplateId));
|
||||
}
|
||||
|
||||
}
|
||||
+14
-1
@@ -1,10 +1,19 @@
|
||||
package com.cf.imes.module.system.controller.admin.labeltemplate.vo;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cf.imes.module.system.dal.dataobject.labelelementproperty.LabelElementPropertyDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class LabelElementTemplateRespVO {
|
||||
|
||||
@Schema(description = "主键")
|
||||
@@ -17,6 +26,10 @@ public class LabelElementTemplateRespVO {
|
||||
private String type;
|
||||
@Schema(description = "数据源id")
|
||||
private Long sourceId;
|
||||
/*@Schema(description = "标签元素属性")
|
||||
private LabelElementPropertyDO propertyDO;*/
|
||||
/*@Schema(description = "标签元素属性")
|
||||
private Map<String,Object> propertyDO;*/
|
||||
@Schema(description = "标签元素属性")
|
||||
private LabelElementPropertyDO propertyDO;
|
||||
private JSONObject propertyDO;
|
||||
}
|
||||
|
||||
+9
-1
@@ -1,9 +1,12 @@
|
||||
package com.cf.imes.module.system.controller.admin.labeltemplate.vo;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cf.imes.module.system.dal.dataobject.labelelementproperty.LabelElementPropertyDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author there
|
||||
*/
|
||||
@@ -19,6 +22,11 @@ public class LabelElementTemplateSaveReqVO {
|
||||
private String type;
|
||||
@Schema(description = "数据源id")
|
||||
private Long sourceId;
|
||||
/*@Schema(description = "标签元素属性")
|
||||
private LabelElementPropertyDO propertyDO;*/
|
||||
/*@Schema(description = "标签元素属性")
|
||||
|
||||
private Map<String, Object> propertyDO;*/
|
||||
@Schema(description = "标签元素属性")
|
||||
private LabelElementPropertyDO propertyDO;
|
||||
private JSONObject propertyDO;
|
||||
}
|
||||
|
||||
+5
-6
@@ -1,12 +1,9 @@
|
||||
package com.cf.imes.module.system.controller.admin.labeltemplate.vo;
|
||||
|
||||
import com.cf.imes.module.system.dal.dataobject.labeltemplate.LabelElementTemplateDO;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@@ -47,7 +44,9 @@ public class LabelTemplateRespVO {
|
||||
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "标签元素模板列表")
|
||||
private List<LabelElementTemplateRespVO> labelElementTemplates;
|
||||
/*@Schema(description = "标签元素模板列表")
|
||||
private List<LabelElementTemplateRespVO> labelElementTemplates;*/
|
||||
@Schema(description = "配置")
|
||||
private String template;
|
||||
|
||||
}
|
||||
+4
-4
@@ -1,11 +1,9 @@
|
||||
package com.cf.imes.module.system.controller.admin.labeltemplate.vo;
|
||||
|
||||
import com.cf.imes.module.system.dal.dataobject.labeltemplate.LabelElementTemplateDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.*;
|
||||
|
||||
@Schema(description = "管理后台 - 标签模板新增/修改 Request VO")
|
||||
@Data
|
||||
@@ -34,7 +32,9 @@ public class LabelTemplateSaveReqVO {
|
||||
@NotNull(message = "高度不能为空")
|
||||
private Integer height;
|
||||
|
||||
@Schema(description = "标签元素模板列表")
|
||||
private List<LabelElementTemplateSaveReqVO> elements;
|
||||
/*@Schema(description = "标签元素模板列表")
|
||||
private List<LabelElementTemplateSaveReqVO> elements;*/
|
||||
@Schema(description = "配置")
|
||||
private String template;
|
||||
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.module.system.controller.admin.machine.vo.*;
|
||||
import com.cf.imes.module.system.dal.dataobject.machinetemplate.MachineTemplateDO;
|
||||
import com.cf.imes.module.system.service.machine.MachineTemplateService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@RestController
|
||||
@Tag(name = "机台模板授权")
|
||||
@RequestMapping("/system/machine-template-auth")
|
||||
public class MachineAuthController {
|
||||
|
||||
@Resource
|
||||
private MachineTemplateService machineTemplateService;
|
||||
|
||||
@PostMapping("organ-auth-template")
|
||||
@Operation(summary = "组织模板授权")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
public CommonResult<Boolean> auth(@RequestBody MachineOrgAuthReq vo) {
|
||||
return success(machineTemplateService.auth(vo));
|
||||
}
|
||||
|
||||
@GetMapping("organ-template-page")
|
||||
@Operation(summary = "组织模板授权分页列表")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
public CommonResult<PageResult<OrganTemplateResp>> organTemplatePage(OrganTemplatePage page) {
|
||||
return success(machineTemplateService.organTemplatePage(page));
|
||||
}
|
||||
|
||||
@GetMapping("organ-template-by-organId")
|
||||
@Operation(summary = "根据组织id查询组织模板授权")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
@Parameter(name = "organId", description = "组织id", required = true, example = "1")
|
||||
public CommonResult<OrganTemplateResp> organTemplateByOrganId(@RequestParam Long organId ) {
|
||||
return success(machineTemplateService.organTemplateByOrganId(organId));
|
||||
}
|
||||
|
||||
@GetMapping("page-template-machine-auth")
|
||||
@Operation(summary = "授权机台模板分页")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
public CommonResult<PageResult<TemplateAutoResp>> pageTemplateAuth(MachinePageReqVO pageParam) {
|
||||
PageResult<MachineTemplateDO> page = machineTemplateService.page(pageParam);
|
||||
List<TemplateAutoResp> list = page.getList().stream().map(e->TemplateAutoResp.builder()
|
||||
.id(e.getId())
|
||||
.machineType(e.getMachineType())
|
||||
.templateName(e.getName())
|
||||
.isDefault(e.getIsDefault())
|
||||
.build()
|
||||
).collect(Collectors.toList());
|
||||
|
||||
return success(new PageResult<TemplateAutoResp>(list, page.getTotal()));
|
||||
}
|
||||
}
|
||||
+14
-51
@@ -1,6 +1,7 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine;
|
||||
|
||||
import com.cf.imes.framework.es.core.valid.UpdateGroup;
|
||||
import com.cf.imes.framework.operatelog.core.annotations.OperateLog;
|
||||
import com.cf.imes.module.system.controller.admin.machine.vo.*;
|
||||
import com.cf.imes.module.system.dal.dataobject.machine.MachineDO;
|
||||
import com.cf.imes.module.system.service.machine.MachineService;
|
||||
@@ -36,22 +37,24 @@ public class MachineController {
|
||||
private MachineTemplateService machineTemplateService;
|
||||
|
||||
@PutMapping("/create-cutting")
|
||||
@Operation(summary = "创建开料机台")
|
||||
@Operation(summary = "创建机台")
|
||||
@PreAuthorize("@ss.hasPermission('machine::create')")
|
||||
@OperateLog(logArgs = false)
|
||||
public CommonResult<Long> createCutting(@Valid @RequestBody CuttingSaveReqVO createReqVO) {
|
||||
return success(machineService.createCutting(createReqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/update-cutting")
|
||||
@Operation(summary = "更新开料机台")
|
||||
@Operation(summary = "更新机台")
|
||||
@PreAuthorize("@ss.hasPermission('machine::update')")
|
||||
@OperateLog(logArgs = false)
|
||||
public CommonResult<Boolean> update( @RequestBody @Validated(UpdateGroup.class) CuttingSaveReqVO updateReqVO) {
|
||||
machineService.updateCutting(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-cutting")
|
||||
@Operation(summary = "删除开料机台")
|
||||
@Operation(summary = "删除机台")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('machine::delete')")
|
||||
public CommonResult<Boolean> delete(@RequestParam("id") Long id) {
|
||||
@@ -60,7 +63,7 @@ public class MachineController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/batch-delete-cutting")
|
||||
@Operation(summary = "批量删除开料机台")
|
||||
@Operation(summary = "批量删除机台")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('machine::delete')")
|
||||
public CommonResult<Boolean> batchDeleteCutting(@RequestParam("ids") List<Long> ids) {
|
||||
@@ -69,7 +72,7 @@ public class MachineController {
|
||||
}
|
||||
|
||||
@GetMapping("/get-cutting")
|
||||
@Operation(summary = "获得开料机台")
|
||||
@Operation(summary = "获得机台")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('machine::query')")
|
||||
public CommonResult<CuttingRespVO> get(@RequestParam("id") Long id) {
|
||||
@@ -86,18 +89,19 @@ public class MachineController {
|
||||
}
|
||||
|
||||
@GetMapping("getDefaultCutting")
|
||||
@Operation(summary = "获得默认开料机台模板")
|
||||
@Operation(summary = "获得默认机台模板")
|
||||
@Parameter(name = "machineType", description = "机台类型", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('machine::query')")
|
||||
public CommonResult<CuttingTemplateRespVO> getDefaultCutting() {
|
||||
return success(machineTemplateService.getDefaultCutting());
|
||||
public CommonResult<CuttingRespVO> getDefaultCutting(@RequestParam Integer machineType) {
|
||||
return success(machineTemplateService.getDefaultCutting(machineType));
|
||||
}
|
||||
|
||||
@GetMapping("getDefaultDrill")
|
||||
/* @GetMapping("getDefaultDrill")
|
||||
@Operation(summary = "获得默认钻孔机台模板")
|
||||
@PreAuthorize("@ss.hasPermission('machine::query')")
|
||||
public CommonResult<DrillTemplateRespVO> getDefaultDrill() {
|
||||
return success(machineTemplateService.getDefaultDrill());
|
||||
}
|
||||
}*/
|
||||
|
||||
/*@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出机台 Excel")
|
||||
@@ -112,47 +116,6 @@ public class MachineController {
|
||||
BeanUtils.toBean(list, MachineRespVO.class));
|
||||
}*/
|
||||
|
||||
@PutMapping("/create-drill")
|
||||
@Operation(summary = "创建钻孔机台")
|
||||
@PreAuthorize("@ss.hasPermission('machine::create')")
|
||||
public CommonResult<Long> createDrill(@Valid @RequestBody DrillSaveReqVO createReqVO) {
|
||||
return success(machineService.createDrill(createReqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/update-drill")
|
||||
@Operation(summary = "更新钻孔机台")
|
||||
@PreAuthorize("@ss.hasPermission('machine::update')")
|
||||
public CommonResult<Boolean> updateDrill( @RequestBody @Validated(UpdateGroup.class) DrillSaveReqVO updateReqVO) {
|
||||
machineService.updateDrill(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-drill")
|
||||
@Operation(summary = "删除钻孔机台")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('machine::delete')")
|
||||
public CommonResult<Boolean> deleteDrill(@RequestParam("id") Long id) {
|
||||
machineService.deleteDrill(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/batch-delete-drill")
|
||||
@Operation(summary = "批量删除钻孔机台")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('machine::delete')")
|
||||
public CommonResult<Boolean> batchDeleteDrill(@RequestParam("ids") List<Long> ids) {
|
||||
machineService.batchDeleteDrill(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get-drill")
|
||||
@Operation(summary = "获得钻孔机台")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('machine::query')")
|
||||
public CommonResult<DrillRespVO> getDrill(@RequestParam("id") Long id) {
|
||||
DrillRespVO respVO = machineService.getDrill(id);
|
||||
return success(respVO);
|
||||
}
|
||||
|
||||
@GetMapping("getMachineTree")
|
||||
@Operation(summary = "获得机台树")
|
||||
|
||||
+12
-45
@@ -3,6 +3,8 @@ package com.cf.imes.module.system.controller.admin.machine;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.framework.operatelog.core.annotations.OperateLog;
|
||||
import com.cf.imes.module.system.controller.admin.machine.vo.*;
|
||||
import com.cf.imes.module.system.dal.dataobject.machinetemplate.MachineTemplateDO;
|
||||
import com.cf.imes.module.system.service.machine.MachineTemplateService;
|
||||
@@ -47,82 +49,47 @@ public class MachineTemplateController {
|
||||
return success(machineTemplateService.page(pageParam));
|
||||
}
|
||||
|
||||
@PutMapping("drill-machine")
|
||||
@Operation(summary = "新增钻孔机台模板配置")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::create')")
|
||||
public CommonResult<Long> createDrillTemplate(@RequestBody DrillTemplateSaveReqVO reqVO) {
|
||||
return success(machineTemplateService.createDrillTemplate(reqVO));
|
||||
}
|
||||
|
||||
@PostMapping("drill-machine")
|
||||
@Operation(summary = "修改钻孔机台模板配置")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::update')")
|
||||
public CommonResult<Boolean> updateDrillTemplate(@RequestBody DrillTemplateSaveReqVO reqVO) {
|
||||
return success(machineTemplateService.updateDrillTemplate(reqVO));
|
||||
}
|
||||
|
||||
@GetMapping("drill-machine")
|
||||
@Operation(summary = "获取钻孔机台模板配置")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
public CommonResult<DrillTemplateRespVO> getDrillTemplateById(@RequestParam("id") Long id) {
|
||||
return success(machineTemplateService.getDirllTemplateById(id));
|
||||
}
|
||||
|
||||
@DeleteMapping("drill-machine")
|
||||
@Operation(summary = "删除钻孔机台模板配置")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::delete')")
|
||||
public CommonResult<Boolean> deleteDrillTemplate(@RequestParam("id") Long id) {
|
||||
return success(machineTemplateService.deleteDrillTemplate(id));
|
||||
}
|
||||
|
||||
@DeleteMapping("batch-delete-drill")
|
||||
@Operation(summary = "批量删除钻孔机台模板配置")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::delete')")
|
||||
public CommonResult<Boolean> batchDeleteDrillTemplate(@RequestParam("ids") List<Long> ids) {
|
||||
return success(machineTemplateService.batchDeleteDrillTemplate(ids));
|
||||
}
|
||||
|
||||
@PutMapping("cutting-machine")
|
||||
@Operation(summary = "新增开料机台模板配置")
|
||||
@Operation(summary = "新增机台模板配置")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::create')")
|
||||
@OperateLog(logArgs = false)
|
||||
public CommonResult<Long> createCuttingTemplate(@RequestBody CuttingTemplateSaveReqVO reqVO) {
|
||||
return success(machineTemplateService.createCuttingTemplate(reqVO));
|
||||
}
|
||||
|
||||
@PostMapping("cutting-machine")
|
||||
@Operation(summary = "修改开料机台模板配置")
|
||||
@Operation(summary = "修改机台模板配置")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::update')")
|
||||
@OperateLog(logArgs = false)
|
||||
public CommonResult<Boolean> updateCuttingTemplate(@RequestBody CuttingTemplateSaveReqVO reqVO) {
|
||||
return success(machineTemplateService.updateCuttingTemplate(reqVO));
|
||||
}
|
||||
|
||||
@GetMapping("cutting-machine")
|
||||
@Operation(summary = "获取开料机台模板配置")
|
||||
@Operation(summary = "获取机台模板配置")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
public CommonResult<CuttingTemplateRespVO> getCuttingTemplateById(@RequestParam("id") String id) {
|
||||
return success(machineTemplateService.getCuttingTemplateById(id));
|
||||
}
|
||||
|
||||
@DeleteMapping("cutting-machine")
|
||||
@Operation(summary = "删除开料机台模板配置")
|
||||
@Operation(summary = "删除机台模板配置")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::delete')")
|
||||
public CommonResult<Boolean> deleteCutting(@RequestParam("id") Long id) {
|
||||
return success(machineTemplateService.deleteCuttingTemplate(id));
|
||||
}
|
||||
|
||||
@DeleteMapping("batch-delete-cutting")
|
||||
@Operation(summary = "批量删除开料机台模板配置")
|
||||
@Operation(summary = "批量删除机台模板配置")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::delete')")
|
||||
public CommonResult<Boolean> batchDeleteCutting(@RequestParam("id") List<Long> ids) {
|
||||
return success(machineTemplateService.batchDeleteCuttingTemplate(ids));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("auth-template")
|
||||
@Operation(summary = "用户模板授权")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
public CommonResult<Boolean> auth(@RequestBody MachineAuthVO vo) {
|
||||
return success(machineTemplateService.auth(vo));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class AuthTemplatePage extends PageParam {
|
||||
@Schema(description = "组织id")
|
||||
private Long organId;
|
||||
@Schema(description = "用户昵称")
|
||||
private String nickname;
|
||||
@Schema(description = "机台模板名称")
|
||||
private String templateName;
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
import static com.cf.imes.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class AuthTemplateResp {
|
||||
@Schema(description = "组织id")
|
||||
private Long organId;
|
||||
@Schema(description = "组织名称")
|
||||
private String organName;
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
@Schema(description = "用户昵称")
|
||||
private String nickname;
|
||||
@Schema(description = "更新时间")
|
||||
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
|
||||
private Date updateTime;
|
||||
@Schema(description = "机台模板列表")
|
||||
private List<AutoTemplateVO> authTemplateList;
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class AuthVO {
|
||||
@Schema(description ="加工模式 开料机加工模式 默认true,显示开料机工作模式(是否排钻/造型,sc)配置")
|
||||
private Boolean showPriorFacing;
|
||||
@Schema(description = "双工位")
|
||||
private Boolean showDualWorkstation;
|
||||
@Schema(description = "自动贴标")
|
||||
private Boolean showAutoNotePrinter;
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class AutoTemplateVO {
|
||||
@Schema(description = "机台模板id")
|
||||
private Long templateId;
|
||||
@Schema(description = "机台模板名称")
|
||||
private String templateName;
|
||||
|
||||
@JsonIgnore
|
||||
private Long userId;
|
||||
}
|
||||
+8
-1
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cf.imes.module.system.dal.dataobject.machine.CuttingSettingDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
@@ -10,6 +11,9 @@ import com.alibaba.excel.annotation.*;
|
||||
@Schema(description = "管理后台 - 机台 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CuttingRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "14092")
|
||||
@@ -31,8 +35,11 @@ public class CuttingRespVO {
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/* @Schema(description = "机台配置")
|
||||
private CuttingSettingDO machineSettingDO;*/
|
||||
|
||||
@Schema(description = "机台配置")
|
||||
private CuttingSettingDO machineSettingDO;
|
||||
private JSONObject machineSettingDO;
|
||||
|
||||
|
||||
}
|
||||
+7
-2
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cf.imes.framework.es.core.valid.UpdateGroup;
|
||||
import com.cf.imes.module.system.dal.dataobject.machine.CuttingSettingDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@@ -32,9 +33,13 @@ public class CuttingSaveReqVO {
|
||||
@NotNull(message = "标签id不能空")
|
||||
private Long labelId;
|
||||
|
||||
@Schema(description = "机台配置")
|
||||
/* @Schema(description = "机台配置")
|
||||
@Valid
|
||||
private CuttingSettingDO machineSettingDO;
|
||||
private CuttingSettingDO machineSettingDO;*/
|
||||
|
||||
@Schema(description = "机台配置")
|
||||
private JSONObject machineSettingDO;
|
||||
|
||||
|
||||
/* @Schema(description = "样式配置")
|
||||
@Valid
|
||||
|
||||
+5
-1
@@ -1,6 +1,7 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cf.imes.module.system.dal.dataobject.machinetemplate.CuttingTemplateMachineDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.machinetemplate.DrillTemplateMachineDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@@ -35,6 +36,9 @@ public class CuttingTemplateRespVO {
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/*@Schema(description = "开料机台模板配置")
|
||||
private CuttingTemplateMachineDO cuttingTemplateMachineDO;*/
|
||||
|
||||
@Schema(description = "开料机台模板配置")
|
||||
private CuttingTemplateMachineDO cuttingTemplateMachineDO;
|
||||
private JSONObject cuttingTemplateMachineDO;
|
||||
}
|
||||
|
||||
+6
-1
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cf.imes.framework.es.core.valid.UpdateGroup;
|
||||
import com.cf.imes.module.system.dal.dataobject.machinetemplate.CuttingTemplateMachineDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@@ -29,7 +30,11 @@ public class CuttingTemplateSaveReqVO {
|
||||
@NotNull(message = "标签id不能空")
|
||||
private Long labelId;*/
|
||||
|
||||
/* @Schema(description = "管理理后台 - 开料机台模板新增/修改 Request VO")
|
||||
@NotNull(message = "开料机台配置不能空")
|
||||
private CuttingTemplateMachineDO setting;*/
|
||||
|
||||
@Schema(description = "管理理后台 - 开料机台模板新增/修改 Request VO")
|
||||
@NotNull(message = "开料机台配置不能空")
|
||||
private CuttingTemplateMachineDO setting;
|
||||
private JSONObject setting;
|
||||
}
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class MachineAuth {
|
||||
@Schema(description = "机台模板id")
|
||||
private Long machineId;
|
||||
@Schema(description ="加工模式 开料机加工模式 默认true,显示开料机工作模式(是否排钻/造型,sc)配置")
|
||||
private Boolean showPriorFacing;
|
||||
@Schema(description = "双工位")
|
||||
private Boolean showDualWorkstation;
|
||||
@Schema(description = "自动贴标")
|
||||
private Boolean showAutoNotePrinter;
|
||||
}
|
||||
-1
@@ -14,6 +14,5 @@ public class MachineAuthVO {
|
||||
@NotNull(message = "用户id不能空")
|
||||
private Long userId;
|
||||
|
||||
@NotEmpty(message = "机台配置id不能空")
|
||||
private List<Long> machinesIds;
|
||||
}
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class MachineOrgAuthReq {
|
||||
|
||||
@Schema(description = "组织id")
|
||||
private Long organId;
|
||||
@Schema(description = "权限列表")
|
||||
private List<MachineAuth> machineAuthList;
|
||||
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class OrganTemplatePage extends PageParam {
|
||||
@Schema(description = "组织id")
|
||||
private Long organId;
|
||||
@Schema(description = "机台模板名称")
|
||||
private String templateName;
|
||||
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
import static com.cf.imes.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class OrganTemplateResp {
|
||||
@Schema(description = "组织id")
|
||||
private Long organId;
|
||||
@Schema(description = "组织名称")
|
||||
private String organName;
|
||||
@Schema(description = "更新时间")
|
||||
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
|
||||
private Date updateTime;
|
||||
@Schema(description = "机台模板列表")
|
||||
private List<OrganTemplateVO> authTemplateList;
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class OrganTemplateVO {
|
||||
@Schema(description = "机台模板id")
|
||||
private Long templateId;
|
||||
@Schema(description = "机台模板名称")
|
||||
private String templateName;
|
||||
@Schema(description = "机台模板类型")
|
||||
private Integer machineType;
|
||||
@Schema(description ="加工模式 开料机加工模式 默认true,显示开料机工作模式(是否排钻/造型,sc)配置")
|
||||
private Boolean showPriorFacing;
|
||||
@Schema(description = "双工位")
|
||||
private Boolean showDualWorkstation;
|
||||
@Schema(description = "自动贴标")
|
||||
private Boolean showAutoNotePrinter;
|
||||
|
||||
@JsonIgnore
|
||||
private Long organId;
|
||||
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class TemplateAutoResp {
|
||||
@Schema(description = "机台模板id")
|
||||
private Long id;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "机台模板名称")
|
||||
private String templateName;
|
||||
/**
|
||||
* 1机台设备 2CNC设备
|
||||
*/
|
||||
@Schema(description = "机台模板类别")
|
||||
private Integer machineType;
|
||||
/**
|
||||
* 是否默认模板
|
||||
*/
|
||||
private Boolean isDefault;
|
||||
@Schema(description ="加工模式 开料机加工模式 默认true,显示开料机工作模式(是否排钻/造型,sc)配置")
|
||||
private Boolean showPriorFacing = false;
|
||||
@Schema(description = "双工位")
|
||||
private Boolean showDualWorkstation = false;
|
||||
@Schema(description = "自动贴标")
|
||||
private Boolean showAutoNotePrinter = false;
|
||||
}
|
||||
+11
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.system.controller.admin.organ;
|
||||
|
||||
import com.cf.imes.framework.common.enums.CommonStatusEnum;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
@@ -25,8 +26,10 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
import static com.cf.imes.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static com.cf.imes.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - 组织")
|
||||
@@ -109,4 +112,12 @@ public class OrganController {
|
||||
BeanUtils.toBean(list, OrganRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping({"/list-all-simple", "/simple-list"})
|
||||
@Operation(summary = "获取组织精简信息列表", description = "主要用于前端的下拉选项")
|
||||
@Parameter(name = "name", description = "组织名称", required = false, example = "xxx")
|
||||
public CommonResult<List<OrganSimpleRespVO>> getSimpleOrganList(@RequestParam(required = false, value = "name") String name) {
|
||||
return success(organService.getSimpleOrganList(name));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package com.cf.imes.module.system.convert.machine;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.cf.imes.module.system.controller.admin.machine.vo.CuttingRespVO;
|
||||
import com.cf.imes.module.system.controller.admin.machine.vo.CuttingSaveReqVO;
|
||||
import com.cf.imes.module.system.dal.dataobject.machine.MachineDO;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
public class MachineConvert {
|
||||
|
||||
public static MachineDO convert(CuttingSaveReqVO createReqVO) {
|
||||
return MachineDO.builder()
|
||||
.machineType(createReqVO.getMachineType())
|
||||
.name(createReqVO.getName())
|
||||
.id(createReqVO.getId())
|
||||
.labelId(createReqVO.getLabelId())
|
||||
.setting(createReqVO.getMachineSettingDO().toJSONString())
|
||||
.build();
|
||||
|
||||
}
|
||||
|
||||
public static CuttingRespVO convert(MachineDO machineDO) {
|
||||
return CuttingRespVO.builder()
|
||||
.id(machineDO.getId())
|
||||
.machineSettingDO(JSON.parseObject(machineDO.getSetting()))
|
||||
.createTime(machineDO.getCreateTime())
|
||||
.labelId(machineDO.getLabelId())
|
||||
.name(machineDO.getName())
|
||||
.machineType(machineDO.getMachineType())
|
||||
.labelId(machineDO.getLabelId())
|
||||
.build();
|
||||
|
||||
}
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.cf.imes.module.system.convert.machine;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.cf.imes.module.system.controller.admin.machine.vo.CuttingRespVO;
|
||||
import com.cf.imes.module.system.controller.admin.machine.vo.CuttingTemplateRespVO;
|
||||
import com.cf.imes.module.system.controller.admin.machine.vo.CuttingTemplateSaveReqVO;
|
||||
import com.cf.imes.module.system.dal.dataobject.machinetemplate.MachineTemplateDO;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
public class MachineTemplateConvert {
|
||||
|
||||
public static CuttingRespVO convert(MachineTemplateDO templateDO) {
|
||||
return CuttingRespVO.builder()
|
||||
.labelId(templateDO.getId())
|
||||
.machineType(templateDO.getMachineType())
|
||||
.id(templateDO.getId())
|
||||
.name(templateDO.getName())
|
||||
.createTime(templateDO.getCreateTime())
|
||||
.machineSettingDO(JSON.parseObject(templateDO.getSetting()))
|
||||
.build();
|
||||
}
|
||||
|
||||
public static MachineTemplateDO convert(CuttingTemplateSaveReqVO reqVO) {
|
||||
return MachineTemplateDO.builder()
|
||||
.machineType(reqVO.getMachineType())
|
||||
.id(reqVO.getId())
|
||||
.name(reqVO.getName())
|
||||
.setting(reqVO.getSetting().toJSONString())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static CuttingTemplateRespVO convert1(MachineTemplateDO templateDO) {
|
||||
return CuttingTemplateRespVO.builder()
|
||||
.machineType(templateDO.getMachineType())
|
||||
.id(templateDO.getId())
|
||||
.name(templateDO.getName())
|
||||
.createTime(templateDO.getCreateTime())
|
||||
.cuttingTemplateMachineDO(JSON.parseObject(templateDO.getSetting()))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -34,7 +34,7 @@ public class DataSourceDO extends BaseDO {
|
||||
/**
|
||||
* sql
|
||||
*/
|
||||
private String sql;
|
||||
private String sqlStr;
|
||||
/**
|
||||
* 数据源类型
|
||||
*/
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.cf.imes.module.system.dal.dataobject.datasource;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
@TableName("system_data_source_field")
|
||||
public class DataSourceFiledDO {
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
private Long sourceId;
|
||||
|
||||
private String name;
|
||||
|
||||
private String key;
|
||||
}
|
||||
-47
@@ -1,47 +0,0 @@
|
||||
package com.cf.imes.module.system.dal.dataobject.labeltemplate;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.cf.imes.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 标签元素模板 DO
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@TableName("system_label_element_template")
|
||||
@KeySequence("system_label_element_template_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class LabelElementTemplateDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 注释
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 标签模板id
|
||||
*/
|
||||
private Long labelTemplateId;
|
||||
/**
|
||||
* 标签元素名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 元素类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 数据源id
|
||||
*/
|
||||
private Long sourceId;
|
||||
|
||||
}
|
||||
+8
@@ -47,5 +47,13 @@ public class LabelTemplateDO extends BaseDO {
|
||||
* 高度
|
||||
*/
|
||||
private Integer height;
|
||||
/**
|
||||
* 是否默认
|
||||
*/
|
||||
private Boolean isDefault;
|
||||
/**
|
||||
* 配置
|
||||
*/
|
||||
private String template;
|
||||
|
||||
}
|
||||
+4
@@ -47,5 +47,9 @@ public class LabelDO extends OrganBaseDO {
|
||||
* 高度
|
||||
*/
|
||||
private Integer height;
|
||||
/**
|
||||
* 配置
|
||||
*/
|
||||
private String template;
|
||||
|
||||
}
|
||||
-47
@@ -1,47 +0,0 @@
|
||||
package com.cf.imes.module.system.dal.dataobject.lable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.cf.imes.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.cf.imes.framework.organ.core.db.OrganBaseDO;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* 标签元素模板 DO
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@TableName("system_label_element")
|
||||
@KeySequence("system_label_element_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class LabelElementDO extends OrganBaseDO {
|
||||
|
||||
/**
|
||||
* 注释
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 标签模板id
|
||||
*/
|
||||
private Long labelId;
|
||||
/**
|
||||
* 标签元素名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 元素类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 数据源id
|
||||
*/
|
||||
private Long sourceId;
|
||||
|
||||
}
|
||||
+11
-11
@@ -26,7 +26,7 @@ public class CuttingSettingDO extends ESDocument {
|
||||
@Schema(description = "默认0,工位1原点位置")
|
||||
private Integer originPoIntegerPosition;
|
||||
@Schema(description = "工作原点Z0基准面")
|
||||
private String originZ0Position;
|
||||
private Integer originZ0Position;
|
||||
@Schema(description = "排版基准点")
|
||||
private String layoutBenchmark;
|
||||
@Schema(description = "排版基准点跟随大板定位")
|
||||
@@ -161,10 +161,10 @@ public class CuttingSettingDO extends ESDocument {
|
||||
|
||||
|
||||
//高级设置
|
||||
@Schema(description ="默认true,显示开料机工作模式(是否排钻/造型,sc)配置")
|
||||
@Schema(description ="加工模式 开料机加工模式 默认true,显示开料机工作模式(是否排钻/造型,sc)配置")
|
||||
private Boolean showPriorFacing;
|
||||
@Schema(description = "双工位")
|
||||
private Boolean dualWorkstation;
|
||||
private Boolean showDualWorkstation;
|
||||
@Schema(description = "自动贴标")
|
||||
private Boolean showAutoNotePrinter;
|
||||
@Schema(description = "排版方式")
|
||||
@@ -239,7 +239,7 @@ public class CuttingSettingDO extends ESDocument {
|
||||
|
||||
|
||||
@Schema(description = "默认false,启用自定义板件编号")
|
||||
private Boolean allowBlockNo_Note;
|
||||
private Boolean showAllowBlockNo_Note;
|
||||
@Schema(description = "默认空,机台备注")
|
||||
private String remark;
|
||||
|
||||
@@ -249,17 +249,17 @@ public class CuttingSettingDO extends ESDocument {
|
||||
@Schema(description = "默认{0}_{1}_{2},导出zip文件名")
|
||||
private List<String> exportOrderPathName;
|
||||
@Schema(description = "大板NC正(A)面文件名")
|
||||
private String largePlateNcPositiveFileName;
|
||||
private List<String> largePlateNcPositiveFileName;
|
||||
@Schema(description = "大板NC反(B)面文件名")
|
||||
private String largePlateNcNegativeFileName;
|
||||
private List<String> largePlateNcNegativeFileName;
|
||||
@Schema(description = "小板NC正(A)面文件名")
|
||||
private String smallPlateNcPositiveFileName;
|
||||
private List<String> smallPlateNcPositiveFileName;
|
||||
@Schema(description = "小板NC反(B)面文件名")
|
||||
private String smallPlateNcNegativeFileName;
|
||||
private List<String> smallPlateNcNegativeFileName;
|
||||
@Schema(description = "大板DXF(排版图)文件名")
|
||||
private String largePlateDxfLayoutFileName;
|
||||
private List<String> largePlateDxfLayoutFileName;
|
||||
@Schema(description = "小板DXF(孔槽加工图)文件名")
|
||||
private String smallPlateDxfProcessingFileName;
|
||||
private List<String> smallPlateDxfProcessingFileName;
|
||||
@Schema(description = "导出大板NC反(B)面文件")
|
||||
private String exportLargePlateNcNegativeFile;
|
||||
@Schema(description = "合并大板NC正反(AB)面文件")
|
||||
@@ -553,7 +553,7 @@ public class CuttingSettingDO extends ESDocument {
|
||||
@Schema(description = "轴停止指令")
|
||||
private String axisStopInstruction;
|
||||
@Schema(description = "是否预启动")
|
||||
private String preStartEnabled;
|
||||
private Boolean preStartEnabled;
|
||||
@Schema(description = "高级加工")
|
||||
private Boolean advancedProcessingEnabled;
|
||||
@Schema(description = "集合加工")
|
||||
|
||||
+5
-1
@@ -35,10 +35,14 @@ public class MachineDO extends OrganBaseDO {
|
||||
/**
|
||||
* 1机台设备 2CNC设备
|
||||
*/
|
||||
private Long machineType;
|
||||
private Integer machineType;
|
||||
/**
|
||||
* 标签id
|
||||
*/
|
||||
private Long labelId;
|
||||
/**
|
||||
* 配置
|
||||
*/
|
||||
private String setting;
|
||||
|
||||
}
|
||||
-1
@@ -20,5 +20,4 @@ public class UserMachineDO {
|
||||
private Long id;
|
||||
private Long userId;
|
||||
private Long machineId;
|
||||
private Long organId;
|
||||
}
|
||||
|
||||
+11
-11
@@ -30,7 +30,7 @@ public class CuttingTemplateMachineDO extends ESDocument {
|
||||
@Schema(description = "默认0,工位1原点位置")
|
||||
private Integer originPoIntegerPosition;
|
||||
@Schema(description = "工作原点Z0基准面")
|
||||
private String originZ0Position;
|
||||
private Integer originZ0Position;
|
||||
@Schema(description = "排版基准点")
|
||||
private String layoutBenchmark;
|
||||
@Schema(description = "排版基准点跟随大板定位")
|
||||
@@ -165,10 +165,10 @@ public class CuttingTemplateMachineDO extends ESDocument {
|
||||
|
||||
|
||||
//高级设置
|
||||
@Schema(description ="默认true,显示开料机工作模式(是否排钻/造型,sc)配置")
|
||||
@Schema(description ="加工模式 开料机加工模式 默认true,显示开料机工作模式(是否排钻/造型,sc)配置")
|
||||
private Boolean showPriorFacing;
|
||||
@Schema(description = "双工位")
|
||||
private Boolean dualWorkstation;
|
||||
private Boolean showDualWorkstation;
|
||||
@Schema(description = "自动贴标")
|
||||
private Boolean showAutoNotePrinter;
|
||||
@Schema(description = "排版方式")
|
||||
@@ -243,7 +243,7 @@ public class CuttingTemplateMachineDO extends ESDocument {
|
||||
|
||||
|
||||
@Schema(description = "默认false,启用自定义板件编号")
|
||||
private Boolean allowBlockNo_Note;
|
||||
private Boolean showAllowBlockNo_Note;
|
||||
@Schema(description = "默认空,机台备注")
|
||||
private String remark;
|
||||
|
||||
@@ -253,17 +253,17 @@ public class CuttingTemplateMachineDO extends ESDocument {
|
||||
@Schema(description = "默认{0}_{1}_{2},导出zip文件名")
|
||||
private List<String> exportOrderPathName;
|
||||
@Schema(description = "大板NC正(A)面文件名")
|
||||
private String largePlateNcPositiveFileName;
|
||||
private List<String> largePlateNcPositiveFileName;
|
||||
@Schema(description = "大板NC反(B)面文件名")
|
||||
private String largePlateNcNegativeFileName;
|
||||
private List<String> largePlateNcNegativeFileName;
|
||||
@Schema(description = "小板NC正(A)面文件名")
|
||||
private String smallPlateNcPositiveFileName;
|
||||
private List<String> smallPlateNcPositiveFileName;
|
||||
@Schema(description = "小板NC反(B)面文件名")
|
||||
private String smallPlateNcNegativeFileName;
|
||||
private List<String> smallPlateNcNegativeFileName;
|
||||
@Schema(description = "大板DXF(排版图)文件名")
|
||||
private String largePlateDxfLayoutFileName;
|
||||
private List<String> largePlateDxfLayoutFileName;
|
||||
@Schema(description = "小板DXF(孔槽加工图)文件名")
|
||||
private String smallPlateDxfProcessingFileName;
|
||||
private List<String> smallPlateDxfProcessingFileName;
|
||||
@Schema(description = "导出大板NC反(B)面文件")
|
||||
private String exportLargePlateNcNegativeFile;
|
||||
@Schema(description = "合并大板NC正反(AB)面文件")
|
||||
@@ -557,7 +557,7 @@ public class CuttingTemplateMachineDO extends ESDocument {
|
||||
@Schema(description = "轴停止指令")
|
||||
private String axisStopInstruction;
|
||||
@Schema(description = "是否预启动")
|
||||
private String preStartEnabled;
|
||||
private Boolean preStartEnabled;
|
||||
@Schema(description = "高级加工")
|
||||
private Boolean advancedProcessingEnabled;
|
||||
@Schema(description = "集合加工")
|
||||
|
||||
+4
@@ -32,6 +32,10 @@ public class MachineTemplateDO extends BaseDO {
|
||||
* 是否默认模板
|
||||
*/
|
||||
private Boolean isDefault;
|
||||
/**
|
||||
* 机台模板配置
|
||||
*/
|
||||
private String setting;
|
||||
|
||||
/**
|
||||
* 标签id
|
||||
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package com.cf.imes.module.system.dal.dataobject.machinetemplate;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
@TableName("system_organ_machine")
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class OrganMachineDO {
|
||||
@TableId
|
||||
private Long id;
|
||||
private Long organId;
|
||||
private Long machineId;
|
||||
private LocalDateTime createTime;
|
||||
/**
|
||||
* 加工模式 开料机加工模式 默认true,显示开料机工作模式(是否排钻/造型,sc)配置
|
||||
*/
|
||||
private Boolean showPriorFacing;
|
||||
/**
|
||||
* 双工位
|
||||
*/
|
||||
private Boolean showDualWorkstation;
|
||||
/**
|
||||
* 自动贴标
|
||||
*/
|
||||
private Boolean showAutoNotePrinter;
|
||||
}
|
||||
+2
-1
@@ -20,10 +20,11 @@ public interface DataSourceMapper extends BaseMapperX<DataSourceDO> {
|
||||
default PageResult<DataSourceDO> selectPage(DataSourcePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<DataSourceDO>()
|
||||
.likeIfPresent(DataSourceDO::getName, reqVO.getName())
|
||||
.eqIfPresent(DataSourceDO::getSql, reqVO.getSql())
|
||||
.eqIfPresent(DataSourceDO::getSqlStr, reqVO.getSqlStr())
|
||||
.eqIfPresent(DataSourceDO::getType, reqVO.getType())
|
||||
.betweenIfPresent(DataSourceDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(DataSourceDO::getId));
|
||||
}
|
||||
|
||||
List<DataSourceRespVO> selectListVO();
|
||||
}
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
package com.cf.imes.module.system.dal.mysql.label;
|
||||
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.module.system.dal.dataobject.lable.LabelElementDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 标签元素模板 Mapper
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@Mapper
|
||||
public interface LabelElementMapper extends BaseMapperX<LabelElementDO> {
|
||||
|
||||
default List<LabelElementDO> selectListByLabelId(Long labelTemplateId) {
|
||||
return selectList(LabelElementDO::getLabelId, labelTemplateId);
|
||||
}
|
||||
|
||||
default int deleteByLabelId(Long labelTemplateId) {
|
||||
return delete(LabelElementDO::getLabelId, labelTemplateId);
|
||||
}
|
||||
|
||||
}
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
package com.cf.imes.module.system.dal.mysql.labeltemplate;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.module.system.dal.dataobject.labeltemplate.LabelElementTemplateDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 标签元素模板 Mapper
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@Mapper
|
||||
public interface LabelElementTemplateMapper extends BaseMapperX<LabelElementTemplateDO> {
|
||||
|
||||
default List<LabelElementTemplateDO> selectListByLabelTemplateId(Long labelTemplateId) {
|
||||
return selectList(LabelElementTemplateDO::getLabelTemplateId, labelTemplateId);
|
||||
}
|
||||
|
||||
default int deleteByLabelTemplateId(Long labelTemplateId) {
|
||||
return delete(LabelElementTemplateDO::getLabelTemplateId, labelTemplateId);
|
||||
}
|
||||
|
||||
}
|
||||
+18
-2
@@ -1,14 +1,18 @@
|
||||
package com.cf.imes.module.system.dal.mysql.machinetemplate;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.module.system.controller.admin.machine.vo.MachinePageReqVO;
|
||||
import com.cf.imes.module.system.controller.admin.machine.vo.*;
|
||||
import com.cf.imes.module.system.dal.dataobject.machinetemplate.MachineTemplateDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author there
|
||||
@@ -19,9 +23,21 @@ public interface MachineTemplateMapper extends BaseMapperX<MachineTemplateDO> {
|
||||
default PageResult<MachineTemplateDO> selectPage(MachinePageReqVO reqVO, Collection<Long> ids) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<MachineTemplateDO>()
|
||||
.eqIfPresent(MachineTemplateDO::getMachineType, reqVO.getMachineType())
|
||||
.inIfPresent(MachineTemplateDO::getId, ids)
|
||||
//.inIfPresent(MachineTemplateDO::getId, ids)
|
||||
.likeIfPresent(MachineTemplateDO::getName, reqVO.getName())
|
||||
.betweenIfPresent(MachineTemplateDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(MachineTemplateDO::getCreateTime));
|
||||
}
|
||||
|
||||
Page<AuthTemplateResp> selectAuthTemplatePage(@Param("page") IPage<AuthTemplateResp> authTemplateRespPage, @Param("vo") AuthTemplatePage page);
|
||||
|
||||
List<AutoTemplateVO> selectAuthTemplateList(Map<String, Object> map);
|
||||
|
||||
//Page<OrganTemplateResp> selectOrganTemplatePage(@Param("page") Page<OrganTemplateResp> respPage, @Param("vo") OrganTemplatePage page);
|
||||
|
||||
List<OrganTemplateVO> selectOrganTemplateList(Map<String, Object> map);
|
||||
|
||||
Page<OrganTemplateResp> selectOrganTemplatePage(@Param("page") Page<OrganTemplateResp> respPage, @Param("vo") OrganTemplatePage page);
|
||||
|
||||
OrganTemplateResp selectOrganTemplate(Long organId);
|
||||
}
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package com.cf.imes.module.system.dal.mysql.machinetemplate;
|
||||
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.module.system.dal.dataobject.machinetemplate.OrganMachineDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface OrganMachineMapper extends BaseMapperX<OrganMachineDO> {
|
||||
|
||||
}
|
||||
+2
@@ -54,4 +54,6 @@ public interface DataSourceService {
|
||||
PageResult<DataSourceDO> getDataSourcePage(DataSourcePageReqVO pageReqVO);
|
||||
|
||||
List<DataSourceDO> list(Integer type);
|
||||
|
||||
List<DataSourceRespVO> list();
|
||||
}
|
||||
+5
@@ -75,4 +75,9 @@ public class DataSourceServiceImpl implements DataSourceService {
|
||||
return dataSourceMapper.selectList(new LambdaQueryWrapperX<DataSourceDO>().eqIfPresent(DataSourceDO::getType, type));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataSourceRespVO> list() {
|
||||
return dataSourceMapper.selectListVO();
|
||||
}
|
||||
|
||||
}
|
||||
+7
-9
@@ -2,10 +2,8 @@ package com.cf.imes.module.system.service.labeltemplate;
|
||||
|
||||
import java.util.*;
|
||||
import com.cf.imes.module.system.controller.admin.labeltemplate.vo.*;
|
||||
import com.cf.imes.module.system.dal.dataobject.labeltemplate.LabelElementTemplateDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.labeltemplate.LabelTemplateDO;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@@ -56,13 +54,13 @@ public interface LabelTemplateService {
|
||||
|
||||
// ==================== 子表(标签元素模板) ====================
|
||||
|
||||
/**
|
||||
* 获得标签元素模板列表
|
||||
*
|
||||
* @param labelTemplateId 标签模板id
|
||||
* @return 标签元素模板列表
|
||||
*/
|
||||
List<LabelElementTemplateRespVO> getLabelElementTemplateListByLabelTemplateId(Long labelTemplateId);
|
||||
|
||||
Map<String, List<LabelTemplateRespVO>> getGroupList();
|
||||
|
||||
/**
|
||||
* 获得默认标签模板
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
LabelTemplateRespVO getDefaultLabelTemplate(String type);
|
||||
}
|
||||
+14
-212
@@ -1,39 +1,18 @@
|
||||
package com.cf.imes.module.system.service.labeltemplate;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.lang.TypeReference;
|
||||
import co.elastic.clients.elasticsearch.ElasticsearchClient;
|
||||
import co.elastic.clients.elasticsearch._types.FieldValue;
|
||||
import co.elastic.clients.elasticsearch._types.query_dsl.TermsQuery;
|
||||
import co.elastic.clients.elasticsearch.core.DeleteByQueryRequest;
|
||||
import co.elastic.clients.elasticsearch.core.SearchResponse;
|
||||
import co.elastic.clients.elasticsearch.core.search.Hit;
|
||||
import com.cf.imes.framework.common.exception.ServiceException;
|
||||
import com.cf.imes.framework.es.core.service.ESDocumentService;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.module.system.dal.dataobject.labelelementproperty.LabelElementPropertyDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.labeltemplate.LabelElementTemplateDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.machine.CuttingSettingDO;
|
||||
import com.cf.imes.module.system.dal.mysql.labeltemplate.LabelElementTemplateMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.cf.imes.module.system.controller.admin.labeltemplate.vo.*;
|
||||
import com.cf.imes.module.system.dal.dataobject.labeltemplate.LabelTemplateDO;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.module.system.dal.mysql.labeltemplate.LabelTemplateMapper;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static com.cf.imes.framework.common.exception.enums.GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR;
|
||||
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.cf.imes.module.system.enums.ErrorCodeConstants.*;
|
||||
|
||||
@@ -49,136 +28,33 @@ public class LabelTemplateServiceImpl implements LabelTemplateService {
|
||||
|
||||
@Resource
|
||||
private LabelTemplateMapper labelTemplateMapper;
|
||||
@Resource
|
||||
private LabelElementTemplateMapper labelElementTemplateMapper;
|
||||
@Resource
|
||||
private ESDocumentService esDocumentService;
|
||||
@Resource
|
||||
private ElasticsearchClient elasticsearchClient;
|
||||
|
||||
private static final String LABEL_TEMPLATE_ELEMENT_PROPERTY_INX = "label_template_element_property";
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long createLabelTemplate(LabelTemplateSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
LabelTemplateDO labelTemplate = BeanUtils.toBean(createReqVO, LabelTemplateDO.class);
|
||||
labelTemplateMapper.insert(labelTemplate);
|
||||
|
||||
// 插入子表
|
||||
List<LabelElementTemplateSaveReqVO> createReqVOElements = createReqVO.getElements();
|
||||
if(CollectionUtil.isNotEmpty(createReqVOElements)) {
|
||||
List<LabelElementPropertyDO> labelElementPropertyDOS = new ArrayList<>();
|
||||
createReqVOElements.forEach(e -> {
|
||||
e.setLabelTemplateId(labelTemplate.getId());
|
||||
LabelElementTemplateDO elementTemplateDO = Convert.convert(LabelElementTemplateDO.class, e);
|
||||
labelElementTemplateMapper.insert(elementTemplateDO);
|
||||
LabelElementPropertyDO propertyDO = e.getPropertyDO();
|
||||
propertyDO.setElementId(elementTemplateDO.getId());
|
||||
labelElementPropertyDOS.add(propertyDO);
|
||||
});
|
||||
//插入索引
|
||||
try {
|
||||
esDocumentService.bulkCreate(LABEL_TEMPLATE_ELEMENT_PROPERTY_INX, labelElementPropertyDOS);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
throw exception(INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
// 返回
|
||||
return labelTemplate.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateLabelTemplate(LabelTemplateSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateLabelTemplateExists(updateReqVO.getId());
|
||||
// 更新
|
||||
LabelTemplateDO updateObj = BeanUtils.toBean(updateReqVO, LabelTemplateDO.class);
|
||||
labelTemplateMapper.updateById(updateObj);
|
||||
|
||||
List<LabelElementTemplateDO> labelElementTemplateDOS = labelElementTemplateMapper.selectList(new LambdaQueryWrapperX<LabelElementTemplateDO>()
|
||||
.select(LabelElementTemplateDO::getId)
|
||||
.eq(LabelElementTemplateDO::getLabelTemplateId, updateReqVO.getId()));
|
||||
//删除旧的元素
|
||||
DeleteByQueryRequest.Builder builder = null;
|
||||
if(CollectionUtil.isNotEmpty(labelElementTemplateDOS)) {
|
||||
List<Long> templateIds = labelElementTemplateDOS.stream()
|
||||
.map(LabelElementTemplateDO::getId)
|
||||
.toList();
|
||||
labelElementTemplateMapper.deleteBatchIds(templateIds);
|
||||
List<FieldValue> fieldValues = templateIds.stream().map(FieldValue::of).collect(Collectors.toList());
|
||||
builder = new DeleteByQueryRequest.Builder()
|
||||
.index(LABEL_TEMPLATE_ELEMENT_PROPERTY_INX)
|
||||
.query(TermsQuery.of(e -> e.field("elementId").terms(b -> b.value(fieldValues)))._toQuery());
|
||||
}
|
||||
|
||||
|
||||
//新增新的元素
|
||||
List<LabelElementTemplateSaveReqVO> createReqVOElements = updateReqVO.getElements();
|
||||
List<LabelElementPropertyDO> labelElementPropertyDOS = new ArrayList<>();
|
||||
createReqVOElements.forEach(e -> {
|
||||
e.setLabelTemplateId(updateObj.getId());
|
||||
LabelElementTemplateDO elementTemplateDO = Convert.convert(LabelElementTemplateDO.class, e);
|
||||
labelElementTemplateMapper.insert(elementTemplateDO);
|
||||
LabelElementPropertyDO propertyDO = e.getPropertyDO();
|
||||
propertyDO.setElementId(elementTemplateDO.getId());
|
||||
labelElementPropertyDOS.add(propertyDO);
|
||||
});
|
||||
//插入索引
|
||||
try {
|
||||
if(CollectionUtil.isNotEmpty(labelElementPropertyDOS)) {
|
||||
esDocumentService.bulkCreate(LABEL_TEMPLATE_ELEMENT_PROPERTY_INX, labelElementPropertyDOS);
|
||||
}
|
||||
if(!Objects.isNull(builder)) {
|
||||
elasticsearchClient.deleteByQuery(builder.build());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
throw exception(INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
|
||||
/*updateLabelElementTemplateList(updateReqVO.getId(), Convert.convert(new TypeReference<List<LabelElementTemplateDO>>() {
|
||||
}, elements));*/
|
||||
/* labelElementTemplateMapper.updateBatch(Convert.convert(new TypeReference<List<LabelElementTemplateDO>>() {
|
||||
}, elements));
|
||||
List<LabelElementPropertyDO> labelElementPropertyDOS = elements.stream().map(e -> e.getPropertyDO()).collect(Collectors.toList());
|
||||
try {
|
||||
esDocumentService.bulkCreate(LABEL_TEMPLATE_ELEMENT_PROPERTY_INX, labelElementPropertyDOS);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
throw exception(INTERNAL_SERVER_ERROR);
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteLabelTemplate(Long id) {
|
||||
// 校验存在
|
||||
LabelTemplateDO labelTemplateDO = labelTemplateMapper.selectById(id);
|
||||
if (labelTemplateDO == null) {
|
||||
throw exception(LABEL_TEMPLATE_NOT_EXISTS);
|
||||
}
|
||||
List<LabelElementTemplateDO> labelElementTemplateDOS = labelElementTemplateMapper.selectListByLabelTemplateId(id);
|
||||
List<FieldValue> fieldValues = labelElementTemplateDOS.stream().map(e -> FieldValue.of(e.getId())).collect(Collectors.toList());
|
||||
// 删除索引
|
||||
DeleteByQueryRequest.Builder builder = new DeleteByQueryRequest.Builder()
|
||||
.index(LABEL_TEMPLATE_ELEMENT_PROPERTY_INX)
|
||||
.query(TermsQuery.of(e -> e.field("elementId").terms(b -> b.value(fieldValues)))._toQuery());
|
||||
try {
|
||||
elasticsearchClient.deleteByQuery(builder.build());
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
throw exception(INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
// 删除标签模板表
|
||||
labelTemplateMapper.deleteById(id);
|
||||
// 删除标签元素模板表
|
||||
labelElementTemplateMapper.delete(new LambdaQueryWrapperX<LabelElementTemplateDO>().eq(LabelElementTemplateDO::getLabelTemplateId, id));
|
||||
|
||||
}
|
||||
|
||||
private void validateLabelTemplateExists(Long id) {
|
||||
@@ -190,31 +66,7 @@ public class LabelTemplateServiceImpl implements LabelTemplateService {
|
||||
@Override
|
||||
public LabelTemplateRespVO getLabelTemplate(Long id) {
|
||||
LabelTemplateDO labelTemplateDO = labelTemplateMapper.selectById(id);
|
||||
List<LabelElementTemplateDO> labelElementTemplateDOS = labelElementTemplateMapper.selectListByLabelTemplateId(labelTemplateDO.getId());
|
||||
LabelTemplateRespVO labelTemplateRespVO = BeanUtils.toBean(labelTemplateDO, LabelTemplateRespVO.class);
|
||||
List<LabelElementTemplateRespVO> labelElementTemplateRespVOS = BeanUtils.toBean(labelElementTemplateDOS, LabelElementTemplateRespVO.class);
|
||||
List<FieldValue> fieldValues = labelElementTemplateDOS.stream().map(e -> FieldValue.of(e.getId())).collect(Collectors.toList());
|
||||
SearchResponse<CuttingSettingDO> searchSetting = null;
|
||||
try {
|
||||
SearchResponse<LabelElementPropertyDO> search = elasticsearchClient.search(builder -> builder.index(LABEL_TEMPLATE_ELEMENT_PROPERTY_INX)
|
||||
.query(TermsQuery.of(e -> e.field("elementId")
|
||||
.terms(b -> b.value(fieldValues)))._toQuery())
|
||||
.from(0)
|
||||
.size(10000),
|
||||
LabelElementPropertyDO.class);
|
||||
List<Hit<LabelElementPropertyDO>> hits = search.hits().hits();
|
||||
if (CollectionUtil.isNotEmpty(hits)) {
|
||||
List<LabelElementPropertyDO> propertyDOS = hits.stream().map(e -> e.source()).collect(Collectors.toList());
|
||||
for (LabelElementTemplateRespVO respVO : labelElementTemplateRespVOS) {
|
||||
respVO.setPropertyDO(propertyDOS.stream().filter(e -> Objects.equals(e.getElementId(), respVO.getId())).findAny().orElse(null));
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
throw new ServiceException(INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
labelTemplateRespVO.setLabelElementTemplates(labelElementTemplateRespVOS);
|
||||
return labelTemplateRespVO;
|
||||
}
|
||||
|
||||
@@ -223,79 +75,29 @@ public class LabelTemplateServiceImpl implements LabelTemplateService {
|
||||
return labelTemplateMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
// ==================== 子表(标签元素模板) ====================
|
||||
|
||||
@Override
|
||||
public List<LabelElementTemplateRespVO> getLabelElementTemplateListByLabelTemplateId(Long labelTemplateId) {
|
||||
List<LabelElementTemplateDO> labelElementTemplateDOS = labelElementTemplateMapper.selectListByLabelTemplateId(labelTemplateId);
|
||||
List<LabelElementTemplateRespVO> respVOS = BeanUtils.toBean(labelElementTemplateDOS, LabelElementTemplateRespVO.class);
|
||||
List<FieldValue> fieldValues = labelElementTemplateDOS.stream().map(e -> FieldValue.of(e.getId())).collect(Collectors.toList());
|
||||
try {
|
||||
SearchResponse<LabelElementPropertyDO> response = elasticsearchClient.search(b -> b.index(LABEL_TEMPLATE_ELEMENT_PROPERTY_INX)
|
||||
.from(0)
|
||||
.size(10000)
|
||||
.query(TermsQuery.of(e -> e.field("elementId").terms(t -> t.value(fieldValues)))._toQuery()),
|
||||
LabelElementPropertyDO.class);
|
||||
List<Hit<LabelElementPropertyDO>> hits = response.hits().hits();
|
||||
if(CollectionUtil.isNotEmpty(hits)) {
|
||||
List<LabelElementPropertyDO> propertyDOS = hits.stream().map(e -> e.source()).collect(Collectors.toList());
|
||||
for (LabelElementTemplateRespVO respVO : respVOS) {
|
||||
respVO.setPropertyDO(propertyDOS.stream().filter(e -> Objects.equals(e.getElementId(), respVO.getId())).findAny().orElse(null));
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
throw exception(INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
return respVOS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<LabelTemplateRespVO>> getGroupList() {
|
||||
List<LabelTemplateDO> labelTemplateDOS = labelTemplateMapper.selectList();
|
||||
List<LabelTemplateRespVO> labelTemplateRespVOS = BeanUtils.toBean(labelTemplateDOS, LabelTemplateRespVO.class);
|
||||
Set<Long> ids = labelTemplateRespVOS.stream().map(e -> e.getId()).collect(Collectors.toSet());
|
||||
List<LabelElementTemplateDO> labelElementTemplateDOS = labelElementTemplateMapper.selectList(new LambdaQueryWrapperX<LabelElementTemplateDO>().in(LabelElementTemplateDO::getLabelTemplateId, ids));
|
||||
List<LabelElementTemplateRespVO> labelElementTemplateRespVOS = BeanUtils.toBean(labelElementTemplateDOS, LabelElementTemplateRespVO.class);
|
||||
List<FieldValue> fieldValues = labelElementTemplateRespVOS.stream().map(e -> FieldValue.of(e.getId())).collect(Collectors.toList());
|
||||
try {
|
||||
SearchResponse<LabelElementPropertyDO> search = elasticsearchClient.search(builder -> builder.index(LABEL_TEMPLATE_ELEMENT_PROPERTY_INX)
|
||||
.query(TermsQuery.of(e -> e.field("elementId")
|
||||
.terms(b -> b.value(fieldValues)))._toQuery())
|
||||
.from(0)
|
||||
.size(10000),
|
||||
LabelElementPropertyDO.class);
|
||||
List<Hit<LabelElementPropertyDO>> hits = search.hits().hits();
|
||||
if (CollectionUtil.isNotEmpty(hits)) {
|
||||
List<LabelElementPropertyDO> propertyDOS = hits.stream().map(e -> e.source()).collect(Collectors.toList());
|
||||
for (LabelElementTemplateRespVO respVO : labelElementTemplateRespVOS) {
|
||||
respVO.setPropertyDO(propertyDOS.stream().filter(e -> Objects.equals(e.getElementId(), respVO.getId())).findAny().orElse(null));
|
||||
}
|
||||
return labelTemplateRespVOS.stream().collect(Collectors.groupingBy(LabelTemplateRespVO::getType));
|
||||
}
|
||||
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
throw new ServiceException(INTERNAL_SERVER_ERROR);
|
||||
@Override
|
||||
public LabelTemplateRespVO getDefaultLabelTemplate(String type) {
|
||||
List<LabelTemplateDO> labelTemplateDOS = labelTemplateMapper.selectList(new LambdaQueryWrapperX<LabelTemplateDO>()
|
||||
.eq(LabelTemplateDO::getIsDefault, Boolean.TRUE)
|
||||
.eq(LabelTemplateDO::getType, type)
|
||||
);
|
||||
if(CollectionUtil.isNotEmpty(labelTemplateDOS)) {
|
||||
if (labelTemplateDOS.size() > 1) {
|
||||
throw exception(DEFAULT_TEMPLATE_COUNT);
|
||||
}
|
||||
for (LabelTemplateRespVO labelTemplateRespVO : labelTemplateRespVOS) {
|
||||
labelTemplateRespVO.setLabelElementTemplates(labelElementTemplateRespVOS.stream().filter(e -> Objects.equals(e.getLabelTemplateId(), labelTemplateRespVO.getId())).toList());
|
||||
LabelTemplateDO labelTemplateDO = labelTemplateDOS.get(0);
|
||||
LabelTemplateRespVO labelTemplateRespVO = BeanUtils.toBean(labelTemplateDO, LabelTemplateRespVO.class);
|
||||
return labelTemplateRespVO;
|
||||
}
|
||||
return labelTemplateRespVOS.stream().collect(Collectors.groupingBy(e -> e.getType()));
|
||||
}
|
||||
|
||||
private void createLabelElementTemplateList(Long labelTemplateId, List<LabelElementTemplateDO> list) {
|
||||
list.forEach(o -> o.setLabelTemplateId(labelTemplateId));
|
||||
labelElementTemplateMapper.insertBatch(list);
|
||||
}
|
||||
|
||||
private void updateLabelElementTemplateList(Long labelTemplateId, List<LabelElementTemplateDO> list) {
|
||||
deleteLabelElementTemplateByLabelTemplateId(labelTemplateId);
|
||||
list.forEach(o -> o.setId(null).setUpdater(null).setUpdateTime(null)); // 解决更新情况下:1)id 冲突;2)updateTime 不更新
|
||||
createLabelElementTemplateList(labelTemplateId, list);
|
||||
}
|
||||
|
||||
private void deleteLabelElementTemplateByLabelTemplateId(Long labelTemplateId) {
|
||||
labelElementTemplateMapper.deleteByLabelTemplateId(labelTemplateId);
|
||||
throw exception(DEFAULT_LABEL_NOT_EXISTS);
|
||||
}
|
||||
|
||||
}
|
||||
-11
@@ -1,12 +1,10 @@
|
||||
package com.cf.imes.module.system.service.lable;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.module.system.controller.admin.label.vo.LabelElementRespVO;
|
||||
import com.cf.imes.module.system.controller.admin.label.vo.LabelPageReqVO;
|
||||
import com.cf.imes.module.system.controller.admin.label.vo.LabelRespVO;
|
||||
import com.cf.imes.module.system.controller.admin.label.vo.LabelSaveReqVO;
|
||||
import com.cf.imes.module.system.dal.dataobject.lable.LabelDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.lable.LabelElementDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
@@ -57,15 +55,6 @@ public interface LabelService {
|
||||
*/
|
||||
PageResult<LabelDO> getLabelPage(LabelPageReqVO pageReqVO);
|
||||
|
||||
// ==================== 子表(标签元素模板) ====================
|
||||
|
||||
/**
|
||||
* 获得标签元素模板列表
|
||||
*
|
||||
* @param LabelId 标签模板id
|
||||
* @return 标签元素模板列表
|
||||
*/
|
||||
List<LabelElementRespVO> getLabelElementListByLabelId(Long LabelId);
|
||||
|
||||
Map<String, List<LabelRespVO>> getGroupList();
|
||||
|
||||
|
||||
+22
-216
@@ -1,41 +1,24 @@
|
||||
package com.cf.imes.module.system.service.lable;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.lang.TypeReference;
|
||||
import co.elastic.clients.elasticsearch.ElasticsearchClient;
|
||||
import co.elastic.clients.elasticsearch._types.FieldValue;
|
||||
import co.elastic.clients.elasticsearch._types.query_dsl.TermsQuery;
|
||||
import co.elastic.clients.elasticsearch.core.DeleteByQueryRequest;
|
||||
import co.elastic.clients.elasticsearch.core.SearchResponse;
|
||||
import co.elastic.clients.elasticsearch.core.search.Hit;
|
||||
import com.cf.imes.framework.common.exception.ServiceException;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.framework.es.core.service.ESDocumentService;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.module.system.controller.admin.label.vo.*;
|
||||
import com.cf.imes.module.system.controller.admin.labeltemplate.vo.LabelElementTemplateSaveReqVO;
|
||||
import com.cf.imes.module.system.dal.dataobject.labelelementproperty.LabelElementPropertyDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.labeltemplate.LabelElementTemplateDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.lable.LabelDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.lable.LabelElementDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.machine.CuttingSettingDO;
|
||||
import com.cf.imes.module.system.dal.mysql.label.LabelElementMapper;
|
||||
import com.cf.imes.module.system.dal.dataobject.machine.MachineDO;
|
||||
import com.cf.imes.module.system.dal.mysql.label.LabelMapper;
|
||||
import com.cf.imes.module.system.dal.mysql.machine.MachineMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.cf.imes.framework.common.exception.enums.GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR;
|
||||
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.cf.imes.module.system.enums.ErrorCodeConstants.LABEL_NOT_EXISTS;
|
||||
import static com.cf.imes.module.system.enums.ErrorCodeConstants.MACHINE_USE_LABEL;
|
||||
|
||||
/**
|
||||
* 标签模板 Service 实现类
|
||||
@@ -48,43 +31,17 @@ import static com.cf.imes.module.system.enums.ErrorCodeConstants.LABEL_NOT_EXIST
|
||||
public class LabelServiceImpl implements LabelService {
|
||||
|
||||
@Resource
|
||||
private LabelMapper LabelMapper;
|
||||
@Resource
|
||||
private LabelElementMapper labelElementMapper;
|
||||
@Resource
|
||||
private ESDocumentService esDocumentService;
|
||||
@Resource
|
||||
private ElasticsearchClient elasticsearchClient;
|
||||
private LabelMapper labelMapper;
|
||||
|
||||
private static final String LABEL_ELEMENT_PROPERTY_INX = "label_element_property";
|
||||
@Resource
|
||||
private MachineMapper machineMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long createLabel(LabelSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
LabelDO Label = BeanUtils.toBean(createReqVO, LabelDO.class);
|
||||
LabelMapper.insert(Label);
|
||||
|
||||
// 插入子表
|
||||
List<LabelElementSaveReqVO> createReqVOElements = createReqVO.getElements();
|
||||
if(CollectionUtil.isNotEmpty(createReqVOElements)) {
|
||||
List<LabelElementPropertyDO> labelElementPropertyDOS = new ArrayList<>();
|
||||
createReqVOElements.forEach(e -> {
|
||||
e.setLabelId(Label.getId());
|
||||
LabelElementDO elementDO = Convert.convert(LabelElementDO.class, e);
|
||||
labelElementMapper.insert(elementDO);
|
||||
LabelElementPropertyDO propertyDO = e.getPropertyDO();
|
||||
propertyDO.setElementId(elementDO.getId());
|
||||
labelElementPropertyDOS.add(propertyDO);
|
||||
});
|
||||
//插入索引
|
||||
try {
|
||||
esDocumentService.bulkCreate(LABEL_ELEMENT_PROPERTY_INX, labelElementPropertyDOS);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
throw exception(INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
labelMapper.insert(Label);
|
||||
// 返回
|
||||
return Label.getId();
|
||||
}
|
||||
@@ -96,211 +53,60 @@ public class LabelServiceImpl implements LabelService {
|
||||
validateLabelExists(updateReqVO.getId());
|
||||
// 更新
|
||||
LabelDO updateObj = BeanUtils.toBean(updateReqVO, LabelDO.class);
|
||||
LabelMapper.updateById(updateObj);
|
||||
|
||||
List<LabelElementDO> labelElementDOS = labelElementMapper.selectList(new LambdaQueryWrapperX<LabelElementDO>()
|
||||
.select(LabelElementDO::getId)
|
||||
.eq(LabelElementDO::getLabelId, updateReqVO.getId()));
|
||||
//删除旧的元素
|
||||
DeleteByQueryRequest.Builder builder = null;
|
||||
if(CollectionUtil.isNotEmpty(labelElementDOS)) {
|
||||
List<Long> templateIds = labelElementDOS.stream()
|
||||
.map(LabelElementDO::getId)
|
||||
.toList();
|
||||
labelElementMapper.deleteBatchIds(templateIds);
|
||||
List<FieldValue> fieldValues = templateIds.stream().map(FieldValue::of).collect(Collectors.toList());
|
||||
builder = new DeleteByQueryRequest.Builder()
|
||||
.index(LABEL_ELEMENT_PROPERTY_INX)
|
||||
.query(TermsQuery.of(e -> e.field("elementId").terms(b -> b.value(fieldValues)))._toQuery());
|
||||
}
|
||||
|
||||
|
||||
//新增新的元素
|
||||
List<LabelElementSaveReqVO> createReqVOElements = updateReqVO.getElements();
|
||||
List<LabelElementPropertyDO> labelElementPropertyDOS = new ArrayList<>();
|
||||
createReqVOElements.forEach(e -> {
|
||||
e.setLabelId(updateObj.getId());
|
||||
LabelElementDO labelElementDO = Convert.convert(LabelElementDO.class, e);
|
||||
labelElementMapper.insert(labelElementDO);
|
||||
LabelElementPropertyDO propertyDO = e.getPropertyDO();
|
||||
propertyDO.setElementId(labelElementDO.getId());
|
||||
labelElementPropertyDOS.add(propertyDO);
|
||||
});
|
||||
//插入索引
|
||||
try {
|
||||
if(CollectionUtil.isNotEmpty(labelElementPropertyDOS)) {
|
||||
esDocumentService.bulkCreate(LABEL_ELEMENT_PROPERTY_INX, labelElementPropertyDOS);
|
||||
}
|
||||
if(!Objects.isNull(builder)) {
|
||||
elasticsearchClient.deleteByQuery(builder.build());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
throw exception(INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
/* List<LabelElementSaveReqVO> elements = updateReqVO.getElements();
|
||||
*//*updateLabelElementList(updateReqVO.getId(), Convert.convert(new TypeReference<List<LabelElementDO>>() {
|
||||
}, elements));*//*
|
||||
labelElementMapper.updateBatch(Convert.convert(new TypeReference<List<LabelElementDO>>() {
|
||||
}, elements));
|
||||
List<LabelElementPropertyDO> labelElementPropertyDOS = elements.stream().map(e -> e.getPropertyDO()).collect(Collectors.toList());
|
||||
try {
|
||||
esDocumentService.bulkCreate(LABEL_ELEMENT_PROPERTY_INX, labelElementPropertyDOS);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
throw exception(INTERNAL_SERVER_ERROR);
|
||||
}*/
|
||||
|
||||
labelMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteLabel(Long id) {
|
||||
// 校验存在
|
||||
LabelDO LabelDO = LabelMapper.selectById(id);
|
||||
LabelDO LabelDO = labelMapper.selectById(id);
|
||||
if (LabelDO == null) {
|
||||
throw exception(LABEL_NOT_EXISTS);
|
||||
}
|
||||
List<LabelElementDO> labelElementDOS = labelElementMapper.selectListByLabelId(id);
|
||||
List<FieldValue> fieldValues = labelElementDOS.stream().map(e -> FieldValue.of(e.getId())).collect(Collectors.toList());
|
||||
// 删除索引
|
||||
DeleteByQueryRequest.Builder builder = new DeleteByQueryRequest.Builder()
|
||||
.index(LABEL_ELEMENT_PROPERTY_INX)
|
||||
.query(TermsQuery.of(e -> e.field("elementId").terms(b -> b.value(fieldValues)))._toQuery());
|
||||
try {
|
||||
elasticsearchClient.deleteByQuery(builder.build());
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
throw exception(INTERNAL_SERVER_ERROR);
|
||||
List<MachineDO> machineDOS = machineMapper.selectList(new LambdaQueryWrapperX<MachineDO>()
|
||||
.select(MachineDO::getId)
|
||||
.eq(MachineDO::getLabelId, id)
|
||||
);
|
||||
if(CollectionUtil.isNotEmpty(machineDOS)) {
|
||||
throw exception(MACHINE_USE_LABEL);
|
||||
}
|
||||
// 删除标签模板表
|
||||
LabelMapper.deleteById(id);
|
||||
// 删除标签元素模板表
|
||||
labelElementMapper.delete(new LambdaQueryWrapperX<LabelElementDO>().eq(LabelElementDO::getLabelId, id));
|
||||
labelMapper.deleteById(id);
|
||||
|
||||
}
|
||||
|
||||
private void validateLabelExists(Long id) {
|
||||
if (LabelMapper.selectById(id) == null) {
|
||||
if (labelMapper.selectById(id) == null) {
|
||||
throw exception(LABEL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public LabelRespVO getLabel(Long id) {
|
||||
LabelDO LabelDO = LabelMapper.selectById(id);
|
||||
List<LabelElementDO> labelElementDOS = labelElementMapper.selectListByLabelId(LabelDO.getId());
|
||||
LabelDO LabelDO = labelMapper.selectById(id);
|
||||
LabelRespVO LabelRespVO = BeanUtils.toBean(LabelDO, LabelRespVO.class);
|
||||
List<LabelElementRespVO> labelElementRespVOS = BeanUtils.toBean(labelElementDOS, LabelElementRespVO.class);
|
||||
List<FieldValue> fieldValues = labelElementDOS.stream().map(e -> FieldValue.of(e.getId())).collect(Collectors.toList());
|
||||
SearchResponse<CuttingSettingDO> searchSetting = null;
|
||||
try {
|
||||
SearchResponse<LabelElementPropertyDO> search = elasticsearchClient.search(builder -> builder.index(LABEL_ELEMENT_PROPERTY_INX)
|
||||
.query(TermsQuery.of(e -> e.field("elementId")
|
||||
.terms(b -> b.value(fieldValues)))._toQuery())
|
||||
.from(0)
|
||||
.size(10000),
|
||||
LabelElementPropertyDO.class);
|
||||
List<Hit<LabelElementPropertyDO>> hits = search.hits().hits();
|
||||
if (CollectionUtil.isNotEmpty(hits)) {
|
||||
List<LabelElementPropertyDO> propertyDOS = hits.stream().map(e -> e.source()).collect(Collectors.toList());
|
||||
for (LabelElementRespVO respVO : labelElementRespVOS) {
|
||||
respVO.setPropertyDO(propertyDOS.stream().filter(e -> Objects.equals(e.getElementId(), respVO.getId())).findAny().orElse(null));
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
throw new ServiceException(INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
LabelRespVO.setLabelElements(labelElementRespVOS);
|
||||
return LabelRespVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<LabelDO> getLabelPage(LabelPageReqVO pageReqVO) {
|
||||
return LabelMapper.selectPage(pageReqVO);
|
||||
return labelMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
// ==================== 子表(标签元素模板) ====================
|
||||
|
||||
@Override
|
||||
public List<LabelElementRespVO> getLabelElementListByLabelId(Long LabelId) {
|
||||
List<LabelElementDO> labelElementDOS = labelElementMapper.selectListByLabelId(LabelId);
|
||||
List<LabelElementRespVO> respVOS = BeanUtils.toBean(labelElementDOS, LabelElementRespVO.class);
|
||||
List<FieldValue> fieldValues = labelElementDOS.stream().map(e -> FieldValue.of(e.getId())).collect(Collectors.toList());
|
||||
try {
|
||||
SearchResponse<LabelElementPropertyDO> response = elasticsearchClient.search(b -> b.index(LABEL_ELEMENT_PROPERTY_INX)
|
||||
.from(0)
|
||||
.size(10000)
|
||||
.query(TermsQuery.of(e -> e.field("elementId").terms(t -> t.value(fieldValues)))._toQuery()),
|
||||
LabelElementPropertyDO.class);
|
||||
List<Hit<LabelElementPropertyDO>> hits = response.hits().hits();
|
||||
if(CollectionUtil.isNotEmpty(hits)) {
|
||||
List<LabelElementPropertyDO> propertyDOS = hits.stream().map(e -> e.source()).collect(Collectors.toList());
|
||||
for (LabelElementRespVO respVO : respVOS) {
|
||||
respVO.setPropertyDO(propertyDOS.stream().filter(e -> Objects.equals(e.getElementId(), respVO.getId())).findAny().orElse(null));
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
throw exception(INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
return respVOS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<LabelRespVO>> getGroupList() {
|
||||
List<LabelDO> LabelDOS = LabelMapper.selectList();
|
||||
List<LabelDO> LabelDOS = labelMapper.selectList();
|
||||
List<LabelRespVO> LabelRespVOS = BeanUtils.toBean(LabelDOS, LabelRespVO.class);
|
||||
Set<Long> ids = LabelRespVOS.stream().map(e -> e.getId()).collect(Collectors.toSet());
|
||||
List<LabelElementDO> labelElementDOS = labelElementMapper.selectList(new LambdaQueryWrapperX<LabelElementDO>().in(LabelElementDO::getLabelId, ids));
|
||||
List<LabelElementRespVO> labelElementRespVOS = BeanUtils.toBean(labelElementDOS, LabelElementRespVO.class);
|
||||
List<FieldValue> fieldValues = labelElementRespVOS.stream().map(e -> FieldValue.of(e.getId())).collect(Collectors.toList());
|
||||
try {
|
||||
SearchResponse<LabelElementPropertyDO> search = elasticsearchClient.search(builder -> builder.index(LABEL_ELEMENT_PROPERTY_INX)
|
||||
.query(TermsQuery.of(e -> e.field("elementId")
|
||||
.terms(b -> b.value(fieldValues)))._toQuery())
|
||||
.from(0)
|
||||
.size(10000),
|
||||
LabelElementPropertyDO.class);
|
||||
List<Hit<LabelElementPropertyDO>> hits = search.hits().hits();
|
||||
if (CollectionUtil.isNotEmpty(hits)) {
|
||||
List<LabelElementPropertyDO> propertyDOS = hits.stream().map(e -> e.source()).collect(Collectors.toList());
|
||||
for (LabelElementRespVO respVO : labelElementRespVOS) {
|
||||
respVO.setPropertyDO(propertyDOS.stream().filter(e -> Objects.equals(e.getElementId(), respVO.getId())).findAny().orElse(null));
|
||||
}
|
||||
}
|
||||
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
throw new ServiceException(INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
for (LabelRespVO LabelRespVO : LabelRespVOS) {
|
||||
LabelRespVO.setLabelElements(labelElementRespVOS.stream().filter(e -> Objects.equals(e.getLabelId(), LabelRespVO.getId())).toList());
|
||||
}
|
||||
return LabelRespVOS.stream().collect(Collectors.groupingBy(e -> e.getType()));
|
||||
return LabelRespVOS.stream().collect(Collectors.groupingBy(LabelRespVO::getType));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LabelDO> list(String type) {
|
||||
return LabelMapper.selectList(new LambdaQueryWrapperX<LabelDO>().eqIfPresent(LabelDO::getType, type));
|
||||
return labelMapper.selectList(new LambdaQueryWrapperX<LabelDO>().eqIfPresent(LabelDO::getType, type));
|
||||
}
|
||||
|
||||
private void createLabelElementList(Long LabelId, List<LabelElementDO> list) {
|
||||
list.forEach(o -> o.setLabelId(LabelId));
|
||||
labelElementMapper.insertBatch(list);
|
||||
}
|
||||
|
||||
private void updateLabelElementList(Long LabelId, List<LabelElementDO> list) {
|
||||
deleteLabelElementByLabelId(LabelId);
|
||||
list.forEach(o -> o.setId(null).setUpdater(null).setUpdateTime(null)); // 解决更新情况下:1)id 冲突;2)updateTime 不更新
|
||||
createLabelElementList(LabelId, list);
|
||||
}
|
||||
|
||||
private void deleteLabelElementByLabelId(Long LabelId) {
|
||||
labelElementMapper.deleteByLabelId(LabelId);
|
||||
}
|
||||
|
||||
}
|
||||
+9
-41
@@ -12,7 +12,9 @@ import co.elastic.clients.elasticsearch.core.SearchResponse;
|
||||
import co.elastic.clients.elasticsearch.core.search.Hit;
|
||||
import com.cf.imes.framework.es.core.dal.ESDocument;
|
||||
import com.cf.imes.framework.es.core.service.ESDocumentService;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.module.system.controller.admin.machine.vo.*;
|
||||
import com.cf.imes.module.system.convert.machine.MachineConvert;
|
||||
import com.cf.imes.module.system.dal.dataobject.machine.DrillSettingDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.machine.MachineDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.machine.CuttingSettingDO;
|
||||
@@ -59,16 +61,8 @@ public class MachineServiceImpl implements MachineService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long createCutting(CuttingSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
MachineDO machineDO = Convert.convert(MachineDO.class, createReqVO);
|
||||
MachineDO machineDO = MachineConvert.convert(createReqVO);
|
||||
machineMapper.insert(machineDO);
|
||||
CuttingSettingDO machineSettingDO = createReqVO.getMachineSettingDO();
|
||||
machineSettingDO.setMachineId(machineDO.getId());
|
||||
try {
|
||||
esDocumentService.createByFluentDSL(CUTTING_MACHINE_SETTING, machineSettingDO.getId(), machineSettingDO);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
throw exception(INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
// 返回
|
||||
return machineDO.getId();
|
||||
}
|
||||
@@ -77,15 +71,9 @@ public class MachineServiceImpl implements MachineService {
|
||||
public void updateCutting(CuttingSaveReqVO updateReqVO){
|
||||
// 校验存在
|
||||
validateExists(updateReqVO.getId());
|
||||
updateReqVO.getMachineSettingDO().setMachineId(updateReqVO.getId());
|
||||
try {
|
||||
esDocumentService.createByFluentDSL(CUTTING_MACHINE_SETTING, updateReqVO.getMachineSettingDO().getId(), updateReqVO.getMachineSettingDO());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
throw exception(INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
// 更新
|
||||
MachineDO updateObj = BeanUtils.toBean(updateReqVO, MachineDO.class);
|
||||
MachineDO updateObj = MachineConvert.convert(updateReqVO);
|
||||
//MachineDO updateObj = BeanUtils.toBean(updateReqVO, MachineDO.class);
|
||||
machineMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@@ -96,16 +84,6 @@ public class MachineServiceImpl implements MachineService {
|
||||
if (machineMapper.selectById(id) == null) {
|
||||
throw exception(MACHINE_NOT_EXISTS);
|
||||
}
|
||||
// 删除
|
||||
DeleteByQueryRequest.Builder builder = new DeleteByQueryRequest.Builder()
|
||||
.index(CUTTING_MACHINE_SETTING)
|
||||
.query(b->b.term(t->t.field("machineId").value(machineDO.getId())));
|
||||
try {
|
||||
elasticsearchClient.deleteByQuery(builder.build());
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
throw exception(INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
machineMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@@ -115,16 +93,6 @@ public class MachineServiceImpl implements MachineService {
|
||||
if(CollectionUtil.isEmpty(machineDOS)){
|
||||
throw exception(MACHINE_NOT_EXISTS);
|
||||
}
|
||||
List<FieldValue> fieldValues = machineDOS.stream().map(e -> FieldValue.of(e.getId())).collect(Collectors.toList());
|
||||
DeleteByQueryRequest.Builder builder = new DeleteByQueryRequest.Builder()
|
||||
.index(CUTTING_MACHINE_SETTING)
|
||||
.query(TermsQuery.of(e-> e.field("machineId").terms(b->b.value(fieldValues)))._toQuery());
|
||||
try {
|
||||
elasticsearchClient.deleteByQuery(builder.build());
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
throw exception(INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
machineMapper.deleteBatchIds(ids);
|
||||
}
|
||||
|
||||
@@ -134,9 +102,7 @@ public class MachineServiceImpl implements MachineService {
|
||||
if(Objects.isNull(machineDO)) {
|
||||
throw exception(MACHINE_NOT_EXISTS);
|
||||
}
|
||||
CuttingRespVO respVO = Convert.convert(CuttingRespVO.class, machineDO);
|
||||
Object o1 = buildResp(machineDO.getId(), CUTTING_MACHINE_SETTING, CuttingSettingDO.class);
|
||||
respVO.setMachineSettingDO((CuttingSettingDO) o1);
|
||||
CuttingRespVO respVO = MachineConvert.convert(machineDO);
|
||||
return respVO;
|
||||
}
|
||||
|
||||
@@ -231,7 +197,9 @@ public class MachineServiceImpl implements MachineService {
|
||||
|
||||
@Override
|
||||
public Map<Integer, List<MachineVO>> getMachineTree() {
|
||||
List<MachineDO> machineDOS = machineMapper.selectList();
|
||||
List<MachineDO> machineDOS = machineMapper.selectList(new LambdaQueryWrapperX<MachineDO>()
|
||||
.select(MachineDO::getName, MachineDO::getMachineType, MachineDO::getId, MachineDO::getLabelId, MachineDO::getCreateTime)
|
||||
);
|
||||
List<MachineVO> machineVOS = BeanUtils.toBean(machineDOS, MachineVO.class);
|
||||
Map<Integer, List<MachineVO>> map = machineVOS.stream().collect(Collectors.groupingBy(MachineVO::getMachineType));
|
||||
return map;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user