瀏覽代碼

修改资金下达情况

tags/24080901
WendyYang 10 月之前
父節點
當前提交
70b7ebe22b
共有 9 個文件被更改,包括 69 次插入32 次删除
  1. +13
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/utils/ProjectCodeGenUtil.java
  2. +0
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/ProcessExecuteChainHandle.java
  3. +39
    -31
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/DeclaredRecordManage.java
  4. +1
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java
  5. +4
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/mapper/ProjectMapper.xml
  6. +3
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/entity/Project.java
  7. +3
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/po/ProjectPO.java
  8. +3
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/ProjectDetailVO.java
  9. +3
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/ProjectLibListItemVO.java

+ 13
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/utils/ProjectCodeGenUtil.java 查看文件

@@ -50,6 +50,19 @@ public class ProjectCodeGenUtil {
return currentCode + String.format(ProjectCodeContant.SHUZI_5, max);
}

public String generateProjectCode(Integer projectYear) {
String areaCode = RegionConst.RC_HZ + ProjectCodeContant.REGION_LAST_3;
// 获取建设年度 (10-13)
String year = projectYear != null ? String.valueOf(projectYear) : String.valueOf(LocalDate.now().getYear());
// 16-20 项目序号00001
String currentCode = areaCode + year;
// 16-20 项目序号00001
//要查询 两边的项目序号
Long max = getMaxProjectCode(currentCode);
// 生成20位的项目编号
return currentCode + String.format(ProjectCodeContant.SHUZI_5, max);
}

public String generateProjectCode(ProjectCollection project) {
// 获取所属行政区划代码(9位)
String areaCode = RegionConst.RC_HZ + ProjectCodeContant.REGION_LAST_3;


+ 0
- 1
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/ProcessExecuteChainHandle.java 查看文件

@@ -30,7 +30,6 @@ import java.util.Objects;
@RequiredArgsConstructor
public class ProcessExecuteChainHandle {

private final IProjectService projectService;
private final ProcessModelService processModelService;

/**


+ 39
- 31
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/DeclaredRecordManage.java 查看文件

@@ -43,7 +43,9 @@ import com.hz.pm.api.sys.manage.NoticeManage;
import com.hz.pm.api.todocenter.constant.WorkNoticeConst;
import com.hz.pm.api.user.helper.MhUnitCache;
import com.hz.pm.api.user.model.dto.UnitDTO;
import com.hz.pm.api.user.model.entity.MhUnit;
import com.hz.pm.api.user.security.model.UserInfoDetails;
import com.hz.pm.api.user.service.IMhUnitService;
import com.hz.pm.api.user.util.LoginUserUtil;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.function.VUtils;
@@ -63,6 +65,7 @@ import org.springframework.web.multipart.MultipartFile;

import java.io.InputStream;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
@@ -86,6 +89,7 @@ public class DeclaredRecordManage {
private final IMhProjectSchemaTargetDataService schemaTargetDataService;
private final IProjectService projectService;
private final MhUnitCache mhUnitCache;
private final IMhUnitService mhUnitService;
private final NoticeManage noticeManage;
private final IProjectDraftService projectDraftService;
private final ProcessModelService processModelService;
@@ -385,6 +389,7 @@ public class DeclaredRecordManage {
}
}

@Transactional(rollbackFor = Exception.class)
public void importProjectFinanceInfos(MultipartFile file) {
try (InputStream is = file.getInputStream()) {
List<Map<String, Object>> rows = ExcelUtil.getReader(is).readAll();
@@ -404,43 +409,49 @@ public class DeclaredRecordManage {
financeInfo.setDeclareGovSuperiorFinanceAmount(MapUtil.get(w, "上级补助资金", BigDecimal.class));
return financeInfo;
});
Map<String, List<ImportProjectFinanceInfosDTO>> groupByUnit = CollUtils.group(importDataList, ImportProjectFinanceInfosDTO::getUnitName);
List<Project> projects = new ArrayList<>();
for (Map.Entry<String, List<ImportProjectFinanceInfosDTO>> entry : groupByUnit.entrySet()) {
if (entry.getValue().size() != 1) {
log.warn("单位存在多个项目:{}", entry.getKey());
continue;
for (ImportProjectFinanceInfosDTO importData : importDataList) {
String projectName = importData.getProjectName();
Project project = projectService.getByProjectName(projectName);
if (project == null) {
List<MhUnit> units = mhUnitService.listByName(importData.getUnitName());
if (units.size() != 1) {
continue;
}
MhUnit unit = units.get(0);
MhUnitTypeEnum unitType = MhUnitTypeEnum.getByCode(unit.getType()).get();
MhProject mhProject = new MhProject();
mhProject.setUnitStrip(unitType.getStrip().getCode());
mhProject.setUnitName(unit.getName());
mhProject.setUnitId(unit.getId());
mhProject.setCreateTime(LocalDateTime.now());
mhProject.setProjectName(importData.getProjectName());
LocalDateTime now = LocalDateTime.now();
mhProject.setProjectCode(projectCodeGenUtil.generateProjectCode(now.getYear()));
mhProjectService.save(mhProject);
project = new Project();
project.setProjectCode(mhProject.getProjectCode());
project.setNewest(Boolean.TRUE);
project.setVersion(1);
project.setStage(ProjectStatusEnum.NOT_APPROVED.getCode());
project.setStatus(ProjectStatusEnum.DECLARED_APPROVED_TO_BE_RECORD.getCode());
project.setCreateOn(now);
project.setUpdateOn(now);
project.setUnitStrip(mhProject.getUnitStrip());
project.setBuildOrgName(unit.getName());
project.setBuildOrgCode(String.valueOf(unit.getId()));
}
Collection<Project> projectsTmp = listProjectsByUnitName(entry.getKey());
if (projectsTmp.size() != 1) {
log.warn("单位存在多个项目:{}", entry.getKey());
continue;
}
Project project = new ArrayList<>(projects).get(0);
ImportProjectFinanceInfosDTO importData = entry.getValue().get(0);
project.setApprovalAmount(importData.getDeclareAmount());
project.setApprovalGovOwnFinanceAmount(importData.getDeclareGovOwnFinanceAmount());
project.setApprovalGovSuperiorFinanceAmount(importData.getDeclareGovSuperiorFinanceAmount());
project.setApprovalHaveAmount(importData.getDeclareHaveAmount());
projects.add(project);
projectService.saveOrUpdate(project);
}
if (projects.isEmpty()) {
return;
}
projectService.updateBatchById(projects);
} catch (Exception e) {
log.info("读取数据失败:", e);
throw new BizException(e);
}
}

private Collection<Project> listProjectsByUnitName(String unitName) {
List<Project> projects = projectService.list(Wrappers.lambdaQuery(Project.class)
.eq(Project::getBuildOrgName, unitName));
return BizUtils.groupFirst(projects, Project::getProjectCode,
Comparator.comparing(Project::getCreateOn).reversed());
}

@Transactional(rollbackFor = Exception.class)
public void importReplaceSystemInfos(MultipartFile file) {
try (InputStream is = file.getInputStream()) {
@@ -457,7 +468,6 @@ public class DeclaredRecordManage {
importData.setSourceName(MapUtil.getStr(w, "替代前系统"));
importData.setTargetName(MapUtil.getStr(w, "替代后系统"));
importData.setUnitName(MapUtil.getStr(w, "单位"));
Assert.notBlank(importData.getUnitName(), "单位名称不能为空");
if (StrUtil.equals(importData.getReplaceType(), "/")
|| StrUtil.isBlank(importData.getReplaceType())) {
importData.setReplaceType(null);
@@ -469,16 +479,14 @@ public class DeclaredRecordManage {
return importData;
});
Map<String, List<ImportReplaceSystemInfosDTO>> groupByProject = CollUtils.group(importDataList,
ImportReplaceSystemInfosDTO::getUnitName);
ImportReplaceSystemInfosDTO::getProjectName);
List<Long> projectIds = new ArrayList<>();
List<ProjectGovSystemReplaceInfos> replaceInfos = new ArrayList<>();
for (Map.Entry<String, List<ImportReplaceSystemInfosDTO>> entry : groupByProject.entrySet()) {
Collection<Project> projects = listProjectsByUnitName(entry.getKey());
if (projects.size() != 1) {
log.warn("单位存在多个项目:{}", entry.getKey());
Project project = projectService.getByProjectName(entry.getKey());
if (project == null) {
continue;
}
Project project = new ArrayList<>(projects).get(0);
projectIds.add(project.getId());
Map<String, Integer> batchNoMap = new HashMap<>();
AtomicInteger integer = new AtomicInteger(1);


+ 1
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java 查看文件

@@ -418,6 +418,7 @@ public class ProjectLibManage {
item.setProjectYear(w.getProjectYear());
item.setBuildOrg(w.getBuildOrgName());
item.setBizDomain(w.getBizDomain());
item.setReviewAmount(w.getReviewAmount());
item.setProcessStatus(w.getProcessStatus());
item.setInstCode(w.getInstCode());
item.setIsHigherSuperOrg(w.getIsHigherSuperOrg());


+ 4
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/mapper/ProjectMapper.xml 查看文件

@@ -10,6 +10,7 @@
project_year,
build_org_code,
build_org_name,
review_amount,
project_code,
project_type,
area,
@@ -39,6 +40,7 @@
area_code,
declare_amount,
approval_amount,
review_amount,
stage,
status,
biz_domain,
@@ -121,6 +123,7 @@
(CASE WHEN b.base_area_code IS NOT NULL then substring(b.base_area_code,0,6) end) area_code,
apply.base_proj_decl_amount declare_amount,
approve.base_initial_review_total_money approval_amount,
NULL review_amount,
NULL stage,
CAST(b.base_proj_set_prog AS INTEGER) status,
NULL annual_plan_amount,
@@ -206,6 +209,7 @@
(CASE WHEN b.base_area_code IS NOT NULL then substring(b.base_area_code,0,6) end) area_code,
apply.base_proj_decl_amount declare_amount,
approve.base_initial_review_total_money approval_amount,
NULL review_amount,
NULL stage,
CAST(b.base_proj_set_prog AS INTEGER) status,
NULL annual_plan_amount,


+ 3
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/entity/Project.java 查看文件

@@ -209,6 +209,9 @@ public class Project implements Serializable {
@Compare("资金分配情况-第三方服务")
private BigDecimal thirdPartyAmount;

@ApiModelProperty("评审金额")
private BigDecimal reviewAmount;

//==================================================================================================================

@ApiModelProperty("批复-自有金额(万元)")


+ 3
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/po/ProjectPO.java 查看文件

@@ -238,6 +238,9 @@ public class ProjectPO implements Serializable {
@Compare("立项批复总投资")
private BigDecimal approvalAmount;

@ApiModelProperty("评审金额")
private BigDecimal reviewAmount;

@ApiModelProperty("立项批复总预算(万元)")
@Compare("立项批复总预算")
private BigDecimal approvalBudget;


+ 3
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/ProjectDetailVO.java 查看文件

@@ -214,6 +214,9 @@ public class ProjectDetailVO {

private LocalDateTime annualPlanAddTime;

@ApiModelProperty("评审金额")
private BigDecimal reviewAmount;

@ApiModelProperty("核心业务-核心业务模块")
private String coreBusiness;



+ 3
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/ProjectLibListItemVO.java 查看文件

@@ -56,6 +56,9 @@ public class ProjectLibListItemVO {
@ApiModelProperty("申报金额")
private BigDecimal declaredAmount;

@ApiModelProperty("评审金额")
private BigDecimal reviewAmount;

@ApiModelProperty("批复金额")
private BigDecimal approvedAmount;



Loading…
取消
儲存