Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit b2454623
由
LN
编写于
2023-03-27 09:39:33 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
盘点导出功能修改
1 个父辈
a43c781e
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
52 行增加
和
0 行删除
src/main/java/com/neotel/smfcore/core/selfAudit/rest/SelfAuditController.java
src/main/java/com/neotel/smfcore/core/selfAudit/rest/SelfAuditController.java
查看文件 @
b245462
...
...
@@ -2,12 +2,15 @@ package com.neotel.smfcore.core.selfAudit.rest;
import
cn.hutool.core.util.ObjectUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.google.common.collect.Lists
;
import
com.neotel.smfcore.common.bean.PageData
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.Constants
;
import
com.neotel.smfcore.common.utils.FileUtil
;
import
com.neotel.smfcore.common.utils.QueryHelp
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.language.util.MessageUtils
;
import
com.neotel.smfcore.core.selfAudit.enums.SELFAUDIT_STATUS
;
import
com.neotel.smfcore.core.selfAudit.rest.dto.SelfAuditDto
;
import
com.neotel.smfcore.core.selfAudit.rest.dto.SelfAuditItemDto
;
...
...
@@ -21,6 +24,7 @@ import com.neotel.smfcore.core.selfAudit.util.SelfAuditUtil;
import
com.neotel.smfcore.core.storage.service.manager.IStoragePosManager
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.RequiredArgsConstructor
;
...
...
@@ -32,8 +36,12 @@ import org.springframework.data.mongodb.core.query.Query;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Locale
;
import
java.util.Map
;
@Slf4j
...
...
@@ -243,4 +251,48 @@ public class SelfAuditController {
dto
.
setItems
(
dtos
);
return
dto
;
}
@ApiOperation
(
"下载盘点详情"
)
@RequestMapping
(
"/detial/download"
)
@AnonymousAccess
public
void
detialDownload
(
@RequestParam
(
required
=
false
)
String
id
,
@RequestParam
(
required
=
false
)
String
batchNo
,
HttpServletResponse
response
,
HttpServletRequest
request
)
throws
IOException
{
SelfAudit
selfAudit
=
null
;
if
(!
ObjectUtils
.
isEmpty
(
id
))
{
selfAudit
=
selfAuditManager
.
get
(
id
);
}
else
if
(!
ObjectUtils
.
isEmpty
(
batchNo
))
{
selfAudit
=
selfAuditManager
.
findByBatchNo
(
batchNo
);
}
if
(
selfAudit
!=
null
)
{
List
<
List
<
String
>>
header
=
new
ArrayList
<>();
Locale
locale
=
request
.
getLocale
();
header
.
add
(
Lists
.
newArrayList
(
MessageUtils
.
getSmfClientMsg
(
"smfclient.Storage.rackCid"
,
locale
,
"CID"
)));
header
.
add
(
Lists
.
newArrayList
(
MessageUtils
.
getSmfClientMsg
(
"smfclient.storagePos.locationNo"
,
locale
,
"库位号"
)));
header
.
add
(
Lists
.
newArrayList
(
MessageUtils
.
getSmfClientMsg
(
"smfclient.selfAudit.invenBarcode"
,
locale
,
"库存条码"
)));
header
.
add
(
Lists
.
newArrayList
(
MessageUtils
.
getSmfClientMsg
(
"smfclient.selfAudit.actualBarcode"
,
locale
,
"实际条码"
)));
header
.
add
(
Lists
.
newArrayList
(
MessageUtils
.
getSmfClientMsg
(
"smfclient.selfAudit.result"
,
locale
,
"结果"
)));
List
<
List
<
Object
>>
dataList
=
new
ArrayList
<>();
for
(
SelfAuditItem
item
:
selfAudit
.
getItems
())
{
List
<
Object
>
data
=
new
ArrayList
<>();
data
.
add
(
item
.
getCid
());
data
.
add
(
item
.
getPosName
());
data
.
add
(
item
.
getBarcode
());
data
.
add
(
item
.
getActualBarcode
());
String
result
=
""
;
if
(
item
.
getItemStatus
()==
2
){
if
(
item
.
getBarcode
().
equals
(
item
.
getActualBarcode
())){
result
=
"YES"
;
}
else
{
result
=
"NO"
;
}
}
data
.
add
(
result
);
dataList
.
add
(
data
);
}
FileUtil
.
downloadExcel
(
selfAudit
.
getBatchNo
(),
header
,
dataList
,
response
);
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论