Commit d35de3f9 by Java-李昕颖

工作转交 及 导出Excel修改

parent 9f1cd6bc
...@@ -89,10 +89,10 @@ public interface ReportDao extends CrudDao<ReportEntity> { ...@@ -89,10 +89,10 @@ public interface ReportDao extends CrudDao<ReportEntity> {
/** /**
* 根据reportId查询消息表中是否已存在该条记录 * 根据reportId查询消息表中是否已存在该条记录
* @param reportId * @param reportEntity
* @return * @return
*/ */
public ReportNotice findReportNotice(String reportId,String userId); public ReportNotice findReportNotice(ReportEntity reportEntity);
/** /**
* 新增消息 * 新增消息
...@@ -145,4 +145,18 @@ public interface ReportDao extends CrudDao<ReportEntity> { ...@@ -145,4 +145,18 @@ public interface ReportDao extends CrudDao<ReportEntity> {
* 举报列表 * 举报列表
*/ */
public List<ReportEntity> getRepList(WorkbenchBean benchBean) throws Exception; public List<ReportEntity> getRepList(WorkbenchBean benchBean) throws Exception;
/**
* 工作转交 查询举报记录
* @param reportEntity
* @return
*/
public List<ReportEntity> getChooseReportList(ReportEntity reportEntity);
/**
* 工作转交 更改转交人
* @param reportEntity
* @return
*/
public int updateExchangeUser(ReportEntity reportEntity);
} }
...@@ -35,7 +35,7 @@ public class ReportEntity extends DataEntity<ReportEntity> { ...@@ -35,7 +35,7 @@ public class ReportEntity extends DataEntity<ReportEntity> {
private String dealResult; //处理结论 1 投诉 2 举报无效 3 举报属实 private String dealResult; //处理结论 1 投诉 2 举报无效 3 举报属实
private String exchangeBeforeUser; //移交/转交前用户 private String exchangeBeforeUser; //移交/转交前用户
private String exchangeAfterUser; //移交/转交后用户(只记录最新的移交用户,此处不记录历史) private String exchangeAfterUser; //移交/转交后用户(只记录最新的移交用户,此处不记录历史)
private String exchangeType; //举报改变类型 1移交 2转交
private String reportTimeFrom; //举报时间起 private String reportTimeFrom; //举报时间起
private String reportTimeTo; //举报时间止 private String reportTimeTo; //举报时间止
...@@ -222,6 +222,14 @@ public class ReportEntity extends DataEntity<ReportEntity> { ...@@ -222,6 +222,14 @@ public class ReportEntity extends DataEntity<ReportEntity> {
this.exchangeAfterUser = exchangeAfterUser; this.exchangeAfterUser = exchangeAfterUser;
} }
public String getExchangeType() {
return exchangeType;
}
public void setExchangeType(String exchangeType) {
this.exchangeType = exchangeType;
}
public String getReportTimeFrom() { public String getReportTimeFrom() {
return reportTimeFrom; return reportTimeFrom;
} }
......
...@@ -2,6 +2,7 @@ package com.ejweb.modules.report.entity; ...@@ -2,6 +2,7 @@ package com.ejweb.modules.report.entity;
public class ReportExchangeHistory { public class ReportExchangeHistory {
private String id; private String id;
private String reportId;
private String oldUserId; private String oldUserId;
private String newUserId; private String newUserId;
private String exchangeType; private String exchangeType;
...@@ -15,6 +16,14 @@ public class ReportExchangeHistory { ...@@ -15,6 +16,14 @@ public class ReportExchangeHistory {
this.id = id; this.id = id;
} }
public String getReportId() {
return reportId;
}
public void setReportId(String reportId) {
this.reportId = reportId;
}
public String getOldUserId() { public String getOldUserId() {
return oldUserId; return oldUserId;
} }
......
...@@ -107,6 +107,9 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> { ...@@ -107,6 +107,9 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
reportEntity.preUpdate(); reportEntity.preUpdate();
User user = UserUtils.getUser(); User user = UserUtils.getUser();
reportEntity.setDealPersonName(user.getName()); reportEntity.setDealPersonName(user.getName());
if (StringUtils.isNotBlank(reportEntity.getExchangeAfterUser())){
reportEntity.setExchangeType("1");
}
dao.addTrack(reportEntity); dao.addTrack(reportEntity);
if (StringUtils.isNotBlank(reportEntity.getSupplementAttachment())) { if (StringUtils.isNotBlank(reportEntity.getSupplementAttachment())) {
...@@ -226,9 +229,9 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> { ...@@ -226,9 +229,9 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
User user = UserUtils.getUser(); User user = UserUtils.getUser();
Date date = new Date(); Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
ReportNotice reportNotice = reportDao.findReportNotice(reportEntity.getId(),user.getId()); ReportNotice reportNotice = reportDao.findReportNotice(reportEntity);
if (reportNotice != null){ if (reportNotice != null){
//消息表中已存在该条举报的移交信息 //消息表中已存在该条举报的移交信息,更新该记录
if (StringUtils.isNotBlank(user.getId())){ if (StringUtils.isNotBlank(user.getId())){
reportNotice.setUpdateBy(user.getId()); reportNotice.setUpdateBy(user.getId());
} }
...@@ -240,14 +243,18 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> { ...@@ -240,14 +243,18 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
reportNotice.setStatus("0"); reportNotice.setStatus("0");
reportDao.updateReportNotice(reportNotice); reportDao.updateReportNotice(reportNotice);
}else{ }else{
//消息表中不存在该条举报的信息,新增记录
reportNotice = new ReportNotice();
reportNotice.setId(IdGen.uuid()); reportNotice.setId(IdGen.uuid());
reportNotice.setReportId(reportEntity.getId()); reportNotice.setReportId(reportEntity.getId());
if (flag.equals("answer")){ if (flag.equals("answer")){
//一般用户处理完成,消息标题为“已由xxx完成”
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());
}else{ }else{
//管理员转交或移交,消息标题为“请处理xxx”
reportNotice.setTitle("请处理-“"+reportEntity.getSupplementTitle()+"”"); reportNotice.setTitle("请处理-“"+reportEntity.getSupplementTitle()+"”");
reportNotice.setSendToId(reportEntity.getExchangeAfterUser()); reportNotice.setSendToId(reportEntity.getExchangeAfterUser());
} }
...@@ -264,7 +271,7 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> { ...@@ -264,7 +271,7 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
} }
/** /**
* 新增移交记录 * 新增移交/转交记录
* @param reportEntity * @param reportEntity
* @return * @return
*/ */
...@@ -272,6 +279,7 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> { ...@@ -272,6 +279,7 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
public void addRecord(ReportEntity reportEntity,String exchangeType){ public void addRecord(ReportEntity reportEntity,String exchangeType){
ReportExchangeHistory reportExchangeHistory = new ReportExchangeHistory(); ReportExchangeHistory reportExchangeHistory = new ReportExchangeHistory();
reportExchangeHistory.setId(IdGen.uuid()); reportExchangeHistory.setId(IdGen.uuid());
reportExchangeHistory.setReportId(reportEntity.getId());
reportExchangeHistory.setOldUserId(reportEntity.getExchangeBeforeUser()); reportExchangeHistory.setOldUserId(reportEntity.getExchangeBeforeUser());
reportExchangeHistory.setNewUserId(reportEntity.getExchangeAfterUser()); reportExchangeHistory.setNewUserId(reportEntity.getExchangeAfterUser());
reportExchangeHistory.setExchangeType(exchangeType); reportExchangeHistory.setExchangeType(exchangeType);
...@@ -290,38 +298,48 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> { ...@@ -290,38 +298,48 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
List<ReportEntity> reportList = dao.findList(reportEntity); List<ReportEntity> reportList = dao.findList(reportEntity);
for (ReportEntity report : reportList) { for (ReportEntity report : reportList) {
String supplementType = report.getSupplementType(); String supplementType = report.getSupplementType();
if (supplementType.equals("1")){ if (StringUtils.isNotBlank(supplementType)) {
supplementType = "营销"; if (supplementType.equals("1")) {
}else if (supplementType.equals("2")){ supplementType = "营销";
supplementType = "工程"; } else if (supplementType.equals("2")) {
}else if (supplementType.equals("3")){ supplementType = "工程";
supplementType = "成本"; } else if (supplementType.equals("3")) {
}else if (supplementType.equals("4")){ supplementType = "成本";
supplementType = "招采"; } else if (supplementType.equals("4")) {
}else if (supplementType.equals("5")){ supplementType = "招采";
supplementType = "人力"; } else if (supplementType.equals("5")) {
}else if (supplementType.equals("6")){ supplementType = "人力";
supplementType = "物业"; } else if (supplementType.equals("6")) {
}else if (supplementType.equals("7")){ supplementType = "物业";
supplementType = "投诉"; } else if (supplementType.equals("7")) {
supplementType = "投诉";
}
}else{
supplementType = "";
} }
report.setSupplementType(supplementType); report.setSupplementType(supplementType);
String reportStatus = report.getReportStatus(); String reportStatus = report.getReportStatus();
if (reportStatus.equals("0")){ if (StringUtils.isNotBlank(reportStatus)) {
reportStatus = "未处理"; if (reportStatus.equals("0")) {
}else if (reportStatus.equals("1")){ reportStatus = "未处理";
reportStatus = "处理中"; } else if (reportStatus.equals("1")) {
}else if (reportStatus.equals("2")){ reportStatus = "处理中";
reportStatus = "已处理"; } else if (reportStatus.equals("2")) {
reportStatus = "已处理";
}
}else{
reportStatus = "";
} }
report.setReportStatus(reportStatus); report.setReportStatus(reportStatus);
String dealResult = report.getDealResult(); String dealResult = report.getDealResult();
if (dealResult.equals("1")){ if (StringUtils.isNotBlank(dealResult)) {
dealResult = "投诉"; if (dealResult.equals("1")) {
}else if (dealResult.equals("2")){ dealResult = "投诉";
dealResult = "举报无效"; } else if (dealResult.equals("2")) {
}else if (dealResult.equals("3")){ dealResult = "举报无效";
dealResult = "举报属实"; } else if (dealResult.equals("3")) {
dealResult = "举报属实";
}
}else{ }else{
dealResult = "--"; dealResult = "--";
} }
...@@ -330,4 +348,36 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> { ...@@ -330,4 +348,36 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
} }
return reportList; return reportList;
} }
/**
* 查询举报列表
* @param reportEntity
* @return
*/
public Page<ReportEntity> getChooseReportPage(Page<ReportEntity> page,ReportEntity reportEntity){
reportEntity.setPage(page);
page.setList(reportDao.getChooseReportList(reportEntity));
return page;
}
/**
* 查询举报列表
* @param reportIds
* @param userId
* @return
*/
@Transactional(readOnly = false)
public void deliverReport(String[] reportIds, String userId) {
User user = UserUtils.getUser();
for (String reportId : reportIds){
ReportEntity reportEntity = dao.get(reportId);
reportEntity.setExchangeAfterUser(userId);
reportEntity.setExchangeType("2");
reportEntity.setUpdateBy(user);
reportEntity.setUpdateDate(new Date());
reportDao.updateExchangeUser(reportEntity);
this.addNotice(reportEntity,"deliver");
this.addRecord(reportEntity,"2");
}
}
} }
...@@ -208,20 +208,30 @@ public class ReportController extends BaseController { ...@@ -208,20 +208,30 @@ public class ReportController extends BaseController {
* @return * @return
*/ */
@RequestMapping(value = "viewTransfer") @RequestMapping(value = "viewTransfer")
public void viewTransfer(User user,HttpServletRequest request, HttpServletResponse response, Model model) throws IOException { public void viewTransfer(User user,String flag,HttpServletRequest request, HttpServletResponse response, Model model) throws IOException {
Page<User> page = reportService.findUserPage(new Page<User>(request, response), user); Page<User> page = reportService.findUserPage(new Page<User>(request, response), user);
StringBuffer html = new StringBuffer(); StringBuffer html = new StringBuffer();
html.append("<table id='contentTable' class='table table-striped table-bordered table-condensed'>"); html.append("<table id='contentTable' class='table table-striped table-bordered table-condensed'>");
html.append(" <thead>"); html.append(" <thead>");
html.append(" <tr>"); html.append(" <tr>");
html.append(" <th>选择</th>"); if (flag.equals("1")) {//移交
html.append(" <th>ID</th>"); html.append(" <th>选择</th>");
html.append(" <th>员工号</th>"); html.append(" <th>ID</th>");
html.append(" <th>姓名</th>"); html.append(" <th>员工号</th>");
html.append(" <th>手机号</th>"); html.append(" <th>姓名</th>");
html.append(" <th>所属公司</th>"); html.append(" <th>手机号</th>");
html.append(" <th>所属部门</th>"); html.append(" <th>所属公司</th>");
html.append(" <th>职位</th>"); html.append(" <th>所属部门</th>");
html.append(" <th>职位</th>");
}else if (flag.equals("2")){//转交
html.append(" <th>选择</th>");
html.append(" <th>ID</th>");
html.append(" <th>用户名</th>");
html.append(" <th>姓名</th>");
html.append(" <th>组织</th>");
html.append(" <th>手机号码</th>");
html.append(" <th>角色</th>");
}
html.append(" </tr>"); html.append(" </tr>");
html.append(" </thead>"); html.append(" </thead>");
html.append(" <tbody>"); html.append(" <tbody>");
...@@ -229,14 +239,24 @@ public class ReportController extends BaseController { ...@@ -229,14 +239,24 @@ public class ReportController extends BaseController {
int i = 1; int i = 1;
for (User userEntity : page.getList()){ for (User userEntity : page.getList()){
html.append(" <tr>"); html.append(" <tr>");
html.append(" <td><input type='radio' value='"+userEntity.getId()+"' onclick='chooseRen(this);'></td>"); if (flag.equals("1")) {
html.append(" <td>"+i+"</td>"); html.append(" <td><input type='radio' value='" + userEntity.getId() + "' onclick='chooseRen(this);'></td>");
html.append(" <td>"+(userEntity.getNo()==null?"":userEntity.getNo())+"</td>"); html.append(" <td>" + i + "</td>");
html.append(" <td>"+(userEntity.getName()==null?"":userEntity.getName())+"</td>"); html.append(" <td>" + (userEntity.getNo() == null ? "" : userEntity.getNo()) + "</td>");
html.append(" <td>"+(userEntity.getMobile()==null?"":userEntity.getMobile())+"</td>"); html.append(" <td>" + (userEntity.getName() == null ? "" : userEntity.getName()) + "</td>");
html.append(" <td>"+(userEntity.getCompany()==null?"":userEntity.getCompany().getName())+ "</td>"); html.append(" <td>" + (userEntity.getMobile() == null ? "" : userEntity.getMobile()) + "</td>");
html.append(" <td>"+(userEntity.getOffice()==null?"":userEntity.getOffice().getName())+ "</td>"); html.append(" <td>" + (userEntity.getCompany() == null ? "" : userEntity.getCompany().getName()) + "</td>");
html.append(" <td>"+(userEntity.getPositionName()==null?"":userEntity.getPositionName())+"</td>"); html.append(" <td>" + (userEntity.getOffice() == null ? "" : userEntity.getOffice().getName()) + "</td>");
html.append(" <td>" + (userEntity.getPositionName() == null ? "" : userEntity.getPositionName()) + "</td>");
}else if (flag.equals("2")){
html.append(" <td><input type='radio' value='" + userEntity.getId() + "' onclick='chooseRen(this);'></td>");
html.append(" <td>" + i + "</td>");
html.append(" <td>" + (userEntity.getLoginName() == null ? "" : userEntity.getLoginName()) + "</td>");
html.append(" <td>" + (userEntity.getName() == null ? "" : userEntity.getName()) + "</td>");
html.append(" <td></td>");
html.append(" <td>" + (userEntity.getMobile() == null ? "" : userEntity.getMobile()) + "</td>");
html.append(" <td>" + (userEntity.getRole().getName() == null ? "" : userEntity.getRole().getName()) + "</td>");
}
html.append(" </tr>"); html.append(" </tr>");
i++; i++;
} }
...@@ -257,7 +277,7 @@ public class ReportController extends BaseController { ...@@ -257,7 +277,7 @@ public class ReportController extends BaseController {
} }
@RequestMapping(value = "export", method = RequestMethod.POST) @RequestMapping(value = "export", method = RequestMethod.POST)
public String exportParticipantList(ReportEntity reportEntity,String flag, HttpServletRequest request,HttpServletResponse response, RedirectAttributes redirectAttributes) { public String export(ReportEntity reportEntity,String flag, HttpServletRequest request,HttpServletResponse response, RedirectAttributes redirectAttributes) {
try { try {
String fileName = "举报列表" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx"; String fileName = "举报列表" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
List<ReportEntity> reportList = reportService.getReportList(reportEntity); List<ReportEntity> reportList = reportService.getReportList(reportEntity);
...@@ -268,4 +288,52 @@ public class ReportController extends BaseController { ...@@ -268,4 +288,52 @@ public class ReportController extends BaseController {
} }
return "redirect:" + adminPath + "/report/list/?repage&flag="+flag; return "redirect:" + adminPath + "/report/list/?repage&flag="+flag;
} }
/**
* 转交列表
*
* @param reportEntity
* @param model
* @param request
* @param response
* @return
*/
@RequestMapping(value = "deliverList")
public String deliverList(ReportEntity reportEntity, HttpServletRequest request, HttpServletResponse response, Model model) {
//判断登录人的角色
User user = UserUtils.getUser();
String roleName = reportService.findRole(user);
if (StringUtils.isNotBlank(roleName)){
if (!roleName.equals("系统管理员")){
reportEntity.setExchangeAfterUser(user.getId());
}
}
Page<ReportEntity> page = reportService.getChooseReportPage(new Page<ReportEntity>(request, response), reportEntity);
User userEntity = new User();
Page<User> userPage = reportService.findUserPage(new Page<User>(request, response), userEntity);
model.addAttribute("page", page);
model.addAttribute("userPage", userPage);
model.addAttribute("user", userEntity);
model.addAttribute("report", reportEntity);
return "modules/report/reportDeliver";
}
/**
* 转交操作
*
* @param reportIds
* @param userId
* @param request
* @param response
* @return
*/
@RequestMapping(value = "deliver")
public void deliver(String[] reportIds,String userId, HttpServletRequest request, HttpServletResponse response) throws IOException {
reportService.deliverReport(reportIds,userId);
String result = "1";
PrintWriter out = response.getWriter();
response.setContentType("application/json;charset=utf-8");
out.write(result);
out.close();
}
} }
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
r.deal_result AS "dealResult", r.deal_result AS "dealResult",
r.exchange_before_user AS "exchangeBeforeUser", r.exchange_before_user AS "exchangeBeforeUser",
r.exchange_after_user AS "exchangeAfterUser", r.exchange_after_user AS "exchangeAfterUser",
r.exchange_type AS "exchangeType",
r.create_by AS "createBy", r.create_by AS "createBy",
r.create_date AS "createDate", r.create_date AS "createDate",
r.update_by AS "updateBy", r.update_by AS "updateBy",
...@@ -141,6 +142,7 @@ ...@@ -141,6 +142,7 @@
report_status, report_status,
exchange_before_user, exchange_before_user,
exchange_after_user, exchange_after_user,
exchange_type,
create_by, create_by,
create_date, create_date,
update_by, update_by,
...@@ -158,6 +160,7 @@ ...@@ -158,6 +160,7 @@
#{reportStatus}, #{reportStatus},
#{exchangeBeforeUser}, #{exchangeBeforeUser},
#{exchangeAfterUser}, #{exchangeAfterUser},
#{exchangeType},
#{createBy.id}, #{createBy.id},
#{createDate}, #{createDate},
#{updateBy.id}, #{updateBy.id},
...@@ -195,6 +198,7 @@ ...@@ -195,6 +198,7 @@
supplement_content = #{supplementContent}, supplement_content = #{supplementContent},
deal_person_name = #{dealPersonName}, deal_person_name = #{dealPersonName},
exchange_after_user = #{exchangeAfterUser}, exchange_after_user = #{exchangeAfterUser},
exchange_type = #{exchangeType},
deal_result = #{dealResult}, deal_result = #{dealResult},
update_by = #{updateBy.id}, update_by = #{updateBy.id},
update_date = #{updateDate} update_date = #{updateDate}
...@@ -213,15 +217,20 @@ ...@@ -213,15 +217,20 @@
su.id AS "id", su.id AS "id",
su.`no` AS "no", su.`no` AS "no",
su.`name` AS "name", su.`name` AS "name",
su.login_name AS "loginName",
su.mobile AS "mobile", su.mobile AS "mobile",
so1.`name` AS "company.name", so1.`name` AS "company.name",
so2.`name` AS "office.name", so2.`name` AS "office.name",
sp.position_name AS "positionName" sp.position_name AS "positionName",
FROM sys_user su sr.`name` AS "role.name"
FROM
sys_user su
LEFT JOIN sys_office so1 ON so1.id = su.company_id LEFT JOIN sys_office so1 ON so1.id = su.company_id
LEFT JOIN sys_office so2 ON so2.id = su.office_id LEFT JOIN sys_office so2 ON so2.id = su.office_id
LEFT JOIN sys_user2position sup ON sup.user_id = su.id LEFT JOIN sys_user2position sup ON sup.user_id = su.id
LEFT JOIN sys_position sp ON sp.id = sup.position_id LEFT JOIN sys_position sp ON sp.id = sup.position_id
LEFT JOIN sys_user2role sur ON su.id = sur.user_id
LEFT JOIN sys_role sr ON sr.id = sur.role_id
<where> <where>
1 = 1 1 = 1
<if test="no != null and no != ''"> <if test="no != null and no != ''">
...@@ -251,6 +260,12 @@ ...@@ -251,6 +260,12 @@
<if test="positionName != null and positionName != ''"> <if test="positionName != null and positionName != ''">
AND sp.position_name = #{positionName} AND sp.position_name = #{positionName}
</if> </if>
<if test="loginName != null and loginName != ''">
AND su.login_name LIKE
<if test="dbName == 'oracle'">'%'||#{loginName}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{loginName}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{loginName}, '%')</if>
</if>
</where> </where>
ORDER BY su.update_date DESC ORDER BY su.update_date DESC
</select> </select>
...@@ -321,12 +336,11 @@ ...@@ -321,12 +336,11 @@
WHERE report_id = #{reportId} WHERE report_id = #{reportId}
</update> </update>
<select id="findReportNotice" resultType="ReportNotice"> <select id="findReportNotice" resultType="com.ejweb.modules.workbench.entity.ReportNotice">
SELECT SELECT * FROM report_notice rn
* LEFT JOIN report r ON rn.report_id = r.id
FROM report_notice WHERE rn.report_id = #{id}
WHERE report_id = #{reportId} AND r.exchange_type = #{exchangeType}
AND send_from_id = #{userId}
</select> </select>
<select id="findAdmin" resultType="String"> <select id="findAdmin" resultType="String">
...@@ -343,12 +357,14 @@ ...@@ -343,12 +357,14 @@
<insert id="addRecord"> <insert id="addRecord">
INSERT INTO report_exchange_history( INSERT INTO report_exchange_history(
id, id,
report_id,
old_user_id, old_user_id,
new_user_id, new_user_id,
exchange_type, exchange_type,
exchange_time exchange_time
) VALUES ( ) VALUES (
#{id}, #{id},
#{reportId},
#{oldUserId}, #{oldUserId},
#{newUserId}, #{newUserId},
#{exchangeType}, #{exchangeType},
...@@ -444,6 +460,7 @@ ...@@ -444,6 +460,7 @@
r.deal_result AS "dealResult", r.deal_result AS "dealResult",
r.exchange_before_user AS "exchangeBeforeUser", r.exchange_before_user AS "exchangeBeforeUser",
r.exchange_after_user AS "exchangeAfterUser", r.exchange_after_user AS "exchangeAfterUser",
r.exchange_type AS "exchangeType",
r.create_by AS "createBy", r.create_by AS "createBy",
r.create_date AS "createDate", r.create_date AS "createDate",
r.update_by AS "updateBy", r.update_by AS "updateBy",
...@@ -460,4 +477,44 @@ ...@@ -460,4 +477,44 @@
limit 0,10 limit 0,10
</select> </select>
<select id="getChooseReportList" parameterType="ReportEntity" resultType="ReportEntity">
SELECT
r.id AS "id",
r.report_project AS "reportProject",
r.report_time AS "reportTime",
r.report_person_name AS "reportPersonName",
r.report_person_tel AS "reportPersonTel",
r.report_status AS "reportStatus",
r.supplement_title AS "supplementTitle",
r.supplement_type AS "supplementType",
r.deal_person_name AS "dealPersonName",
r.deal_result AS "dealResult",
(CASE WHEN r.exchange_type='2' THEN (SELECT `name` FROM sys_user WHERE id=r.exchange_after_user) ELSE '--' END) AS "exchangeAfterUser",
r.exchange_type AS "exchangeType"
FROM report r
<where>
1 = 1
<if test="exchangeAfterUser != null and exchangeAfterUser != ''">
AND r.exchange_after_user = #{exchangeAfterUser}
</if>
<if test="dealPersonName != null and dealPersonName != ''">
AND r.deal_person_name LIKE
<if test="dbName == 'oracle'">'%'||#{dealPersonName}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{dealPersonName}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{dealPersonName}, '%')</if>
</if>
</where>
ORDER BY r.update_date DESC
</select>
<update id="updateExchangeUser">
UPDATE report SET
exchange_after_user = #{exchangeAfterUser},
exchange_type = #{exchangeType},
update_by = #{updateBy.id},
update_date = #{updateDate}
WHERE id = #{id}
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -9,8 +9,7 @@ ...@@ -9,8 +9,7 @@
$("#btnExport").click(function(){ $("#btnExport").click(function(){
top.$.jBox.confirm("确认要导出数据吗?","系统提示",function(v,h,f){ top.$.jBox.confirm("确认要导出数据吗?","系统提示",function(v,h,f){
if(v=="ok"){ if(v=="ok"){
var flag = $("#flag").val(); $("#searchForm").attr("action","${ctx}/report/export?");
$("#searchForm").attr("action","${ctx}/report/export?flag="+flag);
$("#searchForm").submit(); $("#searchForm").submit();
} }
},{buttonsFocus:1}); },{buttonsFocus:1});
......
...@@ -42,14 +42,14 @@ ...@@ -42,14 +42,14 @@
//关闭隐藏层 //关闭隐藏层
$("#btnClose").click(function () { $("#btnClose").click(function () {
$("#chooseDiv").hide(); $("#chooseDiv").hide();
$("#fade").show(); $("#fade").hide();
}); });
//选中用户并关闭 //选中用户并关闭
$("#btnConfirm").click(function () { $("#btnConfirm").click(function () {
$("#chooseUser").val($("input:radio:checked").parent().next().next().next().html()); $("#chooseUser").val($("input:radio:checked").parent().next().next().next().html());
$("#userId").val($("input:radio:checked").val()); $("#userId").val($("input:radio:checked").val());
$("#chooseDiv").hide(); $("#chooseDiv").hide();
$("#fade").show(); $("#fade").hide();
}); });
}); });
...@@ -216,7 +216,7 @@ ...@@ -216,7 +216,7 @@
$(document).ready(function() { $(document).ready(function() {
$("#btnSearch").click(function () { $("#btnSearch").click(function () {
$.ajax({ $.ajax({
url: "${ctx}/report/viewTransfer", url: "${ctx}/report/viewTransfer?flag=1",
dataType: "html", dataType: "html",
data: $('#searchForm').serialize(), data: $('#searchForm').serialize(),
cache: false, cache: false,
...@@ -251,7 +251,7 @@ ...@@ -251,7 +251,7 @@
function page(n,s){ function page(n,s){
$("#pageNo").val(n); $("#pageNo").val(n);
$("#pageSize").val(s); $("#pageSize").val(s);
$("#searchForm").attr("action", "${ctx}/report/viewTransfer"); $("#searchForm").attr("action", "${ctx}/report/viewTransfer?flag=1");
$("#searchForm").submit(); $("#searchForm").submit();
return false; return false;
} }
......
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