Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsk-cr20g
Project
Project
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
Administrator
dsk-cr20g
Commits
0bbc06f3
Commit
0bbc06f3
authored
Jun 05, 2023
by
lcl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加客户认领接口
parent
b31f6a98
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
9 deletions
+25
-9
CustomerController.java
...a/com/dsk/web/controller/customer/CustomerController.java
+17
-2
CustomerServiceImpl.java
...java/com/dsk/system/service/impl/CustomerServiceImpl.java
+8
-7
No files found.
dsk-admin/src/main/java/com/dsk/web/controller/customer/CustomerController.java
View file @
0bbc06f3
...
...
@@ -16,7 +16,6 @@ import com.dsk.system.domain.customer.dto.CustomerBusinessSearchDto;
import
com.dsk.system.domain.customer.dto.CustomerSearchDto
;
import
com.dsk.system.service.ICustomerService
;
import
com.dsk.web.controller.search.service.BusinessOpportunityRadarService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.util.ObjectUtils
;
...
...
@@ -68,6 +67,23 @@ public class CustomerController extends BaseController {
@PostMapping
()
@RepeatSubmit
public
AjaxResult
add
(
@RequestBody
Customer
customer
)
{
dealWithcustomerData
(
customer
);
return
AjaxResult
.
success
(
baseService
.
add
(
customer
));
}
/**
* 认领客户
*/
// @PreAuthorize("@ss.hasPermi('customer:claim')")
@PostMapping
(
"/claim"
)
@RepeatSubmit
public
AjaxResult
claim
(
@RequestBody
Customer
customer
)
{
if
(
ObjectUtils
.
isEmpty
(
customer
.
getUipId
()))
throw
new
BeanException
(
"城投uipId不能为空"
);
dealWithcustomerData
(
customer
);
return
AjaxResult
.
success
(
baseService
.
add
(
customer
));
}
private
void
dealWithcustomerData
(
Customer
customer
){
if
(
ObjectUtils
.
isEmpty
(
customer
.
getCompanyName
()))
throw
new
BeanException
(
"企业名称不能为空"
);
if
(
ObjectUtils
.
isEmpty
(
customer
.
getCompanyId
()))
{
try
{
...
...
@@ -79,7 +95,6 @@ public class CustomerController extends BaseController {
logger
.
debug
(
"获取企业id错误!error:{}"
,
e
.
getMessage
());
}
}
return
AjaxResult
.
success
(
baseService
.
add
(
customer
));
}
/**
...
...
dsk-system/src/main/java/com/dsk/system/service/impl/CustomerServiceImpl.java
View file @
0bbc06f3
...
...
@@ -76,15 +76,16 @@ public class CustomerServiceImpl implements ICustomerService {
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
add
(
Customer
customer
)
{
try
{
R
res
=
enterpriseService
.
getUipId
(
customer
.
getCompanyName
());
if
(!
ObjectUtils
.
isEmpty
(
res
.
getData
()))
{
customer
.
setUipId
(
MapUtil
.
getStr
(
BeanUtil
.
beanToMap
(
res
.
getData
()),
"uipId"
));
if
(
ObjectUtils
.
isEmpty
(
customer
.
getUipId
()))
{
try
{
R
res
=
enterpriseService
.
getUipId
(
customer
.
getCompanyName
());
if
(!
ObjectUtils
.
isEmpty
(
res
.
getData
()))
{
customer
.
setUipId
(
MapUtil
.
getStr
(
BeanUtil
.
beanToMap
(
res
.
getData
()),
"uipId"
));
}
}
catch
(
Exception
e
)
{
log
.
error
(
"获取城投平台企业id错误!error:{}"
,
e
.
getMessage
());
}
}
catch
(
Exception
e
)
{
log
.
error
(
"获取城投平台企业id错误!error:{}"
,
e
.
getMessage
());
}
Long
userId
=
SecurityUtils
.
getUserId
();
customer
.
setCreateId
(
userId
);
customer
.
setUpdateId
(
userId
);
...
...
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