26个文件已修改
8 文件已重命名
51个文件已添加
17个文件已删除
| | |
| | | public class BigStorageCageBaseInfo { |
| | | |
| | | /** |
| | | * 工程号 |
| | | */ |
| | | @ApiModelProperty(value = "工程号", position = 16) |
| | | private String engineerId; |
| | | /** |
| | | * 玻璃id |
| | | */ |
| | | @ApiModelProperty(value = "玻璃id") |
| | | private String glassId; |
| | | /** |
| | | * 钢化版图id |
| | | */ |
| | | @ApiModelProperty(value = "钢化版图id", position = 12) |
| | | private Integer temperingLayoutId; |
| | | |
| | | /** |
| | | * 钢化版图片序 |
| | | */ |
| | | @ApiModelProperty(value = "钢化版图片序", position = 13) |
| | | private Integer temperingFeedSequence; |
| | | |
| | | /** |
| | | * 宽 |
| | |
| | | */ |
| | | @ApiModelProperty(value = "玻璃id") |
| | | private Integer slot; |
| | | |
| | | /** |
| | | * x坐标 |
| | | */ |
| | | @ApiModelProperty(value = "x坐标", position = 13) |
| | | private Integer xCoordinate; |
| | | |
| | | /** |
| | | * y坐标 |
| | | */ |
| | | @ApiModelProperty(value = "y坐标", position = 14) |
| | | private Integer yCoordinate; |
| | | |
| | | } |
| | |
| | | public static final Integer TEMPERING_START = 2; |
| | | public static final Integer TEMPERING_SUCCESS = 3; |
| | | public static final Integer TEMPERING_END = 4; |
| | | public static final Integer TEMPERING_PAUSE = 5; |
| | | public static final Integer TEMPERING_DAMAGE = 8; |
| | | public static final Integer TEMPERING_TAKE = 9; |
| | | |
| | |
| | | public static final Integer BIG_STORAGE_TASK_EMPTY = 0; |
| | | public static final Integer BIG_STORAGE_TASK_RUNNING = 1; |
| | | |
| | | /** |
| | | * 中空大理片笼出片状态I |
| | | * 0 空任务 |
| | | * 1 启动 |
| | | * 2 暂停 |
| | | * 3 完成 |
| | | */ |
| | | public static final Integer HOLLOW_FLOW_CARD_NEW = 0; |
| | | public static final Integer HOLLOW_FLOW_CARD_START = 1; |
| | | public static final Integer HOLLOW_FLOW_CARD_PAUSE = 2; |
| | | public static final Integer HOLLOW_FLOW_CARD_SUCCESS = 3; |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.glassinfo.entity.dto; |
| | | |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/11/28 10:02 |
| | | * @Description: |
| | | */ |
| | | @Data |
| | | public class HollowGlassInfoDTO extends GlassInfo { |
| | | /** |
| | | * 中空线总 |
| | | */ |
| | | private int hollowSequence; |
| | | } |
| | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.entity.dto.HollowGlassInfoDTO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | @DS("hangzhoumes") |
| | | public interface GlassInfoMapper extends MPJBaseMapper<GlassInfo> { |
| | | |
| | | List<GlassInfo> listBySize(@Param("engineerId") String engineerId); |
| | | List<HollowGlassInfoDTO> listBySize(@Param("engineerId") String engineerId); |
| | | } |
| | |
| | | |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.entity.dto.HollowGlassInfoDTO; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | List<Map<String, Object>> getFlowCardId(); |
| | | |
| | | |
| | | List<GlassInfo> listBySize(String engineerId); |
| | | List<HollowGlassInfoDTO> listBySize(String engineerId); |
| | | } |
| | | |
| | |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.entity.OptimizeGlassinfo; |
| | | import com.mes.glassinfo.entity.dto.HollowGlassInfoDTO; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.pp.entity.OptimizeProject; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<GlassInfo> listBySize(String engineerId) { |
| | | public List<HollowGlassInfoDTO> listBySize(String engineerId) { |
| | | return baseMapper.listBySize(engineerId); |
| | | } |
| | | |
| | |
| | | private Integer ishorizontal; |
| | | |
| | | /** |
| | | * 钢化版图id |
| | | */ |
| | | @ApiModelProperty(value = "钢化版图id", position = 11) |
| | | private Integer temperingLayoutId; |
| | | |
| | | /** |
| | | * 钢化版图片序 |
| | | */ |
| | | @ApiModelProperty(value = "钢化版图片序", position = 12) |
| | | private Integer temperingFeedSequence; |
| | | |
| | | /** |
| | | * 旋转角度(逆时针) |
| | | */ |
| | | @ApiModelProperty(value = "旋转角度(逆时针)", position = 15) |
| | | private Integer angle; |
| | | /** |
| | | * x坐标 |
| | | */ |
| | | @ApiModelProperty(value = "x坐标", position = 13) |
| | | private Integer xCoordinate; |
| | | |
| | | /** |
| | | * y坐标 |
| | | */ |
| | | @ApiModelProperty(value = "y坐标", position = 14) |
| | | private Integer yCoordinate; |
| | | |
| | | /** |
| | | * 状态 |
| | |
| | | @ApiModelProperty(value = "状态", position = 16) |
| | | private Integer state; |
| | | |
| | | /** |
| | | * 工程id |
| | | */ |
| | | @ApiModelProperty(value = "工程id", position = 17) |
| | | private String engineerId; |
| | | |
| | | @TableLogic |
| | | private int deleted; |
| | |
| | | <!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"> |
| | | |
| | | <select id="listBySize" resultType="com.mes.glassinfo.entity.GlassInfo"> |
| | | <select id="listBySize" resultType="com.mes.glassinfo.entity.dto.HollowGlassInfoDTO"> |
| | | with glass_list as ( |
| | | SELECT flow_card_id, |
| | | glass_type, |
| | |
| | | FROM glass_info |
| | | where engineer_id = #{engineerId} |
| | | ) |
| | | select * |
| | | from glass_list |
| | | order by flow_card_id, height desc, width desc, tempering_layout_id, tempering_feed_sequence |
| | | select row_number() |
| | | over (order by flow_card_id, height desc, width desc, tempering_layout_id, tempering_feed_sequence) as rn, |
| | | t.* |
| | | from glass_list t |
| | | |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" |
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <parent> |
| | | <artifactId>hangzhoumesParent</artifactId> |
| | | <groupId>com.mes</groupId> |
| | | <version>1.0-SNAPSHOT</version> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>mesHub</artifactId> |
| | | |
| | | <properties> |
| | | <maven.compiler.source>8</maven.compiler.source> |
| | | <maven.compiler.target>8</maven.compiler.target> |
| | | </properties> |
| | | <dependencies> |
| | | <!--web 需要启动项目--> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-web</artifactId> |
| | | </dependency> |
| | | |
| | | |
| | | <dependency> |
| | | <artifactId>servicebase</artifactId> |
| | | <groupId>com.mes</groupId> |
| | | <version>1.0-SNAPSHOT</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-test</artifactId> |
| | | <scope>test</scope> |
| | | </dependency> |
| | | </dependencies> |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | </project> |
New file |
| | |
| | | package com.mes; |
| | | |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/11/28 15:52 |
| | | * @Description: |
| | | */ |
| | | @SpringBootApplication |
| | | @EnableSwagger2WebMvc |
| | | @EnableDiscoveryClient |
| | | @MapperScan(basePackages = "com.mes.*.mapper") |
| | | @EnableScheduling |
| | | public class MesHubApplication { |
| | | public static void main(String[] args) { |
| | | SpringApplication.run(MesHubApplication.class, args); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 127.0.0.1:8848 |
| | | application: |
| | | name: cacheGlass |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | password: 123456 |
New file |
| | |
| | | server: |
| | | port: 8180 |
| | | |
| | | spring: |
| | | application: |
| | | name: mesHub |
| | | liquibase: |
| | | enabled: false |
| | | task: |
| | | scheduling: |
| | | pool: |
| | | size: 10 |
| | | thread-name-prefix: mesHub |
| | | profiles: |
| | | active: dev |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | kangaroohy: |
| | | milo: |
| | | enabled: false |
| | | primary: default |
| | | config: |
| | | default: |
| | | endpoint: opc.tcp://192.168.2.100:49320 |
| | | security-policy: basic256sha256 |
| | | username: admin |
| | | password: 1qaz2wsx3edc4rfv |
| | | |
| | |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" |
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <parent> |
| | | <artifactId>moduleService</artifactId> |
| | | <groupId>com.mes</groupId> |
| | | <version>1.0-SNAPSHOT</version> |
| | | <relativePath>../pom.xml</relativePath> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | <parent> |
| | | <artifactId>moduleService</artifactId> |
| | | <groupId>com.mes</groupId> |
| | | <version>1.0-SNAPSHOT</version> |
| | | <relativePath>../pom.xml</relativePath> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>cacheVerticalGlass</artifactId> |
| | | <artifactId>cacheVerticalGlass</artifactId> |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>junit</groupId> |
| | |
| | | <scope>test</scope> |
| | | </dependency> |
| | | </dependencies> |
| | | <properties> |
| | | <maven.compiler.source>8</maven.compiler.source> |
| | | <maven.compiler.target>8</maven.compiler.target> |
| | | </properties> |
| | | <properties> |
| | | <maven.compiler.source>8</maven.compiler.source> |
| | | <maven.compiler.target>8</maven.compiler.target> |
| | | </properties> |
| | | |
| | | </project> |
| | |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private double thickness; |
| | | |
| | | /** |
| | | * 钢化版图id |
| | | * x坐标 |
| | | */ |
| | | @ApiModelProperty(value = "钢化版图id", position = 12) |
| | | private Integer temperingLayoutId; |
| | | @ApiModelProperty(value = "x坐标", position = 13) |
| | | private Integer xCoordinate; |
| | | |
| | | /** |
| | | * 钢化版图片序 |
| | | * y坐标 |
| | | */ |
| | | @ApiModelProperty(value = "钢化版图片序", position = 13) |
| | | private Integer temperingFeedSequence; |
| | | @ApiModelProperty(value = "y坐标", position = 14) |
| | | private Integer yCoordinate; |
| | | |
| | | /** |
| | | * 状态 |
| | |
| | | /** |
| | | * 工程号 |
| | | */ |
| | | @ApiModelProperty(value = "工程号", position = 16) |
| | | private String engineerId; |
| | | |
| | | /** |
| | | * 工程号 |
| | | */ |
| | | @ApiModelProperty(value = "层", position = 17) |
| | | private int layer; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createTime; |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 进片任务 |
| | | */ |
| | | @ApiModelProperty(value = "进片任务", position = 18) |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.bigstorage.entity.BigStorageGlassRelationInfo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (BigStorageGlassRelationInfo)表数据库访问层 |
| | |
| | | */ |
| | | public interface BigStorageGlassRelationInfoMapper extends BaseMapper<BigStorageGlassRelationInfo> { |
| | | |
| | | List<String> queryNeedOutGlassId(@Param("engineerId") String engineerId, @Param("temperingLayoutId") Integer temperingLayoutId, @Param("temperingFeedSequence") Integer temperingFeedSequence); |
| | | } |
| | | |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | BigStorageDTO queryBigStorageTargetSlot(String glassId); |
| | | BigStorageDTO queryBigStorageTargetSlot(String engineerId, Integer temperingLayoutId, Integer temperingFeedSequence); |
| | | |
| | | /** |
| | | * 生成中空玻璃信息 |
| | | */ |
| | | void generateBigStorageGlassInfo(String glassId); |
| | | void generateBigStorageGlassInfo(String engineerId, int temperingLayoutId); |
| | | |
| | | /** |
| | | * 格子配对 |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.bigstorage.entity.BigStorageGlassRelationInfo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (BigStorageGlassRelationInfo)表服务接口 |
| | | * |
| | |
| | | */ |
| | | public interface BigStorageGlassRelationInfoService extends IService<BigStorageGlassRelationInfo> { |
| | | |
| | | List<String> queryNeedOutGlassId(String engineerId, Integer temperingLayoutId, Integer temperingFeedSequence); |
| | | } |
| | | |
| | |
| | | } |
| | | bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth) |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth).orderByAsc(BigStorageCage::getSlot) |
| | | // .notInSql(BigStorageCage::getSlot, "select distinct slot from big_storage_cage_details where state = 0") |
| | | .inSql(BigStorageCage::getDeviceId, |
| | | "select distinct device_id from big_storage_cage_details where engineer_id = '" + glassInfo.getEngineerId() + "' and tempering_layout_id = " + glassInfo.getTemperingLayoutId()) |
| | |
| | | } |
| | | for (Integer item : deviceUsedList) { |
| | | bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth) |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth).orderByAsc(BigStorageCage::getSlot) |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | .eq(BigStorageCage::getDeviceId, item) |
| | | .last("limit 1")); |
| | |
| | | .orderByDesc(GlassInfo::getTemperingFeedSequence); |
| | | List<GlassInfo> glassInfoList = glassInfoService.list(glassInfoWrapper); |
| | | if (glassInfoList.size() == Integer.parseInt(temperingNo.toString())) { |
| | | for (GlassInfo glassInfo : glassInfoList |
| | | ) { |
| | | |
| | | for (GlassInfo glassInfo : glassInfoList) { |
| | | TemperingGlassInfo temperingGlassInfo = new TemperingGlassInfo(); |
| | | BeanUtils.copyProperties(glassInfo, temperingGlassInfo); |
| | | temperingGlassInfoService.save(temperingGlassInfo); |
| | | |
| | | } |
| | | key = true; |
| | | } |
| | |
| | | MPJLambdaWrapper<BigStorageCage> wrapper = new MPJLambdaWrapper<>(); |
| | | wrapper.selectAll(BigStorageCage.class).selectCollection(BigStorageCageDetails.class, BigStorageCage::getBigStorageCageDetails) |
| | | .leftJoin(BigStorageCageDetails.class, on -> on.eq(BigStorageCageDetails::getSlot, BigStorageCage::getSlot) |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN, Const.GLASS_STATE_ARTIFICIAL, Const.GLASS_STATE_OUT_ING)); |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL).orderByAsc(BigStorageCageDetails::getUpdateTime)); |
| | | List<BigStorageCage> bigStorageCages = bigStorageCageMapper.selectJoinList(BigStorageCage.class, wrapper); |
| | | Map<Integer, List<BigStorageCage>> listMap = bigStorageCages.stream().collect(Collectors.groupingBy(item -> item.getDeviceId())); |
| | | return listMap; |
| | |
| | | import com.mes.bigstorage.entity.BigStorageGlassInfo; |
| | | import com.mes.bigstorage.entity.BigStorageGlassRelationInfo; |
| | | import com.mes.bigstorage.entity.dto.BigStorageDTO; |
| | | import com.mes.bigstorage.entity.dto.BigStorageRelationDTO; |
| | | import com.mes.bigstorage.entity.dto.BigStorageSequenceDTO; |
| | | import com.mes.bigstorage.mapper.BigStorageGlassInfoMapper; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | |
| | | private Integer slotWidth; |
| | | @Value("${mes.glassGap}") |
| | | private Integer glassGap; |
| | | @Value("${mes.outCarMaxSize}") |
| | | private Integer outCarMaxSize; |
| | | |
| | | @Override |
| | | public BigStorageDTO queryBigStorageTargetSlot(String glassId) { |
| | | public BigStorageDTO queryBigStorageTargetSlot(String engineerId, Integer temperingLayoutId, Integer temperingFeedSequence) { |
| | | //按照玻璃信息获取关系表是否有对应的关系 |
| | | BigStorageGlassRelationInfo relationInfoOne = bigStorageGlassRelationInfoService.getOne(new LambdaQueryWrapper<BigStorageGlassRelationInfo>() |
| | | .eq(BigStorageGlassRelationInfo::getGlassId, glassId)); |
| | | .eq(BigStorageGlassRelationInfo::getEngineerId, engineerId) |
| | | .eq(BigStorageGlassRelationInfo::getTemperingLayoutId, temperingLayoutId) |
| | | .eq(BigStorageGlassRelationInfo::getTemperingFeedSequence, temperingFeedSequence) |
| | | ); |
| | | if (relationInfoOne == null) { |
| | | //理片笼关系表中没有对应的数据,查看理片笼虚拟位置表是否有本工程下的所有玻璃虚拟信息 |
| | | BigStorageGlassInfo bigStorageGlassInfo = this.getOne(new LambdaQueryWrapper<BigStorageGlassInfo>().eq(BigStorageGlassInfo::getGlassId, glassId)); |
| | | BigStorageGlassInfo bigStorageGlassInfo = this.getOne(new LambdaQueryWrapper<BigStorageGlassInfo>() |
| | | .eq(BigStorageGlassInfo::getEngineerId, engineerId) |
| | | .eq(BigStorageGlassInfo::getTemperingLayoutId, temperingLayoutId) |
| | | .eq(BigStorageGlassInfo::getTemperingFeedSequence, temperingFeedSequence)); |
| | | if (null == bigStorageGlassInfo) { |
| | | //虚拟位置表没有本工程下的所有玻璃虚拟信息,按照玻璃id生成本工程下所有玻璃的虚拟信息 |
| | | generateBigStorageGlassInfo(glassId); |
| | | bigStorageGlassInfo = this.getOne(new LambdaQueryWrapper<BigStorageGlassInfo>().eq(BigStorageGlassInfo::getGlassId, glassId)); |
| | | generateBigStorageGlassInfo(engineerId, temperingLayoutId); |
| | | bigStorageGlassInfo = this.getOne(new LambdaQueryWrapper<BigStorageGlassInfo>() |
| | | .eq(BigStorageGlassInfo::getEngineerId, engineerId) |
| | | .eq(BigStorageGlassInfo::getTemperingLayoutId, temperingLayoutId) |
| | | .eq(BigStorageGlassInfo::getTemperingFeedSequence, temperingFeedSequence)); |
| | | } |
| | | //按照虚拟位置和大理片笼现有可用格子生成关系表 |
| | | bigStorageSlotPair(bigStorageGlassInfo); |
| | | //关系表获取实际位置 |
| | | relationInfoOne = bigStorageGlassRelationInfoService.getOne(new LambdaQueryWrapper<BigStorageGlassRelationInfo>() |
| | | .eq(BigStorageGlassRelationInfo::getGlassId, glassId)); |
| | | .eq(BigStorageGlassRelationInfo::getEngineerId, engineerId) |
| | | .eq(BigStorageGlassRelationInfo::getTemperingLayoutId, temperingLayoutId) |
| | | .eq(BigStorageGlassRelationInfo::getTemperingFeedSequence, temperingFeedSequence)); |
| | | } |
| | | BigStorageCageDetails bigStorageCageDetails = bigStorageCageDetailsService.getOne(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .eq(BigStorageCageDetails::getSlot, relationInfoOne.getSlot()).in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL_ZERO) |
| | |
| | | if (null == relationInfoBefore) { |
| | | //表示序号没有或者 序号为1又不是第一块来的 新开一格 |
| | | storageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON).eq(BigStorageCage::getRemainWidth, slotWidth).last("limit 1")); |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON).eq(BigStorageCage::getRemainWidth, slotWidth).orderByAsc(BigStorageCage::getSlot).last("limit 1")); |
| | | } else { |
| | | BigStorageCageDetails beforeGlass = bigStorageCageDetailsService.getOne(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL_ZERO).eq(BigStorageCageDetails::getGlassId, relationInfoBefore.getGlassId()) |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL_ZERO) |
| | | .eq(BigStorageCageDetails::getEngineerId, relationInfoBefore.getEngineerId()) |
| | | .eq(BigStorageCageDetails::getTemperingLayoutId, relationInfoBefore.getTemperingLayoutId()) |
| | | .eq(BigStorageCageDetails::getTemperingFeedSequence, relationInfoBefore.getTemperingFeedSequence()) |
| | | ); |
| | | if (null == beforeGlass) { |
| | | storageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON).eq(BigStorageCage::getRemainWidth, slotWidth).last("limit 1")); |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON).eq(BigStorageCage::getRemainWidth, slotWidth).orderByAsc(BigStorageCage::getSlot).last("limit 1")); |
| | | } else { |
| | | storageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON).eq(BigStorageCage::getSlot, beforeGlass.getSlot())); |
| | |
| | | return storageDTO; |
| | | } |
| | | |
| | | public void dispatchBigStorageSlot() { |
| | | //todo:获取笼内单格已经到齐的玻璃格子信息 |
| | | List<BigStorageRelationDTO> virtualList = bigStorageCageDetailsService.queryIsAllNeedDispatchVirtualSlot(); |
| | | if (CollectionUtil.isEmpty(virtualList)) { |
| | | log.info("没有需要调度的格子"); |
| | | } |
| | | for (BigStorageRelationDTO dto : virtualList) { |
| | | List<BigStorageSequenceDTO> sequenceDTOList = bigStorageCageDetailsService.dispatchBigStorageGlassInfo(dto); |
| | | if (CollectionUtil.isEmpty(sequenceDTOList) || sequenceDTOList.size() == 1) { |
| | | continue; |
| | | } |
| | | int sequence = 0; |
| | | int startSlot = 0; |
| | | int targetSlot = 0; |
| | | for (BigStorageSequenceDTO item : sequenceDTOList) { |
| | | if (item.getMinSequence() == sequence + 1) { |
| | | //生成调度任务 |
| | | startSlot = item.getSlot(); |
| | | break; |
| | | } |
| | | sequence = item.getMaxSequence(); |
| | | targetSlot = item.getSlot(); |
| | | } |
| | | } |
| | | // |
| | | } |
| | | |
| | | @Override |
| | | public void generateBigStorageGlassInfo(String glassId) { |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassId)); |
| | | public void generateBigStorageGlassInfo(String engineerId, int temperingLayoutId) { |
| | | List<BigStorageGlassInfo> list = this.list(new LambdaQueryWrapper<BigStorageGlassInfo>() |
| | | .eq(BigStorageGlassInfo::getEngineerId, glassInfo.getEngineerId()).eq(BigStorageGlassInfo::getTemperingLayoutId, glassInfo.getTemperingLayoutId())); |
| | | .eq(BigStorageGlassInfo::getEngineerId, engineerId).eq(BigStorageGlassInfo::getTemperingLayoutId, temperingLayoutId)); |
| | | if (CollectionUtil.isNotEmpty(list)) { |
| | | return; |
| | | } |
| | |
| | | // .eq(Engineering::getEngineerId, glassInfo.getEngineerId())); |
| | | //获取玻璃的工程id,按照工程id获取工程下的所有玻璃信息 |
| | | List<GlassInfo> glassInfoList = glassInfoService.list(new LambdaQueryWrapper<GlassInfo>() |
| | | .eq(GlassInfo::getEngineerId, glassInfo.getEngineerId()) |
| | | .eq(GlassInfo::getEngineerId, engineerId) |
| | | .orderByAsc(GlassInfo::getTemperingLayoutId).orderByAsc(GlassInfo::getTemperingFeedSequence)); |
| | | Map<Integer, List<GlassInfo>> trmperingIdMap = glassInfoList.stream().collect(Collectors.groupingBy(GlassInfo::getTemperingLayoutId)); |
| | | List<BigStorageGlassInfo> bigStorageGlassInfoList = new ArrayList<>(); |
| | |
| | | int slotSequence = 1; |
| | | for (GlassInfo item : v) { |
| | | int maxLength = (int) Math.max(item.getWidth(), item.getHeight()); |
| | | if (remainWidth > maxLength) { |
| | | if (remainWidth > maxLength && slotSequence <= outCarMaxSize) { |
| | | remainWidth = remainWidth - maxLength - glassGap; |
| | | } else { |
| | | slotNumber = slotNumber + 1; |
| | |
| | | public int bigStorageSlotPair(BigStorageGlassInfo bigStorageGlassInfo) { |
| | | //获取所有空闲可用的格子号 |
| | | BigStorageCage storageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON).eq(BigStorageCage::getRemainWidth, slotWidth).last("limit 1")); |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON).eq(BigStorageCage::getRemainWidth, slotWidth).orderByAsc(BigStorageCage::getSlot).last("limit 1")); |
| | | Assert.isTrue(null != storageCage, "没有空余的笼子存放玻璃"); |
| | | Integer slot = storageCage.getSlot(); |
| | | //获取该工程同一流程卡同一车的玻璃信息 |
| | |
| | | import com.mes.bigstorage.service.BigStorageGlassRelationInfoService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (BigStorageGlassRelationInfo)表服务实现类 |
| | | * |
| | |
| | | @Service |
| | | public class BigStorageGlassRelationInfoServiceImpl extends ServiceImpl<BigStorageGlassRelationInfoMapper, BigStorageGlassRelationInfo> implements BigStorageGlassRelationInfoService { |
| | | |
| | | @Override |
| | | public List<String> queryNeedOutGlassId(String engineerId, Integer temperingLayoutId, Integer temperingFeedSequence) { |
| | | return baseMapper.queryNeedOutGlassId(engineerId, temperingLayoutId, temperingFeedSequence); |
| | | } |
| | | } |
| | | |
| | |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.bigstorage.service.BigStorageGlassInfoService; |
| | | import com.mes.bigstorage.service.BigStorageGlassRelationInfoService; |
| | | import com.mes.bigstoragecagetask.entity.BigStorageCageHistoryTask; |
| | | import com.mes.bigstoragecagetask.entity.BigStorageCageTask; |
| | | import com.mes.bigstoragecagetask.service.BigStorageCageHistoryTaskService; |
| | |
| | | import com.mes.common.config.Const; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.edgglasstask.entity.EdgGlassTaskInfo; |
| | | import com.mes.edgglasstask.service.EdgGlassTaskInfoService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | |
| | | @Resource |
| | | private GlassInfoService glassInfoService; |
| | | @Resource |
| | | private BigStorageGlassRelationInfoService bigStorageGlassRelationInfoService; |
| | | @Resource |
| | | private BigStorageCageService bigStorageCageService; |
| | | @Resource |
| | | private BigStorageCageHistoryTaskService bigStorageCageHistoryTaskService; |
| | |
| | | private BigStorageCageTaskService bigStorageCageTaskService; |
| | | @Resource |
| | | private BigStorageGlassInfoService bigStorageGlassInfoService; |
| | | @Resource |
| | | private EdgGlassTaskInfoService edgGlassTaskInfoService; |
| | | |
| | | @Autowired(required = false) |
| | | MiloService miloService; |
| | |
| | | |
| | | @Value("${mes.sequence.order}") |
| | | private boolean sequenceOrder; |
| | | @Value("${mes.temperingOutTargetPosition}") |
| | | private Integer temperingOutTargetPosition; |
| | | @Value("${mes.artificialOutTargetPosition}") |
| | | private Integer artificialOutTargetPosition; |
| | | |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | |
| | | log.info("有正在执行的任务,结束进片任务"); |
| | | return; |
| | | } |
| | | //获取进片任务表 |
| | | List<BigStorageCageTask> inTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_in_one_task"); |
| | | //获取进片任务信息 |
| | | List<BigStorageCageTask> inTaskList = new ArrayList(); |
| | | ReadWriteEntity fromOpcUa = miloService.readFromOpcUa("DLP1A.DLP1A.FROM1"); |
| | | List<String> glassIdList = new ArrayList<>(); |
| | | for (int i = 1; i <= 6; i++) { |
| | | ReadWriteEntity requestWord = miloService.readFromOpcUa("DLP1A.DLP1A.DI" + i); |
| | | if (null != requestWord.getValue()) { |
| | | BigStorageCageTask task = new BigStorageCageTask(); |
| | | task.setGlassId(requestWord.getValue() + ""); |
| | | task.setStartSlot(Integer.parseInt(fromOpcUa.getValue() + "")); |
| | | inTaskList.add(task); |
| | | glassIdList.add(requestWord.getValue() + ""); |
| | | continue; |
| | | } |
| | | } |
| | | if (CollectionUtil.isEmpty(inTaskList)) { |
| | | log.info("当前大车无进片玻璃,结束进片任务"); |
| | | return; |
| | | } |
| | | |
| | | List<String> glassIdList = inTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList()); |
| | | log.info("获取任务的玻璃id:{}", glassIdList); |
| | | Map<String, Long> glassCountMap = glassIdList.stream().collect(Collectors.groupingBy(e -> e, Collectors.counting())); |
| | | for (Map.Entry<String, Long> entry : glassCountMap.entrySet()) { |
| | |
| | | } |
| | | List<GlassInfo> glassInfoList = glassInfoService.list(new LambdaQueryWrapper<GlassInfo>().in(GlassInfo::getGlassId, glassIdList)); |
| | | |
| | | if (glassInfoList.size() != inTaskList.size()) { |
| | | log.info("进片任务数量{}与玻璃数量{}不匹配,结束本次进片", inTaskList.size(), glassInfoList.size()); |
| | | //todo:向plc发送报警 |
| | | return; |
| | | } |
| | | //修改磨边对列表的玻璃状态 |
| | | edgGlassTaskInfoService.update(new LambdaUpdateWrapper<EdgGlassTaskInfo>() |
| | | .set(EdgGlassTaskInfo::getState, Const.EDG_GLASS_SUCCESS).in(EdgGlassTaskInfo::getGlassId, glassIdList)); |
| | | Map<String, List<GlassInfo>> glassListMap = glassInfoList.stream().collect(Collectors.groupingBy(GlassInfo::getGlassId)); |
| | | |
| | | //计算目标格子 |
| | | List<BigStorageCageHistoryTask> historyTasks = new ArrayList<>(); |
| | | for (BigStorageCageTask task : inTaskList) { |
| | | GlassInfo info = glassListMap.get(task.getGlassId()).get(0); |
| | | BigStorageDTO bigStorageDTO = bigStorageGlassInfoService.queryBigStorageTargetSlot(info.getGlassId()); |
| | | BigStorageDTO bigStorageDTO = bigStorageGlassInfoService.queryBigStorageTargetSlot(info.getEngineerId(), info.getTemperingLayoutId(), info.getTemperingFeedSequence()); |
| | | //获取目标格子信息 |
| | | // BigStorageDTO bigStorageDTO = bigStorageCageDetailsService.queryTargetSlotByTempering(info); |
| | | // 临时更新格子的剩余尺寸:防止相邻玻璃进同一格子造成剩余尺寸不足,玻璃越界的情况,任务完成后再次更新大理片笼表剩余宽度(按照笼内玻璃数量更新大理片笼剩余尺寸) |
| | |
| | | //历史数据入库 |
| | | bigStorageCageHistoryTaskService.saveBatch(historyTasks); |
| | | //向opc发送启动信号 |
| | | miloService.writeToOpcWord(generateReadWriteEntity("DLP1A.DLP1A.MesReply", 1)); |
| | | List<ReadWriteEntity> list = new ArrayList<>(); |
| | | for (int i = 1; i <= inTaskList.size(); i++) { |
| | | list.add(generateReadWriteEntity("DLP1A.DLP1A.TO" + i, inTaskList.get(i - 1).getTargetSlot())); |
| | | } |
| | | list.add(generateReadWriteEntity("DLP1A.DLP1A.MesReply", 1)); |
| | | miloService.writeToOpcWord(list); |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | |
| | | log.info("有正在执行的出片任务,结束本次出片任务"); |
| | | return; |
| | | } |
| | | //todo:是否允许钢化 |
| | | if (redisUtil.getCacheObject("temperingSwitch")) { |
| | | //是否有正在钢化的玻璃:钢化小片表关联历史任务表,筛选未出笼的玻璃信息 |
| | | //是否允许钢化 |
| | | //是否有正在钢化的玻璃:钢化小片表关联历史任务表,筛选未出笼的玻璃信息 |
| | | // 获取当前钢化任务未完成出片的玻璃信息 |
| | | List<TemperingGlassInfo> unFinishTemperingGlassInfoList = temperingGlassInfoService.list(new LambdaQueryWrapper<TemperingGlassInfo>().eq(TemperingGlassInfo::getState, Const.TEMPERING_NEW)); |
| | | if (CollectionUtil.isNotEmpty(unFinishTemperingGlassInfoList)) { |
| | | List<String> glassIdList = unFinishTemperingGlassInfoList.stream().map(TemperingGlassInfo::getGlassId).collect(Collectors.toList()); |
| | | List<BigStorageCageHistoryTask> historyTaskList = bigStorageCageHistoryTaskService.list(new LambdaQueryWrapper<BigStorageCageHistoryTask>() |
| | | .eq(BigStorageCageHistoryTask::getTaskType, Const.BIG_STORAGE_BEFORE_OUT) |
| | | .in(BigStorageCageHistoryTask::getGlassId, glassIdList)); |
| | | List<TemperingGlassInfo> temperingGlassList = unFinishTemperingGlassInfoList; |
| | | if (CollectionUtil.isNotEmpty(historyTaskList)) { |
| | | List<String> taskGlassList = historyTaskList.stream().map(BigStorageCageHistoryTask::getGlassId).collect(Collectors.toList()); |
| | | temperingGlassList = unFinishTemperingGlassInfoList.stream().filter(e -> !taskGlassList.contains(e.getGlassId())).collect(Collectors.toList()); |
| | | } |
| | | if (CollectionUtil.isNotEmpty(temperingGlassList)) { |
| | | log.info("有正在出片的钢化任务"); |
| | | computeOutGlassInfo(temperingGlassList, "big_storage_cage_out_one_task", Const.TEMPERING_OUT_TARGET_POSITION, Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_BEFORE_OUT); |
| | | Date endDate = new Date(); |
| | | log.info("大理片笼出片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | } |
| | | } |
| | | List<TemperingGlassInfo> unFinishTemperingGlassInfoList = temperingGlassInfoService.list(new LambdaQueryWrapper<TemperingGlassInfo>().eq(TemperingGlassInfo::getState, Const.TEMPERING_NEW)); |
| | | if (CollectionUtil.isNotEmpty(unFinishTemperingGlassInfoList)) { |
| | | // List<String> glassIdList = unFinishTemperingGlassInfoList.stream().map(TemperingGlassInfo::getGlassId).collect(Collectors.toList()); |
| | | // List<BigStorageCageHistoryTask> historyTaskList = bigStorageCageHistoryTaskService.list(new LambdaQueryWrapper<BigStorageCageHistoryTask>() |
| | | // .eq(BigStorageCageHistoryTask::getTaskType, Const.BIG_STORAGE_BEFORE_OUT) |
| | | // .in(BigStorageCageHistoryTask::getGlassId, glassIdList)); |
| | | // List<TemperingGlassInfo> temperingGlassList = unFinishTemperingGlassInfoList; |
| | | // if (CollectionUtil.isNotEmpty(historyTaskList)) { |
| | | // List<String> taskGlassList = historyTaskList.stream().map(BigStorageCageHistoryTask::getGlassId).collect(Collectors.toList()); |
| | | // temperingGlassList = unFinishTemperingGlassInfoList.stream().filter(e -> !taskGlassList.contains(e.getGlassId())).collect(Collectors.toList()); |
| | | // } |
| | | // if (CollectionUtil.isNotEmpty(unFinishTemperingGlassInfoList)) { |
| | | log.info("有正在出片的钢化任务"); |
| | | computeOutGlassInfoByVirtualSlot(unFinishTemperingGlassInfoList, "big_storage_cage_out_one_task", temperingOutTargetPosition, Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_BEFORE_OUT); |
| | | Date endDate = new Date(); |
| | | log.info("大理片笼出片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | } |
| | | |
| | | if (redisUtil.getCacheObject("temperingSwitch")) { |
| | | //钢化优先:获取理片笼 玻璃小片 破损表 数量 判断笼内版图是否到齐 |
| | | List<TemperingLayoutDTO> temperingLayoutDTOList = bigStorageCageDetailsService.temperingIsAll(); |
| | | if (CollectionUtil.isNotEmpty(temperingLayoutDTOList)) { |
| | |
| | | .orderBy(Boolean.TRUE, sequenceOrder, GlassInfo::getTemperingFeedSequence)); |
| | | if (CollectionUtil.isNotEmpty(temperingGlassInfos)) { |
| | | temperingGlassInfoService.saveBatch(temperingGlassInfos); |
| | | computeOutGlassInfo(temperingGlassInfos, "big_storage_cage_out_one_task", Const.TEMPERING_OUT_TARGET_POSITION, Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_BEFORE_OUT); |
| | | computeOutGlassInfoByVirtualSlot(temperingGlassInfos, "big_storage_cage_out_one_task", temperingOutTargetPosition, Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_BEFORE_OUT); |
| | | Date endDate = new Date(); |
| | | log.info("大理片笼出片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | |
| | | List<BigStorageCageDetails> artificialList = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_ARTIFICIAL) |
| | | .orderByAsc(BigStorageCageDetails::getSlot) |
| | | .orderByAsc(BigStorageCageDetails::getId)); |
| | | .orderByAsc(BigStorageCageDetails::getId).last("limit " + outCarMaxSize)); |
| | | if (CollectionUtil.isNotEmpty(artificialList)) { |
| | | computeOutGlassInfo(artificialList, "big_storage_cage_out_one_task", Const.ARTIFICIAL_OUT_TARGET_POSITION, Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_BEFORE_OUT); |
| | | computeOutGlassInfoByVirtualSlot(artificialList, "big_storage_cage_out_one_task", artificialOutTargetPosition, Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_BEFORE_OUT); |
| | | Date endDate = new Date(); |
| | | log.info("大理片笼出片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | |
| | | return; |
| | | } |
| | | List<BigStorageCageDetails> list = new ArrayList<>(); |
| | | loop: |
| | | for (BigStorageRelationDTO dto : virtualList) { |
| | | List<BigStorageSequenceDTO> sequenceDTOList = bigStorageCageDetailsService.dispatchBigStorageGlassInfo(dto); |
| | | if (CollectionUtil.isEmpty(sequenceDTOList) || sequenceDTOList.size() == 1) { |
| | |
| | | int targetSlot = item.getSlot(); |
| | | list = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN).eq(BigStorageCageDetails::getSlot, startSlot)); |
| | | computeOutGlassInfo(list, "big_storage_cage_out_one_task", targetSlot, Const.GLASS_STATE_SCHEDULE_ING, Const.BIG_STORAGE_BEFORE_DISPATCH); |
| | | computeOutGlassInfoByVirtualSlot(list, "big_storage_cage_out_one_task", targetSlot, Const.GLASS_STATE_SCHEDULE_ING, Const.BIG_STORAGE_BEFORE_DISPATCH); |
| | | List<Integer> slotList = new ArrayList<>(); |
| | | slotList.add(targetSlot); |
| | | updateSlotRemainBySlots(slotList); |
| | | break; |
| | | break loop; |
| | | } |
| | | sequence = item.getMaxSequence(); |
| | | startSlot = item.getSlot(); |
| | |
| | | return; |
| | | } |
| | | //获取进片任务表 |
| | | List<BigStorageCageTask> inTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_in_one_task"); |
| | | // List<BigStorageCageTask> inTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_in_one_task"); |
| | | List<BigStorageCageTask> inTaskList = new ArrayList(); |
| | | |
| | | List<String> glassIdList = new ArrayList<>(); |
| | | ReadWriteEntity toWord = miloService.readFromOpcUa("DLP1A.DLP1A.TO1"); |
| | | if ("0".equals(toWord.getValue() + "")) { |
| | | log.info("完成任务已执行,结束本次完成进片任务"); |
| | | return; |
| | | } |
| | | for (int i = 1; i <= 6; i++) { |
| | | ReadWriteEntity requestWord = miloService.readFromOpcUa("DLP1A.DLP1A.DI" + i); |
| | | ReadWriteEntity statetWord = miloService.readFromOpcUa("DLP1A.DLP1A.STATE" + i); |
| | | ReadWriteEntity toOpcUa = miloService.readFromOpcUa("DLP1A.DLP1A.TO" + i); |
| | | ReadWriteEntity fromOpcUa = miloService.readFromOpcUa("DLP1A.DLP1A.FROM" + i); |
| | | |
| | | if (null != requestWord.getValue()) { |
| | | BigStorageCageTask task = new BigStorageCageTask(); |
| | | task.setGlassId(requestWord.getValue() + ""); |
| | | task.setTargetSlot(Integer.parseInt(toOpcUa.getValue() + "")); |
| | | task.setTaskState(Integer.parseInt(statetWord.getValue() + "")); |
| | | task.setStartSlot(Integer.parseInt(fromOpcUa.getValue() + "")); |
| | | inTaskList.add(task); |
| | | glassIdList.add(requestWord.getValue() + ""); |
| | | continue; |
| | | } |
| | | } |
| | | if (CollectionUtil.isEmpty(inTaskList)) { |
| | | log.info("当前大车无进片玻璃,结束完成进片任务"); |
| | | return; |
| | |
| | | } |
| | | //清空启动状态 |
| | | //向opc发送启动信号 |
| | | miloService.writeToOpcWord(generateReadWriteEntity("DLP1A.DLP1A.MesReply", 0)); |
| | | //向opc发送启动信号 |
| | | List<ReadWriteEntity> list = new ArrayList<>(); |
| | | for (int i = 1; i <= 6; i++) { |
| | | list.add(generateReadWriteEntity("DLP1A.DLP1A.TO" + i, 0)); |
| | | } |
| | | list.add(generateReadWriteEntity("DLP1A.DLP1A.MesReply", 0)); |
| | | miloService.writeToOpcWord(list); |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | |
| | | if (finalTaskType.equals(Const.BIG_STORAGE_BEFORE_OUT)) { |
| | | outSuccessGlassSlot = v.stream().map(BigStorageCageTask::getStartSlot).collect(Collectors.toList()); |
| | | } else { |
| | | outSuccessGlassSlot = v.stream().map(BigStorageCageTask::getTargetSlot).collect(Collectors.toList()); |
| | | List<Integer> targetSuccessGlassSlot = v.stream().map(BigStorageCageTask::getTargetSlot).collect(Collectors.toList()); |
| | | List<Integer> startoutSuccessGlassSlot = v.stream().map(BigStorageCageTask::getStartSlot).collect(Collectors.toList()); |
| | | outSuccessGlassSlot.addAll(targetSuccessGlassSlot); |
| | | outSuccessGlassSlot.addAll(startoutSuccessGlassSlot); |
| | | } |
| | | List<UpdateBigStorageCageDTO> storageCageDTOList = v.stream().map(e -> { |
| | | UpdateBigStorageCageDTO storageCageDTO = new UpdateBigStorageCageDTO(); |
| | |
| | | List<String> glassList = noDealTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList()); |
| | | bigStorageCageDetailsService.update(new LambdaUpdateWrapper<BigStorageCageDetails>() |
| | | .set(BigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .ne(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT) |
| | | .in(BigStorageCageDetails::getGlassId, glassList)); |
| | | |
| | | } else { |
| | |
| | | bigStorageCageDetailsService.update(new LambdaUpdateWrapper<BigStorageCageDetails>() |
| | | .set(BigStorageCageDetails::getSlot, item.getStartSlot()) |
| | | .set(BigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .ne(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT) |
| | | .eq(BigStorageCageDetails::getGlassId, item.getGlassId())); |
| | | } |
| | | } |
| | |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | private <T extends BigStorageCageBaseInfo> Boolean computeOutGlassInfoByVirtualSlot(List<T> list, String tableName, int targetSlot, int state, int taskType) { |
| | | //任务数据:获取车子存放玻璃最大数量,玻璃间隔 |
| | | List<String> glassIdList = bigStorageGlassRelationInfoService.queryNeedOutGlassId( |
| | | list.get(0).getEngineerId(), list.get(0).getTemperingLayoutId(), list.get(0).getTemperingFeedSequence()); |
| | | List<T> outGlassList = list.stream().filter(e -> glassIdList.contains(e.getGlassId())).collect(Collectors.toList()); |
| | | Assert.isFalse(CollectionUtil.isEmpty(outGlassList), "未获取出片数据,结束出片任务"); |
| | | log.info("获取出片任务数据{}条,执行保存", outGlassList.size()); |
| | | List<BigStorageCageTask> bigStorageCageTaskList = outGlassList.stream() |
| | | .map(e -> new BigStorageCageTask(e.getGlassId(), e.getSlot(), targetSlot, 0)).collect(Collectors.toList()); |
| | | |
| | | List<String> glassIds = bigStorageCageTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList()); |
| | | int glassCount = bigStorageCageTaskList.size(); |
| | | //生成出片任务条数不足6补全 |
| | | while (bigStorageCageTaskList.size() < 6) { |
| | | bigStorageCageTaskList.add(new BigStorageCageTask("", 0, 0, 0)); |
| | | } |
| | | //清空任务表数据 |
| | | bigStorageCageTaskService.removeAll("big_storage_cage_out_one_task"); |
| | | bigStorageCageTaskService.saveTaskMessage(tableName, bigStorageCageTaskList); |
| | | List<BigStorageCageHistoryTask> historyList = bigStorageCageTaskList.stream().filter(e -> StringUtils.isNotBlank(e.getGlassId())).map(e -> { |
| | | BigStorageCageHistoryTask history = new BigStorageCageHistoryTask(); |
| | | BeanUtils.copyProperties(e, history); |
| | | history.setGlassCount(glassCount); |
| | | history.setTaskType(taskType); |
| | | return history; |
| | | }).collect(Collectors.toList()); |
| | | bigStorageCageHistoryTaskService.saveBatch(historyList); |
| | | |
| | | log.info("将出片玻璃{}玻璃状态改为出片中", glassIds); |
| | | bigStorageCageDetailsService.update(new LambdaUpdateWrapper<BigStorageCageDetails>() |
| | | .set(BigStorageCageDetails::getState, state) |
| | | .set(Const.RAW_GLASS_TASK_TYPE_DISPATCH.equals(taskType), BigStorageCageBaseInfo::getSlot, targetSlot) |
| | | .ne(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT) |
| | | .in(BigStorageCageDetails::getGlassId, glassIds)); |
| | | try { |
| | | miloService.writeToOpcWord(generateReadWriteEntity("DLP1B.DLP1B.MesReply", 1)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | | // /** |
| | | // * 出片一次仅生成一车玻璃 |
| | | // * |
| | | // * @param list |
| | | // * @param <T> |
| | | // * @return |
| | | // */ |
| | | private <T extends BigStorageCageBaseInfo> Boolean computeOutGlassInfo(List<T> list, String tableName, int targetSlot, int state, int taskType) { |
| | | //任务数据:获取车子存放玻璃最大数量,玻璃间隔 |
| | | List<BigStorageCageTask> bigStorageCageTaskList = new ArrayList<>(); |
| | |
| | | log.info("将出片玻璃{}玻璃状态改为出片中", glassIds); |
| | | bigStorageCageDetailsService.update(new LambdaUpdateWrapper<BigStorageCageDetails>() |
| | | .set(BigStorageCageDetails::getState, state) |
| | | .ne(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT) |
| | | .set(Const.GLASS_STATE_SCHEDULE_ING.equals(state), BigStorageCageBaseInfo::getSlot, targetSlot) |
| | | .in(BigStorageCageDetails::getGlassId, glassIds)); |
| | | try { |
| | |
| | | @Value("${mes.sequence.order}") |
| | | private boolean sequenceOrder; |
| | | |
| | | @Value("${mes.temperingOutTargetPosition}") |
| | | private Integer temperingOutTargetPosition; |
| | | @Value("${mes.artificialOutTargetPosition}") |
| | | private Integer artificialOutTargetPosition; |
| | | |
| | | |
| | | // @Scheduled(fixedDelay = 1000) |
| | | public void inBigStorageTask() throws Exception { |
| | |
| | | if (maxX + minLength <= xMaxSize) { |
| | | bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.TEMPERING_OUT_TARGET_POSITION, |
| | | e.getWidth() * 10, e.getHeight() * 10, 0, 0, 1, new Date())); |
| | | maxX = Math.max(maxX, e.getXCoordinate()); |
| | | // maxX = Math.max(maxX, e.getXCoordinate()); |
| | | } else { |
| | | break; |
| | | } |
| | |
| | | if (maxX + minLength <= xMaxSize) { |
| | | bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.TEMPERING_OUT_TARGET_POSITION, |
| | | e.getWidth() * 10, e.getHeight() * 10, trainNumber, serialNumber++, 1, new Date())); |
| | | maxX = Math.max(maxX, e.getXCoordinate()); |
| | | // maxX = Math.max(maxX, e.getXCoordinate()); |
| | | } else { |
| | | remainWidth = carWidth - maxLength - glassGap; |
| | | trainNumber = trainNumber + 1; |
| | | serialNumber = 1; |
| | | maxX = e.getXCoordinate(); |
| | | // maxX = e.getXCoordinate(); |
| | | bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.TEMPERING_OUT_TARGET_POSITION, |
| | | e.getWidth() * 10, e.getHeight(), trainNumber, serialNumber++, 1, new Date())); |
| | | } |
| | |
| | | import com.mes.base.entity.BigStorageCageBaseInfo; |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.entity.BigStorageDTO; |
| | | import com.mes.bigstorage.entity.dto.BigStorageDTO; |
| | | import com.mes.bigstorage.entity.dto.SlotSequenceDTO; |
| | | import com.mes.bigstorage.entity.dto.TemperingLayoutDTO; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | } |
| | | |
| | | |
| | | @Scheduled(fixedDelay = 10000) |
| | | // @Scheduled(fixedDelay = 10000) |
| | | public void plcToHomeEdgOutTask() { |
| | | String mesToPLCAddress = ""; |
| | | List<BigStorageCageOutTask> outingList = bigStorageCageOutTaskService.list(new LambdaQueryWrapper<BigStorageCageOutTask>() |
| | |
| | | /** |
| | | * 确认字清空 |
| | | */ |
| | | @Scheduled(fixedDelay = 300) |
| | | // @Scheduled(fixedDelay = 300) |
| | | public void confirmClear() { |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | String d01ToMES = plcParameterObject.getPlcParameter("D01ToMES").getValue(); |
| | |
| | | /** |
| | | * 进片状态修改 |
| | | */ |
| | | @Scheduled(fixedDelay = 300) |
| | | // @Scheduled(fixedDelay = 300) |
| | | public void feedStatusUpdate() { |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | List<String> glassIds1 = new ArrayList<>(); |
| | |
| | | edgGlassTaskInfoList = edgGlassTaskInfoService.list(new LambdaQueryWrapper<EdgGlassTaskInfo>() |
| | | .eq(EdgGlassTaskInfo::getLine, line) |
| | | .apply("time >= (select time from edg_glass_task_info where line='" + line + "' and glass_id = '" + glassId + "' and deleted = 0)") |
| | | .orderByAsc(EdgGlassTaskInfo::getTime)); |
| | | .orderByAsc(EdgGlassTaskInfo::getCreateTime)); |
| | | if (edgGlassTaskInfoList.size() == 0) { |
| | | edgGlassTaskInfoList = edgGlassTaskInfoService.list(new QueryWrapper<EdgGlassTaskInfo>() |
| | | .select("Top 1 *") |
| | |
| | | if (maxX + minLength <= xMaxSize) { |
| | | bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.TEMPERING_OUT_TARGET_POSITION, |
| | | e.getWidth() * 10, e.getHeight() * 10, 0, 0, 1, new Date())); |
| | | maxX = Math.max(maxX, e.getXCoordinate()); |
| | | // maxX = Math.max(maxX, e.getXCoordinate()); |
| | | } else { |
| | | break; |
| | | } |
| | |
| | | if (maxX + minLength <= xMaxSize) { |
| | | bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.TEMPERING_OUT_TARGET_POSITION, |
| | | e.getWidth() * 10, e.getHeight() * 10, trainNumber, serialNumber++, 1, new Date())); |
| | | maxX = Math.max(maxX, e.getXCoordinate()); |
| | | // maxX = Math.max(maxX, e.getXCoordinate()); |
| | | } else { |
| | | remainWidth = carWidth - maxLength - glassGap; |
| | | trainNumber = trainNumber + 1; |
| | | serialNumber = 1; |
| | | maxX = e.getXCoordinate(); |
| | | // maxX = e.getXCoordinate(); |
| | | bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.TEMPERING_OUT_TARGET_POSITION, |
| | | e.getWidth() * 10, e.getHeight(), trainNumber, serialNumber++, 1, new Date())); |
| | | } |
| | |
| | | return null; |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 300) |
| | | // @Scheduled(fixedDelay = 300) |
| | | public void querySizeByEngineerTask() { |
| | | log.info("查询结果:{}", querySizeByEngineer("P24072402", 1, 10, 8)); |
| | | log.info("查询结果:{}", querySizeByEngineer("P24072402", 1, 5, 8)); |
| | |
| | | |
| | | bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth) |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth).orderByAsc(BigStorageCage::getSlot) |
| | | .inSql(BigStorageCage::getDeviceId, |
| | | "select distinct device_id from big_storage_cage_details where engineer_id = '" + engineerId + "' and tempering_layout_id = " + temperingLayoutId) |
| | | .last("limit 1")); |
| | |
| | | List<Integer> deviceUsedList = bigStorageCageService.queryFreeDeviceByUsed(thickness); |
| | | for (Integer item : deviceUsedList) { |
| | | bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth) |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth).orderByAsc(BigStorageCage::getSlot) |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | .eq(BigStorageCage::getDeviceId, item) |
| | | .last("limit 1")); |
| | |
| | | |
| | | bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth) |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth).orderByAsc(BigStorageCage::getSlot) |
| | | .inSql(BigStorageCage::getDeviceId, |
| | | "select distinct device_id from big_storage_cage_details where engineer_id = '" + engineerId + "' and tempering_layout_id = " + temperingLayoutId) |
| | | .last("limit 1")); |
| | |
| | | List<Integer> deviceUsedList = bigStorageCageService.queryFreeDeviceByUsed(thickness); |
| | | for (Integer item : deviceUsedList) { |
| | | bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth) |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth).orderByAsc(BigStorageCage::getSlot) |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | .eq(BigStorageCage::getDeviceId, item) |
| | | .last("limit 1")); |
| | |
| | | carWidth: 6200 #大车宽度 |
| | | slotWidth: 6200 #大车宽度 |
| | | inCarMaxSize: 5 #进片大车最大存放玻璃数量 |
| | | outCarMaxSize: 3 #出片大车最大存放玻璃数量 |
| | | outCarMaxSize: 6 #出片大车最大存放玻璃数量 |
| | | glassGap: 250 #玻璃间距 |
| | | xMaxSize: 2800 |
| | | temperingOutTargetPosition: 930 |
| | | artificialOutTargetPosition: 931 |
| | | |
| | | scan: |
| | | ip: 192.168.30.199 |
| | | port: 5000 |
| | |
| | | (#{item.glassId}, #{item.targetSlot}) |
| | | </foreach> |
| | | ) |
| | | and state !=101 |
| | | </where> |
| | | </update> |
| | | |
| | |
| | | details_temp as ( |
| | | select t.engineer_id, t.tempering_layout_id, t.virtual_slot, count(1) as slot_count |
| | | from big_storage_glass_relation_info t |
| | | left join big_storage_cage_details t1 on t.glass_id = t1.glass_id |
| | | left join big_storage_cage_details t1 on |
| | | t.engineer_id = t1.engineer_id and t.tempering_layout_id = t1.tempering_layout_id and |
| | | t.tempering_feed_sequence = t1.tempering_feed_sequence |
| | | where t1.state = 100 |
| | | group by t.engineer_id, t.tempering_layout_id, t.virtual_slot |
| | | ), |
| | |
| | | |
| | | <select id="queryNeedDispatchSlot" resultMap="baseSlotSequenceDTO"> |
| | | with glass_id_temp as ( |
| | | select glass_id |
| | | select engineer_id, tempering_layout_id, tempering_feed_sequence |
| | | from big_storage_glass_relation_info |
| | | where (engineer_id, tempering_layout_id, virtual_slot) = |
| | | (#{engineerId}, #{temperingLayoutId}, #{virtualSlot}) |
| | | ) |
| | | select t.slot, max(t1.slot_sequence) as max_sequence, min(t1.slot_sequence) as min_sequence |
| | | select t.slot, max(t1.tempering_feed_sequence) as max_sequence, min(t1.tempering_feed_sequence) as min_sequence |
| | | from big_storage_cage_details t |
| | | inner join big_storage_glass_relation_info t1 on t.glass_id = t1.glass_id |
| | | where t.glass_id in (select * from glass_id_temp) |
| | | inner join big_storage_glass_relation_info t1 |
| | | on t.engineer_id = t1.engineer_id and t.tempering_layout_id = t1.tempering_layout_id and |
| | | t.tempering_feed_sequence = t1.tempering_feed_sequence |
| | | where (t.engineer_id, t.tempering_layout_id, t.tempering_feed_sequence) in |
| | | (select engineer_id, tempering_layout_id, tempering_feed_sequence from glass_id_temp) |
| | | and t.state = 100 |
| | | group by t.slot |
| | | order by max_sequence |
| | | </select> |
New file |
| | |
| | | <?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.bigstorage.mapper.BigStorageGlassRelationInfoMapper"> |
| | | |
| | | <select id="queryNeedOutGlassId" resultType="java.lang.String"> |
| | | select glass_id |
| | | from glass_info |
| | | where (engineer_id, tempering_layout_id, tempering_feed_sequence) in ( |
| | | SELECT engineer_id, tempering_layout_id, tempering_feed_sequence |
| | | FROM big_storage_glass_relation_info |
| | | WHERE (engineer_id, tempering_layout_id, virtual_slot) = |
| | | (SELECT engineer_id, tempering_layout_id, virtual_slot |
| | | FROM big_storage_glass_relation_info |
| | | WHERE engineer_id = #{engineerId} |
| | | and tempering_layout_id = #{temperingLayoutId} |
| | | and tempering_feed_sequence = #{temperingFeedSequence} |
| | | ) |
| | | ) |
| | | </select> |
| | | </mapper> |
| | |
| | | start_slot int DEFAULT '0' COMMENT '起始格子', |
| | | target_slot int DEFAULT '0' COMMENT '目标格子', |
| | | task_state int DEFAULT NULL COMMENT '任务状态 ' |
| | | ) |
| | | ); |
| | | -- rollback DROP TABLE big_storage_cage_in_one_task; |
| | | |
| | | -- changeset zsh:20241112003 |
| | |
| | | start_slot int DEFAULT '0' COMMENT '起始格子', |
| | | target_slot int DEFAULT '0' COMMENT '目标格子', |
| | | task_state int DEFAULT NULL COMMENT '任务状态 ' |
| | | ) |
| | | ); |
| | | -- rollback DROP TABLE big_storage_cage_out_one_task; |
| | | |
| | | -- changeset zsh:20241113002 |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" |
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <parent> |
| | | <artifactId>moduleService</artifactId> |
| | | <groupId>com.mes</groupId> |
| | | <version>1.0-SNAPSHOT</version> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>howllowGlass</artifactId> |
| | | |
| | | <properties> |
| | | <maven.compiler.source>8</maven.compiler.source> |
| | | <maven.compiler.target>8</maven.compiler.target> |
| | | </properties> |
| | | |
| | | </project> |
New file |
| | |
| | | package com.mes; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/11/28 14:21 |
| | | * @Description: |
| | | */ |
| | | @Slf4j |
| | | @SpringBootApplication |
| | | @EnableSwagger2WebMvc |
| | | @EnableDiscoveryClient |
| | | @MapperScan(basePackages = "com.mes.*.mapper") |
| | | @EnableScheduling |
| | | public class HollowGlassApplication { |
| | | |
| | | public static void main(String[] args) { |
| | | SpringApplication.run(HollowGlassApplication.class, args); |
| | | } |
| | | } |
File was renamed from hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/hollow/controller/BigStorageCageHollowController.java |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * (BigStorageCageHollow)表控制层 |
| | | * (HollowBigStorageCage)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-21 09:22:39 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("bigStorageCageHollow") |
| | | public class BigStorageCageHollowController { |
| | | @RequestMapping("hollowBigStorageCage") |
| | | public class HollowBigStorageCageController { |
| | | |
| | | } |
| | | |
File was renamed from hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/hollow/controller/BigStorageCageHollowDetailsController.java |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * (BigStorageCageHollowDetails)表控制层 |
| | | * (HollowBigStorageCageDetails)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-21 09:23:12 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("bigStorageCageHollowDetails") |
| | | public class BigStorageCageHollowDetailsController { |
| | | @RequestMapping("hollowBigStorageCageDetails") |
| | | public class HollowBigStorageCageDetailsController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.hollow.controller; |
| | | |
| | | |
| | | import com.mes.hollow.entity.HollowGlassOutRelationInfo; |
| | | import com.mes.hollow.service.HollowGlassOutRelationInfoService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * (HollowGlassOutRelationInfo)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-30 13:57:28 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("hollowGlassOutRelationInfo") |
| | | public class HollowGlassOutRelationInfoController { |
| | | |
| | | @Resource |
| | | HollowGlassOutRelationInfoService hollowGlassOutRelationInfoService; |
| | | |
| | | @ApiOperation("领取任务") |
| | | @PostMapping("/receiveTask") |
| | | public Result<HollowGlassOutRelationInfo> receiveTask(String flowCardId, int cell) { |
| | | return Result.success(hollowGlassOutRelationInfoService.receiveTask(flowCardId, cell)); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.hollow.controller; |
| | | |
| | | |
| | | import com.mes.hollow.entity.dto.FlowCardGlassInfoDTO; |
| | | import com.mes.hollow.entity.dto.LackDetailsDTO; |
| | | import com.mes.hollow.service.HollowGlassRelationInfoService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * (HollowGlassRelationInfo)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-23 15:59:27 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("hollowGlassRelationInfo") |
| | | public class HollowGlassRelationInfoController { |
| | | |
| | | @Resource |
| | | HollowGlassRelationInfoService hollowGlassRelationInfoService; |
| | | |
| | | @ApiOperation("界面点击创建任务:查询中空所有流程卡对应的玻璃信息") |
| | | @PostMapping("/queryHollowAllFlowCard") |
| | | public Result<Map<String, List<FlowCardGlassInfoDTO>>> queryHollowAllFlowCard() { |
| | | Map<String, List<FlowCardGlassInfoDTO>> bigStorageCageDetails = hollowGlassRelationInfoService.queryHollowAllFlowCard(); |
| | | return Result.success(bigStorageCageDetails); |
| | | } |
| | | |
| | | @ApiOperation("查询指定流程卡及层数的缺片详情") |
| | | @PostMapping("/queryLackByFlowCard") |
| | | public Result<List<LackDetailsDTO>> queryLackByFlowCard(String flowCardId, int layer) { |
| | | List<LackDetailsDTO> lackDetailsList = hollowGlassRelationInfoService.queryLackByFlowCard(flowCardId, layer); |
| | | return Result.success(lackDetailsList); |
| | | } |
| | | |
| | | } |
| | | |
File was renamed from hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/hollow/entity/BigStorageCageHollow.java |
| | |
| | | package com.mes.hollow.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * (BigStorageCageHollow)表实体类 |
| | | * (HollowBigStorageCage)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-21 09:22:45 |
| | | */ |
| | | @Data |
| | | public class BigStorageCageHollow { |
| | | public class HollowBigStorageCage { |
| | | /** |
| | | * /*大理片笼表id |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * /*设备id |
New file |
| | |
| | | package com.mes.hollow.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.mes.base.entity.BigStorageCageBaseInfo; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * (HollowBigStorageCageDetails)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-21 09:23:12 |
| | | */ |
| | | @Data |
| | | public class HollowBigStorageCageDetails extends BigStorageCageBaseInfo { |
| | | /** |
| | | * /*大理片笼详情表id |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * 设备id |
| | | */ |
| | | private Integer deviceId; |
| | | /** |
| | | * /*虚拟格子 |
| | | */ |
| | | private Integer virtualSlot; |
| | | /** |
| | | * /*小片在格内的顺序 |
| | | */ |
| | | private Integer sequence; |
| | | /** |
| | | * /*流程卡号 |
| | | */ |
| | | private String flowCardId; |
| | | /** |
| | | * /*玻璃类型 |
| | | */ |
| | | private Integer glassType; |
| | | /** |
| | | * 膜系 |
| | | */ |
| | | private String filmsId; |
| | | /** |
| | | * /*厚度 |
| | | */ |
| | | private Double thickness; |
| | | /** |
| | | * /*状态 |
| | | */ |
| | | private Integer state; |
| | | /** |
| | | * /*玻璃间隙 |
| | | */ |
| | | private Integer gap; |
| | | |
| | | private String engineerId; |
| | | /** |
| | | * /*层号 |
| | | */ |
| | | private Integer totalLayer; |
| | | |
| | | /** |
| | | * /*层号 |
| | | */ |
| | | private Integer hollowSequence; |
| | | /** |
| | | * /*层号 |
| | | */ |
| | | private Integer layer; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createTime; |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | private Date updateTime; |
| | | |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.hollow.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * (HollowGlassOutRelationInfo)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-30 13:57:29 |
| | | */ |
| | | @Data |
| | | public class HollowGlassOutRelationInfo { |
| | | /** |
| | | * /*中空玻璃关系表id |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * /*流程卡 |
| | | */ |
| | | private String flowCardId; |
| | | /** |
| | | * /*总层数 |
| | | */ |
| | | private Integer totalLayer; |
| | | /** |
| | | * /*路线 |
| | | */ |
| | | private Integer cell; |
| | | /** |
| | | * /*状态0新增 1执行中 2暂停 3结束 |
| | | */ |
| | | private Integer state; |
| | | /** |
| | | * /*创建时间 |
| | | */ |
| | | private Date createTime; |
| | | /** |
| | | * /*更新时间 |
| | | */ |
| | | private Date updateTime; |
| | | |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.hollow.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * (HollowGlassRelationInfo)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-23 15:59:29 |
| | | */ |
| | | @Data |
| | | public class HollowGlassRelationInfo { |
| | | /** |
| | | * /*中空玻璃关系表id |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 工程号 |
| | | */ |
| | | private String engineerId; |
| | | |
| | | /** |
| | | * 钢化版图id |
| | | */ |
| | | private Integer temperingLayoutId; |
| | | |
| | | /** |
| | | * 钢化版图片序 |
| | | */ |
| | | private Integer temperingFeedSequence; |
| | | |
| | | /** |
| | | * /*玻璃ID |
| | | */ |
| | | private String glassId; |
| | | /** |
| | | * /*流程卡 |
| | | */ |
| | | private String flowCardId; |
| | | |
| | | /** |
| | | * 膜系 |
| | | */ |
| | | private String filmsId; |
| | | |
| | | /** |
| | | * 宽度 |
| | | */ |
| | | private double width; |
| | | |
| | | /** |
| | | * 高度 |
| | | */ |
| | | private double height; |
| | | |
| | | /** |
| | | * /*厚度 |
| | | */ |
| | | private Double thickness; |
| | | /** |
| | | * /*总层数 |
| | | */ |
| | | private Integer totalLayer; |
| | | /** |
| | | * /*层数 |
| | | */ |
| | | private Integer layer; |
| | | /** |
| | | * /*虚拟格子号 |
| | | */ |
| | | private Integer virtualSlot; |
| | | /** |
| | | * /*中空格子次序 |
| | | */ |
| | | private Integer slotSequence; |
| | | /** |
| | | * /*中空总次序 |
| | | */ |
| | | private Integer hollowSequence; |
| | | /** |
| | | * /*中空总次序 |
| | | */ |
| | | private Integer orderSort; |
| | | |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.hollow.entity.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/11/25 18:53 |
| | | * @Description: |
| | | */ |
| | | @Data |
| | | public class BigStorageSequenceDTO { |
| | | |
| | | private Integer slot; |
| | | private Integer maxSequence; |
| | | private Integer minSequence; |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.hollow.entity.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/11/30 13:34 |
| | | * @Description: |
| | | */ |
| | | @Data |
| | | public class FlowCardGlassInfoDTO { |
| | | |
| | | /** |
| | | * 工程号 |
| | | */ |
| | | private String engineerId; |
| | | /** |
| | | * 流程卡 |
| | | */ |
| | | private String flowCardId; |
| | | /** |
| | | * 膜系 |
| | | */ |
| | | private String filmsId; |
| | | /** |
| | | * 层号 |
| | | */ |
| | | private int layer; |
| | | /** |
| | | * 层号 |
| | | */ |
| | | private int sumCount; |
| | | /** |
| | | * 配对数量 |
| | | */ |
| | | private int pairCount; |
| | | /** |
| | | * 实际数量 |
| | | */ |
| | | private int realCount; |
| | | /** |
| | | * 破损数量 |
| | | */ |
| | | private int damageCount; |
| | | /** |
| | | * 缺少数量 |
| | | */ |
| | | private int lackCount; |
| | | } |
New file |
| | |
| | | package com.mes.hollow.entity.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/11/30 16:10 |
| | | * @Description: |
| | | */ |
| | | @Data |
| | | public class FlowCardVirtualSlotDTO { |
| | | |
| | | /** |
| | | * 流程卡号 |
| | | */ |
| | | private String flowCardId; |
| | | /** |
| | | * /*虚拟格子 |
| | | */ |
| | | private Integer virtualSlot; |
| | | } |
New file |
| | |
| | | package com.mes.hollow.entity.dto; |
| | | |
| | | import com.mes.hollow.entity.HollowGlassRelationInfo; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/11/27 11:36 |
| | | * @Description: |
| | | */ |
| | | @Data |
| | | public class HollowBigStorageDTO extends HollowGlassRelationInfo { |
| | | /** |
| | | * 格子号 |
| | | */ |
| | | private Integer slot; |
| | | /** |
| | | * 剩余宽度 |
| | | */ |
| | | private Integer remainWidth; |
| | | |
| | | /** |
| | | * 玻璃数量 |
| | | */ |
| | | private Integer glassCount; |
| | | |
| | | /** |
| | | * 笼子号 |
| | | */ |
| | | private Integer deviceId; |
| | | } |
New file |
| | |
| | | package com.mes.hollow.entity.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/11/28 23:35 |
| | | * @Description: |
| | | */ |
| | | @Data |
| | | public class HollowGlassDetailsDTO { |
| | | |
| | | /** |
| | | * 流程卡号 |
| | | */ |
| | | private String flowCardId; |
| | | |
| | | /** |
| | | * 流程卡号 |
| | | */ |
| | | private Integer orderSort; |
| | | /** |
| | | * 宽度 |
| | | */ |
| | | private double width; |
| | | |
| | | /** |
| | | * 高度 |
| | | */ |
| | | private double height; |
| | | |
| | | /** |
| | | * /*厚度 |
| | | */ |
| | | private double thickness; |
| | | /** |
| | | * /*层数 |
| | | */ |
| | | private Integer layer; |
| | | |
| | | /** |
| | | * 数量 |
| | | */ |
| | | private Integer quantity; |
| | | |
| | | /** |
| | | * /*中空总次序 |
| | | */ |
| | | private Integer hollowSequence; |
| | | } |
New file |
| | |
| | | package com.mes.hollow.entity.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/11/25 18:53 |
| | | * @Description: |
| | | */ |
| | | @Data |
| | | public class LackDetailsDTO { |
| | | |
| | | /** |
| | | * 流程卡 |
| | | */ |
| | | private String flowCardId; |
| | | /** |
| | | * 流程卡 |
| | | */ |
| | | private int layer; |
| | | /** |
| | | * 膜系 |
| | | */ |
| | | private String filmsId; |
| | | /** |
| | | * 宽度 |
| | | */ |
| | | private double width; |
| | | |
| | | /** |
| | | * 高度 |
| | | */ |
| | | private double height; |
| | | |
| | | /** |
| | | * /*厚度 |
| | | */ |
| | | private Double thickness; |
| | | /** |
| | | * /*总片数 |
| | | */ |
| | | private Integer totalCount; |
| | | /** |
| | | * /*缺少片数 |
| | | */ |
| | | private Integer lackCount; |
| | | /** |
| | | * /*破损片数 |
| | | */ |
| | | private Integer damageCount; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.hollow.entity.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/7/26 9:05 |
| | | * @Description: |
| | | */ |
| | | @Data |
| | | public class UpdateHollowBigStorageCageDTO { |
| | | |
| | | private String glassId; |
| | | |
| | | private int targetSlot; |
| | | } |
New file |
| | |
| | | package com.mes.hollow.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.hollow.entity.HollowBigStorageCageDetails; |
| | | import com.mes.hollow.entity.dto.BigStorageSequenceDTO; |
| | | import com.mes.hollow.entity.dto.FlowCardGlassInfoDTO; |
| | | import com.mes.hollow.entity.dto.FlowCardVirtualSlotDTO; |
| | | import com.mes.hollow.entity.dto.UpdateHollowBigStorageCageDTO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (HollowBigStorageCageDetails)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-21 09:23:12 |
| | | */ |
| | | public interface HollowBigStorageCageDetailsMapper extends BaseMapper<HollowBigStorageCageDetails> { |
| | | |
| | | void updateBySlot(@Param("list") List<UpdateHollowBigStorageCageDTO> storageCageDTOList, @Param("state") Integer state); |
| | | |
| | | List<FlowCardGlassInfoDTO> hollowIsAll(@Param("flowCardId") String flowCardId, @Param("totalLayer") int totalLayer, @Param("flag") Boolean flag); |
| | | |
| | | List<FlowCardVirtualSlotDTO> queryIsAllNeedDispatchVirtualSlot(); |
| | | |
| | | List<BigStorageSequenceDTO> queryNeedDispatchSlot(FlowCardVirtualSlotDTO flowCardVirtualSlotDTO); |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.hollow.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.hollow.entity.HollowBigStorageCage; |
| | | |
| | | /** |
| | | * (HollowBigStorageCage)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-21 09:22:40 |
| | | */ |
| | | public interface HollowBigStorageCageMapper extends BaseMapper<HollowBigStorageCage> { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.hollow.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.hollow.entity.HollowGlassOutRelationInfo; |
| | | |
| | | /** |
| | | * (HollowGlassOutRelationInfo)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-30 13:57:28 |
| | | */ |
| | | public interface HollowGlassOutRelationInfoMapper extends BaseMapper<HollowGlassOutRelationInfo> { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.hollow.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.hollow.entity.HollowGlassRelationInfo; |
| | | import com.mes.hollow.entity.dto.HollowGlassDetailsDTO; |
| | | import com.mes.hollow.entity.dto.LackDetailsDTO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (HollowGlassRelationInfo)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-23 15:59:29 |
| | | */ |
| | | public interface HollowGlassRelationInfoMapper extends BaseMapper<HollowGlassRelationInfo> { |
| | | |
| | | |
| | | List<HollowGlassDetailsDTO> queryFlowCardIdMaxLayerGlassInfo(@Param("flowCardId") String flowCardId, @Param("totalLayer") int totalLayer); |
| | | |
| | | |
| | | List<HollowGlassDetailsDTO> queryFlowCardIdLayerGlassInfo(@Param("flowCardId") String flowCardId, @Param("totalLayer") int totalLayer, @Param("layer") int layer); |
| | | |
| | | List<LackDetailsDTO> queryLackByFlowCard(String flowCardId, int layer); |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.hollow.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.hollow.entity.HollowBigStorageCageDetails; |
| | | import com.mes.hollow.entity.dto.BigStorageSequenceDTO; |
| | | import com.mes.hollow.entity.dto.FlowCardGlassInfoDTO; |
| | | import com.mes.hollow.entity.dto.FlowCardVirtualSlotDTO; |
| | | import com.mes.hollow.entity.dto.UpdateHollowBigStorageCageDTO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (HollowBigStorageCageDetails)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-21 09:23:12 |
| | | */ |
| | | public interface HollowBigStorageCageDetailsService extends IService<HollowBigStorageCageDetails> { |
| | | |
| | | void updateBySlot(List<UpdateHollowBigStorageCageDTO> storageCageDTOList, Integer glassStateIn); |
| | | |
| | | List<FlowCardGlassInfoDTO> hollowIsAll(String flow_card_id, Integer totalLayer, Boolean flag); |
| | | |
| | | |
| | | List<FlowCardVirtualSlotDTO> queryIsAllNeedDispatchVirtualSlot(); |
| | | |
| | | List<BigStorageSequenceDTO> queryNeedDispatchSlot(FlowCardVirtualSlotDTO flowCardVirtualSlotDTO); |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.hollow.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.hollow.entity.HollowBigStorageCage; |
| | | |
| | | /** |
| | | * (HollowBigStorageCage)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-21 09:22:45 |
| | | */ |
| | | public interface HollowBigStorageCageService extends IService<HollowBigStorageCage> { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.hollow.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.hollow.entity.HollowGlassOutRelationInfo; |
| | | |
| | | /** |
| | | * (HollowGlassOutRelationInfo)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-30 13:57:29 |
| | | */ |
| | | public interface HollowGlassOutRelationInfoService extends IService<HollowGlassOutRelationInfo> { |
| | | |
| | | HollowGlassOutRelationInfo receiveTask(String flowCardId, int cell); |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.hollow.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.hollow.entity.HollowGlassRelationInfo; |
| | | import com.mes.hollow.entity.dto.FlowCardGlassInfoDTO; |
| | | import com.mes.hollow.entity.dto.HollowBigStorageDTO; |
| | | import com.mes.hollow.entity.dto.LackDetailsDTO; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * (HollowGlassRelationInfo)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-23 15:59:30 |
| | | */ |
| | | public interface HollowGlassRelationInfoService extends IService<HollowGlassRelationInfo> { |
| | | /** |
| | | * 按照玻璃id获取中空目标格子 |
| | | * |
| | | * @return |
| | | */ |
| | | HollowBigStorageDTO queryHollowTargetSlot(String flowCardId, double width, double height, int totalLayer, int layer); |
| | | |
| | | /** |
| | | * 生成中空玻璃信息 |
| | | */ |
| | | void generateHollowGlassInfo(String flowCardId, int totalLayer, int layer); |
| | | |
| | | Map<String, List<FlowCardGlassInfoDTO>> queryHollowAllFlowCard(); |
| | | |
| | | List<LackDetailsDTO> queryLackByFlowCard(String flowCardId, int layer); |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.hollow.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.hollow.entity.HollowBigStorageCageDetails; |
| | | import com.mes.hollow.entity.dto.BigStorageSequenceDTO; |
| | | import com.mes.hollow.entity.dto.FlowCardGlassInfoDTO; |
| | | import com.mes.hollow.entity.dto.FlowCardVirtualSlotDTO; |
| | | import com.mes.hollow.entity.dto.UpdateHollowBigStorageCageDTO; |
| | | import com.mes.hollow.mapper.HollowBigStorageCageDetailsMapper; |
| | | import com.mes.hollow.service.HollowBigStorageCageDetailsService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (HollowBigStorageCageDetails)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-21 09:23:12 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class HollowBigStorageCageDetailsServiceImpl extends ServiceImpl<HollowBigStorageCageDetailsMapper, HollowBigStorageCageDetails> implements HollowBigStorageCageDetailsService { |
| | | |
| | | |
| | | @Override |
| | | public void updateBySlot(List<UpdateHollowBigStorageCageDTO> storageCageDTOList, Integer state) { |
| | | baseMapper.updateBySlot(storageCageDTOList, state); |
| | | } |
| | | |
| | | @Override |
| | | public List<FlowCardGlassInfoDTO> hollowIsAll(String flow_card_id, Integer totalLayer, Boolean flag) { |
| | | return baseMapper.hollowIsAll(flow_card_id, totalLayer, flag); |
| | | } |
| | | |
| | | @Override |
| | | public List<FlowCardVirtualSlotDTO> queryIsAllNeedDispatchVirtualSlot() { |
| | | return baseMapper.queryIsAllNeedDispatchVirtualSlot(); |
| | | } |
| | | |
| | | @Override |
| | | public List<BigStorageSequenceDTO> queryNeedDispatchSlot(FlowCardVirtualSlotDTO flowCardVirtualSlotDTO) { |
| | | return baseMapper.queryNeedDispatchSlot(flowCardVirtualSlotDTO); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.hollow.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.hollow.entity.HollowBigStorageCage; |
| | | import com.mes.hollow.mapper.HollowBigStorageCageMapper; |
| | | import com.mes.hollow.service.HollowBigStorageCageService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * (HollowBigStorageCage)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-21 09:22:46 |
| | | */ |
| | | @Service |
| | | public class HollowBigStorageCageServiceImpl extends ServiceImpl<HollowBigStorageCageMapper, HollowBigStorageCage> implements HollowBigStorageCageService { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.hollow.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.hollow.entity.HollowGlassOutRelationInfo; |
| | | import com.mes.hollow.mapper.HollowGlassOutRelationInfoMapper; |
| | | import com.mes.hollow.service.HollowGlassOutRelationInfoService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * (HollowGlassOutRelationInfo)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-30 13:57:29 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class HollowGlassOutRelationInfoServiceImpl extends ServiceImpl<HollowGlassOutRelationInfoMapper, HollowGlassOutRelationInfo> implements HollowGlassOutRelationInfoService { |
| | | |
| | | @Resource |
| | | GlassInfoService glassInfoService; |
| | | |
| | | @Override |
| | | public HollowGlassOutRelationInfo receiveTask(String flowCardId, int cell) { |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getFlowCardId, flowCardId).last("limit 1")); |
| | | HollowGlassOutRelationInfo info = new HollowGlassOutRelationInfo(); |
| | | if (null == glassInfo) { |
| | | log.info("该流程卡信息系统未找到"); |
| | | return info; |
| | | } |
| | | info.setFlowCardId(flowCardId); |
| | | info.setCell(cell); |
| | | info.setTotalLayer(glassInfo.getTotalLayer()); |
| | | info.setTotalLayer(glassInfo.getTotalLayer()); |
| | | info.setState(Const.HOLLOW_FLOW_CARD_NEW); |
| | | this.save(info); |
| | | return info; |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.hollow.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.hutool.core.lang.Assert; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.hollow.entity.HollowBigStorageCage; |
| | | import com.mes.hollow.entity.HollowBigStorageCageDetails; |
| | | import com.mes.hollow.entity.HollowGlassRelationInfo; |
| | | import com.mes.hollow.entity.dto.FlowCardGlassInfoDTO; |
| | | import com.mes.hollow.entity.dto.HollowBigStorageDTO; |
| | | import com.mes.hollow.entity.dto.HollowGlassDetailsDTO; |
| | | import com.mes.hollow.entity.dto.LackDetailsDTO; |
| | | import com.mes.hollow.mapper.HollowGlassRelationInfoMapper; |
| | | import com.mes.hollow.service.HollowBigStorageCageDetailsService; |
| | | import com.mes.hollow.service.HollowBigStorageCageService; |
| | | import com.mes.hollow.service.HollowGlassRelationInfoService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * (HollowGlassRelationInfo)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-23 15:59:30 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class HollowGlassRelationInfoServiceImpl extends ServiceImpl<HollowGlassRelationInfoMapper, HollowGlassRelationInfo> implements HollowGlassRelationInfoService { |
| | | |
| | | @Resource |
| | | GlassInfoService glassInfoService; |
| | | @Resource |
| | | HollowBigStorageCageService hollowBigStorageCageService; |
| | | @Resource |
| | | HollowGlassRelationInfoService hollowGlassRelationInfoService; |
| | | @Resource |
| | | HollowBigStorageCageDetailsService hollowBigStorageCageDetailsService; |
| | | @Value("${mes.slotWidth}") |
| | | private Integer slotWidth; |
| | | @Value("${mes.glassGap}") |
| | | private Integer glassGap; |
| | | |
| | | @Value("${mes.outCarMaxSize}") |
| | | private Integer outCarMaxSize; |
| | | |
| | | @Override |
| | | public HollowBigStorageDTO queryHollowTargetSlot(String flowCardId, double width, double height, int totalLayer, int layer) { |
| | | //按照玻璃信息获取关系表中对应的大理片笼格子号 |
| | | HollowGlassRelationInfo relationInfoOne = hollowGlassRelationInfoService.getOne(new LambdaQueryWrapper<HollowGlassRelationInfo>() |
| | | .eq(HollowGlassRelationInfo::getFlowCardId, flowCardId) |
| | | .eq(HollowGlassRelationInfo::getWidth, width) |
| | | .eq(HollowGlassRelationInfo::getHeight, height) |
| | | .eq(HollowGlassRelationInfo::getLayer, layer) |
| | | .isNull(HollowGlassRelationInfo::getTemperingLayoutId) |
| | | .isNull(HollowGlassRelationInfo::getTemperingFeedSequence) |
| | | .orderByAsc(HollowGlassRelationInfo::getHollowSequence) |
| | | .last("limit 1") |
| | | ); |
| | | if (relationInfoOne == null) { |
| | | //理片笼关系表中没有对应的数据,查看理片笼虚拟位置表是否有本工程下的所有玻璃虚拟信息 |
| | | //虚拟位置表没有本工程下的所有玻璃虚拟信息,按照玻璃id生成本工程下所有玻璃的虚拟信息 |
| | | generateHollowGlassInfo(flowCardId, totalLayer, layer); |
| | | relationInfoOne = this.getOne(new LambdaQueryWrapper<HollowGlassRelationInfo>() |
| | | .eq(HollowGlassRelationInfo::getFlowCardId, flowCardId) |
| | | .eq(HollowGlassRelationInfo::getWidth, width) |
| | | .eq(HollowGlassRelationInfo::getHeight, height) |
| | | .eq(HollowGlassRelationInfo::getLayer, layer) |
| | | .isNull(HollowGlassRelationInfo::getTemperingLayoutId) |
| | | .isNull(HollowGlassRelationInfo::getTemperingFeedSequence) |
| | | .orderByAsc(HollowGlassRelationInfo::getHollowSequence) |
| | | .last("limit 1") |
| | | ); |
| | | } |
| | | HollowBigStorageCageDetails hollowDetails = hollowBigStorageCageDetailsService.getOne(new LambdaQueryWrapper<HollowBigStorageCageDetails>() |
| | | .eq(HollowBigStorageCageDetails::getSlot, relationInfoOne.getVirtualSlot()).in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL_ZERO) |
| | | .orderByDesc(HollowBigStorageCageDetails::getSequence).last("limit 1")); |
| | | HollowBigStorageCage storageCage = null; |
| | | if (null == hollowDetails) { |
| | | storageCage = hollowBigStorageCageService.getOne(new LambdaQueryWrapper<HollowBigStorageCage>() |
| | | .eq(HollowBigStorageCage::getEnableState, Const.SLOT_ON).eq(HollowBigStorageCage::getRemainWidth, slotWidth).last("limit 1")); |
| | | HollowBigStorageDTO storageDTO = new HollowBigStorageDTO(); |
| | | BeanUtils.copyProperties(storageCage, storageDTO); |
| | | BeanUtils.copyProperties(relationInfoOne, storageDTO); |
| | | return storageDTO; |
| | | } |
| | | HollowGlassRelationInfo relationInfoBefore = hollowGlassRelationInfoService.getOne(new LambdaQueryWrapper<HollowGlassRelationInfo>() |
| | | .eq(HollowGlassRelationInfo::getEngineerId, relationInfoOne.getEngineerId()) |
| | | .eq(HollowGlassRelationInfo::getTemperingLayoutId, relationInfoOne.getTemperingLayoutId()) |
| | | .eq(HollowGlassRelationInfo::getVirtualSlot, relationInfoOne.getVirtualSlot()) |
| | | .eq(HollowGlassRelationInfo::getSlotSequence, relationInfoOne.getSlotSequence() - 1)); |
| | | if (null == relationInfoBefore) { |
| | | //表示序号没有或者 序号为1又不是第一块来的 新开一格 |
| | | storageCage = hollowBigStorageCageService.getOne(new LambdaQueryWrapper<HollowBigStorageCage>() |
| | | .eq(HollowBigStorageCage::getEnableState, Const.SLOT_ON).eq(HollowBigStorageCage::getRemainWidth, slotWidth).last("limit 1")); |
| | | } else { |
| | | HollowBigStorageCageDetails beforeGlass = hollowBigStorageCageDetailsService.getOne(new LambdaQueryWrapper<HollowBigStorageCageDetails>() |
| | | .in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL_ZERO) |
| | | .eq(HollowBigStorageCageDetails::getEngineerId, relationInfoBefore.getEngineerId()) |
| | | .eq(HollowBigStorageCageDetails::getTemperingLayoutId, relationInfoBefore.getTemperingLayoutId()) |
| | | .eq(HollowBigStorageCageDetails::getTemperingFeedSequence, relationInfoBefore.getTemperingFeedSequence()) |
| | | ); |
| | | if (null == beforeGlass) { |
| | | storageCage = hollowBigStorageCageService.getOne(new LambdaQueryWrapper<HollowBigStorageCage>() |
| | | .eq(HollowBigStorageCage::getEnableState, Const.SLOT_ON).eq(HollowBigStorageCage::getRemainWidth, slotWidth).last("limit 1")); |
| | | } else { |
| | | storageCage = hollowBigStorageCageService.getOne(new LambdaQueryWrapper<HollowBigStorageCage>() |
| | | .eq(HollowBigStorageCage::getEnableState, Const.SLOT_ON).eq(HollowBigStorageCage::getSlot, beforeGlass.getSlot())); |
| | | } |
| | | } |
| | | Assert.isTrue(null != storageCage, "没有空余的笼子存放玻璃"); |
| | | HollowBigStorageDTO storageDTO = new HollowBigStorageDTO(); |
| | | BeanUtils.copyProperties(storageCage, storageDTO); |
| | | BeanUtils.copyProperties(relationInfoOne, storageDTO); |
| | | return storageDTO; |
| | | } |
| | | |
| | | @Override |
| | | public void generateHollowGlassInfo(String flowCardId, int totalLayer, int layer) { |
| | | |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getFlowCardId, flowCardId) |
| | | .eq(GlassInfo::getLayer, layer).last("limit 1")); |
| | | if (null == glassInfo) { |
| | | log.info("当前流程卡信息为导入mes系统流程卡:{},层数{}", flowCardId, layer); |
| | | return; |
| | | } |
| | | //按照流程卡获取本流程卡最后一层或第一次的玻璃数据 |
| | | List<HollowGlassDetailsDTO> glassDetailsDTOS = this.baseMapper.queryFlowCardIdMaxLayerGlassInfo(flowCardId, totalLayer); |
| | | if (CollectionUtil.isEmpty(glassDetailsDTOS)) { |
| | | log.info("当前流程卡最外层数据未找到,请在erp确认数据无误,流程卡:{},总层数{}", flowCardId, totalLayer); |
| | | return; |
| | | } |
| | | if (totalLayer != layer) { |
| | | glassDetailsDTOS = this.baseMapper.queryFlowCardIdLayerGlassInfo(flowCardId, totalLayer, layer); |
| | | } |
| | | if (CollectionUtil.isEmpty(glassDetailsDTOS)) { |
| | | log.info("当前流程卡最外层数据未找到,请在erp确认数据无误,流程卡:{},总层数{},层数{}", flowCardId, totalLayer, layer); |
| | | return; |
| | | } |
| | | ArrayList<HollowGlassDetailsDTO> tempGlassList = new ArrayList<>(); |
| | | int hollowSequence = 1; |
| | | for (HollowGlassDetailsDTO item : glassDetailsDTOS) { |
| | | for (int i = 0; i < item.getQuantity(); i++) { |
| | | HollowGlassDetailsDTO dto = new HollowGlassDetailsDTO(); |
| | | BeanUtils.copyProperties(item, dto); |
| | | dto.setHollowSequence(hollowSequence++); |
| | | tempGlassList.add(dto); |
| | | } |
| | | } |
| | | //方式一:将玻璃按流程卡、尺寸、版图、版序 依次生成虚拟格子信息,格子一直往后累加 |
| | | // flowCardIdMap.forEach((e, v) -> { |
| | | // int remainWidth = slotWidth; |
| | | // int slotNumber = 1; |
| | | // for (GlassInfo item : v) { |
| | | // int maxLength = (int) Math.max(item.getWidth(), item.getHeight()); |
| | | // if (remainWidth > maxLength) { |
| | | // remainWidth = remainWidth - maxLength - glassGap; |
| | | // } else { |
| | | // slotNumber = slotNumber + 1; |
| | | // remainWidth = slotWidth - maxLength - glassGap; |
| | | // } |
| | | // HollowGlassInfo hollow = new HollowGlassInfo(); |
| | | // BeanUtils.copyProperties(item, hollow); |
| | | // hollow.setSlot(slotNumber); |
| | | // hollowGlassInfoList.add(hollow); |
| | | // } |
| | | // }); |
| | | // this.saveBatch(hollowGlassInfoList); |
| | | //获取中空大理片笼的所有空闲格子 |
| | | // List<HollowBigStorageCage> hollowSlotList = HollowBigStorageCageService.list(new LambdaQueryWrapper<HollowBigStorageCage>() |
| | | // .eq(HollowBigStorageCage::getEnableState, Const.SLOT_ON).eq(HollowBigStorageCage::getRemainWidth, slotWidth)); |
| | | //方式二:将玻璃按流程卡、尺寸、版图、版序 ,优先将格子全部补全后 依次计算后面的格子号 |
| | | List<HollowGlassRelationInfo> relationInfoList = new ArrayList(); |
| | | List<List<HollowGlassRelationInfo>> tempHollowList = new ArrayList<>(); |
| | | int slotNumber = 1; |
| | | for (HollowGlassDetailsDTO item : tempGlassList) { |
| | | boolean flag = false; |
| | | for (List<HollowGlassRelationInfo> temp : tempHollowList) { |
| | | int sum = 0; |
| | | for (HollowGlassRelationInfo i : temp) { |
| | | sum = sum + (int) Math.max(i.getHeight(), i.getWidth()) + glassGap; |
| | | } |
| | | if (sum + (int) Math.max(item.getHeight(), item.getWidth()) <= slotWidth && temp.size() < outCarMaxSize) { |
| | | HollowGlassRelationInfo hollow = new HollowGlassRelationInfo(); |
| | | BeanUtils.copyProperties(item, hollow); |
| | | hollow.setSlotSequence(temp.size() + 1); |
| | | hollow.setTotalLayer(totalLayer); |
| | | hollow.setVirtualSlot(temp.get(0).getVirtualSlot()); |
| | | hollow.setFilmsId(glassInfo.getFilmsid()); |
| | | hollow.setThickness(glassInfo.getThickness()); |
| | | temp.add(hollow); |
| | | flag = true; |
| | | break; |
| | | } |
| | | } |
| | | if (!flag) { |
| | | List<HollowGlassRelationInfo> newList = new ArrayList<>(); |
| | | HollowGlassRelationInfo hollow = new HollowGlassRelationInfo(); |
| | | BeanUtils.copyProperties(item, hollow); |
| | | hollow.setSlotSequence(1); |
| | | hollow.setTotalLayer(totalLayer); |
| | | hollow.setVirtualSlot(slotNumber++); |
| | | hollow.setFilmsId(glassInfo.getFilmsid()); |
| | | hollow.setThickness(glassInfo.getThickness()); |
| | | newList.add(hollow); |
| | | tempHollowList.add(newList); |
| | | } |
| | | } |
| | | for (List<HollowGlassRelationInfo> item : tempHollowList) { |
| | | relationInfoList.addAll(item); |
| | | } |
| | | log.info("分配完毕"); |
| | | this.saveBatch(relationInfoList); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, List<FlowCardGlassInfoDTO>> queryHollowAllFlowCard() { |
| | | List<HollowBigStorageCageDetails> detailsList = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>() |
| | | .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN)); |
| | | if (CollectionUtil.isEmpty(detailsList)) { |
| | | log.info("笼内无玻璃"); |
| | | return new HashMap<>(); |
| | | } |
| | | Map<String, List<HollowBigStorageCageDetails>> listMap = detailsList.stream().collect(Collectors.groupingBy(HollowBigStorageCageDetails::getFlowCardId)); |
| | | List<FlowCardGlassInfoDTO> dtos = new ArrayList<>(); |
| | | listMap.forEach((e, v) -> { |
| | | HollowBigStorageCageDetails cageDetails = v.get(0); |
| | | dtos.addAll(hollowBigStorageCageDetailsService.hollowIsAll(e, cageDetails.getTotalLayer(), Boolean.FALSE)); |
| | | }); |
| | | return dtos.stream().collect(Collectors.groupingBy(FlowCardGlassInfoDTO::getFlowCardId)); |
| | | } |
| | | |
| | | @Override |
| | | public List<LackDetailsDTO> queryLackByFlowCard(String flowCardId, int layer) { |
| | | |
| | | return this.baseMapper.queryLackByFlowCard(flowCardId, layer); |
| | | // return this.list(new LambdaQueryWrapper<HollowGlassRelationInfo>() |
| | | // .eq(HollowGlassRelationInfo::getFlowCardId,flowCardId) |
| | | // .eq(HollowGlassRelationInfo::getLayer,layer) |
| | | // .isNull(HollowGlassRelationInfo::getTemperingLayoutId) |
| | | // .isNull(HollowGlassRelationInfo::getTemperingFeedSequence) |
| | | // ); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.hollowqueue.controller; |
| | | |
| | | import com.mes.hollowqueue.entity.HollowGlassQueueInfo; |
| | | import com.mes.hollowqueue.service.HollowGlassQueueInfoService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (HollowGlassQueueInfo)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-30 10:19:53 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("hollowGlassQueueInfo") |
| | | public class HollowGlassQueueInfoController { |
| | | |
| | | @Resource |
| | | HollowGlassQueueInfoService hollowGlassQueueInfoService; |
| | | |
| | | @ApiOperation("强制出片") |
| | | @PostMapping("/forceOutGlass") |
| | | public Result<String> forceOutGlass(String flowCardId, int cell) { |
| | | hollowGlassQueueInfoService.forceOutGlass(flowCardId, cell); |
| | | return Result.success("success"); |
| | | } |
| | | |
| | | @ApiOperation("切换线路强制出片") |
| | | @PostMapping("/changeForceOutGlass") |
| | | public Result<String> changeForceOutGlass(String flowCardId, int cell) { |
| | | hollowGlassQueueInfoService.changeForceOutGlass(flowCardId, cell); |
| | | return Result.success("success"); |
| | | } |
| | | |
| | | @ApiOperation("按照线路查询正在出片的玻璃队列") |
| | | @PostMapping("/queryHollowGlassQueueInfo") |
| | | public Result<List<HollowGlassQueueInfo>> queryHollowGlassQueueInfo(int cell) { |
| | | return Result.success(hollowGlassQueueInfoService.queryHollowGlassQueueInfo(cell)); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.hollowqueue.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.mes.base.entity.BigStorageCageBaseInfo; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * (HollowGlassQueueInfo)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-30 10:19:55 |
| | | */ |
| | | @Data |
| | | public class HollowGlassQueueInfo extends BigStorageCageBaseInfo { |
| | | /** |
| | | * /*大理片笼详情表id |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * /*设备id |
| | | */ |
| | | private Integer deviceId; |
| | | /** |
| | | * /*虚拟栅格号 |
| | | */ |
| | | private Integer virtualSlot; |
| | | /** |
| | | * /*栅格号 |
| | | */ |
| | | private Integer slot; |
| | | /** |
| | | * /*小片在格内的顺序 |
| | | */ |
| | | private Integer sequence; |
| | | /** |
| | | * /*流程卡号 |
| | | */ |
| | | private String flowCardId; |
| | | /** |
| | | * /*玻璃类型 |
| | | */ |
| | | private Integer glassType; |
| | | /** |
| | | * /*厚度 |
| | | */ |
| | | private Double thickness; |
| | | /** |
| | | * /*状态 |
| | | */ |
| | | private Integer state; |
| | | /** |
| | | * /*玻璃间隙 |
| | | */ |
| | | private Integer gap; |
| | | |
| | | private String engineerId; |
| | | /** |
| | | * /*总层号 |
| | | */ |
| | | private Integer totalLayer; |
| | | /** |
| | | * /*层号 |
| | | */ |
| | | private Integer layer; |
| | | /** |
| | | * /*创建时间 |
| | | */ |
| | | private Date createTime; |
| | | /** |
| | | * /*更新时间 |
| | | */ |
| | | private Date updateTime; |
| | | /** |
| | | * /*中空顺序 |
| | | */ |
| | | private Integer hollowSequence; |
| | | |
| | | /** |
| | | * 路线 |
| | | */ |
| | | private Integer cell; |
| | | |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.hollowqueue.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.hollowqueue.entity.HollowGlassQueueInfo; |
| | | |
| | | /** |
| | | * (HollowGlassQueueInfo)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-30 10:19:54 |
| | | */ |
| | | public interface HollowGlassQueueInfoMapper extends BaseMapper<HollowGlassQueueInfo> { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.hollowqueue.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.hollowqueue.entity.HollowGlassQueueInfo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (HollowGlassQueueInfo)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-30 10:19:55 |
| | | */ |
| | | public interface HollowGlassQueueInfoService extends IService<HollowGlassQueueInfo> { |
| | | |
| | | void forceOutGlass(String flowCardId, int cell); |
| | | |
| | | void changeForceOutGlass(String flowCardId, int cell); |
| | | |
| | | List<HollowGlassQueueInfo> queryHollowGlassQueueInfo(int cell); |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.hollowqueue.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.hollow.entity.HollowBigStorageCageDetails; |
| | | import com.mes.hollow.entity.HollowGlassOutRelationInfo; |
| | | import com.mes.hollow.service.HollowBigStorageCageDetailsService; |
| | | import com.mes.hollow.service.HollowGlassOutRelationInfoService; |
| | | import com.mes.hollowqueue.entity.HollowGlassQueueInfo; |
| | | import com.mes.hollowqueue.mapper.HollowGlassQueueInfoMapper; |
| | | import com.mes.hollowqueue.service.HollowGlassQueueInfoService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * (HollowGlassQueueInfo)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-30 10:19:56 |
| | | */ |
| | | @Service |
| | | public class HollowGlassQueueInfoServiceImpl extends ServiceImpl<HollowGlassQueueInfoMapper, HollowGlassQueueInfo> implements HollowGlassQueueInfoService { |
| | | |
| | | @Resource |
| | | HollowBigStorageCageDetailsService hollowBigStorageCageDetailsService; |
| | | |
| | | @Resource |
| | | HollowGlassOutRelationInfoService hollowGlassOutRelationInfoService; |
| | | |
| | | @Override |
| | | public void forceOutGlass(String flowCardId, int cell) { |
| | | hollowGlassOutRelationInfoService.receiveTask(flowCardId, cell); |
| | | hollowGlassOutRelationInfoService.update(new LambdaUpdateWrapper<HollowGlassOutRelationInfo>() |
| | | .eq(HollowGlassOutRelationInfo::getFlowCardId, flowCardId) |
| | | .set(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START) |
| | | ); |
| | | List<HollowBigStorageCageDetails> hollowBigStorageCageDetailsList = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>() |
| | | .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .eq(HollowBigStorageCageDetails::getFlowCardId, flowCardId) |
| | | .orderByAsc(HollowBigStorageCageDetails::getVirtualSlot) |
| | | .orderBy(Boolean.TRUE, cell != 931, HollowBigStorageCageDetails::getSequence) |
| | | .orderByAsc(HollowBigStorageCageDetails::getHollowSequence) |
| | | ); |
| | | |
| | | List<HollowGlassQueueInfo> hollowQueues = hollowBigStorageCageDetailsList.stream().map(queue -> { |
| | | HollowGlassQueueInfo queueInfo = new HollowGlassQueueInfo(); |
| | | BeanUtils.copyProperties(queue, queueInfo); |
| | | queueInfo.setState(Const.TEMPERING_NEW); |
| | | queueInfo.setCell(cell); |
| | | return queueInfo; |
| | | }).collect(Collectors.toList()); |
| | | this.saveBatch(hollowQueues); |
| | | } |
| | | |
| | | @Override |
| | | public void changeForceOutGlass(String flowCardId, int cell) { |
| | | hollowGlassOutRelationInfoService.update(new LambdaUpdateWrapper<HollowGlassOutRelationInfo>() |
| | | .eq(HollowGlassOutRelationInfo::getFlowCardId, flowCardId) |
| | | .set(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START) |
| | | ); |
| | | //情况历史任务中未做完的玻璃信息 |
| | | this.remove(new LambdaQueryWrapper<HollowGlassQueueInfo>() |
| | | .eq(HollowGlassQueueInfo::getFlowCardId, flowCardId) |
| | | .eq(HollowGlassQueueInfo::getCell, cell) |
| | | .eq(HollowGlassQueueInfo::getState, Const.TEMPERING_NEW) |
| | | ); |
| | | //按照线路重新去理片笼查询玻璃信息 |
| | | List<HollowBigStorageCageDetails> hollowBigStorageCageDetailsList = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>() |
| | | .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .eq(HollowBigStorageCageDetails::getFlowCardId, flowCardId) |
| | | .orderByAsc(HollowBigStorageCageDetails::getVirtualSlot) |
| | | .orderBy(Boolean.TRUE, cell != 931, HollowBigStorageCageDetails::getSequence) |
| | | .orderByAsc(HollowBigStorageCageDetails::getHollowSequence) |
| | | ); |
| | | |
| | | List<HollowGlassQueueInfo> hollowQueues = hollowBigStorageCageDetailsList.stream().map(queue -> { |
| | | HollowGlassQueueInfo queueInfo = new HollowGlassQueueInfo(); |
| | | BeanUtils.copyProperties(queue, queueInfo); |
| | | queueInfo.setState(Const.TEMPERING_NEW); |
| | | queueInfo.setCell(cell); |
| | | return queueInfo; |
| | | }).collect(Collectors.toList()); |
| | | this.saveBatch(hollowQueues); |
| | | } |
| | | |
| | | @Override |
| | | public List<HollowGlassQueueInfo> queryHollowGlassQueueInfo(int cell) { |
| | | HollowGlassOutRelationInfo one = hollowGlassOutRelationInfoService.getOne(new LambdaUpdateWrapper<HollowGlassOutRelationInfo>() |
| | | .eq(HollowGlassOutRelationInfo::getCell, cell) |
| | | .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START) |
| | | ); |
| | | this.list(new LambdaQueryWrapper<HollowGlassQueueInfo>() |
| | | .eq(HollowGlassQueueInfo::getFlowCardId, one.getFlowCardId()) |
| | | .eq(HollowGlassQueueInfo::getCell, one.getCell()) |
| | | ); |
| | | return null; |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.hollowtask.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * (HollowBigStorageCageHistoryTask)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-27 15:22:45 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("hollowBigStorageCageHistoryTask") |
| | | public class HollowBigStorageCageHistoryTaskController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.hollowtask.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * (HollowBigStorageCageHistoryTask)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-27 15:22:47 |
| | | */ |
| | | @Data |
| | | public class HollowBigStorageCageHistoryTask { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * /*玻璃id |
| | | */ |
| | | private String glassId; |
| | | /** |
| | | * /*起始格子 |
| | | */ |
| | | private Integer startSlot; |
| | | /** |
| | | * /*目标格子 |
| | | */ |
| | | private Integer targetSlot; |
| | | /** |
| | | * /*任务状态 |
| | | */ |
| | | private Integer taskState; |
| | | /** |
| | | * /*玻璃数量 |
| | | */ |
| | | private Integer glassCount; |
| | | /** |
| | | * /*任务类型 |
| | | */ |
| | | private Integer taskType; |
| | | /** |
| | | * /*创建时间 |
| | | */ |
| | | private Date createTime; |
| | | /** |
| | | * /*更新时间 |
| | | */ |
| | | private Date updateTime; |
| | | |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.hollowtask.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.hollowtask.entity.HollowBigStorageCageHistoryTask; |
| | | |
| | | /** |
| | | * (HollowBigStorageCageHistoryTask)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-27 15:22:46 |
| | | */ |
| | | public interface HollowBigStorageCageHistoryTaskMapper extends BaseMapper<HollowBigStorageCageHistoryTask> { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.hollowtask.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.hollowtask.entity.HollowBigStorageCageHistoryTask; |
| | | |
| | | /** |
| | | * (HollowBigStorageCageHistoryTask)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-27 15:22:47 |
| | | */ |
| | | public interface HollowBigStorageCageHistoryTaskService extends IService<HollowBigStorageCageHistoryTask> { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.hollowtask.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.hollowtask.entity.HollowBigStorageCageHistoryTask; |
| | | import com.mes.hollowtask.mapper.HollowBigStorageCageHistoryTaskMapper; |
| | | import com.mes.hollowtask.service.HollowBigStorageCageHistoryTaskService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * (HollowBigStorageCageHistoryTask)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-27 15:22:48 |
| | | */ |
| | | @Service |
| | | public class HollowBigStorageCageHistoryTaskServiceImpl extends ServiceImpl<HollowBigStorageCageHistoryTaskMapper, HollowBigStorageCageHistoryTask> implements HollowBigStorageCageHistoryTaskService { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.job; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.hutool.core.lang.Assert; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.kangaroohy.milo.model.ReadWriteEntity; |
| | | import com.kangaroohy.milo.service.MiloService; |
| | | import com.mes.base.entity.BigStorageCageBaseInfo; |
| | | import com.mes.bigstoragecagetask.entity.BigStorageCageTask; |
| | | import com.mes.bigstoragecagetask.service.BigStorageCageTaskService; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.hollow.entity.HollowBigStorageCage; |
| | | import com.mes.hollow.entity.HollowBigStorageCageDetails; |
| | | import com.mes.hollow.entity.HollowGlassOutRelationInfo; |
| | | import com.mes.hollow.entity.HollowGlassRelationInfo; |
| | | import com.mes.hollow.entity.dto.*; |
| | | import com.mes.hollow.service.HollowBigStorageCageDetailsService; |
| | | import com.mes.hollow.service.HollowBigStorageCageService; |
| | | import com.mes.hollow.service.HollowGlassOutRelationInfoService; |
| | | import com.mes.hollow.service.HollowGlassRelationInfoService; |
| | | import com.mes.hollowqueue.entity.HollowGlassQueueInfo; |
| | | import com.mes.hollowqueue.service.HollowGlassQueueInfoService; |
| | | import com.mes.hollowtask.entity.HollowBigStorageCageHistoryTask; |
| | | import com.mes.hollowtask.service.HollowBigStorageCageHistoryTaskService; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import com.mes.utils.RedisUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author SNG-015 |
| | | */ |
| | | @Component |
| | | @Slf4j |
| | | public class OpcPlcStorageCageHollowTask { |
| | | @Resource |
| | | private HollowBigStorageCageService hollowBigStorageCageService; |
| | | |
| | | @Resource |
| | | private HollowBigStorageCageHistoryTaskService hollowBigStorageCageHistoryTaskService; |
| | | @Resource |
| | | private HollowGlassRelationInfoService hollowGlassRelationInfoService; |
| | | @Resource |
| | | private HollowBigStorageCageDetailsService hollowBigStorageCageDetailsService; |
| | | @Resource |
| | | private DamageService damageService; |
| | | @Resource |
| | | private GlassInfoService glassInfoService; |
| | | @Resource |
| | | private BigStorageCageTaskService bigStorageCageTaskService; |
| | | |
| | | @Resource |
| | | private TemperingGlassInfoService temperingGlassInfoService; |
| | | @Resource |
| | | private HollowGlassQueueInfoService hollowGlassQueueInfoService; |
| | | @Resource |
| | | private HollowGlassOutRelationInfoService hollowGlassOutRelationInfoService; |
| | | @Autowired(required = false) |
| | | MiloService miloService; |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | @Value("${mes.slotWidth}") |
| | | private Integer slotWidth; |
| | | |
| | | @Value("${mes.glassGap}") |
| | | private Integer glassGap; |
| | | |
| | | @Value("${mes.carWidth}") |
| | | private Integer carWidth; |
| | | |
| | | @Value("${mes.outCarMaxSize}") |
| | | private Integer outCarMaxSize; |
| | | |
| | | @Value("${mes.sequence.order}") |
| | | private boolean sequenceOrder; |
| | | |
| | | @Value("${mes.temperingOutTargetPosition}") |
| | | private Integer temperingOutTargetPosition; |
| | | @Value("${mes.artificialOutTargetPosition}") |
| | | private Integer artificialOutTargetPosition; |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void inBigStorageTask() throws Exception { |
| | | ReadWriteEntity inkageEntity = miloService.readFromOpcUa("DLP2A.DLP2A.mesControl"); |
| | | if (true != Boolean.parseBoolean(inkageEntity.getValue() + "")) { |
| | | log.info("当前为非联机状态,结束进片任务"); |
| | | return; |
| | | } |
| | | ReadWriteEntity requestEntity = miloService.readFromOpcUa("DLP2A.DLP2A.RequestMes"); |
| | | if (!"1".equals(requestEntity.getValue() + "")) { |
| | | log.info("当前未收到进片请求,结束进片任务"); |
| | | return; |
| | | } |
| | | ReadWriteEntity mesReplyEntity = miloService.readFromOpcUa("DLP2A.DLP2A.MesReply"); |
| | | if ("1".equals(mesReplyEntity.getValue() + "")) { |
| | | log.info("有正在执行的任务,结束进片任务"); |
| | | return; |
| | | } |
| | | |
| | | List<BigStorageCageTask> inTaskList = new ArrayList(); |
| | | ReadWriteEntity fromOpcUa = miloService.readFromOpcUa("DLP2A.DLP2A.FROM1"); |
| | | List<String> glassIdList = new ArrayList<>(); |
| | | for (int i = 1; i <= 6; i++) { |
| | | ReadWriteEntity requestWord = miloService.readFromOpcUa("DLP2A.DLP2A.DI" + i); |
| | | if (null != requestWord.getValue()) { |
| | | BigStorageCageTask task = new BigStorageCageTask(); |
| | | task.setGlassId(requestWord.getValue() + ""); |
| | | task.setStartSlot(Integer.parseInt(fromOpcUa.getValue() + "")); |
| | | inTaskList.add(task); |
| | | glassIdList.add(requestWord.getValue() + ""); |
| | | continue; |
| | | } |
| | | } |
| | | if (CollectionUtil.isEmpty(inTaskList)) { |
| | | log.info("当前大车无进片玻璃,结束进片任务"); |
| | | return; |
| | | } |
| | | log.info("获取任务的玻璃id:{}", glassIdList); |
| | | Map<String, Long> glassCountMap = glassIdList.stream().collect(Collectors.groupingBy(e -> e, Collectors.counting())); |
| | | for (Map.Entry<String, Long> entry : glassCountMap.entrySet()) { |
| | | if (entry.getValue() > 1) { |
| | | log.info("进片玻璃{}存在相同,结束本次任务", entry.getKey()); |
| | | //todo:向plc发送报警 |
| | | return; |
| | | } |
| | | } |
| | | List<HollowBigStorageCageDetails> detailsList = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>().in(HollowBigStorageCageDetails::getGlassId, glassIdList) |
| | | .in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL)); |
| | | if (CollectionUtil.isNotEmpty(detailsList)) { |
| | | log.info("理片笼存在相同的进片玻璃{},结束本次任务", detailsList); |
| | | //todo:向plc发送报警 |
| | | return; |
| | | } |
| | | List<GlassInfo> glassInfoList = glassInfoService.list(new LambdaQueryWrapper<GlassInfo>().in(GlassInfo::getGlassId, glassIdList)); |
| | | |
| | | if (glassInfoList.size() != inTaskList.size()) { |
| | | log.info("进片任务数量{}与玻璃数量{}不匹配,结束本次进片", inTaskList.size(), glassInfoList.size()); |
| | | //todo:向plc发送报警 |
| | | return; |
| | | } |
| | | //修改钢化任务表中的状态 |
| | | temperingGlassInfoService.update(new LambdaUpdateWrapper<TemperingGlassInfo>() |
| | | .set(TemperingGlassInfo::getState, Const.TEMPERING_END).in(TemperingGlassInfo::getGlassId, glassIdList)); |
| | | |
| | | Map<String, List<GlassInfo>> glassListMap = glassInfoList.stream().collect(Collectors.groupingBy(GlassInfo::getGlassId)); |
| | | |
| | | //计算目标格子 |
| | | List<HollowBigStorageCageHistoryTask> historyTasks = new ArrayList<>(); |
| | | for (BigStorageCageTask task : inTaskList) { |
| | | GlassInfo info = glassListMap.get(task.getGlassId()).get(0); |
| | | HollowBigStorageDTO bigStorageDTO = hollowGlassRelationInfoService.queryHollowTargetSlot(info.getFlowCardId(), |
| | | info.getWidth(), info.getHeight(), info.getTotalLayer(), info.getLayer()); |
| | | // 临时更新格子的剩余尺寸:防止相邻玻璃进同一格子造成剩余尺寸不足,玻璃越界的情况,任务完成后再次更新大理片笼表剩余宽度(按照笼内玻璃数量更新大理片笼剩余尺寸) |
| | | hollowBigStorageCageService.update(new LambdaUpdateWrapper<HollowBigStorageCage>() |
| | | .set(HollowBigStorageCage::getRemainWidth, bigStorageDTO.getRemainWidth() - Math.max(info.getWidth(), info.getHeight()) - glassGap) |
| | | .eq(HollowBigStorageCage::getSlot, bigStorageDTO.getSlot())); |
| | | task.setTargetSlot(bigStorageDTO.getSlot()); |
| | | task.setGlassId(info.getGlassId()); |
| | | bigStorageCageTaskService.updateTaskMessage("big_storage_cage_in_two_task", task); |
| | | //存放历史任务 |
| | | HollowBigStorageCageHistoryTask historyTask = new HollowBigStorageCageHistoryTask(); |
| | | BeanUtils.copyProperties(task, historyTask); |
| | | historyTask.setTaskType(Const.BIG_STORAGE_AFTER_IN); |
| | | historyTask.setGlassCount(glassInfoList.size()); |
| | | historyTask.setTaskState(Const.ENGINEERING_NEW); |
| | | historyTasks.add(historyTask); |
| | | //存放详情数据 |
| | | HollowBigStorageCageDetails cageDetails = new HollowBigStorageCageDetails(); |
| | | BeanUtils.copyProperties(bigStorageDTO, cageDetails); |
| | | BeanUtils.copyProperties(info, cageDetails); |
| | | cageDetails.setState(Const.GLASS_STATE_NEW); |
| | | cageDetails.setSequence(bigStorageDTO.getSlotSequence()); |
| | | cageDetails.setGap(glassGap); |
| | | cageDetails.setId(null); |
| | | hollowBigStorageCageDetailsService.save(cageDetails); |
| | | hollowGlassRelationInfoService.update(new LambdaUpdateWrapper<HollowGlassRelationInfo>() |
| | | .set(HollowGlassRelationInfo::getGlassId, cageDetails.getGlassId()) |
| | | .set(HollowGlassRelationInfo::getTemperingLayoutId, cageDetails.getTemperingLayoutId()) |
| | | .set(HollowGlassRelationInfo::getTemperingFeedSequence, cageDetails.getTemperingFeedSequence()) |
| | | .set(HollowGlassRelationInfo::getEngineerId, cageDetails.getEngineerId()) |
| | | .eq(HollowGlassRelationInfo::getFlowCardId, bigStorageDTO.getFlowCardId()) |
| | | .eq(HollowGlassRelationInfo::getLayer, bigStorageDTO.getLayer()) |
| | | .eq(HollowGlassRelationInfo::getVirtualSlot, bigStorageDTO.getVirtualSlot()) |
| | | .eq(HollowGlassRelationInfo::getSlotSequence, bigStorageDTO.getSlotSequence()) |
| | | .eq(HollowGlassRelationInfo::getHollowSequence, bigStorageDTO.getHollowSequence()) |
| | | ); |
| | | } |
| | | //历史数据入库 |
| | | hollowBigStorageCageHistoryTaskService.saveBatch(historyTasks); |
| | | //向opc发送启动信号 |
| | | List<ReadWriteEntity> list = new ArrayList<>(); |
| | | for (int i = 1; i <= inTaskList.size(); i++) { |
| | | list.add(generateReadWriteEntity("DLP2A.DLP2A.TO" + i, inTaskList.get(i - 1).getTargetSlot())); |
| | | } |
| | | list.add(generateReadWriteEntity("DLP2A.DLP2A.MesReply", 1)); |
| | | miloService.writeToOpcWord(list); |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void outBigStorageTask() throws Exception { |
| | | Date startDate = new Date(); |
| | | ReadWriteEntity inkageEntity = miloService.readFromOpcUa("DLP2B.DLP2B.mesControl"); |
| | | if (true != Boolean.parseBoolean(inkageEntity.getValue() + "")) { |
| | | log.info("当前为非联机状态,结束进片任务"); |
| | | return; |
| | | } |
| | | ReadWriteEntity requestEntity = miloService.readFromOpcUa("DLP2B.DLP2B.RequestMes"); |
| | | if (!"1".equals(requestEntity.getValue() + "")) { |
| | | log.info("当前未收到出片请求,结束出片任务"); |
| | | return; |
| | | } |
| | | //获取出片任务表 |
| | | List<BigStorageCageTask> outTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_out_two_task"); |
| | | if (CollectionUtil.isNotEmpty(outTaskList)) { |
| | | log.info("有正在执行的出片任务,结束本次出片任务"); |
| | | return; |
| | | } |
| | | |
| | | //获取空闲且领取任务的数据信息,没有任务直接走玻璃调度 |
| | | ReadWriteEntity oneEntity = miloService.readFromOpcUa("DLP2B.DLP2B.outOneRequest"); |
| | | ReadWriteEntity twoEntity = miloService.readFromOpcUa("DLP2B.DLP2B.outTwoRequest"); |
| | | ReadWriteEntity threeEntity = miloService.readFromOpcUa("DLP2B.DLP2B.outThreeRequest"); |
| | | int cell = -1; |
| | | HollowGlassOutRelationInfo hollowGlassOutRelationInfo = null; |
| | | if ("1".equals(oneEntity.getValue() + "")) { |
| | | cell = 930; |
| | | hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService |
| | | .getOne(new LambdaQueryWrapper<HollowGlassOutRelationInfo>() |
| | | .eq(HollowGlassOutRelationInfo::getCell, cell) |
| | | .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START) |
| | | ); |
| | | } |
| | | if (1 == 1 || null == hollowGlassOutRelationInfo && "1".equals(twoEntity.getValue() + "")) { |
| | | cell = 931; |
| | | hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService |
| | | .getOne(new LambdaQueryWrapper<HollowGlassOutRelationInfo>() |
| | | .eq(HollowGlassOutRelationInfo::getCell, cell) |
| | | .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START) |
| | | ); |
| | | } |
| | | if (null == hollowGlassOutRelationInfo && "1".equals(threeEntity.getValue() + "")) { |
| | | cell = 932; |
| | | hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService |
| | | .getOne(new LambdaQueryWrapper<HollowGlassOutRelationInfo>() |
| | | .eq(HollowGlassOutRelationInfo::getCell, cell) |
| | | .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START) |
| | | ); |
| | | } |
| | | if (null != hollowGlassOutRelationInfo) { |
| | | //是否允许中空 |
| | | //是否有正在中空的玻璃:中空小片表筛选未出笼的玻璃信息 |
| | | // 获取当前中空任务未完成出片的玻璃信息 |
| | | List<HollowGlassQueueInfo> unFinishHollowQueueList = hollowGlassQueueInfoService.list(new LambdaQueryWrapper<HollowGlassQueueInfo>() |
| | | .eq(HollowGlassQueueInfo::getFlowCardId, hollowGlassOutRelationInfo.getFlowCardId()) |
| | | .eq(HollowGlassQueueInfo::getCell, cell) |
| | | .eq(HollowGlassQueueInfo::getState, Const.TEMPERING_NEW)); |
| | | if (CollectionUtil.isNotEmpty(unFinishHollowQueueList)) { |
| | | log.info("有正在出片的中空任务"); |
| | | computeOutGlassInfo(unFinishHollowQueueList, "big_storage_cage_out_two_task", hollowGlassOutRelationInfo.getCell(), Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_AFTER_OUT); |
| | | Date endDate = new Date(); |
| | | log.info("大理片笼出片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | } else { |
| | | //将中空任务状态改为已完成 |
| | | hollowGlassOutRelationInfoService.update(new LambdaUpdateWrapper<HollowGlassOutRelationInfo>() |
| | | .eq(HollowGlassOutRelationInfo::getFlowCardId, hollowGlassOutRelationInfo.getFlowCardId()) |
| | | .eq(HollowGlassOutRelationInfo::getCell, hollowGlassOutRelationInfo.getCell()) |
| | | .set(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_SUCCESS)); |
| | | } |
| | | |
| | | if (redisUtil.getCacheObject("hollowSwitch")) { |
| | | List<HollowGlassOutRelationInfo> HollowGlassOutRelationInfoList = hollowGlassOutRelationInfoService |
| | | .list(new LambdaQueryWrapper<HollowGlassOutRelationInfo>() |
| | | .eq(HollowGlassOutRelationInfo::getCell, cell) |
| | | .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_NEW)); |
| | | for (HollowGlassOutRelationInfo e : HollowGlassOutRelationInfoList) { |
| | | //中空优先:获取理片笼 玻璃小片 破损表 数量 判断笼内版图是否到齐 |
| | | List<FlowCardGlassInfoDTO> flowCardGlassInfoDTO = hollowBigStorageCageDetailsService.hollowIsAll(e.getFlowCardId(), e.getTotalLayer(), Boolean.TRUE); |
| | | if (CollectionUtil.isNotEmpty(flowCardGlassInfoDTO)) { |
| | | //玻璃到齐包括已出片的 |
| | | //到齐,将玻璃小片数据存入中空小片表,逻辑生成出片任务 结束 |
| | | for (FlowCardGlassInfoDTO item : flowCardGlassInfoDTO) { |
| | | List<HollowBigStorageCageDetails> hollowBigStorageCageDetailsList = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>() |
| | | .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .eq(HollowBigStorageCageDetails::getFlowCardId, item.getFlowCardId()) |
| | | .orderByAsc(HollowBigStorageCageDetails::getHollowSequence) |
| | | .orderBy(Boolean.TRUE, cell != 931, HollowBigStorageCageDetails::getLayer) |
| | | ); |
| | | int finalCell = cell; |
| | | List<HollowGlassQueueInfo> hollowQueues = hollowBigStorageCageDetailsList.stream().map(queue -> { |
| | | HollowGlassQueueInfo queueInfo = new HollowGlassQueueInfo(); |
| | | BeanUtils.copyProperties(queue, queueInfo); |
| | | queueInfo.setState(Const.TEMPERING_NEW); |
| | | queueInfo.setCell(finalCell); |
| | | return queueInfo; |
| | | }).collect(Collectors.toList()); |
| | | if (CollectionUtil.isNotEmpty(hollowQueues)) { |
| | | hollowGlassQueueInfoService.saveBatch(hollowQueues); |
| | | computeOutGlassInfo(hollowQueues, "big_storage_cage_out_two_task", cell, Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_AFTER_OUT); |
| | | //将中空任务状态改为开始 |
| | | hollowGlassOutRelationInfoService.update(new LambdaUpdateWrapper<HollowGlassOutRelationInfo>() |
| | | .eq(HollowGlassOutRelationInfo::getFlowCardId, e.getFlowCardId()) |
| | | .eq(HollowGlassOutRelationInfo::getCell, cell) |
| | | .set(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START)); |
| | | Date endDate = new Date(); |
| | | log.info("大理片笼出片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //是否有人工下片任务 有直接出 |
| | | List<HollowBigStorageCageDetails> artificialList = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>() |
| | | .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_ARTIFICIAL) |
| | | .orderByAsc(HollowBigStorageCageDetails::getSlot) |
| | | .orderByAsc(HollowBigStorageCageDetails::getId).last("limit " + outCarMaxSize)); |
| | | if (CollectionUtil.isNotEmpty(artificialList)) { |
| | | computeOutGlassInfo(artificialList, "big_storage_cage_out_two_task", artificialOutTargetPosition, Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_AFTER_OUT); |
| | | Date endDate = new Date(); |
| | | log.info("大理片笼出片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | //是否存在需要内部调度的格子:执行内部调度任务 |
| | | if (redisUtil.getCacheObject("dispatchHollowSwitch")) { |
| | | //todo:获取笼内单格已经到齐的玻璃格子信息 |
| | | List<FlowCardVirtualSlotDTO> virtualList = hollowBigStorageCageDetailsService.queryIsAllNeedDispatchVirtualSlot(); |
| | | if (CollectionUtil.isEmpty(virtualList)) { |
| | | log.info("没有需要调度的格子"); |
| | | return; |
| | | } |
| | | List<HollowBigStorageCageDetails> list = new ArrayList<>(); |
| | | loop: |
| | | for (FlowCardVirtualSlotDTO dto : virtualList) { |
| | | List<BigStorageSequenceDTO> sequenceDTOList = hollowBigStorageCageDetailsService.queryNeedDispatchSlot(dto); |
| | | if (CollectionUtil.isEmpty(sequenceDTOList) || sequenceDTOList.size() == 1) { |
| | | continue; |
| | | } |
| | | int sequence = -1; |
| | | int startSlot = -1; |
| | | for (BigStorageSequenceDTO item : sequenceDTOList) { |
| | | if (item.getMinSequence() == sequence + 1) { |
| | | //生成调度任务 |
| | | int targetSlot = item.getSlot(); |
| | | list = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>() |
| | | .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN).eq(HollowBigStorageCageDetails::getSlot, startSlot)); |
| | | computeOutGlassInfo(list, "big_storage_cage_out_two_task", targetSlot, Const.GLASS_STATE_SCHEDULE_ING, Const.BIG_STORAGE_AFTER_DISPATCH); |
| | | List<Integer> slotList = new ArrayList<>(); |
| | | slotList.add(targetSlot); |
| | | updateSlotRemainBySlots(slotList); |
| | | break loop; |
| | | } |
| | | sequence = item.getMaxSequence(); |
| | | startSlot = item.getSlot(); |
| | | } |
| | | } |
| | | } |
| | | Date endDate = new Date(); |
| | | log.info("大理片笼出片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void finishInBigStorageTask() throws Exception { |
| | | ReadWriteEntity inkageEntity = miloService.readFromOpcUa("DLP2A.DLP2A.mesControl"); |
| | | if (true != Boolean.parseBoolean(inkageEntity.getValue() + "")) { |
| | | log.info("当前为非联机状态,结束完成进片任务"); |
| | | return; |
| | | } |
| | | //获取进片任务表 |
| | | List<BigStorageCageTask> inTaskList = new ArrayList(); |
| | | List<String> glassIdList = new ArrayList<>(); |
| | | ReadWriteEntity toWord = miloService.readFromOpcUa("DLP2A.DLP2A.TO1"); |
| | | if ("0".equals(toWord.getValue() + "")) { |
| | | log.info("完成任务已执行,结束本次完成进片任务"); |
| | | return; |
| | | } |
| | | for (int i = 1; i <= 6; i++) { |
| | | ReadWriteEntity requestWord = miloService.readFromOpcUa("DLP2A.DLP2A.DI" + i); |
| | | ReadWriteEntity statetWord = miloService.readFromOpcUa("DLP2A.DLP2A.STATE" + i); |
| | | ReadWriteEntity toOpcUa = miloService.readFromOpcUa("DLP2A.DLP2A.TO" + i); |
| | | ReadWriteEntity fromOpcUa = miloService.readFromOpcUa("DLP2A.DLP2A.FROM" + i); |
| | | |
| | | if (null != requestWord.getValue()) { |
| | | BigStorageCageTask task = new BigStorageCageTask(); |
| | | task.setGlassId(requestWord.getValue() + ""); |
| | | task.setTargetSlot(Integer.parseInt(toOpcUa.getValue() + "")); |
| | | task.setTaskState(Integer.parseInt(statetWord.getValue() + "")); |
| | | task.setStartSlot(Integer.parseInt(fromOpcUa.getValue() + "")); |
| | | inTaskList.add(task); |
| | | glassIdList.add(requestWord.getValue() + ""); |
| | | continue; |
| | | } |
| | | } |
| | | if (CollectionUtil.isEmpty(inTaskList)) { |
| | | log.info("当前大车无进片玻璃,结束完成进片任务"); |
| | | return; |
| | | } |
| | | List<BigStorageCageTask> unFinishTaskList = inTaskList.stream().filter(e -> e.getTaskState() <= 1 || e.getStartSlot() == 0).collect(Collectors.toList()); |
| | | if (CollectionUtil.isNotEmpty(unFinishTaskList)) { |
| | | log.info("存在未完成的玻璃信息,玻璃:{}", unFinishTaskList); |
| | | return; |
| | | } |
| | | Map<Integer, List<BigStorageCageTask>> taskMap = inTaskList.stream().collect(Collectors.groupingBy(BigStorageCageTask::getTaskState)); |
| | | //按照任务状态修改大理片笼内的玻璃数据 |
| | | // 重新计算大理片笼内的剩余尺寸 |
| | | taskMap.forEach((e1, v) -> { |
| | | if (e1 == 2) { |
| | | //进片完成 |
| | | log.info("3、获取进片已完成的玻璃信息id:{}", v); |
| | | List<Integer> inSuccessGlassSlot = v.stream().map(BigStorageCageTask::getTargetSlot).collect(Collectors.toList()); |
| | | List<UpdateHollowBigStorageCageDTO> storageCageDTOList = v.stream().map(e -> { |
| | | UpdateHollowBigStorageCageDTO storageCageDTO = new UpdateHollowBigStorageCageDTO(); |
| | | BeanUtils.copyProperties(e, storageCageDTO); |
| | | return storageCageDTO; |
| | | }).collect(Collectors.toList()); |
| | | hollowBigStorageCageDetailsService.updateBySlot(storageCageDTOList, Const.GLASS_STATE_IN); |
| | | log.info("4、大理片笼进片状态已完成已完成的玻璃信息id:{}", v); |
| | | updateSlotRemainBySlots(inSuccessGlassSlot); |
| | | } else if (e1 == 3) { |
| | | //破损处理 |
| | | dealDamageInTask(v); |
| | | } else { |
| | | //清空理片笼空数据 |
| | | noDealInTask(v); |
| | | } |
| | | }); |
| | | for (BigStorageCageTask item : inTaskList) { |
| | | //更新历史任务表中的任务状态 |
| | | hollowBigStorageCageHistoryTaskService.update(new LambdaUpdateWrapper<HollowBigStorageCageHistoryTask>() |
| | | .set(HollowBigStorageCageHistoryTask::getTaskState, item.getTaskState()) |
| | | .eq(HollowBigStorageCageHistoryTask::getTaskType, Const.BIG_STORAGE_AFTER_IN) |
| | | .eq(HollowBigStorageCageHistoryTask::getTargetSlot, item.getTargetSlot()) |
| | | .eq(HollowBigStorageCageHistoryTask::getGlassId, item.getGlassId())); |
| | | item.setTargetSlot(0); |
| | | //清空任务表数据 |
| | | bigStorageCageTaskService.updateTaskMessage("big_storage_cage_in_one_task", item); |
| | | } |
| | | //清空启动状态 |
| | | //向opc发送启动信号 |
| | | //向opc发送启动信号 |
| | | List<ReadWriteEntity> list = new ArrayList<>(); |
| | | for (int i = 1; i <= 6; i++) { |
| | | list.add(generateReadWriteEntity("DLP2A.DLP2A.TO" + i, 0)); |
| | | } |
| | | list.add(generateReadWriteEntity("DLP2A.DLP2A.MesReply", 0)); |
| | | miloService.writeToOpcWord(list); |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void finishOutBigStorageTask() throws Exception { |
| | | ReadWriteEntity inkageEntity = miloService.readFromOpcUa("DLP2B.DLP2B.mesControl"); |
| | | if (true != Boolean.parseBoolean(inkageEntity.getValue() + "")) { |
| | | log.info("当前为非联机状态,结束完成出片任务"); |
| | | return; |
| | | } |
| | | //获取进片任务表 |
| | | List<BigStorageCageTask> outTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_out_one_task"); |
| | | if (CollectionUtil.isEmpty(outTaskList)) { |
| | | log.info("当前大车无进片玻璃,结束完成进片任务"); |
| | | return; |
| | | } |
| | | List<BigStorageCageTask> unFinishTaskList = outTaskList.stream().filter(e -> e.getTaskState() <= 1 || e.getStartSlot() == 0).collect(Collectors.toList()); |
| | | if (CollectionUtil.isNotEmpty(unFinishTaskList)) { |
| | | log.info("存在未完成的玻璃信息,玻璃:{}", unFinishTaskList); |
| | | return; |
| | | } |
| | | Map<Integer, List<BigStorageCageTask>> taskMap = outTaskList.stream().collect(Collectors.groupingBy(BigStorageCageTask::getTaskState)); |
| | | int taskType = 0; |
| | | if (Const.OUT_TARGET_POSITION_ALL.contains(outTaskList.get(0).getTargetSlot())) { |
| | | taskType = Const.BIG_STORAGE_AFTER_OUT; |
| | | } else { |
| | | taskType = Const.BIG_STORAGE_AFTER_DISPATCH; |
| | | } |
| | | //按照任务状态修改大理片笼内的玻璃数据 |
| | | // 重新计算大理片笼内的剩余尺寸 |
| | | Integer finalTaskType = taskType; |
| | | taskMap.forEach((e1, v) -> { |
| | | if (e1 == 2) { |
| | | //进片完成 |
| | | log.info("3、获取进片已完成的玻璃信息id:{}", v); |
| | | List<Integer> outSuccessGlassSlot = new ArrayList<>(); |
| | | if (finalTaskType.equals(Const.BIG_STORAGE_AFTER_OUT)) { |
| | | outSuccessGlassSlot = v.stream().map(BigStorageCageTask::getStartSlot).collect(Collectors.toList()); |
| | | } else { |
| | | List<Integer> targetSuccessGlassSlot = v.stream().map(BigStorageCageTask::getTargetSlot).collect(Collectors.toList()); |
| | | List<Integer> startoutSuccessGlassSlot = v.stream().map(BigStorageCageTask::getStartSlot).collect(Collectors.toList()); |
| | | outSuccessGlassSlot.addAll(targetSuccessGlassSlot); |
| | | outSuccessGlassSlot.addAll(startoutSuccessGlassSlot); |
| | | } |
| | | List<UpdateHollowBigStorageCageDTO> storageCageDTOList = v.stream().map(e -> { |
| | | UpdateHollowBigStorageCageDTO storageCageDTO = new UpdateHollowBigStorageCageDTO(); |
| | | storageCageDTO.setGlassId(e.getGlassId()); |
| | | if (finalTaskType.equals(Const.BIG_STORAGE_AFTER_OUT)) { |
| | | storageCageDTO.setTargetSlot(e.getStartSlot()); |
| | | } else { |
| | | storageCageDTO.setTargetSlot(e.getTargetSlot()); |
| | | } |
| | | return storageCageDTO; |
| | | }).collect(Collectors.toList()); |
| | | if (finalTaskType.equals(Const.BIG_STORAGE_AFTER_OUT)) { |
| | | hollowBigStorageCageDetailsService.updateBySlot(storageCageDTOList, Const.GLASS_STATE_OUT); |
| | | } else { |
| | | hollowBigStorageCageDetailsService.updateBySlot(storageCageDTOList, Const.GLASS_STATE_IN); |
| | | } |
| | | log.info("4、大理片笼进片状态已完成已完成的玻璃信息id:{}", v); |
| | | updateSlotRemainBySlots(outSuccessGlassSlot); |
| | | } else if (e1 == 3) { |
| | | //破损处理 |
| | | dealDamageOutTask(v); |
| | | } else { |
| | | //清空理片笼空数据 |
| | | noDealOutTask(v); |
| | | } |
| | | }); |
| | | for (BigStorageCageTask item : outTaskList) { |
| | | //更新历史任务表中的任务状态 |
| | | hollowBigStorageCageHistoryTaskService.update(new LambdaUpdateWrapper<HollowBigStorageCageHistoryTask>() |
| | | .set(HollowBigStorageCageHistoryTask::getTaskState, item.getTaskState()) |
| | | .eq(HollowBigStorageCageHistoryTask::getTaskType, taskType) |
| | | .eq(HollowBigStorageCageHistoryTask::getGlassId, item.getGlassId())); |
| | | //更新中空小片表 |
| | | Integer taskState = item.getTaskState(); |
| | | if (taskState == 2) { |
| | | hollowGlassQueueInfoService.update(new LambdaUpdateWrapper<HollowGlassQueueInfo>() |
| | | .set(HollowGlassQueueInfo::getState, Const.TEMPERING_OUT).eq(HollowGlassQueueInfo::getGlassId, item.getGlassId())); |
| | | } else if (taskState == 3) { |
| | | // temperingGlassInfoService.remove(new LambdaQueryWrapper<TemperingGlassInfo>().eq(TemperingGlassInfo::getGlassId, item.getGlassId())); |
| | | hollowGlassQueueInfoService.update(new LambdaUpdateWrapper<HollowGlassQueueInfo>() |
| | | .set(HollowGlassQueueInfo::getState, Const.TEMPERING_DAMAGE).eq(HollowGlassQueueInfo::getGlassId, item.getGlassId())); |
| | | |
| | | } else { |
| | | // 空执行 |
| | | } |
| | | } |
| | | // 重置任务表数据 |
| | | bigStorageCageTaskService.updateOutTaskMessage("big_storage_cage_out_one_task"); |
| | | //清空启动状态 |
| | | //向opc发送启动信号 |
| | | miloService.writeToOpcWord(generateReadWriteEntity("DLP2B.DLP2B.MesReply", 0)); |
| | | } |
| | | |
| | | private void dealDamageInTask(List<BigStorageCageTask> damageTaskList) { |
| | | // 获取进片任务表中状态为破损的数据 |
| | | log.info("破损的玻璃信息有:{}", damageTaskList); |
| | | //移除理片笼详情表任务执行过程中破损的玻璃 |
| | | hollowBigStorageCageDetailsService.remove(new LambdaQueryWrapper<HollowBigStorageCageDetails>() |
| | | .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_NEW) |
| | | .in(HollowBigStorageCageDetails::getGlassId, damageTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList()))); |
| | | //将破损信息新增入破损表 |
| | | List<Integer> slotList = new ArrayList<>(); |
| | | for (BigStorageCageTask item : damageTaskList) { |
| | | Damage damage = new Damage(); |
| | | damage.setGlassId(item.getGlassId()); |
| | | damage.setLine(item.getStartSlot()); |
| | | damage.setWorkingProcedure("磨边"); |
| | | damage.setRemark("进笼前卧转立"); |
| | | damage.setStatus(1); |
| | | damage.setType(item.getTaskState()); |
| | | damageService.insertDamage(damage); |
| | | slotList.add(item.getTargetSlot()); |
| | | } |
| | | //更新格子剩余宽度 |
| | | updateSlotRemainBySlots(slotList); |
| | | log.info("进片任务-破损任务执行完成"); |
| | | } |
| | | |
| | | private void dealDamageOutTask(List<BigStorageCageTask> damageTaskList) { |
| | | // 获取进片任务表中状态为破损的数据 |
| | | log.info("破损的玻璃信息有:{}", damageTaskList); |
| | | //移除理片笼详情表任务执行过程中破损的玻璃 |
| | | hollowBigStorageCageDetailsService.remove(new LambdaQueryWrapper<HollowBigStorageCageDetails>() |
| | | .in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL_ZERO) |
| | | .in(HollowBigStorageCageDetails::getGlassId, damageTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList()))); |
| | | //将破损信息新增入破损表 |
| | | List<Integer> slotList = new ArrayList<>(); |
| | | for (BigStorageCageTask item : damageTaskList) { |
| | | Damage damage = new Damage(); |
| | | damage.setGlassId(item.getGlassId()); |
| | | damage.setLine(item.getStartSlot()); |
| | | damage.setWorkingProcedure("中空前"); |
| | | damage.setRemark("进笼后卧转立"); |
| | | damage.setStatus(1); |
| | | damage.setType(item.getTaskState()); |
| | | damageService.insertDamage(damage); |
| | | slotList.add(item.getTargetSlot()); |
| | | slotList.add(item.getStartSlot()); |
| | | } |
| | | //更新格子剩余宽度 |
| | | updateSlotRemainBySlots(slotList); |
| | | log.info("出片任务-破损任务执行完成"); |
| | | } |
| | | |
| | | private void noDealInTask(List<BigStorageCageTask> noDealTaskList) { |
| | | // 获取进片任务表中状态为破损的数据 |
| | | log.info("破损的玻璃信息有:{}", noDealTaskList); |
| | | //移除理片笼详情表未执行任务的空记录信息 |
| | | hollowBigStorageCageDetailsService.remove(new LambdaQueryWrapper<HollowBigStorageCageDetails>() |
| | | .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_NEW) |
| | | .in(HollowBigStorageCageDetails::getGlassId, noDealTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList()))); |
| | | //记录格子号,按格子号更新剩余尺寸 |
| | | List<Integer> slotList = new ArrayList<>(); |
| | | for (BigStorageCageTask item : noDealTaskList) { |
| | | slotList.add(item.getTargetSlot()); |
| | | slotList.add(item.getStartSlot()); |
| | | } |
| | | //更新格子剩余宽度 |
| | | updateSlotRemainBySlots(slotList); |
| | | log.info("进片任务-无动作执行完成"); |
| | | } |
| | | |
| | | private void noDealOutTask(List<BigStorageCageTask> noDealTaskList) { |
| | | // 获取进片任务表中状态为破损的数据 |
| | | log.info("破损的玻璃信息有:{}", noDealTaskList); |
| | | if (Const.OUT_TARGET_POSITION_ALL.contains(noDealTaskList.get(0).getTargetSlot())) { |
| | | //出片任务:将出片中状态恢复为在笼内 |
| | | List<String> glassList = noDealTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList()); |
| | | hollowBigStorageCageDetailsService.update(new LambdaUpdateWrapper<HollowBigStorageCageDetails>() |
| | | .set(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .ne(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_OUT) |
| | | .in(HollowBigStorageCageDetails::getGlassId, glassList)); |
| | | |
| | | } else { |
| | | //调度任务:将调度中状态改为在笼内,格子号恢复为调度前的格子 |
| | | for (BigStorageCageTask item : noDealTaskList) { |
| | | hollowBigStorageCageDetailsService.update(new LambdaUpdateWrapper<HollowBigStorageCageDetails>() |
| | | .set(HollowBigStorageCageDetails::getSlot, item.getStartSlot()) |
| | | .set(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .ne(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_OUT) |
| | | .eq(HollowBigStorageCageDetails::getGlassId, item.getGlassId())); |
| | | } |
| | | } |
| | | //将破损信息新增入破损表 |
| | | List<Integer> slotList = new ArrayList<>(); |
| | | for (BigStorageCageTask item : noDealTaskList) { |
| | | slotList.add(item.getTargetSlot()); |
| | | slotList.add(item.getStartSlot()); |
| | | } |
| | | //更新格子剩余宽度 |
| | | updateSlotRemainBySlots(slotList); |
| | | log.info("出片任务-无动作执行完成"); |
| | | } |
| | | |
| | | /** |
| | | * 出片一次仅生成一车玻璃 |
| | | * |
| | | * @param list |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | private <T extends BigStorageCageBaseInfo> Boolean computeOutGlassInfo(List<T> list, String tableName, int targetSlot, int state, int taskType) { |
| | | //任务数据:获取车子存放玻璃最大数量,玻璃间隔 |
| | | List<BigStorageCageTask> bigStorageCageTaskList = new ArrayList<>(); |
| | | //打车剩余尺寸 |
| | | Integer remainWidth = carWidth; |
| | | for (T e : list) { |
| | | if (bigStorageCageTaskList.size() >= outCarMaxSize || Math.max((int) e.getWidth(), (int) e.getHeight()) > remainWidth) { |
| | | break; |
| | | } |
| | | //计算当前出片车剩尺寸 |
| | | remainWidth = remainWidth - Math.max((int) e.getWidth(), (int) e.getHeight()) - glassGap; |
| | | bigStorageCageTaskList.add(new BigStorageCageTask(e.getGlassId(), e.getSlot(), targetSlot, |
| | | 0)); |
| | | } |
| | | Assert.isFalse(CollectionUtil.isEmpty(bigStorageCageTaskList), "未获取出片数据,结束出片任务"); |
| | | log.info("获取出片任务数据{}条,执行保存", bigStorageCageTaskList.size()); |
| | | List<String> glassIds = bigStorageCageTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList()); |
| | | int glassCount = bigStorageCageTaskList.size(); |
| | | //生成出片任务条数不足6补全 |
| | | while (bigStorageCageTaskList.size() < 6) { |
| | | bigStorageCageTaskList.add(new BigStorageCageTask("", 0, 0, 0)); |
| | | } |
| | | //清空任务表数据 |
| | | bigStorageCageTaskService.removeAll(tableName); |
| | | bigStorageCageTaskService.saveTaskMessage(tableName, bigStorageCageTaskList); |
| | | List<HollowBigStorageCageHistoryTask> historyList = bigStorageCageTaskList.stream().filter(e -> StringUtils.isNotBlank(e.getGlassId())).map(e -> { |
| | | HollowBigStorageCageHistoryTask history = new HollowBigStorageCageHistoryTask(); |
| | | BeanUtils.copyProperties(e, history); |
| | | history.setGlassCount(glassCount); |
| | | history.setTaskType(taskType); |
| | | return history; |
| | | }).collect(Collectors.toList()); |
| | | hollowBigStorageCageHistoryTaskService.saveBatch(historyList); |
| | | |
| | | log.info("将出片玻璃{}玻璃状态改为出片中", glassIds); |
| | | hollowBigStorageCageDetailsService.update(new LambdaUpdateWrapper<HollowBigStorageCageDetails>() |
| | | .set(HollowBigStorageCageDetails::getState, state) |
| | | .set(Const.RAW_GLASS_TASK_TYPE_DISPATCH.equals(taskType), BigStorageCageBaseInfo::getSlot, targetSlot) |
| | | .ne(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_OUT) |
| | | .in(HollowBigStorageCageDetails::getGlassId, glassIds)); |
| | | try { |
| | | miloService.writeToOpcWord(generateReadWriteEntity("DLP2B.DLP2B.MesReply", 1)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | | public void updateSlotRemainBySlots(List<Integer> slotList) { |
| | | //获取格子内所有的玻璃信息 |
| | | List<HollowBigStorageCageDetails> inSlotGlassList = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>() |
| | | .in(HollowBigStorageCageDetails::getSlot, slotList).in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL)); |
| | | Map<Integer, Double> slotRemainMap = new HashMap<>(); |
| | | //是否存在有格子非空的玻璃 |
| | | if (CollectionUtils.isNotEmpty(inSlotGlassList)) { |
| | | //存在 将格子内的玻璃分别进行更新 |
| | | slotRemainMap = inSlotGlassList.stream() |
| | | .collect(Collectors.groupingBy(HollowBigStorageCageDetails::getSlot, Collectors.summingDouble(item -> Math.max(item.getWidth(), item.getHeight()) + glassGap))); |
| | | slotRemainMap.forEach((e, v) -> { |
| | | double remainWidth = slotWidth - v >= 0 ? slotWidth - v : 0; |
| | | hollowBigStorageCageService.update(new LambdaUpdateWrapper<HollowBigStorageCage>().set(HollowBigStorageCage::getRemainWidth, remainWidth) |
| | | .eq(HollowBigStorageCage::getSlot, e)); |
| | | }); |
| | | } |
| | | //过滤不存在玻璃的格子 将宽度重置为原始宽度6200 |
| | | Set<Integer> remainSlotList = slotRemainMap.keySet(); |
| | | slotList.removeAll(remainSlotList); |
| | | if (CollectionUtils.isNotEmpty(slotList)) { |
| | | hollowBigStorageCageService.update(new LambdaUpdateWrapper<HollowBigStorageCage>().set(HollowBigStorageCage::getRemainWidth, slotWidth) |
| | | .in(HollowBigStorageCage::getSlot, slotList)); |
| | | } |
| | | } |
| | | |
| | | private ReadWriteEntity generateReadWriteEntity(String identifier, Object value) { |
| | | return ReadWriteEntity.builder() |
| | | .identifier(identifier) |
| | | //Kep中是Long类型,即:Int32,Java中的int类型 |
| | | .value(value) |
| | | .build(); |
| | | } |
| | | } |
New file |
| | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://192.168.1.199:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | salve_hangzhoumes: |
| | | url: jdbc:sqlserver://192.168.10.2:1433;databasename=hangzhoumes |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | pp: |
| | | url: jdbc:mysql://192.168.1.199:3306/pp?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 127.0.0.1:8848 |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | password: 123456 |
New file |
| | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | salve_hangzhoumes: |
| | | url: jdbc:sqlserver://127.0.0.1:1433;databasename=hangzhoumes |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | pp: |
| | | url: jdbc:mysql://127.0.0.1:3306/pp?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 127.0.0.1:8848 |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | password: 123456 |
New file |
| | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | salve_hangzhoumes: |
| | | url: jdbc:sqlserver://10.153.19.150:1433;databasename=hangzhoumes |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | pp: |
| | | url: jdbc:mysql://10.153.19.150:3306/pp?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 10.153.19.150:8848 |
| | | redis: |
| | | database: 0 |
| | | host: 10.153.19.150 |
| | | port: 6379 |
| | | password: 123456 |
New file |
| | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://192.168.2.100:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | pp: |
| | | url: jdbc:mysql://192.168.2.100:3306/pp?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | salve_hangzhoumes: |
| | | url: jdbc:sqlserver://192.168.2.100:1433;databasename=mes |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 192.168.2.100:8848 |
| | | redis: |
| | | database: 0 |
| | | host: 192.168.2.100 |
| | | port: 6379 |
| | | password: 123456 |
New file |
| | |
| | | server: |
| | | port: 8181 |
| | | |
| | | spring: |
| | | profiles: |
| | | active: yw |
| | | application: |
| | | name: hollowGlass |
| | | liquibase: |
| | | enabled: false |
| | | task: |
| | | scheduling: |
| | | pool: |
| | | size: 10 |
| | | thread-name-prefix: task-hollowGlass |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | mes: |
| | | sequence: |
| | | order: true |
| | | minCount: 30 |
| | | carWidth: 6200 #大车宽度 |
| | | slotWidth: 6200 #大车宽度 |
| | | inCarMaxSize: 5 #进片大车最大存放玻璃数量 |
| | | outCarMaxSize: 6 #出片大车最大存放玻璃数量 |
| | | glassGap: 250 #玻璃间距 |
| | | xMaxSize: 2800 |
| | | temperingOutTargetPosition: 930 |
| | | artificialOutTargetPosition: 931 |
| | | |
| | | scan: |
| | | ip: 192.168.30.199 |
| | | port: 5000 |
| | | kangaroohy: |
| | | milo: |
| | | enabled: true |
| | | primary: default |
| | | config: |
| | | default: |
| | | endpoint: opc.tcp://192.168.2.100:49320 |
| | | security-policy: basic256sha256 |
| | | username: admin |
| | | password: 1qaz2wsx3edc4rfv |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration scan="true" scanPeriod="10 seconds"> |
| | | <!-- logger上下文名称(根据业务修改) --> |
| | | <contextName>cacheVerticalGlass</contextName> |
| | | |
| | | <!-- 定义了一个名为serverName的属性,它的值来自于logging.file.name,如果没有找到该属性默认为MyServerName(根据业务修改) --> |
| | | <springProperty name="serverName" source="logging.file.name" defaultValue="hollowGlass"/> |
| | | <springProperty name="logging.path" source="logging.file.path" defaultValue="././logs/"/> |
| | | |
| | | <!-- 彩色日志依赖的渲染类 --> |
| | | <!-- 定义了一个名为clr的转换规则,它使用org.springframework.boot.logging.logback.ColorConverter类进行转换,这个元素通常用于将日志输出中的文本着色,以便更容易地区分不同的日志级别或其他信息 --> |
| | | <conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/> |
| | | <!-- WhitespaceThrowableProxyConverter和ExtendedWhitespaceThrowableProxyConverter都是用于将异常信息转换为字符串,并将其中的换行符替换为空格,以便更容易地在日志输出中显示的类。它们之间的区别在于,ExtendedWhitespaceThrowableProxyConverter在输出异常信息时会包含更多的详细信息,例如异常的类名、方法名和行号等 --> |
| | | <!-- 定义了一个名为wex的转换规则,它使用org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter类进行转换,这个元素通常用于将异常信息转换为字符串,并将其中的换行符替换为空格,以便更容易地在日志输出中显示 --> |
| | | <conversionRule conversionWord="wex" |
| | | converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/> |
| | | <!-- 定义了一个名为wEx的转换规则,它使用org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter类进行转换,这个元素通常用于将异常信息转换为字符串,并将其中的换行符替换为空格,以便更容易地在日志输出中显示 --> |
| | | <conversionRule conversionWord="wEx" |
| | | converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/> |
| | | |
| | | <!-- 彩色日志格式 --> |
| | | <!-- value值是日志输出模板, :-是属性名和其默认值之间的分隔符,作用与:相同 --> |
| | | <!-- 定义日志输出格式的转换规则,%d{yyyy-MM-dd HH:mm:ss.SSS}表示日期和时间,%clr表示将输出文本着色,{faint}表示使用淡色 --> |
| | | <!-- %5p表示日志级别输出右对齐,左边以空格填充 --> |
| | | <!-- ${PID:- }表示进程ID,%clr表示将输出文本着色,{magenta}表示使用洋红色 --> |
| | | <!-- -表示一个分隔符 --> |
| | | <!-- %t:显示产生该日志的线程名;%15:若字符长度小于15,则左边用空格填充;%.15:若字符长度超过15,截去多余字符 --> |
| | | <!-- %-40:若字符长度小于40,则右边用空格填充;%.40:若字符长度超过40,截去多余字符;logger{39}对应的是“logging.WARNING”级别。具体来说,Python的logging模块定义了以下几个级别(从低到高):NOTSET、DEBUG、INFO、WARNING、ERROR、CRITICAL。因此,logger{39}表示的是WARNING级别,即日志记录器会记录所有WARNING级别及以上的日志信息 --> |
| | | <!-- %m表示日志消息;%n表示换行符;${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}表示异常信息。如果日志输出中包含异常信息,这个规则将会将其转换为字符串,并将其中的换行符替换为空格,以便更容易地在日志输出中显示 --> |
| | | <property name="CONSOLE_LOG_PATTERN" |
| | | value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> |
| | | |
| | | <!--1. 输出到控制台--> |
| | | <!-- 定义控制台日志输出的appender,class="ch.qos.logback.core.ConsoleAppender"表示使用Logback框架提供的ConsoleAppender类来输出日志到控制台 --> |
| | | <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> |
| | | <!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息--> |
| | | <!-- 定义日志输出级别的过滤器,class="ch.qos.logback.classic.filter.ThresholdFilter"表示使用Logback框架提供的ThresholdFilter类来过滤日志输出,<level>debug</level>表示只输出debug级别及以上的日志 --> |
| | | <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
| | | <level>debug</level> |
| | | </filter> |
| | | <encoder> |
| | | <!-- ${CONSOLE_LOG_PATTERN}表示控制台日志输出格式,UTF-8表示编码格式 --> |
| | | <Pattern>${CONSOLE_LOG_PATTERN}</Pattern> |
| | | <!-- 设置字符集 --> |
| | | <charset>UTF-8</charset> |
| | | </encoder> |
| | | </appender> |
| | | <!--2. 输出到文档--> |
| | | <!-- 2.1 level为 DEBUG 日志,时间滚动输出 --> |
| | | <!-- 定义文件日志输出的appender,class="ch.qos.logback.core.rolling.RollingFileAppender"表示使用Logback框架提供的RollingFileAppender类来输出日志到文件 --> |
| | | <appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文档的路径及文档名 --> |
| | | <file>${logging.path}/${serverName}/web_debug.log</file> |
| | | <!--日志文档输出格式--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | <charset>UTF-8</charset> <!-- 设置字符集 --> |
| | | </encoder> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <!-- 定义日志文件滚动策略的标签,class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"表示使用Logback框架提供的TimeBasedRollingPolicy类来定义日志文件的滚动策略 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- 日志归档 --> |
| | | <!-- 定义日志文件名的模式。在这个模式中,${logging.path}表示日志文件的路径,%d{yyyy-MM-dd}表示日期格式,%i表示文件索引 --> |
| | | <fileNamePattern>${logging.path}/${serverName}/web-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <!-- 定义日志文件滚动策略的标签,class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"表示使用Logback框架提供的SizeAndTimeBasedFNATP类来定义日志文件的滚动策略,<maxFileSize>100MB</maxFileSize>表示日志文件的最大大小为100MB。这个滚动策略通常用于按照时间和文件大小滚动日志文件,以便更好地管理日志文件的大小和数量 --> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | | <!-- 此日志文档只记录debug级别的 --> |
| | | <!-- 定义日志输出级别的过滤器。在这个过滤器中,class="ch.qos.logback.classic.filter.LevelFilter"表示使用Logback框架提供的LevelFilter类来过滤日志输出,<level>debug</level>表示只输出debug级别及以上的日志 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>debug</level> |
| | | <!-- <onMatch>ACCEPT</onMatch>表示如果日志事件与过滤器匹配,则接受该事件,<onMismatch>DENY</onMismatch>表示如果日志事件与过滤器不匹配,则拒绝该事件 --> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | <!-- 2.2 level为 INFO 日志,时间滚动输出 --> |
| | | <appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文档的路径及文档名 --> |
| | | <file>${logging.path}/${serverName}/web_info.log</file> |
| | | <!--日志文档输出格式--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | <charset>UTF-8</charset> |
| | | </encoder> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- 天天日志归档路径以及格式 --> |
| | | <fileNamePattern>${logging.path}/${serverName}/web-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | | <!-- 此日志文档只记录info级别的 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>info</level> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | <!-- 2.3 level为 WARN 日志,时间滚动输出 --> |
| | | <appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文档的路径及文档名 --> |
| | | <file>${logging.path}/${serverName}/web_warn.log</file> |
| | | <!--日志文档输出格式--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | <charset>UTF-8</charset> <!-- 此处设置字符集 --> |
| | | </encoder> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <fileNamePattern>${logging.path}/${serverName}/web-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | | <!-- 此日志文档只记录warn级别的 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>warn</level> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | <!-- 2.4 level为 ERROR 日志,时间滚动输出 --> |
| | | <appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文档的路径及文档名 --> |
| | | <file>${logging.path}/${serverName}/web_error.log</file> |
| | | <!--日志文档输出格式--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | <charset>UTF-8</charset> <!-- 此处设置字符集 --> |
| | | </encoder> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <fileNamePattern>${logging.path}/${serverName}/web-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | | <!-- 此日志文档只记录ERROR级别的 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>ERROR</level> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | <!-- 4.1 开发环境:打印控制台--> |
| | | <!-- 用于在Spring Boot应用程序中配置日志记录的标签。在这个标签中,name="dev"表示这个配置文件只在dev环境中生效,<logger name="com.myClass.controller" level="debug"/>表示为com.myClass.controller(根据业务修改)这个包下的类配置日志输出级别为debug --> |
| | | <!-- <springProfile name="dev">--> |
| | | <!-- <logger name="com.myClass.controller" level="debug"/>--> |
| | | <!-- </springProfile>--> |
| | | <!-- 用于配置日志输出的标签。在这个标签中,level="info"表示日志输出级别为info,<appender-ref ref="CONSOLE"/>、<appender-ref ref="DEBUG_FILE"/>、<appender-ref ref="INFO_FILE"/>、<appender-ref ref="WARN_FILE"/>、<appender-ref ref="ERROR_FILE"/>表示将日志输出到不同的appender中,分别为控制台、debug文件、info文件、warn文件和error文件 --> |
| | | <root level="info"> |
| | | <appender-ref ref="CONSOLE"/> |
| | | <appender-ref ref="DEBUG_FILE"/> |
| | | <appender-ref ref="INFO_FILE"/> |
| | | <appender-ref ref="WARN_FILE"/> |
| | | <appender-ref ref="ERROR_FILE"/> |
| | | </root> |
| | | </configuration> |
New file |
| | |
| | | <?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.hollow.mapper.HollowBigStorageCageDetailsMapper"> |
| | | |
| | | <resultMap id="baseMap" type="com.mes.hollow.entity.dto.FlowCardGlassInfoDTO"> |
| | | <result column="engineer_id" property="engineerId"/> |
| | | <result column="flow_card_id" property="flowCardId"/> |
| | | <result column="layer" property="layer"/> |
| | | <result column="sum_count" property="sumCount"/> |
| | | <result column="pair_count" property="pairCount"/> |
| | | <result column="real_count" property="realCount"/> |
| | | <result column="damage_count" property="damageCount"/> |
| | | <result column="lack_count" property="lackCount"/> |
| | | </resultMap> |
| | | <resultMap id="virtualSlotSequenceDTO" type="com.mes.hollow.entity.dto.FlowCardVirtualSlotDTO"> |
| | | <result column="flow_card_id" property="flowCardId"/> |
| | | <result column="virtual_slot" property="virtualSlot"/> |
| | | </resultMap> |
| | | <resultMap id="baseSlotSequenceDTO" type="com.mes.hollow.entity.dto.BigStorageSequenceDTO"> |
| | | <result column="slot" property="slot"/> |
| | | <result column="max_sequence" property="maxSequence"/> |
| | | <result column="min_sequence" property="minSequence"/> |
| | | </resultMap> |
| | | |
| | | <update id="updateBySlot"> |
| | | update hollow_big_storage_cage_details |
| | | <set> |
| | | state = #{state} |
| | | </set> |
| | | <where> |
| | | (glass_id,slot) in ( |
| | | <foreach collection="list" item="item" separator=","> |
| | | (#{item.glassId}, #{item.targetSlot}) |
| | | </foreach> |
| | | ) |
| | | and state !=101 |
| | | </where> |
| | | </update> |
| | | |
| | | <select id="hollowIsAll" resultMap="baseMap"> |
| | | WITH sum_flow_layer_count AS ( |
| | | SELECT |
| | | flow_card_id, |
| | | layer, |
| | | min( films_id ) AS films_id, |
| | | count(*) AS sum_count |
| | | FROM |
| | | hollow_glass_relation_info |
| | | GROUP BY |
| | | flow_card_id, |
| | | layer |
| | | ), |
| | | real_flow_layer_count AS ( |
| | | SELECT |
| | | flow_card_id, |
| | | layer, |
| | | count(*) AS real_count |
| | | FROM |
| | | hollow_glass_relation_info |
| | | WHERE |
| | | tempering_layout_id IS NOT NULL |
| | | AND tempering_feed_sequence IS NOT NULL |
| | | GROUP BY |
| | | flow_card_id, |
| | | layer |
| | | ), |
| | | damage_flow_layer_count AS ( SELECT process_id AS flow_card_id, technology_number AS layer, count(*) |
| | | damage_count FROM damage GROUP BY process_id, technology_number ), |
| | | lack_flow_layer_count AS ( |
| | | SELECT |
| | | t.flow_card_id, |
| | | t.layer, |
| | | ( sum_count - real_count - damage_count ) AS lack_count |
| | | FROM |
| | | sum_flow_layer_count t |
| | | INNER JOIN real_flow_layer_count t1 ON t.flow_card_id = t1.flow_card_id |
| | | AND t.layer = t1.layer |
| | | INNER JOIN damage_flow_layer_count t2 ON t1.flow_card_id = t2.flow_card_id |
| | | AND t1.layer = t2.layer |
| | | ), |
| | | layer_one AS ( SELECT * FROM hollow_glass_relation_info WHERE layer = 1 AND tempering_layout_id IS NOT NULL AND |
| | | tempering_feed_sequence IS NOT NULL ), |
| | | layer_two AS ( SELECT * FROM hollow_glass_relation_info WHERE layer = 2 AND tempering_layout_id IS NOT NULL AND |
| | | tempering_feed_sequence IS NOT NULL ), |
| | | layer_three AS ( SELECT * FROM hollow_glass_relation_info WHERE layer = 3 AND tempering_layout_id IS NOT NULL |
| | | AND tempering_feed_sequence IS NOT NULL ) |
| | | , |
| | | pair_flow_layer_count AS ( |
| | | SELECT |
| | | t.flow_card_id, |
| | | count(*) AS pair_count |
| | | FROM |
| | | layer_one t |
| | | INNER JOIN layer_two t1 ON t.flow_card_id = t1.flow_card_id |
| | | AND t.virtual_slot = t1.virtual_slot |
| | | AND t.slot_sequence = t1.slot_sequence |
| | | <if test="totalLayer == 3"> |
| | | inner join layer_three t2 |
| | | on t.flow_card_id = t2.flow_card_id and |
| | | t.virtual_slot = t2.virtual_slot and t.slot_sequence = t2.slot_sequence |
| | | </if> |
| | | GROUP BY |
| | | t.flow_card_id |
| | | ) |
| | | ,result_flow_layer_count AS ( |
| | | SELECT |
| | | t.flow_card_id, |
| | | t.layer, |
| | | t.films_id, |
| | | sum_count, |
| | | t3.pair_count, |
| | | IFNULL(real_count,0) as real_count, |
| | | IFNULL(damage_count,0) as damage_count, |
| | | IFNULL(lack_count,0) as lack_count |
| | | FROM |
| | | sum_flow_layer_count t |
| | | left JOIN real_flow_layer_count t1 ON t.flow_card_id = t1.flow_card_id |
| | | AND t.layer = t1.layer |
| | | left JOIN lack_flow_layer_count t2 ON t.flow_card_id = t2.flow_card_id |
| | | AND t.layer = t2.layer |
| | | left JOIN pair_flow_layer_count t3 ON t.flow_card_id = t3.flow_card_id |
| | | left JOIN damage_flow_layer_count t4 ON t.flow_card_id = t4.flow_card_id |
| | | AND t.layer = t4.layer |
| | | ) SELECT |
| | | * |
| | | FROM |
| | | result_flow_layer_count |
| | | WHERE |
| | | flow_card_id = #{flowCardId} |
| | | <if test="flag == true"> |
| | | and sum_count = pair_count |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <select id="queryIsAllNeedDispatchVirtualSlot" resultMap="virtualSlotSequenceDTO"> |
| | | with relation_temp as ( |
| | | select flow_card_id, virtual_slot, count(1) as slot_count |
| | | from hollow_glass_relation_info |
| | | group by flow_card_id, virtual_slot |
| | | ), |
| | | details_temp as ( |
| | | select flow_card_id, virtual_slot, count(1) as slot_count |
| | | from hollow_big_storage_cage_details |
| | | where state = 100 |
| | | group by flow_card_id, virtual_slot |
| | | ), |
| | | result_one as ( |
| | | select t.*, t1.slot_count as tslot_count |
| | | from relation_temp t |
| | | INNER JOIN details_temp t1 on t.flow_card_id = t1.flow_card_id and |
| | | t.virtual_slot = t1.virtual_slot |
| | | where t.slot_count = t1.slot_count |
| | | ) |
| | | select flow_card_id, virtual_slot |
| | | from result_one |
| | | order by flow_card_id, virtual_slot |
| | | </select> |
| | | |
| | | <select id="queryNeedDispatchSlot" resultMap="baseSlotSequenceDTO"> |
| | | with glass_id_temp as ( |
| | | select glass_id |
| | | from big_storage_glass_relation_info |
| | | where (flow_card_id, virtual_slot) = |
| | | (#{flowCardId}, #{virtualSlot}) |
| | | ) |
| | | select slot, max(sequence) as max_sequence, min(sequence) as min_sequence |
| | | from big_storage_cage_details |
| | | where glass_id in (select * from glass_id_temp) |
| | | and state = 100 |
| | | group by slot |
| | | order by max_sequence |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?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.hollow.mapper.HollowGlassRelationInfoMapper"> |
| | | |
| | | <resultMap id="baseMap" type="com.mes.hollow.entity.dto.HollowGlassDetailsDTO"> |
| | | <result column="process_id" property="flowCardId"/> |
| | | <result column="child_width" property="width"/> |
| | | <result column="child_height" property="height"/> |
| | | <result column="order_number" property="orderSort"/> |
| | | <result column="technology_number" property="layer"/> |
| | | <result column="quantity" property="quantity"/> |
| | | </resultMap> |
| | | <resultMap id="lackBaseMap" type="com.mes.hollow.entity.dto.LackDetailsDTO"> |
| | | <result column="flow_card_id" property="flowCardId"/> |
| | | <result column="layer" property="layer"/> |
| | | <result column="films_id" property="filmsId"/> |
| | | <result column="first_length" property="width"/> |
| | | <result column="second_Length" property="height"/> |
| | | <result column="thickness" property="thickness"/> |
| | | <result column="lack_cout" property="lackCount"/> |
| | | </resultMap> |
| | | <select id="queryFlowCardIdMaxLayerGlassInfo" resultMap="baseMap"> |
| | | with temp_flow as (SELECT t.process_id, |
| | | t.order_id, |
| | | t.order_number, |
| | | t.technology_number, |
| | | t.quantity, |
| | | t1.child_width, |
| | | t1.child_height |
| | | |
| | | from pp.flow_card t |
| | | LEFT JOIN sd.order_glass_detail t1 |
| | | on t.order_id = t1.order_id |
| | | and t.order_number = t1.order_number |
| | | and t.technology_number = t1.technology_number |
| | | where t.process_id = #{flowCardId}), |
| | | glass_info_temp as ( |
| | | select process_id, |
| | | order_id, |
| | | GREATEST(child_width, child_height) as first_length, |
| | | least(child_width, child_height) as second_length, |
| | | child_width, |
| | | child_height, |
| | | order_number, |
| | | technology_number, |
| | | quantity |
| | | from temp_flow |
| | | where technology_number = #{totalLayer} |
| | | ) |
| | | select row_number() over (order by second_length desc,first_length desc) as rn, t.* |
| | | from glass_info_temp t |
| | | </select> |
| | | |
| | | <select id="queryFlowCardIdLayerGlassInfo" resultMap="baseMap"> |
| | | with temp_flow as (SELECT t.process_id, |
| | | t.order_id, |
| | | t.order_number, |
| | | t.technology_number, |
| | | t.quantity, |
| | | t1.child_width, |
| | | t1.child_height |
| | | |
| | | from pp.flow_card t |
| | | LEFT JOIN sd.order_glass_detail t1 |
| | | on t.order_id = t1.order_id |
| | | and t.order_number = t1.order_number |
| | | and t.technology_number = t1.technology_number |
| | | where t.process_id = #{flowCardId}), |
| | | glass_info_max_layer_temp as ( |
| | | select process_id, |
| | | order_id, |
| | | GREATEST(child_width, child_height) as first_length, |
| | | least(child_width, child_height) as second_length, |
| | | child_width, |
| | | child_height, |
| | | order_number, |
| | | technology_number, |
| | | quantity |
| | | from temp_flow |
| | | where technology_number = #{totalLayer} |
| | | ), |
| | | glass_info_layer_temp as ( |
| | | select process_id, |
| | | order_id, |
| | | GREATEST(child_width, child_height) as first_length, |
| | | least(child_width, child_height) as second_length, |
| | | child_width, |
| | | child_height, |
| | | order_number, |
| | | technology_number, |
| | | quantity |
| | | from temp_flow |
| | | where technology_number = #{layer} |
| | | ), |
| | | max_layer_sequence as ( |
| | | select row_number() over (order by second_length desc,first_length desc) as rn, t.order_number |
| | | from glass_info_max_layer_temp t |
| | | ), |
| | | result as (select t.* |
| | | from glass_info_layer_temp t |
| | | INNER join max_layer_sequence t1 on t.order_number = t1.order_number |
| | | order by t1.rn) |
| | | select * |
| | | from result |
| | | </select> |
| | | <select id="queryLackByFlowCard" resultMap="lackBaseMap"> |
| | | with relation_length as ( |
| | | select flow_card_id, |
| | | layer, |
| | | tempering_layout_id, |
| | | tempering_feed_sequence, |
| | | GREATEST(width, height) as first_length, |
| | | LEAST(width, height) as second_Length, |
| | | width, |
| | | height, |
| | | thickness, |
| | | films_id |
| | | from hollow_glass_relation_info |
| | | where flow_card_id = #{flowCardId} |
| | | and tempering_layout_id is null |
| | | and tempering_feed_sequence is null |
| | | ) |
| | | select flow_card_id, layer, first_length, films_id, second_Length, thickness, count(*) as lack_cout |
| | | from relation_length |
| | | group by flow_card_id, layer, films_id, first_length, second_Length, thickness |
| | | </select> |
| | | </mapper> |
| | |
| | | <module>TemperingGlassModule</module> |
| | | <module>UnLoadGlassModule</module> |
| | | <module>GlassStorageModule</module> |
| | | <module>howllowGlassModule</module> |
| | | </modules> |
| | | |
| | | <properties> |
| | |
| | | <module>common</module> |
| | | <module>moduleService</module> |
| | | <module>gateway</module> |
| | | <module>mesHub</module> |
| | | </modules> |
| | | <packaging>pom</packaging> |
| | | |