mark
This commit is contained in:
@@ -15,6 +15,7 @@ import com.cnbm.packing.entity.WoPowerLevel;
|
||||
import com.cnbm.packing.service.*;
|
||||
import com.cnbm.s7.s7connector.enmuc.S7Client;
|
||||
import com.cnbm.s7.s7connector.type.PlcVar;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -23,6 +24,8 @@ import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.Format;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
@@ -66,6 +69,7 @@ public class KukaJoinThread implements ApplicationRunner {
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* return
|
||||
* 成功: 返回相应的object对象
|
||||
@@ -150,7 +154,9 @@ public class KukaJoinThread implements ApplicationRunner {
|
||||
public String getBoxId(String sapMaterial){
|
||||
Integer todayBoxNum = service.getTodayBoxNum();
|
||||
String nowTime = DateUtil.format(new Date(), "yyMMdd");
|
||||
String res = "301"+sapMaterial+nowTime+todayBoxNum;
|
||||
|
||||
todayBoxNum+=500;
|
||||
String res = "301"+sapMaterial+nowTime+formateString(todayBoxNum);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -159,9 +165,13 @@ public class KukaJoinThread implements ApplicationRunner {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String str = "30110012302210707 ";
|
||||
String substring = str.substring(0,17);
|
||||
System.out.println(substring);
|
||||
Integer a = 102;
|
||||
Format f1 = new DecimalFormat("000");
|
||||
System.out.println(f1.format(a));
|
||||
}
|
||||
public String formateString(Integer a){
|
||||
Format f1 = new DecimalFormat("000");
|
||||
return f1.format(a);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -209,6 +219,8 @@ public class KukaJoinThread implements ApplicationRunner {
|
||||
woPackagingBoxSubstrate.setPowerLevel(argByPMPP.getPowerClass());
|
||||
woPackagingBoxSubstrate.setSapMaterial(argByPMPP.getSapMaterialNum());
|
||||
woPackagingBoxSubstrate.setWoSubstrateId(subId);
|
||||
woPackagingBoxSubstrate.setActualPmpp(pmppBySubId);
|
||||
woPackagingBoxSubstrate.setCreateTime(LocalDateTime.now());
|
||||
|
||||
//5. 从camline那里获取可变字段
|
||||
CamlineExtendArgDTO extendArgFromCamline = service.getExtendArgFromCamline(subId);
|
||||
@@ -271,7 +283,6 @@ public class KukaJoinThread implements ApplicationRunner {
|
||||
try {
|
||||
|
||||
//调度开始
|
||||
|
||||
Integer shelfIsFull = waitingForTarget(Step2Plc2MesVar.ShelfIsFull, true);
|
||||
if(shelfIsFull != 1){
|
||||
logger.info("失败"+" --- "+"MES监听 Step2Plc2MesVar.ShelfIsFull 是否 等于 1 失败");
|
||||
|
||||
Reference in New Issue
Block a user