Merge branch 'wq1' of SH-Arbitrate/Mediation-Backend into dev

This commit was merged in pull request #48.
This commit is contained in:
2024-01-29 11:53:29 +08:00
committed by Gitea
12 changed files with 37 additions and 131 deletions
@@ -201,25 +201,7 @@ 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);
}
/** /**
* 根据模板id查询模板字段列表 * 根据模板id查询模板字段列表
@@ -51,6 +51,9 @@ public class MsCaseApplicationController extends BaseController {
@PostMapping("/insert") @PostMapping("/insert")
public AjaxResult insert(@RequestBody MsCaseApplicationVO caseApplication ) public AjaxResult insert(@RequestBody MsCaseApplicationVO caseApplication )
{ {
if(caseApplication.getAffiliate()==null||caseApplication.getAffiliate().getOrganizeFlag()==null){
error("参数校验失败");
}
return success(caseApplicationService.insert(caseApplication)); return success(caseApplicationService.insert(caseApplication));
} }
@@ -20,24 +20,30 @@ public class MsCaseAffiliate {
@Id @Id
@Column(name = "case_appli_id") @Column(name = "case_appli_id")
private Long caseAppliId; private Long caseAppliId;
/**
* 是否机构申请,0-自然人,1-申请机构,默认0
*/
@Column(name = "organize_flag")
private Integer organizeFlag;
/** /**
* 申请机构 * 申请人id
*/ */
@Column(name = "application_organ_id") @Column(name = "application_id")
private String applicationOrganId; private String applicationId;
/** /**
* 申请机构名称 * 申请人名称
*/ */
@Column(name = "application_organ_name") @Column(name = "application_name")
private String applicationOrganName; private String applicationName;
/** /**
* 统一社会信用代码 * 代码(统一社会信用代码或者身份证号)
*/ */
@Column(name = "credit_code") @Column(name = "code")
private String creditCode; private String code;
/** /**
* 法定代表人 * 法定代表人
@@ -51,7 +51,7 @@ public class MsCaseApplication {
private BigDecimal caseSubjectAmount; private BigDecimal caseSubjectAmount;
/** /**
* 调解方式,1-开庭调解,2-书面调解 * 调解方式,1-线上调解,2-线下调解
*/ */
@Column(name = "mediation_method") @Column(name = "mediation_method")
private String mediationMethod; private String mediationMethod;
@@ -92,23 +92,12 @@ public class MsCaseApplication {
@Column(name = "mediator_name") @Column(name = "mediator_name")
private String mediatorName; private String mediatorName;
/**
* 是否同意组庭,0否,1是
*/
@Column(name = "is_agree_pend_tral")
private Integer isAgreePendTral;
/** /**
* 支付方式(0线上支付,1线下支付) * 支付方式(0线上支付,1线下支付)
*/ */
@Column(name = "pay_type") @Column(name = "pay_type")
private String payType; private String payType;
/**
* 是否仲裁反请求,1是,0否
*/
@Column(name = "adjudica_counter")
private Integer adjudicaCounter;
/** /**
* 被申请人是否缺席,1是,0否 * 被申请人是否缺席,1是,0否
@@ -192,17 +181,6 @@ public class MsCaseApplication {
*/ */
private String facts; private String facts;
/**
* 申请人请求仲裁庭裁决
*/
@Column(name = "request_rule")
private String requestRule;
/**
* 案件描述
*/
@Column(name = "case_describe")
private String caseDescribe;
/** /**
* 调解书URL * 调解书URL
@@ -210,11 +188,7 @@ public class MsCaseApplication {
@Column(name = "mediation_url") @Column(name = "mediation_url")
private String mediationUrl; private String mediationUrl;
/**
* 仲裁反请求原因
*/
@Column(name = "adjudica_counter_reason")
private String adjudicaCounterReason;
/** /**
* 调解内容 * 调解内容
@@ -35,7 +35,7 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
* @return * @return
*/ */
@Select("<script> select t.* from (select c.id,c.room_id roomId,c.mediation_method mediationMethod,0 AS pendingStatus,c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,c.case_subject_amount caseSubjectAmount," + @Select("<script> select t.* from (select c.id,c.room_id roomId,c.mediation_method mediationMethod,0 AS pendingStatus,c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,c.case_subject_amount caseSubjectAmount," +
"a.application_organ_name applicationOrganName,a.respondent_name respondentName,c.mediator_name mediatorName," + "a.application_name applicationName,a.respondent_name respondentName,c.mediator_name mediatorName," +
"c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime from ms_case_application c " + "c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime from ms_case_application c " +
"join ms_case_affiliate a on c.id=a.case_appli_id <where> " + "join ms_case_affiliate a on c.id=a.case_appli_id <where> " +
"<if test='caseStatusNames != null and caseStatusNames.size() > 0 '> and c.case_status_name in" + "<if test='caseStatusNames != null and caseStatusNames.size() > 0 '> and c.case_status_name in" +
@@ -54,7 +54,7 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
"</if> " + "</if> " +
"<if test=\"req.applicantFlag != null \">" + "<if test=\"req.applicantFlag != null \">" +
" AND a.application_organ_id = #{req.applicationOrganId} " + " AND a.application_id = #{req.applicationId} " +
"</if> " "</if> "
+ "<if test=\"req.respondentIdentityNum != null and req.respondentIdentityNum != ''\">" + + "<if test=\"req.respondentIdentityNum != null and req.respondentIdentityNum != ''\">" +
" AND a.respondent_identity_num = #{req.respondentIdentityNum} " + " AND a.respondent_identity_num = #{req.respondentIdentityNum} " +
@@ -70,7 +70,7 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
"and c.create_time &lt;= #{req.endTime}</if>" + "and c.create_time &lt;= #{req.endTime}</if>" +
" </where> " + " </where> " +
"union select c.id id,c.room_id roomId,c.mediation_method mediationMethod,1 AS pendingStatus,c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,c.case_subject_amount caseSubjectAmount," + "union select c.id id,c.room_id roomId,c.mediation_method mediationMethod,1 AS pendingStatus,c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,c.case_subject_amount caseSubjectAmount," +
"a.application_organ_name applicationOrganName,a.respondent_name respondentName,c.mediator_name mediatorName," + "a.application_name applicationName,a.respondent_name respondentName,c.mediator_name mediatorName," +
"c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime from ms_case_log_record r " + "c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime from ms_case_log_record r " +
"join ms_case_application c on r.case_appli_id=c.id " + "join ms_case_application c on r.case_appli_id=c.id " +
"join ms_case_affiliate a on c.id=a.case_appli_id <where> r.create_by=#{req.userName} and c.id not in (" + "join ms_case_affiliate a on c.id=a.case_appli_id <where> r.create_by=#{req.userName} and c.id not in (" +
@@ -92,7 +92,7 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
" AND c1.case_num = #{req.caseNum} " + " AND c1.case_num = #{req.caseNum} " +
"</if> " + "</if> " +
"<if test=\"req.applicantFlag != null \">" + "<if test=\"req.applicantFlag != null \">" +
" AND a1.application_organ_id = #{req.applicationOrganId} " + " AND a1.application_id = #{req.applicationId} " +
"</if> " "</if> "
+ "<if test=\"req.respondentIdentityNum != null and req.respondentIdentityNum != ''\">" + + "<if test=\"req.respondentIdentityNum != null and req.respondentIdentityNum != ''\">" +
" AND a1.respondent_identity_num = #{req.respondentIdentityNum} " + " AND a1.respondent_identity_num = #{req.respondentIdentityNum} " +
@@ -126,7 +126,7 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
" AND c.case_num = #{req.caseNum} " + " AND c.case_num = #{req.caseNum} " +
"</if> " + "</if> " +
"<if test=\"req.applicantFlag != null \">" + "<if test=\"req.applicantFlag != null \">" +
" AND a.application_organ_id = #{req.applicationOrganId} " + " AND a.application_id = #{req.applicationId} " +
"</if> " "</if> "
+ "<if test=\"req.respondentIdentityNum != null and req.respondentIdentityNum != ''\">" + + "<if test=\"req.respondentIdentityNum != null and req.respondentIdentityNum != ''\">" +
" AND a.respondent_identity_num = #{req.respondentIdentityNum} " + " AND a.respondent_identity_num = #{req.respondentIdentityNum} " +
@@ -24,7 +24,4 @@ public interface FatchRuleMapper {
int insertFatchRule(FatchRule fatchRule); int insertFatchRule(FatchRule fatchRule);
List<FatchRule> selectColumnandComment(FatchRule fatchRuleselect);
FatchRule selectColumnbycomment(FatchRule fatchRule);
} }
@@ -55,9 +55,6 @@ public interface IDeptIdentifyService {
AjaxResult saveFatchRules(TemplateManage templateManage); AjaxResult saveFatchRules(TemplateManage templateManage);
List<FatchRule> selectColumnandComment();
FatchRule selectColumnbycomment(FatchRule fatchRule);
/** /**
* 根据模板id查询模板字段列表 * 根据模板id查询模板字段列表
@@ -586,21 +586,6 @@ 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;
}
/** /**
* 根据模板id查询模板字段列表 * 根据模板id查询模板字段列表
@@ -272,7 +272,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
// 保存案件相关人员 // 保存案件相关人员
if (affiliate != null) { if (affiliate != null) {
// 设置申请人 // 设置申请人
if (StrUtil.isNotEmpty(affiliate.getApplicationOrganName())) { if (StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==1) {
// 组装申请机构 // 组装申请机构
insertDept(affiliate); insertDept(affiliate);
// 新增申请机构代理人 // 新增申请机构代理人
@@ -411,7 +411,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
if (affiliate != null) { if (affiliate != null) {
affiliate.setCaseAppliId(caseApplication.getId()); affiliate.setCaseAppliId(caseApplication.getId());
// 设置申请人 // 设置申请人
if (StrUtil.isNotEmpty(affiliate.getApplicationOrganName())) { if (StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==1) {
// 组装申请机构 // 组装申请机构
insertDept(affiliate); insertDept(affiliate);
// 新增申请机构代理人 // 新增申请机构代理人
@@ -2124,20 +2124,20 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
agentUser.setNickName(affiliate.getNameAgent()); agentUser.setNickName(affiliate.getNameAgent());
agentUser.setPhonenumber(affiliate.getContactTelphoneAgent()); agentUser.setPhonenumber(affiliate.getContactTelphoneAgent());
agentUser.setPassword(SecurityUtils.encryptPassword("abc123456")); agentUser.setPassword(SecurityUtils.encryptPassword("abc123456"));
agentUser.setDeptId(Long.valueOf(affiliate.getApplicationOrganId())); agentUser.setDeptId(Long.valueOf(affiliate.getApplicationId()));
userMapper.insertUser(agentUser); userMapper.insertUser(agentUser);
userRoleMapper.insertUserRole(agentUser.getUserId(), roleId); userRoleMapper.insertUserRole(agentUser.getUserId(), roleId);
} else if (null == agentUser.getDeptId() ) { } else if (null == agentUser.getDeptId() ) {
// todo 未关联部门,关联部门 // todo 未关联部门,关联部门
agentUser.setDeptId(Long.valueOf(affiliate.getApplicationOrganId())); agentUser.setDeptId(Long.valueOf(affiliate.getApplicationId()));
userMapper.updateUser(agentUser); userMapper.updateUser(agentUser);
}else if (null != agentUser.getDeptId() && !String.valueOf(agentUser.getDeptId()).equals(affiliate.getApplicationOrganId())) { }else if (null != agentUser.getDeptId() && !String.valueOf(agentUser.getDeptId()).equals(affiliate.getApplicationId())) {
if (null != agentUser.getDept() && StrUtil.isNotEmpty(agentUser.getDept().getDeptName())) { if (null != agentUser.getDept() && StrUtil.isNotEmpty(agentUser.getDept().getDeptName())) {
throw new ServiceException("该申请代理人已在【" + agentUser.getDept().getDeptName() + "】申请机构下存在,请检查填写信息是否正确"); throw new ServiceException("该申请代理人已在【" + agentUser.getDept().getDeptName() + "】申请机构下存在,请检查填写信息是否正确");
} else { } else {
throw new ServiceException("该申请代理人已存在,与申请机构不匹配,请检查填写信息是否正确"); throw new ServiceException("该申请代理人已存在,与申请机构不匹配,请检查填写信息是否正确");
} }
} else if (null != agentUser.getDeptId() && String.valueOf(agentUser.getDeptId()).equals(affiliate.getApplicationOrganId())) { } else if (null != agentUser.getDeptId() && String.valueOf(agentUser.getDeptId()).equals(affiliate.getApplicationId())) {
// 同步用户表和案件关联人表的手机号和名称 // 同步用户表和案件关联人表的手机号和名称
affiliate.setContactTelphoneAgent(StrUtil.isNotEmpty(agentUser.getPhonenumber()) ? agentUser.getPhonenumber() : affiliate.getContactTelphoneAgent()); affiliate.setContactTelphoneAgent(StrUtil.isNotEmpty(agentUser.getPhonenumber()) ? agentUser.getPhonenumber() : affiliate.getContactTelphoneAgent());
affiliate.setNameAgent(agentUser.getNickName()); affiliate.setNameAgent(agentUser.getNickName());
@@ -2171,13 +2171,13 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
Map<String, Long> deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV)); Map<String, Long> deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV));
// 将组织机构id设为申请人名称 // 将组织机构id设为申请人名称
if (deptMap.containsKey(affiliate.getApplicationOrganName())) { if (deptMap.containsKey(affiliate.getApplicationName())) {
affiliate.setApplicationOrganId(String.valueOf(deptMap.get(affiliate.getApplicationOrganName()))); affiliate.setApplicationId(String.valueOf(deptMap.get(affiliate.getApplicationName())));
} else { } else {
// 如果不存在则新增 // 如果不存在则新增
SysDept dept = new SysDept(); SysDept dept = new SysDept();
dept.setParentId(0L); dept.setParentId(0L);
dept.setDeptName(affiliate.getApplicationOrganName()); dept.setDeptName(affiliate.getApplicationName());
dept.setAncestors("0"); dept.setAncestors("0");
dept.setOrderNum(1); dept.setOrderNum(1);
dept.setStatus("0"); dept.setStatus("0");
@@ -2186,7 +2186,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
dept.setUpdateBy(getUsername()); dept.setUpdateBy(getUsername());
sysDeptMapper.insertDept(dept); sysDeptMapper.insertDept(dept);
deptMap.put(dept.getDeptName(), dept.getDeptId()); deptMap.put(dept.getDeptName(), dept.getDeptId());
affiliate.setApplicationOrganId(String.valueOf(dept.getDeptId())); affiliate.setApplicationId(String.valueOf(dept.getDeptId()));
} }
} }
@@ -218,7 +218,7 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
} }
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.set("totalFee", totalFee); jsonObject.set("totalFee", totalFee);
jsonObject.set("applicationOrganName", affiliate.getApplicationOrganName()); jsonObject.set("applicationOrganName", affiliate.getApplicationName());
return AjaxResult.success(jsonObject); return AjaxResult.success(jsonObject);
} }
@@ -242,7 +242,7 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
result.setCaseStatusName(application.getCaseStatusName()); result.setCaseStatusName(application.getCaseStatusName());
MsCaseAffiliate affiliate = caseAffiliateMapper.selectByPrimaryKey(application.getId()); MsCaseAffiliate affiliate = caseAffiliateMapper.selectByPrimaryKey(application.getId());
if(affiliate != null) { if(affiliate != null) {
result.setApplicationOrganName(affiliate.getApplicationOrganName()); result.setApplicationOrganName(affiliate.getApplicationName());
} }
// 查询缴费单 // 查询缴费单
result.setCaseAttachList(caseAttachMapper.listCaseAttachByCaseIdAndType(id, AnnexTypeEnum.PAYMENT_RECEIPT.getCode())); result.setCaseAttachList(caseAttachMapper.listCaseAttachByCaseIdAndType(id, AnnexTypeEnum.PAYMENT_RECEIPT.getCode()));
@@ -17,9 +17,7 @@
<result column="fee_payable" jdbcType="DECIMAL" property="feePayable" /> <result column="fee_payable" jdbcType="DECIMAL" property="feePayable" />
<result column="mediator_id" jdbcType="BIGINT" property="mediatorId" /> <result column="mediator_id" jdbcType="BIGINT" property="mediatorId" />
<result column="mediator_name" jdbcType="VARCHAR" property="mediatorName" /> <result column="mediator_name" jdbcType="VARCHAR" property="mediatorName" />
<result column="is_agree_pend_tral" jdbcType="INTEGER" property="isAgreePendTral" />
<result column="pay_type" jdbcType="CHAR" property="payType" /> <result column="pay_type" jdbcType="CHAR" property="payType" />
<result column="adjudica_counter" jdbcType="INTEGER" property="adjudicaCounter" />
<result column="is_absence" jdbcType="INTEGER" property="isAbsence" /> <result column="is_absence" jdbcType="INTEGER" property="isAbsence" />
<result column="lock_status" jdbcType="INTEGER" property="lockStatus" /> <result column="lock_status" jdbcType="INTEGER" property="lockStatus" />
<result column="room_id" jdbcType="VARCHAR" property="roomId" /> <result column="room_id" jdbcType="VARCHAR" property="roomId" />
@@ -32,10 +30,7 @@
<result column="version" jdbcType="INTEGER" property="version" /> <result column="version" jdbcType="INTEGER" property="version" />
<result column="arbitrat_claims" jdbcType="LONGVARCHAR" property="arbitratClaims" /> <result column="arbitrat_claims" jdbcType="LONGVARCHAR" property="arbitratClaims" />
<result column="facts" jdbcType="LONGVARCHAR" property="facts" /> <result column="facts" jdbcType="LONGVARCHAR" property="facts" />
<result column="request_rule" jdbcType="LONGVARCHAR" property="requestRule" />
<result column="case_describe" jdbcType="LONGVARCHAR" property="caseDescribe" />
<result column="mediation_url" jdbcType="LONGVARCHAR" property="mediationUrl" /> <result column="mediation_url" jdbcType="LONGVARCHAR" property="mediationUrl" />
<result column="adjudica_counter_reason" jdbcType="LONGVARCHAR" property="adjudicaCounterReason" />
<result column="mediation_agreement" jdbcType="LONGVARCHAR" property="mediationAgreement" /> <result column="mediation_agreement" jdbcType="LONGVARCHAR" property="mediationAgreement" />
</resultMap> </resultMap>
@@ -36,39 +36,6 @@
</where> </where>
</select> </select>
<select id="selectColumnandComment" parameterType="com.ruoyi.wisdomarbitrate.domain.dto.template.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="com.ruoyi.wisdomarbitrate.domain.dto.template.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="com.ruoyi.wisdomarbitrate.domain.dto.template.FatchRule" resultMap="BaseResultMap"> <select id="selectFatchRuleListIsDefault" parameterType="com.ruoyi.wisdomarbitrate.domain.dto.template.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`