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
75a647a5
提交
75a647a5
authored
11月 12, 2023
作者:
“chaining”
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: 墙盒申请代码迁移
父级
60e528cd
显示空白字符变更
内嵌
并排
正在显示
24 个修改的文件
包含
1908 行增加
和
0 行删除
+1908
-0
lib/dop-sdk-0.0.1-SNAPSHOT.jar
+0
-0
pom.xml
+41
-0
src/main/java/com/boco/nbd/wios/downloadfile/controller/CreateEntityGroup.java
+4
-0
src/main/java/com/boco/nbd/wios/downloadfile/controller/ImportControllerV2.java
+66
-0
src/main/java/com/boco/nbd/wios/manage/client/DepponClient.java
+27
-0
src/main/java/com/boco/nbd/wios/manage/client/DopInterceptor.java
+76
-0
src/main/java/com/boco/nbd/wios/manage/controller/WallboxApplyController.java
+290
-0
src/main/java/com/boco/nbd/wios/manage/convert/WallboxApplyConvert.java
+31
-0
src/main/java/com/boco/nbd/wios/manage/entity/bo/WallboxApply.java
+91
-0
src/main/java/com/boco/nbd/wios/manage/entity/dto/WallboxApplyBatchCheckDTO.java
+27
-0
src/main/java/com/boco/nbd/wios/manage/entity/dto/WallboxApplyCheckDTO.java
+63
-0
src/main/java/com/boco/nbd/wios/manage/entity/dto/WallboxApplyDetailQueryDTO.java
+17
-0
src/main/java/com/boco/nbd/wios/manage/entity/vo/WallboxApplyCheckVO.java
+32
-0
src/main/java/com/boco/nbd/wios/manage/entity/vo/WallboxApplyDetailVO.java
+71
-0
src/main/java/com/boco/nbd/wios/manage/entity/vo/WallboxApplyExcelVO.java
+45
-0
src/main/java/com/boco/nbd/wios/manage/entity/vo/WallboxApplyInstallInfoVO.java
+95
-0
src/main/java/com/boco/nbd/wios/manage/entity/vo/WallboxApplyInstallListVO.java
+88
-0
src/main/java/com/boco/nbd/wios/manage/entity/vo/WallboxApplyPageVO.java
+77
-0
src/main/java/com/boco/nbd/wios/manage/entity/vo/WallboxApplyReqVO.java
+36
-0
src/main/java/com/boco/nbd/wios/manage/mapper/def/WallboxApplyMapper.java
+96
-0
src/main/java/com/boco/nbd/wios/manage/service/impl/SupplierService.java
+4
-0
src/main/java/com/boco/nbd/wios/manage/service/impl/WallboxApplyService.java
+258
-0
src/main/java/com/boco/nbd/wios/utils/ExcelUtils.java
+47
-0
src/main/resources/mybatis/mapper/def/common/WallboxApplyMapper.xml
+326
-0
没有找到文件。
lib/dop-sdk-0.0.1-SNAPSHOT.jar
0 → 100644
查看文件 @
75a647a5
File added
pom.xml
查看文件 @
75a647a5
...
@@ -16,6 +16,10 @@
...
@@ -16,6 +16,10 @@
<version>
2.0.0
</version>
<version>
2.0.0
</version>
<description>
wios project
</description>
<description>
wios project
</description>
<properties>
<mapstruct.version>
1.5.5.Final
</mapstruct.version>
</properties>
<dependencies>
<dependencies>
<dependency>
<dependency>
<groupId>
com.boco.nbd
</groupId>
<groupId>
com.boco.nbd
</groupId>
...
@@ -116,6 +120,43 @@
...
@@ -116,6 +120,43 @@
<artifactId>
aspose-words
</artifactId>
<artifactId>
aspose-words
</artifactId>
<version>
15.8.0
</version>
<version>
15.8.0
</version>
</dependency>
</dependency>
<dependency>
<groupId>
org.mapstruct
</groupId>
<artifactId>
mapstruct
</artifactId>
<!-- use mapstruct-jdk8 for Java 8 or higher -->
<version>
${mapstruct.version}
</version>
</dependency>
<dependency>
<groupId>
org.mapstruct
</groupId>
<artifactId>
mapstruct-jdk8
</artifactId>
<version>
${mapstruct.version}
</version>
</dependency>
<dependency>
<groupId>
org.mapstruct
</groupId>
<artifactId>
mapstruct-processor
</artifactId>
<version>
${mapstruct.version}
</version>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
easyexcel
</artifactId>
<version>
3.3.2
</version>
</dependency>
<dependency>
<groupId>
com.dtflys.forest
</groupId>
<artifactId>
forest-spring-boot-starter
</artifactId>
<version>
1.5.27
</version>
</dependency>
<dependency>
<groupId>
commons-httpclient
</groupId>
<artifactId>
commons-httpclient
</artifactId>
<version>
3.1
</version>
</dependency>
<dependency>
<groupId>
org.deppon.com
</groupId>
<artifactId>
dop-sdk
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
<scope>
system
</scope>
<systemPath>
${project.basedir}/lib/dop-sdk-0.0.1-SNAPSHOT.jar
</systemPath>
</dependency>
</dependencies>
</dependencies>
...
...
src/main/java/com/boco/nbd/wios/downloadfile/controller/CreateEntityGroup.java
0 → 100644
查看文件 @
75a647a5
package
com
.
boco
.
nbd
.
wios
.
downloadfile
.
controller
;
public
interface
CreateEntityGroup
{
}
src/main/java/com/boco/nbd/wios/downloadfile/controller/ImportControllerV2.java
0 → 100644
查看文件 @
75a647a5
package
com
.
boco
.
nbd
.
wios
.
downloadfile
.
controller
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.boco.nbd.wios.manage.entity.bo.Order
;
import
com.boco.nbd.wios.manage.entity.vo.WallboxApplyExcelVO
;
import
com.boco.nbd.wios.manage.mapper.def.OrderDao
;
import
com.boco.nbd.wios.manage.service.impl.WallboxApplyService
;
import
com.boco.nbd.wios.utils.ExcelUtils
;
import
com.ihidea.component.api.v2.BaseResponse
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.validation.ConstraintViolation
;
import
javax.validation.Validator
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
@RestController
public
class
ImportControllerV2
{
@Autowired
private
Validator
validator
;
@Autowired
private
WallboxApplyService
wallboxApplyService
;
@Autowired
private
OrderDao
orderDao
;
@PostMapping
(
"/wallbox-apply/import"
)
@ApiOperation
(
"导入墙盒申请"
)
public
BaseResponse
<
List
<
WallboxApplyExcelVO
>>
importExcel
(
@RequestParam
(
value
=
"file"
)
MultipartFile
file
)
throws
Exception
{
List
<
WallboxApplyExcelVO
>
list
=
ExcelUtils
.
read
(
file
,
WallboxApplyExcelVO
.
class
);
for
(
WallboxApplyExcelVO
vo
:
list
)
{
Set
<
ConstraintViolation
<
WallboxApplyExcelVO
>>
violations
=
validator
.
validate
(
vo
,
CreateEntityGroup
.
class
);
if
(!
violations
.
isEmpty
())
{
String
errorMessage
=
violations
.
stream
()
.
map
(
ConstraintViolation:
:
getMessage
)
.
collect
(
Collectors
.
joining
(
";"
));
vo
.
setErrorMessage
(
errorMessage
);
}
if
(
StringUtils
.
isNotBlank
(
vo
.
getOrderId
())){
Order
order
=
orderDao
.
selectById
(
vo
.
getOrderId
());
if
(
ObjectUtil
.
isNull
(
order
))
{
vo
.
setErrorMessage
(
"不存在安装订单号"
);
}
if
(
ObjectUtil
.
isNotNull
(
order
))
{
vo
.
setWallboxModel
(
order
.
getWallboxModel
());
}
if
(
ObjectUtil
.
isNotNull
(
wallboxApplyService
.
selectWallboxDetail
(
vo
.
getOrderId
())))
{
vo
.
setErrorMessage
(
"重复订单申请"
);
}
}
}
return
new
BaseResponse
<>(
list
);
}
}
src/main/java/com/boco/nbd/wios/manage/client/DepponClient.java
0 → 100644
查看文件 @
75a647a5
package
com
.
boco
.
nbd
.
wios
.
manage
.
client
;
import
com.dtflys.forest.annotation.BaseRequest
;
import
com.dtflys.forest.annotation.Body
;
import
com.dtflys.forest.annotation.Post
;
import
java.util.Map
;
/**
* <p>
* 德邦物流clinet,注意入参使用Map或者对象实体
* <p>
*
* @author <a href="mail to: ning.chai@foxmail.com" rel="nofollow">chaining</a>
*/
@BaseRequest
(
baseURL
=
"http://dpsanbox.deppon.com/sandbox-web/standard-order/"
,
interceptor
=
DopInterceptor
.
class
)
public
interface
DepponClient
{
/**
* 新标准轨迹查询
* http://dop.deppon.com/#/wantAccess/myApiConfig
* @param {"mailNo":"7503587254"}
* @return 字符串
*/
@Post
(
"newTraceQuery.action"
)
String
newTraceQuery
(
@Body
(
"params"
)
Map
<
String
,
Object
>
params
);
}
src/main/java/com/boco/nbd/wios/manage/client/DopInterceptor.java
0 → 100644
查看文件 @
75a647a5
package
com
.
boco
.
nbd
.
wios
.
manage
.
client
;
import
com.deppon.dop.module.sdk.shared.util.FastJsonUtil
;
import
com.deppon.dop.module.sdk.shared.util.SecurityUtil
;
import
com.dtflys.forest.exceptions.ForestRuntimeException
;
import
com.dtflys.forest.http.ForestRequest
;
import
com.dtflys.forest.http.ForestResponse
;
import
com.dtflys.forest.interceptor.Interceptor
;
import
com.dtflys.forest.reflection.ForestMethod
;
import
org.apache.commons.codec.binary.Base64
;
import
org.apache.commons.codec.digest.DigestUtils
;
/**
* <p>
* 德邦物流请求拦截器,实现自动注入companyCode、digest、timestamp参数
* <p>
*
* @author <a href="mail to: ning.chai@foxmail.com" rel="nofollow">chaining</a>
*/
public
class
DopInterceptor
<
T
>
implements
Interceptor
<
T
>
{
private
final
String
companyCode
=
"EWBXRCHSZX"
;
private
final
String
appkey
=
"fe38a755ce4f7629717342e441cdedff"
;
/**
* 该方法在被调用时
*
* @Param request Forest请求对象
* @Param args 方法被调用时传入的参数数组
*/
@Override
public
void
onInvokeMethod
(
ForestRequest
request
,
ForestMethod
method
,
Object
[]
args
)
{
}
@Override
public
boolean
beforeExecute
(
ForestRequest
request
)
{
request
.
addHeader
(
"Content-Type"
,
"application/x-www-form-urlencoded;charset=utf-8"
);
// String params = request.getBody().get(0)+"";
long
timestamp
=
System
.
currentTimeMillis
();
String
params
=
FastJsonUtil
.
toJSONString
(
request
.
getBody
().
getNameValueBody
(
"params"
).
getValue
());
String
digest
=
SecurityUtil
.
getStandardDigest
(
params
+
appkey
+
timestamp
);
request
.
addBody
(
"companyCode"
,
companyCode
);
request
.
addBody
(
"digest"
,
digest
);
request
.
addBody
(
"timestamp"
,
timestamp
);
request
.
addBody
(
"params"
,
params
);
return
true
;
}
/**
* 该方法在请求成功响应时被调用
*/
@Override
public
void
onSuccess
(
T
data
,
ForestRequest
req
,
ForestResponse
res
)
{
}
/**
* 该方法在请求发送失败时被调用
*/
@Override
public
void
onError
(
ForestRuntimeException
ex
,
ForestRequest
req
,
ForestResponse
res
)
{
// 执行发送请求失败后处理的代码
int
status
=
res
.
getStatusCode
();
// 获取请求响应状态码
String
content
=
res
.
getContent
();
}
/**
* 该方法在请求发送之后被调用
*/
@Override
public
void
afterExecute
(
ForestRequest
req
,
ForestResponse
res
)
{
}
private
String
getDigest
(
String
plainText
)
{
return
Base64
.
encodeBase64String
(
DigestUtils
.
md5Hex
(
plainText
).
getBytes
());
}
}
src/main/java/com/boco/nbd/wios/manage/controller/WallboxApplyController.java
0 → 100644
查看文件 @
75a647a5
package
com
.
boco
.
nbd
.
wios
.
manage
.
controller
;
import
cn.hutool.core.date.LocalDateTimeUtil
;
import
cn.hutool.core.lang.Assert
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.alibaba.fastjson.JSON
;
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.Supplier
;
import
com.boco.nbd.wios.manage.entity.bo.SupplierStaff
;
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.dto.WallboxApplyBatchCheckDTO
;
import
com.boco.nbd.wios.manage.entity.vo.*
;
import
com.boco.nbd.wios.manage.service.impl.*
;
import
com.boco.nbd.wios.utils.ExcelUtils
;
import
com.ihidea.component.api.v2.BaseResponse
;
import
com.ihidea.core.support.exception.ServiceException
;
import
com.ihidea.core.support.session.SessionInfo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.time.Duration
;
import
java.time.LocalDateTime
;
import
java.time.ZoneId
;
import
java.time.temporal.ChronoUnit
;
import
java.util.*
;
/**
* <p>
* 墙盒申请Controller
* <p>
*
* @author <a href="mail to: ning.chai@foxmail.com" rel="nofollow">chaining</a>
*/
@RestController
@Api
(
tags
=
"墙盒申请接口"
)
@RequestMapping
(
"api/wallbox/apply"
)
public
class
WallboxApplyController
{
@Autowired
private
WallboxApplyService
wallboxApplyService
;
@Autowired
private
OrderService
orderService
;
@Autowired
private
TokenService
tokenService
;
@Autowired
private
SupplierStaffService
supplierStaffService
;
@Autowired
private
SupplierService
supplierService
;
@Resource
private
DepponClient
depponClient
;
@ApiOperation
(
value
=
"墙盒申请"
)
@PostMapping
(
"/add"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"orderId"
,
value
=
"订单id"
,
dataType
=
"string"
,
paramType
=
"query"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"ifEmergency"
,
value
=
"是否紧急0否,1是"
,
dataType
=
"int"
,
paramType
=
"query"
,
required
=
true
),})
public
BaseResponse
<
Object
>
applyInstallation
(
String
orderId
,
Integer
ifEmergency
)
{
Assert
.
notNull
(
orderId
,
"订单id不能为空"
);
Order
order
=
orderService
.
get
(
orderId
);
if
(
ObjectUtil
.
isNull
(
order
))
{
throw
new
ServiceException
(
"订单不存在"
);
}
Integer
status
=
order
.
getStatus
();
// 检查订单状态是否在0-43之间
boolean
allowed
=
status
>=
OrderStatus
.
DISPATCHING
.
getType
()
&&
status
<=
OrderStatus
.
INSTALLING
.
getType
();
// if (!allowed) {
// throw new ServiceException("订单已在安装中,无法申请");
// }
SessionInfo
loginUser
=
tokenService
.
getUser
();
String
userId
=
loginUser
.
getUserId
();
// SupplierStaff infoByAccount = supplierStaffService.getByAccountId(Integer.valueOf(userId));
// Supplier supplier = supplierService.getById(infoByAccount.getSupplierId());
// if (supplier == null) {
// throw new ServiceException("供应商不存在");
// }
WallboxApply
wa
=
new
WallboxApply
();
wa
.
setSupplierId
(
2L
);
wa
.
setSupplierTeam
(
"服务商-万帮云安装"
);
wa
.
setOrderId
(
orderId
);
wa
.
setIfEmergency
(
ifEmergency
);
wa
.
setCreateAccount
(
tokenService
.
getUser
().
getUserId
());
wallboxApplyService
.
insertWallboxApply
(
wa
);
return
new
BaseResponse
<>(
true
);
}
/**
* 查询墙盒申请列表
*/
@GetMapping
(
"/list"
)
@ApiOperation
(
value
=
"分页查询墙盒申请列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"page"
,
value
=
"一页显示数量"
,
dataType
=
"int"
,
paramType
=
"query"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"pagecount"
,
value
=
"页码"
,
dataType
=
"int"
,
paramType
=
"query"
,
required
=
true
)})
public
BaseResponse
<
List
<
WallboxApplyInstallListVO
>>
list
(
WallboxApplyReqVO
req
)
{
List
<
WallboxApplyInstallListVO
>
list
=
wallboxApplyService
.
selectWallboxApplyListFromOrder
(
WallboxApplyConvert
.
INSTANCE
.
convert
(
req
));
LocalDateTime
currentTime
=
LocalDateTime
.
now
();
for
(
WallboxApplyInstallListVO
apply
:
list
)
{
Date
createdDate
=
apply
.
getCreatedTime
();
LocalDateTime
createdTime
=
LocalDateTime
.
ofInstant
(
createdDate
.
toInstant
(),
ZoneId
.
systemDefault
());
LocalDateTime
endTime
=
createdTime
.
plusHours
(
24
);
long
remainingHours
=
currentTime
.
until
(
endTime
,
ChronoUnit
.
HOURS
);
remainingHours
=
Math
.
max
(
remainingHours
,
0
);
// 将剩余小时数限制在0-24之间
if
(
remainingHours
==
0
)
{
apply
.
setIfTimeout
(
1L
);
}
else
{
apply
.
setIfTimeout
(
0L
);
}
apply
.
setTimeRemaining
(
Long
.
toString
(
remainingHours
));
}
return
new
BaseResponse
<>(
list
);
}
@GetMapping
(
"/get-import-template"
)
@ApiOperation
(
"获得导入模板"
)
public
void
importTemplate
(
HttpServletResponse
response
)
throws
IOException
{
// 手动创建导出 demo
WallboxApplyExcelVO
excelDemo
=
new
WallboxApplyExcelVO
();
excelDemo
.
setIfEmergency
(
0
);
excelDemo
.
setOrderId
(
"CA20201204044558"
);
List
<
WallboxApplyExcelVO
>
list
=
Arrays
.
asList
(
excelDemo
);
// 输出
ExcelUtils
.
write
(
response
,
"墙盒申请导入模板.xls"
,
"墙盒申请"
,
WallboxApplyExcelVO
.
class
,
list
);
}
@PostMapping
(
"/import"
)
@ApiOperation
(
"导入墙盒申请"
)
public
BaseResponse
<
WallboxApplyExcelVO
>
importExcel
(
@RequestParam
(
value
=
"file"
)
MultipartFile
file
)
throws
Exception
{
List
<
WallboxApplyExcelVO
>
list
=
ExcelUtils
.
read
(
file
,
WallboxApplyExcelVO
.
class
);
return
new
BaseResponse
<>();
}
/**
* 导出墙盒申请模板
*/
@PostMapping
(
"/export"
)
@ApiOperation
(
"导出墙盒申请"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"page"
,
value
=
"一页显示数量"
,
dataType
=
"int"
,
paramType
=
"query"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"pagecount"
,
value
=
"页码"
,
dataType
=
"int"
,
paramType
=
"query"
,
required
=
true
)})
public
void
export
(
HttpServletResponse
response
,
WallboxApplyReqVO
req
)
throws
IOException
{
List
<
WallboxApplyInstallListVO
>
list
=
wallboxApplyService
.
selectWallboxApplyListFromOrder
(
WallboxApplyConvert
.
INSTANCE
.
convert
(
req
));
ExcelUtils
.
write
(
response
,
"墙盒申请数据导出.xls"
,
"墙盒申请数据"
,
WallboxApplyInstallListVO
.
class
,
list
);
}
/**
* 获取墙盒申请详细信息
*/
@ApiOperation
(
value
=
"获取墙盒详细信息"
)
@GetMapping
(
value
=
"/{id}"
)
public
BaseResponse
<
Object
>
getInfo
(
@PathVariable
(
"id"
)
Long
id
)
{
return
new
BaseResponse
<>(
wallboxApplyService
.
selectWallboxApplyById
(
id
));
}
/**
* 获取墙盒详细信息
*/
@ApiOperation
(
value
=
"墙盒状态"
)
@PostMapping
(
value
=
"/status"
)
public
BaseResponse
<
Object
>
wallboxStatus
(
@RequestParam
(
"orderId"
)
String
orderId
)
{
WallboxApplyDetailVO
rest
=
wallboxApplyService
.
selectWallboxDetail
(
orderId
);
return
new
BaseResponse
<>(
rest
);
}
@ApiOperation
(
value
=
"获取物流信息"
)
@GetMapping
(
value
=
"/trace/{id}"
)
public
BaseResponse
<
Object
>
getTrace
(
@PathVariable
(
"id"
)
String
id
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"mailNo"
,
id
);
return
new
BaseResponse
<>(
JSON
.
parseObject
(
depponClient
.
newTraceQuery
(
paramMap
)));
}
/**
* 新增墙盒申请
*/
@ApiOperation
(
value
=
"批量新增"
)
@PostMapping
public
BaseResponse
<
Object
>
add
(
@RequestBody
List
<
WallboxApply
>
tWallboxApply
)
{
tWallboxApply
.
forEach
(
t
->
{
wallboxApplyService
.
insertWallboxApply
(
t
);
});
return
new
BaseResponse
<>();
}
@ApiOperation
(
value
=
"查询当前账号所属团队"
)
@GetMapping
(
"/get-team"
)
public
BaseResponse
<
Object
>
getTeamInfo
()
{
SessionInfo
loginUser
=
tokenService
.
getUser
();
String
userId
=
loginUser
.
getUserId
();
SupplierStaff
infoByAccount
=
supplierStaffService
.
getByAccountId
(
Integer
.
valueOf
(
userId
));
Supplier
supplier
=
supplierService
.
getById
(
infoByAccount
.
getSupplierId
());
if
(
supplier
==
null
)
{
throw
new
ServiceException
(
"供应商不存在"
);
}
return
new
BaseResponse
<>(
supplier
);
}
/**
* 修改墙盒申请
*/
@PutMapping
public
BaseResponse
<
Object
>
edit
(
@RequestBody
WallboxApply
tWallboxApply
)
{
//TODO 判断是否超时
return
new
BaseResponse
<>(
wallboxApplyService
.
updateWallboxApply
(
tWallboxApply
));
}
@ApiOperation
(
value
=
"申请审核"
)
@PostMapping
(
"/check"
)
public
BaseResponse
<
Object
>
check
(
@RequestBody
@Validated
WallboxApplyCheckVO
req
)
{
wallboxApplyService
.
checkWallboxApply
(
req
);
return
new
BaseResponse
<>();
}
@ApiOperation
(
value
=
"同订单多申请情况"
)
@PostMapping
(
"/unapproved"
)
public
BaseResponse
<
Object
>
hasUnapprovedOrders
(
@RequestBody
@Validated
WallboxApplyCheckVO
req
)
{
WallboxApply
cond
=
new
WallboxApply
();
cond
.
setOrderId
(
req
.
getOrderId
());
long
count
=
wallboxApplyService
.
selectWallboxApplyList
(
cond
).
stream
().
filter
(
l
->
l
.
getCheckStatus
()
==
1
).
count
();
if
(
count
>
0
)
{
throw
new
ServiceException
(
"该安装订单号存在多个申请"
);
}
return
new
BaseResponse
<>();
}
@ApiOperation
(
value
=
"批量申请审核"
)
@PostMapping
(
"/check-batch"
)
public
BaseResponse
<
Object
>
checkBatch
(
@RequestBody
WallboxApplyBatchCheckDTO
req
)
{
return
new
BaseResponse
<>(
wallboxApplyService
.
checkBatch
(
req
));
}
@ApiOperation
(
value
=
"墙盒申请状态统计"
)
@PostMapping
(
"/count"
)
public
BaseResponse
<
Object
>
count
()
{
//查询当前团队的已审批、未审批、已发货、未发货数据
String
currentLogin
=
tokenService
.
getUser
().
getUserId
();
WallboxApply
cond
=
new
WallboxApply
();
cond
.
setCreateAccount
(
currentLogin
);
List
<
WallboxApply
>
list
=
wallboxApplyService
.
selectWallboxApplyList
(
cond
);
// 使用 Lambda 表达式统计每种情况的数据数量
long
unapprovedCount
=
list
.
stream
()
.
filter
(
apply
->
apply
.
getCheckStatus
()
==
1
)
.
count
();
LocalDateTime
currentDateTime
=
LocalDateTime
.
now
();
long
timeoutCount
=
list
.
stream
()
.
filter
(
apply
->
apply
.
getCheckStatus
()
==
1
&&
Duration
.
between
(
LocalDateTimeUtil
.
of
(
apply
.
getCreatedTime
()),
currentDateTime
).
toHours
()
>
24
)
.
count
();
long
awaitingDeliveryCount
=
list
.
stream
()
.
filter
(
apply
->
"0"
.
equals
(
apply
.
getTrackingStatus
()))
.
count
();
long
deliveredCount
=
list
.
stream
()
.
filter
(
apply
->
"1"
.
equals
(
apply
.
getTrackingStatus
()))
.
count
();
Map
<
String
,
Object
>
rest
=
new
HashMap
<>();
rest
.
put
(
"unapprovedCount"
,
unapprovedCount
);
rest
.
put
(
"timeoutCount"
,
timeoutCount
);
rest
.
put
(
"awaitingDeliveryCount"
,
awaitingDeliveryCount
);
rest
.
put
(
"deliveredCount"
,
deliveredCount
);
return
new
BaseResponse
<>(
rest
);
}
}
src/main/java/com/boco/nbd/wios/manage/convert/WallboxApplyConvert.java
0 → 100644
查看文件 @
75a647a5
package
com
.
boco
.
nbd
.
wios
.
manage
.
convert
;
import
com.boco.nbd.wios.manage.entity.bo.WallboxApply
;
import
com.boco.nbd.wios.manage.entity.vo.WallboxApplyInstallInfoVO
;
import
com.boco.nbd.wios.manage.entity.vo.WallboxApplyInstallListVO
;
import
com.boco.nbd.wios.manage.entity.vo.WallboxApplyReqVO
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.factory.Mappers
;
import
java.util.List
;
/**
* <p>
* description
* <p>
*
* @author <a href="mail to: ning.chai@foxmail.com" rel="nofollow">chaining</a>
*/
@Mapper
public
interface
WallboxApplyConvert
{
WallboxApplyConvert
INSTANCE
=
Mappers
.
getMapper
(
WallboxApplyConvert
.
class
);
WallboxApply
convert
(
WallboxApplyReqVO
bean
);
WallboxApplyInstallInfoVO
convert2Info
(
WallboxApply
bean
);
WallboxApplyInstallListVO
convert
(
WallboxApply
bean
);
List
<
WallboxApplyInstallListVO
>
convertList
(
List
<
WallboxApply
>
bean
);
}
src/main/java/com/boco/nbd/wios/manage/entity/bo/WallboxApply.java
0 → 100644
查看文件 @
75a647a5
package
com
.
boco
.
nbd
.
wios
.
manage
.
entity
.
bo
;
import
lombok.Data
;
import
java.util.Date
;
/**
* <p>
* 墙盒申请
* <p>
*
* @author <a href="mail to: ning.chai@foxmail.com" rel="nofollow">chaining</a>
*/
@Data
public
class
WallboxApply
{
/** 自增id */
private
Long
id
;
/** 安装订单号 */
private
String
orderId
;
/** 安装服务商id */
private
Long
supplierId
;
/** 申请团队名称 */
private
String
supplierTeam
;
/** 墙盒设备型号(对应物料id) */
private
String
wallboxItemId
;
/** 墙盒品牌 */
private
String
wallboxModel
;
/** 物料类型 */
private
String
materialType
;
/** 物流单号 */
private
String
trackingNumber
;
/** 物流状态0未发货,1已发货 */
private
String
trackingStatus
;
/** 安装状态 */
private
String
installStatus
;
/** 区域id */
private
String
regionId
;
/** 地址 */
private
String
address
;
/** 车企安装单号 */
private
String
outOrderId
;
/** 是否紧急:0:否,1:是 */
private
Integer
ifEmergency
;
/** 是否超时:0:未超时,1:已超时 */
private
Long
ifTimeout
;
/** 审核人员 */
private
String
checkAccount
;
/** 申请状态:1:已申请,2:已通过,3:已驳回,4:已关闭 */
private
Long
checkStatus
;
/** 审核备注 */
private
String
checkRemarks
;
/** 审核时间 */
private
Date
checkTime
;
/** 预约安装日期 */
private
Date
installReserveTime
;
/** 安装进度 */
private
Long
installProcess
;
/** 创建人 */
private
String
createAccount
;
/** 创建时间 */
private
Date
createdTime
;
/** 更新人 */
private
String
modifyAccount
;
/** 更新时间 */
private
Date
modifyTime
;
}
src/main/java/com/boco/nbd/wios/manage/entity/dto/WallboxApplyBatchCheckDTO.java
0 → 100644
查看文件 @
75a647a5
package
com
.
boco
.
nbd
.
wios
.
manage
.
entity
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
/**
* <p>
* 墙盒申请批量审核
* <p>
*
* @author <a href="mail to: ning.chai@foxmail.com" rel="nofollow">chaining</a>
*/
@Data
public
class
WallboxApplyBatchCheckDTO
{
List
<
WallboxApplyCheckDTO
>
checkList
;
/** 申请状态:0:已申请,1:已通过,2:已驳回,3:已关闭 */
@ApiModelProperty
(
value
=
"申请状态"
,
notes
=
"1:通过,2:驳回"
,
example
=
"1"
,
required
=
true
)
private
Long
checkStatus
;
@ApiModelProperty
(
value
=
"审核备注"
,
required
=
true
)
private
String
checkRemarks
;
}
src/main/java/com/boco/nbd/wios/manage/entity/dto/WallboxApplyCheckDTO.java
0 → 100644
查看文件 @
75a647a5
package
com
.
boco
.
nbd
.
wios
.
manage
.
entity
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* <p>
* 墙盒申请批量审核DTO
* <p>
*
* @author <a href="mail to: ning.chai@foxmail.com" rel="nofollow">chaining</a>
*/
@Data
public
class
WallboxApplyCheckDTO
{
/** 自增id */
private
Long
id
;
/** 安装订单号 */
@ApiModelProperty
(
value
=
"安装订单号"
)
private
String
orderId
;
@ApiModelProperty
(
value
=
"安装状态"
)
private
String
installStatus
;
/** 安装服务商id */
@ApiModelProperty
(
value
=
"安装服务商id"
)
private
String
supplierId
;
/** 申请团队名称 */
@ApiModelProperty
(
value
=
"申请团队名称"
)
private
String
supplierTeam
;
/** 墙盒品牌*/
@ApiModelProperty
(
value
=
"墙盒品牌"
)
private
String
wallboxModel
;
/** 区域id */
@ApiModelProperty
(
value
=
"区域id"
)
private
String
regionId
;
/** 区域id */
@ApiModelProperty
(
value
=
"地址"
)
private
String
address
;
/** 是否紧急:0:否,1:是 */
@ApiModelProperty
(
value
=
"是否特殊申请"
)
private
Integer
ifEmergency
;
/** 申请状态:0:已申请,1:已通过,2:已驳回,3:已关闭 */
@ApiModelProperty
(
value
=
"审核状态"
)
private
Long
checkStatus
;
/**
* 数据状态
*/
private
String
dataStatus
;
/**
* 数据异常信息
*/
private
String
errorMessage
;
}
src/main/java/com/boco/nbd/wios/manage/entity/dto/WallboxApplyDetailQueryDTO.java
0 → 100644
查看文件 @
75a647a5
package
com
.
boco
.
nbd
.
wios
.
manage
.
entity
.
dto
;
import
lombok.Data
;
/**
* <p>
* 墙盒申请状态查询参数
* <p>
*
* @author <a href="mail to: ning.chai@foxmail.com" rel="nofollow">chaining</a>
*/
@Data
public
class
WallboxApplyDetailQueryDTO
{
private
String
orderId
;
private
String
supplierId
;
}
src/main/java/com/boco/nbd/wios/manage/entity/vo/WallboxApplyCheckVO.java
0 → 100644
查看文件 @
75a647a5
package
com
.
boco
.
nbd
.
wios
.
manage
.
entity
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
/**
* <p>
* 墙盒申请审核
* <p>
*
* @author <a href="mail to: ning.chai@foxmail.com" rel="nofollow">chaining</a>
*/
@Data
public
class
WallboxApplyCheckVO
{
@ApiModelProperty
(
value
=
"数据id"
,
notes
=
"不是安装订单号"
,
example
=
"1"
,
required
=
true
)
@NotNull
(
message
=
"id不能为空"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"安装订单号"
,
notes
=
""
,
example
=
"CA20201204044558"
,
required
=
true
)
private
String
orderId
;
/** 申请状态:0:已申请,1:已通过,2:已驳回,3:已关闭 */
@ApiModelProperty
(
value
=
"审核意见"
,
notes
=
"1:通过,2:驳回"
,
example
=
"1"
,
required
=
true
)
@NotNull
(
message
=
"审核意见不能为空"
)
private
Long
checkStatus
;
@ApiModelProperty
(
value
=
"审核备注"
,
notes
=
""
,
example
=
"同意"
,
required
=
true
)
private
String
checkRemarks
;
}
src/main/java/com/boco/nbd/wios/manage/entity/vo/WallboxApplyDetailVO.java
0 → 100644
查看文件 @
75a647a5
package
com
.
boco
.
nbd
.
wios
.
manage
.
entity
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* <p>
* 墙盒申请详情页面
* <p>
*
* @author <a href="mail to: ning.chai@foxmail.com" rel="nofollow">chaining</a>
*/
@Data
public
class
WallboxApplyDetailVO
{
/**
* t_order数据
*/
@ApiModelProperty
(
value
=
"客户姓名"
)
private
String
userName
;
@ApiModelProperty
(
value
=
"联系电话"
)
private
String
userPhone
;
@ApiModelProperty
(
value
=
"安装单号"
)
private
String
orderId
;
@ApiModelProperty
(
value
=
"墙盒设备型号"
)
private
String
itemModel
;
@ApiModelProperty
(
value
=
"墙盒设备编号"
)
private
String
wallboxCode
;
@ApiModelProperty
(
value
=
"墙盒品牌"
)
private
String
wallboxModel
;
/**
* t_wallbox_apply
*/
@ApiModelProperty
(
value
=
"物流单号"
)
private
String
trackingNumber
;
@ApiModelProperty
(
value
=
"物流状态0未发货,1已发货"
)
private
String
trackingStatus
;
@ApiModelProperty
(
value
=
"墙盒是否申请"
)
private
String
checkStatus
;
/**
* t_delivery
*/
@ApiModelProperty
(
value
=
"物流供应商"
)
private
String
logisticCompany
;
/**
* 物流接口
*/
//发货客户名称
private
String
shipperName
;
//发货联系人名称
private
String
contactName
;
//联系人手机
private
String
contactMobile
;
//收货人联系姓名
private
String
receiverCustName
;
//接货人联系手机
private
String
receiveMobile
;
//接货人联系电话
private
String
receivePhone
;
}
src/main/java/com/boco/nbd/wios/manage/entity/vo/WallboxApplyExcelVO.java
0 → 100644
查看文件 @
75a647a5
package
com
.
boco
.
nbd
.
wios
.
manage
.
entity
.
vo
;
import
com.alibaba.excel.annotation.ExcelIgnore
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.starcharge.wios.validation.CreateEntityGroup
;
import
lombok.Data
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
/**
* <p>
* 墙盒申请excel
* <p>
*
* @author <a href="mail to: ning.chai@foxmail.com" rel="nofollow">chaining</a>
*/
@Data
public
class
WallboxApplyExcelVO
{
/** 安装订单号 */
@ExcelProperty
(
"安装订单号"
)
@NotNull
(
groups
=
CreateEntityGroup
.
class
,
message
=
"缺少安装单号"
)
@NotEmpty
(
groups
=
CreateEntityGroup
.
class
,
message
=
"缺少安装单号"
)
private
String
orderId
;
/** 墙盒设备型号(对应物料id) */
@ExcelIgnore
private
String
wallboxItemId
;
@ExcelIgnore
private
String
wallboxModel
;
/** 是否紧急:0:否,1:是 */
@ExcelProperty
(
"是否紧急(0否,1是)"
)
@NotNull
(
groups
=
CreateEntityGroup
.
class
,
message
=
"缺少是否紧急数据"
)
private
Integer
ifEmergency
;
/**
* 错误信息
*/
@ExcelIgnore
private
String
errorMessage
;
}
src/main/java/com/boco/nbd/wios/manage/entity/vo/WallboxApplyInstallInfoVO.java
0 → 100644
查看文件 @
75a647a5
package
com
.
boco
.
nbd
.
wios
.
manage
.
entity
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
/**
* <p>
* 墙盒申请安装团队
* <p>
*
* @author <a href="mail to: ning.chai@foxmail.com" rel="nofollow">chaining</a>
*/
@Data
public
class
WallboxApplyInstallInfoVO
{
/** 自增id */
private
Long
id
;
/** 安装订单号 */
@ApiModelProperty
(
value
=
"安装订单号"
)
private
String
orderId
;
@ApiModelProperty
(
value
=
"安装状态"
)
private
String
installStatus
;
/** 安装服务商id */
@ApiModelProperty
(
value
=
"安装服务商id"
)
private
String
supplierId
;
/** 申请团队名称 */
@ApiModelProperty
(
value
=
"申请团队名称"
)
private
String
supplierTeam
;
/** 墙盒设备型号(对应物料id) */
@ApiModelProperty
(
value
=
"墙盒设备型号(对应物料id)"
)
private
String
wallboxItemId
;
/** 物料类型 */
@ApiModelProperty
(
value
=
"物料类型"
)
private
String
materialType
;
/** 墙盒品牌*/
@ApiModelProperty
(
value
=
"墙盒品牌"
)
private
String
wallboxModel
;
/** 墙盒类型*/
@ApiModelProperty
(
value
=
"墙盒类型"
)
private
String
wallboxType
;
@ApiModelProperty
(
value
=
"预约安装时间"
)
private
String
installReserveTime
;
/** 区域id */
@ApiModelProperty
(
value
=
"区域id"
)
private
String
regionId
;
@ApiModelProperty
(
value
=
"区域名称"
)
private
String
regionName
;
/** 是否紧急:0:否,1:是 */
@ApiModelProperty
(
value
=
"是否特殊申请"
)
private
Integer
ifEmergency
;
/** 申请状态:0:已申请,1:已通过,2:已驳回,3:已关闭 */
@ApiModelProperty
(
value
=
"审核状态"
)
private
Long
checkStatus
;
/** 创建时间 */
@ApiModelProperty
(
value
=
"申请时间"
)
private
Date
createdTime
;
@ApiModelProperty
(
value
=
"审核时间"
)
private
Date
checkTime
;
@ApiModelProperty
(
value
=
"审核人员"
)
private
String
checkAccount
;
private
String
checkName
;
@ApiModelProperty
(
value
=
"审核意见"
)
private
String
checkRemarks
;
@ApiModelProperty
(
value
=
"车企安装单号"
)
private
String
outOrderId
;
@ApiModelProperty
(
value
=
"物流单号"
)
private
String
trackingNumber
;
/** 物流状态 */
@ApiModelProperty
(
value
=
"物流状态"
)
private
String
logisticsStatus
;
@ApiModelProperty
(
value
=
"数量"
)
private
String
number
;
}
src/main/java/com/boco/nbd/wios/manage/entity/vo/WallboxApplyInstallListVO.java
0 → 100644
查看文件 @
75a647a5
package
com
.
boco
.
nbd
.
wios
.
manage
.
entity
.
vo
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
/**
* <p>
* 墙盒申请安装团队
* <p>
*
* @author <a href="mail to: ning.chai@foxmail.com" rel="nofollow">chaining</a>
*/
@Data
public
class
WallboxApplyInstallListVO
{
/** 自增id */
private
Long
id
;
/** 安装订单号 */
@ApiModelProperty
(
value
=
"安装订单号"
)
@ExcelProperty
(
"安装订单号"
)
private
String
orderId
;
@ApiModelProperty
(
value
=
"安装状态"
)
private
String
installStatus
;
/** 安装服务商id */
@ApiModelProperty
(
value
=
"安装服务商id"
)
private
String
supplierId
;
/** 申请团队名称 */
@ApiModelProperty
(
value
=
"申请团队名称"
)
@ExcelProperty
(
"申请团队名称"
)
private
String
supplierTeam
;
/** 墙盒设备型号(对应物料id) */
@ApiModelProperty
(
value
=
"墙盒设备型号(对应物料id)"
)
private
String
wallboxItemId
;
/** 物料类型 */
@ApiModelProperty
(
value
=
"物料类型"
)
private
String
materialType
;
/** 墙盒品牌*/
@ApiModelProperty
(
value
=
"墙盒品牌"
)
@ExcelProperty
(
"墙盒品牌"
)
private
String
wallboxModel
;
/** 墙盒类型*/
@ApiModelProperty
(
value
=
"墙盒类型"
)
private
String
wallboxType
;
@ApiModelProperty
(
value
=
"剩余时间"
)
private
String
timeRemaining
;
/** 区域id */
@ApiModelProperty
(
value
=
"区域id"
)
private
String
regionId
;
@ExcelProperty
(
"仓库名称"
)
private
String
regionName
;
/** 是否紧急:0:否,1:是 */
@ApiModelProperty
(
value
=
"是否特殊申请"
)
private
Integer
ifEmergency
;
/** 是否超时:0:未超时,1:已超时 */
@ApiModelProperty
(
value
=
"超时类型"
)
private
Long
ifTimeout
;
/** 申请状态:0:已申请,1:已通过,2:已驳回,3:已关闭 */
@ApiModelProperty
(
value
=
"申请状态"
)
private
Long
checkStatus
;
/** 创建时间 */
@ApiModelProperty
(
value
=
"申请时间"
)
private
Date
createdTime
;
@ApiModelProperty
(
value
=
"物流单号"
)
private
String
trackingNumber
;
/** 物流状态 */
@ApiModelProperty
(
value
=
"物流状态"
)
private
String
logisticsStatus
;
@ApiModelProperty
(
value
=
"数量"
)
private
String
number
;
}
src/main/java/com/boco/nbd/wios/manage/entity/vo/WallboxApplyPageVO.java
0 → 100644
查看文件 @
75a647a5
package
com
.
boco
.
nbd
.
wios
.
manage
.
entity
.
vo
;
import
lombok.Data
;
import
java.util.Date
;
/**
* <p>
* 墙盒申请分页响应结果
* <p>
*
* @author <a href="mail to: ning.chai@foxmail.com" rel="nofollow">chaining</a>
*/
@Data
public
class
WallboxApplyPageVO
{
/** 自增id */
private
Long
id
;
/** 安装订单号 */
private
String
installationOrderId
;
/** 安装服务商id */
private
String
supplierId
;
/** 申请团队名称 */
private
String
supplierTeam
;
/** 墙盒设备型号(对应物料id) */
private
String
wallboxItemId
;
/** 物料类型 */
private
String
materialType
;
/** 墙盒品牌*/
private
String
wallboxModel
;
/** 墙盒类型*/
private
String
wallboxType
;
/** 区域id */
private
String
regionId
;
private
Date
installReserveTime
;
private
String
outOrderId
;
/** 审核备注 */
private
String
checkRemarks
;
/** 是否紧急:0:否,1:是 */
private
Integer
ifEmergency
;
/** 是否超时:0:未超时,1:已超时 */
private
Long
ifTimeout
;
/** 申请状态:0:已申请,1:已通过,2:已驳回,3:已关闭 */
private
Long
checkStatus
;
/** 创建人 */
private
String
createAccount
;
/** 创建时间 */
private
Date
createdTime
;
/** 更新人 */
private
String
modifyAccount
;
/** 更新时间 */
private
Date
modifyTime
;
/** 审核人 */
private
String
checkAccount
;
/** 审核时间 */
private
Date
checkTime
;
/** 物流状态 */
private
String
logisticsStatus
;
}
src/main/java/com/boco/nbd/wios/manage/entity/vo/WallboxApplyReqVO.java
0 → 100644
查看文件 @
75a647a5
package
com
.
boco
.
nbd
.
wios
.
manage
.
entity
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* <p>
* description
* <p>
*
* @author <a href="mail to: ning.chai@foxmail.com" rel="nofollow">chaining</a>
*/
@Data
public
class
WallboxApplyReqVO
{
/** 申请团队名称 */
@ApiModelProperty
(
value
=
"申请团队名称"
,
required
=
true
)
private
String
supplierTeam
;
/** 区域id */
@ApiModelProperty
(
value
=
"区域id"
,
required
=
true
)
private
String
regionId
;
/** 申请状态:0:已申请,1:已通过,2:已驳回,3:已关闭 */
@ApiModelProperty
(
value
=
"申请状态"
,
notes
=
"0:已申请,1:已通过,2:已驳回,3:已关闭"
,
example
=
"1"
,
required
=
true
)
private
Long
checkStatus
;
/** 墙盒设备型号(对应物料id) */
@ApiModelProperty
(
value
=
"墙盒设备型号(对应物料id)"
,
required
=
false
)
private
String
wallboxItemId
;
/** 物流状态0未发货,1已发货 */
@ApiModelProperty
(
value
=
"物流状态0未发货,1已发货"
,
required
=
false
)
private
String
trackingStatus
;
}
src/main/java/com/boco/nbd/wios/manage/mapper/def/WallboxApplyMapper.java
0 → 100644
查看文件 @
75a647a5
package
com
.
boco
.
nbd
.
wios
.
manage
.
mapper
.
def
;
import
com.boco.nbd.wios.manage.entity.bo.WallboxApply
;
import
com.boco.nbd.wios.manage.entity.dto.WallboxApplyDetailQueryDTO
;
import
com.boco.nbd.wios.manage.entity.vo.WallboxApplyDetailVO
;
import
com.boco.nbd.wios.manage.entity.vo.WallboxApplyInstallInfoVO
;
import
com.boco.nbd.wios.manage.entity.vo.WallboxApplyInstallListVO
;
import
com.ihidea.core.base.CoreDao
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Update
;
import
java.util.List
;
/**
* <p>
* 墙盒申请Mapper接口
* <p>
*
* @author <a href="mail to: ning.chai@foxmail.com" rel="nofollow">chaining</a>
*/
public
interface
WallboxApplyMapper
{
/**
* 查询墙盒申请
*
* @param id 墙盒申请主键
* @return 墙盒申请
*/
WallboxApplyInstallInfoVO
selectWallboxApplyById
(
Long
id
);
/**
* 墙盒状态
*/
WallboxApplyDetailVO
selectWallboxDetail
(
WallboxApplyDetailQueryDTO
query
);
/**
* 查询墙盒申请
*
* @param id Order id
* @return 墙盒申请
*/
WallboxApply
selectWallboxApplyByOrderId
(
String
id
);
/**
* 查询墙盒申请列表
*
* @return 墙盒申请集合
*/
List
<
WallboxApply
>
selectWallboxApplyList
(
WallboxApply
WallboxApply
);
List
<
WallboxApplyInstallListVO
>
selectWallboxApplyListFromOrder
(
WallboxApply
WallboxApply
);
/**
* 新增墙盒申请
*
* @param tWallboxApply 墙盒申请
* @return 结果
*/
int
insertWallboxApply
(
WallboxApply
WallboxApply
);
/**
* 修改墙盒申请
*
* @param tWallboxApply 墙盒申请
* @return 结果
*/
int
updateWallboxApply
(
WallboxApply
WallboxApply
);
void
batchUpdateWallboxApply
(
List
<
WallboxApply
>
list
);
/**
* 删除墙盒申请
*
* @param id 墙盒申请主键
* @return 结果
*/
int
deleteWallboxApplyById
(
Long
id
);
/**
* 批量删除墙盒申请
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
int
deleteWallboxApplyByIds
(
Long
[]
ids
);
/**
* 通过物料编码更新发货状态
*
* @param trackingStatus
* @param wallboxItemId
* @return
*/
@Update
(
"update t_wallbox_apply set tracking_status=#{trackingStatus} where wallbox_item_id=#{wallboxItemId}"
)
int
updateWallBoxTrackingStatusByMC
(
@Param
(
"trackingStatus"
)
String
trackingStatus
,
@Param
(
"wallboxItemId"
)
String
wallboxItemId
);
}
src/main/java/com/boco/nbd/wios/manage/service/impl/SupplierService.java
查看文件 @
75a647a5
...
@@ -116,6 +116,10 @@ public class SupplierService {
...
@@ -116,6 +116,10 @@ public class SupplierService {
}
}
}
}
public
Supplier
getById
(
Integer
id
){
return
supplierDao
.
selectById
(
id
);
}
public
List
<
SupplierVo
>
getList
(
SupplierBo
condition
)
{
public
List
<
SupplierVo
>
getList
(
SupplierBo
condition
)
{
SessionInfo
sessionInfo
=
ProcessUtil
.
getUserInfo
();
SessionInfo
sessionInfo
=
ProcessUtil
.
getUserInfo
();
if
(
sessionInfo
!=
null
&&
!
StringUtils
.
isEmpty
(
sessionInfo
.
getAttribute
().
get
(
"installSupplierId"
)))
{
if
(
sessionInfo
!=
null
&&
!
StringUtils
.
isEmpty
(
sessionInfo
.
getAttribute
().
get
(
"installSupplierId"
)))
{
...
...
src/main/java/com/boco/nbd/wios/manage/service/impl/WallboxApplyService.java
0 → 100644
查看文件 @
75a647a5
package
com
.
boco
.
nbd
.
wios
.
manage
.
service
.
impl
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.boco.nbd.wios.manage.entity.bo.Order
;
import
com.boco.nbd.wios.manage.entity.bo.OrderInstall
;
import
com.boco.nbd.wios.manage.entity.bo.SupplierStaff
;
import
com.boco.nbd.wios.manage.entity.bo.WallboxApply
;
import
com.boco.nbd.wios.manage.entity.dto.WallboxApplyBatchCheckDTO
;
import
com.boco.nbd.wios.manage.entity.dto.WallboxApplyCheckDTO
;
import
com.boco.nbd.wios.manage.entity.dto.WallboxApplyDetailQueryDTO
;
import
com.boco.nbd.wios.manage.entity.vo.WallboxApplyCheckVO
;
import
com.boco.nbd.wios.manage.entity.vo.WallboxApplyDetailVO
;
import
com.boco.nbd.wios.manage.entity.vo.WallboxApplyInstallInfoVO
;
import
com.boco.nbd.wios.manage.entity.vo.WallboxApplyInstallListVO
;
import
com.boco.nbd.wios.manage.mapper.def.*
;
import
com.ihidea.core.support.exception.ServiceException
;
import
com.ihidea.core.support.session.SessionInfo
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* <p>
* description
* <p>
*
* @author <a href="mail to: ning.chai@foxmail.com" rel="nofollow">chaining</a>
*/
@Service
public
class
WallboxApplyService
{
@Autowired
private
WallboxApplyMapper
wallboxApplyMapper
;
@Autowired
private
OrderDao
orderDao
;
@Autowired
private
OrderInstallDao
orderInstallDao
;
@Autowired
private
TokenService
tokenService
;
@Autowired
private
SupplierDao
supplierDao
;
@Autowired
private
SupplierStaffDao
supplierStaffDao
;
private
final
Integer
CHECK_STATUS_REJECT
=
2
;
/**
* 查询墙盒申请
*
* @param id 墙盒申请主键
* @return 墙盒申请
*/
public
WallboxApplyInstallInfoVO
selectWallboxApplyById
(
Long
id
)
{
return
wallboxApplyMapper
.
selectWallboxApplyById
(
id
);
}
/**
* 墙盒详情(墙盒状态)
*
* @param orderId 订单id
* @return 墙盒申请
*/
public
WallboxApplyDetailVO
selectWallboxDetail
(
String
orderId
)
{
SessionInfo
loginUser
=
tokenService
.
getUser
();
String
userId
=
loginUser
.
getUserId
();
List
<
SupplierStaff
>
supplier
=
supplierStaffDao
.
selectByAccountId
(
Integer
.
valueOf
(
userId
));
WallboxApplyDetailQueryDTO
query
=
new
WallboxApplyDetailQueryDTO
();
query
.
setOrderId
(
orderId
);
query
.
setSupplierId
(
supplier
.
stream
().
findFirst
().
get
().
getSupplierId
().
toString
());
return
wallboxApplyMapper
.
selectWallboxDetail
(
query
);
}
/**
* 查询墙盒申请列表
*
* @param WallboxApply 墙盒申请
* @return 墙盒申请
*/
public
List
<
WallboxApply
>
selectWallboxApplyList
(
WallboxApply
WallboxApply
)
{
return
wallboxApplyMapper
.
selectWallboxApplyList
(
WallboxApply
);
}
/**
* 根据订单表查询墙盒申请列表
*
* @param WallboxApply 墙盒申请
* @return 墙盒申请
*/
public
List
<
WallboxApplyInstallListVO
>
selectWallboxApplyListFromOrder
(
WallboxApply
WallboxApply
)
{
List
<
WallboxApplyInstallListVO
>
list
=
wallboxApplyMapper
.
selectWallboxApplyListFromOrder
(
WallboxApply
);
list
.
stream
().
map
(
l
->{
return
l
;
});
return
list
;
}
public
WallboxApply
calculateTimeRemaining
(
WallboxApply
wallboxApply
)
{
return
wallboxApply
;
}
/**
* 新增墙盒申请
*
* @param req 墙盒申请
* @return 结果
*/
public
int
insertWallboxApply
(
WallboxApply
req
)
{
//判断是否可以新增
//validateApplyExists(req.getOrderId());
WallboxApply
condition
=
new
WallboxApply
();
condition
.
setOrderId
(
req
.
getOrderId
());
condition
.
setCheckStatus
(
1L
);
List
<
WallboxApply
>
retList
=
wallboxApplyMapper
.
selectWallboxApplyList
(
condition
);
if
(
CollectionUtils
.
isNotEmpty
(
retList
)){
throw
new
ServiceException
(
"存在已审核通过的安装单,无法重复申请"
);
}
condition
.
setSupplierId
(
req
.
getSupplierId
());
List
<
WallboxApply
>
retList2
=
wallboxApplyMapper
.
selectWallboxApplyList
(
condition
);
if
(
CollectionUtils
.
isNotEmpty
(
retList2
)){
throw
new
ServiceException
(
"该订单已申请"
);
}
//补全相关信息
Order
order
=
orderDao
.
selectById
(
req
.
getOrderId
());
req
.
setRegionId
(
order
.
getRegionId
());
String
wallboxModel
=
order
.
getWallboxModel
();
if
(
StrUtil
.
isBlank
(
wallboxModel
))
{
throw
new
ServiceException
(
"订单数据异常,缺失墙盒信息,请联系系统管理员"
);
}
req
.
setWallboxItemId
(
order
.
getWallboxModel
());
req
.
setWallboxModel
(
order
.
getWallboxModel
()
==
null
?
""
:
order
.
getWallboxModel
());
req
.
setOutOrderId
(
order
.
getOutOrderId
());
req
.
setInstallReserveTime
(
order
.
getInstallReserveTime
());
req
.
setAddress
(
order
.
getAddress
());
req
.
setTrackingNumber
(
order
.
getShipno
());
req
.
setInstallProcess
(
Integer
.
toUnsignedLong
(
order
.
getStatus
()));
req
.
setInstallStatus
(
Integer
.
toString
(
order
.
getStatus
()));
req
.
setOutOrderId
(
order
.
getOutOrderId
());
return
wallboxApplyMapper
.
insertWallboxApply
(
req
);
}
/**
* 新增墙盒申请
*
* @param orderId 订单号
* @return 结果
*/
public
int
insertWallboxApply
(
int
orderId
)
{
//判断订单状态
// orderInstallDao.selectByOrderId()
return
0
;
}
/**
* 修改墙盒申请
*
* @return 结果
*/
public
int
updateWallboxApply
(
WallboxApply
wallboxApply
)
{
WallboxApply
record
=
wallboxApplyMapper
.
selectWallboxApplyByOrderId
(
wallboxApply
.
getOutOrderId
());
// if (!CHECK_STATUS_REJECT.equals(record.getCheckStatus())) {
// throw new ServiceException("非驳回状态订单无法修改信息!");
// }
wallboxApply
.
setCheckTime
(
new
Date
());
return
wallboxApplyMapper
.
updateWallboxApply
(
wallboxApply
);
}
/**
* 审核
* @param req
* @return
*/
public
int
checkWallboxApply
(
WallboxApplyCheckVO
req
){
WallboxApply
cond
=
new
WallboxApply
();
cond
.
setOrderId
(
req
.
getOrderId
());
List
<
WallboxApply
>
list
=
wallboxApplyMapper
.
selectWallboxApplyList
(
cond
);
List
<
WallboxApply
>
filteredList
=
list
.
stream
()
.
filter
(
l
->
l
.
getCheckStatus
()
==
2
)
.
collect
(
Collectors
.
toList
());
if
(!
filteredList
.
isEmpty
())
{
throw
new
ServiceException
(
"同订单已审核"
);
}
WallboxApply
update
=
new
WallboxApply
();
update
.
setId
(
req
.
getId
());
update
.
setOrderId
(
req
.
getOrderId
());
update
.
setCheckStatus
(
req
.
getCheckStatus
());
update
.
setCheckRemarks
(
req
.
getCheckRemarks
());
update
.
setCheckTime
(
new
Date
());
update
.
setCheckAccount
(
tokenService
.
getUser
().
getUserId
());
return
wallboxApplyMapper
.
updateWallboxApply
(
update
);
}
/**
* 批量审核
*/
public
WallboxApplyBatchCheckDTO
checkBatch
(
WallboxApplyBatchCheckDTO
req
)
{
List
<
WallboxApplyCheckDTO
>
checkList
=
req
.
getCheckList
();
List
<
WallboxApply
>
toUpdateList
=
new
ArrayList
<>();
boolean
allowedUpdate
=
true
;
for
(
WallboxApplyCheckDTO
wallboxApply
:
checkList
)
{
WallboxApply
cond
=
new
WallboxApply
();
cond
.
setOrderId
(
wallboxApply
.
getOrderId
());
List
<
WallboxApply
>
list
=
wallboxApplyMapper
.
selectWallboxApplyList
(
cond
);
List
<
WallboxApply
>
filteredList
=
list
.
stream
()
.
filter
(
l
->
l
.
getCheckStatus
()
==
2
)
.
collect
(
Collectors
.
toList
());
if
(!
filteredList
.
isEmpty
())
{
wallboxApply
.
setDataStatus
(
"0"
);
wallboxApply
.
setErrorMessage
(
"该订单已审核通过"
);
allowedUpdate
=
false
;
}
if
(
allowedUpdate
){
WallboxApply
update
=
new
WallboxApply
();
update
.
setId
(
wallboxApply
.
getId
());
update
.
setCheckStatus
(
req
.
getCheckStatus
());
update
.
setCheckRemarks
(
req
.
getCheckRemarks
());
update
.
setCheckAccount
(
tokenService
.
getUser
().
getUserId
());
toUpdateList
.
add
(
update
);
}
}
if
(
allowedUpdate
){
// 批量更新操作
toUpdateList
.
forEach
(
l
->
wallboxApplyMapper
.
updateWallboxApply
(
l
));
}
return
req
;
}
void
validateApplyExists
(
String
id
)
{
OrderInstall
orderInstall
=
orderInstallDao
.
selectByOrderId
(
id
);
if
(
ObjectUtil
.
isNull
(
orderInstall
))
{
throw
new
ServiceException
(
"不存在安装单号"
);
}
}
}
src/main/java/com/boco/nbd/wios/utils/ExcelUtils.java
0 → 100644
查看文件 @
75a647a5
package
com
.
boco
.
nbd
.
wios
.
utils
;
import
com.alibaba.excel.EasyExcel
;
import
com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.net.URLEncoder
;
import
java.util.List
;
/**
* Excel 工具类
*
*/
public
class
ExcelUtils
{
/**
* 将列表以 Excel 响应给前端
*
* @param response 响应
* @param filename 文件名
* @param sheetName Excel sheet 名
* @param head Excel head 头
* @param data 数据列表哦
* @param <T> 泛型,保证 head 和 data 类型的一致性
* @throws IOException 写入失败的情况
*/
public
static
<
T
>
void
write
(
HttpServletResponse
response
,
String
filename
,
String
sheetName
,
Class
<
T
>
head
,
List
<
T
>
data
)
throws
IOException
{
response
.
addHeader
(
"Content-Disposition"
,
"attachment;filename="
+
URLEncoder
.
encode
(
filename
,
"UTF-8"
));
// 输出 Excel
EasyExcel
.
write
(
response
.
getOutputStream
(),
head
)
.
autoCloseStream
(
false
)
// 不要自动关闭,交给 Servlet 自己处理
.
registerWriteHandler
(
new
LongestMatchColumnWidthStyleStrategy
())
// 基于 column 长度,自动适配。最大 255 宽度
.
sheet
(
sheetName
).
doWrite
(
data
);
// 设置 header 和 contentType。写在最后的原因是,避免报错时,响应 contentType 已经被修改了
response
.
setContentType
(
"application/octet-stream;charset=ISO8859-1"
);
}
public
static
<
T
>
List
<
T
>
read
(
MultipartFile
file
,
Class
<
T
>
head
)
throws
IOException
{
return
EasyExcel
.
read
(
file
.
getInputStream
(),
head
,
null
)
.
autoCloseStream
(
false
)
// 不要自动关闭,交给 Servlet 自己处理
.
doReadAllSync
();
}
}
src/main/resources/mybatis/mapper/def/common/WallboxApplyMapper.xml
0 → 100644
查看文件 @
75a647a5
<?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.boco.nbd.wios.manage.mapper.def.WallboxApplyMapper"
>
<resultMap
type=
"com.boco.nbd.wios.manage.entity.bo.WallboxApply"
id=
"WallboxApplyResult"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"orderId"
column=
"order_id"
/>
<result
property=
"supplierId"
column=
"supplier_id"
/>
<result
property=
"supplierTeam"
column=
"supplier_team"
/>
<result
property=
"wallboxItemId"
column=
"wallbox_item_id"
/>
<result
property=
"wallboxModel"
column=
"wallbox_model"
/>
<result
property=
"materialType"
column=
"material_type"
/>
<result
property=
"trackingNumber"
column=
"tracking_number"
/>
<result
property=
"trackingStatus"
column=
"tracking_status"
/>
<result
property=
"installStatus"
column=
"install_status"
/>
<result
property=
"regionId"
column=
"region_id"
/>
<result
property=
"address"
column=
"address"
/>
<result
property=
"outOrderId"
column=
"out_order_id"
/>
<result
property=
"ifEmergency"
column=
"if_emergency"
/>
<result
property=
"ifTimeout"
column=
"if_timeout"
/>
<result
property=
"checkAccount"
column=
"check_account"
/>
<result
property=
"checkStatus"
column=
"check_status"
/>
<result
property=
"checkRemarks"
column=
"check_remarks"
/>
<result
property=
"checkTime"
column=
"check_time"
/>
<result
property=
"installReserveTime"
column=
"install_reserve_time"
/>
<result
property=
"installProcess"
column=
"install_process"
/>
<result
property=
"createAccount"
column=
"create_account"
/>
<result
property=
"createdTime"
column=
"created_time"
/>
<result
property=
"modifyAccount"
column=
"modify_account"
/>
<result
property=
"modifyTime"
column=
"modify_time"
/>
</resultMap>
<sql
id=
"selectWallboxApplyVo"
>
select id,
order_id,
supplier_id,
supplier_team,
wallbox_item_id,
wallbox_model,
material_type,
tracking_number,
tracking_status,
install_status,
region_id,
address,
out_order_id,
if_emergency,
if_timeout,
check_account,
check_status,
check_remarks,
check_time,
install_reserve_time,
install_process,
create_account,
created_time,
modify_account,
modify_time
from t_wallbox_apply
</sql>
<select
id=
"selectWallboxApplyList"
parameterType=
"com.boco.nbd.wios.manage.entity.bo.WallboxApply"
resultMap=
"WallboxApplyResult"
>
<include
refid=
"selectWallboxApplyVo"
/>
<where>
<if
test=
"orderId != null and orderId != ''"
>
and order_id = #{orderId}
</if>
<if
test=
"supplierId != null "
>
and supplier_id = #{supplierId}
</if>
<if
test=
"supplierTeam != null and supplierTeam != ''"
>
and supplier_team like concat('%', #{supplierTeam},
'%')
</if>
<if
test=
"wallboxItemId != null and wallboxItemId != ''"
>
and wallbox_item_id = #{wallboxItemId}
</if>
<if
test=
"wallboxModel != null and wallboxModel != ''"
>
and wallbox_model = #{wallboxModel}
</if>
<if
test=
"materialType != null and materialType != ''"
>
and material_type = #{materialType}
</if>
<if
test=
"trackingNumber != null and trackingNumber != ''"
>
and tracking_number = #{trackingNumber}
</if>
<if
test=
"trackingStatus != null and trackingStatus != ''"
>
and tracking_status = #{trackingStatus}
</if>
<if
test=
"installStatus != null and installStatus != ''"
>
and install_status = #{installStatus}
</if>
<if
test=
"regionId != null and regionId != ''"
>
and region_id = #{regionId}
</if>
<if
test=
"address != null and address != ''"
>
and address = #{address}
</if>
<if
test=
"outOrderId != null and outOrderId != ''"
>
and out_order_id = #{outOrderId}
</if>
<if
test=
"ifEmergency != null "
>
and if_emergency = #{ifEmergency}
</if>
<if
test=
"ifTimeout != null "
>
and if_timeout = #{ifTimeout}
</if>
<if
test=
"checkAccount != null and checkAccount != ''"
>
and check_account = #{checkAccount}
</if>
<if
test=
"checkStatus != null "
>
and check_status = #{checkStatus}
</if>
<if
test=
"checkRemarks != null and checkRemarks != ''"
>
and check_remarks = #{checkRemarks}
</if>
<if
test=
"checkTime != null "
>
and check_time = #{checkTime}
</if>
<if
test=
"installReserveTime != null "
>
and install_reserve_time = #{installReserveTime}
</if>
<if
test=
"installProcess != null "
>
and install_process = #{installProcess}
</if>
<if
test=
"createAccount != null and createAccount != ''"
>
and create_account = #{createAccount}
</if>
<if
test=
"createdTime != null "
>
and created_time = #{createdTime}
</if>
<if
test=
"modifyAccount != null and modifyAccount != ''"
>
and modify_account = #{modifyAccount}
</if>
<if
test=
"modifyTime != null "
>
and modify_time = #{modifyTime}
</if>
</where>
</select>
<select
id=
"selectWallboxApplyListFromOrder"
parameterType=
"com.boco.nbd.wios.manage.entity.vo.WallboxApplyReqVO"
resultType=
"com.boco.nbd.wios.manage.entity.vo.WallboxApplyInstallListVO"
>
SELECT t_wallbox_apply.id,
t_wallbox_apply.order_id,
t_wallbox_apply.supplier_id,
t_wallbox_apply.supplier_team,
t_wallbox_apply.wallbox_item_id,
t_wallbox_apply.wallbox_model,
t_wallbox_apply.material_type,
t_wallbox_apply.tracking_status,
t_order.region_id,
reg.name as region_name,
t_order.address,
t_wallbox_apply.out_order_id,
t_wallbox_apply.if_emergency,
t_wallbox_apply.if_timeout,
t_wallbox_apply.check_account,
t_wallbox_apply.check_status,
t_wallbox_apply.check_remarks,
t_wallbox_apply.check_time,
t_wallbox_apply.install_reserve_time,
t_wallbox_apply.install_process,
t_wallbox_apply.create_account,
t_wallbox_apply.created_time,
t_wallbox_apply.modify_account,
t_wallbox_apply.modify_time,
t_order.shipno as tracking_number,
t_order.status as install_status
FROM t_wallbox_apply
LEFT JOIN t_order ON t_wallbox_apply.order_id = t_order.id
left join t_region reg on reg.id=t_wallbox_apply.region_id
<where>
<if
test=
"supplierTeam != null and supplierTeam != ''"
>
and t_wallbox_apply.supplier_team like concat('%',
#{supplierTeam},
'%')
</if>
<if
test=
"checkStatus != null "
>
and t_wallbox_apply.check_status = #{checkStatus}
</if>
<if
test=
"trackingStatus != null "
>
and t_wallbox_apply.tracking_status = #{trackingStatus}
</if>
<if
test=
"regionId != null and regionId != ''"
>
and t_wallbox_apply.region_id = #{regionId}
</if>
<if
test=
"wallboxItemId != null and wallboxItemId != ''"
>
and t_wallbox_apply.wallbox_item_id like
concat('%', #{wallboxItemId}, '%')
</if>
</where>
</select>
<select
id=
"selectWallboxApplyById"
parameterType=
"Long"
resultType=
"com.boco.nbd.wios.manage.entity.vo.WallboxApplyInstallInfoVO"
>
SELECT t_wallbox_apply.id,
t_wallbox_apply.order_id,
t_wallbox_apply.supplier_id,
t_wallbox_apply.supplier_team,
t_order.wallbox_model,
t_order.item_model as material_type,
t_wallbox_apply.tracking_status,
t_order.region_id,
reg.name as region_name,
t_order.install_reserve_time,
t_order.address,
t_order.out_order_id,
t_wallbox_apply.if_emergency,
t_wallbox_apply.if_timeout,
t_wallbox_apply.check_account,
wb_account.name as check_name,
t_wallbox_apply.check_status,
t_wallbox_apply.check_remarks,
t_wallbox_apply.check_time,
t_order.install_reserve_time,
t_wallbox_apply.create_account,
t_wallbox_apply.created_time,
t_wallbox_apply.modify_account,
t_wallbox_apply.modify_time,
t_order.shipno as tracking_number,
t_order.status as install_status
FROM t_wallbox_apply
LEFT JOIN t_order ON t_wallbox_apply.order_id = t_order.id
left join t_region reg on reg.id = t_wallbox_apply.region_id
left join wb_account on wb_account.id = t_wallbox_apply.check_account
where t_wallbox_apply.id = #{id}
</select>
<select
id=
"selectWallboxDetail"
parameterType=
"com.starcharge.wios.dto.WallboxApplyDetailQueryDTO"
resultType=
"com.boco.nbd.wios.manage.entity.vo.WallboxApplyDetailVO"
>
SELECT t_wallbox_apply.id,
t_wallbox_apply.order_id,
t_wallbox_apply.supplier_team,
t_wallbox_apply.tracking_status,
t_wallbox_apply.tracking_number,
t_wallbox_apply.supplier_id,
t_wallbox_apply.wallbox_item_id as wallbox_code,
t_order.user_name,
t_order.user_phone,
t_order.wallbox_model,
t_order.item_model,
t_wallbox_apply.if_emergency,
t_wallbox_apply.if_timeout,
t_wallbox_apply.check_account,
t_wallbox_apply.check_status,
t_wallbox_apply.check_remarks,
t_wallbox_apply.check_time,
t_wallbox_apply.create_account,
t_wallbox_apply.created_time,
t_wallbox_apply.modify_account,
t_wallbox_apply.modify_time
FROM t_order
LEFT JOIN t_wallbox_apply ON t_wallbox_apply.order_id = t_order.id
where t_wallbox_apply.order_id = #{orderId}
and t_wallbox_apply.supplier_id = #{supplierId}
</select>
<select
id=
"selectWallboxApplyByOrderId"
parameterType=
"String"
resultMap=
"WallboxApplyResult"
>
<include
refid=
"selectWallboxApplyVo"
/>
where order_id = #{id}
</select>
<insert
id=
"insertWallboxApply"
parameterType=
"com.boco.nbd.wios.manage.entity.bo.WallboxApply"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into t_wallbox_apply
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"orderId != null and orderId != ''"
>
order_id,
</if>
<if
test=
"supplierId != null"
>
supplier_id,
</if>
<if
test=
"supplierTeam != null"
>
supplier_team,
</if>
<if
test=
"wallboxItemId != null and wallboxItemId != ''"
>
wallbox_item_id,
</if>
<if
test=
"wallboxModel != null"
>
wallbox_model,
</if>
<if
test=
"materialType != null"
>
material_type,
</if>
<if
test=
"trackingNumber != null"
>
tracking_number,
</if>
<if
test=
"trackingStatus != null"
>
tracking_status,
</if>
<if
test=
"installStatus != null"
>
install_status,
</if>
<if
test=
"regionId != null"
>
region_id,
</if>
<if
test=
"address != null"
>
address,
</if>
<if
test=
"outOrderId != null"
>
out_order_id,
</if>
<if
test=
"ifEmergency != null"
>
if_emergency,
</if>
<if
test=
"ifTimeout != null"
>
if_timeout,
</if>
<if
test=
"checkAccount != null"
>
check_account,
</if>
<if
test=
"checkStatus != null"
>
check_status,
</if>
<if
test=
"checkRemarks != null"
>
check_remarks,
</if>
<if
test=
"checkTime != null"
>
check_time,
</if>
<if
test=
"installReserveTime != null"
>
install_reserve_time,
</if>
<if
test=
"installProcess != null"
>
install_process,
</if>
<if
test=
"createAccount != null"
>
create_account,
</if>
<if
test=
"createdTime != null"
>
created_time,
</if>
<if
test=
"modifyAccount != null"
>
modify_account,
</if>
<if
test=
"modifyTime != null"
>
modify_time,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"orderId != null and orderId != ''"
>
#{orderId},
</if>
<if
test=
"supplierId != null"
>
#{supplierId},
</if>
<if
test=
"supplierTeam != null"
>
#{supplierTeam},
</if>
<if
test=
"wallboxItemId != null and wallboxItemId != ''"
>
#{wallboxItemId},
</if>
<if
test=
"wallboxModel != null"
>
#{wallboxModel},
</if>
<if
test=
"materialType != null"
>
#{materialType},
</if>
<if
test=
"trackingNumber != null"
>
#{trackingNumber},
</if>
<if
test=
"trackingStatus != null"
>
#{trackingStatus},
</if>
<if
test=
"installStatus != null"
>
#{installStatus},
</if>
<if
test=
"regionId != null"
>
#{regionId},
</if>
<if
test=
"address != null"
>
#{address},
</if>
<if
test=
"outOrderId != null"
>
#{outOrderId},
</if>
<if
test=
"ifEmergency != null"
>
#{ifEmergency},
</if>
<if
test=
"ifTimeout != null"
>
#{ifTimeout},
</if>
<if
test=
"checkAccount != null"
>
#{checkAccount},
</if>
<if
test=
"checkStatus != null"
>
#{checkStatus},
</if>
<if
test=
"checkRemarks != null"
>
#{checkRemarks},
</if>
<if
test=
"checkTime != null"
>
#{checkTime},
</if>
<if
test=
"installReserveTime != null"
>
#{installReserveTime},
</if>
<if
test=
"installProcess != null"
>
#{installProcess},
</if>
<if
test=
"createAccount != null"
>
#{createAccount},
</if>
<if
test=
"createdTime != null"
>
#{createdTime},
</if>
<if
test=
"modifyAccount != null"
>
#{modifyAccount},
</if>
<if
test=
"modifyTime != null"
>
#{modifyTime},
</if>
</trim>
</insert>
<update
id=
"updateWallboxApply"
parameterType=
"com.boco.nbd.wios.manage.entity.bo.WallboxApply"
>
update t_wallbox_apply
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"orderId != null and orderId != ''"
>
order_id = #{orderId},
</if>
<if
test=
"supplierId != null"
>
supplier_id = #{supplierId},
</if>
<if
test=
"supplierTeam != null"
>
supplier_team = #{supplierTeam},
</if>
<if
test=
"wallboxItemId != null and wallboxItemId != ''"
>
wallbox_item_id = #{wallboxItemId},
</if>
<if
test=
"wallboxModel != null"
>
wallbox_model = #{wallboxModel},
</if>
<if
test=
"materialType != null"
>
material_type = #{materialType},
</if>
<if
test=
"trackingNumber != null"
>
tracking_number = #{trackingNumber},
</if>
<if
test=
"trackingStatus != null"
>
tracking_status = #{trackingStatus},
</if>
<if
test=
"installStatus != null"
>
install_status = #{installStatus},
</if>
<if
test=
"regionId != null"
>
region_id = #{regionId},
</if>
<if
test=
"address != null"
>
address = #{address},
</if>
<if
test=
"outOrderId != null"
>
out_order_id = #{outOrderId},
</if>
<if
test=
"ifEmergency != null"
>
if_emergency = #{ifEmergency},
</if>
<if
test=
"ifTimeout != null"
>
if_timeout = #{ifTimeout},
</if>
<if
test=
"checkAccount != null"
>
check_account = #{checkAccount},
</if>
<if
test=
"checkStatus != null"
>
check_status = #{checkStatus},
</if>
<if
test=
"checkRemarks != null"
>
check_remarks = #{checkRemarks},
</if>
<if
test=
"checkTime != null"
>
check_time = #{checkTime},
</if>
<if
test=
"installReserveTime != null"
>
install_reserve_time = #{installReserveTime},
</if>
<if
test=
"installProcess != null"
>
install_process = #{installProcess},
</if>
<if
test=
"createAccount != null"
>
create_account = #{createAccount},
</if>
<if
test=
"createdTime != null"
>
created_time = #{createdTime},
</if>
<if
test=
"modifyAccount != null"
>
modify_account = #{modifyAccount},
</if>
<if
test=
"modifyTime != null"
>
modify_time = #{modifyTime},
</if>
</trim>
where id = #{id}
</update>
<!-- 批量更新 WallboxApply -->
<update
id=
"batchUpdateWallboxApply"
parameterType=
"java.util.List"
>
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
";"
>
UPDATE t_wallbox_apply
SET check_status = #{item.checkStatus},
check_remarks = #{item.checkRemarks},
modify_account = #{item.modifyAccount},
modify_time = CURRENT_TIMESTAMP
WHERE id = #{item.id}
</foreach>
</update>
<delete
id=
"deleteWallboxApplyById"
parameterType=
"Long"
>
delete
from t_wallbox_apply
where id = #{id}
</delete>
<delete
id=
"deleteWallboxApplyByIds"
parameterType=
"String"
>
delete from t_wallbox_apply where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论