|
|
@@ -13,18 +13,21 @@ import com.google.gson.JsonObject;
|
|
13
|
13
|
import com.ruoyi.common.constant.FileTransformation;
|
|
14
|
14
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
15
|
15
|
import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
|
|
|
16
|
+import com.ruoyi.common.core.domain.entity.SysRole;
|
|
16
|
17
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
17
|
18
|
import com.ruoyi.common.enums.AnnexTypeEnum;
|
|
18
|
19
|
import com.ruoyi.common.enums.YesOrNoEnum;
|
|
19
|
20
|
import com.ruoyi.common.exception.EsignDemoException;
|
|
20
|
21
|
import com.ruoyi.common.exception.ServiceException;
|
|
21
|
22
|
import com.ruoyi.common.utils.EmailOutUtil;
|
|
|
23
|
+import com.ruoyi.common.utils.SecurityUtils;
|
|
22
|
24
|
import com.ruoyi.common.utils.SmsUtils;
|
|
23
|
25
|
import com.ruoyi.common.utils.StringUtils;
|
|
24
|
26
|
import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
|
|
25
|
27
|
import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
|
|
26
|
28
|
import com.ruoyi.system.mapper.SysUserMapper;
|
|
27
|
29
|
import com.ruoyi.system.mapper.flow.MsCaseFlowMapper;
|
|
|
30
|
+import com.ruoyi.system.service.ISysUserService;
|
|
28
|
31
|
import com.ruoyi.wisdomarbitrate.domain.dto.dept.DeptIdentify;
|
|
29
|
32
|
import com.ruoyi.wisdomarbitrate.domain.dto.dept.SealManage;
|
|
30
|
33
|
import com.ruoyi.wisdomarbitrate.domain.dto.mscase.CaseLogRecord;
|
|
|
@@ -58,6 +61,7 @@ import javax.annotation.Resource;
|
|
58
|
61
|
import java.io.File;
|
|
59
|
62
|
import java.time.LocalDate;
|
|
60
|
63
|
import java.util.*;
|
|
|
64
|
+import java.util.stream.Collectors;
|
|
61
|
65
|
|
|
62
|
66
|
import static com.ruoyi.common.core.domain.AjaxResult.success;
|
|
63
|
67
|
|
|
|
@@ -76,6 +80,8 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
|
76
|
80
|
private SealManageMapper sealManageMapper;
|
|
77
|
81
|
@Autowired
|
|
78
|
82
|
MsCaseFlowMapper caseFlowMapper;
|
|
|
83
|
+ @Autowired
|
|
|
84
|
+ private SysUserMapper userMapper;
|
|
79
|
85
|
|
|
80
|
86
|
@Autowired
|
|
81
|
87
|
private SysUserMapper sysUserMapper;
|
|
|
@@ -728,27 +734,60 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
|
728
|
734
|
Long caseId = dto.getCaseId();
|
|
729
|
735
|
MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(caseId);
|
|
730
|
736
|
Integer organizeFlag = caseAffiliate.getOrganizeFlag();
|
|
731
|
|
- SealSignRecord sealSignRecordres = new SealSignRecord();
|
|
732
|
|
- MsSealSignRecord mssealSignRecord = new MsSealSignRecord();
|
|
733
|
|
- mssealSignRecord.setCaseAppliId(caseId);
|
|
734
|
|
- List<MsSealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecord(mssealSignRecord);
|
|
735
|
|
- if (sealSignRecords != null && sealSignRecords.size() > 0) {
|
|
736
|
|
- String signFlowid = sealSignRecords.get(0).getSignFlowId();
|
|
737
|
|
- if(organizeFlag!=null){
|
|
738
|
|
- SealSignRecord sealSignRecord = new SealSignRecord();
|
|
739
|
|
- if(organizeFlag.intValue()==1){
|
|
740
|
|
- sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
|
|
741
|
|
- sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
|
|
742
|
|
- }else {
|
|
743
|
|
- String nameAgent = caseAffiliate.getNameAgent();
|
|
744
|
|
- if(StringUtils.isNotBlank(nameAgent)){
|
|
|
737
|
+
|
|
|
738
|
+ SysUser user = new SysUser();
|
|
|
739
|
+ Long userId = SecurityUtils.getUserId();
|
|
|
740
|
+ user.setUserId(userId);
|
|
|
741
|
+ List<SysUser> listSysUser = userMapper.selectUserList(user);
|
|
|
742
|
+ List<SysRole> allSysRole = new ArrayList<>();
|
|
|
743
|
+ for(SysUser sysUser :listSysUser){
|
|
|
744
|
+ List<SysRole> roles = sysUser.getRoles();
|
|
|
745
|
+ allSysRole.addAll(roles);
|
|
|
746
|
+ }
|
|
|
747
|
+ List<String> roleNames = allSysRole.stream().map(SysRole::getRoleName).collect(Collectors.toList());
|
|
|
748
|
+ if(roleNames.contains("申请人")){
|
|
|
749
|
+ SealSignRecord sealSignRecordres = new SealSignRecord();
|
|
|
750
|
+ MsSealSignRecord mssealSignRecord = new MsSealSignRecord();
|
|
|
751
|
+ mssealSignRecord.setCaseAppliId(caseId);
|
|
|
752
|
+ List<MsSealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecord(mssealSignRecord);
|
|
|
753
|
+ if (sealSignRecords != null && sealSignRecords.size() > 0) {
|
|
|
754
|
+ String signFlowid = sealSignRecords.get(0).getSignFlowId();
|
|
|
755
|
+ if(organizeFlag!=null){
|
|
|
756
|
+ SealSignRecord sealSignRecord = new SealSignRecord();
|
|
|
757
|
+ if(organizeFlag.intValue()==1){
|
|
745
|
758
|
sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
|
|
746
|
759
|
sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
|
|
747
|
760
|
}else {
|
|
748
|
|
- sealSignRecord.setPensonAccount(caseAffiliate.getApplicationPhone());
|
|
749
|
|
- sealSignRecord.setPensonName(caseAffiliate.getApplicationName());
|
|
|
761
|
+ String nameAgent = caseAffiliate.getNameAgent();
|
|
|
762
|
+ if(StringUtils.isNotBlank(nameAgent)){
|
|
|
763
|
+ sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
|
|
|
764
|
+ sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
|
|
|
765
|
+ }else {
|
|
|
766
|
+ sealSignRecord.setPensonAccount(caseAffiliate.getApplicationPhone());
|
|
|
767
|
+ sealSignRecord.setPensonName(caseAffiliate.getApplicationName());
|
|
|
768
|
+ }
|
|
750
|
769
|
}
|
|
|
770
|
+ sealSignRecord.setSignFlowid(signFlowid);
|
|
|
771
|
+
|
|
|
772
|
+ Gson gson = new Gson();
|
|
|
773
|
+ EsignHttpResponse signUrl = SignAward.signUrl(sealSignRecord);
|
|
|
774
|
+ JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
|
|
|
775
|
+ JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
|
|
|
776
|
+ String urlapply = signUrlData.get("shortUrl").getAsString();
|
|
|
777
|
+ sealSignRecordres.setSealUrl(urlapply);
|
|
751
|
778
|
}
|
|
|
779
|
+ }
|
|
|
780
|
+ return AjaxResult.success(sealSignRecordres);
|
|
|
781
|
+
|
|
|
782
|
+ }else if(roleNames.contains("被申请人")){
|
|
|
783
|
+ SealSignRecord sealSignRecordres = new SealSignRecord();
|
|
|
784
|
+ MsSealSignRecord mssealSignRecord = new MsSealSignRecord();
|
|
|
785
|
+ mssealSignRecord.setCaseAppliId(caseId);
|
|
|
786
|
+ List<MsSealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecord(mssealSignRecord);
|
|
|
787
|
+ if (sealSignRecords != null && sealSignRecords.size() > 0) {
|
|
|
788
|
+ String signFlowid = sealSignRecords.get(0).getSignFlowId();
|
|
|
789
|
+ SealSignRecord sealSignRecord = new SealSignRecord();
|
|
|
790
|
+ sealSignRecord.setPensonAccount(caseAffiliate.getRespondentPhone());
|
|
752
|
791
|
sealSignRecord.setSignFlowid(signFlowid);
|
|
753
|
792
|
|
|
754
|
793
|
Gson gson = new Gson();
|
|
|
@@ -758,8 +797,9 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
|
758
|
797
|
String urlapply = signUrlData.get("shortUrl").getAsString();
|
|
759
|
798
|
sealSignRecordres.setSealUrl(urlapply);
|
|
760
|
799
|
}
|
|
|
800
|
+ return AjaxResult.success(sealSignRecordres);
|
|
761
|
801
|
}
|
|
762
|
|
- return AjaxResult.success(sealSignRecordres);
|
|
|
802
|
+ return AjaxResult.success();
|
|
763
|
803
|
}
|
|
764
|
804
|
|
|
765
|
805
|
@Override
|