Commit 8b5658d6 authored by luzhuang's avatar luzhuang

Merge remote-tracking branch 'origin/meiteng' into meiteng

parents 7b690764 b70627fa
...@@ -346,7 +346,7 @@ public interface BChapterRepository extends BaseMapper<BChapter> { ...@@ -346,7 +346,7 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
"WHERE " + "WHERE " +
" bp.chapter_id IS NOT NULL " + " bp.chapter_id IS NOT NULL " +
" AND bp.chapter_id != '' " + " AND bp.chapter_id != '' " +
" AND b.business_id = #{lessonId} " + " AND bp.lesson_id = #{lessonId} " +
" AND bp.person_id = #{userId} " + " AND bp.person_id = #{userId} " +
"and bc.corp_id = #{corpId} " + "and bc.corp_id = #{corpId} " +
......
...@@ -323,14 +323,13 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -323,14 +323,13 @@ public class BChapterServiceImpl implements BChapterService {
String firstId = bChapterRepository.getFirstChapter(lessonId); String firstId = bChapterRepository.getFirstChapter(lessonId);
int line = bChapterRepository.removeByPrimaryKey(id); int line = bChapterRepository.removeByPrimaryKey(id);
bChapterRepository.updateClassHourInLesson(lessonId); bChapterRepository.updateClassHourInLesson(lessonId);
if(firstId.equals(id)){ if(StringUtils.isNotEmpty(id) && id.equals(firstId)){
//当前节为第一节 获取下一节的课程时长 //当前节为第一节 获取下一节的课程时长
String secondId = bChapterRepository.getFirstChapter(lessonId); String secondId = bChapterRepository.getFirstChapter(lessonId);
String time = bChapterRepository.getTimeByChapterId(secondId); String time = bChapterRepository.getTimeByChapterId(secondId);
//更新到b_lesson 表 //更新到b_lesson 表
bChapterRepository.updateCourseTimeForLesson(time,lessonId); bChapterRepository.updateCourseTimeForLesson(time,lessonId);
} }
return new PersistModel(line); return new PersistModel(line);
} }
......
...@@ -221,7 +221,7 @@ public interface BLessonRepository extends BaseMapper<BLesson> { ...@@ -221,7 +221,7 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
* @param * @param
* @return * @return
*/ */
@Select(" <script> select bl.* " + @Select(" <script> select distinct bl.* " +
" ,su.name lecturerName " + " ,su.name lecturerName " +
" ,suc.name createByName " + " ,suc.name createByName " +
" from b_lesson bl " + " from b_lesson bl " +
......
...@@ -910,7 +910,7 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -910,7 +910,7 @@ public class BLessonServiceImpl implements BLessonService {
//step2 判断该用户是否被指派该培训或已经报名 //step2 判断该用户是否被指派该培训或已经报名
person = bLessonPersonRepository.getAppointInTraining(lessonId, curUser.getUserId()); person = bLessonPersonRepository.getAppointInTraining(lessonId, curUser.getUserId());
if (person != null) { if (person != null) {
if (person.getIsApply().equals("1")) { if ("1".equals(person.getIsApply())) {
log.info("-----------该培训已报名-------------"); log.info("-----------该培训已报名-------------");
throw new ServiceException(ResultServiceEnums.TRAIN_APPLYED); throw new ServiceException(ResultServiceEnums.TRAIN_APPLYED);
} }
......
...@@ -55,7 +55,6 @@ public class BRStudentChapterServiceImpl implements BRStudentChapterService { ...@@ -55,7 +55,6 @@ public class BRStudentChapterServiceImpl implements BRStudentChapterService {
@Override @Override
public PersistModel save(BRStudentChapterDto brStudentChapterDto){ public PersistModel save(BRStudentChapterDto brStudentChapterDto){
int line = 0; int line = 0;
// 查詢是否已經開始觀看此章節的課程
AddMyLearnLessonDTO addMy = new AddMyLearnLessonDTO(); AddMyLearnLessonDTO addMy = new AddMyLearnLessonDTO();
addMy.setUserId(brStudentChapterDto.getStudentId()); addMy.setUserId(brStudentChapterDto.getStudentId());
addMy.setLessonId(brStudentChapterDto.getLessonId()); addMy.setLessonId(brStudentChapterDto.getLessonId());
......
...@@ -63,11 +63,10 @@ public class SysUserController extends PaginationController<SysUser> { ...@@ -63,11 +63,10 @@ public class SysUserController extends PaginationController<SysUser> {
@GetMapping("/gets") @GetMapping("/gets")
@ApiOperation(value = "|personnels|同步人员", notes = "同步人员信息") @ApiOperation(value = "|personnels|同步人员", notes = "同步人员信息")
public Result synchronizedUsers(@RequestParam String corpId) throws ParseException { public Result synchronizedUsers(@RequestParam String corpId) throws ParseException {
int line = userServiceImpl.synchronizedUsers(corpId); return Result.builder(new PersistModel(1),
return Result.builder(new PersistModel(line),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
corpId); userServiceImpl.synchronizedUsers(corpId));
} }
......
...@@ -33,6 +33,9 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -33,6 +33,9 @@ import org.springframework.transaction.annotation.Transactional;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.*; import java.util.*;
import static java.util.Arrays.asList; import static java.util.Arrays.asList;
...@@ -333,13 +336,13 @@ public class SysUserServiceImpl implements SysUserService { ...@@ -333,13 +336,13 @@ public class SysUserServiceImpl implements SysUserService {
} }
String updateTime = df.format(synchronizationTime.getSynchronizationTime()); String updateTime = df.format(synchronizationTime.getSynchronizationTime());
List<GetAllRspDTO> userGetRspDTOList = mtCotactApiRequestClient.accountGetMyInfoList(corpId, updateTime); List<GetAllRspDTO> userGetRspDTOList = mtCotactApiRequestClient.accountGetMyInfoList(corpId, updateTime);
log.info("同步人员......" + userGetRspDTOList.size() + "记录");
// if (null == userGetRspDTOList) { // if (null == userGetRspDTOList) {
// throw new ServiceException(ResultServiceEnums.ZX_FAILED); // throw new ServiceException(ResultServiceEnums.ZX_FAILED);
// } // }
List<SysUser> personnelsList = new ArrayList<>(); List<SysUser> personnelsList = new ArrayList<>();
int line = 0; int line = 0;
if (null != userGetRspDTOList) { if (null != userGetRspDTOList && userGetRspDTOList.size() > 0) {
log.info("同步人员......" + userGetRspDTOList.size() + "记录");
for (GetAllRspDTO userInfo : userGetRspDTOList) { for (GetAllRspDTO userInfo : userGetRspDTOList) {
SysUser personnels = new SysUser(); SysUser personnels = new SysUser();
UserUtil.setCurrentPersistOperation(personnels); UserUtil.setCurrentPersistOperation(personnels);
...@@ -348,9 +351,14 @@ public class SysUserServiceImpl implements SysUserService { ...@@ -348,9 +351,14 @@ public class SysUserServiceImpl implements SysUserService {
personnels.setName(userInfo.getName()); //姓名 personnels.setName(userInfo.getName()); //姓名
personnels.setHeadPic(userInfo.getAvatar()); //头像 personnels.setHeadPic(userInfo.getAvatar()); //头像
personnels.setPhone(userInfo.getMobile()); // 手机号 personnels.setPhone(userInfo.getMobile()); // 手机号
personnels.setDelFlag(userInfo.getIsDel()); //智信状态 personnels.setDelFlag(userInfo.getIsDel()); //在职离职状态
// personnels.setAge(0); // personnels.setAge(0);
// personnels.setGender(0); // personnels.setGender(0);
if (null !=userInfo.getCreateAt()){
Instant instant = userInfo.getCreateAt().toInstant();
ZoneId zone = ZoneId.systemDefault();
// personnels.setCreateDate(LocalDateTime.ofInstant(instant, zone));
}
personnels.setAccountId(userInfo.getAccountId()); personnels.setAccountId(userInfo.getAccountId());
personnelsList.add(personnels); personnelsList.add(personnels);
} }
...@@ -360,6 +368,8 @@ public class SysUserServiceImpl implements SysUserService { ...@@ -360,6 +368,8 @@ public class SysUserServiceImpl implements SysUserService {
// 同步成功后,更新同步时间 // 同步成功后,更新同步时间
synchronizationTime.setSynchronizationTime(new Date()); synchronizationTime.setSynchronizationTime(new Date());
synchronizationTimeServiceImpl.upadteById(synchronizationTime); synchronizationTimeServiceImpl.upadteById(synchronizationTime);
}else {
log.info("同步人员......0.......记录");
} }
return line; return 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