Commit 46454933 authored by zhangqingle's avatar zhangqingle

修改BUG

parent c33a7dc0
...@@ -129,6 +129,7 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -129,6 +129,7 @@ public class BChapterServiceImpl implements BChapterService {
model.setLessonId(lessonId); model.setLessonId(lessonId);
model.setStudentId(curUser.getUserId()); model.setStudentId(curUser.getUserId());
List<QueryChapterListResDTO> queryChapterListResDTOS = queryChapterListResDTO(model, curUser.getCorpId()); List<QueryChapterListResDTO> queryChapterListResDTOS = queryChapterListResDTO(model, curUser.getCorpId());
if (StringUtils.isNotEmpty(curUser.getUserId())){
for (QueryChapterListResDTO queryChapterListResDTO : queryChapterListResDTOS) { for (QueryChapterListResDTO queryChapterListResDTO : queryChapterListResDTOS) {
for (QueryChapterListResDTO childList : queryChapterListResDTO.getChildList()) { for (QueryChapterListResDTO childList : queryChapterListResDTO.getChildList()) {
// 遍历学生章节中间表 查询学生观看章节进度 // 遍历学生章节中间表 查询学生观看章节进度
...@@ -139,6 +140,7 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -139,6 +140,7 @@ public class BChapterServiceImpl implements BChapterService {
} }
} }
} }
}
Map map = new HashMap(); Map map = new HashMap();
DecimalFormat df = new DecimalFormat("0.00");//设置保留位数 DecimalFormat df = new DecimalFormat("0.00");//设置保留位数
map.put("chapterList", queryChapterListResDTOS); map.put("chapterList", queryChapterListResDTOS);
...@@ -174,7 +176,7 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -174,7 +176,7 @@ public class BChapterServiceImpl implements BChapterService {
List<String> lecturerIds = new ArrayList<>(); List<String> lecturerIds = new ArrayList<>();
lecturerIds.add(bLesson.getLecturerId()); lecturerIds.add(bLesson.getLecturerId());
MTUserGetsReqDTO mtUserGetsReqDTOlecDept = new MTUserGetsReqDTO(); MTUserGetsReqDTO mtUserGetsReqDTOlecDept = new MTUserGetsReqDTO();
mtUserGetsReqDTOlecDept.setCorpId(curUser.getCorpId()); mtUserGetsReqDTOlecDept.setCorpId(bLesson.getCorpId());
mtUserGetsReqDTOlecDept.setIds(lecturerIds); mtUserGetsReqDTOlecDept.setIds(lecturerIds);
List<MTUserInfoRspDTO> mtUserInfoRspDTOLecDeptList = mtCotactApiRequestClient.userGets(mtUserGetsReqDTOlecDept); List<MTUserInfoRspDTO> mtUserInfoRspDTOLecDeptList = mtCotactApiRequestClient.userGets(mtUserGetsReqDTOlecDept);
if (mtUserInfoRspDTOLecDeptList != null && mtUserInfoRspDTOLecDeptList.size() > 0) { if (mtUserInfoRspDTOLecDeptList != null && mtUserInfoRspDTOLecDeptList.size() > 0) {
...@@ -495,8 +497,10 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -495,8 +497,10 @@ public class BChapterServiceImpl implements BChapterService {
//TODO 判断 曾经是否学完过 奖励积分 //TODO 判断 曾经是否学完过 奖励积分
if (IsFinishEnum.FINISHED.getCode().equals(lessonPerson.getIsFinish()) && !(IsFinishEnum.LEARNING.getCode().equals(lessonPerson.getEverFinished()))) { if (IsFinishEnum.FINISHED.getCode().equals(lessonPerson.getIsFinish()) && !(IsFinishEnum.LEARNING.getCode().equals(lessonPerson.getEverFinished()))) {
//查询课程信息 //查询课程信息
if(StringUtils.isNotEmpty(bLesson.getValueGain()) && Long.parseLong(bLesson.getValueGain()) > 0){
BPersonValue bPersonValue = new BPersonValue(lessonPerson.getPersonId(), "学完!@#课程", bLesson.getValueGain(), "0", bLesson.getBusinessId()); BPersonValue bPersonValue = new BPersonValue(lessonPerson.getPersonId(), "学完!@#课程", bLesson.getValueGain(), "0", bLesson.getBusinessId());
bLessonServiceImpl.addValueEvent(lessonPerson.getPersonId(), bPersonValue, null); bLessonServiceImpl.addValueEvent(lessonPerson.getPersonId(), bPersonValue, null);
}
lessonPerson.setEverFinished("1"); lessonPerson.setEverFinished("1");
} }
// 规避 复数 和超100% 的情况 // 规避 复数 和超100% 的情况
......
...@@ -313,7 +313,7 @@ public class BLessonPersonServiceImpl implements BLessonPersonService { ...@@ -313,7 +313,7 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
if (userInfo == null){ if (userInfo == null){
throw new ServiceException(ResultServiceEnums.COMPANY_NOT_EXISTS); throw new ServiceException(ResultServiceEnums.COMPANY_NOT_EXISTS);
} }
if (bLesson.getValueConsume() != null && (StringUtils.isEmpty(userInfo.getValue()) || Long.valueOf(userInfo.getValue()) < Long.valueOf(bLesson.getValueConsume()))){ if (!(curUser.getUserId().equals(bLesson.getLecturerId())) && bLesson.getValueConsume() != null && !("0".equals(bLesson.getValueConsume())) && (StringUtils.isEmpty(userInfo.getValue()) || Long.valueOf(userInfo.getValue()) < Long.valueOf(bLesson.getValueConsume()))){
throw new ServiceException(ResultServiceEnums.VALUE_NOT_ENOUGH); throw new ServiceException(ResultServiceEnums.VALUE_NOT_ENOUGH);
} }
//查询是否已有已删除 //查询是否已有已删除
...@@ -391,8 +391,10 @@ public class BLessonPersonServiceImpl implements BLessonPersonService { ...@@ -391,8 +391,10 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
//TODO 判断 曾经是否学完过 奖励积分 //TODO 判断 曾经是否学完过 奖励积分
if ( !("2".equals(bLessonPerson.getTrainIsSign())) && !("1".equals(bLessonPerson.getEverFinished()))){ if ( !("2".equals(bLessonPerson.getTrainIsSign())) && !("1".equals(bLessonPerson.getEverFinished()))){
//查询课程信息 //查询课程信息
if(StringUtils.isNotEmpty(bLesson.getValueGain()) && Long.parseLong(bLesson.getValueGain()) > 0){
BPersonValue bPersonValue = new BPersonValue(bLessonPerson.getPersonId(),"参加!@#培训",bLesson.getValueGain(),"0",bLesson.getBusinessId()); BPersonValue bPersonValue = new BPersonValue(bLessonPerson.getPersonId(),"参加!@#培训",bLesson.getValueGain(),"0",bLesson.getBusinessId());
bLessonServiceImpl.addValueEvent(bLessonPerson.getPersonId(),bPersonValue,null); bLessonServiceImpl.addValueEvent(bLessonPerson.getPersonId(),bPersonValue,null);
}
bLessonPerson.setEverFinished("1"); bLessonPerson.setEverFinished("1");
} }
bLessonPerson.setSignDate(new Date()); bLessonPerson.setSignDate(new Date());
......
...@@ -146,7 +146,7 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -146,7 +146,7 @@ public class BLessonServiceImpl implements BLessonService {
List<String> ids = new ArrayList<>(); List<String> ids = new ArrayList<>();
ids.add(bLesson.getLecturerId()); ids.add(bLesson.getLecturerId());
MTUserGetsReqDTO mtUserGetsReqDTO = new MTUserGetsReqDTO(); MTUserGetsReqDTO mtUserGetsReqDTO = new MTUserGetsReqDTO();
mtUserGetsReqDTO.setCorpId(curUser.getCorpId()); mtUserGetsReqDTO.setCorpId(bLesson.getCorpId());
mtUserGetsReqDTO.setIds(ids); mtUserGetsReqDTO.setIds(ids);
List<MTUserInfoRspDTO> mtUserInfoRspDTOList = cotactApiRequestClient.userGets(mtUserGetsReqDTO); List<MTUserInfoRspDTO> mtUserInfoRspDTOList = cotactApiRequestClient.userGets(mtUserGetsReqDTO);
if (mtUserInfoRspDTOList != null && mtUserInfoRspDTOList.size() > 0) { if (mtUserInfoRspDTOList != null && mtUserInfoRspDTOList.size() > 0) {
...@@ -608,17 +608,18 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -608,17 +608,18 @@ public class BLessonServiceImpl implements BLessonService {
UserUtil.setCurrentPersistOperation(bPersonValue); UserUtil.setCurrentPersistOperation(bPersonValue);
bPersonValue.setPersonId(bLesson.getLecturerId()); bPersonValue.setPersonId(bLesson.getLecturerId());
bPersonValue.setType("0"); bPersonValue.setType("0");
if (LessonTypeEnum.LESSON.getCode().equals(bLesson.getLessonType())) { if (LessonTypeEnum.LESSON.getCode().equals(bLesson.getLessonType()) && StringUtils.isNotEmpty(bReleaseValueList.get(0).getLessonValue()) && Long.parseLong(bReleaseValueList.get(0).getLessonValue()) > 0) {
bPersonValue.setEvent("发布!@#课程"); bPersonValue.setEvent("发布!@#课程");
bPersonValue.setValue(bReleaseValueList.get(0).getLessonValue()); bPersonValue.setValue(bReleaseValueList.get(0).getLessonValue());
bPersonValue.setLessonId(bLesson.getBusinessId()); bPersonValue.setLessonId(bLesson.getBusinessId());
bPersonValueRepository.add(bPersonValue);
} }
if (LessonTypeEnum.TRAIN.getCode().equals(bLesson.getLessonType())) { if (LessonTypeEnum.TRAIN.getCode().equals(bLesson.getLessonType()) && StringUtils.isNotEmpty(bReleaseValueList.get(0).getLessonValue()) && Long.parseLong(bReleaseValueList.get(0).getTrainValue()) > 0) {
bPersonValue.setEvent("发布!@#培训"); bPersonValue.setEvent("发布!@#培训");
bPersonValue.setValue(bReleaseValueList.get(0).getTrainValue()); bPersonValue.setValue(bReleaseValueList.get(0).getTrainValue());
bPersonValue.setLessonId(bLesson.getBusinessId()); bPersonValue.setLessonId(bLesson.getBusinessId());
}
bPersonValueRepository.add(bPersonValue); bPersonValueRepository.add(bPersonValue);
}
//积分变化后 s_user表中value字段重新统计 //积分变化后 s_user表中value字段重新统计
bPersonValueRepository.updateUserValue(bLesson.getLecturerId(), null); bPersonValueRepository.updateUserValue(bLesson.getLecturerId(), null);
} }
...@@ -1140,8 +1141,10 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -1140,8 +1141,10 @@ public class BLessonServiceImpl implements BLessonService {
//TODO 判断 曾经是否学完过 奖励积分 //TODO 判断 曾经是否学完过 奖励积分
if ("2".equals(setTrainIsSignDTO.getTrainIsSign()) && !("2".equals(bLessonPerson.getTrainIsSign())) && !("1".equals(bLessonPerson.getEverFinished())) && bLesson != null) { if ("2".equals(setTrainIsSignDTO.getTrainIsSign()) && !("2".equals(bLessonPerson.getTrainIsSign())) && !("1".equals(bLessonPerson.getEverFinished())) && bLesson != null) {
//查询课程信息 //查询课程信息
if(StringUtils.isNotEmpty(bLesson.getValueGain()) && Long.parseLong(bLesson.getValueGain()) > 0){
BPersonValue bPersonValue = new BPersonValue(bLessonPerson.getPersonId(), "参加!@#培训", bLesson.getValueGain(), "0",bLesson.getBusinessId()); BPersonValue bPersonValue = new BPersonValue(bLessonPerson.getPersonId(), "参加!@#培训", bLesson.getValueGain(), "0",bLesson.getBusinessId());
addValueEvent(bLessonPerson.getPersonId(), bPersonValue, null); addValueEvent(bLessonPerson.getPersonId(), bPersonValue, null);
}
bLessonPerson.setEverFinished("1"); bLessonPerson.setEverFinished("1");
} }
bLessonPerson.setTrainIsSign(setTrainIsSignDTO.getTrainIsSign()); bLessonPerson.setTrainIsSign(setTrainIsSignDTO.getTrainIsSign());
...@@ -1218,7 +1221,7 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -1218,7 +1221,7 @@ public class BLessonServiceImpl implements BLessonService {
if (userInfo == null) { if (userInfo == null) {
throw new ServiceException(ResultServiceEnums.COMPANY_NOT_EXISTS); throw new ServiceException(ResultServiceEnums.COMPANY_NOT_EXISTS);
} }
if (bLesson.getValueConsume() != null && !("0".equals(bLesson.getValueConsume())) && Long.parseLong(userInfo.getValue()) < Long.parseLong(bLesson.getValueConsume()) && !(curUser.getUserId().equals(bLesson.getLecturerId()))) { if (bLesson.getValueConsume() != null && !("0".equals(bLesson.getValueConsume())) && (StringUtils.isEmpty(userInfo.getValue()) || (Long.parseLong(userInfo.getValue()) < Long.parseLong(bLesson.getValueConsume()))) && !(curUser.getUserId().equals(bLesson.getLecturerId()))) {
throw new ServiceException(ResultServiceEnums.VALUE_NOT_ENOUGH); throw new ServiceException(ResultServiceEnums.VALUE_NOT_ENOUGH);
} }
int line = bLessonPersonRepository.updateByPrimaryKeySelective(person); int line = bLessonPersonRepository.updateByPrimaryKeySelective(person);
...@@ -1249,7 +1252,7 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -1249,7 +1252,7 @@ public class BLessonServiceImpl implements BLessonService {
if (userInfo == null) { if (userInfo == null) {
throw new ServiceException(ResultServiceEnums.COMPANY_NOT_EXISTS); throw new ServiceException(ResultServiceEnums.COMPANY_NOT_EXISTS);
} }
if (bLesson.getValueConsume() != null && !"0".equals(bLesson.getValueConsume()) && Long.parseLong(userInfo.getValue()) < Long.parseLong(bLesson.getValueConsume())) { if (bLesson.getValueConsume() != null && !("0".equals(bLesson.getValueConsume())) && (StringUtils.isEmpty(userInfo.getValue()) || (Long.parseLong(userInfo.getValue()) < Long.parseLong(bLesson.getValueConsume()))) && !(curUser.getUserId().equals(bLesson.getLecturerId()))) {
throw new ServiceException(ResultServiceEnums.VALUE_NOT_ENOUGH); throw new ServiceException(ResultServiceEnums.VALUE_NOT_ENOUGH);
} }
int line = this.trainInsert("0", bLesson, bLessonPersons); int line = this.trainInsert("0", bLesson, bLessonPersons);
...@@ -1323,7 +1326,7 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -1323,7 +1326,7 @@ public class BLessonServiceImpl implements BLessonService {
List<String> ids = new ArrayList<>(); List<String> ids = new ArrayList<>();
ids.add(bLesson.getLecturerId()); ids.add(bLesson.getLecturerId());
MTUserGetsReqDTO mtUserGetsReqDTO = new MTUserGetsReqDTO(); MTUserGetsReqDTO mtUserGetsReqDTO = new MTUserGetsReqDTO();
mtUserGetsReqDTO.setCorpId(curUser.getCorpId()); mtUserGetsReqDTO.setCorpId(bLesson.getCorpId());
mtUserGetsReqDTO.setIds(ids); mtUserGetsReqDTO.setIds(ids);
List<MTUserInfoRspDTO> mtUserInfoRspDTOList = cotactApiRequestClient.userGets(mtUserGetsReqDTO); List<MTUserInfoRspDTO> mtUserInfoRspDTOList = cotactApiRequestClient.userGets(mtUserGetsReqDTO);
if (mtUserInfoRspDTOList != null && mtUserInfoRspDTOList.size() > 0) { if (mtUserInfoRspDTOList != null && mtUserInfoRspDTOList.size() > 0) {
...@@ -1373,7 +1376,7 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -1373,7 +1376,7 @@ public class BLessonServiceImpl implements BLessonService {
List<String> ids = new ArrayList<>(); List<String> ids = new ArrayList<>();
ids.add(bLesson.getLecturerId()); ids.add(bLesson.getLecturerId());
MTUserGetsReqDTO mtUserGetsReqDTO = new MTUserGetsReqDTO(); MTUserGetsReqDTO mtUserGetsReqDTO = new MTUserGetsReqDTO();
mtUserGetsReqDTO.setCorpId(curUser.getCorpId()); mtUserGetsReqDTO.setCorpId(bLesson.getCorpId());
mtUserGetsReqDTO.setIds(ids); mtUserGetsReqDTO.setIds(ids);
List<MTUserInfoRspDTO> mtUserInfoRspDTOList = cotactApiRequestClient.userGets(mtUserGetsReqDTO); List<MTUserInfoRspDTO> mtUserInfoRspDTOList = cotactApiRequestClient.userGets(mtUserGetsReqDTO);
if (mtUserInfoRspDTOList != null && mtUserInfoRspDTOList.size() > 0) { if (mtUserInfoRspDTOList != null && mtUserInfoRspDTOList.size() > 0) {
......
...@@ -151,8 +151,10 @@ public class BRStudentChapterServiceImpl implements BRStudentChapterService { ...@@ -151,8 +151,10 @@ public class BRStudentChapterServiceImpl implements BRStudentChapterService {
BLesson bLesson = bLessonRepository.selectByPrimaryKey(brStudentChapterDto.getLessonId()); BLesson bLesson = bLessonRepository.selectByPrimaryKey(brStudentChapterDto.getLessonId());
if (bLesson != null && IsFinishEnum.FINISHED.getCode().equals(bLessonPerson.getIsFinish()) && !("1".equals(bLessonPerson.getEverFinished()))){ if (bLesson != null && IsFinishEnum.FINISHED.getCode().equals(bLessonPerson.getIsFinish()) && !("1".equals(bLessonPerson.getEverFinished()))){
//查询课程信息 //查询课程信息
if(StringUtils.isNotEmpty(bLesson.getValueGain()) && Long.parseLong(bLesson.getValueGain()) > 0){
BPersonValue bPersonValue = new BPersonValue(curUser.getUserId(),"学完!@#课程",bLesson.getValueGain(),"0",bLesson.getBusinessId()); BPersonValue bPersonValue = new BPersonValue(curUser.getUserId(),"学完!@#课程",bLesson.getValueGain(),"0",bLesson.getBusinessId());
bLessonServiceImpl.addValueEvent(curUser.getUserId(),bPersonValue,null); bLessonServiceImpl.addValueEvent(curUser.getUserId(),bPersonValue,null);
}
bLessonPerson.setEverFinished("1"); bLessonPerson.setEverFinished("1");
} }
bLessonPersonRepository.updateByPrimaryKeySelective(bLessonPerson); bLessonPersonRepository.updateByPrimaryKeySelective(bLessonPerson);
......
...@@ -86,6 +86,7 @@ ...@@ -86,6 +86,7 @@
<result column="train_address" jdbcType="VARCHAR" property="trainAddress"/> <result column="train_address" jdbcType="VARCHAR" property="trainAddress"/>
<result column="train_sign_time" jdbcType="VARCHAR" property="trainSignTime"/> <result column="train_sign_time" jdbcType="VARCHAR" property="trainSignTime"/>
<result column="qr_code" jdbcType="VARCHAR" property="qrCode"/> <result column="qr_code" jdbcType="VARCHAR" property="qrCode"/>
<result column="corp_id" jdbcType="VARCHAR" property="corpId"/>
<!----> <!---->
<result column="value_consume" jdbcType="VARCHAR" property="valueConsume"/> <result column="value_consume" jdbcType="VARCHAR" property="valueConsume"/>
<result column="value_gain" jdbcType="VARCHAR" property="valueGain"/> <result column="value_gain" jdbcType="VARCHAR" property="valueGain"/>
......
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