Commit f3d92f96 by Java-张振楠

修改代码,以适配融创oracle数据库

parent 0def6d14
...@@ -20,7 +20,7 @@ public interface FrontReportDao extends CrudDao<FrontReportEntity> { ...@@ -20,7 +20,7 @@ public interface FrontReportDao extends CrudDao<FrontReportEntity> {
public Integer insertReportAttachment(ReportAttachmentBean bean); public Integer insertReportAttachment(ReportAttachmentBean bean);
// 查找管理员 // 查找管理员
public User getUser(); public User getUser(User user);
} }
...@@ -42,7 +42,7 @@ public class FrontReportService extends CrudService<FrontReportDao,FrontReportEn ...@@ -42,7 +42,7 @@ public class FrontReportService extends CrudService<FrontReportDao,FrontReportEn
bean.setReportStatus("0"); bean.setReportStatus("0");
// 查询管理员 // 查询管理员
User user = dao.getUser(); User user = dao.getUser(new User());
if(user!= null){ if(user!= null){
bean.setExchangeBeforeUser(user.getId()); bean.setExchangeBeforeUser(user.getId());
} }
......
...@@ -120,7 +120,7 @@ public interface ReportDao extends CrudDao<ReportEntity> { ...@@ -120,7 +120,7 @@ public interface ReportDao extends CrudDao<ReportEntity> {
* 查询管理员ID * 查询管理员ID
* @return * @return
*/ */
public String findAdmin(); public String findAdmin(Office office);
/** /**
* 举报状态数据 * 举报状态数据
......
package com.ejweb.modules.report.service; package com.ejweb.modules.report.service;
import com.ejweb.conf.GConstants;
import com.ejweb.core.persistence.Page; 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;
...@@ -252,7 +253,7 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> { ...@@ -252,7 +253,7 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
reportNotice.setSendToId(reportEntity.getExchangeAfterUser()); reportNotice.setSendToId(reportEntity.getExchangeAfterUser());
reportNotice.setStatus("0"); reportNotice.setStatus("0");
if (StringUtils.isNotBlank(reportEntity.getDealResult())){ if (StringUtils.isNotBlank(reportEntity.getDealResult())){
reportNotice.setSendToId(reportDao.findAdmin()); reportNotice.setSendToId(reportDao.findAdmin(new Office()));
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日"); SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日");
String dateStr = sdf1.format(date); String dateStr = sdf1.format(date);
reportNotice.setTitle("“"+reportEntity.getSupplementTitle()+"”已由"+user.getName()+"于"+dateStr+"处理完成"); reportNotice.setTitle("“"+reportEntity.getSupplementTitle()+"”已由"+user.getName()+"于"+dateStr+"处理完成");
...@@ -268,7 +269,7 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> { ...@@ -268,7 +269,7 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日"); SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日");
String dateStr = sdf1.format(date); String dateStr = sdf1.format(date);
reportNotice.setTitle("“"+reportEntity.getSupplementTitle()+"”已由"+user.getName()+"于"+dateStr+"处理完成"); reportNotice.setTitle("“"+reportEntity.getSupplementTitle()+"”已由"+user.getName()+"于"+dateStr+"处理完成");
reportNotice.setSendToId(reportDao.findAdmin()); reportNotice.setSendToId(reportDao.findAdmin(new Office()));
}else{ }else{
//管理员转交或移交,消息标题为“请处理xxx” //管理员转交或移交,消息标题为“请处理xxx”
reportNotice.setTitle("请处理-“"+reportEntity.getSupplementTitle()+"”"); reportNotice.setTitle("请处理-“"+reportEntity.getSupplementTitle()+"”");
......
...@@ -311,7 +311,13 @@ public class User extends DataEntity<User> { ...@@ -311,7 +311,13 @@ public class User extends DataEntity<User> {
roleList.add(role); roleList.add(role);
} }
} }
/**
* 获取数据库名称
*/
@JsonIgnore
public String getDbName() {
return GConstants.getValue("jdbc.type", "mysql");
}
public Position getPosition() { public Position getPosition() {
return position; return position;
} }
......
...@@ -47,7 +47,8 @@ ...@@ -47,7 +47,8 @@
<include refid="fileColumns"/> <include refid="fileColumns"/>
FROM ct_bbtc_upload_files FROM ct_bbtc_upload_files
WHERE path = #{code} WHERE path = #{code}
<if test="dbName == 'oracle'"> AND rownum &lt;= 1</if>
ORDER BY created DESC ORDER BY created DESC
limit 1 <if test="dbName == 'mysql'"> limit 1</if>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -85,13 +85,14 @@ ...@@ -85,13 +85,14 @@
) )
</insert> </insert>
<select id="getUser" resultType="com.ejweb.modules.sys.entity.User"> <select id="getUser" parameterType="com.ejweb.modules.sys.entity.User" resultType="com.ejweb.modules.sys.entity.User">
SELECT u.id SELECT u.id
FROM ct_bbtc_sys_user u FROM ct_bbtc_sys_user u
LEFT JOIN ct_bbtc_sys_user2role u2r ON u2r.user_id = u.id LEFT JOIN ct_bbtc_sys_user2role u2r ON u2r.user_id = u.id
LEFT JOIN ct_bbtc_sys_role r ON r.id = u2r.role_id LEFT JOIN ct_bbtc_sys_role r ON r.id = u2r.role_id
WHERE r.enname = 'admin' WHERE r.enname = 'admin' AND u.del_flag = 0
limit 1 <if test="dbName == 'oracle'"> AND rownum &lt;= 1</if>
<if test="dbName == 'mysql'"> limit 1</if>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
LEFT JOIN ct_bbtc_sys_area sac ON sac.id = so1.area_id LEFT JOIN ct_bbtc_sys_area sac ON sac.id = so1.area_id
LEFT JOIN ct_bbtc_sys_area sao ON sao.id = so2.area_id LEFT JOIN ct_bbtc_sys_area sao ON sao.id = so2.area_id
<where> <where>
1 = 1 1 = 1 AND su.del_flag = 0
<if test="no != null and no != ''"> <if test="no != null and no != ''">
AND su.no LIKE AND su.no LIKE
<if test="dbName == 'oracle'">'%'||#{no}||'%'</if> <if test="dbName == 'oracle'">'%'||#{no}||'%'</if>
...@@ -349,7 +349,7 @@ ...@@ -349,7 +349,7 @@
AND r.exchange_type = #{exchangeType} AND r.exchange_type = #{exchangeType}
</select> </select>
<select id="findAdmin" resultType="String"> <select id="findAdmin" parameterType="Office" resultType="String">
SELECT SELECT
su.id su.id
FROM FROM
...@@ -358,6 +358,8 @@ ...@@ -358,6 +358,8 @@
LEFT JOIN ct_bbtc_sys_role sr ON sr.id = sur.role_id LEFT JOIN ct_bbtc_sys_role sr ON sr.id = sur.role_id
WHERE WHERE
sr.name = '系统管理员' sr.name = '系统管理员'
<if test="dbName == 'oracle'"> AND rownum &lt;= 1</if>
<if test="dbName == 'mysql'"> limit 1</if>
</select> </select>
<insert id="addRecord"> <insert id="addRecord">
......
...@@ -100,13 +100,14 @@ ...@@ -100,13 +100,14 @@
</select> </select>
<select id="getCompany" resultType="Office"> <select id="getCompany" parameterType="Office" resultType="Office">
SELECT SELECT
<include refid="officeColumns"/> <include refid="officeColumns"/>
FROM ct_bbtc_sys_office a FROM ct_bbtc_sys_office a
<include refid="officeJoins"/> <include refid="officeJoins"/>
WHERE a.del_flag = #{DEL_FLAG_NORMAL} AND a.parent_id='1' WHERE a.del_flag = #{DEL_FLAG_NORMAL} AND a.parent_id='1'
limit 1 <if test="dbName == 'oracle'"> AND rownum &lt;= 1</if>
<if test="dbName == 'mysql'"> limit 1</if>
</select> </select>
<insert id="insert"> <insert id="insert">
INSERT INTO ct_bbtc_sys_office( INSERT INTO ct_bbtc_sys_office(
......
...@@ -11,11 +11,32 @@ ...@@ -11,11 +11,32 @@
$("#btnTrack").click(function () { $("#btnTrack").click(function () {
window.location.href = "${ctx}/report/track?id=${report.id}"; window.location.href = "${ctx}/report/track?id=${report.id}";
}); });
$("#btnDocument").click(function () {
$("#inputForm").attr("action", "${ctx}/report/document?id=${report.id}");
$("#inputForm").submit();
});
}); });
var requestFlag = true;
function openDownloadDialog(id){
if (requestFlag == true){
$.ajax({
url: "${ctx}/report/document?id="+id,
dataType: "text",
traditional: true,//这里设置为true
cache: false,
beforeSend: function () {
requestFlag = false;
},
success: function(url) { //登录成功后返回的数据
window.open(url, "_blank");
},
error:function(){
alert("数据错误!");
},
complete: function () {
requestFlag = true;
}
});
}else{
top.$.jBox.tip('正在加载,请稍等', 'warning');
}
}
</script> </script>
<style type="text/css"> <style type="text/css">
.title{ .title{
...@@ -148,8 +169,9 @@ ...@@ -148,8 +169,9 @@
</div> </div>
</div> </div>
<li class="btns"> <li class="btns">
<label style="width:auto;"><input id="btnTrack" class="btn btn-primary" type="button" value="跟踪"/>&nbsp;&nbsp; <label style="width:auto;">
<input id="btnDocument" class="btn btn-primary" type="button" value="转为文档"/>&nbsp;&nbsp; <c:if test="${report.reportStatus != '2'}"><input id="btnTrack" class="btn btn-primary" type="button" value="跟踪"/>&nbsp;&nbsp;</c:if>
<input id="btnDocument" class="btn btn-primary" type="button" value="转为文档" onclick="openDownloadDialog('${report.id}')"/>&nbsp;&nbsp;
<input id="btnReturn" class="btn btn-primary" type="button" value="返回" onclick="history.go(-1)"/></label> <input id="btnReturn" class="btn btn-primary" type="button" value="返回" onclick="history.go(-1)"/></label>
</li> </li>
</form:form> </form:form>
......
...@@ -147,6 +147,12 @@ ...@@ -147,6 +147,12 @@
<form:radiobutton path="supplementArea" value="North China" checked="true"/>华北区域公司 <form:radiobutton path="supplementArea" value="North China" checked="true"/>华北区域公司
<form:radiobutton path="supplementArea" value="BeiJing"/>北京区域公司 <form:radiobutton path="supplementArea" value="BeiJing"/>北京区域公司
<form:radiobutton path="supplementArea" value="ShangHai"/>上海区域公司 <form:radiobutton path="supplementArea" value="ShangHai"/>上海区域公司
<form:radiobutton path="supplementArea" value="SouthWest"/>西南区域公司
<form:radiobutton path="supplementArea" value="SouthEast"/>东南区域公司
<form:radiobutton path="supplementArea" value="Central China"/>华中区域公司
<form:radiobutton path="supplementArea" value="GuangShen"/>广深区域公司
<form:radiobutton path="supplementArea" value="Hainan"/>海南区域公司
<form:radiobutton path="supplementArea" value="Group"/>集团本部
<span class="help-inline"><font color="red">*</font> </span> <span class="help-inline"><font color="red">*</font> </span>
</div> </div>
</div> </div>
......
...@@ -229,9 +229,9 @@ ...@@ -229,9 +229,9 @@
</label> </label>
</li> </li>
<li style="float: right"><label>至:</label><input id="endDate" name="endDate" readonly="readonly" type="text" <li style="float: right"><label>至:</label><input id="endDate" name="endDate" readonly="readonly" type="text"
maxlength="200" class="Wdate" style="width: auto" onFocus="WdatePicker({lang:'zh-cn'})" value="${workbench.endDate}" /></li> maxlength="200" class="Wdate" style="width: auto" onFocus="WdatePicker({lang:'zh-cn',minDate:'#F{$dp.$D(\'startDate\')}'})" value="${workbench.endDate}" /></li>
<li style="float: right"><label>日期:</label><input id="startDate" name="startDate" readonly="readonly" type="text" <li style="float: right"><label>日期:</label><input id="startDate" name="startDate" readonly="readonly" type="text"
maxlength="200" class="Wdate" style="width: auto" onFocus="WdatePicker({lang:'zh-cn'})" value="${workbench.startDate}" /></li> maxlength="200" class="Wdate" style="width: auto" onFocus="WdatePicker({lang:'zh-cn',maxDate:'#F{$dp.$D(\'endDate\')}'})" value="${workbench.startDate}" /></li>
</ul> </ul>
<ul class="ul-form"> <ul class="ul-form">
<div> <div>
......
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