优化成员的代码模块
This commit is contained in:
parent
a875905347
commit
f4195efe59
@ -50,59 +50,6 @@ public class MemberProjectController {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 负责人对成员进行允许和拒绝的操作
|
||||
* @param map
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/memberOperateByPrincipal")
|
||||
@PreAuthorize("hasAnyAuthority('auth_administor','auth_general_user')")
|
||||
public String memberOperateByPrincipal(@RequestBody Map map,@RequestHeader(value="Authorization") String token){
|
||||
String projectNumber = (String) map.get("projectNumber");
|
||||
String keepType = (String) map.get("keepType");
|
||||
Integer userId = (Integer) map.get("userId");
|
||||
// 获取区域信息
|
||||
Locale locale = LocaleContextHolder.getLocale();
|
||||
// 验证token
|
||||
String tokenUserName = TokenUtil.getTokenUserName(token);
|
||||
SysUserEntity sysUserByUserName = sysUserService.getSysUserByUserName(tokenUserName);
|
||||
if(sysUserByUserName == null){
|
||||
return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale);
|
||||
}
|
||||
if("1".equals(keepType)){
|
||||
memberProjectService.memberByAllow(projectNumber,userId);
|
||||
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"已允许加入",locale);
|
||||
}else {
|
||||
memberProjectService.memberByRefuse(projectNumber,userId);
|
||||
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"已拒绝加入",locale);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询成员的加入申请
|
||||
* @param projectNumber
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/selectMemberApplication")
|
||||
@PreAuthorize("hasAnyAuthority('auth_administor','auth_general_user')")
|
||||
public String selectMemberApplication(@RequestParam("projectNumber") String projectNumber,@RequestHeader(value="Authorization") String token){
|
||||
// 获取区域信息
|
||||
Locale locale = LocaleContextHolder.getLocale();
|
||||
// 验证token
|
||||
String tokenUserName = TokenUtil.getTokenUserName(token);
|
||||
SysUserEntity sysUserByUserName = sysUserService.getSysUserByUserName(tokenUserName);
|
||||
if(sysUserByUserName == null){
|
||||
return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale);
|
||||
}
|
||||
List<MemberApplicationVo> memberApplicationVos = memberProjectService.selectMemberApplication(projectNumber);
|
||||
if(memberApplicationVos == null || memberApplicationVos.size() == 0){
|
||||
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时还没有任何加入的申请",locale);
|
||||
}
|
||||
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,memberApplicationVos,locale);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询该项目加入的成员的信息
|
||||
* @param projectNumber
|
||||
|
@ -26,27 +26,6 @@ public interface MemberProjectService {
|
||||
*/
|
||||
String memberDropOut(String projectNumber,String token);
|
||||
|
||||
/**
|
||||
* 成员被允许加入
|
||||
* @param projectNumber
|
||||
* @param userId
|
||||
*/
|
||||
void memberByAllow(String projectNumber,Integer userId);
|
||||
|
||||
/**
|
||||
* 成员被拒绝加入
|
||||
* @param projectNumber
|
||||
* @param userId
|
||||
*/
|
||||
void memberByRefuse(String projectNumber,Integer userId);
|
||||
|
||||
/**
|
||||
* 查询成员的加入申请
|
||||
* @param projectNumber
|
||||
* @return
|
||||
*/
|
||||
List<MemberApplicationVo> selectMemberApplication(String projectNumber);
|
||||
|
||||
/**
|
||||
* 查询加入的成员的信息
|
||||
* @param projectNumber
|
||||
@ -60,11 +39,4 @@ public interface MemberProjectService {
|
||||
* @return
|
||||
*/
|
||||
List<String> selectProjectNumberByMemberId(Integer userId);
|
||||
|
||||
/**
|
||||
* 查询待审核的项目的编号
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<String> selectProjectNumberByMemberIds(Integer userId);
|
||||
}
|
||||
|
@ -112,53 +112,6 @@ public class MemberProjectServiceImpl implements MemberProjectService {
|
||||
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"退出成功",locale);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------------------*
|
||||
/**
|
||||
* 成员被允许加入
|
||||
* @param projectNumber
|
||||
* @param userId
|
||||
*/
|
||||
@Transactional(rollbackOn = Exception.class)
|
||||
@Override
|
||||
public void memberByAllow(String projectNumber,Integer userId) {
|
||||
WorkHourRecord workHourRecord = new WorkHourRecord();
|
||||
workHourRecord.setWorkContent("优化");
|
||||
workHourRecord.setWorkHour(0);
|
||||
workHourRecord.setUserId(userId);
|
||||
workHourRecord.setProjectNumber(projectNumber);
|
||||
workHourRecord.setColor("1");
|
||||
workHourRecord.setSubmitTime(DateTimeUtil.dateTimeToString(LocalDateTime.now()));
|
||||
workHourRecordDao.save(workHourRecord);
|
||||
memberProjectDao.updateApplicationType("1",projectNumber);
|
||||
memberProjectDao.updateJoinTime(DateTimeUtil.dateTimeToString(LocalDateTime.now()),projectNumber);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成员被拒绝加入
|
||||
* @param projectNumber
|
||||
* @param userId
|
||||
*/
|
||||
@Transactional(rollbackOn = Exception.class)
|
||||
@Override
|
||||
public void memberByRefuse(String projectNumber,Integer userId) {
|
||||
memberProjectDao.updateApplicationType("2",projectNumber);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询成员的加入申请
|
||||
* @param projectNumber
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<MemberApplicationVo> selectMemberApplication(String projectNumber) {
|
||||
return memberProjectDao.selectMemberApplication(projectNumber);
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------*
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询加入的成员的信息
|
||||
* @param projectNumber
|
||||
@ -180,19 +133,4 @@ public class MemberProjectServiceImpl implements MemberProjectService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------*
|
||||
/**
|
||||
* 查询待审核项目的编号
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<String> selectProjectNumberByMemberIds(Integer userId) {
|
||||
return memberProjectDao.selectProjectNumberByMemberId(userId,"0");
|
||||
}
|
||||
//-----------------------------------------------------------------------------*
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user