Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
platform
/
platform-process-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit dad2a8c2
authored
Oct 09, 2023
by
谢海旭
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
调整抛出的异常类
1 parent
403ad1a4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
platform-process/src/main/java/cn/com/glsx/process/common/sysenum/ResultEnum.java
platform-process/src/main/java/cn/com/glsx/process/modules/service/SopInstService.java
platform-process/src/main/java/cn/com/glsx/process/common/sysenum/ResultEnum.java
View file @
dad2a8c
...
...
@@ -9,7 +9,9 @@ import com.glsx.plat.exception.SystemMessage;
*/
public
enum
ResultEnum
{
PARAM_ERROR
(
1001
,
"参数错误"
);
PARAM_ERROR
(
1001
,
"参数错误"
),
FEIGN_REQUEST_ERROR
(
1002
,
"feign请求异常"
),
DATA_HANDLE_ERROR
(
1003
,
"数据处理异常"
);
private
final
Integer
code
;
private
final
String
message
;
...
...
platform-process/src/main/java/cn/com/glsx/process/modules/service/SopInstService.java
View file @
dad2a8c
...
...
@@ -28,8 +28,6 @@ import com.github.pagehelper.PageHelper;
import
com.github.pagehelper.PageInfo
;
import
com.glsx.plat.core.enums.SysConstants
;
import
com.glsx.plat.core.web.Result
;
import
com.glsx.plat.exception.BusinessException
;
import
com.glsx.plat.exception.SystemMessage
;
import
com.glsx.plat.office.excel.EasyExcelUtils
;
import
com.google.common.collect.Lists
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -362,7 +360,7 @@ public class SopInstService {
String
sopJourneyId
=
search
.
getSopJourneyId
();
SopInst
sopInst
=
sopInstMapper
.
selectByPrimaryKey
(
sopJourneyId
);
if
(
Objects
.
isNull
(
sopInst
))
{
throw
BusinessException
.
create
(
SystemMessage
.
ARGS
_ERROR
.
getCode
(),
"该模板实例不存在!"
);
throw
new
AdminException
(
ResultEnum
.
PARAM
_ERROR
.
getCode
(),
"该模板实例不存在!"
);
}
SopTplGrant
sopTplGrant
=
sopTplGrantMapper
.
selectByPrimaryKey
(
sopInst
.
getGrantId
());
...
...
@@ -414,12 +412,12 @@ public class SopInstService {
String
oneId
=
body
.
getOneId
();
Result
<
CustomerSopJourneyDetailDTO
>
detail
=
customerSopJourneyFeignClient
.
detail
(
orgId
,
sopJourneyId
,
oneId
);
if
(!
SysConstants
.
ResultStatus
.
success
.
getCode
().
equals
(
detail
.
getCode
()))
{
throw
BusinessException
.
create
(
SystemMessage
.
ARGS
_ERROR
.
getCode
(),
"查询客户信息异常"
);
throw
new
AdminException
(
ResultEnum
.
FEIGN_REQUEST
_ERROR
.
getCode
(),
"查询客户信息异常"
);
}
CustomerSopJourneyDetailDTO
customerDetail
=
detail
.
getData
();
if
(
Objects
.
isNull
(
customerDetail
))
{
throw
BusinessException
.
create
(
SystemMessage
.
ARGS
_ERROR
.
getCode
(),
"客户信息不存在"
);
throw
new
AdminException
(
ResultEnum
.
PARAM
_ERROR
.
getCode
(),
"客户信息不存在"
);
}
ModifySopJourneyStageRequest
request
=
new
ModifySopJourneyStageRequest
();
...
...
@@ -450,7 +448,7 @@ public class SopInstService {
search
.
setPageSize
(
5000
);
SopInst
sopInst
=
sopInstMapper
.
selectByPrimaryKey
(
search
.
getSopJourneyId
());
if
(
Objects
.
isNull
(
sopInst
))
{
throw
BusinessException
.
create
(
SystemMessage
.
ARGS
_ERROR
.
getCode
(),
"模板实例不存在"
);
throw
new
AdminException
(
ResultEnum
.
PARAM
_ERROR
.
getCode
(),
"模板实例不存在"
);
}
List
<
SopCustomerExcelDTO
>
data
=
new
ArrayList
<>();
...
...
@@ -482,14 +480,14 @@ public class SopInstService {
FileUploadServerData
fileUploadServerData
=
FileUploadUtil
.
uploadToFileSystem
(
String
.
format
(
"客户数据_%d"
,
now
.
getTime
()),
bytes
,
"xlsx"
);
return
fileUploadServerData
;
}
catch
(
Exception
e
)
{
throw
BusinessException
.
create
(
SystemMessage
.
DATA_HANDLE_ERROR
.
getCode
(),
"客户数据导出处理异常"
);
throw
new
AdminException
(
ResultEnum
.
DATA_HANDLE_ERROR
.
getCode
(),
"客户数据导出处理异常"
);
}
}
private
void
getCustomersForExcel
(
SopCustomerSearch
search
,
List
<
CustomerSopJourneyDTO
>
customerSopJourneyDTOList
)
{
Result
<
PageInfo
<
CustomerSopJourneyDTO
>>
customersResult
=
customers
(
search
);
if
(!
SysConstants
.
ResultStatus
.
success
.
getCode
().
equals
(
customersResult
.
getCode
()))
{
throw
BusinessException
.
create
(
SystemMessage
.
MICROSERVICE_CALL_FAIL
.
getCode
(),
"查询客户数据接口异常"
);
throw
new
AdminException
(
ResultEnum
.
FEIGN_REQUEST_ERROR
.
getCode
(),
"查询客户数据接口异常"
);
}
PageInfo
<
CustomerSopJourneyDTO
>
pageInfo
=
customersResult
.
getData
();
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment