|
|
@@ -18,15 +18,10 @@ import com.ruoyi.system.domain.SysUserPost;
|
|
18
|
18
|
import com.ruoyi.system.mapper.SysDeptMapper;
|
|
19
|
19
|
import com.ruoyi.system.mapper.SysUserMapper;
|
|
20
|
20
|
import com.ruoyi.system.mapper.SysUserPostMapper;
|
|
21
|
|
-import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
|
|
22
|
|
-import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
|
|
23
|
|
-import com.ruoyi.wisdomarbitrate.domain.SealManage;
|
|
24
|
|
-import com.ruoyi.wisdomarbitrate.domain.TemplateManage;
|
|
|
21
|
+import com.ruoyi.wisdomarbitrate.domain.*;
|
|
25
|
22
|
import com.ruoyi.wisdomarbitrate.domain.vo.SealListVO;
|
|
26
|
|
-import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper;
|
|
27
|
|
-import com.ruoyi.wisdomarbitrate.mapper.DeptIdentifyMapper;
|
|
28
|
|
-import com.ruoyi.wisdomarbitrate.mapper.SealManageMapper;
|
|
29
|
|
-import com.ruoyi.wisdomarbitrate.mapper.TemplateManageMapper;
|
|
|
23
|
+import com.ruoyi.wisdomarbitrate.domain.vo.TemplateFatchRule;
|
|
|
24
|
+import com.ruoyi.wisdomarbitrate.mapper.*;
|
|
30
|
25
|
import com.ruoyi.wisdomarbitrate.service.IDeptIdentifyService;
|
|
31
|
26
|
import com.ruoyi.wisdomarbitrate.utils.SignAward;
|
|
32
|
27
|
import org.springframework.beans.BeanUtils;
|
|
|
@@ -34,11 +29,13 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
34
|
29
|
import org.springframework.stereotype.Service;
|
|
35
|
30
|
import org.springframework.transaction.annotation.Transactional;
|
|
36
|
31
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
32
|
+import com.ruoyi.wisdomarbitrate.mapper.TemplateFatchRuleMapper;
|
|
37
|
33
|
|
|
38
|
34
|
import java.io.File;
|
|
39
|
35
|
import java.io.IOException;
|
|
40
|
36
|
import java.time.LocalDate;
|
|
41
|
37
|
import java.util.*;
|
|
|
38
|
+import java.util.stream.Collectors;
|
|
42
|
39
|
|
|
43
|
40
|
import static com.ruoyi.common.utils.PageUtils.startPage;
|
|
44
|
41
|
import static com.ruoyi.common.utils.SecurityUtils.getUsername;
|
|
|
@@ -60,6 +57,10 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
|
|
60
|
57
|
private TemplateManageMapper templateManageMapper;
|
|
61
|
58
|
@Autowired
|
|
62
|
59
|
private SysUserPostMapper sysUserPostMapper;
|
|
|
60
|
+ @Autowired
|
|
|
61
|
+ private TemplateFatchRuleMapper templateFatchRuleMapper;
|
|
|
62
|
+ @Autowired
|
|
|
63
|
+ private FatchRuleMapper fatchRuleMapper;
|
|
63
|
64
|
|
|
64
|
65
|
|
|
65
|
66
|
@Override
|
|
|
@@ -530,6 +531,54 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
|
|
530
|
531
|
return null;
|
|
531
|
532
|
}
|
|
532
|
533
|
|
|
|
534
|
+ @Override
|
|
|
535
|
+ public List<FatchRule> getFatchRuleByTemplateid(TemplateManage templateManage) {
|
|
|
536
|
+ TemplateFatchRule templateFatchRule = new TemplateFatchRule();
|
|
|
537
|
+ templateFatchRule.setTemplateId(templateManage.getId());
|
|
|
538
|
+ List<FatchRule> fatchRules = new ArrayList<>();
|
|
|
539
|
+ int countTemplateFatchRule = templateFatchRuleMapper.selectTemplateFatchRulecount(templateFatchRule);
|
|
|
540
|
+ if(countTemplateFatchRule!=0){
|
|
|
541
|
+ FatchRule fatchRule = new FatchRule();
|
|
|
542
|
+ fatchRule.setTemplateId(templateManage.getId());
|
|
|
543
|
+ fatchRules = fatchRuleMapper.selectFatchRuleList(fatchRule);
|
|
|
544
|
+ return fatchRules;
|
|
|
545
|
+ }else {
|
|
|
546
|
+ FatchRule fatchRule = new FatchRule();
|
|
|
547
|
+ fatchRule.setIsDefault(1);
|
|
|
548
|
+ fatchRules = fatchRuleMapper.selectFatchRuleListIsDefault(fatchRule);
|
|
|
549
|
+ return fatchRules;
|
|
|
550
|
+ }
|
|
|
551
|
+ }
|
|
|
552
|
+
|
|
|
553
|
+ @Override
|
|
|
554
|
+ @Transactional
|
|
|
555
|
+ public AjaxResult saveFatchRules(TemplateManage templateManage) {
|
|
|
556
|
+ TemplateFatchRule templateFatchRule = new TemplateFatchRule();
|
|
|
557
|
+ templateFatchRule.setTemplateId(templateManage.getId());
|
|
|
558
|
+ List<TemplateFatchRule> templateFatchRulelist = templateFatchRuleMapper.selectTemplateFatchRuleList(templateFatchRule);
|
|
|
559
|
+ if(templateFatchRulelist!=null&&templateFatchRulelist.size()>0){
|
|
|
560
|
+ List<Long> fatchRuleIds = templateFatchRulelist.stream().map(TemplateFatchRule::getFatchRuleId).collect(Collectors.toList());
|
|
|
561
|
+ fatchRuleMapper.deletebatchFatchRule(fatchRuleIds);
|
|
|
562
|
+ templateFatchRuleMapper.deleteTemplateFatchRule(templateManage.getId());
|
|
|
563
|
+ }
|
|
|
564
|
+ List<FatchRule> fatchRules = templateManage.getFatchRules();
|
|
|
565
|
+ if(fatchRules!=null&&fatchRules.size()>0){
|
|
|
566
|
+ for (FatchRule fatchRule : fatchRules) {
|
|
|
567
|
+ //保存抓取规则数据
|
|
|
568
|
+ fatchRule.setIsDefault(0);
|
|
|
569
|
+ fatchRuleMapper.insertFatchRule(fatchRule);
|
|
|
570
|
+ //保存模板抓取规则关联关系
|
|
|
571
|
+ Long fatchRuleId = fatchRule.getId();
|
|
|
572
|
+ if(fatchRuleId!=null){
|
|
|
573
|
+ templateFatchRule.setFatchRuleId(fatchRuleId);
|
|
|
574
|
+ templateFatchRuleMapper.insertTemplateFatchRule(templateFatchRule);
|
|
|
575
|
+ }
|
|
|
576
|
+ }
|
|
|
577
|
+ return AjaxResult.success("新增成功");
|
|
|
578
|
+ }
|
|
|
579
|
+ return AjaxResult.error();
|
|
|
580
|
+ }
|
|
|
581
|
+
|
|
533
|
582
|
private String getFileExtension(String fileName) {
|
|
534
|
583
|
int lastDotIndex = fileName.lastIndexOf(".");
|
|
535
|
584
|
if (lastDotIndex > 0 && lastDotIndex < fileName.length() - 1) {
|