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 { ...@@ -139,6 +139,7 @@ public class BChapterServiceImpl implements BChapterService {
BChapter bChapter = bChapterRepository.selectByPrimaryKey(queryChapterListResDTO.getPid()); BChapter bChapter = bChapterRepository.selectByPrimaryKey(queryChapterListResDTO.getPid());
if (null != bChapter) { if (null != bChapter) {
queryChapterListResDTO.setPSort(bChapter.getSort()); queryChapterListResDTO.setPSort(bChapter.getSort());
queryChapterListResDTO.setProgress(Integer.parseInt(queryChapterListResDTO.getProgress())*100+"%");
} }
map.put("currentChapter", queryChapterListResDTO); map.put("currentChapter", queryChapterListResDTO);
} else { } else {
......
...@@ -556,10 +556,10 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -556,10 +556,10 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiImplicitParam(name = "lessonId", value = "培训课id", required = true, dataType = "varchar") @ApiImplicitParam(name = "lessonId", value = "培训课id", required = true, dataType = "varchar")
@GetMapping(value = "/toTraining") @GetMapping(value = "/toTraining")
public Result toTraining(CurUser curUser,String lessonId) { 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_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
bLessonService.toTraining(curUser,lessonId)); lessonId);
} }
@ApiOperation(value="632 单一查询我参加培训的信息", notes="单一查询我参加培训的信息",response = BLesson.class) @ApiOperation(value="632 单一查询我参加培训的信息", notes="单一查询我参加培训的信息",response = BLesson.class)
......
...@@ -243,7 +243,14 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> { ...@@ -243,7 +243,14 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
@ResultMap(value = "BaseResultMap") @ResultMap(value = "BaseResultMap")
BLessonPerson selectById(String businessId); 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 ); BLessonPerson getAppointInTraining(@Param("lessonId")String lessonId ,@Param("personId")String personId );
...@@ -258,4 +265,16 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> { ...@@ -258,4 +265,16 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
@ResultMap(value = "BaseResultMap") @ResultMap(value = "BaseResultMap")
List<BLessonPerson> trainPersons(@Param("param") FindTrainPersonDTO param); 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; ...@@ -14,6 +14,7 @@ import javax.persistence.Entity;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Transient; import javax.persistence.Transient;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import java.util.Date;
@Entity @Entity
@Table(name = "b_lesson_person") @Table(name = "b_lesson_person")
...@@ -70,10 +71,10 @@ public class BLessonPerson extends IdEntity<BLessonPerson> { ...@@ -70,10 +71,10 @@ public class BLessonPerson extends IdEntity<BLessonPerson> {
private String trainIsSign; private String trainIsSign;
@ApiModelProperty(value = "报名日期") @ApiModelProperty(value = "报名日期")
private String applyDate; private Date applyDate;
@ApiModelProperty(value = "签到日期") @ApiModelProperty(value = "签到日期")
private String signDate; private Date signDate;
//----------------------------- //-----------------------------
@ApiModelProperty(value = "课程名称") @ApiModelProperty(value = "课程名称")
......
...@@ -861,14 +861,21 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -861,14 +861,21 @@ public class BLessonServiceImpl implements BLessonService {
log.info("-----------该培训已报名-------------"); log.info("-----------该培训已报名-------------");
return 1; return 1;
} }
UserUtil.setCurrentMergeOperation(person); person.setTrainIsSign("0");
person.setApplyDate(new Date());
person.setIsApply("1"); person.setIsApply("1");
return bLessonPersonRepository.updateByPrimaryKey(person); return bLessonPersonRepository.updateLessonPersonByUserId(person);
} else { } else {
UserUtil.setCurrentPersistOperation(bLessonPerson); UserUtil.setCurrentPersistOperation(bLessonPerson);
bLessonPerson.setPersonId(curUser.getUserId()); bLessonPerson.setPersonId(curUser.getUserId());
bLessonPerson.setLessonId(lessonId);
bLessonPerson.setIsAppoint("0");
bLessonPerson.setIsApply("1"); 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 { ...@@ -58,6 +58,17 @@ public class SysUserServiceImpl implements SysUserService {
@Override @Override
public List<SysUser> queryUsersByPagination(PageUtil pageUtil, QuerySysUserDTO dto) { 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<SysUser> users = sysUserMapper.queryUsers(dto);
List<String> list = new ArrayList<>(); List<String> list = new ArrayList<>();
for (SysUser user : users) { for (SysUser user : users) {
...@@ -100,7 +111,6 @@ public class SysUserServiceImpl implements SysUserService { ...@@ -100,7 +111,6 @@ public class SysUserServiceImpl implements SysUserService {
return usersForDept; return usersForDept;
} }
return users; return users;
} }
@Override @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