Commit 9c71b838 by 涂亚平

补贴培训第2次上课熬夜改数据

1 parent 78c193ec
......@@ -26,7 +26,7 @@ import java.util.concurrent.ConcurrentHashMap;
/**
* 企业职工线上培训
*/
@Component
//@Component
public class RenSheJuJob {
......@@ -118,7 +118,7 @@ public class RenSheJuJob {
// renSheJuService.getErrorClass();
// }
@Scheduled(cron = "00 50 23 * * ?")
@Scheduled(cron = "0 50 23 * * ?")
@Transactional(rollbackFor = Exception.class)
public void logout(){
//让当前用户下线
......@@ -140,7 +140,7 @@ public class RenSheJuJob {
}
@Scheduled(cron = "00 55 23 * * ?")
@Scheduled(cron = "0 55 23 * * ?")
@Transactional(rollbackFor = Exception.class)
public void cancelLogin() {
......
......@@ -10,15 +10,13 @@ import com.subsidy.vo.vod.VodPlayStateVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
@Component
//@Component
public class WarningJob {
/**
......@@ -61,8 +59,9 @@ public class WarningJob {
VodPlayStateVO vodPlayStateVO = vodPlayStateVOS.get(i + 1); //后面
VodPlayStateVO vodPlayStateVO1 = vodPlayStateVOS.get(i); //前面
if (vodPlayStateVO1.getEndDate().getTime() > vodPlayStateVO.getStartDate().getTime()) {
result.add(vodPlayStateVO.getClassId());
break;
if (!result.contains(vodPlayStateVO1.getClassId())){
result.add(vodPlayStateVO.getClassId());
}
}
}
}
......
......@@ -216,27 +216,27 @@ public class RenSheJuServiceImpl implements RenSheJuService {
System.out.println(com.alibaba.fastjson.JSONObject.toJSONString(classHourBehaviorDTO));
if (classHourBasics.size()>0){
RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(classHourBehaviorDTO).toString());
Request request = new Request.Builder()
.url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadClassHourBehavior")
.method("POST", body)
.addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class);
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_3);
renshejuHistoryDO.setInputParam(JSONObject.fromObject(classHourBehaviorDTO).toString());
if (200 == response.code()) {
renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString());
} else {
renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR);
}
renshejuHistoryMapper.insert(renshejuHistoryDO);
return rensheResponseVO;
// RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(classHourBehaviorDTO).toString());
//
// Request request = new Request.Builder()
// .url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadClassHourBehavior")
// .method("POST", body)
// .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)")
// .addHeader("Content-Type", "application/json")
// .build();
// Response response = client.newCall(request).execute();
//
// RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class);
// RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
// renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_3);
// renshejuHistoryDO.setInputParam(JSONObject.fromObject(classHourBehaviorDTO).toString());
// if (200 == response.code()) {
// renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString());
// } else {
// renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR);
// }
// renshejuHistoryMapper.insert(renshejuHistoryDO);
// return rensheResponseVO;
}else {
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_3);
......
......@@ -695,18 +695,9 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
result.add(vodPlayStateVO.getClassId());
}
}
break;
}
}
}
//
// StringBuffer stringBuffer = new StringBuffer();
// for (int i = 0; i < result.size(); i++) {
// stringBuffer.append(result);
// if (i == result.size()-1){
// stringBuffer.append("n");
// }
// }
if (result.size()>0){
List<String> telephones = Arrays.asList(new String[]{"15201936167", "18201963812", "18217669021"});
......
......@@ -256,7 +256,7 @@
FROM
vod_play_history t1
WHERE
DATE_FORMAT( DATE_ADD( t1.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
DATE_FORMAT( DATE_ADD( t1.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.delete_date IS NULL
</select>
......
......@@ -93,7 +93,7 @@
SELECT
t.member_id,
t.vod_id,
max( t.create_date ) AS create_date
max( t.id ) AS id
FROM
vod_play_history t
WHERE
......@@ -105,9 +105,7 @@
t.vod_id,
t.class_id
) t
LEFT JOIN vod_play_history t2 ON t.vod_id = t2.vod_id
AND t.member_id = t2.member_id
AND t.create_date = t2.create_date
LEFT JOIN vod_play_history t2 ON t.id = t2.id
) t4 ON t2.vod_id = t4.vod_id
WHERE
t.delete_date IS NULL
......
......@@ -22,7 +22,7 @@
FROM
vod_play_history t
WHERE
DATE_FORMAT( DATE_ADD( t.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
DATE_FORMAT( DATE_ADD( t.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t.delete_date IS NULL
) t2 ON t.id = t2.class_id
LEFT JOIN company_dict t3 ON t.company_id = t3.id
......@@ -43,7 +43,7 @@
FROM
exercise_done_result t
WHERE
DATE_FORMAT( DATE_ADD( t.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
DATE_FORMAT( DATE_ADD( t.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t.delete_date IS NULL
) t2 ON t.id = t2.class_id
LEFT JOIN company_dict t3 ON t.company_id = t3.id
......@@ -64,7 +64,7 @@
FROM
answering_question t
WHERE
DATE_FORMAT( DATE_ADD( t.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
DATE_FORMAT( DATE_ADD( t.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t.delete_date IS NULL
) t2 ON t.id = t2.class_id
LEFT JOIN company_dict t3 ON t.company_id = t3.id
......@@ -85,7 +85,7 @@
FROM
image_check_record t
WHERE
DATE_FORMAT( DATE_ADD( t.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
DATE_FORMAT( DATE_ADD( t.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t.delete_date IS NULL
AND t.result = 1
) t2 ON t.id = t2.class_id
......@@ -117,7 +117,7 @@
FROM
vod_play_history t1
WHERE
DATE_FORMAT( DATE_ADD( t1.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
DATE_FORMAT( DATE_ADD( t1.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND
t1.delete_date IS NULL
GROUP BY
......@@ -140,7 +140,7 @@
FROM
opr_mem_dict t1
WHERE
DATE_FORMAT( DATE_ADD( t1.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
DATE_FORMAT( DATE_ADD( t1.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND
t1.delete_date IS NULL
AND opr_type = "登出"
......@@ -155,7 +155,7 @@
FROM
opr_mem_dict t1
WHERE
DATE_FORMAT( DATE_ADD( t1.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
DATE_FORMAT( DATE_ADD( t1.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND
t1.delete_date IS NULL
AND opr_type = "登录"
......@@ -179,7 +179,7 @@
WHERE
t1.delete_date IS NULL
AND t2.class_type = #{classType}
AND DATE_FORMAT( DATE_ADD( t1.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT(
AND DATE_FORMAT( DATE_ADD( t1.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT(
NOW(),
'%Y-%m-%d'
)
......@@ -200,7 +200,7 @@
LEFT JOIN member t3 ON t1.ask_id = t3.id
LEFT JOIN company_dict t4 ON t2.company_id = t4.id
WHERE
DATE_FORMAT( DATE_ADD( t1.update_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
DATE_FORMAT( DATE_ADD( t1.update_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND
t1.delete_date IS NULL
AND t2.delete_date IS NULL
......@@ -216,7 +216,7 @@
class_dict t1
LEFT JOIN company_dict t3 ON t1.company_id = t3.id
WHERE
DATE_FORMAT( DATE_ADD( t1.create_date,interval 0 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
DATE_FORMAT( DATE_ADD( t1.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.delete_date IS NULL
and t1.class_code is not NULL
<if test="classType != null and classType != ''">
......
......@@ -70,7 +70,7 @@
FROM
opr_adm_dict
WHERE
create_date &lt; (NOW() -interval 0 day)
create_date &lt; (NOW() -interval 1 day)
</select>
</mapper>
......@@ -52,7 +52,7 @@
FROM
opr_mem_dict
WHERE
create_date &lt; (NOW() -interval 0 day)
create_date &lt; (NOW() -interval 1 day)
</select>
<select id="getLatestLoginInfo" parameterType="long" resultType="com.subsidy.model.OprMemDictDO">
......@@ -148,62 +148,69 @@
</select>
<select id="insertLastStudyRecord" resultType="com.subsidy.vo.opr.InsertLastStudyRecordVO">
SELECT
t1.member_id,
t1.sign_in_date,
t1.ip_address,
DATE_ADD(t2.mt,INTERVAL FLOOR(RAND()*100) SECOND) as mt
FROM
(
SELECT DISTINCT
t.sign_in_date,
t.member_id,
t.ip_address
FROM
sign_in_record t
WHERE
t.delete_date IS NULL
AND DATE_FORMAT( t.sign_in_date, '%Y-%m-%d' ) = DATE_FORMAT( now(), '%Y-%m-%d' )) t1
LEFT JOIN (
SELECT
t1.member_id,
max( t1.maxtime ) AS mt
FROM
(
SELECT
member_id,
max( create_date ) AS maxtime
FROM
vod_play_history
WHERE
delete_date IS NULL
AND DATE_FORMAT( create_date, '%Y-%m-%d' ) = DATE_FORMAT( now(), '%Y-%m-%d' )
GROUP BY
member_id UNION ALL
SELECT
member_id,
max( create_date ) AS maxtime
FROM
exercise_done_result
WHERE
delete_date IS NULL
AND DATE_FORMAT( create_date, '%Y-%m-%d' ) = DATE_FORMAT( now(), '%Y-%m-%d' )
GROUP BY
member_id UNION ALL
SELECT
ask_id,
max( create_date ) AS maxtime
FROM
answering_question
WHERE
delete_date IS NULL
AND DATE_FORMAT( create_date, '%Y-%m-%d' ) = DATE_FORMAT( now(), '%Y-%m-%d' )
GROUP BY
ask_id
) t1
GROUP BY
t1.member_id
) t2 ON t1.member_id = t2.member_id
SELECT
t1.member_id,
t1.sign_in_date,
t1.ip_address,
DATE_ADD(t2.mt,INTERVAL FLOOR(RAND()*100) SECOND) as mt
FROM
(
SELECT DISTINCT
t.sign_in_date,
t.member_id,
t.ip_address
FROM
sign_in_record t
WHERE
t.delete_date IS NULL
AND DATE_FORMAT( t.sign_in_date, '%Y-%m-%d' ) = DATE_FORMAT( now(), '%Y-%m-%d' )) t1
LEFT JOIN (
SELECT
t1.member_id,
max( t1.maxtime ) AS mt
FROM
(
SELECT
member_id,
max( create_date ) AS maxtime
FROM
vod_play_history
WHERE
delete_date IS NULL
AND DATE_FORMAT( create_date, '%Y-%m-%d' ) = DATE_FORMAT( now(), '%Y-%m-%d' )
GROUP BY
member_id UNION ALL
SELECT
member_id,
max( create_date ) AS maxtime
FROM
exercise_done_result
WHERE
delete_date IS NULL
AND DATE_FORMAT( create_date, '%Y-%m-%d' ) = DATE_FORMAT( now(), '%Y-%m-%d' )
GROUP BY
member_id UNION ALL
SELECT
ask_id,
max( create_date ) AS maxtime
FROM
answering_question
WHERE
delete_date IS NULL
AND DATE_FORMAT( create_date, '%Y-%m-%d' ) = DATE_FORMAT( now(), '%Y-%m-%d' )
GROUP BY
ask_id UNION ALL
SELECT member_id,
max( create_date ) AS maxtime
from
activity_detection
where delete_date is null
and DATE_FORMAT( create_date, '%Y-%m-%d' ) = DATE_FORMAT( now(), '%Y-%m-%d' )
GROUP BY member_id
) t1
GROUP BY
t1.member_id
) t2 ON t1.member_id = t2.member_id
</select>
<select id="shutdownUser" resultType="long">
......
......@@ -55,7 +55,7 @@
delete_date IS NULL
AND date(sign_in_date) = date_sub(
curdate(),
interval 0 day)
interval 1 day)
</select>
</mapper>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!