Commit 507dc3c5 authored by zhangqingle's avatar zhangqingle

Merge branch 'meiteng' of ssh://103.249.252.28:10022/lcy/education into meiteng

parents fcda2e60 b663b718
......@@ -139,6 +139,7 @@ public class BChapterServiceImpl implements BChapterService {
BChapter bChapter = bChapterRepository.selectByPrimaryKey(queryChapterListResDTO.getPid());
if (null != bChapter) {
queryChapterListResDTO.setPSort(bChapter.getSort());
queryChapterListResDTO.setProgress(Integer.parseInt(queryChapterListResDTO.getProgress())*100+"%");
}
map.put("currentChapter", queryChapterListResDTO);
} else {
......
......@@ -556,10 +556,10 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiImplicitParam(name = "lessonId", value = "培训课id", required = true, dataType = "varchar")
@GetMapping(value = "/toTraining")
public Result toTraining(CurUser curUser,String lessonId) {
return Result.builder(new PersistModel(1),
return Result.builder(new PersistModel(bLessonService.toTraining(curUser,lessonId)),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
bLessonService.toTraining(curUser,lessonId));
lessonId);
}
@ApiOperation(value="632 单一查询我参加培训的信息", notes="单一查询我参加培训的信息",response = BLesson.class)
......
......@@ -243,7 +243,14 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
@ResultMap(value = "BaseResultMap")
BLessonPerson selectById(String businessId);
@Select("select * from b_lesson_person where lesson_id = #{lessonId} and person_id = #{personId}")
/**
* 查询该用户在此培训中不删除的状态
* @param lessonId
* @param personId
* @return
*/
@Select("select * from b_lesson_person where lesson_id = #{lessonId} and person_id = #{personId} and del_flag != 1 ")
@ResultMap(value = "BaseResultMap")
BLessonPerson getAppointInTraining(@Param("lessonId")String lessonId ,@Param("personId")String personId );
......@@ -258,4 +265,16 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
@ResultMap(value = "BaseResultMap")
List<BLessonPerson> trainPersons(@Param("param") FindTrainPersonDTO param);
/**
* 用户在表中有未删除的数据且未报名
* 更新 报名状态、报名时间、培训状态
* @return
*/
@Update("update b_lesson_person set apply_date=#{applyDate},is_apply =#{isApply},train_is_sign = #{trainIsSign} " +
"where lesson_id= #{lessonId} and person_id=#{personId} and del_flag != 1 ")
int updateLessonPersonByUserId(BLessonPerson lessonPerson);
// @Insert("")
// int insertLessonPerson(BLessonPerson lessonPerson);
}
......@@ -14,6 +14,7 @@ import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotBlank;
import java.util.Date;
@Entity
@Table(name = "b_lesson_person")
......@@ -70,10 +71,10 @@ public class BLessonPerson extends IdEntity<BLessonPerson> {
private String trainIsSign;
@ApiModelProperty(value = "报名日期")
private String applyDate;
private Date applyDate;
@ApiModelProperty(value = "签到日期")
private String signDate;
private Date signDate;
//-----------------------------
@ApiModelProperty(value = "课程名称")
......
......@@ -861,14 +861,21 @@ public class BLessonServiceImpl implements BLessonService {
log.info("-----------该培训已报名-------------");
return 1;
}
UserUtil.setCurrentMergeOperation(person);
person.setTrainIsSign("0");
person.setApplyDate(new Date());
person.setIsApply("1");
return bLessonPersonRepository.updateByPrimaryKey(person);
return bLessonPersonRepository.updateLessonPersonByUserId(person);
} else {
UserUtil.setCurrentPersistOperation(bLessonPerson);
bLessonPerson.setPersonId(curUser.getUserId());
bLessonPerson.setLessonId(lessonId);
bLessonPerson.setIsAppoint("0");
bLessonPerson.setIsApply("1");
return bLessonPersonRepository.insertSelective(bLessonPerson);
bLessonPerson.setTrainIsSign("0");
bLessonPerson.setApplyDate(new Date());
bLessonPerson.setRemarks("");
//插入 用户id 、培训id、指派状态、报名状态、培训状态、报名时间 、通用字段
return bLessonPersonRepository.insert(bLessonPerson);
}
}
......
......@@ -58,6 +58,17 @@ public class SysUserServiceImpl implements SysUserService {
@Override
public List<SysUser> queryUsersByPagination(PageUtil pageUtil, QuerySysUserDTO dto) {
List<SysUser> users = this.qusers(dto);
return users;
}
/**
* 添加用户对应的 部门和岗位
* @param dto
* @return
*/
public List<SysUser> qusers(QuerySysUserDTO dto){
List<SysUser> users = sysUserMapper.queryUsers(dto);
List<String> list = new ArrayList<>();
for (SysUser user : users) {
......@@ -99,8 +110,7 @@ public class SysUserServiceImpl implements SysUserService {
return usersForDept;
}
return users;
return users;
}
@Override
......
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