|
|
@@ -2540,7 +2540,169 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2540
|
2540
|
return caseAttach;
|
|
2541
|
2541
|
}
|
|
2542
|
2542
|
|
|
|
2543
|
+ @Override
|
|
|
2544
|
+ public List<CaseApplication> selectCaseApplicationListBatchByRole(CaseApplication caseApplication) {
|
|
|
2545
|
+ return caseApplicationMapper.selectAdminCaseApplicationListBatch(caseApplication);
|
|
|
2546
|
+ }
|
|
2543
|
2547
|
|
|
|
2548
|
+ @Override
|
|
|
2549
|
+ @Transactional
|
|
|
2550
|
+ public int submitCaseApplicationBatch(String batchNumber) {
|
|
|
2551
|
+ int rows = 0;
|
|
|
2552
|
+ CaseApplication caseApplicationsel = new CaseApplication();
|
|
|
2553
|
+ caseApplicationsel.setBatchNumber(batchNumber);
|
|
|
2554
|
+ caseApplicationsel.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION);
|
|
|
2555
|
+ List<CaseApplication> caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel);
|
|
|
2556
|
+ List<Long> ids = caseApplications.stream().map(CaseApplication::getId).collect(Collectors.toList());
|
|
|
2557
|
+ if(caseApplications!=null&&caseApplications.size()>0){
|
|
|
2558
|
+ Map<Long, CaseApplication> applicationMap = caseApplications.stream().collect(Collectors.toMap(CaseApplication::getId, Function.identity(), (n1, n2) -> n2));
|
|
|
2559
|
+ List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliateByCaseIds(ids);
|
|
|
2560
|
+ // 转换为Map<CaseId,List<CaseAffiliate>>形式
|
|
|
2561
|
+ Map<Long, List<CaseAffiliate>> caseAffiliateMap = caseAffiliates.stream().collect(Collectors.groupingBy(CaseAffiliate::getCaseAppliId));
|
|
|
2562
|
+ for (Long id : ids) {
|
|
|
2563
|
+ // 查询案件信息,做必填校验,校验不通过,提示,不能提交
|
|
|
2564
|
+ StringBuilder errorMsg = new StringBuilder();
|
|
|
2565
|
+ // 必填校验
|
|
|
2566
|
+ CaseApplication caseApplication = applicationMap.get(id);
|
|
|
2567
|
+ String caseNum = caseApplication.getCaseNum();
|
|
|
2568
|
+ // 基本字段校验
|
|
|
2569
|
+ if(caseApplication!=null) {
|
|
|
2570
|
+ for (String baseColumn : baseColumns) {
|
|
|
2571
|
+ if(StrUtil.isEmpty( ObjectFieldUtils.getValue(caseApplication, baseColumn))){
|
|
|
2572
|
+ errorMsg.append(getColumnstr(baseColumn)).append("不能为空,");
|
|
|
2573
|
+// throw new ServiceException("必填字段未填写,请完善案件信息!");
|
|
|
2574
|
+ }
|
|
|
2575
|
+ }
|
|
|
2576
|
+ // 校验人员
|
|
|
2577
|
+ if(CollectionUtil.isNotEmpty(caseAffiliates)){
|
|
|
2578
|
+ List<CaseAffiliate> affiliateList = caseAffiliateMap.get(id);
|
|
|
2579
|
+ if(CollectionUtil.isNotEmpty(affiliateList)){
|
|
|
2580
|
+ for (CaseAffiliate caseAffiliate : affiliateList) {
|
|
|
2581
|
+ if(caseAffiliate.getIdentityType()==1){
|
|
|
2582
|
+ // 校验申请人
|
|
|
2583
|
+ for (String applicAffiliateColumn : applicAffiliateColumns) {
|
|
|
2584
|
+ if(StrUtil.isEmpty( ObjectFieldUtils.getValue(caseAffiliate, applicAffiliateColumn))){
|
|
|
2585
|
+ errorMsg.append(getColumnstr(applicAffiliateColumn)).append("不能为空,");
|
|
|
2586
|
+// throw new ServiceException("必填字段未填写,请完善案件信息!");
|
|
|
2587
|
+ }
|
|
|
2588
|
+ }
|
|
|
2589
|
+ }else {
|
|
|
2590
|
+ // 校验被申请人
|
|
|
2591
|
+ for (String applicAffiliateColumn : dectborAffiliateColumns) {
|
|
|
2592
|
+ if(StrUtil.isEmpty( ObjectFieldUtils.getValue(caseAffiliate, applicAffiliateColumn))){
|
|
|
2593
|
+ errorMsg.append(getColumnstr(applicAffiliateColumn)).append("不能为空,");
|
|
|
2594
|
+// throw new ServiceException("必填字段未填写,请完善案件信息!");
|
|
|
2595
|
+ }
|
|
|
2596
|
+ }
|
|
|
2597
|
+ }
|
|
|
2598
|
+ }
|
|
|
2599
|
+ }
|
|
|
2600
|
+ }
|
|
|
2601
|
+ }
|
|
|
2602
|
+ if(StringUtils.isNotEmpty(errorMsg.toString())){
|
|
|
2603
|
+ throw new ServiceException("案件编号" + caseNum + errorMsg.toString()+"请完善案件信息!");
|
|
|
2604
|
+ }
|
|
|
2605
|
+
|
|
|
2606
|
+ CaseApplication application = new CaseApplication();
|
|
|
2607
|
+ application.setId(id);
|
|
|
2608
|
+ //提交立案申请
|
|
|
2609
|
+ application.setCaseStatus(CaseApplicationConstants.CASE_CHECK);
|
|
|
2610
|
+ rows += caseApplicationMapper.submitCaseApplication(application);
|
|
|
2611
|
+ // 新增日志
|
|
|
2612
|
+ insertCaseLog(application.getId(), CaseApplicationConstants.CASE_CHECK, "");
|
|
|
2613
|
+ }
|
|
|
2614
|
+
|
|
|
2615
|
+ }else{
|
|
|
2616
|
+ throw new ServiceException("这个批号没有批量提交的案件");
|
|
|
2617
|
+ }
|
|
|
2618
|
+
|
|
|
2619
|
+ return rows;
|
|
|
2620
|
+ }
|
|
|
2621
|
+
|
|
|
2622
|
+ private String getColumnstr(String columnname) {
|
|
|
2623
|
+ String columnstr = "";
|
|
|
2624
|
+ switch (columnname) {
|
|
|
2625
|
+ case "caseName":
|
|
|
2626
|
+ columnstr = "案件名称";
|
|
|
2627
|
+ break;
|
|
|
2628
|
+ case "caseSubjectAmount":
|
|
|
2629
|
+ columnstr = "案件标的";
|
|
|
2630
|
+ break;
|
|
|
2631
|
+ case "loanStartDate":
|
|
|
2632
|
+ columnstr = "借款开始日期";
|
|
|
2633
|
+ break;
|
|
|
2634
|
+ case "loanEndDate":
|
|
|
2635
|
+ columnstr = "借款结束日期";
|
|
|
2636
|
+ break;
|
|
|
2637
|
+ case "contractNumber":
|
|
|
2638
|
+ columnstr = "合同编号";
|
|
|
2639
|
+ break;
|
|
|
2640
|
+ case "claimInterestOwed":
|
|
|
2641
|
+ columnstr = "申请人主张欠利息";
|
|
|
2642
|
+ break;
|
|
|
2643
|
+ case "claimLiquidDamag":
|
|
|
2644
|
+ columnstr = "申请人主张违约金";
|
|
|
2645
|
+ break;
|
|
|
2646
|
+ case "claimPrinciOwed":
|
|
|
2647
|
+ columnstr = "申请人主张欠本金";
|
|
|
2648
|
+ break;
|
|
|
2649
|
+ case "arbitratClaims":
|
|
|
2650
|
+ columnstr = "申请人仲裁请求及事实和理由";
|
|
|
2651
|
+ break;
|
|
|
2652
|
+ case "name":
|
|
|
2653
|
+ columnstr = "姓名";
|
|
|
2654
|
+ break;
|
|
|
2655
|
+ case "identityNum":
|
|
|
2656
|
+ columnstr = "身份证号";
|
|
|
2657
|
+ break;
|
|
|
2658
|
+ case "contactTelphone":
|
|
|
2659
|
+ columnstr = "联系电话";
|
|
|
2660
|
+ break;
|
|
|
2661
|
+ case "contactAddress":
|
|
|
2662
|
+ columnstr = "联系地址";
|
|
|
2663
|
+ break;
|
|
|
2664
|
+ case "workTelphone":
|
|
|
2665
|
+ columnstr = "单位电话";
|
|
|
2666
|
+ break;
|
|
|
2667
|
+ case "workAddress":
|
|
|
2668
|
+ columnstr = "单位地址";
|
|
|
2669
|
+ break;
|
|
|
2670
|
+ case "residenAffili":
|
|
|
2671
|
+ columnstr = "住所";
|
|
|
2672
|
+ break;
|
|
|
2673
|
+ case "compLegalPerson":
|
|
|
2674
|
+ columnstr = "法定代表人";
|
|
|
2675
|
+ break;
|
|
|
2676
|
+ case "compLegalperPost":
|
|
|
2677
|
+ columnstr = "法定代表人职位";
|
|
|
2678
|
+ break;
|
|
|
2679
|
+ case "email":
|
|
|
2680
|
+ columnstr = "邮箱";
|
|
|
2681
|
+ break;
|
|
|
2682
|
+ case "nameAgent":
|
|
|
2683
|
+ columnstr = "代理人姓名";
|
|
|
2684
|
+ break;
|
|
|
2685
|
+ case "identityNumAgent":
|
|
|
2686
|
+ columnstr = "代理人身份证号";
|
|
|
2687
|
+ break;
|
|
|
2688
|
+ case "contactTelphoneAgent":
|
|
|
2689
|
+ columnstr = "代理人联系电话";
|
|
|
2690
|
+ break;
|
|
|
2691
|
+ case "contactAddressAgent":
|
|
|
2692
|
+ columnstr = "代理人联系地址";
|
|
|
2693
|
+ break;
|
|
|
2694
|
+ case "responSex":
|
|
|
2695
|
+ columnstr = "被申请人性别";
|
|
|
2696
|
+ break;
|
|
|
2697
|
+ case "responBirth":
|
|
|
2698
|
+ columnstr = "被申请人出生年月日";
|
|
|
2699
|
+ break;
|
|
|
2700
|
+ default:
|
|
|
2701
|
+ columnstr = "";
|
|
|
2702
|
+ }
|
|
|
2703
|
+
|
|
|
2704
|
+ return columnstr;
|
|
|
2705
|
+ }
|
|
2544
|
2706
|
|
|
2545
|
2707
|
|
|
2546
|
2708
|
@Override
|
|
|
@@ -2594,9 +2756,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2594
|
2756
|
|
|
2595
|
2757
|
//发送短信通知 1947342 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。
|
|
2596
|
2758
|
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
|
2597
|
|
- request.setTemplateId("1947342");
|
|
|
2759
|
+ request.setTemplateId("2033619");
|
|
2598
|
2760
|
// 发送开庭日期通知短信
|
|
2599
|
|
- sendHearDateMessage(caseApplication, request, "1947342");
|
|
|
2761
|
+ sendHearDateMessage(caseApplication, request, "2033619");
|
|
2600
|
2762
|
// 新增日志
|
|
2601
|
2763
|
insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, "");
|
|
2602
|
2764
|
|
|
|
@@ -2614,9 +2776,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2614
|
2776
|
CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
|
|
2615
|
2777
|
|
|
2616
|
2778
|
String caseNum = caseApplicationselect.getCaseNum();
|
|
2617
|
|
- //Date hearDate = caseApplicationselect.getHearDate();
|
|
|
2779
|
+ Date hearDate = caseApplicationselect.getHearDate();
|
|
|
2780
|
+ String hearDatestr = "";
|
|
2618
|
2781
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
2619
|
|
- String hearDatestr = null;
|
|
|
2782
|
+ if(hearDate!=null) {
|
|
|
2783
|
+ hearDatestr = dateFormat.format(hearDate);
|
|
|
2784
|
+ }
|
|
2620
|
2785
|
String arbitratorId = caseApplicationselect.getArbitratorId();
|
|
2621
|
2786
|
// List<Arbitrator> arbitratorList = new ArrayList<>();
|
|
2622
|
2787
|
if (StringUtils.isNotEmpty(arbitratorId)) {
|
|
|
@@ -2633,7 +2798,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2633
|
2798
|
request.setPhone(user.getPhonenumber());
|
|
2634
|
2799
|
// 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。
|
|
2635
|
2800
|
String name = user.getNickName();
|
|
2636
|
|
- request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr});
|
|
|
2801
|
+ if (templateId.equals("2033619")) {
|
|
|
2802
|
+ request.setTemplateParamSet(new String[]{name, caseNum});
|
|
|
2803
|
+ }
|
|
|
2804
|
+ if (templateId.equals("1975139")) {
|
|
|
2805
|
+ request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr});
|
|
|
2806
|
+ }
|
|
|
2807
|
+
|
|
2637
|
2808
|
Boolean aBoolean = SmsUtils.sendSms(request);
|
|
2638
|
2809
|
//保存短信发送记录
|
|
2639
|
2810
|
SmsSendRecord smsSendRecord = new SmsSendRecord();
|
|
|
@@ -2642,8 +2813,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2642
|
2813
|
smsSendRecord.setPhone(request.getPhone());
|
|
2643
|
2814
|
smsSendRecord.setSendTime(new Date());
|
|
2644
|
2815
|
String content = "";
|
|
2645
|
|
- if (templateId.equals("1947342")) {
|
|
2646
|
|
- content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,开庭日期已确定为" + hearDatestr + ",请知晓,如非本人操作,请忽略本短信。";
|
|
|
2816
|
+ if (templateId.equals("2033619")) {
|
|
|
2817
|
+ content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,已组庭,请知晓,如非本人操作,请忽略本短信。";
|
|
2647
|
2818
|
}
|
|
2648
|
2819
|
if (templateId.equals("1975139")) {
|
|
2649
|
2820
|
content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,开庭日期已改为" + hearDatestr + ",请知晓,如非本人操作,请忽略本短信。";
|
|
|
@@ -2677,7 +2848,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2677
|
2848
|
request.setPhone(caseAffiliateselect.getContactTelphone());
|
|
2678
|
2849
|
// 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。
|
|
2679
|
2850
|
String name = caseAffiliateselect.getName();
|
|
2680
|
|
- request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr});
|
|
|
2851
|
+ if (templateId.equals("2033619")) {
|
|
|
2852
|
+ request.setTemplateParamSet(new String[]{name, caseNum});
|
|
|
2853
|
+ }
|
|
|
2854
|
+ if (templateId.equals("1975139")) {
|
|
|
2855
|
+ request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr});
|
|
|
2856
|
+ }
|
|
2681
|
2857
|
Boolean aBoolean = SmsUtils.sendSms(request);
|
|
2682
|
2858
|
//保存短信发送记录
|
|
2683
|
2859
|
SmsSendRecord smsSendRecord = new SmsSendRecord();
|
|
|
@@ -2685,7 +2861,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2685
|
2861
|
smsSendRecord.setCaseNum(caseApplicationselect.getCaseNum());
|
|
2686
|
2862
|
smsSendRecord.setPhone(request.getPhone());
|
|
2687
|
2863
|
smsSendRecord.setSendTime(new Date());
|
|
2688
|
|
- String content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,开庭日期已确定为" + hearDatestr + ",请知晓,如非本人操作,请忽略本短信。";
|
|
|
2864
|
+ String content = "";
|
|
|
2865
|
+ if (templateId.equals("2033619")) {
|
|
|
2866
|
+ content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,已组庭,请知晓,如非本人操作,请忽略本短信。";
|
|
|
2867
|
+ }
|
|
|
2868
|
+ if (templateId.equals("1975139")) {
|
|
|
2869
|
+ content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,开庭日期已改为" + hearDatestr + ",请知晓,如非本人操作,请忽略本短信。";
|
|
|
2870
|
+ }
|
|
2689
|
2871
|
smsSendRecord.setSendContent(content);
|
|
2690
|
2872
|
smsSendRecord.setCreateBy(getUsername());
|
|
2691
|
2873
|
if (aBoolean) {
|