| | |
| | | @Data |
| | | public class BigStorageVO { |
| | | |
| | | @ApiModelProperty(value = "笼子号") |
| | | private int deviceId; |
| | | @ApiModelProperty(value = "格子号") |
| | | private int slot; |
| | | @ApiModelProperty(value = "数量") |
New file |
| | |
| | | package com.mes.rawglassdetails.entity.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/9/20 16:31 |
| | | * @Description: |
| | | */ |
| | | @Data |
| | | public class RawGlassStorageDetailsDTO { |
| | | |
| | | /** |
| | | * 原片宽 |
| | | */ |
| | | private Double patternWidth; |
| | | |
| | | /** |
| | | * 原片高 |
| | | */ |
| | | private Double patternHeight; |
| | | |
| | | /** |
| | | * 原片厚度 |
| | | */ |
| | | private Double patternThickness; |
| | | |
| | | /** |
| | | * 膜系 |
| | | */ |
| | | private String filmsId; |
| | | |
| | | /** |
| | | * 总原片数 |
| | | */ |
| | | private Integer totalCount; |
| | | |
| | | /** |
| | | * 笼内片数 |
| | | */ |
| | | private String count; |
| | | |
| | | /** |
| | | * 上片片数 |
| | | */ |
| | | private String finishCount; |
| | | |
| | | /** |
| | | * 破损片数 |
| | | */ |
| | | private String damageCount; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.rawglassdetails.entity.RawGlassStorageDetails; |
| | | import com.mes.rawglassdetails.entity.dto.RawGlassStorageDetailsDTO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | * @return |
| | | */ |
| | | List<RawGlassStorageDetails> listBySlotState(@Param("leftingStation") List<Integer> liftingStation, @Param("state") List<Integer> state); |
| | | |
| | | List<RawGlassStorageDetailsDTO> patternUsage(@Param("width") String width, @Param("height") String height, @Param("thickness") String thickness, @Param("films") String films); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.rawglassdetails.entity.RawGlassStorageDetails; |
| | | import com.mes.rawglassdetails.entity.dto.RawGlassStorageDetailsDTO; |
| | | import com.mes.rawglassdetails.entity.request.RawGlassRequest; |
| | | |
| | | import java.util.List; |
| | |
| | | boolean generateTask(int startSlot, int endSlot, int shelf, int patternQuantity, int taskType) throws Exception; |
| | | |
| | | String shelfReset(Long slot); |
| | | |
| | | List<RawGlassStorageDetailsDTO> patternUsage(String width, String height, String thickness, String films); |
| | | } |
| | |
| | | import com.kangaroohy.milo.service.MiloService; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.rawglassdetails.entity.RawGlassStorageDetails; |
| | | import com.mes.rawglassdetails.entity.dto.RawGlassStorageDetailsDTO; |
| | | import com.mes.rawglassdetails.entity.request.RawGlassRequest; |
| | | import com.mes.rawglassdetails.mapper.RawGlassStorageDetailsMapper; |
| | | import com.mes.rawglassdetails.service.RawGlassStorageDetailsService; |
| | |
| | | //生成一条详情数据 仅记录架子状态 |
| | | return "success"; |
| | | } |
| | | |
| | | @Override |
| | | public List<RawGlassStorageDetailsDTO> patternUsage(String width, String height, String thickness, String films){ |
| | | return baseMapper.patternUsage(width, height, thickness, films); |
| | | } |
| | | } |
| | |
| | | <result column="DEVICE_ID" property="deviceId"/> |
| | | <result column="SLOT" property="slot"/> |
| | | </resultMap> |
| | | <resultMap id="RawGlassStorageDetailsDTO" type="com.mes.rawglassdetails.entity.dto.RawGlassStorageDetailsDTO"> |
| | | <result property="patternWidth" column="pattern_width"/> |
| | | <result property="patternHeight" column="pattern_height"/> |
| | | <result property="patternThickness" column="pattern_thickness"/> |
| | | <result property="filmsId" column="films_id"/> |
| | | <result property="count" column="count"/> |
| | | <result property="finishCount" column="finishCount"/> |
| | | <result property="damageCount" column="damageCount"/> |
| | | <!-- 如果有其他字段,请继续添加 --> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="listBySlotState" resultMap="baseMap"> |
| | | SELECT |
| | |
| | | </foreach> |
| | | AND T1.SLOT IS NULL |
| | | </select> |
| | | |
| | | <select id="listBySlotState" resultMap="RawGlassStorageDetailsDTO"> |
| | | select rgsd.pattern_width, |
| | | rgsd.pattern_height, |
| | | rgsd.pattern_thickness, |
| | | rgsd.films_id, |
| | | rgsd.count + sum(lgdth.finish_count) + sum(damage_count), |
| | | rgsd.count, |
| | | sum(lgdth.finish_count) as finishCount, |
| | | sum(damage_count) as damageCount |
| | | from (select pattern_width, |
| | | pattern_height, |
| | | pattern_thickness, |
| | | films_id, |
| | | sum(case when state = 100 then remain_quantity else 0 end) as count |
| | | from raw_glass_storage_details |
| | | group by pattern_width, pattern_height, pattern_thickness, films_id) as rgsd |
| | | left JOIN load_glass_device_task_history as lgdth |
| | | on rgsd.pattern_width = lgdth.raw_glass_width |
| | | and rgsd.pattern_height = lgdth.raw_glass_height |
| | | and rgsd.pattern_thickness = lgdth.raw_glass_thickness |
| | | and rgsd.films_id = lgdth.raw_glass_films_id |
| | | where rgsd.pattern_width like "%#{processId}%" |
| | | and rgsd.pattern_height like "%#{pattern_height}%" |
| | | and rgsd.pattern_thickness like "%#{pattern_thickness}%" |
| | | and rgsd.films_id like "%#{films_id}%" |
| | | group by rgsd.pattern_width, rgsd.pattern_height, rgsd.pattern_thickness, rgsd.films_id |
| | | </select> |
| | | </mapper> |
| | |
| | | patternSequence = lastGlass.getPatternSequence() + 1; |
| | | } else { |
| | | //当前版图是否有剩余,有剩余显示当前版图 |
| | | patternSequence = lastGlass.getPatternSequence(); |
| | | } |
| | | patternSequence = lastGlass.getPatternSequence(); } |
| | | } |
| | | return baseMapper.queryCutDrawingByEngineerId(engineering.getEngineerId(), patternSequence, 0); |
| | | } |
| | |
| | | import com.mes.edgstoragecage.entity.vo.EdgStorageCageVO; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageDetailsService; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageService; |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.engineering.service.EngineeringService; |
| | | import com.mes.opctask.entity.EdgStorageDeviceTask; |
| | | import com.mes.opctask.entity.EdgStorageDeviceTaskHistory; |
| | | import com.mes.opctask.service.EdgStorageDeviceTaskHistoryService; |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.CompletionStage; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | |
| | | EdgStorageDeviceTaskService edgStorageDeviceTaskService; |
| | | @Resource |
| | | EdgStorageDeviceTaskHistoryService edgStorageDeviceTaskHistoryService; |
| | | @Resource |
| | | EngineeringService engineeringService; |
| | | |
| | | |
| | | private static final String EDG_STORAGE_DEVICE_ONE_TASK = "edg_storage_device_one_task"; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void largenScreen() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //磨边信息 |
| | | List<EdgStorageDeviceTaskHistory> edgOneTasks = edgStorageDeviceTaskHistoryService.list( |
| | | new LambdaQueryWrapper<EdgStorageDeviceTaskHistory>() |
| | | .eq(EdgStorageDeviceTaskHistory::getDeviceId, 1) |
| | | .eq(EdgStorageDeviceTaskHistory::getTaskState, Const.EDG_GLASS_BEFORE) |
| | | ); |
| | | List<EdgStorageDeviceTaskHistory> edgTwoTasks = edgStorageDeviceTaskHistoryService.list( |
| | | new LambdaQueryWrapper<EdgStorageDeviceTaskHistory>() |
| | | .eq(EdgStorageDeviceTaskHistory::getDeviceId, 1) |
| | | .eq(EdgStorageDeviceTaskHistory::getTaskState, Const.EDG_GLASS_BEFORE) |
| | | ); |
| | | jsonObject.append("edgOneTasks", edgOneTasks); |
| | | jsonObject.append("edgOneTasks", edgTwoTasks); |
| | | List<Engineering> engineeringOne = engineeringService.list( |
| | | new LambdaQueryWrapper<Engineering>() |
| | | .eq(Engineering::getStationCell, 5) |
| | | ); |
| | | List<Engineering> engineeringTow = engineeringService.list( |
| | | new LambdaQueryWrapper<Engineering>() |
| | | .eq(Engineering::getStationCell, 6) |
| | | ); |
| | | jsonObject.append("engineeringOne", engineeringOne); |
| | | jsonObject.append("engineeringTow", engineeringTow); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("largenScreen"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | List<String> messages = webserver.getMessages(); |
| | | if (!messages.isEmpty()) { |
| | | // // 将最后一个消息转换为整数类型的列表 |
| | | webserver.clearMessages(); |
| | | } |
| | | } else { |
| | | log.info("largenScreen is closed"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | List<BigStorageCageDetails> queryRealGlassInfo(BigStorageQueryVO bigStorageQueryVO); |
| | | |
| | | List<BigStorageVO> querybigStorageCageDetail(); |
| | | Map<Integer, List<BigStorageVO>> querybigStorageCageDetail(); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<BigStorageVO> querybigStorageCageDetail() { |
| | | return baseMapper.querybigStorageCageDetail(); |
| | | public Map<Integer, List<BigStorageVO>> querybigStorageCageDetail() { |
| | | List<BigStorageVO> bigStorageCages= baseMapper.querybigStorageCageDetail(); |
| | | return bigStorageCages.stream().collect(Collectors.groupingBy(item -> item.getDeviceId())); |
| | | } |
| | | |
| | | @Override |
| | |
| | | FROM result |
| | | </select> |
| | | <select id="querybigStorageCageDetail" resultType="com.mes.base.entity.vo.BigStorageVO"> |
| | | SELECT SLOT, COUNT(1) AS COUNT |
| | | FROM BIG_STORAGE_CAGE_DETAILS |
| | | where state in (100, 102, 103, 104) |
| | | group by SLOT |
| | | ORDER BY SLOT |
| | | select bsc.device_id, bsc.slot, count(bscd.glass_id) as count |
| | | from big_storage_cage bsc left join big_storage_cage_details bscd |
| | | on bsc.slot=bscd.slot and bscd.state in (100, 102, 103, 104) |
| | | group by bsc.device_id, bsc.slot |
| | | order by bsc.device_id, bsc.slot |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.hutool.json.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.rawglassdetails.entity.RawGlassStorageDetails; |
| | | import com.mes.rawglassdetails.service.RawGlassStorageDetailsService; |
| | | import com.mes.rawglassstation.service.RawGlassStorageStationService; |
| | | import com.mes.rawglasstask.entity.RawGlassStorageTask; |
| | | import com.mes.rawglasstask.service.RawGlassStorageTaskService; |
| | |
| | | @Resource |
| | | private RawGlassStorageTaskService rawGlassStorageTaskService; |
| | | |
| | | @Resource |
| | | private RawGlassStorageDetailsService rawGlassStorageDetailsService; |
| | | |
| | | @Scheduled(fixedDelay = 2000) |
| | | public void sendRawGlassMessage() { |
| | | log.info("发送任务信息和架子信息"); |
| | |
| | | }); |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void largenScreen() { |
| | | log.info("发送任务信息和架子信息"); |
| | | JSONObject jsonObject = new JSONObject(); |
| | | List<RawGlassStorageDetails> rawGlassStorageDetailList = rawGlassStorageDetailsService.list( |
| | | new LambdaUpdateWrapper<RawGlassStorageDetails>() |
| | | .eq(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_IN) |
| | | ); |
| | | jsonObject.append("rawGlassStorageDetailList", rawGlassStorageDetailList); |
| | | List<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("largenScreen"); |
| | | if (CollectionUtil.isNotEmpty(sendwServer)) { |
| | | sendwServer.stream().forEach(e -> { |
| | | e.sendMessage(String.valueOf(jsonObject)); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.mes.rawglassdetails.controller; |
| | | |
| | | import com.mes.rawglassdetails.entity.dto.RawGlassStorageDetailsDTO; |
| | | import com.mes.rawglassdetails.entity.request.RawGlassRequest; |
| | | import com.mes.rawglassdetails.service.RawGlassStorageDetailsService; |
| | | import com.mes.utils.Result; |
| | |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 前端控制器 |
| | |
| | | public Result<Object> updateQuantity(@Validated @RequestBody RawGlassRequest request) { |
| | | return Result.success(rawGlassStorageDetailsService.UpdateQuantity(request)); |
| | | } |
| | | |
| | | @ApiOperation("删除原片") |
| | | @PostMapping("/deleteWarehousing") |
| | | public Result<Object> deleteWarehousing(@RequestBody Long slotId) { |
| | |
| | | public Result<String> shelfReset(Long slot) { |
| | | return Result.success(rawGlassStorageDetailsService.shelfReset(slot)); |
| | | } |
| | | |
| | | @ApiOperation("原片使用情况") |
| | | @PostMapping("/patternUsage") |
| | | public Result<List<RawGlassStorageDetailsDTO>> patternUsage(String width, String height, String thickness, String films) { |
| | | return Result.build(200, "查询成功", rawGlassStorageDetailsService.patternUsage(width, height, thickness, films)); |
| | | } |
| | | } |
| | |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.tools.WebSocketServer; |
| | |
| | | |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void largenScreen() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //大屏钢化信息 |
| | | Integer putGlass = temperingAgoService.count( |
| | | new LambdaUpdateWrapper<TemperingGlassInfo>() |
| | | .eq(TemperingGlassInfo::getState, Const.TEMPERING_NEW) |
| | | ); |
| | | jsonObject.append("temperingTaskType", putGlass); |
| | | //大屏钢化信息 |
| | | Integer temperingGlass = temperingAgoService.count( |
| | | new LambdaUpdateWrapper<TemperingGlassInfo>() |
| | | .eq(TemperingGlassInfo::getState, Const.TEMPERING_START) |
| | | .groupBy(TemperingGlassInfo::getEngineerId, |
| | | TemperingGlassInfo::getTemperingLayoutId) |
| | | ); |
| | | jsonObject.append("temperingGlass", temperingGlass); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("largenScreen"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | List<String> messages = webserver.getMessages(); |
| | | if (!messages.isEmpty()) { |
| | | // // 将最后一个消息转换为整数类型的列表 |
| | | webserver.clearMessages(); |
| | | } |
| | | } else { |
| | | log.info("largenScreen is closed"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | password: 123456 |
| | | liquibase: |
| | | change-log: classpath:changelog/changelogBase.xml |
| | | kangaroohy: |
| | | milo: |
| | | enabled: true |
| | | primary: default |
| | | config: |
| | | default: |
| | | endpoint: opc.tcp://10.153.19.150:49320 |
| | | security-policy: basic256sha256 |
| | | username: admin |
| | | password: 1qaz2wsx3edc4rfv |
| | |
| | | </if> |
| | | </select> |
| | | <select id="queryHollowbigStorageCageDetail" resultType="com.mes.base.entity.vo.BigStorageVO"> |
| | | SELECT SLOT, COUNT(1) AS COUNT |
| | | FROM HOLLOW_BIG_STORAGE_CAGE_DETAILS |
| | | where state in (100, 102, 103, 104) |
| | | group by SLOT |
| | | ORDER BY SLOT |
| | | select hbsc.device_id, hbsc.slot, count(hbscd.glass_id) as count |
| | | from hollow_big_storage_cage hbsc left join hollow_big_storage_cage_details hbscd |
| | | on hbsc.slot=hbscd.slot and hbscd.state in (100, 102, 103, 104) |
| | | group by hbsc.device_id, hbsc.slot |
| | | order by hbsc.device_id, hbsc.slot |
| | | </select> |
| | | <select id="querySlotMaxSequence" resultType="com.mes.hollow.entity.HollowBigStorageCageDetails"> |
| | | select max(sequence) as sequence, device_id, slot |