Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
1eb4b1e2
Commit
1eb4b1e2
authored
4 years ago
by
邓实川
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加删除客户联系人 容错
parent
2408d153
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
src/main/java/cn/timer/api/controller/crm/CrmController.java
+11
-3
No files found.
src/main/java/cn/timer/api/controller/crm/CrmController.java
View file @
1eb4b1e2
...
...
@@ -563,13 +563,18 @@ public class CrmController {
@ApiOperation
(
value
=
"新增/编辑客户联系人"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
public
Result
<
Void
>
addCilentLinkMan
(
@CurrentUser
UserBean
userBean
,
@RequestBody
CrmClientContacts
crmClientContacts
)
{
Integer
cid
=
crmClientContacts
.
getCid
();
if
(
crmClientContacts
.
getId
()
==
null
)
{
if
(
cid
==
null
)
return
ResultUtil
.
error
(
"编辑失败,请传入客户id"
);
Integer
num
=
CrmClientData
.
builder
().
id
(
crmClientContacts
.
getCid
()).
build
().
selectById
().
getContactsNum
();
CrmClientData
.
builder
().
id
(
c
rmClientContacts
.
getCid
()
).
contactsNum
(++
num
).
build
().
updateById
();
CrmClientData
.
builder
().
id
(
c
id
).
contactsNum
(++
num
).
build
().
updateById
();
}
if
(
crmClientContacts
.
insertOrUpdate
())
return
ResultUtil
.
success
(
"新增/编辑成功"
);
return
ResultUtil
.
success
(
"新增/编辑失败"
);
return
ResultUtil
.
error
(
"新增/编辑失败"
);
}
...
...
@@ -577,7 +582,10 @@ public class CrmController {
@Transactional
@ApiOperation
(
value
=
"删除客户联系人"
,
httpMethod
=
"DELETE"
,
notes
=
"接口发布说明"
)
public
Result
<
Void
>
delCilentLinkMan
(
@CurrentUser
UserBean
userBean
,
CrmClientContacts
crmClientContacts
)
{
Integer
num
=
CrmClientData
.
builder
().
build
().
selectById
().
getContactsNum
();
Integer
cid
=
crmClientContacts
.
getCid
();
if
(
cid
==
null
)
return
ResultUtil
.
error
(
"编辑失败,请传入客户id"
);
Integer
num
=
CrmClientData
.
builder
().
id
(
cid
).
build
().
selectById
().
getContactsNum
();
CrmClientData
.
builder
().
id
(
crmClientContacts
.
getCid
()).
contactsNum
(--
num
).
build
().
updateById
();
if
(
crmClientContacts
.
deleteById
())
return
ResultUtil
.
success
(
"删除成功"
);
...
...
This diff is collapsed.
Click to expand it.
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