| | |
| | | username: sa |
| | | # password: JCDM@2023 |
| | | password: admin@123 |
| | | # password: 1!deshine |
| | | |
| | | # 从库数据源 |
| | | slave: |
| | | # 从数据源开关/默认关闭 |
| | |
| | | package com.jcdm.main.bs.formulaChild.service.impl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | @Override |
| | | public AjaxResult updateResults(BsFormulaChildInfo bsFormulaChildInfo) { |
| | | String result = ""; |
| | | // BsFormulaChildInfo checkInfo = new BsFormulaChildInfo(); |
| | | // checkInfo.setProcessesCode(bsFormulaChildInfo.getLocationCode()); |
| | | // checkInfo.setProductCode(bsFormulaChildInfo.getProductCode()); |
| | | //// checkInfo.setMaterialCode(bsFormulaChildInfo.getScanBarcode()); |
| | | // bsFormulaChildInfo.setMaterialCode(bsFormulaChildInfo.getScanBarcode().substring(1,2)); |
| | | // List<BsFormulaChildInfo> bsFormulaChildInfos = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(checkInfo); |
| | | List<BsFormulaChildInfo> bsFormulaChildInfos = bsFormulaChildInfoService.list(new LambdaQueryWrapper<BsFormulaChildInfo>() |
| | | List<BsFormulaChildInfo> bsFormulaChildInfos = new ArrayList<>(); |
| | | List<BsFormulaChildInfo> infos = bsFormulaChildInfoService.list(new LambdaQueryWrapper<BsFormulaChildInfo>() |
| | | .eq(BsFormulaChildInfo::getProcessesCode, bsFormulaChildInfo.getLocationCode()) |
| | | .eq(BsFormulaChildInfo::getProductCode, bsFormulaChildInfo.getProductCode()) |
| | | .eq(BsFormulaChildInfo::getMaterialCode, bsFormulaChildInfo.getScanBarcode().substring(1, 2)) |
| | | .eq(BsFormulaChildInfo::getOperationType, "2") |
| | | ); |
| | | for (BsFormulaChildInfo formulaChildInfo : infos) { |
| | | if(bsFormulaChildInfo.getScanBarcode().contains(formulaChildInfo.getMaterialCode())){ |
| | | bsFormulaChildInfos.add(formulaChildInfo); |
| | | break; |
| | | } |
| | | } |
| | | if(bsFormulaChildInfos.size()>0){ |
| | | String spareField4 = bsFormulaChildInfos.get(0).getSpareField4(); |
| | | bsFormulaChildInfos.get(0).setCollectData(bsFormulaChildInfo.getScanBarcode()); |
| | |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @GetMapping("/noList") |
| | | public TableDataInfo noList() |
| | | { |
| | | List<BsProcessesInfo> list = bsProcessesInfoService.list(); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 导出工序信息列表 |
| | | */ |
| | |
| | | lists.add(OPCElement.PACK_OP500_RecordData);//请求记录数据 |
| | | lists.add(OPCElement.PACK_OP500_AngleResult);//请求记录数据 |
| | | // |
| | | // lists.add(OPCElement.PACK_OP280_RecordData);//请求记录数据 |
| | | // lists.add(OPCElement.PACK_OP320_RecordData);//请求记录数据 |
| | | // lists.add(OPCElement.PACK_OP340_RecordData);//请求记录数据 |
| | | // lists.add(OPCElement.PACK_OP350_RecordData);//请求记录数据 |
| | | // lists.add(OPCElement.PACK_OP360_RecordData);//请求记录数据 |
| | | // lists.add(OPCElement.PACK_OP370_RecordData);//请求记录数据 |
| | | // lists.add(OPCElement.PACK_OP390_RecordData);//请求记录数据 |
| | | // lists.add(OPCElement.PACK_OP470_RecordData);//请求记录数据 |
| | | lists.add(OPCElement.PACK_OP280_RecordData);//请求记录数据 |
| | | lists.add(OPCElement.PACK_OP320A_RecordData);//请求记录数据 |
| | | lists.add(OPCElement.PACK_OP320B_RecordData);//请求记录数据 |
| | | lists.add(OPCElement.PACK_OP340_RecordData);//请求记录数据 |
| | | lists.add(OPCElement.PACK_OP350_RecordData);//请求记录数据 |
| | | lists.add(OPCElement.PACK_OP360_RecordData);//请求记录数据 |
| | | lists.add(OPCElement.PACK_OP370_RecordData);//请求记录数据 |
| | | lists.add(OPCElement.PACK_OP390_RecordData);//请求记录数据 |
| | | lists.add(OPCElement.PACK_OP470_RecordData);//请求记录数据 |
| | | |
| | | return lists; |
| | | } |
| | |
| | | public static final String PACK_OP310_RecordData = "PACK.OP310.RecordData";//请求记录数据 |
| | | |
| | | public static final String PACK_OP310_AngleResult = "PACK.OP310.AngleResult";//请求拧紧数据 |
| | | |
| | | public static final String PACK_OP320A_RecordData = "PACK.OP320A.RecordData";//请求记录数据 |
| | | |
| | | public static final String PACK_OP320B_RecordData = "PACK.OP320B.RecordData";//请求记录数据 |
| | | |
| | | /** |
| | | * OP330 |
| | | */ |
| | |
| | | /** |
| | | * OP320 |
| | | */ |
| | | public static final String PACK_OP320_RecordData = "PACK.OP320.RecordData";//请求记录数据 |
| | | |
| | | /** |
| | | * OP340 |
| | | */ |
| | |
| | | |
| | | public SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | |
| | | //新自动工站 |
| | | public List<String> automaticList = Arrays.asList("OP280", "OP320A","OP320B", "OP340A","OP340B", "OP350A","OP350B", "OP360","OP365","OP370", "OP390", "OP470"); |
| | | |
| | | //自动工位 |
| | | public List<String> automaticList = Arrays.asList("OP300","OP280", "OP320", "OP340", "OP350", "OP360","OP370", "OP390", "OP470", "OP530", "OP540"); |
| | | // public List<String> automaticList = Arrays.asList("OP300","OP280", "OP320A","OP320B", "OP340", "OP350", "OP360","OP370", "OP390", "OP470", "OP530", "OP540"); |
| | | |
| | | //采集模组工位 |
| | | public List<String> moduleCodeList = Arrays.asList("OP300","OP310", "OP320", "OP340", "OP350", "OP330"); |
| | | public List<String> moduleCodeList = Arrays.asList("OP300","OP310", "OP340", "OP350", "OP330"); |
| | | |
| | | //区分pack型号的工位 |
| | | public List<String> packIdList = Arrays.asList("OP280"); |
| | | |
| | | //空的 |
| | | public List<String> nullList = Arrays.asList("OP250","OP260"); |
| | |
| | | // } |
| | | |
| | | //自动工位 |
| | | //plc给我们一个pack码,拿pack码校验出型号 |
| | | if(moduleCodeList.stream().anyMatch(s -> s.equals(device))){ |
| | | //读模组码 |
| | | String moduleCode = miloService.readFromOpcUa(thoroughfare + "." + device + ".ModuleCode").getValue().toString(); |
| | | String productTye = thoroughfare + "." + device + ".ProductType"; |
| | | if(null!=moduleCode && moduleCode.length() == 24){ |
| | | miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(productTye).value(Integer.valueOf(moduleCode.substring(7,8))).build()); |
| | | //进站保存数据 |
| | | if(automaticList.stream().anyMatch(s -> s.equals(device))){ |
| | | //plc给我们一个模组码,拿模组码校验出型号 |
| | | if(moduleCodeList.stream().anyMatch(s -> s.equals(device))) { |
| | | //读模组码 |
| | | String moduleCode = miloService.readFromOpcUa(thoroughfare + "." + device + ".ModuleCode").getValue().toString(); |
| | | String productTye = thoroughfare + "." + device + ".ProductType"; |
| | | if (null != moduleCode && moduleCode.length() == 24) { |
| | | miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(productTye).value(Integer.valueOf(moduleCode.substring(7, 8))).build()); |
| | | //进站保存数据 |
| | | // inSaveDate(thoroughfare,device) |
| | | //记录数据完成 |
| | | String RecordDataDoneAddress = thoroughfare + "." + device + ".RecordDataDone"; |
| | | //记录数据完成 |
| | | String RecordDataDoneAddress = thoroughfare + "." + device + ".RecordDataDone"; |
| | | |
| | | miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(11).build()); |
| | | miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(11).build()); |
| | | |
| | | |
| | | //请求工单 |
| | | }else { |
| | | miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(12).build()); |
| | | //请求工单 |
| | | } else { |
| | | miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(12).build()); |
| | | } |
| | | } |
| | | }else { |
| | | //手动工位处理逻辑 |
| | |
| | | package com.jcdm.main.restful.factoryMes.controller; |
| | | |
| | | import java.util.Date; |
| | | import java.util.Timer; |
| | | import java.util.TimerTask; |
| | | import java.util.*; |
| | | |
| | | public class testClass { |
| | | public static void main(String[] args) { |
| | | // 创建Timer实例 |
| | | Timer timer = new Timer(); |
| | | |
| | | // 创建TimerTask实例 |
| | | TimerTask task = new TimerTask() { |
| | | @Override |
| | | public void run() { |
| | | // 在这里编写定时任务的具体逻辑 |
| | | System.out.println("定时任务触发,当前时间:" + new Date()); |
| | | String str = "123990016680564"; |
| | | List<String> l = new ArrayList<>(); |
| | | l.add("9900166805"); |
| | | l.add("9900171753"); |
| | | l.add("9900173353"); |
| | | Integer i = 0; |
| | | String o = ""; |
| | | for (String s : l) { |
| | | if(str.contains(s)){ |
| | | i = s.length(); |
| | | o = s; |
| | | break; |
| | | } |
| | | }; |
| | | } |
| | | System.out.println(i); |
| | | System.out.println(o); |
| | | |
| | | // 设置定时任务的触发时间为每天的9:25 |
| | | // 获取当前时间 |
| | | Date currentTime = new Date(); |
| | | // 设置定时任务的触发时间为当天的9:25 |
| | | Date scheduleTime = new Date(currentTime.getYear(), currentTime.getMonth(), currentTime.getDate(), 9, 27, 0); |
| | | |
| | | // 启动定时任务 |
| | | timer.schedule(task, scheduleTime); |
| | | |
| | | } |
| | | } |
| | |
| | | <result property="preparationTime" column="preparation_time" /> |
| | | <result property="productiveTime" column="productive_time" /> |
| | | <result property="status" column="status" /> |
| | | <result property="spareField1" column="spare_field_1" /> |
| | | <result property="spareField2" column="spare_field_2" /> |
| | | <result property="spareField3" column="spare_field_3" /> |
| | | <result property="spareField4" column="spare_field_4" /> |
| | | <result property="spareField1" column="spare_field1" /> |
| | | <result property="spareField2" column="spare_field2" /> |
| | | <result property="spareField3" column="spare_field3" /> |
| | | <result property="spareField4" column="spare_field4" /> |
| | | <result property="createUser" column="create_user" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateUser" column="update_user" /> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectBsProcessesInfoVo"> |
| | | select id, processes_code, processes_name, processes_type, preparation_time, productive_time, status, spare_field_1, spare_field_2, spare_field_3, spare_field_4, create_user, create_time, update_user, update_time, remarks from bs_processes_info |
| | | select id, processes_code, processes_name, processes_type, preparation_time, productive_time, status, spare_field1, spare_field2, spare_field3, spare_field4, create_user, create_time, update_user, update_time, remarks from bs_processes_info |
| | | </sql> |
| | | |
| | | <select id="selectBsProcessesInfoList" parameterType="BsProcessesInfo" resultMap="BsProcessesInfoResult"> |
| | |
| | | <if test="preparationTime != null">preparation_time,</if> |
| | | <if test="productiveTime != null">productive_time,</if> |
| | | <if test="status != null">status,</if> |
| | | <if test="spareField1 != null">spare_field_1,</if> |
| | | <if test="spareField2 != null">spare_field_2,</if> |
| | | <if test="spareField3 != null">spare_field_3,</if> |
| | | <if test="spareField4 != null">spare_field_4,</if> |
| | | <if test="createUser != null">create_user,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateUser != null">update_user,</if> |
| | |
| | | <if test="preparationTime != null">#{preparationTime},</if> |
| | | <if test="productiveTime != null">#{productiveTime},</if> |
| | | <if test="status != null">#{status},</if> |
| | | <if test="spareField1 != null">#{spareField1},</if> |
| | | <if test="spareField2 != null">#{spareField2},</if> |
| | | <if test="spareField3 != null">#{spareField3},</if> |
| | | <if test="spareField4 != null">#{spareField4},</if> |
| | | <if test="createUser != null">#{createUser},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="updateUser != null">#{updateUser},</if> |
| | |
| | | <if test="preparationTime != null">preparation_time = #{preparationTime},</if> |
| | | <if test="productiveTime != null">productive_time = #{productiveTime},</if> |
| | | <if test="status != null">status = #{status},</if> |
| | | <if test="spareField1 != null">spare_field_1 = #{spareField1},</if> |
| | | <if test="spareField2 != null">spare_field_2 = #{spareField2},</if> |
| | | <if test="spareField3 != null">spare_field_3 = #{spareField3},</if> |
| | | <if test="spareField4 != null">spare_field_4 = #{spareField4},</if> |
| | | <if test="createUser != null">create_user = #{createUser},</if> |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | | <if test="updateUser != null">update_user = #{updateUser},</if> |
| | |
| | | }) |
| | | } |
| | | |
| | | export function listProcessesNoPage(query) { |
| | | return request({ |
| | | url: '/bs/processes/noList', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // 查询工序信息详细 |
| | | export function getProcesses(id) { |
| | | return request({ |
| | |
| | | </el-table-column> |
| | | <el-table-column label="产品编号" align="center" prop="productCode"> |
| | | </el-table-column> |
| | | <el-table-column label="物料编码" align="center" prop="materialCode"> |
| | | </el-table-column> |
| | | <el-table-column label="采集值" align="center" prop="collectData"> |
| | | </el-table-column> |
| | | <el-table-column label="结果" align="center" prop="results"> |
| | |
| | | this.cakeLamp.release= 0 //允许放行 |
| | | |
| | | this.formulaChildList = [] |
| | | this.headContent.sfcCode = null |
| | | this.workpieceInformation.productCode = null; |
| | | this.workpieceInformation.workOrderNo = null; |
| | | this.workpieceInformation.productModel = null; |
| | | this.workpieceInformation.productName = null; |
| | | this.headContent.sfcCode = ''; |
| | | }, |
| | | changeMenu(tab, event) { |
| | | console.log(tab, event); |
| | |
| | | |
| | | <script> |
| | | import {listStationConf, getStationConf, delStationConf, addStationConf, updateStationConf} from "@/api/main/sc/stationConf"; |
| | | import {listProcesses} from "@/api/main/bs/processes/processes"; |
| | | import {listProcesses, listProcessesNoPage} from "@/api/main/bs/processes/processes"; |
| | | |
| | | export default { |
| | | name: "StationConf", |
| | |
| | | |
| | | }, |
| | | initProcesses(){ |
| | | listProcesses(this.queryParams).then(response => { |
| | | this.options = []; |
| | | listProcessesNoPage().then(response => { |
| | | this.options = response.rows; |
| | | }); |
| | | }, |