Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
manager
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
reyun
manager
Commits
8ce81009
Commit
8ce81009
authored
Jul 18, 2020
by
kangxiaoshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提示已存在合同
parent
5c101ea4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
8 deletions
+7
-8
ContractRepository.java
src/main/java/common/repository/ContractRepository.java
+2
-2
ContractServiceImpl.java
src/main/java/common/service/impl/ContractServiceImpl.java
+3
-4
ResultStatus.java
src/main/java/util/ResultStatus.java
+2
-2
No files found.
src/main/java/common/repository/ContractRepository.java
View file @
8ce81009
...
...
@@ -120,6 +120,6 @@ public interface ContractRepository extends JpaRepository<Contract, Long> {
@Query
(
value
=
"select contract_code from contract where customer_body =?1 and contract_code <> ?2 and status in ('backfirst','normal','late') limit 3 "
,
nativeQuery
=
true
)
List
<
String
>
findContractBodyNames
(
String
customerBody
,
String
contractCode
);
@Query
(
value
=
"select
count(*) from contract where contract_code=?1
"
,
nativeQuery
=
true
)
in
t
checkByCode
(
String
code
);
@Query
(
value
=
"select
* from contract where contract_code=?1 limit 1
"
,
nativeQuery
=
true
)
Contrac
t
checkByCode
(
String
code
);
}
src/main/java/common/service/impl/ContractServiceImpl.java
View file @
8ce81009
...
...
@@ -473,7 +473,6 @@ public class ContractServiceImpl implements ContractService {
}
resource
.
setInvoice
(
0L
);
Long
extraFlow
=
resource
.
getExtraFlow
();
if
(
extraFlow
==
null
)
{
...
...
@@ -2199,8 +2198,8 @@ public class ContractServiceImpl implements ContractService {
}
catch
(
Exception
ex
)
{
logger
.
error
(
"批量上传合同错误"
,
ex
);
return
ResultModel
.
ERROR
(
ResultStatus
.
UPLOAD_ERRO
);
}
return
ResultModel
.
ERROR
(
ResultStatus
.
NONE_FILE_EXIST
);
}
...
...
@@ -2282,8 +2281,8 @@ public class ContractServiceImpl implements ContractService {
"合同编号["
+
dataSTR
+
"]已存在,请重新上传"
);
}
int
countCode
=
contractRepository
.
checkByCode
(
dataSTR
);
if
(
co
untCode
>
0
)
{
Contract
contractExist
=
contractRepository
.
checkByCode
(
dataSTR
);
if
(
co
ntractExist
!=
null
)
{
return
ResultModel
.
ERROR
(
ResultStatus
.
CCODE_EXITS
.
getCode
(),
"合同编号["
+
dataSTR
+
"]已存在,请重新上传"
);
}
...
...
src/main/java/util/ResultStatus.java
View file @
8ce81009
...
...
@@ -56,8 +56,8 @@ public enum ResultStatus {
NONE_FILE_EXIST
(-
1000
,
"上传文件为空"
),
FORMAT_FILE_ERRO
(-
10001
,
"模板文件格式错误"
),
UPLOAD_CONTENT_ERRO
(-
10002
,
"模板文件内容错误"
),
CCODE_EXITS
(-
10003
,
"合同编号已存在"
)
;
CCODE_EXITS
(-
10003
,
"合同编号已存在"
)
,
UPLOAD_ERRO
(-
10004
,
"上传时系统错误"
);
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment