|
@@ -12,8 +12,12 @@ import com.ningdatech.basic.util.CollUtils; |
|
|
import com.ningdatech.basic.util.NdDateUtils; |
|
|
import com.ningdatech.basic.util.NdDateUtils; |
|
|
import com.ningdatech.pmapi.common.constant.BizConst; |
|
|
import com.ningdatech.pmapi.common.constant.BizConst; |
|
|
import com.ningdatech.pmapi.common.constant.CommonConst; |
|
|
import com.ningdatech.pmapi.common.constant.CommonConst; |
|
|
|
|
|
import com.ningdatech.pmapi.common.constant.RegionConst; |
|
|
|
|
|
import com.ningdatech.pmapi.common.helper.RegionCacheHelper; |
|
|
import com.ningdatech.pmapi.common.util.ExcelDownUtil; |
|
|
import com.ningdatech.pmapi.common.util.ExcelDownUtil; |
|
|
import com.ningdatech.pmapi.common.util.ExcelExportStyle; |
|
|
import com.ningdatech.pmapi.common.util.ExcelExportStyle; |
|
|
|
|
|
import com.ningdatech.pmapi.datascope.model.DataScopeDTO; |
|
|
|
|
|
import com.ningdatech.pmapi.datascope.utils.DataScopeUtil; |
|
|
import com.ningdatech.pmapi.gov.model.entity.GovBizProjectApply; |
|
|
import com.ningdatech.pmapi.gov.model.entity.GovBizProjectApply; |
|
|
import com.ningdatech.pmapi.gov.model.entity.GovBizProjectApprove; |
|
|
import com.ningdatech.pmapi.gov.model.entity.GovBizProjectApprove; |
|
|
import com.ningdatech.pmapi.gov.model.entity.GovBizProjectBaseinfo; |
|
|
import com.ningdatech.pmapi.gov.model.entity.GovBizProjectBaseinfo; |
|
@@ -32,16 +36,19 @@ import com.ningdatech.pmapi.projectlib.model.dto.ProjectRenewalFundDeclarationDT |
|
|
import com.ningdatech.pmapi.projectlib.model.entity.Project; |
|
|
import com.ningdatech.pmapi.projectlib.model.entity.Project; |
|
|
import com.ningdatech.pmapi.projectlib.model.entity.ProjectRenewalFundDeclaration; |
|
|
import com.ningdatech.pmapi.projectlib.model.entity.ProjectRenewalFundDeclaration; |
|
|
import com.ningdatech.pmapi.projectlib.model.po.ProjectRenewalFundDeclarationPO; |
|
|
import com.ningdatech.pmapi.projectlib.model.po.ProjectRenewalFundDeclarationPO; |
|
|
|
|
|
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; |
|
|
import com.ningdatech.pmapi.projectlib.model.req.ProjectRenewalAuditReq; |
|
|
import com.ningdatech.pmapi.projectlib.model.req.ProjectRenewalAuditReq; |
|
|
import com.ningdatech.pmapi.projectlib.model.req.ProjectRenewalListReq; |
|
|
import com.ningdatech.pmapi.projectlib.model.req.ProjectRenewalListReq; |
|
|
import com.ningdatech.pmapi.projectlib.model.vo.AnnualAmountVO; |
|
|
import com.ningdatech.pmapi.projectlib.model.vo.AnnualAmountVO; |
|
|
import com.ningdatech.pmapi.projectlib.model.vo.ProjectRenewalFundDeclarationVO; |
|
|
import com.ningdatech.pmapi.projectlib.model.vo.ProjectRenewalFundDeclarationVO; |
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectRenewalFundDeclarationService; |
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectRenewalFundDeclarationService; |
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectService; |
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectService; |
|
|
|
|
|
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; |
|
|
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; |
|
|
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; |
|
|
import com.ningdatech.pmapi.user.util.LoginUserUtil; |
|
|
import com.ningdatech.pmapi.user.util.LoginUserUtil; |
|
|
import com.wflow.exception.BusinessException; |
|
|
import com.wflow.exception.BusinessException; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.springframework.beans.BeanUtils; |
|
|
import org.springframework.beans.BeanUtils; |
|
|
import org.springframework.stereotype.Component; |
|
|
import org.springframework.stereotype.Component; |
|
@@ -49,6 +56,7 @@ import org.springframework.stereotype.Component; |
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
import java.io.IOException; |
|
|
import java.io.IOException; |
|
|
import java.time.LocalDateTime; |
|
|
import java.time.LocalDateTime; |
|
|
|
|
|
import java.util.Collection; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.Objects; |
|
|
import java.util.Objects; |
|
|
import java.util.Optional; |
|
|
import java.util.Optional; |
|
@@ -64,6 +72,7 @@ import java.util.stream.Collectors; |
|
|
*/ |
|
|
*/ |
|
|
@Component |
|
|
@Component |
|
|
@RequiredArgsConstructor |
|
|
@RequiredArgsConstructor |
|
|
|
|
|
@Slf4j |
|
|
public class ProjectRenewalFundManage { |
|
|
public class ProjectRenewalFundManage { |
|
|
|
|
|
|
|
|
private final IProjectRenewalFundDeclarationService projectRenewalFundDeclarationService; |
|
|
private final IProjectRenewalFundDeclarationService projectRenewalFundDeclarationService; |
|
@@ -78,13 +87,16 @@ public class ProjectRenewalFundManage { |
|
|
|
|
|
|
|
|
private final IGovBizProjectApproveService approveService; |
|
|
private final IGovBizProjectApproveService approveService; |
|
|
|
|
|
|
|
|
|
|
|
private final RegionCacheHelper regionCacheHelper; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 项目续建资金库列表 分页 |
|
|
* 项目续建资金库列表 分页 |
|
|
* @param req |
|
|
* @param req |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
public PageVo<ProjectRenewalFundDeclarationVO> list(ProjectRenewalListReq req) { |
|
|
|
|
|
|
|
|
public PageVo<ProjectRenewalFundDeclarationVO> list(ProjectRenewalListReq req, UserFullInfoDTO user) { |
|
|
Page<ProjectRenewalFundDeclarationPO> page = req.page(); |
|
|
Page<ProjectRenewalFundDeclarationPO> page = req.page(); |
|
|
|
|
|
req = buildProjectLibPermission(req,user); |
|
|
projectRenewalFundDeclarationService.pageSql(page, req); |
|
|
projectRenewalFundDeclarationService.pageSql(page, req); |
|
|
long total; |
|
|
long total; |
|
|
if ((total = page.getTotal()) == 0) { |
|
|
if ((total = page.getTotal()) == 0) { |
|
@@ -446,4 +458,49 @@ public class ProjectRenewalFundManage { |
|
|
throw new RuntimeException(e); |
|
|
throw new RuntimeException(e); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ProjectRenewalListReq buildProjectLibPermission(ProjectRenewalListReq req, UserFullInfoDTO user) { |
|
|
|
|
|
Optional<DataScopeDTO> currentUserDataScope = DataScopeUtil.getCurrentUserDataScope(user); |
|
|
|
|
|
if (!currentUserDataScope.isPresent()) { |
|
|
|
|
|
log.warn("没有取到权限信息 当前查询 没有权限条件"); |
|
|
|
|
|
return req; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
switch (currentUserDataScope.get().getRole()) { |
|
|
|
|
|
case NORMAL_MEMBER: |
|
|
|
|
|
//普通用户 只能看到自己单位去申报的 |
|
|
|
|
|
req.setUserType("normal"); |
|
|
|
|
|
req.setUserValue(user.getEmpPosUnitCode()); |
|
|
|
|
|
break; |
|
|
|
|
|
case COMPANY_MANAGER: |
|
|
|
|
|
//单位管理员 看到自己单位去申报的 + 待预审的主管单位是自己单位的项目 |
|
|
|
|
|
req.setUserType("org"); |
|
|
|
|
|
req.setUserValue(user.getEmpPosUnitCode()); |
|
|
|
|
|
break; |
|
|
|
|
|
case SUPER_ADMIN: |
|
|
|
|
|
//超级管理员 看到丽水全市的 并且也要判断他 同时是不是单位管理员 |
|
|
|
|
|
break; |
|
|
|
|
|
case REGION_MANAGER: |
|
|
|
|
|
//区域管理员 看到自己区域的项目 如果是市本级 就看全市的 |
|
|
|
|
|
if (RegionConst.RC_LS.equals(user.getRegionCode())) { |
|
|
|
|
|
Collection<String> regionCodes = regionCacheHelper.listChildRegionCodeList(user.getRegionCode(), |
|
|
|
|
|
RegionConst.RL_CITY); |
|
|
|
|
|
req.setRegionCodes(regionCodes); |
|
|
|
|
|
} else { |
|
|
|
|
|
req.setUserRegionCode(user.getRegionCode()); |
|
|
|
|
|
} |
|
|
|
|
|
req.setUserType("region"); |
|
|
|
|
|
break; |
|
|
|
|
|
case VISITOR: |
|
|
|
|
|
//访客可以看全市的 |
|
|
|
|
|
break; |
|
|
|
|
|
case DASHBOARD: |
|
|
|
|
|
break; |
|
|
|
|
|
default: |
|
|
|
|
|
//没有权限的话 就让它查不到 |
|
|
|
|
|
req.setId(0L); |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
return req; |
|
|
|
|
|
} |
|
|
} |
|
|
} |