新增导入立案修改

This commit is contained in:
18792927508
2023-10-10 19:23:27 +08:00
parent f0f65d0cf0
commit e1422ce1c8
5 changed files with 108 additions and 32 deletions
@@ -25,6 +25,15 @@ public class CaseLogRecord extends BaseEntity {
/** 案件编号 */
private String caseNum;
/**
* 展示的内容
*/
private String content;
/**
* 用户昵称
*/
private String nickName;
public String getCaseNum() {
return caseNum;
@@ -73,4 +82,24 @@ public class CaseLogRecord extends BaseEntity {
public void setNotes(String notes) {
this.notes = notes;
}
public void setCaseNode(Integer caseNode) {
this.caseNode = caseNode;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
}
@@ -2,6 +2,7 @@ package com.ruoyi.wisdomarbitrate.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.constant.CaseApplicationConstants;
import com.ruoyi.common.core.domain.entity.SysDept;
@@ -69,34 +70,38 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
int rows = caseApplicationMapper.insertCaseApplication(caseApplication);
List<CaseAffiliate> caseAffiliates = caseApplication.getCaseAffiliates();
Map<String, Long> deptMap =new HashMap<>();
if (caseAffiliates != null && caseAffiliates.size() > 0) {
// 查询所有的组织机构,组装成map
List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
if (CollectionUtil.isEmpty(deptList)) {
deptList = new ArrayList<>();
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));
}
Map<String, Long> deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId));
for (CaseAffiliate caseAffiliate : caseAffiliates) {
caseAffiliate.setCaseAppliId(caseApplication.getId());
// 将组织机构id设为申请人名称
if (deptMap.containsKey(caseApplication.getName())) {
caseAffiliate.setName(String.valueOf(deptMap.get(caseApplication.getName())));
} else {
// 如果不存在则新增
SysDept dept = new SysDept();
dept.setParentId(0L);
dept.setDeptName(caseApplication.getName());
dept.setAncestors("0");
dept.setOrderNum(1);
dept.setStatus("0");
dept.setDelFlag("0");
dept.setCreateBy(getUsername());
dept.setUpdateBy(getUsername());
sysDeptMapper.insertDept(dept);
caseAffiliate.setName(String.valueOf(dept.getDeptId()));
if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseApplication.getName())) {
// 将组织机构id设为申请人名称
if (deptMap.containsKey(caseApplication.getName())) {
caseAffiliate.setName(String.valueOf(deptMap.get(caseApplication.getName())));
} else {
// 如果不存在则新增
SysDept dept = new SysDept();
dept.setParentId(0L);
dept.setDeptName(caseApplication.getName());
dept.setAncestors("0");
dept.setOrderNum(1);
dept.setStatus("0");
dept.setDelFlag("0");
dept.setCreateBy(getUsername());
dept.setUpdateBy(getUsername());
sysDeptMapper.insertDept(dept);
deptMap.put(dept.getDeptName(), dept.getDeptId());
caseAffiliate.setName(String.valueOf(dept.getDeptId()));
}
}
}
@@ -582,7 +587,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
BeanUtils.copyBeanProp(caseAffiliate,caseApplication);
caseAffiliate.setIdentityType(1);
// 申请人(机构),需要判断部门中是否存在,不存在则新增,当身份类型为1的时候,查询时需要根据名称查询组织机构
setApplicantOrganization(caseAffiliate,caseApplication,deptList);
if(StrUtil.isNotEmpty(caseApplication.getName())){
setApplicantOrganization(caseAffiliate, caseApplication, deptList);
}
caseAffiliatesnew.add(caseAffiliate);
// 组装被申请人信息
@@ -615,6 +622,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
dept.setCreateBy(getUsername());
dept.setUpdateBy(getUsername());
sysDeptMapper.insertDept(dept);
deptMap.put(dept.getDeptName(),dept.getDeptId());
caseAffiliate.setName(String.valueOf(dept.getDeptId()));
}
@@ -1,5 +1,7 @@
package com.ruoyi.wisdomarbitrate.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord;
import com.ruoyi.wisdomarbitrate.mapper.CaseLogRecordMapper;
import com.ruoyi.wisdomarbitrate.service.ICaseLogRecordService;
@@ -16,7 +18,43 @@ public class CaseLogRecordServiceImpl implements ICaseLogRecordService {
@Override
public List<CaseLogRecord> selectCaseLogRecordList(CaseLogRecord caseLogRecord) {
return caseLogRecordMapper.selectCaseLogRecordList(caseLogRecord);
List<CaseLogRecord> records = caseLogRecordMapper.selectCaseLogRecordList(caseLogRecord);
if(CollectionUtil.isNotEmpty(records)){
records.forEach(record->{
StringBuilder contentBuilder = new StringBuilder();
if(StrUtil.isNotEmpty(record.getNickName())) {
contentBuilder.append(record.getNickName());
}
contentBuilder.append("于").append(record.getCaseNodeTime());
switch(record.getCaseNode()){
case 0:
contentBuilder.append("创建立案申请");
break;
case 1:
contentBuilder.append("提交立案申请");
break;
case 2:
contentBuilder.append("提交立案审查");
break;
case 3:
contentBuilder.append("创建立案申请");
break;
case 4:
contentBuilder.append("缴费成功");
case 5:
contentBuilder.append("缴费成功");
case 6:
contentBuilder.append("缴费成功");
case 7:
contentBuilder.append("缴费成功");
case 8:
contentBuilder.append("缴费成功");
break;
}
});
}
return records;
}