Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
Z
zhmes-agecal
Project
Project
Details
Activity
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
耿迪迪
zhmes-agecal
Commits
701a4d4d
Commit
701a4d4d
authored
Jan 17, 2026
by
wanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1 通过 验证 从 MES 获取 标检单功能实现
parent
9d7953d8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
1583 additions
and
6 deletions
+1583
-6
addSql.sql
sql/addSql.sql
+2
-0
ProductStandardInspectionController.java
...roller/equipment/ProductStandardInspectionController.java
+93
-0
RoboticArmConstans.java
...n/java/com/zehong/common/constant/RoboticArmConstans.java
+12
-0
RedisCache.java
...rc/main/java/com/zehong/common/core/redis/RedisCache.java
+10
-0
HttpUtils.java
...src/main/java/com/zehong/common/utils/http/HttpUtils.java
+232
-2
ProductStandardInspection.java
...a/com/zehong/system/domain/ProductStandardInspection.java
+291
-0
ProductStandardInspectionMapper.java
...zehong/system/mapper/ProductStandardInspectionMapper.java
+61
-0
IProductStandardInspectionService.java
...ong/system/service/IProductStandardInspectionService.java
+66
-0
ProductStandardInspectionServiceImpl.java
...em/service/impl/ProductStandardInspectionServiceImpl.java
+244
-0
ProductStandardInspectionMapper.xml
...sources/mapper/system/ProductStandardInspectionMapper.xml
+151
-0
package.json
zhmes-agecal-web/package.json
+1
-1
standardInspection.js
zhmes-agecal-web/src/api/system/standardInspection.js
+60
-0
variables.scss
zhmes-agecal-web/src/assets/styles/variables.scss
+1
-1
Logo.vue
zhmes-agecal-web/src/layout/components/Sidebar/Logo.vue
+1
-1
settings.js
zhmes-agecal-web/src/settings.js
+1
-1
index.vue
zhmes-agecal-web/src/views/standardInspection/index.vue
+357
-0
No files found.
sql/addSql.sql
View file @
701a4d4d
...
@@ -77,3 +77,5 @@ WHERE
...
@@ -77,3 +77,5 @@ WHERE
ALTER
TABLE
`t_storey_info`
ALTER
TABLE
`t_storey_info`
ADD
COLUMN
`f_estimated_end_time`
datetime
DEFAULT
NULL
COMMENT
'预计老化结束时间'
;
ADD
COLUMN
`f_estimated_end_time`
datetime
DEFAULT
NULL
COMMENT
'预计老化结束时间'
;
-- src/assets/styles/variables.scss $sideBarWidth 修改左边栏宽度
zhmes-agecal-admin/src/main/java/com/zehong/web/controller/equipment/ProductStandardInspectionController.java
0 → 100644
View file @
701a4d4d
package
com
.
zehong
.
web
.
controller
.
equipment
;
import
com.zehong.common.core.controller.BaseController
;
import
com.zehong.common.core.domain.AjaxResult
;
import
com.zehong.common.core.page.TableDataInfo
;
import
com.zehong.common.utils.poi.ExcelUtil
;
import
com.zehong.system.domain.ProductStandardInspection
;
import
com.zehong.system.service.IProductStandardInspectionService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* 产品主体标检单Controller
*
* @author zehong
* @date 2026-01-17
*/
@RestController
@RequestMapping
(
"/system/inspection"
)
public
class
ProductStandardInspectionController
extends
BaseController
{
@Autowired
private
IProductStandardInspectionService
productStandardInspectionService
;
/**
* 查询产品主体标检单列表
*/
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
ProductStandardInspection
productStandardInspection
)
{
startPage
();
List
<
ProductStandardInspection
>
list
=
productStandardInspectionService
.
selectProductStandardInspectionList
(
productStandardInspection
);
return
getDataTable
(
list
);
}
/**
* 导出产品主体标检单列表
*/
@GetMapping
(
"/export"
)
public
AjaxResult
export
(
ProductStandardInspection
productStandardInspection
)
{
List
<
ProductStandardInspection
>
list
=
productStandardInspectionService
.
selectProductStandardInspectionList
(
productStandardInspection
);
ExcelUtil
<
ProductStandardInspection
>
util
=
new
ExcelUtil
<
ProductStandardInspection
>(
ProductStandardInspection
.
class
);
return
util
.
exportExcel
(
list
,
"产品主体标检单数据"
);
}
/**
* 同步MES数据
*/
@GetMapping
(
"/syncMESData"
)
public
void
syncMESData
()
{
productStandardInspectionService
.
syncMESData
();
}
/**
* 获取产品主体标检单详细信息
*/
@GetMapping
(
value
=
"/{productStandardInspectionId}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"productStandardInspectionId"
)
Long
productStandardInspectionId
)
{
return
AjaxResult
.
success
(
productStandardInspectionService
.
selectProductStandardInspectionById
(
productStandardInspectionId
));
}
/**
* 新增产品主体标检单
*/
@PostMapping
public
AjaxResult
add
(
@RequestBody
ProductStandardInspection
productStandardInspection
)
{
return
toAjax
(
productStandardInspectionService
.
insertProductStandardInspection
(
productStandardInspection
));
}
/**
* 修改产品主体标检单
*/
@PutMapping
public
AjaxResult
edit
(
@RequestBody
ProductStandardInspection
productStandardInspection
)
{
return
toAjax
(
productStandardInspectionService
.
updateProductStandardInspection
(
productStandardInspection
));
}
/**
* 删除产品主体标检单
*/
@DeleteMapping
(
"/{productStandardInspectionIds}"
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
productStandardInspectionIds
)
{
return
toAjax
(
productStandardInspectionService
.
deleteProductStandardInspectionByIds
(
productStandardInspectionIds
));
}
}
zhmes-agecal-common/src/main/java/com/zehong/common/constant/RoboticArmConstans.java
View file @
701a4d4d
...
@@ -9,6 +9,18 @@ public class RoboticArmConstans {
...
@@ -9,6 +9,18 @@ public class RoboticArmConstans {
// 上传MES地址的key
// 上传MES地址的key
public
static
final
String
UPLOAD_MES_ADDRESS
=
"uploadMesAddress"
;
public
static
final
String
UPLOAD_MES_ADDRESS
=
"uploadMesAddress"
;
// 标检单地址的key
public
static
final
String
STANDARD_INSPECTION_ADDRESS
=
"standardInspectionAddress"
;
public
static
final
String
MES_TOKEN
=
"mes:token"
;
public
static
final
String
MES_LOGIN_URL
=
"mes.login.url"
;
public
static
final
String
MES_USERNAME
=
"mes.username"
;
public
static
final
String
MES_PASSWORD
=
"mes.password"
;
/**
/**
* 老化流程第一阶段执行时间(单位:分钟)
* 老化流程第一阶段执行时间(单位:分钟)
*/
*/
...
...
zhmes-agecal-common/src/main/java/com/zehong/common/core/redis/RedisCache.java
View file @
701a4d4d
...
@@ -49,6 +49,16 @@ public class RedisCache
...
@@ -49,6 +49,16 @@ public class RedisCache
redisTemplate
.
opsForValue
().
set
(
key
,
value
,
timeout
,
timeUnit
);
redisTemplate
.
opsForValue
().
set
(
key
,
value
,
timeout
,
timeUnit
);
}
}
/**
* 获取键的剩余过期时间
* @param key Redis键
* @param timeUnit 时间单位
* @return 剩余时间,单位由timeUnit指定
*/
public
Long
getExpire
(
final
String
key
,
final
TimeUnit
timeUnit
)
{
return
redisTemplate
.
getExpire
(
key
,
timeUnit
);
}
/**
/**
* 设置有效时间
* 设置有效时间
*
*
...
...
zhmes-agecal-common/src/main/java/com/zehong/common/utils/http/HttpUtils.java
View file @
701a4d4d
...
@@ -4,12 +4,15 @@ import java.io.*;
...
@@ -4,12 +4,15 @@ import java.io.*;
import
java.net.*
;
import
java.net.*
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.charset.StandardCharsets
;
import
java.security.cert.X509Certificate
;
import
java.security.cert.X509Certificate
;
import
java.util.Map
;
import
javax.net.ssl.HostnameVerifier
;
import
javax.net.ssl.HostnameVerifier
;
import
javax.net.ssl.HttpsURLConnection
;
import
javax.net.ssl.HttpsURLConnection
;
import
javax.net.ssl.SSLContext
;
import
javax.net.ssl.SSLContext
;
import
javax.net.ssl.SSLSession
;
import
javax.net.ssl.SSLSession
;
import
javax.net.ssl.TrustManager
;
import
javax.net.ssl.TrustManager
;
import
javax.net.ssl.X509TrustManager
;
import
javax.net.ssl.X509TrustManager
;
import
com.alibaba.fastjson.JSON
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
com.zehong.common.constant.Constants
;
import
com.zehong.common.constant.Constants
;
...
@@ -23,6 +26,8 @@ public class HttpUtils
...
@@ -23,6 +26,8 @@ public class HttpUtils
{
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
HttpUtils
.
class
);
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
HttpUtils
.
class
);
private
static
final
int
CONNECT_TIMEOUT
=
5000
;
// 5秒
private
static
final
int
READ_TIMEOUT
=
30000
;
// 30秒
/**
/**
* 向指定 URL 发送GET方法的请求
* 向指定 URL 发送GET方法的请求
*
*
...
@@ -250,4 +255,229 @@ public class HttpUtils
...
@@ -250,4 +255,229 @@ public class HttpUtils
return
true
;
return
true
;
}
}
}
}
/**
* 发送GET请求(带请求头和查询参数)
*/
public
static
String
get
(
String
url
,
Map
<
String
,
String
>
headers
,
Map
<
String
,
Object
>
params
)
{
HttpURLConnection
connection
=
null
;
BufferedReader
reader
=
null
;
try
{
// 构建带参数的URL
String
fullUrl
=
buildUrlWithParams
(
url
,
params
);
log
.
debug
(
"GET请求URL: {}"
,
fullUrl
);
if
(
headers
!=
null
)
{
log
.
debug
(
"GET请求头: {}"
,
JSON
.
toJSONString
(
headers
));
}
URL
requestUrl
=
new
URL
(
fullUrl
);
connection
=
(
HttpURLConnection
)
requestUrl
.
openConnection
();
// 设置连接参数
connection
.
setRequestMethod
(
"GET"
);
connection
.
setConnectTimeout
(
CONNECT_TIMEOUT
);
connection
.
setReadTimeout
(
READ_TIMEOUT
);
connection
.
setDoInput
(
true
);
// 设置通用请求头
connection
.
setRequestProperty
(
"Accept"
,
"application/json, text/plain, */*"
);
connection
.
setRequestProperty
(
"Connection"
,
"keep-alive"
);
// 设置自定义请求头
if
(
headers
!=
null
)
{
for
(
Map
.
Entry
<
String
,
String
>
entry
:
headers
.
entrySet
())
{
connection
.
setRequestProperty
(
entry
.
getKey
(),
entry
.
getValue
());
}
}
// 发起请求
connection
.
connect
();
// 获取响应码
int
responseCode
=
connection
.
getResponseCode
();
// 读取响应
InputStream
inputStream
;
if
(
responseCode
>=
200
&&
responseCode
<
300
)
{
inputStream
=
connection
.
getInputStream
();
}
else
{
inputStream
=
connection
.
getErrorStream
();
}
reader
=
new
BufferedReader
(
new
InputStreamReader
(
inputStream
,
StandardCharsets
.
UTF_8
));
StringBuilder
response
=
new
StringBuilder
();
String
line
;
while
((
line
=
reader
.
readLine
())
!=
null
)
{
response
.
append
(
line
);
}
String
responseBody
=
response
.
toString
();
log
.
debug
(
"GET响应码: {}, 响应体: {}"
,
responseCode
,
responseBody
);
if
(
responseCode
>=
200
&&
responseCode
<
300
)
{
return
responseBody
;
}
else
{
throw
new
IOException
(
"HTTP GET请求失败,状态码: "
+
responseCode
+
",响应: "
+
responseBody
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"GET请求异常, URL: {}"
,
url
,
e
);
throw
new
RuntimeException
(
"GET请求失败"
,
e
);
}
finally
{
if
(
reader
!=
null
)
{
try
{
reader
.
close
();
}
catch
(
IOException
e
)
{
log
.
warn
(
"关闭读取流异常"
,
e
);
}
}
if
(
connection
!=
null
)
{
connection
.
disconnect
();
}
}
}
/**
* 发送POST请求(JSON格式)
*/
public
static
String
postJson
(
String
url
,
Map
<
String
,
String
>
headers
,
Object
body
)
{
return
requestWithBody
(
"POST"
,
url
,
headers
,
JSON
.
toJSONString
(
body
),
"application/json"
);
}
/**
* 发送带请求体的请求
*/
private
static
String
requestWithBody
(
String
method
,
String
url
,
Map
<
String
,
String
>
headers
,
String
body
,
String
contentType
)
{
HttpURLConnection
connection
=
null
;
BufferedReader
reader
=
null
;
OutputStreamWriter
writer
=
null
;
try
{
log
.
debug
(
"{}请求URL: {}"
,
method
,
url
);
log
.
debug
(
"{}请求头: {}"
,
method
,
JSON
.
toJSONString
(
headers
));
log
.
debug
(
"{}请求体: {}"
,
method
,
body
);
URL
requestUrl
=
new
URL
(
url
);
connection
=
(
HttpURLConnection
)
requestUrl
.
openConnection
();
// 设置连接参数
connection
.
setRequestMethod
(
method
);
connection
.
setConnectTimeout
(
CONNECT_TIMEOUT
);
connection
.
setReadTimeout
(
READ_TIMEOUT
);
connection
.
setDoInput
(
true
);
connection
.
setDoOutput
(
true
);
// 设置通用请求头
connection
.
setRequestProperty
(
"Accept"
,
"application/json, text/plain, */*"
);
connection
.
setRequestProperty
(
"Connection"
,
"keep-alive"
);
// 设置内容类型
if
(
contentType
!=
null
)
{
connection
.
setRequestProperty
(
"Content-Type"
,
contentType
);
}
// 设置自定义请求头
if
(
headers
!=
null
)
{
for
(
Map
.
Entry
<
String
,
String
>
entry
:
headers
.
entrySet
())
{
connection
.
setRequestProperty
(
entry
.
getKey
(),
entry
.
getValue
());
}
}
// 发送请求体
if
(
body
!=
null
)
{
writer
=
new
OutputStreamWriter
(
connection
.
getOutputStream
(),
StandardCharsets
.
UTF_8
);
writer
.
write
(
body
);
writer
.
flush
();
}
// 获取响应码
int
responseCode
=
connection
.
getResponseCode
();
// 读取响应
InputStream
inputStream
;
if
(
responseCode
>=
200
&&
responseCode
<
300
)
{
inputStream
=
connection
.
getInputStream
();
}
else
{
inputStream
=
connection
.
getErrorStream
();
}
reader
=
new
BufferedReader
(
new
InputStreamReader
(
inputStream
,
StandardCharsets
.
UTF_8
));
StringBuilder
response
=
new
StringBuilder
();
String
line
;
while
((
line
=
reader
.
readLine
())
!=
null
)
{
response
.
append
(
line
);
}
String
responseBody
=
response
.
toString
();
log
.
debug
(
"{}响应码: {}, 响应体: {}"
,
method
,
responseCode
,
responseBody
);
if
(
responseCode
>=
200
&&
responseCode
<
300
)
{
return
responseBody
;
}
else
{
throw
new
IOException
(
"HTTP "
+
method
+
"请求失败,状态码: "
+
responseCode
+
",响应: "
+
responseBody
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"{}请求异常, URL: {}"
,
method
,
url
,
e
);
throw
new
RuntimeException
(
method
+
"请求失败"
,
e
);
}
finally
{
if
(
writer
!=
null
)
{
try
{
writer
.
close
();
}
catch
(
IOException
e
)
{
log
.
warn
(
"关闭写入流异常"
,
e
);
}
}
if
(
reader
!=
null
)
{
try
{
reader
.
close
();
}
catch
(
IOException
e
)
{
log
.
warn
(
"关闭读取流异常"
,
e
);
}
}
if
(
connection
!=
null
)
{
connection
.
disconnect
();
}
}
}
/**
* 构建带参数的URL
*/
private
static
String
buildUrlWithParams
(
String
url
,
Map
<
String
,
Object
>
params
)
{
if
(
params
==
null
||
params
.
isEmpty
())
{
return
url
;
}
StringBuilder
urlBuilder
=
new
StringBuilder
(
url
);
// 检查URL是否已包含参数
boolean
hasQuery
=
url
.
contains
(
"?"
);
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
params
.
entrySet
())
{
if
(!
hasQuery
)
{
urlBuilder
.
append
(
"?"
);
hasQuery
=
true
;
}
else
{
urlBuilder
.
append
(
"&"
);
}
try
{
urlBuilder
.
append
(
URLEncoder
.
encode
(
entry
.
getKey
(),
"UTF-8"
))
.
append
(
"="
)
.
append
(
URLEncoder
.
encode
(
String
.
valueOf
(
entry
.
getValue
()),
"UTF-8"
));
}
catch
(
UnsupportedEncodingException
e
)
{
// 使用默认编码
urlBuilder
.
append
(
entry
.
getKey
())
.
append
(
"="
)
.
append
(
entry
.
getValue
());
}
}
return
urlBuilder
.
toString
();
}
}
}
zhmes-agecal-system/src/main/java/com/zehong/system/domain/ProductStandardInspection.java
0 → 100644
View file @
701a4d4d
package
com
.
zehong
.
system
.
domain
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
com.zehong.common.annotation.Excel
;
import
com.zehong.common.core.domain.BaseEntity
;
/**
* 产品主体标检单对象 t_product_standard_inspection
*
* @author zehong
* @date 2026-01-17
*/
public
class
ProductStandardInspection
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/** id */
private
Long
productStandardInspectionId
;
/** 出库单号 */
@Excel
(
name
=
"出库单号"
)
private
String
outStoreOrderNumber
;
/** 主体标检单号 */
@Excel
(
name
=
"主体标检单号"
)
private
String
productStandardInspectionNumber
;
/** 确认标检人 */
@Excel
(
name
=
"确认标检人"
)
private
String
confirmQualityInspector
;
/** 备注 */
@Excel
(
name
=
"备注"
)
private
String
remarks
;
/** 状态 (PENDING_STANDARD_INSPECTION-待标检;DURING_STANDARD_INSPECTION-标检中;STANDARD_INSPECTION_COMPLETED-标检完成) */
@Excel
(
name
=
"状态 (PENDING_STANDARD_INSPECTION-待标检;DURING_STANDARD_INSPECTION-标检中;STANDARD_INSPECTION_COMPLETED-标检完成) "
)
private
String
status
;
/** 报检部门 */
@Excel
(
name
=
"报检部门"
)
private
String
inspectionDep
;
/** 删除标志,默认0,删除1 */
@Excel
(
name
=
"删除标志,默认0,删除1"
)
private
Integer
deleteFlag
;
/** 物料名称 */
@Excel
(
name
=
"物料名称"
)
private
String
materialName
;
/** 物料代码 */
@Excel
(
name
=
"物料代码"
)
private
String
materialCode
;
/** 规格型号 */
@Excel
(
name
=
"规格型号"
)
private
String
specification
;
/** 领料数量 */
@Excel
(
name
=
"领料数量"
)
private
Long
issuedNum
;
/** 申请数量 */
@Excel
(
name
=
"申请数量"
)
private
Long
quantity
;
/** 合格数量 */
@Excel
(
name
=
"合格数量"
)
private
Long
qualifiedNum
;
/** 不合格数量 */
@Excel
(
name
=
"不合格数量"
)
private
Long
unQualifiedNum
;
/** 老化时长 */
@Excel
(
name
=
"老化时长"
)
private
String
agingDuration
;
/** 标定气体 */
@Excel
(
name
=
"标定气体"
)
private
String
calibrationGas
;
/** 报警值 */
@Excel
(
name
=
"报警值"
)
private
String
alarmValue
;
/** 量程 */
@Excel
(
name
=
"量程"
)
private
String
range
;
public
void
setProductStandardInspectionId
(
Long
productStandardInspectionId
)
{
this
.
productStandardInspectionId
=
productStandardInspectionId
;
}
public
Long
getProductStandardInspectionId
()
{
return
productStandardInspectionId
;
}
public
void
setOutStoreOrderNumber
(
String
outStoreOrderNumber
)
{
this
.
outStoreOrderNumber
=
outStoreOrderNumber
;
}
public
String
getOutStoreOrderNumber
()
{
return
outStoreOrderNumber
;
}
public
void
setProductStandardInspectionNumber
(
String
productStandardInspectionNumber
)
{
this
.
productStandardInspectionNumber
=
productStandardInspectionNumber
;
}
public
String
getProductStandardInspectionNumber
()
{
return
productStandardInspectionNumber
;
}
public
void
setConfirmQualityInspector
(
String
confirmQualityInspector
)
{
this
.
confirmQualityInspector
=
confirmQualityInspector
;
}
public
String
getConfirmQualityInspector
()
{
return
confirmQualityInspector
;
}
public
void
setRemarks
(
String
remarks
)
{
this
.
remarks
=
remarks
;
}
public
String
getRemarks
()
{
return
remarks
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
public
String
getStatus
()
{
return
status
;
}
public
void
setInspectionDep
(
String
inspectionDep
)
{
this
.
inspectionDep
=
inspectionDep
;
}
public
String
getInspectionDep
()
{
return
inspectionDep
;
}
public
void
setDeleteFlag
(
Integer
deleteFlag
)
{
this
.
deleteFlag
=
deleteFlag
;
}
public
Integer
getDeleteFlag
()
{
return
deleteFlag
;
}
public
void
setMaterialName
(
String
materialName
)
{
this
.
materialName
=
materialName
;
}
public
String
getMaterialName
()
{
return
materialName
;
}
public
void
setMaterialCode
(
String
materialCode
)
{
this
.
materialCode
=
materialCode
;
}
public
String
getMaterialCode
()
{
return
materialCode
;
}
public
void
setSpecification
(
String
specification
)
{
this
.
specification
=
specification
;
}
public
String
getSpecification
()
{
return
specification
;
}
public
void
setIssuedNum
(
Long
issuedNum
)
{
this
.
issuedNum
=
issuedNum
;
}
public
Long
getIssuedNum
()
{
return
issuedNum
;
}
public
void
setQuantity
(
Long
quantity
)
{
this
.
quantity
=
quantity
;
}
public
Long
getQuantity
()
{
return
quantity
;
}
public
void
setQualifiedNum
(
Long
qualifiedNum
)
{
this
.
qualifiedNum
=
qualifiedNum
;
}
public
Long
getQualifiedNum
()
{
return
qualifiedNum
;
}
public
void
setUnQualifiedNum
(
Long
unQualifiedNum
)
{
this
.
unQualifiedNum
=
unQualifiedNum
;
}
public
Long
getUnQualifiedNum
()
{
return
unQualifiedNum
;
}
public
void
setAgingDuration
(
String
agingDuration
)
{
this
.
agingDuration
=
agingDuration
;
}
public
String
getAgingDuration
()
{
return
agingDuration
;
}
public
void
setCalibrationGas
(
String
calibrationGas
)
{
this
.
calibrationGas
=
calibrationGas
;
}
public
String
getCalibrationGas
()
{
return
calibrationGas
;
}
public
void
setAlarmValue
(
String
alarmValue
)
{
this
.
alarmValue
=
alarmValue
;
}
public
String
getAlarmValue
()
{
return
alarmValue
;
}
public
void
setRange
(
String
range
)
{
this
.
range
=
range
;
}
public
String
getRange
()
{
return
range
;
}
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
.
append
(
"productStandardInspectionId"
,
getProductStandardInspectionId
())
.
append
(
"outStoreOrderNumber"
,
getOutStoreOrderNumber
())
.
append
(
"productStandardInspectionNumber"
,
getProductStandardInspectionNumber
())
.
append
(
"confirmQualityInspector"
,
getConfirmQualityInspector
())
.
append
(
"remarks"
,
getRemarks
())
.
append
(
"status"
,
getStatus
())
.
append
(
"createBy"
,
getCreateBy
())
.
append
(
"inspectionDep"
,
getInspectionDep
())
.
append
(
"createTime"
,
getCreateTime
())
.
append
(
"deleteFlag"
,
getDeleteFlag
())
.
append
(
"materialName"
,
getMaterialName
())
.
append
(
"materialCode"
,
getMaterialCode
())
.
append
(
"specification"
,
getSpecification
())
.
append
(
"issuedNum"
,
getIssuedNum
())
.
append
(
"quantity"
,
getQuantity
())
.
append
(
"qualifiedNum"
,
getQualifiedNum
())
.
append
(
"unQualifiedNum"
,
getUnQualifiedNum
())
.
append
(
"agingDuration"
,
getAgingDuration
())
.
append
(
"calibrationGas"
,
getCalibrationGas
())
.
append
(
"alarmValue"
,
getAlarmValue
())
.
append
(
"range"
,
getRange
())
.
toString
();
}
}
zhmes-agecal-system/src/main/java/com/zehong/system/mapper/ProductStandardInspectionMapper.java
0 → 100644
View file @
701a4d4d
package
com
.
zehong
.
system
.
mapper
;
import
java.util.List
;
import
com.zehong.system.domain.ProductStandardInspection
;
/**
* 产品主体标检单Mapper接口
*
* @author zehong
* @date 2026-01-17
*/
public
interface
ProductStandardInspectionMapper
{
/**
* 查询产品主体标检单
*
* @param productStandardInspectionId 产品主体标检单ID
* @return 产品主体标检单
*/
public
ProductStandardInspection
selectProductStandardInspectionById
(
Long
productStandardInspectionId
);
/**
* 查询产品主体标检单列表
*
* @param productStandardInspection 产品主体标检单
* @return 产品主体标检单集合
*/
public
List
<
ProductStandardInspection
>
selectProductStandardInspectionList
(
ProductStandardInspection
productStandardInspection
);
/**
* 新增产品主体标检单
*
* @param productStandardInspection 产品主体标检单
* @return 结果
*/
public
int
insertProductStandardInspection
(
ProductStandardInspection
productStandardInspection
);
/**
* 修改产品主体标检单
*
* @param productStandardInspection 产品主体标检单
* @return 结果
*/
public
int
updateProductStandardInspection
(
ProductStandardInspection
productStandardInspection
);
/**
* 删除产品主体标检单
*
* @param productStandardInspectionId 产品主体标检单ID
* @return 结果
*/
public
int
deleteProductStandardInspectionById
(
Long
productStandardInspectionId
);
/**
* 批量删除产品主体标检单
*
* @param productStandardInspectionIds 需要删除的数据ID
* @return 结果
*/
public
int
deleteProductStandardInspectionByIds
(
Long
[]
productStandardInspectionIds
);
}
zhmes-agecal-system/src/main/java/com/zehong/system/service/IProductStandardInspectionService.java
0 → 100644
View file @
701a4d4d
package
com
.
zehong
.
system
.
service
;
import
java.util.List
;
import
com.zehong.system.domain.ProductStandardInspection
;
/**
* 产品主体标检单Service接口
*
* @author zehong
* @date 2026-01-17
*/
public
interface
IProductStandardInspectionService
{
/**
* 查询产品主体标检单
*
* @param productStandardInspectionId 产品主体标检单ID
* @return 产品主体标检单
*/
public
ProductStandardInspection
selectProductStandardInspectionById
(
Long
productStandardInspectionId
);
/**
* 查询产品主体标检单列表
*
* @param productStandardInspection 产品主体标检单
* @return 产品主体标检单集合
*/
public
List
<
ProductStandardInspection
>
selectProductStandardInspectionList
(
ProductStandardInspection
productStandardInspection
);
/**
* 同步MES数据
*/
public
void
syncMESData
();
/**
* 新增产品主体标检单
*
* @param productStandardInspection 产品主体标检单
* @return 结果
*/
public
int
insertProductStandardInspection
(
ProductStandardInspection
productStandardInspection
);
/**
* 修改产品主体标检单
*
* @param productStandardInspection 产品主体标检单
* @return 结果
*/
public
int
updateProductStandardInspection
(
ProductStandardInspection
productStandardInspection
);
/**
* 批量删除产品主体标检单
*
* @param productStandardInspectionIds 需要删除的产品主体标检单ID
* @return 结果
*/
public
int
deleteProductStandardInspectionByIds
(
Long
[]
productStandardInspectionIds
);
/**
* 删除产品主体标检单信息
*
* @param productStandardInspectionId 产品主体标检单ID
* @return 结果
*/
public
int
deleteProductStandardInspectionById
(
Long
productStandardInspectionId
);
}
zhmes-agecal-system/src/main/java/com/zehong/system/service/impl/ProductStandardInspectionServiceImpl.java
0 → 100644
View file @
701a4d4d
package
com
.
zehong
.
system
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.zehong.common.constant.RoboticArmConstans
;
import
com.zehong.common.core.redis.RedisCache
;
import
com.zehong.common.utils.DateUtils
;
import
com.zehong.common.utils.http.HttpUtils
;
import
com.zehong.system.domain.ProductStandardInspection
;
import
com.zehong.system.mapper.ProductStandardInspectionMapper
;
import
com.zehong.system.service.IProductStandardInspectionService
;
import
com.zehong.system.service.ISysConfigService
;
import
io.netty.handler.codec.http.HttpUtil
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.TimeUnit
;
/**
* 产品主体标检单Service业务层处理
*
* @author zehong
* @date 2026-01-17
*/
@Service
public
class
ProductStandardInspectionServiceImpl
implements
IProductStandardInspectionService
{
public
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ProductStandardInspectionServiceImpl
.
class
);
@Resource
private
ProductStandardInspectionMapper
productStandardInspectionMapper
;
@Resource
private
ISysConfigService
sysConfigService
;
@Resource
private
RedisCache
redisCache
;
/**
* 查询产品主体标检单
*
* @param productStandardInspectionId 产品主体标检单ID
* @return 产品主体标检单
*/
@Override
public
ProductStandardInspection
selectProductStandardInspectionById
(
Long
productStandardInspectionId
)
{
return
productStandardInspectionMapper
.
selectProductStandardInspectionById
(
productStandardInspectionId
);
}
/**
* 查询产品主体标检单列表
*
* @param productStandardInspection 产品主体标检单
* @return 产品主体标检单
*/
@Override
public
List
<
ProductStandardInspection
>
selectProductStandardInspectionList
(
ProductStandardInspection
productStandardInspection
)
{
return
productStandardInspectionMapper
.
selectProductStandardInspectionList
(
productStandardInspection
);
}
/**
* 同步MES数据
*/
@Override
public
void
syncMESData
()
{
String
standardInspectionAddress
=
sysConfigService
.
directSelectConfigByKey
(
RoboticArmConstans
.
STANDARD_INSPECTION_ADDRESS
);
if
(
StringUtils
.
isBlank
(
standardInspectionAddress
))
{
throw
new
RuntimeException
(
"MES地址未配置"
);
}
// 2. 获取token
String
token
=
getMESToken
();
if
(
StringUtils
.
isBlank
(
token
))
{
throw
new
RuntimeException
(
"MES token未获取"
);
}
// 3. 构造请求头
Map
<
String
,
String
>
headers
=
new
HashMap
<>();
headers
.
put
(
"Authorization"
,
"Bearer "
+
token
);
headers
.
put
(
"Content-Type"
,
"application/json"
);
// 4. 调用MES接口
String
result
=
HttpUtils
.
get
(
standardInspectionAddress
,
headers
,
null
);
if
(
StringUtils
.
isNotBlank
(
result
))
{
// 5. 处理返回的数据
processMESData
(
result
);
logger
.
info
(
"MES数据同步成功"
);
}
else
{
throw
new
RuntimeException
(
"MES接口调用失败"
);
}
}
/**
* 获取MES token
*/
private
String
getMESToken
()
{
// 1. 先从Redis中获取token
Object
tokenObj
=
redisCache
.
getCacheObject
(
RoboticArmConstans
.
MES_TOKEN
);
if
(
tokenObj
!=
null
)
{
String
token
=
tokenObj
.
toString
();
// 检查token是否即将过期(提前5分钟刷新)
long
expireTime
=
redisCache
.
getExpire
(
RoboticArmConstans
.
MES_TOKEN
,
TimeUnit
.
MINUTES
);
if
(
expireTime
>
1
)
{
// 大于1分钟,直接返回
return
token
;
}
}
// 2. 如果Redis中没有或即将过期,重新获取token
return
refreshMESToken
();
}
/**
* 刷新MES token
*/
private
String
refreshMESToken
()
{
try
{
// 1. 获取登录配置信息
String
loginUrl
=
sysConfigService
.
directSelectConfigByKey
(
RoboticArmConstans
.
MES_LOGIN_URL
);
String
username
=
sysConfigService
.
directSelectConfigByKey
(
RoboticArmConstans
.
MES_USERNAME
);
String
password
=
sysConfigService
.
directSelectConfigByKey
(
RoboticArmConstans
.
MES_PASSWORD
);
if
(
StringUtils
.
isAnyBlank
(
loginUrl
,
username
,
password
))
{
throw
new
RuntimeException
(
"MES登录配置信息不完整"
);
}
// 2. 构造登录参数
Map
<
String
,
String
>
loginParams
=
new
HashMap
<>();
loginParams
.
put
(
"username"
,
username
);
loginParams
.
put
(
"password"
,
password
);
// 3. 调用登录接口
String
response
=
HttpUtils
.
sendPost
(
loginUrl
,
JSON
.
toJSONString
(
loginParams
));
if
(
StringUtils
.
isNotBlank
(
response
))
{
// 4. 解析返回的token(根据实际接口返回格式调整)
String
token
=
parseTokenFromResponse
(
response
);
if
(
StringUtils
.
isNotBlank
(
token
))
{
// 5. 将token存储到Redis,设置过期时间
redisCache
.
setCacheObject
(
RoboticArmConstans
.
MES_TOKEN
,
token
,
300
,
TimeUnit
.
MINUTES
);
// 5分钟
return
token
;
}
}
throw
new
RuntimeException
(
"获取MES token失败"
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"刷新MES token异常"
,
e
);
}
}
/**
* 从响应中解析token(根据实际接口返回格式调整)
*/
private
String
parseTokenFromResponse
(
String
response
)
{
try
{
// 假设返回格式为:{"code": 200, "data": "abacadfsasd", "msg": "success"}
JSONObject
jsonObject
=
JSON
.
parseObject
(
response
);
if
(
jsonObject
!=
null
&&
jsonObject
.
getInteger
(
"code"
)
==
200
)
{
String
token
=
jsonObject
.
getString
(
"data"
);
if
(
StringUtils
.
isNotBlank
(
token
))
{
return
token
;
}
else
{
throw
new
RuntimeException
(
"获取MES token失败"
);
}
}
}
catch
(
Exception
e
)
{
logger
.
error
(
"解析token失败,响应内容:{}"
,
response
,
e
);
}
return
null
;
}
/**
* 处理MES返回的数据
*/
private
void
processMESData
(
String
data
)
{
// 根据实际业务需求处理数据
// 这里只是示例,具体实现根据您的业务逻辑
try
{
JSONObject
jsonData
=
JSON
.
parseObject
(
data
);
// 处理数据逻辑...
logger
.
debug
(
"接收到MES数据:{}"
,
jsonData
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"处理MES数据异常:"
,
e
);
}
}
/**
* 新增产品主体标检单
*
* @param productStandardInspection 产品主体标检单
* @return 结果
*/
@Override
public
int
insertProductStandardInspection
(
ProductStandardInspection
productStandardInspection
)
{
productStandardInspection
.
setCreateTime
(
DateUtils
.
getNowDate
());
return
productStandardInspectionMapper
.
insertProductStandardInspection
(
productStandardInspection
);
}
/**
* 修改产品主体标检单
*
* @param productStandardInspection 产品主体标检单
* @return 结果
*/
@Override
public
int
updateProductStandardInspection
(
ProductStandardInspection
productStandardInspection
)
{
return
productStandardInspectionMapper
.
updateProductStandardInspection
(
productStandardInspection
);
}
/**
* 批量删除产品主体标检单
*
* @param productStandardInspectionIds 需要删除的产品主体标检单ID
* @return 结果
*/
@Override
public
int
deleteProductStandardInspectionByIds
(
Long
[]
productStandardInspectionIds
)
{
return
productStandardInspectionMapper
.
deleteProductStandardInspectionByIds
(
productStandardInspectionIds
);
}
/**
* 删除产品主体标检单信息
*
* @param productStandardInspectionId 产品主体标检单ID
* @return 结果
*/
@Override
public
int
deleteProductStandardInspectionById
(
Long
productStandardInspectionId
)
{
return
productStandardInspectionMapper
.
deleteProductStandardInspectionById
(
productStandardInspectionId
);
}
}
zhmes-agecal-system/src/main/resources/mapper/system/ProductStandardInspectionMapper.xml
0 → 100644
View file @
701a4d4d
This diff is collapsed.
Click to expand it.
zhmes-agecal-web/package.json
View file @
701a4d4d
{
{
"name"
:
"zehong"
,
"name"
:
"zehong"
,
"version"
:
"3.5.0"
,
"version"
:
"3.5.0"
,
"description"
:
"泽宏
管理系统
"
,
"description"
:
"泽宏
老化监控平台
"
,
"author"
:
"泽宏"
,
"author"
:
"泽宏"
,
"license"
:
"MIT"
,
"license"
:
"MIT"
,
"scripts"
:
{
"scripts"
:
{
...
...
zhmes-agecal-web/src/api/system/standardInspection.js
0 → 100644
View file @
701a4d4d
import
request
from
'@/utils/request'
// 查询产品主体标检单列表
export
function
listInspection
(
query
)
{
return
request
({
url
:
'/system/inspection/list'
,
method
:
'get'
,
params
:
query
})
}
// 查询产品主体标检单详细
export
function
getInspection
(
productStandardInspectionId
)
{
return
request
({
url
:
'/system/inspection/'
+
productStandardInspectionId
,
method
:
'get'
})
}
// 新增产品主体标检单
export
function
addInspection
(
data
)
{
return
request
({
url
:
'/system/inspection'
,
method
:
'post'
,
data
:
data
})
}
// 修改产品主体标检单
export
function
updateInspection
(
data
)
{
return
request
({
url
:
'/system/inspection'
,
method
:
'put'
,
data
:
data
})
}
// 删除产品主体标检单
export
function
delInspection
(
productStandardInspectionId
)
{
return
request
({
url
:
'/system/inspection/'
+
productStandardInspectionId
,
method
:
'delete'
})
}
// 导出产品主体标检单
export
function
exportInspection
(
query
)
{
return
request
({
url
:
'/system/inspection/export'
,
method
:
'get'
,
params
:
query
})
}
export
function
syncMESData
()
{
return
request
({
url
:
'/system/inspection/syncMESData'
,
method
:
'get'
})
}
zhmes-agecal-web/src/assets/styles/variables.scss
View file @
701a4d4d
...
@@ -24,7 +24,7 @@ $sidebarLightTitle: #001529;
...
@@ -24,7 +24,7 @@ $sidebarLightTitle: #001529;
$subMenuBg
:
#1f2d3d
;
$subMenuBg
:
#1f2d3d
;
$subMenuHover
:
#001528
;
$subMenuHover
:
#001528
;
$sideBarWidth
:
2
0
0px
;
$sideBarWidth
:
2
5
0px
;
// the :export directive is the magic sauce for webpack
// the :export directive is the magic sauce for webpack
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
...
...
zhmes-agecal-web/src/layout/components/Sidebar/Logo.vue
View file @
701a4d4d
...
@@ -35,7 +35,7 @@ export default {
...
@@ -35,7 +35,7 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
title
:
'泽宏
管理系统
'
,
title
:
'泽宏
老化监控平台
'
,
logo
:
logoImg
logo
:
logoImg
}
}
}
}
...
...
zhmes-agecal-web/src/settings.js
View file @
701a4d4d
module
.
exports
=
{
module
.
exports
=
{
title
:
'泽宏
管理系统
'
,
title
:
'泽宏
老化监控平台
'
,
/**
/**
* 侧边栏主题 深色主题theme-dark,浅色主题theme-light
* 侧边栏主题 深色主题theme-dark,浅色主题theme-light
...
...
zhmes-agecal-web/src/views/standardInspection/index.vue
0 → 100644
View file @
701a4d4d
This diff is collapsed.
Click to expand it.
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