Commit a94ec1e6 authored by 徐州's avatar 徐州

排班列表提交

parent e84ecf56
......@@ -39,6 +39,7 @@ import org.springside.modules.web.Servlets;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.util.*;
import java.util.stream.Collectors;
/**
* 账户控制器<br>
......@@ -1148,4 +1149,20 @@ public class UserController extends BaseController {
}
return result;
}
@RequestMapping(value = "pblist", method = RequestMethod.GET)
public String pbList( HttpServletRequest request, Model model) {
//共多少条数据,今日新增多少条
String cityCode = (String) request.getSession().getAttribute(SessionConstants.SESSION_CITY_KEY);
List<UserEntity> users = this.user.getDutyUserByCity(cityCode);
List<UserVo> collect = users.stream().map(i -> {
UserVo userVo = new UserVo();
userVo.setEntity(i);
return userVo;
}).collect(Collectors.toList());
model.addAttribute("users", collect);
return getAutoUrl("pblist");
}
}
......@@ -299,6 +299,10 @@
<shiro:hasPermission name="PLZYKH">
<li><a href="${ctx}/transfercustomer">批量转移客户</a></li>
</shiro:hasPermission>
<%-- <shiro:hasPermission name="PBGL">--%>
<shiro:hasPermission name="PLZYKH">
<li><a href="${ctx}/user/pblist">排班管理</a></li>
</shiro:hasPermission>
</ul>
</li>
......
<%@include file="/WEB-INF/common/layouts/common.jsp" %>
<%@ page language="java" pageEncoding="UTF-8" %>
<html>
<head>
<title>员工列表</title>
<style type="text/css">
* {
margin: 0;
padding: 0;
}
li {
list-style: none;
}
.clearfix:after,
.clearfix:before {
content: '.';
display: block;
visibility: hidden;
font-size: 0;
line-height: 0;
width: 0;
height: 0;
}
.clearfix:after {
clear: both;
}
.clearfix {
zoom: 1;
}
.choosemask {
position: fixed;
left: 0;
top: 0;
background-color: rgba(0, 0, 0, 0.5);
width: 100%;
height: 100%;
}
.choosemask-wrap {
width: 280px;
height: 147px;
background-color: #fff;
border: 1px solid #000;
left: 50%;
margin-left: -140px;
top: 200px;
position: absolute;
}
.choosemask-top {
text-align: right;
font-size: 20px;
height: 22px;
line-height: 22px;
}
.choosemask-close {
cursor: pointer;
padding: 0 5px;
}
.choosemask-bottom {
width: 217px;
margin: 0 auto;
}
.choosemask-title {
font-size: 15px;
height: 18px;
line-height: 18px;
text-align: center;
margin-top: 15px;
}
.choosemask-fbs, .choosemask-aj {
width: 84px;
height: 23px;
line-height: 23px;
text-align: center;
background-color: #11a0ca;
color: #fff;
font-size: 12px;
cursor: pointer;
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
}
.choosemask-fbs.on, .choosemask-aj.on {
color: orange;
}
.choosemask-fbs {
float: left;
}
.choosemask-aj {
float: right;
}
.choosemask-twobtn {
margin-top: 36px;
}
</style>
</head>
<body>
<!-- 面包屑 begin -->
<div class="container" style="width: 1200px;">
<div class="row${fluid}">
<div class="span12">
<form id="filterForm" class="form-inline filterForm" action="${ctx}/user/" method="get">
<div class="buttons pull-right" style="margin-left:15px;">
<a href="${ctx}/user/?action=create" class="btn blue pull-right" title="新增"><i
class="icon-plus"></i></a>
</div>
</form>
</div>
</div>
<table class="table table-striped table-advance table-hover">
<thead>
<tr>
<th width="100">ID</th>
<th width="100">用户名</th>
<th width="100">姓名</th>
<th width="100">职位</th>
<th width="100">排序</th>
<th width="100">今日值班</th>
<th width="150">操作</th>
</tr>
</thead>
<c:forEach items="${users}" var="user">
<tr>
<td nowrap="nowrap">
${user.entity.id}
</td>
<td nowrap="nowrap">
${user.entity.name}
</td>
<td nowrap="nowrap">
${user.entity.realName}
</td>
<td nowrap="nowrap">
${user.entity.position}
</td>
<td nowrap="nowrap">
${user.entity.status}
</td>
<td nowrap="nowrap">
<c:choose>
<c:when test="${!user.entity.enabled}">
<span></span>
</c:when>
<c:when test="${user.entity.enabled}">
<span></span>
</c:when>
</c:choose>
</td>
<%-- <shiro:hasPermission name="USER_EDIT"> --%>
<td nowrap="nowrap">
<%--<i class="icon-edit pointer icon-large" title="编辑"--%>
<%--onclick="window.location='${ctx}/user/${user.entity.id}?action=edit'"></i>--%>
<i class="icon-edit pointer icon-large" title="编辑"
onclick="goEdit(${user.entity.id})"></i>
&nbsp;&nbsp;
<i title="删除"
class="icon-minus pointer icon-large"
onclick="deleteById('${user.entity.id}', ${user.hasCustomers},${user.hasCustomersInPlatform})"> </i>
</tr>
</c:forEach>
</table>
</div>
<div id="choosemask" class="choosemask" style="display: none">
<div class="choosemask-wrap" style="width: 500px;height: 200px;">
<div class="choosemask-top">
<span id="choosemask_2" class="choosemask-close" onclick="hiddenChoosemask()" style="">×</span>
</div>
<div class="choosemask-bottom" style="width: 400px;">
<div class="choosemask-title">请选择身份:</div>
<ul class="choosemask-twobtn clearfix" id="fbs">
<li class="choosemask-fbs" onclick="saveIM(3)">新房房博士</li>
<li class="choosemask-fbs" onclick="saveIM(6)" style="margin-left: 10px;">二手房房博士</li>
<li class="choosemask-fbs" onclick="saveIM(10)" style="margin-left: 10px;">租房房博士</li>
<li class="choosemask-fbs" onclick="saveIM(14)" style="margin-left: 10px;">其他房博士</li>
</ul>
<ul class="choosemask-twobtn clearfix">
<li class="choosemask-fbs" onclick="saveIM(7)" id="kefu">客服</li>
<li class="choosemask-fbs" onclick="saveIM(1)" style="margin-left: 10px;">安家顾问</li>
<li class="choosemask-fbs" onclick="saveIM(20)" style="margin-left: 10px;">平台人员</li>
</ul>
</div>
</div>
</div>
<script language="javascript" type="text/javascript" src="${ctx}/resources/customize/js/layer.js"></script>
<script type="text/javascript">
$(document).keydown(function (event) {
if (event.keyCode == "13") {
//回车执行查询
$('#filterForm').submit();
}
});
function identityIM(uid, mobile) {
$.ajax({
url: '${ctx}/user/judgeAdmin',
type: 'GET',
contentType: 'application/json',
dataType: 'json',
cache: false,
success: function (result) {
debugger;
if (result.status != 0) {
$("#kefu").css("display", "none");
$("#fbs").css("display", "none");
}
var choosemask = document.getElementById("choosemask");
choosemask.style.display = "block";
$("#uid").val(uid);
$("#mobile").val(mobile);
}
});
}
function saveIM(identityType) {
var userId = $("#uid").val();
var mobile = $("#mobile").val();
$.ajax({
url: '${ctx}/user/saveIM',
data: {"userId": userId, "mobile": mobile, "identityType": identityType},
type: "GET",
success: function () {
window.location.reload();
}
});
}
function hiddenChoosemask() {
var obj = document.getElementById("choosemask");
obj.style.display = "none";
}
function lock(obj) {
debugger;
if (obj == 257) {
alert("appstore账户,请勿操作");
return;
}
$.ajax({
url: '${ctx}/user/lock/' + obj,
type: "GET",
success: function () {
window.location.reload();
}
});
}
function unlock(obj) {
$.ajax({
url: '${ctx}/user/unlock/' + obj,
type: "GET",
success: function () {
window.location.reload();
}
});
}
function goEdit(id) {
debugger;
if (id == 257) {
alert("appstore账户,请勿操作");
return;
}
var url = "/house365-hgs-web/user/" + id + "?action=edit";
window.location = url;
// window.location.href = url;
<%--window.location='${ctx}/user/ + "" id + "" + ?action=edit';--%>
}
//全选
function checkAll(btn) {
if (btn.checked) {
for (i = 0; i < document.all("memberCheck").length; i++) {
document.all("memberCheck")[i].checked = "checked";
}
}
else {
for (i = 0; i < document.all("memberCheck").length; i++) {
document.all("memberCheck")[i].checked = "";
}
}
}
//单选
function checkMember(btn) {
if (btn.checked) {
var checkAll = true;
for (i = 0; i < document.all("memberCheck").length; i++) {
if (document.all("memberCheck")[i].checked == false) {
checkAll = false;
}
}
if (checkAll) {
document.getElementById("memberCheckAll").checked = true;
}
}
else {
document.getElementById("memberCheckAll").checked = false;
}
}
var deleteById = function (selectedId, hasCustomers,hasCustomersInPlatform) {
var localHasCustomers = false;
/*
id为空则是多选 判断是否为空
为空 提示选择
不为空 确认后删除
不为空单选确认后删除
*/
if (selectedId == "") {
for (i = 0; i < document.getElementsByName('memberCheck').length; i++) {
if (document.getElementsByName('memberCheck')[i].checked) {
selectedId += document.getElementsByName('memberCheck')[i].value + ",";
if ($("input[name='memberCheck']")[i].dataset.hascustomers == "true") {
localHasCustomers = true;
}
}
}
var str = "";
if (selectedId != "") {
str = selectedId.split(",");
if (str[str.length - 1] == "") {
selectedId = selectedId.substring(0, selectedId.length - 1);
}
}
}
if (selectedId == "") {
House365Util.createModal("删除员工", "请至少选择一条员工!", function () {
});
} else {
if (hasCustomers || localHasCustomers) {
House365Util.createModal("删除员工", "员工名下还有客户,请转移交接给其他置业顾问后再删除。", function () {
});
}else if(hasCustomersInPlatform){
House365Util.createModal("删除员工", "员工名下还有客户,请转移交接给其他平台人员后再删除。", function () {
});
} else {
//获取删除用户的绑定楼盘信息
$.ajax({
url: '${ctx}/user/bindPeople/' + selectedId,
type: "GET",
success: function (result) {
console.info(result.data)
if (result.status == 0) {
if(result.data!=null && result.data.length>0){
//员工有绑定的楼盘,不能删除
alert("请在团立方后台解绑该顾问");
return;
}else {
House365Util.createModal("删除员工", "删除后将无法恢复员工账号,请确认是否继续?", function () {
debugger;
if (selectedId.includes("257") == true) {
alert("appstore账户,请勿操作");
return;
}
$.ajax({
url: '${ctx}/user/' + selectedId,
type: "DELETE",
success: function () {
$("input[name='memberCheck']").removeAttr("checked");
window.location.reload();
}
});
});
}
}else{
alert(result.errorMessage);
}
}
});
<%--House365Util.createModal("删除员工", "删除后将无法恢复员工账号,请确认是否继续?", function () {--%>
<%-- debugger;--%>
<%-- if (selectedId.includes("257") == true) {--%>
<%-- alert("appstore账户,请勿操作");--%>
<%-- return;--%>
<%-- }--%>
<%-- $.ajax({--%>
<%-- url: '${ctx}/user/' + selectedId,--%>
<%-- type: "DELETE",--%>
<%-- success: function () {--%>
<%-- $("input[name='memberCheck']").removeAttr("checked");--%>
<%-- window.location.reload();--%>
<%-- }--%>
<%-- });--%>
<%--});--%>
}
}
};
var addWxUser = function () {
$.ajax({
url: '${ctx}/user/saveWxUser',
type: 'POST',
contentType: 'application/json',
data: '',
dataType: 'json',
cache: false,
success: function (result) {
if (result.status == 0) {
alert("同步微信用户成功!");
window.location.reload();
} else {
alert(result.errorMessage);
}
}
});
};
function sycToWechat() {
var selectedId = "";
for (i = 0; i < document.getElementsByName('memberCheck').length; i++) {
if (document.getElementsByName('memberCheck')[i].checked) {
selectedId += document.getElementsByName('memberCheck')[i].value + ",";
}
}
var str = "";
if (selectedId != "") {
str = selectedId.split(",");
if (str[str.length - 1] == "") {
selectedId = selectedId.substring(0, selectedId.length - 1);
}
}
if (selectedId == "") {
House365Util.createModal("同步员工", "请至少选择一条员工!", function () {
});
} else {
House365Util.createModal("确认", "是否继续?", function () {
$.ajax({
url: '${ctx}/user/syncToWechat/' + selectedId,
type: "GET",
success: function (re) {
if ("success" == re) {
layer.open({
content: "操作成功",
time: 2
});
} else if ("fail" == re) {
layer.open({
content: "操作失败",
time: 2
});
}
}
});
});
}
}
function transferDept(obj) {
House365Util.createRemoteModal("请选择部门", "${ctx}/department/transferDept", null, function () {
var treeObj = $.fn.zTree.getZTreeObj("treeSelect1");
var nodes = treeObj.getCheckedNodes(true);
if (nodes[0] == undefined || nodes[0] == null) {
window.location.reload();
return true;
}
$.ajax({
url: '${ctx}/department/transferDept/' + nodes[0].id + '/' + obj,
data: {},
type: "GET",
success: function () {
window.location.reload();
}
});
return true;
});
}
var openAdd = function (id) {
$("#userId").val(id);
$("#bindModal").modal('show');
};
$(document).ready(function () {
$("#searchName").select2({
placeholder: "请选择微信用户",
// 输入几个字符开始联想
minimumInputLength: 1,
// 最大返回记录数
minimumResultsForSearch: 10,
maximumSelectionLength: 1,
minimumSelectionLength: 1,
containerCssClass: "chosen, chosen-with-diselect",
query: function (query) {
$.ajax({
timeout: 1000,
url: "${ctx}/user/getByName",
data: {
userName: query.term
},
type: "GET",
dataType: "json",
success: function (data, status) {
var pageData = {
results: []
};
$.each(data.data, function (i, item) {
pageData.results.push({
id: item.wxId + ',' + item.userName,
text: item.userName + ',' + item.mobile
});
});
query.callback(pageData);
},
error: function () {
var pageData = {
results: []
};
query.callback(pageData);
}
});
}
});
$("#searchName").change(function () {
var $this = $(this);
var chooseName = $this.val();
if (chooseName) {
var tag = chooseName.split(",");
var wxId = tag[0];
$("#wxId").val(wxId);
}
});
});
var bindRelation = function () {
var userId = $("#userId").val();
var wxId = $("#wxId").val();
if (typeof(wxId) == "undefined" || wxId == '' || wxId == null) {
alert("请填写微信用户");
return;
}
var data = {userId: userId, wxId: wxId};
data = JSON.stringify(data);
$.ajax({
url: '${ctx}/user/saveRelation',
type: 'POST',
contentType: 'application/json',
data: data,
dataType: 'json',
cache: false,
success: function (result) {
if (result.status == 0) {
alert("绑定成功!");
$("#bindModal").modal('hide');
window.location.reload();
} else {
alert(result.errorMessage);
}
}
});
};
var backAdd = function () {
$("#bindModal").modal('hide');
};
</script>
<div class="modal fade" id="bindModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h5 class="modal-title" id="myModalLabel">绑定微信用户</h5>
</div>
<input type="hidden" id="userId" class="m-wrap small"/>
<input type="hidden" id="wxId" class="m-wrap small"/>
<div style="margin-top: 10px;" id="tag">
<div style="float: left;width: 80px">
<span class="control-label">微信用户:</span>
</div>
<input id="searchName" name="searchName" style="height: 20px;width: 200px;">
</div>
<div id="btnGive" class="modal-footer" style="margin-top: 20px;">
<button type="button" class="btn btn-primary" onclick="bindRelation()">确认</button>
<button type="button" class="btn btn-primary" onclick="backAdd()">取消</button>
</div>
</div>
</div>
</div>
</body>
</html>
......@@ -134,6 +134,8 @@ public interface IUser extends IService {
List<DutyStaffEntity> getOndutyById(Integer uid);
List<UserEntity> getDutyUserByCity(String cityCodes);
List<UserEntity> getManagerByPid(Integer uid, String managername);
UserEntity getLimitLoginById(String name);
......
......@@ -25,6 +25,8 @@ public interface UserMapper {
List<DutyStaffEntity> getStaffDutyList();
List<UserEntity> getDutyUserByCity(Map<String, Object> map);
UserEntity getLimitLoginById(String name);
void updateDutyStaff(DutyStaffEntity staff);
......
......@@ -131,6 +131,13 @@ public class UserImpl implements IUser {
return userMapper.getOndutyById(uid);
}
@Override
public List<UserEntity> getDutyUserByCity(String cityCode) {
Map<String,Object> param = new HashMap<>();
param.put("cityCode",cityCode);
return userMapper.getDutyUserByCity(param);
}
@Override
public List<LabelEntity> getCustomerLabelById(LabelEntity labelentity) {
return labelmapper.getCustomerLabelById(labelentity);
......
......@@ -191,6 +191,11 @@
select id,name,userId,onduty from duty_staff
</select>
<select id="getDutyUserByCity" resultMap="infoMap">
select a.id,a.name,a.`realName`,a.`position`,b.`onduty` as enabled,b.order as status from user a join `duty_staff` b on a.id = b.userId
where a.`deptUrlPath` REGEXP CONCAT('^', (select urlPath from `department` where `descripition` = #{cityCode})) order by 'b.order'
</select>
<select id="getDutyByCondition" resultMap="infoMap3" parameterType="map">
select id,name,userId,onduty
FROM duty_staff
......
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