From 638a2f5064ca376e7c4e28d3b6a6718a4563a19d Mon Sep 17 00:00:00 2001
From: wu <731351411@qq.com>
Date: 星期一, 06 五月 2024 16:52:42 +0800
Subject: [PATCH] 增加新建实体类等文件
---
hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/service/impl/GlassInfoServiceImpl.java | 77 +++++++++
hangzhoumesParent/moduleService/TemperingGlassModule/src/test/java/com/mes/TemperingApplicationTest.java | 55 ++++++
hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/mapper/xml/GlassInfoMapper.xml | 5
hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/controller/GlassInfoController.java | 21 ++
hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/entity/GlassInfo.java | 135 ++++++++++++++++
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/job/PlcLoadGlassTask.java | 33 ++++
hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/entity/OptimizeGlassinfo.java | 82 ++++++++++
hangzhoumesParent.zip | 0
hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/service/GlassInfoService.java | 19 ++
hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/mapper/GlassInfoMapper.java | 17 ++
10 files changed, 444 insertions(+), 0 deletions(-)
diff --git a/hangzhoumesParent.zip b/hangzhoumesParent.zip
new file mode 100644
index 0000000..c049891
--- /dev/null
+++ b/hangzhoumesParent.zip
Binary files differ
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/controller/GlassInfoController.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/controller/GlassInfoController.java
new file mode 100644
index 0000000..612845f
--- /dev/null
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/controller/GlassInfoController.java
@@ -0,0 +1,21 @@
+package com.mes.glassinfo.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 鍓嶇鎺у埗鍣�
+ * </p>
+ *
+ * @author wu
+ * @since 2024-04-29
+ */
+@RestController
+@RequestMapping("/glassinfo/glass-info")
+public class GlassInfoController {
+
+}
+
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/entity/GlassInfo.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/entity/GlassInfo.java
new file mode 100644
index 0000000..dfa7b6e
--- /dev/null
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/entity/GlassInfo.java
@@ -0,0 +1,135 @@
+package com.mes.glassinfo.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author wu
+ * @since 2024-04-29
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class GlassInfo implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 鐜荤拑淇℃伅琛╥d
+ */
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 娴佺▼鍗�
+ */
+ private String flowCardId;
+
+ /**
+ * 娴佺▼鍗$幓鐠冪被鍨�
+ */
+ private Integer glassType;
+
+ /**
+ * 瀹�
+ */
+ private Double width;
+
+ /**
+ * 楂�
+ */
+ private Double height;
+
+ /**
+ * 鍘氬害
+ */
+ private Double thickness;
+
+ /**
+ * 鑶滅郴
+ */
+ private String filmsid;
+
+ /**
+ * 纾ㄥ墠瀹�
+ */
+ private Double edgWidth;
+
+ /**
+ * 纾ㄥ墠楂�
+ */
+ private Double edgHeight;
+
+ /**
+ * 鏄惁閰嶇墖
+ */
+ private Integer ismultiple;
+
+ /**
+ * 閰嶇墖鏈�澶у
+ */
+ private Double maxWidth;
+
+ /**
+ * 閰嶇墖鏈�澶ч珮
+ */
+ private Double maxHeight;
+
+ /**
+ * 閽㈠寲鏄惁鎺ュ彈妯斁
+ */
+ private Integer ishorizontal;
+
+ /**
+ * 鍘熺墖椤哄簭
+ */
+ private Integer patternSequence;
+
+ /**
+ * 閽㈠寲鐗堝浘id
+ */
+ private Integer temperingLayoutId;
+
+ /**
+ * 閽㈠寲鐗堝浘鐗囧簭
+ */
+ private Integer temperingFeedSequence;
+
+ /**
+ * x鍧愭爣
+ */
+ private Integer xCoordinate;
+
+ /**
+ * y鍧愭爣
+ */
+ private Integer yCoordinate;
+
+ /**
+ * 鏃嬭浆瑙掑害锛堥�嗘椂閽堬級
+ */
+ private Integer angle;
+
+ /**
+ * 宸ョ▼鍙�
+ */
+ private String engineerId;
+
+ /**
+ * 鐢熶骇瑙勫垯id
+ */
+ private Integer ruleId;
+
+ /**
+ * 鐜荤拑ID
+ */
+ private String glassId;
+
+
+}
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/entity/OptimizeGlassinfo.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/entity/OptimizeGlassinfo.java
new file mode 100644
index 0000000..8f50981
--- /dev/null
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/entity/OptimizeGlassinfo.java
@@ -0,0 +1,82 @@
+package com.mes.glassinfo.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author SNG-010
+ */
+@Setter
+@Getter
+public class OptimizeGlassinfo {
+
+ // Getter methods
+ // Setter methods
+ /**
+ * 娴佺▼鍗″彿
+ */
+ private String projectId;
+
+ /**
+ * 宸ョ▼绉嶇被
+ */
+ private String type;
+
+ /**
+ * 瀹�
+ */
+ private Double width;
+
+ /**
+ * 楂�
+ */
+ private Double height;
+
+ /**
+ * 鍘氬害
+ */
+ private Double glassThickness;
+
+ /**
+ * 鐜荤拑鑶滅郴
+ */
+ private String glassType;
+
+ /**
+ * 灏忕墖瀹斤紙鍔犵(閲忥級
+ */
+ private Double pWidth;
+ /**
+ * 灏忕墖楂橈紙鍔犵(閲忥級
+ */
+ private Double pHeight;
+ /**
+ * 鐗堝浘id
+ */
+ private Integer stockId;
+ /**
+ * 閽㈠寲鐗堝浘缂栧彿(鏋跺彿)
+ */
+ private Integer heatLayoutId;
+ /**
+ * 閽㈠寲搴忓彿
+ */
+ private Integer heatLayoutSort;
+ /**
+ * x鍧愭爣
+ */
+ private Integer xAxis;
+ /**
+ * y鍧愭爣
+ */
+ private Integer yAxis;
+ /**
+ * 宸ョ▼鍙�
+ */
+ private String projectNo;
+ /**
+ * 灏忕墖缂栧彿
+ */
+ private String glassId;
+
+}
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/mapper/GlassInfoMapper.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/mapper/GlassInfoMapper.java
new file mode 100644
index 0000000..4688c38
--- /dev/null
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/mapper/GlassInfoMapper.java
@@ -0,0 +1,17 @@
+package com.mes.glassinfo.mapper;
+
+import com.github.yulichang.base.MPJBaseMapper;
+import com.mes.glassinfo.entity.GlassInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * Mapper 鎺ュ彛
+ * </p>
+ *
+ * @author wu
+ * @since 2024-04-29
+ */
+public interface GlassInfoMapper extends BaseMapper<GlassInfo>, MPJBaseMapper<GlassInfo> {
+
+}
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/mapper/xml/GlassInfoMapper.xml b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/mapper/xml/GlassInfoMapper.xml
new file mode 100644
index 0000000..3c9381f
--- /dev/null
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/mapper/xml/GlassInfoMapper.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.mes.glassinfo.mapper.GlassInfoMapper">
+
+</mapper>
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/service/GlassInfoService.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/service/GlassInfoService.java
new file mode 100644
index 0000000..746b5f4
--- /dev/null
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/service/GlassInfoService.java
@@ -0,0 +1,19 @@
+package com.mes.glassinfo.service;
+
+import com.mes.glassinfo.entity.GlassInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.github.yulichang.base.MPJBaseService;
+import java.util.List;
+
+/**
+ * <p>
+ * 鏈嶅姟绫�
+ * </p>
+ *
+ * @author wu
+ * @since 2024-04-29
+ */
+public interface GlassInfoService extends MPJBaseService<GlassInfo> {
+
+ List<GlassInfo> selectGlassInfo(String engineeringId);
+}
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/service/impl/GlassInfoServiceImpl.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/service/impl/GlassInfoServiceImpl.java
new file mode 100644
index 0000000..88838b9
--- /dev/null
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/service/impl/GlassInfoServiceImpl.java
@@ -0,0 +1,77 @@
+package com.mes.glassinfo.service.impl;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.github.yulichang.query.MPJQueryWrapper;
+import com.mes.glassinfo.entity.GlassInfo;
+import com.mes.glassinfo.entity.OptimizeGlassinfo;
+import com.mes.glassinfo.mapper.GlassInfoMapper;
+import com.mes.glassinfo.service.GlassInfoService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.mes.pp.entity.OptimizeProject;
+import com.mes.pp.mapper.OptimizeProjectMapper;
+import com.mes.uppattenusage.entity.UpPattenUsage;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.github.yulichang.base.MPJBaseServiceImpl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * <p>
+ * 鏈嶅姟瀹炵幇绫�
+ * </p>
+ *
+ * @author wu
+ * @since 2024-04-29
+ */
+@Service
+@Slf4j
+public class GlassInfoServiceImpl extends MPJBaseServiceImpl<GlassInfoMapper, GlassInfo> implements GlassInfoService {
+ @Autowired
+ OptimizeProjectMapper optimizeProjectMapper;
+ @Override
+ @DS("pp")
+
+ public List<GlassInfo> selectGlassInfo(String engineeringId) {
+ List<OptimizeGlassinfo> optimizeGlassinfos=null;
+ if (engineeringId != null) {
+ optimizeGlassinfos = optimizeProjectMapper.selectJoinList(OptimizeGlassinfo.class, new MPJQueryWrapper<OptimizeProject>()
+ .select("b.process_id,t.type,b.width,b.height,t.glass_thickness,t.glass_type,b.p_width,b.p_height,b.stock_id,b.heat_layout_id,b.heat_layout_sort,b.x_axis,b.y_axis,b.project_no,b.glass_id")
+ .leftJoin("optimize_detail b on t.project_no=b.project_no")
+ .eq("t.state",200)
+ .eq("t.project_no", engineeringId));
+ }
+
+ // 鍒涘缓涓�涓� List 鐢ㄤ簬淇濆瓨鏄犲皠鍚庣殑瀹炰綋瀵硅薄
+ List<GlassInfo> resultList = new ArrayList<>();
+
+ if(optimizeGlassinfos!=null){
+ for (OptimizeGlassinfo map : optimizeGlassinfos) {
+ // 鍒涘缓涓�涓柊鐨� OptimizeGlassinfo 瀵硅薄
+ GlassInfo glassInfo = new GlassInfo();
+ // 灏� Map 涓殑姣忎釜閿�煎鏄犲皠鍒� OptimizeGlassinfo 瀵硅薄鐨勭浉搴斿瓧娈典笂
+ glassInfo.setEngineerId(map.getProjectNo());
+ glassInfo.setFlowCardId(map.getProjectId());
+ glassInfo.setFilmsid(map.getGlassType());
+ glassInfo.setWidth(map.getWidth());
+ glassInfo.setHeight(map.getHeight());
+ glassInfo.setThickness(map.getGlassThickness());
+ glassInfo.setPatternSequence(map.getStockId());//
+ glassInfo.setTemperingLayoutId(map.getHeatLayoutId());//閽㈠寲鐗堝浘id
+ glassInfo.setTemperingFeedSequence(map.getHeatLayoutSort());//閽㈠寲鐗堝浘椤哄簭
+ glassInfo.setXCoordinate(map.getXAxis());
+ glassInfo.setYCoordinate(map.getYAxis());
+
+ glassInfo.setGlassId(map.getGlassId());
+ // 灏嗘槧灏勫悗鐨勫璞℃坊鍔犲埌缁撴灉鍒楄〃涓�
+ resultList.add(glassInfo);
+ }
+ }
+ log.info("鏌ヨ鍑篻lassinfo鐨勬暟鎹畕}:",resultList);
+ log.info("鏌ヨ鍑篻lassinfopro鐨勬暟鎹畕}:",optimizeGlassinfos);
+ return resultList;
+ }
+}
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/job/PlcLoadGlassTask.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/job/PlcLoadGlassTask.java
new file mode 100644
index 0000000..d3c4324
--- /dev/null
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/job/PlcLoadGlassTask.java
@@ -0,0 +1,33 @@
+package com.mes.job;
+
+import cn.hutool.json.JSONObject;
+import com.mes.workstation.service.UpWorkstationService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+@Component
+@Slf4j
+public class PlcLoadGlassTask {
+
+ @Autowired
+ private UpWorkstationService upWorkstationService;
+
+
+ /**
+ * fixedRate : 涓婁竴涓皟鐢ㄥ紑濮嬪悗鍐嶆璋冪敤鐨勫欢鏃讹紙涓嶇敤绛夊緟涓婁竴娆¤皟鐢ㄥ畬鎴愶級
+ * fixedDelay : 涓婁竴涓皟鐢ㄧ粨鏉熷悗鍐嶆璋冪敤鐨勫欢鏃�
+ */
+ @Scheduled(fixedDelay = 300)
+ public void plcLoadGlassTask() throws InterruptedException {
+ JSONObject jsonObject = new JSONObject();
+ try {
+ Thread.sleep(300);
+ upWorkstationService.selectPriority();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/TemperingGlassModule/src/test/java/com/mes/TemperingApplicationTest.java b/hangzhoumesParent/moduleService/TemperingGlassModule/src/test/java/com/mes/TemperingApplicationTest.java
new file mode 100644
index 0000000..426a339
--- /dev/null
+++ b/hangzhoumesParent/moduleService/TemperingGlassModule/src/test/java/com/mes/TemperingApplicationTest.java
@@ -0,0 +1,55 @@
+package com.mes;
+
+import com.mes.glassinfo.entity.GlassInfo;
+import com.mes.glassinfo.service.GlassInfoService;
+import com.mes.pp.mapper.OptimizeProjectMapper;
+import com.mes.temperingglass.entity.TemperingGlassInfo;
+import com.mes.temperingglass.service.TemperingAgoService;
+import com.mes.uppattenusage.entity.UpPattenUsage;
+import com.mes.uppattenusage.service.impl.UpPattenUsageServiceImpl;
+import lombok.extern.slf4j.Slf4j;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import javax.annotation.Resource;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @Author : zhoush
+ * @Date: 2024/3/27 16:37
+ * @Description:
+ */
+@Slf4j
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = TemperingGlassModuleApplication.class)
+public class TemperingApplicationTest {
+
+ @Resource
+ private OptimizeProjectMapper optimizeProjectMapper;
+ @Autowired
+ private TemperingAgoService temperingAgoService;
+ @Autowired
+ private GlassInfoService glassInfoService;
+
+
+ @Test
+ public void testFindPa() {
+ List<TemperingGlassInfo> glass = temperingAgoService.selectIntoGlass();
+ log.info("杩涚倝涓殑鐜荤拑锛歿}", Arrays.asList(glass));
+ }
+ @Test
+ public void testFindPa2() {
+ List<TemperingGlassInfo> glass = temperingAgoService.SelectOutGlass();
+ log.info("宸插嚭涓殑鐜荤拑锛歿}", Arrays.asList(glass));
+ }
+
+ @Test
+ public void testFindPa3() {
+ List<TemperingGlassInfo> glass = temperingAgoService.selectWaitingGlass();
+ log.info("绛夊緟涓殑鐜荤拑锛歿}", Arrays.asList(glass));
+ }
+}
--
Gitblit v1.8.0