Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
warehouse
概览
Overview
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
苗卫卫
warehouse
Commits
dff9ea74
提交
dff9ea74
authored
1月 26, 2024
作者:
李超杰
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
解決报错
父级
71713af9
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
23 行增加
和
16 行删除
+23
-16
src/main/java/com/boco/nbd/wios/export/impl/WallBoxExport.java
+8
-10
src/main/java/com/boco/nbd/wios/manage/controller/WallboxApplyController.java
+13
-6
src/main/resources/application.yml
+2
-0
没有找到文件。
src/main/java/com/boco/nbd/wios/export/impl/WallBoxExport.java
查看文件 @
dff9ea74
package
com
.
boco
.
nbd
.
wios
.
export
.
impl
;
package
com
.
boco
.
nbd
.
wios
.
export
.
impl
;
import
com.boco.nbd.wios.export.Export
;
import
com.boco.nbd.wios.export.Export
;
import
com.boco.nbd.wios.manage.convert.WallboxApplyConvert
;
import
com.boco.nbd.wios.manage.entity.bo.SupplierBo
;
import
com.boco.nbd.wios.manage.entity.bo.SupplierVo
;
import
com.boco.nbd.wios.manage.entity.bo.WallboxApply
;
import
com.boco.nbd.wios.manage.entity.bo.WallboxApply
;
import
com.boco.nbd.wios.manage.entity.cams.enums.OrderStatus
;
import
com.boco.nbd.wios.manage.entity.cams.enums.OrderStatus
;
import
com.boco.nbd.wios.manage.entity.vo.WallboxApplyInstallListVO
;
import
com.boco.nbd.wios.manage.entity.vo.WallboxApplyInstallListVO
;
import
com.boco.nbd.wios.manage.entity.vo.WallboxApplyReqVO
;
import
com.boco.nbd.wios.manage.entity.vo.WallboxApplyReqVO
;
import
com.boco.nbd.wios.manage.mapper.def.WallboxApplyMapper
;
import
com.boco.nbd.wios.manage.mapper.def.WallboxApplyMapper
;
import
com.boco.nbd.wios.manage.service.impl.SupplierService
;
import
com.boco.nbd.wios.manage.service.impl.WallboxApplyService
;
import
com.boco.nbd.wios.manage.service.impl.WallboxApplyService
;
import
com.fasterxml.jackson.databind.DeserializationFeature
;
import
com.fasterxml.jackson.databind.DeserializationFeature
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
...
@@ -25,9 +22,8 @@ import java.util.List;
...
@@ -25,9 +22,8 @@ import java.util.List;
/**
/**
* 辅材导出WallboxApplyInstallListVO
* 辅材导出WallboxApplyInstallListVO
*
*
* @author
* @author
* @version
*/
*/
@Service
@Service
public
class
WallBoxExport
implements
Export
<
WallboxApplyInstallListVO
>
{
public
class
WallBoxExport
implements
Export
<
WallboxApplyInstallListVO
>
{
...
@@ -36,13 +32,15 @@ public class WallBoxExport implements Export<WallboxApplyInstallListVO> {
...
@@ -36,13 +32,15 @@ public class WallBoxExport implements Export<WallboxApplyInstallListVO> {
private
WallboxApplyMapper
wallboxApplyMapper
;
private
WallboxApplyMapper
wallboxApplyMapper
;
@Autowired
@Autowired
private
WallboxApplyService
wallboxApplyService
;
private
WallboxApplyService
wallboxApplyService
;
@Override
@Override
public
List
<
WallboxApplyInstallListVO
>
getExportList
(
String
json
)
throws
Exception
{
public
List
<
WallboxApplyInstallListVO
>
getExportList
(
String
json
)
throws
Exception
{
ObjectMapper
mapper
=
new
ObjectMapper
();
ObjectMapper
mapper
=
new
ObjectMapper
();
mapper
.
configure
(
DeserializationFeature
.
FAIL_ON_UNKNOWN_PROPERTIES
,
false
);
mapper
.
configure
(
DeserializationFeature
.
FAIL_ON_UNKNOWN_PROPERTIES
,
false
);
WallboxApplyReqVO
condition
=
mapper
.
readValue
(
json
,
WallboxApplyReqVO
.
class
);
WallboxApplyReqVO
condition
=
mapper
.
readValue
(
json
,
WallboxApplyReqVO
.
class
);
List
<
WallboxApplyInstallListVO
>
list
=
wallboxApplyService
.
selectWallboxApplyListFromOrder
(
WallboxApplyConvert
.
INSTANCE
.
convert
(
condition
));
WallboxApply
wallboxApply
=
new
WallboxApply
();
BeanUtils
.
copyProperties
(
condition
,
wallboxApply
);
List
<
WallboxApplyInstallListVO
>
list
=
wallboxApplyService
.
selectWallboxApplyListFromOrder
(
wallboxApply
);
LocalDateTime
currentTime
=
LocalDateTime
.
now
();
LocalDateTime
currentTime
=
LocalDateTime
.
now
();
Long
no
=
1L
;
Long
no
=
1L
;
for
(
WallboxApplyInstallListVO
apply
:
list
)
{
for
(
WallboxApplyInstallListVO
apply
:
list
)
{
...
@@ -61,11 +59,11 @@ public class WallBoxExport implements Export<WallboxApplyInstallListVO> {
...
@@ -61,11 +59,11 @@ public class WallBoxExport implements Export<WallboxApplyInstallListVO> {
apply
.
setTimeRemaining
(
Long
.
toString
(
remainingHours
));
apply
.
setTimeRemaining
(
Long
.
toString
(
remainingHours
));
apply
.
setId
(
no
++);
apply
.
setId
(
no
++);
apply
.
setNumber
(
"1"
);
apply
.
setNumber
(
"1"
);
if
(!
StringUtils
.
isEmpty
(
apply
.
getInstallStatus
())){
if
(!
StringUtils
.
isEmpty
(
apply
.
getInstallStatus
()))
{
apply
.
setInstallStatusName
(
OrderStatus
.
getText
(
Integer
.
parseInt
(
apply
.
getInstallStatus
())));
apply
.
setInstallStatusName
(
OrderStatus
.
getText
(
Integer
.
parseInt
(
apply
.
getInstallStatus
())));
}
}
}
}
return
list
;
return
list
;
}
}
}
}
src/main/java/com/boco/nbd/wios/manage/controller/WallboxApplyController.java
查看文件 @
dff9ea74
...
@@ -5,7 +5,6 @@ import cn.hutool.core.lang.Assert;
...
@@ -5,7 +5,6 @@ import cn.hutool.core.lang.Assert;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.boco.nbd.wios.manage.client.DepponClient
;
import
com.boco.nbd.wios.manage.client.DepponClient
;
import
com.boco.nbd.wios.manage.convert.WallboxApplyConvert
;
import
com.boco.nbd.wios.manage.entity.bo.Order
;
import
com.boco.nbd.wios.manage.entity.bo.Order
;
import
com.boco.nbd.wios.manage.entity.bo.Supplier
;
import
com.boco.nbd.wios.manage.entity.bo.Supplier
;
import
com.boco.nbd.wios.manage.entity.bo.SupplierStaff
;
import
com.boco.nbd.wios.manage.entity.bo.SupplierStaff
;
...
@@ -22,6 +21,7 @@ import io.swagger.annotations.Api;
...
@@ -22,6 +21,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -65,7 +65,7 @@ public class WallboxApplyController {
...
@@ -65,7 +65,7 @@ public class WallboxApplyController {
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"orderId"
,
value
=
"订单id"
,
dataType
=
"string"
,
paramType
=
"query"
,
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"orderId"
,
value
=
"订单id"
,
dataType
=
"string"
,
paramType
=
"query"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"ifEmergency"
,
value
=
"是否紧急0否,1是"
,
dataType
=
"int"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"ifEmergency"
,
value
=
"是否紧急0否,1是"
,
dataType
=
"int"
,
paramType
=
"query"
,
required
=
true
),})
paramType
=
"query"
,
required
=
true
),})
public
BaseResponse
<
Object
>
applyInstallation
(
String
orderId
,
Integer
ifEmergency
,
String
receiverWarehouseId
)
{
public
BaseResponse
<
Object
>
applyInstallation
(
String
orderId
,
Integer
ifEmergency
,
String
receiverWarehouseId
)
{
Assert
.
notNull
(
orderId
,
"订单id不能为空"
);
Assert
.
notNull
(
orderId
,
"订单id不能为空"
);
Order
order
=
orderService
.
get
(
orderId
);
Order
order
=
orderService
.
get
(
orderId
);
if
(
ObjectUtil
.
isNull
(
order
))
{
if
(
ObjectUtil
.
isNull
(
order
))
{
...
@@ -106,8 +106,10 @@ public class WallboxApplyController {
...
@@ -106,8 +106,10 @@ public class WallboxApplyController {
required
=
true
),
@ApiImplicitParam
(
name
=
"pagecount"
,
value
=
"页码"
,
dataType
=
"int"
,
paramType
=
required
=
true
),
@ApiImplicitParam
(
name
=
"pagecount"
,
value
=
"页码"
,
dataType
=
"int"
,
paramType
=
"query"
,
required
=
true
)})
"query"
,
required
=
true
)})
public
BaseResponse
<
List
<
WallboxApplyInstallListVO
>>
list
(
WallboxApplyReqVO
req
)
{
public
BaseResponse
<
List
<
WallboxApplyInstallListVO
>>
list
(
WallboxApplyReqVO
req
)
{
WallboxApply
wallboxApply
=
new
WallboxApply
();
BeanUtils
.
copyProperties
(
req
,
wallboxApply
);
List
<
WallboxApplyInstallListVO
>
list
=
List
<
WallboxApplyInstallListVO
>
list
=
wallboxApplyService
.
selectWallboxApplyListFromOrder
(
WallboxApplyConvert
.
INSTANCE
.
convert
(
req
)
);
wallboxApplyService
.
selectWallboxApplyListFromOrder
(
wallboxApply
);
LocalDateTime
currentTime
=
LocalDateTime
.
now
();
LocalDateTime
currentTime
=
LocalDateTime
.
now
();
for
(
WallboxApplyInstallListVO
apply
:
list
)
{
for
(
WallboxApplyInstallListVO
apply
:
list
)
{
apply
.
setNumber
(
"1"
);
apply
.
setNumber
(
"1"
);
...
@@ -145,8 +147,10 @@ public class WallboxApplyController {
...
@@ -145,8 +147,10 @@ public class WallboxApplyController {
throw
new
ServiceException
(
"供应商不存在"
);
throw
new
ServiceException
(
"供应商不存在"
);
}
}
req
.
setSupplierId
(
supplier
.
getId
());
req
.
setSupplierId
(
supplier
.
getId
());
WallboxApply
wallboxApply
=
new
WallboxApply
();
BeanUtils
.
copyProperties
(
req
,
wallboxApply
);
List
<
WallboxApplyInstallListVO
>
list
=
List
<
WallboxApplyInstallListVO
>
list
=
wallboxApplyService
.
selectWallboxApplyListFromOrder
(
WallboxApplyConvert
.
INSTANCE
.
convert
(
req
)
);
wallboxApplyService
.
selectWallboxApplyListFromOrder
(
wallboxApply
);
LocalDateTime
currentTime
=
LocalDateTime
.
now
();
LocalDateTime
currentTime
=
LocalDateTime
.
now
();
for
(
WallboxApplyInstallListVO
apply
:
list
)
{
for
(
WallboxApplyInstallListVO
apply
:
list
)
{
Date
createdDate
=
apply
.
getCreatedTime
();
Date
createdDate
=
apply
.
getCreatedTime
();
...
@@ -197,8 +201,10 @@ public class WallboxApplyController {
...
@@ -197,8 +201,10 @@ public class WallboxApplyController {
required
=
true
),
@ApiImplicitParam
(
name
=
"pagecount"
,
value
=
"页码"
,
dataType
=
"int"
,
paramType
=
required
=
true
),
@ApiImplicitParam
(
name
=
"pagecount"
,
value
=
"页码"
,
dataType
=
"int"
,
paramType
=
"query"
,
required
=
true
)})
"query"
,
required
=
true
)})
public
void
export
(
HttpServletResponse
response
,
WallboxApplyReqVO
req
)
throws
IOException
{
public
void
export
(
HttpServletResponse
response
,
WallboxApplyReqVO
req
)
throws
IOException
{
WallboxApply
wallboxApply
=
new
WallboxApply
();
BeanUtils
.
copyProperties
(
req
,
wallboxApply
);
List
<
WallboxApplyInstallListVO
>
list
=
List
<
WallboxApplyInstallListVO
>
list
=
wallboxApplyService
.
selectWallboxApplyListFromOrder
(
WallboxApplyConvert
.
INSTANCE
.
convert
(
req
)
);
wallboxApplyService
.
selectWallboxApplyListFromOrder
(
wallboxApply
);
ExcelUtils
.
write
(
response
,
"墙盒申请数据导出.xls"
,
"墙盒申请数据"
,
WallboxApplyInstallListVO
.
class
,
list
);
ExcelUtils
.
write
(
response
,
"墙盒申请数据导出.xls"
,
"墙盒申请数据"
,
WallboxApplyInstallListVO
.
class
,
list
);
}
}
...
@@ -211,6 +217,7 @@ public class WallboxApplyController {
...
@@ -211,6 +217,7 @@ public class WallboxApplyController {
public
BaseResponse
<
Object
>
getInfo
(
@PathVariable
(
"id"
)
Long
id
)
{
public
BaseResponse
<
Object
>
getInfo
(
@PathVariable
(
"id"
)
Long
id
)
{
return
new
BaseResponse
<>(
wallboxApplyService
.
selectWallboxApplyById
(
id
));
return
new
BaseResponse
<>(
wallboxApplyService
.
selectWallboxApplyById
(
id
));
}
}
/**
/**
* 根据订单号查询详情
* 根据订单号查询详情
*/
*/
...
@@ -266,7 +273,7 @@ public class WallboxApplyController {
...
@@ -266,7 +273,7 @@ public class WallboxApplyController {
@ApiOperation
(
value
=
"查询当前账号所属团队"
)
@ApiOperation
(
value
=
"查询当前账号所属团队"
)
@GetMapping
(
"/getTeamOrder"
)
@GetMapping
(
"/getTeamOrder"
)
public
BaseResponse
<
Object
>
getTeamOrder
()
{
public
BaseResponse
<
Object
>
getTeamOrder
()
{
SessionInfo
loginUser
=
tokenService
.
getUser
();
SessionInfo
loginUser
=
tokenService
.
getUser
();
String
userId
=
loginUser
.
getUserId
();
String
userId
=
loginUser
.
getUserId
();
...
...
src/main/resources/application.yml
查看文件 @
dff9ea74
server
:
server
:
tomcat
:
tomcat
:
uri-encoding
:
UTF-8
uri-encoding
:
UTF-8
servlet
:
context-path
:
/api2
spring
:
spring
:
http
:
http
:
encoding
:
encoding
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论