Commit 240ab0fb authored by zhangqingle's avatar zhangqingle

修改接口、添加新接口

parent 8d2fd6b2
......@@ -36,8 +36,8 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
// " and b.corp_id = #{curUser.corpId} "+
// " and su.corp_id = #{curUser.corpId} "+
" <if test=\"releaseState!=null and releaseState != ''\">and release_state = #{param.releaseState} </if>" +
" <if test=\"lessonType!=null and lessonType != ''\">and lesson_type = #{param.lessonType} </if>" +
" <if test=\"releaseState!=null and releaseState != ''\">and b.release_state = #{param.releaseState} </if>" +
" <if test=\"lessonType!=null and lessonType != ''\">and b.lesson_type = #{param.lessonType} </if>" +
"order by update_date desc</script>")
@ResultMap(value = "BaseResultMap")
List<BLesson> queryBLessons(@Param("param") MyReleaseDTO param,@Param("curUser")CurUser curUser);
......
......@@ -21,7 +21,7 @@ public class ILearnLessonDTO {
@ApiModelProperty(value = "是否已学完(0:未开始 1:已开始 2: 已学完)")
private String isFinish;
@ApiModelProperty(value = "培训状态(0 待参加 1 缺勤 2 签到 )")
@ApiModelProperty(value = "培训状态(0 待参加 1 缺勤 2 已参加 )")
private String trainIsSign;
@Length(min = 1,max = 1,message = "长度最小为1,最大为1")
......
......@@ -299,7 +299,7 @@ public class BLessonServiceImpl implements BLessonService {
List<BMaterial> bMaterialList = new ArrayList<>();
//插入b_train_file表
if (!addLessonDTO.getTrainFileList().isEmpty()){
if (addLessonDTO.getTrainFileList() != null && addLessonDTO.getTrainFileList().size()>0){
List<BTrainFile> trainFileList = addLessonDTO.getTrainFileList();
for (BTrainFile bTrainFile : trainFileList) {
bTrainFile.setLessonId(model.getBusinessId());
......@@ -593,6 +593,11 @@ public class BLessonServiceImpl implements BLessonService {
departs.addAll(Arrays.asList(deptsBean.getPid().split(",")));
});
});
departs.forEach(depart->{
if(StringUtils.isEmpty(depart)){
departs.remove(depart);
}
});
//----------------------------
model.setDeparts(departs);
List<String> courseIds;
......@@ -655,7 +660,7 @@ public class BLessonServiceImpl implements BLessonService {
}
List<GetAllRspDTO> GetAllRspDTOList = cotactApiRequestClient.getUserByDeptIdSet(corpId,departIds);
if (!GetAllRspDTOList.isEmpty()){
if (GetAllRspDTOList != null && GetAllRspDTOList.size()>0){
for (GetAllRspDTO getAllRspDTO : GetAllRspDTOList) {
uids.add(getAllRspDTO.getId());
}
......
......@@ -96,7 +96,7 @@ public class MTCotactApiRequestClient {
}
return null;
}
log.info("---------------------同步人员开始-----------------------");
return contactFeignClient.getUsersByUpdateTime(corpId,updateTime,zxClientType,zxAccountId).getData();
}
......
......@@ -76,23 +76,16 @@ public class MvcConfig extends WebMvcConfigurerAdapter {
String message = e.getMessage();
if (handler instanceof HandlerMethod) {
HandlerMethod handlerMethod = (HandlerMethod) handler;
if(e instanceof SystemException){
/*license*/
try {
throw e;
} catch (Exception e1) {
log.error(e.getMessage());
log.error(e1.getMessage());
}
}
message = String.format("接口 [%s] 出现异常,方法:%s.%s,异常摘要:%s",
request.getRequestURI(),
handlerMethod.getBean().getClass().getName(),
handlerMethod.getMethod().getName(),
e.getMessage());
log.error(message);
if (e instanceof ServiceException) {//业务失败的异常,如“账号或密码错误”
result.setCode(ResultCode.FAIL).setMessage(e.getMessage());
}else {
message = String.format("接口 [%s] 出现异常,方法:%s.%s,异常摘要:%s",
request.getRequestURI(),
handlerMethod.getBean().getClass().getName(),
handlerMethod.getMethod().getName(),
e.getMessage());
result.setCode(ResultCode.ERROR).setMessage(message);
}
} else {
......
......@@ -4,6 +4,8 @@ import org.rcisoft.core.component.RcJobFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;
/**
......@@ -34,4 +36,13 @@ public class QuartzConfig {
//bean.setTriggers(cronJobTrigger);
return bean;
}
@Bean
public TaskScheduler scheduledExecutorService() {
ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
scheduler.setPoolSize(8);
scheduler.setThreadNamePrefix("scheduled-thread-");
return scheduler;
}
}
package org.rcisoft.sys.user.service.impl;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.rcisoft.business.synchronizationtime.entity.SynchronizationTime;
import org.rcisoft.business.synchronizationtime.service.SynchronizationTimeService;
......@@ -34,6 +35,7 @@ import java.util.*;
import static java.util.Arrays.asList;
@Slf4j
@Service
@Transactional(readOnly = true, propagation = Propagation.NOT_SUPPORTED)
public class SysUserServiceImpl implements SysUserService {
......@@ -285,6 +287,7 @@ public class SysUserServiceImpl implements SysUserService {
}
String updateTime = df.format(synchronizationTime.getSynchronizationTime());
List<GetAllRspDTO> userGetRspDTOList = mtCotactApiRequestClient.accountGetMyInfoList(corpId, updateTime);
log.info("同步人员......" + userGetRspDTOList.size() + "记录");
// if (null == userGetRspDTOList) {
// throw new ServiceException(ResultServiceEnums.ZX_FAILED);
// }
......
......@@ -14,6 +14,7 @@ server:
# org.springframework.web: DEBUG
druid:
# url: jdbc:mysql://192.168.5.201:20001/edu_db?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
url: jdbc:mysql://mt_mysql:3306/edu_db?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
username: root
password: 91isoft
......@@ -95,14 +96,15 @@ libreoffice:
ip: mt_office
port: 8997
mt:
api: http://221.239.114.20:6789/api/
api: http://192.168.5.201/api/
# api: http://221.239.114.20:6789/api/
eureka:
instance:
hostname: localhost
# hostname: localhost
prefer-ip-address: true
ip-address: 192.168.5.201
client:
register-with-eureka: false
fetch-registry: false
register-with-eureka: true
fetch-registry: true
service-url:
defaultZone: http://zx:zgiot@192.168.5.48:7001/eureka
\ No newline at end of file
defaultZone: http://zx:zgiot@192.168.5.48:7001/eureka
spring:
profiles:
active: dev
# active: dev
# active: prod
# active: mt
active: mt
......@@ -72,7 +72,7 @@
</root>
</springProfile>
<springProfile name="mt">
<root level="info">
<root level="debug">
<appender-ref ref="consoleLog" />
<appender-ref ref="fileInfoLog" />
<appender-ref ref="fileErrorLog" />
......
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