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
7c6471a2
Commit
7c6471a2
authored
Jul 10, 2023
by
lcl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客户认领补充
parent
db83f983
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
6 deletions
+38
-6
CustomerController.java
...a/com/dsk/web/controller/customer/CustomerController.java
+9
-0
CustomerUserMapper.java
...c/main/java/com/dsk/system/mapper/CustomerUserMapper.java
+4
-0
ICustomerService.java
...rc/main/java/com/dsk/system/service/ICustomerService.java
+2
-0
CustomerServiceImpl.java
...java/com/dsk/system/service/impl/CustomerServiceImpl.java
+16
-6
CustomerUserMapper.xml
...n/resources/mapper/system/customer/CustomerUserMapper.xml
+7
-0
No files found.
dsk-admin/src/main/java/com/dsk/web/controller/customer/CustomerController.java
View file @
7c6471a2
...
...
@@ -193,6 +193,15 @@ public class CustomerController extends BaseController {
return
success
;
}
/**
* 客户状态
*/
@GetMapping
(
"/status/{customerId}"
)
@RepeatSubmit
public
AjaxResult
status
(
@PathVariable
String
customerId
)
{
return
AjaxResult
.
success
(
baseService
.
status
(
customerId
));
}
/**
* 取消认领
...
...
dsk-system/src/main/java/com/dsk/system/mapper/CustomerUserMapper.java
View file @
7c6471a2
...
...
@@ -3,6 +3,8 @@ package com.dsk.system.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.dsk.system.domain.customer.CustomerUser
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
/**
...
...
@@ -14,5 +16,7 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public
interface
CustomerUserMapper
extends
BaseMapper
<
CustomerUser
>
{
CustomerUser
selectByCustomerIdAndUserId
(
@Param
(
"customerId"
)
String
customerId
,
@Param
(
"userId"
)
Long
userId
);
}
dsk-system/src/main/java/com/dsk/system/service/ICustomerService.java
View file @
7c6471a2
...
...
@@ -31,6 +31,8 @@ public interface ICustomerService {
List
<
String
>
selectUipIdList
(
List
<
String
>
uipIds
);
Integer
status
(
String
customerId
);
boolean
cancelClaim
(
String
customerId
);
boolean
historyClaim
(
String
customerId
);
...
...
dsk-system/src/main/java/com/dsk/system/service/impl/CustomerServiceImpl.java
View file @
7c6471a2
...
...
@@ -125,21 +125,31 @@ public class CustomerServiceImpl implements ICustomerService {
return
baseMapper
.
selectUipIdList
(
uipIds
,
SecurityUtils
.
getUserId
());
}
@Override
public
Integer
status
(
String
customerId
)
{
CustomerUser
customerUser
=
customerUserMapper
.
selectByCustomerIdAndUserId
(
customerId
,
SecurityUtils
.
getUserId
());
if
(
ObjectUtils
.
isEmpty
(
customerUser
))
{
return
null
;
}
return
customerUser
.
getStatus
();
}
@Override
public
boolean
cancelClaim
(
String
customerId
)
{
return
updateClaimStatus
(
customerId
,
1
);
return
updateClaimStatus
(
customerId
,
1
);
}
@Override
public
boolean
historyClaim
(
String
customerId
)
{
return
updateClaimStatus
(
customerId
,
0
);
return
updateClaimStatus
(
customerId
,
0
);
}
//修改客户认领状态
private
boolean
updateClaimStatus
(
String
customerId
,
Integer
status
)
{
CustomerUser
customerUser
=
customerUserMapper
.
selectOne
(
Wrappers
.<
CustomerUser
>
lambdaQuery
()
.
eq
(
CustomerUser:
:
getCustomerId
,
customerId
)
.
eq
(
CustomerUser:
:
getUserId
,
SecurityUtils
.
getUserId
()));
private
boolean
updateClaimStatus
(
String
customerId
,
Integer
status
)
{
CustomerUser
customerUser
=
customerUserMapper
.
selectByCustomerIdAndUserId
(
customerId
,
SecurityUtils
.
getUserId
());
if
(
ObjectUtils
.
isEmpty
(
customerUser
))
{
throw
new
ServiceException
(
"数据错误!"
);
}
customerUser
.
setStatus
(
status
);
return
customerUserMapper
.
updateById
(
customerUser
)
==
1
;
}
...
...
dsk-system/src/main/resources/mapper/system/customer/CustomerUserMapper.xml
View file @
7c6471a2
...
...
@@ -2,6 +2,13 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.dsk.system.mapper.CustomerUserMapper"
>
<select
id=
"selectByCustomerIdAndUserId"
resultType=
"com.dsk.system.domain.customer.CustomerUser"
>
select
id, customer_id, user_id, status, create_time, update_time
from customer_user
where customer_id = #{customerId} and user_id = #{userId}
</select>
</mapper>
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