公章管理测试

This commit is contained in:
hejinbo
2023-11-15 09:01:20 +08:00
parent dac20a4a04
commit 4088cf7357
10 changed files with 140 additions and 186 deletions
@@ -181,32 +181,36 @@ public class FixSelectFlowDetailUtils {
if (deptIdentifysnew != null && deptIdentifysnew.size() > 0) {
for (int i = 0; i < deptIdentifysnew.size(); i++) {
EsignHttpResponse identifyInfo = SignAward.getDeptIdentifyInfo(deptIdentifysnew.get(i));
JsonObject identifyInfoJsonObject = gson.fromJson(identifyInfo.getBody(), JsonObject.class);
JsonObject identifyInfoData = identifyInfoJsonObject.getAsJsonObject("data");
int realnameStatus = identifyInfoData.get("realnameStatus").getAsInt();
if (realnameStatus == 1) {
String orgId = identifyInfoData.get("orgId").getAsString();
System.out.println("这是orgId"+orgId+"=======================");
EsignHttpResponse identifyInfo1 = SignAward.deptIdentifySealList(orgId);
//将orgId保存到数据库里
DeptIdentify deptIdentifynew = deptIdentifysnew.get(i);
deptIdentifynew.setOrgId(orgId);
JsonObject identifyInfoJsonObject1 = gson.fromJson(identifyInfo1.getBody(), JsonObject.class);
JsonObject identifyInfoData1 = identifyInfoJsonObject1.getAsJsonObject("data");
JsonArray sealArray = identifyInfoData1.get("seals").getAsJsonArray();
String sealNames = "";
if (sealArray.size() > 0) {
for (int j = 0; j < sealArray.size(); j++) {
JsonObject sealObject = (JsonObject) sealArray.get(j);
String sealName = sealObject.get("sealName").toString();
String sealNamenew = sealName.substring(1, sealName.length() - 1);
sealNames += sealNamenew + ",";
int code = identifyInfoJsonObject.get("code").getAsInt();
if (code == 0) {
JsonObject identifyInfoData = identifyInfoJsonObject.getAsJsonObject("data");
int realnameStatus = identifyInfoData.get("realnameStatus").getAsInt();
if (realnameStatus == 1) {
String orgId = identifyInfoData.get("orgId").getAsString();
System.out.println("这是orgId" + orgId + "=======================");
EsignHttpResponse identifyInfo1 = SignAward.deptIdentifySealList(orgId);
//将orgId保存到数据库里
DeptIdentify deptIdentifynew = deptIdentifysnew.get(i);
deptIdentifynew.setOrgId(orgId);
JsonObject identifyInfoJsonObject1 = gson.fromJson(identifyInfo1.getBody(), JsonObject.class);
JsonObject identifyInfoData1 = identifyInfoJsonObject1.getAsJsonObject("data");
JsonArray sealArray = identifyInfoData1.get("seals").getAsJsonArray();
String sealNames = "";
if (sealArray.size() > 0) {
for (int j = 0; j < sealArray.size(); j++) {
JsonObject sealObject = (JsonObject) sealArray.get(j);
String sealName = sealObject.get("sealName").toString();
String sealNamenew = sealName.substring(1, sealName.length() - 1);
sealNames += sealNamenew + ",";
}
}
String sealName = sealNames.substring(0, sealNames.length() - 1);
deptIdentifynew.setIdentifyStatus(1);
deptIdentifynew.setSealName(sealName);
int row = deptIdentifyMapper.updateDeptIdentify(deptIdentifynew);
}
String sealName = sealNames.substring(0, sealNames.length() - 1);
deptIdentifynew.setIdentifyStatus(1);
deptIdentifynew.setSealName(sealName);
int row = deptIdentifyMapper.updateDeptIdentify(deptIdentifynew);
}
}
}
@@ -217,9 +221,9 @@ public class FixSelectFlowDetailUtils {
*
* @throws EsignDemoException
*/
// @Scheduled(cron = "0/30 * * * * ?")
// @Scheduled(cron = "0/30 * * * * ?")
@Transactional
public void searchForInstitutionalSeal() {
public void searchForInstitutionalSeal() {
try {
DeptIdentify deptIdentify = new DeptIdentify();
deptIdentify.setIsUse(0);
@@ -228,16 +232,16 @@ public class FixSelectFlowDetailUtils {
for (DeptIdentify identify : deptIdentifies) {
//查询企业内部印章
Integer annexId = identify.getAnnexId();
if (annexId == null){
if (annexId == null) {
//说明之前没有下载过
EsignHttpResponse response = SignAward.orgOwnSealList(identify);
JSONObject jsonObject = JSONObject.parseObject(response.getBody());
JSONObject data = jsonObject.getJSONObject("data");
JSONArray seals = data.getJSONArray("seals");
for (int i = 0; i < seals.size(); i++){
for (int i = 0; i < seals.size(); i++) {
JSONObject seal = seals.getJSONObject(i);
int statusDescription = seal.getIntValue("statusDescription");
if (statusDescription==1){//印章状态 1已启用,2待审核,3审核不通过,4 挂起
if (statusDescription == 1) {//印章状态 1已启用,2待审核,3审核不通过,4 挂起
//已启用证明审核通过,下载到数据库
String sealImageDownloadUrl = seal.getString("sealImageDownloadUrl");
LocalDate now = LocalDate.now();
@@ -265,7 +269,7 @@ public class FixSelectFlowDetailUtils {
caseAttach.setAnnexPath(savePath);
caseAttach.setAnnexName(saveName);
int i1 = caseAttachMapper.save(caseAttach);
if (i1>0){
if (i1 > 0) {
//将附件id保存到公章管理表里
Integer annexId1 = caseAttach.getAnnexId();
identify.setAnnexId(annexId1);