Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zhongtong-avi-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
中通客车项目
zhongtong-avi-service
Commits
fbfaee2f
Commit
fbfaee2f
authored
Oct 22, 2019
by
夏东伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
联调修改
parent
8520d763
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
97 additions
and
67 deletions
+97
-67
WheelAlignmentJob.java
...et/vtstar/zhongtong/avi/access/job/WheelAlignmentJob.java
+76
-63
DailyItemModel.java
...tstar/zhongtong/avi/laboratory/domain/DailyItemModel.java
+6
-0
DailyItemRecord.java
...star/zhongtong/avi/laboratory/domain/DailyItemRecord.java
+5
-0
DailyCheckService.java
...r/zhongtong/avi/laboratory/service/DailyCheckService.java
+10
-4
No files found.
src/main/java/net/vtstar/zhongtong/avi/access/job/WheelAlignmentJob.java
View file @
fbfaee2f
...
...
@@ -63,31 +63,60 @@ public class WheelAlignmentJob extends QuartzJobBean {
String
dateString
=
DateUtils
.
parseDateToString
(
startOfDay
,
"yyyy-MM-dd HH:mm:ss"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyyMMMdd"
,
Locale
.
ENGLISH
);
String
newDateString
=
sdf
.
format
(
new
Date
());
String
dataBaseFileName
=
"BL_Align"
;
for
(
String
ipAddress
:
ipAddressList
){
if
(!
PingIpUtils
.
ping
(
ipAddress
,
pingTimes
,
timeOut
))
{
log
.
error
(
"ping: {}失败, 此次同步底盘四轮定位数据操作结束!"
,
ipAddress
);
return
;
}
//todo:账户, 密码, 文件位置需要变
String
url
=
"smb://wanteng:wanteng@"
+
ipAddress
+
"/AN9637H/"
+
newDateString
+
".mdb"
;
//todo:账户, 密码, 文件位置需要变 BL_Align(数据库文件)
String
url
;
if
(
ipAddress
.
equals
(
ipAddress1
)){
url
=
"smb://wanteng:wanteng@"
+
ipAddress
+
"/AN9637H/"
+
newDateString
+
".mdb"
;
}
else
{
url
=
"smb://wanteng:wanteng@"
+
ipAddress
+
"/Database/"
+
dataBaseFileName
+
".mdb"
;
}
SmbFile
file
=
null
;
String
dateFile
=
baseUrl
+
newDateString
+
"-"
+
ipAddress
+
".mdb"
;
try
{
file
=
new
SmbFile
(
url
);
if
(
file
.
exists
())
{
SmbFileUtil
.
smbGet
(
url
,
baseUrl
+
newDateString
+
".mdb"
);
SmbFileUtil
.
smbGet
(
url
,
dateFile
);
}
else
{
log
.
error
(
"日期: {} 的底盘车间四轮定位共享数据库文件不存在!"
,
newDateString
);
log
.
error
(
"日期: {} 的底盘车间四轮定位共享数据库文件不存在!"
,
url
);
continue
;
}
Database
db
;
List
<
WheelAlignment
>
list
=
new
ArrayList
<>();;
try
{
db
=
DatabaseBuilder
.
open
(
new
File
(
baseUrl
+
newDateString
+
".mdb"
));
db
=
DatabaseBuilder
.
open
(
new
File
(
dateFile
));
Set
<
String
>
tableNames
=
db
.
getTableNames
();
for
(
String
tableName
:
tableNames
)
{
if
(!
"LEGEND-5214E5AF"
.
equals
(
tableName
)){
if
(
"LEGEND-5214E5AF"
.
equals
(
tableName
)){
saveData
(
ipAddress
,
db
,
list
,
tableName
);
}
if
(
newDateString
.
equals
(
tableName
)){
saveData
(
ipAddress
,
db
,
list
,
tableName
);
}
}
}
catch
(
IOException
e
)
{
log
.
error
(
"读取日期: {} 的数据库文件失败!ip: {}"
,
dateString
,
ipAddress
);
continue
;
}
mapper
.
delByFilter
(
new
WhereFilter
()
{{
addFilter
(
"create_time"
,
Operation
.
GREATER_THAN
,
dateString
);
addFilter
(
"ipAddress"
,
Operation
.
EQUAL
,
ipAddress
);
}},
TestLineResult
.
class
);
mapper
.
insertList
(
list
);
log
.
info
(
"更新四轮定位: {} 数据: {}条"
,
ipAddress
,
list
.
size
());
}
catch
(
Exception
e
)
{
log
.
error
(
"获取底盘车间四轮定位共享文件失败!ip: {}"
,
ipAddress
);
}
}
log
.
info
(
"--------同步底盘车间四轮定位数据结束--------"
);
}
private
void
saveData
(
String
ipAddress
,
Database
db
,
List
<
WheelAlignment
>
list
,
String
tableName
)
throws
IOException
{
Table
table
=
db
.
getTable
(
tableName
);
for
(
Row
row
:
table
)
{
WheelAlignment
map
=
new
WheelAlignment
();
...
...
@@ -146,20 +175,4 @@ public class WheelAlignmentJob extends QuartzJobBean {
list
.
add
(
map
);
}
}
}
catch
(
IOException
e
)
{
log
.
error
(
"读取日期: {} 的数据库文件失败!ip: {}"
,
dateString
,
ipAddress
);
continue
;
}
mapper
.
delByFilter
(
new
WhereFilter
()
{{
addFilter
(
"create_time"
,
Operation
.
GREATER_THAN
,
dateString
);
addFilter
(
"ipAddress"
,
Operation
.
EQUAL
,
ipAddress
);
}},
TestLineResult
.
class
);
mapper
.
insertList
(
list
);
log
.
info
(
"更新四轮定位: {} 数据: {}条"
,
ipAddress
,
list
.
size
());
}
catch
(
Exception
e
)
{
log
.
error
(
"获取底盘车间四轮定位共享文件失败!ip: {}"
,
ipAddress
);
}
}
log
.
info
(
"--------同步底盘车间四轮定位数据结束--------"
);
}
}
src/main/java/net/vtstar/zhongtong/avi/laboratory/domain/DailyItemModel.java
View file @
fbfaee2f
...
...
@@ -12,6 +12,7 @@ import lombok.Data;
import
javax.persistence.Column
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
javax.validation.constraints.NotNull
;
import
java.util.Date
;
@ApiModel
(
value
=
"涂装日常检测项模板表"
)
...
...
@@ -22,6 +23,7 @@ public class DailyItemModel {
@Id
private
Long
id
;
@NotNull
(
message
=
"检测模板ID为空!"
)
@Column
(
name
=
"check_model_id"
)
@ApiModelProperty
(
notes
=
"检测模板ID"
)
private
Integer
checkModelId
;
...
...
@@ -50,6 +52,10 @@ public class DailyItemModel {
@ApiModelProperty
(
notes
=
"频次"
)
private
String
frequency
;
@Column
(
name
=
"is_necessary"
)
@ApiModelProperty
(
notes
=
"是否为必检项"
)
private
Boolean
isNecessary
;
@ApiModelProperty
(
notes
=
"创建时间"
)
private
Date
createTime
;
...
...
src/main/java/net/vtstar/zhongtong/avi/laboratory/domain/DailyItemRecord.java
View file @
fbfaee2f
...
...
@@ -54,6 +54,11 @@ public class DailyItemRecord {
@ApiModelProperty
(
notes
=
"频次"
)
private
String
frequency
;
@Column
(
name
=
"is_necessary"
)
@ApiModelProperty
(
notes
=
"是否为必检项"
)
private
Boolean
isNecessary
;
@Column
(
name
=
"create_time"
)
@ApiModelProperty
(
notes
=
"取样时间"
)
private
Date
createTime
;
...
...
src/main/java/net/vtstar/zhongtong/avi/laboratory/service/DailyCheckService.java
View file @
fbfaee2f
...
...
@@ -16,8 +16,6 @@ import net.vtstar.zhongtong.avi.laboratory.mapper.DailyCheckModelMapper;
import
net.vtstar.zhongtong.avi.laboratory.mapper.DailyCheckRecordMapper
;
import
net.vtstar.zhongtong.avi.laboratory.mapper.DailyItemModelMapper
;
import
net.vtstar.zhongtong.avi.laboratory.mapper.DailyItemRecordMapper
;
import
org.apache.poi.xssf.usermodel.XSSFCell
;
import
org.apache.poi.xssf.usermodel.XSSFRow
;
import
org.apache.poi.xssf.usermodel.XSSFSheet
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -177,8 +175,16 @@ public class DailyCheckService {
workbook
=
new
XSSFWorkbook
(
is
);
sheet
=
workbook
.
getSheetAt
(
0
);
if
(
sheet
!=
null
)
{
XSSFRow
row
=
sheet
.
getRow
(
4
);
XSSFCell
cell
=
row
.
getCell
(
1
);
sheet
.
getRow
(
1
).
getCell
(
5
).
setCellValue
(
recordById
.
getRev
());
sheet
.
getRow
(
2
).
getCell
(
5
).
setCellValue
(
recordById
.
getSheetNo
());
sheet
.
getRow
(
3
).
getCell
(
5
).
setCellValue
(
recordById
.
getNo
());
if
(
"PICKLING"
.
equals
(
recordById
.
getType
())){
sheet
.
getRow
(
4
).
getCell
(
0
).
setCellValue
(
"酸洗磷化线槽液日常检测报告"
);
}
else
if
(
"ELECTROPHORESIS"
.
equals
(
recordById
.
getType
())){
sheet
.
getRow
(
4
).
getCell
(
0
).
setCellValue
(
"电泳槽液日常检测报告"
);
}
else
{
sheet
.
getRow
(
4
).
getCell
(
0
).
setCellValue
(
"前处理槽液日常检测报告"
);
}
}
ServletOutputStream
outputStream
=
response
.
getOutputStream
();
String
filename
=
"检测报告"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment