mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-11 20:06:51 +08:00
Merge branch 'master' of codeup.aliyun.com:6265f483e4166464dc2f9c14/boeu/baseservers
# Conflicts: # servers/boe-server-all/src/main/resources/application-pre.properties # servers/boe-server-all/src/main/resources/application-pro.properties
This commit is contained in:
@@ -31,7 +31,6 @@ public class ElasticsearchCourseApi extends ApiBaseController{
|
|||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/search", method = {RequestMethod.GET,RequestMethod.POST})
|
@RequestMapping(value = "/search", method = {RequestMethod.GET,RequestMethod.POST})
|
||||||
public JsonResponse<PageList<CourseFullText>> search(Pagination page, CourseFullText cft) {
|
public JsonResponse<PageList<CourseFullText>> search(Pagination page, CourseFullText cft) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
PageList<CourseFullText> list = courseSearch.search(ICourseFullTextSearch.DEFAULT_INDEX_NAME,page.getStartRow(),page.getPageSize(), cft);
|
PageList<CourseFullText> list = courseSearch.search(ICourseFullTextSearch.DEFAULT_INDEX_NAME,page.getStartRow(),page.getPageSize(), cft);
|
||||||
return success(list);
|
return success(list);
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import javax.annotation.Resource;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.xboe.core.SysConstant;
|
||||||
import com.xboe.core.utils.OkHttpUtil;
|
import com.xboe.core.utils.OkHttpUtil;
|
||||||
import com.xboe.module.assistance.service.IEmailService;
|
import com.xboe.module.assistance.service.IEmailService;
|
||||||
|
|
||||||
@@ -42,23 +42,31 @@ public class EmailServiceImpl implements IEmailService {
|
|||||||
// $r = TNetworkHelper::HttpPost($url, $arr);
|
// $r = TNetworkHelper::HttpPost($url, $arr);
|
||||||
// var_dump($r);
|
// var_dump($r);
|
||||||
// }
|
// }
|
||||||
private static final String PostUrl="https://u-pre.boe.com/api/b1/email/send";
|
//private static final String PostUrl="https://u-pre.boe.com/api/b1/email/send";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendMail(String to, String subject, String htmlMsg, String from) throws Exception {
|
public void sendMail(String to, String subject, String htmlMsg, String from) throws Exception {
|
||||||
|
|
||||||
|
String cfgUrl=SysConstant.getConfigValue("xboe.email.url");
|
||||||
|
if(StringUtils.isBlank(cfgUrl)) {
|
||||||
|
throw new Exception("发送邮件失败,未配置邮件信息");
|
||||||
|
}
|
||||||
|
String cfgFrom=SysConstant.getConfigValue("xboe.email.from","boeu_learning@boe.com.cn");
|
||||||
|
String cfgUser=SysConstant.getConfigValue("xboe.email.user");
|
||||||
|
String cfgWord=SysConstant.getConfigValue("xboe.email.security");
|
||||||
|
|
||||||
Map<String,Object> data=new HashMap<String,Object>();
|
Map<String,Object> data=new HashMap<String,Object>();
|
||||||
data.put("to",to);
|
data.put("to",to);
|
||||||
data.put("subject",subject);
|
data.put("subject",subject);
|
||||||
data.put("content", htmlMsg);
|
data.put("content", htmlMsg);
|
||||||
data.put("fromName", "boeu_learning@boe.com.cn");
|
data.put("fromName", cfgFrom);
|
||||||
data.put("cc", "");
|
data.put("cc", "");
|
||||||
data.put("type", 0);
|
data.put("type", 0);
|
||||||
ObjectMapper mapper=new ObjectMapper();
|
ObjectMapper mapper=new ObjectMapper();
|
||||||
String json=mapper.writeValueAsString(data);
|
String json=mapper.writeValueAsString(data);
|
||||||
|
|
||||||
String[] headers=new String[] {"Content-Type","application/json","Host","u.boe.com"};
|
String[] headers=new String[] {"Content-Type","application/json","Host","u.boe.com"};
|
||||||
String rs=httpUtil.doPostJson(PostUrl,json,headers);
|
String rs=httpUtil.doPostJson(cfgUrl,json,headers);
|
||||||
//System.out.println(mailInfo.toString());
|
//System.out.println(mailInfo.toString());
|
||||||
//System.out.println(rs);
|
//System.out.println(rs);
|
||||||
if(StringUtils.isNotBlank(rs)) {
|
if(StringUtils.isNotBlank(rs)) {
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ import com.xboe.module.course.entity.CourseTeacher;
|
|||||||
import com.xboe.module.course.entity.CourseUpdateLog;
|
import com.xboe.module.course.entity.CourseUpdateLog;
|
||||||
import com.xboe.module.course.service.ICourseContentService;
|
import com.xboe.module.course.service.ICourseContentService;
|
||||||
import com.xboe.module.course.service.ICourseCrowdService;
|
import com.xboe.module.course.service.ICourseCrowdService;
|
||||||
|
import com.xboe.module.course.service.ICourseHRBPAuditService;
|
||||||
import com.xboe.module.course.service.ICourseSectionService;
|
import com.xboe.module.course.service.ICourseSectionService;
|
||||||
import com.xboe.module.course.service.ICourseService;
|
import com.xboe.module.course.service.ICourseService;
|
||||||
import com.xboe.module.course.service.ICourseTeacherService;
|
import com.xboe.module.course.service.ICourseTeacherService;
|
||||||
@@ -94,6 +95,9 @@ public class CourseManageApi extends ApiBaseController{
|
|||||||
@Resource
|
@Resource
|
||||||
private IUserService userService;
|
private IUserService userService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ICourseHRBPAuditService hrbpAuditService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 管理列表的查询
|
* 管理列表的查询
|
||||||
* @param pager
|
* @param pager
|
||||||
@@ -430,12 +434,13 @@ public class CourseManageApi extends ApiBaseController{
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
//检查课程内容的完整性
|
//检查课程内容的完整性
|
||||||
|
|
||||||
|
|
||||||
//填充必要的信息
|
//填充必要的信息
|
||||||
//fillCourseData(dto.getCourse());
|
//fillCourseData(dto.getCourse());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
CourseHRBPAudit hrbpAudit = hrbpAuditService.hasAuditing(dto.getCourse().getId());
|
||||||
|
if(hrbpAudit!=null) {
|
||||||
|
return badRequest("此课程中已有审核,不能再提交审核,如修改请先撤回");
|
||||||
|
}
|
||||||
if(!isLocalDevelopment()) {
|
if(!isLocalDevelopment()) {
|
||||||
//转化用户id
|
//转化用户id
|
||||||
User u = userService.getByUserNo(dto.getAuditUser().getCode());
|
User u = userService.getByUserNo(dto.getAuditUser().getCode());
|
||||||
@@ -468,8 +473,10 @@ public class CourseManageApi extends ApiBaseController{
|
|||||||
//邮件发送
|
//邮件发送
|
||||||
String email=dto.getAuditUser().getEmail();
|
String email=dto.getAuditUser().getEmail();
|
||||||
if(!isLocalDevelopment()) {
|
if(!isLocalDevelopment()) {
|
||||||
//只是非高度模式下才可以发送
|
//只是非开发模式下才可以发送
|
||||||
service.sendMail(email,"课程审核提醒", htmlEmail,"数字化学习平台");
|
service.sendMail(email,"课程审核提醒", htmlEmail,"数字化学习平台");
|
||||||
|
}else {
|
||||||
|
//service.sendMail("daihaixing@bjxask.com","课程审核提醒", htmlEmail,"数字化学习平台");
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
@@ -536,6 +543,10 @@ public class CourseManageApi extends ApiBaseController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
CourseHRBPAudit hrbpAudit = hrbpAuditService.hasAuditing(audit.getCourseId());
|
||||||
|
if(hrbpAudit!=null) {
|
||||||
|
return badRequest("此课程中已有审核,不能再提交审核,如修改请先撤回");
|
||||||
|
}
|
||||||
|
|
||||||
if(!isLocalDevelopment()) {
|
if(!isLocalDevelopment()) {
|
||||||
//转化用户id
|
//转化用户id
|
||||||
|
|||||||
@@ -22,6 +22,13 @@ public interface ICourseHRBPAuditService {
|
|||||||
* */
|
* */
|
||||||
//void audit(String id,Integer status,String remark);
|
//void audit(String id,Integer status,String remark);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查课程是否已经在审核中了
|
||||||
|
* @param courseId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
CourseHRBPAudit hasAuditing(String courseId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据课程、id获取课程的审核记录
|
* 根据课程、id获取课程的审核记录
|
||||||
* @param info 审核信息
|
* @param info 审核信息
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import com.xboe.common.OrderCondition;
|
|||||||
import com.xboe.common.PageList;
|
import com.xboe.common.PageList;
|
||||||
import com.xboe.core.orm.FieldFilters;
|
import com.xboe.core.orm.FieldFilters;
|
||||||
import com.xboe.core.orm.QueryBuilder;
|
import com.xboe.core.orm.QueryBuilder;
|
||||||
import com.xboe.core.orm.UpdateBuilder;
|
|
||||||
import com.xboe.module.course.dao.CourseHRBPAuditDao;
|
import com.xboe.module.course.dao.CourseHRBPAuditDao;
|
||||||
import com.xboe.module.course.dto.CourseHRBPAuditDto;
|
import com.xboe.module.course.dto.CourseHRBPAuditDto;
|
||||||
import com.xboe.module.course.entity.Course;
|
import com.xboe.module.course.entity.Course;
|
||||||
@@ -158,4 +157,11 @@ public class CourseHRBPAuditServiceImpl implements ICourseHRBPAuditService {
|
|||||||
return rs;
|
return rs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CourseHRBPAudit hasAuditing(String courseId) {
|
||||||
|
//未审核的
|
||||||
|
CourseHRBPAudit hrbp = courseHRBPAuditDao.findOne(FieldFilters.eq("courseId", courseId),FieldFilters.eq("status", 1));
|
||||||
|
return hrbp;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -603,6 +603,7 @@ public class CourseServiceImpl implements ICourseService {
|
|||||||
public void submit(CourseFullDto full) throws Exception {
|
public void submit(CourseFullDto full) throws Exception {
|
||||||
|
|
||||||
Course c=full.getCourse();//当前的课程信息
|
Course c=full.getCourse();//当前的课程信息
|
||||||
|
//提交审核,不再记录修改日志
|
||||||
// Course nowCourse=courseDao.get(c.getId());//修改之前的课程信息
|
// Course nowCourse=courseDao.get(c.getId());//修改之前的课程信息
|
||||||
// //审核不保存日志了
|
// //审核不保存日志了
|
||||||
// StringBuffer stringBuffer = new StringBuffer("[");
|
// StringBuffer stringBuffer = new StringBuffer("[");
|
||||||
@@ -625,21 +626,21 @@ public class CourseServiceImpl implements ICourseService {
|
|||||||
full.getCourse().setSysVersion(c.getSysVersion());
|
full.getCourse().setSysVersion(c.getSysVersion());
|
||||||
|
|
||||||
//先清空教师信息, 教师信息如果不一样了,也要加入到日志中
|
//先清空教师信息, 教师信息如果不一样了,也要加入到日志中
|
||||||
// courseTeacherDao.deleteByField("courseId", c.getId());
|
courseTeacherDao.deleteByField("courseId", c.getId());
|
||||||
// if(full.getTeachers()!=null && !full.getTeachers().isEmpty()) {
|
if(full.getTeachers()!=null && !full.getTeachers().isEmpty()) {
|
||||||
// for(CourseTeacher ct : full.getTeachers()) {
|
for(CourseTeacher ct : full.getTeachers()) {
|
||||||
// ct.setCourseId(c.getId());
|
ct.setCourseId(c.getId());
|
||||||
// courseTeacherDao.saveOrUpdate(ct);
|
courseTeacherDao.saveOrUpdate(ct);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// //先清空受众信息,受众信息如果不一样了,也要加入到日志中
|
//先清空受众信息,受众信息如果不一样了,也要加入到日志中
|
||||||
// courseCrowdDao.deleteByField("courseId", c.getId());
|
courseCrowdDao.deleteByField("courseId", c.getId());
|
||||||
// if(full.getCrowds()!=null && !full.getCrowds().isEmpty()) {
|
if(full.getCrowds()!=null && !full.getCrowds().isEmpty()) {
|
||||||
// for(CourseCrowd cc : full.getCrowds()) {
|
for(CourseCrowd cc : full.getCrowds()) {
|
||||||
// cc.setCourseId(c.getId());
|
cc.setCourseId(c.getId());
|
||||||
// courseCrowdDao.saveOrUpdate(cc);
|
courseCrowdDao.saveOrUpdate(cc);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
//保存审核信息
|
//保存审核信息
|
||||||
CourseHRBPAudit hrbpAudit=new CourseHRBPAudit();
|
CourseHRBPAudit hrbpAudit=new CourseHRBPAudit();
|
||||||
hrbpAudit.setCourseId(c.getId());
|
hrbpAudit.setCourseId(c.getId());
|
||||||
|
|||||||
@@ -35,4 +35,9 @@ public class StudyCourseSimple {
|
|||||||
private String sysType3;
|
private String sysType3;
|
||||||
|
|
||||||
private String aid;
|
private String aid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除标识
|
||||||
|
*/
|
||||||
|
private Boolean deleted;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,9 @@ import java.time.LocalDate;
|
|||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.transaction.Transactional;
|
import javax.transaction.Transactional;
|
||||||
|
|
||||||
@@ -417,7 +419,7 @@ public class StudyCourseServiceImpl implements IStudyCourseService{
|
|||||||
@Override
|
@Override
|
||||||
public List<StudyCourseSimple> followids(StudyCourseQuery studyCourseQuery) {
|
public List<StudyCourseSimple> followids(StudyCourseQuery studyCourseQuery) {
|
||||||
//分两次查询,查询课程,查询学习记录
|
//分两次查询,查询课程,查询学习记录
|
||||||
String courseHql="Select id,coverImg,score,name,sysType1,sysType2,sysType3 from "+Course.class.getSimpleName()+" where id in(?1)";
|
String courseHql="Select id,coverImg,score,name,sysType1,sysType2,sysType3,deleted from "+Course.class.getSimpleName()+" where id in(?1)";
|
||||||
String studyHql="Select courseId,addTime,progress,aid from "+StudyCourse.class.getSimpleName()+" where aid in(?1) and courseId in(?2)";
|
String studyHql="Select courseId,addTime,progress,aid from "+StudyCourse.class.getSimpleName()+" where aid in(?1) and courseId in(?2)";
|
||||||
|
|
||||||
List<StudyCourseSimple> rs=new ArrayList<>();
|
List<StudyCourseSimple> rs=new ArrayList<>();
|
||||||
@@ -425,6 +427,7 @@ public class StudyCourseServiceImpl implements IStudyCourseService{
|
|||||||
List<Object[]> clist= studyCourseDao.findListFields(courseHql,studyCourseQuery.getIds());
|
List<Object[]> clist= studyCourseDao.findListFields(courseHql,studyCourseQuery.getIds());
|
||||||
List<Object[]> slist= studyCourseDao.findListFields(studyHql,studyCourseQuery.getAids(),studyCourseQuery.getIds());
|
List<Object[]> slist= studyCourseDao.findListFields(studyHql,studyCourseQuery.getAids(),studyCourseQuery.getIds());
|
||||||
//数据数量一般不会太多,不超过20条,所以直接使用嵌套循环
|
//数据数量一般不会太多,不超过20条,所以直接使用嵌套循环
|
||||||
|
Map<String,Object> map=new HashMap<String,Object>();
|
||||||
for(Object[] sobjs : slist) {
|
for(Object[] sobjs : slist) {
|
||||||
StudyCourseSimple sc=new StudyCourseSimple();
|
StudyCourseSimple sc=new StudyCourseSimple();
|
||||||
sc.setCourseId(ConvertUtil.toStr(sobjs[0]));
|
sc.setCourseId(ConvertUtil.toStr(sobjs[0]));
|
||||||
@@ -441,6 +444,7 @@ public class StudyCourseServiceImpl implements IStudyCourseService{
|
|||||||
sc.setSysType1(ConvertUtil.toStr(cobjs[4]));
|
sc.setSysType1(ConvertUtil.toStr(cobjs[4]));
|
||||||
sc.setSysType2(ConvertUtil.toStr(cobjs[5]));
|
sc.setSysType2(ConvertUtil.toStr(cobjs[5]));
|
||||||
sc.setSysType3(ConvertUtil.toStr(cobjs[6]));
|
sc.setSysType3(ConvertUtil.toStr(cobjs[6]));
|
||||||
|
sc.setDeleted(ConvertUtil.toBool(cobjs[7]));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -449,6 +453,33 @@ public class StudyCourseServiceImpl implements IStudyCourseService{
|
|||||||
}
|
}
|
||||||
rs.add(sc);
|
rs.add(sc);
|
||||||
}
|
}
|
||||||
|
//检查针对于没有学习记录的课程
|
||||||
|
for(Object[] cobjs : clist) {
|
||||||
|
String cid=ConvertUtil.toStr(cobjs[0]);
|
||||||
|
boolean has=false;
|
||||||
|
for(StudyCourseSimple scs : rs) {
|
||||||
|
if(scs.getCourseId().equals(cid)) {
|
||||||
|
has=true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!has) {
|
||||||
|
StudyCourseSimple sc=new StudyCourseSimple();
|
||||||
|
sc.setCourseId(cid);
|
||||||
|
sc.setProgress(0f);
|
||||||
|
sc.setAid("");
|
||||||
|
sc.setCourseImage(ConvertUtil.toStr(cobjs[1]));
|
||||||
|
sc.setLastScore(ConvertUtil.toFloat(cobjs[2]));//课程分数,使用此值来承载
|
||||||
|
sc.setCourseName(ConvertUtil.toStr(cobjs[3]));
|
||||||
|
sc.setSysType1(ConvertUtil.toStr(cobjs[4]));
|
||||||
|
sc.setSysType2(ConvertUtil.toStr(cobjs[5]));
|
||||||
|
sc.setSysType3(ConvertUtil.toStr(cobjs[6]));
|
||||||
|
sc.setDeleted(ConvertUtil.toBool(cobjs[7]));
|
||||||
|
rs.add(sc);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}catch(Exception e) {
|
}catch(Exception e) {
|
||||||
log.error("查询错误",e);
|
log.error("查询错误",e);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import com.xboe.constants.Constants;
|
|||||||
import com.xboe.core.IAuthorizationToken;
|
import com.xboe.core.IAuthorizationToken;
|
||||||
import com.xboe.core.JsonResponse;
|
import com.xboe.core.JsonResponse;
|
||||||
import com.xboe.core.api.ApiBaseController;
|
import com.xboe.core.api.ApiBaseController;
|
||||||
|
import com.xboe.core.event.IEventDataSender;
|
||||||
import com.xboe.system.logs.entity.SysLogLogin;
|
import com.xboe.system.logs.entity.SysLogLogin;
|
||||||
import com.xboe.system.logs.service.ISysLogLoginService;
|
import com.xboe.system.logs.service.ISysLogLoginService;
|
||||||
import com.xboe.system.user.entity.SysManager;
|
import com.xboe.system.user.entity.SysManager;
|
||||||
@@ -62,6 +63,9 @@ public class SysLoginApi extends ApiBaseController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
StringRedisTemplate redisTemplate;
|
StringRedisTemplate redisTemplate;
|
||||||
|
|
||||||
|
@Autowired(required = false)
|
||||||
|
private IEventDataSender eventSender;
|
||||||
|
|
||||||
@GetMapping("/captcha")
|
@GetMapping("/captcha")
|
||||||
public JsonResponse<Map<String, String>> captcha() {
|
public JsonResponse<Map<String, String>> captcha() {
|
||||||
SpecCaptcha specCaptcha = new SpecCaptcha(130, 48, 5);
|
SpecCaptcha specCaptcha = new SpecCaptcha(130, 48, 5);
|
||||||
@@ -77,6 +81,24 @@ public class SysLoginApi extends ApiBaseController {
|
|||||||
return success(map);
|
return success(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/login/send")
|
||||||
|
public JsonResponse<Map<String, String>> sendMessage() {
|
||||||
|
Map<String, String> rs=new HashMap<String, String>();
|
||||||
|
|
||||||
|
if(eventSender!=null) {
|
||||||
|
try {
|
||||||
|
eventSender.send("测试消息","keykey", "all测试消息","1231231", "1", "aaaa", "asdqadqw","wqwrqre","");
|
||||||
|
}catch(Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return error("发送失败"+e.getMessage());
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
//log.error();
|
||||||
|
return error("未配置事件消息发送的实现");
|
||||||
|
}
|
||||||
|
return success(rs);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户名和密码登录
|
* 根据用户名和密码登录
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ public class OrganizationServiceImpl implements IOrganizationService {
|
|||||||
|
|
||||||
QueryBuilder qb = QueryBuilder.from(Organization.class);
|
QueryBuilder qb = QueryBuilder.from(Organization.class);
|
||||||
qb.addFilter(FieldFilters.eq("deleted", false));
|
qb.addFilter(FieldFilters.eq("deleted", false));
|
||||||
|
qb.addFilter(FieldFilters.eq("status", 1));
|
||||||
|
|
||||||
if (StringUtil.isNotBlank(parentId)) {
|
if (StringUtil.isNotBlank(parentId)) {
|
||||||
if(parentId.equals("-1")) {
|
if(parentId.equals("-1")) {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ spring.jpa.show-sql = true
|
|||||||
spring.jpa.hibernate.ddl-auto=update
|
spring.jpa.hibernate.ddl-auto=update
|
||||||
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
||||||
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||||
spring.datasource.url=jdbc:mysql://192.168.0.11:3306/boeu_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/boeu_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||||
spring.datasource.username=root
|
spring.datasource.username=root
|
||||||
spring.datasource.password=ENC(lAoFOYuc8CAypPtigTNLYg==)
|
spring.datasource.password=ENC(lAoFOYuc8CAypPtigTNLYg==)
|
||||||
|
|
||||||
@@ -52,11 +52,17 @@ jasypt.encryptor.algorithm=PBEWithMD5AndDES
|
|||||||
jasypt.encryptor.iv-generator-classname=org.jasypt.iv.NoIvGenerator
|
jasypt.encryptor.iv-generator-classname=org.jasypt.iv.NoIvGenerator
|
||||||
|
|
||||||
# elasticsearch config
|
# elasticsearch config
|
||||||
xboe.elasticsearch.server.ip=192.168.0.11
|
xboe.elasticsearch.server.ip=127.0.0.1
|
||||||
xboe.elasticsearch.server.port=9200
|
xboe.elasticsearch.server.port=9200
|
||||||
xboe.elasticsearch.server.user=
|
xboe.elasticsearch.server.user=
|
||||||
xboe.elasticsearch.server.password=
|
xboe.elasticsearch.server.password=
|
||||||
# 默认搜索的索引
|
# 默认搜索的索引
|
||||||
xboe.elasticsearch.index.name=new_resource_list
|
xboe.elasticsearch.index.name=new_resource_list
|
||||||
|
|
||||||
|
## 邮件的配置
|
||||||
|
xboe.email.url=https://u-pre.boe.com/api/b1/email/send
|
||||||
|
xboe.email.from=boeu_learning@boe.com.cn
|
||||||
|
xboe.email.user=
|
||||||
|
xboe.email.security=
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -48,3 +48,9 @@ xboe.elasticsearch.server.ip=10.251.129.21
|
|||||||
xboe.elasticsearch.server.port=9200
|
xboe.elasticsearch.server.port=9200
|
||||||
xboe.elasticsearch.server.user=
|
xboe.elasticsearch.server.user=
|
||||||
xboe.elasticsearch.server.password=
|
xboe.elasticsearch.server.password=
|
||||||
|
|
||||||
|
## 邮件的配置
|
||||||
|
xboe.email.url=https://u.boe.com/api/b1/email/send
|
||||||
|
xboe.email.from=boeu_learning@boe.com.cn
|
||||||
|
xboe.email.user=
|
||||||
|
xboe.email.security=
|
||||||
@@ -1,9 +1,18 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## redis
|
## redis
|
||||||
spring.redis.database=3
|
spring.redis.database=3
|
||||||
spring.redis.host=10.251.129.122
|
spring.redis.host=10.251.129.122
|
||||||
spring.redis.password=qwert!W588
|
spring.redis.password=qwert!W588
|
||||||
spring.redis.port=6379
|
spring.redis.port=6379
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## datasource config
|
## datasource config
|
||||||
spring.jpa.hibernate.ddl-auto=none
|
spring.jpa.hibernate.ddl-auto=none
|
||||||
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
||||||
@@ -13,7 +22,7 @@ spring.datasource.username=admin
|
|||||||
spring.datasource.password=boeRds01
|
spring.datasource.password=boeRds01
|
||||||
|
|
||||||
logging.level.org.hibernate.SQL=ERROR
|
logging.level.org.hibernate.SQL=ERROR
|
||||||
#logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
|
# logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
|
||||||
|
|
||||||
# 设置logback.xml位置
|
# 设置logback.xml位置
|
||||||
logging.config=classpath:log/logback-dev.xml
|
logging.config=classpath:log/logback-dev.xml
|
||||||
@@ -48,3 +57,9 @@ xboe.elasticsearch.server.ip=10.251.129.21
|
|||||||
xboe.elasticsearch.server.port=9200
|
xboe.elasticsearch.server.port=9200
|
||||||
xboe.elasticsearch.server.user=
|
xboe.elasticsearch.server.user=
|
||||||
xboe.elasticsearch.server.password=
|
xboe.elasticsearch.server.password=
|
||||||
|
|
||||||
|
## 邮件的配置
|
||||||
|
xboe.email.url=https://u.boe.com/api/b1/email/send
|
||||||
|
xboe.email.from=boeu_learning@boe.com.cn
|
||||||
|
xboe.email.user=
|
||||||
|
xboe.email.security=
|
||||||
@@ -60,3 +60,9 @@ xboe.elasticsearch.server.ip=10.251.129.25
|
|||||||
xboe.elasticsearch.server.port=9200
|
xboe.elasticsearch.server.port=9200
|
||||||
xboe.elasticsearch.server.user=elastic
|
xboe.elasticsearch.server.user=elastic
|
||||||
xboe.elasticsearch.server.password=Boe@es123
|
xboe.elasticsearch.server.password=Boe@es123
|
||||||
|
|
||||||
|
## 邮件的配置
|
||||||
|
xboe.email.url=https://u-pre.boe.com/api/b1/email/send
|
||||||
|
xboe.email.from=boeu_learning@boe.com.cn
|
||||||
|
xboe.email.user=
|
||||||
|
xboe.email.security=
|
||||||
@@ -187,7 +187,13 @@ public class CaseDataSyncRunner {
|
|||||||
return first;
|
return first;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// public static void main(String[] args) {
|
||||||
|
// String str="显示-前台SBU1__eol__(包括:前台:MNT SBU、NB SBU、TPC SBU、TV SBU、F1 SBU、Mobile SBU、产销管理中心、车载SBU、SC SBU、C SBU、显示事业数字化变革管理办公室;终端营销协调组:MNT终端产品线、TV终端产品线、NB终端产品线、TPC终端产品线、3D显示特战队;中台:产销管理中心)";
|
||||||
|
// CaseDataSyncRunner runner=new CaseDataSyncRunner();
|
||||||
|
// System.out.println(runner.getNameStr(str));
|
||||||
|
// System.out.println("显示-前台SBU1__eol__");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
|
||||||
public void doParser(String json) throws Exception {
|
public void doParser(String json) throws Exception {
|
||||||
|
|
||||||
@@ -239,7 +245,7 @@ public class CaseDataSyncRunner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//组织领域,无根据名称查找 ,再根据找到filter 对应code去找上级的名称
|
//组织领域,无根据名称查找 ,再根据找到filter 对应code去找上级的名称
|
||||||
if(StringUtil.isNotBlank(csr.getCaseOwnerOrg())) {
|
if(StringUtils.isNotBlank(csr.getCaseOwnerOrg())) {
|
||||||
String firstName=null;
|
String firstName=null;
|
||||||
DictItem dictItem=null;
|
DictItem dictItem=null;
|
||||||
List<DictItem> items=syncService.findDictItemByName(csr.getCaseOwnerOrg());
|
List<DictItem> items=syncService.findDictItemByName(csr.getCaseOwnerOrg());
|
||||||
@@ -272,8 +278,7 @@ public class CaseDataSyncRunner {
|
|||||||
|
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
csr.setStatus(1);
|
appendError(csr,"无组织领域【"+csr.getCaseOwnerOrg()+"】");
|
||||||
csr.setErrorInfo(csr.getErrorInfo()+ ",未匹配到组织领域【"+csr.getCaseOwnerOrg()+"】");
|
|
||||||
}
|
}
|
||||||
//专业分类
|
//专业分类
|
||||||
if(StringUtil.isNotBlank(csr.getCaseSpecialtySequence()) ) {
|
if(StringUtil.isNotBlank(csr.getCaseSpecialtySequence()) ) {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.xboe.common.utils.StringUtil;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.ApplicationArguments;
|
import org.springframework.boot.ApplicationArguments;
|
||||||
@@ -61,7 +62,7 @@ public class StartRunner implements ApplicationRunner {
|
|||||||
mainOrgMap.put(org.getKid(),mainOrg.getId());//
|
mainOrgMap.put(org.getKid(),mainOrg.getId());//
|
||||||
|
|
||||||
}
|
}
|
||||||
//同步用户信息
|
//同步用户信息,2022/11/04同步用户学习时长
|
||||||
//查询出本地用户
|
//查询出本地用户
|
||||||
List<MainUser> allUsers=mainService.findAll();
|
List<MainUser> allUsers=mainService.findAll();
|
||||||
for(MainUser mainUser : allUsers) {
|
for(MainUser mainUser : allUsers) {
|
||||||
@@ -72,13 +73,29 @@ public class StartRunner implements ApplicationRunner {
|
|||||||
String newId=mainOrgMap.get(oldUser.getOrgnizationId());
|
String newId=mainOrgMap.get(oldUser.getOrgnizationId());
|
||||||
|
|
||||||
if(StringUtils.isBlank(newId)) {
|
if(StringUtils.isBlank(newId)) {
|
||||||
log.error("未找到【"+oldUser.getKid()+"】对应的机构id,不更新用户");
|
log.error("本地未找到【"+oldUser.getKid()+"】对应的机构id,不更新用户");
|
||||||
}else {
|
}else {
|
||||||
mainUser.setSysDepartId(oldUser.getOrgnizationId());
|
mainUser.setSysDepartId(oldUser.getOrgnizationId());
|
||||||
mainUser.setCompanyId(oldUser.getCompanyId());
|
mainUser.setCompanyId(oldUser.getCompanyId());
|
||||||
mainUser.setDepartId(newId);
|
mainUser.setDepartId(newId);
|
||||||
|
|
||||||
|
mainUser.setLearningDuration(oldUser.getLearningDuration());
|
||||||
|
mainUser.setStatus(oldUser.getStatus());
|
||||||
|
if(oldUser.getIsDeleted()!=null) {
|
||||||
|
mainUser.setDeleted(oldUser.getIsDeleted()==0? false:true);
|
||||||
|
}
|
||||||
|
if(mainUser.getDeleted()) {
|
||||||
|
if(StringUtils.isNotBlank(oldUser.getEmployeeStatus())){
|
||||||
|
mainUser.setDeleted(oldUser.getEmployeeStatus().equals("3")? true:false);
|
||||||
|
}
|
||||||
|
}
|
||||||
mainService.updateUser(mainUser);
|
mainService.updateUser(mainUser);
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
|
//本地应该删除
|
||||||
|
log.error("原系统中无【"+mainUser.getSysId()+"】对应的用户id,本地标识删除此用户");
|
||||||
|
mainService.deleteAccount(mainUser.getId());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,12 +21,23 @@ public class OldTreeNode {
|
|||||||
@Column(name = "kid", length = 36)
|
@Column(name = "kid", length = 36)
|
||||||
private String kid;
|
private String kid;
|
||||||
|
|
||||||
|
@Column(name = "tree_node_code", length = 50)
|
||||||
|
private String nodeCode;
|
||||||
|
|
||||||
@Column(name = "tree_node_name", length = 100)
|
@Column(name = "tree_node_name", length = 100)
|
||||||
private String nodeName;
|
private String nodeName;
|
||||||
|
|
||||||
|
@Column(name = "display_number")
|
||||||
|
private Integer displayNumber;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "node_name_path", length = 500)
|
@Column(name = "node_name_path", length = 500)
|
||||||
private String namePath;
|
private String namePath;
|
||||||
|
|
||||||
|
@Column(name = "parent_node_id", length = 50)
|
||||||
|
private String parentNodeId;
|
||||||
|
|
||||||
@Column(name = "is_deleted", length = 1)
|
@Column(name = "is_deleted", length = 1)
|
||||||
private Integer isDeleted;
|
private Integer isDeleted;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,11 +33,16 @@ public class OldUser implements java.io.Serializable{
|
|||||||
private String userNo;
|
private String userNo;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Column(name = "employee_status", length = 50)
|
||||||
|
private String employeeStatus;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态;0:临时,1:正常,2:停用
|
* 状态;0:临时,1:正常,2:停用
|
||||||
*/
|
*/
|
||||||
@Column(name = "status", length = 3)
|
@Column(name = "status", length = 3)
|
||||||
private String status;
|
private Integer status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业ID
|
* 企业ID
|
||||||
@@ -51,9 +56,13 @@ public class OldUser implements java.io.Serializable{
|
|||||||
@Column(name = "orgnization_id", length = 150)
|
@Column(name = "orgnization_id", length = 150)
|
||||||
private String orgnizationId;
|
private String orgnizationId;
|
||||||
|
|
||||||
|
/**用户学习时长*/
|
||||||
|
@Column(name = "learning_duration")
|
||||||
|
private Float learningDuration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除标记;0:正常,1:已删除
|
* 删除标记;0:正常,1:已删除
|
||||||
*/
|
*/
|
||||||
@Column(name = "is_deleted", length = 3)
|
@Column(name = "is_deleted", length = 3)
|
||||||
private String isDeleted;
|
private Integer isDeleted;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import com.xboe.basic.dao.OldUserDao;
|
|||||||
import com.xboe.basic.entity.OldOrganization;
|
import com.xboe.basic.entity.OldOrganization;
|
||||||
import com.xboe.basic.entity.OldUser;
|
import com.xboe.basic.entity.OldUser;
|
||||||
import com.xboe.basic.service.IOldService;
|
import com.xboe.basic.service.IOldService;
|
||||||
import com.xboe.common.OrderCondition;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -15,7 +15,10 @@ public interface MainAccountDao extends JpaRepository<MainAccount,String>{
|
|||||||
|
|
||||||
@Modifying
|
@Modifying
|
||||||
@Query(value = "update MainAccount set deleted=true where id=?1")
|
@Query(value = "update MainAccount set deleted=true where id=?1")
|
||||||
// @Transactional(rollbackFor = Exception.class)
|
|
||||||
public Integer setDeleted(String id);
|
public Integer setDeleted(String id);
|
||||||
|
|
||||||
|
@Modifying
|
||||||
|
@Query(value = "update MainAccount set status=?1,deleted=?2 where id=?3")
|
||||||
|
public Integer updateStatusAndDeleted(Integer status,Boolean deleted,String id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,12 +65,21 @@ public class MainUser extends IdEntity {
|
|||||||
@Column(name = "sass_id", length = 36)
|
@Column(name = "sass_id", length = 36)
|
||||||
private String sassId;
|
private String sassId;
|
||||||
|
|
||||||
|
/**用户学习时长*/
|
||||||
|
@Column(name = "learning_duration")
|
||||||
|
private Float learningDuration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除标识
|
* 删除标识
|
||||||
* */
|
* */
|
||||||
@Column(name="deleted",length = 1)
|
// @Column(name="deleted",length = 1)
|
||||||
private Boolean deleted;
|
private Boolean deleted;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户的状态
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
public MainUser() {
|
public MainUser() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,4 +28,10 @@ public interface IMainDbSyncService {
|
|||||||
|
|
||||||
void updateUser(MainUser muser);
|
void updateUser(MainUser muser);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 把账号设置为已删除
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
void deleteAccount(String id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,8 +61,16 @@ public class MainDbSyncServiceImpl implements IMainDbSyncService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional("transactionManagerPrimary")
|
||||||
|
public void deleteAccount(String id) {
|
||||||
|
accountDao.setDeleted(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional("transactionManagerPrimary")
|
||||||
public void updateUser(MainUser muser) {
|
public void updateUser(MainUser muser) {
|
||||||
userDao.update(muser.getDepartId(),muser.getSysDepartId(),muser.getCompanyId(),muser.getId());
|
userDao.update(muser.getDepartId(),muser.getSysDepartId(),muser.getCompanyId(),muser.getId());
|
||||||
|
accountDao.updateStatusAndDeleted(muser.getStatus(),muser.getDeleted(), muser.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user