mark for pull
Este cometimento está contido em:
ascendente
3ab40e515a
cometimento
e82bc1161c
@ -2,14 +2,14 @@ spring:
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
#MySQL-local
|
||||
# url: jdbc:mysql://10.0.1.249:3306/mt_cigs4?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
||||
# username: cigs4
|
||||
# password: 1qazxsw2
|
||||
url: jdbc:mysql://10.0.1.249:3306/mt_cigs4?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
||||
username: cigs4
|
||||
password: 1qazxsw2
|
||||
|
||||
#MySQL-remote
|
||||
url: jdbc:mysql://mysql.picaiba.com:30307/mt_cigs4?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
||||
username: root
|
||||
password: 1qaz@WSX3edc$RFV
|
||||
# url: jdbc:mysql://mysql.picaiba.com:30307/mt_cigs4?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
||||
# username: root
|
||||
# password: 1qaz@WSX3edc$RFV
|
||||
# #Oracle
|
||||
# driver-class-name: oracle.jdbc.OracleDriver
|
||||
# url: jdbc:oracle:thin:@192.168.10.10:1521:xe
|
||||
@ -66,15 +66,15 @@ dynamic:
|
||||
# username: root
|
||||
# password: 1qaz@WSX3edc$RFV
|
||||
## camline系统 - remote
|
||||
camline:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://mysql.picaiba.com:30307/mt_cigs4?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
||||
username: root
|
||||
password: 1qaz@WSX3edc$RFV
|
||||
#
|
||||
#camline系统 - local
|
||||
# camline:
|
||||
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# url: jdbc:mysql://10.0.1.23:3306/synapse?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
||||
# username: offline_data
|
||||
# password: tpvmfab4
|
||||
# url: jdbc:mysql://mysql.picaiba.com:30307/mt_cigs4?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
||||
# username: root
|
||||
# password: 1qaz@WSX3edc$RFV
|
||||
#
|
||||
#camline系统 - local
|
||||
camline:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://10.0.1.23:3306/synapse?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
||||
username: offline_data
|
||||
password: tpvmfab4
|
@ -33,8 +33,8 @@ spring:
|
||||
enabled: true
|
||||
redis:
|
||||
database: 6
|
||||
host: 127.0.0.1
|
||||
#host: 10.0.1.249
|
||||
#host: 127.0.0.1
|
||||
host: 10.0.1.249
|
||||
#host: 192.168.0.102
|
||||
port: 6379
|
||||
password: '' # 密码(默认为空)
|
||||
|
@ -206,252 +206,252 @@ public class KukaJoinThread implements ApplicationRunner {
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
|
||||
// kukaStep1.scheduleAtFixedRate(new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// try {
|
||||
//
|
||||
// //调度开始
|
||||
//// logger.info("");
|
||||
//// logger.info("================= 现在开始执行 过程一 任务 ==================");
|
||||
// Integer subArrived = waitingForTarget(Step1Plc2MesVar.SubArrivedToMes, true);
|
||||
// if(subArrived != 1){
|
||||
// logger.info("标签打印Event--- 失败"+" --- "+" MES监听 Step1Plc2MesVar.SubArrivedToMes 是否 等于 1 失败");
|
||||
// }
|
||||
//
|
||||
// //一. 从plc 中获取 subId 和 lineNum
|
||||
// String subId = (String) read(S7Client.S7_KUKA,Step1Plc2MesVar.SubIdToMes);
|
||||
// Integer lineNum = (Integer) read(S7Client.S7_KUKA,Step1Plc2MesVar.LineNum);
|
||||
// //把基板ID字符串的空格去掉,因为plc中设置的20位,但实际基板ID就是17位,因为带空格去数据库查询 有问题的。
|
||||
// subId = removeKG(subId);
|
||||
//
|
||||
// //二. MES 业务
|
||||
// //=============== MES 业务 开始 =================
|
||||
// //1. 从comline数据库中获取 实际pmpp
|
||||
// float pmppActual = service.getPMPPBySubId(subId);
|
||||
// //2. 匹配和计算补偿功率
|
||||
// float pmppCompensation = compensationPowerServiceBiz.calculCompensationPMPP(pmppActual,lineNum);
|
||||
// //3. 依据补偿功率,获取工艺参数,并且把这些工艺参数传给kuka
|
||||
// WoPowerLevel argByPMPP = levelServiceBiz.getArgByPMPP(pmppCompensation, lineNum);
|
||||
// write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Pnom,Integer.valueOf(argByPMPP.getPowerClass()));
|
||||
// write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Voc,argByPMPP.getLableVoc());
|
||||
// write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Isc,argByPMPP.getLableIsc());
|
||||
// write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Vmpp,argByPMPP.getLableVmpp());
|
||||
// write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Impp,argByPMPP.getLableImpp());
|
||||
// logger.info("标签打印Event--- 采集到 基板ID: "+subId+", 线边号:"+lineNum+",从camline 获取到实际pmpp"+pmppActual+",计算后 补偿功率:"+pmppCompensation+",dLable_Pnom: "+argByPMPP.getPowerClass() +",dLable_Voc: "+argByPMPP.getLableVoc()+",dLable_Isc: "+argByPMPP.getLableIsc()+",dLable_Vmpp: "+argByPMPP.getLableVmpp()+",dLable_Impp: "+argByPMPP.getLableImpp());
|
||||
//
|
||||
//
|
||||
//
|
||||
// //4. 把基板录到数据库
|
||||
// WoPackagingBoxSubstrate woPackagingBoxSubstrate = new WoPackagingBoxSubstrate();
|
||||
// woPackagingBoxSubstrate.setLineBody(lineNum);
|
||||
// woPackagingBoxSubstrate.setPowerLevel(argByPMPP.getPowerClass());
|
||||
// woPackagingBoxSubstrate.setSapMaterial(argByPMPP.getSapMaterialNum());
|
||||
// woPackagingBoxSubstrate.setWoSubstrateId(subId);
|
||||
// woPackagingBoxSubstrate.setActualPmpp(pmppActual);
|
||||
// woPackagingBoxSubstrate.setCreateTime(LocalDateTime.now());
|
||||
// woPackagingBoxSubstrate.setPmpp(pmppCompensation);
|
||||
//
|
||||
//
|
||||
// //5. 从camline那里获取可变字段
|
||||
// CamlineExtendArgDTO extendArgFromCamline = service.getExtendArgFromCamline(subId);
|
||||
// logger.info("标签打印Event--- 基板ID: "+subId+", 从camline获取PID16~PID22 的实测数据 成功, 数据内容:"+extendArgFromCamline.toString());
|
||||
// woPackagingBoxSubstrate.setLastUpdateTime(extendArgFromCamline.getLastUpdateTime());
|
||||
//
|
||||
// woPackagingBoxSubstrate.setOrderName(extendArgFromCamline.getOrderName());
|
||||
// woPackagingBoxSubstrate.setBinclassFl1(extendArgFromCamline.getBinclassFl1());
|
||||
// woPackagingBoxSubstrate.setBinclassFl2(extendArgFromCamline.getBinclassFl2());
|
||||
// woPackagingBoxSubstrate.setEtaFl1(extendArgFromCamline.getEtaFl1());
|
||||
// woPackagingBoxSubstrate.setEtaFl2(extendArgFromCamline.getEtaFl2());
|
||||
// woPackagingBoxSubstrate.setFfFl1(extendArgFromCamline.getFfFl1());
|
||||
// woPackagingBoxSubstrate.setFfFl2(extendArgFromCamline.getFfFl2());
|
||||
// woPackagingBoxSubstrate.setImppFl1(extendArgFromCamline.getImppFl1());
|
||||
// woPackagingBoxSubstrate.setImppFl2(extendArgFromCamline.getImppFl2());
|
||||
// woPackagingBoxSubstrate.setInsolflashcontrolFl1(extendArgFromCamline.getInsolflashcontrolFl1());
|
||||
// woPackagingBoxSubstrate.setInsolflashcontrolFl2(extendArgFromCamline.getInsolflashcontrolFl2());
|
||||
// woPackagingBoxSubstrate.setInsolmppFl1(extendArgFromCamline.getInsolmppFl1());
|
||||
// woPackagingBoxSubstrate.setInsolmppFl2(extendArgFromCamline.getInsolmppFl2());
|
||||
// woPackagingBoxSubstrate.setInsolvocFl1(extendArgFromCamline.getInsolvocFl1());
|
||||
// woPackagingBoxSubstrate.setInsolvocFl2(extendArgFromCamline.getInsolvocFl2());
|
||||
// woPackagingBoxSubstrate.setInsolFl1(extendArgFromCamline.getInsolFl1());
|
||||
// woPackagingBoxSubstrate.setInsolFl2(extendArgFromCamline.getInsolFl2());
|
||||
// woPackagingBoxSubstrate.setIscFl1(extendArgFromCamline.getIscFl1());
|
||||
// woPackagingBoxSubstrate.setIscFl2(extendArgFromCamline.getIscFl2());
|
||||
// woPackagingBoxSubstrate.setMeasTimeFl1(extendArgFromCamline.getMeasTimeFl1());
|
||||
// woPackagingBoxSubstrate.setMeasTimeFl2(extendArgFromCamline.getMeasTimeFl2());
|
||||
// woPackagingBoxSubstrate.setPmppFl1(extendArgFromCamline.getPmppFl1());
|
||||
// woPackagingBoxSubstrate.setPmppFl2(extendArgFromCamline.getPmppFl2());
|
||||
// woPackagingBoxSubstrate.setTcellFl1(extendArgFromCamline.getTcellFl1());
|
||||
// woPackagingBoxSubstrate.setTcellFl2(extendArgFromCamline.getTcellFl2());
|
||||
// woPackagingBoxSubstrate.setTmonicellFl1(extendArgFromCamline.getTmonicellFl1());
|
||||
// woPackagingBoxSubstrate.setTmonicellFl2(extendArgFromCamline.getTmonicellFl2());
|
||||
// woPackagingBoxSubstrate.setUmppFl1(extendArgFromCamline.getUmppFl1());
|
||||
// woPackagingBoxSubstrate.setUmppFl2(extendArgFromCamline.getUmppFl2());
|
||||
// woPackagingBoxSubstrate.setUocFl1(extendArgFromCamline.getUocFl1());
|
||||
// woPackagingBoxSubstrate.setUocFl1(extendArgFromCamline.getUocFl2());
|
||||
//
|
||||
// substrateServiceBiz.insert(woPackagingBoxSubstrate);
|
||||
// logger.info("标签打印Event--- 基板ID: "+subId+", 录入数据库成功");
|
||||
// //=============== MES 业务 结束 =================
|
||||
//
|
||||
// //三. 当MES完成任务后,把MesToPlc.SubArrivedFinish变量置为true,告诉plc,我操作完成了
|
||||
// write(S7Client.S7_KUKA,Step1Mes2PlcVar.SubArrivedFinish,true);
|
||||
// logger.info("标签打印Event--- 基板ID: "+subId+", SubArrivedFinish,置为true 成功");
|
||||
// //四. mes 监控 到PlcToMes.SubArrived==false,就把MesToPlc.SubArrivedFinish置为false
|
||||
// Integer subArrived2 = waitingForTarget(Step1Plc2MesVar.SubArrivedToMes, false);
|
||||
// if(subArrived2 != 1){
|
||||
// logger.info("标签打印Event--- 失败"+" --- "+"MES监听 Step1Plc2MesVar.SubArrivedToMes 是否 等于 1 失败");
|
||||
// }
|
||||
//
|
||||
// write(S7Client.S7_KUKA,Step1Mes2PlcVar.SubArrivedFinish,false);
|
||||
// logger.info("标签打印Event--- 基板ID: "+subId+", SubArrivedFinish,置为 false 成功, Event1 成功结束");
|
||||
//
|
||||
// }catch (Throwable e){
|
||||
// e.printStackTrace();
|
||||
// logger.info("标签打印Event--- 出现异常 :"+e.toString());
|
||||
// }
|
||||
// }
|
||||
// },1,1, TimeUnit.SECONDS);
|
||||
//
|
||||
// kukaStep2.scheduleAtFixedRate(new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// try {
|
||||
//
|
||||
// //调度开始
|
||||
// Integer shelfIsFull = waitingForTarget(Step2Plc2MesVar.ShelfIsFull, true);
|
||||
// if(shelfIsFull != 1){
|
||||
// logger.info("BOXID生成Event-------失败"+" --- "+"MES监听 Step2Plc2MesVar.ShelfIsFull 是否 等于 1 失败");
|
||||
// }
|
||||
//
|
||||
// //一. 从plc 中获取 subIdList 和 lineNum
|
||||
// String[] subIdList = (String[])read(S7Client.S7_KUKA,Step2Plc2MesVar.SubIdList);
|
||||
// Integer listSize = (Integer)read(S7Client.S7_KUKA,Step2Plc2MesVar.PackageNumberSet)-1;
|
||||
//
|
||||
//
|
||||
// //二. MES 业务
|
||||
// //=============== MES 业务 开始 =================
|
||||
// //1.MES 生成BoxId
|
||||
// if(subIdList.length<=0){
|
||||
// logger.info("BOXID生成Event-------失败"+" --- "+"从plc里面获取到的基板列表 为空");
|
||||
// throw new Exception("BOXID生成Event-------kuka机械手 取到了空箱");
|
||||
// }
|
||||
// //真实的基板ID 就是17位的,plc读取过来,有空格,要把后面3位空格去掉就行了。
|
||||
// for(int i=0;i<subIdList.length;i++){
|
||||
// subIdList[i] = removeKG(subIdList[i]);
|
||||
// }
|
||||
// logger.info("BOXID生成Event-------获取到基板列表:"+ Arrays.toString(subIdList)+",基板数量:"+listSize);
|
||||
//
|
||||
// WoPackagingBoxSubstrate bySubId = substrateServiceBiz.getBySubId(subIdList[0]);
|
||||
// logger.info("bySubId"+ bySubId.toString());
|
||||
// //如果我们系统中找不到这块基板那么就去camline里面找
|
||||
// if(bySubId == null){
|
||||
//
|
||||
// //todo
|
||||
// CamlineSubIdDTO subIdByCamline = service.getSubIdByCamline(subIdList[0]);
|
||||
// bySubId = new WoPackagingBoxSubstrate();
|
||||
// bySubId.setPowerLevel(subIdByCamline.getPowerLevel());
|
||||
// bySubId.setSapMaterial(subIdByCamline.getSapMaterial());
|
||||
// bySubId.setLineBody(2);
|
||||
// }
|
||||
//
|
||||
// //校验是否存在混档位情况
|
||||
// String boxId = "";
|
||||
// if(isMixLevel(subIdList,listSize)){
|
||||
// //出现混档
|
||||
// boxId = getErrorBoxId(bySubId.getSapMaterial());
|
||||
// }else {
|
||||
// //正常情况
|
||||
// boxId = getBoxId(bySubId.getSapMaterial());
|
||||
// }
|
||||
//
|
||||
// logger.info("BOXID生成Event-------mes 生成的boxId :"+ boxId);
|
||||
// //2. 依次update 基板表,把boxId 赋予这些基板
|
||||
// for(int i=0;i<listSize;i++){
|
||||
// substrateServiceBiz.updatePackagingBoxIdAndSlotByWoSubstrateId(boxId,(i+1),subIdList[i]);
|
||||
// }
|
||||
// //3.去camline数据库 查询此基板ID 对应的订单
|
||||
// String orderNameBySubId = service.getOrderNameBySubId(subIdList[0]);
|
||||
// //4. box信息录入到box表
|
||||
// WoPackagingBox woPackagingBox = new WoPackagingBox();
|
||||
// woPackagingBox.setBoxNo(boxId);
|
||||
// woPackagingBox.setSubstrateQuantity(listSize);
|
||||
// woPackagingBox.setPackagingTime(LocalDateTime.now());
|
||||
// woPackagingBox.setPowerLevel(bySubId.getPowerLevel());
|
||||
// woPackagingBox.setLineBody(bySubId.getLineBody());
|
||||
// woPackagingBox.setSapMaterial(bySubId.getSapMaterial());
|
||||
// woPackagingBox.setOrderNum(orderNameBySubId);
|
||||
// //1-手动模式,2-自动模式
|
||||
// woPackagingBox.setModel(2);
|
||||
// woPackagingBox.setCreateTime(LocalDateTime.now());
|
||||
// woPackagingBox.setPackagingTime(LocalDateTime.now());
|
||||
// boxServiceBiz.insert(woPackagingBox);
|
||||
// logger.info("BOXID生成Event-------boxId :"+ boxId+"写入数据库成功");
|
||||
// //=============== MES 业务 结束 =================
|
||||
//
|
||||
// //三. 把生成的BoxId 告诉kuka
|
||||
// write(S7Client.S7_KUKA,Step2Mes2PlcVar.BoxId,boxId);
|
||||
// logger.info("BOXID生成Event-------boxId :"+ boxId+"传给PLC 成功");
|
||||
//
|
||||
// //四. 当MES完成任务后,把MesToPlc.ShelfIsFullFinish变量置为true,告诉plc,我操作完成了
|
||||
// write(S7Client.S7_KUKA,Step2Mes2PlcVar.ShelfIsFullFinish,true);
|
||||
// logger.info("BOXID生成Event-------boxId :"+ boxId+"ShelfIsFullFinish 置为true 成功");
|
||||
// //四. mes 监控 到PlcToMes.SubArrived==false,就把MesToPlc.SubArrivedFinish置为false
|
||||
// Integer subArrived2 = waitingForTarget(Step2Plc2MesVar.ShelfIsFull, false);
|
||||
// if(subArrived2 != 1){
|
||||
// logger.info("BOXID生成Event-------失败"+" --- "+"步骤1. MES监听 Step1Plc2MesVar.SubArrivedToMes 是否 等于 1 失败");
|
||||
// }
|
||||
// write(S7Client.S7_KUKA,Step2Mes2PlcVar.ShelfIsFullFinish,false);
|
||||
// logger.info("BOXID生成Event-------boxId :"+ boxId+"ShelfIsFullFinish 置为false 成功,Event2 成功结束");
|
||||
// }catch (Throwable e){
|
||||
// e.printStackTrace();
|
||||
// logger.info("BOXID生成Event------- 出现异常:" + e.toString());
|
||||
// }
|
||||
// }
|
||||
// },1,1, TimeUnit.SECONDS);
|
||||
//
|
||||
// kukaStep3.scheduleAtFixedRate(new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// try {
|
||||
//
|
||||
// //调度开始
|
||||
// Integer shelfIsFull = waitingForTarget(Step3Plc2MesVar.ShelfIsFullArrived, true);
|
||||
// if(shelfIsFull != 1){
|
||||
// logger.info("装箱单打印Event------失败"+" --- "+"MES监听 Step3Plc2MesVar.ShelfIsFullArrived 是否 等于 1 失败");
|
||||
// }
|
||||
//
|
||||
// //一. 从plc 中获取 subIdList 和 lineNum
|
||||
// String boxId = (String)read(S7Client.S7_KUKA,Step3Plc2MesVar.BoxId);
|
||||
// Integer lineNum = (Integer) read(S7Client.S7_KUKA,Step3Plc2MesVar.LineNum);
|
||||
// logger.info("装箱单打印Event------到达站台的boxId :"+boxId);
|
||||
//
|
||||
// //二. MES 业务
|
||||
// //=============== MES 业务 开始 =================
|
||||
// //1. box信息录入到box表
|
||||
// boxServiceBiz.updateIsArrivedByBoxNo(1,boxId);
|
||||
// logger.info("装箱单打印Event------boxId :"+boxId+"更新数据库成功");
|
||||
// //=============== MES 业务 结束 =================
|
||||
//
|
||||
//
|
||||
// //四. 当MES完成任务后,把MesToPlc.ShelfIsFullArrivedFinish变量置为true,告诉plc,我操作完成了
|
||||
// write(S7Client.S7_KUKA,Step3Mes2PlcVar.ShelfIsFullArrivedFinish,true);
|
||||
// logger.info("装箱单打印Event------boxId :"+boxId+", ShelfIsFullArrivedFinish置为true 成功");
|
||||
// //四. mes 监控 到PlcToMes.SubArrived==false,就把MesToPlc.SubArrivedFinish置为false
|
||||
// Integer subArrived2 = waitingForTarget(Step3Plc2MesVar.ShelfIsFullArrived, false);
|
||||
// if(subArrived2 != 1){
|
||||
// logger.info("装箱单打印Event------失败"+" --- "+"步骤1. MES监听 Step3Plc2MesVar.ShelfIsFullArrived 是否 等于 1 失败");
|
||||
// }
|
||||
// logger.info("装箱单打印Event------boxId :"+boxId+", 监听到subArrived=false 成功");
|
||||
// write(S7Client.S7_KUKA,Step3Mes2PlcVar.ShelfIsFullArrivedFinish,false);
|
||||
// logger.info("装箱单打印Event------boxId :"+boxId+", Even3 成功");
|
||||
// }catch (Throwable e){
|
||||
// e.printStackTrace();
|
||||
// logger.info("装箱单打印Event 出现异常------"+e.toString());
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// },1,1, TimeUnit.SECONDS);
|
||||
kukaStep1.scheduleAtFixedRate(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
|
||||
//调度开始
|
||||
// logger.info("");
|
||||
// logger.info("================= 现在开始执行 过程一 任务 ==================");
|
||||
Integer subArrived = waitingForTarget(Step1Plc2MesVar.SubArrivedToMes, true);
|
||||
if(subArrived != 1){
|
||||
logger.info("标签打印Event--- 失败"+" --- "+" MES监听 Step1Plc2MesVar.SubArrivedToMes 是否 等于 1 失败");
|
||||
}
|
||||
|
||||
//一. 从plc 中获取 subId 和 lineNum
|
||||
String subId = (String) read(S7Client.S7_KUKA,Step1Plc2MesVar.SubIdToMes);
|
||||
Integer lineNum = (Integer) read(S7Client.S7_KUKA,Step1Plc2MesVar.LineNum);
|
||||
//把基板ID字符串的空格去掉,因为plc中设置的20位,但实际基板ID就是17位,因为带空格去数据库查询 有问题的。
|
||||
subId = removeKG(subId);
|
||||
|
||||
//二. MES 业务
|
||||
//=============== MES 业务 开始 =================
|
||||
//1. 从comline数据库中获取 实际pmpp
|
||||
float pmppActual = service.getPMPPBySubId(subId);
|
||||
//2. 匹配和计算补偿功率
|
||||
float pmppCompensation = compensationPowerServiceBiz.calculCompensationPMPP(pmppActual,lineNum);
|
||||
//3. 依据补偿功率,获取工艺参数,并且把这些工艺参数传给kuka
|
||||
WoPowerLevel argByPMPP = levelServiceBiz.getArgByPMPP(pmppCompensation, lineNum);
|
||||
write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Pnom,Integer.valueOf(argByPMPP.getPowerClass()));
|
||||
write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Voc,argByPMPP.getLableVoc());
|
||||
write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Isc,argByPMPP.getLableIsc());
|
||||
write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Vmpp,argByPMPP.getLableVmpp());
|
||||
write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Impp,argByPMPP.getLableImpp());
|
||||
logger.info("标签打印Event--- 采集到 基板ID: "+subId+", 线边号:"+lineNum+",从camline 获取到实际pmpp"+pmppActual+",计算后 补偿功率:"+pmppCompensation+",dLable_Pnom: "+argByPMPP.getPowerClass() +",dLable_Voc: "+argByPMPP.getLableVoc()+",dLable_Isc: "+argByPMPP.getLableIsc()+",dLable_Vmpp: "+argByPMPP.getLableVmpp()+",dLable_Impp: "+argByPMPP.getLableImpp());
|
||||
|
||||
|
||||
|
||||
//4. 把基板录到数据库
|
||||
WoPackagingBoxSubstrate woPackagingBoxSubstrate = new WoPackagingBoxSubstrate();
|
||||
woPackagingBoxSubstrate.setLineBody(lineNum);
|
||||
woPackagingBoxSubstrate.setPowerLevel(argByPMPP.getPowerClass());
|
||||
woPackagingBoxSubstrate.setSapMaterial(argByPMPP.getSapMaterialNum());
|
||||
woPackagingBoxSubstrate.setWoSubstrateId(subId);
|
||||
woPackagingBoxSubstrate.setActualPmpp(pmppActual);
|
||||
woPackagingBoxSubstrate.setCreateTime(LocalDateTime.now());
|
||||
woPackagingBoxSubstrate.setPmpp(pmppCompensation);
|
||||
|
||||
|
||||
//5. 从camline那里获取可变字段
|
||||
CamlineExtendArgDTO extendArgFromCamline = service.getExtendArgFromCamline(subId);
|
||||
logger.info("标签打印Event--- 基板ID: "+subId+", 从camline获取PID16~PID22 的实测数据 成功, 数据内容:"+extendArgFromCamline.toString());
|
||||
woPackagingBoxSubstrate.setLastUpdateTime(extendArgFromCamline.getLastUpdateTime());
|
||||
|
||||
woPackagingBoxSubstrate.setOrderName(extendArgFromCamline.getOrderName());
|
||||
woPackagingBoxSubstrate.setBinclassFl1(extendArgFromCamline.getBinclassFl1());
|
||||
woPackagingBoxSubstrate.setBinclassFl2(extendArgFromCamline.getBinclassFl2());
|
||||
woPackagingBoxSubstrate.setEtaFl1(extendArgFromCamline.getEtaFl1());
|
||||
woPackagingBoxSubstrate.setEtaFl2(extendArgFromCamline.getEtaFl2());
|
||||
woPackagingBoxSubstrate.setFfFl1(extendArgFromCamline.getFfFl1());
|
||||
woPackagingBoxSubstrate.setFfFl2(extendArgFromCamline.getFfFl2());
|
||||
woPackagingBoxSubstrate.setImppFl1(extendArgFromCamline.getImppFl1());
|
||||
woPackagingBoxSubstrate.setImppFl2(extendArgFromCamline.getImppFl2());
|
||||
woPackagingBoxSubstrate.setInsolflashcontrolFl1(extendArgFromCamline.getInsolflashcontrolFl1());
|
||||
woPackagingBoxSubstrate.setInsolflashcontrolFl2(extendArgFromCamline.getInsolflashcontrolFl2());
|
||||
woPackagingBoxSubstrate.setInsolmppFl1(extendArgFromCamline.getInsolmppFl1());
|
||||
woPackagingBoxSubstrate.setInsolmppFl2(extendArgFromCamline.getInsolmppFl2());
|
||||
woPackagingBoxSubstrate.setInsolvocFl1(extendArgFromCamline.getInsolvocFl1());
|
||||
woPackagingBoxSubstrate.setInsolvocFl2(extendArgFromCamline.getInsolvocFl2());
|
||||
woPackagingBoxSubstrate.setInsolFl1(extendArgFromCamline.getInsolFl1());
|
||||
woPackagingBoxSubstrate.setInsolFl2(extendArgFromCamline.getInsolFl2());
|
||||
woPackagingBoxSubstrate.setIscFl1(extendArgFromCamline.getIscFl1());
|
||||
woPackagingBoxSubstrate.setIscFl2(extendArgFromCamline.getIscFl2());
|
||||
woPackagingBoxSubstrate.setMeasTimeFl1(extendArgFromCamline.getMeasTimeFl1());
|
||||
woPackagingBoxSubstrate.setMeasTimeFl2(extendArgFromCamline.getMeasTimeFl2());
|
||||
woPackagingBoxSubstrate.setPmppFl1(extendArgFromCamline.getPmppFl1());
|
||||
woPackagingBoxSubstrate.setPmppFl2(extendArgFromCamline.getPmppFl2());
|
||||
woPackagingBoxSubstrate.setTcellFl1(extendArgFromCamline.getTcellFl1());
|
||||
woPackagingBoxSubstrate.setTcellFl2(extendArgFromCamline.getTcellFl2());
|
||||
woPackagingBoxSubstrate.setTmonicellFl1(extendArgFromCamline.getTmonicellFl1());
|
||||
woPackagingBoxSubstrate.setTmonicellFl2(extendArgFromCamline.getTmonicellFl2());
|
||||
woPackagingBoxSubstrate.setUmppFl1(extendArgFromCamline.getUmppFl1());
|
||||
woPackagingBoxSubstrate.setUmppFl2(extendArgFromCamline.getUmppFl2());
|
||||
woPackagingBoxSubstrate.setUocFl1(extendArgFromCamline.getUocFl1());
|
||||
woPackagingBoxSubstrate.setUocFl1(extendArgFromCamline.getUocFl2());
|
||||
|
||||
substrateServiceBiz.insert(woPackagingBoxSubstrate);
|
||||
logger.info("标签打印Event--- 基板ID: "+subId+", 录入数据库成功");
|
||||
//=============== MES 业务 结束 =================
|
||||
|
||||
//三. 当MES完成任务后,把MesToPlc.SubArrivedFinish变量置为true,告诉plc,我操作完成了
|
||||
write(S7Client.S7_KUKA,Step1Mes2PlcVar.SubArrivedFinish,true);
|
||||
logger.info("标签打印Event--- 基板ID: "+subId+", SubArrivedFinish,置为true 成功");
|
||||
//四. mes 监控 到PlcToMes.SubArrived==false,就把MesToPlc.SubArrivedFinish置为false
|
||||
Integer subArrived2 = waitingForTarget(Step1Plc2MesVar.SubArrivedToMes, false);
|
||||
if(subArrived2 != 1){
|
||||
logger.info("标签打印Event--- 失败"+" --- "+"MES监听 Step1Plc2MesVar.SubArrivedToMes 是否 等于 1 失败");
|
||||
}
|
||||
|
||||
write(S7Client.S7_KUKA,Step1Mes2PlcVar.SubArrivedFinish,false);
|
||||
logger.info("标签打印Event--- 基板ID: "+subId+", SubArrivedFinish,置为 false 成功, Event1 成功结束");
|
||||
|
||||
}catch (Throwable e){
|
||||
e.printStackTrace();
|
||||
logger.info("标签打印Event--- 出现异常 :"+e.toString());
|
||||
}
|
||||
}
|
||||
},1,1, TimeUnit.SECONDS);
|
||||
|
||||
kukaStep2.scheduleAtFixedRate(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
|
||||
//调度开始
|
||||
Integer shelfIsFull = waitingForTarget(Step2Plc2MesVar.ShelfIsFull, true);
|
||||
if(shelfIsFull != 1){
|
||||
logger.info("BOXID生成Event-------失败"+" --- "+"MES监听 Step2Plc2MesVar.ShelfIsFull 是否 等于 1 失败");
|
||||
}
|
||||
|
||||
//一. 从plc 中获取 subIdList 和 lineNum
|
||||
String[] subIdList = (String[])read(S7Client.S7_KUKA,Step2Plc2MesVar.SubIdList);
|
||||
Integer listSize = (Integer)read(S7Client.S7_KUKA,Step2Plc2MesVar.PackageNumberSet)-1;
|
||||
|
||||
|
||||
//二. MES 业务
|
||||
//=============== MES 业务 开始 =================
|
||||
//1.MES 生成BoxId
|
||||
if(subIdList.length<=0){
|
||||
logger.info("BOXID生成Event-------失败"+" --- "+"从plc里面获取到的基板列表 为空");
|
||||
throw new Exception("BOXID生成Event-------kuka机械手 取到了空箱");
|
||||
}
|
||||
//真实的基板ID 就是17位的,plc读取过来,有空格,要把后面3位空格去掉就行了。
|
||||
for(int i=0;i<subIdList.length;i++){
|
||||
subIdList[i] = removeKG(subIdList[i]);
|
||||
}
|
||||
logger.info("BOXID生成Event-------获取到基板列表:"+ Arrays.toString(subIdList)+",基板数量:"+listSize);
|
||||
|
||||
WoPackagingBoxSubstrate bySubId = substrateServiceBiz.getBySubId(subIdList[0]);
|
||||
logger.info("bySubId"+ bySubId.toString());
|
||||
//如果我们系统中找不到这块基板那么就去camline里面找
|
||||
if(bySubId == null){
|
||||
|
||||
//todo
|
||||
CamlineSubIdDTO subIdByCamline = service.getSubIdByCamline(subIdList[0]);
|
||||
bySubId = new WoPackagingBoxSubstrate();
|
||||
bySubId.setPowerLevel(subIdByCamline.getPowerLevel());
|
||||
bySubId.setSapMaterial(subIdByCamline.getSapMaterial());
|
||||
bySubId.setLineBody(2);
|
||||
}
|
||||
|
||||
//校验是否存在混档位情况
|
||||
String boxId = "";
|
||||
if(isMixLevel(subIdList,listSize)){
|
||||
//出现混档
|
||||
boxId = getErrorBoxId(bySubId.getSapMaterial());
|
||||
}else {
|
||||
//正常情况
|
||||
boxId = getBoxId(bySubId.getSapMaterial());
|
||||
}
|
||||
|
||||
logger.info("BOXID生成Event-------mes 生成的boxId :"+ boxId);
|
||||
//2. 依次update 基板表,把boxId 赋予这些基板
|
||||
for(int i=0;i<listSize;i++){
|
||||
substrateServiceBiz.updatePackagingBoxIdAndSlotByWoSubstrateId(boxId,(i+1),subIdList[i]);
|
||||
}
|
||||
//3.去camline数据库 查询此基板ID 对应的订单
|
||||
String orderNameBySubId = service.getOrderNameBySubId(subIdList[0]);
|
||||
//4. box信息录入到box表
|
||||
WoPackagingBox woPackagingBox = new WoPackagingBox();
|
||||
woPackagingBox.setBoxNo(boxId);
|
||||
woPackagingBox.setSubstrateQuantity(listSize);
|
||||
woPackagingBox.setPackagingTime(LocalDateTime.now());
|
||||
woPackagingBox.setPowerLevel(bySubId.getPowerLevel());
|
||||
woPackagingBox.setLineBody(bySubId.getLineBody());
|
||||
woPackagingBox.setSapMaterial(bySubId.getSapMaterial());
|
||||
woPackagingBox.setOrderNum(orderNameBySubId);
|
||||
//1-手动模式,2-自动模式
|
||||
woPackagingBox.setModel(2);
|
||||
woPackagingBox.setCreateTime(LocalDateTime.now());
|
||||
woPackagingBox.setPackagingTime(LocalDateTime.now());
|
||||
boxServiceBiz.insert(woPackagingBox);
|
||||
logger.info("BOXID生成Event-------boxId :"+ boxId+"写入数据库成功");
|
||||
//=============== MES 业务 结束 =================
|
||||
|
||||
//三. 把生成的BoxId 告诉kuka
|
||||
write(S7Client.S7_KUKA,Step2Mes2PlcVar.BoxId,boxId);
|
||||
logger.info("BOXID生成Event-------boxId :"+ boxId+"传给PLC 成功");
|
||||
|
||||
//四. 当MES完成任务后,把MesToPlc.ShelfIsFullFinish变量置为true,告诉plc,我操作完成了
|
||||
write(S7Client.S7_KUKA,Step2Mes2PlcVar.ShelfIsFullFinish,true);
|
||||
logger.info("BOXID生成Event-------boxId :"+ boxId+"ShelfIsFullFinish 置为true 成功");
|
||||
//四. mes 监控 到PlcToMes.SubArrived==false,就把MesToPlc.SubArrivedFinish置为false
|
||||
Integer subArrived2 = waitingForTarget(Step2Plc2MesVar.ShelfIsFull, false);
|
||||
if(subArrived2 != 1){
|
||||
logger.info("BOXID生成Event-------失败"+" --- "+"步骤1. MES监听 Step1Plc2MesVar.SubArrivedToMes 是否 等于 1 失败");
|
||||
}
|
||||
write(S7Client.S7_KUKA,Step2Mes2PlcVar.ShelfIsFullFinish,false);
|
||||
logger.info("BOXID生成Event-------boxId :"+ boxId+"ShelfIsFullFinish 置为false 成功,Event2 成功结束");
|
||||
}catch (Throwable e){
|
||||
e.printStackTrace();
|
||||
logger.info("BOXID生成Event------- 出现异常:" + e.toString());
|
||||
}
|
||||
}
|
||||
},1,1, TimeUnit.SECONDS);
|
||||
|
||||
kukaStep3.scheduleAtFixedRate(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
|
||||
//调度开始
|
||||
Integer shelfIsFull = waitingForTarget(Step3Plc2MesVar.ShelfIsFullArrived, true);
|
||||
if(shelfIsFull != 1){
|
||||
logger.info("装箱单打印Event------失败"+" --- "+"MES监听 Step3Plc2MesVar.ShelfIsFullArrived 是否 等于 1 失败");
|
||||
}
|
||||
|
||||
//一. 从plc 中获取 subIdList 和 lineNum
|
||||
String boxId = (String)read(S7Client.S7_KUKA,Step3Plc2MesVar.BoxId);
|
||||
Integer lineNum = (Integer) read(S7Client.S7_KUKA,Step3Plc2MesVar.LineNum);
|
||||
logger.info("装箱单打印Event------到达站台的boxId :"+boxId);
|
||||
|
||||
//二. MES 业务
|
||||
//=============== MES 业务 开始 =================
|
||||
//1. box信息录入到box表
|
||||
boxServiceBiz.updateIsArrivedByBoxNo(1,boxId);
|
||||
logger.info("装箱单打印Event------boxId :"+boxId+"更新数据库成功");
|
||||
//=============== MES 业务 结束 =================
|
||||
|
||||
|
||||
//四. 当MES完成任务后,把MesToPlc.ShelfIsFullArrivedFinish变量置为true,告诉plc,我操作完成了
|
||||
write(S7Client.S7_KUKA,Step3Mes2PlcVar.ShelfIsFullArrivedFinish,true);
|
||||
logger.info("装箱单打印Event------boxId :"+boxId+", ShelfIsFullArrivedFinish置为true 成功");
|
||||
//四. mes 监控 到PlcToMes.SubArrived==false,就把MesToPlc.SubArrivedFinish置为false
|
||||
Integer subArrived2 = waitingForTarget(Step3Plc2MesVar.ShelfIsFullArrived, false);
|
||||
if(subArrived2 != 1){
|
||||
logger.info("装箱单打印Event------失败"+" --- "+"步骤1. MES监听 Step3Plc2MesVar.ShelfIsFullArrived 是否 等于 1 失败");
|
||||
}
|
||||
logger.info("装箱单打印Event------boxId :"+boxId+", 监听到subArrived=false 成功");
|
||||
write(S7Client.S7_KUKA,Step3Mes2PlcVar.ShelfIsFullArrivedFinish,false);
|
||||
logger.info("装箱单打印Event------boxId :"+boxId+", Even3 成功");
|
||||
}catch (Throwable e){
|
||||
e.printStackTrace();
|
||||
logger.info("装箱单打印Event 出现异常------"+e.toString());
|
||||
}
|
||||
|
||||
}
|
||||
},1,1, TimeUnit.SECONDS);
|
||||
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,7 @@ import com.cnbm.dispatch.enums.kuka.step3.Step3Plc2MesVar;
|
||||
import com.cnbm.packing.dto.CamlineSubIdDTO;
|
||||
import com.cnbm.packing.dto.CamlineSubIdForImportDTO;
|
||||
import com.cnbm.packing.dto.PowerReportDTO;
|
||||
import com.cnbm.packing.dto.WoCompensationPowerDTO;
|
||||
import com.cnbm.packing.entity.WoPackagingBoxSubstrate;
|
||||
import com.cnbm.packing.mapper.WoPackagingBoxSubstrateMapper;
|
||||
import com.cnbm.packing.param.PowerReportQueryParam;
|
||||
@ -144,8 +145,8 @@ public class TestController {
|
||||
|
||||
|
||||
@PostMapping("/forImport")
|
||||
public R forImport() throws UnsupportedEncodingException, ParseException {
|
||||
List<CamlineSubIdForImportDTO> alllCamlineSubForImp = service.getAlllCamlineSubForImp();
|
||||
public R forImport(@RequestBody WoCompensationPowerDTO dto) throws UnsupportedEncodingException, ParseException {
|
||||
List<CamlineSubIdForImportDTO> alllCamlineSubForImp = service.getAlllCamlineSubForImp(dto.getRemark().split(","));
|
||||
for(CamlineSubIdForImportDTO cam:alllCamlineSubForImp){
|
||||
WoPackagingBoxSubstrate woPackagingBoxSubstrate = new WoPackagingBoxSubstrate();
|
||||
woPackagingBoxSubstrate.setWoSubstrateId(cam.getSubId());
|
||||
@ -158,6 +159,15 @@ public class TestController {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
// @PostMapping("/forImport")
|
||||
// public R forImport(@RequestBody WoCompensationPowerDTO dto) throws UnsupportedEncodingException, ParseException {
|
||||
// System.out.println(dto.getRemark());
|
||||
//
|
||||
// List<CamlineSubIdForImportDTO> alllCamlineSubForImp = service.getAlllCamlineSubForImp(dto.getRemark().split(","));
|
||||
//
|
||||
// return R.ok().put("data",alllCamlineSubForImp);
|
||||
// }
|
||||
|
||||
@PostMapping("/forTestMix")
|
||||
public R forTestMix() throws UnsupportedEncodingException, ParseException {
|
||||
String[] s = new String[20];
|
||||
|
@ -31,5 +31,5 @@ public interface CamlineMapper {
|
||||
|
||||
CamlineSubIdDTO getSubIdByCamline(@Param("subId") String subId);
|
||||
|
||||
List<CamlineSubIdForImportDTO> getSubIdByCamlineForImpoet();
|
||||
List<CamlineSubIdForImportDTO> getSubIdByCamlineForImpoet(@Param("subIds") String[] subIds);
|
||||
}
|
@ -57,8 +57,8 @@ public class DynamicDataSourceService {
|
||||
|
||||
@DataSource("camline")
|
||||
@Transactional
|
||||
public List<CamlineSubIdForImportDTO> getAlllCamlineSubForImp(){
|
||||
return mapper.getSubIdByCamlineForImpoet();
|
||||
public List<CamlineSubIdForImportDTO> getAlllCamlineSubForImp(String[] subIds){
|
||||
return mapper.getSubIdByCamlineForImpoet(subIds);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -153,66 +153,25 @@
|
||||
LEFT JOIN e_tracking_unit tu ON flc.mainid = tu.id
|
||||
LEFT JOIN er_order eo ON tu.ORDER_ID = eo.ID
|
||||
WHERE
|
||||
tu.NAME IN (
|
||||
'30110012303050629',
|
||||
'30110012302272118',
|
||||
'30110012303050331',
|
||||
'30110012303050321',
|
||||
'30110012303030164',
|
||||
'30110012303023000',
|
||||
'30110012303011203',
|
||||
'30110012303012089',
|
||||
'30110012303011487',
|
||||
'30110012302271154',
|
||||
'30110012302283324',
|
||||
'30110012303030787',
|
||||
'30110012303050373',
|
||||
'30110012303022841',
|
||||
'30110012303021008',
|
||||
'30110012303030325',
|
||||
'30110012302283810',
|
||||
'30110012303011490',
|
||||
'30110012303022163',
|
||||
'30110012303012695',
|
||||
'30110012303010372',
|
||||
'30110012303020247',
|
||||
'30110012303022801',
|
||||
'30110012303022407',
|
||||
'30110012303012915',
|
||||
'30110012303022996',
|
||||
'30110012303022721',
|
||||
'30110012303040003',
|
||||
'30110012303023102',
|
||||
'30110012302281213',
|
||||
'30110012303022204',
|
||||
'30110012302281212',
|
||||
'30110012303022970',
|
||||
'30110012303022415',
|
||||
'30110012303050341',
|
||||
'30110012303022434',
|
||||
'30110012302271569',
|
||||
'30110012303030505',
|
||||
'30110012303021276',
|
||||
'30110012302280295',
|
||||
'30110012303022166',
|
||||
'30110012303022299',
|
||||
'30110012303020988',
|
||||
'30110012302271160',
|
||||
'30110012302281215',
|
||||
'30110012303050537',
|
||||
'30110012302272052',
|
||||
'30110012303011213',
|
||||
'30110012303030488',
|
||||
'30110012303021614',
|
||||
'30110012303012878',
|
||||
'30110012302242962',
|
||||
'30110012303030608',
|
||||
'30110012303012697',
|
||||
'30110012303020737'
|
||||
)
|
||||
tu.NAME IN
|
||||
<foreach collection="subIds" item="subId" index="index" open="(" close=")" separator=",">
|
||||
#{subId}
|
||||
</foreach>
|
||||
and flc.PMPP != 0
|
||||
GROUP BY tu.`NAME`
|
||||
</select>
|
||||
<!-- <select id="getSubIdByCamlineForImpoet" resultMap="ResultMapCamIm">-->
|
||||
<!-- SELECT-->
|
||||
<!-- sub.WO_SUBSTRATE_ID as sub_id-->
|
||||
<!-- FROM-->
|
||||
<!-- t_wo_packaging_box_substrate sub-->
|
||||
|
||||
<!-- WHERE-->
|
||||
<!-- sub.WO_SUBSTRATE_ID IN-->
|
||||
<!-- <foreach collection="subIds" item="subId" index="index" open="(" close=")" separator=",">-->
|
||||
<!-- #{subId}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </select>-->
|
||||
|
||||
<select id="getOrderNameBySubId" resultType="string">
|
||||
SELECT
|
||||
|
Carregando…
Criar uma nova questão referindo esta
Bloquear um utilizador