Browse Source

增加项目实体

master
WendyYang 1 year ago
parent
commit
c91227dbe2
10 changed files with 372 additions and 98 deletions
  1. +0
    -64
      ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeConfig.java
  2. +1
    -1
      ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java
  3. +25
    -26
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java
  4. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/NdProjectMapper.java
  5. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/NdProjectMapper.xml
  6. +282
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java
  7. +5
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectLibListReq.java
  8. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java
  9. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/INdProjectService.java
  10. +20
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/NdProjectServiceImpl.java

+ 0
- 64
ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeConfig.java View File

@@ -1,64 +0,0 @@
package com.ningdatech.generator.config;

import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.config.OutputFile;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;

import java.util.Collections;

/**
* @description: 自动生成code代码
* @author: liuxinxin
* @date: 2023/01/03 09:20
*/
public class GeneratorCodeConfig {

private static final String PATH_LXX = "/Users/liuxinxin/IdeaProjects/project-management/pmapi/src/main/java";
private static final String PATH_YYD = "";
private static final String PATH_LS = "";
private static final String PATH_ZPF = "";
private static final String PATH_CMM = "";

private static final String URL = "jdbc:mysql://47.98.125.47:3306/nd_project_management?" +
"useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&" +
"useSSL=false&serverTimezone=Asia/Shanghai";
private static final String USER_NAME = "root";
private static final String PASSWORD = "NingdaKeji123!";

private static void generate(String author, String packageName, String path, String... tableNames) {
FastAutoGenerator.create(URL, USER_NAME, PASSWORD)
.globalConfig(builder -> {
// 设置作者
builder.author(author)
// 开启 swagger 模式
.enableSwagger()
// 覆盖已生成文件
.fileOverride()
// 指定输出目录
.outputDir(path);
})
.packageConfig(builder -> {
// 设置父包名
builder.parent("com.ningdatech")
// 设置父包模块名
.moduleName("pmapi." + packageName)
// 设置mapperXml生成路径
.pathInfo(Collections.singletonMap(OutputFile.mapperXml,
//设置自己的生成路径
path + "/com/ningdatech/pmapi/" + packageName + "/mapper"));
})
.strategyConfig(builder -> {
builder.addTablePrefix("nd");
// 设置需要生成的表名
builder.addInclude(tableNames);
})
// 使用Freemarker引擎模板,默认的是Velocity引擎模板
.templateEngine(new FreemarkerTemplateEngine())
.execute();
}

public static void main(String[] args) {
generate("Liuxinxin", "user", PATH_LXX, "nd_role_info", "nd_user_role");
}

}

+ 1
- 1
ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java View File

@@ -56,7 +56,7 @@ public class GeneratorCodeKingbaseConfig {
}

public static void main(String[] args) {
generate("WendyYang", "sys", PATH_YYD, "nd_role_menu_datascope");
generate("WendyYang", "projectlib", PATH_YYD, "nd_project");
}

}

+ 25
- 26
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java View File

@@ -5,15 +5,14 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.req.ProjectLibListReq;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO;
import com.wflow.bean.entity.NdDeclaredProject;
import com.wflow.service.NdDeclaredProjectService;
import com.ningdatech.pmapi.projectlib.service.INdProjectService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.stream.Collectors;

import static com.ningdatech.pmapi.common.utils.BizUtils.notBlank;
import static com.ningdatech.pmapi.common.utils.BizUtils.notNull;
@@ -30,36 +29,36 @@ import static com.ningdatech.pmapi.common.utils.BizUtils.notNull;
@RequiredArgsConstructor
public class ProjectLibManage {

private final NdDeclaredProjectService declaredProjectService;
private final INdProjectService projectService;

private LambdaQueryWrapper<NdDeclaredProject> projectLibQuery(ProjectLibListReq req) {
LambdaQueryWrapper<NdDeclaredProject> query = Wrappers.lambdaQuery(NdDeclaredProject.class);
notBlank(req.getProjectName(), w -> query.like(NdDeclaredProject::getProjectName, w));
notNull(req.getProjectType(), w -> query.eq(NdDeclaredProject::getProjectType, w));
notNull(req.getProjectYear(), w -> query.eq(NdDeclaredProject::getProjectYear, w));
private LambdaQueryWrapper<Project> projectLibQuery(ProjectLibListReq req) {
LambdaQueryWrapper<Project> query = Wrappers.lambdaQuery(Project.class);
notBlank(req.getProjectName(), w -> query.like(Project::getProjectName, w));
notNull(req.getProjectType(), w -> query.eq(Project::getProjectType, w));
notNull(req.getProjectYear(), w -> query.eq(Project::getProjectYear, w));
// 申报金额 批复金额
notNull(req.getApprovedAmountMin(), w -> query.ge(NdDeclaredProject::getApprovedAmount, w));
notNull(req.getApprovedAmountMax(), w -> query.le(NdDeclaredProject::getApprovedAmount, w));
notNull(req.getApproveAmountMin(), w -> query.ge(Project::getApprovalAmount, w));
notNull(req.getApproveAmountMax(), w -> query.le(Project::getApprovalAmount, w));

notNull(req.getDeclaredAmountMax(), w -> query.le(NdDeclaredProject::getDeclaredAmount, w));
notNull(req.getDeclaredAmountMin(), w -> query.ge(NdDeclaredProject::getDeclaredAmount, w));
notNull(req.getDeclareAmountMax(), w -> query.le(Project::getDeclareAmount, w));
notNull(req.getDeclareAmountMin(), w -> query.ge(Project::getDeclareAmount, w));
// 状态查询
notNull(req.getStatus1st(), w -> query.ge(NdDeclaredProject::getProjectStatusFirst, w));
notNull(req.getStatus2nd(), w -> query.ge(NdDeclaredProject::getProjectStatusSecond, w));
notNull(req.getStatus1st(), w -> query.ge(Project::getStage, w));
notNull(req.getStatus2nd(), w -> query.ge(Project::getStatus, w));

notNull(req.getCreateOnMin(), w -> query.ge(NdDeclaredProject::getCreateOn, w));
notNull(req.getCreateOnMax(), w -> query.le(NdDeclaredProject::getCreateOn, w));
notNull(req.getCreateOnMin(), w -> query.ge(Project::getCreateOn, w));
notNull(req.getCreateOnMax(), w -> query.le(Project::getCreateOn, w));

notBlank(req.getApplyOrg(), w -> query.like(NdDeclaredProject::getOrgName, w));
notBlank(req.getBuildUnit(), w -> query.like(Project::getBuildUnitName, w));

query.orderByDesc(NdDeclaredProject::getUpdateOn, NdDeclaredProject::getCreateOn);
query.orderByDesc(Project::getUpdateOn, Project::getCreateOn);
// TODO 区域编码处理
return query;
}

public PageVo<ProjectLibListItemVO> projectLibList(ProjectLibListReq req) {
LambdaQueryWrapper<NdDeclaredProject> query = projectLibQuery(req);
Page<NdDeclaredProject> page = declaredProjectService.page(req.page(), query);
LambdaQueryWrapper<Project> query = projectLibQuery(req);
Page<Project> page = projectService.page(req.page(), query);
long total;
if ((total = page.getTotal()) == 0) {
return PageVo.empty();
@@ -69,13 +68,13 @@ public class ProjectLibManage {
item.setId(w.getId());
item.setProjectName(w.getProjectName());
item.setCreateOn(w.getCreateOn());
item.setDeclaredAmount(w.getDeclaredAmount());
item.setStatus1st(w.getProjectStatusFirst());
item.setStatus2nd(w.getProjectStatusSecond());
item.setDeclaredAmount(w.getDeclareAmount());
item.setStatus1st(w.getStage());
item.setStatus2nd(w.getStatus());
item.setProjectType(w.getProjectType());
item.setProjectYear(w.getProjectYear());
item.setApplyOrg(w.getOrgName());
item.setBizArea(w.getBizArea());
item.setBuildUnit(w.getBuildUnitName());
item.setBizDomain(w.getBizDomain());
return item;
});
return PageVo.of(records, total);


+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/NdProjectMapper.java View File

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

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

/**
* <p>
* Mapper 接口
* </p>
*
* @author WendyYang
* @since 2023-02-03
*/
public interface NdProjectMapper extends BaseMapper<Project> {

}

+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/NdProjectMapper.xml View File

@@ -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.NdProjectMapper">

</mapper>

+ 282
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java View File

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

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

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

/**
* <p>
*
* </p>
*
* @author WendyYang
* @since 2023-02-03
*/
@Data
@TableName("nd_project")
@ApiModel(value = "NdProject对象", description = "")
public class Project implements Serializable {

private static final long serialVersionUID = 1L;

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

@ApiModelProperty("所属地区编号")
private String areaCode;

@ApiModelProperty("所属地区名称")
private String area;

@ApiModelProperty("项目阶段")
private Integer stage;

@ApiModelProperty("项目状态")
private Integer status;

@ApiModelProperty("项目名称")
private String projectName;

@ApiModelProperty("是否临时增补 0:否 1:是")
private Integer isTemporaryAugment;

@ApiModelProperty("项目负责人")
private String responsibleMan;

@ApiModelProperty("负责人手机号码")
private String responsibleManMobile;

@ApiModelProperty("项目联系人")
private String contactName;

@ApiModelProperty("项目联系人手机号码")
private String contactPhone;

@ApiModelProperty("建设单位名称")
private String buildUnitName;

@ApiModelProperty("建设单位统一社会信用代码")
private String buildUnitCode;

@ApiModelProperty("建设单位浙政钉ID")
private String buildUnitZheJiangGovernmentDingId;

@ApiModelProperty("项目类型 1:建设 2:运维")
private Integer projectType;

@ApiModelProperty("是否首次新建 0:否 1:是")
private Integer isFirst;

@ApiModelProperty("项目预算年度")
private Integer projectYear;

@ApiModelProperty("项目建设起始时间")
private String beginTime;

@ApiModelProperty("项目建设终止时间")
private String endTime;

@ApiModelProperty("四大体系 1:业务应用 2:应用支撑 3:数据资源 4:基础设施")
private Integer fourSystems;

@ApiModelProperty("是否数字化改革项目 0:否 1:是")
private Integer isDigitalReform;

@ApiModelProperty("综合业务领域")
private String bizDomain;

@ApiModelProperty("建设层级 1:国家级 2:省级 3:省本级 4:市级 5:市本级 6:区县 7乡镇")
private Integer buildLevel;

@ApiModelProperty("立项依据")
private String buildBasis;

@ApiModelProperty("发改编码")
private String developCode;

@ApiModelProperty("财政编码")
private String financialCode;

@ApiModelProperty("是否上云 0:否 1:是")
private Integer isCloud;

private String cloudType;

@ApiModelProperty("等保级别 1:一级 2:二级 3:三级 4:四级 5:五级")
private Integer protectionLevel;

@ApiModelProperty("是否密评 0:否 1:是")
private Integer isSecretComments;

@ApiModelProperty("项目简介")
private String projectIntroduction;

@ApiModelProperty("资金申报情况-申报金额(万元)")
private BigDecimal declareAmount;

@ApiModelProperty("资金申报情况-自有金额(万元)")
private BigDecimal declareHaveAmount;

@ApiModelProperty("资金申报情况-政府投资-本级财政资金(万元)")
private BigDecimal declareGovernmentOwnFinanceAmount;

@ApiModelProperty("资金申报情况-政府投资-上级补助资金(万元)")
private BigDecimal declareGovernmentSuperiorFinanceAmount;

@ApiModelProperty("银行贷款(万元)")
private BigDecimal declareBankLendingAmount;

@ApiModelProperty("其它资金(万元)")
private BigDecimal declareOtherAmount;

@ApiModelProperty("资金分配情况-软件开发(万元)")
private BigDecimal softwareDevelopmentAmount;

@ApiModelProperty("资金分配情况-云资源、硬件购置(万元)")
private BigDecimal cloudHardwarePurchaseAmount;

@ApiModelProperty("资金分配情况-第三方服务(万元)")
private BigDecimal thirdPartyAmount;

@ApiModelProperty("年度支付计划-年度支付计划(万元)")
private BigDecimal annualPlanAmount;

@ApiModelProperty("年度支付计划-自有金额(万元)")
private BigDecimal annualPlanHaveAmount;

@ApiModelProperty("年度支付计划-政府投资-本级财政资金(万元)")
private BigDecimal annualPlanGovernmentOwnFinanceAmount;

@ApiModelProperty("年度支付计划-政府投资-上级补助资金(万元)")
private BigDecimal annualPlanGovernmentSuperiorFinanceAmount;

@ApiModelProperty("年度支付计划-银行贷款(万元)")
private BigDecimal annualPlanBankLendingAmount;

@ApiModelProperty("年度支付计划-其它资金(万元)")
private BigDecimal annualPlanOtherAmount;

@ApiModelProperty("立项批复资金(万元)")
private BigDecimal approvalAmount;

private LocalDateTime annualPlanAddTime;

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

@ApiModelProperty("安全投入-投入项")
private String safetyInputTitle;

@ApiModelProperty("安全投入-内容描述")
private String safetyInputDescribe;

@ApiModelProperty("安全投入-金额(万元)")
private BigDecimal safetyInputAmount;

@ApiModelProperty("附件-初步方案")
private String preliminaryPlanFile;

@ApiModelProperty("附件-佐证材料")
private String supportingMaterialsFile;

@ApiModelProperty("附件-项目总投资测算明细")
private String calculationTotalInvestmentFile;

@ApiModelProperty("附件-申报单位主要职责(单位三定方案)")
private String mainResponsibilitiesApplicantFile;

@ApiModelProperty("备注")
private String projectRemarks;

@ApiModelProperty("是否包含应用 0:否 1:是")
private Integer includeApplication;

@ApiModelProperty("工程形象进度-第一季度")
private String engineeringSpeedOne;

@ApiModelProperty("工程形象进度-第二季度")
private String engineeringSpeedTwo;

@ApiModelProperty("工程形象进度-第三季度")
private String engineeringSpeedThree;

@ApiModelProperty("工程形象进度-第四季度")
private String engineeringSpeedFour;

@ApiModelProperty("核心业务-是否开启核心业务模块 false:关闭 true:开启")
private Boolean isOpenCoreBusiness;

@ApiModelProperty("安全投入-是否开启安全投入模块 false:关闭 true:开启")
private Boolean isOpenSafetyInput;

@ApiModelProperty("工程形象进度-是否开启 false:关闭 true:开启")
private Boolean isEngineeringSpeed;

@ApiModelProperty("附件-是否开启 false:关闭 true:开启")
private Boolean isAccessories;

@ApiModelProperty("备注-是否开启 false:关闭 true:开启")
private Boolean isRemarks;

@ApiModelProperty("年度支付计划-是否开启 false:关闭 true:开启")
private Boolean isAnnualPlanAmount;

@ApiModelProperty("一地创新全省共享项目-是否开启 false:关闭 true:开启")
private Boolean isInnovateWholeProvinceShare;

private LocalDateTime createOn;

private LocalDateTime updateOn;

@ApiModelProperty("流程实例编号")
private String instCode;

@ApiModelProperty("安全投入-模块信息")
private String safetyInputModular;

@ApiModelProperty("项目申报pdf")
private String projectPdf;

@ApiModelProperty("立项申报pdf")
private String declarationPdf;

@ApiModelProperty("建设周期(月)")
private String buildCycle;

@ApiModelProperty("建设方案文件")
private String constructionPlanFile;

@ApiModelProperty("立项批复文件")
private String approvedFile;

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

@ApiModelProperty("上级主管部门")
private String higherSuperUnit;

@ApiModelProperty("上级主管部门Code")
private String higherSuperUnitCode;

@ApiModelProperty("主管部门名称")
private String superUnit;

@ApiModelProperty("主管部门Code")
private String superUnitCode;

@ApiModelProperty("前端所需验证字段")
private Integer allApplicationsDone;

private Long createBy;

private Long updateBy;

}

+ 5
- 5
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectLibListReq.java View File

@@ -29,7 +29,7 @@ public class ProjectLibListReq extends PagePo {
private String projectName;

@ApiModelProperty("申报单位")
private String applyOrg;
private String buildUnit;

@ApiModelProperty("项目类型")
private Integer projectType;
@@ -44,16 +44,16 @@ public class ProjectLibListReq extends PagePo {
private Integer status2nd;

@ApiModelProperty("申报金额")
private BigDecimal declaredAmountMin;
private BigDecimal declareAmountMin;

@ApiModelProperty("申报金额")
private BigDecimal declaredAmountMax;
private BigDecimal declareAmountMax;

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

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

@ApiModelProperty("创建时间")
private LocalDateTime createOnMin;


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java View File

@@ -44,10 +44,10 @@ public class ProjectLibListItemVO {
private Integer projectYear;

@ApiModelProperty("申报单位")
private String applyOrg;
private String buildUnit;

@ApiModelProperty("业务领域")
private String bizArea;
private String bizDomain;

@ApiModelProperty("创建时间")
private LocalDateTime createOn;


+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/INdProjectService.java View File

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

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

/**
* <p>
* 服务类
* </p>
*
* @author WendyYang
* @since 2023-02-03
*/
public interface INdProjectService extends IService<Project> {

}

+ 20
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/NdProjectServiceImpl.java View File

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

import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.mapper.NdProjectMapper;
import com.ningdatech.pmapi.projectlib.service.INdProjectService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
* <p>
* 服务实现类
* </p>
*
* @author WendyYang
* @since 2023-02-03
*/
@Service
public class NdProjectServiceImpl extends ServiceImpl<NdProjectMapper, Project> implements INdProjectService {

}

Loading…
Cancel
Save