Commit 9d319e6a by sunxin

定时任务,线索定时转换

parent d8d5ce55
......@@ -265,4 +265,12 @@ public interface ReportDao extends CrudDao<ReportEntity> {
* @return
*/
public List<ReportEntity> findListByCheck(ReportEntity entity);
/**
* 跟据当前时间查询已到期的举报信息,将过期信息状态设置无效
* @param entity
* @return
*/
void updateReportByClueTime(ReportEntity entity);
}
......@@ -5,6 +5,7 @@ import com.ejweb.core.persistence.DataEntity;
import com.ejweb.core.utils.excel.annotation.ExcelField;
import com.ejweb.modules.sys.entity.User;
import java.util.Date;
import java.util.List;
/**
......@@ -68,6 +69,15 @@ public class ReportEntity extends DataEntity<ReportEntity> {
private String supplementCategory; //业务类别
private CtBbtcRegion supplementAreaNew; //被举报区域
private CtBbtcBusType supplementTypeNew;//业务类型
private Date transTime; //转为线索的时间
public Date getTransTime() {
return transTime;
}
public void setTransTime(Date transTime) {
this.transTime = transTime;
}
public String getTransferGroup() {
return transferGroup;
......
......@@ -160,6 +160,14 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
reportEntity.setExchangeType("1");
reportEntity.setExchangeAfterUser(transferUser);
}
/*判断处理结论是否为转为线索*/
if(reportEntity.getDealResult().equals("7")){
Date transTime =new Date(); /* transTime 转为线索的时间 */
reportEntity.setTransTime(transTime);
System.out.println("转为线索时间:"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(transTime));
}
dao.addTrack(reportEntity);
if (StringUtils.isNotBlank(reportEntity.getSupplementAttachment())) {
......
package com.ejweb.modules.report.utils;
import com.ejweb.modules.front.report.dao.FrontReportDao;
import com.ejweb.modules.report.dao.ReportDao;
import com.ejweb.modules.report.entity.ReportEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
/**
* Created by haoqm on 2019/7/18.
*/
......@@ -11,10 +19,24 @@ import org.springframework.stereotype.Service;
@Lazy(false)
public class TimedTask {
@Scheduled(cron="0 0 0 * * ?") //每天晚上12点执行
@Autowired
private ReportDao reportDao;
@Scheduled(cron="0 0 12 * * ?") //cron表达式 每天下午6点执行
public void job1() {
System.out.println("spring task 注解使用。。。任务进行中(每天12点触发)");
//获取所有转为线索的举报信息
ReportEntity reportEntity=new ReportEntity();
Calendar c = Calendar.getInstance();
c.add(Calendar.MONTH, -3); // 当前日期减三个月
/* c.add(Calendar.MINUTE, -25); // 当前日期减去25分钟*/
reportEntity.setTransTime(c.getTime());
try{
/*跟据三个月前的过期时间查询并修改举报信息*/
reportDao.updateReportByClueTime(reportEntity);
System.out.println("线索状态改变成功");
}catch (Exception e){
System.out.println("线索状态改变失败");
}
}
......
......@@ -97,7 +97,7 @@ public class ReportController extends BaseController {
reportEntity.setReportStatus("0");
}
} else {
if (flag.equals("4")) {
if (flag.equals("1")) {
if (StringUtils.isBlank(reportEntity.getReportStatus())) {
reportEntity.setDealResult("7");
reportEntity.setFlage("1");
......
......@@ -549,6 +549,9 @@
update_date = #{updateDate},
supplement_group=#{supplementGroup},
supplement_category=#{supplementCategory}
<if test="transTime != null ">
,transTime=#{transTime}
</if>
WHERE id = #{id}
</update>
......@@ -1103,5 +1106,11 @@
where del_flag = 0
</select>
<update id="updateReportByClueTime" parameterType="ReportEntity" >
UPDATE ct_bbtc_report SET
report_status= '3',
deal_result='2'
WHERE DATE(transTime) &lt;= #{transTime}
</update>
</mapper>
\ No newline at end of file
......@@ -172,6 +172,18 @@
<if test="dbName == 'mssql'">'%'+#{supplementCategory}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{supplementCategory}, '%')</if>
</if>
<if test="transferGroup != null and transferGroup != ''">
AND r.transferGroup = #{transferGroup}
</if>
<if test="transferDepartment != null and transferDepartment != ''">
AND r.transfer_department LIKE
<if test="dbName == 'oracle'">'%'||#{transferDepartment}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{transferDepartment}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{transferDepartment}, '%')</if>
</if>
<if test="reportSource != null and reportSource != ''">
AND r.report_source = #{reportSource}
</if>
......@@ -230,6 +242,16 @@
<if test="dbName == 'mssql'">'%'+#{supplementCategory}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{supplementCategory}, '%')</if>
</if>
<if test="transferGroup != null and transferGroup != ''">
AND r.transferGroup = #{transferGroup}
</if>
<if test="transferDepartment != null and transferDepartment != ''">
AND r.transfer_department LIKE
<if test="dbName == 'oracle'">'%'||#{transferDepartment}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{transferDepartment}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{transferDepartment}, '%')</if>
</if>
</where>
</select>
......@@ -353,6 +375,16 @@
<if test="dbName == 'mssql'">'%'+#{supplementCategory}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{supplementCategory}, '%')</if>
</if>
<if test="transferGroup != null and transferGroup != ''">
AND r.transferGroup = #{transferGroup}
</if>
<if test="transferDepartment != null and transferDepartment != ''">
AND r.transfer_department LIKE
<if test="dbName == 'oracle'">'%'||#{transferDepartment}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{transferDepartment}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{transferDepartment}, '%')</if>
</if>
<if test="reportSource != null and reportSource != ''">
AND r.report_source = #{reportSource}
</if>
......@@ -517,6 +549,9 @@
update_date = #{updateDate},
supplement_group=#{supplementGroup},
supplement_category=#{supplementCategory}
<if test="transTime != null ">
,transTime=#{transTime}
</if>
WHERE id = #{id}
</update>
......@@ -1071,5 +1106,11 @@
where del_flag = 0
</select>
<update id="updateReportByClueTime" parameterType="ReportEntity" >
UPDATE ct_bbtc_report SET
report_status= '3',
deal_result='2'
WHERE DATE(transTime) &lt;= #{transTime}
</update>
</mapper>
\ No newline at end of file
No preview for this file type
......@@ -172,6 +172,18 @@
<if test="dbName == 'mssql'">'%'+#{supplementCategory}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{supplementCategory}, '%')</if>
</if>
<if test="transferGroup != null and transferGroup != ''">
AND r.transferGroup = #{transferGroup}
</if>
<if test="transferDepartment != null and transferDepartment != ''">
AND r.transfer_department LIKE
<if test="dbName == 'oracle'">'%'||#{transferDepartment}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{transferDepartment}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{transferDepartment}, '%')</if>
</if>
<if test="reportSource != null and reportSource != ''">
AND r.report_source = #{reportSource}
</if>
......@@ -230,6 +242,16 @@
<if test="dbName == 'mssql'">'%'+#{supplementCategory}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{supplementCategory}, '%')</if>
</if>
<if test="transferGroup != null and transferGroup != ''">
AND r.transferGroup = #{transferGroup}
</if>
<if test="transferDepartment != null and transferDepartment != ''">
AND r.transfer_department LIKE
<if test="dbName == 'oracle'">'%'||#{transferDepartment}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{transferDepartment}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{transferDepartment}, '%')</if>
</if>
</where>
</select>
......@@ -353,6 +375,16 @@
<if test="dbName == 'mssql'">'%'+#{supplementCategory}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{supplementCategory}, '%')</if>
</if>
<if test="transferGroup != null and transferGroup != ''">
AND r.transferGroup = #{transferGroup}
</if>
<if test="transferDepartment != null and transferDepartment != ''">
AND r.transfer_department LIKE
<if test="dbName == 'oracle'">'%'||#{transferDepartment}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{transferDepartment}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{transferDepartment}, '%')</if>
</if>
<if test="reportSource != null and reportSource != ''">
AND r.report_source = #{reportSource}
</if>
......@@ -517,6 +549,9 @@
update_date = #{updateDate},
supplement_group=#{supplementGroup},
supplement_category=#{supplementCategory}
<if test="transTime != null ">
,transTime=#{transTime}
</if>
WHERE id = #{id}
</update>
......@@ -1071,5 +1106,11 @@
where del_flag = 0
</select>
<update id="updateReportByClueTime" parameterType="ReportEntity" >
UPDATE ct_bbtc_report SET
report_status= '3',
deal_result='2'
WHERE DATE(transTime) &lt;= #{transTime}
</update>
</mapper>
\ No newline at end of file
......@@ -190,6 +190,7 @@
slsb.append(new Option(data1[i].name,data1[i].id));
}
}
var selectNode = $("#supplementType");
selectNode.empty();//每次需要将上一次的数据进行清空
selectNode.append("<option value=''>请选择</option>");
......@@ -200,6 +201,7 @@
slsb.append(new Option(data2[i].name,data2[i].id));
}
}
},error:function(data){
alert("系统错误");
}
......@@ -243,6 +245,36 @@
}
function getTransferDepartment(ts_describe){
if(ts_describe != null && ts_describe != ''){
$.ajax({
type: "POST",
url: "${ctx}/report/ctBbtcRegion/getRegionList?groupId="+ts_describe,
dataType: "json",
success: function(returnedData) {
var data2 = returnedData.ctBbtcBusTypeList;
//移交部门赋值
var selectNode = $("#transferDepartment");
selectNode.empty();//每次需要将上一次的数据进行清空
selectNode.append("<option value=''>请选择</option>");
if (data2 != '') {
console.log(data2[0].name);
var slsb=document.getElementById("transferDepartment");
for (var i = 0;i < data2.length;i++){
slsb.append(new Option(data2[i].name,data2[i].id));
}
}
},error:function(data){
alert("系统错误");
}
});
}else{
top.$.jBox.tip('请选择业务类型', 'warning');
}
}
function resetPageNo() {
$("#pageNo").val(0);
}
......@@ -417,6 +449,25 @@
</form:select>
</li>
<li><label>移交集团:</label>
<%-- <form:select onchange="resetPageNo();" path="transferGroup" class="input-small" id="transferGroup" value="${report.transferGroup}">
<form:option value="">请选择</form:option>
</form:select>--%>
<form:select id="transferGroup" path="transferGroup" class="input-small required" onchange="getTransferDepartment(value)">
<form:option value="">请选择</form:option>
<form:options items="${fns:getDictList('supplement_group')}" itemLabel="label" itemValue="id"
htmlEscape="false"/>
</form:select>
</li>
<li><label>移交部门:</label>
<%-- <form:select onchange="resetPageNo();" path="transferDepartment" class="input-small" id="transferDepartment" value="${report.transferDepartment}">
<form:option value="">请选择</form:option>
</form:select>--%>
<form:select id="transferDepartment" onchange="resetPageNo();" path="transferDepartment" class="input-small" value="${report.transferDepartment}">
<form:option value="">请选择</form:option>
</form:select>
</li>
<li><label>处理结论:</label><form:select onchange="resetPageNo();" path="dealResult" class="input-small">
<form:option value=" ">请选择</form:option>
<form:options items="${fns:getDictList('deal_result')}" itemLabel="label" itemValue="value"
......@@ -496,7 +547,7 @@
<th>举报时间</th>
<th>状态</th>
<th>处理结论</th>
<th>移交部门</th>
<th><%--<td>移交集团</td><td>移交部门</td>--%>移交部门</th>
<th>处理人</th>
<c:if test="${isAdmin eq '1'||isAdmin eq '2'}">
<th>移交给</th>
......@@ -508,6 +559,7 @@
<th>邮件发送</th>
<th style="width:10%">操作</th>
</tr>
</thead>
<tbody>
<c:if test="${page.list.size()>0}">
......
......@@ -248,6 +248,37 @@
}
function getTransferDepartment(ts_describe){
if(ts_describe != null && ts_describe != ''){
$.ajax({
type: "POST",
url: "${ctx}/report/ctBbtcRegion/getRegionList?groupId="+ts_describe,
dataType: "json",
success: function(returnedData) {
var data2 = returnedData.ctBbtcBusTypeList;
//移交部门赋值
var selectNode = $("#transferDepartment");
selectNode.empty();//每次需要将上一次的数据进行清空
selectNode.append("<option value=''>请选择</option>");
if (data2 != '') {
console.log(data2[0].name);
var slsb=document.getElementById("transferDepartment");
for (var i = 0;i < data2.length;i++){
slsb.append(new Option(data2[i].name,data2[i].id));
}
}
},error:function(data){
alert("系统错误");
}
});
}else{
top.$.jBox.tip('请选择业务类型', 'warning');
}
}
function resetPageNo() {
$("#pageNo").val(0);
}
......@@ -416,7 +447,24 @@
<form:option value="">请选择</form:option>
</form:select>
</li>
<li><label>移交集团:</label>
<%-- <form:select onchange="resetPageNo();" path="transferGroup" class="input-small" id="transferGroup" value="${report.transferGroup}">
<form:option value="">请选择</form:option>
</form:select>--%>
<form:select id="transferGroup" path="transferGroup" class="input-small required" onchange="getTransferDepartment(value)">
<form:option value="">请选择</form:option>
<form:options items="${fns:getDictList('supplement_group')}" itemLabel="label" itemValue="id"
htmlEscape="false"/>
</form:select>
</li>
<li><label>移交部门:</label>
<%-- <form:select onchange="resetPageNo();" path="transferDepartment" class="input-small" id="transferDepartment" value="${report.transferDepartment}">
<form:option value="">请选择</form:option>
</form:select>--%>
<form:select id="transferDepartment" onchange="resetPageNo();" path="transferDepartment" class="input-small" value="${report.transferDepartment}">
<form:option value="">请选择</form:option>
</form:select>
</li>
<li><label>处理结论:</label><form:select onchange="resetPageNo();" path="dealResult" class="input-small">
<form:option value="">请选择</form:option>
<form:options items="${fns:getDictList('deal_result')}" itemLabel="label" itemValue="value"
......
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