Commit 0def6d14 by Java-李昕颖

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

parents ee9d8cf5 aaf7757b
......@@ -80,7 +80,7 @@ public interface ReportDao extends CrudDao<ReportEntity> {
* 查询部门列表
* @return
*/
public List<Office> getOfficeList();
public List<Office> getOfficeList(Office office);
/**
* 查询职位列表
......
......@@ -217,8 +217,8 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
* 查询部门列表
* @return
*/
public List<Office> getOfficeList(){
return reportDao.getOfficeList();
public List<Office> getOfficeList(Office office){
return reportDao.getOfficeList(office);
}
/**
......
......@@ -152,7 +152,7 @@ public class ReportController extends BaseController {
User user = UserUtils.getUser();
boolean isAdmin = reportService.checkRole(user);
List<Office> companyList = reportService.getCompanyList();
List<Office> officeList = reportService.getOfficeList();
List<Office> officeList = reportService.getOfficeList(new Office());
List<Position> positionList = reportService.getPositionList();
User userEntity = new User();
Page<User> page = reportService.findUserPage(new Page<User>(request, response), userEntity);
......
......@@ -106,7 +106,7 @@ public class SystemService extends BaseService implements InitializingBean {
/**
* 通过部门ID获取用户列表,仅返回用户id和name(树查询用户时用)
* @param user
* @param officeId
* @return
*/
@SuppressWarnings("unchecked")
......@@ -145,6 +145,7 @@ public class SystemService extends BaseService implements InitializingBean {
public void saveUser(User user) {
if (StringUtils.isBlank(user.getId())){
user.preInsert();
user.setPassword(SystemService.entryptPassword("123456"));
userDao.insert(user);
}else{
// 清除原用户机构用户缓存
......@@ -161,8 +162,8 @@ public class SystemService extends BaseService implements InitializingBean {
userDao.deleteUserRole(user);
if (user.getRoleList() != null && user.getRoleList().size() > 0){
userDao.insertUserRole(user);
}else{
throw new ServiceException(user.getLoginName() + "没有设置角色!");
// }else{
// throw new ServiceException(user.getLoginName() + "没有设置角色!");
}
// 将当前用户同步到Activiti
saveActivitiUser(user);
......
package com.ejweb.modules.workbench.Bean;
import com.ejweb.conf.GConstants;
import com.fasterxml.jackson.annotation.JsonIgnore;
/**
* Created by mengxy on 2017/9/11.
*/
......@@ -49,6 +52,14 @@ public class WorkbenchBean {
public WorkbenchBean() {
}
/**
* 获取数据库名称
*/
@JsonIgnore
public String getDbName() {
return GConstants.getValue("jdbc.type", "mysql");
}
public int getRepStatusTotal() {
return repStatusTotal;
}
......
......@@ -274,7 +274,7 @@
ORDER BY su.update_date DESC
</select>
<select id="getOfficeList" resultType="Office">
<select id="getOfficeList" parameterType="Office" resultType="Office">
SELECT
so.id AS "id",
<if test="dbName == 'oracle'">so.name||'('||(SELECT s.name FROM ct_bbtc_sys_office s WHERE s.id = so.parent_id)||')' AS "name"</if>
......@@ -386,11 +386,11 @@
AND exchange_after_user = #{isAdmin}
</if>
<if test="startDate != null">
AND create_date >= #{startDate}
AND create_date >= to_date(#{startDate}, 'yyyy-MM-dd')
</if>
<if test="endDate != null">
<if test="dbName == 'oracle'"> AND create_date &lt;= #{endDate}||" 23:59:59"</if>
<if test="dbName == 'mysql'"> AND create_date &lt;= CONCAT(#{endDate}," 23:59:59")</if>
<if test="dbName == 'oracle'"> AND create_date &lt;= to_date( #{endDate}|| ' 23:59:59', 'yyyy-MM-dd hh24:mi:ss')</if>
<if test="dbName == 'mysql'"> AND create_date &lt;= CONCAT(#{endDate},' 23:59:59')</if>
</if>
GROUP BY report_status
</select>
......@@ -403,11 +403,11 @@
AND exchange_after_user = #{isAdmin}
</if>
<if test="startDate != null">
AND create_date >= #{startDate}
AND create_date >= to_date(#{startDate}, 'yyyy-MM-dd')
</if>
<if test="endDate != null">
<if test="dbName == 'oracle'"> AND create_date &lt;= #{endDate}||" 23:59:59"</if>
<if test="dbName == 'mysql'"> AND create_date &lt;= CONCAT(#{endDate}," 23:59:59")</if>
<if test="dbName == 'oracle'"> AND create_date &lt;= to_date( #{endDate}|| ' 23:59:59', 'yyyy-MM-dd hh24:mi:ss')</if>
<if test="dbName == 'mysql'"> AND create_date &lt;= CONCAT(#{endDate},' 23:59:59')</if>
</if>
GROUP BY deal_result
</select>
......@@ -420,11 +420,11 @@
AND exchange_after_user = #{isAdmin}
</if>
<if test="startDate != null">
AND create_date >= #{startDate}
AND create_date >= to_date(#{startDate}, 'yyyy-MM-dd')
</if>
<if test="endDate != null">
<if test="dbName == 'oracle'"> AND create_date &lt;= #{endDate}||" 23:59:59"</if>
<if test="dbName == 'mysql'"> AND create_date &lt;= CONCAT(#{endDate}," 23:59:59")</if>
<if test="dbName == 'oracle'"> AND create_date &lt;= to_date( #{endDate}|| ' 23:59:59', 'yyyy-MM-dd hh24:mi:ss')</if>
<if test="dbName == 'mysql'"> AND create_date &lt;= CONCAT(#{endDate},' 23:59:59')</if>
</if>
GROUP BY report_source
</select>
......@@ -437,11 +437,11 @@
AND exchange_after_user = #{isAdmin}
</if>
<if test="startDate != null">
AND create_date >= #{startDate}
AND create_date >= to_date(#{startDate}, 'yyyy-MM-dd')
</if>
<if test="endDate != null">
<if test="dbName == 'oracle'"> AND create_date &lt;= #{endDate}||" 23:59:59"</if>
<if test="dbName == 'mysql'"> AND create_date &lt;= CONCAT(#{endDate}," 23:59:59")</if>
<if test="dbName == 'oracle'"> AND create_date &lt;= to_date( #{endDate}|| ' 23:59:59', 'yyyy-MM-dd hh24:mi:ss')</if>
<if test="dbName == 'mysql'"> AND create_date &lt;= CONCAT(#{endDate},' 23:59:59')</if>
</if>
GROUP BY supplement_type
</select>
......@@ -481,14 +481,15 @@
AND r.exchange_after_user = #{isAdmin}
</if>
<if test="startDate != null">
AND r.create_date >= #{startDate}
AND r.create_date >= to_date(#{startDate}, 'yyyy-MM-dd')
</if>
<if test="endDate != null">
<if test="dbName == 'oracle'"> AND create_date &lt;= #{endDate}||" 23:59:59"</if>
<if test="dbName == 'mysql'"> AND create_date &lt;= CONCAT(#{endDate}," 23:59:59")</if>
<if test="dbName == 'oracle'"> AND create_date &lt;= to_date( #{endDate}|| ' 23:59:59', 'yyyy-MM-dd hh24:mi:ss')</if>
<if test="dbName == 'mysql'"> AND create_date &lt;= CONCAT(#{endDate},' 23:59:59')</if>
</if>
<if test="dbName == 'oracle'"> AND rownum &lt;= 10</if>
order by r.create_date desc
limit 0,10
<if test="dbName == 'mysql'"> limit 0,10</if>
</select>
<select id="getChooseReportList" parameterType="com.ejweb.modules.report.entity.ReportEntity" resultType="com.ejweb.modules.report.entity.ReportEntity">
......
......@@ -164,7 +164,7 @@
<li><a href="${ctx}/sys/user/modifyPwd" target="mainFrame"><i class="icon-lock"></i>&nbsp; 修改密码</a></li>
</ul>--%>
</li>
<c:if test="${fns:getUser().id eq '1'}"><li><a href="${ctx}/logout" title="退出登录">退出</a></li></c:if>
<%--<c:if test="${fns:getUser().id eq '1'}"><li><a href="${ctx}/logout" title="退出登录">退出</a></li></c:if>--%>
<li>&nbsp;</li>
</ul>
<%-- <c:if test="${cookie.theme.value eq 'cerulean'}">
......
......@@ -148,7 +148,7 @@
<li><a href="${ctx}/sys/user/modifyPwd" target="mainFrame"><i class="icon-lock"></i>&nbsp; 修改密码</a></li>
</ul>--%>
</li>
<li><a href="${ctx}/logout" title="退出登录">退出</a></li>
<li><%--<a href="${ctx}/logout" title="退出登录">退出</a>--%></li>
<li>&nbsp;</li>
</ul>
<%--<c:if test="${cookie.theme.value eq 'cerulean'}"> --%>
......
......@@ -40,13 +40,13 @@
<form:form id="inputForm" modelAttribute="user" action="${ctx}/sys/user/save" method="post" class="form-horizontal">
<form:hidden path="id"/>
<sys:message content="${message}"/>
<div class="control-group">
<%--<div class="control-group">
<label class="control-label">头像:</label>
<div class="controls">
<form:hidden id="nameImage" path="photo" htmlEscape="false" maxlength="255" class="input-xlarge"/>
<sys:ckfinder input="nameImage" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
</div>
</div>
</div>--%>
<%--<div class="control-group">
<label class="control-label">归属公司:</label>
<div class="controls">
......@@ -61,13 +61,13 @@
title="部门" url="/sys/office/treeData?type=2" notAllowSelectParent="true"/>
</div>
</div>--%>
<div class="control-group">
<%--<div class="control-group">
<label class="control-label">工号:</label>
<div class="controls">
<form:input path="no" htmlEscape="false" maxlength="50" class="required"/>
<span class="help-inline"><font color="red">*</font> </span>
</div>
</div>
</div>--%>
<div class="control-group">
<label class="control-label">姓名:</label>
<div class="controls">
......@@ -83,7 +83,7 @@
<span class="help-inline"><font color="red">*</font> </span>
</div>
</div>
<div class="control-group">
<%--<div class="control-group">
<label class="control-label">密码:</label>
<div class="controls">
<input id="newPassword" name="newPassword" type="password" value="" maxlength="50" minlength="3" class="${empty user.id?'required':''}"/>
......@@ -124,7 +124,7 @@
</form:select>
<span class="help-inline"><font color="red">*</font> “是”代表此账号允许登录,“否”则表示此账号不允许登录</span>
</div>
</div>
</div>--%>
<%-- <div class="control-group">
<label class="control-label">用户类型:</label>
<div class="controls">
......@@ -134,7 +134,7 @@
</form:select>
</div>
</div>--%>
<div class="control-group">
<%--<div class="control-group">
<label class="control-label">用户角色:</label>
<div class="controls">
<form:checkboxes path="roleIdList" items="${allRoles}" itemLabel="name" itemValue="id" htmlEscape="false" class="required"/>
......@@ -160,7 +160,7 @@
<label class="lbl">IP: ${user.loginIp}&nbsp;&nbsp;&nbsp;&nbsp;时间:<fmt:formatDate value="${user.loginDate}" type="both" dateStyle="full"/></label>
</div>
</div>
</c:if>
</c:if>--%>
<div class="form-actions">
<shiro:hasPermission name="sys:user:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
......
......@@ -65,7 +65,7 @@
</c:if>
</tbody>
</table>
<c:if test="${noticePage.list.size()=='0'}">
<c:if test="${noticePage.list == null}">
<span style="color: #999999;margin: 20px 0 70px 20px;display: block;">未查询到相关内容</span>
</c:if>
<c:if test="${noticePage.list.size()>0}">
......
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