mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-09 02:46:50 +08:00
Merge branch 'preview' of codeup.aliyun.com:6265f483e4166464dc2f9c14/boeu/baseservers into release
This commit is contained in:
@@ -22,6 +22,11 @@
|
|||||||
<artifactId>xboe-core</artifactId>
|
<artifactId>xboe-core</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.xboe</groupId>
|
||||||
|
<artifactId>xboe-redis</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xboe</groupId>
|
<groupId>com.xboe</groupId>
|
||||||
<artifactId>xboe-module-course</artifactId>
|
<artifactId>xboe-module-course</artifactId>
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ public class ArticleServiceImpl implements IArticleService{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<UsernameDto> usernameCounts(int pageSize) {
|
public List<UsernameDto> usernameCounts(int pageSize) {
|
||||||
String sql="select count(sys_create_aid),sys_create_by,coverurl,summary,favorites,praises,shares,comments,views,sys_create_aid from boe_article where deleted=0 and status=9 and enabled =1 GROUP BY(sys_create_by) ORDER BY (count(sys_create_aid)) desc limit ?1";
|
String sql="select count(sys_create_aid),sys_create_by,coverurl,summary,favorites,praises,shares,comments,views,sys_create_aid from boe_article where deleted=0 and status=9 and enabled =1 GROUP BY(sys_create_by) ORDER BY (count(sys_create_aid)) desc,views desc limit ?1";
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
List<Object[]> list = dao.sqlFindList(sql, pageSize);
|
List<Object[]> list = dao.sqlFindList(sql, pageSize);
|
||||||
if(pageSize>list.size()){
|
if(pageSize>list.size()){
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ public interface ICourseService {
|
|||||||
/**
|
/**
|
||||||
* 查询出三条关联兴趣爱好的数据
|
* 查询出三条关联兴趣爱好的数据
|
||||||
* */
|
* */
|
||||||
List<Course> userHobbyList(String aid);
|
List<Course> userHobbyList(String aid,String orderField,Boolean orderAsc);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -958,7 +958,7 @@ public class CourseServiceImpl implements ICourseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Course> userHobbyList(String aid) {
|
public List<Course> userHobbyList(String aid,String orderField,Boolean orderAsc) {
|
||||||
List<Course> courses = new ArrayList<>();
|
List<Course> courses = new ArrayList<>();
|
||||||
if(StringUtil.isNotBlank(aid)){
|
if(StringUtil.isNotBlank(aid)){
|
||||||
String sql="select ref_id from boe_user_hobby where aid='"+aid+"'";
|
String sql="select ref_id from boe_user_hobby where aid='"+aid+"'";
|
||||||
@@ -977,6 +977,19 @@ public class CourseServiceImpl implements ICourseService {
|
|||||||
iFieldFilters.add(FieldFilters.in("sysType2",strings));
|
iFieldFilters.add(FieldFilters.in("sysType2",strings));
|
||||||
iFieldFilters.add(FieldFilters.in("sysType3",strings));
|
iFieldFilters.add(FieldFilters.in("sysType3",strings));
|
||||||
builder.addFilter(FieldFilters.or(iFieldFilters));
|
builder.addFilter(FieldFilters.or(iFieldFilters));
|
||||||
|
OrderCondition oc=null;
|
||||||
|
if(StringUtils.isNotBlank(orderField)) {
|
||||||
|
if(orderAsc==null || orderAsc) {
|
||||||
|
oc=OrderCondition.asc(orderField);
|
||||||
|
}else {
|
||||||
|
oc=OrderCondition.desc(orderField);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
//oc=OrderCondition.desc("id");
|
||||||
|
//默认按发布时间排序
|
||||||
|
oc=OrderCondition.desc("publishTime");
|
||||||
|
}
|
||||||
|
builder.addOrder(oc);
|
||||||
courses=courseDao.findList(builder.builder());
|
courses=courseDao.findList(builder.builder());
|
||||||
}
|
}
|
||||||
return courses;
|
return courses;
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.xboe.phase2.dao;
|
||||||
|
|
||||||
|
import com.xboe.core.orm.BaseDao;
|
||||||
|
import com.xboe.phase2.entity.GuestBook;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public class GuestBookDao extends BaseDao<GuestBook> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.xboe.phase2.dao;
|
||||||
|
|
||||||
|
import com.xboe.core.orm.BaseDao;
|
||||||
|
import com.xboe.phase2.entity.NoteInfo;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public class NoteInfoDao extends BaseDao<NoteInfo> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package com.xboe.phase2.entity;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.xboe.core.SysConstant;
|
||||||
|
import com.xboe.core.orm.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 留言
|
||||||
|
* */
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Table(name = SysConstant.TABLE_PRE+"guest_book")
|
||||||
|
public class GuestBook extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -1546791463472018751L;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
* */
|
||||||
|
@Column(name = "aid",length = 20)
|
||||||
|
private String aid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 留言内容
|
||||||
|
* */
|
||||||
|
@Column(name = "content",length = 200)
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 回复内容
|
||||||
|
* */
|
||||||
|
@Column(name = "replys",columnDefinition = "text")
|
||||||
|
private String replys;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 回复时间
|
||||||
|
* */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Column(name = "reply_time")
|
||||||
|
private LocalDateTime replyTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点赞数
|
||||||
|
* */
|
||||||
|
@Column(name = "praises")
|
||||||
|
private Integer praises;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,150 @@
|
|||||||
|
package com.xboe.phase2.entity;
|
||||||
|
|
||||||
|
import com.xboe.core.SysConstant;
|
||||||
|
import com.xboe.core.orm.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 笔记
|
||||||
|
* */
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Entity
|
||||||
|
@Table(name = SysConstant.TABLE_PRE+"note_info")
|
||||||
|
public class NoteInfo extends BaseEntity {
|
||||||
|
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**课程笔记*/
|
||||||
|
public static final int COURSE_TYPE=1;
|
||||||
|
|
||||||
|
/**上传的笔记*/
|
||||||
|
public static final int UPLODE_TYPE=2;
|
||||||
|
|
||||||
|
/**不公开*/
|
||||||
|
public static final int NOOPEN=1;
|
||||||
|
|
||||||
|
/**完全公开*/
|
||||||
|
public static final int OPEN=9;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 笔记类型
|
||||||
|
* 1 课程笔记 2 上传的笔记
|
||||||
|
* 我发布的是1 我导入的是2,
|
||||||
|
* */
|
||||||
|
@Column(name = "type",length = 1)
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 笔记内容
|
||||||
|
* */
|
||||||
|
@Column(name = "content",columnDefinition = "text")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*课程播放点 秒
|
||||||
|
* 课程内容播放时间点,只限于音视频
|
||||||
|
* */
|
||||||
|
@Column(name = "play_time")
|
||||||
|
private Integer playTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程id
|
||||||
|
* */
|
||||||
|
@Column(name = "course_id",length = 20)
|
||||||
|
private String courseId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程内容id
|
||||||
|
* */
|
||||||
|
@Column(name = "content_id",length = 20)
|
||||||
|
private String contentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程名称
|
||||||
|
* */
|
||||||
|
@Column(name = "course_name",length = 100)
|
||||||
|
private String courseName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否公开
|
||||||
|
* 1表不公开 9表完全公开
|
||||||
|
* */
|
||||||
|
@Column(name = "open_type",length = 1)
|
||||||
|
private Integer openType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 笔记原文件
|
||||||
|
* */
|
||||||
|
@Column(name = "file_path",length = 200)
|
||||||
|
private String filePath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 笔记原文件名称
|
||||||
|
* */
|
||||||
|
@Column(name = "file_name",length = 100)
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点赞数
|
||||||
|
* */
|
||||||
|
@Column(name = "praises")
|
||||||
|
private Integer praises;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收藏数
|
||||||
|
* */
|
||||||
|
@Column(name = "favorites")
|
||||||
|
private Integer favorites;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 评论数
|
||||||
|
* */
|
||||||
|
@Column(name = "comments")
|
||||||
|
private Integer comments;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否自动保存
|
||||||
|
* */
|
||||||
|
@Column(name = "is_auto")
|
||||||
|
private Boolean isAuto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 内容类型 1 txt 2 word image 3
|
||||||
|
* */
|
||||||
|
@Column(name = "content_type")
|
||||||
|
private Integer contentType;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public NoteInfo(Integer type, String content, Integer playTime, String courseId, String contentId, String courseName, Integer openType, String filePath, String fileName, Integer praises, Integer favorites, Integer comments) {
|
||||||
|
this.type = type;
|
||||||
|
this.content = content;
|
||||||
|
this.playTime = playTime;
|
||||||
|
this.courseId = courseId;
|
||||||
|
this.contentId = contentId;
|
||||||
|
this.courseName = courseName;
|
||||||
|
this.openType = openType;
|
||||||
|
this.filePath = filePath;
|
||||||
|
this.fileName = fileName;
|
||||||
|
this.praises = praises;
|
||||||
|
this.favorites = favorites;
|
||||||
|
this.comments = comments;
|
||||||
|
}
|
||||||
|
|
||||||
|
public NoteInfo() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public NoteInfo(String courseId, String courseName){
|
||||||
|
this.courseId=courseId;
|
||||||
|
this.courseName=courseName;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -100,6 +100,7 @@ public class PortalConsoleApi extends ApiBaseController{
|
|||||||
map.put("name",user.getName());
|
map.put("name",user.getName());
|
||||||
map.put("sex",user.getGender());
|
map.put("sex",user.getGender());
|
||||||
map.put("userNo",user.getUserNo());
|
map.put("userNo",user.getUserNo());
|
||||||
|
map.put("showHome",user.getShowHome()==null? true:user.getShowHome());
|
||||||
map.put("userType",utype);
|
map.put("userType",utype);
|
||||||
map.put("departId",user.getDepartId());
|
map.put("departId",user.getDepartId());
|
||||||
map.put("sign",user.getSign());
|
map.put("sign",user.getSign());
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ public class PortalIndexApi extends ApiBaseController{
|
|||||||
PageList<Course> coursePageList = courseService.findSimplePage(pager.getPageIndex(), pager.getPageSize(),dto);
|
PageList<Course> coursePageList = courseService.findSimplePage(pager.getPageIndex(), pager.getPageSize(),dto);
|
||||||
|
|
||||||
String aid = this.getCurrent().getAccountId();
|
String aid = this.getCurrent().getAccountId();
|
||||||
List<Course> courses = courseService.userHobbyList(aid);
|
List<Course> courses = courseService.userHobbyList(aid,dto.getOrderField(),dto.getOrderAsc());
|
||||||
|
|
||||||
//计算下标,
|
//计算下标,
|
||||||
int i=0;
|
int i=0;
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ public class PortalLoginApi extends ApiBaseController {
|
|||||||
//检查系统用户是否存在
|
//检查系统用户是否存在
|
||||||
account = accountService.get(tokenInfo.get("aid"));
|
account = accountService.get(tokenInfo.get("aid"));
|
||||||
}else{
|
}else{
|
||||||
log.error("查询用户kid【"+tokenInfo.get("userId")+"】");
|
//log.error("查询用户kid【"+tokenInfo.get("userId")+"】");
|
||||||
// 没有aid则判断是否已同步的用户,不是则同步
|
// 没有aid则判断是否已同步的用户,不是则同步
|
||||||
if(StringUtil.isNotBlank(tokenInfo.get("userId"))){
|
if(StringUtil.isNotBlank(tokenInfo.get("userId"))){
|
||||||
account = accountService.findLoginBySysId(tokenInfo.get("userId"));
|
account = accountService.findLoginBySysId(tokenInfo.get("userId"));
|
||||||
@@ -240,6 +240,9 @@ public class PortalLoginApi extends ApiBaseController {
|
|||||||
return error("未找到的用户信息");
|
return error("未找到的用户信息");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//在这种情况下情况下,应该重置 一下缓存,以便对用户进行缓存更新
|
||||||
|
//String cacheKey=CacheName.NAME_USER+ CacheName.KEY_USER_SYSID +account.getId();
|
||||||
|
|
||||||
// if (account.getStatus() == Constants.ACCOUNT_STATUS_DEACTIVATE) {
|
// if (account.getStatus() == Constants.ACCOUNT_STATUS_DEACTIVATE) {
|
||||||
// return error("账号已停用");
|
// return error("账号已停用");
|
||||||
// }
|
// }
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.xboe.school.impl;
|
||||||
|
|
||||||
|
import com.xboe.core.orm.FieldUpdateType;
|
||||||
|
import com.xboe.core.orm.UpdateBuilder;
|
||||||
|
import com.xboe.module.interaction.dao.CommentsDao;
|
||||||
|
import com.xboe.module.interaction.service.ICallbackAddHits;
|
||||||
|
import com.xboe.standard.enums.BoedxHitsField;
|
||||||
|
import com.xboe.standard.enums.BoedxResourceType;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章评论对点数的增加或者减少
|
||||||
|
* */
|
||||||
|
@Service
|
||||||
|
@Transactional
|
||||||
|
public class ArticleCommentAddHitsImpl implements ICallbackAddHits {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
CommentsDao commentsDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BoedxResourceType getType() {
|
||||||
|
return BoedxResourceType.ArticleComment;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void increase(String id, BoedxHitsField field) {
|
||||||
|
commentsDao.updateMultiFieldById(id, UpdateBuilder.create(field.getField(),field.getField()+"+1", FieldUpdateType.EXPRESSION));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reduce(String id, BoedxHitsField field) {
|
||||||
|
commentsDao.updateMultiFieldById(id, UpdateBuilder.create(field.getField(),field.getField()+"-1",FieldUpdateType.EXPRESSION));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.xboe.school.impl;
|
||||||
|
|
||||||
|
import com.xboe.core.orm.FieldUpdateType;
|
||||||
|
import com.xboe.core.orm.UpdateBuilder;
|
||||||
|
import com.xboe.module.interaction.dao.CommentsDao;
|
||||||
|
import com.xboe.module.interaction.service.ICallbackAddHits;
|
||||||
|
import com.xboe.standard.enums.BoedxHitsField;
|
||||||
|
import com.xboe.standard.enums.BoedxResourceType;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.transaction.Transactional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案例评论 对点数的增加或者减少
|
||||||
|
* */
|
||||||
|
@Service
|
||||||
|
public class CaseCommentAddHitsImpl implements ICallbackAddHits {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
CommentsDao commentsDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BoedxResourceType getType() {
|
||||||
|
return BoedxResourceType.CaseComment;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void increase(String id, BoedxHitsField field) {
|
||||||
|
commentsDao.updateMultiFieldById(id, UpdateBuilder.create(field.getField(),field.getField()+"+1", FieldUpdateType.EXPRESSION));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void reduce(String id, BoedxHitsField field) {
|
||||||
|
commentsDao.updateMultiFieldById(id, UpdateBuilder.create(field.getField(),field.getField()+"-1",FieldUpdateType.EXPRESSION));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package com.xboe.school.impl;
|
||||||
|
|
||||||
|
import com.xboe.core.orm.FieldUpdateType;
|
||||||
|
import com.xboe.core.orm.UpdateBuilder;
|
||||||
|
import com.xboe.module.interaction.dao.CommentsDao;
|
||||||
|
import com.xboe.module.interaction.service.ICallbackAddHits;
|
||||||
|
import com.xboe.standard.enums.BoedxHitsField;
|
||||||
|
import com.xboe.standard.enums.BoedxResourceType;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程评论对点数的增加和减少
|
||||||
|
* */
|
||||||
|
@Service
|
||||||
|
@Transactional
|
||||||
|
public class CourseCommentAddHitsImpl implements ICallbackAddHits {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
CommentsDao commentsDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BoedxResourceType getType() {
|
||||||
|
return BoedxResourceType.CourseComment;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void increase(String id, BoedxHitsField field) {
|
||||||
|
commentsDao.updateMultiFieldById(id, UpdateBuilder.create(field.getField(),field.getField()+"+1", FieldUpdateType.EXPRESSION));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reduce(String id, BoedxHitsField field) {
|
||||||
|
commentsDao.updateMultiFieldById(id, UpdateBuilder.create(field.getField(),field.getField()+"-1",FieldUpdateType.EXPRESSION));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.xboe.school.impl;
|
||||||
|
|
||||||
|
import com.xboe.core.orm.FieldUpdateType;
|
||||||
|
import com.xboe.core.orm.UpdateBuilder;
|
||||||
|
import com.xboe.module.interaction.service.ICallbackAddHits;
|
||||||
|
import com.xboe.phase2.dao.GuestBookDao;
|
||||||
|
import com.xboe.standard.enums.BoedxHitsField;
|
||||||
|
import com.xboe.standard.enums.BoedxResourceType;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Transactional
|
||||||
|
public class GuestAddHitsImpl implements ICallbackAddHits {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
GuestBookDao guestBookDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BoedxResourceType getType() {
|
||||||
|
return BoedxResourceType.Guest;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void increase(String id, BoedxHitsField field) {
|
||||||
|
guestBookDao.updateMultiFieldById(id, UpdateBuilder.create(field.getField(),field.getField()+"+1", FieldUpdateType.EXPRESSION));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reduce(String id, BoedxHitsField field) {
|
||||||
|
guestBookDao.updateMultiFieldById(id, UpdateBuilder.create(field.getField(),field.getField()+"-1",FieldUpdateType.EXPRESSION));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package com.xboe.school.impl;
|
||||||
|
|
||||||
|
import com.xboe.core.orm.FieldUpdateType;
|
||||||
|
import com.xboe.core.orm.UpdateBuilder;
|
||||||
|
import com.xboe.module.interaction.dao.CommentsDao;
|
||||||
|
import com.xboe.module.interaction.service.ICallbackAddHits;
|
||||||
|
import com.xboe.standard.enums.BoedxHitsField;
|
||||||
|
import com.xboe.standard.enums.BoedxResourceType;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 笔记评论对点数的增加和减少
|
||||||
|
* */
|
||||||
|
@Service
|
||||||
|
@Transactional
|
||||||
|
public class NoteCommentAddHitsImpl implements ICallbackAddHits {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
CommentsDao commentsDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BoedxResourceType getType() {
|
||||||
|
return BoedxResourceType.NoteComment;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void increase(String id, BoedxHitsField field) {
|
||||||
|
commentsDao.updateMultiFieldById(id, UpdateBuilder.create(field.getField(),field.getField()+"+1", FieldUpdateType.EXPRESSION));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reduce(String id, BoedxHitsField field) {
|
||||||
|
commentsDao.updateMultiFieldById(id, UpdateBuilder.create(field.getField(),field.getField()+"-1",FieldUpdateType.EXPRESSION));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.xboe.school.impl;
|
||||||
|
|
||||||
|
import com.xboe.core.orm.FieldUpdateType;
|
||||||
|
import com.xboe.core.orm.UpdateBuilder;
|
||||||
|
import com.xboe.module.interaction.service.ICallbackAddHits;
|
||||||
|
import com.xboe.phase2.dao.NoteInfoDao;
|
||||||
|
import com.xboe.standard.enums.BoedxHitsField;
|
||||||
|
import com.xboe.standard.enums.BoedxResourceType;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 笔记 对点数的增加或者减少
|
||||||
|
* */
|
||||||
|
@Service
|
||||||
|
@Transactional
|
||||||
|
public class NoteInfoAddHitsImpl implements ICallbackAddHits {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
NoteInfoDao noteInfoDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BoedxResourceType getType() {
|
||||||
|
return BoedxResourceType.NoteInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void increase(String id, BoedxHitsField field) {
|
||||||
|
noteInfoDao.updateMultiFieldById(id, UpdateBuilder.create(field.getField(),field.getField()+"+1", FieldUpdateType.EXPRESSION));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reduce(String id, BoedxHitsField field) {
|
||||||
|
noteInfoDao.updateMultiFieldById(id, UpdateBuilder.create(field.getField(),field.getField()+"-1",FieldUpdateType.EXPRESSION));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,8 +6,6 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
|
|
||||||
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.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
|
||||||
package com.xboe.school.study.service.impl;
|
package com.xboe.school.study.service.impl;
|
||||||
|
|
||||||
|
import java.math.BigInteger;
|
||||||
|
import java.sql.Timestamp;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
@@ -275,34 +277,94 @@ public class StudyCourseServiceImpl implements IStudyCourseService{
|
|||||||
@Override
|
@Override
|
||||||
public List<StudyCourse> ids(StudyCourseQuery studyCourseQuery) {
|
public List<StudyCourse> ids(StudyCourseQuery studyCourseQuery) {
|
||||||
// List<StudyCouseDto> studyCouseDtos = new ArrayList<>();
|
// List<StudyCouseDto> studyCouseDtos = new ArrayList<>();
|
||||||
QueryBuilder builder = QueryBuilder.from(StudyCourse.class.getSimpleName()+" sc,"+ Course.class.getSimpleName()+" c");
|
// QueryBuilder builder = QueryBuilder.from(StudyCourse.class.getSimpleName()+" sc,"+ Course.class.getSimpleName()+" c");
|
||||||
builder.addFilter(FieldFilters.eqField("sc.courseId","c.id"));
|
// builder.addFilter(FieldFilters.eqField("sc.courseId","c.id"));
|
||||||
// builder.addFilter(FieldFilters.eq("c.enabled",true));
|
//// builder.addFilter(FieldFilters.eq("c.enabled",true));
|
||||||
// builder.addFilter(FieldFilters.eq("c.deleted",false));
|
//// builder.addFilter(FieldFilters.eq("c.deleted",false));
|
||||||
builder.addFilter(FieldFilters.eq("sc.aid",studyCourseQuery.getAid()));
|
// builder.addFilter(FieldFilters.eq("sc.aid",studyCourseQuery.getAid()));
|
||||||
builder.addFilter(FieldFilters.in("sc.courseId",studyCourseQuery.getIds()));
|
// builder.addFilter(FieldFilters.in("sc.courseId",studyCourseQuery.getIds()));
|
||||||
builder.addOrder(OrderCondition.desc("sc.lastTime"));
|
// builder.addOrder(OrderCondition.desc("sc.lastTime"));
|
||||||
builder.addFields("sc");
|
// builder.addFields("sc");
|
||||||
builder.addFields("c.score");
|
// builder.addFields("c.score");
|
||||||
builder.addFields("c.coverImg");
|
// builder.addFields("c.coverImg");
|
||||||
|
|
||||||
|
StringBuilder str=new StringBuilder();
|
||||||
|
if(!studyCourseQuery.getIds().isEmpty()){
|
||||||
|
for (String id:studyCourseQuery.getIds()){
|
||||||
|
str.append("'");
|
||||||
|
str.append(id);
|
||||||
|
str.append("'");
|
||||||
|
str.append(",");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotBlank(str)){
|
||||||
|
str.deleteCharAt(str.length()-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
String sql="select sc.id,sc.course_id,sc.course_type,sc.course_name,sc.aid,sc.aname,sc.source,sc.add_time,sc.start_time,sc.finish_time,sc.progress," +
|
||||||
|
"sc.total_duration,sc.last_score,sc.status,sc.status_time,sc.last_time," +
|
||||||
|
"c.score,c.cover_img from boe_course as c left join boe_study_course as sc on sc.course_id=c.id where " +
|
||||||
|
"sc.aid='"+studyCourseQuery.getAid()+"' and sc.course_id in ("+str+") order by sc.last_time";
|
||||||
|
|
||||||
|
|
||||||
//List<StudyCourse> list = studyCourseDao.findList(builder.builder());
|
//List<StudyCourse> list = studyCourseDao.findList(builder.builder());
|
||||||
List<StudyCourse> rs=new ArrayList<StudyCourse>();
|
List<StudyCourse> rs=new ArrayList<StudyCourse>();
|
||||||
Set<String> checkSet=new HashSet<String>();
|
Set<String> checkSet=new HashSet<String>();
|
||||||
try {
|
try {
|
||||||
List<Object[]> list= studyCourseDao.findListFields(builder.builder());
|
// List<Object[]> list= studyCourseDao.findListFields(builder.builder());
|
||||||
|
List<Object[]> list = studyCourseDao.sqlFindList(sql);
|
||||||
for(Object[] objs:list) {
|
for(Object[] objs:list) {
|
||||||
StudyCourse sc=(StudyCourse)objs[0];
|
// System.out.println(objs[0].getClass());
|
||||||
if(!checkSet.contains(sc.getCourseId())) {
|
// StudyCourse sc=(StudyCourse)objs[0];
|
||||||
Float score=(Float)objs[1];
|
StudyCourse studyCourse = new StudyCourse();
|
||||||
String img=(String)objs[2];
|
|
||||||
sc.setLastScore(score);
|
studyCourse.setId(String.valueOf((BigInteger) objs[0]));
|
||||||
sc.setCourseImage(img);
|
studyCourse.setCourseId((String) objs[1]);
|
||||||
rs.add(sc);
|
studyCourse.setCourseType((Integer) objs[2]);
|
||||||
checkSet.add(sc.getCourseId());
|
studyCourse.setCourseName((String) objs[3]);
|
||||||
|
studyCourse.setAid((String) objs[4]);
|
||||||
|
studyCourse.setAname((String) objs[5]);
|
||||||
|
studyCourse.setSource((Integer) objs[6]);
|
||||||
|
if(objs[7]!=null) {
|
||||||
|
Timestamp timestamp = (Timestamp) objs[7];
|
||||||
|
|
||||||
|
studyCourse.setAddTime(timestamp.toLocalDateTime());
|
||||||
|
}
|
||||||
|
if(objs[8]!=null){
|
||||||
|
Timestamp timestamp1 = (Timestamp) objs[8];
|
||||||
|
studyCourse.setStartTime(timestamp1.toLocalDateTime());
|
||||||
|
}
|
||||||
|
if(objs[9]!=null){
|
||||||
|
Timestamp timestamp2 = (Timestamp) objs[9];
|
||||||
|
studyCourse.setFinishTime(timestamp2.toLocalDateTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
studyCourse.setProgress((Float) objs[10]);
|
||||||
|
studyCourse.setTotalDuration((Integer) objs[11]);
|
||||||
|
studyCourse.setLastScore((Float) objs[12]);
|
||||||
|
studyCourse.setStatus((Integer) objs[13]);
|
||||||
|
if(objs[14]!=null){
|
||||||
|
Timestamp timestamp3 = (Timestamp) objs[14];
|
||||||
|
studyCourse.setStatusTime(timestamp3.toLocalDateTime());
|
||||||
|
}
|
||||||
|
if(objs[15]!=null){
|
||||||
|
Timestamp timestamp4 = (Timestamp) objs[15];
|
||||||
|
studyCourse.setLastTime(timestamp4.toLocalDateTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!checkSet.contains(studyCourse.getCourseId())) {
|
||||||
|
Float score=(Float)objs[16];
|
||||||
|
String img=(String)objs[17];
|
||||||
|
studyCourse.setLastScore(score);
|
||||||
|
studyCourse.setCourseImage(img);
|
||||||
|
rs.add(studyCourse);
|
||||||
|
checkSet.add(studyCourse.getCourseId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return rs;
|
return rs;
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
log.error("",e);
|
log.error("",e);
|
||||||
}
|
}
|
||||||
return rs;
|
return rs;
|
||||||
@@ -317,30 +379,101 @@ public class StudyCourseServiceImpl implements IStudyCourseService{
|
|||||||
@Override
|
@Override
|
||||||
public List<StudyCourse> followids(StudyCourseQuery studyCourseQuery) {
|
public List<StudyCourse> followids(StudyCourseQuery studyCourseQuery) {
|
||||||
//当前先这样查询,以后要修改,只查询需要的字段,另外 ,需要按课程分组,不然一门课程会查出很多记录出来
|
//当前先这样查询,以后要修改,只查询需要的字段,另外 ,需要按课程分组,不然一门课程会查出很多记录出来
|
||||||
QueryBuilder builder = QueryBuilder.from(StudyCourse.class.getSimpleName()+" sc,"+ Course.class.getSimpleName()+" c");
|
// QueryBuilder builder = QueryBuilder.from(StudyCourse.class.getSimpleName()+" sc,"+ Course.class.getSimpleName()+" c");
|
||||||
builder.addFilter(FieldFilters.eqField("sc.courseId","c.id"));
|
// builder.addFilter(FieldFilters.eqField("sc.courseId","c.id"));
|
||||||
// builder.addFilter(FieldFilters.eq("c.enabled",true));
|
//// builder.addFilter(FieldFilters.eq("c.enabled",true));
|
||||||
// builder.addFilter(FieldFilters.eq("c.deleted",false));
|
//// builder.addFilter(FieldFilters.eq("c.deleted",false));
|
||||||
builder.addFilter(FieldFilters.in("sc.aid",studyCourseQuery.getAids()));
|
// builder.addFilter(FieldFilters.in("sc.aid",studyCourseQuery.getAids()));
|
||||||
builder.addFilter(FieldFilters.in("sc.courseId",studyCourseQuery.getIds()));
|
// builder.addFilter(FieldFilters.in("sc.courseId",studyCourseQuery.getIds()));
|
||||||
builder.addOrder(OrderCondition.desc("sc.lastTime"));
|
// builder.addOrder(OrderCondition.desc("sc.lastTime"));
|
||||||
builder.addFields("sc");
|
// builder.addFields("sc");
|
||||||
builder.addFields("c.score");
|
// builder.addFields("c.score");
|
||||||
builder.addFields("c.coverImg");
|
// builder.addFields("c.coverImg");
|
||||||
//List<StudyCourse> list = studyCourseDao.findList(builder.builder());
|
//List<StudyCourse> list = studyCourseDao.findList(builder.builder());
|
||||||
|
StringBuilder str=new StringBuilder();
|
||||||
|
if(!studyCourseQuery.getIds().isEmpty()){
|
||||||
|
for (String id:studyCourseQuery.getIds()){
|
||||||
|
str.append("'");
|
||||||
|
str.append(id);
|
||||||
|
str.append("'");
|
||||||
|
str.append(",");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotBlank(str)){
|
||||||
|
str.deleteCharAt(str.length()-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuilder str1=new StringBuilder();
|
||||||
|
if(!studyCourseQuery.getAids().isEmpty()){
|
||||||
|
for (String id:studyCourseQuery.getIds()){
|
||||||
|
str1.append("'");
|
||||||
|
str1.append(id);
|
||||||
|
str1.append("'");
|
||||||
|
str1.append(",");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotBlank(str)){
|
||||||
|
str1.deleteCharAt(str1.length()-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String sql="select sc.id,sc.course_id,sc.course_type,sc.course_name,sc.aid,sc.aname,sc.source,sc.add_time,sc.start_time,sc.finish_time,sc.progress," +
|
||||||
|
"sc.total_duration,sc.last_score,sc.status,sc.status_time,sc.last_time," +
|
||||||
|
"c.score,c.cover_img from boe_course as c left join boe_study_course as sc on sc.course_id=c.id where " +
|
||||||
|
"sc.aid in("+str1+") and sc.course_id in ("+str+") order by sc.last_time";
|
||||||
|
|
||||||
List<StudyCourse> rs=new ArrayList<StudyCourse>();
|
List<StudyCourse> rs=new ArrayList<StudyCourse>();
|
||||||
Set<String> checkSet=new HashSet<String>();
|
Set<String> checkSet=new HashSet<String>();
|
||||||
try {
|
try {
|
||||||
List<Object[]> list= studyCourseDao.findListFields(builder.builder());
|
// List<Object[]> list= studyCourseDao.findListFields(builder.builder());
|
||||||
|
List<Object[]> list = studyCourseDao.sqlFindList(sql);
|
||||||
for(Object[] objs:list) {
|
for(Object[] objs:list) {
|
||||||
StudyCourse sc=(StudyCourse)objs[0];
|
// StudyCourse sc=(StudyCourse)objs[0];
|
||||||
if(!checkSet.contains(sc.getCourseId())) {
|
StudyCourse studyCourse = new StudyCourse();
|
||||||
Float score=(Float)objs[1];
|
|
||||||
String img=(String)objs[2];
|
studyCourse.setId(String.valueOf((BigInteger) objs[0]));
|
||||||
sc.setLastScore(score);
|
studyCourse.setCourseId((String) objs[1]);
|
||||||
sc.setCourseImage(img);
|
studyCourse.setCourseType((Integer) objs[2]);
|
||||||
rs.add(sc);
|
studyCourse.setCourseName((String) objs[3]);
|
||||||
checkSet.add(sc.getCourseId());
|
studyCourse.setAid((String) objs[4]);
|
||||||
|
studyCourse.setAname((String) objs[5]);
|
||||||
|
studyCourse.setSource((Integer) objs[6]);
|
||||||
|
if(objs[7]!=null) {
|
||||||
|
Timestamp timestamp = (Timestamp) objs[7];
|
||||||
|
|
||||||
|
studyCourse.setAddTime(timestamp.toLocalDateTime());
|
||||||
|
}
|
||||||
|
if(objs[8]!=null){
|
||||||
|
Timestamp timestamp1 = (Timestamp) objs[8];
|
||||||
|
studyCourse.setStartTime(timestamp1.toLocalDateTime());
|
||||||
|
}
|
||||||
|
if(objs[9]!=null){
|
||||||
|
Timestamp timestamp2 = (Timestamp) objs[9];
|
||||||
|
studyCourse.setFinishTime(timestamp2.toLocalDateTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
studyCourse.setProgress((Float) objs[10]);
|
||||||
|
studyCourse.setTotalDuration((Integer) objs[11]);
|
||||||
|
studyCourse.setLastScore((Float) objs[12]);
|
||||||
|
studyCourse.setStatus((Integer) objs[13]);
|
||||||
|
if(objs[14]!=null){
|
||||||
|
Timestamp timestamp3 = (Timestamp) objs[14];
|
||||||
|
studyCourse.setStatusTime(timestamp3.toLocalDateTime());
|
||||||
|
}
|
||||||
|
if(objs[15]!=null){
|
||||||
|
Timestamp timestamp4 = (Timestamp) objs[15];
|
||||||
|
studyCourse.setLastTime(timestamp4.toLocalDateTime());
|
||||||
|
}
|
||||||
|
if(!checkSet.contains(studyCourse.getCourseId())) {
|
||||||
|
Float score=(Float)objs[16];
|
||||||
|
String img=(String)objs[17];
|
||||||
|
studyCourse.setLastScore(score);
|
||||||
|
studyCourse.setCourseImage(img);
|
||||||
|
rs.add(studyCourse);
|
||||||
|
checkSet.add(studyCourse.getCourseId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return rs;
|
return rs;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|||||||
import com.xboe.core.SysConstant;
|
import com.xboe.core.SysConstant;
|
||||||
import com.xboe.core.api.TokenProxy;
|
import com.xboe.core.api.TokenProxy;
|
||||||
import com.xboe.core.utils.OkHttpUtil;
|
import com.xboe.core.utils.OkHttpUtil;
|
||||||
|
import com.xboe.standard.BaseConstant;
|
||||||
import com.xboe.stat.IEventDataSender;
|
import com.xboe.stat.IEventDataSender;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -54,10 +55,13 @@ public class EventDataSender implements IEventDataSender{
|
|||||||
try {
|
try {
|
||||||
ObjectMapper mapper=new ObjectMapper();
|
ObjectMapper mapper=new ObjectMapper();
|
||||||
String json =mapper.writeValueAsString(params);
|
String json =mapper.writeValueAsString(params);
|
||||||
String[] headers=new String[] {"token",token};
|
//String[] headers=new String[] {"token",token};
|
||||||
|
String[] headers=new String[] {BaseConstant.HTTP_ACCESS_TOKEN,token};
|
||||||
|
|
||||||
String responseStr = okHttpUtil.doPostJson(url, json,headers);
|
String responseStr = okHttpUtil.doPostJson(url, json,headers);
|
||||||
if(responseStr.indexOf("\"status\":200")==-1) {
|
if(responseStr.indexOf("\"status\":200")==-1) {
|
||||||
log.error("发送事件失败:"+responseStr);
|
log.error("发送事件失败:"+responseStr);
|
||||||
|
log.info("【发送的token】"+headers[0]+": "+headers[1]);
|
||||||
}
|
}
|
||||||
}catch(Exception e) {
|
}catch(Exception e) {
|
||||||
log.error("发送事件错误",e);
|
log.error("发送事件错误",e);
|
||||||
|
|||||||
@@ -7,10 +7,15 @@ import java.util.Map;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
import com.xboe.system.user.vo.UserAccountVo;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import com.xboe.account.entity.Account;
|
import com.xboe.account.entity.Account;
|
||||||
import com.xboe.account.service.IAccountService;
|
import com.xboe.account.service.IAccountService;
|
||||||
@@ -29,7 +34,6 @@ import com.xboe.system.user.service.IUserService;
|
|||||||
import com.xboe.system.user.vo.UserSimpleVo;
|
import com.xboe.system.user.vo.UserSimpleVo;
|
||||||
import com.xboe.system.user.vo.UserVo;
|
import com.xboe.system.user.vo.UserVo;
|
||||||
|
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -387,6 +391,28 @@ public class UserApi extends ApiBaseController {
|
|||||||
return success(map);
|
return success(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 个人主页开或关
|
||||||
|
* */
|
||||||
|
@PostMapping("/show-home")
|
||||||
|
public JsonResponse<Boolean> showHome(String id,Boolean showHome){
|
||||||
|
if(StringUtil.isBlank(id)){
|
||||||
|
id=this.getCurrent().getAccountId();
|
||||||
|
}
|
||||||
|
if(StringUtil.isBlank(id)){
|
||||||
|
return badRequest("参数异常");
|
||||||
|
}
|
||||||
|
if(showHome==null){
|
||||||
|
return badRequest("请选择对应操作");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
service.updateShowHome(id, showHome);
|
||||||
|
return success(true);
|
||||||
|
} catch (Exception e){
|
||||||
|
return error("操作失败",e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -242,6 +242,12 @@ public class User extends IdEntity {
|
|||||||
@Column(name = "sign")
|
@Column(name = "sign")
|
||||||
private String sign;
|
private String sign;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开关
|
||||||
|
* */
|
||||||
|
@Column(name = "show_home")
|
||||||
|
private Boolean showHome;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -146,4 +146,10 @@ public interface IUserService {
|
|||||||
* 查少量字段
|
* 查少量字段
|
||||||
* */
|
* */
|
||||||
Map<String,Object> findByFiled(String id);
|
Map<String,Object> findByFiled(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开关
|
||||||
|
* */
|
||||||
|
void updateShowHome(String id,Boolean showHome);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -333,6 +333,11 @@ public class UserServiceImpl implements IUserService {
|
|||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateShowHome(String id, Boolean showHome) {
|
||||||
|
dao.updateFieldById(id,"showHome",showHome);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public User getByUserNo(String userNo) {
|
public User getByUserNo(String userNo) {
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,11 @@
|
|||||||
<artifactId>xboe-core</artifactId>
|
<artifactId>xboe-core</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.xboe</groupId>
|
||||||
|
<artifactId>xboe-redis</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</dependency>
|
||||||
<!-- java-jwt -->
|
<!-- java-jwt -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.auth0</groupId>
|
<groupId>com.auth0</groupId>
|
||||||
|
|||||||
@@ -23,7 +23,11 @@
|
|||||||
<artifactId>xboe-core</artifactId>
|
<artifactId>xboe-core</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.xboe</groupId>
|
||||||
|
<artifactId>xboe-redis</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.boe</groupId>
|
<groupId>com.boe</groupId>
|
||||||
<artifactId>httpsdk</artifactId>
|
<artifactId>httpsdk</artifactId>
|
||||||
|
|||||||
@@ -23,7 +23,11 @@
|
|||||||
<artifactId>xboe-core</artifactId>
|
<artifactId>xboe-core</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.xboe</groupId>
|
||||||
|
<artifactId>xboe-redis</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.boe</groupId>
|
<groupId>com.boe</groupId>
|
||||||
<artifactId>httpsdk</artifactId>
|
<artifactId>httpsdk</artifactId>
|
||||||
|
|||||||
@@ -22,6 +22,11 @@
|
|||||||
<artifactId>xboe-core</artifactId>
|
<artifactId>xboe-core</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.xboe</groupId>
|
||||||
|
<artifactId>xboe-redis</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</dependency>
|
||||||
<!--
|
<!--
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bitbucket.b_c</groupId>
|
<groupId>org.bitbucket.b_c</groupId>
|
||||||
|
|||||||
@@ -22,6 +22,11 @@
|
|||||||
<artifactId>xboe-core</artifactId>
|
<artifactId>xboe-core</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.xboe</groupId>
|
||||||
|
<artifactId>xboe-redis</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</dependency>
|
||||||
<!-- java-jwt -->
|
<!-- java-jwt -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.auth0</groupId>
|
<groupId>com.auth0</groupId>
|
||||||
|
|||||||
162
servers/modify-221027/pom.xml
Normal file
162
servers/modify-221027/pom.xml
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
|
<version>2.6.3</version>
|
||||||
|
<relativePath/> <!-- lookup parent from repository -->
|
||||||
|
</parent>
|
||||||
|
<groupId>com.xboe</groupId>
|
||||||
|
<artifactId>modify-221027</artifactId>
|
||||||
|
<version>2.0.0</version>
|
||||||
|
<name>modify-221027</name>
|
||||||
|
<description>修改课程考试的一个数据错误</description>
|
||||||
|
<properties>
|
||||||
|
<java.version>1.8</java.version>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.xboe</groupId>
|
||||||
|
<artifactId>xboe-core</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- java-jwt -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.auth0</groupId>
|
||||||
|
<artifactId>java-jwt</artifactId>
|
||||||
|
<version>3.18.3</version>
|
||||||
|
</dependency>
|
||||||
|
<!--
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.bitbucket.b_c</groupId>
|
||||||
|
<artifactId>jose4j</artifactId>
|
||||||
|
<version>0.7.9</version>
|
||||||
|
</dependency>
|
||||||
|
-->
|
||||||
|
<!-- apache commons -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-lang3</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-codec</groupId>
|
||||||
|
<artifactId>commons-codec</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||||
|
<!-- <artifactId>spring-boot-starter-actuator</artifactId>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
<version>5.1.27</version>
|
||||||
|
<!-- <scope>runtime</scope> -->
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--加密配置文件-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.ulisesbocchio</groupId>
|
||||||
|
<artifactId>jasypt-spring-boot-starter</artifactId>
|
||||||
|
<version>3.0.3</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<build>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
<includes>
|
||||||
|
<include>application-${profileActive}.properties</include>
|
||||||
|
<include>application.properties</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
<resource>
|
||||||
|
<filtering>false</filtering>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
<excludes>
|
||||||
|
<exclude>*.properties</exclude>
|
||||||
|
</excludes>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<source>1.8</source>
|
||||||
|
<target>1.8</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<excludes>
|
||||||
|
<exclude>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
</exclude>
|
||||||
|
</excludes>
|
||||||
|
<includeSystemScope>true</includeSystemScope>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>pro</id>
|
||||||
|
<properties>
|
||||||
|
<profileActive>pro</profileActive>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>pre</id>
|
||||||
|
<properties>
|
||||||
|
<profileActive>pre</profileActive>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>test</id>
|
||||||
|
<properties>
|
||||||
|
<profileActive>test</profileActive>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>dev</id>
|
||||||
|
<properties>
|
||||||
|
<profileActive>dev</profileActive>
|
||||||
|
</properties>
|
||||||
|
<activation>
|
||||||
|
<activeByDefault>true</activeByDefault>
|
||||||
|
</activation>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.xboe;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@SpringBootApplication
|
||||||
|
public class BoeBasicApplication {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.setProperty("jasypt.encryptor.password","jasypt");
|
||||||
|
SpringApplication.run(BoeBasicApplication.class, args);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package com.xboe;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.context.annotation.Primary;
|
||||||
|
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.JsonGenerator;
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.databind.JsonSerializer;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回的数据中如果是null 就会转化成空字符串
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class ResultNullToEmptyConfig {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
@Primary
|
||||||
|
@ConditionalOnMissingBean(ObjectMapper.class)
|
||||||
|
public ObjectMapper jacksonObjectMapper(Jackson2ObjectMapperBuilder builder) {
|
||||||
|
ObjectMapper objectMapper = builder.createXmlMapper(false).build();
|
||||||
|
objectMapper.getSerializerProvider().setNullValueSerializer(new JsonSerializer<Object>() {
|
||||||
|
@Override
|
||||||
|
public void serialize(Object o, JsonGenerator jsonGenerator, SerializerProvider serializerProvider)
|
||||||
|
throws IOException, JsonProcessingException {
|
||||||
|
jsonGenerator.writeString("");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return objectMapper;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.xboe;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.ApplicationArguments;
|
||||||
|
import org.springframework.boot.ApplicationRunner;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import com.xboe.basic.service.IModifyService;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启动执行一次
|
||||||
|
* @author seastar
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class StartRunner implements ApplicationRunner {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
IModifyService service;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(ApplicationArguments args) throws Exception {
|
||||||
|
//用于存放 kid=newId
|
||||||
|
try {
|
||||||
|
//本地 971783273423056896,971783831047385088
|
||||||
|
service.modifyCourseExamScore("971783273423056896","971783831047385088");
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("执行失败",e);
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
System.exit(0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.xboe.basic.api;
|
||||||
|
|
||||||
|
import com.xboe.core.JsonResponse;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/modify")
|
||||||
|
public class ModifyApi {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新系统查出用户 并根据老库 更新sys_depart_id,commany_id
|
||||||
|
* */
|
||||||
|
@GetMapping("/save-user")
|
||||||
|
public JsonResponse<Boolean> saveUser(){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.xboe.basic.dao;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.xboe.basic.entity.StudyCourseItem;
|
||||||
|
import com.xboe.core.orm.BaseDao;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 老系统的机构
|
||||||
|
* */
|
||||||
|
@Repository
|
||||||
|
public class StudyCourseItemDao extends BaseDao<StudyCourseItem> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.xboe.basic.dao;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.xboe.basic.entity.StudyExam;
|
||||||
|
import com.xboe.core.orm.BaseDao;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public class StudyExamDao extends BaseDao<StudyExam>{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
package com.xboe.basic.entity;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
|
import com.xboe.core.SysConstant;
|
||||||
|
import com.xboe.core.orm.IdEntity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 课程学习记录表,相当于课程学习表的子表
|
||||||
|
* */
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Table(name = SysConstant.TABLE_PRE+"study_course_item")
|
||||||
|
public class StudyCourseItem extends IdEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public static final int STATUS_NONE=1;
|
||||||
|
|
||||||
|
public static final int STATUS_STUDYING=2;
|
||||||
|
|
||||||
|
public static final int STATUS_FINISH=9;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 学习id
|
||||||
|
* */
|
||||||
|
@Column(name = "study_id",nullable=false,length = 20)
|
||||||
|
private String studyId;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 课程id
|
||||||
|
* */
|
||||||
|
@Column(name = "course_id",nullable=false,length = 20)
|
||||||
|
private String courseId;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 课程内容id
|
||||||
|
* */
|
||||||
|
@Column(name = "content_id",nullable=true,length=20)
|
||||||
|
private String contentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 内容类型,用于查询
|
||||||
|
*/
|
||||||
|
@Column(name = "content_type",length=2)
|
||||||
|
private Integer contentType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号id,记录学习人
|
||||||
|
*/
|
||||||
|
@Column(name = "aid",nullable=true,length=20)
|
||||||
|
private String aid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学习人姓名
|
||||||
|
*/
|
||||||
|
@Column(name = "aname",nullable=true,length=30)
|
||||||
|
private String aname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 内容学习的最终得分
|
||||||
|
*/
|
||||||
|
@Column(name = "score",nullable=true)
|
||||||
|
private Float score;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 学习进度
|
||||||
|
* */
|
||||||
|
@Column(name = "progress")
|
||||||
|
private Integer progress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学习状态,当前未使用 ,以学习进度100来定义是否已学完
|
||||||
|
* 1表未学习,2表学习中,9表学习完成
|
||||||
|
*/
|
||||||
|
@Column(name = "status",length=1)
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
package com.xboe.basic.entity;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
|
import com.xboe.core.SysConstant;
|
||||||
|
import com.xboe.core.orm.IdEntity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 课程考试提交记录表,此表是课程考试的记录
|
||||||
|
* */
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Table(name = SysConstant.TABLE_PRE+"study_exam")
|
||||||
|
public class StudyExam extends IdEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 学习id
|
||||||
|
* */
|
||||||
|
@Column(name = "study_id",nullable=false,length = 20)
|
||||||
|
private String studyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 内容学习记录id
|
||||||
|
*/
|
||||||
|
@Column(name = "study_item_id",nullable=false,length = 20)
|
||||||
|
private String studyItemId;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 课程id
|
||||||
|
* */
|
||||||
|
@Column(name = "course_id",nullable=false,length = 20)
|
||||||
|
private String courseId;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 内容id
|
||||||
|
* */
|
||||||
|
@Column(name = "content_id",nullable=false,length = 20)
|
||||||
|
private String contentId;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 学员id
|
||||||
|
* */
|
||||||
|
@Column(name = "student_id",nullable=false,length = 20)
|
||||||
|
private String studentId;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 学员name
|
||||||
|
* */
|
||||||
|
@Column(name = "student_name",length = 30)
|
||||||
|
private String studentName;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 对应课程考试的id
|
||||||
|
* */
|
||||||
|
@Column(name = "test_id",nullable=false,length = 20)
|
||||||
|
private String testId;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 试卷内容
|
||||||
|
* */
|
||||||
|
@Column(name = "paper_json",columnDefinition = "text")
|
||||||
|
private String paperJson;
|
||||||
|
|
||||||
|
/**本次得分 */
|
||||||
|
@Column(name = "score" ,nullable=false)
|
||||||
|
private Float score;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package com.xboe.basic.service;
|
||||||
|
|
||||||
|
public interface IModifyService {
|
||||||
|
|
||||||
|
void modifyCourseExamScore(String courseId,String testId);
|
||||||
|
}
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
package com.xboe.basic.service.impl;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.transaction.Transactional;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||||
|
import com.fasterxml.jackson.databind.JsonMappingException;
|
||||||
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.fasterxml.jackson.databind.type.CollectionType;
|
||||||
|
import com.xboe.basic.dao.StudyCourseItemDao;
|
||||||
|
import com.xboe.basic.dao.StudyExamDao;
|
||||||
|
import com.xboe.basic.entity.StudyExam;
|
||||||
|
import com.xboe.basic.service.IModifyService;
|
||||||
|
import com.xboe.core.orm.FieldFilters;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 老系统的机构
|
||||||
|
* */
|
||||||
|
@Service
|
||||||
|
public class ModifyServiceImpl implements IModifyService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
StudyExamDao sexameDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
StudyCourseItemDao scitemDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void modifyCourseExamScore(String courseId,String testId) {
|
||||||
|
|
||||||
|
ObjectMapper mapper=new ObjectMapper();
|
||||||
|
mapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY,true);
|
||||||
|
mapper.configure(DeserializationFeature.ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT,true);
|
||||||
|
mapper.enable(DeserializationFeature.ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT);
|
||||||
|
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||||
|
|
||||||
|
|
||||||
|
//String json="{\"items\":[{\"id\":\"6978553381937754113\",\"type\":102,\"score\":20,\"checked\":false,\"optShow\":false,\"content\":\"3P付薪理念指?\",\"options\":[{\"id\":\"6978553498178695168\",\"content\":\"为岗位价值付薪\",\"answer\":true,\"checked\":true},{\"id\":\"6978553498178695169\",\"content\":\"为个人差异付薪 \",\"answer\":true,\"checked\":false},{\"id\":\"6978553498178695170\",\"content\":\"为绩效付薪\",\"answer\":true,\"checked\":true},{\"id\":\"6978553498178695171\",\"content\":\"为工龄付薪\",\"answer\":false,\"checked\":false}],\"userAnswer\":[\"6978553498178695168\",\"6978553498178695169\",\"6978553498178695170\"]},{\"id\":\"6978553396823339008\",\"type\":102,\"score\":20,\"checked\":false,\"optShow\":false,\"content\":\"BOE业绩贡献薪酬主要包含?\",\"options\":[{\"id\":\"6978553618722992128\",\"content\":\"及时激励金\",\"answer\":true,\"checked\":true},{\"id\":\"6978553618722992129\",\"content\":\"绩效奖金\",\"answer\":true,\"checked\":true},{\"id\":\"6978553618722992130\",\"content\":\"年度业绩奖金\",\"answer\":true,\"checked\":true},{\"id\":\"6978553618722992131\",\"content\":\"股权激励计划\",\"answer\":true,\"checked\":true}],\"userAnswer\":[\"6978553618722992128\",\"6978553618722992129\",\"6978553618722992130\",\"6978553618722992131\"]},{\"id\":\"6978553399407030272\",\"type\":102,\"score\":20,\"checked\":false,\"optShow\":false,\"content\":\"企业年金领取条件?\",\"options\":[{\"id\":\"6978553732237635584\",\"content\":\"达到国家规定的退休年龄\",\"answer\":true,\"checked\":true},{\"id\":\"6978553732241829888\",\"content\":\"出国(境)定居\",\"answer\":true,\"checked\":true},{\"id\":\"6978553732241829889\",\"content\":\"退休前身故\",\"answer\":true,\"checked\":true},{\"id\":\"6978553732241829890\",\"content\":\"经劳动能力鉴定委员会鉴定,因病(残)完全丧失劳动能力\",\"answer\":true,\"checked\":true}],\"userAnswer\":[\"6978553732237635584\",\"6978553732241829888\",\"6978553732241829889\",\"6978553732241829890\"]},{\"id\":\"6978553744212373504\",\"type\":101,\"score\":20,\"checked\":false,\"optShow\":false,\"content\":\"考勤异常申诉每月最多可申请()次?\",\"options\":[{\"id\":\"6978553808188092416\",\"content\":\"3\",\"answer\":false,\"checked\":false},{\"id\":\"6978553808188092417\",\"content\":\"4\",\"answer\":false,\"checked\":false},{\"id\":\"6978553808188092418\",\"content\":\"5\",\"answer\":true,\"checked\":true},{\"id\":\"6978553808188092419\",\"content\":\"6\",\"answer\":false,\"checked\":false}],\"userAnswer\":\"6978553808188092418\"},{\"id\":\"6978553745848152064\",\"type\":101,\"score\":20,\"checked\":false,\"optShow\":false,\"content\":\"员工签订劳动合同后办理结婚登记的,在试用期结束后可享受婚假,同时应在办理完结婚登记后()内申请。\",\"options\":[{\"id\":\"6978553896880844800\",\"content\":\"三个月\",\"answer\":false,\"checked\":false},{\"id\":\"6978553896880844801\",\"content\":\"半年\",\"answer\":false,\"checked\":false},{\"id\":\"6978553896880844802\",\"content\":\"一年\",\"answer\":true,\"checked\":true},{\"id\":\"6978553896880844803\",\"content\":\"两年\",\"answer\":false,\"checked\":false}],\"userAnswer\":\"6978553896880844802\"}]}";
|
||||||
|
//String json="{\"items\":[{\"id\":\"6978553381937754113\",\"type\":102,\"score\":20,\"checked\":false,\"optShow\":false,\"content\":\"3P付薪理念指?\",\"options\":[{\"id\":\"6978553498178695168\",\"content\":\"为岗位价值付薪\",\"answer\":true,\"checked\":true},{\"id\":\"6978553498178695169\",\"content\":\"为个人差异付薪 \",\"answer\":true,\"checked\":false},{\"id\":\"6978553498178695170\",\"content\":\"为绩效付薪\",\"answer\":true,\"checked\":false},{\"id\":\"6978553498178695171\",\"content\":\"为工龄付薪\",\"answer\":false,\"checked\":false}],\"userAnswer\":[\"6978553498178695168\"]},{\"id\":\"6978553396823339008\",\"type\":102,\"score\":20,\"checked\":false,\"optShow\":false,\"content\":\"BOE业绩贡献薪酬主要包含?\",\"options\":[{\"id\":\"6978553618722992128\",\"content\":\"及时激励金\",\"answer\":true,\"checked\":false},{\"id\":\"6978553618722992129\",\"content\":\"绩效奖金\",\"answer\":true,\"checked\":false},{\"id\":\"6978553618722992130\",\"content\":\"年度业绩奖金\",\"answer\":true,\"checked\":false},{\"id\":\"6978553618722992131\",\"content\":\"股权激励计划\",\"answer\":true,\"checked\":true}],\"userAnswer\":[\"6978553618722992131\"]},{\"id\":\"6978553399407030272\",\"type\":102,\"score\":20,\"checked\":false,\"optShow\":false,\"content\":\"企业年金领取条件?\",\"options\":[{\"id\":\"6978553732237635584\",\"content\":\"达到国家规定的退休年龄\",\"answer\":true,\"checked\":false},{\"id\":\"6978553732241829888\",\"content\":\"出国(境)定居\",\"answer\":true,\"checked\":false},{\"id\":\"6978553732241829889\",\"content\":\"退休前身故\",\"answer\":true,\"checked\":true},{\"id\":\"6978553732241829890\",\"content\":\"经劳动能力鉴定委员会鉴定,因病(残)完全丧失劳动能力\",\"answer\":true,\"checked\":false}],\"userAnswer\":[\"6978553732241829889\"]},{\"id\":\"6978553744212373504\",\"type\":101,\"score\":20,\"checked\":false,\"optShow\":false,\"content\":\"考勤异常申诉每月最多可申请()次?\",\"options\":[{\"id\":\"6978553808188092416\",\"content\":\"3\",\"answer\":false,\"checked\":false},{\"id\":\"6978553808188092417\",\"content\":\"4\",\"answer\":false,\"checked\":false},{\"id\":\"6978553808188092418\",\"content\":\"5\",\"answer\":true,\"checked\":true},{\"id\":\"6978553808188092419\",\"content\":\"6\",\"answer\":false,\"checked\":false}],\"userAnswer\":\"6978553808188092418\"},{\"id\":\"6978553745848152064\",\"type\":101,\"score\":20,\"checked\":false,\"optShow\":false,\"content\":\"员工签订劳动合同后办理结婚登记的,在试用期结束后可享受婚假,同时应在办理完结婚登记后()内申请。\",\"options\":[{\"id\":\"6978553896880844800\",\"content\":\"三个月\",\"answer\":false,\"checked\":false},{\"id\":\"6978553896880844801\",\"content\":\"半年\",\"answer\":false,\"checked\":true},{\"id\":\"6978553896880844802\",\"content\":\"一年\",\"answer\":true,\"checked\":false},{\"id\":\"6978553896880844803\",\"content\":\"两年\",\"answer\":false,\"checked\":false}],\"userAnswer\":\"6978553896880844801\"},{\"id\":\"6991356164617457665\",\"type\":103,\"score\":5,\"checked\":false,\"optShow\":false,\"content\":\"是否\",\"options\":[{\"id\":\"6991356327297732608\",\"content\":\"正确\",\"answer\":true,\"checked\":true},{\"id\":\"6991356327297732609\",\"content\":\"错误\",\"answer\":false,\"checked\":false}],\"userAnswer\":\"6991356327297732608\"}]}";
|
||||||
|
//查询出所有的
|
||||||
|
|
||||||
|
//List<StudyExam> list = sexameDao.findList(FieldFilters.eq("courseId", courseId),FieldFilters.eq("testId", testId));
|
||||||
|
List<StudyExam> list = sexameDao.getAll();
|
||||||
|
for(StudyExam se : list) {
|
||||||
|
try {
|
||||||
|
String pageJson=se.getPaperJson();
|
||||||
|
if(StringUtils.isNotBlank(pageJson)) {
|
||||||
|
float total=countTotal(mapper,pageJson);
|
||||||
|
//System.out.println("【"+se.getId()+"】最后的得分="+total);
|
||||||
|
|
||||||
|
//更新分数
|
||||||
|
sexameDao.updateFieldById(se.getId(),"score",total);
|
||||||
|
//scitemDao.updateFieldById(se.getStudyItemId(), "score", total);
|
||||||
|
scitemDao.update("update StudyCourseItem set score=?1 where id=?2 and score<?3",total,se.getStudyItemId(),total);
|
||||||
|
}
|
||||||
|
}catch(Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// float total=countTotal(mapper,json);
|
||||||
|
// System.out.println("最后的得分="+total);
|
||||||
|
|
||||||
|
|
||||||
|
//程序自动 退出
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private float countTotal(ObjectMapper mapper,String json) throws JsonMappingException, JsonProcessingException{
|
||||||
|
|
||||||
|
JsonNode root = mapper.readTree(json);
|
||||||
|
|
||||||
|
CollectionType collectionType = mapper.getTypeFactory().constructCollectionType(ArrayList.class, PaperItem.class);
|
||||||
|
|
||||||
|
float total=0;
|
||||||
|
float uscore=0;
|
||||||
|
String jsonItems=root.get("items").toString();
|
||||||
|
//System.out.println(root.get("items").toString());
|
||||||
|
List<PaperItem> items=mapper.readValue(jsonItems, collectionType);
|
||||||
|
|
||||||
|
for(PaperItem item:items) {
|
||||||
|
if(item.getOptions()!=null && !item.getOptions().isEmpty()) {
|
||||||
|
boolean right=true;
|
||||||
|
total+=item.getScore();
|
||||||
|
for(PaperItemOption opt : item.getOptions()) {
|
||||||
|
if(!opt.getChecked() && opt.getAnswer()) {
|
||||||
|
right=false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(right){
|
||||||
|
uscore+=item.getScore();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(total!=100) {
|
||||||
|
//转化为面分制
|
||||||
|
uscore=Math.round(uscore*100/total);
|
||||||
|
}
|
||||||
|
return uscore;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.xboe.basic.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PaperItem {
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
private Integer type;
|
||||||
|
private Integer score;
|
||||||
|
private Boolean checked;
|
||||||
|
private Boolean optShow;
|
||||||
|
private String content;
|
||||||
|
//private String userAnswer;
|
||||||
|
|
||||||
|
private List<PaperItemOption> options;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.xboe.basic.service.impl;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PaperItemOption {
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
private String content;
|
||||||
|
private Boolean answer;
|
||||||
|
private Boolean checked;
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# datasource config
|
||||||
|
# basic数据库
|
||||||
|
spring.jpa.hibernate.ddl-auto=update
|
||||||
|
spring.jpa.open-in-view=false
|
||||||
|
spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true
|
||||||
|
|
||||||
|
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
||||||
|
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||||
|
# 当前数据库 basic 对应的数据库
|
||||||
|
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.password=ENC(lAoFOYuc8CAypPtigTNLYg==)
|
||||||
|
|
||||||
|
logging.level.org.hibernate.SQL=DEBUG
|
||||||
|
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
|
||||||
|
|
||||||
|
# 设置logback.xml位置
|
||||||
|
logging.config=classpath:log/logback-dev.xml
|
||||||
|
|
||||||
|
#加密盐
|
||||||
|
#jasypt.encryptor.password=jasypt
|
||||||
|
jasypt.encryptor.algorithm=PBEWithMD5AndDES
|
||||||
|
jasypt.encryptor.iv-generator-classname=org.jasypt.iv.NoIvGenerator
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# datasource config
|
||||||
|
# basic数据库
|
||||||
|
spring.jpa.hibernate.ddl-auto=update
|
||||||
|
spring.jpa.open-in-view=false
|
||||||
|
spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true
|
||||||
|
|
||||||
|
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
||||||
|
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||||
|
# 当前数据库 basic 对应的数据库
|
||||||
|
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.password=ENC(lAoFOYuc8CAypPtigTNLYg==)
|
||||||
|
|
||||||
|
logging.level.org.hibernate.SQL=DEBUG
|
||||||
|
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
|
||||||
|
|
||||||
|
# 设置logback.xml位置
|
||||||
|
logging.config=classpath:log/logback-dev.xml
|
||||||
|
|
||||||
|
#加密盐
|
||||||
|
#jasypt.encryptor.password=jasypt
|
||||||
|
jasypt.encryptor.algorithm=PBEWithMD5AndDES
|
||||||
|
jasypt.encryptor.iv-generator-classname=org.jasypt.iv.NoIvGenerator
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# datasource config
|
||||||
|
# basic数据库
|
||||||
|
spring.jpa.hibernate.ddl-auto=none
|
||||||
|
spring.jpa.open-in-view=false
|
||||||
|
spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true
|
||||||
|
|
||||||
|
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
||||||
|
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||||
|
# 当前数据库 basic 对应的数据库
|
||||||
|
spring.datasource.url=jdbc:mysql://10.251.129.126:3306/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||||
|
spring.datasource.username=admin
|
||||||
|
spring.datasource.password=boeRds01
|
||||||
|
|
||||||
|
logging.level.org.hibernate.SQL=DEBUG
|
||||||
|
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
|
||||||
|
|
||||||
|
# 设置logback.xml位置
|
||||||
|
logging.config=classpath:log/logback-dev.xml
|
||||||
|
|
||||||
|
#加密盐
|
||||||
|
#jasypt.encryptor.password=jasypt
|
||||||
|
jasypt.encryptor.algorithm=PBEWithMD5AndDES
|
||||||
|
jasypt.encryptor.iv-generator-classname=org.jasypt.iv.NoIvGenerator
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# datasource config
|
||||||
|
# basic数据库
|
||||||
|
spring.jpa.hibernate.ddl-auto=update
|
||||||
|
spring.jpa.open-in-view=false
|
||||||
|
spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true
|
||||||
|
|
||||||
|
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
||||||
|
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||||
|
# 当前数据库 basic 对应的数据库
|
||||||
|
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.password=ENC(lAoFOYuc8CAypPtigTNLYg==)
|
||||||
|
|
||||||
|
logging.level.org.hibernate.SQL=DEBUG
|
||||||
|
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
|
||||||
|
|
||||||
|
# 设置logback.xml位置
|
||||||
|
logging.config=classpath:log/logback-dev.xml
|
||||||
|
|
||||||
|
#加密盐
|
||||||
|
#jasypt.encryptor.password=jasypt
|
||||||
|
jasypt.encryptor.algorithm=PBEWithMD5AndDES
|
||||||
|
jasypt.encryptor.iv-generator-classname=org.jasypt.iv.NoIvGenerator
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
spring.profiles.active=@profileActive@
|
||||||
|
spring.application.name=boe-server-modify
|
||||||
|
server.port=9196
|
||||||
|
server.servlet.session.timeout=30m
|
||||||
|
|
||||||
|
|
||||||
|
server.servlet.encoding.charset=UTF-8
|
||||||
|
server.servlet.encoding.enabled=true
|
||||||
|
server.servlet.encoding.force=true
|
||||||
|
|
||||||
|
server.tomcat.uri-encoding=UTF-8
|
||||||
|
|
||||||
|
|
||||||
|
#spring.jackson.locale=
|
||||||
|
#spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
|
||||||
|
# spring.jackson.default-property-inclusion=NON_NULL
|
||||||
|
spring.jackson.time-zone=GMT+8
|
||||||
|
|
||||||
|
spring.servlet.multipart.max-file-size=1024MB
|
||||||
|
spring.servlet.multipart.max-request-size=1024MB
|
||||||
|
|
||||||
|
## 静态文件目录,默认是在static下面,以后独立到nginx下面配置
|
||||||
|
spring.mvc.static-path-pattern=/cdn/**
|
||||||
|
|
||||||
|
spring.redis.lettuce.pool.max-active=8
|
||||||
|
spring.redis.lettuce.pool.min-idle=0
|
||||||
|
spring.redis.lettuce.pool.max-idle=30
|
||||||
|
spring.redis.lettuce.pool.max-wait=10000ms
|
||||||
|
spring.redis.lettuce.shutdown-timeout=100ms
|
||||||
|
|
||||||
|
# 上传的临时目录,部署到服务器必须指定
|
||||||
|
# spring.servlet.multipart.location=
|
||||||
|
|
||||||
|
# jpa config
|
||||||
|
spring.jpa.database = MYSQL
|
||||||
|
spring.jpa.show-sql = true
|
||||||
|
# spring.jpa.properties.hibernate.cache.use_second_level_cache=true
|
||||||
|
# spring.jpa.properties.hibernate.cache.region.factory_class=org.hibernate.cache.ehcache.EhCacheRegionFactory
|
||||||
|
|
||||||
|
spring.jpa.properties.hibernate.naming_strategy=org.hibernate.cfg.EJB3NamingStrategy
|
||||||
|
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
|
||||||
|
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
|
||||||
|
#spring.transaction
|
||||||
|
# spring.jpa.properties.hibernate.allow_update_outside_transaction=true
|
||||||
|
# spring.jpa.properties.hibernate.current_session_context_class=org.springframework.orm.hibernate5.SpringSessionContext
|
||||||
|
spring.jpa.properties.hibernate.current_session_context_class=org.springframework.orm.hibernate5.SpringSessionContext
|
||||||
|
|
||||||
|
|
||||||
|
# 设置logback.xml位置
|
||||||
|
logging.config=classpath:log/logback-@profileActive@.xml
|
||||||
|
|
||||||
|
|
||||||
54
servers/modify-221027/src/main/resources/log/logback-dev.xml
Normal file
54
servers/modify-221027/src/main/resources/log/logback-dev.xml
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration debug="false" scan="false">
|
||||||
|
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/>
|
||||||
|
<property name="log.path" value="logs/${spring.application.name}"/>
|
||||||
|
<!-- 彩色日志格式 -->
|
||||||
|
<property name="CONSOLE_LOG_PATTERN"
|
||||||
|
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
|
||||||
|
<!-- 彩色日志依赖的渲染类 -->
|
||||||
|
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
|
||||||
|
<conversionRule conversionWord="wex"
|
||||||
|
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
|
||||||
|
<conversionRule conversionWord="wEx"
|
||||||
|
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
|
||||||
|
<!-- Console log output -->
|
||||||
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- Log file debug output -->
|
||||||
|
<appender name="debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/debug.log</file>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${log.path}/%d{yyyy-MM, aux}/debug.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||||
|
<maxFileSize>50MB</maxFileSize>
|
||||||
|
<maxHistory>30</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- Log file error output -->
|
||||||
|
<appender name="error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/error.log</file>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${log.path}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||||
|
<maxFileSize>50MB</maxFileSize>
|
||||||
|
<maxHistory>30</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||||
|
<level>ERROR</level>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
|
||||||
|
<root level="INFO">
|
||||||
|
<appender-ref ref="console"/>
|
||||||
|
</root>
|
||||||
|
</configuration>
|
||||||
55
servers/modify-221027/src/main/resources/log/logback-pro.xml
Normal file
55
servers/modify-221027/src/main/resources/log/logback-pro.xml
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration debug="false" scan="false">
|
||||||
|
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/>
|
||||||
|
<property name="log.path" value="/home/logs/${spring.application.name}"/>
|
||||||
|
<!-- 彩色日志格式 -->
|
||||||
|
<property name="CONSOLE_LOG_PATTERN"
|
||||||
|
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
|
||||||
|
<!-- 彩色日志依赖的渲染类 -->
|
||||||
|
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
|
||||||
|
<conversionRule conversionWord="wex"
|
||||||
|
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
|
||||||
|
<conversionRule conversionWord="wEx"
|
||||||
|
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
|
||||||
|
<!-- Console log output -->
|
||||||
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- Log file debug output -->
|
||||||
|
<appender name="debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/debug.log</file>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${log.path}/%d{yyyy-MM, aux}/debug.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||||
|
<maxFileSize>50MB</maxFileSize>
|
||||||
|
<maxHistory>30</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- Log file error output -->
|
||||||
|
<appender name="error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/error.log</file>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${log.path}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||||
|
<maxFileSize>50MB</maxFileSize>
|
||||||
|
<maxHistory>30</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||||
|
<level>ERROR</level>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
|
||||||
|
<root level="WARN">
|
||||||
|
<appender-ref ref="debug"/>
|
||||||
|
<appender-ref ref="error"/>
|
||||||
|
</root>
|
||||||
|
</configuration>
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration debug="false" scan="false">
|
||||||
|
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/>
|
||||||
|
<property name="log.path" value="logs/${spring.application.name}"/>
|
||||||
|
<!-- 彩色日志格式 -->
|
||||||
|
<property name="CONSOLE_LOG_PATTERN"
|
||||||
|
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
|
||||||
|
<!-- 彩色日志依赖的渲染类 -->
|
||||||
|
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
|
||||||
|
<conversionRule conversionWord="wex"
|
||||||
|
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
|
||||||
|
<conversionRule conversionWord="wEx"
|
||||||
|
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
|
||||||
|
<!-- Console log output -->
|
||||||
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- Log file debug output -->
|
||||||
|
<appender name="debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/debug.log</file>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${log.path}/%d{yyyy-MM, aux}/debug.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||||
|
<maxFileSize>50MB</maxFileSize>
|
||||||
|
<maxHistory>30</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- Log file error output -->
|
||||||
|
<appender name="error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/error.log</file>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${log.path}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||||
|
<maxFileSize>50MB</maxFileSize>
|
||||||
|
<maxHistory>30</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||||
|
<level>ERROR</level>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
|
||||||
|
<root level="INFO">
|
||||||
|
<appender-ref ref="debug"/>
|
||||||
|
<appender-ref ref="error"/>
|
||||||
|
</root>
|
||||||
|
</configuration>
|
||||||
@@ -22,6 +22,11 @@
|
|||||||
<artifactId>xboe-core</artifactId>
|
<artifactId>xboe-core</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.xboe</groupId>
|
||||||
|
<artifactId>xboe-redis</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</dependency>
|
||||||
<!-- java-jwt -->
|
<!-- java-jwt -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.auth0</groupId>
|
<groupId>com.auth0</groupId>
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
package com.xboe.primary.dao;
|
package com.xboe.primary.dao;
|
||||||
|
|
||||||
import io.lettuce.core.dynamic.annotation.Param;
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.data.jpa.repository.Modifying;
|
import org.springframework.data.jpa.repository.Modifying;
|
||||||
import org.springframework.data.jpa.repository.Query;
|
import org.springframework.data.jpa.repository.Query;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import com.xboe.primary.entity.MainAccount;
|
import com.xboe.primary.entity.MainAccount;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 账号信息DAO
|
* 账号信息DAO
|
||||||
|
|||||||
Reference in New Issue
Block a user