@@ -3,7 +3,7 @@ package com.ningdatech.pmapi.irs.sign; | |||||
import com.alibaba.fastjson.JSON; | import com.alibaba.fastjson.JSON; | ||||
import com.alibaba.fastjson.JSONObject; | import com.alibaba.fastjson.JSONObject; | ||||
import com.sun.org.apache.xerces.internal.impl.dv.util.Base64; | 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.HttpEntity; | ||||
import org.apache.http.HttpResponse; | import org.apache.http.HttpResponse; | ||||
import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; | import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; | ||||
@@ -124,8 +124,7 @@ public class IRSAPIRequest { | |||||
req.addHeader("Content-Type", "application/json"); | req.addHeader("Content-Type", "application/json"); | ||||
// 设置HTTP请求体 | // 设置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); | req.setEntity(entity); | ||||
// 执行请求 | // 执行请求 | ||||
@@ -147,15 +146,12 @@ public class IRSAPIRequest { | |||||
return strRes; | return strRes; | ||||
} | } | ||||
private static String sign(byte[] stream) | |||||
throws Exception { | |||||
private static String sign(byte[] stream) throws Exception { | |||||
// 获取消息验证码类的实例,算法选择"HmacSHA256" | // 获取消息验证码类的实例,算法选择"HmacSHA256" | ||||
Mac mac = Mac.getInstance("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); | 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" | // 获取消息验证码类的实例,算法选择"HmacSHA256" | ||||
Mac mac = Mac.getInstance("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); | mac.init(secKey); | ||||
@@ -190,8 +183,7 @@ public class IRSAPIRequest { | |||||
} | } | ||||
public static String binaryEncode(byte[] data) { | 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(); | StringBuilder builder = new StringBuilder(); | ||||
@@ -254,8 +246,6 @@ public class IRSAPIRequest { | |||||
return Base64.encode(bytes); | return Base64.encode(bytes); | ||||
//return encoder.encodeBuffer(bytes); | //return encoder.encodeBuffer(bytes); | ||||
} catch (FileNotFoundException e) { | |||||
e.printStackTrace(); | |||||
} catch (IOException e) { | } catch (IOException e) { | ||||
e.printStackTrace(); | e.printStackTrace(); | ||||
} finally { | } finally { | ||||
@@ -321,7 +311,7 @@ public class IRSAPIRequest { | |||||
int eqIndex = param.indexOf("="); | int eqIndex = param.indexOf("="); | ||||
String key = param.substring(0, eqIndex); | String key = param.substring(0, eqIndex); | ||||
String value = param.substring(eqIndex + 1); | String value = param.substring(eqIndex + 1); | ||||
Pair<String, String> pair = new Pair<String, String>(key, value); | |||||
Pair<String, String> pair = Pair.of(key, value); | |||||
queryParamList.add(pair); | queryParamList.add(pair); | ||||
} | } | ||||
@@ -330,16 +320,8 @@ public class IRSAPIRequest { | |||||
sortedParamList.stream().forEach(param -> { | sortedParamList.stream().forEach(param -> { | ||||
try { | try { | ||||
String key = URLEncoder.encode(param.getKey(), "utf-8"); | 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) { | } catch (UnsupportedEncodingException e) { | ||||
throw new RuntimeException("encoding error"); | throw new RuntimeException("encoding error"); | ||||
} | } | ||||
@@ -1,5 +1,6 @@ | |||||
package com.ningdatech.pmapi.projectdeclared.entity.dto; | 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.ningdatech.pmapi.projectlib.model.entity.Project; | ||||
import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; | import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; | ||||
import lombok.AllArgsConstructor; | import lombok.AllArgsConstructor; | ||||
@@ -25,7 +26,7 @@ import java.util.Map; | |||||
public class DeclaredProjectDto implements Serializable { | public class DeclaredProjectDto implements Serializable { | ||||
@NotNull | @NotNull | ||||
private Project projectInfo; | |||||
private ProjectDto projectInfo; | |||||
private Map<String,Object> formData; | private Map<String,Object> formData; | ||||
@@ -140,13 +140,9 @@ public class DeclaredProjectManage { | |||||
} | } | ||||
ProcessStartParamsVo params = new ProcessStartParamsVo(); | ProcessStartParamsVo params = new ProcessStartParamsVo(); | ||||
// ProcessInstanceUserDto user = new ProcessInstanceUserDto(); | |||||
// user.setOrgCode("6179678"); | |||||
// user.setOrgName("数转办"); | |||||
// user.setUserId("381496"); | |||||
// user.setUserName("旅人"); | |||||
params.setUser(dto.getUser()); | params.setUser(dto.getUser()); | ||||
params.setProcessUsers(Collections.emptyMap()); | params.setProcessUsers(Collections.emptyMap()); | ||||
//放入条件判断的项目字段 | |||||
dto.getFormData().putAll( | dto.getFormData().putAll( | ||||
JSON.parseObject(JSON.toJSONString(dto.getProjectInfo()), new TypeReference<Map<String, Object>>() { | JSON.parseObject(JSON.toJSONString(dto.getProjectInfo()), new TypeReference<Map<String, Object>>() { | ||||
})); | })); | ||||
@@ -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; | |||||
/** | |||||
* <p> | |||||
* 项目应用表 | |||||
* </p> | |||||
* | |||||
* @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; | |||||
} |
@@ -7,6 +7,7 @@ import lombok.Data; | |||||
import java.io.Serializable; | import java.io.Serializable; | ||||
import java.math.BigDecimal; | import java.math.BigDecimal; | ||||
import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
import java.util.List; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
@@ -276,16 +277,14 @@ public class ProjectDto implements Serializable { | |||||
@ApiModelProperty("流程实例 formId") | @ApiModelProperty("流程实例 formId") | ||||
private String formId; | private String formId; | ||||
@ApiModelProperty("项目一级状态 10000 20000 30000") | |||||
private Integer projectStatusFirst; | |||||
@ApiModelProperty("项目应用实例") | |||||
private List<ProjectApplicationDto> 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; | private Long createBy; | ||||
@@ -281,21 +281,12 @@ public class Project implements Serializable { | |||||
@ApiModelProperty("前端所需验证字段") | @ApiModelProperty("前端所需验证字段") | ||||
private Integer allApplicationsDone; | private Integer allApplicationsDone; | ||||
@ApiModelProperty("项目一级状态 10000 20000 30000") | |||||
private Integer projectStatusFirst; | |||||
@ApiModelProperty("项目二级状态") | |||||
private Integer projectStatusSecond; | |||||
@ApiModelProperty("单位名称") | |||||
private String orgName; | |||||
@ApiModelProperty("单位code") | |||||
private String orgCode; | |||||
@ApiModelProperty("流程状态") | @ApiModelProperty("流程状态") | ||||
private Integer processStatus; | private Integer processStatus; | ||||
@ApiModelProperty("动态表单 json") | |||||
private String dynamicForm; | |||||
private Long createBy; | private Long createBy; | ||||
private Long updateBy; | private Long updateBy; | ||||
@@ -31,8 +31,8 @@ public class ProjectStateTest extends AppTests { | |||||
project.setInstCode("1"); | project.setInstCode("1"); | ||||
project.setId(1L); | project.setId(1L); | ||||
project.setProjectStatusFirst(ProjectStatusEnum.NOT_APPROVED.getCode()); | 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(); | stopWatch.stop(); | ||||
System.out.println("调用状态机结束 :" + stopWatch.getTotalTimeSeconds()); | System.out.println("调用状态机结束 :" + stopWatch.getTotalTimeSeconds()); | ||||