申请机构修改

This commit is contained in:
18792927508
2024-01-29 11:50:56 +08:00
parent 695405ac03
commit fb349f1983
12 changed files with 37 additions and 131 deletions
@@ -201,25 +201,7 @@ public class DeptIdentifyController extends BaseController {
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查询模板字段列表
@@ -51,6 +51,9 @@ public class MsCaseApplicationController extends BaseController {
@PostMapping("/insert")
public AjaxResult insert(@RequestBody MsCaseApplicationVO caseApplication )
{
if(caseApplication.getAffiliate()==null||caseApplication.getAffiliate().getOrganizeFlag()==null){
error("参数校验失败");
}
return success(caseApplicationService.insert(caseApplication));
}
@@ -20,24 +20,30 @@ public class MsCaseAffiliate {
@Id
@Column(name = "case_appli_id")
private Long caseAppliId;
/**
* 是否机构申请,0-自然人,1-申请机构,默认0
*/
@Column(name = "organize_flag")
private Integer organizeFlag;
/**
* 申请机构
* 申请人id
*/
@Column(name = "application_organ_id")
private String applicationOrganId;
@Column(name = "application_id")
private String applicationId;
/**
* 申请机构名称
* 申请人名称
*/
@Column(name = "application_organ_name")
private String applicationOrganName;
@Column(name = "application_name")
private String applicationName;
/**
* 统一社会信用代码
* 代码(统一社会信用代码或者身份证号)
*/
@Column(name = "credit_code")
private String creditCode;
@Column(name = "code")
private String code;
/**
* 法定代表人
@@ -51,7 +51,7 @@ public class MsCaseApplication {
private BigDecimal caseSubjectAmount;
/**
* 调解方式,1-开庭调解,2-书面调解
* 调解方式,1-线上调解,2-线下调解
*/
@Column(name = "mediation_method")
private String mediationMethod;
@@ -92,23 +92,12 @@ public class MsCaseApplication {
@Column(name = "mediator_name")
private String mediatorName;
/**
* 是否同意组庭,0否,1是
*/
@Column(name = "is_agree_pend_tral")
private Integer isAgreePendTral;
/**
* 支付方式(0线上支付,1线下支付)
*/
@Column(name = "pay_type")
private String payType;
/**
* 是否仲裁反请求,1是,0否
*/
@Column(name = "adjudica_counter")
private Integer adjudicaCounter;
/**
* 被申请人是否缺席,1是,0否
@@ -192,17 +181,6 @@ public class MsCaseApplication {
*/
private String facts;
/**
* 申请人请求仲裁庭裁决
*/
@Column(name = "request_rule")
private String requestRule;
/**
* 案件描述
*/
@Column(name = "case_describe")
private String caseDescribe;
/**
* 调解书URL
@@ -210,11 +188,7 @@ public class MsCaseApplication {
@Column(name = "mediation_url")
private String mediationUrl;
/**
* 仲裁反请求原因
*/
@Column(name = "adjudica_counter_reason")
private String adjudicaCounterReason;
/**
* 调解内容
@@ -35,7 +35,7 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
* @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," +
"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 " +
"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" +
@@ -54,7 +54,7 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
"</if> " +
"<if test=\"req.applicantFlag != null \">" +
" AND a.application_organ_id = #{req.applicationOrganId} " +
" AND a.application_id = #{req.applicationId} " +
"</if> "
+ "<if test=\"req.respondentIdentityNum != null and 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>" +
" </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," +
"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 " +
"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 (" +
@@ -92,7 +92,7 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
" AND c1.case_num = #{req.caseNum} " +
"</if> " +
"<if test=\"req.applicantFlag != null \">" +
" AND a1.application_organ_id = #{req.applicationOrganId} " +
" AND a1.application_id = #{req.applicationId} " +
"</if> "
+ "<if test=\"req.respondentIdentityNum != null and 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} " +
"</if> " +
"<if test=\"req.applicantFlag != null \">" +
" AND a.application_organ_id = #{req.applicationOrganId} " +
" AND a.application_id = #{req.applicationId} " +
"</if> "
+ "<if test=\"req.respondentIdentityNum != null and req.respondentIdentityNum != ''\">" +
" AND a.respondent_identity_num = #{req.respondentIdentityNum} " +
@@ -24,7 +24,4 @@ public interface FatchRuleMapper {
int insertFatchRule(FatchRule fatchRule);
List<FatchRule> selectColumnandComment(FatchRule fatchRuleselect);
FatchRule selectColumnbycomment(FatchRule fatchRule);
}
@@ -55,9 +55,6 @@ public interface IDeptIdentifyService {
AjaxResult saveFatchRules(TemplateManage templateManage);
List<FatchRule> selectColumnandComment();
FatchRule selectColumnbycomment(FatchRule fatchRule);
/**
* 根据模板id查询模板字段列表
@@ -586,21 +586,6 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
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查询模板字段列表
@@ -272,7 +272,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
// 保存案件相关人员
if (affiliate != null) {
// 设置申请人
if (StrUtil.isNotEmpty(affiliate.getApplicationOrganName())) {
if (StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==1) {
// 组装申请机构
insertDept(affiliate);
// 新增申请机构代理人
@@ -411,7 +411,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
if (affiliate != null) {
affiliate.setCaseAppliId(caseApplication.getId());
// 设置申请人
if (StrUtil.isNotEmpty(affiliate.getApplicationOrganName())) {
if (StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==1) {
// 组装申请机构
insertDept(affiliate);
// 新增申请机构代理人
@@ -2124,20 +2124,20 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
agentUser.setNickName(affiliate.getNameAgent());
agentUser.setPhonenumber(affiliate.getContactTelphoneAgent());
agentUser.setPassword(SecurityUtils.encryptPassword("abc123456"));
agentUser.setDeptId(Long.valueOf(affiliate.getApplicationOrganId()));
agentUser.setDeptId(Long.valueOf(affiliate.getApplicationId()));
userMapper.insertUser(agentUser);
userRoleMapper.insertUserRole(agentUser.getUserId(), roleId);
} else if (null == agentUser.getDeptId() ) {
// todo 未关联部门,关联部门
agentUser.setDeptId(Long.valueOf(affiliate.getApplicationOrganId()));
agentUser.setDeptId(Long.valueOf(affiliate.getApplicationId()));
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())) {
throw new ServiceException("该申请代理人已在【" + agentUser.getDept().getDeptName() + "】申请机构下存在,请检查填写信息是否正确");
} else {
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.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));
// 将组织机构id设为申请人名称
if (deptMap.containsKey(affiliate.getApplicationOrganName())) {
affiliate.setApplicationOrganId(String.valueOf(deptMap.get(affiliate.getApplicationOrganName())));
if (deptMap.containsKey(affiliate.getApplicationName())) {
affiliate.setApplicationId(String.valueOf(deptMap.get(affiliate.getApplicationName())));
} else {
// 如果不存在则新增
SysDept dept = new SysDept();
dept.setParentId(0L);
dept.setDeptName(affiliate.getApplicationOrganName());
dept.setDeptName(affiliate.getApplicationName());
dept.setAncestors("0");
dept.setOrderNum(1);
dept.setStatus("0");
@@ -2186,7 +2186,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
dept.setUpdateBy(getUsername());
sysDeptMapper.insertDept(dept);
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.set("totalFee", totalFee);
jsonObject.set("applicationOrganName", affiliate.getApplicationOrganName());
jsonObject.set("applicationOrganName", affiliate.getApplicationName());
return AjaxResult.success(jsonObject);
}
@@ -242,7 +242,7 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
result.setCaseStatusName(application.getCaseStatusName());
MsCaseAffiliate affiliate = caseAffiliateMapper.selectByPrimaryKey(application.getId());
if(affiliate != null) {
result.setApplicationOrganName(affiliate.getApplicationOrganName());
result.setApplicationOrganName(affiliate.getApplicationName());
}
// 查询缴费单
result.setCaseAttachList(caseAttachMapper.listCaseAttachByCaseIdAndType(id, AnnexTypeEnum.PAYMENT_RECEIPT.getCode()));
@@ -17,9 +17,7 @@
<result column="fee_payable" jdbcType="DECIMAL" property="feePayable" />
<result column="mediator_id" jdbcType="BIGINT" property="mediatorId" />
<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="adjudica_counter" jdbcType="INTEGER" property="adjudicaCounter" />
<result column="is_absence" jdbcType="INTEGER" property="isAbsence" />
<result column="lock_status" jdbcType="INTEGER" property="lockStatus" />
<result column="room_id" jdbcType="VARCHAR" property="roomId" />
@@ -32,10 +30,7 @@
<result column="version" jdbcType="INTEGER" property="version" />
<result column="arbitrat_claims" jdbcType="LONGVARCHAR" property="arbitratClaims" />
<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="adjudica_counter_reason" jdbcType="LONGVARCHAR" property="adjudicaCounterReason" />
<result column="mediation_agreement" jdbcType="LONGVARCHAR" property="mediationAgreement" />
</resultMap>
@@ -36,39 +36,6 @@
</where>
</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 f.id ,f.file_name ,f.start_content ,f.end_content ,
f.`column` ,f.is_default ,f.`column_name`