将管理员拒绝负责人申请的代码模块修改为管理员撤回授权的功能
This commit is contained in:
parent
87b0aec13a
commit
166d34bcd2
@ -77,4 +77,11 @@ public interface ResponsibleProjectDao extends JpaRepository<ResponsibleProject,
|
||||
*/
|
||||
@Query(value = "select responsible_project_number from responsible_project where principal_id = ?1 and audit_type = ?2",nativeQuery = true)
|
||||
List<String> selectProjectNumberByPrincipalId(Integer userId,String auditType);
|
||||
|
||||
/**
|
||||
* 根据项目编号删除信息
|
||||
* @param projectNumber
|
||||
*/
|
||||
@Modifying(clearAutomatically=true)
|
||||
void deleteByResponsibleProjectNumber(String projectNumber);
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ public interface ResponsibleProjectService {
|
||||
* @param projectNumber
|
||||
* @param userId
|
||||
*/
|
||||
void adminRefuse(String projectNumber,Integer userId);
|
||||
String adminRefuse(String projectNumber,Integer userId);
|
||||
|
||||
/**
|
||||
* 负责人移除成员
|
||||
|
@ -159,29 +159,23 @@ public class ResponsibleProjectServiceImpl implements ResponsibleProjectService
|
||||
// 修改项目的授权状态
|
||||
projectOverviewDao.updateAuthorizationType("1",projectNumber);
|
||||
responsibleProjectDao.save(responsibleProject1);
|
||||
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);
|
||||
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"授权成功",locale);
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员拒绝负责人的申请
|
||||
* 管理员撤销该项目的授权
|
||||
* @param projectNumber
|
||||
* @param userId
|
||||
*/
|
||||
@Transactional(rollbackOn = Exception.class)
|
||||
@Override
|
||||
public void adminRefuse(String projectNumber,Integer userId) {
|
||||
// 修改中间表的申请状态为2(表示负责人提交的申请被拒绝)
|
||||
responsibleProjectDao.updateAuditType("2",projectNumber);
|
||||
// 修改项目表中的状态为0(表示负责人提交的申请被拒绝,项目变成未开始状态)
|
||||
projectOverviewDao.updateProjectStatus("0",projectNumber);
|
||||
public String adminRefuse(String projectNumber,Integer userId) {
|
||||
Locale locale = LocaleContextHolder.getLocale();
|
||||
// 删除负责人表中对应的项目
|
||||
responsibleProjectDao.deleteByResponsibleProjectNumber(projectNumber);
|
||||
// 修改项目表中的授权状态为0(表示负责人提交的申请被拒绝,项目变成未开始状态)
|
||||
projectOverviewDao.updateAuthorizationType("0",projectNumber);
|
||||
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"撤销授权成功",locale);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user