Commit 1baecdb2 by mengxy

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

parents 0a550977 5663def1
package com.ejweb.core.filter;
/**
* Created by BrianHolsen on 2017-07-26 at 15:52.
*/
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Servlet Filter implementation class CORSFilter
*/
public class CORSFilter implements Filter {
/**
* Default constructor.
*/
public CORSFilter() {
// TODO Auto-generated constructor stub
}
/**
* @see Filter#destroy()
*/
public void destroy() {
// TODO Auto-generated method stub
}
/**
* @see Filter#doFilter(ServletRequest, ServletResponse, FilterChain)
*/
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain chain)
throws IOException, ServletException {
HttpServletRequest request = (HttpServletRequest) servletRequest;
System.out.println("CORSFilter HTTP Request: " + request.getMethod());
// Authorize (allow) all domains to consume the content
((HttpServletResponse) servletResponse).addHeader("Access-Control-Allow-Origin", "*");
((HttpServletResponse) servletResponse).addHeader("Access-Control-Allow-Methods","GET, OPTIONS, HEAD, PUT, POST");
HttpServletResponse resp = (HttpServletResponse) servletResponse;
// For HTTP OPTIONS verb/method reply with ACCEPTED status code -- per CORS handshake
if (request.getMethod().equals("OPTIONS")) {
resp.setStatus(HttpServletResponse.SC_ACCEPTED);
return;
}
// pass the request along the filter chain
chain.doFilter(request, servletResponse);
}
/**
* @see Filter#init(FilterConfig)
*/
public void init(FilterConfig fConfig) throws ServletException {
// TODO Auto-generated method stub
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.ejweb.modules.front.report.bean;
import com.ejweb.core.base.BaseBean;
import java.util.Date;
import java.util.List;
/**
......@@ -31,6 +32,11 @@ public class FrontReportBean extends BaseBean{
private String dealResult; //varchar(255) DEFAULT NULL COMMENT '处理结论 1 投诉 2 举报无效 3 举报属实',
private String exchangeBeforeUser; //varchar(255) DEFAULT NULL COMMENT '移交/转交前用户id',
private String exchangeAfterUser; //varchar(255) DEFAULT NULL COMMENT '移交/转交后用户id(只记录最新的移交用户,此处不记录历史)',
private String createBy; //创建人
private Date createDate; //创建时间
private String updateBy; //更新人\
private Date updateDate; //更新时间
private String code;// 验证码返回的code
private String captcha;// 验证码
......@@ -235,4 +241,36 @@ public class FrontReportBean extends BaseBean{
public void setCode(String code) {
this.code = code;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public Date getUpdateDate() {
return updateDate;
}
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate;
}
}
......@@ -5,6 +5,7 @@ import com.ejweb.core.persistence.annotation.MyBatisDao;
import com.ejweb.modules.front.report.bean.FrontReportBean;
import com.ejweb.modules.front.report.bean.ReportAttachmentBean;
import com.ejweb.modules.front.report.entity.FrontReportEntity;
import com.ejweb.modules.sys.entity.User;
/**
* Created by lenovo on 2017/9/8.
......@@ -18,5 +19,8 @@ public interface FrontReportDao extends CrudDao<FrontReportEntity> {
// 添加举报附件
public Integer insertReportAttachment(ReportAttachmentBean bean);
// 查找管理员
public User getUser();
}
......@@ -4,14 +4,17 @@ import com.ejweb.conf.ErrorCode;
import com.ejweb.conf.GConstants;
import com.ejweb.core.api.ResponseBean;
import com.ejweb.core.service.CrudService;
import com.ejweb.core.utils.DateUtils;
import com.ejweb.core.utils.IdWorker;
import com.ejweb.modules.front.report.bean.FrontReportBean;
import com.ejweb.modules.front.report.bean.ReportAttachmentBean;
import com.ejweb.modules.front.report.dao.FrontReportDao;
import com.ejweb.modules.front.report.entity.FrontReportEntity;
import com.ejweb.modules.sys.entity.User;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
......@@ -28,6 +31,24 @@ public class FrontReportService extends CrudService<FrontReportDao,FrontReportEn
public ResponseBean addReport(FrontReportBean bean){
ResponseBean responseBean = new ResponseBean();
bean.setId(IdWorker.getNextId("R"));
Date date = new Date();
bean.setReportTime(DateUtils.formatDate(date,"yyyy-MM-dd HH:mm:ss"));
// 现在写的是微信公众号,可能不是这个
bean.setReportSource("wechat");
bean.setReportStatus("0");
// 查询管理员
User user = dao.getUser();
if(user!= null){
bean.setExchangeBeforeUser(user.getId());
}
bean.setCreateBy(user.getId());
bean.setUpdateBy(user.getId());
bean.setCreateDate(date);
bean.setUpdateDate(date);
//
// bean.setExchangeBeforeUser("");
// 添加举报信息表
int row = dao.insertReport(bean);
if(row == 1){ // 添加成功
......
package com.ejweb.modules.front.sso.api;
import com.ejweb.conf.ErrorCode;
import com.ejweb.conf.GConstants;
import com.ejweb.core.api.ResponseBean;
import com.ejweb.core.base.BaseController;
import com.ejweb.modules.front.sso.service.SsoService;
import com.kingdee.eas.cp.eip.sso.ltpa.LtpaToken;
import com.kingdee.eas.cp.eip.sso.ltpa.LtpaTokenManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.List;
/**
* Created by zhangzn on 2017/09/13.
*/
@RestController
@RequestMapping("/api/front/sso")
public class SsoController extends BaseController {
@Autowired
private SsoService ssoService;
@RequestMapping(value = "/checkSso")
public ResponseBean checkSso(String token) {
ResponseBean response = new ResponseBean();
try {
DefaultResourceLoader resourceLoader = new DefaultResourceLoader();
Resource resource = resourceLoader.getResource("LtpaToken.properties");
String filePath = resource.getURL().getPath();
LtpaTokenManager.loadConfig(URLDecoder.decode(URLDecoder.decode(filePath)));
token = URLDecoder.decode(token);
token = URLDecoder.decode(token);
String username = "";
if (LtpaTokenManager.isValid(token)) {//验证Token是否合法有效
logger.debug(".................合法token:\t\t" + token);
LtpaToken ltpaToken = new LtpaToken(token);
username = ltpaToken.getUsername();
}
response.setStatus(ErrorCode.STATUS_CODE_2000);
response.setMessage("解析用户名正常");
if (ssoService.checkSso(username) == 1) {
response.setData(GConstants.YES);
} else {
response.setData(GConstants.NO);
}
} catch (Exception e) {
logger.error("解析用户名出错:\n" + e.getMessage());
response.setStatus(ErrorCode.STATUS_CODE_4001);
response.setMessage("解析用户名出错");
response.setData(e.getMessage());
}
return response;
}
@RequestMapping(value = "/test")
public ResponseBean test(String username) {
ResponseBean response = new ResponseBean();
try {
DefaultResourceLoader resourceLoader = new DefaultResourceLoader();
Resource resource = resourceLoader.getResource("LtpaToken.properties");
String filePath = resource.getURL().getPath();
LtpaTokenManager.loadConfig(URLDecoder.decode(URLDecoder.decode(filePath)));
response.setStatus(ErrorCode.STATUS_CODE_2000);
response.setMessage("ok");
response.setData(LtpaTokenManager.generate(username, URLDecoder.decode(URLDecoder.decode(filePath))));
} catch (Exception e) {
e.printStackTrace();
logger.error(e.getMessage());
}
return response;
}
}
package com.ejweb.modules.front.sso.dao;
import com.ejweb.core.persistence.CrudDao;
import com.ejweb.core.persistence.annotation.MyBatisDao;
import com.ejweb.modules.front.sso.entity.SsoEntity;
/**
* Created by zhangzn on 2017/09/13.
*/
@MyBatisDao
public interface SsoDao extends CrudDao<SsoEntity> {
// 查找用户
int checkSso(String username);
}
package com.ejweb.modules.front.sso.entity;
import com.ejweb.core.persistence.DataEntity;
/**
* Created by zhangzn on 2017/09/13.
*/
public class SsoEntity extends DataEntity<SsoEntity> {
private String username;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
}
package com.ejweb.modules.front.sso.service;
import com.ejweb.core.service.CrudService;
import com.ejweb.modules.front.sso.dao.SsoDao;
import com.ejweb.modules.front.sso.entity.SsoEntity;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Created by zhangzn on 2017/09/13.
*/
@Service
@Transactional(readOnly = true)
public class SsoService extends CrudService<SsoDao, SsoEntity> {
// 添加举报信息
public int checkSso(String username) {
return dao.checkSso(username);
}
}
......@@ -12,6 +12,7 @@ import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
......@@ -28,6 +29,7 @@ import java.util.List;
/**
* Created by BrianHolsen on 2017-07-11 at 17:19.
*/
@Controller
@RequestMapping("/api/front/file")
public class FileController {
......
......@@ -6,6 +6,8 @@ import com.ejweb.modules.report.entity.ReportAttachmentEntity;
import com.ejweb.modules.report.entity.ReportEntity;
import com.ejweb.modules.sys.entity.User;
import java.util.List;
/**
* 举报DAO接口
* @author lixy
......@@ -21,6 +23,13 @@ public interface ReportDao extends CrudDao<ReportEntity> {
public String findRole(User user);
/**
* 查询附件
* @param reportAttachmentEntity
* @return
*/
public List<ReportAttachmentEntity> getAttachmentInfo(ReportAttachmentEntity reportAttachmentEntity);
/**
* 新增举报
* @param reportEntity
* @return
......@@ -33,4 +42,18 @@ public interface ReportDao extends CrudDao<ReportEntity> {
* @return
*/
public int addReportAttachment(ReportAttachmentEntity reportAttachmentEntity);
/**
* 举报信息补充
* @param reportEntity
* @return
*/
public int addTrack(ReportEntity reportEntity);
/**
* 更新举报状态
* @param reportEntity
* @return
*/
public int updateReportStatus(ReportEntity reportEntity);
}
......@@ -3,6 +3,8 @@ package com.ejweb.modules.report.entity;
import com.ejweb.core.persistence.DataEntity;
import java.util.List;
/**
* 举报Entity
* @author lixy
......@@ -36,7 +38,12 @@ public class ReportEntity extends DataEntity<ReportEntity> {
private String reportTimeFrom; //举报时间起
private String reportTimeTo; //举报时间止
private ReportAttachmentEntity reportAttachmentEntity;
private List<ReportAttachmentEntity> reportAttachmentEntityList;
private String reportAttachment; //举报提交文件
private String supplementAttachment; //补充提交文件
private String dealAttachment; //处理成果文件
public String getReportProject() {
return reportProject;
......@@ -222,11 +229,35 @@ public class ReportEntity extends DataEntity<ReportEntity> {
this.reportTimeTo = reportTimeTo;
}
public ReportAttachmentEntity getReportAttachmentEntity() {
return reportAttachmentEntity;
public List<ReportAttachmentEntity> getReportAttachmentEntityList() {
return reportAttachmentEntityList;
}
public void setReportAttachmentEntityList(List<ReportAttachmentEntity> reportAttachmentEntityList) {
this.reportAttachmentEntityList = reportAttachmentEntityList;
}
public String getReportAttachment() {
return reportAttachment;
}
public void setReportAttachment(String reportAttachment) {
this.reportAttachment = reportAttachment;
}
public String getSupplementAttachment() {
return supplementAttachment;
}
public void setSupplementAttachment(String supplementAttachment) {
this.supplementAttachment = supplementAttachment;
}
public String getDealAttachment() {
return dealAttachment;
}
public void setReportAttachmentEntity(ReportAttachmentEntity reportAttachmentEntity) {
this.reportAttachmentEntity = reportAttachmentEntity;
public void setDealAttachment(String dealAttachment) {
this.dealAttachment = dealAttachment;
}
}
......@@ -2,10 +2,12 @@ package com.ejweb.modules.report.service;
import com.ejweb.core.service.CrudService;
import com.ejweb.core.utils.IdGen;
import com.ejweb.core.utils.StringUtils;
import com.ejweb.modules.report.dao.ReportDao;
import com.ejweb.modules.report.entity.ReportAttachmentEntity;
import com.ejweb.modules.report.entity.ReportEntity;
import com.ejweb.modules.sys.entity.User;
import com.ejweb.modules.sys.utils.UserUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -14,6 +16,7 @@ import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.text.SimpleDateFormat;
import java.util.List;
/**
* 举报Service
......@@ -28,6 +31,15 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
private ReportDao reportDao;
/**
* 查询附件
* @param reportAttachmentEntity
* @return
*/
public List<ReportAttachmentEntity> getAttachmentInfo(ReportAttachmentEntity reportAttachmentEntity) {
return reportDao.getAttachmentInfo(reportAttachmentEntity);
}
/**
* 查询用户角色
* @param user
* @return
......@@ -41,7 +53,8 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
* @param reportEntity
*/
@Transactional(readOnly = false)
public void save(ReportEntity reportEntity) {
public void saveReport(ReportEntity reportEntity) {
//保存举报信息
reportEntity.preInsert();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String reportTime = sdf.format(reportEntity.getCreateDate());
......@@ -51,24 +64,113 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
reportEntity.setExchangeAfterUser(reportEntity.getCreateBy().getId());
dao.addReport(reportEntity);
ReportAttachmentEntity reportAttachmentEntity = reportEntity.getReportAttachmentEntity();
reportAttachmentEntity.setId(IdGen.uuid());
reportAttachmentEntity.setReportId(reportEntity.getId());
//获取文件名
int beginIndex = reportAttachmentEntity.getAttachmentPath().indexOf("%");
int endIndex = reportAttachmentEntity.getAttachmentPath().lastIndexOf(".");
String fileNameUrlCode = reportAttachmentEntity.getAttachmentPath().substring(beginIndex,endIndex);
String prefixName = reportAttachmentEntity.getAttachmentPath().substring(endIndex,reportAttachmentEntity.getAttachmentPath().length());
if (StringUtils.isNotBlank(reportEntity.getReportAttachment())) {
String[] reportAttachmentList = new String[]{reportEntity.getReportAttachment()};
if (reportEntity.getReportAttachment().contains("|")){
reportAttachmentList = reportEntity.getReportAttachment().split("\\|");
}
for (String path : reportAttachmentList) {
if (StringUtils.isNotBlank(path)) {
//保存举报提交附件信息
ReportAttachmentEntity reportAttachmentEntity = new ReportAttachmentEntity();
reportAttachmentEntity.setId(IdGen.uuid());
reportAttachmentEntity.setReportId(reportEntity.getId());
//获取文件名
String fileName = this.getFilename(path);
if (StringUtils.isNotBlank(fileName)) {
reportAttachmentEntity.setAttachmentName(fileName);
}
reportAttachmentEntity.setAttachmentPath(path);
File file = new File(reportAttachmentEntity.getAttachmentPath());
long length = file.length();
reportAttachmentEntity.setAttachmentType("0");
reportDao.addReportAttachment(reportAttachmentEntity);
}
}
}
}
/**
* 举报补充
* @param reportEntity
*/
@Transactional(readOnly = false)
public void saveTrack(ReportEntity reportEntity) {
//保存举报补充信息
reportEntity.preUpdate();
User user = UserUtils.getUser();
reportEntity.setDealPersonName(user.getName());
dao.addTrack(reportEntity);
if (StringUtils.isNotBlank(reportEntity.getSupplementAttachment())) {
String[] supplementAttachmentList = new String[]{reportEntity.getSupplementAttachment()};
if (reportEntity.getSupplementAttachment().contains("|")){
supplementAttachmentList = reportEntity.getSupplementAttachment().split("\\|");
}
for (String path : supplementAttachmentList) {
if (StringUtils.isNotBlank(path)) {
//保存补充提交附件信息
ReportAttachmentEntity reportAttachmentEntity = reportAttachmentEntity = new ReportAttachmentEntity();
reportAttachmentEntity.setId(IdGen.uuid());
reportAttachmentEntity.setReportId(reportEntity.getId());
//获取文件名
String fileName = this.getFilename(path);
if (StringUtils.isNotBlank(fileName)) {
reportAttachmentEntity.setAttachmentName(fileName);
}
reportAttachmentEntity.setAttachmentPath(path);
File file = new File(reportAttachmentEntity.getAttachmentPath());
long length = file.length();
reportAttachmentEntity.setAttachmentType("1");
reportDao.addReportAttachment(reportAttachmentEntity);
}
}
}
if (StringUtils.isNotBlank(reportEntity.getDealAttachment())) {
String[] dealAttachmentList = new String[]{reportEntity.getDealAttachment()};
if (reportEntity.getDealAttachment().contains("|")){
dealAttachmentList = reportEntity.getDealAttachment().split("\\|");
}
for (String path : dealAttachmentList) {
if (StringUtils.isNotBlank(path)) {
//保存处理结果附件信息
ReportAttachmentEntity reportAttachmentEntity = reportAttachmentEntity = new ReportAttachmentEntity();
reportAttachmentEntity.setId(IdGen.uuid());
reportAttachmentEntity.setReportId(reportEntity.getId());
//获取文件名
String fileName = this.getFilename(path);
if (StringUtils.isNotBlank(fileName)) {
reportAttachmentEntity.setAttachmentName(fileName);
}
reportAttachmentEntity.setAttachmentPath(path);
File file = new File(reportAttachmentEntity.getAttachmentPath());
long length = file.length();
reportAttachmentEntity.setAttachmentType("2");
reportDao.addReportAttachment(reportAttachmentEntity);
}
}
}
//更新举报状态
reportEntity.setReportStatus("1");
if (StringUtils.isNotBlank(reportEntity.getDealResult())){
reportEntity.setReportStatus("2");
}
reportDao.updateReportStatus(reportEntity);
}
public String getFilename(String path){
int beginIndex = path.indexOf("%");
int endIndex = path.lastIndexOf(".");
String fileNameUrlCode = path.substring(beginIndex, endIndex);
String prefixName = path.substring(endIndex, path.length());
try {
String fileName = URLDecoder.decode(fileNameUrlCode,"UTF-8");
reportAttachmentEntity.setAttachmentName(fileName+prefixName);
String utlToName = URLDecoder.decode(fileNameUrlCode, "UTF-8");
String fileName = utlToName + prefixName;
return fileName;
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
return null;
}
File file = new File(reportAttachmentEntity.getAttachmentPath());
long length = file.length();
reportAttachmentEntity.setAttachmentType("0");
reportDao.addReportAttachment(reportAttachmentEntity);
}
}
......@@ -3,6 +3,7 @@ package com.ejweb.modules.report.web;
import com.ejweb.core.base.BaseController;
import com.ejweb.core.persistence.Page;
import com.ejweb.core.utils.StringUtils;
import com.ejweb.modules.report.entity.ReportAttachmentEntity;
import com.ejweb.modules.report.entity.ReportEntity;
import com.ejweb.modules.report.service.ReportService;
import com.ejweb.modules.sys.entity.User;
......@@ -18,6 +19,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 举报Controller
......@@ -40,7 +42,15 @@ public class ReportController extends BaseController {
}
}
// 举报列表
/**
* 举报列表
*
* @param reportEntity
* @param model
* @param request
* @param response
* @return
*/
@RequiresPermissions("report:view")
@RequestMapping(value = {"list", ""})
public String list(ReportEntity reportEntity, String flag,HttpServletRequest request, HttpServletResponse response, Model model) {
......@@ -72,26 +82,95 @@ public class ReportController extends BaseController {
return "modules/report/reportList";
}
@RequestMapping(value = "/form")
/**
* 举报添加
*
* @param reportEntity
* @param model
* @return
*/
@RequestMapping(value = "form")
public String form(ReportEntity reportEntity, Model model) {
model.addAttribute("reportEntity", reportEntity);
model.addAttribute("report", reportEntity);
return "modules/report/reportForm";
}
/**
* 举报信息保存
*
* @param reportEntity
* @param model
* @return
*/
@RequestMapping(value = "addReport")
public String addReport(ReportEntity reportEntity, Model model, RedirectAttributes redirectAttributes) {
if (!beanValidator(model, reportEntity)) {
return form(reportEntity, model);
}
reportService.save(reportEntity);
reportService.saveReport(reportEntity);
addMessage(redirectAttributes, "添加举报"+ reportEntity.getReportProject() + "'成功");
return "redirect:" + adminPath + "/report/list/?repage&flag=0";
}
/**
* 举报详情
*
* @param reportEntity
* @param model
* @return
*/
@RequestMapping(value = "view")
public String view(ReportEntity reportEntity, Model model, RedirectAttributes redirectAttributes) {
model.addAttribute("reportEntity", reportEntity);
ReportAttachmentEntity reportAttachment = new ReportAttachmentEntity();
reportAttachment.setReportId(reportEntity.getId());
reportAttachment.setAttachmentType("0");
List<ReportAttachmentEntity> reportAttachmentList = reportService.getAttachmentInfo(reportAttachment);
ReportAttachmentEntity supplementAttachment = new ReportAttachmentEntity();
supplementAttachment.setReportId(reportEntity.getId());
supplementAttachment.setAttachmentType("1");
List<ReportAttachmentEntity> supplementAttachmentList = reportService.getAttachmentInfo(supplementAttachment);
model.addAttribute("report", reportEntity);
model.addAttribute("reportAttachmentList", reportAttachmentList);
model.addAttribute("supplementAttachmentList", supplementAttachmentList);
return "modules/report/reportDetail";
}
/**
* 举报跟踪
*
* @param reportEntity
* @param model
* @return
*/
@RequestMapping(value = "track")
public String track(ReportEntity reportEntity, Model model) {
User user = UserUtils.getUser();
String roleName = reportService.findRole(user);
String transferFlag = "0";
if (roleName.equals("系统管理员")){
transferFlag = "1";
}
model.addAttribute("currentUser", user.getName());
model.addAttribute("transferFlag", transferFlag);
model.addAttribute("report", reportEntity);
return "modules/report/reportTrack";
}
/**
* 举报跟踪信息保存
*
* @param reportEntity
* @param model
* @return
*/
@RequestMapping(value = "addTrack")
public String addTrack(ReportEntity reportEntity, Model model, RedirectAttributes redirectAttributes) {
if (!beanValidator(model, reportEntity)) {
return form(reportEntity, model);
}
reportService.saveTrack(reportEntity);
addMessage(redirectAttributes, "补充举报"+ reportEntity.getSupplementTitle() + "'成功");
return "redirect:" + adminPath + "/report/list/?repage&flag=0";
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ejweb.modules.front.sso.dao.SsoDao">
<select id="checkSso" resultType="Integer" parameterType="String">
SELECT
count(*)
FROM
sys_user su
WHERE
su.login_name = #{username}
</select>
</mapper>
\ No newline at end of file
......@@ -85,4 +85,13 @@
)
</insert>
<select id="getUser" resultType="com.ejweb.modules.sys.entity.User">
SELECT u.id
FROM sys_user u
LEFT JOIN sys_user2role u2r ON u2r.user_id = u.id
LEFT JOIN sys_role r ON r.id = u2r.role_id
WHERE r.enname = 'admin'
limit 1
</select>
</mapper>
\ No newline at end of file
......@@ -28,11 +28,7 @@
r.create_by AS "createBy",
r.create_date AS "createDate",
r.update_by AS "updateBy",
r.update_date AS "updateDate",
ra.attachment_name AS "reportAttachmentEntity.attachmentName",
ra.attachment_path AS "reportAttachmentEntity.attachmentPath",
ra.attachment_size AS "reportAttachmentEntity.attachmentSize",
ra.attachment_type AS "reportAttachmentEntity.attachmentType"
r.update_date AS "updateDate"
</sql>
......@@ -44,7 +40,6 @@
SELECT
<include refid="reportColumns"/>
FROM report r
<include refid="reportJoins"/>
WHERE r.id = #{id}
</select>
......@@ -52,7 +47,6 @@
SELECT
<include refid="reportColumns"/>
FROM report r
<include refid="reportJoins"/>
<where>
1 = 1
<if test="exchangeAfterUser != null and exchangeAfterUser != ''">
......@@ -105,7 +99,6 @@
SELECT
<include refid="reportColumns"/>
FROM report r
<include refid="reportJoins"/>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
......@@ -125,6 +118,15 @@
WHERE su.id = #{id}
</select>
<select id="getAttachmentInfo" resultType="ReportAttachmentEntity">
SELECT
ra.attachment_name,
ra.attachment_path
FROM report_attachment ra
WHERE ra.report_id = #{reportId}
AND ra.attachment_type = #{attachmentType}
</select>
<insert id="addReport">
INSERT INTO report(
id,
......@@ -181,24 +183,26 @@
)
</insert>
<update id="update">
UPDATE sys_area SET
parent_id = #{parent.id},
parent_ids = #{parentIds},
code = #{code},
name = #{name},
sort = #{sort},
type = #{type},
update_by = #{updateBy.id},
update_date = #{updateDate},
remarks = #{remarks}
WHERE id = #{id}
</update>
<update id="addTrack">
UPDATE report SET
supplement_company = #{supplementCompany},
supplement_department = #{supplementDepartment},
supplement_informant = #{supplementInformant},
supplement_title = #{supplementTitle},
supplement_type = #{supplementType},
supplement_area = #{supplementArea},
supplement_project = #{supplementProject},
supplement_content = #{supplementContent},
deal_person_name = #{dealPersonName},
deal_result = #{dealResult},
update_by = #{updateBy.id},
update_date = #{updateDate}
WHERE id = #{id}
</update>
<update id="updateParentIds">
UPDATE sys_area SET
parent_id = #{parent.id},
parent_ids = #{parentIds}
<update id="updateReportStatus">
UPDATE report SET
report_status = #{reportStatus}
WHERE id = #{id}
</update>
......
<%@ 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 () {
$("input[type='text']").attr("disabled",true);
$("#btnTrack").click(function () {
window.location.href = "${ctx}/report/track?id=${report.id}";
});
$("#btnDocument").click(function () {
$("#inputForm").attr("action", "${ctx}/report/document");
$("#inputForm").submit();
});
});
</script>
<style type="text/css">
.title{
font-size:16px;
font-weight:bold;
}
</style>
</head>
<body>
<ul class="nav nav-tabs">
<li class="active"><a href="${ctx}/report/form">举报详情</a></li>
</ul>
<br/>
<form:form id="inputForm" modelAttribute="report" action="${ctx}/report/track" method="post" class="form-horizontal">
<sys:message content="${message}"/>
<span class="title">举报内容</span>
<div class="control-group">
<label class="control-label">被举报项目:</label>
<div class="controls">
<form:input path="reportProject" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
</div>
</div>
<div class="control-group">
<label class="control-label">被举报项目:</label>
<div class="controls">
<form:input path="reportTime" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
</div>
</div>
<div class="control-group">
<label class="control-label">所在城市:</label>
<div class="controls">
<form:input path="reportCity" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
</div>
</div>
<div class="control-group">
<label class="control-label">内容:</label>
<div class="controls">
<form:textarea id="reportContent" htmlEscape="true" path="reportContent" rows="4" maxlength="500" class="input-xxlarge" disabled="true"/>
</div>
</div>
<div class="control-group">
<label class="control-label">附件:</label>
<div class="controls">
<c:forEach items="${reportAttachmentList}" var="reportAttachment" varStatus="vs">
${vs.count}.<a href="${reportAttachment.attachmentPath}" target="_blank">${reportAttachment.attachmentName}</a><br>
</c:forEach>
</div>
</div>
<span class="title">举报人信息</span>
<div class="control-group">
<label class="control-label">姓名:</label>
<div class="controls">
<form:input path="reportPersonName" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
</div>
</div>
<div class="control-group">
<label class="control-label">手机号:</label>
<div class="controls">
<form:input path="reportPersonTel" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
</div>
</div>
<div class="control-group">
<label class="control-label">Email:</label>
<div class="controls">
<form:input path="reportPersonEmail" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
</div>
</div>
<div class="control-group">
<label class="control-label">举报途径:</label>
<div class="controls">
<form:radiobuttons path="reportSource" items="${fns:getDictList('report_source')}" itemLabel="label" itemValue="value"
htmlEscape="false" disabled="true"/>
</div>
</div>
<span class="title">举报信息补充</span>
<div class="control-group">
<label class="control-label">标题:</label>
<div class="controls">
<form:input path="supplementTitle" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
</div>
</div>
<div class="control-group">
<label class="control-label">被举报公司:</label>
<div class="controls">
<form:input path="supplementCompany" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
</div>
</div>
<div class="control-group">
<label class="control-label">被举报部门:</label>
<div class="controls">
<form:input path="supplementDepartment" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
</div>
</div>
<div class="control-group">
<label class="control-label">被举报人:</label>
<div class="controls">
<form:input path="supplementInformant" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
</div>
</div>
<div class="control-group">
<label class="control-label">业务类型:</label>
<div class="controls">
<form:input path="supplementType" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
</div>
</div>
<div class="control-group">
<label class="control-label">被举报区域:</label>
<div class="controls">
<form:input path="supplementArea" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
</div>
</div>
<div class="control-group">
<label class="control-label">被举报项目:</label>
<div class="controls">
<form:input path="supplementProject" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
</div>
</div>
<div class="control-group">
<label class="control-label">内容:</label>
<div class="controls">
<form:textarea id="reportContent" htmlEscape="true" path="supplementContent" rows="4" maxlength="500" class="input-xxlarge" disabled="true"/>
</div>
</div>
<div class="control-group">
<label class="control-label">附件:</label>
<div class="controls">
<c:forEach items="${supplementAttachmentList}" var="supplementAttachment" varStatus="vs">
${vs.count}.<a href="${supplementAttachment.attachmentPath}" target="_blank">${supplementAttachment.attachmentName}</a><br>
</c:forEach>
</div>
</div>
<li class="btns">
<label style="width:auto;"><input id="btnTrack" class="btn btn-primary" type="button" value="跟踪"/>&nbsp;&nbsp;
<input id="btnDocument" class="btn btn-primary" type="button" value="转为文档"/>&nbsp;&nbsp;
<input id="btnReturn" class="btn btn-primary" type="button" value="返回" onclick="history.go(-1)"/></label>
</li>
</form:form>
</body>
</html>
\ No newline at end of file
......@@ -11,7 +11,9 @@
submitHandler: function (form) {
if ($("#nameFile").val().length == 0) {
$("#checkFile").show();
} else {
} else if ($("#reportContent").val() == ""){
top.$.jBox.tip('请填写内容', 'warning');
}else {
submitCount += 1;
if(submitCount == 1){
$("#checkFile").hide();
......@@ -46,7 +48,7 @@
<li class="active"><a href="${ctx}/report/form">举报录入</a></li>
</ul>
<br/>
<form:form id="inputForm" modelAttribute="reportEntity" action="${ctx}/report/addReport" method="post" class="form-horizontal">
<form:form id="inputForm" modelAttribute="report" action="${ctx}/report/addReport" method="post" class="form-horizontal">
<sys:message content="${message}"/>
<span class="title">举报内容</span>
<div class="control-group">
......@@ -74,10 +76,10 @@
<div class="control-group">
<label class="control-label">附件:</label>
<div class="controls">
<form:hidden id="nameFile" path="reportAttachmentEntity.attachmentPath" htmlEscape="false"
<form:hidden id="nameFile" path="reportAttachment" htmlEscape="false"
maxlength="255" class="input-xlarge"/>
<sys:ckfinder input="nameFile" type="files" uploadPath="/file"
selectMultiple="false" maxWidth="100" maxHeight="100"/>
selectMultiple="true" maxWidth="100" maxHeight="100"/>
<label id="checkFile" class="error" style="display: none;">必填信息</label>
</div>
</div>
......
......@@ -131,7 +131,7 @@
<c:if test="${report.dealResult eq '3'}">举报属实</c:if>
</td>
<td><c:if test="${report.dealResult eq null}">--</c:if>
<c:if test="${report.dealResult eq null}">${report.dealPersonName}</c:if>
<c:if test="${report.dealResult ne null}">${report.dealPersonName}</c:if>
</td>
<td>
<a href="${ctx}/report/view?id=${report.id}">查看</a>
......
<%@ 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">
var submitCount = 0;
$(document).ready(function () {
$("#inputForm").validate({
submitHandler: function (form) {
if ($("#nameFile").val().length == 0) {
$("#checkFile").show();
} else {
submitCount += 1;
if(submitCount == 1){
$("#checkFile").hide();
loading('正在提交,请稍等...');
form.submit();
}else{
return false;
}
}
},
errorContainer: "#messageBox",
errorPlacement: function (error, element) {
$("#messageBox").text("输入有误,请先更正。");
if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
error.appendTo(element.parent().parent());
} else {
error.insertAfter(element);
}
}
});
});
</script>
<style type="text/css">
.title{
font-size:16px;
font-weight:bold;
}
</style>
</head>
<body>
<ul class="nav nav-tabs">
<li class="active"><a href="${ctx}/report/track">跟踪举报信息</a></li>
</ul>
<br/>
<form:form id="inputForm" modelAttribute="report" action="${ctx}/report/addTrack" method="post" class="form-horizontal">
<form:hidden path="id"/>
<sys:message content="${message}"/>
<span class="title">举报信息补充</span>
<div class="control-group">
<label class="control-label">被举报公司:</label>
<div class="controls">
<form:input path="supplementCompany" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
<span class="help-inline"><font color="red">*</font> </span>
</div>
</div>
<div class="control-group">
<label class="control-label">被举报部门:</label>
<div class="controls">
<form:input path="supplementDepartment" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
<span class="help-inline"><font color="red">*</font> </span>
</div>
</div>
<div class="control-group">
<label class="control-label">被举报人:</label>
<div class="controls">
<form:input path="supplementInformant" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
<span class="help-inline"><font color="red">*</font> </span>
</div>
</div>
<div class="control-group">
<label class="control-label">标题:</label>
<div class="controls">
<form:input path="supplementTitle" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
<span class="help-inline"><font color="red">*</font> </span>
</div>
</div>
<div class="control-group">
<label class="control-label">业务类型:</label>
<div class="controls">
<form:select path="supplementType" class="input-small required">
<form:option value=" ">请选择</form:option>
<form:options items="${fns:getDictList('supplement_type')}" itemLabel="label" itemValue="value"
htmlEscape="false"/></form:select>
<span class="help-inline"><font color="red">*</font> </span>
</div>
</div>
<div class="control-group">
<label class="control-label">被举报区域:</label>
<div class="controls">
<form:radiobutton path="supplementArea" value="North China" checked="true"/>华北区域公司
<form:radiobutton path="supplementArea" value="BeiJing"/>北京区域公司
<form:radiobutton path="supplementArea" value="ShangHai"/>上海区域公司
<span class="help-inline"><font color="red">*</font> </span>
</div>
</div>
<div class="control-group">
<label class="control-label">被举报项目:</label>
<div class="controls">
<form:input path="supplementProject" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
<span class="help-inline"><font color="red">*</font> </span>
</div>
</div>
<div class="control-group">
<label class="control-label">内容:</label>
<div class="controls">
<form:textarea id="supplementContent" htmlEscape="true" path="supplementContent" rows="4" maxlength="500" class="input-xxlarge"/>
<span class="help-inline"><font color="red">*</font> </span>
</div>
</div>
</div>
<div class="control-group">
<label class="control-label">附件:</label>
<div class="controls">
<form:hidden id="nameFile" path="supplementAttachment" htmlEscape="false"
maxlength="255" class="input-xlarge"/>
<sys:ckfinder input="nameFile" type="files" uploadPath="/file"
selectMultiple="true" maxWidth="100" maxHeight="100"/>
<label id="checkFile" class="error" style="display: none;">必填信息</label>
</div>
</div>
<span class="title">处理结果</span>
<div class="control-group">
<label class="control-label">处理人:</label>
<div class="controls">
<form:input path="dealPersonName" value="${currentUser}" disabled="true" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
<span class="help-inline"><font color="red">*</font> </span>
</div>
</div>
<div class="control-group">
<label class="control-label">处理成果文件:</label>
<div class="controls">
<form:hidden id="nameFile" path="dealAttachment" htmlEscape="false"
maxlength="255" class="input-xlarge"/>
<sys:ckfinder input="nameFile" type="files" uploadPath="/file"
selectMultiple="true" maxWidth="100" maxHeight="100"/>
<label id="checkFile" class="error" style="display: none;">必填信息</label>
</div>
</div>
<div class="control-group">
<label class="control-label">处理结论:</label>
<div class="controls">
<form:select path="dealResult" class="input-small required">
<form:option value=" ">请选择</form:option>
<form:options items="${fns:getDictList('deal_result')}" itemLabel="label" itemValue="value"
htmlEscape="false"/></form:select>
<span class="help-inline"><font color="red">*</font> </span>
</div>
</div>
<span class="title">移交他人处理</span>
<div class="control-group">
<label class="control-label">移交:</label>
<div class="controls">
<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 class="form-actions">
<input id="btnSubmit" class="btn btn-primary" type="submit" value="提交"/>&nbsp;
</div>
</form:form>
</body>
</html>
\ No newline at end of file
......@@ -131,6 +131,16 @@
<filter-name>FileUploadFilter</filter-name>
<url-pattern>/assets/ckfinder/core/connector/java/connector.java</url-pattern>
</filter-mapping>
<filter>
<filter-name>CorsFilter</filter-name>
<filter-class>com.ejweb.core.filter.CORSFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>CorsFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>UserfilesDownloadServlet</servlet-name>
<servlet-class>com.ejweb.core.servlet.UserfilesDownloadServlet</servlet-class>
......@@ -156,7 +166,7 @@
</servlet>
<servlet-mapping>
<servlet-name>captcha</servlet-name>
<url-pattern>/front/report/captcha</url-pattern>
<url-pattern>/api/front/report/captcha</url-pattern>
</servlet-mapping>
<error-page>
......
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<display-name>JeeSite</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
......@@ -131,6 +131,16 @@
<filter-name>FileUploadFilter</filter-name>
<url-pattern>/assets/ckfinder/core/connector/java/connector.java</url-pattern>
</filter-mapping>
<filter>
<filter-name>CorsFilter</filter-name>
<filter-class>com.ejweb.core.filter.CORSFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>CorsFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>UserfilesDownloadServlet</servlet-name>
<servlet-class>com.ejweb.core.servlet.UserfilesDownloadServlet</servlet-class>
......@@ -145,8 +155,20 @@
</servlet>
<servlet-mapping>
<servlet-name>ValidateCodeServlet</servlet-name>
<url-pattern>/servlet/validateCodeServlet</url-pattern>
<url-pattern>/api/front/report/validateCodeServlet</url-pattern>
</servlet-mapping>
<!--验证码-->
<servlet>
<servlet-name>captcha</servlet-name>
<servlet-class>com.ejweb.modules.front.report.servlet.CaptchaServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>captcha</servlet-name>
<url-pattern>/api/front/report/captcha</url-pattern>
</servlet-mapping>
<error-page>
<error-code>500</error-code>
<location>/WEB-INF/views/error/500.jsp</location>
......
......@@ -96,6 +96,9 @@ file.image.thumb.height=640
# The Prefix Url
file.prefix.url=http://127.0.0.1:8080/static/
# The Prefix separator
file.upload.path.separator = /
# The Push Server Config
push.server.url=http://123.56.146.81:1880/v1/
......
......@@ -3,9 +3,9 @@ db.table.prefix=sunac_
jdbc.type=mysql
jdbc.driver.class=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/report_sunac?useUnicode=true&characterEncoding=utf-8
jdbc.username=root
jdbc.password=admin
jdbc.url=jdbc:mysql://123.56.146.7:3306/sunac_report?useUnicode=true&characterEncoding=utf-8
jdbc.username=reportuser
jdbc.password=$R@20$7
#初始化连接
jdbc.initialSize=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