Commit d4366537 authored by YangZhaoJun1's avatar YangZhaoJun1

Merge branch 'V2.0.3' of http://103.249.252.28:90/lcy/education into V2.0.3

parents f8c322b0 b4b04873
......@@ -108,4 +108,18 @@ ADD COLUMN `sub_agency_seq` varchar(10) NULL AFTER `status`;
/*列表查询增加排序*/
ALTER TABLE `b_schedule_dto`
ADD COLUMN `dto_seq` varchar(10) NULL AFTER `sunday`;
\ No newline at end of file
ADD COLUMN `dto_seq` varchar(10) NULL AFTER `sunday`;
/*更改排序类型*/
ALTER TABLE `b_sl_schedule`
MODIFY COLUMN `seq` int(64) NULL DEFAULT NULL COMMENT '节点id' AFTER `tea_code`;
ALTER TABLE `b_schedule_dto`
MODIFY COLUMN `dto_seq` int(64) NULL DEFAULT NULL COMMENT '排序' AFTER `sunday`;
ALTER TABLE `b_sub_agency`
MODIFY COLUMN `sub_agency_seq` int(10) NULL DEFAULT NULL AFTER `status`;
ALTER TABLE `b_subtask`
MODIFY COLUMN `subtask_seq` int(10) NULL DEFAULT NULL AFTER `grade_code`;
......@@ -164,5 +164,12 @@ public interface BArrangeRepository extends BaseMapper<BArrange> {
"</script>")
@ResultMap(value = "scheduleDtoResultMap")
List<ScheduleDto> queryLessonsBySubAgencyId(String subAgencyId);
@Select("<script>select * from b_schedule_dto " +
"where sub_agency_id = #{subAgencyId} and class_code = #{classCode} and lesson_code = #{lessonCode} " +
"GROUP BY dto_seq " +
"</script>")
@ResultMap(value = "scheduleDtoResultMap")
List<ScheduleDto> queryDtoThroughBsl(@Param("subAgencyId") String subAgencyId,@Param("classCode") String classCode,@Param("lessonCode") String lessonCode);
}
......@@ -285,7 +285,7 @@ public class BArrangeServiceImpl implements BArrangeService {
for (String[] value : values) {
ScheduleDto scheduleDto = new ScheduleDto();
//判断1:根据课程编号查询是否有此门课程;
if(bLessonRepository.selectOne(new BLesson(value[3].trim()))==null){
if(bLessonRepository.select(new BLesson(value[3].trim())).size() != 1){
lessonCodes.add(value[3]);
continue;
}
......@@ -294,24 +294,24 @@ public class BArrangeServiceImpl implements BArrangeService {
user1.setLoginName(value[14]);
user1.setDelFlag("0");
user1.setFlag("1");
if (sysUserMapper.selectOne(user1) == null) {
if (sysUserMapper.select(user1).size() != 1) {
teacherCodes.add(value[14]);
continue;
}
//判断3:根据班级编号查询是否有此班级;
if (bEduClassRepository.selectOne(new BEduClass(value[16].trim())) == null) {
if (bEduClassRepository.select(new BEduClass(value[16].trim())).size() != 1) {
classCodes.add(value[16]);
continue;
}
//判断4:根据教室编号查询是否有此教室;
//如果存在星期日,向后推一格
if(contanSunday){
if(bRoomsRepository.selectOne(new BRooms(value[27].trim()))==null){
if(bRoomsRepository.select(new BRooms(value[27].trim())).size() != 1){
roomCodes.add(value[27]);
continue;
}
}else {
if(bRoomsRepository.selectOne(new BRooms(value[26].trim()))==null){
if(bRoomsRepository.select(new BRooms(value[26].trim())).size() != 1){
roomCodes.add(value[26]);
continue;
}
......@@ -421,7 +421,7 @@ public class BArrangeServiceImpl implements BArrangeService {
for (String[] value : values) {
//判断1:根据课程编号查询是否有此门课程;
if(bLessonRepository.selectOne(new BLesson(value[3].trim()))==null){
if(bLessonRepository.select(new BLesson(value[3].trim())).size() != 1){
lessonCodes.add(value[3]);
continue;
}
......@@ -430,24 +430,24 @@ public class BArrangeServiceImpl implements BArrangeService {
user1.setLoginName(value[14]);
user1.setDelFlag("0");
user1.setFlag("1");
if (sysUserMapper.selectOne(user1) == null) {
if (sysUserMapper.select(user1).size() != 1) {
teacherCodes.add(value[14]);
continue;
}
//判断3:根据班级编号查询是否有此班级;
if (bEduClassRepository.selectOne(new BEduClass(value[16].trim())) == null) {
if (bEduClassRepository.select(new BEduClass(value[16].trim())).size() != 1) {
classCodes.add(value[16]);
continue;
}
//判断4:根据教室编号查询是否有此教室;
//如果存在星期日,向后推一格
if(contanSunday){
if(bRoomsRepository.selectOne(new BRooms(value[27].trim()))==null){
if(bRoomsRepository.select(new BRooms(value[27].trim())).size() != 1){
roomCodes.add(value[27]);
continue;
}
}else {
if(bRoomsRepository.selectOne(new BRooms(value[26].trim()))==null){
if(bRoomsRepository.select(new BRooms(value[26].trim())).size() != 1){
roomCodes.add(value[26]);
continue;
}
......
......@@ -26,9 +26,14 @@ public interface BSlScheduleRepository extends BaseMapper<BSlSchedule> {
@Select("<script>select *, "
+ "b_agency.name as agencyName,b_agency.code as agencyCode,b_agency.business_id as agencyId, \n"
+ "(select sum(student_num) from b_class where FIND_IN_SET(b_class.business_id,b_edu_class.classes_id)) AS studentNum from b_sl_schedule "
+ "b_lesson.code as lessonCode,b_direction.name as directionName,b_direction.code as directionCode, \n"
+ "b_sl.code as bslCode, \n"
+ "(select sum(student_num) from b_class where FIND_IN_SET(b_class.code,b_edu_class.classes_id)) AS studentNum from b_sl_schedule "
+ "left join b_sl on b_sl_schedule.tea_code = b_sl.teacher_code and b_sl_schedule.term_code = b_sl.term_code and b_sl_schedule.lesson_code = b_sl.lesson_code \n"
+ "left join b_edu_class on b_edu_class.code = b_sl_schedule.edu_class_code \n"
+ "left join b_lesson on b_lesson.code = b_sl_schedule.lesson_code \n"
+ "left join b_lesson_direction on b_lesson_direction.lession_id = b_lesson.business_id \n"
+ "left join b_direction on b_direction.business_id = b_lesson_direction.direction_id \n"
+ "left join b_rooms on b_rooms.code = b_sl_schedule.room_code \n"
+ "left join s_user on s_user.login_name = b_sl_schedule.tea_code \n"
+ "left join b_teacher on b_teacher.code = b_sl_schedule.tea_code \n"
......
......@@ -3,8 +3,11 @@ package org.rcisoft.business.bslschedule.entity;
import lombok.*;
import org.rcisoft.business.bagency.entity.BAgency;
import org.rcisoft.business.barrange.entity.ScheduleDto;
import org.rcisoft.business.bdirection.entity.BDirection;
import org.rcisoft.business.beduclass.entity.BEduClass;
import org.rcisoft.business.blesson.entity.BLesson;
import org.rcisoft.business.blesson.entity.BLessonDirection;
import org.rcisoft.business.brooms.entity.BRooms;
import org.rcisoft.business.bteacher.entity.BTeacher;
import org.rcisoft.business.bterm.entity.BTerm;
......@@ -77,5 +80,16 @@ public class BSlSchedule extends IdEntity<BSlSchedule> {
@Transient
private BAgency bAgency;
@Transient
private BDirection bDirection;
@Transient
private List<ScheduleDto> list;
@Transient
private String result;
@Transient
private String bslCode;
}
......@@ -20,6 +20,8 @@ import org.rcisoft.business.bterm.entity.BTerm;
import org.rcisoft.business.bterm.utils.Week;
import org.rcisoft.core.exception.ServiceException;
import org.rcisoft.core.result.ResultServiceEnums;
import org.rcisoft.core.service.RcRedisService;
import org.rcisoft.core.service.SerializationUtils;
import org.rcisoft.core.util.ExcelUtil;
import org.rcisoft.core.util.UserUtil;
import org.rcisoft.core.aop.PageUtil;
......@@ -77,6 +79,10 @@ public class BSlScheduleServiceImpl implements BSlScheduleService {
@Autowired
private BEduClassRepository bEduClassRepository;
@Autowired
private RcRedisService rcRedisServiceImpl;
private static Map<String,Date> timeMap;
private static String termCode;
......@@ -190,10 +196,79 @@ public class BSlScheduleServiceImpl implements BSlScheduleService {
maxCal.add(Calendar.DATE,1);
}
SimpleDateFormat format0 = new SimpleDateFormat("yyyy-MM-dd");
scheduleResult.setBSlSchedules(bSlScheduleRepository.queryMoreBSlSchedules(
List<BSlSchedule> list = bSlScheduleRepository.queryMoreBSlSchedules(
format0.format(minCal.getTime()),
format0.format(maxCal.getTime()),
subAgencyId));
subAgencyId);
// for(BSlSchedule bSlSchedule : list){
// int minWeek = 0;
// int maxWeek = 0;
// //共几周课
// int total = 0;
// String weekDetail = "";
// String key = bSlSchedule.getSubAgencyId() +
// bSlSchedule.getBEduClass() +
// bSlSchedule.getBLesson() + "";
// List<ScheduleDto> scheduleDtos = rcRedisServiceImpl.getList(key);
// //如果缓存内不存在数据
// if(scheduleDtos == null || scheduleDtos.size() == 0){
// List<ScheduleDto> list1 = bArrangeRepository.queryDtoThroughBsl(bSlSchedule.getSubAgencyId(),bSlSchedule.getEduClassCode(),bSlSchedule.getBLesson().getCode());
// for(int i = 0 ; i < list1.size() ; i++){
// String innerKey = key + i;
// rcRedisServiceImpl.setBytes(innerKey, SerializationUtils.serializer(list.get(i)));
// //获取周
// String detailWeek = list1.get(i).getWeek();
// //分割周
// String[] subWeek = detailWeek.split("-");
// //确定这段时间有几周
// if(subWeek.length > 1){
// if(i == 0)
// minWeek = Integer.valueOf(subWeek[0]);
// maxWeek = Integer.valueOf(subWeek[1]);
// total += (Integer.valueOf(subWeek[1]) - Integer.valueOf(subWeek[0]));
// weekDetail += "(" + detailWeek + "周)";
// }else{
// if(i == 0)
// minWeek = Integer.valueOf(detailWeek);
// maxWeek = Integer.valueOf(detailWeek);
// total += 1;
// weekDetail += "(" + detailWeek + "周)";
// }
// }
// bSlSchedule.setResult("共 " + total + "周," + weekDetail + FindTime.getStartOrEndTime(minWeek,"getStart") + FindTime.getStartOrEndTime(maxWeek,"getEnd"));
// bSlSchedule.setList(list1);
// }else{
// //如果存在
// List<ScheduleDto> list1 = new ArrayList<>();
// for(int i = 0 ; true ; i++){
// byte[] bytes = rcRedisServiceImpl.getBytes(key + i);
// if(bytes == null || bytes.length == 0){
// break;
// }
// ScheduleDto scheduleDto = SerializationUtils.deserializer(bytes,ScheduleDto.class);
// String detailWeek = scheduleDto.getWeek();
// String[] subWeek = detailWeek.split("-");
// list1.add(scheduleDto);
// if(subWeek.length > 1){
// if(i == 0)
// minWeek = Integer.valueOf(subWeek[0]);
// maxWeek = Integer.valueOf(subWeek[1]);
// total += (Integer.valueOf(subWeek[1]) - Integer.valueOf(subWeek[0]));
// weekDetail += "(" + detailWeek + "周)";
// }else{
// if(i == 0)
// minWeek = Integer.valueOf(detailWeek);
// maxWeek = Integer.valueOf(detailWeek);
// total += 1;
// weekDetail += "(" + detailWeek + "周)";
// }
// }
// bSlSchedule.setResult("共 " + total + "周," + weekDetail + FindTime.getStartOrEndTime(minWeek,"getStart") + FindTime.getStartOrEndTime(maxWeek,"getEnd"));
// bSlSchedule.setList(list1);
// }
// }
scheduleResult.setBSlSchedules(list);
BCourseCode bCourseCode = new BCourseCode();
bCourseCode.setFlag("1");
bCourseCode.setDelFlag("0");
......
package org.rcisoft.business.bslschedule.util;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
......@@ -7,6 +8,8 @@ import java.util.Map;
public class FindTime {
public static Map<String,Date> map;
public static Map<String,Date> findTime(Date startTime,Date endTime){
Map<String,Date> map1 = new HashMap<>();
......@@ -41,12 +44,53 @@ public class FindTime {
i += 1;
}
}
map = map1;
return map1;
}
public static String getStartOrEndTime(Integer week,String doWhat){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
if(doWhat.equals("getStart")){
if(map.get(week+",1") != null){
return sdf.format(map.get(week+",1"));
}else if(map.get(week+",2") != null){
return sdf.format(map.get(week+",2"));
}else if(map.get(week+",3") != null){
return sdf.format(map.get(week+",3"));
}else if(map.get(week+",4") != null){
return sdf.format(map.get(week+",4"));
}else if(map.get(week+",5") != null){
return sdf.format(map.get(week+",5"));
}else if(map.get(week+",6") != null){
return sdf.format(map.get(week+",6"));
}else if(map.get(week+",7") != null){
return sdf.format(map.get(week+",7"));
}
}else if(doWhat.equals("getEnd")){
if(map.get(week+",7") != null){
return " --- " + sdf.format(map.get(week+",7"));
}else if(map.get(week+",6") != null){
return " --- " + sdf.format(map.get(week+",6"));
}else if(map.get(week+",5") != null){
return " --- " + sdf.format(map.get(week+",5"));
}else if(map.get(week+",4") != null){
return " --- " + sdf.format(map.get(week+",4"));
}else if(map.get(week+",3") != null){
return " --- " + sdf.format(map.get(week+",3"));
}else if(map.get(week+",2") != null){
return " --- " + sdf.format(map.get(week+",2"));
}else if(map.get(week+",1") != null){
return " --- " + sdf.format(map.get(week+",1"));
}
}
return "";
}
}
......@@ -52,14 +52,14 @@ public class JwtAuthenTokenFilter extends OncePerRequestFilter {
/**/
String lk = rcRedisServiceImpl.get("lk");
if(StringUtils.isBlank(lk) || !"1".equals(lk)){
if(permitRes==-1) {
Result result = new Result();
result.setCode(202);
ResponseUtil.responseResult(response, result);
return;
}
}
// if(StringUtils.isBlank(lk) || !"1".equals(lk)){
// if(permitRes==-1) {
// Result result = new Result();
// result.setCode(202);
// ResponseUtil.responseResult(response, result);
// return;
// }
// }
// 取得header
String authHeader = request.getHeader(this.tokenHeader);
//判断header头
......
......@@ -11,8 +11,8 @@ server:
# org.springframework.web: DEBUG
druid:
url: jdbc:mysql://192.168.1.125:13318/new_edu_db?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
#url: jdbc:mysql://127.0.0.1:3306/edu_db?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
#url: jdbc:mysql://192.168.1.125:13318/new_edu_db?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
url: jdbc:mysql://120.52.179.75:13318/edu_db?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
username: root
password: 123456
initial-size: 1
......
......@@ -49,6 +49,9 @@
<result column="class_name" jdbcType="VARCHAR" property="bEduClass.className"/>
<result column="lesson_name" jdbcType="VARCHAR" property="bLesson.lessonName"/>
<result column="class_hour" jdbcType="VARCHAR" property="bLesson.classHour"/>
<result column="lessonCode" jdbcType="VARCHAR" property="bLesson.code"/>
<result column="directionName" jdbcType="VARCHAR" property="bDirection.name"/>
<result column="directionCode" jdbcType="VARCHAR" property="bDirection.code"/>
<result column="credits" jdbcType="VARCHAR" property="bLesson.credits"/>
<result column="campus" jdbcType="VARCHAR" property="bRooms.transitCampus"/>
<result column="building" jdbcType="VARCHAR" property="bRooms.building"/>
......@@ -65,6 +68,7 @@
<result column="agencyName" jdbcType="VARCHAR" property="bAgency.name"/>
<result column="agencyId" jdbcType="VARCHAR" property="bAgency.businessId"/>
<result column="studentNum" jdbcType="VARCHAR" property="bEduClass.studentNum"/>
<result column="bslCode" jdbcType="VARCHAR" property="bslCode" />
</resultMap>
<insert id="insertList">
insert into b_sl_schedule(business_id,flag,del_flag,update_by,create_by,create_date,update_date,remarks,
......
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