ソースを参照

累积投资金额

master
PoffyZhang 1年前
コミット
980d220357
10個のファイルの変更212行の追加14行の削除
  1. +28
    -13
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java
  2. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectAnnualAccumulateAmountMapper.java
  3. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectAnnualAccumulateAmountMapper.xml
  4. +34
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectAnnualAccumulateAmountSaveDTO.java
  5. +50
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectAnnualAccumulateAmount.java
  6. +36
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectAnnualAccumulateAmountVO.java
  7. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java
  8. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectAnnualAccumulateAmountService.java
  9. +22
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectAnnualAccumulateAmountServiceImpl.java
  10. +2
    -1
      pmapi/src/test/resources/security/auth-dev.yml

+ 28
- 13
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java ファイルの表示

@@ -7,11 +7,13 @@ import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.pmapi.projectlib.helper.ProjectHelper;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectAnnualAccumulateAmount;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication;
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectApplicationVO;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO;
import com.ningdatech.pmapi.projectlib.service.IProjectAnnualAccumulateAmountService;
import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import lombok.RequiredArgsConstructor;
@@ -38,6 +40,8 @@ public class ProjectLibManage {

private final IProjectApplicationService applicationService;

private final IProjectAnnualAccumulateAmountService announcementAccumulateAmountService;

public PageVo<ProjectLibListItemVO> projectLibList(ProjectListReq req) {
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req);
Page<Project> page = projectService.page(req.page(), query);
@@ -79,19 +83,30 @@ public class ProjectLibManage {
BeanUtils.copyProperties(projectInfo, vo);
vo.buildDynamicForm(projectInfo.getDynamicForm());
// 查询应用
if(Objects.nonNull(vo)){
List<ProjectApplication> applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class)
.eq(ProjectApplication::getProjectId, vo.getId()));
Optional.ofNullable(applications).ifPresent(apps ->
vo.setProjectApplications(CollUtils.convert(apps,
app-> {
ProjectApplicationVO appVo = new ProjectApplicationVO();
BeanUtils.copyProperties(app, appVo);
return appVo;
}
)
));
}
List<ProjectApplication> applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class)
.eq(ProjectApplication::getProjectId, vo.getId()));
Optional.ofNullable(applications).ifPresent(apps ->
vo.setProjectApplications(CollUtils.convert(apps,
app-> {
ProjectApplicationVO appVo = new ProjectApplicationVO();
BeanUtils.copyProperties(app, appVo);
return appVo;
}
)
));
//查询年度投资金额
List<ProjectAnnualAccumulateAmount> annualAmount = announcementAccumulateAmountService.list(Wrappers.lambdaQuery(ProjectAnnualAccumulateAmount.class)
.eq(ProjectAnnualAccumulateAmount::getProjectId, vo.getId())
.orderByAsc(ProjectAnnualAccumulateAmount::getProjectYear));
Optional.ofNullable(annualAmount).ifPresent(amounts ->
vo.setAnnualAccumulateAmountDetail(CollUtils.joinByComma(amounts,
amount-> {
StringBuffer sb = new StringBuffer();
sb.append(amount.getProjectYear() + "年投资" + amount.getConvertTenThousand() + "万元。\n");
return sb.toString();
}
)
));
return vo;
}



+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectAnnualAccumulateAmountMapper.java ファイルの表示

@@ -0,0 +1,16 @@
package com.ningdatech.pmapi.projectlib.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectAnnualAccumulateAmount;

/**
* <p>
* Mapper 接口
* </p>
*
* @author zpf
* @since 2023-02-17
*/
public interface ProjectAnnualAccumulateAmountMapper extends BaseMapper<ProjectAnnualAccumulateAmount> {

}

+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectAnnualAccumulateAmountMapper.xml ファイルの表示

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ningdatech.pmapi.projectlib.mapper.ProjectAnnualAccumulateAmountMapper">

</mapper>

+ 34
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectAnnualAccumulateAmountSaveDTO.java ファイルの表示

@@ -0,0 +1,34 @@
package com.ningdatech.pmapi.projectlib.model.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
* @Classname ProjectAnnualAccumulateAmountSaveDTO
* @Description
* @Date 2023/2/17 10:49
* @Author PoffyZhang
*/
@Data
@ApiModel(value = "ProjectAnnualAccumulateAmountSaveDTO", description = "项目年度累积投资资金保存")
public class ProjectAnnualAccumulateAmountSaveDTO implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("项目ID")
@NotNull
private Long projectId;

@NotNull
@ApiModelProperty("年份")
private Integer projectYear;

@NotNull
@ApiModelProperty("年度投资金额")
private BigDecimal annualAccumulateAmount;
}

+ 50
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectAnnualAccumulateAmount.java ファイルの表示

@@ -0,0 +1,50 @@
package com.ningdatech.pmapi.projectlib.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Objects;

/**
* @Classname NdProjectAnnualAccumulateAmount
* @Description
* @Date 2023/2/17 10:49
* @Author PoffyZhang
*/
@Data
@TableName("nd_project_annual_accumulate_amount")
@ApiModel(value = "NdProjectAnnualAccumulateAmount", description = "项目年度累积投资资金表")
public class ProjectAnnualAccumulateAmount implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("主键")
@TableId(type = IdType.AUTO)
private Long id;

@ApiModelProperty("项目ID")
private Long projectId;

@ApiModelProperty("年份")
private Integer projectYear;

@ApiModelProperty("年度投资金额")
private BigDecimal annualAccumulateAmount;

@TableField(fill = FieldFill.INSERT)
private Long createBy;

@TableField(fill = FieldFill.INSERT_UPDATE)
private Long updateBy;

public BigDecimal getConvertTenThousand() {
if(Objects.nonNull(this.annualAccumulateAmount)){
return this.annualAccumulateAmount.divide(BigDecimal.valueOf(10000),2, RoundingMode.HALF_UP);
}
return BigDecimal.ZERO;
}
}

+ 36
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectAnnualAccumulateAmountVO.java ファイルの表示

@@ -0,0 +1,36 @@
package com.ningdatech.pmapi.projectlib.model.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
* @Classname ProjectAnnualAccumulateAmountVO
* @Description
* @Date 2023/2/17 10:49
* @Author PoffyZhang
*/
@Data
@ApiModel(value = "ProjectAnnualAccumulateAmountVO", description = "项目年度累积投资资金VO")
public class ProjectAnnualAccumulateAmountVO implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("主键")
private Long id;

@ApiModelProperty("项目ID")
private Long projectId;

@ApiModelProperty("年份")
private Integer projectYear;

@ApiModelProperty("年度投资金额")
private BigDecimal annualAccumulateAmount;

private Long createBy;
private Long updateBy;
}

+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java ファイルの表示

@@ -274,6 +274,9 @@ public class ProjectDetailVO {
@ApiModelProperty("动态form")
private Map<String, Object> dynamicForm;

@ApiModelProperty("年度投资金额详情")
private String annualAccumulateAmountDetail;

private String projectTypeName;

public String getProjectTypeName() {


+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectAnnualAccumulateAmountService.java ファイルの表示

@@ -0,0 +1,16 @@
package com.ningdatech.pmapi.projectlib.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectAnnualAccumulateAmount;

/**
* <p>
* 服务类
* </p>
*
* @author zpf
* @since 2023-02-17
*/
public interface IProjectAnnualAccumulateAmountService extends IService<ProjectAnnualAccumulateAmount> {

}

+ 22
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectAnnualAccumulateAmountServiceImpl.java ファイルの表示

@@ -0,0 +1,22 @@
package com.ningdatech.pmapi.projectlib.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ningdatech.pmapi.projectlib.mapper.ProjectAnnualAccumulateAmountMapper;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectAnnualAccumulateAmount;
import com.ningdatech.pmapi.projectlib.service.IProjectAnnualAccumulateAmountService;
import org.springframework.stereotype.Service;

/**
* <p>
* 服务实现类
* </p>
*
* @author WendyYang
* @since 2023-02-05
*/
@Service
public class ProjectAnnualAccumulateAmountServiceImpl
extends ServiceImpl<ProjectAnnualAccumulateAmountMapper, ProjectAnnualAccumulateAmount>
implements IProjectAnnualAccumulateAmountService {

}

+ 2
- 1
pmapi/src/test/resources/security/auth-dev.yml ファイルの表示

@@ -49,4 +49,5 @@ security:
- /api/v1/user-info/save
- /api/v1/user-info/del
- /api/v1/user-info/kick-off/**
- /api/v1/user-info/password/mod
- /api/v1/user-info/password/mod
- /api/v1/**

読み込み中…
キャンセル
保存