Merge branch 'qtz3' of SH-Arbitrate/Arbitrate-Backend into dev
This commit was merged in pull request #288.
This commit is contained in:
+18
@@ -199,7 +199,25 @@ public class DeptIdentifyController extends BaseController {
|
|||||||
return deptIdentifyService.saveFatchRules(templateManage);
|
return deptIdentifyService.saveFatchRules(templateManage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询column和注释
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/selectColumnandComment")
|
||||||
|
public AjaxResult selectColumnandComment(){
|
||||||
|
List<FatchRule> fatchRuleList = deptIdentifyService.selectColumnandComment();
|
||||||
|
return AjaxResult.success(fatchRuleList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询column
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/selectColumnbycomment")
|
||||||
|
public AjaxResult selectColumnbycomment(@RequestBody FatchRule fatchRule){
|
||||||
|
FatchRule fatchRulesel = deptIdentifyService.selectColumnbycomment(fatchRule);
|
||||||
|
return AjaxResult.success(fatchRulesel);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package com.ruoyi.wisdomarbitrate.domain;
|
|||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.annotation.Excel;
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -31,6 +33,7 @@ public class CaseApplication extends BaseEntity {
|
|||||||
private Long templateId;
|
private Long templateId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** 立案日期 */
|
/** 立案日期 */
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date registerDate;
|
private Date registerDate;
|
||||||
@@ -621,6 +624,16 @@ public class CaseApplication extends BaseEntity {
|
|||||||
this.annexTypeList = annexTypeList;
|
this.annexTypeList = annexTypeList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<ColumnValue> columnValues;
|
||||||
|
|
||||||
|
public List<ColumnValue> getColumnValues() {
|
||||||
|
return columnValues;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColumnValues(List<ColumnValue> columnValues) {
|
||||||
|
this.columnValues = columnValues;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 案件附件列表
|
* 案件附件列表
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -24,5 +24,6 @@ public class FatchRule extends BaseEntity {
|
|||||||
private Integer isDefault;
|
private Integer isDefault;
|
||||||
|
|
||||||
private Long templateId;
|
private Long templateId;
|
||||||
|
private String databaseName;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,4 +34,6 @@ public class ColumnValue {
|
|||||||
*/
|
*/
|
||||||
private Long caseId;
|
private Long caseId;
|
||||||
|
|
||||||
|
private Integer isDefault;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.wisdomarbitrate.mapper;
|
package com.ruoyi.wisdomarbitrate.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||||
import com.ruoyi.wisdomarbitrate.domain.FatchRule;
|
import com.ruoyi.wisdomarbitrate.domain.FatchRule;
|
||||||
import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue;
|
import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
@@ -25,4 +26,5 @@ public interface ColumnValueMapper {
|
|||||||
*/
|
*/
|
||||||
List<ColumnValue> listByCaseId(@Param("caseId") Long caseId);
|
List<ColumnValue> listByCaseId(@Param("caseId") Long caseId);
|
||||||
|
|
||||||
|
List<ColumnValue> queryColumnValueList(ColumnValue columnValue);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,4 +25,8 @@ public interface FatchRuleMapper {
|
|||||||
void deletebatchFatchRule(@Param("fatchRuleIds") List<Long> fatchRuleIds);
|
void deletebatchFatchRule(@Param("fatchRuleIds") List<Long> fatchRuleIds);
|
||||||
|
|
||||||
int insertFatchRule(FatchRule fatchRule);
|
int insertFatchRule(FatchRule fatchRule);
|
||||||
|
|
||||||
|
List<FatchRule> selectColumnandComment(FatchRule fatchRuleselect);
|
||||||
|
|
||||||
|
FatchRule selectColumnbycomment(FatchRule fatchRule);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,4 +55,8 @@ public interface IDeptIdentifyService {
|
|||||||
List<FatchRule> getFatchRuleByTemplateid(TemplateManage templateManage);
|
List<FatchRule> getFatchRuleByTemplateid(TemplateManage templateManage);
|
||||||
|
|
||||||
AjaxResult saveFatchRules(TemplateManage templateManage);
|
AjaxResult saveFatchRules(TemplateManage templateManage);
|
||||||
|
|
||||||
|
List<FatchRule> selectColumnandComment();
|
||||||
|
|
||||||
|
FatchRule selectColumnbycomment(FatchRule fatchRule);
|
||||||
}
|
}
|
||||||
|
|||||||
+7
@@ -1397,6 +1397,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
arbitrateRecord.setCaseAppliId(caseApplication.getId());
|
arbitrateRecord.setCaseAppliId(caseApplication.getId());
|
||||||
ArbitrateRecord arbitrateRecordselect = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord);
|
ArbitrateRecord arbitrateRecordselect = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord);
|
||||||
|
|
||||||
|
ColumnValue columnValue = new ColumnValue();
|
||||||
|
columnValue.setIsDefault(1);
|
||||||
|
columnValue.setCaseId(caseApplication.getId());
|
||||||
|
List<ColumnValue> columnValueList = columnValueMapper.queryColumnValueList(columnValue);
|
||||||
|
caseApplicationselect.setColumnValues(columnValueList);
|
||||||
|
|
||||||
// CaseAttach caseAttachSelect = new CaseAttach();
|
// CaseAttach caseAttachSelect = new CaseAttach();
|
||||||
// caseAttachSelect.setCaseAppliId(caseApplication.getId());
|
// caseAttachSelect.setCaseAppliId(caseApplication.getId());
|
||||||
// caseAttachSelect.setAnnexType(2);
|
// caseAttachSelect.setAnnexType(2);
|
||||||
@@ -1451,6 +1457,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
caseApplicationselect.setRespondentName(respondentName.toString());
|
caseApplicationselect.setRespondentName(respondentName.toString());
|
||||||
caseApplicationselect.setCaseAffiliates(caseAffiliatListeselect);
|
caseApplicationselect.setCaseAffiliates(caseAffiliatListeselect);
|
||||||
caseApplicationselect.setArbitrateRecord(arbitrateRecordselect);
|
caseApplicationselect.setArbitrateRecord(arbitrateRecordselect);
|
||||||
|
|
||||||
}
|
}
|
||||||
return caseApplicationselect;
|
return caseApplicationselect;
|
||||||
}
|
}
|
||||||
|
|||||||
+39
-1
@@ -12,6 +12,7 @@ import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
|
|||||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
import com.ruoyi.common.exception.EsignDemoException;
|
import com.ruoyi.common.exception.EsignDemoException;
|
||||||
|
import com.ruoyi.common.exception.ServiceException;
|
||||||
import com.ruoyi.common.utils.SealUtil;
|
import com.ruoyi.common.utils.SealUtil;
|
||||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||||
import com.ruoyi.system.domain.SysUserPost;
|
import com.ruoyi.system.domain.SysUserPost;
|
||||||
@@ -36,6 +37,7 @@ import java.io.IOException;
|
|||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
import static com.ruoyi.common.utils.PageUtils.startPage;
|
import static com.ruoyi.common.utils.PageUtils.startPage;
|
||||||
import static com.ruoyi.common.utils.SecurityUtils.getUsername;
|
import static com.ruoyi.common.utils.SecurityUtils.getUsername;
|
||||||
@@ -558,10 +560,30 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
|
|||||||
templateFatchRuleMapper.deleteTemplateFatchRule(templateManage.getId());
|
templateFatchRuleMapper.deleteTemplateFatchRule(templateManage.getId());
|
||||||
|
|
||||||
List<FatchRule> fatchRules = templateManage.getFatchRules();
|
List<FatchRule> fatchRules = templateManage.getFatchRules();
|
||||||
|
|
||||||
|
Map<Object, Long> columnmap = fatchRules.stream().collect(Collectors.groupingBy(fatchRule -> fatchRule.getColumn(), Collectors.counting()));
|
||||||
|
Stream<Object> columnStream = columnmap.entrySet().stream().filter(entry -> entry.getValue() > 1).map(entry -> entry.getKey());
|
||||||
|
List<String> strlist1 = new ArrayList<>();
|
||||||
|
columnStream.forEach(column -> {
|
||||||
|
strlist1.add(column.toString());
|
||||||
|
});
|
||||||
|
if(strlist1!=null&&strlist1.size()>0){
|
||||||
|
throw new ServiceException("字段' " + String.join(",", strlist1) + " '重复");
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<Object, Long> columnNamemap = fatchRules.stream().collect(Collectors.groupingBy(fatchRule -> fatchRule.getColumnName(), Collectors.counting()));
|
||||||
|
Stream<Object> columnNameStream = columnNamemap.entrySet().stream().filter(entry -> entry.getValue() > 1).map(entry -> entry.getKey());
|
||||||
|
List<String> strlist2 = new ArrayList<>();
|
||||||
|
columnNameStream.forEach(column -> {
|
||||||
|
strlist2.add(column.toString());
|
||||||
|
});
|
||||||
|
if(strlist2!=null&&strlist2.size()>0){
|
||||||
|
throw new ServiceException("字段' " + String.join(",", strlist2) + " '重复");
|
||||||
|
}
|
||||||
|
|
||||||
if(fatchRules!=null&&fatchRules.size()>0){
|
if(fatchRules!=null&&fatchRules.size()>0){
|
||||||
for (FatchRule fatchRule : fatchRules) {
|
for (FatchRule fatchRule : fatchRules) {
|
||||||
//保存抓取规则数据
|
//保存抓取规则数据
|
||||||
fatchRule.setIsDefault(0);
|
|
||||||
fatchRuleMapper.insertFatchRule(fatchRule);
|
fatchRuleMapper.insertFatchRule(fatchRule);
|
||||||
//保存模板抓取规则关联关系
|
//保存模板抓取规则关联关系
|
||||||
Long fatchRuleId = fatchRule.getId();
|
Long fatchRuleId = fatchRule.getId();
|
||||||
@@ -575,6 +597,22 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
|
|||||||
return AjaxResult.error();
|
return AjaxResult.error();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<FatchRule> selectColumnandComment() {
|
||||||
|
List<FatchRule> fatchRules = new ArrayList<>();
|
||||||
|
FatchRule fatchRuleselect = new FatchRule();
|
||||||
|
fatchRuleselect.setDatabaseName("test_smart_arbitration");
|
||||||
|
fatchRules = fatchRuleMapper.selectColumnandComment(fatchRuleselect);
|
||||||
|
return fatchRules;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FatchRule selectColumnbycomment(FatchRule fatchRule) {
|
||||||
|
fatchRule.setDatabaseName("test_smart_arbitration");
|
||||||
|
FatchRule fatchRulesel = fatchRuleMapper.selectColumnbycomment(fatchRule);
|
||||||
|
return fatchRulesel;
|
||||||
|
}
|
||||||
|
|
||||||
private String getFileExtension(String fileName) {
|
private String getFileExtension(String fileName) {
|
||||||
int lastDotIndex = fileName.lastIndexOf(".");
|
int lastDotIndex = fileName.lastIndexOf(".");
|
||||||
if (lastDotIndex > 0 && lastDotIndex < fileName.length() - 1) {
|
if (lastDotIndex > 0 && lastDotIndex < fileName.length() - 1) {
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package com.ruoyi.wisdomarbitrate.utils;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.zip.ZipEntry;
|
||||||
|
import java.util.zip.ZipOutputStream;
|
||||||
|
|
||||||
|
public class ZipFileUtils {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String filePath1 = "/path/to/file1.txt";
|
||||||
|
String filePath2 = "/path/to/file2.txt";
|
||||||
|
|
||||||
|
// ZIP文件的输出路径
|
||||||
|
String zipOutPath = "/path/to/output.zip";
|
||||||
|
|
||||||
|
try {
|
||||||
|
FileOutputStream fous = new FileOutputStream(zipOutPath);
|
||||||
|
ZipOutputStream zipOutstream = new ZipOutputStream(fous);
|
||||||
|
FileInputStream fis1 = new FileInputStream(filePath1);
|
||||||
|
FileInputStream fis2 = new FileInputStream(filePath2);
|
||||||
|
|
||||||
|
zipFile(filePath1, fis1, zipOutstream);
|
||||||
|
|
||||||
|
zipFile(filePath2, fis2, zipOutstream);
|
||||||
|
|
||||||
|
System.out.println("文件成功打包成ZIP文件!");
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private static void zipFile(String zipfilePath, FileInputStream zipFileinsteam, ZipOutputStream zipfileOut)
|
||||||
|
throws IOException {
|
||||||
|
ZipEntry zipfileEntry = new ZipEntry(new File(zipfilePath).getName());
|
||||||
|
zipfileOut.putNextEntry(zipfileEntry);
|
||||||
|
|
||||||
|
// 从输入流读取数据并写入ZIP文件
|
||||||
|
byte[] bytes = new byte[1024];
|
||||||
|
int length;
|
||||||
|
while ((length = zipFileinsteam.read(bytes)) >= 0) {
|
||||||
|
zipfileOut.write(bytes, 0, length);
|
||||||
|
}
|
||||||
|
zipfileOut.closeEntry();
|
||||||
|
zipFileinsteam.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -22,5 +22,18 @@
|
|||||||
select * from column_value where case_id=#{caseId}
|
select * from column_value where case_id=#{caseId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="queryColumnValueList" parameterType="ColumnValue" resultMap="BaseResultMap">
|
||||||
|
select * from column_value c
|
||||||
|
<where>
|
||||||
|
<if test="caseId != null">
|
||||||
|
AND c.case_id = #{caseId}
|
||||||
|
</if>
|
||||||
|
<if test="isDefault != null">
|
||||||
|
AND c.is_default = #{isDefault}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -30,6 +30,39 @@
|
|||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectColumnandComment" parameterType="FatchRule" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
a.COLUMN_name as `column`,
|
||||||
|
a.COLumn_comment as column_name
|
||||||
|
from
|
||||||
|
information_schema.COLUMNS a
|
||||||
|
where
|
||||||
|
TABLE_schema = #{databaseName}
|
||||||
|
and TABLE_name in('case_application','case_affiliate')
|
||||||
|
and COLUMN_NAME not in('id','case_appli_id','case_num','case_subject_amount',
|
||||||
|
'register_date','arbitrat_method','case_status','hear_date','begin_video_date',
|
||||||
|
'online_video_person','create_time','update_by','update_time','create_by',
|
||||||
|
'arbitrator_id','arbitrator_name','pended_trial_arbitorid','pending_appoint_arbotrar',
|
||||||
|
'case_name','case_result','is_agree_pend_tral','objection_add_eviden','open_court_hear',
|
||||||
|
'paid_expenses','filearbitra_url','pay_type','adjudica_counter','proper_preser','objecti_juris',
|
||||||
|
'is_absence','respon_cross_opin','applica_cross_opin','respon_defen_opini','appli_is_absen',
|
||||||
|
'lock_status','room_id','import_flag','version','batch_number','template_id','applicant_agent_user_id','contract_number','identity_type','application_organ_id')
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectColumnbycomment" parameterType="FatchRule" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
COLUMN_NAME
|
||||||
|
from
|
||||||
|
information_schema.COLUMNS
|
||||||
|
where
|
||||||
|
TABLE_schema = #{databaseName}
|
||||||
|
and TABLE_name in('case_application','case_affiliate')
|
||||||
|
and COLumn_comment = #{columnName}
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<select id="selectFatchRuleListIsDefault" parameterType="FatchRule" resultMap="BaseResultMap">
|
<select id="selectFatchRuleListIsDefault" parameterType="FatchRule" resultMap="BaseResultMap">
|
||||||
SELECT f.id ,f.file_name ,f.start_content ,f.end_content ,
|
SELECT f.id ,f.file_name ,f.start_content ,f.end_content ,
|
||||||
f.`column` ,f.is_default ,f.`column_name`
|
f.`column` ,f.is_default ,f.`column_name`
|
||||||
|
|||||||
Reference in New Issue
Block a user