@@ -6,12 +6,14 @@ import com.ningdatech.pmapi.expert.manage.ReviewTemplateSettingsManage; | |||
import com.ningdatech.pmapi.expert.model.req.ReviewTemplateReq; | |||
import com.ningdatech.pmapi.expert.model.vo.ReviewTemplateVO; | |||
import io.swagger.annotations.Api; | |||
import io.swagger.annotations.ApiImplicitParam; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import io.swagger.annotations.ApiOperation; | |||
import lombok.AllArgsConstructor; | |||
import org.springframework.web.bind.annotation.*; | |||
import javax.validation.Valid; | |||
import java.util.List; | |||
/** | |||
* <p> | |||
@@ -42,10 +44,18 @@ public class ReviewTemplateSettingsController { | |||
reviewTemplateSettingsManage.saveOrUpdate(req); | |||
} | |||
@GetMapping("/template/{templateId}") | |||
@GetMapping("/template") | |||
@ApiModelProperty("根据模版ID获取评审模版") | |||
public ReviewTemplateVO getTemplateById(@PathVariable Long templateId) { | |||
@ApiImplicitParam(name = "templateId", defaultValue = "模版ID") | |||
public ReviewTemplateVO getTemplateById(@RequestParam Long templateId) { | |||
return reviewTemplateSettingsManage.getReviewTemplateSettings(templateId); | |||
} | |||
@GetMapping("/templates") | |||
@ApiModelProperty("(批量)根据模版ID获取评审模版") | |||
@ApiImplicitParam(name = "templateIds", defaultValue = "模版ID集合") | |||
public List<ReviewTemplateVO> getTemplateById(@RequestParam List<Long> templateIds) { | |||
return reviewTemplateSettingsManage.listReviewTemplateSettings(templateIds); | |||
} | |||
} |
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.ningdatech.basic.exception.BizException; | |||
import com.ningdatech.basic.util.CollUtils; | |||
import com.ningdatech.pmapi.common.constant.BizConst; | |||
import com.ningdatech.pmapi.expert.model.dto.ReviewTemplateSettingsDTO; | |||
import com.ningdatech.pmapi.expert.model.entity.ReviewTemplateSettings; | |||
@@ -16,6 +17,8 @@ import lombok.AllArgsConstructor; | |||
import org.springframework.stereotype.Component; | |||
import org.springframework.transaction.annotation.Transactional; | |||
import java.util.List; | |||
/** | |||
* <p> | |||
* ReviewTemplateSettingsManage | |||
@@ -62,6 +65,11 @@ public class ReviewTemplateSettingsManage { | |||
return buildTemplateDetail(settings); | |||
} | |||
public List<ReviewTemplateVO> listReviewTemplateSettings(List<Long> templateIds) { | |||
List<ReviewTemplateSettings> settings = reviewTemplateSettingsService.listByIds(templateIds); | |||
return CollUtils.convert(settings, this::buildTemplateDetail); | |||
} | |||
private ReviewTemplateVO buildTemplateDetail(ReviewTemplateSettings settings) { | |||
if (settings == null) { | |||
throw BizException.wrap("模版不存在"); | |||
@@ -1,8 +1,6 @@ | |||
package com.ningdatech.pmapi.expert.model.entity; | |||
import com.baomidou.mybatisplus.annotation.IdType; | |||
import com.baomidou.mybatisplus.annotation.TableId; | |||
import com.baomidou.mybatisplus.annotation.TableName; | |||
import com.baomidou.mybatisplus.annotation.*; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
@@ -41,12 +39,16 @@ public class ReviewTemplateSettings implements Serializable { | |||
@ApiModelProperty("区域编码") | |||
private String regionCode; | |||
@TableField(fill = FieldFill.INSERT) | |||
private Long createBy; | |||
@TableField(fill = FieldFill.INSERT_UPDATE) | |||
private Long updateBy; | |||
@TableField(fill = FieldFill.INSERT) | |||
private LocalDateTime createOn; | |||
@TableField(fill = FieldFill.INSERT_UPDATE) | |||
private LocalDateTime updateOn; | |||
} |
@@ -1,9 +1,16 @@ | |||
package com.ningdatech.pmapi.projectlib.controller; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.stereotype.Controller; | |||
import com.ningdatech.basic.model.PageVo; | |||
import com.ningdatech.pmapi.projectlib.manage.ProjectRenewalFundManage; | |||
import com.ningdatech.pmapi.projectlib.model.dto.ProjectRenewalFundDeclarationDTO; | |||
import com.ningdatech.pmapi.projectlib.model.req.ProjectRenewalListReq; | |||
import com.ningdatech.pmapi.projectlib.model.vo.ProjectRenewalFundDeclarationVO; | |||
import io.swagger.annotations.Api; | |||
import io.swagger.annotations.ApiOperation; | |||
import lombok.AllArgsConstructor; | |||
import org.springframework.validation.annotation.Validated; | |||
import org.springframework.web.bind.annotation.*; | |||
/** | |||
* <p> | |||
@@ -13,8 +20,28 @@ import org.springframework.stereotype.Controller; | |||
* @author WendyYang | |||
* @since 2023-02-15 | |||
*/ | |||
@Controller | |||
@RequestMapping("/pmapi.projectlib/nd-project-renewal-fund-declaration") | |||
@RestController | |||
@RequestMapping("/api/v1/project/renewal") | |||
@AllArgsConstructor | |||
@Api(tags = "续建项目资金库") | |||
public class ProjectRenewalFundDeclarationController { | |||
private final ProjectRenewalFundManage projectRenewalFundManage; | |||
@GetMapping("/list") | |||
@ApiOperation("项目续建资金库") | |||
public PageVo<ProjectRenewalFundDeclarationVO> list(ProjectRenewalListReq req) { | |||
return projectRenewalFundManage.list(req); | |||
} | |||
@GetMapping("/{id}") | |||
@ApiOperation("项目续建资金详情") | |||
private ProjectRenewalFundDeclarationVO detail (@PathVariable Long id){ | |||
return projectRenewalFundManage.detail(id); | |||
} | |||
@PostMapping("/declared") | |||
@ApiOperation("项目续建资金申请") | |||
private Long declared (@Validated @RequestBody ProjectRenewalFundDeclarationDTO dto){ | |||
return projectRenewalFundManage.declared(dto); | |||
} | |||
} |
@@ -0,0 +1,104 @@ | |||
package com.ningdatech.pmapi.projectlib.manage; | |||
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.enumeration.ProjectRenewalApprovalStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.model.dto.ProjectRenewalFundDeclarationDTO; | |||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | |||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectRenewalFundDeclaration; | |||
import com.ningdatech.pmapi.projectlib.model.req.ProjectRenewalListReq; | |||
import com.ningdatech.pmapi.projectlib.model.vo.ProjectRenewalFundDeclarationVO; | |||
import com.ningdatech.pmapi.projectlib.service.IProjectRenewalFundDeclarationService; | |||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | |||
import com.wflow.exception.BusinessException; | |||
import lombok.RequiredArgsConstructor; | |||
import org.springframework.beans.BeanUtils; | |||
import org.springframework.stereotype.Component; | |||
import java.time.LocalDateTime; | |||
import java.util.List; | |||
import java.util.Objects; | |||
/** | |||
* <p> | |||
* ProjectRenewalFundManage | |||
* </p> | |||
* | |||
* @author ZPF | |||
* @since 14:19 2023/2/15 | |||
*/ | |||
@Component | |||
@RequiredArgsConstructor | |||
public class ProjectRenewalFundManage { | |||
private final IProjectRenewalFundDeclarationService projectRenewalFundDeclarationService; | |||
private final IProjectService projectService; | |||
/** | |||
* 项目续建资金库列表 分页 | |||
* @param req | |||
* @return | |||
*/ | |||
public PageVo<ProjectRenewalFundDeclarationVO> list(ProjectRenewalListReq req) { | |||
Page<ProjectRenewalFundDeclaration> page = req.page(); | |||
projectRenewalFundDeclarationService.pageSql(page, req); | |||
long total; | |||
if ((total = page.getTotal()) == 0) { | |||
return PageVo.empty(); | |||
} | |||
List<ProjectRenewalFundDeclarationVO> records = CollUtils.convert(page.getRecords(), w -> { | |||
ProjectRenewalFundDeclarationVO item = new ProjectRenewalFundDeclarationVO(); | |||
BeanUtils.copyProperties(w,item); | |||
return item; | |||
}); | |||
return PageVo.of(records, total); | |||
} | |||
/** | |||
* @param id | |||
* @author ZPF | |||
* @since 2023/02/15 11:15 | |||
*/ | |||
public ProjectRenewalFundDeclarationVO detail(Long id) { | |||
// 查询项目申报信息 | |||
ProjectRenewalFundDeclaration renewal = projectRenewalFundDeclarationService.getById(id); | |||
if(Objects.isNull(renewal)){ | |||
return null; | |||
} | |||
ProjectRenewalFundDeclarationVO vo = new ProjectRenewalFundDeclarationVO(); | |||
BeanUtils.copyProperties(renewal, vo); | |||
// 查询项目信息 | |||
if(Objects.nonNull(vo)){ | |||
Project project = projectService.getById(renewal.getProjectId()); | |||
if(Objects.isNull(project)){ | |||
return vo; | |||
} | |||
vo.setApprovalAmount(project.getApprovalAmount()); | |||
vo.setProjectName(project.getProjectName()); | |||
vo.setProjectType(project.getProjectType()); | |||
vo.setStage(project.getStage()); | |||
vo.setStatus(project.getStatus()); | |||
} | |||
return vo; | |||
} | |||
/** | |||
* 申报 | |||
* @param dto | |||
* @return | |||
*/ | |||
public Long declared(ProjectRenewalFundDeclarationDTO dto) { | |||
ProjectRenewalFundDeclaration declaration = new ProjectRenewalFundDeclaration(); | |||
BeanUtils.copyProperties(dto,declaration); | |||
declaration.setId(null); | |||
declaration.setCreateOn(LocalDateTime.now()); | |||
declaration.setUpdateOn(LocalDateTime.now()); | |||
declaration.setApprovalStatus(ProjectRenewalApprovalStatusEnum.PENDING.name()); | |||
if(!projectRenewalFundDeclarationService.save(declaration)){ | |||
throw new BusinessException("申报失败"); | |||
} | |||
return declaration.getId(); | |||
} | |||
} |
@@ -1,7 +1,11 @@ | |||
package com.ningdatech.pmapi.projectlib.mapper; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectRenewalFundDeclaration; | |||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
import com.ningdatech.pmapi.projectlib.model.po.ProjectRenewalFundDeclarationPO; | |||
import com.ningdatech.pmapi.projectlib.model.req.ProjectRenewalListReq; | |||
import org.apache.ibatis.annotations.Param; | |||
/** | |||
* <p> | |||
@@ -13,4 +17,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
*/ | |||
public interface ProjectRenewalFundDeclarationMapper extends BaseMapper<ProjectRenewalFundDeclaration> { | |||
Page<ProjectRenewalFundDeclarationPO> pageSql(Page<ProjectRenewalFundDeclaration> page,@Param("param") ProjectRenewalListReq req); | |||
} |
@@ -2,4 +2,44 @@ | |||
<!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.ProjectRenewalFundDeclarationMapper"> | |||
<select id="pageSql" | |||
parameterType="com.ningdatech.pmapi.projectlib.model.req.ProjectRenewalListReq" | |||
resultType="com.ningdatech.pmapi.projectlib.model.po.ProjectRenewalFundDeclarationPO"> | |||
select | |||
prfd.id,prfd.create_on,prfd.update_on,prfd.project_id, | |||
prfd.project_year,prfd.annual_payment_amount,prfd.have_amount, | |||
prfd.gov_own_finance_amount,prfd.gov_superior_finance_amount, | |||
prfd.bank_lending_amount,prfd.other_amount,prfd.approval_status,prfd.deleted, | |||
p.project_type | |||
from nd_project_renewal_fund_declaration prfd | |||
left join nd_project p on prfd.project_id = p.id | |||
where prfd.deleted = false | |||
<if test="param.projectName != null and param.projectName != ''"> | |||
and p.project_name like concat('%',#{param.projectName},'%') | |||
</if> | |||
<if test="param.orgCode != null and param.orgCode != ''"> | |||
and prfd.org_code = #{param.orgCode} | |||
</if> | |||
<if test="param.regionCode != null and param.regionCode != ''"> | |||
and prfd.region_code = #{param.regionCode} | |||
</if> | |||
<if test="param.projectType != null"> | |||
and p.project_type = #{param.projectType} | |||
</if> | |||
<if test="param.projectYear != null"> | |||
and p.project_year = #{param.projectYear} | |||
</if> | |||
<if test="param.stage != null"> | |||
and p.stage = #{param.stage} | |||
</if> | |||
<if test="param.status != null"> | |||
and p.status = #{param.status} | |||
</if> | |||
<if test="param.createOnMin != null"> | |||
and p.create_on >= #{param.createOnMin} | |||
</if> | |||
<if test="param.createOnMax != null"> | |||
and p.create_on <= #{param.createOnMax} | |||
</if> | |||
</select> | |||
</mapper> |
@@ -0,0 +1,59 @@ | |||
package com.ningdatech.pmapi.projectlib.model.dto; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import java.io.Serializable; | |||
import java.math.BigDecimal; | |||
/** | |||
* <p> | |||
* 续建项目资金申请 | |||
* </p> | |||
* | |||
* @author WendyYang | |||
* @since 2023-02-15 | |||
*/ | |||
@ApiModel(value = "NdProjectRenewalFundDeclarationDTO", description = "续建项目资金申请表") | |||
@Data | |||
public class ProjectRenewalFundDeclarationDTO implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
@ApiModelProperty("主键") | |||
private Long id; | |||
@ApiModelProperty("关联项目ID") | |||
private Long projectId; | |||
@ApiModelProperty("项目年份") | |||
private Integer projectYear; | |||
@ApiModelProperty("年度支付金额") | |||
private BigDecimal annualPaymentAmount; | |||
@ApiModelProperty("自有资金") | |||
private BigDecimal haveAmount; | |||
@ApiModelProperty("政府投资 本级财务金额") | |||
private BigDecimal govOwnFinanceAmount; | |||
@ApiModelProperty("政府投资 上级财务金额") | |||
private BigDecimal govSuperiorFinanceAmount; | |||
@ApiModelProperty("银行贷款金额") | |||
private BigDecimal bankLendingAmount; | |||
@ApiModelProperty("其它金额") | |||
private BigDecimal otherAmount; | |||
@ApiModelProperty("单位code") | |||
private String orgCode; | |||
@ApiModelProperty("区域code") | |||
private String regionCode; | |||
@ApiModelProperty("是否删除 false未删 true已删") | |||
private Boolean deleted; | |||
} |
@@ -1,11 +1,14 @@ | |||
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 java.io.Serializable; | |||
import java.math.BigDecimal; | |||
import java.time.LocalDateTime; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
/** | |||
* <p> | |||
@@ -17,11 +20,13 @@ import io.swagger.annotations.ApiModelProperty; | |||
*/ | |||
@TableName("nd_project_renewal_fund_declaration") | |||
@ApiModel(value = "NdProjectRenewalFundDeclaration对象", description = "续建项目资金申请表") | |||
@Data | |||
public class ProjectRenewalFundDeclaration implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
@ApiModelProperty("主键") | |||
@TableId(type = IdType.AUTO) | |||
private Long id; | |||
@ApiModelProperty("创建时间") | |||
@@ -57,117 +62,14 @@ public class ProjectRenewalFundDeclaration implements Serializable { | |||
@ApiModelProperty("审核状态 待审核PENGING 审核通过PASS 审核不通过NO_PASS") | |||
private String approvalStatus; | |||
@ApiModelProperty("单位code") | |||
private String orgCode; | |||
@ApiModelProperty("区域code") | |||
private String regionCode; | |||
@ApiModelProperty("是否删除 false未删 true已删") | |||
private Boolean deleted; | |||
public Long getId() { | |||
return id; | |||
} | |||
public void setId(Long id) { | |||
this.id = id; | |||
} | |||
public LocalDateTime getCreateOn() { | |||
return createOn; | |||
} | |||
public void setCreateOn(LocalDateTime createOn) { | |||
this.createOn = createOn; | |||
} | |||
public LocalDateTime getUpdateOn() { | |||
return updateOn; | |||
} | |||
public void setUpdateOn(LocalDateTime updateOn) { | |||
this.updateOn = updateOn; | |||
} | |||
public Long getProjectId() { | |||
return projectId; | |||
} | |||
public void setProjectId(Long projectId) { | |||
this.projectId = projectId; | |||
} | |||
public Integer getProjectYear() { | |||
return projectYear; | |||
} | |||
public void setProjectYear(Integer projectYear) { | |||
this.projectYear = projectYear; | |||
} | |||
public BigDecimal getAnnualPaymentAmount() { | |||
return annualPaymentAmount; | |||
} | |||
public void setAnnualPaymentAmount(BigDecimal annualPaymentAmount) { | |||
this.annualPaymentAmount = annualPaymentAmount; | |||
} | |||
public BigDecimal getHaveAmount() { | |||
return haveAmount; | |||
} | |||
public void setHaveAmount(BigDecimal haveAmount) { | |||
this.haveAmount = haveAmount; | |||
} | |||
public BigDecimal getGovOwnFinanceAmount() { | |||
return govOwnFinanceAmount; | |||
} | |||
public void setGovOwnFinanceAmount(BigDecimal govOwnFinanceAmount) { | |||
this.govOwnFinanceAmount = govOwnFinanceAmount; | |||
} | |||
public BigDecimal getGovSuperiorFinanceAmount() { | |||
return govSuperiorFinanceAmount; | |||
} | |||
public void setGovSuperiorFinanceAmount(BigDecimal govSuperiorFinanceAmount) { | |||
this.govSuperiorFinanceAmount = govSuperiorFinanceAmount; | |||
} | |||
public BigDecimal getBankLendingAmount() { | |||
return bankLendingAmount; | |||
} | |||
public void setBankLendingAmount(BigDecimal bankLendingAmount) { | |||
this.bankLendingAmount = bankLendingAmount; | |||
} | |||
public BigDecimal getOtherAmount() { | |||
return otherAmount; | |||
} | |||
public void setOtherAmount(BigDecimal otherAmount) { | |||
this.otherAmount = otherAmount; | |||
} | |||
public String getApprovalStatus() { | |||
return approvalStatus; | |||
} | |||
public void setApprovalStatus(String approvalStatus) { | |||
this.approvalStatus = approvalStatus; | |||
} | |||
public Boolean getDeleted() { | |||
return deleted; | |||
} | |||
public void setDeleted(Boolean deleted) { | |||
this.deleted = deleted; | |||
} | |||
@Override | |||
public String toString() { | |||
return "NdProjectRenewalFundDeclaration{" + | |||
"id=" + id + | |||
", createOn=" + createOn + | |||
", updateOn=" + updateOn + | |||
", projectId=" + projectId + | |||
", projectYear=" + projectYear + | |||
", annualPaymentAmount=" + annualPaymentAmount + | |||
", haveAmount=" + haveAmount + | |||
", govOwnFinanceAmount=" + govOwnFinanceAmount + | |||
", govSuperiorFinanceAmount=" + govSuperiorFinanceAmount + | |||
", bankLendingAmount=" + bankLendingAmount + | |||
", otherAmount=" + otherAmount + | |||
", approvalStatus=" + approvalStatus + | |||
", deleted=" + deleted + | |||
"}"; | |||
} | |||
} |
@@ -0,0 +1,77 @@ | |||
package com.ningdatech.pmapi.projectlib.model.po; | |||
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-15 | |||
*/ | |||
@ApiModel(value = "NdProjectRenewalFundDeclarationPO", description = "续建项目资金申请表") | |||
@Data | |||
public class ProjectRenewalFundDeclarationPO implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
@ApiModelProperty("主键") | |||
private Long id; | |||
@ApiModelProperty("创建时间") | |||
private LocalDateTime createOn; | |||
@ApiModelProperty("修改时间") | |||
private LocalDateTime updateOn; | |||
@ApiModelProperty("关联项目ID") | |||
private Long projectId; | |||
@ApiModelProperty("项目年份") | |||
private Integer projectYear; | |||
@ApiModelProperty("年度支付金额") | |||
private BigDecimal annualPaymentAmount; | |||
@ApiModelProperty("自有资金") | |||
private BigDecimal haveAmount; | |||
@ApiModelProperty("政府投资 本级财务金额") | |||
private BigDecimal govOwnFinanceAmount; | |||
@ApiModelProperty("政府投资 上级财务金额") | |||
private BigDecimal govSuperiorFinanceAmount; | |||
@ApiModelProperty("银行贷款金额") | |||
private BigDecimal bankLendingAmount; | |||
@ApiModelProperty("其它金额") | |||
private BigDecimal otherAmount; | |||
@ApiModelProperty("审核状态 待审核PENGING 审核通过PASS 审核不通过NO_PASS") | |||
private String approvalStatus; | |||
@ApiModelProperty("单位code") | |||
private String orgCode; | |||
@ApiModelProperty("区域code") | |||
private String regionCode; | |||
@ApiModelProperty("项目类型") | |||
private Integer projectType; | |||
@ApiModelProperty("是否删除 false未删 true已删") | |||
private Boolean deleted; | |||
} |
@@ -0,0 +1,62 @@ | |||
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 org.springframework.format.annotation.DateTimeFormat; | |||
import java.time.LocalDateTime; | |||
import java.util.List; | |||
/** | |||
* <p> | |||
* ProjectRenewalListReq | |||
* </p> | |||
* | |||
* @author zpf | |||
* @since 14:35 2023/2/15 | |||
*/ | |||
@Data | |||
@ApiModel("项目续建资金库列表查询") | |||
@EqualsAndHashCode(callSuper = true) | |||
public class ProjectRenewalListReq extends PagePo { | |||
@ApiModelProperty("区域编码") | |||
private String regionCode; | |||
@ApiModelProperty("项目名称") | |||
private String projectName; | |||
@ApiModelProperty("项目类型") | |||
private Integer projectType; | |||
@ApiModelProperty("预算年度") | |||
private Integer projectYear; | |||
@ApiModelProperty("项目阶段") | |||
private Integer stage; | |||
@ApiModelProperty("项目状态") | |||
private Integer status; | |||
@ApiModelProperty("创建时间") | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
private LocalDateTime createOnMin; | |||
@ApiModelProperty("创建时间") | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
private LocalDateTime createOnMax; | |||
@ApiModelProperty("用户ID") | |||
private Long userId; | |||
@ApiModelProperty("单位code") | |||
private String orgCode; | |||
@ApiModelProperty("项目阶段 多个") | |||
private List<Integer> stageList; | |||
@ApiModelProperty("项目状态 多个") | |||
private List<Integer> statusList; | |||
} |
@@ -0,0 +1,84 @@ | |||
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; | |||
import java.time.LocalDateTime; | |||
/** | |||
* <p> | |||
* 续建项目资金申请表 | |||
* </p> | |||
* | |||
* @author WendyYang | |||
* @since 2023-02-15 | |||
*/ | |||
@ApiModel(value = "NdProjectRenewalFundDeclarationVO", description = "续建项目资金申请表") | |||
@Data | |||
public class ProjectRenewalFundDeclarationVO implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
@ApiModelProperty("主键") | |||
private Long id; | |||
@ApiModelProperty("创建时间") | |||
private LocalDateTime createOn; | |||
@ApiModelProperty("修改时间") | |||
private LocalDateTime updateOn; | |||
@ApiModelProperty("项目年份") | |||
private Integer projectYear; | |||
@ApiModelProperty("年度支付金额") | |||
private BigDecimal annualPaymentAmount; | |||
@ApiModelProperty("自有资金") | |||
private BigDecimal haveAmount; | |||
@ApiModelProperty("政府投资 本级财务金额") | |||
private BigDecimal govOwnFinanceAmount; | |||
@ApiModelProperty("政府投资 上级财务金额") | |||
private BigDecimal govSuperiorFinanceAmount; | |||
@ApiModelProperty("银行贷款金额") | |||
private BigDecimal bankLendingAmount; | |||
@ApiModelProperty("其它金额") | |||
private BigDecimal otherAmount; | |||
@ApiModelProperty("审核状态 待审核PENGING 审核通过PASS 审核不通过NO_PASS") | |||
private String approvalStatus; | |||
@ApiModelProperty("是否删除 false未删 true已删") | |||
private Boolean deleted; | |||
@ApiModelProperty("单位code") | |||
private String orgCode; | |||
@ApiModelProperty("区域code") | |||
private String regionCode; | |||
@ApiModelProperty("项目阶段") | |||
private Integer stage; | |||
@ApiModelProperty("项目状态") | |||
private Integer status; | |||
@ApiModelProperty("立项批复资金") | |||
private BigDecimal approvalAmount; | |||
@ApiModelProperty("关联项目ID") | |||
private Long projectId; | |||
@ApiModelProperty("关联项目名字") | |||
private String projectName; | |||
@ApiModelProperty("项目类型 1建设 2运维") | |||
private Integer projectType; | |||
} |
@@ -1,7 +1,10 @@ | |||
package com.ningdatech.pmapi.projectlib.service; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectRenewalFundDeclaration; | |||
import com.baomidou.mybatisplus.extension.service.IService; | |||
import com.ningdatech.pmapi.projectlib.model.po.ProjectRenewalFundDeclarationPO; | |||
import com.ningdatech.pmapi.projectlib.model.req.ProjectRenewalListReq; | |||
/** | |||
* <p> | |||
@@ -13,4 +16,5 @@ import com.baomidou.mybatisplus.extension.service.IService; | |||
*/ | |||
public interface IProjectRenewalFundDeclarationService extends IService<ProjectRenewalFundDeclaration> { | |||
Page<ProjectRenewalFundDeclarationPO> pageSql(Page<ProjectRenewalFundDeclaration> page, ProjectRenewalListReq req); | |||
} |
@@ -1,9 +1,13 @@ | |||
package com.ningdatech.pmapi.projectlib.service.impl; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectRenewalFundDeclaration; | |||
import com.ningdatech.pmapi.projectlib.mapper.ProjectRenewalFundDeclarationMapper; | |||
import com.ningdatech.pmapi.projectlib.model.po.ProjectRenewalFundDeclarationPO; | |||
import com.ningdatech.pmapi.projectlib.model.req.ProjectRenewalListReq; | |||
import com.ningdatech.pmapi.projectlib.service.IProjectRenewalFundDeclarationService; | |||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
import lombok.RequiredArgsConstructor; | |||
import org.springframework.stereotype.Service; | |||
/** | |||
@@ -15,6 +19,13 @@ import org.springframework.stereotype.Service; | |||
* @since 2023-02-15 | |||
*/ | |||
@Service | |||
public class ProjectRenewalFundDeclarationServiceImpl extends ServiceImpl<ProjectRenewalFundDeclarationMapper, ProjectRenewalFundDeclaration> implements IProjectRenewalFundDeclarationService { | |||
@RequiredArgsConstructor | |||
public class ProjectRenewalFundDeclarationServiceImpl extends | |||
ServiceImpl<ProjectRenewalFundDeclarationMapper, ProjectRenewalFundDeclaration> implements IProjectRenewalFundDeclarationService { | |||
private final ProjectRenewalFundDeclarationMapper mapper; | |||
@Override | |||
public Page<ProjectRenewalFundDeclarationPO> pageSql(Page<ProjectRenewalFundDeclaration> page, ProjectRenewalListReq req) { | |||
return mapper.pageSql(page,req); | |||
} | |||
} |
@@ -0,0 +1,18 @@ | |||
package com.ningdatech.pmapi.user.constant; | |||
/** | |||
* @author liuxinxin | |||
* @date 2023/2/15 下午5:13 | |||
*/ | |||
public enum UserAvailableEnum { | |||
/** | |||
* 启用 | |||
*/ | |||
ENABLE, | |||
/** | |||
* 禁用 | |||
*/ | |||
DISABLE | |||
} |
@@ -4,7 +4,8 @@ package com.ningdatech.pmapi.user.controller; | |||
import com.ningdatech.basic.model.PageVo; | |||
import com.ningdatech.pmapi.user.manage.UserInfoManage; | |||
import com.ningdatech.pmapi.user.model.po.ReqUserDetailEditPO; | |||
import com.ningdatech.pmapi.user.model.po.ReqUserDisablePO; | |||
import com.ningdatech.pmapi.user.model.po.ReqUserDetailPO; | |||
import com.ningdatech.pmapi.user.model.po.ReqUserDisableOrEnablePO; | |||
import com.ningdatech.pmapi.user.model.po.ReqUserInfoListPO; | |||
import com.ningdatech.pmapi.user.model.vo.ResUserDetailVO; | |||
import com.ningdatech.pmapi.user.model.vo.ResUserInfoListVO; | |||
@@ -38,14 +39,14 @@ public class UserInfoController { | |||
@ApiOperation(value = "用户禁用/启用", notes = "用户禁用/启用") | |||
@PostMapping("/disable-enable") | |||
public void disableOrEnable(@Valid @RequestBody ReqUserDisablePO reqUserDisablePO) { | |||
userInfoManage.disableOrEnable(reqUserDisablePO); | |||
public void disableOrEnable(@Valid @RequestBody ReqUserDisableOrEnablePO reqUserDisableOrEnablePO) { | |||
userInfoManage.disableOrEnable(reqUserDisableOrEnablePO); | |||
} | |||
@ApiOperation(value = "用户详情", notes = "用户详情") | |||
@PostMapping("/detail") | |||
public ResUserDetailVO userInfoDetail(@Valid @RequestBody ReqUserInfoListPO reqUserInfoListPO) { | |||
return userInfoManage.userInfoDetail(reqUserInfoListPO); | |||
public ResUserDetailVO userInfoDetail(@Valid @RequestBody ReqUserDetailPO reqUserDetailPO) { | |||
return userInfoManage.userInfoDetail(reqUserDetailPO); | |||
} | |||
@ApiOperation(value = "用户详情编辑", notes = "用户详情编辑") | |||
@@ -54,5 +55,4 @@ public class UserInfoController { | |||
userInfoManage.userInfoDetailEdit(reqUserDetailEditPO); | |||
} | |||
} |
@@ -21,6 +21,8 @@ import java.time.LocalDateTime; | |||
@TableName("nd_user_info") | |||
@Builder | |||
@Data | |||
@AllArgsConstructor | |||
@NoArgsConstructor | |||
@ApiModel(value = "NdUserInfo对象", description = "") | |||
@AllArgsConstructor | |||
@NoArgsConstructor | |||
@@ -48,4 +50,6 @@ public class UserInfo implements Serializable { | |||
private String available; | |||
private String employeeCode; | |||
} |
@@ -1,23 +1,34 @@ | |||
package com.ningdatech.pmapi.user.manage; | |||
import cn.hutool.core.collection.CollUtil; | |||
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.exception.BizException; | |||
import com.ningdatech.basic.model.PageVo; | |||
import com.ningdatech.pmapi.organization.model.entity.DingEmployeeInfo; | |||
import com.ningdatech.pmapi.organization.service.IDingEmployeeInfoService; | |||
import com.ningdatech.pmapi.organization.service.IDingOrganizationService; | |||
import com.ningdatech.pmapi.sys.model.entity.UserRole; | |||
import com.ningdatech.pmapi.sys.service.IUserRoleService; | |||
import com.ningdatech.pmapi.user.constant.UserAvailableEnum; | |||
import com.ningdatech.pmapi.user.entity.UserInfo; | |||
import com.ningdatech.pmapi.user.model.po.ReqUserDetailEditPO; | |||
import com.ningdatech.pmapi.user.model.po.ReqUserDisablePO; | |||
import com.ningdatech.pmapi.user.model.po.ReqUserDetailPO; | |||
import com.ningdatech.pmapi.user.model.po.ReqUserDisableOrEnablePO; | |||
import com.ningdatech.pmapi.user.model.po.ReqUserInfoListPO; | |||
import com.ningdatech.pmapi.user.model.vo.ResUserDetailVO; | |||
import com.ningdatech.pmapi.user.model.vo.ResUserInfoListVO; | |||
import com.ningdatech.pmapi.user.model.vo.UserRoleVO; | |||
import com.ningdatech.pmapi.user.service.IUserInfoService; | |||
import lombok.RequiredArgsConstructor; | |||
import org.springframework.stereotype.Component; | |||
import org.springframework.transaction.annotation.Transactional; | |||
import java.time.LocalDateTime; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
import java.util.Objects; | |||
import java.util.stream.Collectors; | |||
/** | |||
@@ -31,6 +42,7 @@ public class UserInfoManage { | |||
private final IDingOrganizationService iDingOrganizationService; | |||
private final IDingEmployeeInfoService iDingEmployeeInfoService; | |||
private final IUserInfoService iUserInfoService; | |||
private final IUserRoleService iUserRoleService; | |||
public PageVo<ResUserInfoListVO> list(ReqUserInfoListPO reqUserInfoListPO) { | |||
LambdaQueryWrapper<DingEmployeeInfo> wrapper = Wrappers.lambdaQuery(DingEmployeeInfo.class) | |||
@@ -67,16 +79,78 @@ public class UserInfoManage { | |||
return pageVo; | |||
} | |||
public void disableOrEnable(ReqUserDisablePO reqUserDisablePO) { | |||
public void disableOrEnable(ReqUserDisableOrEnablePO reqUserDisableOrEnablePO) { | |||
Long userId = generateUserId(reqUserDisableOrEnablePO.getEmployeeCode()); | |||
UserInfo userInfo = iUserInfoService.getById(userId); | |||
userInfo.setAvailable(reqUserDisableOrEnablePO.getOperation()); | |||
iUserInfoService.updateById(userInfo); | |||
} | |||
public ResUserDetailVO userInfoDetail(ReqUserInfoListPO reqUserInfoListPO) { | |||
return null; | |||
public ResUserDetailVO userInfoDetail(ReqUserDetailPO reqUserDetailPO) { | |||
Long userId = generateUserId(reqUserDetailPO.getEmployeeCode()); | |||
UserInfo userInfo = iUserInfoService.getById(userId); | |||
if (Objects.isNull(userInfo)) { | |||
return null; | |||
} | |||
ResUserDetailVO resUserDetailVO = new ResUserDetailVO(); | |||
resUserDetailVO.setUserId(userInfo.getId()); | |||
resUserDetailVO.setPhoneNo(userInfo.getMobile()); | |||
resUserDetailVO.setStatus(userInfo.getAvailable()); | |||
resUserDetailVO.setUserRoleInfoList(new ArrayList<>()); | |||
return resUserDetailVO; | |||
} | |||
@Transactional(rollbackFor = Exception.class) | |||
public void userInfoDetailEdit(ReqUserDetailEditPO reqUserDetailEditPO) { | |||
Long userId = generateUserId(reqUserDetailEditPO.getEmployeeCode()); | |||
UserInfo userInfo = iUserInfoService.getById(userId); | |||
if (Objects.isNull(userInfo)) { | |||
return; | |||
} | |||
userInfo.setMobile(reqUserDetailEditPO.getPhoneNo()); | |||
userInfo.setAvailable(reqUserDetailEditPO.getStatus()); | |||
iUserInfoService.updateById(userInfo); | |||
List<UserRoleVO> userRoleInfoList = reqUserDetailEditPO.getUserRoleInfoList(); | |||
iUserRoleService.remove(Wrappers.lambdaQuery(UserRole.class).eq(UserRole::getUserId, userId)); | |||
if (CollUtil.isNotEmpty(userRoleInfoList)) { | |||
List<UserRole> userRoleList = userRoleInfoList.stream().map(r -> { | |||
UserRole saveRecord = new UserRole(); | |||
saveRecord.setRoleId(r.getId()); | |||
saveRecord.setUserId(userId); | |||
return saveRecord; | |||
}).collect(Collectors.toList()); | |||
iUserRoleService.saveBatch(userRoleList); | |||
} | |||
} | |||
private Long generateUserId(String employeeCode) { | |||
UserInfo userInfo = iUserInfoService.getOne(Wrappers.lambdaQuery(UserInfo.class) | |||
.eq(UserInfo::getEmployeeCode, employeeCode)); | |||
if (Objects.isNull(userInfo)) { | |||
List<DingEmployeeInfo> dingEmployeeInfoList = iDingEmployeeInfoService.list(Wrappers.lambdaQuery(DingEmployeeInfo.class) | |||
.eq(DingEmployeeInfo::getMainJob, "true")); | |||
if (CollUtil.isEmpty(dingEmployeeInfoList)) { | |||
throw new BizException("员工账号不存在"); | |||
} | |||
DingEmployeeInfo dingEmployeeInfo = dingEmployeeInfoList.get(0); | |||
userInfo = UserInfo.builder() | |||
.accountId(dingEmployeeInfo.getAccountId()) | |||
.username(dingEmployeeInfo.getEmployeeName()) | |||
.realName(dingEmployeeInfo.getEmployeeName()) | |||
.available(UserAvailableEnum.DISABLE.name()) | |||
.createBy(-1L) | |||
.updateBy(-1L) | |||
.createOn(LocalDateTime.now()) | |||
.updateOn(LocalDateTime.now()) | |||
.build(); | |||
iUserInfoService.save(userInfo); | |||
} | |||
return userInfo.getId(); | |||
} | |||
} |
@@ -1,33 +0,0 @@ | |||
package com.ningdatech.pmapi.user.model.base; | |||
import com.baomidou.mybatisplus.annotation.TableField; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import javax.validation.constraints.Size; | |||
import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE; | |||
/** | |||
* @author liuxinxin | |||
* @date 2022/8/22 下午4:12 | |||
*/ | |||
@Data | |||
@ApiModel("用户角色信息") | |||
public class UserRoleInfo { | |||
@ApiModelProperty(value = "名称") | |||
private String name; | |||
@ApiModelProperty(value = "枚举code") | |||
private String code; | |||
@ApiModelProperty(value = "描述") | |||
@Size(max = 100, message = "描述长度不能超过100") | |||
@TableField(value = "describe", condition = LIKE) | |||
private String describe; | |||
@ApiModelProperty(value = "排序") | |||
private Integer roleSort; | |||
} |
@@ -1,10 +1,11 @@ | |||
package com.ningdatech.pmapi.user.model.po; | |||
import com.ningdatech.pmapi.user.model.base.UserRoleInfo; | |||
import com.ningdatech.pmapi.user.model.vo.UserRoleVO; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import javax.validation.constraints.NotBlank; | |||
import java.util.List; | |||
/** | |||
@@ -12,18 +13,24 @@ import java.util.List; | |||
* @date 2023/2/15 上午8:43 | |||
*/ | |||
@Data | |||
@ApiModel("获取用户详情编辑请求") | |||
@ApiModel("用户详情编辑请求") | |||
public class ReqUserDetailEditPO { | |||
@ApiModelProperty("userId") | |||
private Long userId; | |||
@NotBlank(message = "浙政钉 用户编码 不能为空") | |||
@ApiModelProperty("浙政钉 用户编码") | |||
private String employeeCode; | |||
@NotBlank(message = "用户手机号不能为空") | |||
@ApiModelProperty("手机号") | |||
private String phoneNo; | |||
@ApiModelProperty("状态 启用/禁用") | |||
private Boolean status; | |||
@NotBlank(message = "状态不能为空") | |||
@ApiModelProperty("状态 启用 ENABLE/禁用 DISABLE") | |||
private String status; | |||
@ApiModelProperty("用户角色信息列表") | |||
private List<UserRoleInfo> userRoleInfoList; | |||
private List<UserRoleVO> userRoleInfoList; | |||
} |
@@ -4,7 +4,7 @@ import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import javax.validation.constraints.NotNull; | |||
import javax.validation.constraints.NotBlank; | |||
/** | |||
* @author liuxinxin | |||
@@ -14,7 +14,11 @@ import javax.validation.constraints.NotNull; | |||
@ApiModel("获取用户详情请求") | |||
public class ReqUserDetailPO { | |||
@NotNull(message = "用户id 不能为空") | |||
@ApiModelProperty("用户id") | |||
private Long userId; | |||
@NotBlank(message = "浙政钉 用户编码 不能为空") | |||
@ApiModelProperty("浙政钉 用户编码") | |||
private String employeeCode; | |||
} |
@@ -13,7 +13,7 @@ import javax.validation.constraints.NotBlank; | |||
@Data | |||
@ApiModel("用户禁用/启用 PO") | |||
public class ReqUserDisablePO { | |||
public class ReqUserDisableOrEnablePO { | |||
@ApiModelProperty("用户id") | |||
private Long userId; | |||
@@ -22,8 +22,9 @@ public class ReqUserDisablePO { | |||
@ApiModelProperty("浙政钉 用户编码") | |||
private String employeeCode; | |||
@NotBlank(message = "浙政钉 用户编码 不能为空") | |||
@ApiModelProperty("操作 true: 启用 / false 禁用") | |||
private Boolean operation; | |||
@NotBlank(message = "操作 不能为空") | |||
@ApiModelProperty("操作 启用 ENABLE/禁用 DISABLE") | |||
private String operation; | |||
} |
@@ -1,7 +1,7 @@ | |||
package com.ningdatech.pmapi.user.model.po; | |||
import com.ningdatech.basic.model.PagePo; | |||
import com.ningdatech.pmapi.sys.model.entity.Role; | |||
import com.ningdatech.pmapi.user.model.vo.UserRoleVO; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
@@ -28,8 +28,11 @@ public class ReqUserInfoListPO extends PagePo { | |||
@ApiModelProperty("所属区域") | |||
private Long regionId; | |||
@ApiModelProperty("所属区域名称") | |||
private Long regionName; | |||
@ApiModelProperty("用户角色") | |||
private List<Role> userRoleList; | |||
private List<UserRoleVO> userRoleList; | |||
@ApiModelProperty("状态") | |||
private String status; | |||
@@ -1,6 +1,5 @@ | |||
package com.ningdatech.pmapi.user.model.vo; | |||
import com.ningdatech.pmapi.user.model.base.UserRoleInfo; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
@@ -21,9 +20,9 @@ public class ResUserDetailVO { | |||
@ApiModelProperty("手机号") | |||
private String phoneNo; | |||
@ApiModelProperty("状态 启用/禁用") | |||
private Boolean status; | |||
@ApiModelProperty("状态 启用 ENABLE/禁用 DISABLE") | |||
private String status; | |||
@ApiModelProperty("用户角色信息列表") | |||
private List<UserRoleInfo> userRoleInfoList; | |||
private List<UserRoleVO> userRoleInfoList; | |||
} |
@@ -0,0 +1,21 @@ | |||
package com.ningdatech.pmapi.user.model.vo; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
/** | |||
* @author liuxinxin | |||
* @date 2023/2/15 下午5:47 | |||
*/ | |||
@Data | |||
@ApiModel("用户角色VO") | |||
public class UserRoleVO { | |||
@ApiModelProperty(value = "角色id") | |||
private Long id; | |||
@ApiModelProperty(value = "名称") | |||
private String name; | |||
} |