Commit eb6fd0c8 by Java-张振楠

Merge branch 'develop' of ssh://git.okayapps.com:5859/java-sunac-report/sunac_report into develop

parents f2b787a3 23e9d3d2
...@@ -3,11 +3,13 @@ package com.ejweb.modules.report.service; ...@@ -3,11 +3,13 @@ package com.ejweb.modules.report.service;
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;
import com.ejweb.core.utils.SpringContextHolder;
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.report.entity.ReportExchangeHistory; import com.ejweb.modules.report.entity.ReportExchangeHistory;
import com.ejweb.modules.sys.dao.RoleDao;
import com.ejweb.modules.sys.entity.Office; import com.ejweb.modules.sys.entity.Office;
import com.ejweb.modules.sys.entity.Position; import com.ejweb.modules.sys.entity.Position;
import com.ejweb.modules.sys.entity.Role; import com.ejweb.modules.sys.entity.Role;
...@@ -39,6 +41,9 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> { ...@@ -39,6 +41,9 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
@Autowired @Autowired
private ReportDao reportDao; private ReportDao reportDao;
@Autowired
private RoleDao roleDao;
/** /**
* 查询附件 * 查询附件
* @param reportAttachmentEntity * @param reportAttachmentEntity
...@@ -244,6 +249,12 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> { ...@@ -244,6 +249,12 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
reportNotice.setSendFromId(user.getId()); reportNotice.setSendFromId(user.getId());
reportNotice.setSendToId(reportEntity.getExchangeAfterUser()); reportNotice.setSendToId(reportEntity.getExchangeAfterUser());
reportNotice.setStatus("0"); reportNotice.setStatus("0");
if (StringUtils.isNotBlank(reportEntity.getDealResult())){
reportNotice.setSendToId(reportDao.findAdmin());
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日");
String dateStr = sdf1.format(date);
reportNotice.setTitle("“"+reportEntity.getSupplementTitle()+"”已由"+user.getName()+"于"+dateStr+"处理完成");
}
reportDao.updateReportNotice(reportNotice); reportDao.updateReportNotice(reportNotice);
}else{ }else{
//消息表中不存在该条举报的信息,新增记录 //消息表中不存在该条举报的信息,新增记录
...@@ -391,7 +402,9 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> { ...@@ -391,7 +402,9 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
*/ */
public boolean checkRole(User user) { public boolean checkRole(User user) {
boolean isAdmin = false; boolean isAdmin = false;
List<Role> roleList = UserUtils.getRoleList(); Role roleEntity = new Role();
roleEntity.setUser(user);
List<Role> roleList = roleDao.findList(roleEntity);
if (roleList != null && roleList.size() != 0){ if (roleList != null && roleList.size() != 0){
for (Role role : roleList){ for (Role role : roleList){
if (role.getName().equals("系统管理员")){ if (role.getName().equals("系统管理员")){
......
...@@ -176,12 +176,13 @@ public class ReportController extends BaseController { ...@@ -176,12 +176,13 @@ public class ReportController extends BaseController {
* @return * @return
*/ */
@RequestMapping(value = "addTrack") @RequestMapping(value = "addTrack")
public String addTrack(ReportEntity reportEntity, Model model, RedirectAttributes redirectAttributes) { public String addTrack(ReportEntity reportEntity,HttpServletRequest request, Model model, RedirectAttributes redirectAttributes) {
if (!beanValidator(model, reportEntity)) { if (!beanValidator(model, reportEntity)) {
return form(reportEntity, model); return form(reportEntity, model);
} }
reportService.saveTrack(reportEntity); reportService.saveTrack(reportEntity);
if (StringUtils.isNotBlank(reportEntity.getExchangeAfterUser())){ String exchangeAfterUser = request.getParameter("exchangeAfterUser");
if (StringUtils.isNotBlank(exchangeAfterUser)){
reportService.addNotice(reportEntity,"transfer"); reportService.addNotice(reportEntity,"transfer");
reportService.addRecord(reportEntity,"1"); reportService.addRecord(reportEntity,"1");
} }
......
...@@ -187,7 +187,7 @@ ...@@ -187,7 +187,7 @@
$("#userList").html($(data)); $("#userList").html($(data));
}, },
error:function(){ error:function(){
alert("数据错误!"); alert("请选择需要移交的数据!");
}, },
complete: function () { complete: function () {
$("#btnSearch").removeAttr("disabled"); $("#btnSearch").removeAttr("disabled");
......
...@@ -9,13 +9,18 @@ ...@@ -9,13 +9,18 @@
$(document).ready(function () { $(document).ready(function () {
$("#inputForm").validate({ $("#inputForm").validate({
submitHandler: function (form) { submitHandler: function (form) {
if ($("#reportContent").val() == ""){
top.$.jBox.tip('请填写内容', 'warning');
}else {
submitCount += 1; submitCount += 1;
if(submitCount == 1){ if (submitCount == 1) {
$("#checkFile").hide();
loading('正在提交,请稍等...'); loading('正在提交,请稍等...');
form.submit(); form.submit();
}else{ } else {
return false; return false;
} }
}
}, },
errorContainer: "#messageBox", errorContainer: "#messageBox",
errorPlacement: function (error, element) { errorPlacement: function (error, element) {
...@@ -62,6 +67,7 @@ ...@@ -62,6 +67,7 @@
<label class="control-label">内容:</label> <label class="control-label">内容:</label>
<div class="controls"> <div class="controls">
<form:textarea id="reportContent" htmlEscape="true" path="reportContent" rows="4" maxlength="500" class="input-xxlarge"/> <form:textarea id="reportContent" htmlEscape="true" path="reportContent" rows="4" maxlength="500" class="input-xxlarge"/>
<span class="help-inline"><font color="red">*</font> </span>
</div> </div>
</div> </div>
</div> </div>
...@@ -78,22 +84,19 @@ ...@@ -78,22 +84,19 @@
<div class="control-group"> <div class="control-group">
<label class="control-label">姓名:</label> <label class="control-label">姓名:</label>
<div class="controls"> <div class="controls">
<form:input path="reportPersonName" htmlEscape="false" maxlength="200" class="input-xlarge required"/> <form:input path="reportPersonName" htmlEscape="false" maxlength="200" class="input-xlarge"/>
<span class="help-inline"><font color="red">*</font> </span>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label">手机号:</label> <label class="control-label">手机号:</label>
<div class="controls"> <div class="controls">
<form:input path="reportPersonTel" htmlEscape="false" maxlength="200" class="input-xlarge required"/> <form:input path="reportPersonTel" htmlEscape="false" maxlength="200" class="input-xlarge"/>
<span class="help-inline"><font color="red">*</font> </span>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label">Email:</label> <label class="control-label">Email:</label>
<div class="controls"> <div class="controls">
<form:input path="reportPersonEmail" htmlEscape="false" maxlength="200" class="input-xlarge required"/> <form:input path="reportPersonEmail" htmlEscape="false" maxlength="200" class="input-xlarge"/>
<span class="help-inline"><font color="red">*</font> </span>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
......
...@@ -203,7 +203,7 @@ ...@@ -203,7 +203,7 @@
<div class="control-group"> <div class="control-group">
<label class="control-label">移交:</label> <label class="control-label">移交:</label>
<div class="controls"> <div class="controls">
<form:hidden id="userId" path="exchangeAfterUser" value=""/> <input type="text" id="userId" name="exchangeAfterUser" value="" style="display:none;"/>
<input id="chooseUser" type="text" value="选择移交人员" <c:if test="${isAdmin eq false}">disabled="true"</c:if> htmlEscape="false" maxlength="200" class="input-xlarge"/> <input id="chooseUser" type="text" value="选择移交人员" <c:if test="${isAdmin eq false}">disabled="true"</c:if> htmlEscape="false" maxlength="200" class="input-xlarge"/>
</div> </div>
</div> </div>
......
...@@ -53,10 +53,7 @@ ...@@ -53,10 +53,7 @@
<c:forEach items="${noticePage.list}" var="notice" varStatus="vs"> <c:forEach items="${noticePage.list}" var="notice" varStatus="vs">
<tr> <tr>
<td>${vs.count}</td> <td>${vs.count}</td>
<td> <td><a href="${ctx}/notice/view?id=${notice.id}&reportId=${notice.reportId}">${notice.title}。</a></td>
<c:if test="${isAdmin eq 'Y'}"><a href="${ctx}/notice/view?id=${notice.id}&reportId=${notice.reportId}">"${notice.title}"-已由${notice.sendFromId}于${notice.sendTime}处理完成。</a></c:if>
<c:if test="${isAdmin eq 'N'}"><a href="${ctx}/notice/view?id=${notice.id}&reportId=${notice.reportId}">请处理-"${notice.title}"。</a></c:if>
</td>
<td>${notice.sendTime}</td> <td>${notice.sendTime}</td>
<td>${notice.sendFromId}</td> <td>${notice.sendFromId}</td>
<td> <td>
......
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