CMM 1 year ago
parent
commit
0e773e6387
10 changed files with 175 additions and 3 deletions
  1. +1
    -1
      ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java
  2. +8
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java
  3. +7
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java
  4. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectInstMapper.java
  5. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectInstMapper.xml
  6. +78
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectInst.java
  7. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectApprovedReq.java
  8. +23
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectIdReq.java
  9. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectInstService.java
  10. +20
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectInstServiceImpl.java

+ 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("Lierbao", "organization", PATH_LXX, "ding_employee_info");
generate("Poffy", "projectlib", PATH_YYD, "nd_project_inst");
}

}

+ 8
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java View File

@@ -4,6 +4,7 @@ import com.ningdatech.basic.model.PageVo;
import com.ningdatech.log.annotation.WebLog;
import com.ningdatech.pmapi.projectlib.manage.AnnualPlanLibManage;
import com.ningdatech.pmapi.projectlib.model.req.ProjectApprovedReq;
import com.ningdatech.pmapi.projectlib.model.req.ProjectIdReq;
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq;
import com.ningdatech.pmapi.projectlib.model.req.StartProjectDeclareReq;
import com.ningdatech.pmapi.projectlib.model.vo.AnnualPlanListItemVO;
@@ -50,4 +51,11 @@ public class AnnualPlanController {
annualPlanLibManage.projectApproved(req);
}

@PostMapping("/suspendAnnualPlan")
@ApiOperation("暂缓年度计划")
@WebLog("暂缓年度计划")
public void suspendAnnualPlan(@RequestBody @Valid ProjectIdReq req) throws Exception {
annualPlanLibManage.suspendAnnualPlan(req);
}

}

+ 7
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java View File

@@ -13,6 +13,7 @@ import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.helper.ProjectHelper;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.req.ProjectApprovedReq;
import com.ningdatech.pmapi.projectlib.model.req.ProjectIdReq;
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq;
import com.ningdatech.pmapi.projectlib.model.req.StartProjectDeclareReq;
import com.ningdatech.pmapi.projectlib.model.vo.AnnualPlanListItemVO;
@@ -47,7 +48,6 @@ public class AnnualPlanLibManage {
*/
private static final List<ProjectStatusEnum> ANNUAL_PLAN_LIST_STATUS = Arrays.asList(
IN_THE_ANNUAL_PLAN,
BE_SUSPENDED,
SCHEME_UNDER_REVIEW,
SCHEME_REVIEW_FAILED,
TO_BE_APPROVED,
@@ -123,4 +123,10 @@ public class AnnualPlanLibManage {
projectService.update(update);
}

@Transactional(rollbackFor = Exception.class)
public void suspendAnnualPlan(ProjectIdReq req) throws Exception {
Project project = projectService.getById(req.getProjectId());
stateMachine.execute(project, ProjectStatusChangeEvent.ANNUAL_PLAN_SUSPEND);
}

}

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

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

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

/**
* <p>
* Mapper 接口
* </p>
*
* @author Poffy
* @since 2023-02-13
*/
public interface ProjectInstMapper extends BaseMapper<ProjectInst> {

}

+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectInstMapper.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.ProjectInstMapper">

</mapper>

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

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

import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;

/**
* <p>
*
* </p>
*
* @author Poffy
* @since 2023-02-13
*/
@TableName("nd_project_inst")
@ApiModel(value = "NdProjectInst对象", description = "")
public class ProjectInst implements Serializable {

private static final long serialVersionUID = 1L;

private Long id;

private Long projectId;

private String instCode;

private LocalDateTime creatOn;

private LocalDateTime updateOn;

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}
public Long getProjectId() {
return projectId;
}

public void setProjectId(Long projectId) {
this.projectId = projectId;
}
public String getInstCode() {
return instCode;
}

public void setInstCode(String instCode) {
this.instCode = instCode;
}
public LocalDateTime getCreatOn() {
return creatOn;
}

public void setCreatOn(LocalDateTime creatOn) {
this.creatOn = creatOn;
}
public LocalDateTime getUpdateOn() {
return updateOn;
}

public void setUpdateOn(LocalDateTime updateOn) {
this.updateOn = updateOn;
}

@Override
public String toString() {
return "NdProjectInst{" +
"id=" + id +
", projectId=" + projectId +
", instCode=" + instCode +
", creatOn=" + creatOn +
", updateOn=" + updateOn +
"}";
}
}

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectApprovedReq.java View File

@@ -40,7 +40,7 @@ public class ProjectApprovedReq {
@ApiModelProperty("建设周期")
@NotNull(message = "建设周期不能为空")
@Range(min = 1, max = 99999, message = "建设周期无效")
private LocalDate buildCycle;
private Integer buildCycle;

@ApiModelProperty("批复文件ID")
@NotNull(message = "批复文件不能为空")


+ 23
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectIdReq.java View File

@@ -0,0 +1,23 @@
package com.ningdatech.pmapi.projectlib.model.req;

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

import javax.validation.constraints.NotNull;

/**
* <p>
* ProjectIdReq
* </p>
*
* @author WendyYang
* @since 09:32 2023/2/13
*/
@Data
public class ProjectIdReq {

@ApiModelProperty("项目ID")
@NotNull(message = "项目ID不能为空")
private Long projectId;

}

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

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

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

/**
* <p>
* 服务类
* </p>
*
* @author Poffy
* @since 2023-02-13
*/
public interface IProjectInstService extends IService<ProjectInst> {

}

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

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

import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst;
import com.ningdatech.pmapi.projectlib.mapper.ProjectInstMapper;
import com.ningdatech.pmapi.projectlib.service.IProjectInstService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
* <p>
* 服务实现类
* </p>
*
* @author Poffy
* @since 2023-02-13
*/
@Service
public class ProjectInstServiceImpl extends ServiceImpl<ProjectInstMapper, ProjectInst> implements IProjectInstService {

}

Loading…
Cancel
Save