仲裁系统bug修复

This commit is contained in:
18792927508
2024-05-08 17:28:22 +08:00
parent fbcf91a592
commit 5b24d0f522
17 changed files with 735 additions and 293 deletions
@@ -2,6 +2,7 @@ package com.ruoyi.web.controller.wisdomarbitrate;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.ruoyi.common.constant.CaseApplicationConstants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
@@ -101,6 +102,18 @@ public class AdjudicationController extends BaseController {
}
return adjudicationService.createDocument(caseApplication);
}
/**
* 开庭审理,确定审理结果,生成裁决书
* @param caseApplication
* @return
*/
@PostMapping("/caseJudgment")
public AjaxResult caseJudgment(@Validated @RequestBody CaseApplication caseApplication){
if (caseApplication.getId() == null) {
return AjaxResult.error("案件id不能为空");
}
return adjudicationService.caseJudgment(caseApplication);
}
/**
* 批量生成裁决书
* @param caseApplication
@@ -174,7 +187,7 @@ public class AdjudicationController extends BaseController {
/**
* 批量归档(暂时只改案件状态)
* @param batchCaseApplication
* @param caseApplication
* @return
*/
@PostMapping("/caseFileBatch")
@@ -240,5 +253,15 @@ public class AdjudicationController extends BaseController {
return adjudicationService.emailByCaseId(id);
}
/**
* 开庭审理提交,只改变案件状态为CaseApplicationConstants.VERPRIF_ARBITRATION
* @param id 案件id
* @return
*/
@GetMapping("/changeCaseStatus")
public AjaxResult changeCaseStatus(@RequestParam("id") Long id){
return adjudicationService.changeCaseStatus(id, CaseApplicationConstants.VERPRIF_ARBITRATION);
}
}
@@ -1,6 +1,7 @@
package com.ruoyi.web.controller.wisdomarbitrate;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.mapper.SysUserMapper;
@@ -26,11 +27,13 @@ public class ArbitratorController extends BaseController {
*/
// @PreAuthorize("@ss.hasPermi('arbitrator:list')")
@GetMapping("/list")
public TableDataInfo list(Arbitrator arbitrator)
public AjaxResult list(Arbitrator arbitrator)
{
startPage();
if(arbitrator.getCaseId()==null){
return AjaxResult.error("案件id不能为空");
}
List<SysUser> list = sysUserService.selectUserListByAdRole(arbitrator);
return getDataTable(list);
return AjaxResult.success(list);
}
@@ -48,8 +48,8 @@ public class CaseApplicationController extends BaseController {
if(StrUtil.isEmpty(caseApplication.getSelectCaseStatus())){
caseApplication.setSelectCaseStatus("0");
}
startPage();
List<CaseApplication> list = caseApplicationService.selectCaseApplicationListByRole(caseApplication);
// List<CaseApplication> list = caseApplicationService.selectCaseApplicationListByRole(caseApplication);
List<CaseApplication> list = caseApplicationService.page(caseApplication);
return getDataTable(list);
}
@@ -271,6 +271,9 @@ public class CaseApplicationController extends BaseController {
@Log(title = "组庭审核", businessType = BusinessType.UPDATE)
@PostMapping("/pendTralCheck")
public AjaxResult pendTralCheck(@Validated @RequestBody CaseApplication caseApplication) {
if(StrUtil.isEmpty(caseApplication.getArbitratorId())|| StrUtil.isEmpty(caseApplication.getArbitratorName())){
return error("请选择仲裁员");
}
return caseApplicationService.pendTralCheck(caseApplication);
}
@@ -4,52 +4,52 @@ package com.ruoyi.common.constant;
*
*/
public class CaseApplicationConstants {
/** 立案申请 */
/** 申请人/代理人,立案申请 */
public static final int CASE_APPLICATION = 0;
/** 案件修改 */
/** 申请人/代理人,案件修改 */
public static final int CASE_EDIT = -1;
/** 待立案审查 */
/** 顾问,待立案审查 */
public static final int CASE_CHECK = 1;
/** 待缴费 */
/** 申请人、代理人,待缴费 */
public static final int PENDING_PAYMENT = 2;
/** 待缴费确认 */
/** 财务,待缴费确认 */
public static final int PENDING_PAYMENT_CONFIRM = 3;
/** 待案件质证 */
/** 被申,待案件质证 */
public static final int CASE_CROSSEXAMI = 4;
/** 待组庭 */
/** 待定,待组庭 */
public static final int PENDING_TRIAL = 26;
/** 待组庭审核 */
/** 顾问,待组庭审核 */
public static final int CONFIRMDED_PENDING_TRIAL_SUBMMIT = 5;
/** 待组庭确定 */
/** 部门长,待组庭确定 */
public static final int CONFIRMDED_PENDING_TRIAL = 6;
/** 待审核仲裁方式 */
/** 仲裁员,待审核仲裁方式 */
public static final int CHECK_ARBITRATION_METHOD = 7;
/** 待开庭审理 */
/** 申请人,被申,顾问,仲裁员,待开庭审理 */
public static final int PENDING_OPENCOURT_HEAR = 8;
/** 待书面审理 */
/** 申请人,被申,顾问,仲裁员,待书面审理 */
public static final int PENDING_WRIITEN_HEAR = 9;
/** 待生成裁决书 */
public static final int GENERATED_ARBITRATION = 10;
/**待秘书核验裁决书*/
/**顾问,待秘书核验裁决书*/
public static final int VERPRIF_ARBITRATION = 11;
/**待部门长审核裁决书*/
/**部门长,待部门长审核裁决书*/
public static final int CHECK_ARBITRATION = 12;
/**待裁决书签名*/
/**仲裁员,待裁决书签名*/
public static final int SIGN_ARBITRATION = 13;
/** 待裁决书用印 */
/** 顾问,待裁决书用印 */
public static final int ARBITRATED_SEAL = 14;
/** 待裁决书送达 */
/** 顾问,待裁决书送达 */
public static final int ARBITRATION_DELIVERY = 15;
/** 待案件归档*/
/** 顾问,待案件归档*/
public static final int CASE_FILING = 16;
/** 已归档*/
public static final int CASE_ARCHIVED = 17;
/** 待修改开庭时间*/
/** 顾问,待修改开庭时间*/
public static final int MODIFY_HEARDATE = 31;
/**待仲裁员审核裁决书*/
/**仲裁员,待仲裁员审核裁决书*/
public static final int HEAD_CHECK_ARBITRATION = 18;
@@ -20,6 +20,12 @@ public interface ISysUserService
* @return 用户信息集合信息
*/
public List<SysUser> selectUserList(SysUser user);
/**
* 查询仲裁员
* @param arbitrator
* @return
*/
public List<SysUser> selectUserListByAdRole(Arbitrator arbitrator);
/**
@@ -6,11 +6,14 @@ import java.util.List;
import java.util.stream.Collectors;
import javax.validation.Validator;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.system.mapper.*;
import com.ruoyi.wisdomarbitrate.domain.Arbitrator;
import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper;
import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -65,6 +68,8 @@ public class SysUserServiceImpl implements ISysUserService {
@Autowired
private CaseApplicationMapper caseApplicationMapper;
@Autowired
private CaseAffiliateMapper caseAffiliateMapper;
@Autowired
protected Validator validator;
@@ -81,21 +86,45 @@ public class SysUserServiceImpl implements ISysUserService {
return userMapper.selectUserList(user);
}
/**
* 查询仲裁员
* @param arbitrator
* @return
*/
@Override
public List<SysUser> selectUserListByAdRole(Arbitrator arbitrator) {
// 根据案件id查询案件
CaseAffiliate caseAffiliate = new CaseAffiliate();
caseAffiliate.setCaseAppliId(arbitrator.getCaseId());
List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
List<String> phoneList=new ArrayList<>();
if(CollectionUtil.isNotEmpty(caseAffiliates)){
for (CaseAffiliate affiliate : caseAffiliates) {
if(StrUtil.isNotEmpty(affiliate.getContactTelphone())) {
phoneList.add(affiliate.getContactTelphone());
}
if(StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent())) {
phoneList.add(affiliate.getContactTelphoneAgent());
}
}
}
List<SysUser> sysUsers = userMapper.selectUserListByAdRole(arbitrator);
if(sysUsers!=null&&sysUsers.size()>0){
List<SysUser> arbitrators = new ArrayList<>();
if(CollectionUtil.isNotEmpty(sysUsers)){
for(SysUser sysUser: sysUsers){
Long userId = sysUser.getUserId();
int casenum = caseApplicationMapper.selectCasenum(userId.toString());
String nickName = sysUser.getNickName();
String nickNamenew = nickName + "(待办案件数量" + casenum + "个)";
sysUser.setNickNameAndNum(nickNamenew);
if(!phoneList.contains(sysUser.getPhonenumber())) {
Long userId = sysUser.getUserId();
int todoCount = caseApplicationMapper.selectCasenum(userId.toString());
String nickName = sysUser.getNickName();
String nickNamenew = nickName + "(待办案件数量" + todoCount + "个)";
sysUser.setNickNameAndNum(nickNamenew);
arbitrators.add(sysUser);
}
}
}
return sysUsers;
return arbitrators;
}
/**
@@ -9,6 +9,10 @@ public class Arbitrator extends BaseEntity {
/** ID */
private Long id;
/**
* 案件id
*/
private Long caseId;
/** 仲裁员姓名 */
private String arbitratorName;
/** 职称 */
@@ -47,6 +51,14 @@ public class Arbitrator extends BaseEntity {
/** 已结案数量 */
private int closedCaseNum;
public Long getCaseId() {
return caseId;
}
public void setCaseId(Long caseId) {
this.caseId = caseId;
}
public Long getId() {
return id;
}
@@ -193,6 +193,10 @@ public class CaseApplication extends BaseEntity {
* 登录用户用户名
*/
private String loginUserName;
/**
* 登录人电话
*/
private String loginUserPhone;
private List<Long> deptIds;
/**
* 部门长状态
@@ -428,4 +432,8 @@ public class CaseApplication extends BaseEntity {
private String userName;
// 缴费确认驳回原因
private String payRejectReason;
/**
* 仲裁员确认裁决书驳回
*/
private String arbitrateReject;
}
@@ -67,7 +67,9 @@ public interface CaseApplicationMapper {
ToDoCount selectAdminCaseToDoCount();
ToDoCount selectTodoCountByRole(CaseApplication caseApplication);
ToDoCount selectTodoCountByRole(@Param("caseApplication") CaseApplication caseApplication,
@Param("caseStatusList") List<Integer> caseStatusList,
@Param("roleNames") List<String> roleNames);
/**
* 修改案件锁定状态
@@ -138,4 +140,13 @@ public interface CaseApplicationMapper {
List<CaseApplication> listCaseApplicationByBatchNumber(CaseApplication caseApplication);
List<CaseApplication> selectAdminCaseApplicationListBatch1(CaseApplication caseApplication);
/**
* 案件列表查询
* @param caseApplication
* @return
*/
List<CaseApplication> list(@Param("caseApplication") CaseApplication caseApplication,
@Param("caseStatusList") List<Integer> caseStatusList,
@Param("roleNames") List<String> roleNames);
}
@@ -67,4 +67,20 @@ public interface IAdjudicationService {
AjaxResult caseFileBatch(Integer batchNumber);
AjaxResult serviceBatch(Integer batchNumber) throws EsignDemoException, IOException;
/**
* 开庭审理,确定审理结果,生成裁决书
* @param caseApplication
* @return
*/
AjaxResult caseJudgment(CaseApplication caseApplication);
/**
* 案件状态改变
* @param id 案件id
* @param caseStatus 案件状态
* @return
*/
AjaxResult changeCaseStatus(Long id, Integer caseStatus);
}
@@ -139,6 +139,8 @@ public interface ICaseApplicationService {
CaseAttach downloadCaseZipFile(CaseApplication caseApplication);
List<CaseApplication> selectCaseApplicationListBatchByRole(CaseApplication caseApplication);
public List<CaseApplication> page(CaseApplication caseApplication) ;
int submitCaseApplicationBatch(String batchNumber);
@@ -132,13 +132,18 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
// 日期格式化年月日
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
/**
* 生成裁决书
* @param caseApplicationReq
* @return
*/
@Override
@Transactional
public AjaxResult createDocument(CaseApplication caseApplicationReq) {
// todo 生成裁决书单独出接口,即确定审理结果接口,提交按钮只改变案件状态和生成签名链接
String templatePath = "";
String templateName = "";
String agentName = "";
String resName = "";
try {
Map<String, Object> datas = new HashMap<>();
Long id = caseApplicationReq.getId();
@@ -214,7 +219,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
// 遍历书签,给书签赋值
replaceBookmark(bookmarkList, datas, valueMap);
// 根据条件替换书签
conditionReplaceBookmark(caseApplicationById, datas, agentName, resName, arbitrateRecordSelect);
conditionReplaceBookmark(caseApplicationById, datas, "", "", arbitrateRecordSelect);
// 裁决书生成时间
LocalDate now = LocalDate.now();
String year = Integer.toString(now.getYear());
@@ -250,7 +255,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8);
// 保存裁决书附件
saveArbitorFile(id, saveName, savePath, caseApplicationById, arbitrateRecordSelect);
saveArbitorFile(id, saveName, savePath, caseApplicationById, arbitrateRecordSelect,CaseApplicationConstants.VERPRIF_ARBITRATION);
return AjaxResult.success("裁决书已生成");
} catch (IOException e) {
@@ -565,8 +570,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
* @param savePath 保存路径
* @param caseApplicationById 案件基本信息
* @param arbitrateRecordSelect 出裁决书生成记录
* @param caseStatus 案件状态,不为空则更新案件状态
*/
private void saveArbitorFile(Long id, String saveName, String savePath, CaseApplication caseApplicationById, ArbitrateRecord arbitrateRecordSelect) {
private void saveArbitorFile(Long id, String saveName, String savePath, CaseApplication caseApplicationById, ArbitrateRecord arbitrateRecordSelect,Integer caseStatus) {
CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id).annexName(saveName).annexPath(savePath).annexType(3).build();
//保存到附件表里,先判断之前有没有,有的话更新,没有的话新增
List<CaseAttach> caseAttachList = caseAttachMapper.getCaseAttachByCaseIdAndType(caseAttach);
@@ -586,7 +592,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
}
}
//修改案件状态
caseApplicationById.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
if(caseStatus!=null) {
caseApplicationById.setCaseStatus(caseStatus);
}
Integer arbitratMethod = caseApplicationById.getArbitratMethod();
if (arbitratMethod == 1) {
caseApplicationById.setLockStatus(1);
@@ -1769,6 +1777,145 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
throw new ServiceException("这个批号没有批量送达裁决书的案件");
}
return AjaxResult.success("裁决书送达成功");
}
/**
* 开庭审理,确定审理结果,生成裁决书
* @param req
* @return
*/
@Override
public AjaxResult caseJudgment(CaseApplication req) {
//获取案件详细信息
CaseApplication caseApplicationById = caseApplicationService.selectCaseApplication(req);
if (caseApplicationById == null) {
return AjaxResult.error("案件不存在");
}
if (caseApplicationById.getTemplateId() == null) {
return AjaxResult.error("请先指定裁决书模板");
}
// 根据模板id查找对应的模板
TemplateManage templateManage = new TemplateManage();
templateManage.setId(caseApplicationById.getTemplateId());
List<TemplateManage> templateManages = templateManageMapper.selectTemplateList(templateManage);
if (CollectionUtil.isEmpty(templateManages)) {
return AjaxResult.error("请先指定裁决书模板");
}
String templatePath = templateManages.get(0).getTemOrigPath();
if (StrUtil.isEmpty(templatePath)) {
return AjaxResult.error("未找到该模板");
}
templatePath = "/home/ruoyi/" + templatePath;
try {
File file = new File(templatePath);
} catch (Exception e) {
return AjaxResult.error("未找到该模板");
}
// 查询案件相关表信息
CaseAffiliate caseAffiliate = new CaseAffiliate();
caseAffiliate.setCaseAppliId(req.getId());
List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
if(CollectionUtil.isEmpty(caseAffiliates)){
return AjaxResult.error("未找到案件相关人员");
}
// 在系统表中查询案件内置字段
SysDictData sysDictData = new SysDictData();
sysDictData.setDictType("case_built_type");
List<SysDictData> dictDataList = dictDataMapper.selectDictDataList(sysDictData);
// 根据模板id查询抓取规则,判断从主表取值还是从columnValue值取
List<FatchRule> fatchRuleList = fatchRuleMapper.listByTemplateId(caseApplicationById.getTemplateId());
// 抓取规则,0-内置字段,1-自定义字段
Map<Integer, List<FatchRule>> fatchRuleMap = new HashMap<>();
// 裁决书需要的字段和内容,占位符需要配置成中文
Map<String, String> valueMap = new HashMap<>();
// 如果未设置抓取规则,则从主表取数据,设置内置字段值
if (CollectionUtil.isNotEmpty(fatchRuleList)) {
fatchRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getIsDefault));
}
// 自定义字段,从columnValue值取
if (fatchRuleMap.size() > 0 && fatchRuleMap.containsKey(1)) {
// 根据案件id查询key-value表
List<ColumnValue> columnValueList = columnValueMapper.listByCaseId(req.getId());
if (CollectionUtil.isNotEmpty(columnValueList)) {
columnValueList.forEach(columnValue -> valueMap.put(columnValue.getName(), columnValue.getValue()));
}
}
// 组装内置字段,在主表中查出内容
buildDefaultColumnValue(dictDataList, caseAffiliates, valueMap, caseApplicationById);
// 获取模板中的占位符key
List<String> bookmarkList = getBookmarkByDocx(templatePath);
if (CollectionUtil.isEmpty(bookmarkList)) {
return AjaxResult.success("请检查模板是否配置正确,未获取到占位符");
}
//获取仲裁记录表里的相关信息
ArbitrateRecord arbitrateRecord = new ArbitrateRecord();
arbitrateRecord.setCaseAppliId(req.getId());
ArbitrateRecord arbitrateRecordSelect = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord);
Map<String, Object> datas = new HashMap<>();
// 遍历书签,给书签赋值
replaceBookmark(bookmarkList, datas, valueMap);
// 根据条件替换书签
conditionReplaceBookmark(caseApplicationById, datas,"", "", arbitrateRecordSelect);
// 裁决书生成时间
LocalDate now = LocalDate.now();
String year = Integer.toString(now.getYear());
datas.put("裁决书生成时间", year);
//生成编码
String equipmentNo = getNewEquipmentNo();
// 裁决书编号
datas.put("裁决书编号", equipmentNo);
// 仲裁费
datas.put("仲裁费", caseApplicationById.getFeePayable() != null ? caseApplicationById.getFeePayable().toString() : "");
// 案件创建时间
Date createTime = caseApplicationById.getCreateTime();
// 将日期格式化为字符串
String createTimeStr = sdf.format(createTime);
datas.put("案件创建时间", createTimeStr);
// 立案日期
Date registerDate = caseApplicationById.getRegisterDate();
String registerDateStr = sdf.format(registerDate);
datas.put("立案日期", registerDateStr);
String month = String.format("%02d", now.getMonthValue());
String day = String.format("%02d", now.getDayOfMonth());
// todo
String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
// String saveFolderPath = "D:/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx";
// todo
String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
// String saveName = "D:/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day + "/" + fileName;
// 将word中的标签替换掉,生成新的word
String docFilePath = null;
try {
docFilePath = wordChangeText(templatePath, datas, saveFolderPath, fileName);
} catch (IOException e) {
throw new ServiceException("生成裁决书失败");
}
String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8);
// 保存裁决书附件
saveArbitorFile(req.getId(), saveName, savePath, caseApplicationById, arbitrateRecordSelect,null);
return AjaxResult.success("裁决书已生成");
}
@Transactional
@Override
public AjaxResult changeCaseStatus(Long id, Integer caseStatus) {
if (id == null || caseStatus == null) {
return AjaxResult.error("参数校验失败");
}
CaseApplication caseApplication = new CaseApplication();
caseApplication.setId(id);
caseApplication.setCaseStatus(caseStatus);
caseApplicationMapper.submitCaseApplication(caseApplication);
return AjaxResult.success();
}
/**
@@ -369,81 +369,274 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
}
@Override
public ToDoCount selectToDoCount() {
/**
* 分页查询
* 数据权限:1.每个人不同的角色,而每个角色可以操作不同的案件状态
* 2.申请人,被申请人:可以看到自己相关的案件(案件有被申请人相关的信息)
* 3.仲裁员:案件选定了某个仲裁员后,该仲裁员就可以查看该案件
* 4.超级管理员,法律顾问秘书,仲裁委(部门长):可以查看所有案件
*
* @param caseApplication
* @return
*/
public List<CaseApplication> page(CaseApplication caseApplication) {
List<CaseApplication> caseApplications= new ArrayList<>();
// todo 案件列表查询Bug修复,需要看见已办案件
// 获取登录用户
LoginUser loginUser = getLoginUser();
SysUser user = loginUser.getUser();
Long userId = user.getUserId();
// 查询登录人信息
// 查询登录人,根据邮箱查询
SysUser sysUser = sysUserMapper.selectUserById(userId);
if(sysUser==null){
throw new ServiceException("未获取到登录用户信息");
}
List<SysRole> roles = sysUser.getRoles();
// 没有角色不能查看案件列表
if (CollectionUtil.isEmpty(roles)) {
throw new ServiceException("该用户没有角色权限");
}
CaseApplication caseApplication = new CaseApplication();
List<Integer> caseStatusList = new ArrayList<>();
List<String> roleNames = roles.stream().map(SysRole::getRoleName).collect(Collectors.toList());
startPage();
for (SysRole role : roles) {
if (StrUtil.isEmpty(role.getRoleName())) {
if(StrUtil.isEmpty(role.getRoleName())){
continue;
}
// 超级管理员和仲裁委(部门长)案件,可查看所有案件 √
if (role.getRoleName().equals("超级管理员")
) {
return caseApplicationMapper.selectAdminCaseToDoCount();
// 查看所有权限
if("超级管理员".equals(role.getRoleName())){
caseApplications = caseApplicationMapper.list(caseApplication,caseStatusList,null);
setArbitorMethod(caseApplications);
return caseApplications;
}
caseApplication.setLoginUserName(sysUser.getUserName());
caseApplication.setLoginUserPhone(sysUser.getPhonenumber());
if("申请人".equals(role.getRoleName())){
// 申请人在生成裁决书之前都可以修改案件
Integer[] array = {0,-1,1,2,3,4,5,6,7,8,9,10,31};
caseStatusList.addAll(Arrays.asList(array));
}
if("被申请人".equals(role.getRoleName())) {
// 案件质证,开庭审理,书面审理
caseStatusList.add(4);
caseStatusList.add(8);
caseStatusList.add(9);
}
if("仲裁员".equals(role.getRoleName())){
Integer[] array = {7,8,9,13,18};
caseStatusList.addAll(Arrays.asList(array));
caseApplication.setArbitratorId(String.valueOf(sysUser.getUserId()));
}
if ("仲裁委".equals(role.getRoleName())
|| "部门长".equals(role.getRoleName())) {
caseApplication.setIsOtherRole(1);
// 组庭确定,部门长审核裁决书
caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
caseStatusList.add(CaseApplicationConstants.CHECK_ARBITRATION);
// caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL);
caseApplication.setDeptHeadStatus(caseStatusList);
}
if ("仲裁员".equals(role.getRoleName())) {
caseApplication.setIsOtherRole(1);
caseApplication.setUserId(String.valueOf(userId));
}
if ("财务".equals(role.getRoleName())) {
caseApplication.setIsOtherRole(1);
caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
caseStatusList.add(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
}
if ("法律顾问".equals(role.getRoleName())) {
// 查询角色有关的用户部门
// List<Long> deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
List<Long> deptIds = new ArrayList<>();
deptIds.add(sysUser.getDeptId());
caseApplication.setDeptIds(deptIds);
if ("法律顾问".equals(role.getRoleName()) || "秘书".equals(role.getRoleName()) ) {
Integer[] array = {1,5,8,9,11,14,15,16,31};
caseStatusList.addAll(Arrays.asList(array));
}
if ("申请人".equals(role.getRoleName())) {
caseApplication.setIsOtherRole(1);
// 查询角色有关的用户部门
caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
}
if ("被申请人".equals(role.getRoleName())) {
caseApplication.setIsOtherRole(1);
//
caseApplication.setIdCard(String.valueOf(sysUser.getIdCard()));
}
if ("代理人".equals(role.getRoleName())) {
caseApplication.setIsOtherRole(1);
// 查询角色有关的用户部门
// List<Long> agentDeptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
List<Long> agentDeptIds = new ArrayList<>();
agentDeptIds.add(sysUser.getDeptId());
caseApplication.setAgentDeptIds(agentDeptIds);
}
caseApplications = caseApplicationMapper.list(caseApplication,caseStatusList, roleNames);
setArbitorMethod(caseApplications);
return caseApplications;
}
/**
* 设置仲裁方式
* @param caseApplications
*/
private void setArbitorMethod(List<CaseApplication> caseApplications) {
if(CollectionUtil.isEmpty(caseApplications)){
return;
}
for(CaseApplication caseApplicationsel : caseApplications){
Integer caseStatus = caseApplicationsel.getCaseStatus();
if(caseStatus.intValue() == CaseApplicationConstants.CHECK_ARBITRATION_METHOD){
Integer applicantIsWrittenHear = caseApplicationsel.getApplicantIsWrittenHear();
Integer respondentIsWrittenHear = caseApplicationsel.getRespondentIsWrittenHear();
if(applicantIsWrittenHear!=null&&respondentIsWrittenHear!=null){
if(applicantIsWrittenHear.intValue()==respondentIsWrittenHear.intValue()){
caseApplicationsel.setArbitraMethodIssame(1);
if(applicantIsWrittenHear.intValue()==1&&respondentIsWrittenHear.intValue()==1){
caseApplicationsel.setArbitratMethod(2);
}else {
caseApplicationsel.setArbitratMethod(1);
}
}else {
caseApplicationsel.setArbitraMethodIssame(2);
String applicantarbitratMethod = "";
String respondentbitratMethod = "";
if(applicantIsWrittenHear.intValue()==1){
applicantarbitratMethod = "书面审理";
}else {
applicantarbitratMethod = "开庭审理";
}
if(respondentIsWrittenHear.intValue()==1){
respondentbitratMethod = "书面审理";
}else {
respondentbitratMethod = "开庭审理";
}
String arbitratMethodIllustrate = "当前案件开庭方式:申请人选择开庭方式为"+applicantarbitratMethod+
"被申请人选择开庭方式为"+respondentbitratMethod+",请确定开庭方式。";
caseApplicationsel.setArbitratMethodIllustrate(arbitratMethodIllustrate);
}
}
}
}
}
@Override
public ToDoCount selectToDoCount() {
// // 获取登录用户
// LoginUser loginUser = getLoginUser();
// SysUser user = loginUser.getUser();
// Long userId = user.getUserId();
//
// // 查询登录人信息
// SysUser sysUser = sysUserMapper.selectUserById(userId);
// List<SysRole> roles = sysUser.getRoles();
// // 没有角色不能查看案件列表
// if (CollectionUtil.isEmpty(roles)) {
// throw new ServiceException("该用户没有角色权限");
// }
// CaseApplication caseApplication = new CaseApplication();
// List<Integer> caseStatusList = new ArrayList<>();
// for (SysRole role : roles) {
// if (StrUtil.isEmpty(role.getRoleName())) {
// continue;
// }
// // 超级管理员和仲裁委(部门长)案件,可查看所有案件 √
// if (role.getRoleName().equals("超级管理员")
// ) {
// return caseApplicationMapper.selectAdminCaseToDoCount();
// }
// if ("仲裁委".equals(role.getRoleName())
// || "部门长".equals(role.getRoleName())) {
// caseApplication.setIsOtherRole(1);
// caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
// caseStatusList.add(CaseApplicationConstants.CHECK_ARBITRATION);
// // caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL);
// caseApplication.setDeptHeadStatus(caseStatusList);
// }
// if ("仲裁员".equals(role.getRoleName())) {
// caseApplication.setIsOtherRole(1);
// caseApplication.setUserId(String.valueOf(userId));
// }
// if ("财务".equals(role.getRoleName())) {
// caseApplication.setIsOtherRole(1);
// caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
// }
// if ("法律顾问".equals(role.getRoleName())) {
// // 查询角色有关的用户部门
// // List<Long> deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
// List<Long> deptIds = new ArrayList<>();
// deptIds.add(sysUser.getDeptId());
// caseApplication.setDeptIds(deptIds);
// }
// if ("申请人".equals(role.getRoleName())) {
// caseApplication.setIsOtherRole(1);
// // 查询角色有关的用户部门
// caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
// }
// if ("被申请人".equals(role.getRoleName())) {
// caseApplication.setIsOtherRole(1);
// //
// caseApplication.setIdCard(String.valueOf(sysUser.getIdCard()));
// }
// if ("代理人".equals(role.getRoleName())) {
// caseApplication.setIsOtherRole(1);
// // 查询角色有关的用户部门
// // List<Long> agentDeptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
// List<Long> agentDeptIds = new ArrayList<>();
// agentDeptIds.add(sysUser.getDeptId());
// caseApplication.setAgentDeptIds(agentDeptIds);
// }
// }
//
//
// // 根据条件查询申请人,被申请人,仲裁员,法律顾问案件
// ToDoCount toDoCount = caseApplicationMapper.selectTodoCountByRole(caseApplication);
// if (toDoCount == null) {
// return new ToDoCount();
// }
LoginUser loginUser = getLoginUser();
SysUser user = loginUser.getUser();
Long userId = user.getUserId();
// 查询登录人,根据邮箱查询
SysUser sysUser = sysUserMapper.selectUserById(userId);
if(sysUser==null){
throw new ServiceException("未获取到登录用户信息");
}
// 根据条件查询申请人,被申请人,仲裁员,法律顾问案件
ToDoCount toDoCount = caseApplicationMapper.selectTodoCountByRole(caseApplication);
if (toDoCount == null) {
return new ToDoCount();
List<SysRole> roles = sysUser.getRoles();
// 没有角色不能查看案件列表
if (CollectionUtil.isEmpty(roles)) {
throw new ServiceException("该用户没有角色权限");
}
List<Integer> caseStatusList = new ArrayList<>();
List<String> roleNames = roles.stream().map(SysRole::getRoleName).collect(Collectors.toList());
ToDoCount toDoCount=null;
CaseApplication caseApplication = new CaseApplication();
for (SysRole role : roles) {
if(StrUtil.isEmpty(role.getRoleName())){
continue;
}
// 查看所有权限
if("超级管理员".equals(role.getRoleName())){
toDoCount = caseApplicationMapper.selectTodoCountByRole(caseApplication,caseStatusList,null);
if(toDoCount==null){
toDoCount=new ToDoCount();
}
return toDoCount;
}
caseApplication.setLoginUserName(sysUser.getUserName());
caseApplication.setLoginUserPhone(sysUser.getPhonenumber());
if("申请人".equals(role.getRoleName())){
// 申请人在生成裁决书之前都可以修改案件
Integer[] array = {0,-1,1,2,3,4,5,6,7,8,9,10,31};
caseStatusList.addAll(Arrays.asList(array));
}
if("被申请人".equals(role.getRoleName())) {
// 案件质证,开庭审理,书面审理
caseStatusList.add(4);
caseStatusList.add(8);
caseStatusList.add(9);
}
if("仲裁员".equals(role.getRoleName())){
Integer[] array = {7,8,9,13,18};
caseStatusList.addAll(Arrays.asList(array));
caseApplication.setArbitratorId(String.valueOf(sysUser.getUserId()));
}
if ("仲裁委".equals(role.getRoleName())
|| "部门长".equals(role.getRoleName())) {
// 组庭确定,部门长审核裁决书
caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
caseStatusList.add(CaseApplicationConstants.CHECK_ARBITRATION);
}
if ("财务".equals(role.getRoleName())) {
caseStatusList.add(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
}
if ("法律顾问".equals(role.getRoleName()) || "秘书".equals(role.getRoleName()) ) {
Integer[] array = {1,5,8,9,11,14,15,16,31};
caseStatusList.addAll(Arrays.asList(array));
}
}
toDoCount = caseApplicationMapper.selectTodoCountByRole(caseApplication,caseStatusList,roleNames);
if(toDoCount==null){
toDoCount=new ToDoCount();
}
return toDoCount;
}
@@ -456,6 +649,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
caseLogRecord.setCaseAppliId(id);
List<CaseLogRecord> records = caseLogRecordMapper.selectCaseLogRecordList(caseLogRecord);
CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
// 当前案件节点
Integer caseStatus = caseApplicationselect.getCaseStatus();
if (caseStatus.intValue() != 0) {
CaseLogRecord caseLogRecordin = getInCasenode(caseStatus);
@@ -733,7 +927,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
CaseLogRecord caseLogRecord9 = new CaseLogRecord();
caseLogRecord8.setCaseNode(9);
caseLogRecord8.setCaseNodeName("开庭审理");
caseLogRecord8.setContent("仲裁员将进行开庭审理");
caseLogRecord8.setContent("仲裁员,申请人,被申请人,法律顾问将进行开庭审理");
CaseLogRecord caseLogRecord11 = new CaseLogRecord();
caseLogRecord9.setCaseNode(11);
caseLogRecord9.setCaseNodeName("书面审理");
@@ -758,7 +952,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
caseLogRecord15.setCaseNode(16);
caseLogRecord15.setCaseNodeName("裁决书送达");
caseLogRecord15.setContent("法律顾问将进行裁决书送达");
CaseLogRecord caseLogRecord17 = new CaseLogRecord();
caseLogRecord16.setCaseNode(17);
caseLogRecord16.setCaseNodeName("案件归档");
caseLogRecord16.setContent("法律顾问将进行案件归档");
@@ -1021,8 +1214,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
caseLogRecord.setContent("法律顾问正在进行案件归档");
break;
default:
caseLogRecord.setCaseNodeName("无案件状态");
caseLogRecord.setContent("无操作内容");
caseLogRecord.setCaseNodeName("");
caseLogRecord.setContent("");
}
return caseLogRecord;
@@ -1416,11 +1609,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
maxVersion = 1;
}
caseApplication.setVersion(maxVersion + 1);
LoginUser loginUser = getLoginUser();
// 异步新增案件日志
ThreadPoolUtil.execute(() -> {
try {
//新增案件日志记录
insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_EDIT, "修改案件信息");
insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_EDIT, "修改案件信息",loginUser);
caseApplication.setCaseAppliId(caseApplication.getId());
caseApplication.setCaseLogId(IdWorkerUtil.getId());
int insertRow = caseApplicationLogMapper.insert(caseApplication);
@@ -1723,6 +1917,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
caseApplicationselect.setArbitrateRecord(arbitrateRecordselect);
if(arbitrateRecordselect!=null){
caseApplicationselect.setPayRejectReason(arbitrateRecordselect.getPayRejectReason());
// 仲裁员审核驳回原因
caseApplicationselect.setArbitrateReject(arbitrateRecordselect.getArbitrateReject());
}
}
@@ -1877,43 +2073,30 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
@Override
@Transactional
public AjaxResult pendTralCheck(CaseApplication caseApplication) {
// todo 需要传仲裁员id
Integer isAgreePendTral = caseApplication.getIsAgreePendTral();
caseApplication.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
int rows = 0;
//同意组庭
if (isAgreePendTral != null && isAgreePendTral == 1) {
CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
if(caseApplicationselect==null){
throw new ServiceException("案件不存在");
}
String arbitratorId = caseApplicationselect.getArbitratorId();
String arbitratorName = caseApplicationselect.getArbitratorName();
List<Arbitrator> arbitrators = caseApplication.getArbitrators();
if(arbitrators != null && arbitrators.size() > 0 && StringUtils.isEmpty(arbitratorId) && StringUtils.isEmpty(arbitratorName)){
List<Long> ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList());
List<String> arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList());
String idstr = ids.stream().map(Object::toString).collect(Collectors.joining(","));
String arbitratorNamestr = arbitratorNames.stream().map(Object::toString).collect(Collectors.joining(","));
caseApplication.setArbitratorId(idstr);
caseApplication.setArbitratorName(arbitratorNamestr);
caseApplication.setLockStatus(1);
rows = caseApplicationMapper.submitCaseApplication(caseApplication);
}
} else {
List<Arbitrator> arbitrators = caseApplication.getArbitrators();
// 仲裁员信息
if (arbitrators != null && arbitrators.size() > 0) {
List<Long> ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList());
List<String> arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList());
String idstr = ids.stream().map(Object::toString).collect(Collectors.joining(","));
String arbitratorNamestr = arbitratorNames.stream().map(Object::toString).collect(Collectors.joining(","));
caseApplication.setArbitratorId(idstr);
caseApplication.setArbitratorName(arbitratorNamestr);
caseApplication.setLockStatus(1);
rows = caseApplicationMapper.submitCaseApplication(caseApplication);
}
}
caseApplication.setLockStatus(1);
rows = caseApplicationMapper.submitCaseApplication(caseApplication);
// List<Arbitrator> arbitrators = caseApplication.getArbitrators();
// if( StringUtils.isEmpty(arbitratorId) && StringUtils.isEmpty(arbitratorName)){
// List<Long> ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList());
// List<String> arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList());
// String idstr = ids.stream().map(Object::toString).collect(Collectors.joining(","));
// String arbitratorNamestr = arbitratorNames.stream().map(Object::toString).collect(Collectors.joining(","));
// caseApplication.setArbitratorId(idstr);
// caseApplication.setArbitratorName(arbitratorNamestr);
// caseApplication.setLockStatus(1);
// rows = caseApplicationMapper.submitCaseApplication(caseApplication);
// }
// 新增日志
insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL, "");
return success();
@@ -164,21 +164,6 @@ public class CaseZipImportImpl {
}
File[] files = directory.listFiles();
// List<CaseApplication> caseApplications = new ArrayList<>();
// for (File file1 : files) {
// if (file1.isDirectory() && file1.listFiles() != null) {
//
// for (File file2 : file1.listFiles()) {
// CaseApplication caseApplication = buildCaseInfo(file2, templateId, fatchRuleList, fatchRuleMap, userMap, dictDataList, deptMap, SecurityUtils.getLoginUser());
// if (caseApplication != null) {
// caseApplications.add(caseApplication);
// }
// }
// }
// }
// if(caseApplications.size()>0){
// return success("导入成功");
// }
CaseZipImportTask caseZipImportTask = null;
try {
caseZipImportTask = new CaseZipImportTask(this, templateId, fatchRuleList, fatchRuleMap, userMap, dictDataList, files , deptMap, SecurityUtils.getLoginUser());
@@ -318,6 +303,8 @@ public class CaseZipImportImpl {
ThreadPoolUtil.execute(() -> {
try {
caseApplicationMapper.insertCaseApplication(caseApplication);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, "",loginUser);
caseApplicationLogMapper.insert(caseApplication);
// 多线程执行
if (CollectionUtil.isNotEmpty(addUsers)) {
@@ -347,28 +334,7 @@ public class CaseZipImportImpl {
columnValueMapper.batchSave(columnValueList);
columnValueLogMapper.batchSave(columnValueList);
}
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, "",loginUser);
// 发送短信
// if (CollectionUtil.isNotEmpty(smsRequestList)) {
// Map<Long, SmsSendRecord> sendRecordMap = null;
// if (CollectionUtil.isNotEmpty(smsSendRecordList)) {
// sendRecordMap = smsSendRecordList.stream().collect(Collectors.toMap(SmsSendRecord::getCaseId, Function.identity()));
// for (SmsUtils.SendSmsRequest sendSmsRequest : smsRequestList) {
// Boolean aBoolean = SmsUtils.sendSms(request);
// if (sendRecordMap != null && sendRecordMap.containsKey(sendSmsRequest.getCaseId())) {
// if (aBoolean) {
// sendRecordMap.get(sendSmsRequest.getCaseId()).setSendStatus(1);
// } else {
// sendRecordMap.get(sendSmsRequest.getCaseId()).setSendStatus(0);
// }
// }
// }
// smsRecordMapper.batchSaveSmsSendRecord(smsSendRecordList);
// }
//
//
// }
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("导入失败,请检查抓取规则是否正确");
@@ -19,6 +19,9 @@
<result property="respondentOpinion" column="respondent_opinion" />
<result property="applicantOpinion" column="applicant_opinion" />
<result property="payRejectReason" column="pay_reject_reason" />
<result property="arbitrateReject" column="arbitrate_reject" />
<result property="deptorReject" column="deptor_reject" />
<result property="caseCheckReject" column="case_check_reject" />
</resultMap>
@@ -92,9 +95,7 @@
<select id="selectArbitrateRecord" parameterType="ArbitrateRecord" resultMap="ArbitrateRecordResult">
SELECT a.id ,a.case_appli_id ,a.eviden_determi ,a.fact_determi ,a.case_sketch ,a.arbitrate_think ,a.ruling_follows ,
a.verifica_opinion ,a.check_opinion,a.annex_id,a.case_focus,a.case_facts,a.respondent_opinion,a.applicant_opinion,
a.case_check_reject ,a.arbitrate_reject,a.deptor_reject,a.pay_reject_reason
SELECT a.*
from arbitrate_record a
<where>
<if test="caseAppliId != null ">
@@ -570,129 +570,10 @@
sum( case when t1.case_status=18 then 1 else 0 end) arbitratorApplyAwardConfirm,
sum( case when t1.case_status=31 then 1 else 0 end) updateOnlineHearDate
from(
<trim suffixOverrides="union">
<!--被申请人,仲裁员,部门长,财务,代理人案件-->
<if test="isOtherRole!=null and isOtherRole==1">
select DISTINCT(t.id),t.case_status,t.application_organ_id, t.arbitrator_id,t.identity_num ,
t.identity_type from(
select c.id ,
c.case_status,ca.application_organ_id,
c.arbitrator_id,ca.identity_num , ca.identity_type
from case_application c
JOIN case_affiliate ca ON ca.case_appli_id = c.id
<where>
<if test="caseStatus != null">
AND c.case_status = #{caseStatus}
</if>
<if test="caseStatusList != null and caseStatusList.size() > 0">
and c.case_status in
<foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
#{caseStatus}
</foreach>
</if>
</where>
) t
<where>
<!--被申请人-->
<if test="idCard != null and idCard != ''">
or (t.identity_num=#{idCard} AND t.identity_type=2 and (t.case_status=4 or t.case_status=17))
</if>
<!--仲裁员-->
<if test="userId != null and userId != ''">
or ( t.identity_type=1 and
t.case_status in (7,13,17,18)
and
instr (t.arbitrator_id,#{userId})>0)
</if>
<!--申请人-->
<if test="applicationOrganId != null and applicationOrganId != ''">
or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1
and t.case_status in (0,2,17))
</if>
<!--部门长-->
<if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
or (t.identity_type=1 and t.case_status in
<foreach item="caseStatus" collection="deptHeadStatus" open="(" separator="," close=")">
#{caseStatus}
</foreach>)
</if>
<!--财务-->
<if test="financeStatus != null and financeStatus != ''">
or ( t.identity_type=1 and t.case_status =#{financeStatus})
</if>
<!--代理人-->
<if test="agentDeptIds != null and agentDeptIds.size()>0">
or (
t.application_organ_id in
<foreach item="deptId" collection="agentDeptIds" open="(" separator="," close=")">#{deptId}
</foreach>
AND t.identity_type=1
and t.case_status in (0,9))
</if>
</where>
union
</if>
<!--秘书案件-->
<if test="deptIds != null and deptIds.size() > 0">
select c.id ,
c.case_status,ca.application_organ_id,
c.arbitrator_id,ca.identity_num , ca.identity_type
FROM
case_application c
JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type = 1
JOIN case_application_log l on l.case_appli_id=c.id and l.update_submit_status not in(1, 2) and
l.version
= (
SELECT
max( version ) version
FROM
case_application_log
WHERE case_appli_id = c.id
)
WHERE
ca.identity_type=1
and c.case_status in (1,5,8,9,11,14,15,16,17,31)
<!-- <if test="deptIds != null and deptIds.size() > 0">
and ca.application_organ_id in
<foreach item="item" collection="deptIds" open="(" separator="," close=")">
#{item}
</foreach>
</if> -->
<if test="caseStatus != null">
AND c.case_status = #{caseStatus}
</if>
<if test="nameId != null and nameId != ''">
AND ca.application_organ_id=#{nameId} AND ca.identity_type=1
</if>
union
select c.id ,
c.case_status,ca.application_organ_id,
c.arbitrator_id,ca.identity_num , ca.identity_type
FROM
case_application c
JOIN case_application_log l ON c.id = l.case_appli_id
JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id
AND ca.identity_type = 1
WHERE
l.update_submit_status IN ( 1, 2 ) and ca.identity_type=1
AND l.version = (
SELECT
max( version ) version
FROM
case_application_log
WHERE
c.id = case_appli_id)
</if>
</trim>
select c.id,c.case_status
from case_application c
JOIN case_affiliate ca ON ca.case_appli_id = c.id
<include refid="SELECT_LIST_QUERY"/>
) t1
</select>
@@ -1114,17 +995,13 @@
<if test="caseResult != null and caseResult != ''">case_result = #{caseResult},</if>
<if test="caseStatus != null">case_status = #{caseStatus},</if>
<if test="properPreser != null">proper_preser = #{properPreser},</if>
<if test="applicantIsWrittenHear != null">appli_iswrit_hear = #{applicantIsWrittenHear},</if>
<if test="respondentIsWrittenHear != null">respon_isWrit_hear = #{respondentIsWrittenHear},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="caseNum != null and caseNum != ''">case_num = #{caseNum},</if>
<if test="version != null ">version = #{version},</if>
<if test="facts != null and facts != ''">facts = #{facts},</if>
<if test="mediationAgreement != null and mediationAgreement != ''">mediation_agreement =
#{mediationAgreement},
</if>
<if test="mediationAgreement != null and mediationAgreement != ''"> mediation_agreement = #{mediationAgreement} </if>
update_time = sysdate()
</set>
where id = #{id}
@@ -1366,7 +1243,7 @@
SELECT count(1)
from case_application c
where c.arbitrator_id = #{userId}
and c.case_status in(8,9)
and c.case_status!=17
</select>
<select id="selectCaseIdByRoomId" resultType="java.lang.Long">
@@ -1382,6 +1259,161 @@
select max(batch_number+0) as maxBatchNumber
from case_application ;
</select>
<sql id="SELECT_LIST_QUERY">
<where>
<!-- 案件状态查询-->
<if test="caseStatusList != null and caseStatusList.size()>0">
and c.case_status in
<foreach collection="caseStatusList" item="caseStatus" open="(" separator="," close=")">
#{caseStatus}
</foreach>
</if>
<if test="caseStatusList == null or caseStatusList.size()==0">
and ca.identity_type=1
</if>
<if test="roleNames != null and roleNames.size()>0 and roleNames.contains('申请人')
and caseApplication.loginUserPhone != null and caseApplication.loginUserPhone != ''">
<!-- 申请人,根据电话查询-->
and ca.identity_type=1
and ( ca.contact_telphone=#{caseApplication.loginUserPhone}
or ca.contact_telphone_agent=#{caseApplication.loginUserPhone}
)
</if>
<if test="roleNames != null and roleNames.size()>0 and roleNames.contains('被申请人')
and caseApplication.loginUserPhone != null and caseApplication.loginUserPhone != ''">
<!-- 被申请人查询,根据电话查询-->
and ca.identity_type=2
and ( ca.contact_telphone=#{caseApplication.loginUserPhone}
or ca.contact_telphone_agent=#{caseApplication.loginUserPhone}
)
</if>
<if test="caseApplication.arbitratorId !=null and caseApplication.arbitratorId!=''">
<!-- 仲裁员查询-->
and c.arbitrator_id=#{caseApplication.arbitratorId}
</if>
</where>
</sql>
<select id="list" resultMap="CaseApplicationResult">
select DISTINCT(t1.id),t1.caseLogId,t1.case_num,t1.case_subject_amount,t1.register_date,t1.arbitrat_method,
t1.arbitratMethodName,t1.case_status,t1.caseStatusName,t1.hear_date,t1.arbitrat_claims,
t1.loan_start_date,t1.loan_end_date,t1.claim_princi_owed,t1.claim_interest_owed,t1.claim_liquid_damag,t1.fee_payable,
t1.begin_video_date,t1.online_video_person,t1.contract_number,t1.create_by,t1.create_time,t1.appli_iswrit_hear,t1.respon_isWrit_hear,t1.update_by,t1.update_time,
t1.arbitrator_name,t1.name,t1.application_organ_id,t1.applicantName,t1.arbitrator_id,t1.identity_num,t1.identity_type,
t1.filearbitra_url,t1.lock_status,t1.version,t1.updateSubmitStatus,t1.batch_number,t1.pendingStatus
from(
select c.id ,'' AS caseLogId,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
ELSE ''
END arbitratMethodName,
c.case_status ,
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书'
when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印'
when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档'
when 18 then '待仲裁员审核裁决书'
when 31 then '待修改开庭时间'
ELSE ''
END caseStatusName,
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.appli_iswrit_hear,c.respon_isWrit_hear,
c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name
as applicantName,
c.arbitrator_id,ca.identity_num ,ca.identity_type,c.filearbitra_url,c.lock_status,c.version,null as
updateSubmitStatus,c.batch_number,0 as pendingStatus
from case_application c
JOIN case_affiliate ca ON ca.case_appli_id = c.id
<include refid="SELECT_LIST_QUERY"/>
union
<!-- 已办案件 -->
SELECT
c.id,
'' AS caseLogId,
c.case_num,
c.case_subject_amount,
c.register_date,
c.arbitrat_method,
CASE
c.arbitrat_method
WHEN 1 THEN
'开庭审理'
WHEN 2 THEN
'书面审理' ELSE ''
END arbitratMethodName,
c.case_status,
CASE
c.case_status
when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书'
when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印'
when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档'
when 18 then '待仲裁员审核裁决书'
when 31 then '待修改开庭时间' ELSE ''
END caseStatusName,
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.appli_iswrit_hear,c.respon_isWrit_hear,
c.update_by,
c.update_time,
c.arbitrator_name,
ca.name,
ca.application_organ_id ,
ca.application_organ_name AS applicantName,
c.arbitrator_id,ca.identity_num ,ca.identity_type,
c.filearbitra_url,
c.lock_status,c.version,
null as updateSubmitStatus,
c.batch_number,1 as pendingStatus
from case_log_record r
join case_application c on r.case_appli_id=c.id
JOIN case_affiliate ca ON ca.case_appli_id = c.id
WHERE
r.create_by=#{caseApplication.loginUserName} AND ca.identity_type=1
and c.id not in(
select c.id
from case_application c
JOIN case_affiliate ca ON ca.case_appli_id = c.id
<include refid="SELECT_LIST_QUERY"/>
)
) t1
<where>
<if test="caseApplication.caseStatus != null">
AND t1.case_status = #{caseApplication.caseStatus}
</if>
<if test="caseApplication.lockStatus != null">
AND t1.lock_status = #{caseApplication.lockStatus}
</if>
<if test="caseApplication.caseNum != null and caseApplication.caseNum != ''">
AND t1.case_num = #{caseApplication.caseNum}
</if>
<if test="caseApplication.batchNumber != null">
AND t1.batch_number = #{caseApplication.batchNumber}
</if>
<!-- <if test="nameId != null and nameId != ''">-->
<!-- AND t1.application_organ_id=#{nameId} AND t1.identity_type=1-->
<!-- </if>-->
</where>
order by t1.pendingStatus asc,t1.create_time desc
</select>
</mapper>
@@ -40,7 +40,7 @@
when 26 then '证据确认成功'
when 31 then '修改开庭时间'
when 18 then '仲裁员审核裁决书'
ELSE '无案件状态'
ELSE ''
END content,
CASE cl.case_node when 0 then '申请人' when 1 then '申请人' when 2 then '法律顾问'
when 3 then '申请人' when 4 then '财务' when 5 then '被申请人'