hangzhoumesParent.zipBinary files differ
hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/controller/GlassInfoController.java
New file @@ -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 { } hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/entity/GlassInfo.java
New file @@ -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; /** * 玻璃信息表id */ @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; } hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/entity/OptimizeGlassinfo.java
New file @@ -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; } hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/mapper/GlassInfoMapper.java
New file @@ -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> { } hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/mapper/xml/GlassInfoMapper.xml
New file @@ -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> hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/service/GlassInfoService.java
New file @@ -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); } hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/service/impl/GlassInfoServiceImpl.java
New file @@ -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("查询出glassinfo的数据{}:",resultList); log.info("查询出glassinfopro的数据{}:",optimizeGlassinfos); return resultList; } } hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/job/PlcLoadGlassTask.java
New file @@ -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(); } } } hangzhoumesParent/moduleService/TemperingGlassModule/src/test/java/com/mes/TemperingApplicationTest.java
New file @@ -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)); } }