diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/irs/sign/IRSAPIRequest.java b/pmapi/src/main/java/com/ningdatech/pmapi/irs/sign/IRSAPIRequest.java index 85147d5..28e92eb 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/irs/sign/IRSAPIRequest.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/irs/sign/IRSAPIRequest.java @@ -3,7 +3,7 @@ package com.ningdatech.pmapi.irs.sign; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.sun.org.apache.xerces.internal.impl.dv.util.Base64; -import javafx.util.Pair; +import org.apache.commons.lang3.tuple.Pair; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; @@ -124,8 +124,7 @@ public class IRSAPIRequest { req.addHeader("Content-Type", "application/json"); // 设置HTTP请求体 - HttpEntity entity = new ByteArrayEntity(stream, ContentType - .create(ContentType.APPLICATION_JSON.getMimeType(), "UTF-8")); + HttpEntity entity = new ByteArrayEntity(stream, ContentType.create(ContentType.APPLICATION_JSON.getMimeType(), "UTF-8")); req.setEntity(entity); // 执行请求 @@ -147,15 +146,12 @@ public class IRSAPIRequest { return strRes; } - private static String sign(byte[] stream) - throws Exception { + private static String sign(byte[] stream) throws Exception { // 获取消息验证码类的实例,算法选择"HmacSHA256" Mac mac = Mac.getInstance("HmacSHA256"); // 获取安全密钥 - Key secKey = new SecretKeySpec( - ProjectSecret.getBytes("UTF-8"), - mac.getAlgorithm()); + Key secKey = new SecretKeySpec(ProjectSecret.getBytes("UTF-8"), mac.getAlgorithm()); // 初始化 mac.init(secKey); @@ -168,15 +164,12 @@ public class IRSAPIRequest { } - private static String sign1(byte[] stream) - throws Exception { + private static String sign1(byte[] stream) throws Exception { // 获取消息验证码类的实例,算法选择"HmacSHA256" Mac mac = Mac.getInstance("HmacSHA256"); // 获取安全密钥 - Key secKey = new SecretKeySpec( - secretKey.getBytes("UTF-8"), - mac.getAlgorithm()); + Key secKey = new SecretKeySpec(secretKey.getBytes("UTF-8"), mac.getAlgorithm()); // 初始化 mac.init(secKey); @@ -190,8 +183,7 @@ public class IRSAPIRequest { } public static String binaryEncode(byte[] data) { - final char hexDigits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', - '9', 'a', 'b', 'c', 'd', 'e', 'f'}; + final char hexDigits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; StringBuilder builder = new StringBuilder(); @@ -254,8 +246,6 @@ public class IRSAPIRequest { return Base64.encode(bytes); //return encoder.encodeBuffer(bytes); - } catch (FileNotFoundException e) { - e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { @@ -321,7 +311,7 @@ public class IRSAPIRequest { int eqIndex = param.indexOf("="); String key = param.substring(0, eqIndex); String value = param.substring(eqIndex + 1); - Pair pair = new Pair(key, value); + Pair pair = Pair.of(key, value); queryParamList.add(pair); } @@ -330,16 +320,8 @@ public class IRSAPIRequest { sortedParamList.stream().forEach(param -> { try { String key = URLEncoder.encode(param.getKey(), "utf-8"); - String value = URLEncoder.encode(Optional.ofNullable(param.getValue()).orElse(""), "utf-8") - .replaceAll("\\%2B", "%20") - .replaceAll("\\+", "%20") - .replaceAll("\\%21", "!") - .replaceAll("\\%27", "'") - .replaceAll("\\%28", "(") - .replaceAll("\\%29", ")") - .replaceAll("\\%7E", "~") - .replaceAll("\\%25", "%"); - encodeParamList.add(new Pair<>(key, value)); + String value = URLEncoder.encode(Optional.ofNullable(param.getValue()).orElse(""), "utf-8").replaceAll("\\%2B", "%20").replaceAll("\\+", "%20").replaceAll("\\%21", "!").replaceAll("\\%27", "'").replaceAll("\\%28", "(").replaceAll("\\%29", ")").replaceAll("\\%7E", "~").replaceAll("\\%25", "%"); + encodeParamList.add(Pair.of(key, value)); } catch (UnsupportedEncodingException e) { throw new RuntimeException("encoding error"); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectDto.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectDto.java index 7aeb95c..44ce29e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectDto.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectDto.java @@ -1,5 +1,6 @@ package com.ningdatech.pmapi.projectdeclared.entity.dto; +import com.ningdatech.pmapi.projectlib.model.dto.ProjectDto; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; import lombok.AllArgsConstructor; @@ -25,7 +26,7 @@ import java.util.Map; public class DeclaredProjectDto implements Serializable { @NotNull - private Project projectInfo; + private ProjectDto projectInfo; private Map formData; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java index c192bba..6cf5d5e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java @@ -140,13 +140,9 @@ public class DeclaredProjectManage { } ProcessStartParamsVo params = new ProcessStartParamsVo(); -// ProcessInstanceUserDto user = new ProcessInstanceUserDto(); -// user.setOrgCode("6179678"); -// user.setOrgName("数转办"); -// user.setUserId("381496"); -// user.setUserName("旅人"); params.setUser(dto.getUser()); params.setProcessUsers(Collections.emptyMap()); + //放入条件判断的项目字段 dto.getFormData().putAll( JSON.parseObject(JSON.toJSONString(dto.getProjectInfo()), new TypeReference>() { })); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectApplicationDto.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectApplicationDto.java new file mode 100644 index 0000000..75c82dd --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectApplicationDto.java @@ -0,0 +1,169 @@ +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.time.LocalDateTime; + +/** + *

+ * 项目应用表 + *

+ * + * @author WendyYang + * @since 2023-02-05 + */ +@ApiModel(value = "NdProjectApplication对象", description = "") +@Data +public class ProjectApplicationDto implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("应用ID") + private Long id; + + @ApiModelProperty("项目ID") + private String projectId; + + @ApiModelProperty("是否初次建设 0否 1是") + private Integer isFirst; + + @ApiModelProperty("应用名称") + private String applicationName; + + @ApiModelProperty("创建时间") + private LocalDateTime createOn; + + @ApiModelProperty("更新时间") + private LocalDateTime updateOn; + + @ApiModelProperty("删除时间") + private LocalDateTime deleteOn; + + @ApiModelProperty("关联IRS现有应用") + private String relatedExistsApplication; + + @ApiModelProperty("关联IRS现有应用-IRS应用编码") + private String relatedExistsApplicationCode; + + @ApiModelProperty("应用类型") + private String applicationType; + + @ApiModelProperty("建设层级 1:国家 2:省级 3:市级 4:县(市、区)") + private Integer buildLevel; + + @ApiModelProperty("是否统建应用 0:否 1:是") + private Integer isUniteBuild; + + @ApiModelProperty("统建类型 1:全省统建 2:全市统建") + private Integer unionBuildKind; + + @ApiModelProperty("是否数改系统 0:否 1:是") + private Integer isDigitalModification; + + @ApiModelProperty("数改系统") + private String digitalModification; + + @ApiModelProperty("业务领域") + private String bizDomain; + + @ApiModelProperty("发布端") + private String publishSide; + + @ApiModelProperty("是否一本账场景应用名称 0:否 1:是") + private Integer isAccountAppName; + + @ApiModelProperty("一本账应用名称") + private String accountAppName; + + @ApiModelProperty("领域大脑一本账") + private String domainBrainAccount; + + @ApiModelProperty("是否业务协同 0:否 1:是") + private Integer isBizCooperate; + + @ApiModelProperty("业务协同描述") + private String bizCooperateInfo; + + @ApiModelProperty("使用范围") + private String usesRangeRemark; + + @ApiModelProperty("应用简介") + private String applicationSummary; + + @ApiModelProperty("应用备注") + private String applicationRemark; + + @ApiModelProperty("应用总投资测算明细-文件") + private String applicationEstimateFile; + + @ApiModelProperty("等保级别 1:一级 2:二级 3:三级 4:四级 5:五级") + private Integer secrecyGrade; + + @ApiModelProperty("密码测评级别 1:一级 2:二级 3:三级 4:四级 5:五级") + private Integer passwordGrade; + + @ApiModelProperty("是否符合国家信息技术应用创新相关规范 0:否 1:是") + private Integer nationalItSpec; + + @ApiModelProperty("是否使用政务云资源 0否 1是") + private Integer useGovCloud; + + @ApiModelProperty("云资源类型") + private String cloudsType; + + @ApiModelProperty("云资源基础规格") + private String cloudsFoundationSpecifications; + + @ApiModelProperty("云资源台数") + private Integer cloudsNumber; + + @ApiModelProperty("云资源用户描述") + private String cloudsDescription; + + @ApiModelProperty("网络环境 1:政务内网 2:政务外网 3:互联网 4:业务专网 5:单机") + private Integer netEnv; + + @ApiModelProperty("是否使用公共数据 0否 1是") + private Integer useCommonData; + + @ApiModelProperty("数据名称") + private String dataName; + + @ApiModelProperty("是否使用公共组件 0否 1是") + private Integer useCommonComponent; + + @ApiModelProperty("使用的公共组件名称") + private String commonComponents; + + @ApiModelProperty("是否产生公共组件 0否 1是") + private Integer produceCommonComponent; + + @ApiModelProperty("预计产生组件名称") + private String produceCommonComponents; + + @ApiModelProperty("试点任务名称") + private String pilotTasksName; + + @ApiModelProperty("试点任务编号") + private String pilotTasksCode; + + @ApiModelProperty("所属重大应用名称") + private String importantTaskName; + + @ApiModelProperty("所属重大应用编号") + private String importantTaskCode; + + @ApiModelProperty("所属子场景应用名称") + private String subSceneApplicationName; + + @ApiModelProperty("试点文件") + private String experimentsFile; + + private Long createBy; + + private Long updateBy; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDto.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDto.java index ee9ac54..7d2eeec 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDto.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDto.java @@ -7,6 +7,7 @@ import lombok.Data; import java.io.Serializable; import java.math.BigDecimal; import java.time.LocalDateTime; +import java.util.List; /** *

@@ -276,16 +277,14 @@ public class ProjectDto implements Serializable { @ApiModelProperty("流程实例 formId") private String formId; - @ApiModelProperty("项目一级状态 10000 20000 30000") - private Integer projectStatusFirst; + @ApiModelProperty("项目应用实例") + private List applicationList; - @ApiModelProperty("项目二级状态") - private Integer projectStatusSecond; + @ApiModelProperty("流程状态") + private Integer processStatus; - @ApiModelProperty("单位名称") - private String orgName; - @ApiModelProperty("单位code") - private String orgCode; + @ApiModelProperty("动态表单 json") + private String dynamicForm; private Long createBy; 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 58ff074..4f64203 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 @@ -281,21 +281,12 @@ public class Project implements Serializable { @ApiModelProperty("前端所需验证字段") private Integer allApplicationsDone; - @ApiModelProperty("项目一级状态 10000 20000 30000") - private Integer projectStatusFirst; - - @ApiModelProperty("项目二级状态") - private Integer projectStatusSecond; - - - @ApiModelProperty("单位名称") - private String orgName; - @ApiModelProperty("单位code") - private String orgCode; - @ApiModelProperty("流程状态") private Integer processStatus; + @ApiModelProperty("动态表单 json") + private String dynamicForm; + private Long createBy; private Long updateBy; diff --git a/pmapi/src/test/java/com/ningdatech/pmapi/sys/project/ProjectStateTest.java b/pmapi/src/test/java/com/ningdatech/pmapi/sys/project/ProjectStateTest.java index 74d3adc..d5a8bfc 100644 --- a/pmapi/src/test/java/com/ningdatech/pmapi/sys/project/ProjectStateTest.java +++ b/pmapi/src/test/java/com/ningdatech/pmapi/sys/project/ProjectStateTest.java @@ -31,8 +31,8 @@ public class ProjectStateTest extends AppTests { project.setInstCode("1"); project.setId(1L); project.setProjectStatusFirst(ProjectStatusEnum.NOT_APPROVED.getCode()); - project.setProjectStatusSecond(ProjectStatusEnum.NOT_APPROVED.getCode()); - stateMachineUtils.execute(project, ProjectStatusChangeEvent.PROJECT_APPLICATION_SUBMIT); + project.setProjectStatusSecond(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode()); + stateMachineUtils.execute(project, ProjectStatusChangeEvent.UNDER_INTERNAL_PASS); stopWatch.stop(); System.out.println("调用状态机结束 :" + stopWatch.getTotalTimeSeconds());