Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Mediation-Backend into qtz1
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package com.ruoyi.system.domain.vo.flow;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Data
|
||||
public class MsBaseCaseFlow {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 顺序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 案件状态名称
|
||||
*/
|
||||
private String caseStatusName;
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.ruoyi.system.mapper.flow;
|
||||
|
||||
import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
|
||||
import com.ruoyi.system.domain.vo.flow.MsBaseCaseFlow;
|
||||
import com.ruoyi.system.domain.vo.flow.MsCaseFlowVO;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
@@ -25,4 +26,7 @@ public interface MsCaseFlowMapper extends Mapper<MsCaseFlow> {
|
||||
|
||||
@Select("SELECT r.role_name as roleName ,f.node_name as nodeName ,f.case_status_name as caseStatusName FROM ms_case_flow f left join ms_case_flow_role_related fr on f.id = fr.flow_id left join ms_sys_role r on fr.roleid = r.role_id WHERE f.id = #{caseFlowId} ")
|
||||
List<MsCaseFlowVO> selectFlowRole(Integer caseFlowId);
|
||||
@Select("select f1.id,f1.case_status_name caseStatusName,f1.sort from ms_case_flow f1 order by f1.sort")
|
||||
|
||||
List<MsBaseCaseFlow> selectCaseFlow();
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.system.service.flow;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.system.domain.vo.flow.MsCaseFlowSearchVO;
|
||||
import com.ruoyi.system.domain.vo.flow.MsCaseFlowVO;
|
||||
|
||||
@@ -12,6 +13,11 @@ public interface CaseFlowService {
|
||||
* @return
|
||||
*/
|
||||
Object queryCaseFlowInfo(MsCaseFlowSearchVO caseFlowSearchVO);
|
||||
/**
|
||||
* 查询案件流程信息
|
||||
* @return
|
||||
*/
|
||||
AjaxResult selectCaseFlow();
|
||||
|
||||
/**
|
||||
* 新增或编辑案件流程节点信息
|
||||
@@ -40,4 +46,6 @@ public interface CaseFlowService {
|
||||
* @return
|
||||
*/
|
||||
Set<Integer> getCaseStatusIdByRoleKey(Set<String> roles);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,10 +2,12 @@ package com.ruoyi.system.service.flow;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
|
||||
import com.ruoyi.system.domain.entity.flow.MsCaseFlowRoleRelated;
|
||||
import com.ruoyi.system.domain.vo.flow.MsBaseCaseFlow;
|
||||
import com.ruoyi.system.domain.vo.flow.MsCaseFlowSearchVO;
|
||||
import com.ruoyi.system.domain.vo.flow.MsCaseFlowVO;
|
||||
import com.ruoyi.system.mapper.SysRoleMapper;
|
||||
@@ -95,6 +97,12 @@ public class CaseFlowServiceImpl implements CaseFlowService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult selectCaseFlow() {
|
||||
List<MsBaseCaseFlow> caseFlows = msCaseFlowMapper.selectCaseFlow();
|
||||
return AjaxResult.success(caseFlows);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询流程信息相关的角色信息
|
||||
*
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.domain.entity.SysUserDept;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.bean.BeanValidators;
|
||||
@@ -241,6 +242,8 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||
@Transactional
|
||||
public AjaxResult insertUser(SysUser user) {
|
||||
// 新增用户信息
|
||||
user.setCreateBy("admin");
|
||||
user.setCreateTime(DateUtils.getNowDate());
|
||||
int rows = userMapper.insertUser(user);
|
||||
// 新增用户部门关联
|
||||
if(CollectionUtil.isNotEmpty(user.getDeptIds())) {
|
||||
|
||||
+24
-1
@@ -1,7 +1,6 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.dto.miniprogress;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -20,6 +19,14 @@ public class IdentityAuthentication extends BaseEntity {
|
||||
private String name;
|
||||
/** 身份证号 */
|
||||
private String identityNo;
|
||||
/**
|
||||
* 身份类别,0-身份证,1-护照,默认0
|
||||
*/
|
||||
private Integer idType;
|
||||
/**
|
||||
* 国籍,0-国内,1-国外,默认0
|
||||
*/
|
||||
private Integer nationality;
|
||||
/**
|
||||
* 短信验证码
|
||||
*/
|
||||
@@ -104,6 +111,22 @@ public class IdentityAuthentication extends BaseEntity {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public Integer getIdType() {
|
||||
return idType;
|
||||
}
|
||||
|
||||
public void setIdType(Integer idType) {
|
||||
this.idType = idType;
|
||||
}
|
||||
|
||||
public Integer getNationality() {
|
||||
return nationality;
|
||||
}
|
||||
|
||||
public void setNationality(Integer nationality) {
|
||||
this.nationality = nationality;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
+10
@@ -154,4 +154,14 @@ public class MsCaseAffiliate {
|
||||
*/
|
||||
@Column(name = "is_sign_respon")
|
||||
private Integer isSignRespon;
|
||||
/**
|
||||
* 身份类别,0-身份证,1-护照,默认0
|
||||
*/
|
||||
@Column(name = "id_type")
|
||||
private Integer idType;
|
||||
/**
|
||||
* 国籍,0-国内,1-国外,默认0
|
||||
*/
|
||||
@Column(name = "nationality")
|
||||
private Integer nationality;
|
||||
}
|
||||
+7
-1
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
|
||||
@@ -7,6 +8,7 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -77,6 +79,10 @@ public class MsCaseApplicationVO extends MsCaseApplication {
|
||||
* 签名按钮显示,0-显示,1-不显示
|
||||
*/
|
||||
private Integer signButtonFlag;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
|
||||
private Date endTime;
|
||||
|
||||
}
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Classname MsCaseBatchInsertVO
|
||||
* @Description 批量新增案件
|
||||
* @Version 1.0.0
|
||||
* @Date 2024/3/11 10:04
|
||||
* @Created wangqiong
|
||||
*/
|
||||
@Data
|
||||
public class MsCaseBatchInsertVO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private List<MsCaseApplicationVO> list;
|
||||
}
|
||||
+10
@@ -6,6 +6,7 @@ import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface MsCaseLogRecordMapper extends Mapper<MsCaseLogRecord> {
|
||||
@@ -33,4 +34,13 @@ public interface MsCaseLogRecordMapper extends Mapper<MsCaseLogRecord> {
|
||||
|
||||
@Select("SELECT group_concat( DISTINCT t.createNickName) createNickName,t.nodeName content,t.nodeId,t.sort ,t.caseStatusName FROM (SELECT l.create_nick_name createNickName ,f.node_name nodeName,f.node_id nodeId, f.sort, f.case_status_name caseStatusName FROM ms_case_log_record l left join ms_case_flow f on l.case_node = f.node_id WHERE l.case_appli_id = #{caseAppliId} and f.node_name is not null ) t group by t.nodeName,t.nodeId,t.sort ,t.caseStatusName order by t.sort ")
|
||||
List<MsCaseLogRecordVO> selectCaseLogRecordListCaseProgress(Long caseAppliId);
|
||||
|
||||
/**
|
||||
* 根据案件id查询结束时间
|
||||
* @param caseAppliId
|
||||
* @param caseStatusName
|
||||
* @return
|
||||
*/
|
||||
@Select("SELECT create_time endTime FROM ms_case_log_record where case_appli_id=#{caseAppliId} and case_status_name=#{caseStatusName} order by create_time desc limit 1")
|
||||
Date selectEndTimeByCaseId(@Param("caseAppliId") Long caseAppliId, @Param("caseStatusName") String caseStatusName);
|
||||
}
|
||||
+2
@@ -161,6 +161,8 @@ public class WeChatUserServiceImpl implements WeChatUserService {
|
||||
sysUser.setPhonenumber(ientityAuthentication.getPhone());
|
||||
sysUser.setEmail(ientityAuthentication.getEmail());
|
||||
sysUser.setCreateBy(ientityAuthentication.getUserName());
|
||||
sysUser.setIdType(ientityAuthentication.getIdType());
|
||||
sysUser.setNationality(ientityAuthentication.getNationality());
|
||||
sysUser.setPassword(SecurityUtils.encryptPassword(ientityAuthentication.getPassWord()));
|
||||
int row = sysUserMapper.insertUser(sysUser);
|
||||
if(row<1) {
|
||||
|
||||
+16
-2
@@ -40,14 +40,27 @@ public interface MsCaseApplicationService {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
MsCaseApplicationVO selectById(Long id);
|
||||
MsCaseApplicationVO selectById(Long id ,String caseNum );
|
||||
|
||||
/**
|
||||
* 新增案件
|
||||
* @param caseApplication
|
||||
* @return
|
||||
*/
|
||||
int insert(MsCaseApplicationVO caseApplication);
|
||||
String insert(MsCaseApplicationVO caseApplication);
|
||||
|
||||
/**
|
||||
* 新增案件
|
||||
* @param caseApplication
|
||||
* @param caseFlow
|
||||
*/
|
||||
String insert(MsCaseApplicationVO caseApplication, MsCaseFlow caseFlow);
|
||||
/**
|
||||
* 批量新增案件
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
AjaxResult batchInsert(MsCaseBatchInsertVO vo);
|
||||
/**
|
||||
* 新增用户
|
||||
* @param affiliate
|
||||
@@ -243,4 +256,5 @@ public interface MsCaseApplicationService {
|
||||
*/
|
||||
List<SmsSendRecord> getSmsSendRecord(SmsSendRecord smsSendRecord);
|
||||
|
||||
|
||||
}
|
||||
|
||||
+161
-72
@@ -158,22 +158,20 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
*/
|
||||
@Override
|
||||
public List<MsCaseApplicationVO> list(MsCaseApplicationReq req) {
|
||||
// admin查询所有案件
|
||||
if (StrUtil.equals(SecurityUtils.getUsername(), "admin")) {
|
||||
startPage();
|
||||
List<MsCaseApplicationVO> list = msCaseApplicationMapper.list(req, null);
|
||||
for (MsCaseApplicationVO vo : list) {
|
||||
vo.setSignButtonFlag(0);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
// 根据用户查询角色
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
// 根据id查询用户
|
||||
SysUser sysUser = sysUserMapper.selectUserById(loginUser.getUserId());
|
||||
List<SysRole> roles = loginUser.getUser().getRoles();
|
||||
if (CollectionUtil.isEmpty(roles)) {
|
||||
throw new ServiceException("该用户未指定角色");
|
||||
if (StrUtil.equals(SecurityUtils.getUsername(), "admin")||CollectionUtil.isEmpty(roles)) {
|
||||
// 如果角色为空,按admin处理,查所有案件
|
||||
startPage();
|
||||
List<MsCaseApplicationVO> list = msCaseApplicationMapper.list(req, null);
|
||||
for (MsCaseApplicationVO vo : list) {
|
||||
vo.setSignButtonFlag(0);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
req.setUserName(SecurityUtils.getUsername());
|
||||
req.setContactTelphoneAgent(sysUser.getPhonenumber());
|
||||
@@ -353,10 +351,29 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据案件id或者案件编号查询详情
|
||||
* @param id
|
||||
* @param caseNum
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public MsCaseApplicationVO selectById(Long id) {
|
||||
public MsCaseApplicationVO selectById(Long id,String caseNum ) {
|
||||
// 根据案件id或者案件编号查询详情
|
||||
MsCaseApplicationVO vo = new MsCaseApplicationVO();
|
||||
MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(id);
|
||||
MsCaseApplication caseApplication = null;
|
||||
if(id!=null) {
|
||||
caseApplication = msCaseApplicationMapper.selectByPrimaryKey(id);
|
||||
}else {
|
||||
// 根据案件编号查
|
||||
Example example = new Example(MsCaseApplication.class);
|
||||
example.createCriteria().andEqualTo("caseNum", caseNum);
|
||||
caseApplication = msCaseApplicationMapper.selectOneByExample(example);
|
||||
}
|
||||
if(caseApplication==null){
|
||||
return vo;
|
||||
}
|
||||
BeanUtil.copyProperties(caseApplication, vo);
|
||||
// 查询案件相关人员
|
||||
MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(id);
|
||||
@@ -369,6 +386,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
vo.setColumnValueList(columnValueVOS);
|
||||
// 查询拒绝原因
|
||||
vo.setReason(auditMapper.selectByCaseId(id,caseApplication.getCaseFlowId()));
|
||||
// todo 在日志表查詢结束时间返回
|
||||
vo.setEndTime(caseLogRecordMapper.selectEndTimeByCaseId(caseApplication.getId(),"结束"));
|
||||
return vo;
|
||||
}
|
||||
|
||||
@@ -380,21 +399,36 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int insert(MsCaseApplicationVO caseApplication) {
|
||||
public String insert(MsCaseApplicationVO caseApplication) {
|
||||
|
||||
|
||||
// todo 第三方调用该接口,未绑定角色,暂时不根据角色查询流程,根据角色获取案件流程
|
||||
/** List<MsCaseFlow> caseFlows= selectCaseFlows();
|
||||
if (CollectionUtil.isEmpty(caseFlows)) {
|
||||
throw new ServiceException("该角色未绑定案件流程");
|
||||
}
|
||||
*/
|
||||
// 设置模板id,根据机构代码查询模板
|
||||
Long templateId = getTemplate();
|
||||
caseApplication.setTemplateId(templateId);
|
||||
// 获取第一个流程节点
|
||||
MsCaseFlow caseFlow = getCaseFlow();
|
||||
return insert(caseApplication,caseFlow);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增案件
|
||||
* @param caseApplication
|
||||
* @param caseFlow
|
||||
* @return
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public String insert(MsCaseApplicationVO caseApplication, MsCaseFlow caseFlow) {
|
||||
if (caseApplication.getId() == null) {
|
||||
caseApplication.setId(IdWorkerUtil.getId());
|
||||
}
|
||||
|
||||
// 根据角色获取案件流程
|
||||
List<MsCaseFlow> caseFlows= selectCaseFlows();
|
||||
if (CollectionUtil.isEmpty(caseFlows)) {
|
||||
throw new ServiceException("该角色为绑定案件流程");
|
||||
}
|
||||
// 设置模板id,根据机构代码查询模板
|
||||
Long templateId = templateManageMapper.selectByCreditCode(creditCode);
|
||||
caseApplication.setTemplateId(templateId);
|
||||
|
||||
MsCaseFlow caseFlow = caseFlows.get(0);
|
||||
caseApplication.setCaseStatusName(caseFlow.getCaseStatusName());
|
||||
caseApplication.setCaseFlowId(caseFlow.getId());
|
||||
caseApplication.setCreateTime(new Date());
|
||||
@@ -416,51 +450,51 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
if (msCaseApplicationMapper.insertSelective(caseApplication) > 0) {
|
||||
List<MsCaseAttach> caseAttachList = caseApplication.getCaseAttachList();
|
||||
// 保存案件相关人员
|
||||
// 设置申请机构
|
||||
if (StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==1) {
|
||||
// 组装申请机构
|
||||
// insertDept(affiliate);
|
||||
// 新增申请机构和代理人
|
||||
caseApplicationService.insertAgentUser(affiliate);
|
||||
}else if(StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==0){
|
||||
// 查询申请人角色id
|
||||
Long roleId = roleMapper.selectRoleIdByName("申请人");
|
||||
caseApplicationService.insertApplicantUser(affiliate,false,roleId);
|
||||
caseApplicationService.insertApplicantUser(affiliate,true,roleId);
|
||||
// 设置申请机构
|
||||
if (StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==1) {
|
||||
// 组装申请机构
|
||||
// insertDept(affiliate);
|
||||
// 新增申请机构和代理人
|
||||
caseApplicationService.insertAgentUser(affiliate);
|
||||
}else if(StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==0){
|
||||
// 查询申请人角色id
|
||||
Long roleId = roleMapper.selectRoleIdByName("申请人");
|
||||
caseApplicationService.insertApplicantUser(affiliate,false,roleId);
|
||||
caseApplicationService.insertApplicantUser(affiliate,true,roleId);
|
||||
|
||||
|
||||
}
|
||||
// 压缩包导入,则根据身份证号获取性别和出生日期
|
||||
if (caseApplication.isImportFlag() && StrUtil.isNotEmpty(affiliate.getRespondentIdentityNum())) {
|
||||
setBirthByIdentityNum(affiliate);
|
||||
}
|
||||
if (StrUtil.isNotEmpty(affiliate.getAgentEmail())) {
|
||||
affiliate.setAgentEmail(affiliate.getAgentEmail().replace("\n", "").replaceAll("\\s", ""));
|
||||
}
|
||||
if (StrUtil.isNotEmpty(affiliate.getRespondentEmail())) {
|
||||
affiliate.setRespondentEmail(affiliate.getRespondentEmail().replace("\n", "").replaceAll("\\s", ""));
|
||||
}
|
||||
msCaseAffiliateMapper.insert(affiliate);
|
||||
// 批量生成调解申请书
|
||||
MsCaseApplicationReq req = new MsCaseApplicationReq();
|
||||
req.setCaseFlowId(caseFlow.getId());
|
||||
if(!caseApplication.isImportFlag()) {
|
||||
req.setId(caseApplication.getId());
|
||||
}else {
|
||||
// 压缩包导入
|
||||
req.setBatchNumber(caseApplication.getBatchNumber());
|
||||
}
|
||||
// 生成调解申请书
|
||||
if(affiliate.getOrganizeFlag()==0){
|
||||
// 自然人
|
||||
req.setTemplateType(TemplateTypeEnum.PERSON_MEDIATION_APPLICATION.getCode());
|
||||
}else {
|
||||
// 机构
|
||||
req.setTemplateType(TemplateTypeEnum.MEDIATION_APPLICATION.getCode());
|
||||
}
|
||||
req.setTemplateId(String.valueOf(templateId));
|
||||
|
||||
caseApplicationService.generateApplication(req);
|
||||
}
|
||||
// 压缩包导入,则根据身份证号获取性别和出生日期
|
||||
if (caseApplication.isImportFlag() && StrUtil.isNotEmpty(affiliate.getRespondentIdentityNum())) {
|
||||
setBirthByIdentityNum(affiliate);
|
||||
}
|
||||
if (StrUtil.isNotEmpty(affiliate.getAgentEmail())) {
|
||||
affiliate.setAgentEmail(affiliate.getAgentEmail().replace("\n", "").replaceAll("\\s", ""));
|
||||
}
|
||||
if (StrUtil.isNotEmpty(affiliate.getRespondentEmail())) {
|
||||
affiliate.setRespondentEmail(affiliate.getRespondentEmail().replace("\n", "").replaceAll("\\s", ""));
|
||||
}
|
||||
msCaseAffiliateMapper.insert(affiliate);
|
||||
// 批量生成调解申请书
|
||||
MsCaseApplicationReq req = new MsCaseApplicationReq();
|
||||
req.setCaseFlowId(caseFlow.getId());
|
||||
if(!caseApplication.isImportFlag()) {
|
||||
req.setId(caseApplication.getId());
|
||||
}else {
|
||||
// 压缩包导入
|
||||
req.setBatchNumber(caseApplication.getBatchNumber());
|
||||
}
|
||||
// 生成调解申请书
|
||||
if(affiliate.getOrganizeFlag()==0){
|
||||
// 自然人
|
||||
req.setTemplateType(TemplateTypeEnum.PERSON_MEDIATION_APPLICATION.getCode());
|
||||
}else {
|
||||
// 机构
|
||||
req.setTemplateType(TemplateTypeEnum.MEDIATION_APPLICATION.getCode());
|
||||
}
|
||||
req.setTemplateId(String.valueOf(caseApplication.getTemplateId()));
|
||||
// todo 部署放开
|
||||
caseApplicationService.generateApplication(req);
|
||||
// 保存案件附件
|
||||
if (CollectionUtil.isNotEmpty(caseAttachList)) {
|
||||
for (MsCaseAttach caseAttach : caseAttachList) {
|
||||
@@ -482,10 +516,61 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
columnValueMapper.batchSave(columnValueList);
|
||||
}
|
||||
CaseLogUtils.insertCaseLog(caseApplication.getId(), 0, "新增案件", "");
|
||||
return 1;
|
||||
return caseApplication.getCaseNum();
|
||||
}
|
||||
|
||||
return 0;
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取第一个流程节点
|
||||
* @return
|
||||
*/
|
||||
private MsCaseFlow getCaseFlow() {
|
||||
|
||||
// 查询所有流程节点
|
||||
Example flowExample = new Example(MsCaseFlow.class);
|
||||
flowExample.setOrderByClause("sort asc");
|
||||
List<MsCaseFlow> caseFlows = caseFlowMapper.selectByExample(flowExample);
|
||||
if (CollectionUtil.isEmpty(caseFlows)) {
|
||||
throw new ServiceException("请先配置流程");
|
||||
}
|
||||
return caseFlows.get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模板id
|
||||
* @return
|
||||
*/
|
||||
private Long getTemplate() {
|
||||
|
||||
return templateManageMapper.selectByCreditCode(creditCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public AjaxResult batchInsert(MsCaseBatchInsertVO vo) {
|
||||
if(CollectionUtil.isEmpty(vo.getList())){
|
||||
return AjaxResult.error("案件不能为空");
|
||||
}
|
||||
// 设置模板id,根据机构代码查询模板
|
||||
Long templateId = getTemplate();
|
||||
// 获取第一个流程节点
|
||||
MsCaseFlow caseFlow = getCaseFlow();
|
||||
List<String> caseNumList = new ArrayList<>();
|
||||
for (MsCaseApplicationVO caseApplicationVO : vo.getList()) {
|
||||
caseApplicationVO.setTemplateId(templateId);
|
||||
String caseNum = caseApplicationService.insert(caseApplicationVO, caseFlow);
|
||||
caseNumList.add(caseNum);
|
||||
}
|
||||
AjaxResult success = AjaxResult.success();
|
||||
success.put("caseNumList",caseNumList);
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -518,6 +603,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
sysUser.setNickName(name);
|
||||
sysUser.setPhonenumber(phone);
|
||||
sysUser.setPassword(SecurityUtils.encryptPassword("abc123456"));
|
||||
sysUser.setIdType(affiliate.getIdType());
|
||||
sysUser.setNationality(affiliate.getNationality());
|
||||
sysUser.setCreateBy(SecurityUtils.getUsername());
|
||||
userMapper.insertUser(sysUser);
|
||||
userRoleMapper.insertUserRole(sysUser.getUserId(), roleId);
|
||||
@@ -565,7 +652,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
example.createCriteria().andIn("roleid", roles.stream().map(SysRole::getRoleId).collect(Collectors.toList()));
|
||||
List<MsCaseFlowRoleRelated> caseFlowRoleRelatedList = caseFlowRoleRelatedMapper.selectByExample(example);
|
||||
if (CollectionUtil.isEmpty(caseFlowRoleRelatedList)) {
|
||||
throw new ServiceException("该角色为绑定案件流程");
|
||||
throw new ServiceException("该角色未绑定案件流程");
|
||||
}
|
||||
Example flowExample = new Example(MsCaseFlow.class);
|
||||
flowExample.setOrderByClause("sort asc");
|
||||
@@ -1672,7 +1759,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
if (CollectionUtil.isEmpty(users)) {
|
||||
return AjaxResult.error("暂无调解员");
|
||||
}
|
||||
// todo 根据角色查询是否已经选择了调解员进行回显
|
||||
// 根据角色查询是否已经选择了调解员进行回显
|
||||
List<Long> userIds = users.stream().map(SysUser::getUserId).collect(Collectors.toList());
|
||||
// 状态为未结束的是待办数量,结束的是已办数量
|
||||
Map<Long, List<MsCaseApplication>> caseMap=null;
|
||||
@@ -3887,6 +3974,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
agentUser.setNickName(affiliate.getNameAgent());
|
||||
agentUser.setPhonenumber(affiliate.getContactTelphoneAgent());
|
||||
agentUser.setPassword(SecurityUtils.encryptPassword("abc123456"));
|
||||
agentUser.setNationality(affiliate.getNationality());
|
||||
agentUser.setIdType(affiliate.getIdType());
|
||||
// agentUser.setDeptId(Long.valueOf(affiliate.getApplicationId()));
|
||||
userMapper.insertUser(agentUser);
|
||||
userRoleMapper.insertUserRole(agentUser.getUserId(), roleId);
|
||||
|
||||
@@ -9,6 +9,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="idCard" column="id_card" />
|
||||
<result property="idType" column="id_type" />
|
||||
<result property="nationality" column="nationality" />
|
||||
<result property="email" column="email" />
|
||||
<result property="phonenumber" column="phonenumber" />
|
||||
<result property="sex" column="sex" />
|
||||
@@ -50,7 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<sql id="selectUserVo">
|
||||
select u.user_id, u.user_name, u.nick_name,u.specialty, u.id_card,u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
||||
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,u.id_card
|
||||
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,u.id_card,u.id_type,u.nationality
|
||||
from ms_sys_user u
|
||||
left join ms_sys_user_role ur on u.user_id = ur.user_id
|
||||
left join ms_sys_role r on r.role_id = ur.role_id
|
||||
@@ -200,6 +202,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="userName != null and userName != ''">user_name,</if>
|
||||
<if test="nickName != null and nickName != ''">nick_name,</if>
|
||||
<if test="idCard != null and idCard != ''">id_card,</if>
|
||||
<if test="idType != null ">id_type,</if>
|
||||
<if test="nationality != null ">nationality,</if>
|
||||
<if test="email != null and email != ''">email,</if>
|
||||
<if test="avatar != null and avatar != ''">avatar,</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">phonenumber,</if>
|
||||
@@ -216,6 +220,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="userName != null and userName != ''">#{userName},</if>
|
||||
<if test="nickName != null and nickName != ''">#{nickName},</if>
|
||||
<if test="idCard != null and idCard != ''">#{idCard},</if>
|
||||
<if test="idType != null ">#{idType},</if>
|
||||
<if test="nationality != null ">#{nationality},</if>
|
||||
<if test="email != null and email != ''">#{email},</if>
|
||||
<if test="avatar != null and avatar != ''">#{avatar},</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
|
||||
@@ -272,6 +278,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
||||
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
|
||||
<if test="idCard != null and idCard != ''">id_card = #{idCard},</if>
|
||||
<if test="idType != null">id_type = #{idType},</if>
|
||||
<if test="nationality != null">nationality = #{nationality},</if>
|
||||
<if test="email != null ">email = #{email},</if>
|
||||
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
|
||||
<if test="sex != null and sex != ''">sex = #{sex},</if>
|
||||
|
||||
Reference in New Issue
Block a user