Commit 213718a9 by 涂亚平

临时上个版本 联调中

1 parent 04198fa7
......@@ -38,7 +38,7 @@ public class ClassDictController {
@PostMapping("getAllClasses")
@ApiOperation("获取某公司下的所有班级 companyId 所选企业id className 班级名称 openStatus 开放状态 startDate 开始时间 endDate 结束时间")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getAllClasses(@RequestBody ClassDictDO classDictDO){
public ResponseVO getAllClasses(@RequestBody ClassDictDO classDictDO)throws Exception{
return ResponseData.generateCreatedResponse(0,classDictService.getAllClasses(classDictDO));
}
......@@ -50,14 +50,14 @@ public class ClassDictController {
}
@PostMapping("addClass")
@ApiOperation("添加班级 userId:登录人id companyId courseId classType className startDate endDate testRule 是否视频看完再做测试 isOrder 是否按照顺序播放 isFastPlay 是否快进 memberIds [] 班级学员 classNoticeDOS[noticeType noticeTime]")
@ApiOperation("添加班级 userId:登录人id companyId courseId classTypeId className startDate endDate testRule 是否视频看完再做测试 isOrder 是否按照顺序播放 isFastPlay 是否快进 memberIds [] 班级学员 classNoticeDOS[noticeType noticeTime]")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addClass(@RequestBody AddClassDTO addClassDTO){
return ResponseData.generateCreatedResponse(0,classDictService.addClass(addClassDTO));
}
@PostMapping("updateClass")
@ApiOperation("修改班级 id companyId courseId className startDate endDate")
@ApiOperation("修改班级 id companyId className classTypeId startDate endDate")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateClass(@RequestBody ClassDictDO classDictDO){
return ResponseData.generateCreatedResponse(0,classDictService.updateClass(classDictDO));
......
......@@ -46,7 +46,7 @@ public class SignInRecordController {
}
@PostMapping("dataView")
@ApiOperation("数据概览 id 校区id className courseName pageSize pageNum")
@ApiOperation("数据概览 id 校区id className pageSize pageNum")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO dataView(@RequestBody DataViewDTO classSignInfoDTO) {
return ResponseData.generateCreatedResponse(0, signInRecordService.dataView(classSignInfoDTO));
......
......@@ -14,6 +14,6 @@ public class DataViewDTO {
private Integer pageNum;
private Integer companyId;
private Integer id;
}
......@@ -68,10 +68,10 @@ public class ClassDictDO extends BaseModel {
*/
private Integer isFastPlay;
/**
* 班级状态
*/
private String openStatus;
///**
// * 班级状态
// */
//private String openStatus;
/**
* 测试规则
......
......@@ -22,7 +22,7 @@ import java.util.List;
*/
public interface ClassDictService extends IService<ClassDictDO> {
List<GetAllClassesVO> getAllClasses(ClassDictDO classDictDO);
List<GetAllClassesVO> getAllClasses(ClassDictDO classDictDO)throws Exception;
String deleteClasses(ClassDictDO classDictDO);
......
......@@ -35,6 +35,8 @@ import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
......@@ -69,8 +71,21 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
@Autowired
private QuartzUtil quartzUtil;
public List<GetAllClassesVO> getAllClasses(ClassDictDO classDictDO) {
return this.baseMapper.getAllClasses(classDictDO);
public List<GetAllClassesVO> getAllClasses(ClassDictDO classDictDO) throws Exception{
DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
List<GetAllClassesVO> getAllClassesVOS = this.baseMapper.getAllClasses(classDictDO);
for (GetAllClassesVO getAllClassesVO : getAllClassesVOS){
if (new Date().before(fmt.parse(getAllClassesVO.getStartDate()))){
getAllClassesVO.setOpenStatus("1"); //待开始
}else if (new Date().after(fmt.parse(getAllClassesVO.getEndDate()))){
getAllClassesVO.setOpenStatus("2");
}else {
getAllClassesVO.setOpenStatus("0");
}
}
return getAllClassesVOS;
}
@Transactional
......
......@@ -118,7 +118,7 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
Page pager = new Page(classSignInfoDTO.getPageNum(), classSignInfoDTO.getPageSize());
IPage<DataViewVO> classSignInfoVOIPage = this.baseMapper.classSignInfo(pager, classSignInfoDTO.getClassName(), classSignInfoDTO.getCourseName(), classSignInfoDTO.getCompanyId());
IPage<DataViewVO> classSignInfoVOIPage = this.baseMapper.classSignInfo(pager, classSignInfoDTO.getClassName(), classSignInfoDTO.getCourseName(), classSignInfoDTO.getId());
List<DataViewVO> dataViewVOS = classSignInfoVOIPage.getRecords();
for (DataViewVO dataViewVO : dataViewVOS) {
......
......@@ -23,5 +23,6 @@ public class GetAllClassesVO {
private String openStatus;
private Long classTypeId;
}
......@@ -11,8 +11,14 @@ public class GetClassBaseInfoVO {
private Integer count;
private String className;
private String startDate;
private String endDate;
private Long courseId;
private Long classTypeId;
}
......@@ -32,7 +32,7 @@
t.end_date,
t4.cnt,
t5.class_type,
t.open_status
t5.id as class_type_id
FROM
class_dict t
left join class_type_dict t5 on t.class_type_id = t5.id
......@@ -51,9 +51,6 @@
and t.end_date >= DATE_FORMAT( #{startDate}, '%Y-%m-%d' )
and t.start_date &lt; DATE_FORMAT( #{endDate}, '%Y-%m-%d' )
</if>
<if test="openStatus != null and openStatus != ''">
and t.open_status = #{openStatus}
</if>
order by t.create_date desc
</select>
......@@ -130,10 +127,13 @@
<select id="getClassBaseInfo" parameterType="long" resultType="com.subsidy.vo.classdict.GetClassBaseInfoVO">
SELECT
t3.class_type,
t.class_name,
t2.course_name,
t.start_date,
t.end_date,
ifnull( t4.cnt, 0 ) AS cnt
ifnull( t4.cnt, 0 ) AS count,
t2.id as courseId,
t3.id as classTypeId
FROM
class_dict t
LEFT JOIN course_dict t2 ON t.course_id = t2.id
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!