Commit bf088ae5 authored by zhangqingle's avatar zhangqingle

修改接口

parent 684b24aa
......@@ -79,7 +79,10 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
" bl.lesson_name LessonTitle , su.name personName, " +
" blp.is_appoint isAppoint , blp.is_finish isFinish ," +
" blp.learn_progress learnProgress ,ba.create_date appointDate ," +
" blp.finish_date finishDate " +
" blp.finish_date finishDate , " +
" blp.apply_date applyDate , " +
" blp.sign_date signDate , " +
" blp.train_is_sign trainIsSign " +
"from b_lesson_person blp left join b_lesson bl on blp.lesson_id = bl.business_id " +
"left join s_user su on blp.person_id = su.business_id " +
"left join b_appoint ba on ba.business_id = blp.appoint_id " +
......
package org.rcisoft.business.blesson.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.Transient;
import java.util.Date;
@Data
......@@ -37,4 +40,23 @@ public class StudentTrackingRspDTO {
@ApiModelProperty(value = "完成时间")
private Date finishDate;
@DateTimeFormat(pattern="yyyy/MM/dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy/MM/dd HH:mm:ss")
@ApiModelProperty(value = "报名时间")
@Transient
private Date applyDate;
@DateTimeFormat(pattern="yyyy/MM/dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy/MM/dd HH:mm:ss")
@ApiModelProperty(value = "签到日期")
@Transient
private String signDate;
@ApiModelProperty(value = "培训状态(0 待参加 1 缺勤 2 已签到")
@Transient
private String trainIsSign;
}
......@@ -209,6 +209,8 @@ public class BLesson extends IdEntity<BLesson> {
@Transient
private String trainIsSign;
@DateTimeFormat(pattern="yyyy/MM/dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy/MM/dd HH:mm:ss")
@ApiModelProperty(value = "签到日期")
@Transient
private String signDate;
......@@ -221,6 +223,12 @@ public class BLesson extends IdEntity<BLesson> {
@Transient
private String applyIsFull;
@DateTimeFormat(pattern="yyyy/MM/dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy/MM/dd HH:mm:ss")
@ApiModelProperty(value = "报名时间")
@Transient
private Date applyDate;
public void initModel(){
// this.setDefaultUrl(global.getDEFAULT_COURSE_LOCATION());
UserUtil.setCurrentPersistOperation(this);
......
......@@ -57,9 +57,13 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
if ("1".equals(bLessonPerson.getIsAppoint())){
throw new ServiceException(ResultServiceEnums.APPOINT_NOT_CLOSE);
}
bLessonPerson.setDelFlag("1");
UserUtil.setCurrentMergeOperation(bLessonPerson);
// int line = bLessonPersonRepository.quit(quitLessonDTO.getBusinessId());
int line = bLessonPersonRepository.updateByPrimaryKeySelective(bLessonPerson);
//重新统计在学人数
bLessonRepository.personNumberReCount(quitLessonDTO.getLessonId());
return new PersistModel(1,bLessonPersonRepository.quit(quitLessonDTO.getBusinessId()));
return new PersistModel(line);
}
@Override
......@@ -75,11 +79,13 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
@Override
public List<StudentTrackingRspDTO> studentTrackingByPagination(PageUtil pageUtil, StudentTrackingDTO studentTrackingDTO) {
List<Long> deptIds = new ArrayList<>();
deptIds.add(Long.parseLong(studentTrackingDTO.getDepartId()));
List<MTGetUserByDeptIdsRspDTO> datas = mtCotactApiRequestClient.userGetUserByDeptIds(studentTrackingDTO.getCorpId(),deptIds);
datas.forEach(data->{
studentTrackingDTO.getUserIdsInDepart().add(data.getId());
});
if(StringUtils.isNotEmpty(studentTrackingDTO.getDepartId())){
deptIds.add(Long.parseLong(studentTrackingDTO.getDepartId()));
List<MTGetUserByDeptIdsRspDTO> datas = mtCotactApiRequestClient.userGetUserByDeptIds(studentTrackingDTO.getCorpId(),deptIds);
datas.forEach(data->{
studentTrackingDTO.getUserIdsInDepart().add(data.getId());
});
}
List<StudentTrackingRspDTO> studentTrackingRspDTOs = bLessonPersonRepository.studentTrackingByPagination(studentTrackingDTO);
List<String> uids = new ArrayList<>();
studentTrackingRspDTOs.forEach(studentTrackingRspDTO->{
......@@ -129,20 +135,20 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
//查询是否在学习
String isFinish = bLessonPersonRepository.selectIsFinish(cancelAppointDTO);
int result = 0;
if ("0".equals(isFinish)){
//未开始执行删除
BLessonPerson bLessonPerson = new BLessonPerson();
bLessonPerson.setBusinessId(cancelAppointDTO.getBusinessId());
result = bLessonPersonRepository.logicalDelete(bLessonPerson);
}else if ("1".equals(isFinish) || "2".equals(isFinish)){
// if ("0".equals(isFinish)){
// //未开始执行删除
// BLessonPerson bLessonPerson = new BLessonPerson();
// bLessonPerson.setBusinessId(cancelAppointDTO.getBusinessId());
// result = bLessonPersonRepository.logicalDelete(bLessonPerson);
// }else if ("1".equals(isFinish) || "2".equals(isFinish)){
//已开始执行更新
BLessonPerson bLessonPerson = new BLessonPerson();
bLessonPerson.setBusinessId(cancelAppointDTO.getBusinessId());
UserUtil.setCurrentMergeOperation(bLessonPerson);
bLessonPerson.setIsAppoint("0");
bLessonPerson.setAppointId("");
result = bLessonPersonRepository.updateByPrimaryKeySelective(bLessonPerson);
}
BLessonPerson bLessonPerson = new BLessonPerson();
bLessonPerson.setBusinessId(cancelAppointDTO.getBusinessId());
UserUtil.setCurrentMergeOperation(bLessonPerson);
bLessonPerson.setIsAppoint("0");
bLessonPerson.setAppointId("");
result = bLessonPersonRepository.updateByPrimaryKeySelective(bLessonPerson);
// }
return new PersistModel(1,result);
}
......
......@@ -807,11 +807,10 @@ public class BLessonServiceImpl implements BLessonService {
@Override
@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
public PersistModel setTrainIsSign(SetTrainIsSignDTO setTrainIsSignDTO) {
BLessonPerson bLessonPerson = new BLessonPerson();
bLessonPerson.setBusinessId(setTrainIsSignDTO.getBusinessId());
BLessonPerson bLessonPerson = bLessonPersonRepository.selectById(setTrainIsSignDTO.getBusinessId());
bLessonPerson.setTrainIsSign(setTrainIsSignDTO.getTrainIsSign());
UserUtil.setCurrentMergeOperation(bLessonPerson);
int line = bLessonPersonRepository.insertSelective(bLessonPerson);
int line = bLessonPersonRepository.updateByPrimaryKeySelective(bLessonPerson);
return new PersistModel(line);
}
......
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