Commit 240ab0fb authored by zhangqingle's avatar zhangqingle

修改接口、添加新接口

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