commit for pull

This commit is contained in:
caixiang 2023-03-07 21:57:54 +08:00
parent c588346c69
commit 00c907ece0
4 changed files with 21 additions and 7 deletions

View File

@ -33,6 +33,7 @@ spring:
enabled: true enabled: true
redis: redis:
database: 6 database: 6
#host: 127.0.0.1
host: 10.0.1.249 host: 10.0.1.249
#host: 192.168.0.102 #host: 192.168.0.102
port: 6379 port: 6379

View File

@ -160,6 +160,15 @@ public class KukaJoinThread implements ApplicationRunner {
return res; return res;
} }
public String getErrorBoxId(String sapMaterial){
String nowTime = DateUtil.format(new Date(), "yyMMdd");
String mixBoxError = "001";
String res = "Err"+sapMaterial+nowTime+mixBoxError;
return res;
}
public String removeKG(String str){ public String removeKG(String str){
return str.substring(0,17); return str.substring(0,17);
} }
@ -302,9 +311,6 @@ public class KukaJoinThread implements ApplicationRunner {
} }
},1,1, TimeUnit.SECONDS); },1,1, TimeUnit.SECONDS);
kukaStep2.scheduleAtFixedRate(new Runnable() { kukaStep2.scheduleAtFixedRate(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -351,7 +357,7 @@ public class KukaJoinThread implements ApplicationRunner {
boxId = getBoxId(bySubId.getSapMaterial()); boxId = getBoxId(bySubId.getSapMaterial());
}else { }else {
//正常情况 //正常情况
boxId = getBoxId(bySubId.getSapMaterial()); boxId = getErrorBoxId(bySubId.getSapMaterial());
} }
@ -367,6 +373,7 @@ public class KukaJoinThread implements ApplicationRunner {
//4. box信息录入到box表 //4. box信息录入到box表
WoPackagingBox woPackagingBox = new WoPackagingBox(); WoPackagingBox woPackagingBox = new WoPackagingBox();
woPackagingBox.setBoxNo(boxId); woPackagingBox.setBoxNo(boxId);
woPackagingBox.setSubstrateQuantity(listSize);
woPackagingBox.setPackagingTime(LocalDateTime.now()); woPackagingBox.setPackagingTime(LocalDateTime.now());
woPackagingBox.setPowerLevel(bySubId.getPowerLevel()); woPackagingBox.setPowerLevel(bySubId.getPowerLevel());
woPackagingBox.setLineBody(bySubId.getLineBody()); woPackagingBox.setLineBody(bySubId.getLineBody());
@ -399,7 +406,6 @@ public class KukaJoinThread implements ApplicationRunner {
} }
},1,1, TimeUnit.SECONDS); },1,1, TimeUnit.SECONDS);
kukaStep3.scheduleAtFixedRate(new Runnable() { kukaStep3.scheduleAtFixedRate(new Runnable() {
@Override @Override
public void run() { public void run() {

View File

@ -144,12 +144,12 @@ public class WoPackagingBoxSubstrateController {
totalSubNum+= subNum; totalSubNum+= subNum;
} }
for(PowerReportDTO power : powerReportDTOS){ for(PowerReportDTO power : powerReportDTOS){
Float prop = Float.valueOf(power.getSubNum())/Float.valueOf(totalSubNum); Float prop = (Float.valueOf(power.getSubNum())/Float.valueOf(totalSubNum))*100;
DecimalFormat df = new DecimalFormat("0.00"); DecimalFormat df = new DecimalFormat("0.00");
String propS = df.format(prop)+"%"; String propS = df.format(prop)+"%";
power.setProportion(propS); power.setProportion(propS);
} }
diversePower = totalLevelPower - totalCompensatePower; diversePower = totalCompensatePower - totalLevelPower;
powerReportVo.setPowerReports(powerReportDTOS); powerReportVo.setPowerReports(powerReportDTOS);
powerReportVo.setDiversePower(diversePower); powerReportVo.setDiversePower(diversePower);
powerReportVo.setTotalCompensatePower(totalCompensatePower); powerReportVo.setTotalCompensatePower(totalCompensatePower);

View File

@ -46,6 +46,11 @@ public class WoPackagingBoxServiceBizImpl extends CrudServiceImpl<WoPackagingBox
private WoPackagingBoxSubstrateServiceBiz woPackagingBoxSubstrateServiceBiz; private WoPackagingBoxSubstrateServiceBiz woPackagingBoxSubstrateServiceBiz;
public static void main(String[] args) {
LocalDateTime localDate=LocalDateTime.parse("2023-03-23 09:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
System.out.println(localDate);
}
@Override @Override
public QueryWrapper<WoPackagingBox> getWrapper(Map<String, Object> params){ public QueryWrapper<WoPackagingBox> getWrapper(Map<String, Object> params){
@ -55,6 +60,8 @@ public class WoPackagingBoxServiceBizImpl extends CrudServiceImpl<WoPackagingBox
if(params.get("startTime")!=null && params.get("endTime")!=null){ if(params.get("startTime")!=null && params.get("endTime")!=null){
LocalDateTime startTime = LocalDateTime.parse(params.get("startTime").toString(),df); LocalDateTime startTime = LocalDateTime.parse(params.get("startTime").toString(),df);
LocalDateTime endTime = LocalDateTime.parse(params.get("endTime").toString(),df); LocalDateTime endTime = LocalDateTime.parse(params.get("endTime").toString(),df);
wrapper.between(startTime!=null && endTime!=null, WoPackagingBox.CREATE_TIME, startTime, endTime); wrapper.between(startTime!=null && endTime!=null, WoPackagingBox.CREATE_TIME, startTime, endTime);
} }
String boxNo = (String) params.get("boxNo"); String boxNo = (String) params.get("boxNo");