|
|
@@ -716,121 +716,120 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
716
|
716
|
arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord);
|
|
717
|
717
|
Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck();
|
|
718
|
718
|
if(agreeOrNotCheck.intValue()==1){//同意审核
|
|
719
|
|
- //TODO 取消一下注释
|
|
720
|
|
-// try {
|
|
721
|
|
-// //获取当前案件的裁决书
|
|
722
|
|
-// CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplication);
|
|
723
|
|
-// List<CaseAttach> caseAttachList = caseApplication2.getCaseAttachList();
|
|
724
|
|
-// if (caseAttachList != null && caseAttachList.size() > 0) {
|
|
725
|
|
-// for (CaseAttach caseAttach : caseAttachList) {
|
|
726
|
|
-// if (caseAttach.getAnnexType() == 3) {
|
|
727
|
|
-// String annexPath = caseAttach.getAnnexPath();
|
|
728
|
|
-// String path = "/home/ruoyi/" + annexPath;
|
|
729
|
|
-//// String path ="D:\\home\\仲裁裁决书模板.docx";
|
|
730
|
|
-// //获取文件上传地址
|
|
731
|
|
-// EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
|
|
732
|
|
-// String body = response.getBody();
|
|
733
|
|
-// if (body != null){
|
|
734
|
|
-// JSONObject jsonObject = JSONObject.parseObject(body);
|
|
735
|
|
-// String fileId = jsonObject.getJSONObject("data").getString("fileId");
|
|
736
|
|
-// String fileUploadUrl = jsonObject.getJSONObject("data").getString("fileUploadUrl");
|
|
737
|
|
-// //上传文件流
|
|
738
|
|
-// EsignHttpResponse response1 = SaaSAPIFileUtils.uploadFile(fileUploadUrl, path);
|
|
739
|
|
-// JSONObject jsonObject1 = JSONObject.parseObject(response1.getBody());
|
|
740
|
|
-// if (jsonObject1.getIntValue("errCode")==0){
|
|
741
|
|
-// //查看文件上传状态
|
|
742
|
|
-// Thread.sleep(5000);
|
|
743
|
|
-// EsignHttpResponse response2 = SaaSAPIFileUtils.getFileStatus(fileId);
|
|
744
|
|
-// JSONObject jsonObject2 = JSONObject.parseObject(response2.getBody());
|
|
745
|
|
-// JSONObject data = jsonObject2.getJSONObject("data");
|
|
746
|
|
-// int fileStatus =data.getIntValue("fileStatus");
|
|
747
|
|
-// if (fileStatus == 2 || fileStatus == 5){
|
|
748
|
|
-// String fileName = data.getString("fileName");
|
|
749
|
|
-// //上传成功,获取文件签名印章位置
|
|
750
|
|
-// SealSignRecord sealSignRecord = new SealSignRecord();
|
|
751
|
|
-// sealSignRecord.setFileid(fileId);
|
|
752
|
|
-// EsignHttpResponse positions = SignAward.getPositions(sealSignRecord);
|
|
753
|
|
-// Gson gson = new Gson();
|
|
754
|
|
-// JsonObject positionsJsonObject = gson.fromJson(positions.getBody(), JsonObject.class);
|
|
755
|
|
-// JsonObject positionsData = positionsJsonObject.getAsJsonObject("data");
|
|
756
|
|
-// String keywordPositions = positionsData.get("keywordPositions").getAsString();
|
|
757
|
|
-// //发起签署
|
|
758
|
|
-// sealSignRecord.setFilename(fileName);
|
|
759
|
|
-// String arbitratorId = caseApplication2.getArbitratorId();
|
|
760
|
|
-// if (arbitratorId!=null){
|
|
761
|
|
-// SysUser sysUser = sysUserMapper.selectUserById(Long.valueOf(arbitratorId));
|
|
762
|
|
-// if (sysUser == null){
|
|
763
|
|
-// return rows;
|
|
764
|
|
-// }
|
|
765
|
|
-// sealSignRecord.setPensonAccount(sysUser.getPhonenumber());
|
|
766
|
|
-// sealSignRecord.setPensonName(sysUser.getNickName());
|
|
767
|
|
-// }
|
|
768
|
|
-// sealSignRecord.setOrgnizeName("西安云美电子科技有限公司");
|
|
769
|
|
-// sealSignRecord.setOrgnizeNamePsnAccount("秦桃则");
|
|
770
|
|
-// sealSignRecord.setOrgnizeName("西安云美电子科技有限公司");
|
|
771
|
|
-// sealSignRecord.setOrgnizeNamePsnAccount("17691338406");
|
|
772
|
|
-// sealSignRecord.setOrgnizeNamepsnName("韩超勃");
|
|
773
|
|
-// //解析文件签名印章位置
|
|
774
|
|
-// JSONArray jsonArray = JSONArray.parseArray(keywordPositions);
|
|
775
|
|
-// for (int i = 0; i < jsonArray.size(); i++) {
|
|
776
|
|
-// JSONObject jsonObject3 = jsonArray.getJSONObject(i);
|
|
777
|
|
-// String keyword = jsonObject3.getString("keyword");
|
|
778
|
|
-// if (keyword.equals("仲裁员")){
|
|
779
|
|
-// //签名
|
|
780
|
|
-// JSONArray positionsArray = jsonObject3.getJSONArray("positions");
|
|
781
|
|
-// // 遍历 positionsArray 中的每个元素
|
|
782
|
|
-// for (int j = 0; j < positionsArray.size(); j++){
|
|
783
|
|
-// JSONObject positionObj = positionsArray.getJSONObject(j);
|
|
784
|
|
-// int pageNum = positionObj.getIntValue("pageNum");
|
|
785
|
|
-// sealSignRecord.setPositionPagepsn(String.valueOf(pageNum));
|
|
786
|
|
-// JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
|
|
787
|
|
-// JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
|
|
788
|
|
-// double positionX = coordinateObj.getDoubleValue("positionX");
|
|
789
|
|
-// double positionY = coordinateObj.getDoubleValue("positionY");
|
|
790
|
|
-// sealSignRecord.setPositionXpsn(positionX);
|
|
791
|
|
-// sealSignRecord.setPositionYpsn(positionY);
|
|
792
|
|
-// }
|
|
793
|
|
-// }else {
|
|
794
|
|
-// //用印
|
|
795
|
|
-// JSONArray positionsArray = jsonObject3.getJSONArray("positions");
|
|
796
|
|
-// // 遍历 positionsArray 中的每个元素
|
|
797
|
|
-// for (int j = 0; j < positionsArray.size(); j++) {
|
|
798
|
|
-// JSONObject positionObj = positionsArray.getJSONObject(j);
|
|
799
|
|
-// int pageNum = positionObj.getIntValue("pageNum");
|
|
800
|
|
-// sealSignRecord.setPositionPageorg(String.valueOf(pageNum));
|
|
801
|
|
-// JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
|
|
802
|
|
-// JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
|
|
803
|
|
-// double positionX = coordinateObj.getDoubleValue("positionX");
|
|
804
|
|
-// double positionY = coordinateObj.getDoubleValue("positionY");
|
|
805
|
|
-// sealSignRecord.setPositionXorg(positionX);
|
|
806
|
|
-// sealSignRecord.setPositionYorg(positionY);
|
|
807
|
|
-// }
|
|
808
|
|
-// }
|
|
809
|
|
-// }
|
|
810
|
|
-// EsignHttpResponse response3 = SignAward.createByFile(sealSignRecord);
|
|
811
|
|
-// JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody());
|
|
812
|
|
-// if (jsonObject1.getIntValue("code")==0){
|
|
813
|
|
-// //获取签署流程ID
|
|
814
|
|
-// JSONObject data1 = jsonObject3.getJSONObject("data");
|
|
815
|
|
-// String signFlowId = data1.getString("signFlowId");
|
|
816
|
|
-// //保存案件id,文件id,文件名称.流程id到签署用印记录表里
|
|
817
|
|
-// sealSignRecord.setCaseAppliId(caseApplication.getId());
|
|
818
|
|
-// sealSignRecord.setSignFlowid(signFlowId);
|
|
819
|
|
-// sealSignRecord.setSignFlowStatus(1);//待签名
|
|
820
|
|
-// sealSignRecordMapper.insertSealSignRecord(sealSignRecord);
|
|
821
|
|
-// }
|
|
822
|
|
-// }
|
|
823
|
|
-// }
|
|
824
|
|
-// }
|
|
825
|
|
-// break;
|
|
826
|
|
-// }
|
|
827
|
|
-// }
|
|
828
|
|
-// }
|
|
829
|
|
-// } catch (EsignDemoException e) {
|
|
830
|
|
-// e.printStackTrace();
|
|
831
|
|
-// } catch (InterruptedException e) {
|
|
832
|
|
-// e.printStackTrace();
|
|
833
|
|
-// }
|
|
|
719
|
+ try {
|
|
|
720
|
+ //获取当前案件的裁决书
|
|
|
721
|
+ CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplication);
|
|
|
722
|
+ List<CaseAttach> caseAttachList = caseApplication2.getCaseAttachList();
|
|
|
723
|
+ if (caseAttachList != null && caseAttachList.size() > 0) {
|
|
|
724
|
+ for (CaseAttach caseAttach : caseAttachList) {
|
|
|
725
|
+ if (caseAttach.getAnnexType() == 3) {
|
|
|
726
|
+ String annexPath = caseAttach.getAnnexPath();
|
|
|
727
|
+ String path = "/home/ruoyi/" + annexPath;
|
|
|
728
|
+// String path ="D:\\home\\仲裁裁决书模板.docx";
|
|
|
729
|
+ //获取文件上传地址
|
|
|
730
|
+ EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
|
|
|
731
|
+ String body = response.getBody();
|
|
|
732
|
+ if (body != null){
|
|
|
733
|
+ JSONObject jsonObject = JSONObject.parseObject(body);
|
|
|
734
|
+ String fileId = jsonObject.getJSONObject("data").getString("fileId");
|
|
|
735
|
+ String fileUploadUrl = jsonObject.getJSONObject("data").getString("fileUploadUrl");
|
|
|
736
|
+ //上传文件流
|
|
|
737
|
+ EsignHttpResponse response1 = SaaSAPIFileUtils.uploadFile(fileUploadUrl, path);
|
|
|
738
|
+ JSONObject jsonObject1 = JSONObject.parseObject(response1.getBody());
|
|
|
739
|
+ if (jsonObject1.getIntValue("errCode")==0){
|
|
|
740
|
+ //查看文件上传状态
|
|
|
741
|
+ Thread.sleep(5000);
|
|
|
742
|
+ EsignHttpResponse response2 = SaaSAPIFileUtils.getFileStatus(fileId);
|
|
|
743
|
+ JSONObject jsonObject2 = JSONObject.parseObject(response2.getBody());
|
|
|
744
|
+ JSONObject data = jsonObject2.getJSONObject("data");
|
|
|
745
|
+ int fileStatus =data.getIntValue("fileStatus");
|
|
|
746
|
+ if (fileStatus == 2 || fileStatus == 5){
|
|
|
747
|
+ String fileName = data.getString("fileName");
|
|
|
748
|
+ //上传成功,获取文件签名印章位置
|
|
|
749
|
+ SealSignRecord sealSignRecord = new SealSignRecord();
|
|
|
750
|
+ sealSignRecord.setFileid(fileId);
|
|
|
751
|
+ EsignHttpResponse positions = SignAward.getPositions(sealSignRecord);
|
|
|
752
|
+ Gson gson = new Gson();
|
|
|
753
|
+ JsonObject positionsJsonObject = gson.fromJson(positions.getBody(), JsonObject.class);
|
|
|
754
|
+ JsonObject positionsData = positionsJsonObject.getAsJsonObject("data");
|
|
|
755
|
+ String keywordPositions = positionsData.get("keywordPositions").getAsString();
|
|
|
756
|
+ //发起签署
|
|
|
757
|
+ sealSignRecord.setFilename(fileName);
|
|
|
758
|
+ String arbitratorId = caseApplication2.getArbitratorId();
|
|
|
759
|
+ if (arbitratorId!=null){
|
|
|
760
|
+ SysUser sysUser = sysUserMapper.selectUserById(Long.valueOf(arbitratorId));
|
|
|
761
|
+ if (sysUser == null){
|
|
|
762
|
+ return rows;
|
|
|
763
|
+ }
|
|
|
764
|
+ sealSignRecord.setPensonAccount(sysUser.getPhonenumber());
|
|
|
765
|
+ sealSignRecord.setPensonName(sysUser.getNickName());
|
|
|
766
|
+ }
|
|
|
767
|
+ sealSignRecord.setOrgnizeName("西安云美电子科技有限公司");
|
|
|
768
|
+ sealSignRecord.setOrgnizeNamePsnAccount("秦桃则");
|
|
|
769
|
+ sealSignRecord.setOrgnizeName("西安云美电子科技有限公司");
|
|
|
770
|
+ sealSignRecord.setOrgnizeNamePsnAccount("17691338406");
|
|
|
771
|
+ sealSignRecord.setOrgnizeNamepsnName("韩超勃");
|
|
|
772
|
+ //解析文件签名印章位置
|
|
|
773
|
+ JSONArray jsonArray = JSONArray.parseArray(keywordPositions);
|
|
|
774
|
+ for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
775
|
+ JSONObject jsonObject3 = jsonArray.getJSONObject(i);
|
|
|
776
|
+ String keyword = jsonObject3.getString("keyword");
|
|
|
777
|
+ if (keyword.equals("仲裁员")){
|
|
|
778
|
+ //签名
|
|
|
779
|
+ JSONArray positionsArray = jsonObject3.getJSONArray("positions");
|
|
|
780
|
+ // 遍历 positionsArray 中的每个元素
|
|
|
781
|
+ for (int j = 0; j < positionsArray.size(); j++){
|
|
|
782
|
+ JSONObject positionObj = positionsArray.getJSONObject(j);
|
|
|
783
|
+ int pageNum = positionObj.getIntValue("pageNum");
|
|
|
784
|
+ sealSignRecord.setPositionPagepsn(String.valueOf(pageNum));
|
|
|
785
|
+ JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
|
|
|
786
|
+ JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
|
|
|
787
|
+ double positionX = coordinateObj.getDoubleValue("positionX");
|
|
|
788
|
+ double positionY = coordinateObj.getDoubleValue("positionY");
|
|
|
789
|
+ sealSignRecord.setPositionXpsn(positionX);
|
|
|
790
|
+ sealSignRecord.setPositionYpsn(positionY);
|
|
|
791
|
+ }
|
|
|
792
|
+ }else {
|
|
|
793
|
+ //用印
|
|
|
794
|
+ JSONArray positionsArray = jsonObject3.getJSONArray("positions");
|
|
|
795
|
+ // 遍历 positionsArray 中的每个元素
|
|
|
796
|
+ for (int j = 0; j < positionsArray.size(); j++) {
|
|
|
797
|
+ JSONObject positionObj = positionsArray.getJSONObject(j);
|
|
|
798
|
+ int pageNum = positionObj.getIntValue("pageNum");
|
|
|
799
|
+ sealSignRecord.setPositionPageorg(String.valueOf(pageNum));
|
|
|
800
|
+ JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
|
|
|
801
|
+ JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
|
|
|
802
|
+ double positionX = coordinateObj.getDoubleValue("positionX");
|
|
|
803
|
+ double positionY = coordinateObj.getDoubleValue("positionY");
|
|
|
804
|
+ sealSignRecord.setPositionXorg(positionX);
|
|
|
805
|
+ sealSignRecord.setPositionYorg(positionY);
|
|
|
806
|
+ }
|
|
|
807
|
+ }
|
|
|
808
|
+ }
|
|
|
809
|
+ EsignHttpResponse response3 = SignAward.createByFile(sealSignRecord);
|
|
|
810
|
+ JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody());
|
|
|
811
|
+ if (jsonObject1.getIntValue("code")==0){
|
|
|
812
|
+ //获取签署流程ID
|
|
|
813
|
+ JSONObject data1 = jsonObject3.getJSONObject("data");
|
|
|
814
|
+ String signFlowId = data1.getString("signFlowId");
|
|
|
815
|
+ //保存案件id,文件id,文件名称.流程id到签署用印记录表里
|
|
|
816
|
+ sealSignRecord.setCaseAppliId(caseApplication.getId());
|
|
|
817
|
+ sealSignRecord.setSignFlowid(signFlowId);
|
|
|
818
|
+ sealSignRecord.setSignFlowStatus(1);//待签名
|
|
|
819
|
+ sealSignRecordMapper.insertSealSignRecord(sealSignRecord);
|
|
|
820
|
+ }
|
|
|
821
|
+ }
|
|
|
822
|
+ }
|
|
|
823
|
+ }
|
|
|
824
|
+ break;
|
|
|
825
|
+ }
|
|
|
826
|
+ }
|
|
|
827
|
+ }
|
|
|
828
|
+ } catch (EsignDemoException e) {
|
|
|
829
|
+ e.printStackTrace();
|
|
|
830
|
+ } catch (InterruptedException e) {
|
|
|
831
|
+ e.printStackTrace();
|
|
|
832
|
+ }
|
|
834
|
833
|
caseApplication.setCaseStatus(CaseApplicationConstants.SIGN_ARBITRATION);
|
|
835
|
834
|
// 新增日志
|
|
836
|
835
|
CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.SIGN_ARBITRATION,"");
|