18792927508 2 anni fa
parent
commit
86b8305dc2

+ 8
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/template/TemplateManageMapper.java Vedi File

9
 @Mapper
9
 @Mapper
10
 public interface TemplateManageMapper {
10
 public interface TemplateManageMapper {
11
     List<TemplateManage> selectTemplateList(TemplateManage templateManage);
11
     List<TemplateManage> selectTemplateList(TemplateManage templateManage);
12
+    List<TemplateManage> selectTemplateListByIds(@Param("fileIds") List<Long> fileIds);
12
 
13
 
13
     int insertTemplateManage(TemplateManage templateManage);
14
     int insertTemplateManage(TemplateManage templateManage);
14
 
15
 
56
      */
57
      */
57
     void deleteTemplateManageFileById(@Param("id")Long id, @Param("fileIds")List<Long> annexIds);
58
     void deleteTemplateManageFileById(@Param("id")Long id, @Param("fileIds")List<Long> annexIds);
58
 
59
 
60
+    /**
61
+     * 根据id和附件类型删除
62
+     * @param id
63
+     * @param types
64
+     */
65
+    void deleteTemplateManageFileByIdAndType(@Param("id")Long id, @Param("types")List<Integer> types);
66
+
59
     /**
67
     /**
60
      * 根据模板id和类型查询
68
      * 根据模板id和类型查询
61
      * @param templateId
69
      * @param templateId

+ 12
- 3
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/dept/impl/DeptIdentifyServiceImpl.java Vedi File

427
         Long id = templateManage.getId();
427
         Long id = templateManage.getId();
428
         templateManage.setUpdateBy(getUsername());
428
         templateManage.setUpdateBy(getUsername());
429
         int i = templateManageMapper.updateTemplateManage(templateManage);
429
         int i = templateManageMapper.updateTemplateManage(templateManage);
430
+
430
         // 先删除附件
431
         // 先删除附件
431
         if (CollectionUtil.isNotEmpty(templateManage.getAnnexIds())) {
432
         if (CollectionUtil.isNotEmpty(templateManage.getAnnexIds())) {
432
-            templateManageMapper.deleteTemplateManageFileById(id, templateManage.getAnnexIds());
433
-            // 修改附件表
434
-            templateManageMapper.updateFileByIds(templateManage);
433
+            // 根据附件id查询附件类型
434
+            List<TemplateManage> templateManages = templateManageMapper.selectTemplateListByIds(templateManage.getAnnexIds());
435
+            if(CollectionUtil.isNotEmpty(templateManages)) {
436
+                List<Integer> types = templateManages.stream().map(TemplateManage::getTemType).collect(Collectors.toList());
437
+                if(CollectionUtil.isNotEmpty(types)) {
438
+                    // 根据模板id和类型删除附件
439
+                    templateManageMapper.deleteTemplateManageFileByIdAndType(id, types);
440
+                    // 修改附件表
441
+                    templateManageMapper.updateFileByIds(templateManage);
442
+                }
443
+            }
435
         }
444
         }
436
 
445
 
437
         if (i > 0) {
446
         if (i > 0) {

+ 52
- 33
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java Vedi File

1050
                 mediatorVO.setCompleteAmount(0L);
1050
                 mediatorVO.setCompleteAmount(0L);
1051
             } else if(caseMap.containsKey(user.getUserId())) {
1051
             } else if(caseMap.containsKey(user.getUserId())) {
1052
                 List<MsCaseApplication> applications = caseMap.get(user.getUserId());
1052
                 List<MsCaseApplication> applications = caseMap.get(user.getUserId());
1053
-                // 办案件
1053
+                // 办案件
1054
                 long count = applications.stream().filter(caseApplication -> !caseApplication.getCaseStatusName().equals("结束")).count();
1054
                 long count = applications.stream().filter(caseApplication -> !caseApplication.getCaseStatusName().equals("结束")).count();
1055
-                mediatorVO.setTodoAmount(applications.size()-count);
1056
-                mediatorVO.setCompleteAmount(count);
1055
+                mediatorVO.setCompleteAmount(applications.size()-count);
1056
+                mediatorVO.setTodoAmount(count);
1057
             }
1057
             }
1058
             mediatorVOS.add(mediatorVO);
1058
             mediatorVOS.add(mediatorVO);
1059
         }
1059
         }
1240
      */
1240
      */
1241
     @Transactional
1241
     @Transactional
1242
     public void verifyMediator(MsCaseApplication application,BookingVO vo) {
1242
     public void verifyMediator(MsCaseApplication application,BookingVO vo) {
1243
+        MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(vo.getCaseFlowId());
1244
+        if (currentFlow == null) {
1245
+            throw new ServiceException("未找到当前流程节点");
1246
+        }
1243
         MsCaseFlow nextFlow = caseFlowMapper.nextFlow(vo.getCaseFlowId());
1247
         MsCaseFlow nextFlow = caseFlowMapper.nextFlow(vo.getCaseFlowId());
1244
         if (nextFlow == null) {
1248
         if (nextFlow == null) {
1245
             throw new ServiceException("未找到下一个流程节点");
1249
             throw new ServiceException("未找到下一个流程节点");
1257
         msCaseApplicationMapper.updateByPrimaryKeySelective(application);
1261
         msCaseApplicationMapper.updateByPrimaryKeySelective(application);
1258
         // 根据案件id查询案件
1262
         // 根据案件id查询案件
1259
         MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(application.getId());
1263
         MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(application.getId());
1260
-        MsCaseAffiliate affiliate = msCaseAffiliateMapper.selectByPrimaryKey(application.getId());
1261
-        if(caseApplication==null || affiliate==null){
1262
-           throw new ServiceException("未找到该案件");
1263
-        }
1264
-        // 申请人电话
1265
-        String phone="";
1266
-        if(affiliate.getOrganizeFlag().equals(0)){
1267
-            // 自然人
1268
-            if(StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent())){
1269
-                phone=affiliate.getContactTelphoneAgent();
1270
-            }else {
1271
-                phone=affiliate.getApplicationPhone();
1264
+        // 发送开庭短信
1265
+        if(CollectionUtil.isNotEmpty(vo.getHerDates())) {
1266
+
1267
+            MsCaseAffiliate affiliate = msCaseAffiliateMapper.selectByPrimaryKey(application.getId());
1268
+            if (caseApplication == null || affiliate == null) {
1269
+                throw new ServiceException("未找到该案件");
1272
             }
1270
             }
1271
+            // 申请人电话
1272
+            String phone = "";
1273
+            if (affiliate.getOrganizeFlag().equals(0)) {
1274
+                // 自然人
1275
+                if (StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent())) {
1276
+                    phone = affiliate.getContactTelphoneAgent();
1277
+                } else {
1278
+                    phone = affiliate.getApplicationPhone();
1279
+                }
1273
 
1280
 
1274
-        }else {
1275
-            phone=affiliate.getContactTelphoneAgent();
1276
-        }
1277
-        caseApplication.setHearDate(application.getHearDate());
1278
-        // 申请人发送开庭日期短信
1279
-        sendHearDateSms(caseApplication,phone);
1280
-        // 被申发送开庭日期短信
1281
-        sendHearDateSms(caseApplication,affiliate.getRespondentPhone());
1282
-        // 调解员发送短信
1283
-       // 根据调解员id查询用户
1284
-        if(caseApplication.getMediatorId()!=null) {
1285
-            SysUser sysUser = sysUserMapper.selectUserById(caseApplication.getMediatorId());
1286
-            sendHearDateSms(caseApplication, sysUser.getPhonenumber());
1281
+            } else {
1282
+                phone = affiliate.getContactTelphoneAgent();
1283
+            }
1284
+            caseApplication.setHearDate(application.getHearDate());
1285
+            // 申请人发送开庭日期短信
1286
+            sendHearDateSms(caseApplication, phone);
1287
+            // 被申发送开庭日期短信
1288
+            sendHearDateSms(caseApplication, affiliate.getRespondentPhone());
1289
+            // 调解员发送短信
1290
+            // 根据调解员id查询用户
1291
+            if (caseApplication.getMediatorId() != null) {
1292
+                SysUser sysUser = sysUserMapper.selectUserById(caseApplication.getMediatorId());
1293
+                sendHearDateSms(caseApplication, sysUser.getPhonenumber());
1294
+            }
1287
         }
1295
         }
1288
         // 新增日志
1296
         // 新增日志
1289
-        CaseLogUtils.insertCaseLog(caseApplication.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(), "");
1297
+
1298
+        CaseLogUtils.insertCaseLog(caseApplication.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "");
1290
 
1299
 
1291
     }
1300
     }
1292
 
1301
 
1299
         if(StrUtil.isEmpty(phone)){
1308
         if(StrUtil.isEmpty(phone)){
1300
             return;
1309
             return;
1301
         }
1310
         }
1302
-        // 2075447  尊敬的用户,您的{1}案件,线上调解日期已确定为{2},请知晓,如非本人操作,请忽略本短信。
1303
-        Boolean smsFlag = SmsUtils.sendSms(application.getId(), "2075447", phone, new String[]{application.getCaseNum(),application.getHearDate()});
1304
-        String sendContent = "尊敬的用户,您的" + application.getCaseNum() + "的案件,线上调解日期已确定为"+application.getHearDate()+",请知晓,如非本人操作,请忽略本短信。";
1305
-        // 新增短信记录
1311
+        Boolean smsFlag =true;
1312
+        String sendContent="";
1313
+        if(StrUtil.isNotEmpty(application.getMediationMethod()) && application.getMediationMethod().equals("1")){
1314
+
1315
+            // 线上调解 2075447  尊敬的用户,您的{1}案件,线上调解日期已确定为{2},请知晓,如非本人操作,请忽略本短信。
1316
+            smsFlag = SmsUtils.sendSms(application.getId(), "2075447", phone, new String[]{application.getCaseNum(),application.getHearDate()});
1317
+            sendContent = "尊敬的用户,您的" + application.getCaseNum() + "的案件,线上调解日期已确定为"+application.getHearDate()+",请知晓,如非本人操作,请忽略本短信。";
1318
+        }else {
1319
+            // 线下调解 2077966 尊敬的用户,您的{1}案件,线下调解日期已确定为{2},请知晓,如非本人操作,请忽略本短信。
1320
+            smsFlag = SmsUtils.sendSms(application.getId(), "2075447", phone, new String[]{application.getCaseNum(),application.getHearDate()});
1321
+            sendContent = "尊敬的用户,您的" + application.getCaseNum() + "的案件,线下调解日期已确定为"+application.getHearDate()+",请知晓,如非本人操作,请忽略本短信。";
1322
+
1323
+        }
1324
+          // 新增短信记录
1306
         SmsSendRecord smsSendRecord = new SmsSendRecord(application.getId(), application.getCaseNum(), phone, new Date(), sendContent);
1325
         SmsSendRecord smsSendRecord = new SmsSendRecord(application.getId(), application.getCaseNum(), phone, new Date(), sendContent);
1307
         if(smsFlag){
1326
         if(smsFlag){
1308
             smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode());
1327
             smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode());

+ 20
- 1
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/template/TemplateManageMapper.xml Vedi File

64
         </where>
64
         </where>
65
         ORDER BY create_time DESC
65
         ORDER BY create_time DESC
66
     </select>
66
     </select>
67
-
67
+    <select id="selectTemplateListByIds"  resultMap="TemplateManageResult">
68
+        SELECT  *
69
+        FROM  ms_template_manage_file
70
+        <where>
71
+            <if test="fileIds != null">
72
+               and file_id in
73
+                <foreach collection="fileIds" item="id" open="(" separator="," close=")">
74
+                    #{id}
75
+                </foreach>
76
+            </if>
77
+        </where>
78
+    </select>
68
     <select id="selectById" resultMap="TemplateManageResult">
79
     <select id="selectById" resultMap="TemplateManageResult">
69
         select * from ms_template_manage where id=#{id}
80
         select * from ms_template_manage where id=#{id}
70
     </select>
81
     </select>
135
 
146
 
136
         ;
147
         ;
137
     </delete>
148
     </delete>
149
+    <delete id="deleteTemplateManageFileByIdAndType">
150
+        delete from ms_template_manage_file where template_manage_id = #{id} and tem_type  in
151
+        <foreach collection="types" item="it" open="(" separator="," close=")">
152
+            #{it}
153
+        </foreach>
154
+
155
+        ;
156
+    </delete>
138
 
157
 
139
     <select id="selectByIdAndType" resultMap="TemplateManageResult">
158
     <select id="selectByIdAndType" resultMap="TemplateManageResult">
140
         select f.* from ms_template_manage m join ms_template_manage_file f on m.id=f.template_manage_id
159
         select f.* from ms_template_manage m join ms_template_manage_file f on m.id=f.template_manage_id