用户信息接口修正
Some checks failed
JslGroup/JslDeveloper/JSL_OrganizeInternalOA/pipeline/head There was a failure building this commit
Some checks failed
JslGroup/JslDeveloper/JSL_OrganizeInternalOA/pipeline/head There was a failure building this commit
This commit is contained in:
parent
a854c41f24
commit
1864f90fe0
@ -42,11 +42,9 @@ public class ProjectController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/project/get/custom")
|
||||
public BaseResponse projectGetCustom(@RequestParam(required = false) Integer id,
|
||||
@RequestParam(required = false) List<String> tags,
|
||||
@RequestParam(required = false) Integer isFinish){
|
||||
public BaseResponse projectGetCustom(@RequestParam(required = false) Integer id){
|
||||
log.info("请求接口[GET]: /project/all/get");
|
||||
return projectService.tget(id,tags,isFinish);
|
||||
return projectService.tget(id);
|
||||
}
|
||||
|
||||
|
||||
|
@ -214,14 +214,8 @@ public class ProjectDAO {
|
||||
}
|
||||
|
||||
|
||||
public List<ProjectDO> tget(Integer id, List<String> tags, Integer isFinish) {
|
||||
public List<ProjectDO> tget(Integer id) {
|
||||
log.info("DAO层");
|
||||
if(isFinish != null){
|
||||
return projectMapper.tgetByIsfinish(isFinish);
|
||||
}
|
||||
if(tags != null && !tags.isEmpty()){
|
||||
return projectMapper.tgetByTags(tags);
|
||||
}
|
||||
return projectMapper.tget(id);
|
||||
}
|
||||
}
|
||||
|
@ -77,6 +77,14 @@ public class RoleDAO {
|
||||
|
||||
}
|
||||
|
||||
public RoleDO getRoleNameByUid(Long uid){
|
||||
log.info("\t> 执行 DAO 层 RoleDAO.getRoleNameByUid 方法");
|
||||
log.info("\t\t> 从 MySQL 获取数据");
|
||||
RoleDO roleDO = roleMapper.getRoleById(getRoleUserByUid(uid).getRid());
|
||||
return roleDO;
|
||||
}
|
||||
|
||||
|
||||
public boolean roleEdit(RoleDO getRole) {
|
||||
log.info("\t> 执行 DAO 层 RoleDAO.roleEdit 方法");
|
||||
log.info("\t\t> 从 MySQL 获取数据");
|
||||
|
@ -97,10 +97,4 @@ public interface ProjectMapper {
|
||||
|
||||
//@Select("select * from organize_oa.oa_project where is_delete=false and status=1")
|
||||
List<ProjectDO> tget(Integer id);
|
||||
|
||||
@Select("select * from organize_oa.oa_project where is_finish=#{isFinish} and is_delete=false")
|
||||
List<ProjectDO> tgetByIsfinish(Integer isFinish);
|
||||
|
||||
|
||||
List<ProjectDO> tgetByTags(List<String> tags);
|
||||
}
|
||||
|
@ -1,27 +1,16 @@
|
||||
package com.jsl.oa.model.doData;
|
||||
/*
|
||||
张睿相 Java
|
||||
*/
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
/**
|
||||
* 总体描述
|
||||
* <p>创建时间:2024/3/11 21:54</p>
|
||||
*
|
||||
* @author 张睿相
|
||||
* @since v1.0
|
||||
*/
|
||||
public class ProjectWorkDO {
|
||||
private Long id;
|
||||
private Long pid;
|
||||
private Long projectId;
|
||||
private Long principalId;
|
||||
private Integer cycle;
|
||||
private Integer workLoad;
|
||||
private Integer type;
|
||||
private String name;
|
||||
private String description;
|
||||
private Integer isDelete;
|
||||
private Integer isFinish;
|
||||
private boolean status;
|
||||
private Timestamp beginTime;
|
||||
private Timestamp completeTime;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,30 +1,16 @@
|
||||
package com.jsl.oa.model.voData;
|
||||
/*
|
||||
张睿相 Java
|
||||
*/
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
@Data
|
||||
/**
|
||||
* 总体描述
|
||||
* <p>创建时间:2024/3/11 21:54</p>
|
||||
*
|
||||
* @author 张睿相
|
||||
* @since v1.0
|
||||
*/
|
||||
public class ProjectWorkVO {
|
||||
|
||||
private Long pid;
|
||||
@NotNull(message = "项目id不能为空")
|
||||
private Long projectId;
|
||||
@NotNull(message = "负责人id不能为空")
|
||||
private Long principalId;
|
||||
@NotNull(message = "周期不能为空")
|
||||
private Integer cycle;
|
||||
|
||||
private Integer workLoad;
|
||||
@NotNull(message = "类型不能为空")
|
||||
private Integer type;
|
||||
@NotNull(message = "名字不能为空")
|
||||
private String name;
|
||||
private String description;
|
||||
private Integer isDelete;
|
||||
private Integer isFinish;
|
||||
private Integer status;
|
||||
private Timestamp beginTime;
|
||||
private Timestamp completeTime;
|
||||
}
|
||||
|
||||
|
||||
|
@ -17,6 +17,7 @@ public class UserProfileVo {
|
||||
private String nickname;
|
||||
private String sex;
|
||||
private String description;
|
||||
private String role;
|
||||
|
||||
}
|
||||
|
||||
|
@ -40,5 +40,5 @@ public interface ProjectService {
|
||||
|
||||
BaseResponse projecWorktAdd(HttpServletRequest request, ProjectWorkVO projectWorkVO);
|
||||
|
||||
BaseResponse tget(Integer id, List<String> tags, Integer isFinish);
|
||||
BaseResponse tget(Integer id);
|
||||
}
|
||||
|
@ -61,21 +61,9 @@ public class ProjectServiceImpl implements ProjectService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse tget(Integer id, List<String> tags, Integer isFinish) {
|
||||
public BaseResponse tget(Integer id) {
|
||||
log.info("\t> 执行 Service 层 ProjectService.tget 方法");
|
||||
|
||||
//根据状态查询
|
||||
if(isFinish != null){
|
||||
List<ProjectDO> projectDOList = projectDAO.tget(id,tags,isFinish);
|
||||
return ResultUtil.success(projectDOList);
|
||||
}
|
||||
//根据标签查询
|
||||
if(tags != null && !tags.isEmpty()){
|
||||
List<ProjectDO> projectDOList = projectDAO.tget(id,tags,isFinish);
|
||||
return ResultUtil.success(projectDOList);
|
||||
}
|
||||
|
||||
List<ProjectDO> projectDOList = projectDAO.tget(id,tags,isFinish);
|
||||
List<ProjectDO> projectDOList = projectDAO.tget(id);
|
||||
return ResultUtil.success(projectDOList);
|
||||
}
|
||||
|
||||
|
@ -257,16 +257,12 @@ public class UserServiceImpl implements UserService {
|
||||
@Override
|
||||
public BaseResponse userProfileGet(HttpServletRequest request) {
|
||||
log.info("\t> 执行 Service 层 UserService.userProfileGet 方法");
|
||||
//判断用户是否为 老师 或 管理员
|
||||
if(!Processing.checkUserIsAdmin(request,roleDAO.roleMapper) &&
|
||||
!Processing.checkUserIsTeacher(request,roleDAO.roleMapper)){
|
||||
return ResultUtil.error(ErrorCode.NOT_PERMISSION);
|
||||
}
|
||||
|
||||
// 获取用户Id
|
||||
UserDO userDO = userDAO.getUserById(Processing.getAuthHeaderToUserId(request));
|
||||
UserProfileVo userProfileVo = new UserProfileVo();
|
||||
Processing.copyProperties(userDO, userProfileVo);
|
||||
userProfileVo.setRole(roleDAO.getRoleNameByUid(userDO.getId()).getDisplayName());
|
||||
userProfileVo.setSex(Processing.getSex(userDO.getSex()));
|
||||
return ResultUtil.success(userProfileVo);
|
||||
}
|
||||
|
@ -48,21 +48,22 @@
|
||||
</update>
|
||||
|
||||
<select id="getByTags" resultType="com.jsl.oa.model.doData.ProjectDO">
|
||||
select * from organize_oa.oa_project where is_delete=false and principal_id=#{userId} and json_extract(tags,'$.tags') like concat
|
||||
<foreach collection="tags" item="tag" separator=",'%') or json_extract(tags,'$.tags') like concat('%',"
|
||||
open="('%," close=",'%')">
|
||||
select * from organize_oa.oa_project where
|
||||
<foreach collection="tags" item="tag" separator=",'%') and json_extract(tags,'$.tags')like concat('%',"
|
||||
open="json_extract(tags,'$.tags')like concat('%',"
|
||||
close=",'%') and is_delete=false and principal_id=#{userId}">
|
||||
#{tag}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="workgetByTags" resultType="com.jsl.oa.model.doData.ProjectWorkDO">
|
||||
select * from organize_oa.oa_project_work where is_delete=false and principal_id=#{userId} and json_extract(tags,'$.tags') like concat
|
||||
<foreach collection="tags" item="tag" separator=",'%') or json_extract(tags,'$.tags') like concat('%',"
|
||||
open="('%'," close=",'%')">
|
||||
select * from organize_oa.oa_project_work where
|
||||
<foreach collection="tags" item="tag" separator=",'%') and json_extract(tags,'$.tags')like concat('%',"
|
||||
open="json_extract(tags,'$.tags')like concat('%',"
|
||||
close=",'%') and is_delete=false and principal_id=#{userId}">
|
||||
#{tag}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="tget" resultType="com.jsl.oa.model.doData.ProjectDO">
|
||||
select * from organize_oa.oa_project where is_delete=false
|
||||
<if test="id != null">
|
||||
@ -70,12 +71,4 @@
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="tgetByTags" resultType="com.jsl.oa.model.doData.ProjectDO">
|
||||
select * from organize_oa.oa_project where is_delete=false and json_extract(tags,'$.tags') like concat
|
||||
<foreach collection="tags" item="tag" separator=",'%') or json_extract(tags,'$.tags') like concat('%',"
|
||||
open="('%'," close=",'%')">
|
||||
#{tag}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
x
Reference in New Issue
Block a user