package com.weaver.seconddev.chapanda.test;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;

public class testJson {


    public static void main(String[] args) {
        String msg = "{\"errCode\":0,\"msg\":\"success\",\"errShow\":true,\"data\":{\"success\":true,\"message\":\"执行成功\",\"template\":{\"templateId\":\"MB124\",\"templateName\":\"用工合同（测试）\",\"typeId\":1,\"typeName\":\"默认类型\",\"modifyTime\":\"2025-07-31 17:57:01\",\"fileKey\":\"$59fc1115-29b1-46b2-a39a-691516e0cb94$3608310660\",\"lastFileKey\":null,\"templateFlows\":[{\"flowId\":56,\"wordPredefineId\":null,\"flowName\":\"甲方\",\"routingOrder\":null,\"predefine\":{\"predefineId\":94,\"signatureType\":\"Multi\",\"keyWord\":null,\"addSignTime\":true,\"positions\":[{\"posX\":142,\"posY\":171,\"pageNo\":\"6,10\",\"templateSignTimeInfos\":[{\"id\":null,\"fontSize\":12,\"dateFormat\":\"YYYY-MM-DD\",\"posPage\":\"6,10\",\"posX\":104.0,\"posY\":102.0}]}]},\"signatory\":null,\"signDate\":null},{\"flowId\":57,\"wordPredefineId\":null,\"flowName\":\"乙方\",\"routingOrder\":null,\"predefine\":{\"predefineId\":95,\"signatureType\":\"Multi\",\"keyWord\":null,\"addSignTime\":true,\"positions\":[{\"posX\":447,\"posY\":182,\"pageNo\":\"6,7,10,11,13,14,15,18,19,67,68\",\"templateSignTimeInfos\":[{\"id\":null,\"fontSize\":12,\"dateFormat\":\"YYYY-MM-DD\",\"posPage\":\"6,7,10,11,13,14,15,18,19,67,68\",\"posX\":406.0,\"posY\":87.0}]}]},\"signatory\":null,\"signDate\":null}],\"templateForms\":[{\"formId\":265,\"formName\":\"员工手册签收页-工号\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":3,\"validateStyle\":9,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":67,\"posX\":388,\"posY\":120,\"width\":162,\"height\":23}]},{\"formId\":264,\"formName\":\"廉洁自律-公司名称\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":16,\"posX\":86,\"posY\":687,\"width\":351,\"height\":36}]},{\"formId\":263,\"formName\":\"社保公积金告知-身份证号\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":3,\"validateStyle\":9,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":15,\"posX\":403,\"posY\":128,\"width\":173,\"height\":26}]},{\"formId\":262,\"formName\":\"离职承诺书-身份证号\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":3,\"validateStyle\":9,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":14,\"posX\":404,\"posY\":136,\"width\":167,\"height\":27}]},{\"formId\":261,\"formName\":\"录用条件-公司名称2\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":13,\"posX\":205,\"posY\":227,\"width\":339,\"height\":36}]},{\"formId\":260,\"formName\":\"录用条件-入职日期\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":2,\"validateStyle\":7,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":13,\"posX\":404,\"posY\":365,\"width\":120,\"height\":30}]},{\"formId\":259,\"formName\":\"录用条件-公司名称\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":13,\"posX\":346,\"posY\":393,\"width\":191,\"height\":53}]},{\"formId\":258,\"formName\":\"录用条件-试用期结束日期\",\"font\":\"SimSun\",\"fontSize\":10.5,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":2,\"validateStyle\":7,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":12,\"posX\":132,\"posY\":662,\"width\":84,\"height\":45}]},{\"formId\":257,\"formName\":\"录用条件-试用期开始日期\",\"font\":\"SimSun\",\"fontSize\":10.5,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":2,\"validateStyle\":7,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":12,\"posX\":35,\"posY\":674,\"width\":99,\"height\":29}]},{\"formId\":256,\"formName\":\"录用条件-岗位\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":12,\"posX\":301,\"posY\":698,\"width\":81,\"height\":34}]},{\"formId\":255,\"formName\":\"录用条件-姓名\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":12,\"posX\":30,\"posY\":717,\"width\":66,\"height\":37}]},{\"formId\":254,\"formName\":\"申请亲属关系2\",\"font\":\"SimSun\",\"fontSize\":10.5,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":11,\"posX\":480,\"posY\":464,\"width\":74,\"height\":30}]},{\"formId\":253,\"formName\":\"申报亲属入职日期2\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":2,\"validateStyle\":7,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":11,\"posX\":431,\"posY\":491,\"width\":120,\"height\":30}]},{\"formId\":252,\"formName\":\"申报亲属工号2\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":11,\"posX\":300,\"posY\":485,\"width\":87,\"height\":35}]},{\"formId\":251,\"formName\":\"申报亲属姓名2\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":11,\"posX\":196,\"posY\":483,\"width\":72,\"height\":36}]},{\"formId\":250,\"formName\":\"申报亲属岗位1\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":11,\"posX\":383,\"posY\":533,\"width\":137,\"height\":35}]},{\"formId\":249,\"formName\":\"申报亲属部门1\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":11,\"posX\":162,\"posY\":534,\"width\":141,\"height\":31}]},{\"formId\":248,\"formName\":\"申请亲属关系1\",\"font\":\"SimSun\",\"fontSize\":10.5,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":11,\"posX\":481,\"posY\":606,\"width\":84,\"height\":34}]},{\"formId\":247,\"formName\":\"申报亲属入职日期1\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":2,\"validateStyle\":7,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":11,\"posX\":431,\"posY\":642,\"width\":120,\"height\":30}]},{\"formId\":246,\"formName\":\"申报亲属工号1\",\"font\":\"SimSun\",\"fontSize\":10.5,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":11,\"posX\":299,\"posY\":636,\"width\":87,\"height\":39}]},{\"formId\":245,\"formName\":\"申报亲属姓名1\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":11,\"posX\":197,\"posY\":637,\"width\":73,\"height\":34}]},{\"formId\":244,\"formName\":\"利益申报-申报日期\",\"font\":\"SimSun\",\"fontSize\":10.5,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":11,\"posX\":430,\"posY\":688,\"width\":94,\"height\":31}]},{\"formId\":243,\"formName\":\"利益申报-入职日期\",\"font\":\"SimSun\",\"fontSize\":10.5,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":2,\"validateStyle\":7,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":11,\"posX\":300,\"posY\":685,\"width\":90,\"height\":33}]},{\"formId\":242,\"formName\":\"利益申报-申报人数\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":11,\"posX\":162,\"posY\":686,\"width\":83,\"height\":33}]},{\"formId\":241,\"formName\":\"利益申报-工号\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":11,\"posX\":431,\"posY\":714,\"width\":124,\"height\":30}]},{\"formId\":240,\"formName\":\"利益申报-部门\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":11,\"posX\":300,\"posY\":716,\"width\":84,\"height\":39}]},{\"formId\":239,\"formName\":\"利益申报-姓名\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":11,\"posX\":160,\"posY\":716,\"width\":91,\"height\":32}]},{\"formId\":238,\"formName\":\"保密协议-员工身份证号\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":8,\"posX\":121,\"posY\":678,\"width\":304,\"height\":28}]},{\"formId\":237,\"formName\":\"保密协议-员工姓名\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":8,\"posX\":136,\"posY\":703,\"width\":291,\"height\":29}]},{\"formId\":236,\"formName\":\"保密协议-公司名称\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":8,\"posX\":137,\"posY\":727,\"width\":285,\"height\":28}]},{\"formId\":235,\"formName\":\"劳动合同-员工手机号\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":3,\"validateStyle\":9,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":5,\"posX\":117,\"posY\":243,\"width\":113,\"height\":27}]},{\"formId\":234,\"formName\":\"劳动合同-员工地址\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":5,\"posX\":96,\"posY\":269,\"width\":473,\"height\":28}]},{\"formId\":233,\"formName\":\"劳动合同工时制度\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":2,\"posX\":177,\"posY\":352,\"width\":55,\"height\":34}]},{\"formId\":232,\"formName\":\"劳动合同工作岗位\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":2,\"posX\":236,\"posY\":498,\"width\":138,\"height\":30}]},{\"formId\":231,\"formName\":\"劳动合同工作地点3\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":2,\"posX\":213,\"posY\":729,\"width\":130,\"height\":31}]},{\"formId\":230,\"formName\":\"劳动合同工作地点2\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":1,\"posX\":142,\"posY\":123,\"width\":118,\"height\":30}]},{\"formId\":229,\"formName\":\"劳动合同工作地点1\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":1,\"posX\":167,\"posY\":150,\"width\":156,\"height\":28}]},{\"formId\":228,\"formName\":\"劳动合同以完成一定任务结束\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":2,\"validateStyle\":7,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":1,\"posX\":345,\"posY\":242,\"width\":120,\"height\":30}]},{\"formId\":227,\"formName\":\"劳动合同以完成一定任务开始日期\",\"font\":\"SimSun\",\"fontSize\":10.5,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":2,\"validateStyle\":7,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":1,\"posX\":242,\"posY\":238,\"width\":120,\"height\":30}]},{\"formId\":226,\"formName\":\"劳动合同无固定期限开始日期\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":2,\"validateStyle\":7,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":1,\"posX\":164,\"posY\":264,\"width\":120,\"height\":30}]},{\"formId\":225,\"formName\":\"劳动合同试用期结束日期\",\"font\":\"SimSun\",\"fontSize\":10.5,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":2,\"validateStyle\":7,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":1,\"posX\":470,\"posY\":285,\"width\":98,\"height\":30}]},{\"formId\":224,\"formName\":\"劳动合同试用期开始日期\",\"font\":\"SimSun\",\"fontSize\":10.5,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":2,\"validateStyle\":7,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":1,\"posX\":388,\"posY\":285,\"width\":83,\"height\":29}]},{\"formId\":223,\"formName\":\"劳动合同固定期限结束日期\",\"font\":\"SimSun\",\"fontSize\":10.5,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":2,\"validateStyle\":7,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":1,\"posX\":229,\"posY\":287,\"width\":84,\"height\":27}]},{\"formId\":222,\"formName\":\"劳动合同固定期限开始日期\",\"font\":\"SimSun\",\"fontSize\":10.5,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":2,\"validateStyle\":7,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":1,\"posX\":137,\"posY\":285,\"width\":93,\"height\":31}]},{\"formId\":221,\"formName\":\"劳动合同期限类型\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":1,\"posX\":367,\"posY\":317,\"width\":159,\"height\":23}]},{\"formId\":219,\"formName\":\"劳动合同-员工邮箱号\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":1,\"posX\":93,\"posY\":489,\"width\":303,\"height\":21}]},{\"formId\":218,\"formName\":\"劳动合同-员工电话号码\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":3,\"validateStyle\":9,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":1,\"posX\":93,\"posY\":514,\"width\":307,\"height\":23}]},{\"formId\":217,\"formName\":\"劳动合同-员工家庭住址\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":1,\"posX\":93,\"posY\":531,\"width\":436,\"height\":30}]},{\"formId\":216,\"formName\":\"劳动合同-员工身份证号码\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":1,\"posX\":103,\"posY\":561,\"width\":302,\"height\":21}]},{\"formId\":215,\"formName\":\"劳动合同-员工姓名\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":1,\"posX\":103,\"posY\":582,\"width\":306,\"height\":21}]},{\"formId\":214,\"formName\":\"劳动合同-公司地址\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":1,\"posX\":69,\"posY\":648,\"width\":415,\"height\":28}]},{\"formId\":213,\"formName\":\"劳动合同-法定代表人\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":1,\"posX\":103,\"posY\":674,\"width\":268,\"height\":28}]},{\"formId\":212,\"formName\":\"劳动合同-公司名称\",\"font\":\"SimSun\",\"fontSize\":12.0,\"fontColor\":\"BLACK\",\"fontStyle\":\"Normal\",\"textAlign\":\"Left\",\"formStyle\":1,\"validateStyle\":0,\"isRequired\":0,\"instruction\":\"\",\"textFieldId\":null,\"positions\":[{\"pageNo\":1,\"posX\":119,\"posY\":702,\"width\":360,\"height\":28}]}],\"templateTag\":null,\"templateQrs\":null}}}";

        JSONObject partyA = new JSONObject();
        JSONObject partyB = new JSONObject();
        String docFilekey = "";
        String sealId = "";

        if(StringUtils.isNotBlank(msg)){
            JSONObject msgJson = JSONObject.parseObject(msg);
            if(msgJson.containsKey("data")){
                JSONObject dataJson = msgJson.getJSONObject("data");
                if(dataJson.containsKey("template")){
                    JSONObject templateJson = dataJson.getJSONObject("template");
                    if(templateJson.containsKey("templateFlows")){
                        JSONArray templateFlows = templateJson.getJSONArray("templateFlows");

                        for(int i=0;i<templateFlows.size();i++){
                            JSONObject templateFlowJson = templateFlows.getJSONObject(i);
                            if(templateFlowJson.containsKey("flowName")){
                                String flowName = templateFlowJson.getString("flowName");
                                if("甲方".equals(flowName)){

                                    JSONObject predefineJson = templateFlowJson.getJSONObject("predefine");
                                    boolean addSignTime = predefineJson.getBoolean("addSignTime");
                                    JSONArray positionsArray = predefineJson.getJSONArray("positions");
                                    System.out.println("positionsArray:"+positionsArray);

                                    JSONArray signPos = new JSONArray();

                                    for(int k=0;k<positionsArray.size();k++){
                                        JSONObject positionsJson = positionsArray.getJSONObject(k);
                                        String posX = positionsJson.getString("posX");
                                        String posY = positionsJson.getString("posY");
                                        String pageNo = positionsJson.getString("pageNo");

                                        JSONArray signDateInfos = new JSONArray();
                                        JSONArray templateSignTimeInfosArray = positionsJson.getJSONArray("templateSignTimeInfos");
                                        for(int n=0;n<templateSignTimeInfosArray.size();n++){
                                            JSONObject templateSignTimeInfosJson = templateSignTimeInfosArray.getJSONObject(n);
                                            JSONObject signDateInfo = new JSONObject();
                                            signDateInfo.put("dateFormat",templateSignTimeInfosJson.getString("dateFormat"));
                                            signDateInfo.put("fontSize",templateSignTimeInfosJson.getString("fontSize"));
                                            signDateInfo.put("posPage",templateSignTimeInfosJson.getString("posPage"));
                                            signDateInfo.put("posX",templateSignTimeInfosJson.getString("posX"));
                                            signDateInfo.put("posY",templateSignTimeInfosJson.getString("posY"));
                                            signDateInfos.add(signDateInfo);
                                        }
                                        JSONObject signPo = new JSONObject();
                                        signPo.put("addSignTime",addSignTime);
                                        signPo.put("edgePosition",1);
                                        signPo.put("edgeScope",0);
                                        signPo.put("posX",posX);
                                        signPo.put("posY",posY);
                                        signPo.put("pageNo",pageNo);
                                        signPo.put("signDateInfos",signDateInfos);

                                        signPo.put("sealId",sealId);
                                        signPo.put("signIdentity","ORGANIZE");
                                        signPo.put("signType",2);
                                        signPos.add(signPo);
                                    }

                                    partyA.put("signPos",signPos);
                                    partyA.put("docFilekey",docFilekey);
                                }else if("乙方".equals(flowName)){
                                    JSONObject predefineJson = templateFlowJson.getJSONObject("predefine");
                                    boolean addSignTime = predefineJson.getBoolean("addSignTime");
                                    JSONArray positionsArray = predefineJson.getJSONArray("positions");
                                    System.out.println("positionsArray:"+positionsArray);

                                    JSONArray signPos = new JSONArray();

                                    for(int k=0;k<positionsArray.size();k++){
                                        JSONObject positionsJson = positionsArray.getJSONObject(k);
                                        String posX = positionsJson.getString("posX");
                                        String posY = positionsJson.getString("posY");
                                        String pageNo = positionsJson.getString("pageNo");

                                        JSONArray signDateInfos = new JSONArray();
                                        JSONArray templateSignTimeInfosArray = positionsJson.getJSONArray("templateSignTimeInfos");
                                        for(int n=0;n<templateSignTimeInfosArray.size();n++){
                                            JSONObject templateSignTimeInfosJson = templateSignTimeInfosArray.getJSONObject(n);
                                            JSONObject signDateInfo = new JSONObject();
                                            signDateInfo.put("dateFormat",templateSignTimeInfosJson.getString("dateFormat"));
                                            signDateInfo.put("fontSize",templateSignTimeInfosJson.getString("fontSize"));
                                            signDateInfo.put("posPage",templateSignTimeInfosJson.getString("posPage"));
                                            signDateInfo.put("posX",templateSignTimeInfosJson.getString("posX"));
                                            signDateInfo.put("posY",templateSignTimeInfosJson.getString("posY"));
                                            signDateInfos.add(signDateInfo);
                                        }
                                        JSONObject signPo = new JSONObject();
                                        signPo.put("addSignTime",addSignTime);
                                        signPo.put("edgePosition",1);
                                        signPo.put("edgeScope",0);
                                        signPo.put("posX",posX);
                                        signPo.put("posY",posY);
                                        signPo.put("pageNo",pageNo);
                                        signPo.put("signDateInfos",signDateInfos);

                                        signPo.put("signIdentity","PERSON");
                                        signPo.put("sealType","0");
                                        signPo.put("pageNo",pageNo);

                                        signPos.add(signPo);
                                    }
                                    partyB.put("signPos",signPos);
                                    partyB.put("docFilekey",docFilekey);
                                }
                            }
                        }
                    }
                }
            }
        }








        System.out.println(partyA.toJSONString());
        System.out.println(partyB.toJSONString());

    }

}
