Commit a754eda8 authored by 夏东伟's avatar 夏东伟

新增喷涂机器人采集, mes过程扫码数据接入;

parent 2c2436e2
...@@ -59,27 +59,34 @@ public class CleanStatusDataJob extends QuartzJobBean { ...@@ -59,27 +59,34 @@ public class CleanStatusDataJob extends QuartzJobBean {
if (CollectionUtils.isEmpty(dataList)) { if (CollectionUtils.isEmpty(dataList)) {
continue; continue;
} }
if (key.contains("DRYING_ROOM_TEMP")) { EquipmentData data = dataList.get(0);
String equipType = data.getEquipType();
if (null != equipType && equipType.contains("DRYING_ROOM_TEMP")) {
//插入设备监控数据 //插入设备监控数据
equipmentDataMapper.insert(dataList.get(0)); equipmentDataMapper.insert(data);
} else { } else {
//插入设备监控数据 //插入设备监控数据
List<EquipmentData> collect = dataList.stream().filter(item -> !EquipStatusEnum.SHUTDOWN.equals(item.getEquipStatus())).collect(Collectors.toList()); List<EquipmentData> collect = dataList.stream().filter(item -> !EquipStatusEnum.SHUTDOWN.equals(item.getEquipStatus())).collect(Collectors.toList());
equipmentDataMapper.insertList(collect); if (CollectionUtils.isEmpty(collect)){
continue;
}
if (null != equipType && !equipType.contains("LASER_CUTTING")){
equipmentDataMapper.insertList(collect);
}
} }
if (key.contains("DRYING_ROOM_TEMP") || key.contains("SPRAY_BOOTH")) { if ((null != equipType && equipType.contains("DRYING_ROOM_TEMP")) || (null != equipType && equipType.contains("SPRAY_BOOTH"))) {
continue; continue;
} }
equipDataService.updateLastStatus(dataList.get(dataList.size() - 1)); equipDataService.updateLastStatus(dataList.get(dataList.size() - 1));
String equipCode = dataList.get(0).getEquipCode(); String equipCode = data.getEquipCode();
EquipmentData last = equipDataService.getLast(equipCode); EquipmentData last = equipDataService.getLast(equipCode);
final EquipmentData first = last; final EquipmentData first = last;
int index = 1; int index = 1;
for (int i = 0; i < dataList.size(); i++) { for (int i = 0; i < dataList.size(); i++) {
if (last == null) { if (last == null) {
last = dataList.get(0); last = data;
continue; continue;
} }
......
...@@ -248,7 +248,7 @@ public class EquipmentService { ...@@ -248,7 +248,7 @@ public class EquipmentService {
//平板激光切割机 //平板激光切割机
case "076707-177": case "076707-177":
ip = "10.1.25.181"; ip = "10.1.25.181";
path = "smb://" + ip + "/NCPrg/"; path = "smb://" + ip + "/NcProng/";
break; break;
} }
return SmbFileUtil.smbPut(path, transferVO.getFilePath(), auth); return SmbFileUtil.smbPut(path, transferVO.getFilePath(), auth);
......
...@@ -84,6 +84,7 @@ public class FlatLaserCuttingMachineJob extends QuartzJobBean { ...@@ -84,6 +84,7 @@ public class FlatLaserCuttingMachineJob extends QuartzJobBean {
machine.setStatus("1"); machine.setStatus("1");
machine.setEquipFactory(equipFactory); machine.setEquipFactory(equipFactory);
machine.setBeginTime(new Date()); machine.setBeginTime(new Date());
machine.setEquipType("FLAT_LASER_CUTTING");
if (!PingIpUtils.ping(ipAddress, pingTimes, timeOut)) { if (!PingIpUtils.ping(ipAddress, pingTimes, timeOut)) {
realTimeService.saveEquip("制件车间", equipCode, equipName, "关机"); realTimeService.saveEquip("制件车间", equipCode, equipName, "关机");
machine.setEquipStatus(EquipStatusEnum.SHUTDOWN); machine.setEquipStatus(EquipStatusEnum.SHUTDOWN);
......
...@@ -67,6 +67,7 @@ public class LaserCutting3DMachineJob extends QuartzJobBean { ...@@ -67,6 +67,7 @@ public class LaserCutting3DMachineJob extends QuartzJobBean {
machine.setStatus("1"); machine.setStatus("1");
machine.setBeginTime(new Date()); machine.setBeginTime(new Date());
machine.setEquipFactory(equipFactory); machine.setEquipFactory(equipFactory);
machine.setEquipType("3D_LASER_CUTTING");
if (!PingIpUtils.ping(ipAddress, pingTimes, timeOut)) { if (!PingIpUtils.ping(ipAddress, pingTimes, timeOut)) {
realTimeService.saveEquip("制件车间", equipCode, equipName, "关机"); realTimeService.saveEquip("制件车间", equipCode, equipName, "关机");
machine.setEquipStatus(EquipStatusEnum.SHUTDOWN); machine.setEquipStatus(EquipStatusEnum.SHUTDOWN);
......
...@@ -72,6 +72,7 @@ public class LaserCuttingMachineJob extends QuartzJobBean { ...@@ -72,6 +72,7 @@ public class LaserCuttingMachineJob extends QuartzJobBean {
machine.setStatus("1"); machine.setStatus("1");
machine.setBeginTime(new Date()); machine.setBeginTime(new Date());
machine.setEquipFactory(equipFactory); machine.setEquipFactory(equipFactory);
machine.setEquipType("LASER_CUTTING");
if (!PingIpUtils.ping(ipAddress, pingTimes, timeOut)) { if (!PingIpUtils.ping(ipAddress, pingTimes, timeOut)) {
realTimeService.saveEquip("制件车间", equipCode, equipName, "关机"); realTimeService.saveEquip("制件车间", equipCode, equipName, "关机");
machine.setEquipStatus(EquipStatusEnum.SHUTDOWN); machine.setEquipStatus(EquipStatusEnum.SHUTDOWN);
......
...@@ -62,10 +62,8 @@ public class MesScanCodeDpInfo { ...@@ -62,10 +62,8 @@ public class MesScanCodeDpInfo {
@Search @Search
private String SupplierName; private String SupplierName;
@Show(label = "车间ID")
@ApiModelProperty(notes = "车间ID") @ApiModelProperty(notes = "车间ID")
@Column(name = "workshopID") @Column(name = "workshopID")
@Search
private String workshopID; private String workshopID;
@Show(label = "产线ID") @Show(label = "产线ID")
......
...@@ -62,10 +62,8 @@ public class MesScanCodeZpInfo { ...@@ -62,10 +62,8 @@ public class MesScanCodeZpInfo {
@Search @Search
private String SupplierName; private String SupplierName;
@Show(label = "车间ID")
@ApiModelProperty(notes = "车间ID") @ApiModelProperty(notes = "车间ID")
@Column(name = "workshopID") @Column(name = "workshopID")
@Search
private String workshopID; private String workshopID;
@Show(label = "产线ID") @Show(label = "产线ID")
......
...@@ -51,11 +51,15 @@ public class MesScanCodeDpJob extends QuartzJobBean { ...@@ -51,11 +51,15 @@ public class MesScanCodeDpJob extends QuartzJobBean {
Date startOfDay = DateUtils.getStartOfDay(0); Date startOfDay = DateUtils.getStartOfDay(0);
String dateString = DateUtils.parseDateToString(startOfDay, "yyyy-MM-dd HH:mm:ss"); String dateString = DateUtils.parseDateToString(startOfDay, "yyyy-MM-dd HH:mm:ss");
StringBuilder sql = new StringBuilder(); StringBuilder sql = new StringBuilder();
sql.append("SELECT SaleOrderNO, VehicleID, PartTraceID, PartDrawingNo,PartDrawingName, SupplierNo, SupplierName, workshopID," + sql.append("SELECT v.SaleOrderNO, v.VehicleID, v.PartTraceID, v.PartDrawingNo, v.PartDrawingName, v.SupplierNo, v.SupplierName, v.workshopID," +
" workLineID, WPCode, ProductionBatch, OperationTime, OperationPerson, OperationPersonName, IsSpecified," + " v.workLineID, v.WPCode, v.ProductionBatch, v.OperationTime, v.OperationPerson, v.OperationPersonName, v.IsSpecified," +
" Deleted, Memo, WkStation, DocClosedBy, Operation, DocClosed, CrtDate, UpdDate, Archived," + " v.Deleted, v.Memo, v.WkStation, v.DocClosedBy, v.Operation, v.DocClosed, v.CrtDate, v.UpdDate, v.Archived," +
" IsSynchronize, MesNoticeNo, personFlag, supplierFlag, matFlag FROM VehicleQualityTraceDocument " + " v.IsSynchronize, v.MesNoticeNo, v.personFlag, v.supplierFlag, v.matFlag, b.WSName, c.MLineNo, d.WPName" +
"WHERE workshopID = 'DP' AND Deleted = 'F' AND OperationTime > '" + dateString + "'"); " FROM VehicleQualityTraceDocument v " +
" left join WS_WorkShop b on v.workshopID = b.WSCode " +
" left join WS_MaufactoryLine c on v.workLineID = c.MLineNo" +
" left join WS_Point d on v.WPCode = d.WPCode" +
"WHERE v.workshopID = 'DP' AND v.Deleted = 'F' AND v.OperationTime > '" + dateString + "'");
List<MesScanCodeDpInfo> query = mesSqlServerJdbcTemplate.query(sql.toString(), (rs, rowNum) -> { List<MesScanCodeDpInfo> query = mesSqlServerJdbcTemplate.query(sql.toString(), (rs, rowNum) -> {
MesScanCodeDpInfo map = new MesScanCodeDpInfo(); MesScanCodeDpInfo map = new MesScanCodeDpInfo();
map.setSaleOrderNO(rs.getString("SaleOrderNO")); map.setSaleOrderNO(rs.getString("SaleOrderNO"));
...@@ -67,15 +71,15 @@ public class MesScanCodeDpJob extends QuartzJobBean { ...@@ -67,15 +71,15 @@ public class MesScanCodeDpJob extends QuartzJobBean {
map.setSupplierName(rs.getString("SupplierName")); map.setSupplierName(rs.getString("SupplierName"));
map.setWorkshopID(rs.getString("workshopID")); map.setWorkshopID(rs.getString("workshopID"));
map.setWorkLineID(rs.getString("workshopID")); map.setWorkLineID(rs.getString("workshopID"));
// map.setWorkLineName(rs.getString("")); map.setWorkLineName(rs.getString("MLineNo"));
map.setWPCode(rs.getString("WPCode")); map.setWPCode(rs.getString("WPCode"));
// map.setWPName(rs.getString("")); map.setWPName(rs.getString("WPName"));
map.setProductionBatch(rs.getString("ProductionBatch")); map.setProductionBatch(rs.getString("ProductionBatch"));
map.setOperationTime(rs.getTimestamp("OperationTime")); map.setOperationTime(rs.getTimestamp("OperationTime"));
map.setOperationPerson(rs.getString("OperationPerson")); map.setOperationPerson(rs.getString("OperationPerson"));
map.setOperationPersonName(rs.getString("OperationPersonName")); map.setOperationPersonName(rs.getString("OperationPersonName"));
map.setStatus("1"); map.setStatus("1");
map.setCreateTime(new Date()); map.setCreateTime(rs.getTimestamp("OperationTime"));
return map; return map;
}); });
if (CollectionUtils.isEmpty(query)) { if (CollectionUtils.isEmpty(query)) {
......
...@@ -51,11 +51,15 @@ public class MesScanCodeZpJob extends QuartzJobBean { ...@@ -51,11 +51,15 @@ public class MesScanCodeZpJob extends QuartzJobBean {
Date startOfDay = DateUtils.getStartOfDay(0); Date startOfDay = DateUtils.getStartOfDay(0);
String dateString = DateUtils.parseDateToString(startOfDay, "yyyy-MM-dd HH:mm:ss"); String dateString = DateUtils.parseDateToString(startOfDay, "yyyy-MM-dd HH:mm:ss");
StringBuilder sql = new StringBuilder(); StringBuilder sql = new StringBuilder();
sql.append("SELECT SaleOrderNO, VehicleID, PartTraceID, PartDrawingNo,PartDrawingName, SupplierNo, SupplierName, workshopID," + sql.append("SELECT v.SaleOrderNO, v.VehicleID, v.PartTraceID, v.PartDrawingNo, v.PartDrawingName, v.SupplierNo, v.SupplierName, v.workshopID," +
" workLineID, WPCode, ProductionBatch, OperationTime, OperationPerson, OperationPersonName, IsSpecified," + " v.workLineID, v.WPCode, v.ProductionBatch, v.OperationTime, v.OperationPerson, v.OperationPersonName, v.IsSpecified," +
" Deleted, Memo, WkStation, DocClosedBy, Operation, DocClosed, CrtDate, UpdDate, Archived," + " v.Deleted, v.Memo, v.WkStation, v.DocClosedBy, v.Operation, v.DocClosed, v.CrtDate, v.UpdDate, v.Archived," +
" IsSynchronize, MesNoticeNo, personFlag, supplierFlag, matFlag FROM VehicleQualityTraceDocument " + " v.IsSynchronize, v.MesNoticeNo, v.personFlag, v.supplierFlag, v.matFlag, b.WSName, c.MLineNo, d.WPName" +
"WHERE workshopID = 'ZP' AND Deleted = 'F' AND OperationTime > '" + dateString + "'"); " FROM VehicleQualityTraceDocument v " +
" left join WS_WorkShop b on v.workshopID = b.WSCode " +
" left join WS_MaufactoryLine c on v.workLineID = c.MLineNo" +
" left join WS_Point d on v.WPCode = d.WPCode" +
"WHERE v.workshopID = 'ZP' AND v.Deleted = 'F' AND v.OperationTime > '" + dateString + "'");
List<MesScanCodeZpInfo> query = mesSqlServerJdbcTemplate.query(sql.toString(), (rs, rowNum) -> { List<MesScanCodeZpInfo> query = mesSqlServerJdbcTemplate.query(sql.toString(), (rs, rowNum) -> {
MesScanCodeZpInfo map = new MesScanCodeZpInfo(); MesScanCodeZpInfo map = new MesScanCodeZpInfo();
map.setSaleOrderNO(rs.getString("SaleOrderNO")); map.setSaleOrderNO(rs.getString("SaleOrderNO"));
...@@ -67,15 +71,15 @@ public class MesScanCodeZpJob extends QuartzJobBean { ...@@ -67,15 +71,15 @@ public class MesScanCodeZpJob extends QuartzJobBean {
map.setSupplierName(rs.getString("SupplierName")); map.setSupplierName(rs.getString("SupplierName"));
map.setWorkshopID(rs.getString("workshopID")); map.setWorkshopID(rs.getString("workshopID"));
map.setWorkLineID(rs.getString("workshopID")); map.setWorkLineID(rs.getString("workshopID"));
// map.setWorkLineName(rs.getString("")); map.setWorkLineName(rs.getString("MLineNo"));
map.setWPCode(rs.getString("WPCode")); map.setWPCode(rs.getString("WPCode"));
// map.setWPName(rs.getString("")); map.setWPName(rs.getString("WPName"));
map.setProductionBatch(rs.getString("ProductionBatch")); map.setProductionBatch(rs.getString("ProductionBatch"));
map.setOperationTime(rs.getTimestamp("OperationTime")); map.setOperationTime(rs.getTimestamp("OperationTime"));
map.setOperationPerson(rs.getString("OperationPerson")); map.setOperationPerson(rs.getString("OperationPerson"));
map.setOperationPersonName(rs.getString("OperationPersonName")); map.setOperationPersonName(rs.getString("OperationPersonName"));
map.setStatus("1"); map.setStatus("1");
map.setCreateTime(new Date()); map.setCreateTime(rs.getTimestamp("OperationTime"));
return map; return map;
}); });
log.error("mes查询到数据: {} 条", query.size()); log.error("mes查询到数据: {} 条", query.size());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment