Parcourir la source

Merge remote-tracking branch 'origin/master'

master
CMM il y a 1 an
Parent
révision
f59cc3faad
9 fichiers modifiés avec 75 ajouts et 13 suppressions
  1. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/common/helper/UserInfoHelper.java
  2. +11
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java
  3. +18
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java
  4. +2
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/DeclaredStatisticsMapper.java
  5. +17
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/DeclaredStatisticsMapper.xml
  6. +2
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/IDeclaredStatisticsService.java
  7. +13
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/DeclaredStatisticsServiceImpl.java
  8. +0
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java
  9. +7
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/workbench/manage/WorkbenchManage.java

+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/common/helper/UserInfoHelper.java Voir le fichier

@@ -24,4 +24,9 @@ public interface UserInfoHelper {

String getUserName(Long userId);

/**
* 判断该用户是否是区管或者超管
* @return
*/
boolean isAdmin(Long userId);
}

+ 11
- 0
pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java Voir le fichier

@@ -37,4 +37,15 @@ public class UserInfoHelperImpl implements UserInfoHelper {
String realName = userFullInfo.getRealName();
return realName;
}

/**
* 判断此人是否是超管或者区管
* @param userId
* @return
*/
@Override
public boolean isAdmin(Long userId) {
//测试 先返回true
return Boolean.TRUE;
}
}

+ 18
- 4
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java Voir le fichier

@@ -85,11 +85,17 @@ public class DefaultDeclaredProjectManage {
BigDecimal totalAmount = govSuperFinanceAmount
.add(govOwnFinanceAmount).add(bankLendingAmount).add(haveAmount).add(otherAmount);
VUtils.isTrue(declareAmount.compareTo(totalAmount) != 0)
.throwMessage(String.format("申报失败! 申报总金额【{}】 不等于其它申报金额 【{}】",declareAmount,totalAmount));
.throwMessage(String.format("申报失败! 申报总金额【%s】 不等于其它申报金额 【%s】",declareAmount,totalAmount));

//判断 年度计划金额 如果开着的话
if(projectInfo.getIsAnnualPlanAmount()){
BigDecimal annualPlanAmount = projectInfo.getAnnualPlanAmount();

VUtils.isTrue(annualPlanAmount.compareTo(BigDecimal.ZERO) <= 0)
.throwMessage(String.format("申报失败! 年度支付总金额【%s】 不能小于等于0",annualPlanAmount));
VUtils.isTrue(annualPlanAmount.compareTo(declareAmount) > 0)
.throwMessage(String.format("申报失败! 年度支付总金额【%s】 不能大于申报金额 【%s】",annualPlanAmount,declareAmount));

BigDecimal annualGovSuperAmount = projectInfo.getAnnualPlanGovSuperiorFinanceAmount();
BigDecimal annualOwnSuperAmount = projectInfo.getAnnualPlanGovOwnFinanceAmount();
BigDecimal annualBankLendingAmount = projectInfo.getAnnualPlanBankLendingAmount();
@@ -98,7 +104,7 @@ public class DefaultDeclaredProjectManage {
BigDecimal totalAnnual = annualGovSuperAmount
.add(annualOwnSuperAmount).add(annualBankLendingAmount).add(annualHaveAmount).add(anualOtherAmount);
VUtils.isTrue(annualPlanAmount.compareTo(totalAnnual) != 0)
.throwMessage(String.format("申报失败! 年度支付总金额【{}】 不等于其它年度支付金额 【{}】",annualPlanAmount,totalAnnual));
.throwMessage(String.format("申报失败! 年度支付总金额【%s】 不等于其它年度支付金额 【%s】",annualPlanAmount,totalAnnual));
}
}

@@ -234,9 +240,17 @@ public class DefaultDeclaredProjectManage {
}
}

public DeclaredProjectStatisticsPO declaredProjectStatistics(Integer year){
//根据提交者的单位
public DeclaredProjectStatisticsPO declaredProjectOrgStatistics(Integer year){
UserInfoDetails userInfo = LoginUserUtil.loginUserDetail();
//查此人建设单位的项目
return statisticsService.getOrgStatistics(userInfo.getOrganizationCode(),year);
}

//根据提交者的区域 他是区管或者超管
public DeclaredProjectStatisticsPO declaredProjectRegionStatistics(Integer year){
UserInfoDetails userInfo = LoginUserUtil.loginUserDetail();
//查此人建设单位的项目
return statisticsService.getStatistics(userInfo.getOrganizationCode(),year);
return statisticsService.getRegionStatistics(userInfo.getRegionCode(),year);
}
}

+ 2
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/DeclaredStatisticsMapper.java Voir le fichier

@@ -15,6 +15,7 @@ import org.apache.ibatis.annotations.Param;
*/
public interface DeclaredStatisticsMapper extends BaseMapper {

DeclaredProjectStatisticsPO getStatistics(@Param("orgCode") String orgCode,@Param("year") Integer year);
DeclaredProjectStatisticsPO getOrgStatistics(@Param("orgCode") String orgCode,@Param("year") Integer year);

DeclaredProjectStatisticsPO getRegionStatistics(@Param("regionCode") String regionCode,@Param("year") Integer year);
}

+ 17
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/DeclaredStatisticsMapper.xml Voir le fichier

@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ningdatech.pmapi.projectdeclared.mapper.DeclaredStatisticsMapper">

<select id="getStatistics" resultType="com.ningdatech.pmapi.projectdeclared.model.po.DeclaredProjectStatisticsPO">
<select id="getOrgStatistics" resultType="com.ningdatech.pmapi.projectdeclared.model.po.DeclaredProjectStatisticsPO">
SELECT
count(0) totalNum,
count(CASE WHEN p.project_type = 1 THEN 1 end) buildNum,
@@ -19,4 +19,20 @@
WHERE build_org_code = #{orgCode} and project_year = #{year}
</select>

<select id="getRegionStatistics" resultType="com.ningdatech.pmapi.projectdeclared.model.po.DeclaredProjectStatisticsPO">
SELECT
count(0) totalNum,
count(CASE WHEN p.project_type = 1 THEN 1 end) buildNum,
count(CASE WHEN p.project_type = 2 THEN 1 end) operationNum,
count(CASE WHEN p.stage = 10000 THEN 1 end) notApprovedNum,
count(CASE WHEN p.stage = 20000 THEN 1 end) approvedNum,
count(CASE WHEN p.stage = 20000 AND p.status = 20002 THEN 1 end) constructionNum,
count(CASE WHEN p.stage = 20000 AND p.status = 20003 THEN 1 end) tobeInspectedNum,
count(CASE WHEN p.stage = 30000 THEN 1 end) archivedNum,
sum(p.declare_amount) declaredAmount,
sum(p.approval_amount) approvalAmount
FROM
nd_project p
WHERE area_code = #{regionCode} and project_year = #{year}
</select>
</mapper>

+ 2
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/IDeclaredStatisticsService.java Voir le fichier

@@ -12,6 +12,7 @@ import com.ningdatech.pmapi.projectdeclared.model.po.DeclaredProjectStatisticsPO
*/
public interface IDeclaredStatisticsService {

DeclaredProjectStatisticsPO getStatistics(String orgCode,Integer year);
DeclaredProjectStatisticsPO getOrgStatistics(String organizationCode, Integer year);

DeclaredProjectStatisticsPO getRegionStatistics(String regionCode,Integer year);
}

+ 13
- 3
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/DeclaredStatisticsServiceImpl.java Voir le fichier

@@ -21,12 +21,22 @@ public class DeclaredStatisticsServiceImpl implements IDeclaredStatisticsService
private final DeclaredStatisticsMapper declaredStatisticsMapper;

/**
* 根据userId 去查询 申报项目统计
* 根据userId 去查询 申报项目统计 根据单位
* @param orgCode
* @return
*/
@Override
public DeclaredProjectStatisticsPO getStatistics(String orgCode,Integer year) {
return declaredStatisticsMapper.getStatistics(orgCode,year);
public DeclaredProjectStatisticsPO getOrgStatistics(String orgCode,Integer year) {
return declaredStatisticsMapper.getOrgStatistics(orgCode,year);
}

/**
* 根据userId 去查询 申报项目统计 根据区域
* @param regionCode
* @return
*/
@Override
public DeclaredProjectStatisticsPO getRegionStatistics(String regionCode,Integer year) {
return declaredStatisticsMapper.getRegionStatistics(regionCode,year);
}
}

+ 0
- 2
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java Voir le fichier

@@ -67,13 +67,11 @@ import com.ningdatech.pmapi.user.entity.UserInfo;
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO;
import com.ningdatech.pmapi.user.service.IUserInfoService;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import com.sun.org.apache.bcel.internal.generic.NEW;
import com.wflow.contants.HisProInsEndActId;
import com.wflow.exception.BusinessException;
import com.wflow.workflow.bean.dto.ProcessInstanceUserDto;
import com.wflow.workflow.bean.dto.ReqProcessHandlerDTO;
import com.wflow.workflow.bean.dto.TodoCenterListReqDTO;
import com.wflow.workflow.bean.dto.TodoCenterListReqDTO;
import com.wflow.workflow.bean.process.ProgressNode;
import com.wflow.workflow.bean.process.enums.NodeTypeEnum;
import com.wflow.workflow.bean.vo.ProcessInstanceVo;


+ 7
- 1
pmapi/src/main/java/com/ningdatech/pmapi/workbench/manage/WorkbenchManage.java Voir le fichier

@@ -2,6 +2,7 @@ package com.ningdatech.pmapi.workbench.manage;

import cn.hutool.core.bean.BeanUtil;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.common.helper.UserInfoHelper;
import com.ningdatech.pmapi.projectdeclared.manage.DeclaredProjectManage;
import com.ningdatech.pmapi.projectdeclared.manage.DefaultDeclaredProjectManage;
import com.ningdatech.pmapi.projectdeclared.model.po.DeclaredProjectStatisticsPO;
@@ -43,6 +44,8 @@ public class WorkbenchManage {

private final NoticeManage noticeManage;

private final UserInfoHelper userInfoHelper;

public WorkbenchVO getWorkbenchData(Integer year){
UserInfoDetails userInfo = LoginUserUtil.loginUserDetail();
WorkbenchVO res = new WorkbenchVO();
@@ -57,7 +60,10 @@ public class WorkbenchManage {
res.setTodoCerter(statisticsVO);

//2.项目统计数据
res.setOrgDeclared(WorkbenchConverter.convert(defaultDeclaredProjectManage.declaredProjectStatistics(year)));
res.setOrgDeclared(WorkbenchConverter.convert(defaultDeclaredProjectManage.declaredProjectOrgStatistics(year)));
if(userInfoHelper.isAdmin(userInfo.getUserId())){
res.setRegionDeclared(WorkbenchConverter.convert(defaultDeclaredProjectManage.declaredProjectRegionStatistics(year)));
}
ProjectListReq projectListReq = new ProjectListReq();
projectListReq.setPageNumber(1);
projectListReq.setPageSize(5);


Chargement…
Annuler
Enregistrer