소스 검색

Merge branch 'qtz' of SH-Arbitrate/Arbitrate-Backend into dev

qtz 2 년 전
부모
커밋
4431065e8f

+ 12
- 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java 파일 보기

141
      * 组庭审核
141
      * 组庭审核
142
      */
142
      */
143
     @PreAuthorize("@ss.hasPermi('caseApplication:pendTralCheck')")
143
     @PreAuthorize("@ss.hasPermi('caseApplication:pendTralCheck')")
144
-    @Log(title = "组庭", businessType = BusinessType.UPDATE)
144
+    @Log(title = "组庭审核", businessType = BusinessType.UPDATE)
145
     @PostMapping("/pendTralCheck")
145
     @PostMapping("/pendTralCheck")
146
     public AjaxResult pendTralCheck(@Validated @RequestBody CaseApplication caseApplication)
146
     public AjaxResult pendTralCheck(@Validated @RequestBody CaseApplication caseApplication)
147
     {
147
     {
148
         return toAjax(caseApplicationService.pendTralCheck(caseApplication));
148
         return toAjax(caseApplicationService.pendTralCheck(caseApplication));
149
     }
149
     }
150
 
150
 
151
+    /**
152
+     * 组庭确认
153
+     */
154
+    @PreAuthorize("@ss.hasPermi('caseApplication:pendTralSure')")
155
+    @Log(title = "组庭确认", businessType = BusinessType.UPDATE)
156
+    @PostMapping("/pendTralSure")
157
+    public AjaxResult pendTralSure(@Validated @RequestBody CaseApplication caseApplication)
158
+    {
159
+        return toAjax(caseApplicationService.pendTralSure(caseApplication));
160
+    }
161
+
151
 
162
 
152
 
163
 
153
     /**
164
     /**

+ 12
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/Arbitrator.java 파일 보기

2
 
2
 
3
 import com.ruoyi.common.core.domain.BaseEntity;
3
 import com.ruoyi.common.core.domain.BaseEntity;
4
 
4
 
5
+import java.util.List;
6
+
5
 public class Arbitrator    extends BaseEntity {
7
 public class Arbitrator    extends BaseEntity {
6
     private static final long serialVersionUID = 1L;
8
     private static final long serialVersionUID = 1L;
7
 
9
 
22
     /** 联系电话 */
24
     /** 联系电话 */
23
     private String telephone;
25
     private String telephone;
24
 
26
 
27
+    List<Long> idList;
28
+
29
+    public List<Long> getIdList() {
30
+        return idList;
31
+    }
32
+
33
+    public void setIdList(List<Long> idList) {
34
+        this.idList = idList;
35
+    }
36
+
25
     public String getArbitratorName() {
37
     public String getArbitratorName() {
26
         return arbitratorName;
38
         return arbitratorName;
27
     }
39
     }

+ 31
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java 파일 보기

80
     private int objectionAddEviden;
80
     private int objectionAddEviden;
81
     /** 是否需要开庭审理 */
81
     /** 是否需要开庭审理 */
82
     private int openCourtHear;
82
     private int openCourtHear;
83
+    /** 案件状态名称 */
84
+    private String caseStatusName;
85
+
86
+    public String getCaseStatusName() {
87
+        return caseStatusName;
88
+    }
89
+
90
+    public void setCaseStatusName(String caseStatusName) {
91
+        this.caseStatusName = caseStatusName;
92
+    }
93
+
94
+    /** 申请人名称 */
95
+    private String applicantName;
96
+    /** 被申请人名称 */
97
+    private String respondentName;
98
+
99
+    public String getApplicantName() {
100
+        return applicantName;
101
+    }
102
+
103
+    public void setApplicantName(String applicantName) {
104
+        this.applicantName = applicantName;
105
+    }
106
+
107
+    public String getRespondentName() {
108
+        return respondentName;
109
+    }
110
+
111
+    public void setRespondentName(String respondentName) {
112
+        this.respondentName = respondentName;
113
+    }
83
 
114
 
84
     public int getObjectionAddEviden() {
115
     public int getObjectionAddEviden() {
85
         return objectionAddEviden;
116
         return objectionAddEviden;

+ 2
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java 파일 보기

27
     int pendingAppointArbotrar(CaseApplication caseApplication);
27
     int pendingAppointArbotrar(CaseApplication caseApplication);
28
 
28
 
29
     int pendTralCheck(CaseApplication caseApplication);
29
     int pendTralCheck(CaseApplication caseApplication);
30
+
31
+    int pendTralSure(CaseApplication caseApplication);
30
 }
32
 }

+ 82
- 5
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java 파일 보기

2
 
2
 
3
 import com.ruoyi.common.constant.CaseApplicationConstants;
3
 import com.ruoyi.common.constant.CaseApplicationConstants;
4
 import com.ruoyi.common.exception.ServiceException;
4
 import com.ruoyi.common.exception.ServiceException;
5
+import com.ruoyi.common.utils.DateUtils;
6
+import com.ruoyi.common.utils.SmsUtils;
5
 import com.ruoyi.common.utils.StringUtils;
7
 import com.ruoyi.common.utils.StringUtils;
6
 import com.ruoyi.common.utils.bean.BeanUtils;
8
 import com.ruoyi.common.utils.bean.BeanUtils;
7
 import com.ruoyi.wisdomarbitrate.domain.Arbitrator;
9
 import com.ruoyi.wisdomarbitrate.domain.Arbitrator;
8
 import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
10
 import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
9
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
11
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
12
+import com.ruoyi.wisdomarbitrate.mapper.ArbitratorMapper;
10
 import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper;
13
 import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper;
11
 import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
14
 import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
12
 import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
15
 import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
15
 import org.springframework.transaction.annotation.Transactional;
18
 import org.springframework.transaction.annotation.Transactional;
16
 
19
 
17
 import java.lang.reflect.Field;
20
 import java.lang.reflect.Field;
18
-import java.util.ArrayList;
19
-import java.util.Comparator;
20
-import java.util.List;
21
-import java.util.TreeSet;
21
+import java.text.SimpleDateFormat;
22
+import java.util.*;
22
 import java.util.stream.Collectors;
23
 import java.util.stream.Collectors;
23
 
24
 
24
 import static com.ruoyi.common.core.domain.AjaxResult.error;
25
 import static com.ruoyi.common.core.domain.AjaxResult.error;
33
     @Autowired
34
     @Autowired
34
     private CaseAffiliateMapper caseAffiliateMapper;
35
     private CaseAffiliateMapper caseAffiliateMapper;
35
 
36
 
37
+    @Autowired
38
+    private ArbitratorMapper arbitratorMapper;
39
+
36
 
40
 
37
     @Override
41
     @Override
38
     public List<CaseApplication> selectCaseApplicationList(CaseApplication caseApplication) {
42
     public List<CaseApplication> selectCaseApplicationList(CaseApplication caseApplication) {
99
         CaseAffiliate caseAffiliate = new CaseAffiliate();
103
         CaseAffiliate caseAffiliate = new CaseAffiliate();
100
         caseAffiliate.setCaseAppliId(caseApplication.getId());
104
         caseAffiliate.setCaseAppliId(caseApplication.getId());
101
         List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
105
         List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
102
-        if(caseApplicationselect!=null){
106
+        if(caseAffiliatListeselect!=null){
107
+            StringBuffer applicantName = new StringBuffer();
108
+            StringBuffer respondentName = new StringBuffer();
109
+            for (int i = 0; i < caseAffiliatListeselect.size(); i++){
110
+                CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i);
111
+                int identityType = caseAffiliateselect.getIdentityType();
112
+                if(identityType==1){
113
+                    applicantName.append(caseAffiliateselect.getName()).append(",");;
114
+                }else if(identityType==2){
115
+                    respondentName.append(caseAffiliateselect.getName()).append(",");;
116
+                }
117
+            }
118
+            caseApplicationselect.setApplicantName(applicantName.toString());
119
+            caseApplicationselect.setRespondentName(respondentName.toString());
103
             caseApplicationselect.setCaseAffiliates(caseAffiliatListeselect);
120
             caseApplicationselect.setCaseAffiliates(caseAffiliatListeselect);
104
         }
121
         }
105
         return caseApplicationselect;
122
         return caseApplicationselect;
231
         return rows;
248
         return rows;
232
     }
249
     }
233
 
250
 
251
+    @Override
252
+    @Transactional
253
+    public int pendTralSure(CaseApplication caseApplication) {
254
+        caseApplication.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION_METHOD);
255
+        int rows = caseApplicationMapper.submitCaseApplication(caseApplication);
256
+
257
+        //发送短信通知
258
+        SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
259
+        request.setTemplateId("1931000");
260
+
261
+        CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
262
+        String caseNum = caseApplicationselect.getCaseNum();
263
+        Date hearDate = caseApplicationselect.getHearDate();
264
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
265
+        String hearDatestr = dateFormat.format(hearDate);
266
+
267
+        String arbitratorId = caseApplicationselect.getArbitratorId();
268
+        List<Arbitrator> arbitratorList = new ArrayList<>();
269
+        if(StringUtils.isNotEmpty(arbitratorId)){
270
+            String[] idStrList  = arbitratorId.split(",");
271
+            List<Long> idList = new ArrayList<>();
272
+            for(int i = 0;i < idStrList.length;i ++ ){
273
+                idList.add(Long.parseLong(idStrList[i]));
274
+            }
275
+            Arbitrator arbitrator = new Arbitrator();
276
+            arbitrator.setIdList(idList);
277
+            arbitratorList = arbitratorMapper.selectArbitratorList(arbitrator);
278
+            if(arbitratorList!=null) {
279
+                for (int i = 0; i < arbitratorList.size(); i++) {
280
+                    Arbitrator arbitratorselect = arbitratorList.get(i);
281
+                    //给仲裁员发送短信通知
282
+                    request.setPhone(arbitratorselect.getTelephone());
283
+                    // 1931000 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。
284
+                    String name = arbitratorselect.getArbitratorName();
285
+                    request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr});
286
+                    SmsUtils.sendSms(request);
287
+                }
288
+            }
289
+        }
290
+
291
+        CaseAffiliate caseAffiliate = new CaseAffiliate();
292
+        caseAffiliate.setCaseAppliId(caseApplication.getId());
293
+        List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
294
+        if(caseAffiliatListeselect!=null) {
295
+            for (int j = 0; j < caseAffiliatListeselect.size(); j++) {
296
+                CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(j);
297
+                int identityType = caseAffiliateselect.getIdentityType();
298
+                //给申请人、被申请人发送短信通知
299
+                request.setPhone(caseAffiliateselect.getContactTelphone());
300
+                // 1931000 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。
301
+                String name = caseAffiliateselect.getName();
302
+                request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr});
303
+                SmsUtils.sendSms(request);
304
+            }
305
+        }
306
+
307
+        return rows;
308
+
309
+    }
310
+
234
     @Override
311
     @Override
235
     @Transactional
312
     @Transactional
236
     public int pendingAppointArbotrar(CaseApplication caseApplication) {
313
     public int pendingAppointArbotrar(CaseApplication caseApplication) {

+ 8
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitratorMapper.xml 파일 보기

26
             <if test="arbitratorName != null and arbitratorName != ''">
26
             <if test="arbitratorName != null and arbitratorName != ''">
27
                 AND a.arbitrator_name like concat('%', #{arbitratorName}, '%')
27
                 AND a.arbitrator_name like concat('%', #{arbitratorName}, '%')
28
             </if>
28
             </if>
29
+
30
+            <if test="idList != null and idList.size() > 0">
31
+                AND a.id in
32
+                <foreach item="id" collection="idList" open="(" separator="," close=")">
33
+                    #{id}
34
+                </foreach>
35
+            </if>
36
+
29
         </where>
37
         </where>
30
     </select>
38
     </select>
31
 
39
 

+ 12
- 2
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml 파일 보기

24
         <result property="beginVideoDate"     column="begin_video_date"     />
24
         <result property="beginVideoDate"     column="begin_video_date"     />
25
         <result property="onlineVideoPerson"       column="online_video_person"       />
25
         <result property="onlineVideoPerson"       column="online_video_person"       />
26
         <result property="contractNumber"      column="contract_number"     />
26
         <result property="contractNumber"      column="contract_number"     />
27
-
27
+        <result property="caseStatusName"      column="caseStatusName"     />
28
         <result property="createBy"     column="create_by"    />
28
         <result property="createBy"     column="create_by"    />
29
         <result property="createTime"   column="create_time"  />
29
         <result property="createTime"   column="create_time"  />
30
         <result property="updateBy"     column="update_by"    />
30
         <result property="updateBy"     column="update_by"    />
34
 
34
 
35
 
35
 
36
     <select id="selectCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
36
     <select id="selectCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
37
-        select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,c.case_status ,c.hear_date ,c.arbitrat_claims ,
37
+        select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,c.case_status ,
38
+        CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
39
+                            when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
40
+                            when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
41
+                            when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
42
+                            when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
43
+                            when 15 then '待仲裁文书送达' when 16 then '待案件归档'
44
+                            ELSE '无案件状态'
45
+                            END caseStatusName,
46
+        c.hear_date ,c.arbitrat_claims ,
38
         c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
47
         c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
39
         c.paid_expenses ,c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
48
         c.paid_expenses ,c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
40
         c.update_by ,c.update_time
49
         c.update_by ,c.update_time
152
             <if test="isAgreePendTral != null">is_agree_pend_tral = #{isAgreePendTral},</if>
161
             <if test="isAgreePendTral != null">is_agree_pend_tral = #{isAgreePendTral},</if>
153
             <if test="objectionAddEviden != null">objection_add_eviden = #{objectionAddEviden},</if>
162
             <if test="objectionAddEviden != null">objection_add_eviden = #{objectionAddEviden},</if>
154
             <if test="openCourtHear != null">open_court_hear = #{openCourtHear},</if>
163
             <if test="openCourtHear != null">open_court_hear = #{openCourtHear},</if>
164
+            <if test="hearDate != null">hear_date = #{hearDate},</if>
155
         </set>
165
         </set>
156
         where id = #{id}
166
         where id = #{id}
157
     </update>
167
     </update>