Commit 3d0064d7 by Java-李昕颖

各种改

parent 6fee7c24
......@@ -2,6 +2,7 @@ package com.ejweb.modules.front.report.bean;
import com.ejweb.core.base.BaseBean;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
......@@ -33,9 +34,9 @@ public class FrontReportBean extends BaseBean{
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 Timestamp createDate; //创建时间
private String updateBy; //更新人\
private Date updateDate; //更新时间
private Timestamp updateDate; //更新时间
private List<String> ids;
private String code;// 验证码返回的code
......@@ -251,11 +252,11 @@ public class FrontReportBean extends BaseBean{
this.createBy = createBy;
}
public Date getCreateDate() {
public Timestamp getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
public void setCreateDate(Timestamp createDate) {
this.createDate = createDate;
}
......@@ -267,11 +268,11 @@ public class FrontReportBean extends BaseBean{
this.updateBy = updateBy;
}
public Date getUpdateDate() {
public Timestamp getUpdateDate() {
return updateDate;
}
public void setUpdateDate(Date updateDate) {
public void setUpdateDate(Timestamp updateDate) {
this.updateDate = updateDate;
}
......
......@@ -7,22 +7,17 @@ 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.front.upload.util.ReportAttachmentUtils;
import com.ejweb.modules.reportAttachment.dao.ReportAttachmentMapper;
import com.ejweb.modules.reportAttachment.entity.ReportAttachment;
import com.ejweb.modules.sys.entity.User;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
/**
* Created by lenovo on 2017/9/8.
*/
......@@ -30,12 +25,12 @@ import java.util.List;
@Service
@Transactional(readOnly = true)
public class FrontReportService extends CrudService<FrontReportDao,FrontReportEntity>{
// 添加举报信息
@Transactional(readOnly = false)
public ResponseBean addReport(FrontReportBean bean){
ResponseBean responseBean = new ResponseBean();
bean.setId(IdWorker.getNextId("R"));
String reportId = IdWorker.getNextId("R");
bean.setId(reportId);
Date date = new Date();
bean.setReportTime(DateUtils.formatDate(date,"yyyy-MM-dd HH:mm:ss"));
......@@ -48,17 +43,23 @@ public class FrontReportService extends CrudService<FrontReportDao,FrontReportEn
}
bean.setCreateBy(user.getId());
bean.setUpdateBy(user.getId());
bean.setCreateDate(date);
bean.setUpdateDate(date);
Timestamp d = new Timestamp(System.currentTimeMillis());
bean.setCreateDate(d);
bean.setUpdateDate(d);
//
// bean.setExchangeBeforeUser("");
// 添加举报信息表
int row = dao.insertReport(bean);
int row = 0;
try {
row = dao.insertReport(bean);
}catch (Exception e){
row = dao.insertReport(bean);
}
if(row == 1){ // 添加成功
List<String> attachmentIds = bean.getIds();
if(attachmentIds != null && attachmentIds.size() > 0){ // 添加举报附件
for(String attachmentId:attachmentIds){
ReportAttachmentUtils.addReportId(attachmentId,bean.getId());
ReportAttachmentUtils.addReportId(attachmentId,reportId);
}
}
......
......@@ -17,7 +17,9 @@ import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by zhangzn on 2017/09/13.
......@@ -41,18 +43,28 @@ public class SsoController extends BaseController {
LtpaTokenManager.loadConfig(URLDecoder.decode(URLDecoder.decode(filePath)));
token = URLDecoder.decode(token);
token = URLDecoder.decode(token);
token = URLDecoder.decode(token);
String username = "";
if (LtpaTokenManager.isValid(token)) {//验证Token是否合法有效
boolean result = LtpaTokenManager.isValid(token);
if (result) {//验证Token是否合法有效
logger.debug(".................合法token:\t\t" + token);
LtpaToken ltpaToken = new LtpaToken(token);
username = ltpaToken.getUsername();
}
response.setStatus(ErrorCode.STATUS_CODE_2000);
response.setMessage("解析用户名正常");
}else {
response.setStatus(ErrorCode.STATUS_CODE_4105);
response.setMessage("token已过期");
}
Map<String,String> map = new HashMap<String,String>();
if (ssoService.checkSso(username) == 1) {
response.setData(GConstants.YES);
map.put("token",token);
map.put("result",GConstants.YES);
response.setData(map);
} else {
response.setData(GConstants.NO);
map.put("token",token);
map.put("result",GConstants.NO);
response.setData(map);
}
} catch (Exception e) {
logger.error("解析用户名出错:\n" + e.getMessage());
......
......@@ -303,6 +303,23 @@ public class ReportController extends BaseController {
@RequestMapping(value = "export", method = RequestMethod.POST)
public String export(ReportEntity reportEntity,String flag, HttpServletRequest request,HttpServletResponse response, RedirectAttributes redirectAttributes) {
//判断登录人的角色
User user = UserUtils.getUser();
if (!reportService.checkRole(user)){
reportEntity.setExchangeAfterUser(user.getId());
}
//判断标签状态 flag为空,跳转到核查中举报列表 flag为0,跳转到未处理举报列表 flag为1,跳转到举报列表
if (StringUtils.isNotBlank(flag)){
if (flag.equals("0")){
if (StringUtils.isBlank(reportEntity.getReportStatus())) {
reportEntity.setReportStatus("0");
}
}
}else{
if (StringUtils.isBlank(reportEntity.getReportStatus())) {
reportEntity.setReportStatus("1");
}
}
try {
String fileName = "举报列表" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
List<ReportEntity> reportList = reportService.getReportList(reportEntity);
......
......@@ -167,107 +167,107 @@ public class ReportToPdfController extends BaseController {
reportSource1.setBorderWidth(0);
table1.addCell(reportSource1);
document.add(table2);
Paragraph pt3 = new Paragraph("举报信息补充",title);
if (!reportEntity.getReportStatus().equals("0")) {
Paragraph pt3 = new Paragraph("举报信息补充", title);
pt3.setAlignment(0);//设置文字居中 0靠左 1,居中 2,靠右
document.add(pt3);
Paragraph blankRow3 = new Paragraph(18f, " ", textfont);
document.add(blankRow3);
PdfPTable table3 = new PdfPTable(2);
table3.setTotalWidth(new float[] { 5, 10}); //设置表头列宽
PdfPCell supplementTitle = new PdfPCell(new Paragraph("标题:",textfont));
table3.setTotalWidth(new float[]{5, 10}); //设置表头列宽
PdfPCell supplementTitle = new PdfPCell(new Paragraph("标题:", textfont));
supplementTitle.setBorderWidth(0);
table3.addCell(supplementTitle);
PdfPCell supplementTitle1 = new PdfPCell(new Paragraph(reportEntity.getSupplementTitle()==null?"":reportEntity.getSupplementTitle(),textfont));
PdfPCell supplementTitle1 = new PdfPCell(new Paragraph(reportEntity.getSupplementTitle() == null ? "" : reportEntity.getSupplementTitle(), textfont));
supplementTitle1.setBorderWidth(0);
table3.addCell(supplementTitle1);
PdfPCell supplementCompany = new PdfPCell(new Paragraph("被举报公司:",textfont));
PdfPCell supplementCompany = new PdfPCell(new Paragraph("被举报公司:", textfont));
supplementCompany.setBorderWidth(0);
table3.addCell(supplementCompany);
PdfPCell supplementCompany1 = new PdfPCell(new Paragraph(reportEntity.getSupplementCompany()==null?"":reportEntity.getSupplementCompany(),textfont));
PdfPCell supplementCompany1 = new PdfPCell(new Paragraph(reportEntity.getSupplementCompany() == null ? "" : reportEntity.getSupplementCompany(), textfont));
supplementCompany1.setBorderWidth(0);
table3.addCell(supplementCompany1);
PdfPCell supplementDepartment = new PdfPCell(new Paragraph("被举报部门:",textfont));
PdfPCell supplementDepartment = new PdfPCell(new Paragraph("被举报部门:", textfont));
supplementDepartment.setBorderWidth(0);
table3.addCell(supplementDepartment);
PdfPCell supplementDepartment1 = new PdfPCell(new Paragraph(reportEntity.getSupplementDepartment()==null?"":reportEntity.getSupplementDepartment(),textfont));
PdfPCell supplementDepartment1 = new PdfPCell(new Paragraph(reportEntity.getSupplementDepartment() == null ? "" : reportEntity.getSupplementDepartment(), textfont));
supplementDepartment1.setBorderWidth(0);
table3.addCell(supplementDepartment1);
PdfPCell supplementInformant = new PdfPCell(new Paragraph("被举报人:",textfont));
PdfPCell supplementInformant = new PdfPCell(new Paragraph("被举报人:", textfont));
supplementInformant.setBorderWidth(0);
table3.addCell(supplementInformant);
PdfPCell supplementInformant1 = new PdfPCell(new Paragraph(reportEntity.getSupplementInformant()==null?"":reportEntity.getSupplementInformant(),textfont));
PdfPCell supplementInformant1 = new PdfPCell(new Paragraph(reportEntity.getSupplementInformant() == null ? "" : reportEntity.getSupplementInformant(), textfont));
supplementInformant1.setBorderWidth(0);
table3.addCell(supplementInformant1);
PdfPCell supplementType = new PdfPCell(new Paragraph("业务类型:",textfont));
PdfPCell supplementType = new PdfPCell(new Paragraph("业务类型:", textfont));
supplementType.setBorderWidth(0);
table3.addCell(supplementType);
String supplement_type = reportEntity.getSupplementType();
if (StringUtils.isNotBlank(supplement_type)){
if (supplement_type.equals("1")){
if (StringUtils.isNotBlank(supplement_type)) {
if (supplement_type.equals("1")) {
supplement_type = "营销";
}else if (supplement_type.equals("2")){
} else if (supplement_type.equals("2")) {
supplement_type = "工程";
}else if (supplement_type.equals("3")){
} else if (supplement_type.equals("3")) {
supplement_type = "成本";
}else if (supplement_type.equals("4")){
} else if (supplement_type.equals("4")) {
supplement_type = "招采";
}else if (supplement_type.equals("5")){
} else if (supplement_type.equals("5")) {
supplement_type = "人力";
}else if (supplement_type.equals("6")){
} else if (supplement_type.equals("6")) {
supplement_type = "物业";
}else if (supplement_type.equals("7")){
} else if (supplement_type.equals("7")) {
supplement_type = "投诉";
}
}else {
} else {
supplement_type = "";
}
PdfPCell supplementType1 = new PdfPCell(new Paragraph(supplement_type,textfont));
PdfPCell supplementType1 = new PdfPCell(new Paragraph(supplement_type, textfont));
supplementType1.setBorderWidth(0);
table3.addCell(supplementType1);
PdfPCell supplementArea = new PdfPCell(new Paragraph("被举报区域:",textfont));
PdfPCell supplementArea = new PdfPCell(new Paragraph("被举报区域:", textfont));
supplementArea.setBorderWidth(0);
table3.addCell(supplementArea);
String supplement_area = reportEntity.getSupplementArea();
if (StringUtils.isNotBlank(supplement_area)){
if (supplement_area.equals("North China")){
if (StringUtils.isNotBlank(supplement_area)) {
if (supplement_area.equals("North China")) {
supplement_area = "华北区域公司";
}else if (supplement_area.equals("BeiJing")){
} else if (supplement_area.equals("BeiJing")) {
supplement_area = "北京区域公司";
}else if (supplement_area.equals("ShangHai")){
} else if (supplement_area.equals("ShangHai")) {
supplement_area = "上海区域公司";
}else if (supplement_area.equals("SouthWest")){
} else if (supplement_area.equals("SouthWest")) {
supplement_area = "西南区域公司";
}else if (supplement_area.equals("SouthEast")){
} else if (supplement_area.equals("SouthEast")) {
supplement_area = "东南区域公司";
}else if (supplement_area.equals("Central China")){
} else if (supplement_area.equals("Central China")) {
supplement_area = "华中区域公司";
}else if (supplement_area.equals("GuangShen")){
} else if (supplement_area.equals("GuangShen")) {
supplement_area = "广深区域公司";
}else if (supplement_area.equals("Hainan")){
} else if (supplement_area.equals("Hainan")) {
supplement_area = "海南区域公司";
}else if (supplement_area.equals("Group")){
} else if (supplement_area.equals("Group")) {
supplement_area = "集团本部";
}
}else {
} else {
supplement_area = "";
}
PdfPCell supplementArea1 = new PdfPCell(new Paragraph(supplement_area,textfont));
PdfPCell supplementArea1 = new PdfPCell(new Paragraph(supplement_area, textfont));
supplementArea1.setBorderWidth(0);
table3.addCell(supplementArea1);
PdfPCell supplementProject = new PdfPCell(new Paragraph("被举报项目:",textfont));
PdfPCell supplementProject = new PdfPCell(new Paragraph("被举报项目:", textfont));
supplementProject.setBorderWidth(0);
table3.addCell(supplementProject);
PdfPCell supplementProject1 = new PdfPCell(new Paragraph(reportEntity.getSupplementProject()==null?"":reportEntity.getSupplementProject(),textfont));
PdfPCell supplementProject1 = new PdfPCell(new Paragraph(reportEntity.getSupplementProject() == null ? "" : reportEntity.getSupplementProject(), textfont));
supplementProject1.setBorderWidth(0);
table3.addCell(supplementProject1);
PdfPCell supplementContent = new PdfPCell(new Paragraph("内容:",textfont));
PdfPCell supplementContent = new PdfPCell(new Paragraph("内容:", textfont));
supplementContent.setBorderWidth(0);
table3.addCell(supplementContent);
PdfPCell supplementContent1 = new PdfPCell(new Paragraph(reportEntity.getSupplementContent()==null?"":reportEntity.getSupplementContent(),textfont));
PdfPCell supplementContent1 = new PdfPCell(new Paragraph(reportEntity.getSupplementContent() == null ? "" : reportEntity.getSupplementContent(), textfont));
supplementContent1.setBorderWidth(0);
table3.addCell(supplementContent1);
PdfPCell supplementAttachment = new PdfPCell(new Paragraph("附件:",textfont));
PdfPCell supplementAttachment = new PdfPCell(new Paragraph("附件:", textfont));
supplementAttachment.setBorderWidth(0);
table3.addCell(supplementAttachment);
......@@ -280,7 +280,7 @@ public class ReportToPdfController extends BaseController {
Paragraph paragraphPath2 = new Paragraph();
if (list1 != null && list1.size() != 0) {
for (ReportAttachmentEntity reportAttachmentEntity : list1) {
Chunk chunk = new Chunk(reportAttachmentEntity.getAttachmentName(),urlfont);
Chunk chunk = new Chunk(reportAttachmentEntity.getAttachmentName(), urlfont);
paragraphPath2.add(chunk);
paragraphPath2.add(Chunk.NEWLINE);
}
......@@ -289,7 +289,62 @@ public class ReportToPdfController extends BaseController {
supplementAttachment1.setBorderWidth(0);
table3.addCell(supplementAttachment1);
document.add(table3);
}
if (reportEntity.getReportStatus().equals("2")) {
Paragraph pt3 = new Paragraph("处理结果", title);
pt3.setAlignment(0);//设置文字居中 0靠左 1,居中 2,靠右
document.add(pt3);
Paragraph blankRow3 = new Paragraph(18f, " ", textfont);
document.add(blankRow3);
PdfPTable table4 = new PdfPTable(2);
table4.setTotalWidth(new float[]{5, 10}); //设置表头列宽
PdfPCell dealPersonName = new PdfPCell(new Paragraph("处理人:", textfont));
dealPersonName.setBorderWidth(0);
table4.addCell(dealPersonName);
PdfPCell dealPersonName1 = new PdfPCell(new Paragraph(reportEntity.getDealPersonName() == null ? "" : reportEntity.getDealPersonName(), textfont));
dealPersonName1.setBorderWidth(0);
table4.addCell(dealPersonName1);
PdfPCell dealAttachment = new PdfPCell(new Paragraph("处理成果文件:", textfont));
dealAttachment.setBorderWidth(0);
table4.addCell(dealAttachment);
//获取附件列表
ReportAttachmentEntity reportAttachmentBean2 = new ReportAttachmentEntity();
reportAttachmentBean2.setReportId(reportEntity.getId());
reportAttachmentBean2.setAttachmentType("2");
List<ReportAttachmentEntity> list2 = reportService.getAttachmentInfo(reportAttachmentBean2);
Paragraph paragraphPath2 = new Paragraph();
if (list2 != null && list2.size() != 0) {
for (ReportAttachmentEntity reportAttachmentEntity : list2) {
Chunk chunk = new Chunk(reportAttachmentEntity.getAttachmentName(), urlfont);
paragraphPath2.add(chunk);
paragraphPath2.add(Chunk.NEWLINE);
}
}
PdfPCell dealAttachment1 = new PdfPCell(paragraphPath2);
dealAttachment1.setBorderWidth(0);
table4.addCell(dealAttachment1);
PdfPCell dealResult = new PdfPCell(new Paragraph("处理结论:", textfont));
dealResult.setBorderWidth(0);
table4.addCell(dealResult);
String deal_result = reportEntity.getDealResult();
if (StringUtils.isNotBlank(deal_result)) {
if (deal_result.equals("1")) {
deal_result = "投诉";
} else if (deal_result.equals("2")) {
deal_result = "举报无效";
} else if (deal_result.equals("3")) {
deal_result = "举报属实";
}
} else {
deal_result = "";
}
PdfPCell dealResult1 = new PdfPCell(new Paragraph(deal_result, textfont));
dealResult1.setBorderWidth(0);
table4.addCell(dealResult1);
document.add(table4);
}
document.close();
PrintWriter out = response.getWriter();
response.setContentType("application/json;charset=utf-8");
......
......@@ -39,6 +39,7 @@ public class WorkbenchBean {
private int email = 0;
private int sunacE = 0;
private int phone = 0;
private int visit = 0;
//举报类型
private int sale = 0;
......@@ -196,6 +197,14 @@ public class WorkbenchBean {
this.phone = phone;
}
public int getVisit() {
return visit;
}
public void setVisit(int visit) {
this.visit = visit;
}
public int getSale() {
return sale;
}
......
......@@ -117,7 +117,7 @@ public class WorkbenchService extends CrudService<ReportDao, ReportEntity> {
}else if("wechat".equals(String.valueOf(total.get("REPORT_SOURCE")))){
//微信公众号
workbench.setWeChat(Integer.valueOf(String.valueOf(total.get("COUNT(REPORT_SOURCE)"))));
}else if("sunacE:".equals(String.valueOf(total.get("REPORT_SOURCE")))){
}else if("sunacE".equals(String.valueOf(total.get("REPORT_SOURCE")))){
//融E
workbench.setSunacE(Integer.valueOf(String.valueOf(total.get("COUNT(REPORT_SOURCE)"))));
}else if("offline".equals(String.valueOf(total.get("REPORT_SOURCE")))){
......@@ -126,14 +126,17 @@ public class WorkbenchService extends CrudService<ReportDao, ReportEntity> {
}else if("tel".equals(String.valueOf(total.get("REPORT_SOURCE")))){
//电话
workbench.setPhone(Integer.valueOf(String.valueOf(total.get("COUNT(REPORT_SOURCE)"))));
}else if("email:".equals((String) total.get("REPORT_SOURCE"))){
}else if("email".equals((String) total.get("REPORT_SOURCE"))){
//邮件
workbench.setEmail(Integer.valueOf(String.valueOf(total.get("COUNT(REPORT_SOURCE)"))));
}else if("visit".equals((String) total.get("REPORT_SOURCE"))){
//来访
workbench.setVisit(Integer.valueOf(String.valueOf(total.get("COUNT(REPORT_SOURCE)"))));
}
}
}
workbench.setTotal(workbench.getWeb()+workbench.getOa()+workbench.getSupplier()+workbench.getWeChat()+
workbench.getSunacE()+workbench.getOffline()+workbench.getPhone()+workbench.getEmail());
workbench.getSunacE()+workbench.getOffline()+workbench.getPhone()+workbench.getEmail()+workbench.getVisit());
return workbench;
}
......
......@@ -258,7 +258,6 @@
<td style="width: 10% "></td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;供应商系统&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${workbench.supplier}</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;邮件&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${workbench.email}</td>
<td></td>
</tr>
</table>
</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