Commit e746c5c6 authored by 李博今's avatar 李博今

周视图结构变化,添加新接口,原接口不再使用

parent e08c8366
......@@ -5,6 +5,7 @@ package org.rcisoft.business.bslschedule.controller;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.rcisoft.business.bslschedule.entity.ScheduleResult2;
import org.springframework.validation.BindingResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......@@ -104,4 +105,27 @@ public class BSlScheduleController extends PaginationController<BSlSchedule> {
MessageConstant.MESSAGE_ALERT_ERROR,
bSlScheduleServiceImpl.queryMoreBSlSchedules(week,termCode,subAgencyId));
}
@ApiOperation(value="查周视图内部信息", notes="查周视图内部信息")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "每格的businessId", required = true, dataType = "varchar")})
@GetMapping(value = "/listDetail")
public Result listDetail(String businessId){
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
bSlScheduleServiceImpl.queryDetail(businessId));
}
@ApiOperation(value="查周视图2", notes="查周视图2")
@ApiImplicitParams({@ApiImplicitParam(name = "week", value = "周次", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "termCode", value = "学期编号", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "subAgencyId", value = "subAgencyId", required = true, dataType = "varchar")})
@GetMapping(value = "/queryBSlScheduleMore2")
public Result queryBSlScheduleMore2(String week,String termCode,String subAgencyId) throws ParseException {
ScheduleResult2 scheduleResult2 = bSlScheduleServiceImpl.queryMoreBSlSchedules2(week,termCode,subAgencyId);
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
scheduleResult2);
}
}
......@@ -2,6 +2,7 @@ package org.rcisoft.business.bslschedule.dao;
import org.apache.ibatis.annotations.*;
import org.rcisoft.business.bslschedule.entity.BSlSchedule;
import org.rcisoft.business.bslschedule.entity.ScheduleDetail;
import org.rcisoft.core.base.BaseMapper;
import org.springframework.stereotype.Repository;
......@@ -69,5 +70,55 @@ public interface BSlScheduleRepository extends BaseMapper<BSlSchedule> {
"left join b_teacher bt on bs.teacher_code = bt.code " +
"where bt.business_id = #{id}")
int querySlScheduleDtoByTeaCode(String id);
@Select("SELECT\n" +
"\tb_sl_schedule.room_code as roomCode,\n" +
"\tb_sl_schedule.term_code as termCode,\n" +
"\tb_sl_schedule.tea_code as teaCode,\n" +
"\tb_sl_schedule.lesson_code as lessonCode,\n" +
"\tb_sl_schedule.edu_class_code as eduClassCode,\n" +
"\tb_sl_schedule.sub_agency_id as subAgencyId,\n" +
"\t(\n" +
"\t\tSELECT\n" +
"\t\t\tsum(student_num)\n" +
"\t\tFROM\n" +
"\t\t\tb_class\n" +
"\t\tWHERE\n" +
"\t\t\tFIND_IN_SET(\n" +
"\t\t\t\tb_class. CODE,\n" +
"\t\t\t\tb_edu_class.classes_id\n" +
"\t\t\t)\n" +
"\t) AS studentNum,\n" +
"\tb_lesson.lesson_name as lessonCode,\n" +
"\tb_sl.`code` AS bslCode,\n" +
"\tb_lesson.class_hour as classHour,\n" +
"\ts_user.`name` AS userName,\n" +
"\ts_user.email,\n" +
"\ts_user.phone,\n" +
"\tb_agency.`name` AS agencyName,\n" +
"\tb_agency.`code` AS agencyCode,\n" +
"\tb_rooms.campus,\n" +
"\tb_rooms.category,\n" +
"\tb_rooms.building,\n" +
"\tb_rooms.classroom_no as classroomNo,\n" +
"\tb_rooms.classroom_name as classroomName\n" +
"FROM\n" +
"\tb_sl_schedule\n" +
"LEFT JOIN b_rooms ON b_rooms.`code` = b_sl_schedule.room_code\n" +
"LEFT JOIN b_term ON b_term.`code` = b_sl_schedule.term_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_edu_class ON b_edu_class. CODE = b_sl_schedule.edu_class_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" +
"LEFT JOIN b_agency ON b_agency. CODE = b_teacher.agency_code\n" +
"LEFT JOIN b_sl ON b_sl_schedule.tea_code = b_sl.teacher_code\n" +
"AND b_sl_schedule.term_code = b_sl.term_code\n" +
"AND b_sl_schedule.lesson_code = b_sl.lesson_code\n" +
"WHERE\n" +
"\tb_sl_schedule.business_id = #{businessId}")
@ResultMap(value = "DetailResultMap")
ScheduleDetail queryDetail(String businessId);
}
package org.rcisoft.business.bslschedule.entity;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
@Data
@JsonSerialize(include= JsonSerialize.Inclusion.NON_EMPTY)
public class BSLData {
@Data
class InnerObject{
String index;
String tag;
InnerObject(String index,String tag){
this.index = index;
this.tag = tag;
}
}
@Data
class Detail{
List<InnerObject> innerObjectList = new ArrayList<>();
}
private Detail classes = new Detail();
private Detail section = new Detail();
private Detail mon = new Detail();
private Detail tue = new Detail();
private Detail wed = new Detail();
private Detail thu = new Detail();
private Detail fri = new Detail();
private Detail sat = new Detail();
private Detail sun = new Detail();
public void addDetail(String index,String tag,String flag){
switch (flag){
case "classes":
classes.innerObjectList.add(new InnerObject(index,tag));
break;
case "section":
section.innerObjectList.add(new InnerObject(index,tag));
break;
}
}
public void addDetail(String index,String tag,int flag){
switch (flag){
case Calendar.MONDAY:
mon.innerObjectList.add(new InnerObject(index,tag));
break;
case Calendar.TUESDAY:
tue.innerObjectList.add(new InnerObject(index,tag));
break;
case Calendar.WEDNESDAY:
wed.innerObjectList.add(new InnerObject(index,tag));
break;
case Calendar.THURSDAY:
thu.innerObjectList.add(new InnerObject(index,tag));
break;
case Calendar.FRIDAY:
fri.innerObjectList.add(new InnerObject(index,tag));
break;
case Calendar.SATURDAY:
sat.innerObjectList.add(new InnerObject(index,tag));
break;
case Calendar.SUNDAY:
sun.innerObjectList.add(new InnerObject(index,tag));
break;
}
}
}
package org.rcisoft.business.bslschedule.entity;
import lombok.Data;
import org.rcisoft.business.barrange.entity.ScheduleDto;
import java.util.ArrayList;
import java.util.List;
@Data
public class ScheduleDetail {
private String roomCode;
private String termCode;
private String teaCode;
private String lessonCode;
private String eduClassCode;
private String studentNum;
private String lessonName;
private String bslCode;
private String classHour;
private String userName;
private String email;
private String phone;
private String agencyName;
private String agencyCode;
private String campus;
private String category;
private String building;
private String classroomNo;
private String classroomName;
private String weekDetail;
private String subAgencyId;
List<ScheduleDto> list = new ArrayList<>();
public String getCampus(){
if(this.campus != null && !this.campus.equals("")){
switch (this.campus) {
case "0":
this.campus = "校本部";
break;
case "1":
this.campus = "新校区";
break;
}
}
return this.campus;
}
public String getBuilding(){
if(this.building != null && !this.building.equals("")){
switch (this.building) {
case "0":
this.building = "A区";
break;
case "1":
this.building = "B区";
break;
case "2":
this.building = "C区";
break;
case "3":
this.building = "D区";
break;
}
}
return this.building;
}
public String getCategory(){
if(this.category != null && !this.category.equals("")){
switch (this.category) {
case "0":
this.category = "普通教室";
break;
case "1":
this.category = "听力教室";
break;
case "2":
this.category = "多媒体教室";
break;
case "3":
this.category = "实训机房";
break;
case "4":
this.category = "报告厅";
break;
case "5":
this.category = "多功能报告厅";
break;
case "6":
this.category = "阶梯教室";
break;
}
}
return this.category;
}
}
package org.rcisoft.business.bslschedule.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.rcisoft.business.bcoursecode.entity.BCourseCode;
import javax.persistence.Entity;
import java.util.List;
import java.util.Map;
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ScheduleResult2 {
private String weekNum;
private Map<String,BSLData> bSlSchedules;
private List<BCourseCode> bCourseCodes;
}
......@@ -2,7 +2,9 @@ package org.rcisoft.business.bslschedule.service;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.rcisoft.business.bslschedule.entity.BSlSchedule;
import org.rcisoft.business.bslschedule.entity.ScheduleDetail;
import org.rcisoft.business.bslschedule.entity.ScheduleResult;
import org.rcisoft.business.bslschedule.entity.ScheduleResult2;
import org.rcisoft.core.model.PersistModel;
import org.rcisoft.core.aop.PageUtil;
......@@ -53,4 +55,8 @@ public interface BSlScheduleService {
ScheduleResult queryMoreBSlSchedules(String week,String termCode1, String subAgencyId);
ScheduleDetail queryDetail(String businessId);
ScheduleResult2 queryMoreBSlSchedules2(String week, String termCode1, String subAgencyId);
}
......@@ -70,6 +70,11 @@
<result column="studentNum" jdbcType="VARCHAR" property="bEduClass.studentNum"/>
<result column="bslCode" jdbcType="VARCHAR" property="bslCode" />
</resultMap>
<resultMap id="DetailResultMap" type="org.rcisoft.business.bslschedule.entity.ScheduleDetail">
</resultMap>
<insert id="insertList">
insert into b_sl_schedule(business_id,flag,del_flag,update_by,create_by,create_date,update_date,remarks,
sl_id,room_code,term_code,tea_code,seq,
......
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