Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit d8d990b9
由
LN
编写于
2025-10-31 15:28:23 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
点料历史上传修改
1 个父辈
284906eb
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
24 行增加
和
20 行删除
src/main/java/com/neotel/smfcore/core/xRay/rest/XrayDataController.java
src/main/java/com/neotel/smfcore/core/xRay/rest/dto/CountingHistoryDto.java
src/main/java/com/neotel/smfcore/core/xRay/service/po/CountingHistory.java
src/main/java/com/neotel/smfcore/core/xRay/rest/XrayDataController.java
查看文件 @
d8d990b
...
@@ -5,6 +5,7 @@ import com.neotel.smfcore.common.base.IExcelDownLoad;
...
@@ -5,6 +5,7 @@ import com.neotel.smfcore.common.base.IExcelDownLoad;
import
com.neotel.smfcore.common.bean.PageData
;
import
com.neotel.smfcore.common.bean.PageData
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.utils.FileUtil
;
import
com.neotel.smfcore.common.utils.FileUtil
;
import
com.neotel.smfcore.common.utils.JsonUtil
;
import
com.neotel.smfcore.common.utils.QueryHelp
;
import
com.neotel.smfcore.common.utils.QueryHelp
;
import
com.neotel.smfcore.core.language.util.MessageUtils
;
import
com.neotel.smfcore.core.language.util.MessageUtils
;
import
com.neotel.smfcore.core.xRay.rest.dto.CountingHistoryDto
;
import
com.neotel.smfcore.core.xRay.rest.dto.CountingHistoryDto
;
...
@@ -33,7 +34,7 @@ import java.util.*;
...
@@ -33,7 +34,7 @@ import java.util.*;
@Slf4j
@Slf4j
@RestController
@RestController
@RequestMapping
(
"service/
equipment/
xRayData"
)
@RequestMapping
(
"service/xRayData"
)
public
class
XrayDataController
{
public
class
XrayDataController
{
@Autowired
@Autowired
...
@@ -49,36 +50,36 @@ public class XrayDataController {
...
@@ -49,36 +50,36 @@ public class XrayDataController {
Object
value
=
paramsMap
.
get
(
"data"
);
Object
value
=
paramsMap
.
get
(
"data"
);
List
<
CountingHistory
>
entities
=
new
ArrayList
<>();
List
<
CountingHistory
>
entities
=
new
ArrayList
<>();
ObjectMapper
mapper
=
new
ObjectMapper
();
try
{
try
{
if
(
value
instanceof
List
)
{
if
(
value
instanceof
List
)
{
List
<?>
rawList
=
(
List
<?>)
value
;
List
<?>
rawList
=
(
List
<?>)
value
;
for
(
Object
item
:
rawList
)
{
for
(
Object
item
:
rawList
)
{
CountingHistory
Dto
dto
=
mapper
.
convertValue
(
item
,
CountingHistoryDto
.
class
);
CountingHistory
dto
=
JsonUtil
.
toObj
(
item
.
toString
(),
CountingHistory
.
class
);
entities
.
add
(
countingHistoryMapper
.
toEntity
(
dto
)
);
entities
.
add
(
dto
);
}
}
}
else
if
(
value
instanceof
String
)
{
}
else
if
(
value
instanceof
String
)
{
String
json
=
(
String
)
value
;
String
json
=
(
String
)
value
;
List
<
CountingHistory
Dto
>
dtos
=
mapper
.
readValue
(
json
,
new
TypeReference
<
List
<
CountingHistoryDto
>>()
{}
);
List
<
CountingHistory
>
dtos
=
JsonUtil
.
toList
(
json
,
CountingHistory
.
class
);
for
(
CountingHistory
Dto
dto
:
dtos
)
{
for
(
CountingHistory
dto
:
dtos
)
{
entities
.
add
(
countingHistoryMapper
.
toEntity
(
dto
)
);
entities
.
add
(
dto
);
}
}
}
else
{
}
else
{
log
.
warn
(
"Unsupported data payload type: {}"
,
value
==
null
?
"null"
:
value
.
getClass
().
getName
());
log
.
warn
(
"Unsupported data payload type: {}"
,
value
==
null
?
"null"
:
value
.
getClass
().
getName
());
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"Failed to parse data payload: {}"
,
e
.
getMessage
());
log
.
error
(
"Failed to parse data payload: {}"
,
e
.
getMessage
());
return
ResultBean
.
new
OkResult
(
new
ArrayList
<>
());
return
ResultBean
.
new
ErrorResult
(
99
,
""
,
e
.
getMessage
());
}
}
List
<
String
>
successUids
=
countingHistoryManager
.
upsertByUid
(
entities
);
List
<
String
>
successUids
=
countingHistoryManager
.
upsertByUid
(
entities
);
log
.
info
(
"uploadCountingHistory 收到"
+
entities
.
size
()+
"条数据,新增成功"
+
successUids
.
size
()+
"条: "
+
String
.
join
(
","
,
successUids
));
return
ResultBean
.
newOkResult
(
successUids
);
return
ResultBean
.
newOkResult
(
successUids
);
}
}
@ApiOperation
(
"查询点料结果"
)
@ApiOperation
(
"查询点料结果"
)
@GetMapping
@GetMapping
(
value
=
"/list"
)
@PreAuthorize
(
"@el.check('xRayData:list')"
)
@PreAuthorize
(
"@el.check('xRayData:list')"
)
public
PageData
<
CountingHistoryDto
>
query
(
CountingHistoryQueryCriteria
criteria
,
Pageable
pageable
){
public
PageData
<
CountingHistoryDto
>
list
(
CountingHistoryQueryCriteria
criteria
,
Pageable
pageable
){
Query
query
=
QueryHelp
.
getQuery
(
criteria
);
Query
query
=
QueryHelp
.
getQuery
(
criteria
);
PageData
<
CountingHistory
>
pages
=
countingHistoryManager
.
findByPage
(
query
,
pageable
);
PageData
<
CountingHistory
>
pages
=
countingHistoryManager
.
findByPage
(
query
,
pageable
);
List
<
CountingHistoryDto
>
countingHistoryDtos
=
countingHistoryMapper
.
toDto
(
pages
.
getContent
());
List
<
CountingHistoryDto
>
countingHistoryDtos
=
countingHistoryMapper
.
toDto
(
pages
.
getContent
());
...
@@ -89,7 +90,7 @@ public class XrayDataController {
...
@@ -89,7 +90,7 @@ public class XrayDataController {
@ApiOperation
(
"导出点料列表"
)
@ApiOperation
(
"导出点料列表"
)
@GetMapping
(
value
=
"/download"
)
@GetMapping
(
value
=
"/download"
)
@PreAuthorize
(
"@el.check('xRayData:download')"
)
@PreAuthorize
(
"@el.check('xRayData:download')"
)
public
void
inventoryD
ownload
(
HttpServletRequest
request
,
HttpServletResponse
response
,
CountingHistoryQueryCriteria
criteria
,
Pageable
pageable
)
throws
IOException
{
public
void
d
ownload
(
HttpServletRequest
request
,
HttpServletResponse
response
,
CountingHistoryQueryCriteria
criteria
,
Pageable
pageable
)
throws
IOException
{
Query
query
=
QueryHelp
.
getQuery
(
criteria
);
Query
query
=
QueryHelp
.
getQuery
(
criteria
);
FileUtil
.
downloadExcel
(
query
,
pageable
,
response
,
new
IExcelDownLoad
()
{
FileUtil
.
downloadExcel
(
query
,
pageable
,
response
,
new
IExcelDownLoad
()
{
...
@@ -110,7 +111,7 @@ public class XrayDataController {
...
@@ -110,7 +111,7 @@ public class XrayDataController {
header
.
add
(
Lists
.
newArrayList
(
MessageUtils
.
getText
(
"smfcore.xray.countingHistory.tdBarcode"
,
locale
,
"条码"
)));
header
.
add
(
Lists
.
newArrayList
(
MessageUtils
.
getText
(
"smfcore.xray.countingHistory.tdBarcode"
,
locale
,
"条码"
)));
header
.
add
(
Lists
.
newArrayList
(
MessageUtils
.
getText
(
"smfcore.xray.countingHistory.xRayFile"
,
locale
,
"图片文件名"
)));
header
.
add
(
Lists
.
newArrayList
(
MessageUtils
.
getText
(
"smfcore.xray.countingHistory.xRayFile"
,
locale
,
"图片文件名"
)));
header
.
add
(
Lists
.
newArrayList
(
MessageUtils
.
getText
(
"smfcore.xray.countingHistory.resultFile"
,
locale
,
"结果文件名"
)));
header
.
add
(
Lists
.
newArrayList
(
MessageUtils
.
getText
(
"smfcore.xray.countingHistory.resultFile"
,
locale
,
"结果文件名"
)));
header
.
add
(
Lists
.
newArrayList
(
MessageUtils
.
getText
(
"smfcore.xray.countingHistory.uploadOk"
,
locale
,
"是否上传完成"
)));
//
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.xray.countingHistory.uploadOk", locale, "是否上传完成")));
header
.
add
(
Lists
.
newArrayList
(
MessageUtils
.
getText
(
"smfcore.xray.countingHistory.countingTime"
,
locale
,
"点料时间"
)));
header
.
add
(
Lists
.
newArrayList
(
MessageUtils
.
getText
(
"smfcore.xray.countingHistory.countingTime"
,
locale
,
"点料时间"
)));
header
.
add
(
Lists
.
newArrayList
(
MessageUtils
.
getText
(
"smfcore.common.createDate"
,
locale
,
"创建时间"
)));
header
.
add
(
Lists
.
newArrayList
(
MessageUtils
.
getText
(
"smfcore.common.createDate"
,
locale
,
"创建时间"
)));
header
.
add
(
Lists
.
newArrayList
(
MessageUtils
.
getText
(
"smfcore.common.updateDate"
,
locale
,
"更新时间"
)));
header
.
add
(
Lists
.
newArrayList
(
MessageUtils
.
getText
(
"smfcore.common.updateDate"
,
locale
,
"更新时间"
)));
...
@@ -143,7 +144,7 @@ public class XrayDataController {
...
@@ -143,7 +144,7 @@ public class XrayDataController {
row
.
add
(
item
.
getTdBarcode
());
row
.
add
(
item
.
getTdBarcode
());
row
.
add
(
item
.
getXRayFile
());
row
.
add
(
item
.
getXRayFile
());
row
.
add
(
item
.
getResultFile
());
row
.
add
(
item
.
getResultFile
());
row
.
add
(
item
.
getUploadOk
());
//
row.add(item.getUploadOk());
row
.
add
(
countingTime
);
row
.
add
(
countingTime
);
row
.
add
(
createDate
);
row
.
add
(
createDate
);
row
.
add
(
updateDate
);
row
.
add
(
updateDate
);
...
...
src/main/java/com/neotel/smfcore/core/xRay/rest/dto/CountingHistoryDto.java
查看文件 @
d8d990b
...
@@ -18,7 +18,7 @@ public class CountingHistoryDto {
...
@@ -18,7 +18,7 @@ public class CountingHistoryDto {
private
String
ri
=
""
;
private
String
ri
=
""
;
@ApiModelProperty
(
"是否为不良品的标识 "
)
@ApiModelProperty
(
"是否为不良品的标识 "
)
private
boolean
isNG
=
false
;
private
boolean
ng
=
false
;
@ApiModelProperty
(
"不良品信息 "
)
@ApiModelProperty
(
"不良品信息 "
)
private
String
ngMsg
=
""
;
private
String
ngMsg
=
""
;
...
...
src/main/java/com/neotel/smfcore/core/xRay/service/po/CountingHistory.java
查看文件 @
d8d990b
package
com
.
neotel
.
smfcore
.
core
.
xRay
.
service
.
po
;
package
com
.
neotel
.
smfcore
.
core
.
xRay
.
service
.
po
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateTime
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.neotel.smfcore.common.base.BasePo
;
import
com.neotel.smfcore.common.base.BasePo
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -8,6 +9,7 @@ import lombok.NoArgsConstructor;
...
@@ -8,6 +9,7 @@ import lombok.NoArgsConstructor;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.Date
;
@Data
@Data
@Document
@Document
...
@@ -73,13 +75,14 @@ public class CountingHistory extends BasePo implements Serializable {
...
@@ -73,13 +75,14 @@ public class CountingHistory extends BasePo implements Serializable {
* 结果文件路径或相关标识
* 结果文件路径或相关标识
*/
*/
private
String
resultFile
;
private
String
resultFile
;
//
/**
//
/**
* 是否上传到smf完成,1=完成,0=未完成
//
* 是否上传到smf完成,1=完成,0=未完成
*/
//
*/
private
int
uploadOk
=
0
;
//
private int uploadOk = 0;
/**
/**
* 点料时间
* 点料时间
*/
*/
private
DateTime
countingTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
// 时区根据实际情况调整
private
Date
countingTime
;
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论