查询组织机构修改
This commit is contained in:
+2
-4
@@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.web.controller.wisdomarbitrate;
|
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.ruoyi.common.annotation.Anonymous;
|
import com.ruoyi.common.annotation.Anonymous;
|
||||||
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
@@ -47,10 +48,7 @@ public class CaseApplicationController extends BaseController {
|
|||||||
@PostMapping("/addCaseApplication")
|
@PostMapping("/addCaseApplication")
|
||||||
public AjaxResult addCaseApplication(@Validated @RequestBody CaseApplication caseApplication)
|
public AjaxResult addCaseApplication(@Validated @RequestBody CaseApplication caseApplication)
|
||||||
{
|
{
|
||||||
int caseApplicationCount = caseApplicationService.selectCaseApplicationCount(caseApplication);
|
|
||||||
if(caseApplicationCount>0){
|
|
||||||
return error("新增立案申请'" + caseApplication.getCaseNum() + "'案件编号已存在");
|
|
||||||
}
|
|
||||||
caseApplication.setCreateBy(getUsername());
|
caseApplication.setCreateBy(getUsername());
|
||||||
return toAjax(caseApplicationService.insertcaseApplication(caseApplication));
|
return toAjax(caseApplicationService.insertcaseApplication(caseApplication));
|
||||||
}
|
}
|
||||||
|
|||||||
+17
-7
@@ -72,25 +72,24 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
List<CaseAffiliate> caseAffiliates = caseApplication.getCaseAffiliates();
|
List<CaseAffiliate> caseAffiliates = caseApplication.getCaseAffiliates();
|
||||||
Map<String, Long> deptMap =new HashMap<>();
|
Map<String, Long> deptMap =new HashMap<>();
|
||||||
if (caseAffiliates != null && caseAffiliates.size() > 0) {
|
if (caseAffiliates != null && caseAffiliates.size() > 0) {
|
||||||
if(StrUtil.isNotEmpty(caseApplication.getName())) {
|
|
||||||
// 查询所有的组织机构,组装成map
|
// 查询所有的组织机构,组装成map
|
||||||
List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
|
List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
|
||||||
if (CollectionUtil.isEmpty(deptList)) {
|
if (CollectionUtil.isEmpty(deptList)) {
|
||||||
deptList = new ArrayList<>();
|
deptList = new ArrayList<>();
|
||||||
}
|
}
|
||||||
deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId));
|
deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId,(oldV,newV)->newV));
|
||||||
}
|
|
||||||
for (CaseAffiliate caseAffiliate : caseAffiliates) {
|
for (CaseAffiliate caseAffiliate : caseAffiliates) {
|
||||||
caseAffiliate.setCaseAppliId(caseApplication.getId());
|
caseAffiliate.setCaseAppliId(caseApplication.getId());
|
||||||
if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseApplication.getName())) {
|
if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) {
|
||||||
// 将组织机构id设为申请人名称
|
// 将组织机构id设为申请人名称
|
||||||
if (deptMap.containsKey(caseApplication.getName())) {
|
if (deptMap.containsKey(caseApplication.getName())) {
|
||||||
caseAffiliate.setName(String.valueOf(deptMap.get(caseApplication.getName())));
|
caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName())));
|
||||||
} else {
|
} else {
|
||||||
// 如果不存在则新增
|
// 如果不存在则新增
|
||||||
SysDept dept = new SysDept();
|
SysDept dept = new SysDept();
|
||||||
dept.setParentId(0L);
|
dept.setParentId(0L);
|
||||||
dept.setDeptName(caseApplication.getName());
|
dept.setDeptName(caseAffiliate.getName());
|
||||||
dept.setAncestors("0");
|
dept.setAncestors("0");
|
||||||
dept.setOrderNum(1);
|
dept.setOrderNum(1);
|
||||||
dept.setStatus("0");
|
dept.setStatus("0");
|
||||||
@@ -227,12 +226,23 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
|
|
||||||
List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
||||||
if(caseAffiliatListeselect!=null){
|
if(caseAffiliatListeselect!=null){
|
||||||
|
// 查询组织机构
|
||||||
|
List<SysDept> sysDepts = sysDeptMapper.selectDeptList(new SysDept());
|
||||||
|
Map<String,String> deptMap=new HashMap<>();
|
||||||
|
if(CollectionUtil.isNotEmpty(sysDepts)){
|
||||||
|
for (SysDept sysDept : sysDepts) {
|
||||||
|
deptMap.put(String.valueOf(sysDept.getDeptId()),sysDept.getDeptName());
|
||||||
|
}
|
||||||
|
}
|
||||||
StringBuffer applicantName = new StringBuffer();
|
StringBuffer applicantName = new StringBuffer();
|
||||||
StringBuffer respondentName = new StringBuffer();
|
StringBuffer respondentName = new StringBuffer();
|
||||||
for (int i = 0; i < caseAffiliatListeselect.size(); i++){
|
for (int i = 0; i < caseAffiliatListeselect.size(); i++){
|
||||||
CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i);
|
CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i);
|
||||||
int identityType = caseAffiliateselect.getIdentityType();
|
int identityType = caseAffiliateselect.getIdentityType();
|
||||||
if(identityType==1){
|
if(identityType==1){
|
||||||
|
if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){
|
||||||
|
caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName()));
|
||||||
|
}
|
||||||
applicantName.append(caseAffiliateselect.getName()).append(",");;
|
applicantName.append(caseAffiliateselect.getName()).append(",");;
|
||||||
}else if(identityType==2){
|
}else if(identityType==2){
|
||||||
respondentName.append(caseAffiliateselect.getName()).append(",");;
|
respondentName.append(caseAffiliateselect.getName()).append(",");;
|
||||||
@@ -258,7 +268,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
|
List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
|
||||||
Map<String, Long> deptMap =new HashMap<>();
|
Map<String, Long> deptMap =new HashMap<>();
|
||||||
if(CollectionUtil.isNotEmpty(deptList)) {
|
if(CollectionUtil.isNotEmpty(deptList)) {
|
||||||
deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId));
|
deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId,(oldV,newV)->newV));
|
||||||
}
|
}
|
||||||
List<CaseApplication> caseApplicationListinsert = new ArrayList<>();
|
List<CaseApplication> caseApplicationListinsert = new ArrayList<>();
|
||||||
for (int i = 0; i < caseApplicationList.size(); i++){
|
for (int i = 0; i < caseApplicationList.size(); i++){
|
||||||
|
|||||||
@@ -55,10 +55,10 @@
|
|||||||
c.hear_date ,c.arbitrat_claims ,
|
c.hear_date ,c.arbitrat_claims ,
|
||||||
c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
|
c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
|
||||||
c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
|
c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
|
||||||
c.update_by ,c.update_time , c.arbitrator_name,d.dept_name as name
|
c.update_by ,c.update_time , c.arbitrator_name,d.dept_name as applicantName
|
||||||
from case_application c
|
from case_application c
|
||||||
LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
|
LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
|
||||||
LEFT JOIN sys_dept d ON ca.NAME = d.dept_id
|
LEFT JOIN sys_dept d ON ca.NAME = d.dept_id and ca.name=d.dept_id
|
||||||
<where>
|
<where>
|
||||||
<if test="caseStatus != null">
|
<if test="caseStatus != null">
|
||||||
AND c.case_status = #{caseStatus}
|
AND c.case_status = #{caseStatus}
|
||||||
@@ -206,8 +206,10 @@
|
|||||||
c.hear_date ,c.arbitrat_claims ,
|
c.hear_date ,c.arbitrat_claims ,
|
||||||
c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
|
c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
|
||||||
c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
|
c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
|
||||||
c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name
|
c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,d.dept_name as applicantName
|
||||||
from case_application c
|
from case_application c
|
||||||
|
LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
|
||||||
|
LEFT JOIN sys_dept d ON ca.NAME = d.dept_id and ca.name=d.dept_id
|
||||||
<where>
|
<where>
|
||||||
<if test="id != null ">
|
<if test="id != null ">
|
||||||
AND c.id = #{id}
|
AND c.id = #{id}
|
||||||
@@ -236,8 +238,10 @@
|
|||||||
p.payment_status ,
|
p.payment_status ,
|
||||||
CASE p.payment_status when 1 then '已支付' when 0 then '未支付'
|
CASE p.payment_status when 1 then '已支付' when 0 then '未支付'
|
||||||
ELSE '无支付状态'
|
ELSE '无支付状态'
|
||||||
END paymentStatusName
|
END paymentStatusName,d.dept_name as applicantName
|
||||||
from case_application c left join case_payment_record p on c.id = p.case_id
|
from case_application c left join case_payment_record p on c.id = p.case_id
|
||||||
|
LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
|
||||||
|
LEFT JOIN sys_dept d ON ca.NAME = d.dept_id and ca.name=d.dept_id
|
||||||
where c.case_status = 3 and p.payment_status = 1
|
where c.case_status = 3 and p.payment_status = 1
|
||||||
AND c.id = #{id}
|
AND c.id = #{id}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user