CMM пре 1 година
родитељ
комит
debb8fdbe9
16 измењених фајлова са 206 додато и 33 уклоњено
  1. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java
  2. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/event/ProjectStatusChangeEvent.java
  3. +0
    -20
      pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingEmployeeInfoController.java
  4. +26
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java
  5. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/OrganizationProcdefController.java
  6. +41
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java
  7. +31
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/organization/model/po/ReqOrganizationListPO.java
  8. +38
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/organization/model/vo/ResOrganizationListVO.java
  9. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java
  10. +2
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enumeration/ProjectStatusEnum.java
  11. +17
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java
  12. +6
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserInfoController.java
  13. +5
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java
  14. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/user/model/vo/ResUserDetailVO.java
  15. +28
    -0
      pmapi/src/test/java/com/ningdatech/pmapi/instance/InstanceTest.java
  16. +4
    -1
      pmapi/src/test/java/com/ningdatech/pmapi/statemachine/StateMachineTest.java

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java Прегледај датотеку

@@ -226,7 +226,7 @@ public class ProjectDeclareAction {
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
// 终验审核通过后,项目一级状态变更为已归档
project.setStage(ProjectStatusEnum.ARCHIVED.getCode());
project.setStatus(ProjectStatusEnum.ARCHIVED.getCode());
project.setStatus(ProjectStatusEnum.ACCEPTED.getCode());
}

@OnTransition(source = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW", target = "FINAL_ACCEPTANCE_REVIEW_FAILED")


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/event/ProjectStatusChangeEvent.java Прегледај датотеку

@@ -105,7 +105,7 @@ public enum ProjectStatusChangeEvent {
/**
* 终验审核通过(项目状态变为:已归档)
*/
FINAL_ACCEPTANCE_PASS(null, null, null),
FINAL_ACCEPTANCE_PASS(20004, null, null),

// 下个节点还未提交审核意见时,流程发起人和前一个审核人可以点击撤回



+ 0
- 20
pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingEmployeeInfoController.java Прегледај датотеку

@@ -1,20 +0,0 @@
package com.ningdatech.pmapi.organization.controller;


import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;

/**
* <p>
* 前端控制器
* </p>
*
* @author Lierbao
* @since 2023-02-11
*/
@Controller
@RequestMapping("/pmapi.organization/ding-employee-info")
public class DingEmployeeInfoController {

}

+ 26
- 1
pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java Прегледај датотеку

@@ -1,10 +1,22 @@
package com.ningdatech.pmapi.organization.controller;


import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.organization.manage.OrganizationManage;
import com.ningdatech.pmapi.organization.model.po.ReqOrganizationListPO;
import com.ningdatech.pmapi.organization.model.vo.ResOrganizationListVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
* <p>
@@ -14,14 +26,27 @@ import org.springframework.web.bind.annotation.RequestMapping;
* @author Lierbao
* @since 2023-02-09
*/
@Controller

@Slf4j
@Validated
@RestController
@RequiredArgsConstructor
@Api(value = "DingOrganizationController", tags = "单位管理")
@RequestMapping("/api/v1/organization")
public class DingOrganizationController {

private final OrganizationManage organizationManage;

@ApiModelProperty("单位成员配置")
@PostMapping("/member/config")
public void organizationManage() {

}

@ApiModelProperty("单位列表筛选")
@PostMapping("/list")
public PageVo<ResOrganizationListVO> organizationList(@Valid @RequestBody ReqOrganizationListPO reqOrganizationListPO) {
return organizationManage.organizationList(reqOrganizationListPO);
}

}

+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/OrganizationProcdefController.java Прегледај датотеку

@@ -57,14 +57,14 @@ public class OrganizationProcdefController {
@ApiOperation(value = "单位流程配置启用", notes = "单位流程配置启用")
@PutMapping("/enable/{processDefId}")
public String enableProcess(@PathVariable String processDefId) {
orgProcessModelService.enableProcess(processDefId,Boolean.FALSE);
orgProcessModelService.enableProcess(processDefId, Boolean.FALSE);
return "启用成功";
}

@ApiOperation(value = "单位流程配置禁用", notes = "单位流程配置禁用")
@PutMapping("/disable/{processDefId}")
public String disableProcess(@PathVariable String processDefId) {
orgProcessModelService.enableProcess(processDefId,Boolean.TRUE);
orgProcessModelService.enableProcess(processDefId, Boolean.TRUE);
return "禁用成功";
}



+ 41
- 1
pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java Прегледај датотеку

@@ -1,8 +1,21 @@
package com.ningdatech.pmapi.organization.manage;

import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.organization.model.entity.DingOrganization;
import com.ningdatech.pmapi.organization.model.po.ReqOrganizationListPO;
import com.ningdatech.pmapi.organization.model.vo.ResOrganizationListVO;
import com.ningdatech.pmapi.organization.service.IDingOrganizationService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

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

/**
* @author liuxinxin
* @date 2023/1/13 下午2:55
@@ -11,7 +24,34 @@ import org.springframework.stereotype.Component;
@RequiredArgsConstructor
public class OrganizationManage {

// private final
private final IDingOrganizationService iDingOrganizationService;

public PageVo<ResOrganizationListVO> organizationList(ReqOrganizationListPO reqOrganizationListPO) {
String orgName = reqOrganizationListPO.getOrgName();

Page<DingOrganization> page = iDingOrganizationService
.page(new Page<>(reqOrganizationListPO.getPageNumber(), reqOrganizationListPO.getPageSize())
, Wrappers.lambdaQuery(DingOrganization.class)
.like(StringUtils.isNotBlank(orgName), DingOrganization::getOrganizationName, orgName));

long total = page.getTotal();
List<DingOrganization> records = page.getRecords();

List<ResOrganizationListVO> resVOList = new ArrayList<>();
if (CollUtil.isNotEmpty(records)) {
resVOList = records.stream().map(r -> {
ResOrganizationListVO resOrganizationListVO = new ResOrganizationListVO();
resOrganizationListVO.setOrgCode(r.getOrganizationCode());
resOrganizationListVO.setOrgName(r.getOrganizationName());
// TODO 补充其他字段
return resOrganizationListVO;
}).collect(Collectors.toList());
}

PageVo<ResOrganizationListVO> pageVo = new PageVo<>();
pageVo.setTotal(total);
pageVo.setRecords(resVOList);
return pageVo;
}

}

+ 31
- 0
pmapi/src/main/java/com/ningdatech/pmapi/organization/model/po/ReqOrganizationListPO.java Прегледај датотеку

@@ -0,0 +1,31 @@
package com.ningdatech.pmapi.organization.model.po;

import com.ningdatech.basic.model.PagePo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
* @author liuxinxin
* @date 2023/2/16 上午11:50
*/
@Data
@ApiModel("组织列表 请求PO")
public class ReqOrganizationListPO extends PagePo {

@ApiModelProperty("单位名称")
private String orgName;

@ApiModelProperty("浙政钉编码")
private String orgCode;

@ApiModelProperty("所属区域id")
private String regionId;

@ApiModelProperty("是否为主管单位")
private Boolean isCompetentUnit;

@ApiModelProperty("是否为上级条线主管单位")
private Boolean isSuperiorLineCompetentUnit;

}

+ 38
- 0
pmapi/src/main/java/com/ningdatech/pmapi/organization/model/vo/ResOrganizationListVO.java Прегледај датотеку

@@ -0,0 +1,38 @@
package com.ningdatech.pmapi.organization.model.vo;

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

/**
* @author liuxinxin
* @date 2023/2/16 上午11:50
*/
@Data
@ApiModel("组织列表VO")
public class ResOrganizationListVO {

public String id;

@ApiModelProperty("单位名称")
private String orgName;

@ApiModelProperty("浙政钉编码")
private String orgCode;

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

@ApiModelProperty("所属区域id")
private String regionId;

@ApiModelProperty("所属区域")
private String regionName;

@ApiModelProperty("是否为主管单位")
private Boolean isCompetentUnit;

@ApiModelProperty("是否为上级条线主管单位")
private Boolean isSuperiorLineCompetentUnit;

}

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java Прегледај датотеку

@@ -81,7 +81,7 @@ public class ConstructionPlanManage {
//首先要判断 项目当前状态 是不是 方案待申报
VUtils.isTrue(!ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode().equals(projectInfo.getStatus()) ||
!ProjectStatusEnum.NOT_APPROVED.getCode().equals(projectInfo.getStage()))
.throwMessage("提交失败 该项目不是 待预审状态或者未立项阶段");
.throwMessage("提交失败 该项目不是 方案待申报状态或者未立项阶段");
// TODO 再判断 该项目是否 真实走完 预审审批

ProcessStartParamsVo params = new ProcessStartParamsVo();


+ 2
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enumeration/ProjectStatusEnum.java Прегледај датотеку

@@ -54,7 +54,8 @@ public enum ProjectStatusEnum {
/**
* 项目阶段:已归档
*/
ARCHIVED(30000, "已归档");
ARCHIVED(30000, "已归档"),
ACCEPTED(30001, "已验收");

private Integer code;
private String desc;


+ 17
- 3
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java Прегледај датотеку

@@ -1,9 +1,11 @@
package com.ningdatech.pmapi.projectlib.manage;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectRenewalApprovalStatusEnum;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.model.dto.ProjectRenewalFundDeclarationDTO;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectRenewalFundDeclaration;
@@ -90,14 +92,26 @@ public class ProjectRenewalFundManage {
* @return
*/
public Long declared(ProjectRenewalFundDeclarationDTO dto) {
//要判断 项目id 是否 以及状态是 已验收
Long projectId = dto.getProjectId();
Project project = projectService.getById(projectId);
VUtils.isTrue(Objects.isNull(project)).throwMessage(String.format("关联的项目【%s】不存在 提交失败!",projectId));
VUtils.isTrue(!ProjectStatusEnum.ACCEPTED.getCode().equals(project.getStatus()) ||
!ProjectStatusEnum.ARCHIVED.getCode().equals(project.getStage()))
.throwMessage("提交失败 该项目不是 已验收状态或者已归档阶段");
ProjectRenewalFundDeclaration declaration = new ProjectRenewalFundDeclaration();
//如果是重新申报
if(Objects.nonNull(dto.getId())){
ProjectRenewalFundDeclaration oldDeclaration = projectRenewalFundDeclarationService.getById(dto.getId());
VUtils.isTrue(Objects.isNull(oldDeclaration)).throwMessage(String.format("重新申报失败 【%s】 该申报不存在!",dto.getId()));
BeanUtils.copyProperties(oldDeclaration,declaration);
}
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("申报失败");
if(!projectRenewalFundDeclarationService.saveOrUpdate(declaration)){
throw new BusinessException(String.format("申报失败 【%s】",dto.getId()));
}
return declaration.getId();
}


+ 6
- 0
pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserInfoController.java Прегледај датотеку

@@ -55,4 +55,10 @@ public class UserInfoController {
userInfoManage.userInfoDetailEdit(reqUserDetailEditPO);
}

@ApiOperation(value = "获取当前登陆用户详情信息", notes = "用户详情")
@PostMapping("/current-user-info")
public ResUserDetailVO currentUserInfo() {
return userInfoManage.currentUserInfo();
}

}

+ 5
- 1
pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java Прегледај датотеку

@@ -93,7 +93,7 @@ public class UserInfoManage {
return null;
}
ResUserDetailVO resUserDetailVO = new ResUserDetailVO();
resUserDetailVO.setRealName(userInfo.getRealName());
resUserDetailVO.setUserId(userInfo.getId());
resUserDetailVO.setPhoneNo(userInfo.getMobile());
resUserDetailVO.setStatus(userInfo.getAvailable());
@@ -141,6 +141,7 @@ public class UserInfoManage {
.accountId(dingEmployeeInfo.getAccountId())
.username(dingEmployeeInfo.getEmployeeName())
.realName(dingEmployeeInfo.getEmployeeName())
.employeeCode(dingEmployeeInfo.getEmployeeCode())
.available(UserAvailableEnum.DISABLE.name())
.createBy(-1L)
.updateBy(-1L)
@@ -153,4 +154,7 @@ public class UserInfoManage {
}


public ResUserDetailVO currentUserInfo() {
return null;
}
}

+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/user/model/vo/ResUserDetailVO.java Прегледај датотеку

@@ -17,6 +17,9 @@ public class ResUserDetailVO {
@ApiModelProperty("userId")
private Long userId;

@ApiModelProperty("用户姓名")
private String realName;

@ApiModelProperty("手机号")
private String phoneNo;



+ 28
- 0
pmapi/src/test/java/com/ningdatech/pmapi/instance/InstanceTest.java Прегледај датотеку

@@ -0,0 +1,28 @@
package com.ningdatech.pmapi.instance;

import com.alibaba.fastjson.JSON;
import com.ningdatech.pmapi.AppTests;
import com.wflow.workflow.bean.dto.ProcessInstanceUserDto;
import org.flowable.engine.RuntimeService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

/**
* @Classname InstanceTest
* @Description
* @Date 2023/2/16 14:44
* @Author PoffyZhang
*/
public class InstanceTest extends AppTests {

@Autowired
private RuntimeService runtimeService;

@Test
public void test(){
String instanceId = "896fa188-96d8-11ed-9539-e2d4e8f16b2f";
Object user = runtimeService.getVariable(instanceId,
"owner");
System.out.println(JSON.toJSONString(user));
}
}

+ 4
- 1
pmapi/src/test/java/com/ningdatech/pmapi/statemachine/StateMachineTest.java Прегледај датотеку

@@ -1,5 +1,6 @@
package com.ningdatech.pmapi.statemachine;

import com.alibaba.fastjson.JSON;
import com.ningdatech.pmapi.AppTests;
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils;
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent;
@@ -24,9 +25,11 @@ public class StateMachineTest extends AppTests {
@Test
public void stateMachineTest() throws Exception {
Project project = new Project();
project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode());
project.setStage(ProjectStatusEnum.PROJECT_APPROVED.getCode());
project.setStatus(ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW.getCode());
project.setDeclareAmount(BigDecimal.valueOf(2000));
// stateMachineUtils.execute(project, ProjectStatusChangeEvent.UNDER_INTERNAL_PASS);
stateMachineUtils.execute(project, stateMachineUtils.getProjectStatusPassEvent(project.getStatus()));
System.out.println(String.format("project:%s", JSON.toJSONString(project)));
}
}

Loading…
Откажи
Сачувај