@@ -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; | |||
/** | |||
* <p> | |||
* AnnualPlanController | |||
* </p> | |||
* | |||
* @author WendyYang | |||
* @since 14:07 2023/2/11 | |||
*/ | |||
@RestController | |||
@Api(tags = "年度计划库") | |||
@RequestMapping("/api/v1/annualPlan") | |||
public class AnnualPlanController { | |||
} |
@@ -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<ProjectLibListItemVO> projectLibList(ProjectLibListReq req) { | |||
public PageVo<ProjectLibListItemVO> projectLibList(ProjectListReq req) { | |||
return projectLibManage.projectLibList(req); | |||
} | |||
@@ -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; | |||
/** | |||
* <p> | |||
* ProjectHelper | |||
* </p> | |||
* | |||
* @author WendyYang | |||
* @since 14:15 2023/2/11 | |||
*/ | |||
public class ProjectHelper { | |||
/** | |||
* 通用项目查询 | |||
* | |||
* @param req 查询条件 | |||
* @return / | |||
**/ | |||
public static LambdaQueryWrapper<Project> projectQuery(ProjectListReq req) { | |||
LambdaQueryWrapper<Project> 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; | |||
} | |||
} |
@@ -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; | |||
/** | |||
* <p> | |||
* AnnualPlanLibManage | |||
* </p> | |||
* | |||
* @author WendyYang | |||
* @since 14:09 2023/2/11 | |||
*/ | |||
@Component | |||
@AllArgsConstructor | |||
public class AnnualPlanLibManage { | |||
private final IProjectService projectService; | |||
public void annulPlanLibList() { | |||
} | |||
} |
@@ -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; | |||
/** | |||
* <p> | |||
* ProjectLibManage | |||
@@ -31,33 +28,8 @@ public class ProjectLibManage { | |||
private final IProjectService projectService; | |||
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.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<ProjectLibListItemVO> projectLibList(ProjectLibListReq req) { | |||
LambdaQueryWrapper<Project> query = projectLibQuery(req); | |||
public PageVo<ProjectLibListItemVO> projectLibList(ProjectListReq req) { | |||
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req); | |||
Page<Project> 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; | |||
}); | |||
@@ -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; | |||
/** | |||
* <p> | |||
* | |||
* 项目b | |||
* </p> | |||
* | |||
* @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; | |||
@@ -18,9 +18,9 @@ import java.time.LocalDateTime; | |||
* @since 14:35 2023/2/1 | |||
*/ | |||
@Data | |||
@ApiModel("项目库列表查询") | |||
@ApiModel("项目列表查询") | |||
@EqualsAndHashCode(callSuper = true) | |||
public class ProjectLibListReq extends PagePo { | |||
public class ProjectListReq extends PagePo { | |||
@ApiModelProperty("区域编码") | |||
private String regionCode; | |||
@@ -29,7 +29,7 @@ public class ProjectLibListReq extends PagePo { | |||
private String projectName; | |||
@ApiModelProperty("申报单位") | |||
private String buildUnit; | |||
private String buildOrg; | |||
@ApiModelProperty("项目类型") | |||
private Integer projectType; | |||
@@ -37,11 +37,11 @@ public class ProjectLibListReq extends PagePo { | |||
@ApiModelProperty("预算年度") | |||
private Integer projectYear; | |||
@ApiModelProperty("项目状态") | |||
private Integer status1st; | |||
@ApiModelProperty("项目阶段") | |||
private Integer stage; | |||
@ApiModelProperty("项目状态") | |||
private Integer status2nd; | |||
private Integer status; | |||
@ApiModelProperty("申报金额") | |||
private BigDecimal declareAmountMin; | |||
@@ -61,4 +61,7 @@ public class ProjectLibListReq extends PagePo { | |||
@ApiModelProperty("创建时间") | |||
private LocalDateTime createOnMax; | |||
@ApiModelProperty("用户ID") | |||
private Long userId; | |||
} |
@@ -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; | |||