zqy 2 miesięcy temu
rodzic
commit
d2049ae563

+ 3 - 1
src/com/kingdee/eas/custom/esign/util/EsignHttpUtil.java

@@ -259,7 +259,9 @@ public class EsignHttpUtil {
                         cum.append(participantFlag+":"+psnName+"("+psnAccount+");");
                     }
                 }
-                cum.delete(cum.length()-1,cum.length());
+                if(cum.length()>0) {
+                    cum.delete(cum.length() - 1, cum.length());
+                }
                 info.setDescription(cum.toString());
             }
         }

+ 37 - 8
websrc/com/kingdee/eas/custom/esign/osf/Create_by_fileOSFService.java

@@ -90,7 +90,7 @@ public class Create_by_fileOSFService implements IHRMsfService {
 
         String mack = (String) map.get("mack");
         String data = (String) map.get("data");
-        String signTemplateId = (String) map.get("signTemplateId");
+        String signTemplateId = (String) map.get("eSignTemplateNum");
         Map<String, Object> resul = Maps.newHashMap();
         try {
             JSONObject jsonObject = JSON.parseObject(data);
@@ -209,7 +209,29 @@ public class Create_by_fileOSFService implements IHRMsfService {
                                 Map<String, List<Map<String, Object>>> pMap = this.addParticipants(context, signInfo, eSignTemplateNum, sealId, sourceId);
                                 signMap.put("signTemplateId", eSignTemplateNum);
                                 signMap.put("components", components);
+                                List<Map<String, Object>> participants= Lists.newArrayList();
+
+                                for(int x =0;x< pMap.get("participants").size();x++){
+                                    Map<String, Object> participant= pMap.get("participants").get(x);
+                                    Integer participantSetMode = (Integer) participant.get("participantSetMode");
+                                    Map<String, Object>  psnParticipant = (Map<String, Object>) participant.get("psnParticipant");
+                                    if(null!=psnParticipant){
+                                        psnParticipant.remove("psnId");
+                                    }
+
+                                    Map<String, Object>  orgParticipant = (Map<String, Object>) participant.get("orgParticipant");
+                                    if(null!=orgParticipant){
+                                        orgParticipant.remove("orgId");
+                                        Map<String, Object>  transactor = (Map<String, Object>) orgParticipant.get("transactor");
+                                        transactor.remove("transactorPsnId");
+                                    }
+
+                                    if (null!=participantSetMode&&(participantSetMode.compareTo(1) == 0 ||participantSetMode.compareTo(4)== 0)){
+                                        participants.add(participant);
+                                    }
+                                }
                                 signMap.putAll(pMap);
+                                signMap.put("participants",participants);
                                 System.out.println("--------------------------------------------------------------------------------------");
                                 System.out.println("signMap:" + JSON.toJSONString(signMap));
                                 System.out.println("--------------------------------------------------------------------------------------");
@@ -643,8 +665,8 @@ public class Create_by_fileOSFService implements IHRMsfService {
                 components.add(component);
             }
             //取得这个文件的签署人的签署区
-            Map<String, Map<String, Map<String, Object>>> signAreaList = this.addsignAreaList(context, fields, (String) docTemplateId, sourceId, docTemplateId);
-            doc.put("signListGroup", signAreaList);
+            //Map<String, Map<String, Map<String, Object>>> signAreaList = this.addsignAreaList(context, fields, (String) docTemplateId, sourceId, docTemplateId);
+            //doc.put("signListGroup", signAreaList);
             docs.add(doc);
         }
         resul.put("docs", docs);
@@ -1095,7 +1117,7 @@ public class Create_by_fileOSFService implements IHRMsfService {
                                     if (null != orgSignerInfo) {
                                         String signName = orgSignerInfo.getString("signName");
                                         if (participantFlag.equals(signName)) {
-                                            orgParticipant = new JSONObject();
+                                             orgParticipant = new JSONObject();
                                             p.put("orgParticipant", orgParticipant);
                                             for(int k=0;k<components.size();k++) {
                                                 JSONObject component=components.getJSONObject(k);
@@ -1130,9 +1152,7 @@ public class Create_by_fileOSFService implements IHRMsfService {
                                         if (null != psnSignerInfo) {
                                             String signName = psnSignerInfo.getString("signName");
                                             if (participantFlag.equals(signName)) {
-                                                if (null == psnParticipant) {
-                                                    psnParticipant = new JSONObject();
-                                                }
+                                                 psnParticipant = new JSONObject();
                                                 p.put("psnParticipant", psnParticipant);
                                                 //orgParticipant.put("sealOwnerId",sealOwnerId);
                                                 psnParticipant.put("psnAccount", psnSignerInfo.get("psnAccount"));
@@ -1151,7 +1171,6 @@ public class Create_by_fileOSFService implements IHRMsfService {
                         }
                         JSONArray copiers = orgPsnStd.getJSONArray("copiers");
                         if (null != copiers) {
-
                             for (int i = 0; i < copiers.size(); i++) {
                                 addCopiers.add((Map<String, Object>) copiers.get(i));
                             }
@@ -1160,6 +1179,16 @@ public class Create_by_fileOSFService implements IHRMsfService {
                 }
             }
         }
+        for(int i=0;i<participants.size();i++){
+            JSONObject p= (JSONObject) participants.get(i);
+            p.remove("components");
+
+        }
+        for(int i=0;i<addCopiers.size();i++){
+            JSONObject copier = (JSONObject) addCopiers.get(i);
+            JSONObject p= (JSONObject) copier.get("copierPsnInfo");
+            p.remove("psnId");
+        }
         participants_addCopiers.put("participants", participants);
         participants_addCopiers.put("addCopiers", addCopiers);
         return participants_addCopiers;