Commit bd0ceaed authored by luzhuang's avatar luzhuang

更新代码

parent d05277a0
...@@ -554,10 +554,10 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -554,10 +554,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)
......
...@@ -254,6 +254,7 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> { ...@@ -254,6 +254,7 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
* @return * @return
*/ */
@Select("select * from b_lesson_person where lesson_id = #{lessonId} and person_id = #{personId} and del_flag != 1 ") @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 );
...@@ -273,8 +274,11 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> { ...@@ -273,8 +274,11 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
* 更新 报名状态、报名时间、培训状态 * 更新 报名状态、报名时间、培训状态
* @return * @return
*/ */
@Update("update b_lesson_person set apply_date=#{applyDate},is_apply =#{isApplay},train_is_sign = #{trainIsSign} " + @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 ") "where lesson_id= #{lessonId} and person_id=#{personId} and del_flag != 1 ")
int updateLessonPersonByUserId(BLessonPerson lessonPerson); 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 = "课程名称")
......
...@@ -825,15 +825,21 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -825,15 +825,21 @@ public class BLessonServiceImpl implements BLessonService {
log.info("-----------该培训已报名-------------"); log.info("-----------该培训已报名-------------");
return 1; return 1;
} }
UserUtil.setCurrentMergeOperation(person);
person.setTrainIsSign("0"); person.setTrainIsSign("0");
person.setApplyDate(new Date());
person.setIsApply("1"); person.setIsApply("1");
return bLessonPersonRepository.updateLessonPersonByUserId(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);
} }
} }
......
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