Commit f1d1525c authored by huagnxiner's avatar huagnxiner

组织架构删除人员进行添加平台管理用户的限制提示代码

parent 1a47716a
......@@ -56,6 +56,18 @@ public class UserVo {
* 名下是否有客户
*/
private boolean hasCustomers = false;
/**
* 针对该用户在平台管理中是否客户
*/
private boolean hasCustomersInPlatform=false;
public boolean isHasCustomersInPlatform() {
return hasCustomersInPlatform;
}
public void setHasCustomersInPlatform(boolean hasCustomersInPlatform) {
this.hasCustomersInPlatform = hasCustomersInPlatform;
}
public boolean isHasCustomers() {
return hasCustomers;
......
......@@ -614,6 +614,9 @@ public class UserController extends BaseController {
if (count > 0) {
userVo.setHasCustomers(true);
}
//针对该用户在平台管理中是否有客户进行判断设置值
int countInfo = customer.queryCountById(userEntity.getId());
userVo.setHasCustomersInPlatform(countInfo>0);
lstUserVo.add(userVo);
}
}
......
......@@ -264,7 +264,7 @@
  
<i title="删除"
class="icon-minus pointer icon-large"
onclick="deleteById('${user.entity.id}', ${user.hasCustomers})"> </i>
onclick="deleteById('${user.entity.id}', ${user.hasCustomers},${user.hasCustomersInPlatform})"> </i>
&nbsp;&nbsp;
<c:if test="${user.entity.enabled}">
<i title="锁定"
......@@ -441,7 +441,7 @@
}
}
var deleteById = function (selectedId, hasCustomers) {
var deleteById = function (selectedId, hasCustomers,hasCustomersInPlatform) {
var localHasCustomers = false;
/*
id为空则是多选 判断是否为空
......@@ -476,6 +476,9 @@
if (hasCustomers || localHasCustomers) {
House365Util.createModal("删除员工", "员工名下还有客户,请转移交接给其他置业顾问后再删除。", function () {
});
}else if(hasCustomersInPlatform){
House365Util.createModal("删除员工", "员工名下还有客户,请转移交接给其他平台人员后再删除。", function () {
});
} else {
//获取删除用户的绑定楼盘信息
$.ajax({
......
......@@ -271,4 +271,6 @@ public interface ICustomer extends IService {
HResult deleteIdList(List<Integer> idList, int userId, String userName);
void batchTransferCreator(String[] customerIds, String[] userIds, UserEntity userEntity, int type) throws Exception;
int queryCountById(Integer userId);
}
......@@ -97,4 +97,6 @@ public interface CustomerMapper {
void updatePtCustomerStar(Map<String, Object> map);
void updatePtCustomerCreater(Map<String, Object> map);
int queryCountById(Integer userId);
}
......@@ -3129,6 +3129,17 @@ public class CustomerImpl implements ICustomer {
return result;
}
/**
* 根据用户id查询该用户在平台管理的数量
*
* @param userId
* @return
*/
@Override
public int queryCountById(Integer userId){
return customerMapper.queryCountById( userId );
}
@Override
@Transactional
public void batchTransferCreator(String[] customerIds, String[] userIds, UserEntity userEntity, int type) throws Exception {
......
......@@ -872,4 +872,15 @@
#{id}
</foreach>
</update>
<select id="queryCountById" resultType="Integer">
SELECT
count(*)
FROM customer
where create_source='PT'
and is_delete=0
and is_show_in_plat=0
and customer_source_type=8
and creater=#{userId}
</select>
</mapper>
\ No newline at end of file
......@@ -865,4 +865,14 @@
#{id}
</foreach>
</update>
<select id="queryCountById" resultType="Integer">
SELECT
count(*)
FROM customer
where create_source='PT'
and is_delete=0
and is_show_in_plat=0
and customer_source_type=8
and creater=#{userId}
</select>
</mapper>
\ No newline at end of file
......@@ -858,4 +858,14 @@
#{id}
</foreach>
</update>
<select id="queryCountById" resultType="Integer">
SELECT
count(*)
FROM customer
where create_source='PT'
and is_delete=0
and is_show_in_plat=0
and customer_source_type=8
and creater=#{userId}
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment