3、 修改了管理员允许负责人申请项目的功能模块,将其修改为管理员把项目授权给某个人
This commit is contained in:
parent
374b53ba9b
commit
87b0aec13a
@ -22,6 +22,15 @@ public interface ProjectOverviewDao extends JpaRepository<ProjectOverview,Long>,
|
||||
@Modifying(clearAutomatically=true)
|
||||
void updateProjectStatus(String projectStatus,String projectNumber);
|
||||
|
||||
/**
|
||||
* 修改项目的授权状态
|
||||
* @param authorizationType
|
||||
* @param projectNumber
|
||||
*/
|
||||
@Query(value = "update project_overview set authorization_type = ?1 where project_number = ?2",nativeQuery = true)
|
||||
@Modifying(clearAutomatically=true)
|
||||
void updateAuthorizationType(String authorizationType,String projectNumber);
|
||||
|
||||
/**
|
||||
* 根据项目编号查询项目的信息
|
||||
* @param projectNumber
|
||||
|
@ -46,7 +46,7 @@ public interface ResponsibleProjectService {
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
void adminAllow(String projectNumber,Integer userId);
|
||||
String adminAllow(String projectNumber,Integer userId);
|
||||
|
||||
/**
|
||||
* 管理员对负责人进行拒绝的操作
|
||||
|
@ -125,6 +125,8 @@ public class MemberProjectServiceImpl implements MemberProjectService {
|
||||
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"退出成功",locale);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------------------*
|
||||
/**
|
||||
* 成员被允许加入
|
||||
@ -166,9 +168,10 @@ public class MemberProjectServiceImpl implements MemberProjectService {
|
||||
public List<MemberApplicationVo> selectMemberApplication(String projectNumber) {
|
||||
return memberProjectDao.selectMemberApplication(projectNumber);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------*
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询加入的成员的信息
|
||||
* @param projectNumber
|
||||
|
@ -41,6 +41,9 @@ public class ResponsibleProjectServiceImpl implements ResponsibleProjectService
|
||||
|
||||
@Resource
|
||||
private WorkHourRecordDao workHourRecordDao;
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------*
|
||||
/**
|
||||
* 负责人点击开始
|
||||
* @param responsibleProjectNumber
|
||||
@ -128,16 +131,34 @@ public class ResponsibleProjectServiceImpl implements ResponsibleProjectService
|
||||
ApplicationProjectVo applicationProjectVo = responsibleProjectDao.selectApplicationInformation(projectNumber);
|
||||
return applicationProjectVo;
|
||||
}
|
||||
// --------------------------------------------------------------------------*
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 管理员允许负责人申请通过
|
||||
* 管理员把项目授权给加入该项目的某个成员
|
||||
* @param projectNumber
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Transactional(rollbackOn = Exception.class)
|
||||
@Override
|
||||
public void adminAllow(String projectNumber,Integer userId) {
|
||||
public String adminAllow(String projectNumber,Integer userId) {
|
||||
Locale locale = LocaleContextHolder.getLocale();
|
||||
ProjectOverview byProjectNumber = projectOverviewDao.findByProjectNumber(projectNumber);
|
||||
if(byProjectNumber.getAuthorizationType().equals("1")){
|
||||
return outputEncapsulationObject(PromptMessageEnum.DATA_WRONG,"该项目已有负责人",locale);
|
||||
}
|
||||
// 负责人点击开始,项目提交申请
|
||||
ResponsibleProject responsibleProject1 = new ResponsibleProject();
|
||||
responsibleProject1.setPrincipalId(userId);
|
||||
responsibleProject1.setResponsibleProjectNumber(projectNumber);
|
||||
responsibleProject1.setApplicationTime(DateTimeUtil.dateTimeToString(LocalDateTime.now()));
|
||||
responsibleProject1.setAuditType("1");
|
||||
responsibleProject1.setStartTime(DateTimeUtil.dateTimeToString(LocalDateTime.now()));
|
||||
// 修改项目的授权状态
|
||||
projectOverviewDao.updateAuthorizationType("1",projectNumber);
|
||||
responsibleProjectDao.save(responsibleProject1);
|
||||
WorkHourRecord workHourRecord = new WorkHourRecord();
|
||||
workHourRecord.setWorkContent("优化");
|
||||
workHourRecord.setWorkHour(0);
|
||||
@ -146,11 +167,7 @@ public class ResponsibleProjectServiceImpl implements ResponsibleProjectService
|
||||
workHourRecord.setColor("1");
|
||||
workHourRecord.setSubmitTime(DateTimeUtil.dateTimeToString(LocalDateTime.now()));
|
||||
workHourRecordDao.save(workHourRecord);
|
||||
// 修改中间表的申请状态为1(表示审核通过)
|
||||
responsibleProjectDao.updateAuditType("1",projectNumber);
|
||||
responsibleProjectDao.updateStartTime(DateTimeUtil.dateTimeToString(LocalDateTime.now()),projectNumber);
|
||||
// 修改项目表中的项目状态为1(表示填报中)
|
||||
projectOverviewDao.updateProjectStatus("1",projectNumber);
|
||||
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"授权成功",locale);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user