Commit 2308be45 by 涂亚平

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

1 parent 895053e3
...@@ -37,7 +37,7 @@ public interface RenSheJuMapper { ...@@ -37,7 +37,7 @@ public interface RenSheJuMapper {
/** /**
* 前一天新增视频学习数据 * 前一天新增视频学习数据
*/ */
List<DailyStudyInfoVO> dailyStudyInfo(String classId); List<DailyStudyInfoVO> dailyStudyInfo(Long classId);
/** /**
* 前一天活跃度检测列表 * 前一天活跃度检测列表
......
...@@ -155,9 +155,18 @@ public class RenSheJuServiceImpl implements RenSheJuService { ...@@ -155,9 +155,18 @@ public class RenSheJuServiceImpl implements RenSheJuService {
List<ClassHourBasic> classHourBasics = new ArrayList<>(); List<ClassHourBasic> classHourBasics = new ArrayList<>();
try { try {
//看视频的班级 //产生视频学习数据的班级
List<DailyStudyInfoVO> dailyStudyInfoVOS = renSheJuMapper.dailyStudyInfo("0"); List<Long> vodClassIds = renSheJuMapper.vodClassIds("0");
for (DailyStudyInfoVO dailyStudyInfoVO : dailyStudyInfoVOS) {
List<DailyStudyInfoVO> result = new ArrayList<>();
for (Long classId : vodClassIds){
//产生数据的班级
List<DailyStudyInfoVO> dailyStudyInfoVOS = renSheJuMapper.dailyStudyInfo(classId);
result.addAll(dailyStudyInfoVOS);
}
for (DailyStudyInfoVO dailyStudyInfoVO : result) {
ClassHourBasic classHourBasic = new ClassHourBasic(); ClassHourBasic classHourBasic = new ClassHourBasic();
BeanUtils.copyProperties(dailyStudyInfoVO, classHourBasic); BeanUtils.copyProperties(dailyStudyInfoVO, classHourBasic);
classHourBasic.setDownCode(dailyStudyInfoVO.getDownCode()); classHourBasic.setDownCode(dailyStudyInfoVO.getDownCode());
...@@ -549,7 +558,7 @@ public class RenSheJuServiceImpl implements RenSheJuService { ...@@ -549,7 +558,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
uploadImage.setImageDetailList(imageDetailLists); uploadImage.setImageDetailList(imageDetailLists);
if (imageDetailLists.size() > 0) { if (imageDetailLists.size() > 0) {
// System.out.println(com.alibaba.fastjson.JSONObject.toJSONString(uploadImage)); System.out.println(com.alibaba.fastjson.JSONObject.toJSONString(uploadImage));
RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(uploadImage).toString()); RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(uploadImage).toString());
Request request = new Request.Builder() Request request = new Request.Builder()
.url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadImage") .url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadImage")
......
...@@ -179,87 +179,88 @@ public class ShehuihuaServiceImpl implements ShehuihuaService { ...@@ -179,87 +179,88 @@ public class ShehuihuaServiceImpl implements ShehuihuaService {
List<ClassHourBasic4DTO> classHourBasics = new ArrayList<>(); List<ClassHourBasic4DTO> classHourBasics = new ArrayList<>();
try { try {
//前一天新增视频学习数据的班级 //TODO 需要按照人社局Impl修改一下
List<DailyStudyInfoVO> dailyStudyInfoVOS = renSheJuMapper.dailyStudyInfo("1"); // //前一天新增视频学习数据的班级
for (DailyStudyInfoVO dailyStudyInfoVO : dailyStudyInfoVOS) { // List<DailyStudyInfoVO> dailyStudyInfoVOS = renSheJuMapper.dailyStudyInfo("1");
ClassHourBasic4DTO classHourBasic = new ClassHourBasic4DTO(); // for (DailyStudyInfoVO dailyStudyInfoVO : dailyStudyInfoVOS) {
BeanUtils.copyProperties(dailyStudyInfoVO, classHourBasic); // ClassHourBasic4DTO classHourBasic = new ClassHourBasic4DTO();
classHourBasic.setClassCode(dailyStudyInfoVO.getDownCode()); // BeanUtils.copyProperties(dailyStudyInfoVO, classHourBasic);
// classHourBasic.setClassCode(dailyStudyInfoVO.getDownCode());
//上线时间列表 //
//找到当天每次上线下线时间 // //上线时间列表
//上线时间 // //找到当天每次上线下线时间
List<OprMemDictDO> loginRecords = renSheJuMapper.loginRecords(dailyStudyInfoVO.getMemberId()); // //上线时间
//下线时间 // List<OprMemDictDO> loginRecords = renSheJuMapper.loginRecords(dailyStudyInfoVO.getMemberId());
List<OprMemDictDO> loginOutRecords = renSheJuMapper.loginOutRecords(dailyStudyInfoVO.getMemberId()); // //下线时间
// List<OprMemDictDO> loginOutRecords = renSheJuMapper.loginOutRecords(dailyStudyInfoVO.getMemberId());
List<LoginList> loginLists = new ArrayList<>(); //
for (int i = 0; i < loginRecords.size(); i++) { // List<LoginList> loginLists = new ArrayList<>();
LoginList loginList = new LoginList(); // for (int i = 0; i < loginRecords.size(); i++) {
loginList.setIp(loginRecords.get(i).getIpAddress()); // LoginList loginList = new LoginList();
loginList.setStartTime(Timestamp.valueOf(loginRecords.get(i).getCreateDate()).getTime()); // loginList.setIp(loginRecords.get(i).getIpAddress());
loginList.setEndTime(Timestamp.valueOf(loginOutRecords.get(i).getCreateDate()).getTime()); // loginList.setStartTime(Timestamp.valueOf(loginRecords.get(i).getCreateDate()).getTime());
// loginList.setEndTime(Timestamp.valueOf(loginOutRecords.get(i).getCreateDate()).getTime());
//查看这个人该时间段的学习记录 //
List<ChapterList3> chapterList3s = renSheJuMapper.dailyStudyRecords(dailyStudyInfoVO.getMemberId(), dailyStudyInfoVO.getDownCode(), loginRecords.get(i).getCreateDate().toString().replace("T", " "), loginOutRecords.get(i).getCreateDate().toString().replace("T", " ")); // //查看这个人该时间段的学习记录
if (chapterList3s.size() > 0) { // List<ChapterList3> chapterList3s = renSheJuMapper.dailyStudyRecords(dailyStudyInfoVO.getMemberId(), dailyStudyInfoVO.getDownCode(), loginRecords.get(i).getCreateDate().toString().replace("T", " "), loginOutRecords.get(i).getCreateDate().toString().replace("T", " "));
loginList.setChapterList(chapterList3s); // if (chapterList3s.size() > 0) {
loginLists.add(loginList); // loginList.setChapterList(chapterList3s);
} // loginLists.add(loginList);
} // }
classHourBasic.setLoginList(loginLists); // }
// classHourBasic.setLoginList(loginLists);
//活跃度列表 //
List<ActivityList> activityLists = new ArrayList<>(); // //活跃度列表
List<DailyActivitiesVO> activityDetectionDOS = renSheJuMapper.dailyActivities(dailyStudyInfoVO.getDownCode(), dailyStudyInfoVO.getMemberId()); // List<ActivityList> activityLists = new ArrayList<>();
for (DailyActivitiesVO dailyActivitiesVO : activityDetectionDOS) { // List<DailyActivitiesVO> activityDetectionDOS = renSheJuMapper.dailyActivities(dailyStudyInfoVO.getDownCode(), dailyStudyInfoVO.getMemberId());
// for (DailyActivitiesVO dailyActivitiesVO : activityDetectionDOS) {
ActivityList activityList = new ActivityList(); //
if (dailyActivitiesVO.getAccess() == 1) { // ActivityList activityList = new ActivityList();
activityList.setAccess(0); // if (dailyActivitiesVO.getAccess() == 1) {
} else { // activityList.setAccess(0);
activityList.setAccess(1); // } else {
activityList.setErrorInfo(2); // activityList.setAccess(1);
} // activityList.setErrorInfo(2);
// }
if (0 == dailyActivitiesVO.getCheckType()) { //
activityList.setActivityDetection(2); // if (0 == dailyActivitiesVO.getCheckType()) {
} else if (1 == dailyActivitiesVO.getCheckType()) { // activityList.setActivityDetection(2);
activityList.setActivityDetection(1); // } else if (1 == dailyActivitiesVO.getCheckType()) {
} // activityList.setActivityDetection(1);
// }
activityList.setActivityTime(dailyActivitiesVO.getActivityTime()); //
activityLists.add(activityList); // activityList.setActivityTime(dailyActivitiesVO.getActivityTime());
} // activityLists.add(activityList);
classHourBasic.setActivityList(activityLists); // }
// classHourBasic.setActivityList(activityLists);
classHourBasics.add(classHourBasic); //
} // classHourBasics.add(classHourBasic);
classHourBehaviorDTO.setClassHourBasic(classHourBasics); // }
// classHourBehaviorDTO.setClassHourBasic(classHourBasics);
System.out.println(com.alibaba.fastjson.JSONObject.toJSONString(classHourBehaviorDTO)); //
// System.out.println(com.alibaba.fastjson.JSONObject.toJSONString(classHourBehaviorDTO));
RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(classHourBehaviorDTO).toString()); //
// RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(classHourBehaviorDTO).toString());
Request request = new Request.Builder() //
.url(renSheConfig.getUrl() + "/import/downstream/social/uploadClassHourBehavior") // Request request = new Request.Builder()
.method("POST", body) // .url(renSheConfig.getUrl() + "/import/downstream/social/uploadClassHourBehavior")
.addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)") // .method("POST", body)
.addHeader("Content-Type", "application/json") // .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)")
.build(); // .addHeader("Content-Type", "application/json")
Response response = client.newCall(request).execute(); // .build();
// Response response = client.newCall(request).execute();
RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class); //
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); // RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class);
renshejuHistoryDO.setInterfaceName(ShehuihuaConstant.POST_4); // RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
renshejuHistoryDO.setInputParam(JSONObject.fromObject(classHourBehaviorDTO).toString()); // renshejuHistoryDO.setInterfaceName(ShehuihuaConstant.POST_4);
if (200 == response.code()) { // renshejuHistoryDO.setInputParam(JSONObject.fromObject(classHourBehaviorDTO).toString());
renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); // if (200 == response.code()) {
} else { // renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString());
renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR); // } else {
} // renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR);
renshejuHistoryMapper.insert(renshejuHistoryDO); // }
return rensheResponseVO; // renshejuHistoryMapper.insert(renshejuHistoryDO);
// return rensheResponseVO;
// return null; // return null;
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
......
...@@ -105,29 +105,27 @@ ...@@ -105,29 +105,27 @@
<select id="dailyStudyInfo" resultType="com.subsidy.vo.renshe.DailyStudyInfoVO"> <select id="dailyStudyInfo" resultType="com.subsidy.vo.renshe.DailyStudyInfoVO">
SELECT SELECT
DISTINCT t.class_id AS downCode,
IFNULL(t2.class_id,t7.class_id) AS downCode, t3.id AS member_id,
t6.member_id, t3.user_name AS studentName,
t4.user_name AS studentName, t3.telephone AS phone,
t4.telephone AS phone, t3.id_card identity,
t4.id_card AS identity, IFNULL( t4.learnTime, 0 ) learnTime,
IFNULL(t2.learnTime,0), IFNULL( t4.playTime, 0 ) playTime,
IFNULL(t2.playTime,0), t2.loginTime
t5.loginTime FROM
FROM class_member_mapping t
class_member_mapping t6
LEFT JOIN member t4 ON t4.id = t6.member_id
LEFT JOIN ( LEFT JOIN (
SELECT SELECT
t3.user_id, t3.user_id,
login - logout AS loginTime , login - logout AS loginTime,
t3.create_date t3.create_date
FROM FROM
( (
SELECT SELECT
user_id, user_id,
sum( sum(
unix_timestamp( t1.create_date )) AS login , unix_timestamp( t1.create_date )) AS login,
create_date create_date
FROM FROM
opr_mem_dict t1 opr_mem_dict t1
...@@ -143,7 +141,7 @@ ...@@ -143,7 +141,7 @@
SELECT SELECT
user_id, user_id,
sum( sum(
unix_timestamp( t1.create_date )) AS logout , unix_timestamp( t1.create_date )) AS logout,
create_date create_date
FROM FROM
opr_mem_dict t1 opr_mem_dict t1
...@@ -155,7 +153,8 @@ ...@@ -155,7 +153,8 @@
GROUP BY GROUP BY
user_id user_id
) t2 ON t3.user_id = t2.user_id ) t2 ON t3.user_id = t2.user_id
) t5 on t5.user_id = t4.id ) t2 ON t2.user_id = t.member_id
LEFT JOIN member t3 ON t.member_id = t3.id
LEFT JOIN ( LEFT JOIN (
SELECT SELECT
t1.class_id, t1.class_id,
...@@ -170,13 +169,12 @@ ...@@ -170,13 +169,12 @@
GROUP BY GROUP BY
t1.class_id, t1.class_id,
t1.member_id t1.member_id
) t2 ON t5.user_id = t2.member_id ) t4 ON t.member_id = t4.member_id
LEFT JOIN class_dict t3 ON t2.class_id = t3.id and t6.class_id = t3.id WHERE
LEFT JOIN image_check_record t7 on t5.user_id = t7.member_id and DATE_FORMAT(t5.create_date,'%Y-%m-%d') = DATE_FORMAT(t7.create_date,'%Y-%m-%d') and t7.result = 1 t.delete_date IS NULL
where t6.delete_date is null and t5.loginTime is not null and IFNULL(t2.class_id,t7.class_id) is not null AND t3.delete_date IS NULL
<if test="classType != null and classType != ''"> AND t.class_id = #{classId}
and t3.class_type = #{classType} AND t2.loginTime IS NOT NULL
</if>
</select> </select>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!