|
|
@@ -44,6 +44,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|
44
|
44
|
|
|
45
|
45
|
import java.io.*;
|
|
46
|
46
|
import java.math.BigDecimal;
|
|
|
47
|
+import java.math.RoundingMode;
|
|
47
|
48
|
import java.nio.file.Files;
|
|
48
|
49
|
import java.nio.file.Path;
|
|
49
|
50
|
import java.nio.file.StandardCopyOption;
|
|
|
@@ -905,8 +906,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
905
|
906
|
public int editCaseApplication(CaseApplication caseApplication) {
|
|
906
|
907
|
//根据仲裁费用计费规则计算应缴费用
|
|
907
|
908
|
//暂时设置计费比率为0.01
|
|
908
|
|
- BigDecimal feeRate = new BigDecimal(0.01);
|
|
909
|
|
- BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2,BigDecimal.ROUND_HALF_UP);
|
|
|
909
|
+ BigDecimal feeRate = new BigDecimal("0.01");
|
|
|
910
|
+ BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, RoundingMode.HALF_UP);
|
|
910
|
911
|
caseApplication.setFeePayable(feePayable);
|
|
911
|
912
|
caseApplication.setUpdateBy(getUsername());
|
|
912
|
913
|
|
|
|
@@ -969,6 +970,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
969
|
970
|
return rows;
|
|
970
|
971
|
}
|
|
971
|
972
|
|
|
|
973
|
+
|
|
972
|
974
|
/**
|
|
973
|
975
|
* 组装申请代理人信息
|
|
974
|
976
|
* @param caseAffiliate
|
|
|
@@ -1176,34 +1178,21 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1176
|
1178
|
CaseApplication caseApplication = caseApplicationList.get(i);
|
|
1177
|
1179
|
|
|
1178
|
1180
|
// 导入校验
|
|
1179
|
|
- importValid(caseApplication);
|
|
|
1181
|
+ importValid(caseApplication,deptMap);
|
|
1180
|
1182
|
// 校验成功的数据
|
|
1181
|
1183
|
if(StrUtil.isEmpty(caseApplication.getErrorMsg())) {
|
|
1182
|
1184
|
//根据仲裁费用计费规则计算应缴费用
|
|
1183
|
1185
|
//暂时设置计费比率为0.01
|
|
1184
|
|
- BigDecimal feeRate = new BigDecimal(0.01);
|
|
1185
|
|
- BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
1186
|
+ BigDecimal feeRate = new BigDecimal("0.01");
|
|
|
1187
|
+ BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, RoundingMode.HALF_UP);
|
|
1186
|
1188
|
caseApplication.setFeePayable(feePayable);
|
|
1187
|
1189
|
|
|
1188
|
1190
|
//赋值CaseApplication的案件关联人信息
|
|
1189
|
1191
|
List<CaseAffiliate> caseAffiliatesnew = new ArrayList<>();
|
|
1190
|
1192
|
// 组装案件关联人信息
|
|
1191
|
1193
|
assignmentCaseAffiliates(caseApplication, caseAffiliatesnew, deptMap,roleId);
|
|
1192
|
|
-
|
|
1193
|
|
-// int caseApplicationCount = selectCaseApplicationCount(caseApplication);
|
|
1194
|
|
-// if(caseApplicationCount>0){
|
|
1195
|
|
-// failureNum++;
|
|
1196
|
|
-// failureMsg.append("<br/>" + failureNum + "、立案编号 " + caseApplication.getCaseNum() + " 已存在");
|
|
1197
|
|
-// }else {
|
|
1198
|
|
-// caseApplicationListinsert.add(caseApplication);
|
|
1199
|
|
-// }
|
|
1200
|
|
- if(StrUtil.isEmpty(caseApplication.getErrorMsg())) {
|
|
1201
|
|
- caseApplicationListinsert.add(caseApplication);
|
|
1202
|
|
- }else {
|
|
1203
|
|
- // 拼接错误信息
|
|
1204
|
|
- failureMsg.append("<br/>").append("第").append(i+2).append("行:").append(caseApplication.getErrorMsg().toString());
|
|
1205
|
|
-
|
|
1206
|
|
- }
|
|
|
1194
|
+ caseApplication.setImportFlag(1);
|
|
|
1195
|
+ caseApplicationListinsert.add(caseApplication);
|
|
1207
|
1196
|
}else {
|
|
1208
|
1197
|
// 拼接错误信息
|
|
1209
|
1198
|
failureMsg.append("<br/>").append("第").append(i+2).append("行:").append(caseApplication.getErrorMsg().toString());
|
|
|
@@ -1283,7 +1272,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1283
|
1272
|
* @param caseApplication
|
|
1284
|
1273
|
* @param
|
|
1285
|
1274
|
*/
|
|
1286
|
|
- private void importValid(CaseApplication caseApplication) {
|
|
|
1275
|
+ private void importValid(CaseApplication caseApplication,Map<String, Long> deptMap) {
|
|
1287
|
1276
|
StringBuilder failureMsg=new StringBuilder();
|
|
1288
|
1277
|
caseApplication.setErrorMsg(failureMsg);
|
|
1289
|
1278
|
// 校验基本字段
|
|
|
@@ -1291,7 +1280,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1291
|
1280
|
// 校验申请人信息
|
|
1292
|
1281
|
validApplicationColumn(caseApplication,failureMsg);
|
|
1293
|
1282
|
// 校验申请人代理信息
|
|
1294
|
|
- validApplicationAgentColumn(caseApplication,failureMsg);
|
|
|
1283
|
+ validApplicationAgentColumn(caseApplication,failureMsg,deptMap);
|
|
1295
|
1284
|
// 校验被申请人信息
|
|
1296
|
1285
|
validDebtorApplicationColumn(caseApplication,failureMsg);
|
|
1297
|
1286
|
// 校验被申请人代理信息
|
|
|
@@ -1382,7 +1371,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1382
|
1371
|
* @param caseApplication
|
|
1383
|
1372
|
* @param failureMsg
|
|
1384
|
1373
|
*/
|
|
1385
|
|
- private void validApplicationAgentColumn(CaseApplication caseApplication, StringBuilder failureMsg) {
|
|
|
1374
|
+ private void validApplicationAgentColumn(CaseApplication caseApplication, StringBuilder failureMsg,Map<String, Long> deptMap) {
|
|
1386
|
1375
|
if( StrUtil.isEmpty(caseApplication.getNameAgent())){
|
|
1387
|
1376
|
failureMsg.append("【申请人主体信息-代理人姓名】字段不能为空;");
|
|
1388
|
1377
|
}else if(caseApplication.getNameAgent().length()>50){
|
|
|
@@ -1393,6 +1382,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1393
|
1382
|
}else if(caseApplication.getIdentityNumAgent().length()>50){
|
|
1394
|
1383
|
failureMsg.append("【申请人主体信息-代理人身份证号】字段超出指定长度,最大长度为50;");
|
|
1395
|
1384
|
}
|
|
|
1385
|
+ validAgentInfo(caseApplication,failureMsg,deptMap);
|
|
1396
|
1386
|
String contactTelphoneAgent = caseApplication.getContactTelphoneAgent();
|
|
1397
|
1387
|
if( StrUtil.isEmpty(contactTelphoneAgent)){
|
|
1398
|
1388
|
failureMsg.append("【申请人主体信息-代理人联系电话】字段不能为空;");
|
|
|
@@ -1405,7 +1395,34 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1405
|
1395
|
failureMsg.append("【申请人主体信息-代理人联系地址】字段超出指定长度,最大长度为50;");
|
|
1406
|
1396
|
}
|
|
1407
|
1397
|
}
|
|
|
1398
|
+ /**
|
|
|
1399
|
+ * 校验代理人与组织机构关系
|
|
|
1400
|
+ * @param caseApplication
|
|
|
1401
|
+ * @param failureMsg
|
|
|
1402
|
+ * @return
|
|
|
1403
|
+ */
|
|
|
1404
|
+ private void validAgentInfo(CaseApplication caseApplication, StringBuilder failureMsg,Map<String, Long> deptMap) {
|
|
|
1405
|
+ // 申请机构与代理人都不为空,校验代理人与组织机构关系(代理人必须在该部门下)
|
|
|
1406
|
+ if (StrUtil.isNotEmpty(caseApplication.getName())&&StrUtil.isNotEmpty(caseApplication.getNameAgent())) {
|
|
|
1407
|
+ String applicationOrganId="";
|
|
|
1408
|
+ // 申请机构已经存在
|
|
|
1409
|
+ if(deptMap.containsKey(caseApplication.getName())){
|
|
|
1410
|
+ applicationOrganId=String.valueOf(deptMap.get(caseApplication.getName()));
|
|
|
1411
|
+ }
|
|
|
1412
|
+ // 根据代理人身份证去用户表查询
|
|
|
1413
|
+ SysUser agentUser = sysUserMapper.selectUserByIdCard(caseApplication.getIdentityNumAgent());
|
|
|
1414
|
+ // 代理人的部门和申请机构不匹配
|
|
|
1415
|
+ if (null != agentUser.getDeptId() && !String.valueOf(agentUser.getDeptId()).equals(applicationOrganId)) {
|
|
|
1416
|
+// return "该申请代理人已在"+agentUser.getDeptName()+"申请机构下存在,请检查填写信息是否正确";
|
|
|
1417
|
+ if (null != agentUser.getDept() && StrUtil.isNotEmpty(agentUser.getDept().getDeptName())) {
|
|
|
1418
|
+ failureMsg.append("该申请代理人已在【").append(agentUser.getDept().getDeptName()).append("】申请机构下存在,请检查填写信息是否正确");
|
|
|
1419
|
+ } else {
|
|
|
1420
|
+ failureMsg.append( "该申请代理人已存在,与申请机构不匹配,请检查填写信息是否正确");
|
|
|
1421
|
+ }
|
|
|
1422
|
+ }
|
|
1408
|
1423
|
|
|
|
1424
|
+ }
|
|
|
1425
|
+ }
|
|
1409
|
1426
|
/**
|
|
1410
|
1427
|
* 校验申请人主题信息
|
|
1411
|
1428
|
* @param caseApplication
|
|
|
@@ -1806,33 +1823,47 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1806
|
1823
|
*/
|
|
1807
|
1824
|
@Override
|
|
1808
|
1825
|
public String sendRoomNoMessage(SendRoomNoMessageVO messageVO) {
|
|
1809
|
|
- CaseAffiliate caseAffiliate = caseAffiliateMapper.selectCaseAffiliateByIdentityType(messageVO.getId(), 2);
|
|
1810
|
|
- if(null==caseAffiliate){
|
|
1811
|
|
- return "被申请人不存在";
|
|
|
1826
|
+ CaseAffiliate caseAffiliateSelect=new CaseAffiliate();
|
|
|
1827
|
+ caseAffiliateSelect.setCaseAppliId(messageVO.getId());
|
|
|
1828
|
+ List<CaseAffiliate> caseAffiliates= caseAffiliateMapper.selectCaseAffiliate(caseAffiliateSelect);
|
|
|
1829
|
+ if(CollectionUtil.isEmpty(caseAffiliates)){
|
|
|
1830
|
+ return "申请人、被申请人不存在";
|
|
1812
|
1831
|
}
|
|
1813
|
1832
|
CaseApplication caseApplication = new CaseApplication();
|
|
1814
|
1833
|
caseApplication.setId(messageVO.getId());
|
|
1815
|
1834
|
CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
|
|
|
1835
|
+ String returnResult="短信发送成功";
|
|
1816
|
1836
|
|
|
1817
|
1837
|
//发送短信通知
|
|
1818
|
1838
|
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
|
1819
|
1839
|
request.setTemplateId("1952136");
|
|
1820
|
|
- // 1948332 普通短信 尊敬的{1}用户,您的{2}仲裁案件,开庭审理房间号为{3},请在微信内打开https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 请知晓,如非本人操作,请忽略本短信。
|
|
1821
|
|
- request.setPhone(caseAffiliate.getContactTelphone());
|
|
1822
|
|
- request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo()});
|
|
1823
|
|
- if (SmsUtils.sendSms(request)){
|
|
1824
|
|
- //保存短信发送记录
|
|
1825
|
|
- SmsSendRecord smsSendRecord = new SmsSendRecord();
|
|
1826
|
|
- smsSendRecord.setCaseId(messageVO.getId());
|
|
1827
|
|
- smsSendRecord.setCaseNum(caseApplicationselect.getCaseNum());
|
|
1828
|
|
- smsSendRecord.setPhone(request.getPhone());
|
|
1829
|
|
- smsSendRecord.setSendTime(new Date());
|
|
1830
|
|
- String content="尊敬的"+caseAffiliate.getName()+"用户,您的"+ caseApplicationselect.getCaseNum()+"仲裁案件,开庭审理房间号为"+ messageVO.getRoomNo()+",请在微信内打开https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 请知晓,如非本人操作,请忽略本短信。";
|
|
1831
|
|
- smsSendRecord.setSendContent(content);
|
|
1832
|
|
- smsSendRecord.setCreateBy(getUsername());
|
|
1833
|
|
- smsRecordMapper.saveSmsSendRecord(smsSendRecord);
|
|
1834
|
|
- }
|
|
1835
|
|
- return "短信发送成功";
|
|
|
1840
|
+ for (CaseAffiliate caseAffiliate : caseAffiliates) {
|
|
|
1841
|
+ request.setPhone(caseAffiliate.getContactTelphone());
|
|
|
1842
|
+ request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo()});
|
|
|
1843
|
+ // 1948332 普通短信 尊敬的{1}用户,您的{2}仲裁案件,开庭审理房间号为{3},请在微信内打开https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 请知晓,如非本人操作,请忽略本短信。
|
|
|
1844
|
+ if (SmsUtils.sendSms(request)){
|
|
|
1845
|
+ //保存短信发送记录
|
|
|
1846
|
+ SmsSendRecord smsSendRecord = new SmsSendRecord();
|
|
|
1847
|
+ smsSendRecord.setCaseId(messageVO.getId());
|
|
|
1848
|
+ smsSendRecord.setCaseNum(caseApplicationselect.getCaseNum());
|
|
|
1849
|
+ smsSendRecord.setPhone(request.getPhone());
|
|
|
1850
|
+ smsSendRecord.setSendTime(new Date());
|
|
|
1851
|
+ String content="尊敬的"+caseAffiliate.getName()+"用户,您的"+ caseApplicationselect.getCaseNum()+"仲裁案件,开庭审理房间号为"+ messageVO.getRoomNo()+",请在微信内打开https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 请知晓,如非本人操作,请忽略本短信。";
|
|
|
1852
|
+ smsSendRecord.setSendContent(content);
|
|
|
1853
|
+ String userName;
|
|
|
1854
|
+ try {
|
|
|
1855
|
+ userName= getUsername();
|
|
|
1856
|
+ } catch (Exception e) {
|
|
|
1857
|
+ userName="admin";
|
|
|
1858
|
+ }
|
|
|
1859
|
+ smsSendRecord.setCreateBy(userName);
|
|
|
1860
|
+ smsRecordMapper.saveSmsSendRecord(smsSendRecord);
|
|
|
1861
|
+ }else {
|
|
|
1862
|
+ returnResult= "短信发送失败";
|
|
|
1863
|
+ }
|
|
|
1864
|
+ }
|
|
|
1865
|
+ return returnResult;
|
|
|
1866
|
+
|
|
1836
|
1867
|
}
|
|
1837
|
1868
|
|
|
1838
|
1869
|
@Override
|
|
|
@@ -2074,6 +2105,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2074
|
2105
|
caseApplication.setFilearbitraUrl(filearbitraUrl);
|
|
2075
|
2106
|
}
|
|
2076
|
2107
|
}
|
|
|
2108
|
+
|
|
2077
|
2109
|
return caseApplication;
|
|
2078
|
2110
|
}
|
|
2079
|
2111
|
|
|
|
@@ -2083,8 +2115,26 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2083
|
2115
|
@Transactional
|
|
2084
|
2116
|
public int pendTralSure(CaseApplication caseApplication) {
|
|
2085
|
2117
|
// caseApplication.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION_METHOD);
|
|
|
2118
|
+
|
|
2086
|
2119
|
caseApplication.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
|
|
2087
|
|
- int rows = caseApplicationMapper.submitCaseApplication(caseApplication);
|
|
|
2120
|
+ Integer isAgreePendTral = caseApplication.getIsAgreePendTral();
|
|
|
2121
|
+ int rows = 0;
|
|
|
2122
|
+ //同意组庭
|
|
|
2123
|
+ if(isAgreePendTral!=null&&isAgreePendTral==1){
|
|
|
2124
|
+ rows = caseApplicationMapper.submitCaseApplication(caseApplication);
|
|
|
2125
|
+ }else {
|
|
|
2126
|
+ List<Arbitrator> arbitrators = caseApplication.getArbitrators();
|
|
|
2127
|
+ // 仲裁员信息
|
|
|
2128
|
+ if(arbitrators!=null&&arbitrators.size()>0){
|
|
|
2129
|
+ List<Long> ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList());
|
|
|
2130
|
+ List<String> arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList());
|
|
|
2131
|
+ String idstr = ids.stream().map(Object::toString).collect(Collectors.joining(","));
|
|
|
2132
|
+ String arbitratorNamestr = arbitratorNames.stream().map(Object::toString).collect(Collectors.joining(","));
|
|
|
2133
|
+ caseApplication.setArbitratorId(idstr);
|
|
|
2134
|
+ caseApplication.setArbitratorName(arbitratorNamestr);
|
|
|
2135
|
+ rows = caseApplicationMapper.submitCaseApplication(caseApplication);
|
|
|
2136
|
+ }
|
|
|
2137
|
+ }
|
|
2088
|
2138
|
|
|
2089
|
2139
|
//发送短信通知
|
|
2090
|
2140
|
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|