Commit 6999b2bc by mengxy

Merge remote-tracking branch 'origin/develop' into develop

parents 1ccc5304 ad8e3800
...@@ -4,6 +4,7 @@ import com.ejweb.core.persistence.CrudDao; ...@@ -4,6 +4,7 @@ import com.ejweb.core.persistence.CrudDao;
import com.ejweb.core.persistence.annotation.MyBatisDao; import com.ejweb.core.persistence.annotation.MyBatisDao;
import com.ejweb.modules.report.entity.ReportAttachmentEntity; import com.ejweb.modules.report.entity.ReportAttachmentEntity;
import com.ejweb.modules.report.entity.ReportEntity; import com.ejweb.modules.report.entity.ReportEntity;
import com.ejweb.modules.sys.entity.Office;
import com.ejweb.modules.sys.entity.User; import com.ejweb.modules.sys.entity.User;
import com.ejweb.modules.workbench.Bean.WorkbenchBean; import com.ejweb.modules.workbench.Bean.WorkbenchBean;
...@@ -60,6 +61,39 @@ public interface ReportDao extends CrudDao<ReportEntity> { ...@@ -60,6 +61,39 @@ public interface ReportDao extends CrudDao<ReportEntity> {
public int updateReportStatus(ReportEntity reportEntity); public int updateReportStatus(ReportEntity reportEntity);
/** /**
* 查询用户
* @param user
* @return
*/
public List<User> findUser(User user);
/**
* 查询公司列表
* @return
*/
public List<Office> getCompanyList();
/**
* 查询部门列表
* @return
*/
public List<Office> getOfficeList();
/**
* 查询职位列表
* @return
*/
public List<User> getPositionList();
/**
* 移交举报
* @param userId
* @param id
* @return
*/
public int modifyExchangeAfterUser(String userId,String id);
/**
* 举报状态数据 * 举报状态数据
*/ */
public List<HashMap> getReportStatus(WorkbenchBean benchBean) throws Exception; public List<HashMap> getReportStatus(WorkbenchBean benchBean) throws Exception;
......
package com.ejweb.modules.report.service; package com.ejweb.modules.report.service;
import com.ejweb.core.persistence.Page;
import com.ejweb.core.service.CrudService; import com.ejweb.core.service.CrudService;
import com.ejweb.core.utils.IdGen; import com.ejweb.core.utils.IdGen;
import com.ejweb.core.utils.StringUtils; import com.ejweb.core.utils.StringUtils;
import com.ejweb.modules.report.dao.ReportDao; import com.ejweb.modules.report.dao.ReportDao;
import com.ejweb.modules.report.entity.ReportAttachmentEntity; import com.ejweb.modules.report.entity.ReportAttachmentEntity;
import com.ejweb.modules.report.entity.ReportEntity; import com.ejweb.modules.report.entity.ReportEntity;
import com.ejweb.modules.sys.entity.Office;
import com.ejweb.modules.sys.entity.User; import com.ejweb.modules.sys.entity.User;
import com.ejweb.modules.sys.utils.UserUtils; import com.ejweb.modules.sys.utils.UserUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -16,7 +18,9 @@ import java.io.File; ...@@ -16,7 +18,9 @@ import java.io.File;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.URLDecoder; import java.net.URLDecoder;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 举报Service * 举报Service
...@@ -173,4 +177,50 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> { ...@@ -173,4 +177,50 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
return null; return null;
} }
} }
/**
* 查询用户
* @param user
* @return
*/
public Page<User> findUserPage(Page<User> page,User user){
user.setPage(page);
page.setList(reportDao.findUser(user));
return page;
}
/**
* 查询公司列表
* @return
*/
public List<Office> getCompanyList(){
return reportDao.getCompanyList();
}
/**
* 查询部门列表
* @return
*/
public List<Office> getOfficeList(){
return reportDao.getOfficeList();
}
/**
* 查询职位列表
* @return
*/
public List<User> getPositionList(){
return reportDao.getPositionList();
}
/**
* 移交举报
* @param userId
* @param id
* @return
*/
@Transactional(readOnly = false)
public int modifyExchangeAfterUser(String userId,String id){
return reportDao.modifyExchangeAfterUser(userId,id);
}
} }
...@@ -6,6 +6,7 @@ import com.ejweb.core.utils.StringUtils; ...@@ -6,6 +6,7 @@ import com.ejweb.core.utils.StringUtils;
import com.ejweb.modules.report.entity.ReportAttachmentEntity; import com.ejweb.modules.report.entity.ReportAttachmentEntity;
import com.ejweb.modules.report.entity.ReportEntity; import com.ejweb.modules.report.entity.ReportEntity;
import com.ejweb.modules.report.service.ReportService; import com.ejweb.modules.report.service.ReportService;
import com.ejweb.modules.sys.entity.Office;
import com.ejweb.modules.sys.entity.User; import com.ejweb.modules.sys.entity.User;
import com.ejweb.modules.sys.utils.UserUtils; import com.ejweb.modules.sys.utils.UserUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
...@@ -173,4 +174,41 @@ public class ReportController extends BaseController { ...@@ -173,4 +174,41 @@ public class ReportController extends BaseController {
return "redirect:" + adminPath + "/report/list/?repage&flag=0"; return "redirect:" + adminPath + "/report/list/?repage&flag=0";
} }
/**
* 移交列表
*
* @param user
* @param model
* @param request
* @param response
* @return
*/
@RequestMapping(value = "viewTransfer")
public String viewTransfer(ReportEntity reportEntity,User user,HttpServletRequest request, HttpServletResponse response, Model model) {
Page<User> page = reportService.findUserPage(new Page<User>(request, response), user);
List<Office> companyList = reportService.getCompanyList();
List<Office> officeList = reportService.getOfficeList();
List<User> positionList = reportService.getPositionList();
model.addAttribute("page", page);
model.addAttribute("companyList", companyList);
model.addAttribute("officeList", officeList);
model.addAttribute("positionList", positionList);
model.addAttribute("User", user);
model.addAttribute("report", reportEntity);
return "modules/report/reportTransfer";
}
/**
* 移交操作
*
* @param userId
* @param model
* @return
*/
@RequestMapping(value = "transfer")
public String transfer(ReportEntity reportEntity,String userId, Model model, RedirectAttributes redirectAttributes) {
reportService.modifyExchangeAfterUser(userId,reportEntity.getId());
addMessage(redirectAttributes, "移交举报"+ reportEntity.getReportProject() + "'成功");
return "redirect:" + adminPath + "/report/list/?repage&flag=0";
}
} }
...@@ -52,6 +52,9 @@ public class User extends DataEntity<User> { ...@@ -52,6 +52,9 @@ public class User extends DataEntity<User> {
private List<Role> roleList = Lists.newArrayList(); // 拥有角色列表 private List<Role> roleList = Lists.newArrayList(); // 拥有角色列表
private String positionName; //职位
public User() { public User() {
super(); super();
this.loginFlag = GConstants.YES; this.loginFlag = GConstants.YES;
...@@ -308,6 +311,14 @@ public class User extends DataEntity<User> { ...@@ -308,6 +311,14 @@ public class User extends DataEntity<User> {
} }
} }
public String getPositionName() {
return positionName;
}
public void setPositionName(String positionName) {
this.positionName = positionName;
}
/** /**
* 用户拥有的角色名称字符串, 多个角色名称用','分隔. * 用户拥有的角色名称字符串, 多个角色名称用','分隔.
*/ */
......
...@@ -198,7 +198,7 @@ ...@@ -198,7 +198,7 @@
update_by = #{updateBy.id}, update_by = #{updateBy.id},
update_date = #{updateDate} update_date = #{updateDate}
WHERE id = #{id} WHERE id = #{id}
</update> </update>
<update id="updateReportStatus"> <update id="updateReportStatus">
UPDATE report SET UPDATE report SET
...@@ -206,13 +206,80 @@ ...@@ -206,13 +206,80 @@
WHERE id = #{id} WHERE id = #{id}
</update> </update>
<update id="delete">
UPDATE sys_area SET <select id="findUser" parameterType="User" resultType="User">
del_flag = #{DEL_FLAG_DELETE} SELECT
WHERE id = #{id} OR parent_ids LIKE su.id AS "id",
<if test="dbName == 'oracle'">'%,'||#{id}||',%'</if> su.`no` AS "no",
<if test="dbName == 'mssql'">'%,'+#{id}+',%'</if> su.`name` AS "name",
<if test="dbName == 'mysql'">CONCAT('%,', #{id}, ',%')</if> su.mobile AS "mobile",
so1.`name` AS "company.name",
so2.`name` AS "office.name",
sp.position_name AS "positionName"
FROM sys_user su
LEFT JOIN sys_office so1 ON so1.id = su.company_id
LEFT JOIN sys_office so2 ON so2.id = su.office_id
LEFT JOIN sys_user2position sup ON sup.user_id = su.id
LEFT JOIN sys_position sp ON sp.id = sup.position_id
<where>
1 = 1
<if test="no != null and no != ''">
AND su.no LIKE
<if test="dbName == 'oracle'">'%'||#{no}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{no}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{no}, '%')</if>
</if>
<if test="name != null and name != ''">
AND su.name LIKE
<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{name}, '%')</if>
</if>
<if test="mobile != null and mobile != ''">
AND su.mobile LIKE
<if test="dbName == 'oracle'">'%'||#{mobile}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{mobile}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{mobile}, '%')</if>
</if>
<if test="company != null and company.id != null and company.id != ''">
AND so1.id = #{company.id}
</if>
<if test="office != null and office.id != null and office.id != ''">
AND so2.id = #{office.id}
</if>
<if test="positionName != null and positionName != ''">
AND sp.position_name = #{positionName}
</if>
</where>
ORDER BY su.update_date DESC
</select>
<select id="getOfficeList" resultType="Office">
SELECT
so.id AS "id",
CONCAT(so.`name`,'(',(SELECT s.`name` FROM sys_office s WHERE s.id = so.parent_id),')') AS "name"
FROM sys_office so
WHERE so.type = '2'
</select>
<select id="getCompanyList" resultType="Office">
SELECT
so.id AS "id",
so.`name` AS "name"
FROM sys_office so
WHERE so.type = '1'
</select>
<select id="getPositionList" resultType="User">
SELECT
position_name AS "positionName"
FROM sys_position
</select>
<update id="modifyExchangeAfterUser" parameterType="HashMap">
UPDATE report SET
exchange_after_user = #{0}
WHERE id = #{1}
</update> </update>
<select id="getReportStatus" parameterType="com.ejweb.modules.workbench.Bean.WorkbenchBean" resultType="java.util.HashMap"> <select id="getReportStatus" parameterType="com.ejweb.modules.workbench.Bean.WorkbenchBean" resultType="java.util.HashMap">
......
...@@ -32,6 +32,18 @@ ...@@ -32,6 +32,18 @@
} }
} }
}); });
$("#btnTransfer").click(function () {
var flag = ${transferFlag};
if (flag == "1"){
var id = "${report.id}";
var url = "${ctx}/report/viewTransfer?id="+id;
window.open(
url,
'newwindow',
'height=600, width=800, left=300, toolbar=no, menubar=no, scrollbars=yes,resizable=yes,location=no, status=no'
);
}
});
}); });
</script> </script>
<style type="text/css"> <style type="text/css">
...@@ -154,14 +166,12 @@ ...@@ -154,14 +166,12 @@
<div class="control-group"> <div class="control-group">
<label class="control-label">移交:</label> <label class="control-label">移交:</label>
<div class="controls"> <div class="controls">
<input id="btnTransfer" class="btn btn-primary" type="button" value="选择移交人员" <input id="btnTransfer" class="btn btn-primary" type="button" value="选择移交人员"/>
<c:if test="${transferFlag eq '0'}">disabled="true" onclick="transfer();" </c:if>/>
</div> </div>
</div> </div>
<div class="form-actions"> <div class="form-actions">
<input id="btnSubmit" class="btn btn-primary" type="submit" value="提交"/>&nbsp; <input id="btnSubmit" class="btn btn-primary" type="submit" value="提交"/>&nbsp;
</div> </div>
</form:form> </form:form>
</body> </body>
</html> </html>
\ No newline at end of file
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>举报管理</title>
<meta name="decorator" content="default"/>
<script type="text/javascript">
$(document).ready(function() {
$("#btnConfirm").click(function () {
var userId = $('input:radio:checked').val();
var id = "${report.id}";
window.location.href = "${ctx}/report/transfer?id="+id+"&userId="+userId;
});
$("input:radio").click(function () {
$("input:radio").attr("checked",false);
$("#chooseItem").empty();
$(this).attr("checked",true);
$("#chooseItem").html("已选择 " + $("input:radio:checked").parent().next().next().next().html()+"<span onclick='remove();'><font size='5'> ×</font></span>");
});
});
function remove(){
$("input:radio").attr("checked",false);
$("#chooseItem").empty();
}
function page(n,s){
$("#pageNo").val(n);
$("#pageSize").val(s);
$("#searchForm").attr("action", "${ctx}/report/viewTransfer");
$("#searchForm").submit();
return false;
}
function resetPageNo() {
$("#pageNo").val(0);
}
</script>
</head>
<body>
<ul class="nav nav-tabs">
<li class="active"><a href="${ctx}/report/viewTransfer">选择移交人员</a></li>
</ul>
<form:form id="searchForm" modelAttribute="user" action="${ctx}/report/viewTransfer?id=${report.id}" method="post" class="breadcrumb form-search">
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
<ul class="ul-form">
<li><label>员工号:</label><form:input onchange="resetPageNo();" path="no" htmlEscape="false" maxlength="50" class="input-small"/></li>
<li><label>姓名:</label><form:input onchange="resetPageNo();" path="name" htmlEscape="false" maxlength="50" class="input-small"/></li>
<li><label>手机号:</label><form:input onchange="resetPageNo();" path="mobile" htmlEscape="false" maxlength="50" class="input-small"/></li>
<li><label>公司:</label><form:select onchange="resetPageNo();" path="company.id" class="input-small ">
<form:option value=" ">请选择</form:option>
<form:options items="${companyList}" itemLabel="name" itemValue="id" htmlEscape="false"/>
</form:select></li>
<li class="clearfix"></li>
<li><label>部门:</label><form:select onchange="resetPageNo();" path="office.id" class="input-small">
<form:option value=" ">请选择</form:option>
<form:options items="${officeList}" itemLabel="name" itemValue="id" htmlEscape="false"/></form:select></li>
<li><label>职位:</label><form:select onchange="resetPageNo();" path="positionName" class="input-small">
<form:option value=" ">请选择</form:option>
<form:options items="${positionList}" itemLabel="positionName" itemValue="positionName" htmlEscape="false"/></form:select></li>
<li class="btns">
<label style="width:auto;"><input id="btnSubmit" class="btn btn-primary" type="submit" value="筛选"/>&nbsp;&nbsp;</label>
</li>
<li class="clearfix"></li>
</ul>
</form:form>
<sys:message content="${message}"/>
<table id="contentTable" class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th>选择</th>
<th>ID</th>
<th>员工号</th>
<th>姓名</th>
<th>手机号</th>
<th>所属公司</th>
<th>所属部门</th>
<th>职位</th>
</tr>
</thead>
<tbody>
<c:if test="${page.list.size()>0}">
<c:forEach items="${page.list}" var="user" varStatus="vs">
<tr>
<td><input type="radio" value="${user.id}"></td>
<td>${vs.count}</td>
<td>${user.no}</td>
<td>${user.name}</td>
<td>${user.mobile}</td>
<td>${user.company.name}</td>
<td>${user.office.name}</td>
<td>${user.positionName}</td>
</tr>
</c:forEach>
</c:if>
</tbody>
</table>
<span id="chooseItem"></span>
<c:if test="${page.list.size()=='0'}">
<span style="color: #999999;margin: 20px 0 70px 20px;display: block;">未查询到相关内容</span>
</c:if>
<c:if test="${page.list.size()>0}">
<div class="pagination">${page}</div>
</c:if>
<li class="btns">
<label style="width:auto;"><input id="btnConfirm" class="btn btn-primary" type="button" value="确定"/>&nbsp;&nbsp;
<input id="btnClose" class="btn btn-primary" type="button" value="关闭" onclick="javascript:window.close();"/></label>
</li>
</body>
</html>
\ 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