diff --git a/cf-framework/cf-spring-boot-starter-elasticsearch/src/main/java/com/cf/imes/framework/es/core/dal/ESDocument.java b/cf-framework/cf-spring-boot-starter-elasticsearch/src/main/java/com/cf/imes/framework/es/core/dal/ESDocument.java index 206e041e5..27a68d63b 100644 --- a/cf-framework/cf-spring-boot-starter-elasticsearch/src/main/java/com/cf/imes/framework/es/core/dal/ESDocument.java +++ b/cf-framework/cf-spring-boot-starter-elasticsearch/src/main/java/com/cf/imes/framework/es/core/dal/ESDocument.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; import javax.validation.constraints.NotBlank; +import java.time.LocalDateTime; import java.util.Date; 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; @@ -19,11 +20,11 @@ public class ESDocument { public String id; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) - private Date createTime; + private String createTime; private Long creator; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) - private Date updateTime; + private String updateTime; private Long updater; private Long organId; diff --git a/cf-framework/cf-spring-boot-starter-elasticsearch/src/main/java/com/cf/imes/framework/es/core/service/ESDocumentService.java b/cf-framework/cf-spring-boot-starter-elasticsearch/src/main/java/com/cf/imes/framework/es/core/service/ESDocumentService.java index 31902865f..b9e9dabd9 100644 --- a/cf-framework/cf-spring-boot-starter-elasticsearch/src/main/java/com/cf/imes/framework/es/core/service/ESDocumentService.java +++ b/cf-framework/cf-spring-boot-starter-elasticsearch/src/main/java/com/cf/imes/framework/es/core/service/ESDocumentService.java @@ -56,7 +56,7 @@ public interface ESDocumentService { * @param documents 要增加的对象集合 * @return 批量操作的结果 */ - BulkResponse bulkCreate(String idxName, List documents) throws Exception; + BulkResponse bulkCreate(String idxName, List documents) throws Exception; /** diff --git a/cf-framework/cf-spring-boot-starter-elasticsearch/src/main/java/com/cf/imes/framework/es/core/service/ESDocumentServiceImpl.java b/cf-framework/cf-spring-boot-starter-elasticsearch/src/main/java/com/cf/imes/framework/es/core/service/ESDocumentServiceImpl.java index 35333fcbd..ead844bd9 100644 --- a/cf-framework/cf-spring-boot-starter-elasticsearch/src/main/java/com/cf/imes/framework/es/core/service/ESDocumentServiceImpl.java +++ b/cf-framework/cf-spring-boot-starter-elasticsearch/src/main/java/com/cf/imes/framework/es/core/service/ESDocumentServiceImpl.java @@ -15,6 +15,11 @@ import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils; import java.io.IOException; import java.io.StringReader; +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeFormatterBuilder; import java.util.Date; import java.util.List; import java.util.Map; @@ -23,7 +28,7 @@ import java.util.function.BiConsumer; /** * @author there */ -public class ESDocumentServiceImpl implements ESDocumentService{ +public class ESDocumentServiceImpl implements ESDocumentService { //同步客户端 private final ElasticsearchClient elasticsearchClient; @@ -32,20 +37,24 @@ public class ESDocumentServiceImpl implements ESDocumentService{ private Snowflake snowflake = IdUtil.getSnowflake(); - public ESDocumentServiceImpl (ElasticsearchClient elasticsearchClient, ElasticsearchAsyncClient elasticsearchAsyncClient) { + DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ISO_DATE_TIME; + ZoneId utc = ZoneId.of("UTC"); + + public ESDocumentServiceImpl(ElasticsearchClient elasticsearchClient, ElasticsearchAsyncClient elasticsearchAsyncClient) { this.elasticsearchClient = elasticsearchClient; this.elasticsearchAsyncClient = elasticsearchAsyncClient; } @Override public IndexResponse createByFluentDSL(String idxName, String idxId, ESDocument document) throws Exception { + LocalDateTime now = LocalDateTime.now(); LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); document.setCreator(loginUser.getId()); document.setUpdater(loginUser.getId()); document.setOrganId(loginUser.getOrganId()); - document.setCreateTime(new Date()); - document.setUpdateTime(new Date()); - if(StrUtil.isBlank(document.getId())) { + document.setCreateTime((now.atZone(utc).format(dateTimeFormatter))); + document.setUpdateTime((now.atZone(utc).format(dateTimeFormatter))); + if (StrUtil.isBlank(document.getId())) { document.setId(snowflake.nextIdStr()); } return elasticsearchClient.index(idx -> idx @@ -56,21 +65,23 @@ public class ESDocumentServiceImpl implements ESDocumentService{ /** * BuilderPattern 方式创建文档 - * @param idxName 索引名 - * @param idxId 索引id + * + * @param idxName 索引名 + * @param idxId 索引id * @param document 文档对象 */ @Override public IndexResponse createByBuilderPattern(String idxName, String idxId, ESDocument document) throws Exception { LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + LocalDateTime now = LocalDateTime.now(); document.setCreator(loginUser.getId()); document.setUpdater(loginUser.getId()); document.setOrganId(loginUser.getOrganId()); - document.setCreateTime(new Date()); - document.setUpdateTime(new Date()); + document.setCreateTime((now.atZone(utc).format(dateTimeFormatter))); + document.setUpdateTime((now.atZone(utc).format(dateTimeFormatter))); IndexRequest.Builder indexReqBuilder = new IndexRequest.Builder<>(); indexReqBuilder.index(idxName); - if(StrUtil.isBlank(idxId)) { + if (StrUtil.isBlank(idxId)) { idxId = snowflake.nextIdStr(); } indexReqBuilder.id(idxId); @@ -80,13 +91,14 @@ public class ESDocumentServiceImpl implements ESDocumentService{ /** * json方式创建文档 - * @param idxName 索引名 - * @param idxId 索引id + * + * @param idxName 索引名 + * @param idxId 索引id * @param jsonContent json字符串 */ @Override public IndexResponse createByJson(String idxName, String idxId, String jsonContent) throws Exception { - if(StrUtil.isBlank(idxId)) { + if (StrUtil.isBlank(idxId)) { idxId = snowflake.nextIdStr(); } String finalIdxId = idxId; @@ -98,11 +110,12 @@ public class ESDocumentServiceImpl implements ESDocumentService{ } /** - * 异步方式创建文档 - * @param idxName 索引名 - * @param idxId 索引id + * 异步方式创建文档 + * + * @param idxName 索引名 + * @param idxId 索引id * @param document 文档 - * @param action 操作 + * @param action 操作 */ @Override public void createAsync(String idxName, String idxId, T document, BiConsumer action) { @@ -115,54 +128,56 @@ public class ESDocumentServiceImpl implements ESDocumentService{ /** * 批量方式创建文档 - * @param idxName 索引名 + * + * @param idxName 索引名 * @param documents 要增加的对象集合 */ + @Override - public BulkResponse bulkCreate(String idxName, List documents) throws Exception { + public BulkResponse bulkCreate(String idxName, List documents) throws Exception { BulkRequest.Builder br = new BulkRequest.Builder(); LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); Date date = new Date(); - documents.forEach(document ->{ - ESDocument esDocument = (ESDocument) document; - if(StrUtil.isBlank(esDocument.getId())) { + LocalDateTime now = LocalDateTime.now(); + documents.forEach(esDocument -> { + if (StrUtil.isBlank(esDocument.getId())) { esDocument.setId(snowflake.nextIdStr()); } esDocument.setCreator(loginUser.getId()); - esDocument.setCreateTime(date); + esDocument.setCreateTime(now.atZone(utc).format(dateTimeFormatter)); esDocument.setUpdater(loginUser.getId()); - esDocument.setUpdateTime(date); + esDocument.setUpdateTime(now.atZone(utc).format(dateTimeFormatter)); br.operations(op -> op.index(idx -> idx .index(idxName) .id(esDocument.getId().toString()) .document(esDocument))); }); - return elasticsearchClient.bulk(br.build()); + return elasticsearchClient.bulk(br.build()); } /** - * * @param idxName 索引名称 - * @param docId 文档id - * @param tClass 返回的类型 - * @param map 修改内容的map - * Map map = new HashMap<>(); - * map.put("age", 35); - * 把年龄改成35 + * @param docId 文档id + * @param tClass 返回的类型 + * @param map 修改内容的map + * Map map = new HashMap<>(); + * map.put("age", 35); + * 把年龄改成35 */ @Override - public Result updateById(String idxName, String docId, Class tClass, Map map) throws IOException { + public Result updateById(String idxName, String docId, Class tClass, Map map) throws IOException { UpdateResponse response = elasticsearchClient.update(e -> e.index(idxName).id(docId).doc(map), tClass); return response.result(); } /** * 文档id查询信息 + * * @param idxName 索引名 - * @param docId 文档id + * @param docId 文档id */ @Override - public T getById(String idxName, String docId,Class tClass) throws IOException { + public T getById(String idxName, String docId, Class tClass) throws IOException { GetResponse response = elasticsearchClient.get(g -> g .index(idxName) .id(docId), @@ -172,8 +187,9 @@ public class ESDocumentServiceImpl implements ESDocumentService{ /** * 根据索引名称和文档id查询ObjectNode + * * @param idxName 索引名 - * @param docId 文档id + * @param docId 文档id */ @Override public JSONObject getObjectNodeById(String idxName, String docId) throws IOException { @@ -187,8 +203,9 @@ public class ESDocumentServiceImpl implements ESDocumentService{ /** * 单条输出 + * * @param idxName 索引名 - * @param docId 文档id + * @param docId 文档id */ @Override public Boolean deleteById(String idxName, String docId) throws IOException { @@ -200,8 +217,9 @@ public class ESDocumentServiceImpl implements ESDocumentService{ /** * 批量删除 + * * @param idxName 索引名 - * @param docIds 要删除的文档id集合 + * @param docIds 要删除的文档id集合 */ @Override public BulkResponse bulkDeleteByIds(String idxName, List docIds) throws Exception { diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/pom.xml b/cf-module-prod-executor/cf-module-prod-executor-biz/pom.xml index 95f6078ec..a863d5805 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/pom.xml +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/pom.xml @@ -65,6 +65,24 @@ com.cf.imes cf-spring-boot-starter-redis + + com.cf.imes + cf-spring-boot-starter-elasticsearch + + + jakarta.json + jakarta.json-api + + + ${revision} + + + + jakarta.json + jakarta.json-api + 2.1.1 + + com.cf.imes diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/PlanController.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/PlanController.java index 4c4d859ee..a5d82da50 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/PlanController.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/PlanController.java @@ -1,5 +1,9 @@ package com.cf.imes.module.executor.controller.admin.plan; +import com.cf.imes.module.executor.service.order.OrderInputProcessor; +import com.cf.imes.module.executor.util.RandomUtils; +import com.cf.imes.module.executor.util.deviseData.Detail; +import com.cf.imes.module.executor.util.deviseData.IBoardProdInfo; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -38,6 +42,9 @@ public class PlanController { @Resource private PlanService planService; + @Resource + private OrderInputProcessor orderInputProcessor; + @PostMapping("/create") @Operation(summary = "创建排单") @PreAuthorize("@ss.hasPermission('executor:plan:create')") @@ -141,4 +148,25 @@ public class PlanController { BeanUtils.toBean(plateByPlanId, PlateResList.class)); } + + @GetMapping("test") + @Operation(summary = "test") + public Boolean test() { + ArrayList details = new ArrayList<>(); + for (int i = 0; i < 20; i++) { + Detail detail = RandomUtils.randomPojo(Detail.class); + IBoardProdInfo iBoardProdInfo = detail.getIBoardProdInfo(); + iBoardProdInfo.setRawGoodsId(999L); + iBoardProdInfo.setGoodsName("abc"); + iBoardProdInfo.setMaterial("ccc"); + iBoardProdInfo.setColor("blue"); + iBoardProdInfo.setBrand("xxx"); + iBoardProdInfo.setSpec("xxxx"); + iBoardProdInfo.setGoodType(1); + details.add(detail); + } + orderInputProcessor.input(details, 999L); + return Boolean.TRUE; + } + } \ No newline at end of file diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/ordermodel/OrderModelDO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/ordermodel/OrderModelDO.java new file mode 100644 index 000000000..18f386c71 --- /dev/null +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/ordermodel/OrderModelDO.java @@ -0,0 +1,43 @@ +package com.cf.imes.module.executor.dal.dataobject.ordermodel; + +import com.cf.imes.framework.es.core.dal.ESDocument; +import com.cf.imes.module.executor.util.deviseData.HoleDetail; +import com.cf.imes.module.executor.util.deviseData.ModelDetail; +import com.cf.imes.module.executor.util.deviseData.PointDetail; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.checkerframework.checker.units.qual.A; + +import java.util.List; + +/** + * @author Beal + * 生产单 小板的轮廓数据对象 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class OrderModelDO extends ESDocument { + /*@Schema(description = "组织id") + private Long organId;*/ + @Schema(description = "生产单id") + private Long orderId; + @Schema(description = "小板id") + private Long plateId; + @Schema(description = "轮廓明细") + private List contourDetail; + @Schema(description = "点明细") + private List pointDetail; + @Schema(description = "孔明细") + private HoleDetail holeDetail; + @Schema(description = "原始点明细") + private List rawPointDetail; + @Schema(description = "侧面轮廓明细") + private List sideModelDetail; + @Schema(description = "侧面孔明细") + private List sideHoleDetail; +} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderInputProcessor.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderInputProcessor.java index 2038042b9..9a0c9f4ff 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderInputProcessor.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderInputProcessor.java @@ -3,6 +3,7 @@ package com.cf.imes.module.executor.service.order; import cn.hutool.core.collection.CollectionUtil; import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator; import com.cf.imes.framework.common.util.json.JsonUtils; +import com.cf.imes.framework.es.core.service.ESDocumentService; import com.cf.imes.framework.mybatis.core.generator.SnowFlakeGenerator; import com.cf.imes.framework.organ.core.context.OrganContextHolder; import com.cf.imes.module.executor.dal.dataobject.orderBody.OrderBodyDO; @@ -10,6 +11,7 @@ import com.cf.imes.module.executor.dal.dataobject.orderGroup.OrderGroupDO; import com.cf.imes.module.executor.dal.dataobject.orderItem.OrderItemDO; import com.cf.imes.module.executor.dal.dataobject.orderModuleExtra.OrderModuleExtraDO; import com.cf.imes.module.executor.dal.dataobject.orderParts.OrderPartsDO; +import com.cf.imes.module.executor.dal.dataobject.ordermodel.OrderModelDO; import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO; import com.cf.imes.module.executor.dal.dataobject.rawgoods.RawGoodsDO; import com.cf.imes.module.executor.dal.mysql.orderBody.OrderBodyMapper; @@ -24,6 +26,7 @@ import com.cf.imes.module.executor.util.deviseData.Detail; import com.cf.imes.module.executor.util.deviseData.IBoardProdInfo; import com.cf.imes.module.executor.util.deviseData.PartsModuleExtra; import com.cf.imes.module.executor.util.deviseData.PlateModuleExtra; +import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; @@ -36,6 +39,7 @@ import java.util.stream.Collectors; * @author Beal * 生产单入库处理器 */ +@Slf4j @Component public class OrderInputProcessor { @@ -64,6 +68,11 @@ public class OrderInputProcessor { @Resource private OrderModuleExtraMapper orderModuleExtraMapper; + @Resource + private ESDocumentService esDocumentService; + + public static final String ORDER_PLATE_MODEL = "imes_order_plate_model"; + public void input(List sourceList, Long orderId) { Long organId = OrganContextHolder.getOrganId(); @@ -74,6 +83,7 @@ public class OrderInputProcessor { ArrayList orderPartsDOS = new ArrayList<>(); ArrayList orderItemDOS = new ArrayList<>(); ArrayList orderModuleExtraDOS = new ArrayList<>(); + ArrayList orderModelDOS = new ArrayList<>(); Map>>> map = sourceList.stream().collect(Collectors.groupingBy(e -> RawGoodsDO.builder() .rawGoodsId(e.getIBoardProdInfo().getGoodsId()) @@ -148,7 +158,7 @@ public class OrderInputProcessor { .unit(e.getIBoardProdInfo().getUnit()) .build() ).toList(); - if(CollectionUtil.isNotEmpty(plateExtras)) { + if (CollectionUtil.isNotEmpty(plateExtras)) { orderModuleExtraDOS.add( OrderModuleExtraDO.builder() .orderId(orderId) @@ -159,7 +169,7 @@ public class OrderInputProcessor { .build()); } - if(CollectionUtil.isNotEmpty(partsModuleExtras)) { + if (CollectionUtil.isNotEmpty(partsModuleExtras)) { orderModuleExtraDOS.add( OrderModuleExtraDO.builder() .orderId(orderId) @@ -224,6 +234,17 @@ public class OrderInputProcessor { orderItemDO.setPartsId(0L); orderItemDO.setType(1); plateDOS.add(plateDO); + orderModelDOS.add( + OrderModelDO.builder() + .orderId(orderId) + .plateId(plateDO.getId()) + .contourDetail(e.getContourDetail()) + .pointDetail(e.getPointDetail()) + .holeDetail(e.getHoleDetail()) + .rawPointDetail(e.getRawPointDetail()) + .sideHoleDetail(e.getSideHoleDetail()) + .sideModelDetail(e.getSideModelDetail()) + .build()); } else { OrderPartsDO orderPartsDO = OrderPartsDO.builder() .id(identifierGenerator.nextId(null).longValue()) @@ -252,13 +273,14 @@ public class OrderInputProcessor { }); }); }); - + batchSaveModel(orderModelDOS); batchInsert(rawGoodsDOS, orderBodyDOS, orderGroupDOS, orderPartsDOS, plateDOS, orderModuleExtraDOS, orderItemDOS); } /** * 批量保存生产单小板五金数据 + * * @param rawGoodsDOS * @param orderBodyDOS * @param orderGroupDOS @@ -282,11 +304,17 @@ public class OrderInputProcessor { /** * 保存生产单造型数据 - * @param sourceList - * @param orderId + * + * @param orderModelDOs */ - public void saveModel(List sourceList, Long orderId) { - + public void batchSaveModel(List orderModelDOs) { + try { + esDocumentService.bulkCreate(ORDER_PLATE_MODEL, orderModelDOs); + } catch (Exception e) { + e.printStackTrace(); + log.error(e.getMessage()); + throw new RuntimeException(e); + } } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/application-dev.yaml b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/application-dev.yaml index cab696a4d..880b02439 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/application-dev.yaml +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/application-dev.yaml @@ -68,7 +68,8 @@ spring: # Kafka 配置项,对应 KafkaProperties 配置类 kafka: bootstrap-servers: 127.0.0.1:9092 # 指定 Kafka Broker 地址,可以设置多个,以逗号分隔 - + elasticsearch: + uris: 192.168.1.205:9200 --- #################### 定时任务相关配置 #################### xxl: job: diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/application-local.yaml b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/application-local.yaml index 9882bd664..75796e617 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/application-local.yaml +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/application-local.yaml @@ -74,6 +74,8 @@ spring: # Kafka 配置项,对应 KafkaProperties 配置类 kafka: bootstrap-servers: 127.0.0.1:9092 # 指定 Kafka Broker 地址,可以设置多个,以逗号分隔 + elasticsearch: + uris: 192.168.1.205:9200 --- #################### 定时任务相关配置 #################### xxl: diff --git a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/machine/MachineController.java b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/machine/MachineController.java index 25ddd04ca..c3a2baf40 100644 --- a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/machine/MachineController.java +++ b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/machine/MachineController.java @@ -92,7 +92,7 @@ public class MachineController { @Operation(summary = "获得默认机台模板") @Parameter(name = "machineType", description = "机台类型", required = true, example = "1") @PreAuthorize("@ss.hasPermission('machine::query')") - public CommonResult getDefaultCutting(@RequestParam Integer machineType) { + public CommonResult getDefaultCutting(@RequestParam Integer machineType) { return success(machineTemplateService.getDefaultCutting(machineType)); } diff --git a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/service/machine/MachineTemplateService.java b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/service/machine/MachineTemplateService.java index bf21adfcc..a5e9ec195 100644 --- a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/service/machine/MachineTemplateService.java +++ b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/service/machine/MachineTemplateService.java @@ -39,7 +39,7 @@ public interface MachineTemplateService { Boolean batchDeleteCuttingTemplate(List ids); - CuttingRespVO getDefaultCutting(Integer machineType); + CuttingTemplateRespVO getDefaultCutting(Integer machineType); DrillTemplateRespVO getDefaultDrill(); diff --git a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/service/machine/MachineTemplateServiceImpl.java b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/service/machine/MachineTemplateServiceImpl.java index c2db15287..c36e68184 100644 --- a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/service/machine/MachineTemplateServiceImpl.java +++ b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/service/machine/MachineTemplateServiceImpl.java @@ -197,7 +197,7 @@ public class MachineTemplateServiceImpl implements MachineTemplateService { } @Override - public CuttingRespVO getDefaultCutting(Integer machineType) { + public CuttingTemplateRespVO getDefaultCutting(Integer machineType) { List machineTemplateDOS = machineTemplateMapper.selectList(new LambdaQueryWrapperX() .eq(MachineTemplateDO::getIsDefault, Boolean.TRUE) .eq(MachineTemplateDO::getMachineType, machineType) @@ -207,7 +207,7 @@ public class MachineTemplateServiceImpl implements MachineTemplateService { throw exception(DEFAULT_TEMPLATE_COUNT); } MachineTemplateDO templateDO = machineTemplateDOS.get(0); - return MachineTemplateConvert.convert(templateDO); + return MachineTemplateConvert.convert1(templateDO); } throw exception(DEFAULT_TEMPLATE_NOT_EXISTS); } diff --git a/script/es/imes-order-plate-model.index b/script/es/imes-order-plate-model.index new file mode 100644 index 000000000..b84ac8e31 --- /dev/null +++ b/script/es/imes-order-plate-model.index @@ -0,0 +1,390 @@ +{ + "settings": {}, + "mappings": { + "properties": { + "contourDetail": { + "properties": { + "depth": { + "type": "short" + }, + "knifeName": { + "type": "keyword" + }, + "knifeRadius": { + "type": "float" + }, + "lineID": { + "type": "long" + }, + "modelId": { + "type": "long" + }, + "offSetList": { + "properties": { + "angle": { + "type": "float" + }, + "deep": { + "type": "float" + }, + "faceType": { + "type": "short" + }, + "name": { + "type": "keyword" + }, + "radius": { + "type": "float" + }, + "value": { + "type": "float" + } + } + }, + "originModeling": { + "properties": { + "addDepth": { + "type": "float" + }, + "addLen": { + "type": "float" + }, + "addWidth": { + "type": "float" + }, + "dir": { + "type": "short" + }, + "holes": { + "properties": { + "buls": { + "type": "float" + }, + "pts": { + "properties": { + "x": { + "type": "float" + }, + "y": { + "type": "float" + } + } + } + } + }, + "knifeRadius": { + "type": "short" + }, + "outline": { + "properties": { + "buls": { + "type": "float" + }, + "pts": { + "properties": { + "x": { + "type": "float" + }, + "y": { + "type": "float" + } + } + } + } + }, + "thickness": { + "type": "short" + } + } + }, + "pointList": { + "properties": { + "curve": { + "type": "long" + }, + "depth": { + "type": "long" + }, + "lineId": { + "type": "long" + }, + "pointId": { + "type": "long" + }, + "pointX": { + "type": "float" + }, + "pointY": { + "type": "float" + }, + "radius": { + "type": "float" + } + } + }, + "typographicFace": { + "type": "short" + } + } + }, + "createTime": { + "type": "date" + }, + "creator": { + "type": "long" + }, + "holeDetail": { + "properties": { + "angle": { + "type": "float" + }, + "depth": { + "type": "float" + }, + "endPoint": { + "type": "float" + }, + "faceType": { + "type": "short" + }, + "holeId": { + "type": "long" + }, + "holeType": { + "type": "short" + }, + "pointX": { + "type": "float" + }, + "pointX2": { + "type": "float" + }, + "pointY": { + "type": "float" + }, + "pointY2": { + "type": "float" + }, + "pointZ": { + "type": "float" + }, + "radius": { + "type": "float" + } + } + }, + "id": { + "type": "keyword" + }, + "orderId": { + "type": "long" + }, + "plateId": { + "type": "long" + }, + "pointDetail": { + "properties": { + "curve": { + "type": "float" + }, + "pointId": { + "type": "long" + }, + "pointX": { + "type": "float" + }, + "pointY": { + "type": "float" + } + } + }, + "rawPointDetail": { + "properties": { + "curve": { + "type": "float" + }, + "pointId": { + "type": "long" + }, + "pointX": { + "type": "float" + }, + "pointY": { + "type": "float" + } + } + }, + "sideHoleDetail": { + "properties": { + "angle": { + "type": "float" + }, + "depth": { + "type": "float" + }, + "endPoint": { + "type": "float" + }, + "faceType": { + "type": "short" + }, + "holeId": { + "type": "long" + }, + "holeType": { + "type": "short" + }, + "pointX": { + "type": "float" + }, + "pointX2": { + "type": "float" + }, + "pointY": { + "type": "float" + }, + "pointY2": { + "type": "float" + }, + "pointZ": { + "type": "float" + }, + "radius": { + "type": "float" + } + } + }, + "sideModelDetail": { + "properties": { + "depth": { + "type": "float" + }, + "knifeName": { + "type": "keyword" + }, + "knifeRadius": { + "type": "float" + }, + "lineID": { + "type": "long" + }, + "modelId": { + "type": "long" + }, + "offSetList": { + "properties": { + "angle": { + "type": "float" + }, + "deep": { + "type": "float" + }, + "faceType": { + "type": "short" + }, + "name": { + "type": "keyword" + }, + "radius": { + "type": "float" + }, + "value": { + "type": "float" + } + } + }, + "originModeling": { + "properties": { + "addDepth": { + "type": "long" + }, + "addLen": { + "type": "long" + }, + "addWidth": { + "type": "long" + }, + "dir": { + "type": "long" + }, + "holes": { + "properties": { + "buls": { + "type": "long" + }, + "pts": { + "properties": { + "x": { + "type": "float" + }, + "y": { + "type": "float" + } + } + } + } + }, + "knifeRadius": { + "type": "long" + }, + "outline": { + "properties": { + "buls": { + "type": "long" + }, + "pts": { + "properties": { + "x": { + "type": "float" + }, + "y": { + "type": "float" + } + } + } + } + }, + "thickness": { + "type": "long" + } + } + }, + "pointList": { + "properties": { + "curve": { + "type": "long" + }, + "depth": { + "type": "long" + }, + "lineId": { + "type": "long" + }, + "pointId": { + "type": "long" + }, + "pointX": { + "type": "long" + }, + "pointY": { + "type": "long" + }, + "radius": { + "type": "long" + } + } + }, + "typographicFace": { + "type": "long" + } + } + }, + "updateTime": { + "type": "date" + }, + "updater": { + "type": "long" + } + } + } +} \ No newline at end of file