Commit b6d3eb29 authored by zhangqingle's avatar zhangqingle

Merge remote-tracking branch 'origin/meiteng' into zql

# Conflicts:
#	src/main/java/org/rcisoft/business/bpersonvalue/dao/BPersonValueRepository.java
#	src/main/java/org/rcisoft/business/breleasevalue/dao/BReleaseValueRepository.java
#	src/main/java/org/rcisoft/core/result/ResultServiceEnums.java
parents 510b6667 5b622b92
...@@ -691,7 +691,7 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -691,7 +691,7 @@ public class BLessonController extends PaginationController<BLesson> {
* @return * @return
* @author: zhangqingle * @author: zhangqingle
*/ */
@ApiOperation(value = "640 用户管理 - 课程情况 ", notes = "用户管理 - 课程情况 ") @ApiOperation(value = "640 用户管理 - 课程情况 ", notes = "用户管理 - 课程情况 " )
@GetMapping(value = "/userManageLessonByPagination") @GetMapping(value = "/userManageLessonByPagination")
public Result userManageLessonByPagination(CurUser curUser, @Valid UserLessonDTO userLessonDTO, BindingResult bindingResult) { public Result userManageLessonByPagination(CurUser curUser, @Valid UserLessonDTO userLessonDTO, BindingResult bindingResult) {
bLessonService.userManageLessonByPagination(getPaginationUtility(), userLessonDTO); bLessonService.userManageLessonByPagination(getPaginationUtility(), userLessonDTO);
...@@ -702,11 +702,10 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -702,11 +702,10 @@ public class BLessonController extends PaginationController<BLesson> {
gridModel); gridModel);
} }
@ApiOperation(value = "641 用户管理 - 考试情况 ", notes = "用户管理 - 考试情况 ") @ApiOperation(value = "641 用户管理 - 考试情况 ", notes = "用户管理 - 考试情况 " ,response = ExamDto.class)
@GetMapping(value = "/userManageExamByPagination") @GetMapping(value = "/userManageExamByPagination")
public Result userManageExamByPagination(CurUser curUser, @Valid UserLessonDTO userLessonDTO, BindingResult bindingResult) { public Result userManageExamByPagination(CurUser curUser, @Valid ExamQueryDto dto, BindingResult bindingResult) {
//原型不完整---查询条件不明确 bLessonService.userManageExamByPagination(getPaginationUtility(), dto);
bLessonService.userManageExamByPagination(getPaginationUtility(), userLessonDTO);
GridModel gridModel = getGridModelResponse(); GridModel gridModel = getGridModelResponse();
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
......
...@@ -408,8 +408,40 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> { ...@@ -408,8 +408,40 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
List<StudentTrackingRspDTO> userManageLesson(@Param("param") UserLessonDTO userLessonDTO, @Param("trainTypeSelStr")String trainTypeSelStr); List<StudentTrackingRspDTO> userManageLesson(@Param("param") UserLessonDTO userLessonDTO, @Param("trainTypeSelStr")String trainTypeSelStr);
@Select("") @Select("<script>" +
List<StudentTrackingRspDTO> userManageExam(); " select b.p_name paperName, b.p_duration examTime,concat(b.p_pass_score ,'/',b.p_total_score) paperScore, " +
" a.e_status paperStatus , (CASE WHEN a.e_score >= b.p_pass_score THEN '通过' ELSE '未通过' END) examResult ,a.e_score score, " +
" TIMESTAMPDIFF(MINUTE, a.e_starttime, a.e_endtime) timeCost," +
" a.e_starttime examStart, a.e_endtime examEnd,b.p_endtime PaperEndTime" +
" from tm_paper b " +
" left join tm_examdata a on a.e_pid = b.p_id " +
" left join tm_paper_link_branch plb on plb.ln_pid = b.p_id " +
" where plb.ln_buid= #{userId}" +
" and corp_id = #{corpId}" +
"<if test= \" paperName != null and paperName != ''\">and b.p_name like concat('%',#{paperName},'%') </if> " +
"<if test= \" examType != null and examType != '' and examType == '0'.toString()\"> and b.p_id not in(select e_pid from tm_examdata where e_uid = #{userId}) and now() &gt; b.p_endtime </if> " +
"<if test= \" examType != null and examType != '' and examType == '1'.toString()\"> and a.e_status = 2 or a.e_status = 1 </if> " +
"<if test= \" examType != null and examType != '' and examType == '2'.toString()\"> and b.p_id not in(select e_pid from tm_examdata where e_uid = #{userId}) and now() &lt; b.p_endtime </if> " +
"<if test= \" examType != null and examType != '' and examType == '3'.toString()\"> and a.e_status = 0 </if> " +
"<if test= \" examResult != null and examResult != '' and examResult == '0'.toString() \"> and a.e_score &lt; b.p_pass_score </if> " +
"<if test= \" examResult != null and examResult != '' and examResult == '1'.toString() \"> and a.e_score &gt;= b.p_pass_score </if> " +
"<if test= \" scoreStart != null and scoreStart != '' \"> and a.e_score &gt;= #{scoreStart} </if> " +
"<if test= \" scoreEnd != null and scoreEnd != '' \"> and a.e_score &lt;= #{scoreEnd} </if> " +
"<if test= \" consumeTimeStart != null and consumeTimeStart != '' \"> and TIMESTAMPDIFF(MINUTE, a.e_starttime, a.e_endtime) &gt;= #{consumeTimeStart} </if> " +
"<if test= \" consumeTimeEnd != null and consumeTimeEnd != '' \"> and TIMESTAMPDIFF(MINUTE, a.e_starttime, a.e_endtime) &lt;= #{consumeTimeEnd}</if> " +
"<if test= \" examTimeStart != null and examTimeStart != '' \"> and a.e_starttime &gt;= #{examTimeStart} </if> " +
"<if test= \" examTimeEnd != null and examTimeEnd != '' \"> and a.e_starttime &lt;= #{examTimeEnd} </if> " +
"<if test= \" handInTimeStart != null and handInTimeStart != '' \"> and a.e_endtime &gt;= #{handInTimeStart} </if> " +
"<if test= \" handInTimeEnd != null and handInTimeEnd != '' \"> and a.e_endtime &lt;= #{handInTimeStart} </if> " +
" ORDER BY corp_id " +
"<if test= \" scoreSort != null and scoreSort != '' and scoreSort == '0'.toString()\">, a.e_score asc </if> " +
"<if test= \" scoreSort != null and scoreSort != '' and scoreSort == '1'.toString()\">, a.e_score desc </if> " +
"<if test= \" examTimeSort != null and examTimeSort != '' and examTimeSort == '0'.toString()\">,a.e_starttime asc </if> " +
"<if test= \" examTimeSort != null and examTimeSort != '' and examTimeSort == '1'.toString()\">,a.e_starttime desc </if> " +
"<if test= \" handInTimeSort != null and handInTimeSort != '' and handInTimeSort == '0'.toString()\">,a.e_endtime asc </if> " +
"<if test= \" handInTimeSort != null and handInTimeSort != '' and handInTimeSort == '1'.toString()\">, a.e_endtime desc </if> " +
"</script>")
List<ExamDto> userManageExam(ExamQueryDto dto);
} }
package org.rcisoft.business.blesson.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
public class ExamDto {
@ApiModelProperty(value = "试卷名称")
public String paperName;
@ApiModelProperty(value = "考试时长")
public String examTime;
@ApiModelProperty(value = "及格分数/卷面分数")
public String paperScore;
@ApiModelProperty(value = "考试状态")
public String paperStatus;
@ApiModelProperty(value = "考试结果")
public String examResult;
@ApiModelProperty(value = "试卷得分")
public String score;
@ApiModelProperty(value = "考试耗时")
public String timeCost;
@ApiModelProperty(value = "开考时间")
public Date examStart;
@ApiModelProperty(value = "交卷时间")
public Date examEnd;
public Date PaperEndTime;
}
package org.rcisoft.business.blesson.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
public class ExamQueryDto {
@ApiModelProperty(value = "试卷名",required = true)
private String paperName;
@ApiModelProperty(value = "考试状态 0待参加 1已完成 2已失效 3进行中 ",required = true)
private String examType;
@ApiModelProperty(value = "考试结果 0通过 1未通过",required = true)
private String examResult;
@ApiModelProperty(value = "考试分数起始",required = true)
private String scoreStart;
@ApiModelProperty(value = "考试分数截止",required = true)
private String scoreEnd;
@ApiModelProperty(value = "考试耗时起始",required = true)
private String consumeTimeStart;
@ApiModelProperty(value = "考试耗时截止",required = true)
private String consumeTimeEnd;
@ApiModelProperty(value = "开考时间起始",required = true)
private Date examTimeStart;
@ApiModelProperty(value = "开考时间截止",required = true)
private Date examTimeEnd;
@ApiModelProperty(value = "交卷时间起始",required = true)
private Date handInTimeStart;
@ApiModelProperty(value = "交卷时间截止",required = true)
private Date handInTimeEnd;
@ApiModelProperty(value = "试卷得分排序 0正序 1倒序",required = true)
private String scoreSort;
@ApiModelProperty(value = "开考时间排序 0正序 1倒序",required = true)
private String examTimeSort;
@ApiModelProperty(value = "交卷时间排序 0正序 1倒序",required = true)
private String handInTimeSort;
@ApiModelProperty(value = "企业id",required = true)
private String corpId;
@ApiModelProperty(value = "用户id",required = true)
private String userId;
}
...@@ -299,6 +299,6 @@ public interface BLessonService{ ...@@ -299,6 +299,6 @@ public interface BLessonService{
*/ */
List<StudentTrackingRspDTO> userManageLessonByPagination(PageUtil pageUtil, UserLessonDTO userLessonDTO); List<StudentTrackingRspDTO> userManageLessonByPagination(PageUtil pageUtil, UserLessonDTO userLessonDTO);
List<StudentTrackingRspDTO> userManageExamByPagination(PageUtil pageUtil, UserLessonDTO userLessonDTO); List<ExamDto> userManageExamByPagination(PageUtil pageUtil, ExamQueryDto dto);
} }
...@@ -1354,8 +1354,27 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -1354,8 +1354,27 @@ public class BLessonServiceImpl implements BLessonService {
} }
@Override @Override
public List<StudentTrackingRspDTO> userManageExamByPagination(PageUtil pageUtil, UserLessonDTO userLessonDTO) { public List<ExamDto> userManageExamByPagination(PageUtil pageUtil, ExamQueryDto dto) {
return bLessonPersonRepository.userManageExam(); List<ExamDto> list = bLessonPersonRepository.userManageExam(dto);
if(list.size()>0){
for(ExamDto examDto : list){
//考试状态 0待参加 1已完成 2已失效 3进行中
if(examDto.getPaperStatus() == null && examDto.getPaperEndTime().after(new Date())){
examDto.setPaperStatus("待参加");
examDto.setExamResult(null);
}else if(examDto.getPaperStatus() == null && examDto.getPaperEndTime().before(new Date())) {
examDto.setPaperStatus("已失效");
examDto.setExamResult(null);
}else if("1".equals(examDto.getPaperStatus()) || "2".equals(examDto.getPaperStatus())){
examDto.setPaperStatus("已完成");
}else if("0".equals(examDto.getPaperStatus())){
examDto.setPaperStatus("进行中");
examDto.setScore(null);
examDto.setExamResult(null);
}
}
}
return list;
} }
//遍历标签放入List中 //遍历标签放入List中
......
...@@ -23,8 +23,8 @@ public interface BPersonValueRepository extends BaseMapper<BPersonValue> { ...@@ -23,8 +23,8 @@ public interface BPersonValueRepository extends BaseMapper<BPersonValue> {
@Select("<script>" + @Select("<script>" +
"select * from b_person_value where del_flag != 1 and flag = 1 " + "select * from b_person_value where del_flag != 1 and flag = 1 " +
"and person_id = #{businessId} " + "and person_id = #{businessId} " +
"<if test=\"startTime !=null and startTime != '' \"> and create_date &lt;= #{startTime} </if> "+ "<if test=\"startTime !=null and startTime != '' \"> and create_date &gt;= #{startTime} </if> "+
"<if test=\"endTime !=null and endTime != '' \"> and create_date &gt;= #{endTime} </if> "+ "<if test=\"endTime !=null and endTime != '' \"> and create_date &lt;= #{endTime} </if> "+
"<if test=\"event !=null and event != '' \"> and `event` like concat('%',#{event},'%') </if> "+ "<if test=\"event !=null and event != '' \"> and `event` like concat('%',#{event},'%') </if> "+
// "<if test=\"type !=null and type != '' \"> and event like concat('%',#{event},'%') </if> "+ // "<if test=\"type !=null and type != '' \"> and event like concat('%',#{event},'%') </if> "+
...@@ -49,6 +49,7 @@ public interface BPersonValueRepository extends BaseMapper<BPersonValue> { ...@@ -49,6 +49,7 @@ public interface BPersonValueRepository extends BaseMapper<BPersonValue> {
@Update(" update s_user set \n" + @Update(" update s_user set \n" +
"`value`=((select sum(`value`) from b_person_value where del_flag != 1 and flag = 1 and type = 0 and person_id = #{personId} )-\n" + "`value`=((select sum(`value`) from b_person_value where del_flag != 1 and flag = 1 and type = 0 and person_id = #{personId} )-\n" +
"(select sum(`value`) from b_person_value where del_flag != 1 and flag = 1 and type = 1 and person_id = #{personId} ))\n" + "(select sum(`value`) from b_person_value where del_flag != 1 and flag = 1 and type = 1 and person_id = #{personId} ))\n" +
", lock_num = lock_num+1 " +
"where business_id = #{personId} and corp_id = #{corpId}") "where business_id = #{personId} and corp_id = #{corpId}")
int updateUserValue(@Param("personId")String personId,@Param("corpId")String corpId); int updateUserValue(@Param("personId")String personId,@Param("corpId")String corpId);
......
...@@ -3,6 +3,8 @@ package org.rcisoft.business.bpersonvalue.dto; ...@@ -3,6 +3,8 @@ package org.rcisoft.business.bpersonvalue.dto;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date;
@Data @Data
public class PersonValueClientDto { public class PersonValueClientDto {
...@@ -10,10 +12,10 @@ public class PersonValueClientDto { ...@@ -10,10 +12,10 @@ public class PersonValueClientDto {
public String businessId; public String businessId;
@ApiModelProperty(value = "起始时间") @ApiModelProperty(value = "起始时间")
public String startTime; public Date startTime;
@ApiModelProperty(value = "结束时间") @ApiModelProperty(value = "结束时间")
public String endTime; public Date endTime;
@ApiModelProperty(value = "事件") @ApiModelProperty(value = "事件")
public String event; public String event;
......
...@@ -93,7 +93,8 @@ public interface BReleaseValueRepository extends BaseMapper<BReleaseValue> { ...@@ -93,7 +93,8 @@ public interface BReleaseValueRepository extends BaseMapper<BReleaseValue> {
* @return * @return
*/ */
@Select("<script>" + @Select("<script>" +
"select bl.business_id businessId,bl.lesson_name lessonName,su.name name,bl.value_consume valueConsume,bl.value_gain valueGain " + "select bl.business_id businessId,bl.lesson_name lessonName,su.name name," +
"bl.value_consume valueConsume,bl.value_gain valueGain ,bl.value_update_date updateDate " +
"from b_lesson bl " + "from b_lesson bl " +
"left join s_user su on su.business_id = bl.lecturer_id " + "left join s_user su on su.business_id = bl.lecturer_id " +
"where bl.del_flag !=1 and bl.flag = 1 " + "where bl.del_flag !=1 and bl.flag = 1 " +
...@@ -115,7 +116,7 @@ public interface BReleaseValueRepository extends BaseMapper<BReleaseValue> { ...@@ -115,7 +116,7 @@ public interface BReleaseValueRepository extends BaseMapper<BReleaseValue> {
* @param valueGain * @param valueGain
* @return * @return
*/ */
@Update("update b_lesson set value_consume = #{valueConsume} ,value_gain = #{valueGain} where business_id = #{businessId}") @Update("update b_lesson set value_consume = #{valueConsume} ,value_gain = #{valueGain} ,value_update_date = now() where business_id = #{businessId}")
int updateLessonValue(@Param("businessId") String businessId,@Param("valueConsume") String valueConsume,@Param("valueGain") String valueGain); int updateLessonValue(@Param("businessId") String businessId,@Param("valueConsume") String valueConsume,@Param("valueGain") String valueGain);
/** /**
...@@ -124,7 +125,7 @@ public interface BReleaseValueRepository extends BaseMapper<BReleaseValue> { ...@@ -124,7 +125,7 @@ public interface BReleaseValueRepository extends BaseMapper<BReleaseValue> {
* @param userList * @param userList
* @return * @return
*/ */
@Select("<script>select business_id, name , `value` ," + @Select("<script>select business_id businessId, name , `value` ," +
"(select sum(`value`) from b_person_value where person_id = s_user.business_id and type = 0) valueGain " + "(select sum(`value`) from b_person_value where person_id = s_user.business_id and type = 0) valueGain " +
" from s_user " + " from s_user " +
" where 1=1 and del_flag !=1 and flag = 1 " + " where 1=1 and del_flag !=1 and flag = 1 " +
......
...@@ -2,6 +2,8 @@ package org.rcisoft.business.breleasevalue.dto; ...@@ -2,6 +2,8 @@ package org.rcisoft.business.breleasevalue.dto;
import lombok.Data; import lombok.Data;
import java.util.Date;
@Data @Data
public class LessonValueDto { public class LessonValueDto {
...@@ -14,4 +16,6 @@ public class LessonValueDto { ...@@ -14,4 +16,6 @@ public class LessonValueDto {
public String valueConsume; public String valueConsume;
public String valueGain; public String valueGain;
public Date updateDate;
} }
...@@ -14,16 +14,52 @@ import java.util.List; ...@@ -14,16 +14,52 @@ import java.util.List;
* Created by on 2019-11-13 13:28:38. * Created by on 2019-11-13 13:28:38.
*/ */
public interface BReleaseValueService { public interface BReleaseValueService {
/**
* 添加、编辑发布积分组
* @param bReleaseValueDto
* @return
*/
PersistModel save (BReleaseValueDto bReleaseValueDto); PersistModel save (BReleaseValueDto bReleaseValueDto);
/**
* 分页查询发布积分组
* @param pageUtil
* @param dto
* @return
*/
List<BReleaseValue> queryByPagination(PageUtil pageUtil, ReleaseValueResDto dto); List<BReleaseValue> queryByPagination(PageUtil pageUtil, ReleaseValueResDto dto);
/**
* 删除发布积分组
* @param businessId
* @param corpId
* @return
*/
PersistModel delete (String businessId ,String corpId); PersistModel delete (String businessId ,String corpId);
/**
* 分页查询课程、培训积分设置页面
* @param pageUtil
* @param curUser
* @param dto
* @return
*/
List<LessonValueDto> queryLessonValueByPagination(PageUtil pageUtil, CurUser curUser, LessonValueSettingQueryDto dto); List<LessonValueDto> queryLessonValueByPagination(PageUtil pageUtil, CurUser curUser, LessonValueSettingQueryDto dto);
/**
* 编辑课程、培训积分
* @param businessId
* @param valueConsume
* @param valueGain
* @return
*/
PersistModel updateLessonValue (String businessId, String valueConsume,String valueGain); PersistModel updateLessonValue (String businessId, String valueConsume,String valueGain);
/**
* 分页查询用户积分统计页面
* @param pageUtil
* @param dto
* @return
*/
List<UserValueDto> queryUserValueByPagination(PageUtil pageUtil, UserValueResDto dto); List<UserValueDto> queryUserValueByPagination(PageUtil pageUtil, UserValueResDto dto);
} }
...@@ -241,7 +241,8 @@ public enum ResultServiceEnums { ...@@ -241,7 +241,8 @@ public enum ResultServiceEnums {
VALUE_IS_ERROR(141,"扣除积分大于当前积分"), VALUE_IS_ERROR(141,"扣除积分大于当前积分"),
USER_IS_NULL(142,"请选择用户"), USER_IS_NULL(142,"请选择用户"),
NUM_IS_ERROR(143,"积分输入格式错误"), NUM_IS_ERROR(143,"积分输入格式错误"),
VALUE_NOT_ENOUGH(144,"积分输入格式错误"), NOT_USE_ADMIN_ROLE(144,"该用户是管理员,不能分配其他角色"),
VALUE_NOT_ENOUGH(145,"积分输入格式错误"),
; ;
private Integer code; private Integer code;
......
...@@ -185,7 +185,10 @@ public class SysUserServiceImpl implements SysUserService { ...@@ -185,7 +185,10 @@ public class SysUserServiceImpl implements SysUserService {
List<String> userIds = asList(StringUtils.split(userId, ",")); List<String> userIds = asList(StringUtils.split(userId, ","));
List<String> roleIds = asList(StringUtils.split(roleId, ",")); List<String> roleIds = asList(StringUtils.split(roleId, ","));
List<UserRole> userRoles = new ArrayList<>(); List<UserRole> userRoles = new ArrayList<>();
//清空userrole中关于ids的所有数据 //清空user_role中关于ids的所有数据
if(userIds.size() == 0){
throw new ServiceException(ResultServiceEnums.NOT_USE_ADMIN_ROLE);
}
sysUserMapper.delUserRoleById(userIds); sysUserMapper.delUserRoleById(userIds);
for (int i = 0; i < roleIds.size(); i++) { for (int i = 0; i < roleIds.size(); i++) {
for (int j = 0; j < userIds.size(); j++) { for (int j = 0; j < userIds.size(); j++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment