From 2f05035eeee582414d4adb4f118bf82035aec02e Mon Sep 17 00:00:00 2001 From: lijiazhuo <13787924+lijiazhuosky@user.noreply.gitee.com> Date: Fri, 27 Feb 2026 14:40:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/example/sso/controller/Reward.java | 2 + .../com/example/sso/controller/TuTest.java | 446 ------------------ .../sso/controller/TuiZuController.java | 282 +++-------- .../sso/controller/TuiZuController1.java | 241 ++++++++++ 4 files changed, 306 insertions(+), 665 deletions(-) delete mode 100644 src/main/java/com/example/sso/controller/TuTest.java create mode 100644 src/main/java/com/example/sso/controller/TuiZuController1.java diff --git a/src/main/java/com/example/sso/controller/Reward.java b/src/main/java/com/example/sso/controller/Reward.java index f581fee..185ef23 100644 --- a/src/main/java/com/example/sso/controller/Reward.java +++ b/src/main/java/com/example/sso/controller/Reward.java @@ -27,6 +27,8 @@ public class Reward { @PostMapping("/reward") public String reward(@RequestBody JSONObject rewards) throws ParseException { + + log.info("我是reward日志 " + rewards.toJSONString() ); lock.lock(); try { JSONObject dataa = rewards.getJSONObject("data"); diff --git a/src/main/java/com/example/sso/controller/TuTest.java b/src/main/java/com/example/sso/controller/TuTest.java deleted file mode 100644 index 2d85b9c..0000000 --- a/src/main/java/com/example/sso/controller/TuTest.java +++ /dev/null @@ -1,446 +0,0 @@ -package com.example.sso.controller; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.example.sso.dao.FddFileId; -import com.example.sso.dao.Photo; -import com.example.sso.dao.ThumbnailCompressor; -import com.example.sso.util.APIUtils; -import com.example.sso.util.FDaDaUtil; -import com.example.sso.util.TimeUtil; -import lombok.extern.slf4j.Slf4j; -import org.springframework.scheduling.annotation.Async; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -@Async -@RestController -@Slf4j -public class TuTest { - - @PostMapping("/tz1") - public void yuezu(@RequestBody JSONObject data) throws Exception { - - log.info("退租数据" + data.toJSONString()); - - JSONObject object = data.getJSONObject("data"); - String id = object.getString("_id"); - String car = object.getString("car"); - String sj = object.getString("sj"); - String timss = TimeUtil.timss(sj); - Integer gl = object.getInteger("gl"); - Integer dl = object.getInteger("dl"); - JSONArray mx = object.getJSONArray("mx"); - JSONArray yz = object.getJSONArray("yz"); - JSONArray cj = object.getJSONArray("cj"); - - String jsyss = object.getString("jsyss"); - String name = object.getString("name"); - String phone = object.getString("phone"); - String id1 = object.getString("id1"); - String a = object.getString("a"); - - String zq = object.getString("zq"); - String zh = object.getString("zh"); - String yq = object.getString("yq"); - String yh = object.getString("yh"); - String fs = object.getString("fs"); - - - String ww = object.getString("ww"); - - String wws = "姓名/联营方公司: " + ww; - String cars = "车牌号码:" + car; - String gls = "车辆公里数(KM): " + gl.toString(); - String dls = "车辆剩余电量(KM): " + dl.toString(); - String sjs = "验车时间:" + timss; - Photo.startPDF("/home/java/dpapp8090/pdf/" + id + ".pdf"); - Photo.TextAlignment(" 交车定损单"); - Photo.appendTextSection(" 驾驶员信息"); - Photo.appendTextSection(" " +wws); - Photo.appendTextSection(" 车辆信息"); - - Photo.appendTextSection(" " +cars); - Photo.appendTextSection(" " +gls); - Photo.appendTextSection(" "+dls); - Photo.appendTextSection(" "+sjs); - - Photo.appendTextSection(" 车辆整体照片"); - - - for (Object yzs : yz) { - JSONObject jsonObject = (JSONObject) yzs; - String url = jsonObject.getString("url"); - String hkfile = APIUtils.hkfile(url); - ThumbnailCompressor.compressWithThumbnailator(hkfile, hkfile); - Photo.appendImageSection(hkfile); - - } - - Photo.appendTextSection(" 车架号照片"); - - for (Object yzs : cj) { - JSONObject jsonObject = (JSONObject) yzs; - String url = jsonObject.getString("url"); - String hkfile = APIUtils.hkfile(url); - ThumbnailCompressor.compressWithThumbnailator(hkfile, hkfile); - Photo.appendImageSection(hkfile); - - } - - - - - - for (Object o : mx) { - - JSONObject test = (JSONObject) o; - String xiang = test.getString("xiang"); - - String xiangs = "验车受损项:" + xiang; - - - - Photo.appendTextSection(" " +xiangs); - - JSONArray tp = test.getJSONArray("tp"); - if (tp != null && tp.size() != 0) { - for (Object o1 : tp) { - JSONObject tests = (JSONObject) o1; - String url = tests.getString("url"); - String hkfile = APIUtils.hkfile(url); - ThumbnailCompressor.compressWithThumbnailator(hkfile, hkfile); - Photo.appendTextSection(" 车损详情图片:"); - Photo.appendImageSection(hkfile); - } - } - - - - - - } - - Photo.appendTextSections(" 签字"); - Photo.appendTextSections1("驾驶员/联营负责人签名:"); - Photo.appendTextSectionss(" 盖章"); - Photo.appendTextSectionss1("定损单位落章:"); - - - - - - Photo.closePDF(); - - - - - //创建签署任务 - JSONObject initiator = new JSONObject(); - JSONObject openid = new JSONObject(); - openid.put("idType", "corp"); - openid.put("openId", "625776ecae6742cb8eb710beedef9b4c"); - initiator.put("initiator", openid); - - initiator.put("signTaskSubject", "交车定损单"); - - - - - - initiator.put("businessId", "a09900c24614bd4c1de10c55712a3e0e"); - //参与方数组 - JSONArray jsonArray = new JSONArray(); - JSONObject ownerId = new JSONObject(); // docid - ownerId.put("ownerId", openid); - ownerId.put("signTemplateId", "1767841802943145947"); - String ownerIdJSONString = ownerId.toJSONString(); - String doc = FDaDaUtil.doc(ownerIdJSONString); - - //actor个人对象 - JSONObject actor = new JSONObject(); - //actor详细信息个人 - JSONObject actorlist = new JSONObject(); - actorlist.put("actorId", "参与方2"); - actorlist.put("actorType", "person"); - - actorlist.put("actorName", name); - - JSONArray permissions = new JSONArray(); - permissions.add("sign"); - - actorlist.put("identNameForMatch", name); - - actorlist.put("certType", "id_card"); - - actorlist.put("certNoForMatch", id1); - - - actorlist.put("notifyAddress", phone); - - JSONArray notifyType = new JSONArray(); - notifyType.add("start"); - notifyType.add("finish"); - actorlist.put("notifyType", notifyType); - actorlist.put("permissions", permissions); - - JSONArray signFieldsgeren = new JSONArray(); - JSONObject jsonObject55 = new JSONObject(); - jsonObject55.put("fieldDocId",doc); - jsonObject55.put("fieldName","签字"); - signFieldsgeren.add(jsonObject55); - - - actor.put("actor", actorlist); - actor.put("signFields",signFieldsgeren); - - - - - - jsonArray.add(actor); - - - - JSONArray docs = new JSONArray(); - - JSONObject qy = new JSONObject(); - qy.put("docId",doc); - qy.put("docName","文件文档"); - String ided = FddFileId.id("/home/java/dpapp8090/pdf/" + id + ".pdf"); - qy.put("docFileId",ided); - JSONArray docFields = new JSONArray(); - - - - - JSONObject yiyes = new JSONObject(); - yiyes.put("fieldId","4100411846"); - yiyes.put("fieldName","签字"); - JSONObject positions = new JSONObject(); - positions.put("positionMode","keyword"); - positions.put("positionKeyword","签字"); - yiyes.put("position",positions); - yiyes.put("moveable","false"); - yiyes.put("fieldType","person_sign"); - - docFields.add(yiyes); - - qy.put("docFields",docFields); - - docs.add(qy); - initiator.put("docs", docs); - - - initiator.put("actors", jsonArray); - String jsonString = initiator.toJSONString(); - log.info("我是参数 " + jsonString); - - String fdd = FDaDaUtil.fdds(jsonString); - log.info("车损明细文件生成:" + fdd); - JSONObject jsonObject = JSON.parseObject(fdd); - //任务id - String signTaskId = jsonObject.getJSONObject("data").getString("signTaskId"); - String signTaskIds = String.valueOf(jsonObject.getJSONObject("data")); - System.out.println("signTaskId____________________" + signTaskId); - System.out.println("signTaskIds========================" + signTaskIds); - String signtask = FDaDaUtil.signtask(signTaskIds); - log.info("车损明细文件生成完成" + signtask); - - - - if (true){ - Photo.startPDF("/home/java/dpapp8090/pdf/" + id + "a" + ".pdf"); - Photo.TextAlignment(" 交车验收单"); - Photo.appendTextSection(" 车号: " + car + " " + "所属分司: " + fs); - - - -// Photo.appendTextSection("驾驶员信息"); -// Photo.appendTextSection("\n"); -// Photo.appendTextSection(wws); -// Photo.appendTextSection("\n"); -// Photo.appendTextSection("\n"); -// Photo.appendTextSection("\n"); -// Photo.appendTextSection("车辆信息"); -// Photo.appendTextSection("\n"); -// Photo.appendTextSection(cars); -// Photo.appendTextSection(gls); -// Photo.appendTextSection(dls); -// Photo.appendTextSection(sjs); -// Photo.appendTextSection("\n"); -// Photo.appendTextSection("\n"); -// Photo.appendTextSection("\n"); -// Photo.appendTextSection("车辆整体照片"); - - - for (Object yzs : mx) { - JSONObject jsonObject12 = (JSONObject) yzs; - String xiang = jsonObject12.getString("xiang"); - Double jine = jsonObject12.getDouble("jine"); - String bz = jsonObject12.getString("bz"); - Photo.appendTextSection(" 项目: " +xiang + " " + " 金额: " + jine + " 备注: " + bz ); - - - - - - } - - - Photo.appendTextSection(" 备注: "); - - Photo.appendTextSection(" 左前轮: " + zq); - - Photo.appendTextSection(" 左后轮: " + zh); - - Photo.appendTextSection(" 右前轮: " + yq); - - Photo.appendTextSection(" 右后轮: " + yh); - - Photo.appendTextSection(" 行驶里程(KM): " + gl); - - Photo.appendTextSection(" 剩余电量(KM):" + dl); - - - Photo.appendTextSections(" 签字"); - Photo.appendTextSections1("驾驶员/联营负责人签名:"); - Photo.appendTextSectionss(" 盖章"); - Photo.appendTextSectionss1("定损单位落章:"); - - - - - - Photo.closePDF(); - - - - - //创建签署任务 - JSONObject initiator12 = new JSONObject(); - JSONObject openid12 = new JSONObject(); - openid12.put("idType", "corp"); - openid12.put("openId", "625776ecae6742cb8eb710beedef9b4c"); - initiator12.put("initiator", openid12); - - initiator12.put("signTaskSubject", "交车验收单"); - - - - - - initiator12.put("businessId", "a09900c24614bd4c1de10c55712a3e0e"); - //参与方数组 - JSONArray jsonArray12 = new JSONArray(); - JSONObject ownerId12 = new JSONObject(); // docid - ownerId12.put("ownerId", openid12); - ownerId12.put("signTemplateId", "1767841802943145947"); - String ownerIdJSONString12 = ownerId12.toJSONString(); - String doc12 = FDaDaUtil.doc(ownerIdJSONString12); - - //actor个人对象 - JSONObject actor12 = new JSONObject(); - //actor详细信息个人 - JSONObject actorlist12 = new JSONObject(); - actorlist12.put("actorId", "参与方2"); - actorlist12.put("actorType", "person"); - - actorlist12.put("actorName", name); - - JSONArray permissions12 = new JSONArray(); - permissions12.add("sign"); - - actorlist12.put("identNameForMatch", name); - - actorlist12.put("certType", "id_card"); - - actorlist12.put("certNoForMatch", id1); - - - actorlist12.put("notifyAddress", phone); - - JSONArray notifyType12 = new JSONArray(); - notifyType12.add("start"); - notifyType12.add("finish"); - actorlist12.put("notifyType", notifyType12); - actorlist12.put("permissions", permissions12); - - JSONArray signFieldsgeren12 = new JSONArray(); - JSONObject jsonObject5512 = new JSONObject(); - jsonObject5512.put("fieldDocId",doc12); - jsonObject5512.put("fieldName","签字"); - signFieldsgeren12.add(jsonObject5512); - - - actor12.put("actor", actorlist12); - actor12.put("signFields",signFieldsgeren12); - - - - - jsonArray12.add(actor12); - - - - JSONArray docs12 = new JSONArray(); - - JSONObject qy12 = new JSONObject(); - qy12.put("docId",doc12); - qy12.put("docName","文件文档"); - String ided12 = FddFileId.id("/home/java/dpapp8090/pdf/" + id + "a"+ ".pdf"); - qy12.put("docFileId",ided12); - JSONArray docFields12 = new JSONArray(); - - - - - JSONObject yiyes12 = new JSONObject(); - yiyes12.put("fieldId","4100411846"); - yiyes12.put("fieldName","签字"); - JSONObject positions12 = new JSONObject(); - positions12.put("positionMode","keyword"); - positions12.put("positionKeyword","签字"); - yiyes12.put("position",positions12); - yiyes12.put("moveable","false"); - yiyes12.put("fieldType","person_sign"); - - docFields12.add(yiyes12); - - qy12.put("docFields",docFields12); - - docs12.add(qy12); - initiator12.put("docs", docs12); - - - initiator12.put("actors", jsonArray12); - String jsonString12 = initiator12.toJSONString(); - log.info("我是参数a " + jsonString12); - - String fdd12 = FDaDaUtil.fdds(jsonString12); - log.info("车损明细文件生成a:" + fdd12); - JSONObject jsonObject12 = JSON.parseObject(fdd12); - //任务id - String signTaskId12 = jsonObject12.getJSONObject("data").getString("signTaskId"); - String signTaskIds12 = String.valueOf(jsonObject12.getJSONObject("data")); - System.out.println("signTaskId____________________" + signTaskId12); - System.out.println("signTaskIds========================" + signTaskIds12); - String signtask12 = FDaDaUtil.signtask(signTaskIds12); - log.info("车损明细文件生成完成a" + signtask12); - - } - - - - - - - - - - - - } -} diff --git a/src/main/java/com/example/sso/controller/TuiZuController.java b/src/main/java/com/example/sso/controller/TuiZuController.java index 521052d..2537f74 100644 --- a/src/main/java/com/example/sso/controller/TuiZuController.java +++ b/src/main/java/com/example/sso/controller/TuiZuController.java @@ -52,7 +52,7 @@ public class TuiZuController { String yq = object.getString("yq"); String yh = object.getString("yh"); String fs = object.getString("fs"); - + String dh = object.getString("dh"); String ww = object.getString("ww"); @@ -65,13 +65,13 @@ public class TuiZuController { Photo.startPDF("/home/java/dpapp8090/pdf/" + id + ".pdf"); Photo.TextAlignment(" 车辆验收单"); Photo.appendTextSection(" 驾驶员信息"); - Photo.appendTextSection(" " +wws); + Photo.appendTextSection(" " + wws); Photo.appendTextSection(" 车辆信息"); - Photo.appendTextSection(" " +cars); - Photo.appendTextSection(" " +gls); - Photo.appendTextSection(" "+dls); - Photo.appendTextSection(" "+sjs); + Photo.appendTextSection(" " + cars); + Photo.appendTextSection(" " + gls); + Photo.appendTextSection(" " + dls); + Photo.appendTextSection(" " + sjs); Photo.appendTextSection(" 车辆整体照片"); @@ -97,9 +97,6 @@ public class TuiZuController { } - - - for (Object o : mx) { JSONObject test = (JSONObject) o; @@ -107,10 +104,9 @@ public class TuiZuController { String jine1 = test.getString("jine"); String xiangs = "车辆验收项:" + xiang; - Photo.appendTextSection(" " +xiangs); - - Photo.appendTextSection(" " +"额定金额:"+jine1 ); + Photo.appendTextSection(" " + xiangs); + Photo.appendTextSection(" " + "额定金额:" + jine1); JSONArray tp = test.getJSONArray("tp"); @@ -126,25 +122,17 @@ public class TuiZuController { } - - - } Photo.appendTextSections(" 签字"); Photo.appendTextSections1("驾驶员/联营负责人签名:"); Photo.appendTextSectionss(" 盖章"); - Photo.appendTextSectionss1("定损单位落章:"); - - - + Photo.appendTextSectionss1("甲方(签章):"); Photo.closePDF(); - - //创建签署任务 JSONObject initiator = new JSONObject(); JSONObject openid = new JSONObject(); @@ -152,10 +140,7 @@ public class TuiZuController { openid.put("openId", "625776ecae6742cb8eb710beedef9b4c"); initiator.put("initiator", openid); - initiator.put("signTaskSubject", "交车验收单"); - - - + initiator.put("signTaskSubject", "交车验收单" + "$" + ww + "$" + dh); initiator.put("businessId", "a09900c24614bd4c1de10c55712a3e0e"); @@ -183,7 +168,7 @@ public class TuiZuController { actorlist.put("certType", "id_card"); - actorlist.put("certNoForMatch", id1); + actorlist.put("certNoForMatch", id1); actorlist.put("notifyAddress", phone); @@ -196,13 +181,13 @@ public class TuiZuController { JSONArray signFieldsgeren = new JSONArray(); JSONObject jsonObject55 = new JSONObject(); - jsonObject55.put("fieldDocId",doc); - jsonObject55.put("fieldName","签字"); + jsonObject55.put("fieldDocId", doc); + jsonObject55.put("fieldName", "签字"); signFieldsgeren.add(jsonObject55); actor.put("actor", actorlist); - actor.put("signFields",signFieldsgeren); + actor.put("signFields", signFieldsgeren); //企业方对象 @@ -237,15 +222,13 @@ public class TuiZuController { notifyTypes.add("start"); notifyTypes.add("finish"); actorlists.put("notifyType", notifyTypes); - JSONArray objects = new JSONArray(); + JSONArray objects = new JSONArray(); objects.add("sign"); actorlists.put("permissions", objects); JSONArray SignField = new JSONArray(); JSONObject jsonObject2 = new JSONObject(); - - jsonObject2.put("fieldDocId", doc); @@ -260,7 +243,8 @@ public class TuiZuController { } else if (jsyss.equals("金银建")) { jsonObject2.put("sealId", 1705991362754131529l); - jsonObject2.put("fieldName", "签章");; + jsonObject2.put("fieldName", "签章"); + ; } else if (jsyss.equals("华建")) { jsonObject2.put("sealId", 1705991079845184562l); @@ -276,11 +260,6 @@ public class TuiZuController { } - - - - - SignField.add(jsonObject2); JSONObject signConfigInfo = new JSONObject(); @@ -301,38 +280,38 @@ public class TuiZuController { JSONArray docs = new JSONArray(); JSONObject qy = new JSONObject(); - qy.put("docId",doc); - qy.put("docName","文件文档"); + qy.put("docId", doc); + qy.put("docName", "文件文档"); String ided = FddFileId.id("/home/java/dpapp8090/pdf/" + id + ".pdf"); - qy.put("docFileId",ided); + qy.put("docFileId", ided); JSONArray docFields = new JSONArray(); JSONObject yiye = new JSONObject(); - yiye.put("fieldId","8342392107"); - yiye.put("fieldName","签章"); + yiye.put("fieldId", "8342392107"); + yiye.put("fieldName", "签章"); JSONObject position = new JSONObject(); - position.put("positionMode","keyword"); - position.put("positionKeyword","盖章"); - yiye.put("position",position); - yiye.put("moveable","false"); - yiye.put("fieldType","corp_seal"); + position.put("positionMode", "keyword"); + position.put("positionKeyword", "盖章"); + yiye.put("position", position); + yiye.put("moveable", "false"); + yiye.put("fieldType", "corp_seal"); docFields.add(yiye); JSONObject yiyes = new JSONObject(); - yiyes.put("fieldId","4100411846"); - yiyes.put("fieldName","签字"); + yiyes.put("fieldId", "4100411846"); + yiyes.put("fieldName", "签字"); JSONObject positions = new JSONObject(); - positions.put("positionMode","keyword"); - positions.put("positionKeyword","签字"); - yiyes.put("position",positions); - yiyes.put("moveable","false"); - yiyes.put("fieldType","person_sign"); + positions.put("positionMode", "keyword"); + positions.put("positionKeyword", "签字"); + yiyes.put("position", positions); + yiyes.put("moveable", "false"); + yiyes.put("fieldType", "person_sign"); docFields.add(yiyes); - qy.put("docFields",docFields); + qy.put("docFields", docFields); docs.add(qy); initiator.put("docs", docs); @@ -354,30 +333,12 @@ public class TuiZuController { log.info("车损明细文件生成完成" + signtask); - - /* if (true){ + /* if (true) { Photo.startPDF("/home/java/dpapp8090/pdf/" + id + "a" + ".pdf"); - Photo.TextAlignment(" 交车验收单"); + Photo.TextAlignment(" 车辆维修报价单"); Photo.appendTextSection(" 车号: " + car + " " + "所属分司: " + fs); - - -// Photo.appendTextSection("驾驶员信息"); -// Photo.appendTextSection("\n"); -// Photo.appendTextSection(wws); -// Photo.appendTextSection("\n"); -// Photo.appendTextSection("\n"); -// Photo.appendTextSection("\n"); -// Photo.appendTextSection("车辆信息"); -// Photo.appendTextSection("\n"); -// Photo.appendTextSection(cars); -// Photo.appendTextSection(gls); -// Photo.appendTextSection(dls); -// Photo.appendTextSection(sjs); -// Photo.appendTextSection("\n"); -// Photo.appendTextSection("\n"); -// Photo.appendTextSection("\n"); -// Photo.appendTextSection("车辆整体照片"); + Photo.appendTextSection(" 定损时间:" + timss); for (Object yzs : mx) { @@ -385,44 +346,19 @@ public class TuiZuController { String xiang = jsonObject12.getString("xiang"); Double jine = jsonObject12.getDouble("jine"); String bz = jsonObject12.getString("bz"); - Photo.appendTextSection(" 项目: " +xiang + " " + " 金额: " + jine + " 备注: " + bz ); - - - + Photo.appendTextSection(" 项目: " + xiang + " " + " 金额: " + jine + " 备注: " + bz); } - Photo.appendTextSection(" 备注: "); - - Photo.appendTextSection(" 左前轮: " + zq); - - Photo.appendTextSection(" 左后轮: " + zh); - - Photo.appendTextSection(" 右前轮: " + yq); - - Photo.appendTextSection(" 右后轮: " + yh); - - Photo.appendTextSection(" 行驶里程(KM): " + gl); - - Photo.appendTextSection(" 剩余电量(KM):" + dl); - - - Photo.appendTextSections(" 签字"); - Photo.appendTextSections1("驾驶员/联营负责人签名:"); Photo.appendTextSectionss(" 盖章"); - Photo.appendTextSectionss1("定损单位落章:"); - - - + Photo.appendTextSectionss1("报价单位落章:"); Photo.closePDF(); - - //创建签署任务 JSONObject initiator12 = new JSONObject(); JSONObject openid12 = new JSONObject(); @@ -430,10 +366,7 @@ public class TuiZuController { openid12.put("openId", "625776ecae6742cb8eb710beedef9b4c"); initiator12.put("initiator", openid12); - initiator12.put("signTaskSubject", "交车验收单"); - - - + initiator12.put("signTaskSubject", "车辆维修报价单" + "$" + ww + "$" + dh); initiator12.put("businessId", "a09900c24614bd4c1de10c55712a3e0e"); @@ -441,47 +374,10 @@ public class TuiZuController { JSONArray jsonArray12 = new JSONArray(); JSONObject ownerId12 = new JSONObject(); // docid ownerId12.put("ownerId", openid12); - ownerId12.put("signTemplateId", "1767841802943145947"); + ownerId12.put("signTemplateId", "1768984354068130424"); String ownerIdJSONString12 = ownerId12.toJSONString(); String doc12 = FDaDaUtil.doc(ownerIdJSONString12); - //actor个人对象 - JSONObject actor12 = new JSONObject(); - //actor详细信息个人 - JSONObject actorlist12 = new JSONObject(); - actorlist12.put("actorId", "参与方2"); - actorlist12.put("actorType", "person"); - - actorlist12.put("actorName", name); - - JSONArray permissions12 = new JSONArray(); - permissions12.add("sign"); - - actorlist12.put("identNameForMatch", name); - - actorlist12.put("certType", "id_card"); - - actorlist12.put("certNoForMatch", id1); - - - actorlist12.put("notifyAddress", phone); - - JSONArray notifyType12 = new JSONArray(); - notifyType12.add("start"); - notifyType12.add("finish"); - actorlist12.put("notifyType", notifyType12); - actorlist12.put("permissions", permissions12); - - JSONArray signFieldsgeren12 = new JSONArray(); - JSONObject jsonObject5512 = new JSONObject(); - jsonObject5512.put("fieldDocId",doc12); - jsonObject5512.put("fieldName","签字"); - signFieldsgeren12.add(jsonObject5512); - - - actor12.put("actor", actorlist12); - actor12.put("signFields",signFieldsgeren12); - //企业方对象 JSONObject actors12 = new JSONObject(); @@ -492,59 +388,29 @@ public class TuiZuController { actorlists12.put("actorName", a); - *//*JSONArray permissionss = new JSONArray(); - permissionss.add("sign"); - actorlists.put("permissions",permissionss);*//* - if (!jsyss.equals("银建新能源")) { - actorlists12.put("actorOpenId", "625776ecae6742cb8eb710beedef9b4c"); - String entryids = FDaDaUtil.entryids(a); - actorlists12.put("actorEntityId", entryids); - } else if (jsyss.equals("银建新能源")) { - actorlists12.put("actorOpenId", "a0c12949a1c54ff9bfa45dbe957fbc5d"); - } - *//*actorlists.put("notifyAddress", "13520145209");*//* + JSONArray permissionss = new JSONArray(); + permissionss.add("sign"); + actorlists.put("permissions", permissionss); + actorlists12.put("actorOpenId", "854d4fb18fc9494aadaa89c089216e22"); + + actorlists.put("notifyAddress", "13520145200"); JSONArray notifyTypes12 = new JSONArray(); notifyTypes12.add("start"); notifyTypes12.add("finish"); actorlists12.put("notifyType", notifyTypes12); - JSONArray objects12 = new JSONArray(); + JSONArray objects12 = new JSONArray(); objects12.add("sign"); actorlists12.put("permissions", objects12); JSONArray SignField12 = new JSONArray(); JSONObject jsonObject212 = new JSONObject(); - - jsonObject212.put("fieldDocId", doc12); - if (jsyss.equals("银建")) { - jsonObject212.put("sealId", 1705990704393128941l); - - jsonObject212.put("fieldName", "签章"); - - } else if (jsyss.equals("金建")) { - jsonObject212.put("sealId", 1705991374867130717l); - jsonObject212.put("fieldName", "签章"); - - } else if (jsyss.equals("金银建")) { - jsonObject212.put("sealId", 1705991362754131529l); - jsonObject212.put("fieldName", "签章");; - - } else if (jsyss.equals("华建")) { - jsonObject212.put("sealId", 1705991079845184562l); - jsonObject212.put("fieldName", "签章"); - - } else if (jsyss.equals("银建新能源")) { - jsonObject212.put("sealId", 1706510414541115296l); - jsonObject212.put("fieldName", "签章"); - - } - - - + jsonObject212.put("sealId", 1768981160551170505l); + jsonObject212.put("fieldName", "签章"); SignField12.add(jsonObject212); @@ -560,45 +426,32 @@ public class TuiZuController { actors12.put("signConfigInfo", signConfigInfos12); - jsonArray12.add(actor12); jsonArray12.add(actors12); JSONArray docs12 = new JSONArray(); JSONObject qy12 = new JSONObject(); - qy12.put("docId",doc12); - qy12.put("docName","文件文档"); - String ided12 = FddFileId.id("/home/java/dpapp8090/pdf/" + id + "a"+ ".pdf"); - qy12.put("docFileId",ided12); + qy12.put("docId", doc12); + qy12.put("docName", "文件文档"); + String ided12 = FddFileId.id("/home/java/dpapp8090/pdf/" + id + "a" + ".pdf"); + qy12.put("docFileId", ided12); JSONArray docFields12 = new JSONArray(); JSONObject yiye12 = new JSONObject(); - yiye12.put("fieldId","8342392107"); - yiye12.put("fieldName","签章"); + yiye12.put("fieldId", "8342392107"); + yiye12.put("fieldName", "签章"); JSONObject position12 = new JSONObject(); - position12.put("positionMode","keyword"); - position12.put("positionKeyword","盖章"); - yiye12.put("position",position12); - yiye12.put("moveable","false"); - yiye12.put("fieldType","corp_seal"); + position12.put("positionMode", "keyword"); + position12.put("positionKeyword", "盖章"); + yiye12.put("position", position12); + yiye12.put("moveable", "false"); + yiye12.put("fieldType", "corp_seal"); docFields12.add(yiye12); - JSONObject yiyes12 = new JSONObject(); - yiyes12.put("fieldId","4100411846"); - yiyes12.put("fieldName","签字"); - JSONObject positions12 = new JSONObject(); - positions12.put("positionMode","keyword"); - positions12.put("positionKeyword","签字"); - yiyes12.put("position",positions12); - yiyes12.put("moveable","false"); - yiyes12.put("fieldType","person_sign"); - - docFields12.add(yiyes12); - - qy12.put("docFields",docFields12); + qy12.put("docFields", docFields12); docs12.add(qy12); initiator12.put("docs", docs12); @@ -622,14 +475,5 @@ public class TuiZuController { }*/ - - - - - - - - - } } diff --git a/src/main/java/com/example/sso/controller/TuiZuController1.java b/src/main/java/com/example/sso/controller/TuiZuController1.java new file mode 100644 index 0000000..b649b87 --- /dev/null +++ b/src/main/java/com/example/sso/controller/TuiZuController1.java @@ -0,0 +1,241 @@ +package com.example.sso.controller; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.example.sso.dao.FddFileId; +import com.example.sso.dao.Photo; +import com.example.sso.util.FDaDaUtil; +import com.example.sso.util.TimeUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.scheduling.annotation.Async; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@Async +@RestController +@Slf4j +public class TuiZuController1 { + + @PostMapping("/tz1") + public void yuezu(@RequestBody JSONObject data) throws Exception { + + log.info("退租数据" + data.toJSONString()); + + JSONObject object = data.getJSONObject("data"); + String id = object.getString("_id"); + String car = object.getString("car"); + String sj = object.getString("sj"); + String timss = TimeUtil.timss(sj); + Integer gl = object.getInteger("gl"); + Integer dl = object.getInteger("dl"); + JSONArray mx = object.getJSONArray("mx"); + JSONArray yz = object.getJSONArray("yz"); + JSONArray cj = object.getJSONArray("cj"); + + String jsyss = object.getString("jsyss"); + String name = object.getString("name"); + String phone = object.getString("phone"); + String id1 = object.getString("id1"); + String a = object.getString("a"); + + String zq = object.getString("zq"); + String zh = object.getString("zh"); + String yq = object.getString("yq"); + String yh = object.getString("yh"); + String fs = object.getString("fs"); + String dh = object.getString("dh"); + + + + String ww = object.getString("ww"); + + + + + if (true){ + Photo.startPDF("/home/java/dpapp8090/pdf/" + id + "a" + ".pdf"); + Photo.TextAlignment(" 车辆维修报价单"); + Photo.appendTextSection(" 车号: " + car + " " + "所属分司: " + fs); + + Photo.appendTextSection(" 定损时间:"+timss); + + + + + for (Object yzs : mx) { + JSONObject jsonObject12 = (JSONObject) yzs; + String xiang = jsonObject12.getString("xiang"); + Double jine = jsonObject12.getDouble("jine"); + String bz = jsonObject12.getString("bz"); + Photo.appendTextSection(" 项目: " +xiang + " " + " 金额: " + jine + " 备注: " + bz ); + + + + + + } + + + + + + + + Photo.appendTextSectionss(" 盖章"); + Photo.appendTextSectionss1("报价单位落章:"); + + + + + + Photo.closePDF(); + + + + + //创建签署任务 + JSONObject initiator12 = new JSONObject(); + JSONObject openid12 = new JSONObject(); + openid12.put("idType", "corp"); + openid12.put("openId", "625776ecae6742cb8eb710beedef9b4c"); + initiator12.put("initiator", openid12); + + initiator12.put("signTaskSubject", "车辆维修报价单" + "$" + ww + "$" + dh); + + + + + + initiator12.put("businessId", "a09900c24614bd4c1de10c55712a3e0e"); + //参与方数组 + JSONArray jsonArray12 = new JSONArray(); + JSONObject ownerId12 = new JSONObject(); // docid + ownerId12.put("ownerId", openid12); + ownerId12.put("signTemplateId", "1768984354068130424"); + String ownerIdJSONString12 = ownerId12.toJSONString(); + String doc12 = FDaDaUtil.doc(ownerIdJSONString12); + + + + + + + //企业方对象 + JSONObject actors12 = new JSONObject(); + //actor详细信息企业 + JSONObject actorlists12 = new JSONObject(); + actorlists12.put("actorId", "参与方1"); + actorlists12.put("actorType", "corp"); + + actorlists12.put("actorName", a); + + JSONArray permissionss = new JSONArray(); + permissionss.add("sign"); + + actorlists12.put("actorOpenId", "854d4fb18fc9494aadaa89c089216e22"); + + + JSONArray notifyTypes12 = new JSONArray(); + notifyTypes12.add("start"); + notifyTypes12.add("finish"); + actorlists12.put("notifyType", notifyTypes12); + JSONArray objects12 = new JSONArray(); + objects12.add("sign"); + actorlists12.put("permissions", objects12); + JSONArray SignField12 = new JSONArray(); + JSONObject jsonObject212 = new JSONObject(); + + + + + jsonObject212.put("fieldDocId", doc12); + + + + jsonObject212.put("sealId", 1768981160551170505l); + + jsonObject212.put("fieldName", "签章"); + + + + + + + + SignField12.add(jsonObject212); + + JSONObject signConfigInfo12 = new JSONObject(); + JSONObject signConfigInfos12 = new JSONObject(); + signConfigInfos12.put("requestVerifyFree", true); + signConfigInfo12.put("signConfigInfo", signConfigInfo12); + + + actors12.put("actor", actorlists12); + actors12.put("signFields", SignField12); + actors12.put("signConfigInfo", signConfigInfos12); + + + + jsonArray12.add(actors12); + + + JSONArray docs12 = new JSONArray(); + + JSONObject qy12 = new JSONObject(); + qy12.put("docId",doc12); + qy12.put("docName","文件文档"); + String ided12 = FddFileId.id("/home/java/dpapp8090/pdf/" + id + "a"+ ".pdf"); + qy12.put("docFileId",ided12); + JSONArray docFields12 = new JSONArray(); + + JSONObject yiye12 = new JSONObject(); + yiye12.put("fieldId","8342392107"); + yiye12.put("fieldName","签章"); + JSONObject position12 = new JSONObject(); + position12.put("positionMode","keyword"); + position12.put("positionKeyword","盖章"); + yiye12.put("position",position12); + yiye12.put("moveable","false"); + yiye12.put("fieldType","corp_seal"); + + docFields12.add(yiye12); + + + + qy12.put("docFields",docFields12); + + docs12.add(qy12); + initiator12.put("docs", docs12); + + + initiator12.put("actors", jsonArray12); + String jsonString12 = initiator12.toJSONString(); + log.info("我是参数a " + jsonString12); + + String fdd12 = FDaDaUtil.fdds(jsonString12); + log.info("车损明细文件生成a:" + fdd12); + JSONObject jsonObject12 = JSON.parseObject(fdd12); + //任务id + String signTaskId12 = jsonObject12.getJSONObject("data").getString("signTaskId"); + String signTaskIds12 = String.valueOf(jsonObject12.getJSONObject("data")); + System.out.println("signTaskId____________________" + signTaskId12); + System.out.println("signTaskIds========================" + signTaskIds12); + String signtask12 = FDaDaUtil.signtask(signTaskIds12); + log.info("车损明细文件生成完成a" + signtask12); + + } + + + + + + + + + + + + } +}