查询组织机构修改
This commit is contained in:
+17
-7
@@ -72,25 +72,24 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
List<CaseAffiliate> caseAffiliates = caseApplication.getCaseAffiliates();
|
||||
Map<String, Long> deptMap =new HashMap<>();
|
||||
if (caseAffiliates != null && caseAffiliates.size() > 0) {
|
||||
if(StrUtil.isNotEmpty(caseApplication.getName())) {
|
||||
// 查询所有的组织机构,组装成map
|
||||
List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
|
||||
if (CollectionUtil.isEmpty(deptList)) {
|
||||
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) {
|
||||
caseAffiliate.setCaseAppliId(caseApplication.getId());
|
||||
if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseApplication.getName())) {
|
||||
if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) {
|
||||
// 将组织机构id设为申请人名称
|
||||
if (deptMap.containsKey(caseApplication.getName())) {
|
||||
caseAffiliate.setName(String.valueOf(deptMap.get(caseApplication.getName())));
|
||||
caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName())));
|
||||
} else {
|
||||
// 如果不存在则新增
|
||||
SysDept dept = new SysDept();
|
||||
dept.setParentId(0L);
|
||||
dept.setDeptName(caseApplication.getName());
|
||||
dept.setDeptName(caseAffiliate.getName());
|
||||
dept.setAncestors("0");
|
||||
dept.setOrderNum(1);
|
||||
dept.setStatus("0");
|
||||
@@ -227,12 +226,23 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
|
||||
List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
||||
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 respondentName = new StringBuffer();
|
||||
for (int i = 0; i < caseAffiliatListeselect.size(); i++){
|
||||
CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i);
|
||||
int identityType = caseAffiliateselect.getIdentityType();
|
||||
if(identityType==1){
|
||||
if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){
|
||||
caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName()));
|
||||
}
|
||||
applicantName.append(caseAffiliateselect.getName()).append(",");;
|
||||
}else if(identityType==2){
|
||||
respondentName.append(caseAffiliateselect.getName()).append(",");;
|
||||
@@ -258,7 +268,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
|
||||
Map<String, Long> deptMap =new HashMap<>();
|
||||
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<>();
|
||||
for (int i = 0; i < caseApplicationList.size(); i++){
|
||||
|
||||
@@ -55,10 +55,10 @@
|
||||
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.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
|
||||
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>
|
||||
<if test="caseStatus != null">
|
||||
AND c.case_status = #{caseStatus}
|
||||
@@ -206,8 +206,10 @@
|
||||
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.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
|
||||
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>
|
||||
<if test="id != null ">
|
||||
AND c.id = #{id}
|
||||
@@ -236,8 +238,10 @@
|
||||
p.payment_status ,
|
||||
CASE p.payment_status when 1 then '已支付' when 0 then '未支付'
|
||||
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
|
||||
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
|
||||
AND c.id = #{id}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user