Commit c205450c authored by zhangqingle's avatar zhangqingle

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

parents cae017db f8010709
...@@ -69,12 +69,12 @@ public class BPersonValueController extends PaginationController<BPersonValue> { ...@@ -69,12 +69,12 @@ public class BPersonValueController extends PaginationController<BPersonValue> {
@ApiOperation(value = "1603 用户明细带总积分", notes = " 用户明细带总积分", response = BPersonValue.class) @ApiOperation(value = "1603 用户明细带总积分", notes = " 用户明细带总积分", response = BPersonValue.class)
@GetMapping(value = "/queryPersonValueByPagination") @GetMapping(value = "/queryPersonValueByPagination")
@ApiImplicitParam(name = "businessId", value = "用户id", required = true, dataType = "varchar") @ApiImplicitParam(name = "businessId", value = "用户id", required = true, dataType = "varchar")
public Result queryPersonValueByPagination(CurUser curUser,String businessId) { public Result queryPersonValueByPagination(CurUser curUser) {
bPersonValueServiceImpl.queryByPagination(getPaginationUtility(), curUser.getCorpId(),businessId); bPersonValueServiceImpl.queryByPagination(getPaginationUtility(), curUser.getCorpId(),curUser.getUserId());
GridModel gridModel = getGridModelResponse(); GridModel gridModel = getGridModelResponse();
Map<String,Object> map = new HashedMap(); Map<String,Object> map = new HashedMap();
map.put("details",gridModel); map.put("details",gridModel);
map.put("userValue",bPersonValueServiceImpl.getUserValue(curUser.getCorpId(),businessId)); map.put("userValue",bPersonValueServiceImpl.getUserValue(curUser.getCorpId(),curUser.getUserId()));
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
......
...@@ -10,6 +10,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -10,6 +10,7 @@ import lombok.extern.slf4j.Slf4j;
import org.rcisoft.business.bbanner.dto.FindBannerPaginDTO; import org.rcisoft.business.bbanner.dto.FindBannerPaginDTO;
import org.rcisoft.business.bbanner.entity.BBanner; import org.rcisoft.business.bbanner.entity.BBanner;
import org.rcisoft.business.breleasevalue.dto.BReleaseValueDto; import org.rcisoft.business.breleasevalue.dto.BReleaseValueDto;
import org.rcisoft.business.breleasevalue.dto.LessonValueSettingQueryDto;
import org.rcisoft.common.controller.PaginationController; import org.rcisoft.common.controller.PaginationController;
import org.rcisoft.common.model.GridModel; import org.rcisoft.common.model.GridModel;
import org.rcisoft.sys.user.bean.CurUser; import org.rcisoft.sys.user.bean.CurUser;
...@@ -76,11 +77,9 @@ public class BReleaseValueController extends PaginationController<BReleaseValue> ...@@ -76,11 +77,9 @@ public class BReleaseValueController extends PaginationController<BReleaseValue>
} }
@ApiOperation(value="1504 分页查询课程、培训积分设置页面", notes="分页查询课程、培训积分设置页面") @ApiOperation(value="1504 分页查询课程、培训积分设置页面", notes="分页查询课程、培训积分设置页面")
@ApiImplicitParams({@ApiImplicitParam(name = "keyWord", value = "模糊查询关键字", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "type", value = "0课程 1培训", required = true, dataType = "varchar")})
@GetMapping(value = "/queryLessonValue") @GetMapping(value = "/queryLessonValue")
public Result queryLessonValue(CurUser curUser, String keyWord,String type ) { public Result queryLessonValue(CurUser curUser, @Valid LessonValueSettingQueryDto dto ,BindingResult bindingResult) {
bReleaseValueServiceImpl.queryLessonValueByPagination(getPaginationUtility(),keyWord,curUser.getCorpId(),type); bReleaseValueServiceImpl.queryLessonValueByPagination(getPaginationUtility(),curUser,dto);
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,
......
...@@ -2,10 +2,12 @@ package org.rcisoft.business.breleasevalue.dao; ...@@ -2,10 +2,12 @@ package org.rcisoft.business.breleasevalue.dao;
import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.*;
import org.rcisoft.business.breleasevalue.dto.LessonValueDto; import org.rcisoft.business.breleasevalue.dto.LessonValueDto;
import org.rcisoft.business.breleasevalue.dto.LessonValueSettingQueryDto;
import org.rcisoft.business.breleasevalue.dto.UserValueDto; import org.rcisoft.business.breleasevalue.dto.UserValueDto;
import org.rcisoft.business.breleasevalue.entity.BReleaseValueSon; import org.rcisoft.business.breleasevalue.entity.BReleaseValueSon;
import org.rcisoft.core.base.BaseMapper; import org.rcisoft.core.base.BaseMapper;
import org.rcisoft.business.breleasevalue.entity.BReleaseValue; import org.rcisoft.business.breleasevalue.entity.BReleaseValue;
import org.rcisoft.sys.user.bean.CurUser;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -71,20 +73,25 @@ public interface BReleaseValueRepository extends BaseMapper<BReleaseValue> { ...@@ -71,20 +73,25 @@ public interface BReleaseValueRepository extends BaseMapper<BReleaseValue> {
/** /**
* 查询课程或培训积分设置 * 查询课程或培训积分设置
* @param keyWord * @param curUser
* @param corpId * @param dto
* @param type
* @return * @return
*/ */
@Select("<script> select bl.business_id businessId,bl.lesson_name lessonName,su.name name,bl.value_consume valueConsume,bl.value_gain valueGain " + @Select("<script>" +
" from b_lesson bl " + "select bl.business_id businessId,bl.lesson_name lessonName,su.name name,bl.value_consume valueConsume,bl.value_gain valueGain " +
" left join s_user su on su.business_id = bl.lecturer_id " + "from b_lesson bl " +
" where bl.del_flag !=1 and bl.flag = 1 " + "left join s_user su on su.business_id = bl.lecturer_id " +
"<if test=\"keyWord!=null and keyWord != ''\"> " + "where bl.del_flag !=1 and bl.flag = 1 " +
" and bl.lesson_name like concat('%',#{keyWord},'%') or su.name like concat('%',#{keyWord},'%') </if>" + "<if test=\"dto.valueConsumeStart!=null and dto.valueConsumeStart != ''\"> and bl.value_consume &gt;= #{dto.valueConsumeStart} </if> " +
" and bl.corp_id = #{corpId} " + "<if test=\"dto.valueConsumeEnd!=null and dto.valueConsumeEnd != ''\"> and bl.value_consume &lt;= #{dto.valueConsumeEnd} </if> " +
"and bl.lesson_type = #{type}</script>") "<if test=\"dto.valueGainStart!=null and dto.valueGainStart != ''\"> and bl.value_gain &gt;= #{dto.valueGainStart} </if> " +
List<LessonValueDto> getLessonValue(@Param("keyWord") String keyWord, @Param("corpId")String corpId, @Param("type")String type); "<if test=\"dto.valueGainEnd!=null and dto.valueGainEnd != ''\"> and bl.value_gain &lt;= #{dto.valueGainEnd} </if> " +
"<if test=\"dto.lessonName!=null and dto.lessonName != ''\"> and bl.lesson_name like concat('%',#{dto.lessonName},'%') </if> " +
"<if test=\"dto.lecturerName!=null and dto.lecturerName != ''\"> and su.`name` like concat('%',#{dto.lecturerName},'%') </if> " +
"and bl.corp_id = #{curUser.corpId} " +
"and bl.lesson_type = #{dto.type} " +
"</script>")
List<LessonValueDto> getLessonValue(@Param("curUser") CurUser curUser, @Param("dto") LessonValueSettingQueryDto dto);
/** /**
* 设置课程或培训 积分 * 设置课程或培训 积分
......
package org.rcisoft.business.breleasevalue.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class LessonValueSettingQueryDto {
@ApiModelProperty(value = "课程、培训名")
public String lessonName;
@ApiModelProperty(value = "讲师名")
public String lecturerName;
@ApiModelProperty(value = "积分消耗起始值")
public String valueConsumeStart;
@ApiModelProperty(value = "积分消耗最大值")
public String valueConsumeEnd;
@ApiModelProperty(value = "积分获得起始值")
public String valueGainStart;
@ApiModelProperty(value = "积分获得最大值")
public String valueGainEnd;
@ApiModelProperty(value = "0 课程 1培训")
public String type;
}
...@@ -4,10 +4,12 @@ import org.rcisoft.business.bbanner.dto.FindBannerPaginDTO; ...@@ -4,10 +4,12 @@ import org.rcisoft.business.bbanner.dto.FindBannerPaginDTO;
import org.rcisoft.business.bbanner.entity.BBanner; import org.rcisoft.business.bbanner.entity.BBanner;
import org.rcisoft.business.breleasevalue.dto.BReleaseValueDto; import org.rcisoft.business.breleasevalue.dto.BReleaseValueDto;
import org.rcisoft.business.breleasevalue.dto.LessonValueDto; import org.rcisoft.business.breleasevalue.dto.LessonValueDto;
import org.rcisoft.business.breleasevalue.dto.LessonValueSettingQueryDto;
import org.rcisoft.business.breleasevalue.dto.UserValueDto; import org.rcisoft.business.breleasevalue.dto.UserValueDto;
import org.rcisoft.business.breleasevalue.entity.BReleaseValue; import org.rcisoft.business.breleasevalue.entity.BReleaseValue;
import org.rcisoft.core.model.PersistModel; import org.rcisoft.core.model.PersistModel;
import org.rcisoft.core.aop.PageUtil; import org.rcisoft.core.aop.PageUtil;
import org.rcisoft.sys.user.bean.CurUser;
import java.util.List; import java.util.List;
...@@ -22,7 +24,7 @@ public interface BReleaseValueService { ...@@ -22,7 +24,7 @@ public interface BReleaseValueService {
PersistModel delete (String businessId ,String corpId); PersistModel delete (String businessId ,String corpId);
List<LessonValueDto> queryLessonValueByPagination(PageUtil pageUtil,String keyWord,String corpId,String LessonType ); List<LessonValueDto> queryLessonValueByPagination(PageUtil pageUtil, CurUser curUser, LessonValueSettingQueryDto dto);
PersistModel updateLessonValue (String businessId, String valueConsume,String valueGain); PersistModel updateLessonValue (String businessId, String valueConsume,String valueGain);
......
...@@ -2,11 +2,14 @@ package org.rcisoft.business.breleasevalue.service.impl; ...@@ -2,11 +2,14 @@ package org.rcisoft.business.breleasevalue.service.impl;
import org.rcisoft.business.breleasevalue.dto.BReleaseValueDto; import org.rcisoft.business.breleasevalue.dto.BReleaseValueDto;
import org.rcisoft.business.breleasevalue.dto.LessonValueDto; import org.rcisoft.business.breleasevalue.dto.LessonValueDto;
import org.rcisoft.business.breleasevalue.dto.LessonValueSettingQueryDto;
import org.rcisoft.business.breleasevalue.dto.UserValueDto; import org.rcisoft.business.breleasevalue.dto.UserValueDto;
import org.rcisoft.business.breleasevalue.entity.BReleaseValueSon; import org.rcisoft.business.breleasevalue.entity.BReleaseValueSon;
import org.rcisoft.common.util.feignDto.MTUserGetsReqDTO; import org.rcisoft.common.util.feignDto.MTUserGetsReqDTO;
import org.rcisoft.common.util.feignDto.MTUserInfoRspDTO; import org.rcisoft.common.util.feignDto.MTUserInfoRspDTO;
import org.rcisoft.common.util.outClient.MTCotactApiRequestClient; import org.rcisoft.common.util.outClient.MTCotactApiRequestClient;
import org.rcisoft.core.exception.ServiceException;
import org.rcisoft.core.result.ResultServiceEnums;
import org.rcisoft.core.util.IdGen; import org.rcisoft.core.util.IdGen;
import org.rcisoft.core.util.UserUtil; import org.rcisoft.core.util.UserUtil;
import org.rcisoft.core.aop.PageUtil; import org.rcisoft.core.aop.PageUtil;
...@@ -16,6 +19,7 @@ import org.rcisoft.business.breleasevalue.entity.BReleaseValue; ...@@ -16,6 +19,7 @@ import org.rcisoft.business.breleasevalue.entity.BReleaseValue;
import org.rcisoft.business.breleasevalue.service.BReleaseValueService; import org.rcisoft.business.breleasevalue.service.BReleaseValueService;
import org.rcisoft.sys.user.bean.CurUser;
import org.rcisoft.sys.user.entity.SysUser; import org.rcisoft.sys.user.entity.SysUser;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -86,8 +90,24 @@ public class BReleaseValueServiceImpl implements BReleaseValueService { ...@@ -86,8 +90,24 @@ public class BReleaseValueServiceImpl implements BReleaseValueService {
} }
@Override @Override
public List<LessonValueDto> queryLessonValueByPagination(PageUtil pageUtil,String keyWord, String corpId, String LessonType) { public List<LessonValueDto> queryLessonValueByPagination(PageUtil pageUtil, CurUser curUser, LessonValueSettingQueryDto dto) {
return bReleaseValueRepository.getLessonValue(keyWord, corpId, LessonType); try{
if(dto.getValueConsumeEnd()!=null && !"".equals(dto.getValueConsumeEnd())){
Integer.parseInt(dto.getValueConsumeEnd());
}
if(dto.getValueConsumeStart()!=null && !"".equals(dto.getValueConsumeStart())){
Integer.parseInt(dto.getValueConsumeStart());
}
if(dto.getValueGainEnd()!=null && !"".equals(dto.getValueGainEnd())){
Integer.parseInt(dto.getValueGainEnd());
}
if(dto.getValueGainStart()!=null && !"".equals(dto.getValueGainStart())){
Integer.parseInt(dto.getValueGainStart());
}
}catch (Exception e){
throw new ServiceException(ResultServiceEnums.NUM_IS_ERROR);
}
return bReleaseValueRepository.getLessonValue(curUser,dto);
} }
@Override @Override
......
...@@ -240,6 +240,7 @@ public enum ResultServiceEnums { ...@@ -240,6 +240,7 @@ public enum ResultServiceEnums {
NOT_TRAIN_TYPE(140,"课程类型不正确"), NOT_TRAIN_TYPE(140,"课程类型不正确"),
VALUE_IS_ERROR(141,"扣除积分大于当前积分"), VALUE_IS_ERROR(141,"扣除积分大于当前积分"),
USER_IS_NULL(142,"请选择用户"), USER_IS_NULL(142,"请选择用户"),
NUM_IS_ERROR(143,"积分输入格式错误"),
; ;
private Integer code; private Integer code;
......
...@@ -15,6 +15,9 @@ public class QuerySysUserDTO { ...@@ -15,6 +15,9 @@ public class QuerySysUserDTO {
@ApiModelProperty(value = "用户启用状态 0未启用 1启用") @ApiModelProperty(value = "用户启用状态 0未启用 1启用")
private String flag; private String flag;
@ApiModelProperty(value = "0 包含子部门 1不包含子部门")
private String type;
@ApiModelProperty(value = "用户角色") @ApiModelProperty(value = "用户角色")
private String roleName; private String roleName;
......
...@@ -33,6 +33,7 @@ import org.springframework.stereotype.Service; ...@@ -33,6 +33,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.lang.reflect.Array;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.Instant; import java.time.Instant;
...@@ -77,15 +78,39 @@ public class SysUserServiceImpl implements SysUserService { ...@@ -77,15 +78,39 @@ public class SysUserServiceImpl implements SysUserService {
*/ */
public List<SysUser> qusers(QuerySysUserDTO dto) { public List<SysUser> qusers(QuerySysUserDTO dto) {
//step1:调用外部接口 查询出 该部门下所有人(取id) //step1:调用外部接口 查询出 该部门下所有人(取id)
if("0".equals(dto.getType())){ //包含子部门
if(dto.getDept()!=null){ if(dto.getDept()!=null){
List<String> deptIds = new ArrayList<>(); List<String> deptIds = new ArrayList<>();
StringBuffer stringBuffer = new StringBuffer();
String ids = "";
deptIds.add(dto.getDept()); deptIds.add(dto.getDept());
Set<String> deptSets = new HashSet<String>(deptIds); Set<String> deptSets = new HashSet<>(deptIds);
List<String> data = mtCotactApiRequestClient.getSubUserIdsByDeptIds(dto.getCorpId(), deptSets); List<String> data = mtCotactApiRequestClient.getSubUserIdsByDeptIds(dto.getCorpId(), deptSets);
if(data.size() != 0){
dto.setUserIds(data); dto.setUserIds(data);
}else{
dto.setUserIds(Arrays.asList(""));
} }
}
}else{ //不包含子部门
if(dto.getDept()!=null){
List<Long> deptIds = new ArrayList<>();
deptIds.add(Long.parseLong(dto.getDept()));
List<MTGetUserByDeptIdsRspDTO> data = mtCotactApiRequestClient.userGetUserByDeptIds(dto.getCorpId(),deptIds);
List<String> uids = new ArrayList<>();
if(data != null ){
for (MTGetUserByDeptIdsRspDTO uid : data) {
uids.add(uid.getId());
}
if(uids.size() != 0){
dto.setUserIds(uids);
}else{
dto.setUserIds(Arrays.asList(""));
}
}else{
dto.setUserIds(Arrays.asList(""));
}
}
}
//step2:先查出符合条件的所有人 //step2:先查出符合条件的所有人
List<SysUser> users = sysUserMapper.queryUsers(dto); List<SysUser> users = sysUserMapper.queryUsers(dto);
......
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