Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
H
Hgs
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
徐州
Hgs
Commits
8aadd0a9
Commit
8aadd0a9
authored
May 21, 2021
by
huagnxiner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
平台管理批量软删除公海的客户信息
parent
27c9301d
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
124 additions
and
2 deletions
+124
-2
PlatformManagementController.java
...house365/web/controller/PlatformManagementController.java
+21
-0
myPlatformCustomer.jsp
...INF/views/platformmanagement/pages/myPlatformCustomer.jsp
+50
-1
ICustomer.java
...ain/java/com/house365/ws/interfaces/server/ICustomer.java
+2
-0
CustomerMapper.java
.../main/java/com/house365/ws/dao/mapper/CustomerMapper.java
+2
-1
CustomerImpl.java
...in/java/com/house365/ws/interfaces/impl/CustomerImpl.java
+22
-0
CustomerMapper.xml
...src/main/resources/development/mybatis/CustomerMapper.xml
+9
-0
CustomerMapper.xml
.../src/main/resources/production/mybatis/CustomerMapper.xml
+9
-0
CustomerMapper.xml
...hgs-ws/src/main/resources/test/mybatis/CustomerMapper.xml
+9
-0
No files found.
house365-hgs-web/src/main/java/com/house365/web/controller/PlatformManagementController.java
View file @
8aadd0a9
...
...
@@ -964,4 +964,25 @@ public class PlatformManagementController extends BaseController {
return
result
;
}
/**
* 逻辑删除平台客户
*
* @param idList 客户idList
* @return
*/
@RequestMapping
(
value
=
"deleteIdList"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
HResult
deleteByIdList
(
@RequestBody
()
List
<
Integer
>
idList
,
HttpServletRequest
request
)
{
HResult
result
=
new
HResult
();
try
{
UserEntity
userEntity
=
(
UserEntity
)
request
.
getSession
().
getAttribute
(
SessionConstants
.
THREAD_USER_KEY
);
result
=
customer
.
deleteIdList
(
idList
,
userEntity
.
getId
(),
userEntity
.
getRealName
());
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
result
.
setStatus
(
500
);
result
.
setErrorMessage
(
"删除失败"
);
}
return
result
;
}
}
house365-hgs-web/src/main/webapp/WEB-INF/views/platformmanagement/pages/myPlatformCustomer.jsp
View file @
8aadd0a9
...
...
@@ -473,8 +473,9 @@
</li>
</ul>
<div
class=
"bottomBtn"
style=
"overflow: hidden"
>
<div
class=
"checkAll"
>
选择全部:
<input
type=
"checkbox"
onclick=
"checkAll(this)"
/></div>
<div
class=
"checkAll"
>
选择全部:
<input
type=
"checkbox"
id=
"memberCheckAll"
onclick=
"checkAll(this)"
/></div>
<div
class=
"bottomBtnR"
onclick=
"assignManager()"
>
批量转移
</div>
<div
class=
"bottomBtnR"
name=
"batchDel"
onclick=
"batchDel()"
>
批量删除
</div>
</div>
</div>
</div>
...
...
@@ -963,6 +964,53 @@
});
$
(
".modal"
).
css
(
"width"
,
"560px"
);
}
//批量删除
function
batchDel
()
{
var
customerIdArr
=
[],
mangerIdStateArr
=
[];
for
(
i
=
0
;
i
<
document
.
getElementsByName
(
'memberCheck'
).
length
;
i
++
)
{
if
(
document
.
getElementsByName
(
'memberCheck'
)[
i
].
checked
)
{
customerIdArr
.
push
(
document
.
getElementsByName
(
'memberCheck'
)[
i
].
value
);
mangerIdStateArr
.
push
(
document
.
getElementsByClassName
(
'mangerId_state'
)[
i
].
textContent
.
replace
(
/
[\r\n\s]
/g
,
""
).
trim
());
}
}
if
(
customerIdArr
.
length
<=
0
)
{
alert
(
"请至少选择一个客户!"
);
return
false
;
}
//不能删除非公海状态的用户
for
(
j
=
0
,
len
=
mangerIdStateArr
.
length
;
j
<
len
;
j
++
)
{
if
(
mangerIdStateArr
[
j
]
!=
'回公海'
)
{
alert
(
"无法删除在跟进客户!"
);
return
false
;
}
else
{
continue
;
}
}
House365Util
.
createModal
(
"批量删除客户"
,
"确认是否删除所选客户?"
,
function
()
{
var
url
=
"${ctx}/platformmanagement/deleteIdList"
;
$
.
ajax
({
url
:
url
,
type
:
'post'
,
contentType
:
'application/json'
,
data
:
JSON
.
stringify
(
customerIdArr
),
dataType
:
'json'
,
cache
:
false
,
success
:
function
(
result
)
{
if
(
result
.
status
==
0
)
{
alert
(
"删除成功"
);
window
.
location
.
reload
();
}
else
{
alert
(
result
.
errorMessage
);
}
}
});
});
}
//全选
var
checkNum
=
0
;
function
checkAll
(
btn
)
{
...
...
@@ -996,6 +1044,7 @@
document
.
getElementById
(
"memberCheckAll"
).
checked
=
false
;
}
}
</script>
<script
src=
"${static_common}/jquery-ui/jquery-ui.min.js"
type=
"text/javascript"
></script>
...
...
house365-hgs-ws-interfaces/src/main/java/com/house365/ws/interfaces/server/ICustomer.java
View file @
8aadd0a9
...
...
@@ -266,4 +266,6 @@ public interface ICustomer extends IService {
HResult
deleteById
(
int
id
,
int
userId
,
String
userName
);
HResult
deleteIdList
(
List
<
Integer
>
idList
,
int
userId
,
String
userName
);
}
house365-hgs-ws/src/main/java/com/house365/ws/dao/mapper/CustomerMapper.java
View file @
8aadd0a9
package
com
.
house365
.
ws
.
dao
.
mapper
;
import
com.house365.beans.entity.CustomerEntity
;
import
com.house365.beans.entity.UserEntity
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
...
...
@@ -93,4 +92,6 @@ public interface CustomerMapper {
int
querySeaCount
(
Map
<
String
,
Object
>
map
);
int
updateIdList
(
List
<
Integer
>
idList
);
}
house365-hgs-ws/src/main/java/com/house365/ws/interfaces/impl/CustomerImpl.java
View file @
8aadd0a9
...
...
@@ -3098,6 +3098,28 @@ public class CustomerImpl implements ICustomer {
return
result
;
}
/**
* 批量软删除customerid
* @param idList
* @param userId
* @param userName
* @return
*/
@Override
public
HResult
deleteIdList
(
List
<
Integer
>
idList
,
int
userId
,
String
userName
)
{
HResult
result
=
new
HResult
();
try
{
int
updateCount
=
customerMapper
.
updateIdList
(
idList
);
LOGGER
.
info
(
"updateCount:"
+
updateCount
);
result
.
setStatus
(
0
);
result
.
setData
(
updateCount
);
}
catch
(
Exception
e
){
LOGGER
.
error
(
e
.
getMessage
(),
e
);
result
.
fail
(
500
,
e
.
getMessage
());
}
return
result
;
}
/**
* 以下均为自动生成
*/
...
...
house365-hgs-ws/src/main/resources/development/mybatis/CustomerMapper.xml
View file @
8aadd0a9
...
...
@@ -850,4 +850,12 @@
</if>
</select>
<update
id=
"updateIdList"
parameterType=
"list"
>
update customer set is_delete=1
WHERE
id
<foreach
collection=
"list"
item=
"id"
open=
"in ("
close=
")"
separator=
","
>
#{id}
</foreach>
</update>
</mapper>
\ No newline at end of file
house365-hgs-ws/src/main/resources/production/mybatis/CustomerMapper.xml
View file @
8aadd0a9
...
...
@@ -850,4 +850,12 @@
</if>
</select>
<update
id=
"updateIdList"
parameterType=
"list"
>
update customer set is_delete=1
WHERE
id
<foreach
collection=
"list"
item=
"id"
open=
"in ("
close=
")"
separator=
","
>
#{id}
</foreach>
</update>
</mapper>
\ No newline at end of file
house365-hgs-ws/src/main/resources/test/mybatis/CustomerMapper.xml
View file @
8aadd0a9
...
...
@@ -850,4 +850,12 @@
</if>
</select>
<update
id=
"updateIdList"
parameterType=
"list"
>
update customer set is_delete=1
WHERE
id
<foreach
collection=
"list"
item=
"id"
open=
"in ("
close=
")"
separator=
","
>
#{id}
</foreach>
</update>
</mapper>
\ No newline at end of file
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