Commit f30244a9 authored by zhangqingle's avatar zhangqingle

修改bug

parent d7563250
......@@ -1154,7 +1154,7 @@ public class BLessonServiceImpl implements BLessonService {
}
Date newDate = new Date();
if (newDate.before(bLesson.getApplyStartDate())||bLesson.getTrainOverDate().before(newDate)){
if (newDate.before(bLesson.getApplyStartDate())||bLesson.getApplyOverDate().before(newDate)){
throw new ServiceException(ResultServiceEnums.NOT_APPLY_DATE);
}
......@@ -1184,7 +1184,7 @@ public class BLessonServiceImpl implements BLessonService {
if (userInfo == null){
throw new ServiceException(ResultServiceEnums.COMPANY_NOT_EXISTS);
}
if (bLesson.getValueConsume() != null && bLesson.getValueConsume() != 0 && Integer.parseInt(userInfo.getValue()) < bLesson.getValueConsume()){
if (bLesson.getValueConsume() != null && bLesson.getValueConsume() != 0 && Integer.parseInt(userInfo.getValue()) < bLesson.getValueConsume() && !curUser.getUserId().equals(bLesson.getLecturerId())){
throw new ServiceException(ResultServiceEnums.VALUE_NOT_ENOUGH);
}
int line = bLessonPersonRepository.updateByPrimaryKeySelective(person);
......
......@@ -46,6 +46,7 @@ public class BReleaseValueController extends PaginationController<BReleaseValue>
@ApiOperation(value = "1501 分页查询积分管理", notes = "根据条件分页查询", response = BReleaseValue.class)
@GetMapping(value = "/queryByPagination")
public Result queryByPagination(CurUser curUser,@Valid ReleaseValueResDto dto ,BindingResult br) {
bReleaseValueServiceImpl.setReleaseValueResDtoIds(dto);
bReleaseValueServiceImpl.queryByPagination(getPaginationUtility(), dto);
GridModel gridModel = getGridModelResponse();
return Result.builder(new PersistModel(1),
......
......@@ -26,7 +26,9 @@ public interface BReleaseValueRepository extends BaseMapper<BReleaseValue> {
" where del_flag != 1 and flag = 1 " +
" and corp_id = #{corpId} " +
"<if test=\"title!=null and title != ''\"> and title like concat('%',#{title},'%') </if> " +
"<if test=\"id!=null and id != ''\"> and business_id = #{id} </if> " +
"<if test=\"ids!=null and ids.size() > 0\"> and business_id in " +
" <foreach item='item' index='index' collection='ids' open='(' separator=',' close=')'> #{item} </foreach> " +
"</if> " +
"<if test=\"lessonValueStart!=null and lessonValueStart != ''\"> and lesson_value &gt;= #{lessonValueStart} </if> " +
"<if test=\"lessonValueEnd!=null and lessonValueEnd != ''\"> and lesson_value &lt;= #{lessonValueEnd} </if> " +
"<if test=\"trainValueStart!=null and trainValueStart != ''\"> and train_value &gt;= #{trainValueStart} </if> " +
......@@ -184,7 +186,7 @@ public interface BReleaseValueRepository extends BaseMapper<BReleaseValue> {
"and su.name like concat('%',#{name},'%')" +
"and rv.corp_id = #{corpId}" +
"</script>")
String getReleaseId (@Param("name") String name,@Param("corpId")String corpId);
List<String> getReleaseId (@Param("name") String name,@Param("corpId")String corpId);
@Select("<script>" +
"select rv.lesson_value lessonValue, rv.train_value trainValue " +
......
......@@ -3,6 +3,8 @@ package org.rcisoft.business.breleasevalue.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class ReleaseValueResDto {
......@@ -39,4 +41,7 @@ public class ReleaseValueResDto {
@ApiModelProperty(value = "不用传")
public String id;
@ApiModelProperty(value = "不用传")
public List<String> ids;
}
......@@ -22,6 +22,14 @@ public interface BReleaseValueService {
*/
PersistModel save (BReleaseValueDto bReleaseValueDto);
/**
* 设置人员id
* @param dto
* @return
*/
ReleaseValueResDto setReleaseValueResDtoIds(ReleaseValueResDto dto);
/**
* 分页查询发布积分组
* @param pageUtil
......
......@@ -77,11 +77,16 @@ public class BReleaseValueServiceImpl implements BReleaseValueService {
}
@Override
public List<BReleaseValue> queryByPagination(PageUtil pageUtil, ReleaseValueResDto dto) {
public ReleaseValueResDto setReleaseValueResDtoIds(ReleaseValueResDto dto) {
if(dto.getName() != null && !"".equals(dto.getName())){
String id = bReleaseValueRepository.getReleaseId(dto.name,dto.getCorpId());
dto.setId(id);
List<String> ids = bReleaseValueRepository.getReleaseId(dto.name,dto.getCorpId());
dto.setIds(ids);
}
return dto;
}
@Override
public List<BReleaseValue> queryByPagination(PageUtil pageUtil, ReleaseValueResDto dto) {
List<BReleaseValue> list = bReleaseValueRepository.queryBReleaseValues(dto);
return list;
}
......
......@@ -16,6 +16,7 @@ import org.rcisoft.common.util.outClient.MTNotificationApiRequestClient;
import org.rcisoft.core.enums.MessageEnum;
import org.rcisoft.core.enums.UrlTypeEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
......@@ -25,6 +26,11 @@ import java.util.Date;
import java.util.List;
@Component
@ConditionalOnProperty(
prefix = "eduJob",
name = {"messageTask"},
havingValue = "true"
)
@Slf4j
public class messageTask {
......
......@@ -97,9 +97,9 @@ global:
eduJob:
taskInterval: 0 0/5 * * * ?
trainBegin: true
trainBegin: true #培训设置为缺勤定时任务
sec: 300 #培训结束后 多少秒 之内的报名人员设置为缺勤
messageTask: true #发送通知定时任务
libreoffice:
ip: mt_libre
port: 8997
......
......@@ -99,6 +99,7 @@ eduJob:
taskInterval: 0 0/5 * * * ?
trainBegin: true
sec: 300 #培训结束后 多少秒 之内的报名人员设置为缺勤
messageTask: true
libreoffice:
ip: mt_libre
......
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