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
Hide 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,25 +4,30 @@ import java.io.*;
...
@@ -4,25 +4,30 @@ 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
;
/**
/**
* 通用http发送方法
* 通用http发送方法
*
*
* @author zehong
* @author zehong
*/
*/
public
class
HttpUtils
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
;
}
}
}
}
}
\ No newline at end of file
/**
* 发送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
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.zehong.system.mapper.ProductStandardInspectionMapper"
>
<resultMap
type=
"ProductStandardInspection"
id=
"ProductStandardInspectionResult"
>
<result
property=
"productStandardInspectionId"
column=
"f_product_standard_inspection_id"
/>
<result
property=
"outStoreOrderNumber"
column=
"f_out_store_order_number"
/>
<result
property=
"productStandardInspectionNumber"
column=
"f_product_standard_inspection_number"
/>
<result
property=
"confirmQualityInspector"
column=
"f_confirm_quality_inspector"
/>
<result
property=
"remarks"
column=
"f_remarks"
/>
<result
property=
"status"
column=
"f_status"
/>
<result
property=
"createBy"
column=
"f_create_by"
/>
<result
property=
"inspectionDep"
column=
"f_inspection_dep"
/>
<result
property=
"createTime"
column=
"f_create_time"
/>
<result
property=
"deleteFlag"
column=
"f_delete_flag"
/>
<result
property=
"materialName"
column=
"f_material_name"
/>
<result
property=
"materialCode"
column=
"f_material_code"
/>
<result
property=
"specification"
column=
"f_specification"
/>
<result
property=
"issuedNum"
column=
"f_issued_num"
/>
<result
property=
"quantity"
column=
"f_quantity"
/>
<result
property=
"qualifiedNum"
column=
"f_qualified_num"
/>
<result
property=
"unQualifiedNum"
column=
"f_un_qualified_num"
/>
<result
property=
"agingDuration"
column=
"f_aging_duration"
/>
<result
property=
"calibrationGas"
column=
"f_calibration_gas"
/>
<result
property=
"alarmValue"
column=
"f_alarm_value"
/>
<result
property=
"range"
column=
"f_range"
/>
</resultMap>
<sql
id=
"selectProductStandardInspectionVo"
>
select f_product_standard_inspection_id, f_out_store_order_number, f_product_standard_inspection_number, f_confirm_quality_inspector, f_remarks, f_status, f_create_by, f_inspection_dep, f_create_time, f_delete_flag, f_material_name, f_material_code, f_specification, f_issued_num, f_quantity, f_qualified_num, f_un_qualified_num, f_aging_duration, f_calibration_gas, f_alarm_value, f_range from t_product_standard_inspection
</sql>
<select
id=
"selectProductStandardInspectionList"
parameterType=
"ProductStandardInspection"
resultMap=
"ProductStandardInspectionResult"
>
<include
refid=
"selectProductStandardInspectionVo"
/>
<where>
<if
test=
"outStoreOrderNumber != null and outStoreOrderNumber != ''"
>
and f_out_store_order_number = #{outStoreOrderNumber}
</if>
<if
test=
"productStandardInspectionNumber != null and productStandardInspectionNumber != ''"
>
and f_product_standard_inspection_number = #{productStandardInspectionNumber}
</if>
<if
test=
"confirmQualityInspector != null and confirmQualityInspector != ''"
>
and f_confirm_quality_inspector = #{confirmQualityInspector}
</if>
<if
test=
"remarks != null and remarks != ''"
>
and f_remarks = #{remarks}
</if>
<if
test=
"status != null and status != ''"
>
and f_status = #{status}
</if>
<if
test=
"createBy != null and createBy != ''"
>
and f_create_by = #{createBy}
</if>
<if
test=
"inspectionDep != null and inspectionDep != ''"
>
and f_inspection_dep = #{inspectionDep}
</if>
<if
test=
"createTime != null "
>
and f_create_time = #{createTime}
</if>
<if
test=
"deleteFlag != null "
>
and f_delete_flag = #{deleteFlag}
</if>
<if
test=
"materialName != null and materialName != ''"
>
and f_material_name like concat('%', #{materialName}, '%')
</if>
<if
test=
"materialCode != null and materialCode != ''"
>
and f_material_code = #{materialCode}
</if>
<if
test=
"specification != null and specification != ''"
>
and f_specification = #{specification}
</if>
<if
test=
"issuedNum != null "
>
and f_issued_num = #{issuedNum}
</if>
<if
test=
"quantity != null "
>
and f_quantity = #{quantity}
</if>
<if
test=
"qualifiedNum != null "
>
and f_qualified_num = #{qualifiedNum}
</if>
<if
test=
"unQualifiedNum != null "
>
and f_un_qualified_num = #{unQualifiedNum}
</if>
<if
test=
"agingDuration != null and agingDuration != ''"
>
and f_aging_duration = #{agingDuration}
</if>
<if
test=
"calibrationGas != null and calibrationGas != ''"
>
and f_calibration_gas = #{calibrationGas}
</if>
<if
test=
"alarmValue != null and alarmValue != ''"
>
and f_alarm_value = #{alarmValue}
</if>
<if
test=
"range != null and range != ''"
>
and f_range = #{range}
</if>
</where>
</select>
<select
id=
"selectProductStandardInspectionById"
parameterType=
"Long"
resultMap=
"ProductStandardInspectionResult"
>
<include
refid=
"selectProductStandardInspectionVo"
/>
where f_product_standard_inspection_id = #{productStandardInspectionId}
</select>
<insert
id=
"insertProductStandardInspection"
parameterType=
"ProductStandardInspection"
useGeneratedKeys=
"true"
keyProperty=
"productStandardInspectionId"
>
insert into t_product_standard_inspection
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"outStoreOrderNumber != null"
>
f_out_store_order_number,
</if>
<if
test=
"productStandardInspectionNumber != null and productStandardInspectionNumber != ''"
>
f_product_standard_inspection_number,
</if>
<if
test=
"confirmQualityInspector != null"
>
f_confirm_quality_inspector,
</if>
<if
test=
"remarks != null"
>
f_remarks,
</if>
<if
test=
"status != null"
>
f_status,
</if>
<if
test=
"createBy != null"
>
f_create_by,
</if>
<if
test=
"inspectionDep != null"
>
f_inspection_dep,
</if>
<if
test=
"createTime != null"
>
f_create_time,
</if>
<if
test=
"deleteFlag != null"
>
f_delete_flag,
</if>
<if
test=
"materialName != null"
>
f_material_name,
</if>
<if
test=
"materialCode != null"
>
f_material_code,
</if>
<if
test=
"specification != null"
>
f_specification,
</if>
<if
test=
"issuedNum != null"
>
f_issued_num,
</if>
<if
test=
"quantity != null"
>
f_quantity,
</if>
<if
test=
"qualifiedNum != null"
>
f_qualified_num,
</if>
<if
test=
"unQualifiedNum != null"
>
f_un_qualified_num,
</if>
<if
test=
"agingDuration != null"
>
f_aging_duration,
</if>
<if
test=
"calibrationGas != null"
>
f_calibration_gas,
</if>
<if
test=
"alarmValue != null"
>
f_alarm_value,
</if>
<if
test=
"range != null"
>
f_range,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"outStoreOrderNumber != null"
>
#{outStoreOrderNumber},
</if>
<if
test=
"productStandardInspectionNumber != null and productStandardInspectionNumber != ''"
>
#{productStandardInspectionNumber},
</if>
<if
test=
"confirmQualityInspector != null"
>
#{confirmQualityInspector},
</if>
<if
test=
"remarks != null"
>
#{remarks},
</if>
<if
test=
"status != null"
>
#{status},
</if>
<if
test=
"createBy != null"
>
#{createBy},
</if>
<if
test=
"inspectionDep != null"
>
#{inspectionDep},
</if>
<if
test=
"createTime != null"
>
#{createTime},
</if>
<if
test=
"deleteFlag != null"
>
#{deleteFlag},
</if>
<if
test=
"materialName != null"
>
#{materialName},
</if>
<if
test=
"materialCode != null"
>
#{materialCode},
</if>
<if
test=
"specification != null"
>
#{specification},
</if>
<if
test=
"issuedNum != null"
>
#{issuedNum},
</if>
<if
test=
"quantity != null"
>
#{quantity},
</if>
<if
test=
"qualifiedNum != null"
>
#{qualifiedNum},
</if>
<if
test=
"unQualifiedNum != null"
>
#{unQualifiedNum},
</if>
<if
test=
"agingDuration != null"
>
#{agingDuration},
</if>
<if
test=
"calibrationGas != null"
>
#{calibrationGas},
</if>
<if
test=
"alarmValue != null"
>
#{alarmValue},
</if>
<if
test=
"range != null"
>
#{range},
</if>
</trim>
</insert>
<update
id=
"updateProductStandardInspection"
parameterType=
"ProductStandardInspection"
>
update t_product_standard_inspection
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"outStoreOrderNumber != null"
>
f_out_store_order_number = #{outStoreOrderNumber},
</if>
<if
test=
"productStandardInspectionNumber != null and productStandardInspectionNumber != ''"
>
f_product_standard_inspection_number = #{productStandardInspectionNumber},
</if>
<if
test=
"confirmQualityInspector != null"
>
f_confirm_quality_inspector = #{confirmQualityInspector},
</if>
<if
test=
"remarks != null"
>
f_remarks = #{remarks},
</if>
<if
test=
"status != null"
>
f_status = #{status},
</if>
<if
test=
"createBy != null"
>
f_create_by = #{createBy},
</if>
<if
test=
"inspectionDep != null"
>
f_inspection_dep = #{inspectionDep},
</if>
<if
test=
"createTime != null"
>
f_create_time = #{createTime},
</if>
<if
test=
"deleteFlag != null"
>
f_delete_flag = #{deleteFlag},
</if>
<if
test=
"materialName != null"
>
f_material_name = #{materialName},
</if>
<if
test=
"materialCode != null"
>
f_material_code = #{materialCode},
</if>
<if
test=
"specification != null"
>
f_specification = #{specification},
</if>
<if
test=
"issuedNum != null"
>
f_issued_num = #{issuedNum},
</if>
<if
test=
"quantity != null"
>
f_quantity = #{quantity},
</if>
<if
test=
"qualifiedNum != null"
>
f_qualified_num = #{qualifiedNum},
</if>
<if
test=
"unQualifiedNum != null"
>
f_un_qualified_num = #{unQualifiedNum},
</if>
<if
test=
"agingDuration != null"
>
f_aging_duration = #{agingDuration},
</if>
<if
test=
"calibrationGas != null"
>
f_calibration_gas = #{calibrationGas},
</if>
<if
test=
"alarmValue != null"
>
f_alarm_value = #{alarmValue},
</if>
<if
test=
"range != null"
>
f_range = #{range},
</if>
</trim>
where f_product_standard_inspection_id = #{productStandardInspectionId}
</update>
<delete
id=
"deleteProductStandardInspectionById"
parameterType=
"Long"
>
delete from t_product_standard_inspection where f_product_standard_inspection_id = #{productStandardInspectionId}
</delete>
<delete
id=
"deleteProductStandardInspectionByIds"
parameterType=
"String"
>
delete from t_product_standard_inspection where f_product_standard_inspection_id in
<foreach
item=
"productStandardInspectionId"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{productStandardInspectionId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
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
<
template
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"出库单号"
prop=
"outStoreOrderNumber"
>
<el-input
v-model=
"queryParams.outStoreOrderNumber"
placeholder=
"请输入出库单号"
clearable
size=
"small"
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"标检单号"
prop=
"productStandardInspectionNumber"
>
<el-input
v-model=
"queryParams.productStandardInspectionNumber"
placeholder=
"请输入主体标检单号"
clearable
size=
"small"
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
</el-form>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"primary"
plain
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleSyncMESData"
>
获取
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"warning"
plain
icon=
"el-icon-download"
size=
"mini"
:loading=
"exportLoading"
@
click=
"handleExport"
>
导出
</el-button>
</el-col>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
<el-table
v-loading=
"loading"
:data=
"inspectionList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
label=
"出库单号"
align=
"center"
prop=
"outStoreOrderNumber"
/>
<el-table-column
label=
"标检单号"
align=
"center"
prop=
"productStandardInspectionNumber"
/>
<el-table-column
label=
"状态"
align=
"center"
prop=
"status"
/>
<el-table-column
label=
"报检人"
align=
"center"
prop=
"createBy"
/>
<el-table-column
label=
"报检部门"
align=
"center"
prop=
"inspectionDep"
/>
<el-table-column
label=
"报检时间"
align=
"center"
prop=
"createTime"
width=
"110"
>
<template
slot-scope=
"scope"
>
<span>
{{
parseTime
(
scope
.
row
.
createTime
,
'{y
}
-{m
}
-{d
}
'
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"物料名称"
align
=
"center"
prop
=
"materialName"
/>
<
el
-
table
-
column
label
=
"物料代码"
align
=
"center"
prop
=
"materialCode"
/>
<
el
-
table
-
column
label
=
"规格型号"
align
=
"center"
prop
=
"specification"
/>
<
el
-
table
-
column
label
=
"领料数量"
align
=
"center"
prop
=
"issuedNum"
/>
<
el
-
table
-
column
label
=
"申请数量"
align
=
"center"
prop
=
"quantity"
/>
<
el
-
table
-
column
label
=
"合格数量"
align
=
"center"
prop
=
"qualifiedNum"
/>
<
el
-
table
-
column
label
=
"不合格数量"
width
=
"110px"
align
=
"center"
prop
=
"unQualifiedNum"
/>
<
el
-
table
-
column
label
=
"老化时长"
align
=
"center"
prop
=
"agingDuration"
/>
<
el
-
table
-
column
label
=
"标定气体"
align
=
"center"
prop
=
"calibrationGas"
/>
<
el
-
table
-
column
label
=
"报警值"
align
=
"center"
prop
=
"alarmValue"
/>
<
el
-
table
-
column
label
=
"量程"
align
=
"center"
prop
=
"range"
/>
<
/el-table
>
<
pagination
v
-
show
=
"total>0"
:
total
=
"total"
:
page
.
sync
=
"queryParams.pageNum"
:
limit
.
sync
=
"queryParams.pageSize"
@
pagination
=
"getList"
/>
<!--
添加或修改产品主体标检单对话框
-->
<
el
-
dialog
:
title
=
"title"
:
visible
.
sync
=
"open"
width
=
"500px"
append
-
to
-
body
>
<
el
-
form
ref
=
"form"
:
model
=
"form"
:
rules
=
"rules"
label
-
width
=
"80px"
>
<
el
-
form
-
item
label
=
"出库单号"
prop
=
"outStoreOrderNumber"
>
<
el
-
input
v
-
model
=
"form.outStoreOrderNumber"
placeholder
=
"请输入出库单号"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"主体标检单号"
prop
=
"productStandardInspectionNumber"
>
<
el
-
input
v
-
model
=
"form.productStandardInspectionNumber"
placeholder
=
"请输入主体标检单号"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"确认标检人"
prop
=
"confirmQualityInspector"
>
<
el
-
input
v
-
model
=
"form.confirmQualityInspector"
placeholder
=
"请输入确认标检人"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"备注"
prop
=
"remarks"
>
<
el
-
input
v
-
model
=
"form.remarks"
placeholder
=
"请输入备注"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"状态 (PENDING_STANDARD_INSPECTION-待标检;DURING_STANDARD_INSPECTION-标检中;STANDARD_INSPECTION_COMPLETED-标检完成) "
>
<
el
-
radio
-
group
v
-
model
=
"form.status"
>
<
el
-
radio
label
=
"1"
>
请选择字典生成
<
/el-radio
>
<
/el-radio-group
>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"报检部门"
prop
=
"inspectionDep"
>
<
el
-
input
v
-
model
=
"form.inspectionDep"
placeholder
=
"请输入报检部门"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"删除标志,默认0,删除1"
prop
=
"deleteFlag"
>
<
el
-
input
v
-
model
=
"form.deleteFlag"
placeholder
=
"请输入删除标志,默认0,删除1"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"物料名称"
prop
=
"materialName"
>
<
el
-
input
v
-
model
=
"form.materialName"
placeholder
=
"请输入物料名称"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"物料代码"
prop
=
"materialCode"
>
<
el
-
input
v
-
model
=
"form.materialCode"
placeholder
=
"请输入物料代码"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"规格型号"
prop
=
"specification"
>
<
el
-
input
v
-
model
=
"form.specification"
type
=
"textarea"
placeholder
=
"请输入内容"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"领料数量"
prop
=
"issuedNum"
>
<
el
-
input
v
-
model
=
"form.issuedNum"
placeholder
=
"请输入领料数量"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"申请数量"
prop
=
"quantity"
>
<
el
-
input
v
-
model
=
"form.quantity"
placeholder
=
"请输入申请数量"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"合格数量"
prop
=
"qualifiedNum"
>
<
el
-
input
v
-
model
=
"form.qualifiedNum"
placeholder
=
"请输入合格数量"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"不合格数量"
prop
=
"unQualifiedNum"
>
<
el
-
input
v
-
model
=
"form.unQualifiedNum"
placeholder
=
"请输入不合格数量"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"老化时长"
prop
=
"agingDuration"
>
<
el
-
input
v
-
model
=
"form.agingDuration"
placeholder
=
"请输入老化时长"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"标定气体"
prop
=
"calibrationGas"
>
<
el
-
input
v
-
model
=
"form.calibrationGas"
placeholder
=
"请输入标定气体"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"报警值"
prop
=
"alarmValue"
>
<
el
-
input
v
-
model
=
"form.alarmValue"
placeholder
=
"请输入报警值"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"量程"
prop
=
"range"
>
<
el
-
input
v
-
model
=
"form.range"
placeholder
=
"请输入量程"
/>
<
/el-form-item
>
<
/el-form
>
<
div
slot
=
"footer"
class
=
"dialog-footer"
>
<
el
-
button
type
=
"primary"
@
click
=
"submitForm"
>
确
定
<
/el-button
>
<
el
-
button
@
click
=
"cancel"
>
取
消
<
/el-button
>
<
/div
>
<
/el-dialog
>
<
/div
>
<
/template
>
<
script
>
import
{
listInspection
,
getInspection
,
delInspection
,
addInspection
,
updateInspection
,
exportInspection
,
syncMESData
}
from
"@/api/system/standardInspection"
;
export
default
{
name
:
"Inspection"
,
components
:
{
}
,
data
()
{
return
{
// 遮罩层
loading
:
true
,
// 导出遮罩层
exportLoading
:
false
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
total
:
0
,
// 产品主体标检单表格数据
inspectionList
:
[],
// 弹出层标题
title
:
""
,
// 是否显示弹出层
open
:
false
,
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
outStoreOrderNumber
:
null
,
productStandardInspectionNumber
:
null
,
confirmQualityInspector
:
null
,
remarks
:
null
,
status
:
null
,
createBy
:
null
,
inspectionDep
:
null
,
createTime
:
null
,
deleteFlag
:
null
,
materialName
:
null
,
materialCode
:
null
,
specification
:
null
,
issuedNum
:
null
,
quantity
:
null
,
qualifiedNum
:
null
,
unQualifiedNum
:
null
,
agingDuration
:
null
,
calibrationGas
:
null
,
alarmValue
:
null
,
range
:
null
}
,
// 表单参数
form
:
{
}
,
// 表单校验
rules
:
{
productStandardInspectionNumber
:
[
{
required
:
true
,
message
:
"主体标检单号不能为空"
,
trigger
:
"blur"
}
],
}
}
;
}
,
created
()
{
this
.
getList
();
}
,
methods
:
{
/** 查询产品主体标检单列表 */
getList
()
{
this
.
loading
=
true
;
listInspection
(
this
.
queryParams
).
then
(
response
=>
{
this
.
inspectionList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
}
);
}
,
// 取消按钮
cancel
()
{
this
.
open
=
false
;
this
.
reset
();
}
,
// 表单重置
reset
()
{
this
.
form
=
{
productStandardInspectionId
:
null
,
outStoreOrderNumber
:
null
,
productStandardInspectionNumber
:
null
,
confirmQualityInspector
:
null
,
remarks
:
null
,
status
:
"0"
,
createBy
:
null
,
inspectionDep
:
null
,
createTime
:
null
,
deleteFlag
:
null
,
materialName
:
null
,
materialCode
:
null
,
specification
:
null
,
issuedNum
:
null
,
quantity
:
null
,
qualifiedNum
:
null
,
unQualifiedNum
:
null
,
agingDuration
:
null
,
calibrationGas
:
null
,
alarmValue
:
null
,
range
:
null
}
;
this
.
resetForm
(
"form"
);
}
,
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
}
,
/** 重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
"queryForm"
);
this
.
handleQuery
();
}
,
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
productStandardInspectionId
)
this
.
single
=
selection
.
length
!==
1
this
.
multiple
=
!
selection
.
length
}
,
/** 新增按钮操作 */
handleAdd
()
{
this
.
reset
();
this
.
open
=
true
;
this
.
title
=
"添加产品主体标检单"
;
}
,
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
();
const
productStandardInspectionId
=
row
.
productStandardInspectionId
||
this
.
ids
getInspection
(
productStandardInspectionId
).
then
(
response
=>
{
this
.
form
=
response
.
data
;
this
.
open
=
true
;
this
.
title
=
"修改产品主体标检单"
;
}
);
}
,
/** 提交按钮 */
submitForm
()
{
this
.
$refs
[
"form"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
form
.
productStandardInspectionId
!=
null
)
{
updateInspection
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
"修改成功"
);
this
.
open
=
false
;
this
.
getList
();
}
);
}
else
{
addInspection
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
"新增成功"
);
this
.
open
=
false
;
this
.
getList
();
}
);
}
}
}
);
}
,
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
productStandardInspectionIds
=
row
.
productStandardInspectionId
||
this
.
ids
;
this
.
$confirm
(
'是否确认删除产品主体标检单编号为"'
+
productStandardInspectionIds
+
'"的数据项?'
,
"警告"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
}
).
then
(
function
()
{
return
delInspection
(
productStandardInspectionIds
);
}
).
then
(()
=>
{
this
.
getList
();
this
.
msgSuccess
(
"删除成功"
);
}
).
catch
(()
=>
{
}
);
}
,
handleSyncMESData
()
{
this
.
$confirm
(
'是否确认同步MES数据项?'
,
"警告"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
}
).
then
(()
=>
{
this
.
exportLoading
=
true
;
return
syncMESData
();
}
).
then
(
response
=>
{
this
.
msgSuccess
(
"同步成功"
);
this
.
exportLoading
=
false
;
this
.
getList
();
}
).
catch
(()
=>
{
}
);
}
,
/** 导出按钮操作 */
handleExport
()
{
const
queryParams
=
this
.
queryParams
;
this
.
$confirm
(
'是否确认导出所有产品主体标检单数据项?'
,
"警告"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
}
).
then
(()
=>
{
this
.
exportLoading
=
true
;
return
exportInspection
(
queryParams
);
}
).
then
(
response
=>
{
this
.
download
(
response
.
msg
);
this
.
exportLoading
=
false
;
}
).
catch
(()
=>
{
}
);
}
}
}
;
<
/script
>
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