From 4fb0e7d23db79c8c9f7b93048027a6ce247ce6fd Mon Sep 17 00:00:00 2001 From: WendyYang Date: Sat, 11 Feb 2023 14:54:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=97=E6=AE=B5=E9=87=8D=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AnnualPlanController.java | 21 +++++++ .../controller/ProjectLibController.java | 4 +- .../pmapi/projectlib/helper/ProjectHelper.java | 46 +++++++++++++++ .../projectlib/manage/AnnualPlanLibManage.java | 25 ++++++++ .../pmapi/projectlib/manage/ProjectLibManage.java | 42 +++----------- .../pmapi/projectlib/model/entity/Project.java | 30 ++++------ .../projectlib/model/req/ProjectLibListReq.java | 64 --------------------- .../pmapi/projectlib/model/req/ProjectListReq.java | 67 ++++++++++++++++++++++ .../projectlib/model/vo/ProjectLibListItemVO.java | 8 +-- 9 files changed, 184 insertions(+), 123 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/helper/ProjectHelper.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectLibListReq.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectListReq.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java new file mode 100644 index 0000000..718b28a --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java @@ -0,0 +1,21 @@ +package com.ningdatech.pmapi.projectlib.controller; + +import io.swagger.annotations.Api; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * AnnualPlanController + *

+ * + * @author WendyYang + * @since 14:07 2023/2/11 + */ +@RestController +@Api(tags = "年度计划库") +@RequestMapping("/api/v1/annualPlan") +public class AnnualPlanController { + + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java index e253c82..70b9f22 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java @@ -2,7 +2,7 @@ package com.ningdatech.pmapi.projectlib.controller; import com.ningdatech.basic.model.PageVo; import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; -import com.ningdatech.pmapi.projectlib.model.req.ProjectLibListReq; +import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -29,7 +29,7 @@ public class ProjectLibController { @GetMapping("/list") @ApiOperation("项目库列表") - public PageVo projectLibList(ProjectLibListReq req) { + public PageVo projectLibList(ProjectListReq req) { return projectLibManage.projectLibList(req); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/helper/ProjectHelper.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/helper/ProjectHelper.java new file mode 100644 index 0000000..264d154 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/helper/ProjectHelper.java @@ -0,0 +1,46 @@ +package com.ningdatech.pmapi.projectlib.helper; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.ningdatech.pmapi.projectlib.model.entity.Project; +import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; + +/** + *

+ * ProjectHelper + *

+ * + * @author WendyYang + * @since 14:15 2023/2/11 + */ +public class ProjectHelper { + + /** + * 通用项目查询 + * + * @param req 查询条件 + * @return / + **/ + public static LambdaQueryWrapper projectQuery(ProjectListReq req) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(req.getRegionCode() != null, Project::getAreaCode, req.getRegionCode()); + query.eq(req.getUserId() != null, Project::getCreateBy, req.getUserId()); + query.like(req.getProjectName() != null, Project::getProjectName, req.getProjectName()); + query.eq(req.getProjectType() != null, Project::getProjectType, req.getProjectType()); + query.eq(req.getProjectYear() != null, Project::getProjectYear, req.getProjectYear()); + query.eq(req.getStage() != null, Project::getStage, req.getStage()); + query.eq(req.getStatus() != null, Project::getStatus, req.getStatus()); + // 申报金额 + query.ge(req.getDeclareAmountMin() != null, Project::getDeclareAmount, req.getDeclareAmountMin()); + query.le(req.getDeclareAmountMax() != null, Project::getDeclareAmount, req.getDeclareAmountMax()); + // 申报时间 + query.ge(req.getCreateOnMin() != null, Project::getCreateOn, req.getCreateOnMin()); + query.le(req.getCreateOnMax() != null, Project::getCreateOn, req.getCreateOnMax()); + // 批复金额 + query.ge(req.getApproveAmountMin() != null, Project::getApprovalAmount, req.getApproveAmountMin()); + query.le(req.getApproveAmountMax() != null, Project::getApprovalAmount, req.getApproveAmountMax()); + + query.like(req.getBuildOrg() != null, Project::getBuildOrgName, req.getBuildOrg()); + return query; + } + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java new file mode 100644 index 0000000..e4e3663 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java @@ -0,0 +1,25 @@ +package com.ningdatech.pmapi.projectlib.manage; + +import com.ningdatech.pmapi.projectlib.service.IProjectService; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Component; + +/** + *

+ * AnnualPlanLibManage + *

+ * + * @author WendyYang + * @since 14:09 2023/2/11 + */ +@Component +@AllArgsConstructor +public class AnnualPlanLibManage { + + private final IProjectService projectService; + + public void annulPlanLibList() { + + } + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index c61e5d3..ab4640e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -1,12 +1,12 @@ package com.ningdatech.pmapi.projectlib.manage; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -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.helper.ProjectHelper; import com.ningdatech.pmapi.projectlib.model.entity.Project; -import com.ningdatech.pmapi.projectlib.model.req.ProjectLibListReq; +import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; import com.ningdatech.pmapi.projectlib.service.IProjectService; import lombok.RequiredArgsConstructor; @@ -14,9 +14,6 @@ import org.springframework.stereotype.Component; import java.util.List; -import static com.ningdatech.pmapi.common.utils.BizUtils.notBlank; -import static com.ningdatech.pmapi.common.utils.BizUtils.notNull; - /** *

* ProjectLibManage @@ -31,33 +28,8 @@ public class ProjectLibManage { private final IProjectService projectService; - private LambdaQueryWrapper projectLibQuery(ProjectLibListReq req) { - LambdaQueryWrapper 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.getApproveAmountMin(), w -> query.ge(Project::getApprovalAmount, w)); - notNull(req.getApproveAmountMax(), w -> query.le(Project::getApprovalAmount, 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(Project::getStage, w)); - notNull(req.getStatus2nd(), w -> query.ge(Project::getStatus, w)); - - notNull(req.getCreateOnMin(), w -> query.ge(Project::getCreateOn, w)); - notNull(req.getCreateOnMax(), w -> query.le(Project::getCreateOn, w)); - - notBlank(req.getBuildUnit(), w -> query.like(Project::getBuildUnitName, w)); - - query.orderByDesc(Project::getUpdateOn, Project::getCreateOn); - // TODO 区域编码处理 - return query; - } - - public PageVo projectLibList(ProjectLibListReq req) { - LambdaQueryWrapper query = projectLibQuery(req); + public PageVo projectLibList(ProjectListReq req) { + LambdaQueryWrapper query = ProjectHelper.projectQuery(req); Page page = projectService.page(req.page(), query); long total; if ((total = page.getTotal()) == 0) { @@ -69,11 +41,11 @@ public class ProjectLibManage { item.setProjectName(w.getProjectName()); item.setCreateOn(w.getCreateOn()); item.setDeclaredAmount(w.getDeclareAmount()); - item.setStatus1st(w.getStage()); - item.setStatus2nd(w.getStatus()); + item.setStage(w.getStage()); + item.setStatus(w.getStatus()); item.setProjectType(w.getProjectType()); item.setProjectYear(w.getProjectYear()); - item.setBuildUnit(w.getBuildUnitName()); + item.setBuildOrg(w.getBuildOrgName()); item.setBizDomain(w.getBizDomain()); return item; }); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java index 4f64203..e607751 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java @@ -1,7 +1,5 @@ package com.ningdatech.pmapi.projectlib.model.entity; -import cn.hutool.core.io.FileUtil; -import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; @@ -11,15 +9,11 @@ import lombok.Data; import java.io.Serializable; import java.math.BigDecimal; -import java.nio.charset.StandardCharsets; import java.time.LocalDateTime; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; /** *

- * + * 项目b *

* * @author WendyYang @@ -67,13 +61,13 @@ public class Project implements Serializable { private String contactPhone; @ApiModelProperty("建设单位名称") - private String buildUnitName; + private String buildOrgName; @ApiModelProperty("建设单位统一社会信用代码") - private String buildUnitCode; + private String buildOrgCode; @ApiModelProperty("建设单位浙政钉ID") - private String buildUnitZheJiangGovernmentDingId; + private String buildOrgZheJiangGovDingId; @ApiModelProperty("项目类型 1:建设 2:运维") private Integer projectType; @@ -132,10 +126,10 @@ public class Project implements Serializable { private BigDecimal declareHaveAmount; @ApiModelProperty("资金申报情况-政府投资-本级财政资金(万元)") - private BigDecimal declareGovernmentOwnFinanceAmount; + private BigDecimal declareGovOwnFinanceAmount; @ApiModelProperty("资金申报情况-政府投资-上级补助资金(万元)") - private BigDecimal declareGovernmentSuperiorFinanceAmount; + private BigDecimal declareGovSuperiorFinanceAmount; @ApiModelProperty("银行贷款(万元)") private BigDecimal declareBankLendingAmount; @@ -159,10 +153,10 @@ public class Project implements Serializable { private BigDecimal annualPlanHaveAmount; @ApiModelProperty("年度支付计划-政府投资-本级财政资金(万元)") - private BigDecimal annualPlanGovernmentOwnFinanceAmount; + private BigDecimal annualPlanGovOwnFinanceAmount; @ApiModelProperty("年度支付计划-政府投资-上级补助资金(万元)") - private BigDecimal annualPlanGovernmentSuperiorFinanceAmount; + private BigDecimal annualPlanGovSuperiorFinanceAmount; @ApiModelProperty("年度支付计划-银行贷款(万元)") private BigDecimal annualPlanBankLendingAmount; @@ -267,16 +261,16 @@ public class Project implements Serializable { private BigDecimal approvedTotalInvestmentIncrease; @ApiModelProperty("上级主管部门") - private String higherSuperUnit; + private String higherSuperOrg; @ApiModelProperty("上级主管部门Code") - private String higherSuperUnitCode; + private String higherSuperOrgCode; @ApiModelProperty("主管部门名称") - private String superUnit; + private String superOrg; @ApiModelProperty("主管部门Code") - private String superUnitCode; + private String superOrgCode; @ApiModelProperty("前端所需验证字段") private Integer allApplicationsDone; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectLibListReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectLibListReq.java deleted file mode 100644 index 4b8a807..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectLibListReq.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.ningdatech.pmapi.projectlib.model.req; - -import com.ningdatech.basic.model.PagePo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; -import java.time.LocalDateTime; - -/** - *

- * ProjectLibListReq - *

- * - * @author WendyYang - * @since 14:35 2023/2/1 - */ -@Data -@ApiModel("项目库列表查询") -@EqualsAndHashCode(callSuper = true) -public class ProjectLibListReq extends PagePo { - - @ApiModelProperty("区域编码") - private String regionCode; - - @ApiModelProperty("项目名称") - private String projectName; - - @ApiModelProperty("申报单位") - private String buildUnit; - - @ApiModelProperty("项目类型") - private Integer projectType; - - @ApiModelProperty("预算年度") - private Integer projectYear; - - @ApiModelProperty("项目状态") - private Integer status1st; - - @ApiModelProperty("项目状态") - private Integer status2nd; - - @ApiModelProperty("申报金额") - private BigDecimal declareAmountMin; - - @ApiModelProperty("申报金额") - private BigDecimal declareAmountMax; - - @ApiModelProperty("批复金额") - private BigDecimal approveAmountMin; - - @ApiModelProperty("批复金额") - private BigDecimal approveAmountMax; - - @ApiModelProperty("创建时间") - private LocalDateTime createOnMin; - - @ApiModelProperty("创建时间") - private LocalDateTime createOnMax; - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectListReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectListReq.java new file mode 100644 index 0000000..0048072 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectListReq.java @@ -0,0 +1,67 @@ +package com.ningdatech.pmapi.projectlib.model.req; + +import com.ningdatech.basic.model.PagePo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + *

+ * ProjectLibListReq + *

+ * + * @author WendyYang + * @since 14:35 2023/2/1 + */ +@Data +@ApiModel("项目列表查询") +@EqualsAndHashCode(callSuper = true) +public class ProjectListReq extends PagePo { + + @ApiModelProperty("区域编码") + private String regionCode; + + @ApiModelProperty("项目名称") + private String projectName; + + @ApiModelProperty("申报单位") + private String buildOrg; + + @ApiModelProperty("项目类型") + private Integer projectType; + + @ApiModelProperty("预算年度") + private Integer projectYear; + + @ApiModelProperty("项目阶段") + private Integer stage; + + @ApiModelProperty("项目状态") + private Integer status; + + @ApiModelProperty("申报金额") + private BigDecimal declareAmountMin; + + @ApiModelProperty("申报金额") + private BigDecimal declareAmountMax; + + @ApiModelProperty("批复金额") + private BigDecimal approveAmountMin; + + @ApiModelProperty("批复金额") + private BigDecimal approveAmountMax; + + @ApiModelProperty("创建时间") + private LocalDateTime createOnMin; + + @ApiModelProperty("创建时间") + private LocalDateTime createOnMax; + + @ApiModelProperty("用户ID") + private Long userId; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java index 3198cdc..73268a0 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java @@ -34,17 +34,17 @@ public class ProjectLibListItemVO { @ApiModelProperty("项目类型") private Integer projectType; - @ApiModelProperty("项目状态") - private Integer status1st; + @ApiModelProperty("项目阶段") + private Integer stage; @ApiModelProperty("项目状态") - private Integer status2nd; + private Integer status; @ApiModelProperty("申报年度") private Integer projectYear; @ApiModelProperty("申报单位") - private String buildUnit; + private String buildOrg; @ApiModelProperty("业务领域") private String bizDomain;