| | |
| | | // 将 JSON 对象和数组添加到结果对象中 |
| | | result.put("title", reportingWorkJson); |
| | | result.put("detail", detailsJsonArray); |
| | | result.put("type", 0); |
| | | result.put("type", 1); |
| | | result.put("userId", "admin"); |
| | | result.put("userName", "admin"); |
| | | result.put("qualityInsStatus", 0); |
| | |
| | | if (flag && CollectionUtil.isNotEmpty(emptyList)) { |
| | | return emptyList.get(0); |
| | | } |
| | | if (CollectionUtil.isEmpty(emptyList) || emptyList.size() == 1) { |
| | | if (CollectionUtil.isEmpty(emptyList)) { |
| | | return null; |
| | | } |
| | | return emptyList.get(0); |
| | |
| | | |
| | | public static String engineerId = ""; |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | @Scheduled(fixedDelay = 500) |
| | | public void plcHomeEdgTask() { |
| | | Date startDate = new Date(); |
| | | log.info("本次任务开始执行时间:{}", startDate); |
| | |
| | | String confirmationWrodValue = plcParameterObject.getPlcParameter("MES_confirmation_word").getValue(); |
| | | //A08 A09表示线路相同 可做等价 无数据转int异常 |
| | | String out08Glassstate = plcParameterObject.getPlcParameter("A08_glass_status").getValue(); |
| | | String out09Glassstate = plcParameterObject.getPlcParameter("A09_glass_status").getValue(); |
| | | String out10Glassstate = plcParameterObject.getPlcParameter("A10_glass_status").getValue(); |
| | | String confirmationWrodAddress = plcParameterObject.getPlcParameter("MES_confirmation_word").getAddress(); |
| | | String currentSlot = plcParameterObject.getPlcParameter("Current_slot").getValue(); |
| | | |
| | | // taskRequestTypeValue = "2"; |
| | | if ("1".equals(out09Glassstate)) { |
| | | log.info("A09空闲"); |
| | | out08Glassstate = "1"; |
| | | } |
| | | |
| | | // taskRequestTypeValue = "3"; |
| | | // out08Glassstate = "1"; |
| | | // out10Glassstate = "1"; |
| | | // currentSlot = "5"; |
| | | // currentSlot = "1"; |
| | | // confirmationWrodValue = "0"; |
| | | // glassIdeValue = "P24092706|15|5"; |
| | | // glassIdeValue = "P24110201|17|1"; |
| | | |
| | | log.info("1、获取到的请求字为:{},获取到的扫描ID为:{},获取到的确认字为:{},获取到的出片状态分别为:A09:{}、A10:{},当前格子号为:{}", |
| | | taskRequestTypeValue, glassIdeValue, confirmationWrodValue, out08Glassstate, out10Glassstate, currentSlot); |
| | |
| | | if ("1".equals(taskRequestTypeValue) && result) { |
| | | log.info("2、进片请求,且确认字为0,执行进片任务,扫码重复ID验证【有重复=false,无重复=true】:{}", result); |
| | | inTo(glassIdeValue, confirmationWrodAddress, currentSlot); |
| | | } else if ("2".equals(taskRequestTypeValue)) { |
| | | } else if ("2".equals(taskRequestTypeValue) && result) { |
| | | //09空闲 :1 10空闲 :2 都空闲:3 其他0 |
| | | log.info("2、出片请求,且确认字为0,执行出片任务"); |
| | | outTo(Integer.parseInt(out08Glassstate), |
| | | Integer.parseInt(out10Glassstate), confirmationWrodAddress, "", Integer.parseInt(currentSlot)); |
| | | } else if ("3".equals(taskRequestTypeValue)) { |
| | | } else if ("3".equals(taskRequestTypeValue) && result) { |
| | | log.info("2、进片和出片都空闲,执行出片任务"); |
| | | //加笼子里面是否有玻璃,有先出,无玻璃先进 |
| | | boolean outFlase = outTo(Integer.parseInt(out08Glassstate), |
| | |
| | | } |
| | | |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | @Scheduled(fixedDelay = 500) |
| | | public void dealDamageTask() { |
| | | Date startDate = new Date(); |
| | | log.info("卧式理片破损玻璃清除任务开始执行时间:{}", startDate); |
| | |
| | | // 1.2.3、按照出片信息去详情表查询格子在笼子里面剩余相同尺寸的玻璃数据且以版图id、版序升序排序 取第一块玻璃出片 |
| | | // 2、如果没有历史出片任务 |
| | | // 2.1、出当前版图id最小版序最小的玻璃(问题:两条线都没有历史任务,出片时两条线的玻璃尺寸相同,是否找尺寸不同的) |
| | | if ((out08Glassstate == 2 && out10Glassstate == 2) || (out08Glassstate == 0 && out10Glassstate == 0)) { |
| | | // if ((out08Glassstate == 2 && out10Glassstate == 2) || (out08Glassstate == 0 && out10Glassstate == 0)) { |
| | | // log.info("A09、A10为{},{}非自动状态,无法出片", out08Glassstate, out10Glassstate); |
| | | // return Boolean.FALSE; |
| | | // } |
| | | if ((out08Glassstate == 2 && out10Glassstate == 2)) { |
| | | log.info("A09、A10为{},{}非自动状态,无法出片", out08Glassstate, out10Glassstate); |
| | | return Boolean.FALSE; |
| | | } |
| | | if ((out08Glassstate == 0 && out10Glassstate == 0)) { |
| | | out10Glassstate = 1; |
| | | } |
| | | log.info("0、出片任务出的状态:A09:【{}】;A10:【{}】)", out08Glassstate, out10Glassstate); |
| | | //定义出片玻璃信息 |
| | | int endcell = 0; |
| | | EdgStorageCageDetails glassInfo = null; |
| | | |
| | | //当笼子已满时,不考虑卧式理片前的玻璃 |
| | | EdgStorageCage nearestEmpty = edgStorageCageService.selectNearestEmpty(currentSlot, Boolean.FALSE); |
| | | if (nearestEmpty == null) { |
| | | glassId = ""; |
| | | } |
| | | |
| | | boolean flag = queryMaxMinDiff(threshold); |
| | | log.info("1、获取钢化版图是否超过阈值:{}", flag); |
| | |
| | | if (out08Glassstate == 1 && out10Glassstate == 1) { |
| | | EdgStorageCageDetails a09EdgGlass = queryGlassByTaskCache(Const.A09_OUT_TARGET_POSITION, Const.GLASS_CACHE_TYPE_OUT_ALL); |
| | | EdgStorageCageDetails a10EdgGlass = queryGlassByTaskCache(Const.A10_OUT_TARGET_POSITION, Const.GLASS_CACHE_TYPE_OUT_ALL); |
| | | if (a09EdgGlass == null && a10EdgGlass == null) { |
| | | if (a09EdgGlass != null || a10EdgGlass != null) { |
| | | MPJQueryWrapper<EdgStorageCageDetails> wrapper = new MPJQueryWrapper<>(); |
| | | wrapper.select("count(t.glass_id), t.width, t.height") |
| | | .eq("t.state", Const.GLASS_STATE_IN) |
| | |
| | | glassInfo = currentGlass; |
| | | } |
| | | } |
| | | //玻璃信息替换 |
| | | String glassIdChange = queryAndChangeGlass(glassInfo.getGlassId()); |
| | | //处理在卧理内的玻璃信息:笼内的数据处理 |
| | | queryEdgAndChangeGlass(glassInfo.getGlassId(), glassIdChange); |
| | | // //玻璃信息替换 |
| | | // String glassIdChange = queryAndChangeGlass(glassInfo.getGlassId()); |
| | | // //处理在卧理内的玻璃信息:笼内的数据处理 |
| | | // queryEdgAndChangeGlass(glassInfo.getGlassId(), glassIdChange); |
| | | LambdaUpdateWrapper<EdgStorageCageDetails> wrapper = new LambdaUpdateWrapper<>(); |
| | | wrapper.eq(EdgStorageCageDetails::getGlassId, glassInfo.getGlassId()).set(EdgStorageCageDetails::getState, Const.GLASS_STATE_OUT); |
| | | edgStorageCageDetailsService.update(wrapper); |
| | |
| | | * @return |
| | | */ |
| | | private int computerLineByState(int out08Glassstate, int out10Glassstate) { |
| | | if (out08Glassstate == 0) { |
| | | if (out10Glassstate == 2) { |
| | | return Const.A09_OUT_TARGET_POSITION; |
| | | } else { |
| | | // if (out08Glassstate == 0) { |
| | | // if (out10Glassstate == 2) { |
| | | // return Const.A09_OUT_TARGET_POSITION; |
| | | // } else { |
| | | // return Const.A10_OUT_TARGET_POSITION; |
| | | // } |
| | | // } else if (out08Glassstate == 1) { |
| | | // return Const.A09_OUT_TARGET_POSITION; |
| | | // } else { |
| | | // return Const.A10_OUT_TARGET_POSITION; |
| | | // } |
| | | if (out10Glassstate == 0) { |
| | | if (out08Glassstate == 2) { |
| | | return Const.A10_OUT_TARGET_POSITION; |
| | | } else { |
| | | return Const.A09_OUT_TARGET_POSITION; |
| | | } |
| | | } else if (out08Glassstate == 1) { |
| | | return Const.A09_OUT_TARGET_POSITION; |
| | | } else { |
| | | } else if (out10Glassstate == 1) { |
| | | return Const.A10_OUT_TARGET_POSITION; |
| | | } else { |
| | | return Const.A09_OUT_TARGET_POSITION; |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | @Scheduled(fixedDelay = 500) |
| | | public void CacheGlassTasks() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | List<Map<String, Object>> currentCutTerritorys = edgStorageCageDetailsService.selectCutTerritory(); |
| | |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | @Scheduled(fixedDelay = 500) |
| | | public void cacheGlassIsRun() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //正在进行的任务 |
| | |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | @Scheduled(fixedDelay = 500) |
| | | public void CacheGlassTaskss() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //log.info("本次识别版图{},++++{}",engineerId,currentCutTerritorys); |
| | |
| | | { |
| | | "plcAddressBegin":"DB11.0", |
| | | "plcAddressLenght":"80", |
| | | "dataType":"word", |
| | | "parameteInfor":[ |
| | | { |
| | | "codeId": "A06_request_word", |
| | | "addressIndex":"0", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"m/min" |
| | | }, |
| | | { |
| | | "codeId": "A05_scanning_ID", |
| | | "addressIndex":"2", |
| | | "addressLenght":"30", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "Current_slot", |
| | | "addressIndex":"36", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "MES_confirmation_word", |
| | | "addressIndex":"38", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "A08_glass_status", |
| | | "addressIndex":"68", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "A10_glass_status", |
| | | "addressIndex":"70", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "A09_prohibit_film_production", |
| | | "addressIndex":"72", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | } |
| | | , |
| | | { |
| | | "codeId": "A10_prohibit_film_production", |
| | | "addressIndex":"74", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | } |
| | | ] |
| | | "plcAddressBegin": "DB11.0", |
| | | "plcAddressLenght": "80", |
| | | "dataType": "word", |
| | | "parameteInfor": [ |
| | | { |
| | | "codeId": "A06_request_word", |
| | | "addressIndex": "0", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "m/min" |
| | | }, |
| | | { |
| | | "codeId": "A05_scanning_ID", |
| | | "addressIndex": "2", |
| | | "addressLenght": "30", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "Current_slot", |
| | | "addressIndex": "36", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "MES_confirmation_word", |
| | | "addressIndex": "38", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "A08_glass_status", |
| | | "addressIndex": "68", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "A10_glass_status", |
| | | "addressIndex": "70", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "A09_prohibit_film_production", |
| | | "addressIndex": "72", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "A10_prohibit_film_production", |
| | | "addressIndex": "74", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "A09_glass_status", |
| | | "addressIndex": "76", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | } |
| | | ] |
| | | } |
| | |
| | | name: cacheGlass |
| | | liquibase: |
| | | enabled: false |
| | | task: |
| | | scheduling: |
| | | pool: |
| | | size: 10 |
| | | thread-name-prefix: task-cache |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | # configuration: |
| | |
| | | @EnableSwagger2WebMvc |
| | | @EnableDiscoveryClient |
| | | @MapperScan(basePackages = "com.mes.*.mapper") |
| | | @EnableScheduling |
| | | //@EnableScheduling |
| | | public class CacheVerticalClassModuleApplication { |
| | | public static void main(String[] args) { |
| | | try { |
| | |
| | | |
| | | //获取玻璃的厚度:重新选笼子需要按照笼子可放玻璃厚度进行选择 因为子查询排序对主sql无影响,所以先执行子查询获取顺序,然后一次去查询 |
| | | List<Integer> deviceUsedList = bigStorageCageService.queryFreeDeviceByUsed(glassInfo.getThickness()); |
| | | List<Integer> deviceUseds = bigStorageCageService.queryFreeDeviceByUsed(glassInfo.getThickness()); |
| | | List<Integer> deviceUseds = bigStorageCageService.queryFreeDeviceByUsed(glassInfo.getThickness()); |
| | | List<BigStorageCageDetails> engineerCount1 = baseMapper.selectList( |
| | | new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .notIn(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT,Const.GLASS_STATE_DAMAGE,Const.GLASS_STATE_TAKE) |
| | | .notIn(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT, Const.GLASS_STATE_DAMAGE, Const.GLASS_STATE_TAKE) |
| | | .select(BigStorageCageDetails::getEngineerId) |
| | | .groupBy(BigStorageCageDetails::getEngineerId) |
| | | .between(BigStorageCageDetails::getDeviceId, 1, 5) |
| | | ); |
| | | List<BigStorageCageDetails> engineerCount2 = baseMapper.selectList( |
| | | new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .notIn(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT,Const.GLASS_STATE_DAMAGE,Const.GLASS_STATE_TAKE) |
| | | .notIn(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT, Const.GLASS_STATE_DAMAGE, Const.GLASS_STATE_TAKE) |
| | | .select(BigStorageCageDetails::getEngineerId) |
| | | .groupBy(BigStorageCageDetails::getEngineerId) |
| | | .between(BigStorageCageDetails::getDeviceId, 6, 8) |
| | | ); |
| | | if (engineerCount1.size() > engineerCount2.size()) { |
| | | if (glassInfo.getThickness() == 8) { |
| | | deviceUsedList.removeIf(device -> device < 6); |
| | | } else { |
| | | deviceUsedList.removeIf(device -> device > 5); |
| | | if (engineerCount1.size() > engineerCount2.size()) { |
| | | deviceUsedList.removeIf(device -> device < 6); |
| | | } else { |
| | | deviceUsedList.removeIf(device -> device > 5); |
| | | } |
| | | } |
| | | if (CollectionUtils.isEmpty(deviceUsedList)) { |
| | | deviceUsedList = deviceUseds; |
| | |
| | | * fixedRate : 上一个调用开始后再次调用的延时(不用等待上一次调用完成) |
| | | * fixedDelay : 上一个调用结束后再次调用的延时 |
| | | */ |
| | | @Scheduled(fixedDelay = 1000) |
| | | @Scheduled(fixedDelay = 300) |
| | | public void plcStorageCageTask() throws InterruptedException { |
| | | jsonObject = new JSONObject(); |
| | | try { |
| | |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | @Scheduled(fixedDelay = 300) |
| | | public void temperingIsRun() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //进片任务数据 |
| | |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = Long.MAX_VALUE) |
| | | // @Scheduled(fixedDelay = Long.MAX_VALUE) |
| | | public void scanCodeTask() { |
| | | log.info("扫描任务已启动"); |
| | | while (true) { |
| | |
| | | String d01ToMES = plcParameterObject.getPlcParameter("D01ToMES").getValue(); |
| | | String d04ToMES = plcParameterObject.getPlcParameter("D04ToMES").getValue(); |
| | | |
| | | |
| | | // d04Id="P24110503|17|4"; |
| | | // d04ToMES="1"; |
| | | // d01ToMES="1"; |
| | | |
| | | log.info("1、获取d01Id扫描ID为:{},请求字为{};获取d04Id扫描ID为:{},请求字为{};", d01Id, d01ToMES, d04Id, d04ToMES); |
| | | if (StringUtils.isBlank(d01ToMES) && StringUtils.isBlank(d04ToMES)) { |
| | | log.info("两条线未收到进片任务,结束本次扫描进卧转立任务"); |
| | |
| | | public void plcToHomeEdgFreeCarTask() { |
| | | Date startDate = new Date(); |
| | | log.info("大理片笼空车进片任务开始执行时间:{}", startDate); |
| | | |
| | | PlcParameterObject plcMesObject = S7object.getinstance().PlcMesObject; |
| | | String mesD03Address = plcMesObject.getPlcParameter("MESToD03").getValue(); |
| | | String mesD05Address = plcMesObject.getPlcParameter("MESToD05").getValue(); |
| | |
| | | computeTargetByLine(outLine); |
| | | } |
| | | Date endDate = new Date(); |
| | | |
| | | log.info("大理片笼空车进片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | } |
| | | |
| | |
| | | BigStorageCageDetails bigStorageCageDetails = bigStorageCageDetailsService.getOne( |
| | | new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .eq(BigStorageCageDetails::getGlassId, glassId) |
| | | .ne(BigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | ); |
| | | if (bigStorageCageFeedTask != null || bigStorageCageDetails != null) { |
| | | log.info("此玻璃存任务或已在笼内"); |
| | |
| | | Map<String, GlassInfo> glassInfoMap = glassInfos.stream() |
| | | .collect(Collectors.toMap(GlassInfo::getGlassId, p -> p)); |
| | | for (BigStorageCageFeedTask e : taskList) { |
| | | //替换玻璃id |
| | | queryAndChangeGlass(e.getGlassId()); |
| | | GlassInfo info = glassInfoMap.get(e.getGlassId()); |
| | | if (info == null) { |
| | | continue; |
| | |
| | | return sitToUpRemainWidth.getWidth() < Math.max(glassInfo.getWidth(), glassInfo.getHeight()); |
| | | } |
| | | |
| | | public String queryAndChangeGlass(String glassId) { |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassId)); |
| | | Assert.isFalse(null == glassInfo, "玻璃信息不存在"); //按照玻璃尺寸 |
| | | LambdaQueryWrapper<GlassInfo> queryWrapper = new LambdaQueryWrapper<GlassInfo>() |
| | | .eq(GlassInfo::getWidth, glassInfo.getWidth()) |
| | | .eq(GlassInfo::getHeight, glassInfo.getHeight()) |
| | | .eq(GlassInfo::getThickness, glassInfo.getThickness()) |
| | | .eq(GlassInfo::getFilmsid, glassInfo.getFilmsid()) |
| | | .eq(GlassInfo::getFlowCardId, glassInfo.getFlowCardId()) |
| | | .eq(GlassInfo::getTotalLayer, glassInfo.getTotalLayer()) |
| | | .eq(GlassInfo::getLayer, glassInfo.getLayer()) |
| | | .eq(GlassInfo::getEngineerId, glassInfo.getEngineerId()) |
| | | .notInSql(GlassInfo::getGlassId, "select distinct glass_id from big_storage_cage_details " + |
| | | "where engineer_id = '" + glassInfo.getEngineerId() + "' and width = " + glassInfo.getWidth() + " and height = " + glassInfo.getHeight()) |
| | | .orderByAsc(GlassInfo::getTemperingLayoutId) |
| | | .orderBy(Boolean.TRUE, sequenceOrder, GlassInfo::getTemperingFeedSequence) |
| | | .last("Limit 1"); |
| | | GlassInfo swapGlassInfo = glassInfoService.getOne(queryWrapper); |
| | | if (swapGlassInfo != null && !glassInfo.getGlassId().equals(swapGlassInfo.getGlassId())) { |
| | | String swapGlassId = swapGlassInfo.getGlassId(); |
| | | log.info("将玻璃{}和玻璃{},信息互换,进玻璃 {}", glassInfo, swapGlassInfo, swapGlassInfo); |
| | | swapGlassInfo.setGlassId(glassId); |
| | | glassInfo.setGlassId(swapGlassId); |
| | | glassInfoService.updateById(swapGlassInfo); |
| | | glassInfoService.updateById(glassInfo); |
| | | return swapGlassId; |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | } |
| | |
| | | task: |
| | | scheduling: |
| | | pool: |
| | | size: 10 |
| | | size: 2 |
| | | thread-name-prefix: task-cacheVertical |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | # configuration: |
| | | # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | mes: |
| | | sequence: |
| | | order: false |
| | |
| | | END MAX_LENGTH |
| | | FROM BIG_STORAGE_CAGE_FEED_TASK |
| | | WHERE LINE = #{line} |
| | | AND (target_slot = 0 or target_slot is null) |
| | | AND TASK_STATE IN (1, 2) |
| | | and deleted = 0 |
| | | ) T |
| | |
| | | import cn.hutool.json.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageFeedTask; |
| | | import com.mes.bigstoragetask.mapper.BigStorageCageFeedTaskMapper; |
| | | import com.mes.bigstoragetask.service.BigStorageCageFeedTaskService; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | |
| | | DamageService damageService; |
| | | @Autowired |
| | | EdgGlassTaskInfoService edgGlassTaskInfoService; |
| | | @Autowired |
| | | BigStorageCageFeedTaskService bigStorageCageFeedTaskService; |
| | | |
| | | |
| | | // @Autowired |
| | | // BigStorageCageFeedTaskMapper bigStorageCageFeedTaskMapper; |
| | |
| | | |
| | | @Test |
| | | public void insertDamage() { |
| | | Damage damage=new Damage(); |
| | | Damage damage = new Damage(); |
| | | damage.setGlassId("P24060403|3|6"); |
| | | damage.setLine(2001); |
| | | damage.setWorkingProcedure("冷加工"); |
| | |
| | | } |
| | | |
| | | @Test |
| | | public void chaxun(){ |
| | | public void chaxun() { |
| | | List<EdgGlassTaskInfo> edgGlassTaskInfoList = edgGlassTaskInfoService.list(new QueryWrapper<EdgGlassTaskInfo>() |
| | | .select("Top 1 *") |
| | | .eq("glass_id", "P24072402|1|13") |
| | |
| | | } |
| | | |
| | | @Test |
| | | public void deleteByGlassId(){ |
| | | public void deleteByGlassId() { |
| | | damageService.deleteByGlassId("P24081203|2|5"); |
| | | } |
| | | |
| | | @Test |
| | | public void testttt(){ |
| | | public void testttt() { |
| | | List<Integer> deviceUsedList = bigStorageCageService.queryFreeDeviceByUsed(6); |
| | | List<Integer> deviceUseds = deviceUsedList; |
| | | List<BigStorageCageDetails> engineerCount1 = bigStorageCageDetailsService.list( |
| | | new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .notIn(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT,Const.GLASS_STATE_DAMAGE,Const.GLASS_STATE_TAKE) |
| | | .notIn(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT, Const.GLASS_STATE_DAMAGE, Const.GLASS_STATE_TAKE) |
| | | .select(BigStorageCageDetails::getEngineerId) |
| | | .groupBy(BigStorageCageDetails::getEngineerId) |
| | | .between(BigStorageCageDetails::getDeviceId, 1, 5) |
| | | ); |
| | | List<BigStorageCageDetails> engineerCount2 = bigStorageCageDetailsService.list( |
| | | new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .notIn(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT,Const.GLASS_STATE_DAMAGE,Const.GLASS_STATE_TAKE) |
| | | .notIn(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT, Const.GLASS_STATE_DAMAGE, Const.GLASS_STATE_TAKE) |
| | | .select(BigStorageCageDetails::getEngineerId) |
| | | .groupBy(BigStorageCageDetails::getEngineerId) |
| | | .between(BigStorageCageDetails::getDeviceId, 6, 8) |
| | |
| | | if (CollectionUtils.isEmpty(deviceUsedList)) { |
| | | deviceUsedList = deviceUseds; |
| | | } |
| | | log.info("zhi:{}",deviceUsedList); |
| | | log.info("zhi:{}", deviceUsedList); |
| | | } |
| | | |
| | | @Test |
| | | public void ca1() { |
| | | List<BigStorageCageFeedTask> bigStorageCageFeedTasks = bigStorageCageFeedTaskService.list( |
| | | new LambdaQueryWrapper<BigStorageCageFeedTask>() |
| | | .gt(BigStorageCageFeedTask::getTargetSlot, 0) |
| | | .eq(BigStorageCageFeedTask::getLine, Const.A09_OUT_TARGET_POSITION) |
| | | .eq(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_UP) |
| | | ); |
| | | if (CollectionUtils.isEmpty(bigStorageCageFeedTasks)) { |
| | | log.info("zhi:" + bigStorageCageFeedTasks); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Test |
| | | public void ca(){ |
| | | public void ca11() { |
| | | plcStorageCageTask.queryAndChangeGlass("P24110503|17|4"); |
| | | } |
| | | |
| | | @Test |
| | | public void ca() { |
| | | try { |
| | | // 目标系统的API URL |
| | | String url = "http://192.168.3.119:8086/reportingWork/mesSaveReportingWorkWorn"; |
| | |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | 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 |
| | |
| | | port: 8083 |
| | | spring: |
| | | profiles: |
| | | active: dev |
| | | active: cz |
| | | application: |
| | | name: loadGlass |
| | | liquibase: |
| | | enabled: false |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | # configuration: |
| | | # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | kangaroohy: |
| | | milo: |
| | | enabled: false |
| | |
| | | name: temperingGlass |
| | | liquibase: |
| | | enabled: false |
| | | task: |
| | | scheduling: |
| | | pool: |
| | | size: 10 |
| | | thread-name-prefix: task-tempering |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | # configuration: |
| | | # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | mes: |
| | | width: 2800 |
| | | height: 5000 |
| | |
| | | */
|
| | | private Integer workState;
|
| | |
|
| | |
|
| | | /**
|
| | | * 总数量
|
| | | */
|
| | | private Integer totalQuantity;
|
| | |
|
| | | /**
|
| | | * 下片数
|
| | | */
|
| | | private Integer racksNumber;
|
| | |
|
| | | /**
|
| | | * 其他数
|
| | | */
|
| | | private Integer otherNumber;
|
| | |
|
| | | /**
|
| | | * 顺序
|
| | | */
|
| | | private Integer sequence;
|
| | |
| | | item.put("width", downWorkstionAndDownGlassinfo.getTotalwidth()); |
| | | item.put("fillColor", "yellow"); |
| | | item.put("content", downWorkstionAndDownGlassinfo.getFlowCardId()); |
| | | if (downWorkstionAndDownGlassinfo.getFlowCardId() != "" && downWorkstionAndDownGlassinfo.getFlowCardId() != null && downWorkstionAndDownGlassinfo.getTotalQuantity() == downWorkstionAndDownGlassinfo.getRacksNumber() + downWorkstionAndDownGlassinfo.getRacksNumber()) { |
| | | if (downWorkstionAndDownGlassinfo.getFlowCardId() != "" && downWorkstionAndDownGlassinfo.getFlowCardId() != null && downWorkstionAndDownGlassinfo.getTotalQuantity() == downWorkstionAndDownGlassinfo.getRacksNumber() + downWorkstionAndDownGlassinfo.getOtherNumber()) { |
| | | item.put("fullCardColor", "red"); |
| | | } else { |
| | | item.put("fullCardColor", "blue"); |