diff --git a/ruoyi-admin/pom.xml b/ruoyi-admin/pom.xml index 2186d33..aa89964 100644 --- a/ruoyi-admin/pom.xml +++ b/ruoyi-admin/pom.xml @@ -9,7 +9,8 @@ 4.0.0 jar - ruoyi-admin + SmartArbitrate + 1.1.0 web服务入口 @@ -94,7 +95,7 @@ - ${project.artifactId} + ${project.artifactId}-${project.version} \ No newline at end of file diff --git a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java index 775f772..6aa07d8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java @@ -1,10 +1,20 @@ package com.ruoyi; +import cn.hutool.core.collection.CollectionUtil; +import com.ruoyi.common.constant.CacheConstants; +import com.ruoyi.common.core.domain.entity.SysRole; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.utils.spring.SpringUtils; +import com.ruoyi.system.mapper.SysRoleMapper; +import com.ruoyi.system.mapper.SysUserMapper; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.scheduling.annotation.EnableScheduling; +import java.util.List; + /** * 启动程序 * @@ -18,15 +28,28 @@ public class RuoYiApplication { // System.setProperty("spring.devtools.restart.enabled", "false"); SpringApplication.run(RuoYiApplication.class, args); - System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" + - " .-------. ____ __ \n" + - " | _ _ \\ \\ \\ / / \n" + - " | ( ' ) | \\ _. / ' \n" + - " |(_ o _) / _( )_ .' \n" + - " | (_,_).' __ ___(_ o _)' \n" + - " | |\\ \\ | || |(_,_)' \n" + - " | | \\ `' /| `-' / \n" + - " | | \\ / \\ / \n" + - " ''-' `'-' `-..-' "); + System.out.println(" __ _ \n" + + " ____ / /_ ____ ____ ____ _ _________ _(_)\n" + + "/_ / / __ \\/ __ \\/ __ \\/ __ `/ / ___/ __ `/ / \n" + + " / /_/ / / / /_/ / / / / /_/ / / /__/ /_/ / / \n" + + "/___/_/ /_/\\____/_/ /_/\\__, / \\___/\\__,_/_/ \n" + + " /____/ "); + // 启动成功后,查询用户表,将用户信息存到redis + RedisCache redisCache = SpringUtils.getBean(RedisCache.class); + SysUserMapper userMapper = SpringUtils.getBean(SysUserMapper.class); + List sysUsers = userMapper.selectUserListByIds(null); + if(CollectionUtil.isNotEmpty(sysUsers)){ + for (SysUser sysUser : sysUsers) { + redisCache.setCacheObject(CacheConstants.USER_KEY+sysUser.getUserId(),sysUser); + } + } + // 初始化角色redis + SysRoleMapper roleMapper = SpringUtils.getBean(SysRoleMapper.class); + List roles = roleMapper.selectRoleList(new SysRole()); + if(CollectionUtil.isNotEmpty(roles)){ + for (SysRole role : roles) { + redisCache.setCacheObject(CacheConstants.ROLE_KEY+role.getRoleName(),role.getRoleId()); + } + } } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java index cec5006..af3c92e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java @@ -4,14 +4,15 @@ import java.util.ArrayList; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.CaseAttach; +import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import com.ruoyi.common.config.RuoYiConfig; import com.ruoyi.common.constant.Constants; @@ -36,6 +37,8 @@ public class CommonController private ServerConfig serverConfig; private static final String FILE_DELIMETER = ","; + @Autowired + CaseAttachMapper caseAttachMapper; /** * 通用下载请求 @@ -160,4 +163,22 @@ public class CommonController log.error("下载文件失败", e); } } + /** + * 根据案件id获取附件 + * @param caseAppliId + * @param annexTypeList + * @param + * @return + */ + @GetMapping("/fileList") + public AjaxResult fileList(@RequestParam("caseAppliId")Long caseAppliId, @RequestParam(value = "annexTypeList",required = false) List annexTypeList){ + if(caseAppliId==null){ + return AjaxResult.error("案件id不能为空"); + } + CaseApplication msCaseApplicationVO = new CaseApplication(); + msCaseApplicationVO.setId(caseAppliId); + msCaseApplicationVO.setAnnexTypeList(annexTypeList); + List caseAttachList = caseAttachMapper.queryCaseAttachList(msCaseApplicationVO); + return AjaxResult.success(caseAttachList); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java index 59e7588..ca6e9fe 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java @@ -37,7 +37,7 @@ public class SysDeptController extends BaseController /** * 获取部门列表 */ - @PreAuthorize("@ss.hasPermi('system:dept:list')") +// @PreAuthorize("@ss.hasPermi('system:dept:list')") @GetMapping("/list") public AjaxResult list(SysDept dept) { diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java index 03b6b65..f519d6d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java @@ -139,4 +139,13 @@ public class SysMenuController extends BaseController } return toAjax(menuService.deleteMenuById(menuId)); } + /** + * 根据用户查询菜单权限字符 + */ + @GetMapping("/getMenuPermsByUser") + public AjaxResult getMenuPermsByUser() + { + + return menuService.getMenuPermsByUser(); + } } \ No newline at end of file diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java index 7af5a47..208af01 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java @@ -1,11 +1,17 @@ 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; import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.exception.EsignDemoException; +import com.ruoyi.wisdomarbitrate.StringIdsReq; import com.ruoyi.wisdomarbitrate.domain.BatchCaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.SealSignRecord; import com.ruoyi.wisdomarbitrate.domain.vo.BookSendVO; import com.ruoyi.wisdomarbitrate.domain.vo.LogisticsInfoVO; import com.ruoyi.wisdomarbitrate.service.IAdjudicationService; @@ -14,6 +20,7 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.io.IOException; import java.util.List; @RestController @@ -22,7 +29,65 @@ public class AdjudicationController extends BaseController { @Autowired private IAdjudicationService adjudicationService; + /** + * 根据签署流程id查询批量签名链接 + */ +// @PreAuthorize("@ss.hasPermi('caseManagement:list:selectSignUrl')") + @PostMapping("/selectBatchSignUrl") + public AjaxResult selectBatchSignUrl(@RequestBody StringIdsReq idsReq) { + if(CollectionUtil.isEmpty(idsReq.getIds())|| StrUtil.isEmpty(idsReq.getPsnAccount())){ + return error("参数校验失败"); + } + SealSignRecord sealSignRecordselect = adjudicationService.selectBatchSignUrl(idsReq); + return success(sealSignRecordselect); + } + /** + * 根据批号查询批量签名链接 + */ +// @PostMapping("/getSignUrlBatch") +// public AjaxResult getSignUrlBatch(@RequestBody StringIdsReq idsReq) { +// if(StrUtil.isEmpty(idsReq.getBatchNumber().toString())|| StrUtil.isEmpty(idsReq.getPsnAccount())){ +// return error("参数校验失败"); +// } +// SealSignRecord sealSignRecordselect = adjudicationService.getSignUrlBatch(idsReq); +// return success(sealSignRecordselect); +// } + + /** + * 根据签署流程id查询批量用印链接 + */ +// @PreAuthorize("@ss.hasPermi('caseManagement:list:selectSignUrl')") + @PostMapping("/selectBatchSealUrl") + public AjaxResult selectBatchSealUrl(@RequestBody StringIdsReq idsReq) { + if(CollectionUtil.isEmpty(idsReq.getIds())|| StrUtil.isEmpty(idsReq.getPsnAccount())){ + return error("参数校验失败"); + } + SealSignRecord sealSignRecordselect = adjudicationService.selectBatchSealUrl(idsReq); + return success(sealSignRecordselect); + } + /** + * 根据仲裁员手机号分页查询待签名/待用印的案件 + */ +// @PreAuthorize("@ss.hasPermi('caseManagement:list:selectSignUrl')") + @GetMapping("/pageSignAdjudicate") + public TableDataInfo pageSignAdjudicate(@RequestParam(value = "personAccount",required = false) String personAccount, @RequestParam("caseStatus") Integer caseStatus) { + startPage(); + List list = adjudicationService.selectSealSigning(personAccount,caseStatus); + return getDataTable(list); + } + + /** + * 根据批号查询批量用印链接 + */ + @PostMapping("/getSealUrlBatch") + public AjaxResult getSealUrlBatch(@RequestBody StringIdsReq idsReq) { + if(StrUtil.isEmpty(idsReq.getBatchNumber().toString())|| StrUtil.isEmpty(idsReq.getPsnAccount())){ + return error("参数校验失败"); + } + SealSignRecord sealSignRecordselect = adjudicationService.getSealUrlBatch(idsReq); + return success(sealSignRecordselect); + } /** @@ -37,16 +102,32 @@ public class AdjudicationController extends BaseController { } return adjudicationService.createDocument(caseApplication); } - /** - * 重新生成裁决书 + * 开庭审理,确定审理结果,生成裁决书 * @param caseApplication * @return */ - @PostMapping("/regenerationDocument") - public AjaxResult regenerationDocument(@Validated @RequestBody CaseApplication caseApplication){ - return adjudicationService.regenerationDocument(caseApplication); + @PostMapping("/caseJudgment") + public AjaxResult caseJudgment(@Validated @RequestBody CaseApplication caseApplication){ + if (caseApplication.getId() == null) { + return AjaxResult.error("案件id不能为空"); + } + return adjudicationService.caseJudgment(caseApplication); } + /** + * 批量生成裁决书 + * @param caseApplication + * @return + */ + @PostMapping("/batchDocument") + public AjaxResult batchDocument(@Validated @RequestBody BatchCaseApplication caseApplication){ + if (CollectionUtil.isEmpty(caseApplication.getIds())) { + return AjaxResult.error("参数校验失败"); + } + return adjudicationService.batchDocument(caseApplication.getIds()); + } + + /** * 裁决书送达(电子邮件) @@ -63,23 +144,15 @@ public class AdjudicationController extends BaseController { * @param caseApplication * @return */ - @GetMapping("/logistics") -// @PreAuthorize("@ss.hasPermi('delivery:detail')") - public AjaxResult getLogisticsInfo(CaseApplication caseApplication){ - List logisticsInfo = adjudicationService.getLogisticsInfo(caseApplication); - return AjaxResult.success(logisticsInfo); - } +// @GetMapping("/logistics") +//// @PreAuthorize("@ss.hasPermi('delivery:detail')") +// public AjaxResult getLogisticsInfo(CaseApplication caseApplication){ +// List logisticsInfo = adjudicationService.getLogisticsInfo(caseApplication); +// return AjaxResult.success(logisticsInfo); +// } + + - /** - * 签名(暂时只改案件状态) - * @param caseApplication - * @return - */ - @PostMapping("/signature") -// @PreAuthorize("@ss.hasPermi('awardManagement:list:sign')") - public AjaxResult signature(@Validated @RequestBody CaseApplication caseApplication){ - return adjudicationService.signature(caseApplication); - } /** * 归档(暂时只改案件状态) @@ -95,6 +168,19 @@ public class AdjudicationController extends BaseController { return adjudicationService.caseFile(batchCaseApplication.getIds()); } + /** + * 批量归档(暂时只改案件状态) + * @param caseApplication + * @return + */ + @PostMapping("/caseFileBatch") + public AjaxResult caseFileBatch(@RequestBody CaseApplication caseApplication){ + if(StrUtil.isEmpty(caseApplication.getBatchNumber().toString())){ + return error("参数校验失败"); + } + return adjudicationService.caseFileBatch(caseApplication.getBatchNumber()); + } + /** * 送达(不包含发送电子邮件) * @param bookSendVO @@ -105,27 +191,32 @@ public class AdjudicationController extends BaseController { public AjaxResult service(@RequestBody BookSendVO bookSendVO){ return adjudicationService.service(bookSendVO.getId(),bookSendVO.getAppEmail(),bookSendVO.getResEmail(),bookSendVO.getApptrackingNum(),bookSendVO.getRestrackingNum()); } + /** - * 用印(暂时只改案件状态) + * 批量送达仲裁书 * @param caseApplication * @return */ - @PostMapping("/stamp") -// @PreAuthorize("@ss.hasPermi('awardManagement:list:signprint')") - public AjaxResult stamp(@Validated @RequestBody CaseApplication caseApplication){ - return adjudicationService.stamp(caseApplication); + @PostMapping("/serviceBatch") + public AjaxResult serviceBatch(@Validated @RequestBody CaseApplication caseApplication) throws EsignDemoException, IOException { + if(StrUtil.isEmpty(caseApplication.getBatchNumber().toString())){ + return error("参数校验失败"); + } + return adjudicationService.serviceBatch(caseApplication.getBatchNumber()); } + + /** * 档案详情查询 * @param id 案件id * @return */ - @GetMapping("/archives") - public AjaxResult getArchivesDetail(Long id){ - - return adjudicationService.getArchivesDetail(id); - } +// @GetMapping("/archives") +// public AjaxResult getArchivesDetail(Long id){ +// +// return adjudicationService.getArchivesDetail(id); +// } /** * 根据案件id获取邮箱 * @param id 案件id @@ -136,5 +227,17 @@ public class AdjudicationController extends BaseController { return adjudicationService.emailByCaseId(id); } + /** + * 开庭审理提交,只改变案件状态为CaseApplicationConstants.VERPRIF_ARBITRATION + * @param caseApplication 案件 + * @return + */ + @PostMapping("/changeCaseStatus") + public AjaxResult changeCaseStatus(@RequestBody CaseApplication caseApplication){ + if(caseApplication.getId()==null){ + return error("参数校验失败"); + } + return adjudicationService.changeCaseStatus(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/ArbitrateApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/ArbitrateApplicationController.java new file mode 100644 index 0000000..a3d82ad --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/ArbitrateApplicationController.java @@ -0,0 +1,55 @@ +package com.ruoyi.web.controller.wisdomarbitrate; + +import cn.hutool.json.JSONUtil; +import com.ruoyi.common.annotation.Anonymous; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.CheckSignatuerUtils; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.dto.CaseApplicationDTO; +import com.ruoyi.wisdomarbitrate.domain.vo.CaseApplicationVO; +import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/callArbitrateCaseApplication") +public class ArbitrateApplicationController extends BaseController { + @Autowired + private ICaseApplicationService caseApplicationService; + + + /** + * 新增立案数据 + */ + @Anonymous + @PostMapping("/generateCaseApplication") + public AjaxResult generateCaseApplication(@Validated @RequestBody CaseApplicationVO caseApplicationVO) throws Exception { + String paramsbody = JSONUtil.toJsonStr(caseApplicationVO); + boolean checkResult= CheckSignatuerUtils.checkSignuter(paramsbody); + if(checkResult){ + CaseApplicationDTO caseApplication = new CaseApplicationDTO(); + BeanUtils.copyProperties(caseApplicationVO,caseApplication); + caseApplication.setCreateBy(getUsername()); + return caseApplicationService.insertOrUpdate(caseApplication); + }else { + return AjaxResult.error("签名验证失败"); + } + + } + + + + + + + + + + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/ArbitratorController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/ArbitratorController.java index b4af1e4..5706937 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/ArbitratorController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/ArbitratorController.java @@ -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 list = sysUserService.selectUserListByAdRole(arbitrator); - return getDataTable(list); + return AjaxResult.success(list); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index da0cdab..5c0babc 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -2,34 +2,30 @@ package com.ruoyi.web.controller.wisdomarbitrate; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; -import com.alipay.api.internal.util.file.IOUtils; import com.ruoyi.common.annotation.Anonymous; import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.constant.FileTransformation; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.exception.EsignDemoException; -import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.WxAppletNotifyUtils; -import com.ruoyi.util.FileUtil; import com.ruoyi.wisdomarbitrate.domain.*; +import com.ruoyi.wisdomarbitrate.domain.dto.CaseApplicationDTO; import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO; import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO; import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount; +import com.ruoyi.wisdomarbitrate.service.IAdjudicationService; import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import com.ruoyi.common.utils.poi.ExcelUtil; import org.springframework.web.multipart.MultipartFile; -import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.InputStream; +import java.io.*; import java.net.URL; import java.net.URLEncoder; import java.util.List; @@ -40,8 +36,19 @@ import java.util.List; public class CaseApplicationController extends BaseController { @Autowired private ICaseApplicationService caseApplicationService; + @Autowired + private IAdjudicationService adjudicationService; + /** + * 根据登录人返回用户信息 + */ + @GetMapping("/getUserInfo") + public AjaxResult getUserInfo() + { + return success(caseApplicationService.getUserInfo()); + } + /** * 查询立案数据 */ @@ -51,11 +58,21 @@ public class CaseApplicationController extends BaseController { if(StrUtil.isEmpty(caseApplication.getSelectCaseStatus())){ caseApplication.setSelectCaseStatus("0"); } - startPage(); - List list = caseApplicationService.selectCaseApplicationListByRole(caseApplication); +// List list = caseApplicationService.selectCaseApplicationListByRole(caseApplication); + List list = caseApplicationService.page(caseApplication); return getDataTable(list); } +// /** +// * 查询批量管理案件列表 +// */ +// @GetMapping("/listBatch") +// public TableDataInfo listBatch(CaseApplication caseApplication) { +// startPage(); +// List list = caseApplicationService.selectCaseApplicationListBatchByRole(caseApplication); +// return getDataTable(list); +// } + /** * 根据角色查询待办数量 * @return @@ -74,24 +91,24 @@ public class CaseApplicationController extends BaseController { // @PreAuthorize("@ss.hasPermi('caseManagement:list:add')") @Log(title = "新增立案数据", businessType = BusinessType.INSERT) @PostMapping("/addCaseApplication") - public AjaxResult addCaseApplication(@Validated @RequestBody CaseApplication caseApplication) + public AjaxResult addCaseApplication(@Validated @RequestBody CaseApplicationDTO caseApplication) { caseApplication.setCreateBy(getUsername()); - return toAjax(caseApplicationService.insertcaseApplication(caseApplication)); + return caseApplicationService.insertOrUpdate(caseApplication); } /** * 修改立案数据 */ // @PreAuthorize("@ss.hasPermi('caseManagement:list:update')") - @Log(title = "修改立案数据", businessType = BusinessType.UPDATE) - @PostMapping("/editCaseApplication") - public AjaxResult editCaseApplication(@Validated @RequestBody CaseApplication caseApplication) { - - caseApplication.setUpdateBy(getUsername()); - return caseApplicationService.editCaseApplication(caseApplication); - } +// @Log(title = "修改立案数据", businessType = BusinessType.UPDATE) +// @PostMapping("/editCaseApplication") +// public AjaxResult editCaseApplication(@Validated @RequestBody CaseApplicationDTO caseApplication) { +// +// caseApplication.setUpdateBy(getUsername()); +// return caseApplicationService.editCaseApplication(caseApplication); +// } /** * 修改立案数据自定义字段 @@ -116,6 +133,19 @@ public class CaseApplicationController extends BaseController { return toAjax(caseApplicationService.submitCaseApplication(batchCaseApplication.getIds())); } + /** + * 批量提交立案申请 + */ + @Log(title = "批量提交立案申请", businessType = BusinessType.UPDATE) + @PostMapping("/submitCaseApplicationBatch") + public AjaxResult submitCaseApplicationBatch(@RequestBody BatchCaseApplication batchCaseApplication) { + if(StringUtils.isEmpty(batchCaseApplication.getBatchNumber())){ + return error("参数校验失败"); + } + return caseApplicationService.submitCaseApplicationBatch(batchCaseApplication.getBatchNumber()); + } + + /** @@ -132,7 +162,7 @@ public class CaseApplicationController extends BaseController { } /** - * 查询立案信息 + * 查询立案详情 */ // @PreAuthorize("@ss.hasPermi('caseManagement:list:detail')") @PostMapping("/selectCaseApplication") @@ -141,6 +171,18 @@ public class CaseApplicationController extends BaseController { CaseApplication caseApplicationselect = caseApplicationService.selectCaseApplication(caseApplication); return success(caseApplicationselect); } + /** + * 视频会议中查询立案详情 + */ +// @PreAuthorize("@ss.hasPermi('caseManagement:list:detail')") + @GetMapping("/selectById") + public AjaxResult selectById(@RequestParam(required = false) Long id ,@RequestParam(required = false) String caseNum) { + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setId(id); + caseApplication.setCaseNum(caseNum); + CaseApplication caseApplicationselect = caseApplicationService.selectCaseApplication(caseApplication); + return success(caseApplicationselect); + } /** * 查询已签署裁决书URL @@ -171,6 +213,7 @@ public class CaseApplicationController extends BaseController { return success(sealSignRecordselect); } + /** * 查询用印链接 */ @@ -250,7 +293,10 @@ public class CaseApplicationController extends BaseController { @Log(title = "组庭审核", businessType = BusinessType.UPDATE) @PostMapping("/pendTralCheck") public AjaxResult pendTralCheck(@Validated @RequestBody CaseApplication caseApplication) { - return toAjax(caseApplicationService.pendTralCheck(caseApplication)); + if(CollectionUtil.isEmpty(caseApplication.getArbitrators())){ + return error("请选择仲裁员"); + } + return caseApplicationService.pendTralCheck(caseApplication); } /** @@ -263,6 +309,25 @@ public class CaseApplicationController extends BaseController { return toAjax(caseApplicationService.pendTralSure(caseApplication)); } + /** + * 批量组庭审核 + */ +// @PreAuthorize("@ss.hasPermi('caseManagement:list:checkgroup')") + @Log(title = "批量组庭审核", businessType = BusinessType.UPDATE) + @PostMapping("/pendTralCheckBatch") + public AjaxResult pendTralCheckBatch(@Validated @RequestBody CaseApplication caseApplication) { + return toAjax(caseApplicationService.pendTralCheckBatch(caseApplication)); + } + + /** + * 批量组庭确认 + */ + @Log(title = "批量组庭确认", businessType = BusinessType.UPDATE) + @PostMapping("/pendTralSureBatch") + public AjaxResult pendTralSureBatch(@Validated @RequestBody CaseApplication caseApplication) { + return toAjax(caseApplicationService.pendTralSureBatch(caseApplication)); + } + /** * 修改开庭时间 */ @@ -303,6 +368,35 @@ public class CaseApplicationController extends BaseController { return caseApplicationService.arbitratorCheckArbitrateRecord(caseApplication); } + /** + * 批量操作仲裁员审核裁决书 + */ + @Log(title = "批量操作仲裁员审核裁决书", businessType = BusinessType.UPDATE) + @PostMapping("/arbitrator/checkArbitrateRecordBatch") + public AjaxResult arbitratorCheckArbitrateRecordBatch(@Validated @RequestBody CaseApplication caseApplication) { + + return caseApplicationService.arbitratorCheckArbitrateRecordBatch(caseApplication); + } + + /** + * 批量部门长审核裁决书 + */ + @Log(title = "批量部门长审核裁决书", businessType = BusinessType.UPDATE) + @PostMapping("/checkArbitrateRecordBatch") + public AjaxResult checkArbitrateRecordBatch(@Validated @RequestBody CaseApplication caseApplication) { + + return caseApplicationService.checkArbitrateRecordBatch(caseApplication); + } + + /** + * 批量核验裁决书 + */ + @Log(title = "批量核验裁决书", businessType = BusinessType.UPDATE) + @PostMapping("/verificationArbitrateRecordBatch") + public AjaxResult verificationArbitrateRecordBatch(@Validated @RequestBody CaseApplication caseApplication) { + return toAjax(caseApplicationService.verificationArbitrateRecordBatch(caseApplication)); + } + /** * 是否指派仲裁员 @@ -327,26 +421,32 @@ public class CaseApplicationController extends BaseController { return success(caseApplicationService.submitCaseApplicationCheck(batchCaseApplication.getIds(),batchCaseApplication.getAgreeOrNotCheck(),batchCaseApplication.getCaseCheckReject())); } - /** - * 确认缴费查询立案信息 - */ -// @PreAuthorize("@ss.hasPermi('paymentManagement:list:detail')") - @PostMapping("/selectCaseApplicationConfirm") - public AjaxResult selectCaseApplicationConfirm(@Validated @RequestBody CaseApplication caseApplication) { - CaseApplication caseApplicationselect = caseApplicationService.selectCaseApplicationConfirm(caseApplication); - return success(caseApplicationselect); - } /** - * 下载案件压缩包 + * 批量提交立案审查 */ - @PostMapping("/downloadCaseZipFile") - public AjaxResult downloadCaseZipFile(@Validated @RequestBody CaseApplication caseApplication) { - - CaseAttach caseAttach = caseApplicationService.downloadCaseZipFile(caseApplication); - return success(caseAttach); + @Log(title = "批量提交立案审查", businessType = BusinessType.UPDATE) + @PostMapping("/submitCaseApplicationCheckBatch") + public AjaxResult submitCaseApplicationCheckBatch(@RequestBody BatchCaseApplication batchCaseApplication) { + if(StringUtils.isEmpty(batchCaseApplication.getBatchNumber()) || batchCaseApplication.getAgreeOrNotCheck()==null){ + return error("参数校验失败"); + } + return caseApplicationService.submitCaseApplicationCheckBatch(batchCaseApplication.getBatchNumber(),batchCaseApplication.getAgreeOrNotCheck(),batchCaseApplication.getCaseCheckReject()); } +// /** +// * 下载案件压缩包 +// */ +// @PostMapping("/downloadCaseZipFile") +// public AjaxResult downloadCaseZipFile(@Validated @RequestBody CaseApplication caseApplication) { +// +// CaseAttach caseAttach = caseApplicationService.downloadCaseZipFile(caseApplication); +// return success(caseAttach); +// } + + + + /** * 发送房间号短信 @@ -367,25 +467,18 @@ public class CaseApplicationController extends BaseController { return success(schemeUrl); } - /** - * 生成庭审笔录 - * @param arbitrateRecord - * @return - */ - @PostMapping("/creatTrialRecord") -// @PreAuthorize("@ss.hasPermi('caseManagement:list:creatTrialRecord')") - public AjaxResult creatTrialRecord(@Validated @RequestBody ArbitrateRecord arbitrateRecord){ - return caseApplicationService.creatTrialRecord(arbitrateRecord); - } /** - * 记录庭审笔录 + * 确认会议结果 * @param arbitrateRecord * @return */ - @PostMapping("/creatTrialRecordnew") + @PostMapping("/confirmMeetingResult") // @PreAuthorize("@ss.hasPermi('caseManagement:list:creatTrialRecord')") - public AjaxResult creatTrialRecordnew(@Validated @RequestBody ArbitrateRecord arbitrateRecord){ + public AjaxResult creatTrialRecordnew( @RequestBody ArbitrateRecord arbitrateRecord){ + if(arbitrateRecord.getCaseAppliId()==null || arbitrateRecord.getAppliIsAbsen()==null || arbitrateRecord.getIsAbsence()==null){ + return error("参数校验失败"); + } return caseApplicationService.creatTrialRecordnew(arbitrateRecord); } @@ -403,17 +496,7 @@ public class CaseApplicationController extends BaseController { return AjaxResult.success(caseApplicationService.updateCaseLockStatus(caseApplication)); } - /** - * 查询短信发送记录 - * @param smsSendRecord - * @return - */ - @PostMapping("/smsRecord") - public TableDataInfo getSmsSendRecord(@RequestBody SmsSendRecord smsSendRecord){ - startPage(); - List list = caseApplicationService.getSmsSendRecord(smsSendRecord); - return getDataTable(list); - } + /** * 获取userSign * @param userId @@ -473,12 +556,14 @@ public class CaseApplicationController extends BaseController { /** * 案件压缩包导入 * @param file + * @param applicantType 申请人类型,自然人-1,机构-2 + * @param resType 被申请人类型,自然人-1,机构-2 * @return * @throws IOException */ @PostMapping("/uploadCaseZipFile") - public AjaxResult uploadCaseZipFile(@RequestParam("file") MultipartFile file,@RequestParam("templateId") Long templateId) throws IOException { - return caseApplicationService.uploadCaseZipFile(file,templateId); + public AjaxResult uploadCaseZipFile(@RequestParam("file") MultipartFile file,@RequestParam("templateId") Long templateId,Integer applicantType,Integer resType) throws IOException { + return caseApplicationService.uploadCaseZipFile(file,templateId,applicantType,resType); } /** @@ -493,4 +578,17 @@ public class CaseApplicationController extends BaseController { } return caseApplicationService.updateCaseIdByAnnexId(caseAttach); } + /** + * 保存onlyOffice在线编辑的文件 + * @param + * @return + */ + @PostMapping("/saveOnlyOfficeFile") + public AjaxResult saveOnlyOfficeFile( @RequestBody CaseAttach caseAttach) { + if(caseAttach.getCaseAppliId()==null||StrUtil.isEmpty(caseAttach.getOnlyOfficeFileId())||StrUtil.isEmpty(caseAttach.getAnnexPath())){ + return error("参数校验失败"); + } + + return caseApplicationService.saveOnlyOfficeFile(caseAttach); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationLogController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationLogController.java index e980e1c..63f1e41 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationLogController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationLogController.java @@ -65,7 +65,7 @@ public class CaseApplicationLogController { if(vo.getCaseId()==null || vo.getVersion()==null){ return AjaxResult.error("参数校验错误"); } - // todo 需确定 + return caseApplicationLogService.revoke(vo); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java index 8105e44..50fe6cc 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java @@ -30,8 +30,18 @@ public class CaseArbitrateController extends BaseController { @PutMapping("/method") // @PreAuthorize("@ss.hasPermi('caseManagement:list:checkarbitrationway')") public AjaxResult examineArbitrateMethod(@Validated @RequestBody CaseApplication caseApplication - , Integer opinion){ - return caseArbitrateService.examineArbitrateMethod(caseApplication,opinion); + , Integer opinion, Integer arbitratMethod){ + return caseArbitrateService.examineArbitrateMethod(caseApplication,opinion,arbitratMethod); + } + + /** + * 批量审核仲裁方式 + * @param caseApplication + * @return + */ + @PostMapping("/methodBatch") + public AjaxResult examineArbitrateMethodBatch(@Validated @RequestBody CaseApplication caseApplication){ + return caseArbitrateService.examineArbitrateMethodBatch(caseApplication); } /** @@ -44,4 +54,14 @@ public class CaseArbitrateController extends BaseController { return caseArbitrateService.writtenHear(caseIds); } + /** + * 批量书面审理 + * @param + * @return + */ + @PostMapping("/writtenHearBatch") + public AjaxResult writtenHearBatch(@Validated @RequestBody CaseApplication caseApplication){ + return caseArbitrateService.writtenHearBatch(caseApplication); + + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java index 152aacb..a10e304 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java @@ -6,6 +6,7 @@ import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.CaseAttach; import com.ruoyi.wisdomarbitrate.domain.CaseEvidenceDirectory; import com.ruoyi.wisdomarbitrate.domain.dto.CaseEvidenceDTO; import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO; @@ -32,23 +33,23 @@ public class CaseEvidenceController extends BaseController { this.caseEvidenceService = caseEvidenceService; } - /** - * 根据案件id查询案件详情 - * - * @param id - * @return - */ - @GetMapping("/{id}") - public AjaxResult getCaseDetailsById(@PathVariable Long id) { - String username = this.getUsername(); - return caseEvidenceService.getCaseDetailsById(id, username); - } +// /** +// * 根据案件id查询案件详情 +// * +// * @param id +// * @return +// */ +// @GetMapping("/{id}") +// public AjaxResult getCaseDetailsById(@PathVariable Long id) { +// String username = this.getUsername(); +// return caseEvidenceService.getCaseDetailsById(id, username); +// } /** * 案件证据上传 * * @param file 附件 - * @param annexType 附件类型,立案申请书(1)、证据材料(2)、仲裁文书(3)、案件视频(4)、身份证件(5) + * @param annexType 附件类型,立案申请书(1)、证据材料(2)、裁决书(3)、案件视频(4)、身份证件(5) * @param id 案件申请id * @return */ @@ -101,16 +102,16 @@ public class CaseEvidenceController extends BaseController { /** * 删除附件 - * @param fileIds + * @param caseAttach * @return */ @PostMapping("/deleteFile") - public AjaxResult deleteFile( @RequestParam("fileIds") List fileIds){ + public AjaxResult deleteFile(@RequestBody CaseAttach caseAttach){ - if(CollectionUtil.isEmpty(fileIds)){ + if(CollectionUtil.isEmpty(caseAttach.getFileIds())){ return error("附件id不能为空"); } - return toAjax(caseEvidenceService.deleteFile( fileIds)); + return success(caseEvidenceService.deleteFile( caseAttach.getFileIds())); } @@ -120,12 +121,12 @@ public class CaseEvidenceController extends BaseController { * @param caseStatus * @return */ - @GetMapping("/all") - public AjaxResult getCaseListAll(@RequestParam("caseStatus") Integer caseStatus) { - - return success(caseEvidenceService.getCaseListAll(caseStatus)); - - } +// @GetMapping("/all") +// public AjaxResult getCaseListAll(@RequestParam("caseStatus") Integer caseStatus) { +// +// return success(caseEvidenceService.getCaseListAll(caseStatus)); +// +// } /** * 证据确认 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseNumRuleController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseNumRuleController.java index 03e00bf..7d453ca 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseNumRuleController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseNumRuleController.java @@ -28,6 +28,8 @@ public class CaseNumRuleController extends BaseController { return caseNumRuleService.insertCaseNumRule(caseNumRule); } + + /** * 修改案件编号规则 * @param caseNumRule diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java index 6590573..47a1ff1 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java @@ -1,6 +1,9 @@ package com.ruoyi.web.controller.wisdomarbitrate; +import cn.hutool.core.collection.CollectionUtil; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.wisdomarbitrate.domain.BatchCaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.dto.CaseConfirmPayDTO; import com.ruoyi.wisdomarbitrate.service.ICasePaymentService; @@ -9,6 +12,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.ArrayList; +import java.util.List; + /** * 缴费支付 */ @@ -41,15 +47,38 @@ public class CasePaymentController { return paymentService.confirmPay(payDTO); } + /** + * 批量缴费 + * @param casePayDTO 缴费传入参数 + * @return 统一响应结果 + */ + @PostMapping("/casePayBatch") + public AjaxResult casePayBatch(@Validated @RequestBody CasePayDTO casePayDTO) { + return paymentService.casePayBatch(casePayDTO); + } + + /** + * 批量缴费 + * @param payDTO 缴费传入参数 + * @return 统一响应结果 + */ + @PostMapping("/confirmPayBatch") + public AjaxResult confirmPayBatch(@Validated @RequestBody CasePayDTO payDTO) { + return paymentService.confirmPayBatch(payDTO); + } + /** * 缴费确认 - * @param caseApplication + * @param batchCaseApplication * @return */ // @PreAuthorize("@ss.hasPermi('paymentManagement:list:payconfirm')") @PutMapping("/confirm") - public AjaxResult confirmPayment(@Validated @RequestBody CaseApplication caseApplication) { - return paymentService.confirmPayment(caseApplication); + public AjaxResult confirmPayment(@Validated @RequestBody BatchCaseApplication batchCaseApplication) { + if(CollectionUtil.isEmpty(batchCaseApplication.getIds()) || batchCaseApplication.getAgreeOrNotCheck()==null){ + return AjaxResult.error("参数校验失败"); + } + return paymentService.confirmPayment(batchCaseApplication); } /** * 缴费列表查询 @@ -60,4 +89,22 @@ public class CasePaymentController { public AjaxResult casePayList(CasePayDTO casePayDTO) { return paymentService.casePayList(casePayDTO); } + + @PostMapping("/listBatch") + public AjaxResult casePayListBatch(@Validated @RequestBody CasePayDTO casePayDTO) { + return paymentService.casePayListBatch(casePayDTO); + } + + /** + * 批量缴费确认 + * @param batchCaseApplication + * @return + */ + @PostMapping("/confirmBatch") + public AjaxResult confirmPaymentBatch(@Validated @RequestBody BatchCaseApplication batchCaseApplication) { + if(StringUtils.isEmpty(batchCaseApplication.getBatchNumber())){ + return AjaxResult.error("参数校验失败"); + } + return paymentService.confirmPaymentBatch(batchCaseApplication.getBatchNumber()); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/DeptIdentifyController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/DeptIdentifyController.java index 71bec6b..47b916a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/DeptIdentifyController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/DeptIdentifyController.java @@ -222,14 +222,13 @@ public class DeptIdentifyController extends BaseController { /** * 根据模板id查询模板字段列表 - * @param templateManage + * @param id * @return */ @GetMapping("/getTemplateInfoById") - public AjaxResult getTemplateInfoById(@RequestBody TemplateManage templateManage){ - if(templateManage.getId()==null){ - return error("参数校验错误"); - } + public AjaxResult getTemplateInfoById(@RequestParam("id") Long id){ + TemplateManage templateManage = new TemplateManage(); + templateManage.setId(id); List fatchRuleList = deptIdentifyService.getTemplateInfoById(templateManage); return AjaxResult.success(fatchRuleList); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/MsSignSealController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/MsSignSealController.java new file mode 100644 index 0000000..92cdc19 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/MsSignSealController.java @@ -0,0 +1,57 @@ +package com.ruoyi.web.controller.wisdomarbitrate; + +import com.ruoyi.common.annotation.Anonymous; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord; +import com.ruoyi.wisdomarbitrate.service.MsSignSealService; +import com.ruoyi.wisdomarbitrate.utils.SignVerifyUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Classname MsSignSealController + * @Description TODO + * @Version 1.0.0 + * @Date 2024/5/10 15:07 + * @Created wangqiong + */ +@RestController +@RequestMapping("/mssignSeal") +public class MsSignSealController extends BaseController { + @Autowired + private MsSignSealService msSignSealService; + /** + * 签名用印回调 + */ + @Anonymous + @PostMapping("/signSeaalCaseApplicaCallback") + public AjaxResult signSeaalCaseApplicaCallback() throws Exception { + boolean checkResult= SignVerifyUtils.checkSignuter(); + if(checkResult){ + String reqbodystr =SignVerifyUtils.getRequestBody(); + return msSignSealService.signSeaalCaseApplicaCallback(reqbodystr); + }else { + return AjaxResult.error("error"); + } + + } + + /** + * 印章审核回调 + */ + @Anonymous + @PostMapping("/sealCheckCallback") + public AjaxResult sealCheckCallback() throws Exception { + boolean checkResult= SignVerifyUtils.checkSignuter(); + if(checkResult){ + String reqbodystr =SignVerifyUtils.getRequestBody(); + return msSignSealService.sealCheckCallback(reqbodystr); + }else { + return AjaxResult.error("error"); + } + + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/SendMailRecordController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/SendMailRecordController.java deleted file mode 100644 index cc9ac35..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/SendMailRecordController.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.ruoyi.web.controller.wisdomarbitrate; - -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord; -import com.ruoyi.wisdomarbitrate.domain.SendMailRecord; -import com.ruoyi.wisdomarbitrate.service.ISendMailRecordService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -@RestController -@RequestMapping("/sendMailRecord") -public class SendMailRecordController extends BaseController { - @Autowired - private ISendMailRecordService sendMailRecordService; - - /** - * 查询发送邮件记录列表 - */ - @GetMapping("/list") - public TableDataInfo list(SendMailRecord sendMailRecord) - { - startPage(); - List list = sendMailRecordService.selectSendMailRecordList(sendMailRecord); - return getDataTable(list); - } - - -// /** -// * 新增立案数据 -// */ -// @Log(title = "新增立案数据", businessType = BusinessType.INSERT) -// @PostMapping("/addSendMailRecord") -// public AjaxResult addSendMailRecord(@Validated @RequestBody SendMailRecord sendMailRecord) -// { -// -// return toAjax(sendMailRecordService.addSendMailRecord(sendMailRecord)); -// } - - - - - -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/VideoController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/VideoController.java index db1f865..6b40fc7 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/VideoController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/VideoController.java @@ -2,13 +2,23 @@ package com.ruoyi.web.controller.wisdomarbitrate; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; import com.ruoyi.common.annotation.Anonymous; +import com.ruoyi.common.config.RuoYiConfig; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.file.FileUploadUtils; +import com.ruoyi.common.utils.file.FileUtils; +import com.ruoyi.framework.config.ServerConfig; +import com.ruoyi.wisdomarbitrate.domain.CaseAttach; import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication; import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO; import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO; import com.ruoyi.wisdomarbitrate.domain.vo.WeChatUserVO; +import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper; +import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; import com.ruoyi.wisdomarbitrate.service.VideoService; import com.ruoyi.wisdomarbitrate.service.WeChatUserService; import com.tencentcloudapi.common.Credential; @@ -25,6 +35,9 @@ import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletRequest; import javax.validation.Valid; import java.io.IOException; +import java.util.Objects; + +import static com.google.common.io.Files.getFileExtension; /** * @author wangqiong @@ -36,7 +49,12 @@ import java.io.IOException; public class VideoController extends BaseController { @Autowired private VideoService videoService; - + @Autowired + private ServerConfig serverConfig; + @Autowired + private CaseAttachMapper caseAttachMapper; + @Autowired + private ICaseApplicationService caseApplicationService; /** * 从腾讯云下载文件到本地 * @param @@ -114,9 +132,8 @@ public class VideoController extends BaseController { */ @Anonymous @GetMapping("secretaryRoleByUserId") - public AjaxResult secretaryRoleByUserId( @RequestParam(value = "userId",required = true) Long userId) { - - return videoService.secretaryRoleByUserId(userId); + public AjaxResult secretaryRoleByUserId( @RequestParam(value = "userId",required = true) Long userId,@RequestParam(value = "caseId",required = true) Long caseId) { + return videoService.secretaryRoleByUserId(userId,caseId); } /** * 根据html字符串转pdf并和案件关联 @@ -144,6 +161,122 @@ public class VideoController extends BaseController { return videoService.attachListByCaseId(caseAppliId,annexType); } + /** + * 根据案件id查询申请人/被申请人会议上传附件按钮权限 + * @param caseId + * @return + */ + @Anonymous + @GetMapping("selectRoleMenuByCaseId") + public AjaxResult selectRoleMenuByCaseId( @RequestParam(value = "caseId",required = true) Long caseId) { + return videoService.selectRoleMenuByCaseId(caseId); + } + /** + * 通用上传请求(单个) + * param officeFlag: 是否上传到onlyoffice,0-否,1-是 + * param isMediaBook: 是否上仲裁书,1-是,其余为否 + */ + @PostMapping("/upload") + public AjaxResult uploadFile(@RequestParam("file") MultipartFile file, @RequestParam(value = "isMediaBook",required = false) Integer isMediaBook, @RequestParam("annexType") Integer annexType, @RequestParam(value = "officeFlag", required = false) Integer officeFlag,@RequestParam(value = "caseId",required = false) Long caseId) throws Exception + { + try + { + // 上传文件路径 + String filePath = RuoYiConfig.getUploadPath(); + String name=file.getOriginalFilename(); + // 上传并返回新文件名称 + String fileName = FileUploadUtils.upload(filePath, file); + String suffix = getFileExtension(fileName); + if(StrUtil.isNotEmpty(suffix)&& suffix.contains("doc")){ + // 上传到onlyoffice + officeFlag=1; + } + String url = serverConfig.getUrl() + fileName; + if(officeFlag != null && officeFlag == 1){ + // officeFlag,fileName为annexPath + JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(fileName,caseId); + if(jsonArray!=null && jsonArray.size() > 0) { + // 先删除之前的裁决书附件 + if(Objects.equals(annexType,3) && caseId!=null) { + caseAttachMapper.deleteCaseAttachByCasedIdAndType(caseId, annexType); + } + CaseAttach caseAttach=null; + for (Object obj : jsonArray) { + JSONObject jsonObject = (JSONObject) obj; + String path = jsonObject.get("filePath")!=null?jsonObject.getString("filePath"):""; + path=path.replace("/home/ruoyi/uploadPath/","profile/"); + caseAttach = CaseAttach.builder() + .caseAppliId(caseId) +// .annexName(jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):"") + .annexName(name) + .annexType(annexType) + .onlyOfficeFileId(jsonObject.getString("fileId")) + .annexPath(path) + .build(); +// if(jsonObject.get("filePath")!=null){ +// String officePath = jsonObject.getString("filePath"); +// String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/"); +// caseAttach.setAnnexPath(replace); +// +// } + caseAttachMapper.save(caseAttach); + } + if(caseAttach==null){ + return AjaxResult.error("上传失败"); + } + AjaxResult ajax = AjaxResult.success(); + ajax.put("annexId", caseAttach.getAnnexId()); + ajax.put("annexType", annexType); + // ajax.put("url", url); + ajax.put("fileName", name); + ajax.put("newFileName", FileUtils.getName(fileName)); + ajax.put("originalFilename", file.getOriginalFilename()); + return ajax; + }else { + return AjaxResult.error("上传失败"); + } + }else { + // 如果是调解书并且是pdf,则删除之前的在新增 + if(annexType!=null && annexType.equals(3) ){ +// if(StrUtil.isNotEmpty(suffix)&&!suffix.equals("pdf")){ +// return AjaxResult.error("请上传pdf格式文件"); +// } +// annexType=AnnexTypeEnum.MEDIATE_BOOK_PDF.getCode(); + // 先删除之前的附件 + if(caseId!=null) { + caseAttachMapper.deleteCaseAttachByCasedIdAndType(caseId, annexType); + } + } + Long annexId = saveCaseAttach(annexType, name, file.getOriginalFilename(), caseId); + + AjaxResult ajax = AjaxResult.success(); + ajax.put("annexId", annexId); + ajax.put("annexType", annexType); + ajax.put("url", url); + ajax.put("fileName", name); + ajax.put("newFileName", FileUtils.getName(fileName)); + ajax.put("originalFilename", file.getOriginalFilename()); + return ajax; + } + } + catch (Exception e) + { + return AjaxResult.error(e.getMessage()); + } + } + private Long saveCaseAttach(Integer annexType, String path, String originalFilename,Long caseId) { + CaseAttach caseAttach = CaseAttach.builder() + .annexName(originalFilename) + .caseAppliId(caseId) + .annexPath(path) + .annexType(annexType) + .userId(SecurityUtils.getUserId()) + .userName(SecurityUtils.getUsername()) + .build(); + + caseAttachMapper.save(caseAttach); + return caseAttach.getAnnexId(); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/sendrecord/SendMailRecordController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/sendrecord/SendMailRecordController.java new file mode 100644 index 0000000..ab3edd8 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/sendrecord/SendMailRecordController.java @@ -0,0 +1,49 @@ +package com.ruoyi.web.controller.wisdomarbitrate.sendrecord; + +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SendMailRecord; +import com.ruoyi.wisdomarbitrate.service.sendrecord.ISendMailRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +@RequestMapping("/sendMailRecord") +public class SendMailRecordController extends BaseController { + @Autowired + private ISendMailRecordService sendMailRecordService; + + /** + * 查询发送邮件记录列表 + */ + @GetMapping("/list") + public TableDataInfo list(SendMailRecord sendMailRecord) { + startPage(); + List list = sendMailRecordService.selectSendMailRecordList(sendMailRecord); + return getDataTable(list); + } + + /** + * 编辑邮件记录 + */ + @PostMapping("/update") + public AjaxResult update(@RequestBody SendMailRecord sendMailRecord) { + return sendMailRecordService.updateSendMailRecord(sendMailRecord); + } + + /** + * 重新发送邮件记录 + */ + @PostMapping("/reSendMailRecord") + public AjaxResult reSendMailRecord(@RequestBody SendMailRecord sendMailRecord) { + Boolean aBoolean = sendMailRecordService.reSendMailRecord(sendMailRecord); + if (aBoolean) { + return AjaxResult.success("发送成功"); + } else { + return AjaxResult.error("发送失败"); + } + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/sendrecord/ShortMessageController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/sendrecord/ShortMessageController.java new file mode 100644 index 0000000..dbfdb99 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/sendrecord/ShortMessageController.java @@ -0,0 +1,143 @@ +package com.ruoyi.web.controller.wisdomarbitrate.sendrecord; + +import cn.hutool.core.collection.CollectionUtil; +import com.ruoyi.common.annotation.Anonymous; +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.domain.model.LoginUser; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.framework.web.service.TokenService; + +import com.ruoyi.system.mapper.SysUserMapper; + +import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord; +import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsSendRecordParam; +import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsTemplateParam; +import com.ruoyi.wisdomarbitrate.domain.shortmessage.MeetingInfo; +import com.ruoyi.wisdomarbitrate.domain.vo.shortmessage.MeetingInfoVO; +import com.ruoyi.wisdomarbitrate.domain.vo.shortmessage.ReSendMessageVO; +import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper; +import com.ruoyi.wisdomarbitrate.mapper.shortmessage.MeetingInfoMapper; +import com.ruoyi.wisdomarbitrate.mapper.sms.MsSmsSendHistoryRecordParamMapper; +import com.ruoyi.wisdomarbitrate.mapper.sms.MsSmsSendRecordParamMapper; +import com.ruoyi.wisdomarbitrate.service.shortmessage.ShortMessageService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import tk.mybatis.mapper.entity.Example; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@RestController +@RequestMapping("/shortMessage") +public class ShortMessageController extends BaseController { + @Autowired + private SmsRecordMapper smsRecordMapper; + @Autowired + private ShortMessageService shortMessageService; + @Autowired + MsSmsSendRecordParamMapper recordParamMapper; + @Autowired + MsSmsSendHistoryRecordParamMapper historyRecordParamMapper; + + /** + * 查询短信发送记录 + * + * @param smsSendRecord + * @return + */ + @GetMapping("/recordList") + public TableDataInfo smsSendRecordList(SmsSendRecord smsSendRecord) { + startPage(); + List list = shortMessageService.smsSendRecordList(smsSendRecord); + return getDataTable(list); + } + + @Anonymous + @PostMapping("/updateSendContent") + public AjaxResult update(@RequestBody SmsSendRecord smsSendRecord) { + if (smsSendRecord == null || smsSendRecord.getId() == null || CollectionUtil.isEmpty(smsSendRecord.getTemplateParams())) { + return AjaxResult.error("参数校验失败"); + } + // 查询当前版本记录 + SmsSendRecord oldSendRecord = smsRecordMapper.selectById(smsSendRecord.getId()); + smsSendRecord.setUpdateTime(new Date()); + // 更新短信内容,先删除短信记录参数表 + Example recordParamExam = new Example(MsSmsSendRecordParam.class); + recordParamExam.createCriteria().andEqualTo("smsRecordId", smsSendRecord.getId()); + recordParamMapper.deleteByExample(recordParamExam); + // 新增短信记录参数表 + List recordParams = new ArrayList<>(); + for (MsSmsTemplateParam templateParam : smsSendRecord.getTemplateParams()) { + MsSmsSendRecordParam recordParam = new MsSmsSendRecordParam(); + recordParam.setSmsRecordId(smsSendRecord.getId()); + recordParam.setParamValue(templateParam.getParamValue()); + recordParams.add(recordParam); + } + recordParamMapper.batchInsert(recordParams); + shortMessageService.insertShortMessageHistoryRecord(oldSendRecord, recordParams); + return AjaxResult.success(); + + } + + /** + * 重新发送短信 + */ + @Anonymous + @PostMapping("/reSendShortMessage") + public AjaxResult reSendShortMessage(@RequestBody ReSendMessageVO reSendMessageVO) { + if (reSendMessageVO != null) { + AjaxResult result = shortMessageService.reSendShortMessage(reSendMessageVO); + return result; + } + return AjaxResult.error("参数缺失"); + } + + /** + * 短信回调 + * @param body + * @return + */ + @Anonymous + @PostMapping("/smsCallBack") + public AjaxResult smsCallBack(@RequestBody String body) { + if(body != null){ + return shortMessageService.smsCallBack(body); + } + return AjaxResult.error("参数缺失"); + } + + @Autowired + MeetingInfoMapper meetingInfoMapper; + @Autowired + SysUserMapper sysUserMapper; + @Autowired + private TokenService tokenService; + + /** + * 查询UID好的密钥 + */ +// @Anonymous +// @GetMapping("/getMeetingInfo") +// public Object getEncryptInfoByUid(@RequestParam(name = "authId", required = true) String authId) { +// MeetingInfoVO result = new MeetingInfoVO(); +// if (authId != null) { +// MeetingInfo meetingInfo = meetingInfoMapper.selectByPrimaryKey(authId); +// if (meetingInfo != null && meetingInfo.getUserId() != null) { +// BeanUtils.copyProperties(meetingInfo, result); +// SysUser sysUser = sysUserMapper.selectUserById(meetingInfo.getUserId()); +// LoginUser loginUser = new LoginUser(); +// loginUser.setUserId(sysUser.getUserId()); +// loginUser.setUser(sysUser); +// String token = tokenService.createVideoToken(loginUser, 120); +//// String createToken = createToken(claims); +// result.setToken(token); +// } +// return result; +// } +// return AjaxResult.error("查询失败"); +// } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/sms/SMSTemplateController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/sms/SMSTemplateController.java new file mode 100644 index 0000000..c74d475 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/sms/SMSTemplateController.java @@ -0,0 +1,55 @@ +package com.ruoyi.web.controller.wisdomarbitrate.sms; + +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsTemplate; +import com.ruoyi.wisdomarbitrate.service.sms.SMSTemplateService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 短信模板控制器 + */ +@RestController +@RequestMapping("/smsTemplate") +public class SMSTemplateController extends BaseController { + @Autowired + private SMSTemplateService templateService; + + /** + * 查询 + * @param + * @return + */ + @GetMapping("/page") + public TableDataInfo page( ){ + startPage(); + List list = templateService.page(); + return getDataTable(list); + } + /** + * 新增或者修改 + * @param + * @return + */ + @PostMapping("/insert") + public AjaxResult insert(@RequestBody MsSmsTemplate template){ + return templateService.insert(template); + } + /** + * 删除 + * @param + * @return + */ + @PostMapping("/delete") + public AjaxResult delete(@RequestBody MsSmsTemplate template){ + if(template.getId()==null){ + return AjaxResult.warn("id不能为空"); + } + return templateService.delete(template.getId()); + } + +} diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index fb697f9..2058ef9 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -6,7 +6,8 @@ spring: druid: # 主库数据源 master: - url: jdbc:mysql://121.40.189.20:3306/test_smart_arbitration?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false + url: jdbc:mysql://121.40.189.20:3306/test_smart_arbitration?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false +# url: jdbc:mysql://121.40.189.20:3306/smart_arbitration?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false username: root password: YMzc157# # 从库数据源 diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 22aa6db..e9ecfa1 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -17,7 +17,7 @@ ruoyi: # 开发环境配置 server: - # 服务器的HTTP端口,默认为8080 + # 服务器的HTTP端口,默认为8001,正式9001 port: 8001 servlet: # 应用的访问路径 @@ -58,9 +58,9 @@ spring: servlet: multipart: # 单个文件大小 - max-file-size: 50MB + max-file-size: 1000MB # 设置总上传的文件大小 - max-request-size: 500MB + max-request-size: 10000MB # 服务模块 devtools: restart: @@ -72,8 +72,8 @@ spring: host: 121.40.189.20 # 端口,默认为6379 port: 6389 - # 数据库索引 - database: 0 + # 数据库索引,2-正式,3-测试 + database: 3 # 密码 password: # 连接超时时间 @@ -121,7 +121,7 @@ token: # 令牌密钥 secret: abcdefghijklmnopqrstuvwxyz # 令牌有效期(默认30分钟) - expireTime: 30 + expireTime: 1200 # MyBatis配置 mybatis: @@ -183,6 +183,14 @@ imConfig: secretId: AKID3xfHgroY4MQHvLXUXMwIQL1UjmbBX1Tv # 腾讯云密钥 secretKey: INDrIXcT8YmomZBcsy0oNirnU0LTN4X7 +# onlyOffice系统url配置 +onlyOfficeConfig: + # url: http://172.16.0.254:9090/files/upload + url: http://121.40.189.20:9090/files/upload +# 调解机构代码配置 +organizeConfig: + # creditCode + creditCode: 910000058386410044 #jodconverter: # local: # host: 121.40.189.20 diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java index 30d3a56..3b8220a 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java @@ -42,4 +42,16 @@ public class CacheConstants */ public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:"; public static final String WE_CHAT_SMS_VERIFY_CODE_KEY="we_chat_sms_verify_code:"; + /** + * 所有用户 redis key + */ +public static final String USER_KEY = "user_key:"; + /** + * 用户邮箱 redis key + */ +// public static final String USER_EMAIL_KEY = "user_email_key:"; + /** + * 角色 redis key + */ + public static final String ROLE_KEY = "role_key:"; } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java index e7802e4..c08a512 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java @@ -4,50 +4,56 @@ package com.ruoyi.common.constant; * */ public class CaseApplicationConstants { - /** 立案申请 */ + /** 申请人/代理人,立案申请 */ public static final int CASE_APPLICATION = 0; - /** 待立案审查 */ + /** + * 案件新增 + */ + public static final int CASE_INSERT = -2; + /** 申请人/代理人,案件修改 */ + 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; diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java index e46e514..a247c16 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java @@ -154,4 +154,11 @@ public class Constants */ public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml", "org.springframework", "org.apache", "com.ruoyi.common.utils.file", "com.ruoyi.common.config" }; + // 中文逗号分隔符 + public static final String CN_SPLIT_COMMA = ","; + /** + * 会议主键Id + */ + public static final String MEETING_KEY = "meeting_key"; + } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java index a685e06..4791a0f 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java @@ -1,6 +1,7 @@ package com.ruoyi.common.core.controller; import java.beans.PropertyEditorSupport; +import java.util.ArrayList; import java.util.Date; import java.util.List; import org.slf4j.Logger; @@ -82,6 +83,9 @@ public class BaseController @SuppressWarnings({ "rawtypes", "unchecked" }) protected TableDataInfo getDataTable(List list) { + if(list == null){ + list=new ArrayList<>(); + } TableDataInfo rspData = new TableDataInfo(); rspData.setCode(HttpStatus.SUCCESS); rspData.setMsg("查询成功"); diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java index f98291a..2b94d71 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java @@ -54,6 +54,68 @@ public class SysDept extends BaseEntity /** 父部门名称 */ private String parentName; + /** + * 代码(统一社会信用代码或者身份证号) + */ + private String code; + + /** + * 法定代表人 + */ + private String compLegalPerson; + /** + * 住所 + */ + private String home; + /** + * 联系地址 + */ + private String address; + /** + * + * 国籍,0-国内,1-国外 + */ + private Integer nationality; + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCompLegalPerson() { + return compLegalPerson; + } + + public void setCompLegalPerson(String compLegalPerson) { + this.compLegalPerson = compLegalPerson; + } + + public String getHome() { + return home; + } + + public void setHome(String home) { + this.home = home; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public Integer getNationality() { + return nationality; + } + + public void setNationality(Integer nationality) { + this.nationality = nationality; + } public Integer getDeptType() { return deptType; diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java index fd3106c..1073d80 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java @@ -38,6 +38,35 @@ public class SysUser extends BaseEntity /** 用户昵称 */ @Excel(name = "用户名称") private String nickName; + + /** 用户昵称和待办数量 */ + private String nickNameAndNum; + + public String getNickNameAndNum() { + return nickNameAndNum; + } + + public void setNickNameAndNum(String nickNameAndNum) { + this.nickNameAndNum = nickNameAndNum; + } + /** 身份类别,0-身份证,1-护照,默认0 */ + private Integer idType; + /** 国籍,0-国内,1-国外,默认0 */ + + private Integer nationality; + /** + * 生日 + */ + private Date birth; + /** + * 住所 + */ + private String home; + /** + * 联系地址 + */ + private String address; + /** 用户身份证号 */ @Excel(name = "身份证号") private String idCard; @@ -93,12 +122,64 @@ public class SysUser extends BaseEntity /** 角色ID */ private Long roleId; + /** + * 职位 + */ + private String position; + + public String getPosition() { + return position; + } + + public void setPosition(String position) { + this.position = position; + } public SysUser() { } + 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 Date getBirth() { + return birth; + } + + public void setBirth(Date birth) { + this.birth = birth; + } + + public String getHome() { + return home; + } + + public void setHome(String home) { + this.home = home; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + public SysUser(Long userId) { this.userId = userId; diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/SMSStatusEnum.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/SMSStatusEnum.java new file mode 100644 index 0000000..dc7ea61 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/SMSStatusEnum.java @@ -0,0 +1,64 @@ +package com.ruoyi.common.enums; + + + +/** + * @author wangqiong + * @description 短信状态枚举 + * @date 2023-11-17 14:05 + */ +public enum SMSStatusEnum +{ + SUCCESS(1, "成功"), + SENDING(2, "发送中"), + FAIL(3, "失败"), + + ; + + private final Integer code; + private final String text; + + SMSStatusEnum(Integer code, String text) + { + this.code = code; + this.text = text; + } + + public Integer getCode() + { + return code; + } + + public String getText() + { + return text; + } + + /** + * 根据code获取text + * @param codeNo + * @return + */ + public static String getTextByCode(Integer codeNo){ + for (SMSStatusEnum value : SMSStatusEnum.values()) { + if (value.getCode().equals(codeNo)){ + return value.getText(); + } + } + return codeNo.toString(); + } + + /** + * 根据text获取code + * @param textStr + * @return + */ + public static String getCodeByText(String textStr){ + for (SMSStatusEnum value : SMSStatusEnum.values()) { + if (value.getText().equals(textStr)){ + return value.getText(); + } + } + return textStr; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/CheckSignatuerUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/CheckSignatuerUtils.java new file mode 100644 index 0000000..45376f3 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/CheckSignatuerUtils.java @@ -0,0 +1,58 @@ +package com.ruoyi.common.utils; + +import cn.hutool.core.io.IoUtil; +import cn.hutool.crypto.digest.HMac; +import cn.hutool.crypto.digest.HmacAlgorithm; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; +import java.nio.charset.StandardCharsets; + +public class CheckSignatuerUtils { + + public static String getSign(String paramsbody, String accessSec, long timestamp) { + String paramsStr = getParamsStr(paramsbody, timestamp); + return generateSign(paramsStr, accessSec); + } + + public static String getParamsStr(String paramsbody,long timestamp) { + StringBuilder strbuild = new StringBuilder(); + if (StringUtils.isNotBlank(paramsbody)) { + strbuild.append(paramsbody).append('#'); + } + strbuild.append("#timestamp=").append(timestamp); + return strbuild.toString(); + } + + public static String generateSign(String paramsStr, String accessSec) { + HMac hMac = new HMac(HmacAlgorithm.HmacSHA256, accessSec.getBytes(StandardCharsets.UTF_8)); + return hMac.digestHex(paramsStr); + } + + public static boolean checkSignuter(String paramsbody) throws Exception { + HttpServletRequest reqParam = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest(); + String timestampstr = reqParam.getHeader("timestampstr"); + String signstr = reqParam.getHeader("signstr"); + String accessSec = "mCFMA6ffe938v79m"; + String newSignuter = getSign(paramsbody, accessSec,Long.parseLong(timestampstr)); + if (StringUtils.equals(signstr, newSignuter)) { + return true; + }else { + return false; + } + + } + + + + + + + + + + + +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/EmailOutUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/EmailOutUtil.java index 2b6ebbf..2e9882a 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/EmailOutUtil.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/EmailOutUtil.java @@ -1,9 +1,13 @@ package com.ruoyi.common.utils; + +import cn.hutool.core.util.StrUtil; +import com.ruoyi.common.utils.uuid.UUID; import lombok.Data; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; +import org.springframework.mail.MailException; import org.springframework.mail.SimpleMailMessage; import org.springframework.mail.javamail.JavaMailSender; @@ -14,18 +18,17 @@ import org.springframework.stereotype.Component; import javax.activation.DataHandler; import javax.mail.*; import javax.mail.internet.*; +import javax.mail.search.*; import javax.mail.util.ByteArrayDataSource; import javax.validation.constraints.NotNull; -import java.io.File; -import java.io.IOException; +import java.io.*; import java.nio.file.Files; import java.nio.file.Paths; import java.security.Security; -import java.util.Date; -import java.util.List; -import java.util.Properties; +import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.stream.Stream; /** * @ClassName EmailInUtil @@ -50,8 +53,10 @@ public class EmailOutUtil { private String hostOut; @Value("${spring.mail.username}") private String usernameOut; + @Value("${spring.mail.password}") private String passwordOut; + @Value("${spring.mail.port}") private Integer portOut; @@ -73,18 +78,29 @@ public class EmailOutUtil { * @param subject 邮件主题 * @param content 邮件内容(发送内容) */ - public void sendMessage(String to, String subject, String content, String from, JavaMailSender mailSender) { - // 创建一个邮件对象 - SimpleMailMessage msg = new SimpleMailMessage(); - msg.setFrom(from); - msg.setTo(to); - // 设置邮件主题 - msg.setSubject(subject); - // 设置邮件内容 - msg.setText(content); - // 发送邮件 - mailSender.send(msg); - ////System.out.println("发送成功:" + from + ":to:" + to); + public Boolean sendMessage(String to, String subject, String content, String from, JavaMailSender mailSender) { + try { + if(mailSender==null){ + mailSender= rebuildMailSender(); + } + // 创建一个邮件对象 + SimpleMailMessage msg = new SimpleMailMessage(); + if(StrUtil.isEmpty(from)){ + msg.setFrom(usernameOut); + }else { + msg.setFrom(from); + } + msg.setTo(to); + // 设置邮件主题 + msg.setSubject(subject); + // 设置邮件内容 + msg.setText(content); + // 发送邮件 + mailSender.send(msg); + } catch (MailException e) { + return false; + } + return true; } /** @@ -92,13 +108,14 @@ public class EmailOutUtil { * @param message 邮件内容 * @param subject 邮件主题 * @param fileList 邮件附件 + * @param fileNameMap 附件名称map,附件路径-附件名称 */ - public Boolean sendEmil(String to, String message, String subject, List fileList, File file) { + public Boolean sendEmil(String to, String message, String subject, List fileList, File file,Map fileNameMap) { try { String messageContent = "

"+message+"。

"; MimeBodyPart messageBodyPart = new MimeBodyPart(); messageBodyPart.setContent(messageContent, "text/html;charset=utf-8"); - Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); + messageBodyPart.setContentID(UUID.randomUUID().toString()); final String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory"; //设置邮件会话参数 Properties props = new Properties(); @@ -150,7 +167,10 @@ public class EmailOutUtil { for (File tempfile : fileList) { MimeBodyPart attachmentPart = new MimeBodyPart(); attachmentPart.attachFile(tempfile); - attachmentPart.setFileName(MimeUtility.encodeText(tempfile.getName())); + // 设置附件名称 + if(fileNameMap!=null && fileNameMap.containsKey(tempfile.getPath())) { + attachmentPart.setFileName(MimeUtility.encodeText(fileNameMap.get(tempfile.getPath()))); + } multipart.addBodyPart(attachmentPart); } msg.setContent(multipart); @@ -269,4 +289,164 @@ public class EmailOutUtil { } return flag; } + public void buildReceiveConnect() throws Exception { + + //POP3主机名 + String host = "pop3.163.com"; + //设置传输协议 + String protocol = "pop3"; + //用户账号 + String username = "wq18792927508@163.com"; + //密码或者授权码 + String password = "WDFHKSEMCKVRELEA"; + /* + * 获取Session + */ + Properties props = new Properties(); + //协议 + props.setProperty("mail.store.protocol", protocol); + //POP3主机名 + props.setProperty("mail.pop3.host", host); + props.setProperty("mail.smtp.auth", "true"); + props.setProperty("mail.pop3.default-encoding", "UTF-8"); + Session session = Session.getDefaultInstance(props, new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(usernameOut, passwordOut); + } + }); + URLName urlName = new URLName(protocol, host, 110, null, username, password); + Store store = session.getStore(urlName); + store.connect(username, password); + + + Folder folder = store.getFolder("INBOX"); + + folder.open(Folder.READ_ONLY); + + } + /** + * 接收邮件 + */ + public List receiverMail() { + List messageIds=new ArrayList<>(); + +// session.setDebug(true); + + try { + //POP3主机名 + String host = "pop3.163.com"; + //设置传输协议 + String protocol = "pop3"; + //用户账号 + String username = "wq18792927508@163.com"; + //密码或者授权码 + String password = "WDFHKSEMCKVRELEA"; + /* + * 获取Session + */ + Properties props = new Properties(); + //协议 + props.setProperty("mail.store.protocol", protocol); + //POP3主机名 + props.setProperty("mail.pop3.host", host); + props.setProperty("mail.smtp.auth", "true"); + props.setProperty("mail.pop3.default-encoding", "UTF-8"); + Session session = Session.getDefaultInstance(props, new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(usernameOut, passwordOut); + } + }); + URLName urlName = new URLName(protocol, host, 110, null, username, password); + Store store = session.getStore(urlName); + store.connect(username, password); + + + Folder folder = store.getFolder("INBOX"); + folder.open(Folder.READ_ONLY); + SearchTerm orTerm = new SubjectTerm("退信"); + // Message[] messages = folder.search(orTerm); + Date endTime= new Date(); + long oneDayMillis=24*60*60*1000L; + Date startTime=new Date(endTime.getTime()-oneDayMillis); + // SearchTerm comparisonTermGe = new SentDateTerm(ComparisonTerm.GE, startTime); + // SearchTerm comparisonTermLe = new SentDateTerm(ComparisonTerm.LE, endTime); + // SearchTerm comparisonAndTerm = new AndTerm(comparisonTermGe, comparisonTermLe); + // SearchTerm searchTerm = new AndTerm(comparisonAndTerm, orTerm); + Message[] messages = folder.search(orTerm); + if (messages != null) { + + Arrays.stream(messages).forEach(message -> { + String messageId=""; + try { + messageId = EmailUtil.getMessageId(message,session); + } catch (Exception e) { + e.printStackTrace(); + } + messageIds.add(messageId); + }); + + } + + folder.close(false); + store.close(); + } catch (Exception e) { + return messageIds; + } + return messageIds; + } + + public void analyseMail(Session session, Object content) throws Exception { + + if (content instanceof Multipart) { + Multipart multipart = (Multipart) content; + for (int i = 0; i < multipart.getCount(); i++) { + BodyPart bodyPart = multipart.getBodyPart(i); +// if (bodyPart.isMimeType("message/rfc822")) { if(bodyPart.getContentType().startsWith("Message/Rfc822")); +// MimeMessage mimeMessage = new MimeMessage(session, bodyPart.getInputStream()); +// } + if(bodyPart.isMimeType("Message/Rfc822")){ + MimeMessage mimeMessage = new MimeMessage(session, bodyPart.getInputStream()); + } + } + } + } + public static String getMessageId(Part part) throws Exception { + if (!part.isMimeType("multipart/*")) { + return ""; + } + + Multipart multipart = (Multipart) part.getContent(); + for (int i = 0; i < multipart.getCount(); i++) { + BodyPart bodyPart = multipart.getBodyPart(i); + + if (part.isMimeType("message/rfc822")) { + return getMessageId((Part) part.getContent()); + } + InputStream inputStream = bodyPart.getInputStream(); + + try (BufferedReader br = new BufferedReader(new InputStreamReader(inputStream))) { + String strLine; + while ((strLine = br.readLine()) != null) { + if (strLine.startsWith("Message_Id:")) { + String[] split = strLine.split("Message_Id:"); + return split.length > 1 ? split[1].trim() : null; + } + } + } + } + + return ""; + } + + +//检查退信邮件 +// Folder folder = ...; //打开收件箱 +// Message[] messages = folder.getMessages(); +// for (Message message : messages) { +// if (message.getSubject().contains("Delivery Status Notification")) { +// System.out.println("Delivery failed for recipient: " + message.getRecipients()[0]); +// } +// } } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/EmailUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/EmailUtil.java new file mode 100644 index 0000000..bb1f2d2 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/EmailUtil.java @@ -0,0 +1,68 @@ +package com.ruoyi.common.utils; + +import lombok.extern.slf4j.Slf4j; + +import javax.mail.*; +import javax.mail.internet.MimeMessage; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; + +@Slf4j +public final class EmailUtil { + + private static final String multipart = "multipart/*"; + + + + public static String getMessageId(Part part, Session session) throws Exception { + if (!part.isMimeType(multipart)) { + return ""; + + } + + Multipart multipart = (Multipart) part.getContent(); + for (int i = 0; i < multipart.getCount(); i++) { + BodyPart bodyPart = multipart.getBodyPart(i); + if(bodyPart.getContentType().contains("Message/Rfc822")){ + MimeMessage mimeMessage = new MimeMessage(session, bodyPart.getInputStream()); + if(mimeMessage.getSubject()!=null&&mimeMessage.getSubject().contains("裁决书")){ + String[] split = mimeMessage.getSubject().split("裁决书"); + if(split.length>0){ + return split[0]; + } + } + } + } return ""; + } + + public static boolean isContainAttachment(Part part) { + boolean attachFlag = false; + try { + if (part.isMimeType(multipart)) { + Multipart mp = (Multipart) part.getContent(); + for (int i = 0; i < mp.getCount(); i++) { + BodyPart mpart = mp.getBodyPart(i); + String disposition = mpart.getDisposition(); + if ((disposition != null) && ((disposition.equals(Part.ATTACHMENT)) || (disposition.equals(Part.INLINE)))) + attachFlag = true; + else if (mpart.isMimeType(multipart)) { + attachFlag = isContainAttachment((Part) mpart); + } else { + String contype = mpart.getContentType(); + if (contype.toLowerCase().contains("application")) + attachFlag = true; + if (contype.toLowerCase().contains("name")) + attachFlag = true; + } + } + } else if (part.isMimeType("message/rfc822")) { + attachFlag = isContainAttachment((Part) part.getContent()); + } + } catch (MessagingException | IOException e) { + e.printStackTrace(); + } + return attachFlag; + } +} \ No newline at end of file diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/PdfUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/PdfUtils.java index 05afb65..089ebb0 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/PdfUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/PdfUtils.java @@ -44,7 +44,7 @@ public class PdfUtils { document.setMarginMirroring(false); document.open(); // 解决PDF中文不显示 - String fontPath = "/D:/simsun.ttf"; //字体文件路径 + String fontPath = "/home/ruoyi/uploadPath/songfont/simsun.ttf"; //字体文件路径 XMLWorkerFontProvider provider = new XMLWorkerFontProvider(XMLWorkerFontProvider.DONTLOOKFORFONTS); provider.register(fontPath);//注册字体 log.error("注册字体"); diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/SmsUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/SmsUtils.java deleted file mode 100644 index ff0ce9e..0000000 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/SmsUtils.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.ruoyi.common.utils; - -import com.tencentcloudapi.common.Credential; -import com.tencentcloudapi.common.exception.TencentCloudSDKException; -import com.tencentcloudapi.common.profile.ClientProfile; -import com.tencentcloudapi.common.profile.HttpProfile; -import com.tencentcloudapi.cvm.v20170312.CvmClient; -import com.tencentcloudapi.cvm.v20170312.models.DescribeRegionsRequest; -import com.tencentcloudapi.cvm.v20170312.models.DescribeRegionsResponse; -import com.tencentcloudapi.sms.v20210111.SmsClient; -import com.tencentcloudapi.sms.v20210111.models.SendSmsResponse; -import com.tencentcloudapi.sms.v20210111.models.SendStatus; -import lombok.Data; -import lombok.extern.slf4j.Slf4j; -import lombok.var; - -import java.util.Objects; - -@Slf4j -public class SmsUtils { - //应用id - private static final String SDK_APP_ID = "1400854852"; - //API的SecretId - private static final String SECRET_ID = "AKIDeEf2A8uX1HSainvvnXAc3X9ZlhtyvkMp"; - //API的SecretKey - private static final String SECRET_KEY = "QjphKo8zkHZigT8j9PVtFPJyfIvO3d6V"; - //签名内容 - private static final String SIGN_NAME = "乙巢智慧仲裁网"; - - public static Boolean sendSms(SendSmsRequest request) { - Credential cred = new Credential(SECRET_ID, SECRET_KEY ); - - SmsClient client = new SmsClient(cred, "ap-guangzhou"); - - final var req = new com.tencentcloudapi.sms.v20210111.models.SendSmsRequest(); - req.setPhoneNumberSet(new String[]{"+86" + request.getPhone()}); - req.setSmsSdkAppId(SDK_APP_ID ); - req.setSignName(SIGN_NAME); - req.setTemplateId(request.getTemplateId()); - req.setTemplateParamSet(request.getTemplateParamSet()); - SendSmsResponse res = null; - try { - res = client.SendSms(req); - } catch (TencentCloudSDKException e) { - log.error("发送短信出错:", e); - return Boolean.FALSE; - } - SendStatus sendStatus = res.getSendStatusSet()[0]; - log.info("发送短信结果:Code={}, Message={}", sendStatus.getCode(), sendStatus.getMessage()); - - if (Objects.nonNull(res.getSendStatusSet()) && res.getSendStatusSet().length > 0 && "Ok".equals(res.getSendStatusSet()[0].getCode())){ - return Boolean.TRUE; - } - return Boolean.FALSE; - } - /** - * 参数对象 - */ - @Data - public static class SendSmsRequest { - /** - * 电话 - */ - private String phone; - - /** - * 模板 ID: 必须填写已审核通过的模板 ID - */ - private String templateId; - - /** - * 模板参数: 模板参数的个数需要与 TemplateId 对应模板的变量个数保持一致,若无模板参数,则设置为空 - */ - private String[] templateParamSet; - private Long caseId; - - } -} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/ThreadUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ThreadUtil.java new file mode 100644 index 0000000..f26e666 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ThreadUtil.java @@ -0,0 +1,23 @@ +package com.ruoyi.common.utils; + +import com.google.common.util.concurrent.ThreadFactoryBuilder; + +import java.util.concurrent.*; + +/** + * @Author: ymbgy + * @Date: 2022-09-23 10:06 + */ +public class ThreadUtil { + public static ExecutorService createThreadPool() { + //获取系统处理器个数,作为线程池数量 + int nThreads = Runtime.getRuntime().availableProcessors(); + ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() + .setNameFormat("demo-pool-%d").build(); + //Thread Pool + ExecutorService executor = new ThreadPoolExecutor(nThreads, 200, + 0L, TimeUnit.MILLISECONDS, + new LinkedBlockingQueue(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy()); + return executor; + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java index 46ab4b2..410f69f 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java @@ -1,11 +1,12 @@ package com.ruoyi.framework.config; import java.util.TimeZone; -import org.mybatis.spring.annotation.MapperScan; +//import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.EnableAspectJAutoProxy; +import tk.mybatis.spring.annotation.MapperScan; /** * 程序注解配置 diff --git a/ruoyi-system/pom.xml b/ruoyi-system/pom.xml index 971c071..3a2a414 100644 --- a/ruoyi-system/pom.xml +++ b/ruoyi-system/pom.xml @@ -12,11 +12,16 @@ ruoyi-system - system系统模块 + - + + + tk.mybatis + mapper-spring-boot-starter + 2.1.5 + com.ruoyi @@ -33,7 +38,17 @@ tls-sig-api-v2 1.2 - + + + tk.mybatis + mapper-spring-boot-starter + 2.1.5 + + + org.projectlombok + lombok + 1.18.22 + \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java index 4ef0d06..4270b36 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java @@ -124,4 +124,11 @@ public interface SysDeptMapper * @return */ int batchSave(@Param("list")List sysDepts); + + /** + * 根据部门名称查询部门信息 + * @param deptName + * @return + */ + public SysDept selectDeptByName(@Param("deptName") String deptName); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java index e23c18f..cf2cc6b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java @@ -171,4 +171,17 @@ public interface SysUserMapper * @return */ int batchSave(@Param("list")List addUsers); + /** + * 根据邮箱查询用户信息 + * @param email + * @return + */ + SysUser selectUserByEmail(String email); + + /** + * 根据角色查询用户 + * @param 法律顾问 + * @return + */ + SysUser selectUserByRole(String 法律顾问); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java index 3143ec8..8942a7b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java @@ -59,4 +59,13 @@ public interface SysUserRoleMapper * @return 结果 */ public int deleteUserRoleInfos(@Param("roleId") Long roleId, @Param("userIds") Long[] userIds); + + /** + * 根据用户id查询关联的角色id + * @param userId + * @return + */ + List selectRoleIdsByUserId(Long userId); + + void insertUserRole(@Param("userId") Long userId,@Param("roleId") Long roleId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java index 7d60696..6c33221 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java @@ -2,6 +2,8 @@ package com.ruoyi.system.service; import java.util.List; import java.util.Set; + +import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.TreeSelect; import com.ruoyi.common.core.domain.entity.SysMenu; import com.ruoyi.system.domain.vo.RouterVo; @@ -141,4 +143,9 @@ public interface ISysMenuService * @return 结果 */ public boolean checkMenuNameUnique(SysMenu menu); + /** + * 根据用户查询菜单权限字符 + * @return + */ + AjaxResult getMenuPermsByUser(); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java index 8830025..e051e40 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java @@ -20,6 +20,12 @@ public interface ISysUserService * @return 用户信息集合信息 */ public List selectUserList(SysUser user); + + /** + * 查询仲裁员 + * @param arbitrator + * @return + */ public List selectUserListByAdRole(Arbitrator arbitrator); /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java index 225c280..e0c565e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java @@ -8,6 +8,8 @@ import java.util.LinkedList; import java.util.List; import java.util.Set; import java.util.stream.Collectors; + +import com.ruoyi.common.core.domain.AjaxResult; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.common.constant.Constants; @@ -528,4 +530,11 @@ public class SysMenuServiceImpl implements ISysMenuService return StringUtils.replaceEach(path, new String[] { Constants.HTTP, Constants.HTTPS, Constants.WWW, "." }, new String[] { "", "", "", "/" }); } + @Override + public AjaxResult getMenuPermsByUser() { + AjaxResult result = AjaxResult.success(); + List perms = menuMapper.selectMenuPermsByUserId(SecurityUtils.getUserId()); + result.put("perms",perms); + return result; + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java index 2505f1f..0684335 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java @@ -6,11 +6,17 @@ 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.domain.entity.CaseAffiliateEntity; +import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper; import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper; +import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -64,9 +70,13 @@ public class SysUserServiceImpl implements ISysUserService { @Autowired private CaseApplicationMapper caseApplicationMapper; + @Autowired + private CaseAffiliateMapper caseAffiliateMapper; @Autowired protected Validator validator; + @Autowired + protected ICaseApplicationService caseApplicationService; /** * 根据条件分页查询用户列表 @@ -80,21 +90,41 @@ public class SysUserServiceImpl implements ISysUserService { return userMapper.selectUserList(user); } + /** + * 查询仲裁员 + * @param arbitrator + * @return + */ @Override public List selectUserListByAdRole(Arbitrator arbitrator) { + // 根据案件id查询案件 + List caseAffiliates = caseApplicationService.selectAfflicatesByCaseId(arbitrator.getCaseId()); + List userIds=new ArrayList<>(); + if(CollectionUtil.isNotEmpty(caseAffiliates)){ + for (CaseAffiliateEntity affiliate : caseAffiliates) { + if(null!=affiliate.getUserId()) { + userIds.add(affiliate.getUserId()); + } + + } + } List sysUsers = userMapper.selectUserListByAdRole(arbitrator); - if(sysUsers!=null&&sysUsers.size()>0){ + List 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.setNickName(nickNamenew); + if(!userIds.contains(sysUser.getUserId())) { + 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; } /** @@ -259,6 +289,13 @@ public class SysUserServiceImpl implements ISysUserService { @Override @Transactional public AjaxResult insertUser(SysUser user) { + // 校验手机号是否重复 + if(StrUtil.isNotEmpty(user.getPhonenumber())){ + if(userMapper.checkPhoneUnique(user.getPhonenumber())!=null){ + return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,手机号码已存在"); + } + } + Long deptId = user.getDeptId(); Long[] postIds = user.getPostIds(); if (deptId != null) { @@ -296,6 +333,11 @@ public class SysUserServiceImpl implements ISysUserService { */ @Override public boolean registerUser(SysUser user) { + if(StrUtil.isNotEmpty(user.getPhonenumber())){ + if(userMapper.checkPhoneUnique(user.getPhonenumber())!=null){ + throw new ServiceException("注册用户'" + user.getUserName() + "'失败,手机号码已存在"); + } + } return userMapper.insertUser(user) > 0; } @@ -315,13 +357,15 @@ public class SysUserServiceImpl implements ISysUserService { Integer deptType = dept.getDeptType(); if (deptType != null && deptType.intValue() == 1) { SysPost sysPost = postMapper.selectPostByPostCode("jbr"); - Long postId = sysPost.getPostId(); - if (postIds.length > 0) { - boolean isContain = Arrays.asList(postIds).contains(postId); - if (isContain) { - List sysUsers = userMapper.selectUserByDeptId(deptId); - if (sysUsers != null && sysUsers.size() > 0) { - return AjaxResult.error("部门类型为仲裁机构的部门的岗位为经办人的用户只能有一个!"); + if(sysPost!=null) { + Long postId = sysPost.getPostId(); + if (postIds.length > 0) { + boolean isContain = Arrays.asList(postIds).contains(postId); + if (isContain) { + List sysUsers = userMapper.selectUserByDeptId(deptId); + if (sysUsers != null && sysUsers.size() > 0) { + return AjaxResult.error("部门类型为仲裁机构的部门的岗位为经办人的用户只能有一个!"); + } } } } @@ -522,6 +566,11 @@ public class SysUserServiceImpl implements ISysUserService { BeanValidators.validateWithException(validator, user); user.setPassword(SecurityUtils.encryptPassword(password)); user.setCreateBy(operName); + if(StrUtil.isNotEmpty(user.getPhonenumber())){ + if(userMapper.checkPhoneUnique(user.getPhonenumber())!=null){ + throw new ServiceException("导入用户'" + user.getUserName() + "'失败,手机号码已存在"); + } + } userMapper.insertUser(user); successNum++; successMsg.append("
" + successNum + "、账号 " + user.getUserName() + " 导入成功"); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/StringIdsReq.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/StringIdsReq.java new file mode 100644 index 0000000..07c5b6c --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/StringIdsReq.java @@ -0,0 +1,26 @@ +package com.ruoyi.wisdomarbitrate; + +import lombok.Data; + +import java.util.List; + +@Data +public class StringIdsReq { + private List ids; + /** + * 签署人账号(即仲裁员手机号) + */ + private String psnAccount; + /** + * 签署人id + */ + private String psnId ; + /** + * 机构账户 + */ + private String orgId ; + /** + * 批号 + */ + private Integer batchNumber; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ArbitrateRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ArbitrateRecord.java index eed8844..a86b846 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ArbitrateRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ArbitrateRecord.java @@ -28,7 +28,7 @@ public class ArbitrateRecord extends BaseEntity { /** 仲裁员审核裁决书意见 */ private String arbitraCheckOpinion; /** 裁决书附件id */ - private Integer annexId; + private Long annexId; /** 被申请人是否缺席 */ private Integer isAbsence; @@ -62,14 +62,17 @@ public class ArbitrateRecord extends BaseEntity { */ private String caseCheckReject; /** - * 仲裁员确认裁决书驳回 + * 裁决书驳回原因 */ private String arbitrateReject; /** * 部门长确认裁决书驳回 */ private String deptorReject; - + /** + * 缴费确认驳回原因 + */ + private String payRejectReason; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/Arbitrator.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/Arbitrator.java index 4e73c8d..09d4482 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/Arbitrator.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/Arbitrator.java @@ -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; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/BatchCaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/BatchCaseApplication.java index 0a81451..72abf5a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/BatchCaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/BatchCaseApplication.java @@ -22,4 +22,10 @@ public class BatchCaseApplication { private Integer opinion; /** 驳回原因 */ private String caseCheckReject; + /** + * 批号 + */ + private String batchNumber; + + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index a92310b..4d9b7e6 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.domain; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; +import com.ruoyi.wisdomarbitrate.domain.vo.CaseAffiliateVO; import lombok.Data; import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue; @@ -17,6 +18,19 @@ public class CaseApplication extends BaseEntity { * 查询案件时区分是否待办案件,0待办案件,1已办案件 */ private String selectCaseStatus; + /** + * 房间号 + */ + private String roomId; + /** + * 仲裁员,0-否,1-是 + */ + private Integer arbitratorFlag; + /** + * 第三方代理人,0-否,1-是 + */ + private Integer agentFlag; + /** ID */ private Long id; @@ -26,6 +40,10 @@ public class CaseApplication extends BaseEntity { /** 案件编号 */ // @Excel(name = "案件编号") private String caseNum; + /** + * 是否同意,0-否 + */ + private Integer opinion; /** 案件标的 */ @Excel(name = "案件标的") private BigDecimal caseSubjectAmount; @@ -39,7 +57,7 @@ public class CaseApplication extends BaseEntity { /** 立案日期 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date registerDate; - /** 仲裁方式 */ + /** 仲裁方式 ,1-开庭,2-书面*/ private Integer arbitratMethod; /** * 是否导入,0手动录入,1导入,默认0 @@ -50,12 +68,17 @@ public class CaseApplication extends BaseEntity { /** 案件状态 */ private Integer caseStatus; + private String caseStatusstr; /** 申请人是否书面审理 */ private Integer applicantIsWrittenHear; /** 被申请人是否书面审理 */ private Integer respondentIsWrittenHear; + /** 开庭方式是否一致 */ + private Integer arbitraMethodIssame; + /** 仲裁方式说明 */ + private String arbitratMethodIllustrate; /** 案件申请表ID */ @@ -183,11 +206,15 @@ public class CaseApplication extends BaseEntity { /** * 用户id */ - private String userId; + private Long userId; /** * 登录用户用户名 */ private String loginUserName; + /** + * 登录人电话 + */ + private String loginUserPhone; private List deptIds; /** * 部门长状态 @@ -202,7 +229,7 @@ public class CaseApplication extends BaseEntity { */ private Integer financeStatus; /** - * 是否是被申请人,仲裁员,部门长,财务,代理人,0-否,1-是 + * 是否查询全部节点 */ private Integer isOtherRole; /** @@ -214,7 +241,7 @@ public class CaseApplication extends BaseEntity { /** 是否指派仲裁员 */ private int pendingAppointArbotrar; /** 案件关联人信息 */ - private List caseAffiliates; + private CaseAffiliateVO affiliate; /** 案件仲裁员 */ private List arbitrators; @@ -222,7 +249,10 @@ public class CaseApplication extends BaseEntity { private List caseStatusList; private List annexTypeList; - + /** + * 立案申请书(1)、申请人证据材料(2)、裁决书(3)、案件视频(4)、身份证件(5) + * 被申请人证据材料 (6)、庭审笔录(7)、缴费凭证(8)、视频录制(9)、公章图片(10)、语音转录文件(11) + */ private Integer annexType; /** * 案件附件列表 @@ -403,9 +433,29 @@ public class CaseApplication extends BaseEntity { /** * 批号 */ - private String batchNumber; + private Integer batchNumber; /** * 自定义字段 */ private List columnValues; + /** + * 待办状态,0待办,1已办 + */ + private Integer pendingStatus; + /** e签宝流程id */ + private String signFlowId; + /** + * 登录用户名 + */ + private String userName; + // 缴费确认驳回原因 + private String payRejectReason; + /** + * 仲裁员确认裁决书驳回原因 + */ + private String arbitrateReject; + /** + * deptorReject:部门长驳回原因 + */ + private String deptorReject; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java index e39680a..14cea94 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java @@ -1,19 +1,22 @@ package com.ruoyi.wisdomarbitrate.domain; + import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -@Data +import java.util.List; + @Builder +@Data @AllArgsConstructor @NoArgsConstructor -public class CaseAttach { +public class CaseAttach { /** - * 附件id + * 附件id */ - private Integer annexId; + private Long annexId; /** * 案件申请id */ @@ -22,6 +25,10 @@ public class CaseAttach { * 案件记录id */ private Long caseAppliLogId; + /** + * onlyOffice附件id + */ + private String onlyOfficeFileId; /** * 附件名称 */ @@ -31,7 +38,7 @@ public class CaseAttach { */ private String annexPath; /** - * 附件类型,立案申请书(1)、申请人证据材料(2)、仲裁文书(3)、案件视频(4)、身份证件(5)、被申请人证据材料 (6)、庭审笔录(7)、缴费凭证(8)' + * 附件类型,立案申请书(1)、申请人证据材料(2)、裁决书(3)、案件视频(4)、身份证件(5)、被申请人证据材料 (6)、庭审笔录(7)、缴费凭证(8)' */ private Integer annexType; /** @@ -54,5 +61,9 @@ public class CaseAttach { * 是否是证据上传,0-否,1-是 */ private Integer isBatchUpload; + /** + * 附件ids + */ + private List fileIds; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseEvidenceDirectory.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseEvidenceDirectory.java index 57c29de..a5f3527 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseEvidenceDirectory.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseEvidenceDirectory.java @@ -34,7 +34,7 @@ public class CaseEvidenceDirectory extends BaseEntity { /** * 附件id */ - private Integer annexId; + private Long annexId; /** * 级数 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseLogRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseLogRecord.java index 0441575..295f91a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseLogRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseLogRecord.java @@ -42,6 +42,18 @@ public class CaseLogRecord extends BaseEntity { * 下一个节点角色名称 */ private String nextRoleName; + /** + * 当前节点角色名称 + */ + private String currentRoleName; + + public String getCurrentRoleName() { + return currentRoleName; + } + + public void setCurrentRoleName(String currentRoleName) { + this.currentRoleName = currentRoleName; + } public String getNextRoleName() { return nextRoleName; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealManage.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealManage.java index 3b835d8..84371fe 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealManage.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealManage.java @@ -29,7 +29,7 @@ public class SealManage extends BaseEntity { /** * 附件id */ - private Integer annexId; + private Long annexId; /** * 印章审核状态(0未通过,1通过) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java index 7365e10..00b2748 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java @@ -1,7 +1,13 @@ package com.ruoyi.wisdomarbitrate.domain; import com.ruoyi.common.core.domain.BaseEntity; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +@Data +@NoArgsConstructor +@AllArgsConstructor public class SealSignRecord extends BaseEntity { private static final long serialVersionUID = 1L; @@ -25,15 +31,6 @@ public class SealSignRecord extends BaseEntity { private String orgnizeNamepsnName; String fileDownloadUrl; - - public String getFileDownloadUrl() { - return fileDownloadUrl; - } - - public void setFileDownloadUrl(String fileDownloadUrl) { - this.fileDownloadUrl = fileDownloadUrl; - } - /** 流程状态 */ private Integer signFlowStatus; /** 签名状态 */ @@ -44,171 +41,11 @@ public class SealSignRecord extends BaseEntity { /** 签名链接 */ private String signUrl; - public String getSignUrl() { - return signUrl; - } - - public void setSignUrl(String signUrl) { - this.signUrl = signUrl; - } - - public String getSealUrl() { - return sealUrl; - } - - public void setSealUrl(String sealUrl) { - this.sealUrl = sealUrl; - } - /** 用印链接 */ private String sealUrl; private Long caseAppliId; - public Long getCaseAppliId() { - return caseAppliId; - } - - public void setCaseAppliId(Long caseAppliId) { - this.caseAppliId = caseAppliId; - } - - public Integer getPsnsignStatus() { - return psnsignStatus; - } - - public void setPsnsignStatus(Integer psnsignStatus) { - this.psnsignStatus = psnsignStatus; - } - - public Integer getOrgsignStatus() { - return orgsignStatus; - } - - public void setOrgsignStatus(Integer orgsignStatus) { - this.orgsignStatus = orgsignStatus; - } - - public Integer getSignFlowStatus() { - return signFlowStatus; - } - - public void setSignFlowStatus(Integer signFlowStatus) { - this.signFlowStatus = signFlowStatus; - } - - public String getFileid() { - return fileid; - } - - public void setFileid(String fileid) { - this.fileid = fileid; - } - - public String getFilename() { - return filename; - } - - public void setFilename(String filename) { - this.filename = filename; - } - - public String getSignFlowid() { - return signFlowid; - } - - public void setSignFlowid(String signFlowid) { - this.signFlowid = signFlowid; - } - - public String getPensonAccount() { - return pensonAccount; - } - - public void setPensonAccount(String pensonAccount) { - this.pensonAccount = pensonAccount; - } - - public String getPensonName() { - return pensonName; - } - - public void setPensonName(String pensonName) { - this.pensonName = pensonName; - } - - public String getOrgnizeName() { - return orgnizeName; - } - - public void setOrgnizeName(String orgnizeName) { - this.orgnizeName = orgnizeName; - } - - public String getOrgnizeNamePsnAccount() { - return orgnizeNamePsnAccount; - } - - public void setOrgnizeNamePsnAccount(String orgnizeNamePsnAccount) { - this.orgnizeNamePsnAccount = orgnizeNamePsnAccount; - } - - public String getOrgnizeNamepsnName() { - return orgnizeNamepsnName; - } - - public void setOrgnizeNamepsnName(String orgnizeNamepsnName) { - this.orgnizeNamepsnName = orgnizeNamepsnName; - } - - public String getPositionPagepsn() { - return positionPagepsn; - } - - public void setPositionPagepsn(String positionPagepsn) { - this.positionPagepsn = positionPagepsn; - } - - public double getPositionXpsn() { - return positionXpsn; - } - - public void setPositionXpsn(double positionXpsn) { - this.positionXpsn = positionXpsn; - } - - public double getPositionYpsn() { - return positionYpsn; - } - - public void setPositionYpsn(double positionYpsn) { - this.positionYpsn = positionYpsn; - } - - public String getPositionPageorg() { - return positionPageorg; - } - - public void setPositionPageorg(String positionPageorg) { - this.positionPageorg = positionPageorg; - } - - public double getPositionXorg() { - return positionXorg; - } - - public void setPositionXorg(double positionXorg) { - this.positionXorg = positionXorg; - } - - public double getPositionYorg() { - return positionYorg; - } - - public void setPositionYorg(double positionYorg) { - this.positionYorg = positionYorg; - } - /** 签名位置页数 */ private String positionPagepsn; /** 签名位置x坐标 */ @@ -221,15 +58,15 @@ public class SealSignRecord extends BaseEntity { private double positionXorg; /** 印章位置y坐标 */ private double positionYorg; + /** + * 仲裁员签名状态,1-签名 + */ + private Integer signStatusArbitor; + /** + * 用印状态,1用印 + */ + private Integer sealStatus; - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SmsSendRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SmsSendRecord.java deleted file mode 100644 index 9c36063..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SmsSendRecord.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.ruoyi.wisdomarbitrate.domain; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.core.domain.BaseEntity; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class SmsSendRecord extends BaseEntity { - /** - * ID - */ - private Long id; - /** - * 案件申请id - */ - private Long caseId; - /** - * 案件编号 - */ - private String caseNum; - /** - * 手机号 - */ - private String phone; - /** - * 发送时间 - */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date sendTime; - /** - * 发送内容 - */ - private String sendContent; - - /** - * 发送状态 - */ - private Integer sendStatus; -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseApplicationDTO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseApplicationDTO.java new file mode 100644 index 0000000..3ea30ce --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseApplicationDTO.java @@ -0,0 +1,309 @@ +package com.ruoyi.wisdomarbitrate.domain.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.wisdomarbitrate.domain.CaseAttach; +import com.ruoyi.wisdomarbitrate.domain.vo.CaseAffiliateVO; +import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * @Classname CaseApplicationDTO + * @Description 案件申请表 + * @Version 1.0.0 + * @Date 2024/5/22 9:19 + * @Created wangqiong + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class CaseApplicationDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + private Long id; + + /** + * 案件编号 + */ + private String caseNum; + + /** + * 案件标的 + */ + private BigDecimal caseSubjectAmount; + + /** + * 立案日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai") + private Date registerDate; + + /** + * 仲裁方式,视频仲裁(1)、书面仲裁(2) + */ + private Long arbitratMethod; + + /** + * 案件状态,立案申请(0)、待立案审查(1)、 待缴费(2)、待缴费确认(3)、 待案件质证(4)、 + */ + private Integer caseStatus; + + /** + * 开庭日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai") + private Date hearDate; + + /** + * 申请人仲裁请求及事实和理由 + */ + private String arbitratClaims; + + /** + * 借款开始日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai") + private Date loanStartDate; + + /** + * 借款结束日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai") + private Date loanEndDate; + + /** + * 申请人主张欠本金 + */ + private BigDecimal claimPrinciOwed; + + /** + * 申请人主张欠利息 + */ + private BigDecimal claimInterestOwed; + + /** + * 申请人主张违约金 + */ + private BigDecimal claimLiquidDamag; + + /** + * 仲裁应缴费用 + */ + private BigDecimal feePayable; + + + /** + * 合同编号 + */ + private String contractNumber; + + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai") + private Date createTime; + + /** + * 更新者 + */ + private String updateBy; + + /** + * 更新时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai") + private Date updateTime; + + /** + * 创建者 + */ + private String createBy; + + /** + * 仲裁员id + */ + private String arbitratorId; + + /** + * 案件名称 + */ + private String caseName; + + /** + * 仲裁结果 + */ + private String caseResult; + + /** + * 是否同意组庭,0否,1是 + */ + private Integer isAgreePendTral; + + /** + * 是否有异议需要举证,1是,0否 + */ + private Integer objectionAddEviden; + + + /** + * 案件实缴费用 + */ + private BigDecimal paidExpenses; + + /** + * 裁决书URL + */ + private String filearbitraUrl; + + /** + * 支付方式(0线上支付,1线下支付) + */ + private String payType; + + /** + * 申请人请求仲裁庭裁决 + */ + private String requestRule; + + /** + * 是否仲裁反请求,1是,0否 + */ + private Integer adjudicaCounter; + + /** + * 仲裁反请求原因 + */ + private String adjudicaCounterReason; + + /** + * 是否财产保全申请,1是,0否 + */ + private Integer properPreser; + + /** + * 是否管辖异议申请,1是,0否 + */ + private Integer objectiJuris; + + /** + * 被申请人是否缺席,1是,0否 + */ + private Integer isAbsence; + + /** + * 被申请人质证意见 + */ + private String responCrossOpin; + + /** + * 申请人质证意见 + */ + private String applicaCrossOpin; + + /** + * 被申请人的答辩意见 + */ + private String responDefenOpini; + + /** + * 申请人是否缺席,1是,0否 + */ + private Integer appliIsAbsen; + + /** + * 是否锁定,0-否,1-是 + */ + private Integer lockStatus; + + /** + * 视频会议房间号id + */ + private String roomId; + + /** + * 是否导入,0手动录入,1导入,默认0 + */ + private Integer importFlag=0; + + /** + * 版本号 + */ + private Integer version; + + /** + * 事实和理由 + */ + private String facts; + + /** + * 批次 + */ + private Integer batchNumber; + + /** + * 模板id + */ + private Long templateId; + + /** + * 调解内容 + */ + private String mediationAgreement; + + /** + * 申请人是否书面审理 ,0否,1是 + */ + private Integer appliIswritHear; + + /** + * 被申请人是否书面审理 + */ + private Integer responIsWritHear; + + /** + * 案件附件相关表 + */ + private List caseAttachList; + /** + * 附件类型 + */ + private List annexTypeList; + /** + * 附件类型 + */ + private Integer annexType; + /** + * 自定义字段 + */ + private List columnValueList; + /** + * 案件相关人员 + */ + private CaseAffiliateVO affiliate; + /** + * 待办状态,0-待办,1-已办 + */ + private Integer pendingStatus; + /** + * 仲裁方式名称,1-线上调解,2-线下调解 + */ + private String arbitratMethodName; + /** + * 申请机构名称 + */ + private String applicationName; + /** + * 被申请人姓名 + */ + private String respondentName; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseConfirmPayDTO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseConfirmPayDTO.java index 596759f..ae00cb0 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseConfirmPayDTO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseConfirmPayDTO.java @@ -25,4 +25,5 @@ public class CaseConfirmPayDTO { * 缴费凭证 */ private List payOrderList; + } \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CasePayDTO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CasePayDTO.java index ff448e3..0c92a68 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CasePayDTO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CasePayDTO.java @@ -35,4 +35,8 @@ public class CasePayDTO { * 缴费凭证 */ private List payOrderList; + /** + * 批号 + */ + private String batchNumber; } \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SendMailRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/sendrecord/SendMailRecord.java similarity index 83% rename from ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SendMailRecord.java rename to ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/sendrecord/SendMailRecord.java index de3e11e..026514b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SendMailRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/sendrecord/SendMailRecord.java @@ -1,11 +1,14 @@ -package com.ruoyi.wisdomarbitrate.domain; +package com.ruoyi.wisdomarbitrate.domain.dto.sendrecord; import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; +import com.ruoyi.wisdomarbitrate.domain.CaseAttach; +import lombok.Data; import java.util.Date; +import java.util.List; +@Data public class SendMailRecord extends BaseEntity { private static final long serialVersionUID = 1L; @@ -40,6 +43,16 @@ public class SendMailRecord extends BaseEntity { private Integer sendStatus; + /** 附件id */ + private String fileIds; + + /** 邮件主题 */ + private String mailSubject; + + /** 邮件发件人地址 */ + private String mailFromAddress; + private List caseAttachList; + public Integer getSendStatus() { return sendStatus; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/sendrecord/SmsSendRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/sendrecord/SmsSendRecord.java new file mode 100644 index 0000000..5141413 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/sendrecord/SmsSendRecord.java @@ -0,0 +1,78 @@ +package com.ruoyi.wisdomarbitrate.domain.dto.sendrecord; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.core.domain.BaseEntity; + +import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsTemplateParam; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; +import java.util.List; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class SmsSendRecord extends BaseEntity { + /** + * ID + */ + private Long id; + /** + * 短信模板主键id + */ + private Long msSmsTemplateId; + /** + * 案件申请id + */ + private Long caseId; + /** + * 案件编号 + */ + private String caseNum; + /** + * 手机号 + */ + private String phone; + /** + * 发送时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date sendTime; + + /** + * 发送状态 + */ + private Integer sendStatus; + /** + * 短信sid,发送的唯一标识 + */ + private String sid; + /** + * 失败原因 + */ + private String reason; + /** + * 短信内容 + */ + private String sendContent; + /** + * 腾讯云模板id + */ + private String templateId; + /** + * 模板内容 + */ + private String templateContent; + private List templateParams; + + public SmsSendRecord(Long caseId, String caseNum, String phone, Date sendTime, String sendContent,String sid) { + this.caseId = caseId; + this.caseNum = caseNum; + this.phone = phone; + this.sendTime = sendTime; + this.sendContent = sendContent; + this.sid = sid; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/CaseAffiliateEntity.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/CaseAffiliateEntity.java new file mode 100644 index 0000000..c11dce4 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/CaseAffiliateEntity.java @@ -0,0 +1,129 @@ +package com.ruoyi.wisdomarbitrate.domain.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import java.util.Date; + +@Getter +@Setter +@ToString +@Data +public class CaseAffiliateEntity { + /** + * id + */ + private Long id; + /** + * 案件主表id,案件申请表主键 + */ + private Long caseAppliId; + /** + * 案件日志表id + */ + private Long caseAppliLogId; + /** + * 用户id,用户表user_id关联 + */ + private Long userId; + /** + * 申请机构id,和部门表id关联 + */ + private Long applicantDeptId; + + /** + * 代码(统一社会信用代码或者身份证号) + */ + private String code; + /** + * 用户名 + */ + private String userName; + + /** + * 法定代表人 + */ + private String compLegalPerson; + /** + * 角色类别,1-申请操作人/申请人,2-申请人代理人,3-被申请人操作人/被申请人,4-被申请人代理人 + */ + private Integer roleType=1; + /** + * 组别 + */ + private Integer groupOrder; + /** + * 是否操作人,0-否,1-是 + */ + private Integer operatorFlag=1; + /** + * 是否机构申请,0-自然人,1-申请机构,默认0 + */ + private Integer organizeFlag=0; + /** + * 电话 + */ + private String phone; + /** + * 邮箱 + */ + private String email; + /** + * 姓名 + */ + private String name; + /** + * 住所 + */ + private String home; + /** + * 联系地址 + */ + private String address; + /** + * 身份证号 + */ + private String idCard; + + /** + * '身份类别,0-身份证,1-护照,默认0' + */ + private Integer idType; + /** + * 国籍,0-境内,1-境外,默认0 + */ + private Integer nationality; + /** + * 生日 + */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai") + private Date birth; + /** + * 性别,0-男,1-女 + */ + private String sex; + /** + * 被申请人姓名 + */ + private String resName; + /** + * 角色名称 + */ + private String roleName; + /** + * 申请机构名称 + */ + private String applicantOrgName; + /** + * 角色id + */ + private Long roleId; + /** + * 职位 + */ + private String position; + +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/sms/MsSmsSendHistoryRecordParam.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/sms/MsSmsSendHistoryRecordParam.java new file mode 100644 index 0000000..8c6ceb1 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/sms/MsSmsSendHistoryRecordParam.java @@ -0,0 +1,32 @@ +package com.ruoyi.wisdomarbitrate.domain.entity.sms; + +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import javax.persistence.Column; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; + +@Getter +@Setter +@ToString +@Table(name = "sms_send_history_record_param") +public class MsSmsSendHistoryRecordParam { + @Id + @GeneratedValue(generator = "JDBC") + private Long id; + + /** + * 短信历史记录表id + */ + @Column(name = "sms_record_history_id") + private Long smsRecordHistoryId; + + /** + * 参数值 + */ + @Column(name = "param_value") + private String paramValue; +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/sms/MsSmsSendRecordParam.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/sms/MsSmsSendRecordParam.java new file mode 100644 index 0000000..0be5ad6 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/sms/MsSmsSendRecordParam.java @@ -0,0 +1,33 @@ +package com.ruoyi.wisdomarbitrate.domain.entity.sms; + +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import javax.persistence.Column; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; + +@Getter +@Setter +@ToString +@Table(name = "sms_send_record_param") +public class MsSmsSendRecordParam { + @Id + @GeneratedValue(generator = "JDBC") + private Integer id; + + /** + * 短信记录表id + */ + @Column(name = "sms_record_id") + private Long smsRecordId; + + + /** + * 参数值 + */ + @Column(name = "param_value") + private String paramValue; +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/sms/MsSmsTemplate.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/sms/MsSmsTemplate.java new file mode 100644 index 0000000..92e12eb --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/sms/MsSmsTemplate.java @@ -0,0 +1,38 @@ +package com.ruoyi.wisdomarbitrate.domain.entity.sms; + +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import javax.persistence.*; +import java.util.List; + +@Getter +@Setter +@ToString +@Table(name = "sms_template") +public class MsSmsTemplate { + @Id + @GeneratedValue(generator = "JDBC") + private Long id; + + /** + * 腾讯云模板id + */ + @Column(name = "template_id") + private String templateId; + + /** + * 模板名称 + */ + private String name; + /** + * 模板内容 + */ + private String content; + /** + * 模板参数 + */ + @Transient + private List templateParams; +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/sms/MsSmsTemplateParam.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/sms/MsSmsTemplateParam.java new file mode 100644 index 0000000..e1de3a8 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/sms/MsSmsTemplateParam.java @@ -0,0 +1,38 @@ +package com.ruoyi.wisdomarbitrate.domain.entity.sms; + +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import javax.persistence.*; + +@Getter +@Setter +@ToString +@Table(name = "sms_template_param") +public class MsSmsTemplateParam { + @Id + @GeneratedValue(generator = "JDBC") + private Long id; + + /** + * ms_sms_template表id + */ + @Column(name = "sms_template_id") + private Long smsTemplateId; + + /** + * 参数 + */ + private String param; + /** + * 参数名 + */ + @Column(name = "param_name") + private String paramName; + /** + * 参数值 + */ + @Transient + private String paramValue; +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/shortmessage/MeetingInfo.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/shortmessage/MeetingInfo.java new file mode 100644 index 0000000..51b528e --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/shortmessage/MeetingInfo.java @@ -0,0 +1,60 @@ +package com.ruoyi.wisdomarbitrate.domain.shortmessage; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.persistence.Column; +import javax.persistence.Id; +import javax.persistence.Table; +import java.util.Date; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@Table(name = "meeting_info") +public class MeetingInfo { + /** + * 主键Id + */ + @Id + private String uid; + + /** + * 案件Id + */ + @Column(name = "case_id") + private Long caseId; + + /** + * 用户Id + */ + @Column(name = "user_id") + private Long userId; + + /** + * 用户名称 + */ + @Column(name = "user_name") + private String userName; + + /** + * 房间Id + */ + @Column(name = "room_id") + private String roomId; + + /** + * 系统类型 + */ + @Column(name = "system_type") + private String systemType; + + /** + * 创建时间 + */ + @Column(name = "create_time") + private Date createTime; +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/shortmessage/MsSendMailHistoryRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/shortmessage/MsSendMailHistoryRecord.java new file mode 100644 index 0000000..53b2890 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/shortmessage/MsSendMailHistoryRecord.java @@ -0,0 +1,111 @@ +package com.ruoyi.wisdomarbitrate.domain.shortmessage; + +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import javax.persistence.Column; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import java.util.Date; + +@Getter +@Setter +@ToString +@Table(name = "send_mail_history_record") +public class MsSendMailHistoryRecord { + @Id + @GeneratedValue(generator = "JDBC") + private Long id; + + /** + * 邮件名称 + */ + @Column(name = "mail_name") + private String mailName; + + /** + * 邮件接收地址 + */ + @Column(name = "mail_address") + private String mailAddress; + + /** + * 发送时间 + */ + @Column(name = "send_time") + private Date sendTime; + + /** + * 案件编号 + */ + @Column(name = "case_num") + private String caseNum; + + /** + * 发送状态 + */ + @Column(name = "send_status") + private Long sendStatus; + + /** + * 立案申请id + */ + @Column(name = "case_id") + private Long caseId; + + /** + * 创建时间 + */ + @Column(name = "create_time") + private Date createTime; + + /** + * 创建者 + */ + @Column(name = "create_by") + private String createBy; + + /** + * 更新者 + */ + @Column(name = "update_by") + private String updateBy; + + /** + * 更新时间 + */ + @Column(name = "update_time") + private Date updateTime; + + /** + * 附件id用英文逗号隔开 + */ + @Column(name = "file_ids") + private String fileIds; + + /** + * 邮件主题 + */ + @Column(name = "mail_subject") + private String mailSubject; + + /** + * 邮件发送地址 + */ + @Column(name = "mail_from_address") + private String mailFromAddress; + + /** + * 邮件父类id + */ + @Column(name = "parent_id") + private Long parentId; + + /** + * 邮件内容 + */ + @Column(name = "mail_content") + private String mailContent; +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/shortmessage/MsSmsSendHistoryRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/shortmessage/MsSmsSendHistoryRecord.java new file mode 100644 index 0000000..20179df --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/shortmessage/MsSmsSendHistoryRecord.java @@ -0,0 +1,98 @@ +package com.ruoyi.wisdomarbitrate.domain.shortmessage; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.persistence.Column; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import java.util.Date; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@Table(name = "sms_send_history_record") +public class MsSmsSendHistoryRecord { + @Id + @GeneratedValue(generator = "JDBC") + private Long id; + + /** + * 案件id + */ + @Column(name = "case_appli_id") + private Long caseAppliId; + /** + * 短信模板表主键id + */ + @Column(name = "ms_sms_template_id") + private Long msSmsTemplateId; + + /** + * 案件编号 + */ + @Column(name = "case_num") + private String caseNum; + + /** + * 手机号 + */ + private String phone; + + /** + * 发送时间 + */ + @Column(name = "send_time") + private Date sendTime; + + /** + * 发送状态,0-失败,1-成功 + */ + @Column(name = "send_status") + private Long sendStatus; + + + /** + * 创建时间 + */ + @Column(name = "create_time") + private Date createTime; + + /** + * 更新时间 + */ + @Column(name = "update_time") + private Date updateTime; + + /** + * 创建人 + */ + @Column(name = "create_by") + private String createBy; + + /** + * 更新者 + */ + @Column(name = "update_by") + private String updateBy; + + /** + * 发送短信唯一标识 + */ + private String sid; + + /** + * 父类短信id + */ + @Column(name = "parent_id") + private Long parentId; + + /** + * 失败原因 + */ + private String reason; +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseAffiliateBase.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseAffiliateBase.java new file mode 100644 index 0000000..70a2324 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseAffiliateBase.java @@ -0,0 +1,33 @@ +package com.ruoyi.wisdomarbitrate.domain.vo; + +import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; +import com.ruoyi.wisdomarbitrate.domain.entity.CaseAffiliateEntity; +import lombok.Data; + +/** + * @Classname MsCaseAffiliateList + * @Description 案件人员表 + * @Version 1.0.0 + * @Date 2024/3/27 16:08 + * @Created wangqiong + */ +@Data +public class CaseAffiliateBase { + /** + * 申请人/操作人 + */ + private CaseAffiliateEntity applicant; + /** + * 申请人代理人 + */ + private CaseAffiliateEntity applicantAgent; + /** + * 被申请人/操作人 + */ + private CaseAffiliateEntity res; + /** + * 被申请人代理人 + */ + private CaseAffiliateEntity resAgent; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseAffiliateVO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseAffiliateVO.java new file mode 100644 index 0000000..6f099f9 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseAffiliateVO.java @@ -0,0 +1,32 @@ +package com.ruoyi.wisdomarbitrate.domain.vo; + +import lombok.Data; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import java.util.List; + +/** + * @Classname MsCaseAffiliateVO + * @Description 案件人员表 + * @Version 1.0.0 + * @Date 2024/3/22 11:46 + * @Created wangqiong + */ +@Getter +@Setter +@ToString +@Data +public class CaseAffiliateVO { + /** + * 申请人/操作人 + */ + private List applicant; + + /** + * 被申请人/操作人 + */ + private List res; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseApplicationVO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseApplicationVO.java new file mode 100644 index 0000000..cb11f90 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseApplicationVO.java @@ -0,0 +1,419 @@ +package com.ruoyi.wisdomarbitrate.domain.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; +import com.ruoyi.wisdomarbitrate.domain.CaseAttach; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +@Data +public class CaseApplicationVO { + private static final long serialVersionUID = 1L; + /** + * 查询案件时区分是否待办案件,0待办案件,1已办案件 + */ + private String selectCaseStatus; + + /** ID */ + private Long id; + /** 案件名称 */ + @Excel(name = "案件名称") + private String caseName; + /** 案件编号 */ +// @Excel(name = "案件编号") + private String caseNum; + /** 案件标的 */ + @Excel(name = "案件标的") + private BigDecimal caseSubjectAmount; + /** + * 模板id + */ + private Long templateId; + + + + /** 立案日期 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date registerDate; + /** 仲裁方式 */ + private Integer arbitratMethod; + /** + * 是否导入,0手动录入,1导入,默认0 + */ + private Integer importFlag; + /** 仲裁方式名称 */ + private String arbitratMethodName; + + /** 案件状态 */ + private Integer caseStatus; + private String caseStatusstr; + + /** 申请人是否书面审理 */ + private Integer applicantIsWrittenHear; + + /** 被申请人是否书面审理 */ + private Integer respondentIsWrittenHear; + /** 开庭方式是否一致 */ + private Integer arbitraMethodIssame; + /** 仲裁方式说明 */ + private String arbitratMethodIllustrate; + + + /** 案件申请表ID */ + private Long caseAppliId; + + /** 开庭日期 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date hearDate; + + /** 借款开始日期 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "借款开始日期") + private Date loanStartDate; + /** 借款结束日期 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "借款结束日期") + private Date loanEndDate; + /** 合同编号 */ + @Excel(name = "合同编号") + private String contractNumber; + /** 申请人主张欠本金 */ + @Excel(name = "申请人主张欠本金") + private BigDecimal claimPrinciOwed; + /** 申请人主张欠利息 */ + @Excel(name = "申请人主张欠利息") + private BigDecimal claimInterestOwed; + /** 申请人主张违约金 */ + @Excel(name = "申请人主张违约金") + private BigDecimal claimLiquidDamag; + /** 申请人请求仲裁庭裁决 */ + @Excel(name = "申请人请求仲裁庭裁决",width = 36) + private String requestRule; + + /** 是否财产保全申请 */ + @Excel(name = "是否财产保全申请",width = 26,combo= {"是","否"},readConverterExp = "0=否,1=是") + private Integer properPreser; + /** 申请人仲裁请求及事实和理由 */ + @Excel(name = "申请人仲裁请求及事实和理由",width = 36) + private String arbitratClaims; + /** 仲裁应缴费用 */ + private BigDecimal feePayable; + + /** 开始在线视频时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date beginVideoDate; + /** 在线视频人员 */ + private String onlineVideoPerson; + + /** 仲裁员id */ + private String arbitratorId; + /** 仲裁员名称 */ + private String arbitratorName; + + /** 案件描述 */ + private String caseDescribe; + /** 裁决书URL */ + private String filearbitraUrl; + + /** 是否同意组庭 */ + private Integer isAgreePendTral; + + /** 是否有异议需要举证 */ + private Integer objectionAddEviden; + /** 是否需要开庭审理 */ + private Integer openCourtHear; + + /** 是否仲裁反请求 */ + private Integer adjudicaCounter; + /** + * 仲裁反请求原因 + */ + private String adjudicaCounterReason; + + /** 被申请人是否缺席 */ + private Integer isAbsence; + /** 是否管辖异议申请 */ + private Integer objectiJuris; + /** 被申请人质证意见 */ + private String responCrossOpin; + /** 被申请人的答辩意见 */ + private String responDefenOpini; + /** 申请人是否缺席 */ + private Integer appliIsAbsen; + + /** 申请人质证意见 */ + private String applicaCrossOpin; + + /** 支付状态 */ + private Integer paymentStatus; + + /** 支付状态描述 */ + private String paymentStatusName; + /** + * 支付方式code,0线上支付,1线下支付 + */ + private Integer payTypeCode; + /** + * 支付方式name,0线上支付,1线下支付 + */ + private String payTypeName; + + + + // 导入校验失败信息 + private StringBuilder errorMsg; + /** + * 是否锁定,0-否,1-是 + */ + private Integer lockStatus; + /** 案件状态名称 */ + private String caseStatusName; + /** 是否同意审核 */ + private Integer agreeOrNotCheck; + /** 申请人名称 */ + private String applicantName; + /** 被申请人名称 */ + private String respondentName; + /** + * 用户身份证号 + */ + private String idCard; + /** + * 用户id + */ + private String userId; + /** + * 登录用户用户名 + */ + private String loginUserName; + private List deptIds; + /** + * 部门长状态 + */ + private List deptHeadStatus; + /** + * 代理人角色有关部门 + */ + private List agentDeptIds; + /** + * 财务状态 + */ + private Integer financeStatus; + /** + * 是否是被申请人,仲裁员,部门长,财务,代理人,0-否,1-是 + */ + private Integer isOtherRole; + /** + * 案件日志id + */ + private Long caseLogId; + /** 仲裁结果 */ + private String caseResult; + + /** 案件关联人信息 */ + private List caseAffiliates; + + + + private List caseStatusList; + + private List annexTypeList; + + private Integer annexType; + /** + * 案件附件列表 + */ + private List caseAttachList; + + + + + /** + * 申请人主体信息 + */ + /** 姓名 */ + @Excel(name = "申请人主体信息-申请人(机构)",width = 26) + private String name; + /** 身份证号 */ + @Excel(name = "申请人主体信息-代码",width = 26) + private String identityNum; + /** 申请人主体信息-法定代表人 */ + @Excel(name = "申请人主体信息-法定代表人",width = 26) + private String compLegalPerson; + /** 申请人主体信息-法定代表人 */ + @Excel(name = "申请人主体信息-法定代表人职位",width = 26) + private String compLegalperPost; + /** + * 申请人主体信息-申请人(机构)id + */ + private String nameId; + + /** 联系电话 */ + @Excel(name = "申请人主体信息-联系电话",width = 26) + private String contactTelphone; + /** 联系地址 */ + @Excel(name = "申请人主体信息-联系地址",width = 26) + private String contactAddress; + /** 单位电话 */ + @Excel(name = "申请人主体信息-单位电话",width = 26) + private String workTelphone; + /** 单位地址 */ + @Excel(name = "申请人主体信息-单位地址",width = 26) + private String workAddress; + + /** 申请人住所 */ + @Excel(name = "申请人主体信息-住所",width = 26) + private String residenAffiliAppli; + + /** 申请人邮箱 */ + @Excel(name = "申请人主体信息-邮箱",width = 26) + private String email; + /** 代理人姓名 */ + @Excel(name = "申请人主体信息-代理人姓名",width = 26) + private String nameAgent; + /** 身份证号 */ + @Excel(name = "申请人主体信息-代理人身份证号",width = 26) + private String identityNumAgent; + + /** 联系电话 */ + @Excel(name = "申请人主体信息-代理人联系电话",width = 26) + private String contactTelphoneAgent; + /** 联系地址 */ + @Excel(name = "申请人主体信息-代理人联系地址",width = 26) + private String contactAddressAgent; + /** 申请人代理人职称 */ + @Excel(name = "申请人主体信息-代理人职称",width = 26) + private String appliAgentTitle; + /** + * 被申请人主体信息 + */ + /** 姓名 */ + @Excel(name = "被申请人主体信息-申请人姓名",width = 26) + private String debtorName; + /** 身份证号 */ + @Excel(name = "被申请人主体信息-身份证号",width = 26) + private String debtorIdentityNum; + /** 被申请人主体信息-性别 */ + @Excel(name = "被申请人主体信息-性别",width = 26,combo= {"男","女"},readConverterExp = "0=男,1=女") + private String responSex; + /** 被申请人主体信息-出生年月日 */ + @Excel(name = "被申请人主体信息-出生年月日",width = 26) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date responBirth; + /** 联系电话 */ + @Excel(name = "被申请人主体信息-联系电话",width = 26) + private String debtorContactTelphone; + /** 联系地址 */ + @Excel(name = "被申请人主体信息-联系地址",width = 26) + private String debtorContactAddress; + /** 被申请人住所 */ + @Excel(name = "被申请人主体信息-住所",width = 26) + private String residenAffiliRespon; + /** 单位电话 */ + @Excel(name = "被申请人主体信息-单位电话",width = 26) + private String debtorWorkTelphone; + /** 单位地址 */ + @Excel(name = "被申请人主体信息-单位地址",width = 26) + private String debtorWorkAddress; + /** 邮箱 */ + @Excel(name = "被申请人主体信息-邮箱",width = 26) + private String debtorEmail; + + /** 代理人姓名 */ + @Excel(name = "被申请人主体信息-代理人姓名",width = 26) + private String debtorNameAgent; + /** 身份证号 */ + @Excel(name = "被申请人主体信息-代理人身份证号",width = 26) + private String debtorIdentityNumAgent; + /** 联系电话 */ + @Excel(name = "被申请人主体信息-代理人联系电话",width = 26) + private String debtorContactTelphoneAgent; + /** 联系地址 */ + @Excel(name = "被申请人主体信息-代理人联系地址",width = 26) + private String debtorContactAddressAgent; + /** + * 申请机构id + */ + private String applicationOrganId; + /** + * 版本号 + */ + private Integer version; + /** + * 修改案件的提交状态,0-未提交,1-已提交,2-同意,3-拒绝,4-撤销 + */ + private Integer updateSubmitStatus; + /** 合同名称 */ + private String contractName; + /** + * 事实和理由 + */ + private String facts; + /** + * 合同甲方 + */ + private String partyA; + /** + * 利率 + */ + private String interestRate; + /** + * 待还金额 + */ + private String outstandingMoney; + /** + * 调解达成协议内容 + */ + private String mediationAgreement; + /** + * 金融消费纠纷基本情况 + */ + private String disputes; + /** + * 贷款类型 + */ + private String loanType; + /** + * 贷款期限 + */ + private String loanTerm; + /** + * 本案争议焦点 + */ + private String caseFocus; + /** + * 本案事实 + */ + private String caseFacts; + /** + * 被申请人对上述材料的质证意见 + */ + private String respondentOpinion; + /** + * 申请人对上述材料的质证意见 + */ + private String applicantOpinion; + /** + * 批号 + */ + private Integer batchNumber; + + /** + * 待办状态,0待办,1已办 + */ + private Integer pendingStatus; + /** e签宝流程id */ + private String signFlowId; + + + + + + + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseEvidenceDirectoryVO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseEvidenceDirectoryVO.java index 51e0d62..2cc5d1f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseEvidenceDirectoryVO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseEvidenceDirectoryVO.java @@ -30,7 +30,7 @@ public class CaseEvidenceDirectoryVO implements Serializable { /** * 附件id */ - private Integer annexId; + private Long annexId; /** * 级数 @@ -105,11 +105,11 @@ public class CaseEvidenceDirectoryVO implements Serializable { this.evidenceName = evidenceName; } - public Integer getAnnexId() { + public Long getAnnexId() { return annexId; } - public void setAnnexId(Integer annexId) { + public void setAnnexId(Long annexId) { this.annexId = annexId; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseEvidenceVO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseEvidenceVO.java index da1e6f2..8abeccf 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseEvidenceVO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseEvidenceVO.java @@ -37,4 +37,8 @@ public class CaseEvidenceVO { */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date scheduleStartTime; + /** + * 案件编号 + */ + private String caseStatusName; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CasePayListVO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CasePayListVO.java index cd789da..6c6263e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CasePayListVO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CasePayListVO.java @@ -4,14 +4,15 @@ import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseApplicationPay; import lombok.Data; +import java.math.BigDecimal; import java.util.List; @Data public class CasePayListVO { /** - * 订单总金额 单位:分 + * 订单总金额 */ - private int totalFee; + private BigDecimal totalFee; /** * 案件总条数 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/ToDoCount.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/ToDoCount.java index 7817936..cb49866 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/ToDoCount.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/ToDoCount.java @@ -21,14 +21,14 @@ public class ToDoCount { private int caseApplyArbitrateWay=0; // 待审核仲裁方式 private int caseApplyGroupOnline=0; // 待开庭审理 private int caseApplyGroupOffline=0; // 待书面审理 - private int caseApplyAward=0; // 待生成仲裁文书 - private int caseApplyAwardCheck=0; // 待核验仲裁文书 - private int caseApplyAwardConfirm=0; // 待审核仲裁文书 - private int caseApplyAwardSign=0; // 待仲裁文书签名 - private int caseApplyAwardSeal=0; // 待仲裁文书用印 - private int caseApplyAwardSend=0; // 待仲裁文书送达 + private int caseApplyAward=0; // 待生成裁决书 + private int caseApplyAwardCheck=0; // 待核验裁决书 + private int caseApplyAwardConfirm=0; // 待审核裁决书 + private int caseApplyAwardSign=0; // 待裁决书签名 + private int caseApplyAwardSeal=0; // 待裁决书用印 + private int caseApplyAwardSend=0; // 待裁决书送达 private int caseApplyStored=0; // 待案件归档 private int caseApplyArchived=0; // 已归档 private int updateOnlineHearDate=0; // 待修改开庭时间 - private int arbitratorApplyAwardConfirm=0; // 待仲裁员审核仲裁文书 + private int arbitratorApplyAwardConfirm=0; // 待仲裁员审核裁决书 } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/shortmessage/MeetingInfoVO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/shortmessage/MeetingInfoVO.java new file mode 100644 index 0000000..0f30ac8 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/shortmessage/MeetingInfoVO.java @@ -0,0 +1,41 @@ +package com.ruoyi.wisdomarbitrate.domain.vo.shortmessage; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class MeetingInfoVO { + /** + * 案件Id + */ + private Long caseId; + + /** + * 用户Id + */ + private Long userId; + + /** + * 用户名称 + */ + private String userName; + + /** + * 房间Id + */ + private String roomId; + + /** + * 系统类型 + */ + private String systemType; + /** + * 登录认证令牌 + */ + private String token; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/shortmessage/ReSendMessageVO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/shortmessage/ReSendMessageVO.java new file mode 100644 index 0000000..5ed7a36 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/shortmessage/ReSendMessageVO.java @@ -0,0 +1,34 @@ +package com.ruoyi.wisdomarbitrate.domain.vo.shortmessage; + + +import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsTemplateParam; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ReSendMessageVO { + /** + * 短信模版Id + */ + private String templateId; + /** + * 手机号 + */ + private String phone; + /** + * 短信id + */ + private Long id; + /** + * 短信模版参数值 + */ + private List templateParams; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateLogMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateLogMapper.java index 7e5affd..b56b105 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateLogMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateLogMapper.java @@ -2,6 +2,7 @@ package com.ruoyi.wisdomarbitrate.mapper; import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.entity.CaseAffiliateEntity; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; @@ -10,7 +11,7 @@ import java.util.List; public interface CaseAffiliateLogMapper { - int batchCaseAffiliate(List caseAffiliates); + int batchCaseAffiliate(List caseAffiliates); void deletecaseAffiliate(CaseApplication caseApplication); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java index 97eca71..f98a5cf 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java @@ -3,6 +3,8 @@ package com.ruoyi.wisdomarbitrate.mapper; import com.ruoyi.wisdomarbitrate.domain.BatchCaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.dto.CaseApplicationDTO; +import com.ruoyi.wisdomarbitrate.domain.entity.CaseAffiliateEntity; import com.ruoyi.wisdomarbitrate.domain.vo.BookSendVO; import org.apache.ibatis.annotations.Param; @@ -18,28 +20,26 @@ public interface CaseAffiliateMapper { void batchDeletecaseAffiliate(@Param("ids") List ids); - List selectCaseAffiliate(CaseAffiliate caseAffiliate); - List selectCaseAffiliateByCaseIds(@Param("ids") List ids); - CaseAffiliate selectCaseAffiliateByIdentityType(@Param("caseAppliId") Long caseAppliId, @Param("identityType")int identityType); - - int updataCaseAffiliate(CaseAffiliate caseAffiliate); - - /** - * 根据案件查询邮箱 - * @param id - * @return - */ - List emailByCaseId(@Param("caseAppliId")Long id); - - /** - * 批量修改 - * @param affiliateLogList - */ - void updateCaseAffiliateByCaseId(@Param("caseAppliId")Long caseAppliId,@Param("list") List affiliateLogList); + List selectCaseAffiliate(CaseAffiliateEntity entity); + List selectCaseAffiliateByCaseIds(@Param("caseIds") List ids); /** * 根据案件id删除 * @param caseId */ void deleteByCaseId(@Param("caseAppliId") Long caseId); + + /** + * 新增人员 + * @param affiliate + */ + + void insert(CaseAffiliateEntity affiliate); + + /** + * 根据案件id查询邮箱 + * @param id + * @return + */ + List emailByCaseId(Long id); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationLogMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationLogMapper.java index 862074f..ca49a36 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationLogMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationLogMapper.java @@ -38,7 +38,7 @@ public interface CaseApplicationLogMapper { Integer selectMaxVersionBySecret(@Param("caseAppliId")Long id); /** - * 根据案件id删除案件记录表和案件关联人日志表 + * 删除日志 * @param ids */ void batchDeleteLog(@Param("ids") List ids); @@ -46,4 +46,11 @@ public interface CaseApplicationLogMapper { CaseApplication selectBeforeCase(@Param("caseId") Long caseId, @Param("version")Integer version); Integer batchSave(@Param("list")List caseApplications); + + /** + * 根据案件id查询所有的日志id + * @param ids + * @return + */ + List selectLogsByCaseIds(@Param("ids")List ids); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java index b0f0e94..f771d46 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java @@ -4,6 +4,7 @@ import com.ruoyi.wisdomarbitrate.domain.Arbitrator; import com.ruoyi.wisdomarbitrate.domain.BatchCaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.dto.CaseApplicationDTO; import com.ruoyi.wisdomarbitrate.domain.dto.CaseConfirmPayDTO; import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount; import org.apache.ibatis.annotations.Param; @@ -11,18 +12,9 @@ import org.apache.ibatis.annotations.Param; import java.util.List; public interface CaseApplicationMapper { - List selectCaseApplicationList(CaseApplication caseApplication); - List selectCaseApplicationList1(CaseApplication caseApplication); int selectCaseApplicationCount(CaseApplication caseApplication); - /** - * 查询超级管理员案件 - * @param caseApplication - * @return - */ - List selectAdminCaseApplicationList(CaseApplication caseApplication); - int insertCaseApplication(CaseApplication caseApplication); @@ -41,7 +33,7 @@ public interface CaseApplicationMapper { */ List listCaseApplicationByIds(@Param("ids")List ids); - CaseApplication selectCaseApplicationConfirm(CaseApplication caseApplication); + /** * 查询最大编号 @@ -65,10 +57,11 @@ public interface CaseApplicationMapper { void updatePayType(CaseConfirmPayDTO payDTO); - ToDoCount selectAdminCaseToDoCount(); - ToDoCount selectTodoCountByRole(CaseApplication caseApplication); + ToDoCount selectTodoCountByRole(@Param("caseApplication") CaseApplication caseApplication, + @Param("caseStatusList") List caseStatusList, + @Param("roleIds") List roleIds); /** * 修改案件锁定状态 @@ -99,12 +92,6 @@ public interface CaseApplicationMapper { */ Long selectCaseIdByRoomId(@Param("roomId")String roomId); - /** - * 查询已办案件 - * @param caseApplication - * @return - */ - List selectHandledCase(CaseApplication caseApplication); /** * 查询最大房间号 * @return @@ -123,7 +110,7 @@ public interface CaseApplicationMapper { * 查询最大批号 * @return */ - Integer selectBatchNumberLike(); + Integer selectMaxBatchNumber(); /** * 批量新增案件 @@ -133,4 +120,35 @@ public interface CaseApplicationMapper { int batchSave(@Param("list")List caseApplications); int selectCasenum(@Param("userId") String userId); + + List selectAdminCaseApplicationListBatch(CaseApplication caseApplication); + + List listCaseApplicationByBatchNumber(CaseApplication caseApplication); + + + + /** + * 案件列表查询 + * @param caseApplication + * @return + */ + List list(@Param("caseApplication") CaseApplication caseApplication, + @Param("caseStatusList") List caseStatusList, + @Param("roleIds") List roleIds); + + /** + * 查询当前案件节点 + * @param id + * @return + */ + Integer selectCaseApplicationCaseStatus(@Param("id") Long id); + + /** + * 新增 + * @param caseApplication + * @return + */ + int insert(CaseApplicationDTO caseApplication); + int update(CaseApplicationDTO caseApplication); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java index ca3bb75..1c0148d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java @@ -21,11 +21,11 @@ public interface CaseAttachMapper { int updateCaseAttachBycaseid(CaseAttach caseAttach); - int deleteByFileIds(@Param("ids") List fileIds); + int deleteByFileIds(@Param("ids") List fileIds); List getCaseAttachByCaseIdAndType(CaseAttach caseAttach); - CaseAttach queryAnnexById(Integer annexId); + CaseAttach queryAnnexById(@Param("annexId")Long annexId); /** * 根据案件id和附件类型删除和上传类型 @@ -35,4 +35,18 @@ public interface CaseAttachMapper { void deleteByCasedIdAndType(@Param("caseAppliId")Long caseAppliId,@Param("annexType") int annexType,@Param("isBatchUpload") int isBatchUpload); void deleteCaseAttachByCasedIdAndType(@Param("caseAppliId")Long caseAppliId,@Param("annexType") int annexType); + + /** + * 删除存在的附件不包括该附件 + * @param caseId 附件 + * @param type 附件类型 + * @param annexId 附件id + */ + void deleteCaseAttach(@Param("caseId")Long caseId, @Param("type")int type,@Param("annexId") Long annexId); + /** + * 根据ids查询 + * @param fileIds + * @return + */ + List selectByIds(@Param("ids") List fileIds); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseEvidenceMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseEvidenceMapper.java index 5f0a4a2..77ee77a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseEvidenceMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseEvidenceMapper.java @@ -9,8 +9,5 @@ import java.util.List; @Mapper public interface CaseEvidenceMapper { - List getCaseListByRespondent(@Param(value = "identityNum" ) String identityNum - , @Param(value = "caseStatusList") List caseStatusList - , @Param(value = "identityType" ) Integer identityType - ); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseNumRuleMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseNumRuleMapper.java index f48f84d..26a2a84 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseNumRuleMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseNumRuleMapper.java @@ -13,4 +13,8 @@ public interface CaseNumRuleMapper { int deleteCaseNumRule(CaseNumRule caseNumRule); List selectCaseNumRules(CaseNumRule caseNumRule); + + int countCaseNumRule(CaseNumRule caseNumRule); + + CaseNumRule selectCaseNumRule(CaseNumRule caseNumRule); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CasePaymentRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CasePaymentRecordMapper.java index d5d4616..fd5549c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CasePaymentRecordMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CasePaymentRecordMapper.java @@ -2,10 +2,12 @@ package com.ruoyi.wisdomarbitrate.mapper; import com.ruoyi.wisdomarbitrate.domain.CasePaymentRecord; +import java.util.List; + public interface CasePaymentRecordMapper { int saveRecord(CasePaymentRecord casePaymentRecord); - CasePaymentRecord queryRecord(String orderNumber); + List queryRecord(String orderNumber); void update(CasePaymentRecord casePaymentRecord); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java index 84bfc9c..210fa95 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java @@ -2,17 +2,40 @@ package com.ruoyi.wisdomarbitrate.mapper; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.SealSignRecord; +import org.apache.ibatis.annotations.Param; import java.util.List; public interface SealSignRecordMapper { List selectSealSignRecord(SealSignRecord sealSignRecord); + /** + * 查询已签署和签署中的文件 + * @param sealSignRecord + * @return + */ List selectSealSignRecordbyStat(SealSignRecord sealSignRecord); + /** + * 差询等待签署,签署中的案件 + * @param penSonAccount 签署人员 + * @return + */ + List selectSealSigning(@Param("penSonAccount") String penSonAccount, @Param("caseStatus") Integer caseStatus); + int updataSealSignRecord(SealSignRecord sealSignRecord); void insertSealSignRecord(SealSignRecord sealSignRecord); + + List selectsignFlow(@Param("batchNumber") Integer batchNumber,@Param("caseStatus") Integer caseStatus); + + /** + * 根据签署流程id查询签署记录 + * @param signFlowId + * @return + */ + SealSignRecord selectSealByFlowId(@Param("signFlowId") String signFlowId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SendMailRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SendMailRecordMapper.java deleted file mode 100644 index 1efd2eb..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SendMailRecordMapper.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.ruoyi.wisdomarbitrate.mapper; - -import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; -import com.ruoyi.wisdomarbitrate.domain.SendMailRecord; - -import java.util.List; - -public interface SendMailRecordMapper { - int saveSendMailRecord(SendMailRecord sendMailRecord); - - List selectSendMailRecord(SendMailRecord sendMailRecord); - - - -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/sendrecord/SendMailRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/sendrecord/SendMailRecordMapper.java new file mode 100644 index 0000000..379a771 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/sendrecord/SendMailRecordMapper.java @@ -0,0 +1,36 @@ +package com.ruoyi.wisdomarbitrate.mapper.sendrecord; + +import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SendMailRecord; + +import java.util.List; + +public interface SendMailRecordMapper { + /** + * 新增发送邮件记录 + * + * @param sendMailRecord 发送邮件记录 + * @return 结果 + */ + + int saveSendMailRecord(SendMailRecord sendMailRecord); +/** + * 查询发送邮件记录 + * + * @param sendMailRecord 发送邮件记录 + * @return 结果 + */ + List selectSendMailRecord(SendMailRecord sendMailRecord); +/** + * 修改发送邮件记录 + * + * @param sendMailRecord 发送邮件记录 + * @return 结果 + */ + int updateSendMailRecord(SendMailRecord sendMailRecord); + + /** + * 根据id查询发送邮件记录 + * @param id + */ + SendMailRecord querySendMailRecordById(Long id); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SmsRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/sendrecord/SmsRecordMapper.java similarity index 54% rename from ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SmsRecordMapper.java rename to ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/sendrecord/SmsRecordMapper.java index e8c4740..638baff 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SmsRecordMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/sendrecord/SmsRecordMapper.java @@ -1,6 +1,6 @@ -package com.ruoyi.wisdomarbitrate.mapper; +package com.ruoyi.wisdomarbitrate.mapper.sendrecord; -import com.ruoyi.wisdomarbitrate.domain.SmsSendRecord; +import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -19,4 +19,13 @@ public interface SmsRecordMapper { * @return */ int batchSaveSmsSendRecord(@Param("list") List smsSendRecordList); + SmsSendRecord selectBySId(@Param("sid") String sid); + void updateStatus (SmsSendRecord smsSendRecord); + + /** + * 通过id查询短信发送记录 + */ + SmsSendRecord selectById(@Param("id") Long id); + + void update(SmsSendRecord smsSendRecord); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/shortmessage/MeetingInfoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/shortmessage/MeetingInfoMapper.java new file mode 100644 index 0000000..c884b5e --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/shortmessage/MeetingInfoMapper.java @@ -0,0 +1,8 @@ +package com.ruoyi.wisdomarbitrate.mapper.shortmessage; + + +import com.ruoyi.wisdomarbitrate.domain.shortmessage.MeetingInfo; +import tk.mybatis.mapper.common.Mapper; + +public interface MeetingInfoMapper extends Mapper { +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/shortmessage/MsSendMailHistoryRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/shortmessage/MsSendMailHistoryRecordMapper.java new file mode 100644 index 0000000..9fd1622 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/shortmessage/MsSendMailHistoryRecordMapper.java @@ -0,0 +1,8 @@ +package com.ruoyi.wisdomarbitrate.mapper.shortmessage; + + +import com.ruoyi.wisdomarbitrate.domain.shortmessage.MsSendMailHistoryRecord; +import tk.mybatis.mapper.common.Mapper; + +public interface MsSendMailHistoryRecordMapper extends Mapper { +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/shortmessage/MsSmsSendHistoryRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/shortmessage/MsSmsSendHistoryRecordMapper.java new file mode 100644 index 0000000..c67c6a6 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/shortmessage/MsSmsSendHistoryRecordMapper.java @@ -0,0 +1,8 @@ +package com.ruoyi.wisdomarbitrate.mapper.shortmessage; + + +import com.ruoyi.wisdomarbitrate.domain.shortmessage.MsSmsSendHistoryRecord; +import tk.mybatis.mapper.common.Mapper; + +public interface MsSmsSendHistoryRecordMapper extends Mapper { +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/sms/MsSmsSendHistoryRecordParamMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/sms/MsSmsSendHistoryRecordParamMapper.java new file mode 100644 index 0000000..2e6931d --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/sms/MsSmsSendHistoryRecordParamMapper.java @@ -0,0 +1,22 @@ +package com.ruoyi.wisdomarbitrate.mapper.sms; + +import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsSendHistoryRecordParam; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import tk.mybatis.mapper.common.Mapper; + +import java.util.List; + +public interface MsSmsSendHistoryRecordParamMapper extends Mapper { + /** + * 批量新增 + * @param historyRecordParams + */ + @Select("") + void batchInsert(@Param("list") List historyRecordParams); +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/sms/MsSmsSendRecordParamMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/sms/MsSmsSendRecordParamMapper.java new file mode 100644 index 0000000..de85ded --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/sms/MsSmsSendRecordParamMapper.java @@ -0,0 +1,22 @@ +package com.ruoyi.wisdomarbitrate.mapper.sms; + +import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsSendRecordParam; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import tk.mybatis.mapper.common.Mapper; + +import java.util.List; + +public interface MsSmsSendRecordParamMapper extends Mapper { + /** + * 批量插入 + * @param list + */ + @Select("") + void batchInsert(@Param("list") List list); +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/sms/MsSmsTemplateMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/sms/MsSmsTemplateMapper.java new file mode 100644 index 0000000..801476c --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/sms/MsSmsTemplateMapper.java @@ -0,0 +1,8 @@ +package com.ruoyi.wisdomarbitrate.mapper.sms; + + +import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsTemplate; +import tk.mybatis.mapper.common.Mapper; + +public interface MsSmsTemplateMapper extends Mapper { +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/sms/MsSmsTemplateParamMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/sms/MsSmsTemplateParamMapper.java new file mode 100644 index 0000000..ddc8e1d --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/sms/MsSmsTemplateParamMapper.java @@ -0,0 +1,19 @@ +package com.ruoyi.wisdomarbitrate.mapper.sms; + + +import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsTemplateParam; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import tk.mybatis.mapper.common.Mapper; + +import java.util.List; + +public interface MsSmsTemplateParamMapper extends Mapper { + @Select("") + void batchInsert(@Param("list") List templateParams); +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java index 3c94b26..9478c73 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java @@ -1,10 +1,14 @@ package com.ruoyi.wisdomarbitrate.service; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.exception.EsignDemoException; +import com.ruoyi.wisdomarbitrate.StringIdsReq; import com.ruoyi.wisdomarbitrate.domain.BatchCaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.SealSignRecord; import com.ruoyi.wisdomarbitrate.domain.vo.LogisticsInfoVO; +import java.io.IOException; import java.util.List; public interface IAdjudicationService { @@ -12,19 +16,16 @@ public interface IAdjudicationService { AjaxResult sendDocumentByEmail(Long id,String appEmail,String resEmail ,String apptrackingNum,String restrackingNum); - List getLogisticsInfo(CaseApplication caseApplication); +// List getLogisticsInfo(CaseApplication caseApplication); - AjaxResult signature(CaseApplication caseApplication); AjaxResult caseFile( List ids); AjaxResult service(Long id, String appEmail, String resEmail, String apptrackingNum, String restrackingNum); - AjaxResult stamp(CaseApplication caseApplication); - AjaxResult getArchivesDetail(Long id); - AjaxResult regenerationDocument(CaseApplication caseApplication); + /** * 根据案件id查询邮箱 @@ -39,4 +40,44 @@ public interface IAdjudicationService { * @return */ AjaxResult batchDocument(List ids); + + /** + * 根据签署流程id查询批量签名链接 + * @param idsReq + * @return + */ + SealSignRecord selectBatchSignUrl( StringIdsReq idsReq); + + /** + * 根据仲裁员手机号分页查询等待签署,签署中的裁决书 + * @param personAccount + * @return + */ + List selectSealSigning(String personAccount,Integer caseStatus); + + SealSignRecord selectBatchSealUrl(StringIdsReq idsReq); + + SealSignRecord getSignUrlBatch(StringIdsReq idsReq); + + SealSignRecord getSealUrlBatch(StringIdsReq idsReq); + + 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); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java index c8a1bc4..99b8a64 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java @@ -1,12 +1,13 @@ package com.ruoyi.wisdomarbitrate.service; +import com.alibaba.fastjson.JSONArray; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.wisdomarbitrate.domain.*; -import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue; -import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO; -import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO; -import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount; +import com.ruoyi.wisdomarbitrate.domain.dto.CaseApplicationDTO; +import com.ruoyi.wisdomarbitrate.domain.entity.CaseAffiliateEntity; +import com.ruoyi.wisdomarbitrate.domain.vo.*; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.multipart.MultipartFile; @@ -15,15 +16,15 @@ import java.util.List; import java.util.Map; public interface ICaseApplicationService { - List selectCaseApplicationList(CaseApplication caseApplication); - List selectCaseApplicationListByRole(CaseApplication caseApplication); - int insertcaseApplication(CaseApplication caseApplication); +// int insertcaseApplication(CaseApplication caseApplication); + +// int insertcaseApplication1(CaseApplication caseApplication); int selectCaseApplicationCount(CaseApplication caseApplication); - AjaxResult editCaseApplication(CaseApplication caseApplication); +// AjaxResult editCaseApplication(CaseApplication caseApplication); int submitCaseApplication( List ids); @@ -37,7 +38,7 @@ public interface ICaseApplicationService { int pendingAppointArbotrar(CaseApplication caseApplication); - int pendTralCheck(CaseApplication caseApplication); + AjaxResult pendTralCheck(CaseApplication caseApplication); int pendTralSure(CaseApplication caseApplication); @@ -47,15 +48,13 @@ public interface ICaseApplicationService { int submitCaseApplicationCheck(List ids, Integer agreeOrNotCheck,String caseCheckReject); - CaseApplication selectCaseApplicationConfirm(CaseApplication caseApplication); - String sendRoomNoMessage(SendRoomNoMessageVO messageVO); SealSignRecord selectSignUrl(CaseApplication caseApplication) throws EsignDemoException; SealSignRecord selectSealUrl(CaseApplication caseApplication) throws EsignDemoException; - AjaxResult creatTrialRecord(ArbitrateRecord arbitrateRecord); + CaseApplication selectSignSealUrl(CaseApplication caseApplication) throws EsignDemoException; @@ -77,12 +76,7 @@ public interface ICaseApplicationService { int updateCaseLockStatus(CaseApplication caseApplication); AjaxResult uploadZipFile(MultipartFile file, Long id, String username, Long userId); - /** - * 查询短信发送记录 - * @param smsSendRecord - * @return - */ - List getSmsSendRecord(SmsSendRecord smsSendRecord); + /** * 获取userSign @@ -114,7 +108,7 @@ public interface ICaseApplicationService { AjaxResult deleteRoom( String roomId); - AjaxResult uploadCaseZipFile(MultipartFile file,Long templateId); + AjaxResult uploadCaseZipFile(MultipartFile file,Long templateId,Integer applicantType,Integer resType); /** * 根据附件id修改案件id @@ -135,4 +129,85 @@ public interface ICaseApplicationService { AjaxResult editCaseApplicationDefineval(CaseApplication caseApplication); CaseAttach downloadCaseZipFile(CaseApplication caseApplication); + +// List selectCaseApplicationListBatchByRole(CaseApplication caseApplication); + public List page(CaseApplication caseApplication) ; + + + AjaxResult submitCaseApplicationBatch(String batchNumber); + + AjaxResult submitCaseApplicationCheckBatch(String batchNumber, Integer agreeOrNotCheck, String caseCheckReject); + + int pendTralCheckBatch(CaseApplication caseApplication); + + int pendTralSureBatch(CaseApplication caseApplication); + + int verificationArbitrateRecordBatch(CaseApplication caseApplication); + + AjaxResult arbitratorCheckArbitrateRecordBatch(CaseApplication caseApplication); + + AjaxResult checkArbitrateRecordBatch(CaseApplication caseApplication); + /** + * 附件上传到onlyoffice服务器 + * @param annexPath + */ + JSONArray uploadOnlyOffice(String annexPath, Long id); + /** + * 保存onlyOffice在线编辑的文件 + * @param + * @return + */ + + AjaxResult saveOnlyOfficeFile(CaseAttach caseAttach); + + /** + * 新增或编辑 + * @param caseApplication + * @return + */ + + AjaxResult insertOrUpdate(CaseApplicationDTO caseApplication); + + /** + * 设置案件相关信息 + * @param caseApplication + * @param affiliate + * @param groupOrder 组别 + * @param operatorCount 操作人数量 + * @param updateFlag 是否修改案件 + */ + public int setCaseAfflicate(List affliates,CaseApplicationDTO caseApplication, CaseAffiliateEntity affiliate, int groupOrder, int operatorCount, boolean updateFlag); + + /** + * 新增案件 + * @param caseApplication + */ + void insert(CaseApplicationDTO caseApplication); + + /** + * 修改案件 + * @param caseApplication + */ + + void update(CaseApplicationDTO caseApplication); + /** + * 新增案件相关人员信息 + * @param affiliate 相关人员信息 + * @param roleIdList 角色id + * @param updateFlag 是否修改案件 + + */ + public void insertAfficateUser(CaseAffiliateEntity affiliate, List roleIdList,boolean updateFlag,List affiliateEntities); + + void insertCaseAfflicate(CaseAffiliateVO caseAffiliateVO, List affliates,CaseApplicationDTO caseApplicationm,boolean updateFlag); + + /** + * 根据案件id查询相关人员 + * @param id + * @return + */ + + List selectAfflicatesByCaseId(Long id); + + SysUser getUserInfo(); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseArbitrateService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseArbitrateService.java index 66b4e36..7f024f8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseArbitrateService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseArbitrateService.java @@ -13,5 +13,9 @@ public interface ICaseArbitrateService { AjaxResult writtenHear(CaseIds caseIds); - AjaxResult examineArbitrateMethod(CaseApplication caseApplication, Integer opinion); + AjaxResult examineArbitrateMethod(CaseApplication caseApplication, Integer opinion, Integer arbitratMethod); + + AjaxResult examineArbitrateMethodBatch(CaseApplication caseApplication); + + AjaxResult writtenHearBatch(CaseApplication caseApplication); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java index 1e8d4d1..fefde22 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java @@ -13,11 +13,11 @@ import java.util.List; public interface ICaseEvidenceService { - AjaxResult getCaseDetailsById(Long id,String userName); +// AjaxResult getCaseDetailsById(Long id,String userName); AjaxResult uploadEvidence(MultipartFile file, Integer annexType, Long id,String userName,Long userId); - List getCaseListAll(Integer caseStatus); +// List getCaseListAll(Integer caseStatus); AjaxResult evidenceConfirmation(CaseApplication caseApplication); @@ -36,7 +36,7 @@ public interface ICaseEvidenceService { AjaxResult fileList(Long caseAppliId, List annexTypeList); - int deleteFile( List fileIds); + int deleteFile( List fileIds); List selectEvidenceTreeList(CaseEvidenceDirectory caseEvidenceDirectory); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseNumRuleService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseNumRuleService.java index 26d323c..67b26bf 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseNumRuleService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseNumRuleService.java @@ -15,4 +15,6 @@ public interface ICaseNumRuleService { AjaxResult deleteCaseNumRule(CaseNumRule caseNumRule); List selectCaseNumRule(CaseNumRule caseNumRule); + + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICasePaymentService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICasePaymentService.java index a5edb44..66c81ed 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICasePaymentService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICasePaymentService.java @@ -2,17 +2,20 @@ package com.ruoyi.wisdomarbitrate.service; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.dto.PayRequest; +import com.ruoyi.wisdomarbitrate.domain.BatchCaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.dto.CaseConfirmPayDTO; import com.ruoyi.wisdomarbitrate.domain.dto.CasePayDTO; +import java.util.List; + public interface ICasePaymentService { /** * 案件缴费 */ AjaxResult casePay(CasePayDTO casePayDTO); - AjaxResult confirmPayment(CaseApplication caseApplication); + AjaxResult confirmPayment(BatchCaseApplication batchCaseApplication); /** * 确认缴费 @@ -24,4 +27,11 @@ public interface ICasePaymentService { AjaxResult casePayList(CasePayDTO casePayDTO); + AjaxResult confirmPayBatch(CasePayDTO payDTO); + + AjaxResult casePayListBatch(CasePayDTO casePayDTO); + + AjaxResult confirmPaymentBatch(String batchNumber); + + AjaxResult casePayBatch(CasePayDTO casePayDTO); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ISendMailRecordService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ISendMailRecordService.java deleted file mode 100644 index b0564a6..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ISendMailRecordService.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.ruoyi.wisdomarbitrate.service; - -import com.ruoyi.wisdomarbitrate.domain.SendMailRecord; - -import java.util.List; - -public interface ISendMailRecordService { - - - List selectSendMailRecordList(SendMailRecord sendMailRecord); - - - - -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/MsSignSealService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/MsSignSealService.java new file mode 100644 index 0000000..de171f9 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/MsSignSealService.java @@ -0,0 +1,15 @@ +package com.ruoyi.wisdomarbitrate.service; + +import com.google.gson.Gson; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.exception.EsignDemoException; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; + +import java.io.IOException; +import java.util.List; + +public interface MsSignSealService { + AjaxResult signSeaalCaseApplicaCallback(String reqbodystr) throws EsignDemoException, IOException; + + AjaxResult sealCheckCallback(String reqbodystr) throws EsignDemoException, IOException; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/VideoService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/VideoService.java index c1c8c71..b0033fe 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/VideoService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/VideoService.java @@ -39,7 +39,7 @@ public interface VideoService { * @param userId * @return */ - AjaxResult secretaryRoleByUserId(Long userId); + AjaxResult secretaryRoleByUserId(Long userId,Long caseId); /** * 根据html字符串转pdf并和案件关联 @@ -55,4 +55,5 @@ public interface VideoService { * @return */ AjaxResult attachListByCaseId(Long caseAppliId, Integer annexType); + AjaxResult selectRoleMenuByCaseId(Long caseId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index 771e3c9..8eda52c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -2,68 +2,71 @@ package com.ruoyi.wisdomarbitrate.service.impl; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; -import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import com.deepoove.poi.data.PictureRenderData; +import com.google.gson.Gson; +import com.google.gson.JsonObject; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.EsignHttpResponse; import com.ruoyi.common.core.domain.entity.SysDictData; import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.exception.ServiceException; -import com.ruoyi.common.utils.*; +import com.ruoyi.common.utils.EmailOutUtil; +import com.ruoyi.common.utils.ObjectFieldUtils; +import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SendMailRecord; +import com.ruoyi.wisdomarbitrate.domain.shortmessage.MsSendMailHistoryRecord; +import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SendMailRecordMapper; +import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper; +import com.ruoyi.wisdomarbitrate.mapper.shortmessage.MsSendMailHistoryRecordMapper; +import com.ruoyi.wisdomarbitrate.utils.SmsUtils; +import com.ruoyi.common.utils.WordUtil; import com.ruoyi.common.utils.thread.MultipleThreadListParam; -import com.ruoyi.common.utils.thread.MultipleThreadWorkUtil; import com.ruoyi.system.mapper.SysDictDataMapper; +import com.ruoyi.wisdomarbitrate.StringIdsReq; +import com.ruoyi.wisdomarbitrate.domain.*; +import com.ruoyi.wisdomarbitrate.domain.entity.CaseAffiliateEntity; import com.ruoyi.wisdomarbitrate.domain.vo.BookSendVO; import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue; import com.ruoyi.wisdomarbitrate.mapper.*; -import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; -import com.ruoyi.wisdomarbitrate.domain.*; -import com.ruoyi.wisdomarbitrate.domain.vo.ArchivesDetailVO; -import com.ruoyi.wisdomarbitrate.domain.vo.LogisticsInfoVO; import com.ruoyi.wisdomarbitrate.service.IAdjudicationService; import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; import com.ruoyi.wisdomarbitrate.service.ICaseLogRecordService; +import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; +import com.ruoyi.wisdomarbitrate.utils.SignAward; import lombok.extern.slf4j.Slf4j; -import org.apache.poi.ss.usermodel.Sheet; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xwpf.usermodel.XWPFDocument; import org.apache.poi.xwpf.usermodel.XWPFParagraph; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBookmark; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.mail.MailSendException; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; import java.io.*; -import java.math.BigDecimal; -import java.net.HttpURLConnection; -import java.net.URL; -import java.net.URLEncoder; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; -import java.text.NumberFormat; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.util.*; -import java.util.concurrent.CountDownLatch; import java.util.function.Function; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; import static com.ruoyi.common.utils.SecurityUtils.getUsername; +import static com.ruoyi.wisdomarbitrate.utils.CaseLogUtils.insertCaseLog; @Service @Slf4j public class AdjudicationServiceImpl implements IAdjudicationService { private final String apiUrl = "http://api.cainiaoapi.com/api/exp/v1/index"; - + @Value("${onlyOfficeConfig.url}") + private String onlyOfficeUrl; @Autowired private CaseApplicationMapper caseApplicationMapper; @Autowired @@ -92,55 +95,61 @@ public class AdjudicationServiceImpl implements IAdjudicationService { private FatchRuleMapper fatchRuleMapper; @Autowired private SysDictDataMapper dictDataMapper; + @Autowired + private SealManageMapper sealManageMapper; + @Autowired + private SealSignRecordMapper sealSignRecordMapper; + @Autowired + private IAdjudicationService adjudicationService; + @Value("${spring.mail.username}") + private String emailFrom; + @Autowired + private MsSendMailHistoryRecordMapper sendMailHistoryRecordMapper; // 仲裁反请求模板内容 - private final String counterclaim= "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" + - "《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" + - "仲裁反请求案件受理后,秘书处向被申请人发送了仲裁反请求通知书及附件,向申请人发送了仲裁反请求通知书及附件、仲裁反请求申请书及附件。"; + private final String counterclaim = "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" + "《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" + "仲裁反请求案件受理后,秘书处向被申请人发送了仲裁反请求通知书及附件,向申请人发送了仲裁反请求通知书及附件、仲裁反请求申请书及附件。"; // 财产保全内容 - String preservation = "本案受理后,申请人向仲裁委提交了财产保全申请,仲裁委根据《中华人民共和国仲裁法》" + - "第二十八条之规定,将该申请提交至法院。"; + String preservation = "本案受理后,申请人向仲裁委提交了财产保全申请,仲裁委根据《中华人民共和国仲裁法》" + "第二十八条之规定,将该申请提交至法院。"; // 管辖权异议 - String jurisdictionalObjection = "本案受理后,被申请人向仲裁委提交了《管辖异议申请书》,认为" + - ",仲裁委经审理,当庭驳回了被申请人的管辖异议申请,并告知被申请人具体的事实和理由将在裁决书中一并列明。"; + String jurisdictionalObjection = "本案受理后,被申请人向仲裁委提交了《管辖异议申请书》,认为" + ",仲裁委经审理,当庭驳回了被申请人的管辖异议申请,并告知被申请人具体的事实和理由将在裁决书中一并列明。"; // 线上开庭时+线上仲裁 - String onLineDate="{{onLineDate}}"; - String onLine = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于"+onLineDate+"通过仲裁委智慧仲裁平台开庭审理了本案。"; + String onLineDate = "{{onLineDate}}"; + String onLine = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于" + onLineDate + "通过仲裁委智慧仲裁平台开庭审理了本案。"; // 开庭+线下仲裁 - String offLineDate="{{offLineDate}}"; - String offLine = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于 "+offLineDate+"在仲裁委所在地开庭审理了本案。"; + String offLineDate = "{{offLineDate}}"; + String offLine = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于 " + offLineDate + "在仲裁委所在地开庭审理了本案。"; //书面仲裁时 - String writtenDate="{{writtenDate}}"; - String written = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于"+writtenDate+"在仲裁委所在地开庭审理了本案。仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,根据《2022年版仲裁规则》第五十八条的规定对本案进行了书面审理。 "; + String writtenDate = "{{writtenDate}}"; + String written = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于" + writtenDate + "在仲裁委所在地开庭审理了本案。仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,根据《2022年版仲裁规则》第五十八条的规定对本案进行了书面审理。 "; //开庭+缺席审理 - String absent = "申请人的特别授权委托代理人{{agentName}}"+"出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" + - "《2022年版仲裁规则》第四十条第(二)项的规定,对本案进行了缺席审理。庭审中,申请人陈述了仲裁请求事项及事实与理由,出示了证据材料并进行了说明,\" +\n" + - " \"发表了意见,回答了仲裁庭的提问,并作了最后陈述。因被申请人缺席庭审,故仲裁庭无法组织调解。"+"综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + - "第四十条第(二)项、第五十一条的规定,缺席裁决如下:"; + String absent = "申请人的特别授权委托代理人{{agentName}}" + "出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" + "《2022年版仲裁规则》第四十条第(二)项的规定,对本案进行了缺席审理。庭审中,申请人陈述了仲裁请求事项及事实与理由,出示了证据材料并进行了说明,\" +\n" + " \"发表了意见,回答了仲裁庭的提问,并作了最后陈述。因被申请人缺席庭审,故仲裁庭无法组织调解。" + "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + "第四十条第(二)项、第五十一条的规定,缺席裁决如下:"; // 开庭+出席 - String attend="申请人的特别授权委托代理人{{agentName}}和被申请人本人出席了庭审。 "; + String attend = "申请人的特别授权委托代理人{{agentName}}和被申请人本人出席了庭审。 "; // 开庭+出席+被申提供证据 - String onLineAttendFile="庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;双方当事人均出示了证据材料并对对方的证据材料进行了质证;双方当事人均回答了仲裁庭的提问,进行了辩论,并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。 "; + String onLineAttendFile = "庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;双方当事人均出示了证据材料并对对方的证据材料进行了质证;双方当事人均回答了仲裁庭的提问,进行了辩论,并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。 "; // 开庭+出席+被申未提供证据 - String onLineAttend="庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;申请人出示了证据材料,被申请人对对方的证据材料进行了质证; 双方当事人均回答了仲裁庭的提问,进行了辩论,并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。 "; + String onLineAttend = "庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;申请人出示了证据材料,被申请人对对方的证据材料进行了质证; 双方当事人均回答了仲裁庭的提问,进行了辩论,并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。 "; // 被申请人出席答辩意见 - String resAttendOpinion="\n(二)被申请人的答辩意见 \n(三)当事人提供的证据材料及对方的质证意见\n" + - "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:\n{{applicantFile}}\n被申请人对上述材料的质证意见为:{{respondentOpinion}}\n"; + String resAttendOpinion = "\n(二)被申请人的答辩意见 \n(三)当事人提供的证据材料及对方的质证意见\n" + "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:\n{{applicantFile}}\n被申请人对上述材料的质证意见为:{{respondentOpinion}}\n"; // 被申请人出席+被申请人提供了资料 - String resFile="被申请人向仲裁庭提交了如下证据材料:\n{{resFile}}" + - "申请人对上述材料的质证意见为:{{applicantOpinion}}"; + String resFile = "被申请人向仲裁庭提交了如下证据材料:\n{{resFile}}" + "申请人对上述材料的质证意见为:{{applicantOpinion}}"; // 被申请人缺席 - String resAbsent="(二)当事人提供的证据材料\n" + - "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:\n{{applicantFile}}"; + String resAbsent = "(二)当事人提供的证据材料\n" + "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:\n{{applicantFile}}"; // 日期格式化年月日 SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日"); + + /** + * 生成裁决书 + * + * @param caseApplicationReq + * @return + */ @Override @Transactional public AjaxResult createDocument(CaseApplication caseApplicationReq) { String templatePath = ""; String templateName = ""; - String agentName = ""; - String resName = ""; + try { Map datas = new HashMap<>(); Long id = caseApplicationReq.getId(); @@ -161,13 +170,13 @@ public class AdjudicationServiceImpl implements IAdjudicationService { return AjaxResult.error("请先指定裁决书模板"); } templatePath = templateManages.get(0).getTemOrigPath(); - if(StrUtil.isEmpty(templatePath)){ + if (StrUtil.isEmpty(templatePath)) { return AjaxResult.error("未找到该模板"); } - // todo 部署放开 - if(templatePath!=null){ - templatePath="/home/ruoyi/" +templatePath; + // 部署放开 + if (templatePath != null) { + templatePath = "/home/ruoyi/" + templatePath; } try { File file = new File(templatePath); @@ -176,9 +185,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } templateName = templateManages.get(0).getFileName(); // 查询案件相关表信息 - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(id); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); + List caseAffiliates = caseApplicationService.selectAfflicatesByCaseId(id); //获取仲裁记录表里的相关信息 ArbitrateRecord arbitrateRecord = new ArbitrateRecord(); arbitrateRecord.setCaseAppliId(id); @@ -198,15 +205,15 @@ public class AdjudicationServiceImpl implements IAdjudicationService { fatchRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getIsDefault)); } // 自定义字段,从columnValue值取 - if (fatchRuleMap.size()>0&&fatchRuleMap.containsKey(1)) { + if (fatchRuleMap.size() > 0 && fatchRuleMap.containsKey(1)) { // 根据案件id查询key-value表 List columnValueList = columnValueMapper.listByCaseId(caseApplicationReq.getId()); if (CollectionUtil.isNotEmpty(columnValueList)) { columnValueList.forEach(columnValue -> valueMap.put(columnValue.getName(), columnValue.getValue())); } } - // 组装内置字段,在主表中查出内容 - buildDefaultColumnValue(dictDataList,caseAffiliates,valueMap,caseApplicationById); + // 组装内置字段,在主表中查出内容 + buildDefaultColumnValue(dictDataList, caseAffiliates, valueMap, caseApplicationById); // 获取模板中的占位符key List bookmarkList = getBookmarkByDocx(templatePath); @@ -214,9 +221,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService { return AjaxResult.success("请检查模板是否配置正确,未获取到占位符"); } // 遍历书签,给书签赋值 - replaceBookmark(bookmarkList,datas,valueMap); + replaceBookmark(bookmarkList, datas, valueMap); // 根据条件替换书签 - conditionReplaceBookmark(caseApplicationById,datas,agentName,resName,arbitrateRecordSelect); + conditionReplaceBookmark(caseApplicationById, datas, "", "", arbitrateRecordSelect); // 裁决书生成时间 LocalDate now = LocalDate.now(); String year = Integer.toString(now.getYear()); @@ -226,7 +233,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { // 裁决书编号 datas.put("裁决书编号", equipmentNo); // 仲裁费 - datas.put("仲裁费", caseApplicationById.getFeePayable().toString()); + datas.put("仲裁费", caseApplicationById.getFeePayable() != null ? caseApplicationById.getFeePayable().toString() : ""); // 案件创建时间 Date createTime = caseApplicationById.getCreateTime(); // 将日期格式化为字符串 @@ -248,11 +255,41 @@ public class AdjudicationServiceImpl implements IAdjudicationService { String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; // String saveName = "D:/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day + "/" + fileName; // 将word中的标签替换掉,生成新的word - String docFilePath = wordChangeText(templatePath,datas,saveFolderPath,fileName); + String docFilePath = wordChangeText(templatePath, datas, saveFolderPath, fileName); + String annexPath = saveName.replace("/profile/upload/", "/home/ruoyi/uploadPath/upload/"); + // 上传到onlyoffice + JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(annexPath, caseApplicationReq.getId()); + CaseAttach caseAttach = null; + if (jsonArray != null && jsonArray.size() > 0) { - String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8); - // 保存裁决书附件 - saveArbitorFile(id, saveName, savePath, caseApplicationById, arbitrateRecordSelect); + for (Object obj : jsonArray) { + JSONObject jsonObject = (JSONObject) obj; + String path = jsonObject.get("filePath")!=null?jsonObject.getString("filePath"):""; + path=path.replace("/home/ruoyi/uploadPath/","/profile/"); + String name = jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):""; + caseAttach = CaseAttach.builder() + .caseAppliId(caseApplicationReq.getId()) + .annexName(name) + .annexPath(path) + .annexType(3) + .onlyOfficeFileId(jsonObject.getString("fileId")) + .build(); + +// if (jsonObject.get("filePath") != null) { +// String officePath = jsonObject.getString("filePath"); +// String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/"); +// caseAttach.setAnnexName(replace); +// +// } + + } + } + if (caseAttach != null) { + // 保存裁决书附件 + saveArbitorFile(caseAttach, caseApplicationById, arbitrateRecordSelect, CaseApplicationConstants.VERPRIF_ARBITRATION); + } else { + return AjaxResult.error("上传onlyoffice服务器失败"); + } return AjaxResult.success("裁决书已生成"); } catch (IOException e) { @@ -262,14 +299,15 @@ public class AdjudicationServiceImpl implements IAdjudicationService { /** * 将word中的标签替换掉,生成新的word - * @param modalFilePath 裁决书模板路径 - * @param datas 替换标签的内容 + * + * @param modalFilePath 裁决书模板路径 + * @param datas 替换标签的内容 * @param saveFolderPath 保存路径 - * @param fileName 保存文件名 + * @param fileName 保存文件名 * @return * @throws IOException */ - private String wordChangeText(String modalFilePath, Map datas, String saveFolderPath,String fileName) throws IOException { + private String wordChangeText(String modalFilePath, Map datas, String saveFolderPath, String fileName) throws IOException { String resultFilePath = saveFolderPath + "/" + fileName; // 创建日期目录 File saveFolder = new File(saveFolderPath); @@ -291,13 +329,14 @@ public class AdjudicationServiceImpl implements IAdjudicationService { /** * 根据条件判断裁决书中是否需要该内容 - * @param caseApplicationById 案件信息 - * @param datas 替换标签值 - * @param agentName 代理人名称 - * @param resName 被申请人名称 - * @param arbitrateRecordSelect 仲裁记录 + * + * @param caseApplicationById 案件信息 + * @param datas 替换标签值 + * @param agentName 代理人名称 + * @param resName 被申请人名称 + * @param arbitrateRecordSelect 仲裁记录 */ - private void conditionReplaceBookmark(CaseApplication caseApplicationById, Map datas,String agentName,String resName, ArbitrateRecord arbitrateRecordSelect ) { + private void conditionReplaceBookmark(CaseApplication caseApplicationById, Map datas, String agentName, String resName, ArbitrateRecord arbitrateRecordSelect) { // 如果有仲裁反请求,该字段设置值 Integer adjudicaCounter = caseApplicationById.getAdjudicaCounter(); if (adjudicaCounter != null && adjudicaCounter == 1) { @@ -342,13 +381,12 @@ public class AdjudicationServiceImpl implements IAdjudicationService { hearDateStr = sdf.format(hearDate); datas.put("审理日期", hearDateStr); } - // todo 线上仲裁/线下仲裁方式未选择 //线上开庭时+线上仲裁 - if (arbitratMethod!=null&&arbitratMethod == 1) { + if (arbitratMethod != null && arbitratMethod == 1) { String replace = onLine.replace(onLineDate, Optional.of(hearDateStr).orElse("")); datas.put("线上开庭并线上仲裁", replace); // 所有附件 - List caseAttachList = caseApplicationById.getCaseAttachList(); + List caseAttachList = caseAttachMapper.queryAnnexPathByCaseId(caseApplicationById.getId()); Map> caseAttachMap = new HashMap<>(); if (caseAttachList != null && caseAttachList.size() > 0) { caseAttachMap = caseAttachList.stream().collect(Collectors.groupingBy(CaseAttach::getAnnexType)); @@ -418,9 +456,10 @@ public class AdjudicationServiceImpl implements IAdjudicationService { /** * 给模板中的占位符赋值 + * * @param bookmarkList 书签 - * @param datas 书签赋值 - * @param valueMap 案件内容 + * @param datas 书签赋值 + * @param valueMap 案件内容 */ private void replaceBookmark(List bookmarkList, Map datas, Map valueMap) { for (String bookmark : bookmarkList) { @@ -454,49 +493,58 @@ public class AdjudicationServiceImpl implements IAdjudicationService { /** * 组装案件内置字段值,即主表和相关人员表信息 - * @param dictDataList 内置字段 + * + * @param dictDataList 内置字段 * @param caseAffiliates 关联人员 - * @param valueMap 组装的值 + * @param valueMap 组装的值 */ - private void buildDefaultColumnValue(List dictDataList, List caseAffiliates, Map valueMap, CaseApplication caseApplication) { + private void buildDefaultColumnValue(List dictDataList, List caseAffiliates, Map valueMap, CaseApplication caseApplication) { if (CollectionUtil.isNotEmpty(dictDataList)) { - Map affiliateMap = caseAffiliates.stream().collect(Collectors.toMap(CaseAffiliate::getIdentityType, Function.identity(), (n1, n2) -> n2)); + // 申请操作人 + Optional applicantAffiliateOpt = caseAffiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))).findFirst(); + Optional applicantAgentAffiliateOpt = caseAffiliates.stream().filter(affiliate -> StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(2))).findFirst(); + // 被申请操作人 + Optional resAffiliateOpt = caseAffiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4))).findFirst(); + Optional resAgentAffiliateOpt = caseAffiliates.stream().filter(affiliate -> StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(4))).findFirst(); + if (!applicantAffiliateOpt.isPresent() || !resAffiliateOpt.isPresent()) { + throw new ServiceException("未找到案件操作人员"); + } + for (SysDictData dictData : dictDataList) { if (StrUtil.isNotEmpty(dictData.getDictLabel())) { if (dictData.getDictLabel().contains("被申请人")) { - CaseAffiliate affiliate = affiliateMap.get(2); - if (affiliate == null) { - continue; - } + CaseAffiliateEntity res = resAffiliateOpt.get(); + // 被申请人 switch (dictData.getDictLabel()) { case "被申请人姓名": - valueMap.put(dictData.getDictLabel(), affiliate.getName()); + valueMap.put(dictData.getDictLabel(), res.getName()); break; case "被申请人身份证号": - valueMap.put(dictData.getDictLabel(), affiliate.getIdentityNum()); + valueMap.put(dictData.getDictLabel(), res.getIdCard()); break; case "被申请人住所": - valueMap.put(dictData.getDictLabel(), affiliate.getResidenAffili()); + valueMap.put(dictData.getDictLabel(), res.getHome()); + break; + case "被申请人联系地址": + valueMap.put(dictData.getDictLabel(), res.getAddress()); break; case "被申请人联系电话": - valueMap.put(dictData.getDictLabel(), affiliate.getContactTelphone()); + valueMap.put(dictData.getDictLabel(), res.getPhone()); break; case "被申请人电子邮件": - valueMap.put(dictData.getDictLabel(), affiliate.getEmail()); + valueMap.put(dictData.getDictLabel(), res.getEmail()); break; case "被申请人性别": - if (dictData.getDictLabel().equals("被申请人性别")) { - String responSex = affiliate.getResponSex(); - if (responSex.equals("0")) { - valueMap.put(dictData.getDictLabel(), "男"); - } else { - valueMap.put(dictData.getDictLabel(), "女"); - } + String responSex = res.getSex(); + if (responSex.equals("0")) { + valueMap.put(dictData.getDictLabel(), "男"); + } else { + valueMap.put(dictData.getDictLabel(), "女"); } break; case "被申请人出生年月日": - Date responBirth = affiliate.getResponBirth(); + Date responBirth = res.getBirth(); if (responBirth != null) { valueMap.put(dictData.getDictLabel(), sdf.format(responBirth)); } else { @@ -506,49 +554,51 @@ public class AdjudicationServiceImpl implements IAdjudicationService { default: break; } - } else if (dictData.getDictLabel().contains("申请人") || dictData.getDictLabel().contains("统一社会信用代码") - || dictData.getDictLabel().contains("法定代表人") || dictData.getDictLabel().contains("法定代表人职位") - || dictData.getDictLabel().contains("代理人")) { - CaseAffiliate affiliate = affiliateMap.get(1); - if (affiliate == null) { - continue; - } + } else if (dictData.getDictLabel().contains("申请人") || dictData.getDictLabel().contains("统一社会信用代码") || dictData.getDictLabel().contains("法定代表人") || dictData.getDictLabel().contains("法定代表人职位") || dictData.getDictLabel().contains("代理人")) { + CaseAffiliateEntity app = applicantAffiliateOpt.get(); + CaseAffiliateEntity appAgent = applicantAgentAffiliateOpt.orElse(null); // 申请人 switch (dictData.getDictLabel()) { case "申请人姓名": - valueMap.put(dictData.getDictLabel(), affiliate.getName()); + valueMap.put(dictData.getDictLabel(), app.getName()); break; case "统一社会信用代码": - valueMap.put(dictData.getDictLabel(), affiliate.getIdentityNum()); + valueMap.put(dictData.getDictLabel(), app.getCode()); break; case "法定代表人": - valueMap.put(dictData.getDictLabel(), affiliate.getCompLegalPerson()); + valueMap.put(dictData.getDictLabel(), app.getCompLegalPerson()); break; case "法定代表人职位": - valueMap.put(dictData.getDictLabel(), affiliate.getCompLegalperPost()); + valueMap.put(dictData.getDictLabel(), app.getPosition()); break; case "申请人住所": - valueMap.put(dictData.getDictLabel(), affiliate.getResidenAffili()); + valueMap.put(dictData.getDictLabel(), app.getHome()); break; case "申请人联系地址": - valueMap.put(dictData.getDictLabel(), affiliate.getContactAddress()); + valueMap.put(dictData.getDictLabel(), app.getAddress()); break; case "委托代理人姓名": - valueMap.put(dictData.getDictLabel(), affiliate.getNameAgent()); + if (appAgent != null) { + valueMap.put(dictData.getDictLabel(), appAgent.getName()); + } break; case "委托代理人联系电话": - valueMap.put(dictData.getDictLabel(), affiliate.getContactTelphoneAgent()); + if (appAgent != null) { + valueMap.put(dictData.getDictLabel(), appAgent.getPhone()); + } break; case "委托代理人电子邮件": - valueMap.put(dictData.getDictLabel(), affiliate.getAgentEmail()); + if (appAgent != null) { + valueMap.put(dictData.getDictLabel(), appAgent.getEmail()); + } break; default: break; } - }else { + } else { valueMap.put(dictData.getDictLabel(), ObjectFieldUtils.getValue(caseApplication, dictData.getDictValue())); } - }else { + } else { valueMap.put(dictData.getDictLabel(), ObjectFieldUtils.getValue(caseApplication, dictData.getDictValue())); } @@ -558,19 +608,12 @@ public class AdjudicationServiceImpl implements IAdjudicationService { /** * 保存裁决书附件 - * @param id 案件id - * @param saveName 保存的文件名 - * @param savePath 保存路径 - * @param caseApplicationById 案件基本信息 + * + * @param caseApplicationById 案件基本信息 * @param arbitrateRecordSelect 出裁决书生成记录 + * @param caseStatus 案件状态,不为空则更新案件状态 */ - private void saveArbitorFile(Long id, String saveName, String savePath, CaseApplication caseApplicationById, ArbitrateRecord arbitrateRecordSelect) { - CaseAttach caseAttach = CaseAttach.builder() - .caseAppliId(id) - .annexName(saveName) - .annexPath(savePath) - .annexType(3) - .build(); + private void saveArbitorFile(CaseAttach caseAttach, CaseApplication caseApplicationById, ArbitrateRecord arbitrateRecordSelect, Integer caseStatus) { //保存到附件表里,先判断之前有没有,有的话更新,没有的话新增 List caseAttachList = caseAttachMapper.getCaseAttachByCaseIdAndType(caseAttach); if (caseAttachList != null && caseAttachList.size() > 0) { @@ -581,7 +624,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { int i = caseAttachMapper.save(caseAttach); if (i > 0) { if (arbitrateRecordSelect != null) { - Integer annexId = caseAttach.getAnnexId(); + Long annexId = caseAttach.getAnnexId(); //将附件id保存到仲裁记录表里面 arbitrateRecordSelect.setAnnexId(annexId); arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecordSelect); @@ -589,7 +632,13 @@ 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); + } caseApplicationMapper.submitCaseApplication(caseApplicationById); } @@ -630,121 +679,109 @@ public class AdjudicationServiceImpl implements IAdjudicationService { //电子邮件送达 JavaMailSender javaMailSender = emailOutUtil.rebuildMailSender(); if (appEmail != null) { - emailOutUtil.sendMessageCarryFile(appEmail, "案件裁决书", "您的裁决书已送达,详情请查阅附件", file - , "hjbjava@163.com", javaMailSender); + emailOutUtil.sendMessageCarryFile(appEmail, "案件裁决书", "您的裁决书已送达,详情请查阅附件", file, "hjbjava@163.com", javaMailSender); } if (resEmail != null) { - emailOutUtil.sendMessageCarryFile(resEmail, "案件裁决书", "您的裁决书已送达,详情请查阅附件", file - , "hjbjava@163.com", javaMailSender); + emailOutUtil.sendMessageCarryFile(resEmail, "案件裁决书", "您的裁决书已送达,详情请查阅附件", file, "hjbjava@163.com", javaMailSender); } //修改案件状态 caseApplication1.setCaseStatus(CaseApplicationConstants.CASE_FILING); caseApplicationMapper.submitCaseApplication(caseApplication1); //保存邮箱信息和快递单号到关联人表 - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(id); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if (caseAffiliates != null && caseAffiliates.size() > 0) { - for (CaseAffiliate affiliate : caseAffiliates) { - if (affiliate.getIdentityType() == 1) { //申请人 - affiliate.setSendEmail(appEmail); - affiliate.setTrackNum(apptrackingNum); - caseAffiliateMapper.updataCaseAffiliate(affiliate); - } else { - affiliate.setSendEmail(resEmail); - affiliate.setTrackNum(restrackingNum); - caseAffiliateMapper.updataCaseAffiliate(affiliate); - } - } - } +// CaseAffiliate caseAffiliate = new CaseAffiliate(); +// caseAffiliate.setCaseAppliId(id); +// List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); +// if (caseAffiliates != null && caseAffiliates.size() > 0) { +// for (CaseAffiliate affiliate : caseAffiliates) { +// if (affiliate.getIdentityType() == 1) { //申请人 +// affiliate.setSendEmail(appEmail); +// affiliate.setTrackNum(apptrackingNum); +// caseAffiliateMapper.updataCaseAffiliate(affiliate); +// } else { +// affiliate.setSendEmail(resEmail); +// affiliate.setTrackNum(restrackingNum); +// caseAffiliateMapper.updataCaseAffiliate(affiliate); +// } +// } +// } - return AjaxResult.success("仲裁文书送达成功"); + return AjaxResult.success("裁决书送达成功"); } catch (MailSendException e) { return AjaxResult.error("发送失败,请检查文件路径"); } } - @Override - public List getLogisticsInfo(CaseApplication caseApplication) { - try { - //快递单号查询 - String key = "729437f92468910aee6c12dbfeaee3c1"; - String com = "auto"; - //根据案件id查询单号信息 - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(caseApplication.getId()); - List logisticsInfoVOList = new ArrayList<>(); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if (caseAffiliates != null && caseAffiliates.size() > 0) { - for (CaseAffiliate affiliate : caseAffiliates) { - LogisticsInfoVO logisticsInfoVO = new LogisticsInfoVO(); - String trackNum = affiliate.getTrackNum(); - if (trackNum != null) { - // 构造查询字符串参数 - String queryParameters = String.format("key=%s&com=%s&no=%s&phone=%d", - URLEncoder.encode(key, "UTF-8"), - URLEncoder.encode(com, "UTF-8"), - URLEncoder.encode(trackNum, "UTF-8"), null); - // 拼接到API URL中 - String fullUrl = apiUrl + "?" + queryParameters; - URL url = new URL(fullUrl); - HttpURLConnection connection = (HttpURLConnection) url.openConnection(); - connection.setRequestMethod("GET"); - int responseCode = connection.getResponseCode(); - if (responseCode == HttpURLConnection.HTTP_OK) { - BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); - String line; - StringBuilder response = new StringBuilder(); - while ((line = reader.readLine()) != null) { - response.append(line); - } - reader.close(); - // 处理返回的响应数据\ - JSONObject jsonObject = JSON.parseObject(response.toString()); - // 提取 "data" 字段并转换为字符串 - String data = jsonObject.getString("data"); - if (data != null) { - logisticsInfoVO.setIdentityType(affiliate.getIdentityType()); - logisticsInfoVO.setLogisticsInfo(data); - logisticsInfoVOList.add(logisticsInfoVO); - } - } else { - // 请求失败 - return null; - } - } - } - return logisticsInfoVOList; - } - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } +// @Override +// public List getLogisticsInfo(CaseApplication caseApplication) { +// try { +// //快递单号查询 +// String key = "729437f92468910aee6c12dbfeaee3c1"; +// String com = "auto"; +// //根据案件id查询单号信息 +// CaseAffiliate caseAffiliate = new CaseAffiliate(); +// caseAffiliate.setCaseAppliId(caseApplication.getId()); +// List logisticsInfoVOList = new ArrayList<>(); +// List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); +// if (caseAffiliates != null && caseAffiliates.size() > 0) { +// for (CaseAffiliate affiliate : caseAffiliates) { +// LogisticsInfoVO logisticsInfoVO = new LogisticsInfoVO(); +// String trackNum = affiliate.getTrackNum(); +// if (trackNum != null) { +// // 构造查询字符串参数 +// String queryParameters = String.format("key=%s&com=%s&no=%s&phone=%d", URLEncoder.encode(key, "UTF-8"), URLEncoder.encode(com, "UTF-8"), URLEncoder.encode(trackNum, "UTF-8"), null); +// // 拼接到API URL中 +// String fullUrl = apiUrl + "?" + queryParameters; +// URL url = new URL(fullUrl); +// HttpURLConnection connection = (HttpURLConnection) url.openConnection(); +// connection.setRequestMethod("GET"); +// int responseCode = connection.getResponseCode(); +// if (responseCode == HttpURLConnection.HTTP_OK) { +// BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); +// String line; +// StringBuilder response = new StringBuilder(); +// while ((line = reader.readLine()) != null) { +// response.append(line); +// } +// reader.close(); +// // 处理返回的响应数据\ +// JSONObject jsonObject = JSON.parseObject(response.toString()); +// // 提取 "data" 字段并转换为字符串 +// String data = jsonObject.getString("data"); +// if (data != null) { +// logisticsInfoVO.setIdentityType(affiliate.getIdentityType()); +// logisticsInfoVO.setLogisticsInfo(data); +// logisticsInfoVOList.add(logisticsInfoVO); +// } +// } else { +// // 请求失败 +// return null; +// } +// } +// } +// return logisticsInfoVOList; +// } +// } catch (IOException e) { +// e.printStackTrace(); +// } +// return null; +// } - @Override - public AjaxResult signature(CaseApplication caseApplication) { - //更改案件状态(暂时) - caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL); - caseApplicationMapper.submitCaseApplication(caseApplication); - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.ARBITRATED_SEAL, ""); - - return AjaxResult.success("签名成功,案件状态已改为待仲裁文书用印"); - } @Override + @Transactional public AjaxResult caseFile(List ids) { try { for (Long id : ids) { CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(id); + // 查询当前案件节点 + // Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); //更改案件状态(暂时) caseApplication.setCaseStatus(CaseApplicationConstants.CASE_ARCHIVED); caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_ARCHIVED, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_FILING, ""); } } catch (Exception e) { return AjaxResult.error(e.getMessage()); @@ -753,6 +790,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService { return AjaxResult.success("归档成功,案件状态已改为已归档"); } + @Autowired + DownFileService downFileService; + @Override @Transactional public AjaxResult service(Long id, String appEmail, String resEmail, String apptrackingNum, String restrackingNum) { @@ -762,510 +802,223 @@ public class AdjudicationServiceImpl implements IAdjudicationService { if (caseApplication1 == null) { return AjaxResult.error("未查询到相关案件"); } + String caseNum = caseApplication1.getCaseNum(); List caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication1); + Boolean isExistPdf = false; + String path=null; if (caseAttachList != null && caseAttachList.size() > 0) { for (CaseAttach caseAttach : caseAttachList) { if (caseAttach.getAnnexType() == 3) { - String annexName = caseAttach.getAnnexName(); - String prefix = "/profile/upload/"; - int startIndex = prefix.length(); - String path = caseAttach.getAnnexPath() + annexName.substring(startIndex); - File file = new File(path); - if(!file.exists()){ - return AjaxResult.error("未生成裁决书"); - } + isExistPdf = true; + String filePath = caseAttach.getAnnexPath(); + if (StrUtil.isEmpty(filePath)) { + throw new ServiceException("未找到文件"); + } + path = filePath.replace("/profile/", "/home/ruoyi/uploadPath/"); + File file = new File(path); + //判断文件是否存在 + if (!file.exists()) { + isExistPdf = false; + //若不存在裁决书则从e签宝下载PDF文件 + try { + SealSignRecord sealSignRecord = new SealSignRecord(); + sealSignRecord.setCaseAppliId(caseApplication.getId()); + //3为"签署用印记录表"的状态为签署完成 + sealSignRecord.setSignFlowStatus(3); + List sealSignRecords = sealSignRecordMapper.selectSealSignRecord(sealSignRecord); + if (sealSignRecords != null && sealSignRecords.size() > 0) { + SealSignRecord sealSignRecord1 = sealSignRecords.get(0); + downFileService.downPdfFileFormEsign(sealSignRecord1.getSignFlowid(), caseAttach.getCaseAppliId()); + //下载成功后重新查询 + List caseAttachList1 = caseAttachMapper.queryCaseAttachList(caseApplication1); + for (CaseAttach caseAttach1 : caseAttachList1) { + if (caseAttach1.getAnnexType() == 3) { + isExistPdf = true; + filePath = caseAttach.getAnnexPath(); + if (StrUtil.isEmpty(filePath)) { + throw new ServiceException("未找到文件"); + } + path = filePath.replace("/profile/", "/home/ruoyi/uploadPath/"); + File file1 = new File(path); + if (!file1.exists()) { + isExistPdf = false; + } + path = null; + caseAttachList = caseAttachList1; + break; + } + } + //若附件中没有裁决书PDF文件则终止 + if (!isExistPdf) { + return AjaxResult.error("未找到签名后的裁决书"); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + } + //找到签署后的PDF文件后调出该循环 + break; } } } + if (!isExistPdf) { + return AjaxResult.error("未找到签名后的裁决书"); + } //修改案件状态 caseApplication1.setCaseStatus(CaseApplicationConstants.CASE_FILING); caseApplicationMapper.submitCaseApplication(caseApplication1); - //保存邮箱信息和快递单号到关联人表 - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(id); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if (caseAffiliates != null && caseAffiliates.size() > 0) { - for (CaseAffiliate affiliate : caseAffiliates) { - if (affiliate.getIdentityType() == 1) { //申请人 - affiliate.setSendEmail(appEmail); - affiliate.setTrackNum(apptrackingNum); - caseAffiliateMapper.updataCaseAffiliate(affiliate); - } else { - affiliate.setSendEmail(resEmail); - affiliate.setTrackNum(restrackingNum); - caseAffiliateMapper.updataCaseAffiliate(affiliate); - } + //申请人发送邮件 + boolean appEmailFlag = sendCaseEmail(caseApplication1, appEmail, caseAttachList,caseNum); + + // 被申请人发送邮件 + boolean resEmailFlag = sendCaseEmail(caseApplication1, resEmail, caseAttachList,caseNum); + if (!appEmailFlag && !resEmailFlag) { + throw new ServiceException("裁决书发送失败"); + } + if (!appEmailFlag) { + throw new ServiceException("申请人裁决书发送失败"); + } + if (!resEmailFlag) { + throw new ServiceException("被申请人裁决书发送失败"); + } + // 发送短信 + if (appEmailFlag || resEmailFlag) { + // 查询案件相关人员 + CaseAffiliateEntity affiliateEntity = new CaseAffiliateEntity(); + affiliateEntity.setCaseAppliId(id); + List affiliateEntities = caseAffiliateMapper.selectCaseAffiliate(affiliateEntity); +// 申请操作人 + Optional applicantAffiliateOpt = affiliateEntities.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))).findFirst(); + // 被申请操作人 + Optional resAffiliateOpt = affiliateEntities.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4))).findFirst(); + List operatorList = new ArrayList<>(); + if (applicantAffiliateOpt.isPresent() && StrUtil.isNotEmpty(applicantAffiliateOpt.get().getPhone())) { + operatorList.add(applicantAffiliateOpt.get()); } - } - //发送邮件 - boolean b = sendCaseEmail(caseApplication1, appEmail, resEmail,caseAttachList); - SendMailRecord sendMailRecord = new SendMailRecord(); - sendMailRecord.setCaseId(id); - sendMailRecord.setMailAddress(appEmail); - sendMailRecord.setMailContent("您好,审核后的裁决书在附件中请查阅"); - sendMailRecord.setMailName("签署后的裁决书"); - sendMailRecord.setSendTime(new Date()); - sendMailRecord.setCreateBy(getUsername()); - if (b) { - sendMailRecord.setSendStatus(1); - } else { - sendMailRecord.setSendStatus(0); - } - sendMailRecordMapper.saveSendMailRecord(sendMailRecord); - SendMailRecord sendMailRecord1 = new SendMailRecord(); - sendMailRecord1.setCaseId(id); - sendMailRecord1.setMailAddress(resEmail); - sendMailRecord1.setMailContent("您好,审核后的裁决书在附件中请查阅"); - sendMailRecord1.setMailName("签署后的裁决书"); - sendMailRecord1.setSendTime(new Date()); - sendMailRecord1.setCreateBy(getUsername()); - if (b) { - sendMailRecord1.setSendStatus(1); - // 发送短信 - if(CollectionUtil.isNotEmpty(caseAffiliates)) { - SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - request.setTemplateId("1990362"); - for (CaseAffiliate affiliate : caseAffiliates) { - - request.setPhone(affiliate.getContactTelphone()); -// if(affiliate.getIdentityType() == 1) { -// request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplication1.getCaseNum(), appEmail}); -// }else { -// request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplication1.getCaseNum(), resEmail}); -// } - request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplication1.getCaseNum()}); - Boolean aBoolean = SmsUtils.sendSms(request); - - // 保存短信发送记录 - SmsSendRecord smsSendRecord = new SmsSendRecord(); - smsSendRecord.setCaseId(caseAffiliate.getCaseAppliId()); - - smsSendRecord.setCaseNum(caseApplication1.getCaseNum()); - smsSendRecord.setPhone(request.getPhone()); - smsSendRecord.setSendTime(new Date()); -// // 尊敬的{1}用户,您的{2}仲裁案件,裁决书已送达,请知晓,如非本人操作,请忽略本短信。 -// if(affiliate.getIdentityType() == 1) { -// smsSendRecord.setSendContent("尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达至" +appEmail+"邮箱,请知晓,如非本人操作,请忽略本短信。"); -// }else { -// smsSendRecord.setSendContent("尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达至" +resEmail+"邮箱,请知晓,如非本人操作,请忽略本短信。"); -// } - smsSendRecord.setSendContent("尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达,请知晓,如非本人操作,请忽略本短信。"); - - - smsSendRecord.setCreateBy(getUsername()); - if (aBoolean) { - smsSendRecord.setSendStatus(1); - } else { - smsSendRecord.setSendStatus(0); - } - smsRecordMapper.saveSmsSendRecord(smsSendRecord); + if (resAffiliateOpt.isPresent() && StrUtil.isNotEmpty(resAffiliateOpt.get().getPhone())) { + operatorList.add(resAffiliateOpt.get()); + } + if (CollectionUtil.isNotEmpty(operatorList)) { + for (CaseAffiliateEntity affiliate : operatorList) { + SmsUtils.sendSms(caseApplication1, "1990362", affiliate.getPhone(), new String[]{affiliate.getName(),caseApplication1.getCaseNum()}); } } - } else { - sendMailRecord1.setSendStatus(0); } - sendMailRecordMapper.saveSendMailRecord(sendMailRecord1); + // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_FILING, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.ARBITRATION_DELIVERY, ""); - return AjaxResult.success("仲裁文书送达成功"); + return AjaxResult.success("裁决书送达成功"); } + + /** * 通过邮件发送裁决书文件 * - * @param caseApplication1 - * @param appEmail - * @param resEmail + * @param */ - private boolean sendCaseEmail(CaseApplication caseApplication1, String appEmail, String resEmail, List caseAttachList) { + private boolean sendCaseEmail(CaseApplication caseApplication, String email, List caseAttachList, String caseNum) { List fileList = new ArrayList<>(); File file = null; + Long fileId = null; + Map fileNameMap = new HashMap<>(); if (caseAttachList != null && caseAttachList.size() > 0) { for (CaseAttach caseAttach : caseAttachList) { - if (caseAttach.getAnnexType() == 3) { - String annexName = caseAttach.getAnnexName(); - String prefix = "/profile/upload/"; - int startIndex = prefix.length(); - String path = caseAttach.getAnnexPath() + annexName.substring(startIndex); + if (Objects.equals(caseAttach.getAnnexType(), 3)) { + String annexPath = caseAttach.getAnnexPath(); + String path = annexPath.replace("/profile/upload/","/home/ruoyi/uploadPath/upload/"); file = new File(path); fileList.add(file); + fileId = caseAttach.getAnnexId(); + fileNameMap.put(file.getPath(), caseAttach.getAnnexName()); System.out.println("文件长度==================:" + file.length()); } } } + SendMailRecord sendMailRecord = new SendMailRecord(); + sendMailRecord.setCaseId(caseApplication.getId()); + sendMailRecord.setCaseNum(caseNum); + sendMailRecord.setMailAddress(email); + sendMailRecord.setMailContent("您好,审核后的调解书在附件中请查阅"); + sendMailRecord.setMailName("签署后的调解书"); + sendMailRecord.setSendTime(new Date()); + sendMailRecord.setMailSubject("签署后的调解书"); + sendMailRecord.setMailFromAddress(emailFrom); + sendMailRecord.setFileIds(fileId != null ? fileId.toString() : ""); +// sendMailRecord.setCreateBy(SecurityUtils.getUsername()); + sendMailRecord.setCreateTime(new Date()); + sendMailRecord.setMailFromAddress(emailFrom); if (file != null && file.exists()) { try { - Boolean aBoolean = emailOutUtil.sendEmil(appEmail, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null); - Boolean aBoolean1 = emailOutUtil.sendEmil(resEmail, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null); - if (aBoolean && aBoolean1) { + Boolean aBoolean = emailOutUtil.sendEmil(email, "您好,审核后的调解书在附件中请查阅", "签署后的调解书", fileList, null,fileNameMap); + + if (aBoolean) { + sendMailRecord.setSendStatus(1); + sendMailRecordMapper.saveSendMailRecord(sendMailRecord); + MsSendMailHistoryRecord msSendMailHistoryRecord = new MsSendMailHistoryRecord(); + BeanUtils.copyProperties(sendMailRecord, msSendMailHistoryRecord); + msSendMailHistoryRecord.setParentId(sendMailRecord.getId()); + msSendMailHistoryRecord.setId(null); + sendMailHistoryRecordMapper.insertSelective(msSendMailHistoryRecord); return Boolean.TRUE; } } catch (Exception e) { System.out.println("邮件发送失败++++++++++++++++++++++++++++++++"); System.out.println(e.toString()); + sendMailRecord.setSendStatus(0); + MsSendMailHistoryRecord msSendMailHistoryRecord = new MsSendMailHistoryRecord(); + BeanUtils.copyProperties(sendMailRecord, msSendMailHistoryRecord); + msSendMailHistoryRecord.setParentId(sendMailRecord.getId()); + msSendMailHistoryRecord.setId(null); + sendMailHistoryRecordMapper.insertSelective(msSendMailHistoryRecord); + sendMailRecordMapper.saveSendMailRecord(sendMailRecord); return Boolean.FALSE; } } return Boolean.FALSE; } - @Override - public AjaxResult stamp(CaseApplication caseApplication) { - //更改案件状态(暂时) - caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY); - caseApplicationMapper.submitCaseApplication(caseApplication); - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.ARBITRATION_DELIVERY, ""); - - return AjaxResult.success("用印成功,案件状态已改为待仲裁文书送达"); - } - - @Override - public AjaxResult getArchivesDetail(Long id) { - ArchivesDetailVO archivesDetailVO = new ArchivesDetailVO(); - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(id); - //查询案件信息 -// CaseApplication caseApplication1 = caseApplicationService.selectCaseApplication(caseApplication); -// if (caseApplication1 != null) { -// archivesDetailVO.setCaseApplication(caseApplication1); -// } - //查询案件日志信息 -// CaseLogRecord caseLogRecord = new CaseLogRecord(); -// caseLogRecord.setCaseAppliId(id); -// List caseLogRecords = caseLogRecordService.selectCaseLogRecordList(caseLogRecord); -// if (caseLogRecords != null && caseLogRecords.size() > 0) { -// archivesDetailVO.setCaseLogRecordList(caseLogRecords); -// } - //查询快递信息 - List logisticsInfo = this.getLogisticsInfo(caseApplication); - if (logisticsInfo != null && logisticsInfo.size() > 0) { - archivesDetailVO.setLogisticsInfoVOList(logisticsInfo); - } - return AjaxResult.success(archivesDetailVO); - } - - @Override - @Transactional - public AjaxResult regenerationDocument(CaseApplication caseApplication) { - try { - Map datas = new HashMap<>(); - Long id = caseApplication.getId(); - if (id == null) { - return null; - } - //获取案件详细信息 - CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); - //生成编码 - String equipmentNo = getNewEquipmentNo(); - datas.put("num", equipmentNo); - //获取仲裁记录相关信息 - ArbitrateRecord arbitrateRecord1 = caseApplication.getArbitrateRecord(); - - //获取案件关联人信息 - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(id); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - List nameAgentList = new ArrayList<>(); - if (caseAffiliates != null && caseAffiliates.size() > 0) { - for (CaseAffiliate affiliate : caseAffiliates) { - //获取身份类型 - int identityType = affiliate.getIdentityType(); - if (identityType == 1) { //申请人 - datas.put("appName", affiliate.getName()); - datas.put("appAddress", affiliate.getResidenAffili()); - datas.put("appContactAddress", affiliate.getContactAddress()); - datas.put("appLegalPerson", affiliate.getCompLegalPerson()); - datas.put("appLegalPersonTitle", affiliate.getCompLegalperPost()); - datas.put("appAgentName", affiliate.getNameAgent()); - datas.put("appAgentTitle", affiliate.getAppliAgentTitle()); - nameAgentList.add(affiliate.getNameAgent()); - } else if (identityType == 2) { //被申请人 - datas.put("resName", affiliate.getName()); - datas.put("resAddress", affiliate.getResidenAffili()); - String responSex = affiliate.getResponSex(); - if (responSex.equals("0")) { - datas.put("resSex", "男"); - } else { - datas.put("resSex", "女"); - } - Date responBirth = affiliate.getResponBirth(); - if (responBirth != null) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - String responBirthStr = sdf.format(responBirth); - datas.put("resDateOfBirth", responBirthStr); - } - datas.put("resContactAddress", affiliate.getContactAddress()); - nameAgentList.add(affiliate.getNameAgent()); - } - } - } - Date createTime = caseApplication1.getCreateTime(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - // 将日期格式化为字符串 - String createTimeStr = sdf.format(createTime); - datas.put("submissionDate", createTimeStr); - Date registerDate = caseApplication1.getRegisterDate(); - String registerDateStr = sdf.format(registerDate); - datas.put("acceptDate", registerDateStr); - //反请求 - Integer adjudicaCounter = caseApplication1.getAdjudicaCounter(); - String counterclaim = "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" + - "《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" + - "仲裁反请求案件受理后,秘书处向被申请人发送了仲裁反请求通知书及附件,向申请人发送了仲裁反请求通知书及附件、仲裁反请求申请书及附件。"; - if (adjudicaCounter == null) { - datas.put("counterclaim", null); - } else if (adjudicaCounter == 1) { - datas.put("counterclaim", counterclaim); - } else { - datas.put("counterclaim", null); - } - //财产保全 - Integer properPreser = caseApplication1.getProperPreser(); - String preservation = "本案受理后,申请人向仲裁委提交了财产保全申请,仲裁委根据《中华人民共和国仲裁法》" + - "第二十八条之规定,将该申请提交至法院。"; - if (properPreser == null) { - datas.put("preservation", null); - } else if (properPreser == 1) { - datas.put("preservation", preservation); - } else { - datas.put("preservation", null); - } - //管辖权异议 - Integer objectiJuris = caseApplication1.getObjectiJuris(); - String jurisdictionalObjection = "本案受理后,被申请人向仲裁委提交了《管辖异议申请书》,认为" + - ",仲裁委经审理,当庭驳回了被申请人的管辖异议申请,并告知被申请人具体的事实和理由将在裁决书中一并列明。"; - if (objectiJuris == null) { - datas.put("jurisdictionalObjection", null); - } else if (objectiJuris == 1) { - datas.put("jurisdictionalObjection", jurisdictionalObjection); - } else { - datas.put("jurisdictionalObjection", null); - } - String arbitratorName = caseApplication1.getArbitratorName(); - datas.put("arbitratorName", arbitratorName); - Integer arbitratMethod = caseApplication1.getArbitratMethod(); - Date hearDate = caseApplication1.getHearDate(); - String hearDateStr = ""; - if (hearDate != null) { - hearDateStr = sdf.format(hearDate); - } - //线上开庭时 - if (arbitratMethod == 1) { - String onLine1 = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于"; - String onLine2 = "通过仲裁委智慧仲裁平台开庭审理了本案。"; - datas.put("onLine1", onLine1); - datas.put("hearDate", hearDateStr); - datas.put("onLine2", onLine2); - } else { - //书面仲裁时 - String written1 = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于"; - String written2 = "在仲裁委所在地开庭审理了本案。"; - datas.put("written1", written1); - datas.put("hearDate1", hearDateStr); - datas.put("written2", written2); - } - Integer isAbsence = caseApplication1.getIsAbsence(); - if (isAbsence == null) { - datas.put("absent1", null); - datas.put("absent2", null); - datas.put("absent3", null); - datas.put("absent4", null); - datas.put("absent5", null); - datas.put("attend1", null); - datas.put("attend2", null); - datas.put("attend3", null); - datas.put("attend4", null); - datas.put("attend5", null); - datas.put("attend6", null); - datas.put("attend7", null); - datas.put("appAgentName1", null); - datas.put("appAgentName2", null); - datas.put("resAgentName", null); - } else if (isAbsence == 1) { - //缺席审理 - String absent1 = "申请人的特别授权委托代理人"; - String absent2 = "出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" + - "《2022年版仲裁规则》第四十条第(二)项的规定,对本案进行了缺席审理。"; - String absent3 = "庭审中,申请人陈述了仲裁请求事项及事实与理由,出示了证据材料并进行了说明," + - "发表了意见,回答了仲裁庭的提问,并作了最后陈述。因被申请人缺席庭审,故仲裁庭无法组织调解。"; - String absent4 = "(二/三)当事人提供的证据材料\n" + - "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:"; - String absent5 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + - "第四十条第(二)项、第五十一条的规定,缺席裁决如下:"; - datas.put("absent1", absent1); - datas.put("absent2", absent2); - datas.put("absent3", absent3); - datas.put("absent4", absent4); - datas.put("absent5", absent5); - datas.put("appAgentName1", nameAgentList.get(0)); - } else { - //出席审理 - String attend1 = "申请人的特别授权委托代理人"; - String attend2 = "和被申请人本人/的特别授权委托代理人"; - String attend3 = "出席了庭审。"; - String attend4 = "庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;" + - "双方当事人均出示了证据材料并对对方的证据材料进行了质证;申请人出示了证据材料," + - "被申请人对对方的证据材料进行了质证;双方当事人均回答了仲裁庭的提问,进行了辩论," + - "并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。"; - String attend5 = "(二)被申请人的答辩意见"; - String attend6 = "(二/三)当事人提供的证据材料及对方的质证意见\n" + - "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:"; - String attend7 = "被申请人对上述材料的质证意见为:"; - datas.put("attend1", attend1); - datas.put("attend2", attend2); - datas.put("attend3", attend3); - datas.put("attend4", attend4); - datas.put("attend5", attend5); - datas.put("attend6", attend6); - datas.put("attend7", attend7); - datas.put("responCrossOpin", caseApplication1.getResponCrossOpin()); - datas.put("appAgentName2", nameAgentList.get(0)); - datas.put("resAgentName", nameAgentList.get(1)); - if (arbitratMethod == 1) { - //被申出席+开庭 - String attend8 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + - "第五十一条的规定,裁决如下:"; - datas.put("attend8", attend8); - } else { - //被申出席+书面 - String attend9 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + - "第五十一条、第五十八条的规定,裁决如下:"; - datas.put("attend9", attend9); - } - } - datas.put("claims", caseApplication1.getArbitratClaims()); - datas.put("request", caseApplication1.getRequestRule()); - CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplication); - List caseAttachList1 = caseApplication2.getCaseAttachList(); - if (caseAttachList1 != null && caseAttachList1.size() > 0) { - for (CaseAttach caseAttach : caseAttachList1) { - if (caseAttach.getAnnexType() == 6) { //被申请人证据材料 - String annexName = caseAttach.getAnnexName(); - boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName); - if (isImageFile) { - String annexPath = "/home/ruoyi" + caseAttach.getAnnexPath(); - System.out.println("路径是===========" + annexPath); - PictureRenderData pictureRenderData = WordUtil - .rebuildImageContent(100, 100, null, annexPath); - datas.put("resEvidenceMaterial", pictureRenderData); - } - } else if (caseAttach.getAnnexType() == 2) { //申请人证据材料 - String annexName = caseAttach.getAnnexName(); - boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName); - if (isImageFile) { - String annexPath = "/home/ruoyi" + caseAttach.getAnnexPath(); - System.out.println("路径是===========" + annexPath); - PictureRenderData pictureRenderData = WordUtil - .rebuildImageContent(100, 100, null, annexPath); - //申请人证据材料 - datas.put("appEvidenceMaterial", pictureRenderData); - } - } - } - } - datas.put("applicaCrossOpin", "被申请人证据不足,无法说明事实"); - - datas.put("factDetermi", "被申请人欠款属实"); - datas.put("arbitrateThink", "被申请人应按约定还款"); - datas.put("rulingFollows", "被申请人依法偿还申请人欠款"); - - LocalDate now = LocalDate.now(); - String year = Integer.toString(now.getYear()); - datas.put("year", year); - String month = String.format("%02d", now.getMonthValue()); - String day = String.format("%02d", now.getDayOfMonth()); - String modalFilePath = "/data/arbitrate-document/template/新裁决书模板.docx"; -// String modalFilePath = "D:/develop/新裁决书模板.docx"; - String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; -// String saveFolderPath = "D:/data/" + year + "/" + month + "/" + day; - String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx"; - String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; - String resultFilePath = saveFolderPath + "/" + fileName; - // 创建日期目录 - File saveFolder = new File(saveFolderPath); - if (!saveFolder.exists()) { - saveFolder.mkdirs(); - } - Path sourcePath = new File(modalFilePath).toPath(); - Path destinationPath = new File(resultFilePath).toPath(); - Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING); - String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath); - String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8); - //将裁决书更新到附件表里 - CaseAttach caseAttach = CaseAttach.builder() - .caseAppliId(id) - .annexName(saveName) - .annexPath(savePath) - .annexType(3) - .build(); - int i = caseAttachMapper.updateCaseAttachBycaseid(caseAttach); - - - if (i > 0) { - if (arbitrateRecord1 != null) { - //将仲裁记录更新到仲裁记录表 - arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord1); - } - } - - String annexName = caseAttach.getAnnexName(); - String prefix = "/profile"; - int startIndex = annexName.indexOf(prefix); - startIndex += prefix.length(); - String annexPath = "/uploadPath" + annexName.substring(startIndex); - caseAttach.setAnnexPath(annexPath); - int startIndexnew = annexName.lastIndexOf("/"); - if (startIndexnew != -1) { - String annexNamenew = annexName.substring(startIndexnew + 1); - caseAttach.setAnnexName(annexNamenew); - } - - return AjaxResult.success(caseAttach); - } catch (IOException e) { - e.printStackTrace(); - return AjaxResult.error("重新生成裁决书异常"); - } - } @Override public AjaxResult emailByCaseId(Long id) { - List list = caseAffiliateMapper.emailByCaseId(id); + List list = caseAffiliateMapper.emailByCaseId(id); BookSendVO bookSendVO = new BookSendVO(); if (CollectionUtil.isNotEmpty(list)) { - for (CaseAffiliate caseAffiliate : list) { - // 申请人邮箱 - if (caseAffiliate.getIdentityType() == 1) { - bookSendVO.setAppEmail(caseAffiliate.getEmail()); - } else { - // 被申请人邮箱 - bookSendVO.setResEmail(caseAffiliate.getEmail()); - } + // 申请操作人 + Optional applicantAffiliateOpt = list.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getEmail()) && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))).findFirst(); + // 被申请操作人 + Optional resAffiliateOpt = list.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getEmail()) && (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4))).findFirst(); + if (!applicantAffiliateOpt.isPresent() || !resAffiliateOpt.isPresent()) { + throw new ServiceException("未找到案件操作人员"); } + bookSendVO.setAppEmail(applicantAffiliateOpt.get().getEmail()); + bookSendVO.setResEmail(resAffiliateOpt.get().getEmail()); } return AjaxResult.success(bookSendVO); } - private void setExecList(List execList, List columnValueList){ - if(CollectionUtil.isNotEmpty(columnValueList)){ - Function,Integer> function= columnValueMapper::batchSave; - execList.add(new MultipleThreadListParam(function,columnValueList)); + + private void setExecList(List execList, List columnValueList) { + if (CollectionUtil.isNotEmpty(columnValueList)) { + Function, Integer> function = columnValueMapper::batchSave; + execList.add(new MultipleThreadListParam(function, columnValueList)); } } - @Transactional + + @Transactional @Override public AjaxResult batchDocument(List ids) { - // todo 多线程生成裁决书 // List execList=new ArrayList<>(); // if(CollectionUtil.isNotEmpty(columnValueList)) { // setExecList(execList, columnValueList); @@ -1283,6 +1036,457 @@ public class AdjudicationServiceImpl implements IAdjudicationService { return AjaxResult.success(); } + /** + * 根据签署流程id查询批量签名链接 + * + * @param idsReq + * @return + */ + @Override + public SealSignRecord selectBatchSignUrl(StringIdsReq idsReq) { + SealSignRecord signRecord = new SealSignRecord(); + + try { + EsignHttpResponse identityInfo = SignAward.identityInfo(idsReq); + + Gson gson = new Gson(); + if (StrUtil.isNotEmpty(identityInfo.getBody())) { + JsonObject identityInfoJsonObject = gson.fromJson(identityInfo.getBody(), JsonObject.class); + if (identityInfoJsonObject != null && !identityInfoJsonObject.get("data").isJsonNull()) { + JsonObject identityInfoData = identityInfoJsonObject.getAsJsonObject("data"); + if (identityInfoData != null && !identityInfoData.get("psnId").isJsonNull()) { + idsReq.setPsnId(identityInfoData.get("psnId").getAsString()); + } + } + } + if (StrUtil.isEmpty(idsReq.getPsnId())) { + throw new ServiceException("该用户未认证"); + } + EsignHttpResponse batchSignUrl = SignAward.batchSignUrl(idsReq); + if (StrUtil.isNotEmpty(batchSignUrl.getBody())) { + JsonObject signUrlJsonObject = gson.fromJson(batchSignUrl.getBody(), JsonObject.class); + if (signUrlJsonObject != null && !signUrlJsonObject.get("data").isJsonNull()) { + JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data"); + if (signUrlData != null && !signUrlData.get("batchSignUrlWithoutLogin").isJsonNull()) { + // 免登录批量签链接(链接有效期2小时) + String url = signUrlData.get("batchSignUrlWithoutLogin").getAsString(); + // batchSignUrl 需登录批量签链接(链接有效期2小时),batchSignShortUrl需登录批量签短链接(链接有效期2小时),batchSignShortUrlWithoutLogin免登录批量签短链接(链接有效期2小时) + signRecord.setSignUrl(url); + } + } + } + } catch (EsignDemoException e) { + e.printStackTrace(); + } + + return signRecord; + } + + @Override + public SealSignRecord selectBatchSealUrl(StringIdsReq idsReq) { + SealSignRecord signRecord = new SealSignRecord(); + + try { + EsignHttpResponse identityInfo = SignAward.identityInfo(idsReq); + + Gson gson = new Gson(); + if (StrUtil.isNotEmpty(identityInfo.getBody())) { + JsonObject identityInfoJsonObject = gson.fromJson(identityInfo.getBody(), JsonObject.class); + if (identityInfoJsonObject != null && !identityInfoJsonObject.get("data").isJsonNull()) { + JsonObject identityInfoData = identityInfoJsonObject.getAsJsonObject("data"); + if (identityInfoData != null && !identityInfoData.get("psnId").isJsonNull()) { + idsReq.setPsnId(identityInfoData.get("psnId").getAsString()); + } + } + } + if (StrUtil.isEmpty(idsReq.getPsnId())) { + throw new ServiceException("该用户未认证"); + } + EsignHttpResponse batchSignUrl = SignAward.batchSignUrl(idsReq); + if (StrUtil.isNotEmpty(batchSignUrl.getBody())) { + JsonObject signUrlJsonObject = gson.fromJson(batchSignUrl.getBody(), JsonObject.class); + if (signUrlJsonObject != null && !signUrlJsonObject.get("data").isJsonNull()) { + JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data"); + if (signUrlData != null && !signUrlData.get("batchSignUrlWithoutLogin").isJsonNull()) { + // 免登录批量签链接(链接有效期2小时) + String url = signUrlData.get("batchSignUrlWithoutLogin").getAsString(); + // batchSignUrl 需登录批量签链接(链接有效期2小时),batchSignShortUrl需登录批量签短链接(链接有效期2小时),batchSignShortUrlWithoutLogin免登录批量签短链接(链接有效期2小时) + signRecord.setSignUrl(url); + } + } + } + } catch (EsignDemoException e) { + e.printStackTrace(); + } + + return signRecord; + } + + @Override + public SealSignRecord getSignUrlBatch(StringIdsReq idsReq) { + SealSignRecord signRecord = new SealSignRecord(); + try { + EsignHttpResponse identityInfo = SignAward.identityInfo(idsReq); + + Gson gson = new Gson(); + if (StrUtil.isNotEmpty(identityInfo.getBody())) { + JsonObject identityInfoJsonObject = gson.fromJson(identityInfo.getBody(), JsonObject.class); + if (identityInfoJsonObject != null && !identityInfoJsonObject.get("data").isJsonNull()) { + JsonObject identityInfoData = identityInfoJsonObject.getAsJsonObject("data"); + if (identityInfoData != null && !identityInfoData.get("psnId").isJsonNull()) { + idsReq.setPsnId(identityInfoData.get("psnId").getAsString()); + } + } + } + if (StrUtil.isEmpty(idsReq.getPsnId())) { + throw new ServiceException("该用户未认证"); + } + Integer batchNumber = idsReq.getBatchNumber(); + Integer caseStatus = CaseApplicationConstants.SIGN_ARBITRATION; + List caseApplications = sealSignRecordMapper.selectsignFlow(batchNumber, caseStatus); + if (caseApplications != null && caseApplications.size() > 0) { + List signFlowIds = caseApplications.stream().map(CaseApplication::getSignFlowId).collect(Collectors.toList()); + idsReq.setIds(signFlowIds); + + EsignHttpResponse batchSignUrl = SignAward.batchSignUrl(idsReq); + if (StrUtil.isNotEmpty(batchSignUrl.getBody())) { + JsonObject signUrlJsonObject = gson.fromJson(batchSignUrl.getBody(), JsonObject.class); + if (signUrlJsonObject != null && !signUrlJsonObject.get("data").isJsonNull()) { + JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data"); + if (signUrlData != null && !signUrlData.get("batchSignUrlWithoutLogin").isJsonNull()) { + // 免登录批量签链接(链接有效期2小时) + String url = signUrlData.get("batchSignUrlWithoutLogin").getAsString(); + // batchSignUrl 需登录批量签链接(链接有效期2小时),batchSignShortUrl需登录批量签短链接(链接有效期2小时),batchSignShortUrlWithoutLogin免登录批量签短链接(链接有效期2小时) + signRecord.setSignUrl(url); + } + } + } + + } else { + throw new ServiceException("这个批号没有批量签名的案件"); + } + + } catch (EsignDemoException e) { + e.printStackTrace(); + } + + return signRecord; + } + + @Override + public SealSignRecord getSealUrlBatch(StringIdsReq idsReq) { + SealSignRecord signRecord = new SealSignRecord(); + try { + EsignHttpResponse identityInfo = SignAward.identityInfo(idsReq); + + Gson gson = new Gson(); + if (StrUtil.isNotEmpty(identityInfo.getBody())) { + JsonObject identityInfoJsonObject = gson.fromJson(identityInfo.getBody(), JsonObject.class); + if (identityInfoJsonObject != null && !identityInfoJsonObject.get("data").isJsonNull()) { + JsonObject identityInfoData = identityInfoJsonObject.getAsJsonObject("data"); + if (identityInfoData != null && !identityInfoData.get("psnId").isJsonNull()) { + idsReq.setPsnId(identityInfoData.get("psnId").getAsString()); + } + } + } + if (StrUtil.isEmpty(idsReq.getPsnId())) { + throw new ServiceException("该用户未认证"); + } + Integer batchNumber = idsReq.getBatchNumber(); + Integer caseStatus = CaseApplicationConstants.ARBITRATED_SEAL; + List caseApplications = sealSignRecordMapper.selectsignFlow(batchNumber, caseStatus); + if (caseApplications != null && caseApplications.size() > 0) { + List signFlowIds = caseApplications.stream().map(CaseApplication::getSignFlowId).collect(Collectors.toList()); + idsReq.setIds(signFlowIds); + + EsignHttpResponse batchSignUrl = SignAward.batchSignUrl(idsReq); + if (StrUtil.isNotEmpty(batchSignUrl.getBody())) { + JsonObject signUrlJsonObject = gson.fromJson(batchSignUrl.getBody(), JsonObject.class); + if (signUrlJsonObject != null && !signUrlJsonObject.get("data").isJsonNull()) { + JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data"); + if (signUrlData != null && !signUrlData.get("batchSignUrlWithoutLogin").isJsonNull()) { + // 免登录批量签链接(链接有效期2小时) + String url = signUrlData.get("batchSignUrlWithoutLogin").getAsString(); + // batchSignUrl 需登录批量签链接(链接有效期2小时),batchSignShortUrl需登录批量签短链接(链接有效期2小时),batchSignShortUrlWithoutLogin免登录批量签短链接(链接有效期2小时) + signRecord.setSignUrl(url); + } + } + } + + } else { + throw new ServiceException("这个批号没有批量用印的案件"); + } + } catch (EsignDemoException e) { + e.printStackTrace(); + } + return signRecord; + } + + @Override + @Transactional + public AjaxResult caseFileBatch(Integer batchNumber) { + CaseApplication caseApplicationsel = new CaseApplication(); + caseApplicationsel.setBatchNumber(batchNumber); + caseApplicationsel.setCaseStatus(CaseApplicationConstants.CASE_FILING); + List caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); + if (caseApplications1 != null && caseApplications1.size() > 0) { + List ids = caseApplications1.stream().map(CaseApplication::getId).collect(Collectors.toList()); + try { + for (Long id : ids) { + // Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(id); + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setId(id); + //更改案件状态(暂时) + caseApplication.setCaseStatus(CaseApplicationConstants.CASE_ARCHIVED); + caseApplicationMapper.submitCaseApplication(caseApplication); + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_FILING, ""); + } + } catch (Exception e) { + return AjaxResult.error(e.getMessage()); + } + + } else { + throw new ServiceException("这个批号没有批量归档的案件"); + } + + return AjaxResult.success("归档成功"); + } + + @Override + @Transactional + public AjaxResult serviceBatch(Integer batchNumber) throws EsignDemoException, IOException { + List operatorList = new ArrayList<>(); + CaseApplication caseApplicationsel = new CaseApplication(); + caseApplicationsel.setBatchNumber(batchNumber); + caseApplicationsel.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY); + List caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); + if (caseApplications1 != null && caseApplications1.size() > 0) { + List ids = caseApplications1.stream().map(CaseApplication::getId).collect(Collectors.toList()); + for (Long id : ids) { + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setId(id); + + CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); + if (caseApplication1 == null) { + return AjaxResult.error("未查询到相关案件"); + } + + String appEmail = ""; + String resEmail = ""; + CaseAffiliate caseAffiliate = new CaseAffiliate(); + caseAffiliate.setCaseAppliId(id); + List caseAffiliates = caseApplicationService.selectAfflicatesByCaseId(id); + if (caseAffiliates != null && caseAffiliates.size() > 0) { +// 申请操作人 + Optional applicantAffiliateOpt = caseAffiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))).findFirst(); + // 被申请操作人 + Optional resAffiliateOpt = caseAffiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4))).findFirst(); + if (applicantAffiliateOpt.isPresent()) { + operatorList.add(applicantAffiliateOpt.get()); + appEmail = applicantAffiliateOpt.get().getEmail(); + } + if (resAffiliateOpt.isPresent()) { + operatorList.add(resAffiliateOpt.get()); + resEmail = resAffiliateOpt.get().getEmail(); + } + + } + adjudicationService.service(id, appEmail, resEmail, "",""); + + } + + + } else { + 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 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("未找到该模板"); + } + // 查询案件相关表信息 + List caseAffiliates = caseApplicationService.selectAfflicatesByCaseId(req.getId()); + if (CollectionUtil.isEmpty(caseAffiliates)) { + return AjaxResult.error("未找到案件相关人员"); + } + // 在系统表中查询案件内置字段 + SysDictData sysDictData = new SysDictData(); + sysDictData.setDictType("case_built_type"); + List dictDataList = dictDataMapper.selectDictDataList(sysDictData); + // 根据模板id查询抓取规则,判断从主表取值还是从columnValue值取 + List fatchRuleList = fatchRuleMapper.listByTemplateId(caseApplicationById.getTemplateId()); + // 抓取规则,0-内置字段,1-自定义字段 + Map> fatchRuleMap = new HashMap<>(); + // 裁决书需要的字段和内容,占位符需要配置成中文 + Map 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 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 bookmarkList = getBookmarkByDocx(templatePath); + if (CollectionUtil.isEmpty(bookmarkList)) { + return AjaxResult.success("请检查模板是否配置正确,未获取到占位符"); + } + //获取仲裁记录表里的相关信息 + ArbitrateRecord arbitrateRecord = new ArbitrateRecord(); + arbitrateRecord.setCaseAppliId(req.getId()); + ArbitrateRecord arbitrateRecordSelect = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord); + + Map 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 annexPath = saveName.replace("/profile/upload/", "/home/ruoyi/uploadPath/upload/"); + // 上传到onlyoffice + JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(annexPath, req.getId()); + CaseAttach caseAttach = null; + if (jsonArray != null && jsonArray.size() > 0) { + + for (Object obj : jsonArray) { + JSONObject jsonObject = (JSONObject) obj; + String path = jsonObject.get("filePath")!=null?jsonObject.getString("filePath"):""; + path=path.replace("/home/ruoyi/uploadPath/","/profile/"); + String name = jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):""; + caseAttach = CaseAttach.builder() + .caseAppliId(req.getId()) + .annexName(name) + .annexPath(path) + .annexType(3) + .onlyOfficeFileId(jsonObject.getString("fileId")) + .build(); + +// if (jsonObject.get("filePath") != null) { +// String officePath = jsonObject.getString("filePath"); +// String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/"); +// caseAttach.setAnnexName(replace); +// +// } + + } + } + if (caseAttach != null) { + // 保存裁决书附件 + saveArbitorFile(caseAttach, caseApplicationById, arbitrateRecordSelect, null); + } else { + return AjaxResult.error("上传onlyoffice服务器失败"); + } + + return AjaxResult.success(); + } + + @Transactional + @Override + public AjaxResult changeCaseStatus(Long id, Integer caseStatus) { + if (id == null || caseStatus == null) { + return AjaxResult.error("参数校验失败"); + } + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(id); + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setId(id); + caseApplication.setCaseStatus(caseStatus); + + caseApplicationMapper.submitCaseApplication(caseApplication); + // 新增日志 + insertCaseLog(id, CaseApplicationConstants.PENDING_OPENCOURT_HEAR, ""); + return AjaxResult.success(); + } + + /** + * 根据仲裁员手机号分页查询等待签署,签署中的裁决书 + * + * @param personAccount 仲裁员手机号 + * @return + */ + @Override + public List selectSealSigning(String personAccount, Integer caseStatus) { + return sealSignRecordMapper.selectSealSigning(personAccount, caseStatus); + } + + public String getNewEquipmentNo() { Object awardNum = redisCache.getCacheObject("awardNum"); if (awardNum == null) { @@ -1311,33 +1515,34 @@ public class AdjudicationServiceImpl implements IAdjudicationService { /** * 根据裁决书模板获取所有的占位符,占位符必须是{{name}}格式 + * * @param path * @return */ - public List getBookmarkByDocx(String path){ + public List getBookmarkByDocx(String path) { XWPFDocument xwpfDocument = null; try { - log.error("path===="+path); + log.error("path====" + path); FileInputStream fileInputStream = new FileInputStream(path); log.error("fileInputStream===="); xwpfDocument = new XWPFDocument(fileInputStream); - log.error("xwpfDocument===="+xwpfDocument); + log.error("xwpfDocument====" + xwpfDocument); } catch (IOException e) { - e.printStackTrace(); + throw new ServiceException("系统找不到指定的文件。"); } - if(xwpfDocument==null){ + if (xwpfDocument == null) { return new ArrayList<>(); } List paragraphs = xwpfDocument.getParagraphs(); - if(CollectionUtil.isEmpty( xwpfDocument.getParagraphs())){ + if (CollectionUtil.isEmpty(xwpfDocument.getParagraphs())) { return new ArrayList<>(); } String regex = "\\{\\{.*?\\}\\}"; // 定义占位符的正则表达式 Pattern pattern = Pattern.compile(regex); - List bookmarkList=new ArrayList<>(); + List bookmarkList = new ArrayList<>(); for (XWPFParagraph paragraph : paragraphs) { String text = paragraph.getText(); - if(StrUtil.isNotEmpty(text)) { + if (StrUtil.isNotEmpty(text)) { Matcher matcher = pattern.matcher(text); while (matcher.find()) { @@ -1350,7 +1555,4 @@ public class AdjudicationServiceImpl implements IAdjudicationService { return bookmarkList; } - - - } \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java index d879caf..9d81e0a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java @@ -3,15 +3,14 @@ package com.ruoyi.wisdomarbitrate.service.impl; 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.common.enums.UpdateSubmitStatus; import com.ruoyi.common.enums.YesOrNoEnum; import com.ruoyi.common.utils.ObjectFieldUtils; -import com.ruoyi.common.utils.SmsUtils; +import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper; +import com.ruoyi.wisdomarbitrate.utils.SmsUtils; import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseAttach; -import com.ruoyi.wisdomarbitrate.domain.SmsSendRecord; import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue; import com.ruoyi.wisdomarbitrate.domain.vo.CompareCaseVO; import com.ruoyi.wisdomarbitrate.domain.vo.UpdateSubmitVO; @@ -210,30 +209,11 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService return AjaxResult.success(); } - SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - request.setTemplateId("1996949"); - request.setPhone(caseAffiliate.getContactTelphone()); - request.setTemplateParamSet(new String[]{caseAffiliate.getName(), logCase.getCaseNum(),vo.getReason()}); - Boolean aBoolean = SmsUtils.sendSms(request); - //保存短信发送记录 - SmsSendRecord smsSendRecord = new SmsSendRecord(); - smsSendRecord.setCaseId(caseAffiliate.getCaseAppliId()); CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(caseAffiliate.getCaseAppliId()); caseApplication = caseApplicationMapper.selectCaseApplication(caseApplication); - smsSendRecord.setCaseNum(caseApplication.getCaseNum()); - smsSendRecord.setPhone(request.getPhone()); - smsSendRecord.setSendTime(new Date()); - // 1996949 审核案件结果通知 尊敬的{1}用户,您的{2}仲裁案件,审核未通过,理由为{3},请知晓,如非本人操作,请忽略本短信 - String content = "尊敬的" + caseAffiliate.getName() + ",您的"+logCase.getCaseNum()+"仲裁案件,审核未通过,理由为"+vo.getReason()+",请知晓,如非本人操作,请忽略本短信。"; - smsSendRecord.setSendContent(content); - smsSendRecord.setCreateBy(getUsername()); - if (aBoolean) { - smsSendRecord.setSendStatus(1); - } else { - smsSendRecord.setSendStatus(0); - } - smsRecordMapper.saveSmsSendRecord(smsSendRecord); + + SmsUtils.sendSms(caseApplication, "1996949", caseAffiliate.getContactTelphone(), new String[]{caseAffiliate.getName(),caseApplication.getCaseNum(),vo.getReason()}); return AjaxResult.success(); } @@ -247,7 +227,7 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService CaseApplication beforeCase = caseApplicationService.selectCaseApplication(caseApplication); // 查询案件关联人员 - afterCase.setCaseAffiliates(caseAffiliateLogMapper.selectCaseAffiliate(afterCase.getCaseLogId())); + // afterCase.setAffiliate(caseAffiliateLogMapper.selectCaseAffiliate(afterCase.getCaseLogId())); // 查询自定义字段表 afterCase.setColumnValues(columnValueLogMapper.listBycaseAppliLogId(afterCase.getCaseLogId())); // 查询附件 @@ -259,17 +239,10 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService List afterAttachList = caseAttachLogMapper.getCaseAttachByCaseIdAndType(caseAttach); if (CollectionUtil.isNotEmpty(afterAttachList)) { for (CaseAttach attach : afterAttachList) { - String annexName = attach.getAnnexName(); - String prefix = "/profile"; - int startIndex = annexName.indexOf(prefix); - startIndex += prefix.length(); - String annexPath = "/uploadPath" + annexName.substring(startIndex); - attach.setAnnexPath(annexPath); - int startIndexnew = annexName.lastIndexOf("/"); - if (startIndexnew != -1) { - String annexNamenew = annexName.substring(startIndexnew + 1); - attach.setAnnexName(annexNamenew); - } + String path = attach.getAnnexPath()==null?"":attach.getAnnexPath(); + attach.setAnnexPath(path); + attach.setAnnexName(attach.getAnnexName()); + } afterCase.setCaseAttachList(afterAttachList); } @@ -299,7 +272,7 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService } // 对比案件人员字段 - compareAffilate(beforeCase, afterCase); +// compareAffilate(beforeCase, afterCase); // 对比申请人证据资料 compareCaseVO.setChangeColumn(compareApplicantFile(beforeCase, afterCase, changeColumn).toString()); // 对比自定义字段 @@ -385,70 +358,70 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService * @param beforeCase * @param afterCase */ - private void compareAffilate(CaseApplication beforeCase, CaseApplication afterCase) { - // 对比人员字段 - List beforeCaseCaseAffiliates = beforeCase.getCaseAffiliates(); - List afterCaseCaseAffiliates = afterCase.getCaseAffiliates(); - Map beforeCaseCaseAffiliateMap = null; - if (CollectionUtil.isNotEmpty(beforeCaseCaseAffiliates)) { - // 转为map - beforeCaseCaseAffiliateMap = beforeCaseCaseAffiliates.stream().collect(Collectors.toMap(CaseAffiliate::getIdentityType, v -> v, (n1, n2) -> n2)); - } - StringBuilder affiliateChangeColumn; - // 如果上一个版本和现版本有一个为空,那么所有字段都修改 - if (beforeCaseCaseAffiliates != null && afterCaseCaseAffiliates == null) { - affiliateChangeColumn = new StringBuilder(); - for (String column : affiliateColumns) { - - affiliateChangeColumn.append(column).append(","); - } - - } else if (beforeCaseCaseAffiliates == null && afterCaseCaseAffiliates != null) { - affiliateChangeColumn = new StringBuilder(); - for (String column : affiliateColumns) { - - affiliateChangeColumn.append(column).append(","); - } - } else if (beforeCaseCaseAffiliates != null && afterCaseCaseAffiliates != null) { - for (CaseAffiliate afterCaseCaseAffiliate : afterCaseCaseAffiliates) { - // 找到相同身份类型的数据,进行对比 - affiliateChangeColumn = new StringBuilder(); - int identityType = afterCaseCaseAffiliate.getIdentityType(); - if (beforeCaseCaseAffiliateMap != null && beforeCaseCaseAffiliateMap.containsKey(identityType)) { - CaseAffiliate beforeCaseCaseAffiliate = beforeCaseCaseAffiliateMap.get(identityType); - for (String column : affiliateColumns) { - String beforeValue = ObjectFieldUtils.getValue(beforeCaseCaseAffiliate, column); - String afterValue = ObjectFieldUtils.getValue(afterCaseCaseAffiliate, column); - if (StrUtil.isEmpty(beforeValue) && StrUtil.isNotEmpty(afterValue)) { - affiliateChangeColumn.append(column).append(","); - continue; - } - if (StrUtil.isNotEmpty(beforeValue) && StrUtil.isEmpty(afterValue)) { - affiliateChangeColumn.append(column).append(","); - continue; - } - if (StrUtil.isNotEmpty(beforeValue) && StrUtil.isNotEmpty(afterValue) && !Objects.equals(beforeValue, afterValue)) { - affiliateChangeColumn.append(column).append(","); - continue; - - } - - } - - - } else { - for (String column : affiliateColumns) { - - affiliateChangeColumn.append(column).append(","); - } - } - afterCaseCaseAffiliate.setChangeColumn(affiliateChangeColumn.toString()); - - } - - - } - } +// private void compareAffilate(CaseApplication beforeCase, CaseApplication afterCase) { +// // 对比人员字段 +// List beforeCaseCaseAffiliates = beforeCase.getCaseAffiliates(); +// List afterCaseCaseAffiliates = afterCase.getCaseAffiliates(); +// Map beforeCaseCaseAffiliateMap = null; +// if (CollectionUtil.isNotEmpty(beforeCaseCaseAffiliates)) { +// // 转为map +// beforeCaseCaseAffiliateMap = beforeCaseCaseAffiliates.stream().collect(Collectors.toMap(CaseAffiliate::getIdentityType, v -> v, (n1, n2) -> n2)); +// } +// StringBuilder affiliateChangeColumn; +// // 如果上一个版本和现版本有一个为空,那么所有字段都修改 +// if (beforeCaseCaseAffiliates != null && afterCaseCaseAffiliates == null) { +// affiliateChangeColumn = new StringBuilder(); +// for (String column : affiliateColumns) { +// +// affiliateChangeColumn.append(column).append(","); +// } +// +// } else if (beforeCaseCaseAffiliates == null && afterCaseCaseAffiliates != null) { +// affiliateChangeColumn = new StringBuilder(); +// for (String column : affiliateColumns) { +// +// affiliateChangeColumn.append(column).append(","); +// } +// } else if (beforeCaseCaseAffiliates != null && afterCaseCaseAffiliates != null) { +// for (CaseAffiliate afterCaseCaseAffiliate : afterCaseCaseAffiliates) { +// // 找到相同身份类型的数据,进行对比 +// affiliateChangeColumn = new StringBuilder(); +// int identityType = afterCaseCaseAffiliate.getIdentityType(); +// if (beforeCaseCaseAffiliateMap != null && beforeCaseCaseAffiliateMap.containsKey(identityType)) { +// CaseAffiliate beforeCaseCaseAffiliate = beforeCaseCaseAffiliateMap.get(identityType); +// for (String column : affiliateColumns) { +// String beforeValue = ObjectFieldUtils.getValue(beforeCaseCaseAffiliate, column); +// String afterValue = ObjectFieldUtils.getValue(afterCaseCaseAffiliate, column); +// if (StrUtil.isEmpty(beforeValue) && StrUtil.isNotEmpty(afterValue)) { +// affiliateChangeColumn.append(column).append(","); +// continue; +// } +// if (StrUtil.isNotEmpty(beforeValue) && StrUtil.isEmpty(afterValue)) { +// affiliateChangeColumn.append(column).append(","); +// continue; +// } +// if (StrUtil.isNotEmpty(beforeValue) && StrUtil.isNotEmpty(afterValue) && !Objects.equals(beforeValue, afterValue)) { +// affiliateChangeColumn.append(column).append(","); +// continue; +// +// } +// +// } +// +// +// } else { +// for (String column : affiliateColumns) { +// +// affiliateChangeColumn.append(column).append(","); +// } +// } +// afterCaseCaseAffiliate.setChangeColumn(affiliateChangeColumn.toString()); +// +// } +// +// +// } +// } /** * 同意撤销 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index ddadc91..7510f01 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -1,8 +1,10 @@ package com.ruoyi.wisdomarbitrate.service.impl; +import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpUtil; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.google.gson.Gson; @@ -10,10 +12,13 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.ruoyi.common.annotation.DataScope; +import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.constant.CaseApplicationConstants; +import com.ruoyi.common.constant.Constants; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.entity.*; import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.enums.UpdateSubmitStatus; import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.exception.ServiceException; @@ -23,14 +28,16 @@ import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.utils.thread.ThreadPoolUtil; import com.ruoyi.system.domain.SysUserRole; import com.ruoyi.system.mapper.*; -import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue; -import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO; -import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount; +import com.ruoyi.wisdomarbitrate.domain.dto.CaseApplicationDTO; +import com.ruoyi.wisdomarbitrate.domain.entity.CaseAffiliateEntity; +import com.ruoyi.wisdomarbitrate.domain.vo.*; import com.ruoyi.wisdomarbitrate.domain.*; -import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO; import com.ruoyi.wisdomarbitrate.mapper.*; +import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper; +import com.ruoyi.wisdomarbitrate.service.IAdjudicationService; import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; import com.ruoyi.wisdomarbitrate.utils.SignAward; +import com.ruoyi.wisdomarbitrate.utils.SmsUtils; import com.ruoyi.wisdomarbitrate.utils.UnZipFileUtils; import com.ruoyi.wisdomarbitrate.utils.ZipFileUtils; import com.tencentyun.TLSSigAPIv2; @@ -40,22 +47,20 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; + import java.io.*; import java.math.BigDecimal; -import java.math.RoundingMode; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.StandardCopyOption; import java.text.SimpleDateFormat; import java.time.LocalDate; -import java.time.ZoneId; import java.util.*; import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.zip.ZipOutputStream; +import static com.ruoyi.common.constant.CaseApplicationConstants.HEAD_CHECK_ARBITRATION; import static com.ruoyi.common.core.domain.AjaxResult.error; import static com.ruoyi.common.core.domain.AjaxResult.success; import static com.ruoyi.common.utils.PageUtils.startPage; @@ -72,6 +77,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 腾讯云即时通信密钥 @Value("${imConfig.sdkSecretKey}") private String sdkSecretKey; + @Value("${onlyOfficeConfig.url}") + private String onlyOfficeUrl; @Autowired private CaseApplicationMapper caseApplicationMapper; @@ -121,192 +128,304 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Autowired private CaseZipImportImpl caseZipImportImpl; + @Autowired + IAdjudicationService adjudicationService; + @Autowired + private RedisCache redisCache; // 手机号正则 private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$"); // 邮箱正则 private static final Pattern EMAIL_PATTERN = Pattern.compile("^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$"); // 基本字段校验 - private static final String[] baseColumns = {"caseName","caseSubjectAmount","loanStartDate", "loanEndDate","contractNumber","claimInterestOwed","claimLiquidDamag", - "claimPrinciOwed","arbitratClaims"}; + private static final String[] baseColumns = {"caseName", "caseSubjectAmount", "loanStartDate", "loanEndDate", "contractNumber", "claimInterestOwed", "claimLiquidDamag", + "claimPrinciOwed", "arbitratClaims"}; // 申请人字段校验 - private static final String[] applicAffiliateColumns = {"name", "contactTelphone","contactAddress","workTelphone","workAddress", - "residenAffili","compLegalPerson", - "compLegalperPost","email","nameAgent", "identityNumAgent","contactTelphoneAgent","contactAddressAgent"}; - // 申请人/被申请人代理人字段校验 - private static final String[] applicAgentAffiliateColumns = {"nameAgent", "identityNumAgent","contactTelphoneAgent","contactAddressAgent"}; + private static final String[] applicAffiliateColumns = {"name", "phone", "address", "home", "email"}; // 被申请人字段校验 - private static final String[] dectborAffiliateColumns = {"name", "identityNum","contactTelphone","contactAddress","workTelphone","workAddress", - "residenAffili","responSex","responBirth","email","nameAgent", "identityNumAgent","contactTelphoneAgent","contactAddressAgent"}; +// private static final String[] dectborAffiliateColumns = {"name", "identityNum", "contactTelphone", "contactAddress", "workTelphone", "workAddress", +// "residenAffili", "responSex", "responBirth", "email", "nameAgent", "identityNumAgent", "contactTelphoneAgent", "contactAddressAgent"}; + private static final String[] dectborAffiliateColumns = {"name", "phone", "address", "home", "email"}; /** + * 分页查询 * 数据权限:1.每个人不同的角色,而每个角色可以操作不同的案件状态 - * 2.申请人:金融机构下,可以看到改机构的所有的案件 - * 3.被申请人:可以看到自己相关的案件(案件有被申请人相关的信息) - * 4.仲裁员:案件选定了某个仲裁员后,该仲裁员就可以查看该案件 - * 5.仲裁委(部门长):可以查看所有的案件 - * 6.法律顾问秘书:可以属于多个机构,可以查看相关机构的所有案件 - * 7.超级管理员:可以查看所有的信息和数据 + * 2.申请人,被申请人:可以看到自己相关的案件(案件有被申请人相关的信息) + * 3.仲裁员:案件选定了某个仲裁员后,该仲裁员就可以查看该案件 + * 4.超级管理员,法律顾问秘书,仲裁委(部门长):可以查看所有案件 * * @param caseApplication * @return */ - @Override - public List selectCaseApplicationListByRole(CaseApplication caseApplication) { + public List page(CaseApplication caseApplication) { + List caseApplications = new ArrayList<>(); // 获取登录用户 LoginUser loginUser = getLoginUser(); SysUser user = loginUser.getUser(); Long userId = user.getUserId(); - // 查询登录人身份证号 + // 查询登录人,根据邮箱查询 SysUser sysUser = sysUserMapper.selectUserById(userId); + if (sysUser == null) { + throw new ServiceException("未获取到登录用户信息"); + } + + + List roles = sysUser.getRoles(); + // 没有角色不能查看案件列表 + if (CollectionUtil.isEmpty(roles)) { + throw new ServiceException("该用户没有角色权限"); + } + // 是否嗲三方代理人 + boolean agentFlag = false; + List caseStatusList = new ArrayList<>(); + List roleIds = roles.stream().map(SysRole::getRoleId).collect(Collectors.toList()); startPage(); - // 已办案件 - if (caseApplication.getSelectCaseStatus().equals("1")) { - caseApplication.setLoginUserName(sysUser.getUserName()); - return caseApplicationMapper.selectHandledCase(caseApplication); - } else { // 待办案件 + // 查看所有权限 + if (StrUtil.equals(SecurityUtils.getUsername(), "admin")) { + startPage(); + caseApplication.setIsOtherRole(1); + caseApplications = caseApplicationMapper.list(caseApplication, caseStatusList, null); + setArbitorMethod(caseApplications, agentFlag); + return caseApplications; + } + + for (SysRole role : roles) { + if (StrUtil.isEmpty(role.getRoleName())) { + continue; + } + if (StrUtil.contains(role.getRoleName(), "财务") + || StrUtil.contains(role.getRoleName(), "法律顾问") + || StrUtil.contains(role.getRoleName(), "部门长") + ) { + roleIds = null; + } + if ("申请人" .equals(role.getRoleName()) || "被申请人" .equals(role.getRoleName())) { + caseApplication.setUserId(userId); + } + if (StrUtil.contains(role.getRoleName(), "代理")) { + caseApplication.setCreateBy(String.valueOf(sysUser.getUserName())); + agentFlag = true; + + } + if (StrUtil.equals(role.getRoleName(), "仲裁员")) { + caseApplication.setArbitratorId(String.valueOf(sysUser.getUserId())); + } +// 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())) { +// caseApplication.setIsOtherRole(1); +// 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); +// } +// 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)); +// } + } + startPage(); + caseApplications = caseApplicationMapper.list(caseApplication, caseStatusList, roleIds); + setArbitorMethod(caseApplications, agentFlag); + return caseApplications; + + } + + /** + * 设置仲裁方式 + * + * @param list + * @param agentFlag 是否第三方代理人 + */ + private void setArbitorMethod(List list, boolean agentFlag) { + + if (CollectionUtil.isEmpty(list)) { + return; + } + // 是否调解员 + boolean isMediatorRole = false; + List caseIds = list.stream().map(CaseApplication::getId).collect(Collectors.toList()); + List affiliatesList = caseAffiliateMapper.selectCaseAffiliateByCaseIds(caseIds); + // 根据案件id分组 + Map> affiliateMap = new HashMap<>(); + if (CollectionUtil.isNotEmpty(affiliatesList)) { + affiliateMap = affiliatesList.stream().collect(Collectors.groupingBy(CaseAffiliateEntity::getCaseAppliId)); + } + for (CaseApplication vo : list) { + if (StrUtil.isNotEmpty(vo.getArbitratorId()) && vo.getArbitratorId().equals(String.valueOf(SecurityUtils.getUserId()))) { + isMediatorRole = true; + vo.setArbitratorFlag(1); + } else { + vo.setArbitratorFlag(0); + } + // 第三方代理人标志 + if (StrUtil.isNotEmpty(vo.getCreateBy())) { + if (StrUtil.isEmpty(SecurityUtils.getUsername())) { + vo.setAgentFlag(0); + } else { + // todo 如果案件流程id变了需要改 + if (StrUtil.equals(SecurityUtils.getUsername(), vo.getCreateBy()) && agentFlag) { + vo.setAgentFlag(1); + } else { + vo.setAgentFlag(0); + } + } + } else { + vo.setAgentFlag(0); + } + // 设置申请人和被申请人 + if (affiliateMap.containsKey(vo.getId())) { + List affiliates = affiliateMap.get(vo.getId()); + StringBuilder applicantName = new StringBuilder(); + StringBuilder respondentName = new StringBuilder(); + for (CaseAffiliateEntity affiliate : affiliates) { + + if (affiliate.getOrganizeFlag() == null || affiliate.getOrganizeFlag() != 1) { + if (StrUtil.isNotEmpty(affiliate.getRoleName()) && affiliate.getRoleName().equals("申请人") + && affiliate.getRoleType() != null && affiliate.getRoleType() == 1 && StrUtil.isNotEmpty(affiliate.getName()) + && !applicantName.toString().contains(affiliate.getName() + Constants.CN_SPLIT_COMMA)) { + applicantName.append(affiliate.getName()).append(Constants.CN_SPLIT_COMMA); + } + } else { + // 组织机构 + if (affiliate.getRoleType() != null && affiliate.getRoleType() == 1 && StrUtil.isNotEmpty(affiliate.getApplicantOrgName()) + && !applicantName.toString().contains(affiliate.getApplicantOrgName() + Constants.CN_SPLIT_COMMA)) { + applicantName.append(affiliate.getApplicantOrgName()).append(Constants.CN_SPLIT_COMMA); + } + } + if (affiliate.getOrganizeFlag() == null || affiliate.getOrganizeFlag() != 1) { + if (StrUtil.isNotEmpty(affiliate.getRoleName()) && affiliate.getRoleName().equals("被申请人") + && affiliate.getRoleType() != null && affiliate.getRoleType() == 3 && StrUtil.isNotEmpty(affiliate.getName()) + && !respondentName.toString().contains(affiliate.getName() + Constants.CN_SPLIT_COMMA)) { + + respondentName.append(affiliate.getName()).append(Constants.CN_SPLIT_COMMA); + } + } else { + // 组织机构 + if (affiliate.getRoleType() != null && affiliate.getRoleType() == 3 && StrUtil.isNotEmpty(affiliate.getApplicantOrgName()) && !respondentName.toString().contains(affiliate.getApplicantOrgName() + Constants.CN_SPLIT_COMMA)) { + respondentName.append(affiliate.getApplicantOrgName()).append(Constants.CN_SPLIT_COMMA); + } + } + + } + vo.setApplicantName(removeLastComma(applicantName.toString(), Constants.CN_SPLIT_COMMA)); + vo.setRespondentName(removeLastComma(respondentName.toString(), Constants.CN_SPLIT_COMMA)); + } + } + } + + @Override + public ToDoCount selectToDoCount() { + LoginUser loginUser = getLoginUser(); + SysUser user = loginUser.getUser(); + Long userId = user.getUserId(); + // 查询登录人,根据邮箱查询 + SysUser sysUser = sysUserMapper.selectUserById(userId); + if (sysUser == null) { + throw new ServiceException("未获取到登录用户信息"); + } + ToDoCount toDoCount = null; + CaseApplication caseApplication = new CaseApplication(); + List caseStatusList = new ArrayList<>(); + if (StrUtil.equals(SecurityUtils.getUsername(), "admin")) { + // caseApplication.setCreateBy(String.valueOf(sysUser.getUserName())); + toDoCount = caseApplicationMapper.selectTodoCountByRole(caseApplication, caseStatusList, null); + if (toDoCount == null) { + toDoCount = new ToDoCount(); + } + return toDoCount; + } else { + List roles = sysUser.getRoles(); // 没有角色不能查看案件列表 if (CollectionUtil.isEmpty(roles)) { throw new ServiceException("该用户没有角色权限"); } + List roleIds = roles.stream().map(SysRole::getRoleId).collect(Collectors.toList()); + for (SysRole role : roles) { if (StrUtil.isEmpty(role.getRoleName())) { continue; } - // 超级管理员和仲裁委(部门长)案件,可查看所有案件 √ - if ("超级管理员".equals(role.getRoleName()) + if (StrUtil.isEmpty(role.getRoleName())) { + continue; + } + if (StrUtil.contains(role.getRoleName(), "财务") + || StrUtil.contains(role.getRoleName(), "法律顾问") + || StrUtil.contains(role.getRoleName(), "部门长") ) { - return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication); + roleIds = null; } - if ("仲裁委".equals(role.getRoleName()) - || "部门长".equals(role.getRoleName())) { - List caseStatusList = new ArrayList<>(); - caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); - caseStatusList.add(CaseApplicationConstants.CHECK_ARBITRATION); - // caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL); - caseApplication.setDeptHeadStatus(caseStatusList); - caseApplication.setIsOtherRole(1); + if ("申请人" .equals(role.getRoleName()) || "被申请人" .equals(role.getRoleName())) { + caseApplication.setUserId(userId); } - if ("仲裁员".equals(role.getRoleName())) { - caseApplication.setUserId(String.valueOf(userId)); - caseApplication.setIsOtherRole(1); + if (StrUtil.contains(role.getRoleName(), "代理")) { + caseApplication.setCreateBy(String.valueOf(sysUser.getUserName())); + } - if ("财务".equals(role.getRoleName())) { - caseApplication.setIsOtherRole(1); - caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); - } - if ("法律顾问".equals(role.getRoleName())) { - // 秘书查看所有案件 - // 查询角色有关的用户部门 - List 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 agentDeptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId()); - List agentDeptIds = new ArrayList<>(); - agentDeptIds.add(sysUser.getDeptId()); - caseApplication.setAgentDeptIds(agentDeptIds); + if (StrUtil.equals(role.getRoleName(), "仲裁员")) { + caseApplication.setArbitratorId(String.valueOf(sysUser.getUserId())); } +// 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())) { +// caseApplication.setIsOtherRole(1); +// 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); +// } +// if ("财务".equals(role.getRoleName())) { +// caseApplication.setIsOtherRole(1); +// caseStatusList.add(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); +// } +// if ("法律顾问".equals(role.getRoleName()) || "秘书".equals(role.getRoleName())) { +// caseApplication.setIsOtherRole(1); +// Integer[] array = {1, 5, 8, 9, 11, 14, 15, 16, 31}; +// caseStatusList.addAll(Arrays.asList(array)); +// } } - - - // 根据条件查询申请人,被申请人,仲裁员,法律顾问案件 -// return caseApplicationMapper.selectCaseApplicationList(caseApplication); - return caseApplicationMapper.selectCaseApplicationList1(caseApplication); - } - - } - - - @Override - public ToDoCount selectToDoCount() { - - // 获取登录用户 - LoginUser loginUser = getLoginUser(); - SysUser user = loginUser.getUser(); - Long userId = user.getUserId(); - - // 查询登录人信息 - SysUser sysUser = sysUserMapper.selectUserById(userId); - List roles = sysUser.getRoles(); - // 没有角色不能查看案件列表 - if (CollectionUtil.isEmpty(roles)) { - throw new ServiceException("该用户没有角色权限"); - } - CaseApplication caseApplication = new CaseApplication(); - List caseStatusList = new ArrayList<>(); - for (SysRole role : roles) { - if (StrUtil.isEmpty(role.getRoleName())) { - continue; + toDoCount = caseApplicationMapper.selectTodoCountByRole(caseApplication, caseStatusList, roleIds); + if (toDoCount == null) { + toDoCount = new ToDoCount(); } - // 超级管理员和仲裁委(部门长)案件,可查看所有案件 √ - 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 deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId()); - List 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 agentDeptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId()); - List agentDeptIds = new ArrayList<>(); - agentDeptIds.add(sysUser.getDeptId()); - caseApplication.setAgentDeptIds(agentDeptIds); - } - } - - - // 根据条件查询申请人,被申请人,仲裁员,法律顾问案件 - ToDoCount toDoCount = caseApplicationMapper.selectTodoCountByRole(caseApplication); - if (toDoCount == null) { - return new ToDoCount(); } return toDoCount; } @@ -315,39 +434,84 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { public AjaxResult selectCaseProgress(CaseApplication caseApplication) { Map datas = new HashMap<>(); Long id = caseApplication.getId(); - CaseLogRecord caseLogRecord = new CaseLogRecord(); - caseLogRecord.setCaseAppliId(id); - List records = caseLogRecordMapper.selectCaseLogRecordList(caseLogRecord); CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); + // 当前案件节点 Integer caseStatus = caseApplicationselect.getCaseStatus(); - if (caseStatus.intValue() != 0) { - CaseLogRecord caseLogRecordin = getInCasenode(caseStatus); - records.add(caseLogRecordin); + List allCaseNode = getAllCaseNode(caseApplicationselect.getArbitratMethod()); + if (caseApplicationselect.getArbitratMethod() != null) { + if (caseApplicationselect.getArbitratMethod().equals(1)) { + // 开庭审理 + allCaseNode.removeIf(record -> record.getCaseNode().equals(9)); + } + if (caseApplicationselect.getArbitratMethod().equals(2)) { + // 书面审理 + allCaseNode.removeIf(record -> record.getCaseNode().equals(8) || record.getCaseNode().equals(31)); + } } - - List recordsnofinish = getNofinishCasenode(caseStatus); - records.addAll(recordsnofinish); - datas.put("allCasenode", records); + datas.put("allCasenode", allCaseNode); datas.put("caseStatus", caseStatus); return success(datas); } + /** + * 获取所有案件节点 + * arbitratMethod : 1:开庭诉讼,2:书面诉讼 + * + * @return + */ + private List getAllCaseNode(Integer arbitratMethod) { + List allCaseNode = new ArrayList<>(); + allCaseNode.add(getCaseNode("当前节点角色:申请人", "立案申请", 0, "申请人将提交案件", "下一节点角色:法律顾问")); + allCaseNode.add(getCaseNode("当前节点角色:法律顾问", "立案审查", 1, "法律顾问将立案审查", "下一节点角色:申请人")); + allCaseNode.add(getCaseNode("当前节点角色:申请人", "缴费", 2, "申请人将缴费", "下一节点角色:财务")); + allCaseNode.add(getCaseNode("当前节点角色:财务", "缴费确认", 3, "财务将缴费确认", "下一节点角色:被申请人")); + allCaseNode.add(getCaseNode("当前节点角色:被申请人", "案件质证", 4, "被申请人将案件质证", "下一节点角色:法律顾问")); + allCaseNode.add(getCaseNode("当前节点角色:法律顾问", "组庭审核", 5, "法律顾问将组庭审核", "下一节点角色:部门长")); + allCaseNode.add(getCaseNode("当前节点角色:部门长", "组庭确定", 6, "部门长将组庭确定", "下一节点角色:仲裁员")); +// allCaseNode.add(getLastNodeRecord("当前节点角色:仲裁员", "审核仲裁方式", 7, "仲裁员将审核仲裁方式","下一节点角色:法律顾问")); + if (arbitratMethod == null) { + allCaseNode.add(getCaseNode("当前节点角色:仲裁员", "审核仲裁方式", 7, "仲裁员将审核仲裁方式", "下一节点角色:法律顾问或仲裁员")); + + allCaseNode.add(getCaseNode("当前节点角色:法律顾问或仲裁员", "修改开庭时间或书面审理", 31, "法律顾问将修改开庭时间或仲裁员将书面审理", "下一节点角色:法律顾问,仲裁员,申请人,被申请人或仲裁员")); + // allCaseNode.add(getLastNodeRecord("当前节点角色:法律顾问", "修改开庭时间", 31, "法律顾问将修改开庭时间", "下一节点角色:法律顾问,仲裁员,申请人,被申请人")); + allCaseNode.add(getCaseNode("当前节点角色:法律顾问,仲裁员,申请人,被申请人或仲裁员", "开庭审理或书面审理", 8, "法律顾问,仲裁员,申请人,被申请人将开庭审理或仲裁员将书面审理", "下一节点角色:法律顾问")); + // allCaseNode.add(getLastNodeRecord("当前节点角色:仲裁员", "书面审理", 9, "仲裁员将书面审理", "下一节点角色:法律顾问")); + } else if (arbitratMethod.equals(1)) { + allCaseNode.add(getCaseNode("当前节点角色:仲裁员", "审核仲裁方式", 7, "仲裁员将审核仲裁方式", "下一节点角色:法律顾问")); + // 开庭 + allCaseNode.add(getCaseNode("当前节点角色:法律顾问", "修改开庭时间", 31, "法律顾问将修改开庭时间", "下一节点角色:法律顾问,仲裁员,申请人,被申请人")); + allCaseNode.add(getCaseNode("当前节点角色:法律顾问,仲裁员,申请人,被申请人", "开庭审理", 8, "法律顾问,仲裁员,申请人,被申请人将开庭审理", "下一节点角色:法律顾问")); + } else if (arbitratMethod.equals(2)) { + allCaseNode.add(getCaseNode("当前节点角色:仲裁员", "审核仲裁方式", 7, "仲裁员将审核仲裁方式", "下一节点角色:仲裁员")); + // 书面 + allCaseNode.add(getCaseNode("当前节点角色:仲裁员", "书面审理", 9, "仲裁员将书面审理", "下一节点角色:法律顾问")); + } + allCaseNode.add(getCaseNode("当前节点角色:法律顾问", "核验裁决书", 11, "法律顾问将核验裁决书", "下一节点角色:仲裁员")); + allCaseNode.add(getCaseNode("当前节点角色:仲裁员", "仲裁员审核裁决书", 18, "仲裁员将审核裁决书", "下一节点角色:部门长")); + allCaseNode.add(getCaseNode("当前节点角色:部门长", "部门长审核裁决书", 12, "部门长将审核裁决书", "下一节点角色:仲裁员")); + allCaseNode.add(getCaseNode("当前节点角色:仲裁员", "裁决书签名", 13, "仲裁员将进行裁决书签名", "下一节点角色:法律顾问")); + allCaseNode.add(getCaseNode("当前节点角色:法律顾问", "裁决书用印", 14, "法律顾问将进行裁决书用印", "下一节点角色:法律顾问")); + allCaseNode.add(getCaseNode("当前节点角色:法律顾问", "裁决书送达", 15, "法律顾问将送达裁决书", "下一节点角色:法律顾问")); + allCaseNode.add(getCaseNode("当前节点角色:法律顾问", "案件归档", 16, "法律顾问将进行案件归档", "")); + allCaseNode.add(getCaseNode(null, "结束", 17, "", "")); + return allCaseNode; + } + @Override @Transactional public int updateHeardate(CaseApplication caseApplication) { + // Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); // caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR); caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR); + caseApplication.setLockStatus(1); int rows = caseApplicationMapper.submitCaseApplication(caseApplication); //1975139 修改开庭时间通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已改为{3},请知晓,如非本人操作,请忽略本短信 - //发送短信通知 - SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - request.setTemplateId("1975139"); // 发送开庭日期通知短信 - sendHearDateMessage(caseApplication, request, "1975139"); + sendHearDateMessage(caseApplication, "1975139"); // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_OPENCOURT_HEAR, ""); + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, ""); return rows; } @@ -357,7 +521,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } - @Override @Transactional public AjaxResult uploadZipFile(MultipartFile file, Long id, String username, Long userId) { @@ -365,7 +528,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return AjaxResult.error("请选择要上传的文件"); } - String targetPath = "/home/ruoyi/uploadPath/upload/unzipFile"; + String targetPath = "/home/ruoyi/uploadPath/upload/unzipFile"; File zipFile = null; InputStream ins = null; try { @@ -400,12 +563,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if (allFilestr != null && allFilestr.size() > 0) { for (String filestr : allFilestr) { List allindex = new ArrayList<>(); -// int indexKey = filestr.indexOf("\\"); int indexKey = filestr.indexOf("/"); -// System.out.println("filestr:------------"+filestr); allindex.add(indexKey); while (indexKey != -1) { -// indexKey = filestr.indexOf("\\", indexKey + 1); indexKey = filestr.indexOf("/", indexKey + 1); allindex.add(indexKey); } @@ -475,7 +635,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { String year = Integer.toString(now.getYear()); String month = String.format("%02d", now.getMonthValue()); String day = String.format("%02d", now.getDayOfMonth()); - // todo + // 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("-", "") + "_" + substrfile; @@ -506,22 +666,21 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { String substrTwo = filestr.substring(allindex.get(6) + 1, allindex.get(7)); Integer annexType = null; - if ("申请书".equals(substrTwo)) { + if ("申请书" .equals(substrTwo)) { annexType = 1; - } else if ("证据材料".equals(substrTwo)) { + } else if ("证据材料" .equals(substrTwo)) { annexType = 2; } - String savePath = "/home/ruoyi/uploadPath/upload"; String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; //将附件保存到附件表里 CaseAttach caseAttach = CaseAttach.builder() .caseAppliId(id) - .annexName(saveName) - .annexPath(savePath) + .annexName(fileName) + .annexPath(saveName) .annexType(annexType) .build(); int i = caseAttachMapper.save(caseAttach); - Integer annexId = caseAttach.getAnnexId(); + Long annexId = caseAttach.getAnnexId(); //保存到目录表 Long parentId = null; @@ -551,350 +710,28 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } - @Override - public List getSmsSendRecord(SmsSendRecord smsSendRecord) { - return smsRecordMapper.getSmsSendRecord(smsSendRecord); + + + + /** + * 获取每个节点的流程 + * + * @param currentRoleName 当前节点角色 + * @param caseNodeName 节点名称 + * @param caseNode 案件节点 + * @param content 内容 + * @return + */ + private CaseLogRecord getCaseNode(String currentRoleName, String caseNodeName, int caseNode, String content, String nextRoleName) { + CaseLogRecord lastNodeRecord = new CaseLogRecord(); + lastNodeRecord.setCaseNodeName(caseNodeName); + lastNodeRecord.setCaseNode(caseNode); + lastNodeRecord.setContent(content); + lastNodeRecord.setNextRoleName(nextRoleName); + lastNodeRecord.setCurrentRoleName(currentRoleName); + return lastNodeRecord; } - private List getNofinishCasenode(Integer caseStatus) { - CaseLogRecord caseLogRecord1 = new CaseLogRecord(); - caseLogRecord1.setCaseNodeName("立案审查"); - caseLogRecord1.setCaseNode(1); - caseLogRecord1.setContent("法律顾问将进行立案审查"); - CaseLogRecord caseLogRecord2 = new CaseLogRecord(); - caseLogRecord2.setCaseNode(2); - caseLogRecord2.setCaseNodeName("缴费"); - caseLogRecord2.setContent("申请人将进行缴费"); - CaseLogRecord caseLogRecord3 = new CaseLogRecord(); - caseLogRecord3.setCaseNode(3); - caseLogRecord3.setCaseNodeName("缴费确认"); - caseLogRecord3.setContent("财务将进行缴费确认"); - CaseLogRecord caseLogRecord4 = new CaseLogRecord(); - caseLogRecord4.setCaseNode(4); - caseLogRecord4.setCaseNodeName("案件质证"); - caseLogRecord4.setContent("被申请人将进行案件质证"); - CaseLogRecord caseLogRecord5 = new CaseLogRecord(); - caseLogRecord5.setCaseNode(5); - caseLogRecord5.setCaseNodeName("组庭审核"); - caseLogRecord5.setContent("法律顾问将进行组庭审核"); - - CaseLogRecord caseLogRecord6 = new CaseLogRecord(); - caseLogRecord6.setCaseNode(6); - caseLogRecord6.setCaseNodeName("修改开庭时间"); - caseLogRecord6.setContent("部门长将修改开庭时间"); - - CaseLogRecord caseLogRecord7 = new CaseLogRecord(); - caseLogRecord6.setCaseNode(7); - caseLogRecord6.setCaseNodeName("组庭确定"); - caseLogRecord6.setContent("部门长将进行组庭确定"); - - CaseLogRecord caseLogRecord8 = new CaseLogRecord(); - caseLogRecord7.setCaseNode(8); - caseLogRecord7.setCaseNodeName("审核仲裁方式"); - caseLogRecord7.setContent("仲裁员将进行审核仲裁方式"); - CaseLogRecord caseLogRecord9 = new CaseLogRecord(); - caseLogRecord8.setCaseNode(9); - caseLogRecord8.setCaseNodeName("开庭审理"); - caseLogRecord8.setContent("仲裁员将进行开庭审理"); - CaseLogRecord caseLogRecord11 = new CaseLogRecord(); - caseLogRecord9.setCaseNode(11); - caseLogRecord9.setCaseNodeName("书面审理"); - caseLogRecord9.setContent("仲裁员将进行书面审理"); - CaseLogRecord caseLogRecord12 = new CaseLogRecord(); - caseLogRecord11.setCaseNode(12); - caseLogRecord11.setCaseNodeName("核验仲裁文书"); - caseLogRecord11.setContent("法律顾问将进行核验仲裁文书"); - CaseLogRecord caseLogRecord13 = new CaseLogRecord(); - caseLogRecord12.setCaseNode(13); - caseLogRecord12.setCaseNodeName("确认仲裁文书"); - caseLogRecord12.setContent("仲裁员将进行确认仲裁文书"); - CaseLogRecord caseLogRecord14 = new CaseLogRecord(); - caseLogRecord13.setCaseNode(14); - caseLogRecord13.setCaseNodeName("仲裁文书签名"); - caseLogRecord13.setContent("仲裁员将进行仲裁文书签名"); - CaseLogRecord caseLogRecord15 = new CaseLogRecord(); - caseLogRecord14.setCaseNode(15); - caseLogRecord14.setCaseNodeName("仲裁文书用印"); - caseLogRecord14.setContent("部门长将进行仲裁文书用印"); - CaseLogRecord caseLogRecord16 = new CaseLogRecord(); - caseLogRecord15.setCaseNode(16); - caseLogRecord15.setCaseNodeName("仲裁文书送达"); - caseLogRecord15.setContent("法律顾问将进行仲裁文书送达"); - CaseLogRecord caseLogRecord17 = new CaseLogRecord(); - caseLogRecord16.setCaseNode(17); - caseLogRecord16.setCaseNodeName("案件归档"); - caseLogRecord16.setContent("法律顾问将进行案件归档"); - - - List caseLogRecords = new ArrayList<>(); - switch (caseStatus.toString()) { - case "0": - caseLogRecords.add(caseLogRecord1); - caseLogRecords.add(caseLogRecord2); - caseLogRecords.add(caseLogRecord3); - caseLogRecords.add(caseLogRecord4); - caseLogRecords.add(caseLogRecord5); - caseLogRecords.add(caseLogRecord6); - caseLogRecords.add(caseLogRecord7); - caseLogRecords.add(caseLogRecord8); - caseLogRecords.add(caseLogRecord9); - caseLogRecords.add(caseLogRecord11); - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - break; - case "1": - caseLogRecords.add(caseLogRecord2); - caseLogRecords.add(caseLogRecord3); - caseLogRecords.add(caseLogRecord4); - caseLogRecords.add(caseLogRecord5); - caseLogRecords.add(caseLogRecord6); - caseLogRecords.add(caseLogRecord7); - caseLogRecords.add(caseLogRecord8); - caseLogRecords.add(caseLogRecord9); - caseLogRecords.add(caseLogRecord11); - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - break; - case "2": - caseLogRecords.add(caseLogRecord3); - caseLogRecords.add(caseLogRecord4); - caseLogRecords.add(caseLogRecord5); - caseLogRecords.add(caseLogRecord6); - caseLogRecords.add(caseLogRecord7); - caseLogRecords.add(caseLogRecord8); - caseLogRecords.add(caseLogRecord9); - caseLogRecords.add(caseLogRecord11); - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - break; - case "3": - caseLogRecords.add(caseLogRecord4); - caseLogRecords.add(caseLogRecord5); - caseLogRecords.add(caseLogRecord6); - caseLogRecords.add(caseLogRecord7); - caseLogRecords.add(caseLogRecord8); - caseLogRecords.add(caseLogRecord9); - caseLogRecords.add(caseLogRecord11); - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - - break; - case "4": - caseLogRecords.add(caseLogRecord5); - caseLogRecords.add(caseLogRecord6); - caseLogRecords.add(caseLogRecord7); - caseLogRecords.add(caseLogRecord8); - caseLogRecords.add(caseLogRecord9); - caseLogRecords.add(caseLogRecord11); - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - - break; - case "5": - caseLogRecords.add(caseLogRecord6); - caseLogRecords.add(caseLogRecord7); - caseLogRecords.add(caseLogRecord8); - caseLogRecords.add(caseLogRecord9); - caseLogRecords.add(caseLogRecord11); - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - - break; - case "6": - caseLogRecords.add(caseLogRecord7); - caseLogRecords.add(caseLogRecord8); - caseLogRecords.add(caseLogRecord9); - caseLogRecords.add(caseLogRecord11); - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - - break; - case "7": - caseLogRecords.add(caseLogRecord8); - caseLogRecords.add(caseLogRecord9); - caseLogRecords.add(caseLogRecord11); - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - - break; - case "8": - case "9": - caseLogRecords.add(caseLogRecord11); - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - break; - - case "11": - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - - break; - case "12": - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - - break; - case "13": - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - - break; - case "14": - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - - break; - case "15": - caseLogRecords.add(caseLogRecord16); - - break; - default: - List caseLogRecords1 = new ArrayList<>(); - } - - return caseLogRecords; - - - } - - private CaseLogRecord getInCasenode(Integer caseStatus) { - CaseLogRecord caseLogRecord = new CaseLogRecord(); - switch (caseStatus.toString()) { - case "1": - caseLogRecord.setCaseNodeName("立案审查"); - caseLogRecord.setCaseNode(1); - caseLogRecord.setContent("法律顾问正在进行立案审查"); - caseLogRecord.setNextRoleName("下一节点角色:申请人"); - break; - case "2": - caseLogRecord.setCaseNodeName("缴费"); - caseLogRecord.setCaseNode(2); - caseLogRecord.setContent("申请人正在进行缴费"); - caseLogRecord.setNextRoleName("下一节点角色:仲裁财务"); - break; - case "3": - caseLogRecord.setCaseNodeName("缴费确认"); - caseLogRecord.setCaseNode(3); - caseLogRecord.setContent("财务正在进行缴费确认"); - caseLogRecord.setNextRoleName("下一节点角色:被申请人"); - break; - case "4": - caseLogRecord.setCaseNodeName("案件质证"); - caseLogRecord.setCaseNode(4); - caseLogRecord.setContent("被申请人将进行案件质证"); - caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); - break; - case "5": - caseLogRecord.setCaseNodeName("组庭审核"); - caseLogRecord.setCaseNode(5); - caseLogRecord.setContent("法律顾问正在进行组庭审核"); - caseLogRecord.setNextRoleName("下一节点角色:部门长"); - break; - case "6": - caseLogRecord.setCaseNodeName("组庭确定"); - caseLogRecord.setCaseNode(6); - caseLogRecord.setContent("部门长正在进行组庭确定"); - caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); - break; - case "7": - caseLogRecord.setCaseNodeName("审核仲裁方式"); - caseLogRecord.setCaseNode(7); - caseLogRecord.setContent("仲裁员正在进行审核仲裁方式"); - caseLogRecord.setNextRoleName("下一节点角色:秘书顾问"); - break; - case "8": - caseLogRecord.setCaseNodeName("开庭审理"); - caseLogRecord.setCaseNode(8); - caseLogRecord.setContent("仲裁员正在进行开庭审理"); - caseLogRecord.setNextRoleName("下一节点角色:仲裁员"); - break; - case "9": - caseLogRecord.setCaseNodeName("书面审理"); - caseLogRecord.setCaseNode(9); - caseLogRecord.setContent("仲裁员正在进行书面审理"); - caseLogRecord.setNextRoleName("下一节点角色:仲裁员"); - break; - case "11": - caseLogRecord.setCaseNodeName("核验仲裁文书"); - caseLogRecord.setCaseNode(11); - caseLogRecord.setContent("法律顾问正在进行核验仲裁文书"); - caseLogRecord.setNextRoleName("下一节点角色:部门长"); - break; - case "12": - caseLogRecord.setCaseNodeName("确认仲裁文书"); - caseLogRecord.setCaseNode(12); - caseLogRecord.setContent("仲裁员正在进行确认仲裁文书"); - caseLogRecord.setNextRoleName("下一节点角色:仲裁员"); - break; - case "13": - caseLogRecord.setCaseNodeName("仲裁文书签名"); - caseLogRecord.setCaseNode(13); - caseLogRecord.setContent("仲裁员正在进行仲裁文书签名"); - caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); - break; - case "14": - caseLogRecord.setCaseNodeName("仲裁文书用印"); - caseLogRecord.setCaseNode(14); - caseLogRecord.setContent("部门长正在进行仲裁文书用印"); - caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); - break; - case "15": - caseLogRecord.setCaseNodeName("仲裁文书送达"); - caseLogRecord.setCaseNode(15); - caseLogRecord.setContent("法律顾问正在进行仲裁文书送达"); - caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); - break; - case "16": - caseLogRecord.setCaseNodeName("案件归档"); - caseLogRecord.setCaseNode(16); - caseLogRecord.setContent("法律顾问正在进行案件归档"); - break; - default: - caseLogRecord.setCaseNodeName("无案件状态"); - caseLogRecord.setContent("无操作内容"); - - } - return caseLogRecord; - } - - @Override - public List selectCaseApplicationList(CaseApplication caseApplication) { - return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication); - - } /** * 新增案件 @@ -902,149 +739,260 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { * @param caseApplication * @return */ - @Override - @Transactional - public int insertcaseApplication(CaseApplication caseApplication) { - List columnValueList=caseApplication.getColumnValues(); - caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); - //根据仲裁费用计费规则计算应缴费用 - //暂时设置计费比率为0.01 - BigDecimal feeRate = new BigDecimal(0.01); - BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP); - caseApplication.setFeePayable(feePayable); - // 获取自动编码 - String caseNum = generateCaseNum(); - caseApplication.setCaseNum(caseNum); - // 设置批号 - if(StrUtil.isEmpty(caseApplication.getBatchNumber())){ - Integer maxBatchNumber = caseApplicationMapper.selectBatchNumberLike(); - if(maxBatchNumber==null){ - caseApplication.setBatchNumber("1"); - }else { - caseApplication.setBatchNumber(maxBatchNumber+1+""); - } - } - caseApplication.setCreateBy(getUsername()); - caseApplication.setVersion(1); - caseApplication.setId(IdWorkerUtil.getId()); - // 新增立案信息 - int rows = caseApplicationMapper.insertCaseApplication(caseApplication); - if (rows == 0) { - return rows; - } - List caseAffiliates = caseApplication.getCaseAffiliates(); - Map deptMap = new HashMap<>(); - // 判断申请机构 - if (caseAffiliates != null && caseAffiliates.size() > 0) { - // 查询所有的组织机构,组装成map - List deptList = sysDeptMapper.selectDeptList(new SysDept()); - if (CollectionUtil.isEmpty(deptList)) { - deptList = new ArrayList<>(); - } - deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV)); - // 查询申请人角色id - Long roleId = roleMapper.selectRoleIdByName("申请人"); - for (CaseAffiliate caseAffiliate : caseAffiliates) { - caseAffiliate.setCaseAppliId(caseApplication.getId()); - // caseAffiliate.setCaseAppliLogId(caseApplication.getId()); - if (caseAffiliate.getIdentityType() == 1 && StrUtil.isNotEmpty(caseAffiliate.getName())) { - // 将组织机构id设为申请人名称 - if (deptMap.containsKey(caseAffiliate.getName())) { - caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseAffiliate.getName()))); - caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); - } else { - // 如果不存在则新增 - SysDept dept = new SysDept(); - dept.setParentId(0L); - dept.setDeptName(caseAffiliate.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.setApplicationOrganId(String.valueOf(dept.getDeptId())); - caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); +// @Override +// @Transactional +// public int insertcaseApplication(CaseApplication caseApplication) { +// List columnValueList=caseApplication.getColumnValues(); +// caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); +// //根据仲裁费用计费规则计算应缴费用 +// //暂时设置计费比率为0.01 +// BigDecimal feeRate = new BigDecimal(0.01); +// BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP); +// caseApplication.setFeePayable(feePayable); +// // 获取自动编码 +// String caseNum = generateCaseNum(); +// caseApplication.setCaseNum(caseNum); +// // 设置批号 +// +// caseApplication.setBatchNumber(0); +// +// caseApplication.setCreateBy(getUsername()); +// caseApplication.setVersion(1); +// caseApplication.setId(IdWorkerUtil.getId()); +// // 新增立案信息 +// int rows = caseApplicationMapper.insertCaseApplication(caseApplication); +// if (rows == 0) { +// return rows; +// } +// List caseAffiliates = caseApplication.getCaseAffiliates(); +// Map deptMap = new HashMap<>(); +// // 判断申请机构 +// if (caseAffiliates != null && caseAffiliates.size() > 0) { +// // 查询所有的组织机构,组装成map +// List deptList = sysDeptMapper.selectDeptList(new SysDept()); +// if (CollectionUtil.isEmpty(deptList)) { +// deptList = new ArrayList<>(); +// } +// deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV)); +// // 查询申请人角色id +// Long roleId = roleMapper.selectRoleIdByName("申请人"); +// for (CaseAffiliate caseAffiliate : caseAffiliates) { +// caseAffiliate.setCaseAppliId(caseApplication.getId()); +// // caseAffiliate.setCaseAppliLogId(caseApplication.getId()); +// if (caseAffiliate.getIdentityType() == 1 && StrUtil.isNotEmpty(caseAffiliate.getName())) { +// // 将组织机构id设为申请人名称 +// if (deptMap.containsKey(caseAffiliate.getName())) { +// caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseAffiliate.getName()))); +// caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); +// } else { +// // 如果不存在则新增 +// SysDept dept = new SysDept(); +// dept.setParentId(0L); +// dept.setDeptName(caseAffiliate.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.setApplicationOrganId(String.valueOf(dept.getDeptId())); +// caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); +// +// } +// // 组装申请代理人信息 +// String agentInfoFlag = buildAgentInfo(caseAffiliate, roleId); +// if (StrUtil.isNotEmpty(agentInfoFlag)) { +// throw new ServiceException(agentInfoFlag); +// } +// } +// } +// // 新增案件关联人 +// caseAffiliateMapper.batchCaseAffiliate(caseAffiliates); +// } +// +// List caseAttachList = caseApplication.getCaseAttachList(); +// // 是否是压缩包导入,压缩包导入则不更新附件 +// boolean isZipImport = caseApplication.getImportFlag() == null || caseApplication.getImportFlag() != 2; +// if (caseAttachList != null && caseAttachList.size() > 0 ) { +// if(isZipImport) { +// for (CaseAttach caseAttach : caseAttachList) { +// caseAttach.setCaseAppliId(caseApplication.getId()); +// // 修改案件附件 +// caseAttachMapper.updateCaseAttach(caseAttach); +// } +// }else { +// // 压缩包导入 +// for (CaseAttach caseAttach : caseAttachList) { +// caseAttach.setCaseAppliId(caseApplication.getId()); +// } +// caseAttachMapper.batchSave(caseAttachList); +// } +// } +// // 新增日志 +// insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, ""); +// // 异步新增案件日志 +// +// ThreadPoolUtil.execute(() -> { +// // 批量新增columnValue自定义字段 +// if(CollectionUtil.isNotEmpty(columnValueList)) { +// columnValueList.forEach(columnValue -> columnValue.setCaseId(caseApplication.getId())); +// columnValueMapper.batchSave(columnValueList); +// } +// // 新增案件日志表 +// caseApplication.setCaseAppliId(caseApplication.getId()); +// caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode()); +// caseApplication.setCaseLogId(IdWorkerUtil.getId()); +// int insertRow = caseApplicationLogMapper.insert(caseApplication); +// // 插入案件相关人员表日志 +// if (insertRow != 0 && CollectionUtil.isNotEmpty(caseAffiliates)) { +// caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getCaseLogId())); +// +// caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates); +// } +// // 插入附件表日志 +// if (CollectionUtil.isNotEmpty(caseAttachList)) { +// List filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList()); +// // 插入日志附件表 +// if (CollectionUtil.isNotEmpty(filterList)) { +// for (CaseAttach caseAttach : filterList) { +// // 查询附件表 +// CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId()); +// attach.setCaseAppliLogId(caseApplication.getCaseLogId()); +// caseAttachLogMapper.save(attach); +// } +// } +// +// } +// // 插入columnValueLog自定义字段日志表 +// if (CollectionUtil.isNotEmpty(columnValueList)) { +// columnValueList.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getCaseLogId())); +// columnValueLogMapper.batchSave(columnValueList); +// +// } +// +// +// }); +// +// return rows; +// } - } - // 组装申请代理人信息 - String agentInfoFlag = buildAgentInfo(caseAffiliate, roleId); - if (StrUtil.isNotEmpty(agentInfoFlag)) { - throw new ServiceException(agentInfoFlag); - } - } - } - // 新增案件关联人 - caseAffiliateMapper.batchCaseAffiliate(caseAffiliates); - } + /** + * 新增案件 + * + * @param caseApplication + * @return + */ +// @Override +// @Transactional +// public int insertcaseApplication1(CaseApplication caseApplication) { +// Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); +// caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); +// //根据仲裁费用计费规则计算应缴费用 +// //暂时设置计费比率为0.01 +// BigDecimal feeRate = new BigDecimal(0.01); +// BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP); +// caseApplication.setFeePayable(feePayable); +// // 获取自动编码 +// String caseNum = generateCaseNum(); +// caseApplication.setCaseNum(caseNum); +// +// caseApplication.setCreateBy(getUsername()); +// caseApplication.setVersion(1); +// caseApplication.setId(IdWorkerUtil.getId()); +// // 新增立案信息 +// int rows = caseApplicationMapper.insertCaseApplication(caseApplication); +// if (rows == 0) { +// return rows; +// } +// List caseAffiliates = caseApplication.getCaseAffiliates(); +// Map deptMap = new HashMap<>(); +// // 判断申请机构 +// if (caseAffiliates != null && caseAffiliates.size() > 0) { +// // 查询所有的组织机构,组装成map +// List deptList = sysDeptMapper.selectDeptList(new SysDept()); +// if (CollectionUtil.isEmpty(deptList)) { +// deptList = new ArrayList<>(); +// } +// deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV)); +// // 查询申请人角色id +// Long roleId = roleMapper.selectRoleIdByName("申请人"); +// for (CaseAffiliate caseAffiliate : caseAffiliates) { +// caseAffiliate.setCaseAppliId(caseApplication.getId()); +// // caseAffiliate.setCaseAppliLogId(caseApplication.getId()); +// if (caseAffiliate.getIdentityType() == 1 && StrUtil.isNotEmpty(caseAffiliate.getName())) { +// // 将组织机构id设为申请人名称 +// if (deptMap.containsKey(caseAffiliate.getName())) { +// caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseAffiliate.getName()))); +// caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); +// } else { +// // 如果不存在则新增 +// SysDept dept = new SysDept(); +// dept.setParentId(0L); +// dept.setDeptName(caseAffiliate.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.setApplicationOrganId(String.valueOf(dept.getDeptId())); +// caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); +// +// } +// // 组装申请代理人信息 +// String agentInfoFlag = buildAgentInfo(caseAffiliate, roleId); +// if (StrUtil.isNotEmpty(agentInfoFlag)) { +// throw new ServiceException(agentInfoFlag); +// } +// } +// } +// // 新增案件关联人 +// caseAffiliateMapper.batchCaseAffiliate(caseAffiliates); +// } +// +// List caseAttachList = caseApplication.getCaseAttachList(); +// if (caseAttachList != null && caseAttachList.size() > 0 ) { +// for (CaseAttach caseAttach : caseAttachList) { +// caseAttach.setCaseAppliId(caseApplication.getId()); +// } +// caseAttachMapper.batchSave(caseAttachList); +// } +// // 新增日志 +// insertCaseLog(caseApplication.getId(), currentStatus, ""); +// +// // 新增案件日志表 +// caseApplication.setCaseAppliId(caseApplication.getId()); +// caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode()); +// caseApplication.setCaseLogId(IdWorkerUtil.getId()); +// int insertRow = caseApplicationLogMapper.insert(caseApplication); +// // 插入案件相关人员表日志 +// if (insertRow != 0 && CollectionUtil.isNotEmpty(caseAffiliates)) { +// caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getCaseLogId())); +// +// caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates); +// } +// // 插入附件表日志 +// if (CollectionUtil.isNotEmpty(caseAttachList)) { +// List filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList()); +// // 插入日志附件表 +// if (CollectionUtil.isNotEmpty(filterList)) { +// for (CaseAttach caseAttach : filterList) { +// // 查询附件表 +// CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId()); +// attach.setCaseAppliLogId(caseApplication.getCaseLogId()); +// caseAttachLogMapper.save(attach); +// } +// } +// +// } +// +// return rows; +// } - List caseAttachList = caseApplication.getCaseAttachList(); - // 是否是压缩包导入,压缩包导入则不更新附件 - boolean isZipImport = caseApplication.getImportFlag() == null || caseApplication.getImportFlag() != 2; - if (caseAttachList != null && caseAttachList.size() > 0 ) { - if(isZipImport) { - for (CaseAttach caseAttach : caseAttachList) { - caseAttach.setCaseAppliId(caseApplication.getId()); - // 修改案件附件 - caseAttachMapper.updateCaseAttach(caseAttach); - } - }else { - // 压缩包导入 - for (CaseAttach caseAttach : caseAttachList) { - caseAttach.setCaseAppliId(caseApplication.getId()); - } - caseAttachMapper.batchSave(caseAttachList); - } - } - // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, ""); - // 异步新增案件日志 - - ThreadPoolUtil.execute(() -> { - // 批量新增columnValue自定义字段 - if(CollectionUtil.isNotEmpty(columnValueList)) { - columnValueList.forEach(columnValue -> columnValue.setCaseId(caseApplication.getId())); - columnValueMapper.batchSave(columnValueList); - } - // 新增案件日志表 - caseApplication.setCaseAppliId(caseApplication.getId()); - caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode()); - caseApplication.setCaseLogId(IdWorkerUtil.getId()); - int insertRow = caseApplicationLogMapper.insert(caseApplication); - // 插入案件相关人员表日志 - if (insertRow != 0 && CollectionUtil.isNotEmpty(caseAffiliates)) { - caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getCaseLogId())); - - caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates); - } - // 插入附件表日志 - if (CollectionUtil.isNotEmpty(caseAttachList)) { - List filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList()); - // 插入日志附件表 - if (CollectionUtil.isNotEmpty(filterList)) { - for (CaseAttach caseAttach : filterList) { - // 查询附件表 - CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId()); - attach.setCaseAppliLogId(caseApplication.getCaseLogId()); - caseAttachLogMapper.save(attach); - } - } - - } - // 插入columnValueLog自定义字段日志表 - if (CollectionUtil.isNotEmpty(columnValueList)) { - columnValueList.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getCaseLogId())); - columnValueLogMapper.batchSave(columnValueList); - - } - - - }); - - return rows; - } /** * 获取自动编码 @@ -1061,7 +1009,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if (null == maxCaseNum) { caseNum = caseNum + "001"; } else { - maxCaseNum=maxCaseNum+1; + maxCaseNum = maxCaseNum + 1; caseNum = caseNum + String.format("%03d", maxCaseNum); } return caseNum; @@ -1073,241 +1021,148 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return caseApplicationMapper.selectCaseApplicationCount(caseApplication); } - @Override - @Transactional - public AjaxResult editCaseApplication(CaseApplication caseApplication) { - //根据仲裁费用计费规则计算应缴费用 - //暂时设置计费比率为0.01 - BigDecimal feeRate = new BigDecimal("0.01"); - BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, RoundingMode.HALF_UP); - caseApplication.setFeePayable(feePayable); - caseApplication.setUpdateBy(getUsername()); - Integer applicantIsWrittenHear = caseApplication.getApplicantIsWrittenHear(); - if(applicantIsWrittenHear.intValue()==1){ - //书面审理 - caseApplication.setArbitratMethod(2); - }else { - //开庭审理 - caseApplication.setArbitratMethod(1); - } - - // 立案申请状态直接修改主表信息 - if (caseApplication.getCaseStatus() != null && caseApplication.getCaseStatus().equals(CaseApplicationConstants.CASE_APPLICATION)) { - // 修改内置字段 - caseApplicationMapper.updataCaseApplication(caseApplication); - if(CollectionUtil.isNotEmpty(caseApplication.getColumnValues())) { - // 修改自定义字段 - for (ColumnValue columnValue : caseApplication.getColumnValues()) { - columnValueMapper.updateColumnValue(columnValue); - } - } - // 修改记录表状态为同意提交修改的内容 - caseApplication.setUpdateSubmitStatus(0); - } else { - // 修改记录表状态为已提交修改的内容 - caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.COMMITTED.getCode()); - } - List caseAffiliates = caseApplication.getCaseAffiliates(); - if (caseAffiliates != null && caseAffiliates.size() > 0) { - // 查询所有的组织机构,组装成map - List deptList = sysDeptMapper.selectDeptList(new SysDept()); - if (CollectionUtil.isEmpty(deptList)) { - deptList = new ArrayList<>(); - } - Map deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV)); - // 查询申请人角色id - Long roleId = roleMapper.selectRoleIdByName("申请人"); - for (CaseAffiliate caseAffiliate : caseAffiliates) { - caseAffiliate.setCaseAppliId(caseApplication.getId()); - if (caseAffiliate.getIdentityType() == 1 && StrUtil.isNotEmpty(caseAffiliate.getName())) { - // 将组织机构id设为申请人名称 - if (deptMap.containsKey(caseAffiliate.getName())) { - caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); - caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseAffiliate.getName()))); - } else { - // 如果不存在则新增 - SysDept dept = new SysDept(); - dept.setParentId(0L); - dept.setDeptName(caseAffiliate.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.setApplicationOrganName(caseAffiliate.getName()); - caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId())); - - } - String agentInfoFlag = buildAgentInfo(caseAffiliate, roleId); - if (StrUtil.isNotEmpty(agentInfoFlag)) { - throw new ServiceException(agentInfoFlag); - } - - } - // 立案申请状态直接修改主表信息 - if (caseApplication.getCaseStatus() != null && caseApplication.getCaseStatus().equals(CaseApplicationConstants.CASE_APPLICATION)) { - - caseAffiliateMapper.updataCaseAffiliate(caseAffiliate); - } - } - - } - List caseAttachList = caseApplication.getCaseAttachList(); - // 立案申请状态直接修改主表信息 - if (caseAttachList != null && caseAttachList.size() > 0 - && caseApplication.getCaseStatus() != null && caseApplication.getCaseStatus().equals(CaseApplicationConstants.CASE_APPLICATION)) { - List filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList()); - if (CollectionUtil.isNotEmpty(filterList)) { - for (CaseAttach caseAttach : caseAttachList) { - caseAttach.setCaseAppliId(caseApplication.getId()); - caseAttachMapper.updateCaseAttach(caseAttach); - } - } - - } - // 根据案件id查询最新版本号 - Integer maxVersion = caseApplicationLogMapper.selectMaxVersionByCaseId(caseApplication.getId()); - if (maxVersion == null) { - maxVersion = 1; - } - caseApplication.setVersion(maxVersion + 1); - // 异步新增案件日志 - ThreadPoolUtil.execute(() -> { - try { - caseApplication.setCaseAppliId(caseApplication.getId()); - caseApplication.setCaseLogId(IdWorkerUtil.getId()); - int insertRow = caseApplicationLogMapper.insert(caseApplication); - if (insertRow != 0) { - if (CollectionUtil.isNotEmpty(caseAffiliates)) { - caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getCaseLogId())); - // 插入案件日志人员相关表 - caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates); - } - if (CollectionUtil.isNotEmpty(caseAttachList)) { - List filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList()); - // 插入日志附件表 - if (CollectionUtil.isNotEmpty(filterList)) { - for (CaseAttach caseAttach : filterList) { - // 查询附件表 - CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId()); - attach.setCaseAppliLogId(caseApplication.getCaseLogId()); - caseAttachLogMapper.save(attach); - } - } - - } - // 插入案件columnValueLog自定义字段表 - if (CollectionUtil.isNotEmpty(caseApplication.getColumnValues())) { - caseApplication.getColumnValues().forEach(columnValue -> columnValue.setCaseAppliLogId(caseApplication.getCaseLogId())); - - columnValueLogMapper.batchSave(caseApplication.getColumnValues()); - } - } - } catch (Exception e) { - throw new RuntimeException(e); - } - }); - - return success(); - } +// @Override +// @Transactional +// public AjaxResult editCaseApplication(CaseApplication caseApplication) { +// //根据仲裁费用计费规则计算应缴费用 +// //暂时设置计费比率为0.01 +// BigDecimal feeRate = new BigDecimal("0.01"); +// BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, RoundingMode.HALF_UP); +// caseApplication.setFeePayable(feePayable); +// caseApplication.setUpdateBy(getUsername()); +// // 立案申请状态直接修改主表信息 +// if (caseApplication.getCaseStatus() != null && caseApplication.getCaseStatus().equals(CaseApplicationConstants.CASE_APPLICATION)) { +// // 修改内置字段 +// caseApplicationMapper.updataCaseApplication(caseApplication); +// if(CollectionUtil.isNotEmpty(caseApplication.getColumnValues())) { +// // 修改自定义字段 +// for (ColumnValue columnValue : caseApplication.getColumnValues()) { +// if(StrUtil.isNotEmpty(columnValue.getValue())) { +// columnValueMapper.updateColumnValue(columnValue); +// } +// } +// } +// // 修改记录表状态为同意提交修改的内容 +// caseApplication.setUpdateSubmitStatus(0); +// } else { +// // 修改记录表状态为已提交修改的内容 +// caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.COMMITTED.getCode()); +// } +// List caseAffiliates = caseApplication.getCaseAffiliates(); +// if (caseAffiliates != null && caseAffiliates.size() > 0) { +// // 查询所有的组织机构,组装成map +// List deptList = sysDeptMapper.selectDeptList(new SysDept()); +// if (CollectionUtil.isEmpty(deptList)) { +// deptList = new ArrayList<>(); +// } +// Map deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV)); +// // 查询申请人角色id +// Long roleId = roleMapper.selectRoleIdByName("申请人"); +// for (CaseAffiliate caseAffiliate : caseAffiliates) { +// caseAffiliate.setCaseAppliId(caseApplication.getId()); +// if (caseAffiliate.getIdentityType() == 1 && StrUtil.isNotEmpty(caseAffiliate.getName())) { +// // 将组织机构id设为申请人名称 +// if (deptMap.containsKey(caseAffiliate.getName())) { +// caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); +// caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseAffiliate.getName()))); +// } else { +// // 如果不存在则新增 +// SysDept dept = new SysDept(); +// dept.setParentId(0L); +// dept.setDeptName(caseAffiliate.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.setApplicationOrganName(caseAffiliate.getName()); +// caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId())); +// +// } +// String agentInfoFlag = buildAgentInfo(caseAffiliate, roleId); +// if (StrUtil.isNotEmpty(agentInfoFlag)) { +// throw new ServiceException(agentInfoFlag); +// } +// +// } +// // 立案申请状态直接修改主表信息 +// if (caseApplication.getCaseStatus() != null && caseApplication.getCaseStatus().equals(CaseApplicationConstants.CASE_APPLICATION)) { +// +// caseAffiliateMapper.updataCaseAffiliate(caseAffiliate); +// } +// } +// +// } +// List caseAttachList = caseApplication.getCaseAttachList(); +// // 立案申请状态直接修改主表信息 +// if (caseAttachList != null && caseAttachList.size() > 0 +// && caseApplication.getCaseStatus() != null && caseApplication.getCaseStatus().equals(CaseApplicationConstants.CASE_APPLICATION)) { +// List filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList()); +// if (CollectionUtil.isNotEmpty(filterList)) { +// for (CaseAttach caseAttach : caseAttachList) { +// caseAttach.setCaseAppliId(caseApplication.getId()); +// caseAttachMapper.updateCaseAttach(caseAttach); +// } +// } +// +// } +// // 根据案件id查询最新版本号 +// Integer maxVersion = caseApplicationLogMapper.selectMaxVersionByCaseId(caseApplication.getId()); +// if (maxVersion == null) { +// maxVersion = 1; +// } +// caseApplication.setVersion(maxVersion + 1); +// LoginUser loginUser = getLoginUser(); +// // 异步新增案件日志 +// ThreadPoolUtil.execute(() -> { +// try { +// //新增案件日志记录 +// insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_EDIT, "修改案件信息",loginUser); +// caseApplication.setCaseAppliId(caseApplication.getId()); +// caseApplication.setCaseLogId(IdWorkerUtil.getId()); +// int insertRow = caseApplicationLogMapper.insert(caseApplication); +// if (insertRow != 0) { +// if (CollectionUtil.isNotEmpty(caseAffiliates)) { +// caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getCaseLogId())); +// // 插入案件日志人员相关表 +// caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates); +// } +// if (CollectionUtil.isNotEmpty(caseAttachList)) { +// List filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList()); +// // 插入日志附件表 +// if (CollectionUtil.isNotEmpty(filterList)) { +// for (CaseAttach caseAttach : filterList) { +// // 查询附件表 +// Long annexId = caseAttach.getAnnexId(); +// CaseAttach attach = caseAttachMapper.queryAnnexById(annexId); +// if(attach!=null){ +// attach.setCaseAppliLogId(caseApplication.getCaseLogId()); +// caseAttachLogMapper.save(attach); +// } +// } +// } +// +// } +// // 插入案件columnValueLog自定义字段表 +// if (CollectionUtil.isNotEmpty(caseApplication.getColumnValues())) { +// caseApplication.getColumnValues().forEach(columnValue -> columnValue.setCaseAppliLogId(caseApplication.getCaseLogId())); +// +// columnValueLogMapper.batchSave(caseApplication.getColumnValues()); +// } +// } +// } catch (Exception e) { +// throw new RuntimeException(e); +// } +// }); +// +// return success(); +// } - /** - * 组装申请代理人信息 - * - * @param caseAffiliate - */ - private String buildAgentInfo(CaseAffiliate caseAffiliate, Long roleId) { - if (caseAffiliate.getIdentityType() == 1 && StrUtil.isNotEmpty(caseAffiliate.getNameAgent())) { - - // 组装申请机构代理人信息,用户表新增并且和部门关联 - // 根据代理人手机号去用户表查询,有修改,么有新增 - SysUser agentUser = sysUserMapper.selectUserByPhone(caseAffiliate.getContactTelphoneAgent()); - if (agentUser == null) { - agentUser = new SysUser(); - agentUser.setIdCard(caseAffiliate.getIdentityNumAgent()); - agentUser.setNickName(caseAffiliate.getNameAgent()); - agentUser.setUserName(caseAffiliate.getContactTelphoneAgent()); - agentUser.setPhonenumber(caseAffiliate.getContactTelphoneAgent()); - agentUser.setPassword(SecurityUtils.encryptPassword("abc123456")); - agentUser.setDeptId(Long.valueOf(caseAffiliate.getApplicationOrganId())); - int insertUserRow = sysUserMapper.insertUser(agentUser); - // 新增角色为申请人 - ArrayList sysUserRoles = new ArrayList<>(); - SysUserRole sysUserRole = new SysUserRole(); - sysUserRole.setUserId(agentUser.getUserId()); - sysUserRole.setRoleId(roleId); - sysUserRoles.add(sysUserRole); - if (CollectionUtil.isNotEmpty(sysUserRoles)) { - userRoleMapper.batchUserRole(sysUserRoles); - } - if (insertUserRow > 0) { - caseAffiliate.setApplicantAgentUserId(String.valueOf(agentUser.getUserId())); - // 尊敬的{1},您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信 - SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - request.setCaseId(caseAffiliate.getCaseAppliId()); - request.setTemplateId("1956159"); - request.setPhone(agentUser.getPhonenumber()); - request.setTemplateParamSet(new String[]{agentUser.getNickName()}); - Boolean aBoolean = SmsUtils.sendSms(request); - - //保存短信发送记录 - SmsSendRecord smsSendRecord = new SmsSendRecord(); - smsSendRecord.setCaseId(caseAffiliate.getCaseAppliId()); - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(caseAffiliate.getCaseAppliId()); - caseApplication = caseApplicationMapper.selectCaseApplication(caseApplication); - smsSendRecord.setCaseNum(caseApplication.getCaseNum()); - smsSendRecord.setPhone(request.getPhone()); - smsSendRecord.setSendTime(new Date()); - String content = "尊敬的" + agentUser.getNickName() + ",您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信"; - smsSendRecord.setSendContent(content); - smsSendRecord.setCreateBy(getUsername()); - if (aBoolean) { - smsSendRecord.setSendStatus(1); - } else { - smsSendRecord.setSendStatus(0); - } - smsRecordMapper.saveSmsSendRecord(smsSendRecord); - } - } else if (null != agentUser.getDeptId() && !String.valueOf(agentUser.getDeptId()).equals(caseAffiliate.getApplicationOrganId())) { -// return "该申请代理人已在"+agentUser.getDeptName()+"申请机构下存在,请检查填写信息是否正确"; - if (null != agentUser.getDept() && StrUtil.isNotEmpty(agentUser.getDept().getDeptName())) { - return "该申请代理人已在【" + agentUser.getDept().getDeptName() + "】申请机构下存在,请检查填写信息是否正确"; - } else { - return "该申请代理人已存在,与申请机构不匹配,请检查填写信息是否正确"; - } - } else if (null != agentUser.getDeptId() && String.valueOf(agentUser.getDeptId()).equals(caseAffiliate.getApplicationOrganId())) { - // 同步用户表和案件关联人表的手机号和名称 - caseAffiliate.setContactTelphoneAgent(agentUser.getPhonenumber()); - caseAffiliate.setNameAgent(agentUser.getNickName()); - caseAffiliate.setApplicantAgentUserId(String.valueOf(agentUser.getUserId())); - if(StrUtil.isNotEmpty(agentUser.getIdCard())){ - caseAffiliate.setIdentityNumAgent(agentUser.getIdCard()); - }else { - caseAffiliate.setIdentityNumAgent(caseAffiliate.getIdentityNumAgent()); - } - List longList = new ArrayList<>(); - // 新增角色为申请人 - if (CollectionUtil.isNotEmpty(agentUser.getRoles())) { - longList = agentUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList()); - if (!longList.contains(roleId)) { - insertAgentUserRole(agentUser, roleId); - } - } else { - - insertAgentUserRole(agentUser, roleId); - } - - } - - } - return null; - } /** * 新增角色为申请人 @@ -1329,57 +1184,65 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override @Transactional public int submitCaseApplication(List ids) { + int rows = 0; // 查询案件信息,做必填校验,校验不通过,提示,不能提交 StringBuilder errorMsg = new StringBuilder(); List caseApplications = caseApplicationMapper.listCaseApplicationByIds(ids); - if(CollectionUtil.isNotEmpty(caseApplications)) { + if (CollectionUtil.isNotEmpty(caseApplications)) { Map applicationMap = caseApplications.stream().collect(Collectors.toMap(CaseApplication::getId, Function.identity(), (n1, n2) -> n2)); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliateByCaseIds(ids); + List caseAffiliates = caseAffiliateMapper.selectCaseAffiliateByCaseIds(ids); // 转换为Map>形式 - Map> caseAffiliateMap = caseAffiliates.stream().collect(Collectors.groupingBy(CaseAffiliate::getCaseAppliId)); + Map> caseAffiliateMap = caseAffiliates.stream().collect(Collectors.groupingBy(CaseAffiliateEntity::getCaseAppliId)); for (Long id : ids) { + // Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(id); // 必填校验 CaseApplication caseApplication = applicationMap.get(id); // 基本字段校验 - if(caseApplication!=null) { - for (String baseColumn : baseColumns) { - if(StrUtil.isEmpty( ObjectFieldUtils.getValue(caseApplication, baseColumn))){ - errorMsg.append(baseColumn).append("不能为空,"); - // todo 暂抛出异常,后边改为提示具体的字段 - throw new ServiceException("必填字段未填写,请完善案件信息!"); - } - } - // 校验人员 - if(CollectionUtil.isNotEmpty(caseAffiliates)){ - List affiliateList = caseAffiliateMap.get(id); - if(CollectionUtil.isNotEmpty(affiliateList)){ - for (CaseAffiliate caseAffiliate : affiliateList) { - if(caseAffiliate.getIdentityType()==1){ - // 校验申请人 - for (String applicAffiliateColumn : applicAffiliateColumns) { - if(StrUtil.isEmpty( ObjectFieldUtils.getValue(caseAffiliate, applicAffiliateColumn))){ - errorMsg.append(applicAffiliateColumn).append("不能为空,"); - // todo 暂抛出异常,后边改为提示具体的字段 - throw new ServiceException("必填字段未填写,请完善案件信息!"); - } - } - }else { - // 校验被申请人 - // 校验申请人 - for (String applicAffiliateColumn : dectborAffiliateColumns) { - if(StrUtil.isEmpty( ObjectFieldUtils.getValue(caseAffiliate, applicAffiliateColumn))){ - errorMsg.append(applicAffiliateColumn).append("不能为空,"); - // todo 暂抛出异常,后边改为提示具体的字段 - throw new ServiceException("必填字段未填写,请完善案件信息!"); - } - } - } - } - } - } - } +// if (caseApplication != null) { +// for (String baseColumn : baseColumns) { +// if (StrUtil.isEmpty(ObjectFieldUtils.getValue(caseApplication, baseColumn))) { +// errorMsg.append(baseColumn).append("不能为空,"); +// throw new ServiceException("必填字段未填写,请完善案件信息!"); +// } +// } +// // 校验人员 +// if (CollectionUtil.isNotEmpty(caseAffiliates)) { +// List affiliateList = caseAffiliateMap.get(id); +// if (CollectionUtil.isNotEmpty(affiliateList)) { +// int appCount = 0; +// int resCount = 0; +// for (CaseAffiliateEntity caseAffiliate : affiliateList) { +// if (caseAffiliate.getOperatorFlag() != null && caseAffiliate.getOperatorFlag().equals(1) && caseAffiliate.getRoleType() != null && (caseAffiliate.getRoleType().equals(1) || caseAffiliate.getRoleType().equals(2))) { +// appCount++; +// // 校验申请人 +// for (String applicAffiliateColumn : applicAffiliateColumns) { +// if (StrUtil.isEmpty(ObjectFieldUtils.getValue(caseAffiliate, applicAffiliateColumn))) { +// errorMsg.append(applicAffiliateColumn).append("不能为空,"); +// throw new ServiceException("必填字段未填写,请完善案件信息!"); +// } +// } +// } else if (caseAffiliate.getOperatorFlag() != null && caseAffiliate.getOperatorFlag().equals(1) && caseAffiliate.getRoleType() != null && (caseAffiliate.getRoleType().equals(3) || caseAffiliate.getRoleType().equals(4))) { +// resCount++; +// // 校验被申请人 +// // 校验申请人 +// for (String applicAffiliateColumn : dectborAffiliateColumns) { +// if (StrUtil.isEmpty(ObjectFieldUtils.getValue(caseAffiliate, applicAffiliateColumn))) { +// errorMsg.append(applicAffiliateColumn).append("不能为空,"); +// throw new ServiceException("必填字段未填写,请完善案件信息!"); +// } +// } +// } +// } +// if (appCount == 0 || resCount == 0) { +// throw new ServiceException("必填字段未填写,请完善案件信息!"); +// } +// } +// } +// } else { +// throw new ServiceException("必填字段未填写,请完善案件信息!"); +// } CaseApplication application = new CaseApplication(); application.setId(id); @@ -1387,7 +1250,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { application.setCaseStatus(CaseApplicationConstants.CASE_CHECK); rows += caseApplicationMapper.submitCaseApplication(application); // 新增日志 - insertCaseLog(application.getId(), CaseApplicationConstants.CASE_CHECK, ""); + insertCaseLog(application.getId(), CaseApplicationConstants.CASE_APPLICATION, ""); } } return rows; @@ -1396,16 +1259,26 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override @Transactional public int deletecaseApplicationByIds(List ids) { + // 查出所有的日志id + List logIds = caseApplicationLogMapper.selectLogsByCaseIds(ids); int rows = caseApplicationMapper.batchDeletecaseApplication(ids); - caseAffiliateMapper.batchDeletecaseAffiliate(ids); - // caseApplicationLogMapper.batchDeleteLog(ids); + // 删除日志 + if (CollectionUtil.isNotEmpty(logIds)) { + caseApplicationLogMapper.batchDeleteLog(logIds); + } return rows; } + /** + * 查询详情 + * + * @param caseApplication + * @return + */ @Override public CaseApplication selectCaseApplication(CaseApplication caseApplication) { CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); - if(caseApplicationselect==null){ + if (caseApplicationselect == null) { throw new ServiceException("案件不存在"); } CaseAffiliate caseAffiliate = new CaseAffiliate(); @@ -1422,185 +1295,290 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { List caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication); if (caseAttachList != null && caseAttachList.size() > 0) { for (CaseAttach caseAttach : caseAttachList) { - String annexName = caseAttach.getAnnexName(); - String prefix = "/profile"; - int startIndex = annexName.indexOf(prefix); - if(startIndex!=-1) { - startIndex += prefix.length(); - - String annexPath = "/uploadPath" + annexName.substring(startIndex); - caseAttach.setAnnexPath(annexPath); + String annexPath = caseAttach.getAnnexPath(); + if (StrUtil.isEmpty(annexPath)) { + continue; } - int startIndexnew = annexName.lastIndexOf("/"); - if (startIndexnew != -1) { - String annexNamenew = annexName.substring(startIndexnew + 1); - caseAttach.setAnnexName(annexNamenew); - } - - + caseAttach.setAnnexPath(annexPath); + caseAttach.setAnnexName(caseAttach.getAnnexName()); } } caseApplicationselect.setCaseAttachList(caseAttachList); - List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if (caseAffiliatListeselect != null) { - // 查询组织机构 - List sysDepts = sysDeptMapper.selectDeptList(new SysDept()); - Map deptMap = new HashMap<>(); - if (CollectionUtil.isNotEmpty(sysDepts)) { - for (SysDept sysDept : sysDepts) { - deptMap.put(String.valueOf(sysDept.getDeptId()), sysDept.getDeptName()); - } - } + // 查询案件相关人员 + List msCaseAffiliates = caseApplicationService.selectAfflicatesByCaseId(caseApplication.getId()); + if (CollectionUtil.isNotEmpty(msCaseAffiliates)) { + Map> affliateMap = msCaseAffiliates.stream().collect(Collectors.groupingBy(CaseAffiliateEntity::getGroupOrder, Collectors.toList())); + CaseAffiliateVO affiliateVO = new CaseAffiliateVO(); + List applicantList = new ArrayList<>(); + List resList = new ArrayList<>(); + affiliateVO.setApplicant(applicantList); + affiliateVO.setRes(resList); 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())); + affliateMap.forEach((k, v) -> { + CaseAffiliateBase affiliateBase = null; + + CaseAffiliateBase resBase = null; + + for (CaseAffiliateEntity affiliate : v) { + + switch (affiliate.getRoleType()) { + case 1: + if (affiliateBase == null) { + affiliateBase = new CaseAffiliateBase(); + } + affiliateBase.setApplicant(affiliate); + if (affiliate.getOrganizeFlag() == null || affiliate.getOrganizeFlag() != 1) { + if (StrUtil.isNotEmpty(affiliate.getName()) + && !applicantName.toString().contains(affiliate.getName() + Constants.CN_SPLIT_COMMA)) { + applicantName.append(affiliate.getName()).append(Constants.CN_SPLIT_COMMA); + } + } else { + // 组织机构 + if (StrUtil.isNotEmpty(affiliate.getApplicantOrgName()) + && !applicantName.toString().contains(affiliate.getApplicantOrgName() + Constants.CN_SPLIT_COMMA)) { + applicantName.append(affiliate.getApplicantOrgName()).append(Constants.CN_SPLIT_COMMA); + } + } + break; + case 2: + if (affiliateBase == null) { + affiliateBase = new CaseAffiliateBase(); + } + affiliateBase.setApplicantAgent(affiliate); + break; + case 3: + if (resBase == null) { + resBase = new CaseAffiliateBase(); + } + resBase.setRes(affiliate); + if (affiliate.getOrganizeFlag() == null || affiliate.getOrganizeFlag() != 1) { + if (StrUtil.isNotEmpty(affiliate.getName()) + && !respondentName.toString().contains(affiliate.getName() + Constants.CN_SPLIT_COMMA)) { + + respondentName.append(affiliate.getName()).append(Constants.CN_SPLIT_COMMA); + } + } else { + // 组织机构 + if (StrUtil.isNotEmpty(affiliate.getApplicantOrgName()) && !respondentName.toString().contains(affiliate.getApplicantOrgName() + Constants.CN_SPLIT_COMMA)) { + respondentName.append(affiliate.getApplicantOrgName()).append(Constants.CN_SPLIT_COMMA); + } + } + break; + case 4: + if (resBase == null) { + resBase = new CaseAffiliateBase(); + } + resBase.setResAgent(affiliate); + break; + default: + + break; } - applicantName.append(caseAffiliateselect.getName()).append(","); - ; - } else if (identityType == 2) { - respondentName.append(caseAffiliateselect.getName()).append(","); + + } + if (affiliateBase != null) { + applicantList.add(affiliateBase); + } + if (resBase != null) { + resList.add(resBase); + } + }); + caseApplicationselect.setAffiliate(affiliateVO); + caseApplicationselect.setApplicantName(removeLastComma(applicantName.toString(), Constants.CN_SPLIT_COMMA)); + caseApplicationselect.setRespondentName(removeLastComma(respondentName.toString(), Constants.CN_SPLIT_COMMA)); + } + caseApplicationselect.setArbitrateRecord(arbitrateRecordselect); + if (arbitrateRecordselect != null) { + caseApplicationselect.setPayRejectReason(arbitrateRecordselect.getPayRejectReason()); + // 仲裁员审核驳回原因 + caseApplicationselect.setArbitrateReject(arbitrateRecordselect.getArbitrateReject()); + caseApplicationselect.setDeptorReject(arbitrateRecordselect.getDeptorReject()); + } + // 设置仲裁方式 + Integer caseStatus = caseApplicationselect.getCaseStatus(); + if (caseStatus != null && caseStatus.equals(CaseApplicationConstants.CHECK_ARBITRATION_METHOD)) { + Integer applicantIsWrittenHear = caseApplicationselect.getApplicantIsWrittenHear(); + Integer respondentIsWrittenHear = caseApplicationselect.getRespondentIsWrittenHear(); + if (applicantIsWrittenHear != null && respondentIsWrittenHear != null) { + if (applicantIsWrittenHear.intValue() == respondentIsWrittenHear.intValue()) { + caseApplicationselect.setArbitraMethodIssame(1); + if (applicantIsWrittenHear.intValue() == 1 && respondentIsWrittenHear.intValue() == 1) { + caseApplicationselect.setArbitratMethod(2); + caseApplicationselect.setArbitratMethodName("书面审理"); + } else { + caseApplicationselect.setArbitratMethod(1); + caseApplicationselect.setArbitratMethodName("开庭审理"); + } + + } else { + caseApplicationselect.setArbitraMethodIssame(2); + String applicantarbitratMethod = ""; + String respondentbitratMethod = ""; + if (applicantIsWrittenHear.intValue() == 1) { + applicantarbitratMethod = "书面审理"; + } else { + applicantarbitratMethod = "开庭审理"; + } + if (respondentIsWrittenHear.intValue() == 1) { + respondentbitratMethod = "书面审理"; + } else { + respondentbitratMethod = "开庭审理"; + } + String arbitratMethodIllustrate = "当前案件开庭方式:申请人选择开庭方式为" + applicantarbitratMethod + + "被申请人选择开庭方式为" + respondentbitratMethod + ",请确定开庭方式。"; + caseApplicationselect.setArbitratMethodIllustrate(arbitratMethodIllustrate); } } - caseApplicationselect.setApplicantName(applicantName.toString()); - caseApplicationselect.setRespondentName(respondentName.toString()); - caseApplicationselect.setCaseAffiliates(caseAffiliatListeselect); - caseApplicationselect.setArbitrateRecord(arbitrateRecordselect); } + return caseApplicationselect; } + /** + * 去除字符串末尾特殊字符 + * + * @param input 字符串 + * @param str 去除字符串末尾的特殊字符 + * @return + */ + public String removeLastComma(String input, String str) { + if (StrUtil.isEmpty(input)) { + return input; + } + if (input.endsWith(str)) { + return input.substring(0, input.length() - 1); + } + return input; // 如果没有末尾逗号,则直接返回原字符串 + } + @Override @Transactional public String importCaseApplication(List caseApplicationList, String operName) { - StringBuilder failureMsg = new StringBuilder(); - StringBuilder successMsg = new StringBuilder(); - int successNum = 0; - List caseAffiliateLogList = new ArrayList<>(); - if (caseApplicationList != null && caseApplicationList.size() > 0) { - // 1,查询所有的组织机构,组装成map - List deptList = sysDeptMapper.selectDeptList(new SysDept()); - Map deptMap = new HashMap<>(); - if (CollectionUtil.isNotEmpty(deptList)) { - deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV)); - } - // 查询申请人角色id - Long roleId = roleMapper.selectRoleIdByName("申请人"); - List caseApplicationListinsert = new ArrayList<>(); - for (int i = 0; i < caseApplicationList.size(); i++) { - CaseApplication caseApplication = caseApplicationList.get(i); - CaseImportValid caseImportValid = new CaseImportValid(caseApplication, deptMap); - // 导入校验 - caseImportValid.importValid(caseApplication, deptMap); - // 校验成功的数据 - if (StrUtil.isEmpty(caseApplication.getErrorMsg())) { - //根据仲裁费用计费规则计算应缴费用 - //暂时设置计费比率为0.01 - BigDecimal feeRate = new BigDecimal("0.01"); - BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, RoundingMode.HALF_UP); - caseApplication.setFeePayable(feePayable); - - //赋值CaseApplication的案件关联人信息 - List caseAffiliatesnew = new ArrayList<>(); - // 组装案件关联人信息 - assignmentCaseAffiliates(caseApplication, caseAffiliatesnew, deptMap, roleId); - caseApplication.setImportFlag(1); - caseApplicationListinsert.add(caseApplication); - } else { - // 拼接错误信息 - failureMsg.append("
").append("第").append(i + 2).append("行:").append(caseApplication.getErrorMsg().toString()); - } - } - if (caseApplicationListinsert.size() > 0) { - //对不重复的立案对象集合的立案对象重新组装对应的案件关联人信息 - List caseApplicationNewList = null; - for (int i = 0; i < caseApplicationListinsert.size(); i++) { - caseApplicationNewList = new ArrayList<>(); - CaseApplication caseApplicationinsertDiffer = caseApplicationListinsert.get(i); - // 设置自动编码 - caseApplicationinsertDiffer.setCaseNum(generateCaseNum()); - List caseAffiliatesnew = new ArrayList<>(); - CaseApplication caseApplicationNew = new CaseApplication(); - copyCaseApplication(caseApplicationinsertDiffer, caseApplicationNew); - if (caseApplicationListinsert.size() > 0) { - for (int j = 0; j < caseApplicationListinsert.size(); j++) { - CaseApplication caseApplicationinsert = caseApplicationListinsert.get(j); - - if (StringUtils.isNotEmpty(caseApplicationinsert.getCaseNum()) && - caseApplicationinsert.getCaseNum().equals(caseApplicationinsertDiffer.getCaseNum())) { - - caseAffiliatesnew.addAll(caseApplicationinsert.getCaseAffiliates()); - } - } - caseApplicationNew.setCaseAffiliates(caseAffiliatesnew); - caseApplicationNewList.add(caseApplicationNew); - } - - for (int k = 0; k < caseApplicationNewList.size(); k++) { - CaseApplication caseApplicationItera = caseApplicationNewList.get(k); - // 新增立案信息 - caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); - caseApplicationItera.setCreateBy(getUsername()); - caseApplicationItera.setImportFlag(1); - caseApplicationItera.setId(IdWorkerUtil.getId()); - int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera); - if (rows == 0) { - continue; - } - // 新增日志 - insertCaseLog(caseApplicationItera.getId(), CaseApplicationConstants.CASE_APPLICATION, ""); - - List caseAffiliates = caseApplicationItera.getCaseAffiliates(); - if (caseAffiliates != null && caseAffiliates.size() > 0) { - for (CaseAffiliate caseAffiliate : caseAffiliates) { - caseAffiliate.setCaseAppliId(caseApplicationItera.getId()); - - } - caseAffiliateMapper.batchCaseAffiliate(caseAffiliates); - } - // 新增案件记录 - caseApplicationItera.setCaseAppliId(caseApplicationItera.getId()); - caseApplicationItera.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode()); - caseApplicationItera.setVersion(1); - caseApplicationItera.setCaseLogId(IdWorkerUtil.getId()); - int insertRow = caseApplicationLogMapper.insert(caseApplicationItera); - if (insertRow > 0) { - caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplicationItera.getId())); - caseAffiliateLogList.addAll(caseAffiliates); - } - successNum++; - successMsg.append("
").append(successNum).append("、立案编号 ").append(caseApplicationItera.getCaseNum()).append(" 导入成功"); - } - - - } - - } - // 异步新增案件日志 - ThreadPoolUtil.execute(() -> { - if (CollectionUtil.isNotEmpty(caseAffiliateLogList)) { - // 插入案件日志人员相关表 - caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliateLogList); - } - }); - - - } else { - throw new ServiceException("导入立案申请数据不能为空!"); - } - return successMsg.append(failureMsg).toString(); +// StringBuilder failureMsg = new StringBuilder(); +// StringBuilder successMsg = new StringBuilder(); +// int successNum = 0; +// List caseAffiliateLogList = new ArrayList<>(); +// if (caseApplicationList != null && caseApplicationList.size() > 0) { +// // 1,查询所有的组织机构,组装成map +// List deptList = sysDeptMapper.selectDeptList(new SysDept()); +// Map deptMap = new HashMap<>(); +// if (CollectionUtil.isNotEmpty(deptList)) { +// deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV)); +// } +// // 查询申请人角色id +// Long roleId = roleMapper.selectRoleIdByName("申请人"); +// List caseApplicationListinsert = new ArrayList<>(); +// for (int i = 0; i < caseApplicationList.size(); i++) { +// CaseApplication caseApplication = caseApplicationList.get(i); +// CaseImportValid caseImportValid = new CaseImportValid(caseApplication, deptMap); +// // 导入校验 +// caseImportValid.importValid(caseApplication, deptMap); +// // 校验成功的数据 +// if (StrUtil.isEmpty(caseApplication.getErrorMsg())) { +// //根据仲裁费用计费规则计算应缴费用 +// //暂时设置计费比率为0.01 +// BigDecimal feeRate = new BigDecimal("0.01"); +// BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, RoundingMode.HALF_UP); +// caseApplication.setFeePayable(feePayable); +// +// //赋值CaseApplication的案件关联人信息 +// List caseAffiliatesnew = new ArrayList<>(); +// // 组装案件关联人信息 +// assignmentCaseAffiliates(caseApplication, caseAffiliatesnew, deptMap, roleId); +// caseApplication.setImportFlag(1); +// caseApplicationListinsert.add(caseApplication); +// } else { +// // 拼接错误信息 +// failureMsg.append("
").append("第").append(i + 2).append("行:").append(caseApplication.getErrorMsg().toString()); +// } +// } +// if (caseApplicationListinsert.size() > 0) { +// //对不重复的立案对象集合的立案对象重新组装对应的案件关联人信息 +// List caseApplicationNewList = null; +// for (int i = 0; i < caseApplicationListinsert.size(); i++) { +// caseApplicationNewList = new ArrayList<>(); +// CaseApplication caseApplicationinsertDiffer = caseApplicationListinsert.get(i); +// // 设置自动编码 +// caseApplicationinsertDiffer.setCaseNum(generateCaseNum()); +// List caseAffiliatesnew = new ArrayList<>(); +// CaseApplication caseApplicationNew = new CaseApplication(); +// copyCaseApplication(caseApplicationinsertDiffer, caseApplicationNew); +// if (caseApplicationListinsert.size() > 0) { +// for (int j = 0; j < caseApplicationListinsert.size(); j++) { +// CaseApplication caseApplicationinsert = caseApplicationListinsert.get(j); +// +// if (StringUtils.isNotEmpty(caseApplicationinsert.getCaseNum()) && +// caseApplicationinsert.getCaseNum().equals(caseApplicationinsertDiffer.getCaseNum())) { +// +// caseAffiliatesnew.addAll(caseApplicationinsert.getCaseAffiliates()); +// } +// } +// caseApplicationNew.setCaseAffiliates(caseAffiliatesnew); +// caseApplicationNewList.add(caseApplicationNew); +// } +// +// for (int k = 0; k < caseApplicationNewList.size(); k++) { +// CaseApplication caseApplicationItera = caseApplicationNewList.get(k); +// // 新增立案信息 +// caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); +// caseApplicationItera.setCreateBy(getUsername()); +// caseApplicationItera.setImportFlag(1); +// caseApplicationItera.setId(IdWorkerUtil.getId()); +// int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera); +// if (rows == 0) { +// continue; +// } +// // 新增日志 +// insertCaseLog(caseApplicationItera.getId(), CaseApplicationConstants.CASE_APPLICATION, ""); +// +// List caseAffiliates = caseApplicationItera.getCaseAffiliates(); +// if (caseAffiliates != null && caseAffiliates.size() > 0) { +// for (CaseAffiliate caseAffiliate : caseAffiliates) { +// caseAffiliate.setCaseAppliId(caseApplicationItera.getId()); +// +// } +// caseAffiliateMapper.batchCaseAffiliate(caseAffiliates); +// } +// // 新增案件记录 +// caseApplicationItera.setCaseAppliId(caseApplicationItera.getId()); +// caseApplicationItera.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode()); +// caseApplicationItera.setVersion(1); +// caseApplicationItera.setCaseLogId(IdWorkerUtil.getId()); +// int insertRow = caseApplicationLogMapper.insert(caseApplicationItera); +// if (insertRow > 0) { +// caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplicationItera.getId())); +// caseAffiliateLogList.addAll(caseAffiliates); +// } +// successNum++; +// successMsg.append("
").append(successNum).append("、立案编号 ").append(caseApplicationItera.getCaseNum()).append(" 导入成功"); +// } +// +// +// } +// +// } +// // 异步新增案件日志 +// ThreadPoolUtil.execute(() -> { +// if (CollectionUtil.isNotEmpty(caseAffiliateLogList)) { +// // 插入案件日志人员相关表 +// caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliateLogList); +// } +// }); +// +// +// } else { +// throw new ServiceException("导入立案申请数据不能为空!"); +// } +// return successMsg.append(failureMsg).toString(); + // todo + return null; } - - @Override @Transactional public int pendTral(CaseApplication caseApplication) { @@ -1623,47 +1601,47 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override @Transactional - public int pendTralCheck(CaseApplication caseApplication) { - Integer isAgreePendTral = caseApplication.getIsAgreePendTral(); - caseApplication.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); - int rows = 0; - //同意组庭 - if (isAgreePendTral != null && isAgreePendTral == 1) { - rows = caseApplicationMapper.submitCaseApplication(caseApplication); - } else { - List arbitrators = caseApplication.getArbitrators(); - // 仲裁员信息 - if (arbitrators != null && arbitrators.size() > 0) { - List ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList()); - List 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); - rows = caseApplicationMapper.submitCaseApplication(caseApplication); + public AjaxResult pendTralCheck(CaseApplication caseApplication) { + CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); + if (caseApplicationselect == null) { + throw new ServiceException("案件不存在"); + } + // Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); + for (Arbitrator arbitrator : caseApplication.getArbitrators()) { + + caseApplication.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); + + if (arbitrator.getId() == null || StrUtil.isEmpty(arbitrator.getArbitratorName())) { + return AjaxResult.warn("请选择仲裁员"); } + caseApplication.setArbitratorId(String.valueOf(arbitrator.getId())); + caseApplication.setArbitratorName(arbitrator.getArbitratorName()); + caseApplication.setLockStatus(1); + caseApplicationMapper.submitCaseApplication(caseApplication); } // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL, ""); - return rows; + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL_SUBMMIT, ""); + return success(); } @Override @Transactional public int verificationArbitrateRecord(CaseApplication caseApplication) { - // 秘书核验裁决书,流转到待仲裁员审核仲裁文书 - caseApplication.setCaseStatus(CaseApplicationConstants.HEAD_CHECK_ARBITRATION); + // Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); + // 秘书核验裁决书,流转到待仲裁员审核裁决书 + caseApplication.setCaseStatus(HEAD_CHECK_ARBITRATION); int rows = caseApplicationMapper.submitCaseApplication(caseApplication); ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.HEAD_CHECK_ARBITRATION, ""); + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, ""); return rows; } /** * 部门长审核裁决书 + * * @param caseApplication * @return */ @@ -1671,10 +1649,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Transactional public AjaxResult checkArbitrateRecord(CaseApplication caseApplication) { int rows = 0; + // Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck(); - if (agreeOrNotCheck.intValue() == 1) {//同意审核 + if (agreeOrNotCheck != null && agreeOrNotCheck.intValue() == 1) {//同意审核 try { //获取当前案件的裁决书 CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplication); @@ -1683,7 +1662,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { for (CaseAttach caseAttach : caseAttachList) { if (caseAttach.getAnnexType() == 3) { String annexPath = caseAttach.getAnnexPath(); - String path = "/home/ruoyi" + annexPath; + if (StrUtil.isEmpty(annexPath)) { + throw new ServiceException("文件找不到"); + } + String path = annexPath.replace("/profile/", "/home/ruoyi/uploadPath/"); // System.out.println("这是查询到的裁决书路径" + path); // String path = "D:\\home\\新裁决书模板.docx"; //获取文件上传地址 @@ -1716,7 +1698,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //发起签署 sealSignRecord.setFilename(fileName); String arbitratorId = caseApplication2.getArbitratorId(); - if (arbitratorId != null) { + if (StringUtils.isNotEmpty(arbitratorId)) { SysUser sysUser = sysUserMapper.selectUserById(Long.valueOf(arbitratorId)); if (sysUser == null) { return AjaxResult.error(); @@ -1812,7 +1794,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { for (SealManage manage : selectSealList) { Integer sealStatus = manage.getSealStatus(); Integer isUse = manage.getIsUse(); - if (sealStatus == 1 && isUse ==1) { + if (sealStatus == 1 && isUse == 1) { sealIdList.add(manage.getSealId()); } } @@ -1856,17 +1838,17 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } caseApplication.setCaseStatus(CaseApplicationConstants.SIGN_ARBITRATION); // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.SIGN_ARBITRATION, ""); + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION, ""); rows = caseApplicationMapper.submitCaseApplication(caseApplication); } else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核 - caseApplication.setCaseStatus(CaseApplicationConstants.HEAD_CHECK_ARBITRATION); - String notes=""; - if(caseApplication.getArbitrateRecord()!=null&&StrUtil.isNotEmpty(caseApplication.getArbitrateRecord().getDeptorReject())){ - notes="部门长驳回仲裁文书,驳回原因:"+caseApplication.getArbitrateRecord().getDeptorReject(); + caseApplication.setCaseStatus(HEAD_CHECK_ARBITRATION); + String notes = ""; + if (caseApplication.getArbitrateRecord() != null && StrUtil.isNotEmpty(caseApplication.getArbitrateRecord().getDeptorReject())) { + notes = "驳回裁决书,驳回原因:" + caseApplication.getArbitrateRecord().getDeptorReject(); } // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.HEAD_CHECK_ARBITRATION, notes); + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION, notes); rows = caseApplicationMapper.submitCaseApplication(caseApplication); } @@ -1876,13 +1858,15 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { /** * 仲裁员审核裁决书 + * * @param caseApplication * @return */ @Override @Transactional public AjaxResult arbitratorCheckArbitrateRecord(CaseApplication caseApplication) { - // 同意后状态改为待部门长审核仲裁文书(CHECK_ARBITRATION = 12),拒绝改为待秘书核验仲裁文书(VERPRIF_ARBITRATION = 11) + // Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); + // 同意后状态改为待部门长审核裁决书(CHECK_ARBITRATION = 12),拒绝改为待秘书核验裁决书(VERPRIF_ARBITRATION = 11) int rows = 0; Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck(); if (agreeOrNotCheck.intValue() == 1) { @@ -1890,150 +1874,80 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { rows = caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION, ""); + insertCaseLog(caseApplication.getId(), HEAD_CHECK_ARBITRATION, ""); } else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核 ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); - if(arbitrateRecord.getId()!=null){ + if (arbitrateRecord.getId() != null) { arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); - }else { + } else { arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecord); } caseApplication.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION); rows = caseApplicationMapper.submitCaseApplication(caseApplication); - String notes=""; - if(caseApplication.getArbitrateRecord()!=null&&StrUtil.isNotEmpty(caseApplication.getArbitrateRecord().getArbitrateReject())){ - notes="仲裁员驳回仲裁文书,驳回原因:"+caseApplication.getArbitrateRecord().getArbitrateReject(); + String notes = ""; + if (caseApplication.getArbitrateRecord() != null && StrUtil.isNotEmpty(caseApplication.getArbitrateRecord().getArbitrateReject())) { + notes = "仲裁员驳回裁决书,驳回原因:" + caseApplication.getArbitrateRecord().getArbitrateReject(); } // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, notes); + insertCaseLog(caseApplication.getId(), HEAD_CHECK_ARBITRATION, notes); } return success(); } - @Override @Transactional - public int submitCaseApplicationCheck(List ids, Integer agreeOrNotCheck,String caseCheckReject) { + public int submitCaseApplicationCheck(List ids, Integer agreeOrNotCheck, String caseCheckReject) { //提交立案审查 int rows = 0; for (Long id : ids) { - String notes=""; + // Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(id); + String notes = ""; CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(id); caseApplication.setAgreeOrNotCheck(agreeOrNotCheck); if (agreeOrNotCheck == 1) {//同意审核 caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT); rows += caseApplicationMapper.submitCaseApplication(caseApplication); + } else if (agreeOrNotCheck == 2) {//拒绝审核 - notes="驳回立案申请,驳回原因:"+caseCheckReject; + notes = "驳回立案申请,驳回原因:" + caseCheckReject; caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); rows += caseApplicationMapper.submitCaseApplication(caseApplication); + ArbitrateRecord arbitrateRecordsel = new ArbitrateRecord(); arbitrateRecordsel.setCaseAppliId(id); ArbitrateRecord arbitrateRecordnew = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecordsel); - if(arbitrateRecordnew!=null){ + if (arbitrateRecordnew != null) { arbitrateRecordnew.setCaseCheckReject(caseCheckReject); arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecordnew); - }else { + } else { arbitrateRecordsel.setCaseCheckReject(caseCheckReject); arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordsel); } + //查询案件详细信息 + CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); //发短信给申请人 - SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(caseApplication.getId()); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if (caseAffiliates != null && caseAffiliates.size() > 0) { - for (CaseAffiliate affiliate : caseAffiliates) { - //获取身份类型 - int identityType = affiliate.getIdentityType(); - //查询案件详细信息 - CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); + List affiliates = selectAfflicatesByCaseId(id); + if (affiliates != null && affiliates.size() > 0) { + // 申请操作人 + Optional applicantAffiliateOpt = affiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))).findFirst(); + if (applicantAffiliateOpt.isPresent() && StrUtil.isNotEmpty(applicantAffiliateOpt.get().getPhone())) { + + CaseAffiliateEntity affiliate = applicantAffiliateOpt.get(); String caseName = "仲裁"; - String caseNum = caseApplication1.getCaseNum(); - - if (identityType == 1) { - request.setPhone(affiliate.getContactTelphone()); - request.setTemplateId("2018697"); - String name = affiliate.getName(); - request.setTemplateParamSet(new String[]{name, caseName, caseNum,caseCheckReject}); - Boolean aBoolean = SmsUtils.sendSms(request); - //保存短信发送记录 - SmsSendRecord smsSendRecord = new SmsSendRecord(); - smsSendRecord.setCaseId(caseApplication.getId()); - smsSendRecord.setCaseNum(caseNum); - smsSendRecord.setPhone(request.getPhone()); - smsSendRecord.setSendTime(new Date()); - String content = "尊敬的" + name + "用户,您的" + caseName + "案件" + caseNum + "已拒绝,拒接原因:" + caseCheckReject; - smsSendRecord.setSendContent(content); - smsSendRecord.setCreateBy(getUsername()); - if (aBoolean) { - smsSendRecord.setSendStatus(1); - } else { - smsSendRecord.setSendStatus(0); - } - smsRecordMapper.saveSmsSendRecord(smsSendRecord); - - } + SmsUtils.sendSms(caseApplication1, "2018697",affiliate.getPhone(), new String[]{affiliate.getName(),caseName,caseApplication1.getCaseNum(),caseCheckReject}); } } } // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT, notes); + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_CHECK, notes); } - - return rows; } - @Override - public CaseApplication selectCaseApplicationConfirm(CaseApplication caseApplication) { - CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplicationConfirm(caseApplication); - if (caseApplicationselect == null) { - return caseApplicationselect; - } - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(caseApplication.getId()); - List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if (caseAffiliatListeselect != null) { - - for (int i = 0; i < caseAffiliatListeselect.size(); i++) { - CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i); - int identityType = caseAffiliateselect.getIdentityType(); - if (identityType == 1) { - - caseApplicationselect.setApplicantName(caseAffiliateselect.getApplicationOrganName()); - } - } - - } - caseApplication.setAnnexType(8); - // 查询缴费凭证 - List caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication); - if (caseAttachList != null && caseAttachList.size() > 0) { - for (CaseAttach caseAttach : caseAttachList) { - String annexName = caseAttach.getAnnexName(); - String prefix = "/profile"; - int startIndex = annexName.indexOf(prefix); - startIndex += prefix.length(); - String annexPath = "/uploadPath" + annexName.substring(startIndex); - caseAttach.setAnnexPath(annexPath); - int startIndexnew = annexName.lastIndexOf("/"); - if (startIndexnew != -1) { - String annexNamenew = annexName.substring(startIndexnew + 1); - caseAttach.setAnnexName(annexNamenew); - } - - - } - } - caseApplicationselect.setPayOrderList(caseAttachList); - - return caseApplicationselect; - } /** * 给被申请人发送房间号短信 @@ -2043,65 +1957,37 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { */ @Override public String sendRoomNoMessage(SendRoomNoMessageVO messageVO) { - CaseAffiliate caseAffiliateSelect = new CaseAffiliate(); - caseAffiliateSelect.setCaseAppliId(messageVO.getId()); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliateSelect); - if (CollectionUtil.isEmpty(caseAffiliates)) { - return "申请人、被申请人不存在"; + List afflicates = selectAfflicatesByCaseId(messageVO.getId()); + if (CollectionUtil.isEmpty(afflicates)) { + throw new ServiceException("未找到案件相关人员"); } CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(messageVO.getId()); CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); + if (caseApplicationselect == null) { + throw new ServiceException("案件不存在"); + } String returnResult = "短信发送成功"; // 需要申请模板,申请人,被申请人发送短信通知 - SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); String startFormat = ""; String endFormat = ""; // 创建房间短信通知 - String format = "yyyy/MM/dd HH:mm:ss"; // 目标格式 - Date startDate = messageVO.getScheduleStartTime(); - Date endDate = messageVO.getScheduleEndTime(); - SimpleDateFormat sdf = new SimpleDateFormat(format); - if(startDate!=null) { - startFormat = sdf.format(startDate); + String format = "yyyy/MM/dd HH:mm:ss"; // 目标格式 + Date startDate = messageVO.getScheduleStartTime(); + Date endDate = messageVO.getScheduleEndTime(); + SimpleDateFormat sdf = new SimpleDateFormat(format); + if (startDate != null) { + startFormat = sdf.format(startDate); + } + if (endDate != null) { + endFormat = sdf.format(endDate); + } + // 预约会议短信模板 + for (CaseAffiliateEntity affiliate : afflicates) { + if (affiliate.getOperatorFlag() == 1) { + // 操作人发送短信短信 + SmsUtils.sendSms(caseApplicationselect, "1983711", affiliate.getPhone(), new String[]{affiliate.getName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo(), startFormat + "-" + endFormat}); } - if(endDate!=null) { - endFormat = sdf.format(endDate); - } - // 预约会议短信模板 - request.setTemplateId("1983711"); - - - for (CaseAffiliate caseAffiliate : caseAffiliates) { - request.setPhone(caseAffiliate.getContactTelphone()); - request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo() + caseAffiliate.getUserId()}); - String userId = (null == caseAffiliate.getUserId() ? "" : caseAffiliate.getUserId()); - // 1983711 开庭审理预约会议短信通知 尊敬的{1}用户,您的{2}仲裁案件,开庭审理房间号为{3},会议时间为{4},请点击https://txroom.xayunmei.com/#/home, 请知晓,如非本人操作,请忽略本短信。 - request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo() , startFormat + "-" + endFormat}); - - Boolean aBoolean = SmsUtils.sendSms(request); - //保存短信发送记录 - SmsSendRecord smsSendRecord = new SmsSendRecord(); - smsSendRecord.setCaseId(messageVO.getId()); - smsSendRecord.setCaseNum(caseApplicationselect.getCaseNum()); - smsSendRecord.setPhone(request.getPhone()); - smsSendRecord.setSendTime(new Date()); - String content = "尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplicationselect.getCaseNum() + "仲裁案件,开庭审理房间号为" + messageVO.getRoomNo() + "会议时间为" + startFormat + "-" + endFormat + ",请点击https://txroom.xayunmei.com/#/home, 请知晓,如非本人操作,请忽略本短信。"; - smsSendRecord.setSendContent(content); - - String userName; - try { - userName = getUsername(); - } catch (Exception e) { - userName = "admin"; - } - smsSendRecord.setCreateBy(userName); - if (aBoolean) { - smsSendRecord.setSendStatus(1); - } else { - smsSendRecord.setSendStatus(0); - } - smsRecordMapper.saveSmsSendRecord(smsSendRecord); } return returnResult; } @@ -2139,191 +2025,25 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data"); String url = signUrlData.get("url").getAsString(); sealSignRecordReslt.setSealUrl(url); + if (StrUtil.isEmpty(SecurityUtils.getUsername())) { + throw new ServiceException("未获取到当前登录用户"); + } + SysUser sysUser = sysUserMapper.selectUserByUserName(getUsername()); + if (sysUser == null) { + throw new ServiceException("未获取到当前登录用户"); + } + CaseLogRecord operLog = new CaseLogRecord(); + operLog.setCreateNickName(sysUser.getNickName()); + operLog.setCaseNode(14); + operLog.setCreateBy(sysUser.getUserName()); + operLog.setCaseAppliId(caseApplication.getId()); + operLog.setCaseNodeName("待用印"); + operLog.setCreateTime(new Date()); + caseLogRecordMapper.insertCaseLogRecord(operLog); } return sealSignRecordReslt; } - @Override - @Transactional - public AjaxResult creatTrialRecord(ArbitrateRecord arbitrateRecordselect) { - //生成仲裁结果 - CaseApplication caseApplicationselect = new CaseApplication(); - caseApplicationselect.setId(arbitrateRecordselect.getCaseAppliId()); - CaseApplication caseApplication = caseApplicationMapper.selectCaseApplication(caseApplicationselect); - String createBy = caseApplication.getCreateBy(); - if (createBy != null) { - arbitrateRecordselect.setCreateBy(createBy); - } - // - CaseApplication caseApplicationupdate = new CaseApplication(); - caseApplicationupdate.setId(arbitrateRecordselect.getCaseAppliId()); - caseApplicationupdate.setIsAbsence(arbitrateRecordselect.getIsAbsence()); - caseApplicationupdate.setAppliIsAbsen(arbitrateRecordselect.getAppliIsAbsen()); - caseApplicationupdate.setRespondentOpinion(arbitrateRecordselect.getRespondentOpinion()); - caseApplicationupdate.setApplicantOpinion(arbitrateRecordselect.getApplicantOpinion()); - caseApplicationupdate.setCaseFacts(arbitrateRecordselect.getCaseFacts()); - caseApplicationupdate.setCaseFocus(arbitrateRecordselect.getCaseFocus()); - caseApplicationMapper.submitCaseApplication(caseApplicationupdate); - - //先判断案件是否已经提交过仲裁结果 - ArbitrateRecord arbitrateRecordsele = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecordselect); - if (arbitrateRecordsele != null) { - int i = arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecordselect); - if (i > 0) { - //案件日志表里添加数据 - CaseLogRecord caseLogRecord = new CaseLogRecord(); - caseLogRecord.setCaseAppliId(caseApplication.getId()); - caseLogRecord.setCaseNode(caseApplication.getCaseStatus()); - if (createBy != null) { - caseLogRecord.setCreateBy(createBy); - } - caseLogRecordMapper.insertCaseLogRecord(caseLogRecord); - - // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, ""); - - - } - } else { - //提交仲裁结果 - int i = arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordselect); - - if (i > 0) { - //案件日志表里添加数据 - CaseLogRecord caseLogRecord = new CaseLogRecord(); - caseLogRecord.setCaseAppliId(caseApplication.getId()); - caseLogRecord.setCaseNode(caseApplication.getCaseStatus()); - if (createBy != null) { - caseLogRecord.setCreateBy(createBy); - } - caseLogRecordMapper.insertCaseLogRecord(caseLogRecord); - - // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, ""); - - } - } - - //生成庭审笔录 - try { - Map datas = new HashMap<>(); - Long id = caseApplication.getId(); - if (id == null) { - return null; - } - - //获取仲裁记录表里的相关信息 - ArbitrateRecord arbitrateRecord = new ArbitrateRecord(); - arbitrateRecord.setCaseAppliId(id); - ArbitrateRecord arbitrateRecord1 = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord); - - //获取案件关联人信息 - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(id); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if (caseAffiliates != null && caseAffiliates.size() > 0) { - for (CaseAffiliate affiliate : caseAffiliates) { - //获取身份类型 - int identityType = affiliate.getIdentityType(); - if (identityType == 1) { //申请人 - datas.put("appName", affiliate.getName()); - datas.put("appIDNo", affiliate.getIdentityNum()); - datas.put("appAddress", affiliate.getContactAddress()); - datas.put("appAgentName", affiliate.getNameAgent()); - datas.put("appAgentIDNo", affiliate.getIdentityNumAgent()); - } else if (identityType == 2) { //被申请人 - datas.put("resName", affiliate.getName()); - datas.put("resIDNo", affiliate.getIdentityNum()); - datas.put("resAddress", affiliate.getContactAddress()); - datas.put("resAgentName", affiliate.getNameAgent()); - datas.put("resAgentIDNo", affiliate.getIdentityNumAgent()); - } - } - } - String arbitratorName = caseApplication.getArbitratorName(); - datas.put("caseName", caseApplication.getCaseName()); - datas.put("caseNum", caseApplication.getCaseNum()); - datas.put("arbitratorName", arbitratorName); - Date hearDate = caseApplication.getHearDate(); - if (hearDate != null) { - LocalDate localDate = hearDate.toInstant() - .atZone(ZoneId.systemDefault()) - .toLocalDate(); - datas.put("hearYear", localDate.getYear()); - datas.put("hearMonths", localDate.getMonthValue()); - datas.put("hearDay", localDate.getDayOfMonth()); - } else { - datas.put("hearYear", null); - datas.put("hearMonths", null); - datas.put("hearDay", null); - } - datas.put("appArbitrationClaims", caseApplication.getArbitratClaims()); - datas.put("evidenDetermi", "认定为申请人证据充足"); - datas.put("factDetermi", "被申请人欠款属实"); - datas.put("caseSketch", "申请人所求通过"); - datas.put("arbitrateThink", "被申请人应按约定还款"); - datas.put("rulingFollows", "被申请人依法偿还申请人欠款"); - datas.put("legalProvisions", "仲裁法"); - LocalDate now = LocalDate.now(); - String year = Integer.toString(now.getYear()); - String month = String.format("%02d", now.getMonthValue()); - String day = String.format("%02d", now.getDayOfMonth()); - datas.put("year", year); - datas.put("months", month); - datas.put("day", day); - String modalFilePath = "/data/arbitrate-document/template/仲裁裁决书模板.docx"; -// String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx"; - String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; -// String saveFolderPath = "D:/data/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth(); - String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx"; - String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; - String resultFilePath = saveFolderPath + "/" + fileName; - // 创建日期目录 - File saveFolder = new File(saveFolderPath); - if (!saveFolder.exists()) { - saveFolder.mkdirs(); - } - Path sourcePath = new File(modalFilePath).toPath(); - Path destinationPath = new File(resultFilePath).toPath(); - Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING); - String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath); - String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8); - -// String savePath = saveFolderPath; -// saveName = fileName; - - caseApplication.setAnnexType(7); - List caseAttachs = caseAttachMapper.queryCaseAttachList(caseApplication); - if (caseAttachs != null && caseAttachs.size() > 0) { - CaseAttach caseAttach = CaseAttach.builder() - .caseAppliId(id) - .annexName(saveName) - .annexPath(savePath) - .annexType(7) - .build(); - int i = caseAttachMapper.updateCaseAttachBycaseid(caseAttach); - - } else { - //将庭审笔录保存到附件表里 - CaseAttach caseAttach = CaseAttach.builder() - .caseAppliId(id) - .annexName(saveName) - .annexPath(savePath) - .annexType(7) - .build(); - int i = caseAttachMapper.save(caseAttach); - - } - - //获取案件详细信息 - CaseApplication caseApplicationSelct = selectCaseApplication(caseApplication); - return success(caseApplicationSelct); - } catch (IOException e) { - e.printStackTrace(); - return AjaxResult.error("生成庭审笔录异常"); - } - - } @Override @Transactional @@ -2344,14 +2064,15 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //提交仲裁结果 int i = arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordselect); } - return success(); + // 生成裁决书 + return adjudicationService.caseJudgment(caseApplicationupdate); } @Override @Transactional public AjaxResult editCaseApplicationDefineval(CaseApplication caseApplication) { - if(CollectionUtil.isNotEmpty(caseApplication.getColumnValues())) { + if (CollectionUtil.isNotEmpty(caseApplication.getColumnValues())) { for (ColumnValue columnValue : caseApplication.getColumnValues()) { columnValueMapper.updateColumnValue(columnValue); } @@ -2364,14 +2085,14 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { public CaseAttach downloadCaseZipFile(CaseApplication caseApplication) { caseApplication.setAnnexType(12); CaseAttach caseAttach = new CaseAttach(); - List caseAttachs = caseAttachMapper.queryCaseAttachList( caseApplication); - if(caseAttachs!=null&&caseAttachs.size()>0){ - caseAttach = caseAttachs.get(0); + List caseAttachs = caseAttachMapper.queryCaseAttachList(caseApplication); + if (caseAttachs != null && caseAttachs.size() > 0) { + caseAttach = caseAttachs.get(0); String annexName = caseAttach.getAnnexName(); String prefix = "/profile"; int startIndex = annexName.indexOf(prefix); - if(startIndex!=-1) { + if (startIndex != -1) { startIndex += prefix.length(); String annexPath = "/uploadPath" + annexName.substring(startIndex); @@ -2383,7 +2104,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAttach.setAnnexName(annexNamenew); } - }else { + } else { CaseApplication caseApplicationsel = new CaseApplication(); caseApplicationsel.setId(caseApplication.getId()); List annexTypeList = new ArrayList<>(); @@ -2395,26 +2116,26 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { annexTypeList.add(9); annexTypeList.add(11); caseApplicationsel.setAnnexTypeList(annexTypeList); - List caseAttachList = caseAttachMapper.queryCaseAttachList( caseApplicationsel); - if(caseAttachList!=null&&caseAttachList.size()>0){ + List caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplicationsel); + if (caseAttachList != null && caseAttachList.size() > 0) { List pathList = new ArrayList<>(); for (CaseAttach caseAttach1 : caseAttachList) { String annexName = caseAttach1.getAnnexName(); String annexPathsel = caseAttach1.getAnnexPath(); String prefix = "/profile"; int startIndex = annexName.indexOf(prefix); - if(startIndex!=-1) { + if (startIndex != -1) { startIndex += prefix.length(); String annexPath = "/uploadPath" + annexName.substring(startIndex); String path = "/home/ruoyi" + annexPath; pathList.add(path); - }else if(annexPathsel.contains(annexName)){ + } else if (annexPathsel.contains(annexName)) { pathList.add(annexPathsel); } } //将案件相关附件压缩zip文件 - if(pathList!=null&&pathList.size()>0){ + if (pathList != null && pathList.size() > 0) { LocalDate now = LocalDate.now(); String year = Integer.toString(now.getYear()); String month = String.format("%02d", now.getMonthValue()); @@ -2427,37 +2148,37 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { saveFolder.mkdirs(); } String zipFileOutPath = saveFolderPath + "/" + fileName; - try { + try { - FileOutputStream zfous = new FileOutputStream(zipFileOutPath); - ZipOutputStream zipFileOutstream = new ZipOutputStream(zfous); + FileOutputStream zfous = new FileOutputStream(zipFileOutPath); + ZipOutputStream zipFileOutstream = new ZipOutputStream(zfous); - for (String pathstr : pathList) { - FileInputStream fis1 = new FileInputStream(pathstr); - ZipFileUtils.zipFile(pathstr, fis1, zipFileOutstream); - } - zipFileOutstream.close(); - zfous.close(); - } catch (IOException e) { - e.printStackTrace(); + for (String pathstr : pathList) { + FileInputStream fis1 = new FileInputStream(pathstr); + ZipFileUtils.zipFile(pathstr, fis1, zipFileOutstream); } + zipFileOutstream.close(); + zfous.close(); + } catch (IOException e) { + e.printStackTrace(); + } - //保存压缩文件附件 - String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; + //保存压缩文件附件 + String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; // String saveName = "D:/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day + "/" + fileName; - String savePath = "/home/ruoyi/uploadPath/upload"; - caseAttach = CaseAttach.builder() + String savePath = "/home/ruoyi/uploadPath/upload"; + caseAttach = CaseAttach.builder() .caseAppliId(caseApplication.getId()) .annexName(saveName) .annexPath(savePath) .annexType(12) .build(); - int i = caseAttachMapper.save(caseAttach); + int i = caseAttachMapper.save(caseAttach); String annexName = caseAttach.getAnnexName(); String prefix = "/profile"; int startIndex = annexName.indexOf(prefix); - if(startIndex!=-1) { + if (startIndex != -1) { startIndex += prefix.length(); String annexPath = "/uploadPath" + annexName.substring(startIndex); @@ -2469,15 +2190,607 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAttach.setAnnexName(annexNamenew); } - return caseAttach; + return caseAttach; - } } } - return caseAttach; + } + return caseAttach; + } + +// @Override +// public List selectCaseApplicationListBatchByRole(CaseApplication caseApplication) { +// // 获取登录用户 +// LoginUser loginUser = getLoginUser(); +// SysUser user = loginUser.getUser(); +// Long userId = user.getUserId(); +// SysUser sysUser = sysUserMapper.selectUserById(userId); +// List roles = sysUser.getRoles(); +// // 没有角色不能查看案件列表 +// if (CollectionUtil.isEmpty(roles)) { +// throw new ServiceException("该用户没有角色权限"); +// } +// for (SysRole role : roles) { +// if (StrUtil.isEmpty(role.getRoleName())) { +// continue; +// } +// if ("超级管理员".equals(role.getRoleName())) { +// List caseApplicationlist = caseApplicationMapper.selectAdminCaseApplicationListBatch(caseApplication); +// if (caseApplicationlist != null && caseApplicationlist.size() > 0) { +// for (CaseApplication caseApplicationselect : caseApplicationlist) { +// Integer batchNumber = caseApplicationselect.getBatchNumber(); +// CaseApplication caseApplicationsel = new CaseApplication(); +// caseApplicationsel.setBatchNumber(batchNumber); +// List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); +// if (caseApplications != null && caseApplications.size() > 0) { +// List caseStatuss = caseApplications.stream().map(CaseApplication::getCaseStatus).collect(Collectors.toList()); +// System.out.println("ceshi:" + caseStatuss.toString()); +// List caseStatusNames = caseApplications.stream().map(CaseApplication::getCaseStatusName).collect(Collectors.toList()); +// List caseStatussnew = caseStatuss.stream().distinct().collect(Collectors.toList()); +// List caseStatusNamesnew = caseStatusNames.stream().distinct().collect(Collectors.toList()); +// String caseStatusName = caseStatusNamesnew.stream().map(Object::toString).collect(Collectors.joining(",")); +// String caseStatusstr = caseStatussnew.stream().map(Object::toString).collect(Collectors.joining(",")); +// caseApplicationselect.setCaseStatusName(caseStatusName); +// caseApplicationselect.setCaseStatusstr(caseStatusstr); +// } +// } +// } +// return caseApplicationlist; +// +// } +// +// if ("仲裁委".equals(role.getRoleName()) +// || "部门长".equals(role.getRoleName())) { +// List caseStatusList = new ArrayList<>(); +// caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); +// caseStatusList.add(CaseApplicationConstants.CHECK_ARBITRATION); +// // caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL); +// caseApplication.setDeptHeadStatus(caseStatusList); +// caseApplication.setIsOtherRole(1); +// } +// if ("仲裁员".equals(role.getRoleName())) { +// caseApplication.setUserId(String.valueOf(userId)); +// caseApplication.setIsOtherRole(1); +// } +// if ("财务".equals(role.getRoleName())) { +// caseApplication.setIsOtherRole(1); +// caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); +// } +// if ("法律顾问".equals(role.getRoleName())) { +// // 秘书查看所有案件 +// // 查询角色有关的用户部门 +// List 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 agentDeptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId()); +// List agentDeptIds = new ArrayList<>(); +// agentDeptIds.add(sysUser.getDeptId()); +// caseApplication.setAgentDeptIds(agentDeptIds); +// } +// +// } +// List caseApplicationlist = caseApplicationMapper.selectAdminCaseApplicationListBatch1(caseApplication); +// if (caseApplicationlist != null && caseApplicationlist.size() > 0) { +// for (CaseApplication caseApplicationselect : caseApplicationlist) { +// Integer batchNumber = caseApplicationselect.getBatchNumber(); +// CaseApplication caseApplicationsel = new CaseApplication(); +// caseApplicationsel.setBatchNumber(batchNumber); +// List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); +// if (caseApplications != null && caseApplications.size() > 0) { +// List caseStatuss = caseApplications.stream().map(CaseApplication::getCaseStatus).collect(Collectors.toList()); +// System.out.println("ceshi:" + caseStatuss.toString()); +// List caseStatusNames = caseApplications.stream().map(CaseApplication::getCaseStatusName).collect(Collectors.toList()); +// List caseStatussnew = caseStatuss.stream().distinct().collect(Collectors.toList()); +// List caseStatusNamesnew = caseStatusNames.stream().distinct().collect(Collectors.toList()); +// String caseStatusName = caseStatusNamesnew.stream().map(Object::toString).collect(Collectors.joining(",")); +// String caseStatusstr = caseStatussnew.stream().map(Object::toString).collect(Collectors.joining(",")); +// caseApplicationselect.setCaseStatusName(caseStatusName); +// caseApplicationselect.setCaseStatusstr(caseStatusstr); +// } +// } +// } +// +// return caseApplicationlist; +// } + + @Override + @Transactional + public AjaxResult submitCaseApplicationBatch(String batchNumber) { + CaseApplication caseApplication = new CaseApplication(); + List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplication); + if (CollectionUtil.isEmpty(caseApplications)) { + return error("该批次案件不存在"); + } + List ids = caseApplications.stream().map(CaseApplication::getId).collect(Collectors.toList()); + caseApplicationService.submitCaseApplication(ids); + + return success(); + } + + @Override + @Transactional + public AjaxResult submitCaseApplicationCheckBatch(String batchNumber, Integer agreeOrNotCheck, String caseCheckReject) { + int rows = 0; + CaseApplication caseApplicationsel = new CaseApplication(); + caseApplicationsel.setBatchNumber(Integer.parseInt(batchNumber)); + caseApplicationsel.setCaseStatus(CaseApplicationConstants.CASE_CHECK); + List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); + List ids = caseApplications.stream().map(CaseApplication::getId).collect(Collectors.toList()); + caseApplicationService.submitCaseApplicationCheck(ids, agreeOrNotCheck, caseCheckReject); + return success(); + } + + @Override + @Transactional + public int pendTralCheckBatch(CaseApplication caseApplication) { + Integer isAgreePendTral = caseApplication.getIsAgreePendTral(); + int rows = 0; + CaseApplication caseApplicationsel = new CaseApplication(); + caseApplicationsel.setBatchNumber(caseApplication.getBatchNumber()); + caseApplicationsel.setCaseStatus(CaseApplicationConstants.CASE_CROSSEXAMI); + List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); + if (caseApplications != null && caseApplications.size() > 0) { + List caseNums = caseApplications.stream().map(CaseApplication::getCaseNum).collect(Collectors.toList()); + List caseNumsnew = caseNums.stream().distinct().collect(Collectors.toList()); + String caseNumsstr = caseNumsnew.stream().map(Object::toString).collect(Collectors.joining(",")); + throw new ServiceException("案件编号" + caseNumsstr + "在案件质证节点,请先进行案件质证,然后再批量组庭审核"); } + CaseApplication caseApplication1 = new CaseApplication(); + caseApplication1.setBatchNumber(caseApplication.getBatchNumber()); + caseApplication1.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL_SUBMMIT); + List caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplication1); + if (caseApplications1 != null && caseApplications1.size() > 0) { + for (CaseApplication caseApplicationse : caseApplications1) { + // Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplicationse.getId()); + //同意组庭 + if (isAgreePendTral != null && isAgreePendTral == 1) { + + String arbitratorId = caseApplicationse.getArbitratorId(); + String arbitratorName = caseApplicationse.getArbitratorName(); + List arbitrators = caseApplication.getArbitrators(); + if (arbitrators != null && arbitrators.size() > 0 && StringUtils.isEmpty(arbitratorId) && StringUtils.isEmpty(arbitratorName)) { + List ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList()); + List 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(",")); + caseApplicationse.setArbitratorId(idstr); + caseApplicationse.setArbitratorName(arbitratorNamestr); + caseApplicationse.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); + rows += caseApplicationMapper.submitCaseApplication(caseApplicationse); + } + } else { + List arbitrators = caseApplication.getArbitrators(); + // 仲裁员信息 + if (arbitrators != null && arbitrators.size() > 0) { + List ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList()); + List 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(",")); + caseApplicationse.setArbitratorId(idstr); + caseApplicationse.setArbitratorName(arbitratorNamestr); + caseApplicationse.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); + rows += caseApplicationMapper.submitCaseApplication(caseApplicationse); + } + } + // 新增日志 + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL_SUBMMIT, ""); + + } + } else { + throw new ServiceException("这个批号没有批量组庭审核的案件"); + } + return rows; + } + + @Override + @Transactional + public int pendTralSureBatch(CaseApplication caseApplication) { + Integer isAgreePendTral = caseApplication.getIsAgreePendTral(); + int rows = 0; + CaseApplication caseApplication1 = new CaseApplication(); + caseApplication1.setBatchNumber(caseApplication.getBatchNumber()); + caseApplication1.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); + List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplication1); + if (caseApplications != null && caseApplications.size() > 0) { + for (CaseApplication caseApplicationse : caseApplications) { + caseApplicationService.pendTralSure(caseApplicationse); + + } + } else { + throw new ServiceException("这个批号没有批量组庭审核的案件"); + } + return rows; + } + + @Override + @Transactional + public int verificationArbitrateRecordBatch(CaseApplication caseApplication) { + CaseApplication caseApplication1 = new CaseApplication(); + caseApplication1.setBatchNumber(caseApplication.getBatchNumber()); + caseApplication1.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION); + List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplication1); + int rows = 0; + if (caseApplications != null && caseApplications.size() > 0) { + for (CaseApplication caseApplicationse : caseApplications) { + caseApplicationService.verificationArbitrateRecord(caseApplicationse); + } + } else { + throw new ServiceException("这个批号没有批量核验裁决书的案件"); + } + + return rows; + } + + @Override + @Transactional + public AjaxResult arbitratorCheckArbitrateRecordBatch(CaseApplication caseApplication) { + int rows = 0; + Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck(); + + CaseApplication caseApplicationsel = new CaseApplication(); + caseApplicationsel.setBatchNumber(caseApplication.getBatchNumber()); + caseApplicationsel.setCaseStatus(HEAD_CHECK_ARBITRATION); + List caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); + if (caseApplications1 != null && caseApplications1.size() > 0) { + for (CaseApplication caseApplicationse : caseApplications1) { + caseApplicationService.arbitratorCheckArbitrateRecord(caseApplicationse); + + } + + } else { + throw new ServiceException("这个批号没有批量仲裁员审核裁决书的案件"); + } + + return success(rows); + } + + /** + * 附件上传到onlyoffice服务器 + * + * @param annexPath + */ + @Override + @Transactional + public JSONArray uploadOnlyOffice(String annexPath, Long caseId) { + annexPath = annexPath.replace("/profile/", "/home/ruoyi/uploadPath/"); + File file = new File(annexPath); + if (file.exists()) { + // 调用onlyoffice + try { + Map params = new HashMap<>(); + params.put("file", file); + String postResult = HttpUtil.post(onlyOfficeUrl + "/" + String.valueOf(caseId), params); + if (StrUtil.isNotEmpty(postResult)) { + // 转为jsonArray + JSONArray jsonArray = JSONArray.parseArray(postResult); + + return jsonArray; + } + } catch (Exception e) { + throw new ServiceException("上传OnlyOffice服务器失败"); + } + } else { + throw new ServiceException("文件不存在"); + } + return null; + } + + @Override + @Transactional + public AjaxResult checkArbitrateRecordBatch(CaseApplication caseApplication) { + Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck(); + int rows = 0; + CaseApplication caseApplicationsel = new CaseApplication(); + caseApplicationsel.setBatchNumber(caseApplication.getBatchNumber()); + caseApplicationsel.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION); + List caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); + if (caseApplications1 != null && caseApplications1.size() > 0) { + for (CaseApplication caseApplicationse : caseApplications1) { + // Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplicationse.getId()); + if (agreeOrNotCheck.intValue() == 1) { + try { + //获取当前案件的裁决书 + CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplicationse); + List caseAttachList = caseApplication2.getCaseAttachList(); + if (caseAttachList != null && caseAttachList.size() > 0) { + for (CaseAttach caseAttach : caseAttachList) { + if (caseAttach.getAnnexType() == 3) { + String annexPath = caseAttach.getAnnexPath(); + String path = "/home/ruoyi" + annexPath; + // System.out.println("这是查询到的裁决书路径" + path); + // String path = "D:\\home\\新裁决书模板.docx"; + //获取文件上传地址 + EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path); + String body = response.getBody(); + if (body != null) { + JSONObject jsonObject = JSONObject.parseObject(body); + String fileId = jsonObject.getJSONObject("data").getString("fileId"); + String fileUploadUrl = jsonObject.getJSONObject("data").getString("fileUploadUrl"); + //上传文件流 + EsignHttpResponse response1 = SaaSAPIFileUtils.uploadFile(fileUploadUrl, path); + JSONObject jsonObject1 = JSONObject.parseObject(response1.getBody()); + if (jsonObject1.getIntValue("errCode") == 0) { + //查看文件上传状态 + Thread.sleep(3000); + EsignHttpResponse response2 = SaaSAPIFileUtils.getFileStatus(fileId); + JSONObject jsonObject2 = JSONObject.parseObject(response2.getBody()); + JSONObject data = jsonObject2.getJSONObject("data"); + int fileStatus = data.getIntValue("fileStatus"); + if (fileStatus == 2 || fileStatus == 5) { + String fileName = data.getString("fileName"); + //上传成功,获取文件签名印章位置 + SealSignRecord sealSignRecord = new SealSignRecord(); + sealSignRecord.setFileid(fileId); + EsignHttpResponse positions = SignAward.getPositions(sealSignRecord); + Gson gson = new Gson(); + JsonObject positionsJsonObject = gson.fromJson(positions.getBody(), JsonObject.class); + JsonObject positionsData = positionsJsonObject.getAsJsonObject("data"); + String keywordPositions = positionsData.get("keywordPositions").toString(); + //发起签署 + sealSignRecord.setFilename(fileName); + String arbitratorId = caseApplication2.getArbitratorId(); + if (StringUtils.isNotEmpty(arbitratorId)) { + SysUser sysUser = sysUserMapper.selectUserById(Long.valueOf(arbitratorId)); + if (sysUser == null) { + return AjaxResult.error(); + } + sealSignRecord.setPensonAccount(sysUser.getPhonenumber()); + sealSignRecord.setPensonName(sysUser.getNickName()); + } + + DeptIdentify deptIdentify = new DeptIdentify(); + deptIdentify.setIsUse(1); + DeptIdentify deptIdentifyselect = new DeptIdentify(); + List deptIdentifysnew = deptIdentifyMapper.selectDeptIdentify(deptIdentify); + if (deptIdentifysnew != null && deptIdentifysnew.size() > 0) { + deptIdentifyselect = deptIdentifysnew.get(0); + sealSignRecord.setOrgnizeName(deptIdentifyselect.getIdentifyName()); + sealSignRecord.setOrgnizeNamePsnAccount(deptIdentifyselect.getOperPhone()); + sealSignRecord.setOrgnizeNamepsnName(deptIdentifyselect.getOperName()); + } else { + return AjaxResult.error("没有用印时的机构名称及经办人信息"); + } + + //解析文件签名印章位置 + JSONArray jsonArray = JSONArray.parseArray(keywordPositions); + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject jsonObject3 = jsonArray.getJSONObject(i); + String keyword = jsonObject3.getString("keyword"); + if (keyword.equals("仲裁员:")) { + //签名 + JSONArray positionsArray = jsonObject3.getJSONArray("positions"); + // 遍历 positionsArray 中的每个元素 + for (int j = 0; j < positionsArray.size(); j++) { + JSONObject positionObj = positionsArray.getJSONObject(j); + int pageNum = positionObj.getIntValue("pageNum"); + sealSignRecord.setPositionPagepsn(String.valueOf(pageNum)); + JSONArray coordinatesArray = positionObj.getJSONArray("coordinates"); + JSONObject coordinateObj = coordinatesArray.getJSONObject(0); + double positionX = coordinateObj.getDoubleValue("positionX"); + double positionY = coordinateObj.getDoubleValue("positionY"); + sealSignRecord.setPositionXpsn(positionX + 90); + sealSignRecord.setPositionYpsn(positionY); + } + } else { + //用印 + JSONArray positionsArray = jsonObject3.getJSONArray("positions"); + // 遍历 positionsArray 中的每个元素 + for (int j = 0; j < positionsArray.size(); j++) { + JSONObject positionObj = positionsArray.getJSONObject(j); + int pageNum = positionObj.getIntValue("pageNum"); + sealSignRecord.setPositionPageorg(String.valueOf(pageNum)); + JSONArray coordinatesArray = positionObj.getJSONArray("coordinates"); + JSONObject coordinateObj = coordinatesArray.getJSONObject(0); + double positionX = coordinateObj.getDoubleValue("positionX"); + double positionY = coordinateObj.getDoubleValue("positionY"); + sealSignRecord.setPositionXorg(positionX + 90); + sealSignRecord.setPositionYorg(positionY); + } + } + } + /*DeptIdentify deptIdentify1 = new DeptIdentify(); + deptIdentify1.setSealStatus(1); // 印章状态为启用 + //根据机构名称查询部门id + SysDept sysDept = new SysDept(); + sysDept.setDeptName(sealSignRecord.getOrgnizeName()); + List sysDepts = deptMapper.selectDeptList(sysDept); + if (sysDepts != null && sysDepts.size() > 0) { + Long deptId = sysDepts.get(0).getDeptId(); + deptIdentify1.setDeptId(deptId); + } + List deptIdentifies = deptIdentifyMapper.selectDeptIdentifylistother(deptIdentify1); + List sealIds = new ArrayList<>(); + if (deptIdentifies != null && deptIdentifies.size() > 0) { + for (DeptIdentify identify : deptIdentifies) { + String sealId = identify.getSealId(); + sealIds.add(sealId); + } + }*/ + String orgnizeName = sealSignRecord.getOrgnizeName(); //机构名称 + String orgnizeNamepsnName = sealSignRecord.getOrgnizeNamepsnName(); //机构经办人姓名 + String orgnizeNamePsnAccount = sealSignRecord.getOrgnizeNamePsnAccount(); //机构经办人联系方式 + //查询机构信息 + DeptIdentify deptIdentify1 = new DeptIdentify(); + deptIdentify1.setIdentifyName(orgnizeName); + deptIdentify1.setOperName(orgnizeNamepsnName); + deptIdentify1.setOperPhone(orgnizeNamePsnAccount); + List deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify1); + if (deptIdentifies != null && deptIdentifies.size() > 0) { + Long id = deptIdentifies.get(0).getId(); + SealManage sealManage = new SealManage(); + sealManage.setIdentifyId(id); + List sealIdList = new ArrayList<>(); + List selectSealList = sealManageMapper.selectSealList(sealManage); + if (selectSealList != null && selectSealList.size() > 0) { + for (SealManage manage : selectSealList) { + Integer sealStatus = manage.getSealStatus(); + Integer isUse = manage.getIsUse(); + if (sealStatus == 1 && isUse == 1) { + sealIdList.add(manage.getSealId()); + } + } + EsignHttpResponse response3 = SignAward.createByFile(sealSignRecord, sealIdList); + + JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody()); + if (jsonObject3 != null) { + if (jsonObject3.getIntValue("code") == 0) { + //获取签署流程ID + JSONObject data1 = jsonObject3.getJSONObject("data"); + String signFlowId = data1.getString("signFlowId"); + //保存案件id,文件id,文件名称.流程id到签署用印记录表里 + sealSignRecord.setCaseAppliId(caseApplicationse.getId()); + sealSignRecord.setSignFlowid(signFlowId); + sealSignRecord.setSignFlowStatus(1);//待签名 + sealSignRecordMapper.insertSealSignRecord(sealSignRecord); + } else { + throw new ServiceException(jsonObject3.getString("message")); + } + } else { + return AjaxResult.error(); + } + + } + + + } else { + return AjaxResult.error(); + } + } + } + } + break; + } + } + } + } catch (EsignDemoException e) { + e.printStackTrace(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + caseApplicationse.setCaseStatus(CaseApplicationConstants.SIGN_ARBITRATION); + // 新增日志 + insertCaseLog(caseApplicationse.getId(), CaseApplicationConstants.CHECK_ARBITRATION, ""); + rows += caseApplicationMapper.submitCaseApplication(caseApplicationse); + } else if (agreeOrNotCheck.intValue() == 2) { + caseApplicationse.setCaseStatus(HEAD_CHECK_ARBITRATION); + String notes = ""; + if (caseApplication.getArbitrateRecord() != null && StrUtil.isNotEmpty(caseApplication.getArbitrateRecord().getDeptorReject())) { + notes = "部门长驳回裁决书,驳回原因:" + caseApplication.getArbitrateRecord().getDeptorReject(); + } + // 新增日志 + insertCaseLog(caseApplicationse.getId(), CaseApplicationConstants.CHECK_ARBITRATION, notes); + + rows = caseApplicationMapper.submitCaseApplication(caseApplicationse); + + } + + } + + } + return success(rows); + + } + + private String getColumnstr(String columnname) { + String columnstr = ""; + switch (columnname) { + case "caseName": + columnstr = "案件名称"; + break; + case "caseSubjectAmount": + columnstr = "案件标的"; + break; + case "loanStartDate": + columnstr = "借款开始日期"; + break; + case "loanEndDate": + columnstr = "借款结束日期"; + break; + case "contractNumber": + columnstr = "合同编号"; + break; + case "claimInterestOwed": + columnstr = "申请人主张欠利息"; + break; + case "claimLiquidDamag": + columnstr = "申请人主张违约金"; + break; + case "claimPrinciOwed": + columnstr = "申请人主张欠本金"; + break; + case "arbitratClaims": + columnstr = "申请人仲裁请求及事实和理由"; + break; + case "name": + columnstr = "姓名"; + break; + case "identityNum": + columnstr = "身份证号"; + break; + case "contactTelphone": + columnstr = "联系电话"; + break; + case "contactAddress": + columnstr = "联系地址"; + break; + case "workTelphone": + columnstr = "单位电话"; + break; + case "workAddress": + columnstr = "单位地址"; + break; + case "residenAffili": + columnstr = "住所"; + break; + case "compLegalPerson": + columnstr = "法定代表人"; + break; + case "compLegalperPost": + columnstr = "法定代表人职位"; + break; + case "email": + columnstr = "邮箱"; + break; + case "nameAgent": + columnstr = "代理人姓名"; + break; + case "identityNumAgent": + columnstr = "代理人身份证号"; + break; + case "contactTelphoneAgent": + columnstr = "代理人联系电话"; + break; + case "contactAddressAgent": + columnstr = "代理人联系地址"; + break; + case "responSex": + columnstr = "被申请人性别"; + break; + case "responBirth": + columnstr = "被申请人出生年月日"; + break; + default: + columnstr = ""; + } + + return columnstr; + } @Override @@ -2508,8 +2821,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Transactional public int pendTralSure(CaseApplication caseApplication) { // caseApplication.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION_METHOD); - + // Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); caseApplication.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION_METHOD); + caseApplication.setLockStatus(1); Integer isAgreePendTral = caseApplication.getIsAgreePendTral(); int rows = 0; //同意组庭 @@ -2530,12 +2844,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } //发送短信通知 1947342 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 - SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - request.setTemplateId("1947342"); // 发送开庭日期通知短信 - sendHearDateMessage(caseApplication, request, "1947342"); + sendHearDateMessage(caseApplication, "2033619"); // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, ""); + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL, ""); return rows; @@ -2545,15 +2857,24 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { * 发送开庭日期通知短信 * * @param caseApplication - * @param request + * @param */ - private void sendHearDateMessage(CaseApplication caseApplication, SmsUtils.SendSmsRequest request, String templateId) { + private void sendHearDateMessage(CaseApplication caseApplication, String templateId) { CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); - + if (caseApplicationselect == null) { + throw new ServiceException("案件不存在"); + } + List afflicates = selectAfflicatesByCaseId(caseApplicationselect.getId()); + if (CollectionUtil.isEmpty(afflicates)) { + throw new ServiceException("案件相关人员不存在"); + } String caseNum = caseApplicationselect.getCaseNum(); - //Date hearDate = caseApplicationselect.getHearDate(); + Date hearDate = caseApplicationselect.getHearDate(); + String hearDatestr = ""; SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String hearDatestr = null; + if (hearDate != null) { + hearDatestr = dateFormat.format(hearDate); + } String arbitratorId = caseApplicationselect.getArbitratorId(); // List arbitratorList = new ArrayList<>(); if (StringUtils.isNotEmpty(arbitratorId)) { @@ -2566,73 +2887,40 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { List userList = sysUserMapper.selectUserListByIds(idList); if (CollectionUtil.isNotEmpty(userList)) { for (SysUser user : userList) { - //给仲裁员发送短信通知 - request.setPhone(user.getPhonenumber()); - // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 - String name = user.getNickName(); - request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr}); - Boolean aBoolean = SmsUtils.sendSms(request); - //保存短信发送记录 - SmsSendRecord smsSendRecord = new SmsSendRecord(); - smsSendRecord.setCaseId(caseApplicationselect.getId()); - smsSendRecord.setCaseNum(caseApplicationselect.getCaseNum()); - smsSendRecord.setPhone(request.getPhone()); - smsSendRecord.setSendTime(new Date()); - String content = ""; - if (templateId.equals("1947342")) { - content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,开庭日期已确定为" + hearDatestr + ",请知晓,如非本人操作,请忽略本短信。"; + if (templateId.equals("2033619")) { + + SmsUtils.sendSms(caseApplicationselect, "2033619", user.getPhonenumber(), new String[]{user.getNickName(),caseApplicationselect.getCaseNum()}); + } if (templateId.equals("1975139")) { - content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,开庭日期已改为" + hearDatestr + ",请知晓,如非本人操作,请忽略本短信。"; + + SmsUtils.sendSms(caseApplicationselect, "1975139", user.getPhonenumber(), new String[]{user.getNickName(),caseApplicationselect.getCaseNum(),hearDatestr}); + } - smsSendRecord.setSendContent(content); - smsSendRecord.setCreateBy(getUsername()); - if (aBoolean) { - smsSendRecord.setSendStatus(1); - } else { - smsSendRecord.setSendStatus(0); - } - smsRecordMapper.saveSmsSendRecord(smsSendRecord); + } } } - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(caseApplication.getId()); - List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if (caseAffiliatListeselect != null) { - for (int j = 0; j < caseAffiliatListeselect.size(); j++) { - CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(j); - int identityType = caseAffiliateselect.getIdentityType(); - if (identityType == 1) { - caseAffiliateselect.setName(caseAffiliateselect.getApplicationOrganName()); - - } - //给申请人、被申请人发送短信通知 - request.setPhone(caseAffiliateselect.getContactTelphone()); + for (int j = 0; j < afflicates.size(); j++) { + CaseAffiliateEntity caseAffiliateselect = afflicates.get(j); + if (caseAffiliateselect.getOperatorFlag() != null && caseAffiliateselect.getOperatorFlag().equals(1) && StrUtil.isNotEmpty(caseAffiliateselect.getPhone())) { // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 - String name = caseAffiliateselect.getName(); - request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr}); - Boolean aBoolean = SmsUtils.sendSms(request); - //保存短信发送记录 - SmsSendRecord smsSendRecord = new SmsSendRecord(); - smsSendRecord.setCaseId(caseApplication.getId()); - smsSendRecord.setCaseNum(caseApplicationselect.getCaseNum()); - smsSendRecord.setPhone(request.getPhone()); - smsSendRecord.setSendTime(new Date()); - String content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,开庭日期已确定为" + hearDatestr + ",请知晓,如非本人操作,请忽略本短信。"; - smsSendRecord.setSendContent(content); - smsSendRecord.setCreateBy(getUsername()); - if (aBoolean) { - smsSendRecord.setSendStatus(1); - } else { - smsSendRecord.setSendStatus(0); + if (templateId.equals("2033619")) { + SmsUtils.sendSms(caseApplicationselect, "2033619",caseAffiliateselect.getPhone(), new String[]{caseAffiliateselect.getName(),caseApplicationselect.getCaseNum()}); + + } + if (templateId.equals("1975139")) { + + SmsUtils.sendSms(caseApplicationselect, "1975139",caseAffiliateselect.getPhone(), new String[]{caseAffiliateselect.getName(),caseApplicationselect.getCaseNum(),hearDatestr}); + } - smsRecordMapper.saveSmsSendRecord(smsSendRecord); } + } + } @@ -2667,31 +2955,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } - private void assignmentCaseAffiliates(CaseApplication caseApplication, List caseAffiliatesnew, - Map deptMap, Long roleId) { - // 申请人信息 - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate = buildApplicaInfo(caseApplication); - // 申请人(机构),需要判断部门中是否存在,不存在则新增,当身份类型为1的时候,查询时需要根据名称查询组织机构 - if (StrUtil.isNotEmpty(caseApplication.getName())) { - setApplicantOrganization(caseAffiliate, caseApplication, deptMap); - } - String s = buildAgentInfo(caseAffiliate, roleId); - if (StrUtil.isNotEmpty(s)) { - StringBuilder errorMsg = caseApplication.getErrorMsg(); - if (StrUtil.isEmpty(errorMsg)) { - errorMsg = new StringBuilder(); - } - errorMsg.append(s); - caseApplication.setErrorMsg(errorMsg); - } - caseAffiliatesnew.add(caseAffiliate); - - // 组装被申请人信息 - caseAffiliatesnew.add(buildDebtorInfo(caseApplication)); - caseApplication.setCaseAffiliates(caseAffiliatesnew); - } - private CaseAffiliate buildApplicaInfo(CaseApplication caseApplication) { // 申请人信息 CaseAffiliate caseAffiliate = new CaseAffiliate(); @@ -2853,7 +3116,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 查询最大房间号 Long maxRoomId = caseApplicationMapper.selectMaxRoomId(); - if (null == maxRoomId || maxRoomId > 4294967294L) { + if (null == maxRoomId || maxRoomId > 4294967294L / 2) { return 1L; } else { return maxRoomId + 1; @@ -2914,17 +3177,17 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return success(reservedConferenceMapper.deleteByRoomId(roomId)); } + @Transactional @Override - public AjaxResult uploadCaseZipFile(MultipartFile file, Long templateId) { - AjaxResult ajaxResult = caseZipImportImpl.zipImport( file, templateId); - return ajaxResult; + public AjaxResult uploadCaseZipFile(MultipartFile file, Long templateId, Integer applicantType, Integer resType) { + return caseZipImportImpl.zipImport(file, templateId, applicantType, resType); } - /** * 根据附件id修改案件id + * * @param caseAttach * @return */ @@ -2934,6 +3197,578 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return success(); } + /** + * 保存onlyOffice在线编辑的文件 + * + * @param + * @return + */ + @Transactional + @Override + public AjaxResult saveOnlyOfficeFile(CaseAttach caseAttach) { + if (StrUtil.isNotEmpty(caseAttach.getAnnexPath())) { + String replace = caseAttach.getAnnexPath().replace("/home/ruoyi/uploadPath/", "/profile/"); + caseAttach.setAnnexPath(replace); + + } + // caseAttach.setAnnexPath("/home/ruoyi/uploadPath/onlyoffice/"); + + caseAttach.setAnnexType(3); + caseAttach.setUserId(SecurityUtils.getUserId()); + caseAttach.setUserName(SecurityUtils.getUsername()); + // 先删除之前的在新增 + caseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), caseAttach.getAnnexType()); + caseAttachMapper.save(caseAttach); + + return AjaxResult.success(); + } + + /** + * 新增或编辑案件 + * + * @param caseApplication + * @return + */ + @Transactional + @Override + public AjaxResult insertOrUpdate(CaseApplicationDTO caseApplication) { + CaseAffiliateVO caseAffiliateVO = caseApplication.getAffiliate(); + if (null == caseAffiliateVO) { + throw new ServiceException("案件相关人员未填写"); + } + if (caseApplication.getId() != null) { + // 修改 + caseApplicationService.update(caseApplication); + } else { + // 新增 + caseApplicationService.insert(caseApplication); + } + return success(); + } + + /** + * 新增案件 + * + * @param caseApplication + */ + @Transactional + @Override + public void insert(CaseApplicationDTO caseApplication) { + CaseAffiliateVO caseAffiliateVO = caseApplication.getAffiliate(); + caseApplication.setCreateBy(getUsername()); + caseApplication.setVersion(1); + caseApplication.setId(IdWorkerUtil.getId()); + caseApplication.setCreateTime(new Date()); + caseApplication.setRegisterDate(new Date()); + caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); + + // 设置编码 + caseApplication.setCaseNum(generateCaseNum()); + // 设置批号 + caseApplication.setBatchNumber(generateBatchNumber()); + // 计算仲裁费用 + caseApplication.setFeePayable(calculateFee(caseApplication.getCaseSubjectAmount())); + caseApplication.setPaidExpenses(caseApplication.getFeePayable()); + // 新增立案申请表 + int rows = caseApplicationMapper.insert(caseApplication); + if (rows == 0) { + throw new ServiceException("新增失败"); + } + List affliates = new ArrayList<>(); + // 新增案件相关人员 + caseApplicationService.insertCaseAfflicate(caseAffiliateVO, affliates, caseApplication,false); + + + // 保存附件 + // 是否是压缩包导入,压缩包导入则不更新附件 + boolean isZipImport = caseApplication.getImportFlag() == null || caseApplication.getImportFlag() != 2; + List caseAttachList = caseApplication.getCaseAttachList(); + if (caseAttachList != null && caseAttachList.size() > 0) { + if (isZipImport) { + for (CaseAttach caseAttach : caseAttachList) { + caseAttach.setCaseAppliId(caseApplication.getId()); + // 修改案件附件 + caseAttachMapper.updateCaseAttach(caseAttach); + } + } else { + // 压缩包导入 + for (CaseAttach caseAttach : caseAttachList) { + caseAttach.setCaseAppliId(caseApplication.getId()); + } + caseAttachMapper.batchSave(caseAttachList); + } + } + // 新增日志 + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_INSERT, ""); + // 异步新增案件日志 + List columnValueList = caseApplication.getColumnValueList(); + ThreadPoolUtil.execute(() -> { + // 批量新增columnValue自定义字段 + if (CollectionUtil.isNotEmpty(columnValueList)) { + columnValueList.forEach(columnValue -> columnValue.setCaseId(caseApplication.getId())); + columnValueMapper.batchSave(columnValueList); + } + CaseApplication application = new CaseApplication(); + BeanUtil.copyProperties(caseApplication, application); + // 新增案件日志表 + application.setCaseAppliId(caseApplication.getId()); + application.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode()); + application.setCaseLogId(IdWorkerUtil.getId()); + int insertRow = caseApplicationLogMapper.insert(application); + // 插入案件相关人员表日志 + if (insertRow != 0 && CollectionUtil.isNotEmpty(affliates)) { + affliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(application.getCaseLogId())); + + caseAffiliateLogMapper.batchCaseAffiliate(affliates); + } + // 插入附件表日志 + if (CollectionUtil.isNotEmpty(caseAttachList)) { + List filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList()); + // 插入日志附件表 + if (CollectionUtil.isNotEmpty(filterList)) { + for (CaseAttach caseAttach : filterList) { + // 查询附件表 + CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId()); + attach.setCaseAppliLogId(application.getCaseLogId()); + caseAttachLogMapper.save(attach); + } + } + + } + // 插入columnValueLog自定义字段日志表 + if (CollectionUtil.isNotEmpty(columnValueList)) { + columnValueList.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(application.getCaseLogId())); + columnValueLogMapper.batchSave(columnValueList); + + } + + + }); + } + + /** + * 设置案件相关信息 + * + * @param caseApplication + * @param affiliate + * @param groupOrder 组别 + * @param operatorCount 操作人数量 + * @param updateFlag 是否修改案件 + */ + @Transactional + public int setCaseAfflicate(List affliates, CaseApplicationDTO caseApplication, CaseAffiliateEntity affiliate, int groupOrder, int operatorCount, boolean updateFlag) { + if (affiliate == null) { + return operatorCount; + } + affiliate.setCaseAppliId(caseApplication.getId()); + boolean b = affiliate.getOrganizeFlag() != 1 && (affiliate.getRoleType() == 1 || affiliate.getRoleType() == 3) && StrUtil.isEmpty(affiliate.getEmail()); + boolean importFlag= caseApplication.getImportFlag() != null && !caseApplication.getImportFlag().equals( 2 ); + if ((b || StrUtil.isEmpty(affiliate.getName())) && importFlag) { + return operatorCount; + } + affiliate.setGroupOrder(groupOrder); + List sysRoles = roleMapper.selectRoleAll(); + if (CollectionUtil.isEmpty(sysRoles)) { + throw new ServiceException("角色不全,请联系管理员新增角色"); + } + Map roleMap = sysRoles.stream().collect(Collectors.toMap(SysRole::getRoleName, SysRole::getRoleId, (n1, n2) -> n2)); + + affiliate.setCaseAppliId(caseApplication.getId()); + List roleIdList = new ArrayList<>(); + switch (affiliate.getRoleType()) { + case 1: + // 申请人 + roleIdList.add(roleMap.get("申请人")); + if (affiliate.getOperatorFlag() == 1) { + // 是操作人 + roleIdList.add(roleMap.get("申请人操作人")); + } + break; + case 2: + // 申请代理人 + roleIdList.add(roleMap.get("委托代理人")); + if (affiliate.getOperatorFlag() == 1) { + // 是操作人 + roleIdList.add(roleMap.get("申请人操作人")); + } + break; + case 3: + // 被申 + roleIdList.add(roleMap.get("被申请人")); + if (affiliate.getOperatorFlag() == 1) { + // 是操作人 + roleIdList.add(roleMap.get("被申请人操作人")); + } + + break; + case 4: + // 被申代理 + roleIdList.add(roleMap.get("委托代理人")); + if (affiliate.getOperatorFlag() == 1) { + // 是操作人 + roleIdList.add(roleMap.get("被申请人操作人")); + } + break; + default: + break; + } + // 如果是申请人,则和用户表关联 + if (affiliate.getOrganizeFlag() == 0) { + caseApplicationService.insertAfficateUser(affiliate, roleIdList, updateFlag,affliates); + } else { + // 申请机构 + if (affiliate.getRoleType() == 1 || affiliate.getRoleType() == 3) { + affiliate.setOperatorFlag(0); + // 申请人,从缓存中判断部门是否存在 + SysDept dept = null; + if (!updateFlag) { + // 新增则根据部门名称查 + dept = sysDeptMapper.selectDeptByName(affiliate.getName()); + } else { + if (affiliate.getApplicantDeptId() != null) { + // 修改根据部门id查 + dept = sysDeptMapper.selectDeptById(affiliate.getApplicantDeptId()); + } else { + dept = sysDeptMapper.selectDeptByName(affiliate.getName()); + } + } + if (dept == null) { + // 不存在该部门,新增 + dept = new SysDept(); + dept.setParentId(0L); + dept.setDeptName(affiliate.getName()); + dept.setAncestors("0"); + dept.setOrderNum(1); + dept.setStatus("0"); + dept.setDelFlag("0"); + dept.setCode(affiliate.getCode()); + dept.setHome(affiliate.getHome()); + dept.setAddress(affiliate.getAddress()); + dept.setCompLegalPerson(affiliate.getCompLegalPerson()); + dept.setCreateBy(getUsername()); + dept.setCreateTime(new Date()); + dept.setNationality(affiliate.getNationality()); + sysDeptMapper.insertDept(dept); + } else { + // 更新部门 + dept.setDeptName(affiliate.getName()); + dept.setCode(affiliate.getCode()); + dept.setCompLegalPerson(affiliate.getCompLegalPerson()); + dept.setUpdateBy(getUsername()); + dept.setUpdateTime(new Date()); + dept.setNationality(affiliate.getNationality()); + dept.setHome(affiliate.getHome()); + dept.setAddress(affiliate.getAddress()); + sysDeptMapper.updateDept(dept); + } + affiliate.setApplicantDeptId(dept.getDeptId()); + affliates.add(affiliate); + caseAffiliateMapper.insert(affiliate); + } else { + caseApplicationService.insertAfficateUser(affiliate, roleIdList, updateFlag,affliates); + } + } + + if (affiliate.getOperatorFlag() != null && affiliate.getOperatorFlag() == 1) { + operatorCount++; + } + return operatorCount; + } + + /** + * 新增案件相关人员信息 + * + * @param affiliate 相关人员信息 + * @param roleIdList 角色id + * @param updateFlag 是否修改案件 + */ + @Transactional + public void insertAfficateUser(CaseAffiliateEntity affiliate, List roleIdList, boolean updateFlag,List affiliateEntities) { + + if (StrUtil.isEmpty(affiliate.getEmail()) && StrUtil.isEmpty(affiliate.getPhone())) { + return; + } + SysUser user = null; + if (!updateFlag) { + // 新增案件则根据邮箱查用户 + user = sysUserMapper.selectUserByEmail(affiliate.getEmail()); + } else { + // 修改案件则根据userId查用户 + if (affiliate.getUserId() != null) { + user = sysUserMapper.selectUserById(affiliate.getUserId()); + } else if(StrUtil.isNotEmpty(affiliate.getEmail())){ + user = sysUserMapper.selectUserByEmail(affiliate.getEmail()); + }else if(StrUtil.isNotEmpty(affiliate.getPhone())){ + user = sysUserMapper.selectUserByPhone(affiliate.getPhone()); + } + } + // 判断该用户是否存在 + if (user == null) { + // 不存在,则新增 + user = new SysUser(); + user.setPosition(affiliate.getPosition()); + user.setPassword(SecurityUtils.encryptPassword("abc123456")); + if(StrUtil.isNotEmpty(affiliate.getPhone())){ + user.setUserName(affiliate.getPhone()); + }else if(StrUtil.isNotEmpty(affiliate.getEmail())) { + user.setUserName(affiliate.getEmail()); + } + user.setNickName(affiliate.getName()); + user.setEmail(affiliate.getEmail()); + user.setHome(affiliate.getHome()); + user.setSex(affiliate.getSex()); + user.setIdCard(affiliate.getIdCard()); + user.setBirth(affiliate.getBirth()); + user.setPhonenumber(affiliate.getPhone()); + user.setAddress(affiliate.getAddress()); + user.setIdType(affiliate.getIdType()); + user.setNationality(affiliate.getNationality()); + sysUserMapper.insertUser(user); + affiliate.setUserId(user.getUserId()); + // redis缓存 + redisCache.setCacheObject(CacheConstants.USER_KEY + user.getUserId(), user); + // 查询该角色是否存在申请人角色 + List roleIds = userRoleMapper.selectRoleIdsByUserId(user.getUserId()); + for (Long roleId : roleIdList) { + if (roleId == null) { + continue; + } + if (CollectionUtil.isEmpty(roleIds) && !roleIds.contains(roleId)) { + userRoleMapper.insertUserRole(user.getUserId(), roleId); + } + } + + } else { + // 存在的话将案件人员信息同步到用户表,更新用户表 + user.setPosition(affiliate.getPosition()); + user.setHome(affiliate.getHome()); + user.setNickName(affiliate.getName()); + user.setSex(affiliate.getSex()); + user.setIdCard(affiliate.getIdCard()); + user.setBirth(affiliate.getBirth()); + user.setPhonenumber(affiliate.getPhone()); + user.setAddress(affiliate.getAddress()); + user.setIdType(affiliate.getIdType()); + user.setNationality(affiliate.getNationality()); + user.setEmail(affiliate.getEmail()); + sysUserMapper.updateUser(user); + affiliate.setUserId(user.getUserId()); + // redis缓存 + redisCache.setCacheObject(CacheConstants.USER_KEY + user.getUserId(), user); + // 查询该角色是否存在申请人角色 + List roleIds = userRoleMapper.selectRoleIdsByUserId(user.getUserId()); + for (Long roleId : roleIdList) { + if (roleId == null) { + continue; + } + if (CollectionUtil.isEmpty(roleIds) || !roleIds.contains(roleId)) { + userRoleMapper.insertUserRole(user.getUserId(), roleId); + } + } + + } + affiliateEntities.add(affiliate); + // 保存人员 + caseAffiliateMapper.insert(affiliate); + } + + @Transactional + @Override + public void insertCaseAfflicate(CaseAffiliateVO caseAffiliateVO, List affliates, CaseApplicationDTO caseApplication,boolean updateFlag) { + // 组装案件相关人员 + int appOperatorCount = 0; + int resOperatorCount = 0; + // 保存案件相关人员 + List applicant = caseAffiliateVO.getApplicant(); + List res = caseAffiliateVO.getRes(); + + if (CollectionUtil.isNotEmpty(applicant)) { + for (int i = 0; i < applicant.size(); i++) { + // 申请人 + appOperatorCount = setCaseAfflicate(affliates, caseApplication, applicant.get(i).getApplicant(), i, appOperatorCount, updateFlag); + // 申请人代理人 + appOperatorCount = setCaseAfflicate(affliates, caseApplication, applicant.get(i).getApplicantAgent(), i, appOperatorCount, updateFlag); + } + } + if (CollectionUtil.isNotEmpty(res)) { + for (int i = 0; i < res.size(); i++) { + // 被申请人 + resOperatorCount = setCaseAfflicate(affliates, caseApplication, res.get(i).getRes(), i, resOperatorCount, updateFlag); + // 被申请人代理人 + resOperatorCount = setCaseAfflicate(affliates, caseApplication, res.get(i).getResAgent(), i, resOperatorCount, updateFlag); + } + } + if (appOperatorCount < 1 && resOperatorCount < 1) { + throw new ServiceException("未设置申请操作人和被申请操作人"); + } else if (appOperatorCount < 1) { + throw new ServiceException("未设置申请操作人"); + } else if (resOperatorCount < 1) { + throw new ServiceException("未设置被申请操作人"); + } + } + + @Override + public List selectAfflicatesByCaseId(Long id) { + CaseAffiliateEntity affiliateEntity = new CaseAffiliateEntity(); + affiliateEntity.setCaseAppliId(id); + return caseAffiliateMapper.selectCaseAffiliate(affiliateEntity); + } + + @Override + public SysUser getUserInfo() { + SysUser sysUser = new SysUser(); + + if (SecurityUtils.getUserId() != null) { + sysUser = sysUserMapper.selectUserById(SecurityUtils.getUserId()); + + } + return sysUser; + } + + /** + * 获取批号 + * + * @return + */ + private Integer generateBatchNumber() { + + Integer batchNumber = caseApplicationMapper.selectMaxBatchNumber(); + AtomicInteger maxBatchNumber = new AtomicInteger(); + if (batchNumber == null) { + maxBatchNumber.set(1); + + } else { + maxBatchNumber.set(batchNumber + 1); + + } + return maxBatchNumber.get(); + } + + /** + * 计算仲裁费用 + * + * @param caseSubjectAmount 案件标的 + * @return + */ + private BigDecimal calculateFee(BigDecimal caseSubjectAmount) { + if(caseSubjectAmount==null){ + return BigDecimal.ZERO; + } + if (caseSubjectAmount.equals(BigDecimal.ZERO)) { + return BigDecimal.ZERO; + } + BigDecimal feeRate = new BigDecimal(0.01); + return caseSubjectAmount.multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP); + + } + + /** + * 修改案件 + * + * @param caseApplication + */ + @Transactional + + @Override + public void update(CaseApplicationDTO caseApplication) { + caseApplication.setFeePayable(calculateFee(caseApplication.getCaseSubjectAmount())); + caseApplication.setPaidExpenses(caseApplication.getFeePayable()); + caseApplication.setUpdateBy(SecurityUtils.getUsername()); + caseApplication.setUpdateTime(new Date()); + Integer updateSubmitStatus = 0; + // 立案申请状态直接修改主表信息 + if (caseApplication.getCaseStatus() != null && caseApplication.getCaseStatus().equals(CaseApplicationConstants.CASE_APPLICATION)) { + // 修改内置字段 + caseApplicationMapper.update(caseApplication); + if (CollectionUtil.isNotEmpty(caseApplication.getColumnValueList())) { + // 修改自定义字段 + for (ColumnValue columnValue : caseApplication.getColumnValueList()) { + if (StrUtil.isNotEmpty(columnValue.getValue())) { + columnValueMapper.updateColumnValue(columnValue); + } + } + } + } else { + // 修改记录表状态为已提交修改的内容 + updateSubmitStatus = UpdateSubmitStatus.COMMITTED.getCode(); + } + CaseApplication application = new CaseApplication(); + BeanUtil.copyProperties(caseApplication, application); + application.setUpdateSubmitStatus(updateSubmitStatus); + CaseAffiliateVO caseAffiliateVO = caseApplication.getAffiliate(); + List affliates = new ArrayList<>(); + // 删除已存在的人员 + caseAffiliateMapper.deleteByCaseId(caseApplication.getId()); + // 新增案件相关人员 + caseApplicationService.insertCaseAfflicate(caseAffiliateVO, affliates, caseApplication,true); + // 保存附件 + if (CollectionUtil.isNotEmpty(caseApplication.getCaseAttachList())) { + for (CaseAttach caseAttach : caseApplication.getCaseAttachList()) { + if (caseAttach == null) { + continue; + } + caseAttach.setCaseAppliId(caseApplication.getId()); + caseAttachMapper.updateCaseAttach(caseAttach); + } + } + // 修改自定义字段 + if (CollectionUtil.isNotEmpty(caseApplication.getColumnValueList())) { + columnValueMapper.batchUpdate(caseApplication.getColumnValueList()); + } + + // 根据案件id查询最新版本号 + Integer maxVersion = caseApplicationLogMapper.selectMaxVersionByCaseId(caseApplication.getId()); + if (maxVersion == null) { + maxVersion = 1; + } + caseApplication.setVersion(maxVersion + 1); + LoginUser loginUser = getLoginUser(); + // 异步新增案件日志 + List columnValueList = caseApplication.getColumnValueList(); + ThreadPoolUtil.execute(() -> { + //新增案件日志记录 + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_EDIT, "", loginUser); + + // 批量新增columnValue自定义字段 + if (CollectionUtil.isNotEmpty(columnValueList)) { + columnValueList.forEach(columnValue -> columnValue.setCaseId(caseApplication.getId())); + columnValueMapper.batchSave(columnValueList); + } + // 新增案件日志表 + application.setCaseAppliId(caseApplication.getId()); + // application.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode()); + application.setCaseLogId(IdWorkerUtil.getId()); + int insertRow = caseApplicationLogMapper.insert(application); + // 插入案件相关人员表日志 + if (insertRow != 0 && CollectionUtil.isNotEmpty(affliates)) { + affliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(application.getCaseLogId())); + + caseAffiliateLogMapper.batchCaseAffiliate(affliates); + } + // 插入附件表日志 + if (CollectionUtil.isNotEmpty(caseApplication.getCaseAttachList())) { + List filterList = caseApplication.getCaseAttachList().stream().filter(c -> c != null && c.getAnnexType().equals(2)).collect(Collectors.toList()); + // 插入日志附件表 + if (CollectionUtil.isNotEmpty(filterList)) { + for (CaseAttach caseAttach : filterList) { + // 查询附件表 + CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId()); + attach.setCaseAppliLogId(application.getCaseLogId()); + caseAttachLogMapper.save(attach); + } + } + + } + // 插入columnValueLog自定义字段日志表 + if (CollectionUtil.isNotEmpty(columnValueList)) { + columnValueList.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(application.getCaseLogId())); + columnValueLogMapper.batchSave(columnValueList); + + } + + + }); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java index 88f55e0..abbcc82 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java @@ -1,36 +1,24 @@ package com.ruoyi.wisdomarbitrate.service.impl; -import cn.hutool.core.collection.CollectionUtil; -import com.deepoove.poi.data.PictureRenderData; +import cn.hutool.core.util.StrUtil; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.redis.RedisCache; -import com.ruoyi.common.utils.WordUtil; +import com.ruoyi.common.exception.ServiceException; import com.ruoyi.wisdomarbitrate.domain.*; +import com.ruoyi.wisdomarbitrate.domain.entity.CaseAffiliateEntity; import com.ruoyi.wisdomarbitrate.mapper.*; +import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper; import com.ruoyi.wisdomarbitrate.service.IAdjudicationService; import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; -import com.ruoyi.common.utils.SmsUtils; +import com.ruoyi.wisdomarbitrate.utils.SmsUtils; import com.ruoyi.wisdomarbitrate.service.ICaseArbitrateService; -import org.apache.poi.xwpf.usermodel.XWPFDocument; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.StandardCopyOption; -import java.text.SimpleDateFormat; -import java.time.LocalDate; -import java.time.ZoneId; import java.util.*; -import java.util.function.Function; -import java.util.regex.Pattern; import java.util.stream.Collectors; import static com.ruoyi.common.utils.SecurityUtils.getUsername; @@ -55,100 +43,157 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { private RedisCache redisCache; @Autowired private ICaseApplicationService caseApplicationService; + @Autowired + private ICaseArbitrateService caseArbitrateService; @Override @Transactional - public AjaxResult examineArbitrateMethod(CaseApplication caseApplication, Integer opinion) { + public AjaxResult examineArbitrateMethod(CaseApplication caseApplication, Integer opinion, Integer arbitratMethodNow) { //查询案件详细信息 CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); if (caseApplication1 == null) { return AjaxResult.success(); } - Integer arbitratMethod = caseApplication1.getArbitratMethod(); - if (arbitratMethod == null) { - return AjaxResult.error("请先指定仲裁方式"); + // Integer currentStatus = caseApplication1.getCaseStatus(); + Integer arbitratMethodOriral = caseApplication.getArbitratMethod(); + if (arbitratMethodOriral == null) { + return AjaxResult.error("请选择仲裁方式"); } + String caseNum = caseApplication1.getCaseNum(); if (opinion == 0) { //拒绝 - if (arbitratMethod == 2) { + if (arbitratMethodOriral == 2) { caseApplication1.setArbitratMethod(1); // 更改仲裁方式 //修改案件状态修改开庭时间 caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE); //修改案件状态为待修改开庭时间 // caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, ""); + } else { caseApplication1.setArbitratMethod(2); //修改案件状态为待书面审理 caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR); - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, ""); + } - } else { - if (arbitratMethod == 2) { + } else if (opinion == 1) { + if (arbitratMethodOriral == 2) { //修改案件状态为待书面审理 + caseApplication1.setArbitratMethod(2); caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR); - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, ""); + } else { //修改案件状态为待修改开庭时间 + caseApplication1.setArbitratMethod(1); caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE); + + + } + } else if (opinion == 2) { + if (arbitratMethodNow == 2) { + //修改案件状态为待书面审理 + caseApplication1.setArbitratMethod(2); + caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR); + + + } else { //修改案件状态为待修改开庭时间 -// caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE); - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, ""); + caseApplication1.setArbitratMethod(1); + caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE); + } } + caseApplication1.setLockStatus(1); int i = caseApplicationMapper.submitCaseApplication(caseApplication1); if (i > 0) { String arbitratMethodStr = caseApplication1.getArbitratMethod() == 1 ? "开庭审理" : "书面审理"; - //发送短信通知 - SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(caseApplication1.getId()); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); //获取案件关联人信息 + //获取案件关联人信息 + List caseAffiliates = caseApplicationService.selectAfflicatesByCaseId(caseApplication1.getId()); if (caseAffiliates != null && caseAffiliates.size() > 0) { - for (CaseAffiliate affiliate : caseAffiliates) { - request.setTemplateId("1931000"); - request.setPhone(affiliate.getContactTelphone()); - // 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置 - // 1931000 尊敬的{1}用户,您的{2}仲裁案件,仲裁方式已确定为{3},请知晓,如非本人操作,请忽略本短信。 - String name = affiliate.getName(); - request.setTemplateParamSet(new String[]{name, caseNum, arbitratMethodStr}); - Boolean aBoolean = SmsUtils.sendSms(request); - //保存短信发送记录 - SmsSendRecord smsSendRecord = new SmsSendRecord(); - smsSendRecord.setCaseId(caseApplication.getId()); - smsSendRecord.setCaseNum(caseApplication1.getCaseNum()); - smsSendRecord.setPhone(request.getPhone()); - smsSendRecord.setSendTime(new Date()); - String content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,仲裁方式已确定为" + arbitratMethodStr + ",请知晓,如非本人操作,请忽略本短信。"; - smsSendRecord.setSendContent(content); - smsSendRecord.setCreateBy(getUsername()); - if (aBoolean){ - smsSendRecord.setSendStatus(1); - }else { - smsSendRecord.setSendStatus(0); - } - smsRecordMapper.saveSmsSendRecord(smsSendRecord); + ArrayList operatorList = new ArrayList<>(); + // 申请操作人 + Optional applicantAffiliateOpt = caseAffiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))).findFirst(); + // 被申请操作人 + Optional resAffiliateOpt = caseAffiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4))).findFirst(); + if (!applicantAffiliateOpt.isPresent() || !resAffiliateOpt.isPresent()) { + throw new ServiceException("未找到案件操作人员"); + } + operatorList.add(applicantAffiliateOpt.get()); + operatorList.add(resAffiliateOpt.get()); + for (CaseAffiliateEntity affiliate : operatorList) { + SmsUtils.sendSms(caseApplication1, "1931000", affiliate.getPhone(), new String[]{affiliate.getName(),caseApplication1.getCaseNum(),arbitratMethodStr}); } } - - return AjaxResult.success("审核成功"); } + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION_METHOD, ""); return AjaxResult.success(); } + @Override + @Transactional + public AjaxResult examineArbitrateMethodBatch(CaseApplication caseApplication) { + CaseApplication caseApplicationsel = new CaseApplication(); + caseApplicationsel.setBatchNumber(caseApplication.getBatchNumber()); + caseApplicationsel.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION_METHOD); + List caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); + if (caseApplications1 != null && caseApplications1.size() > 0) { + + + for (CaseApplication caseApplicationse : caseApplications1) { + caseArbitrateService.examineArbitrateMethod(caseApplicationse, caseApplication.getOpinion(), caseApplication.getArbitratMethod()); + } + + } else { + throw new ServiceException("这个批号没有批量审核仲裁方式的案件"); + } + + return AjaxResult.success(); + } + + @Override + @Transactional + public AjaxResult writtenHearBatch(CaseApplication caseApplicationparam) { + CaseApplication caseApplicationsel = new CaseApplication(); + caseApplicationsel.setBatchNumber(caseApplicationparam.getBatchNumber()); + caseApplicationsel.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR); + List caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); + if (caseApplications1 != null && caseApplications1.size() > 0) { + List ids = caseApplications1.stream().map(CaseApplication::getId).collect(Collectors.toList()); + for (Long caseId : ids) { + //查询案件详情 + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setId(caseId); + CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); + //案件日志表里添加数据 + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, ""); + + // 生成裁决书 + CaseApplication application = new CaseApplication(); + application.setId(caseId); + adjudicationService.createDocument(application); + //修改案件状态 + caseApplication1.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION); + int i = caseApplicationMapper.submitCaseApplication(caseApplication1); + + } + + } else { + throw new ServiceException("这个批号没有批量书面审理的案件"); + } + return AjaxResult.success(); + + } + @Override @Transactional public AjaxResult writtenHear(CaseIds caseIds) { - if (caseIds!=null){ + if (caseIds != null) { List ids = caseIds.getIds(); for (Long caseId : ids) { //查询案件详情 @@ -161,331 +206,28 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { ArbitrateRecord arbitrateRecord1 = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord); if (arbitrateRecord1 != null) { int i = arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); - if (i > 0) { - //案件日志表里添加数据 - CaseLogRecord caseLogRecord = new CaseLogRecord(); - caseLogRecord.setCaseAppliId(caseApplication1.getId()); - caseLogRecord.setCaseNode(caseApplication1.getCaseStatus()); - caseLogRecord.setCreateBy(getUsername()); - caseLogRecordMapper.insertCaseLogRecord(caseLogRecord); - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, ""); - } } else { //提交仲裁结果 int i = arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecord); - if (i > 0) { - //案件日志表里添加数据 - CaseLogRecord caseLogRecord = new CaseLogRecord(); - caseLogRecord.setCaseAppliId(caseApplication1.getId()); - caseLogRecord.setCaseNode(caseApplication1.getCaseStatus()); - caseLogRecord.setCreateBy(getUsername()); - caseLogRecordMapper.insertCaseLogRecord(caseLogRecord); - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, ""); - } } // 生成裁决书 CaseApplication application = new CaseApplication(); application.setId(caseId); adjudicationService.createDocument(application); - //修改案件状态 - caseApplication1.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION); - int i = caseApplicationMapper.submitCaseApplication(caseApplication1); - + //修改案件状态 + caseApplication1.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION); + int i = caseApplicationMapper.submitCaseApplication(caseApplication1); +// 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, ""); } + + return AjaxResult.success("审理成功"); } return AjaxResult.error("请检查参数"); } - //生成仲裁文书 - private Boolean generateAward(Long id) { - try { - Map datas = new HashMap<>(); - if (id == null) { - return null; - } - //获取案件详细信息 - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(id); - CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); - //生成编码 - String equipmentNo = getNewEquipmentNo(); - datas.put("num", equipmentNo); - //获取仲裁记录表里的相关信息 - ArbitrateRecord arbitrateRecord = new ArbitrateRecord(); - arbitrateRecord.setCaseAppliId(id); - ArbitrateRecord arbitrateRecord1 = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord); - //获取案件关联人信息 - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(id); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - List nameAgentList = new ArrayList<>(); - if (caseAffiliates != null && caseAffiliates.size() > 0) { - for (CaseAffiliate affiliate : caseAffiliates) { - //获取身份类型 - int identityType = affiliate.getIdentityType(); - if (identityType == 1) { //申请人 - datas.put("appName", affiliate.getName()); - datas.put("appAddress", affiliate.getResidenAffili()); - datas.put("appContactAddress", affiliate.getContactAddress()); - datas.put("appLegalPerson", affiliate.getCompLegalPerson()); - datas.put("appLegalPersonTitle", affiliate.getCompLegalperPost()); - datas.put("appAgentName", affiliate.getNameAgent()); - datas.put("appAgentTitle", affiliate.getAppliAgentTitle()); - nameAgentList.add(affiliate.getNameAgent()); - } else if (identityType == 2) { //被申请人 - datas.put("resName", affiliate.getName()); - datas.put("resAddress", affiliate.getResidenAffili()); - String responSex = affiliate.getResponSex(); - if (responSex.equals("0")) { - datas.put("resSex", "男"); - } else if (responSex.equals("1")){ - datas.put("resSex", "女"); - }else { - datas.put("resSex", "未知"); - } - Date responBirth = affiliate.getResponBirth(); - if (responBirth != null) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - String responBirthStr = sdf.format(responBirth); - datas.put("resDateOfBirth", responBirthStr); - - } - - datas.put("resContactAddress", affiliate.getContactAddress()); - nameAgentList.add(affiliate.getNameAgent()); - } - } - } - Date createTime = caseApplication1.getCreateTime(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - // 将日期格式化为字符串 - String createTimeStr = sdf.format(createTime); - datas.put("submissionDate", createTimeStr); - Date registerDate = caseApplication1.getRegisterDate(); - String registerDateStr = sdf.format(registerDate); - datas.put("acceptDate", registerDateStr); - //反请求 - Integer adjudicaCounter = caseApplication1.getAdjudicaCounter(); - String counterclaim = "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" + - "《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" + - "仲裁反请求案件受理后,秘书处向被申请人发送了仲裁反请求通知书及附件,向申请人发送了仲裁反请求通知书及附件、仲裁反请求申请书及附件。"; - if (adjudicaCounter == null) { - datas.put("counterclaim", null); - } else if (adjudicaCounter == 1) { - datas.put("counterclaim", counterclaim); - } else { - datas.put("counterclaim", null); - } - //财产保全 - Integer properPreser = caseApplication1.getProperPreser(); - String preservation = "本案受理后,申请人向仲裁委提交了财产保全申请,仲裁委根据《中华人民共和国仲裁法》" + - "第二十八条之规定,将该申请提交至法院。"; - if (properPreser == null) { - datas.put("preservation", null); - } else if (properPreser == 1) { - datas.put("preservation", preservation); - } else { - datas.put("preservation", null); - } - //管辖权异议 - Integer objectiJuris = caseApplication1.getObjectiJuris(); - String jurisdictionalObjection = "本案受理后,被申请人向仲裁委提交了《XX管辖异议申请书》,认为XXXXXX" + - ",仲裁委经审理,当庭驳回了被申请人的管辖异议申请,并告知被申请人具体的事实和理由将在裁决书中一并列明。"; - if (objectiJuris == null) { - datas.put("jurisdictionalObjection", null); - } else if (objectiJuris == 1) { - datas.put("jurisdictionalObjection", jurisdictionalObjection); - } else { - datas.put("jurisdictionalObjection", null); - } - String arbitratorName = caseApplication1.getArbitratorName(); - datas.put("arbitratorName", arbitratorName); - Integer arbitratMethod = caseApplication1.getArbitratMethod(); - Date hearDate = caseApplication1.getHearDate(); - if (hearDate != null) { - String hearDateStr = sdf.format(hearDate); - //线上开庭时 - if (arbitratMethod == 1) { - String onLine1 = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于"; - String onLine2 = "通过仲裁委智慧仲裁平台开庭审理了本案。"; - datas.put("onLine1", onLine1); - datas.put("hearDate", hearDateStr); - datas.put("onLine2", onLine2); - } else { - //书面仲裁时 - String written1 = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于"; - String written2 = "在仲裁委所在地开庭审理了本案。"; - datas.put("written1", written1); - datas.put("hearDate1", hearDateStr); - datas.put("written2", written2); - } - } - Integer isAbsence = caseApplication1.getIsAbsence(); - if (isAbsence == null) { - datas.put("absent1", null); - datas.put("absent2", null); - datas.put("absent3", null); - datas.put("absent4", null); - datas.put("absent5", null); - datas.put("attend1", null); - datas.put("attend2", null); - datas.put("attend3", null); - datas.put("attend4", null); - datas.put("attend5", null); - datas.put("attend6", null); - datas.put("attend7", null); - datas.put("appAgentName1", null); - datas.put("appAgentName2", null); - datas.put("resAgentName", null); - } else if (isAbsence == 1) { - //缺席审理 - String absent1 = "申请人的特别授权委托代理人"; - String absent2 = "出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" + - "《2022年版仲裁规则》第四十条第(二)项的规定,对本案进行了缺席审理。"; - String absent3 = "庭审中,申请人陈述了仲裁请求事项及事实与理由,出示了证据材料并进行了说明," + - "发表了意见,回答了仲裁庭的提问,并作了最后陈述。因被申请人缺席庭审,故仲裁庭无法组织调解。"; - String absent4 = "(二/三)当事人提供的证据材料\n" + - "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:"; - String absent5 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + - "第四十条第(二)项、第五十一条的规定,缺席裁决如下:"; - datas.put("absent1", absent1); - datas.put("absent2", absent2); - datas.put("absent3", absent3); - datas.put("absent4", absent4); - datas.put("absent5", absent5); - datas.put("appAgentName1", nameAgentList.get(0)); - } else { - //出席审理 - String attend1 = "申请人的特别授权委托代理人"; - String attend2 = "和被申请人本人/的特别授权委托代理人"; - String attend3 = "出席了庭审。"; - String attend4 = "庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;" + - "双方当事人均出示了证据材料并对对方的证据材料进行了质证;申请人出示了证据材料," + - "被申请人对对方的证据材料进行了质证;双方当事人均回答了仲裁庭的提问,进行了辩论," + - "并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。"; - String attend5 = "(二)被申请人的答辩意见"; - String attend6 = "(二/三)当事人提供的证据材料及对方的质证意见\n" + - "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:"; - String attend7 = "被申请人对上述材料的质证意见为:"; - datas.put("attend1", attend1); - datas.put("attend2", attend2); - datas.put("attend3", attend3); - datas.put("attend4", attend4); - datas.put("attend5", attend5); - datas.put("attend6", attend6); - datas.put("attend7", attend7); - datas.put("responCrossOpin", caseApplication1.getResponCrossOpin()); - datas.put("appAgentName2", nameAgentList.get(0)); - datas.put("resAgentName", nameAgentList.get(1)); - if (arbitratMethod == 1) { - //被申出席+开庭 - String attend8 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + - "第五十一条的规定,裁决如下:"; - datas.put("attend8", attend8); - } else { - //被申出席+书面 - String attend9 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + - "第五十一条、第五十八条的规定,裁决如下:"; - datas.put("attend9", attend9); - } - } - datas.put("claims", caseApplication1.getArbitratClaims()); - datas.put("request", caseApplication1.getRequestRule()); - CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplication); - List caseAttachList1 = caseApplication2.getCaseAttachList(); - if (caseAttachList1 != null && caseAttachList1.size() > 0) { - for (CaseAttach caseAttach : caseAttachList1) { - if (caseAttach.getAnnexType() == 6) { //被申请人证据材料 - String annexName = caseAttach.getAnnexName(); - boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName); - if (isImageFile) { - String annexPath = "/home/ruoyi" + caseAttach.getAnnexPath(); - System.out.println("路径是===========" + annexPath); - PictureRenderData pictureRenderData = WordUtil - .rebuildImageContent(100, 100, null, annexPath); - datas.put("resEvidenceMaterial", pictureRenderData); - } - } else if (caseAttach.getAnnexType() == 2) { //申请人证据材料 - String annexName = caseAttach.getAnnexName(); - boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName); - if (isImageFile) { - String annexPath = "/home/ruoyi" + caseAttach.getAnnexPath(); - System.out.println("路径是===========" + annexPath); - PictureRenderData pictureRenderData = WordUtil - .rebuildImageContent(100, 100, null, annexPath); - //申请人证据材料 - datas.put("appEvidenceMaterial", pictureRenderData); - } - } - } - } - datas.put("applicaCrossOpin", "被申请人证据不足,无法说明事实"); - datas.put("factDetermi", "被申请人欠款属实"); - datas.put("arbitrateThink", " 被申请人应按约定还款"); - datas.put("rulingFollows", "被申请人依法偿还申请人欠款"); - LocalDate now = LocalDate.now(); - String year = Integer.toString(now.getYear()); - datas.put("year", year); - String month = String.format("%02d", now.getMonthValue()); - String day = String.format("%02d", now.getDayOfMonth()); - String modalFilePath = "/data/arbitrate-document/template/新裁决书模板.docx"; - //String modalFilePath = "D:/develop/新裁决书模板.docx"; - String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; - //String saveFolderPath = "D:/data/" + year + "/" + month + "/" + day; - String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx"; - String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; - String resultFilePath = saveFolderPath + "/" + fileName; - // 创建日期目录 - File saveFolder = new File(saveFolderPath); - if (!saveFolder.exists()) { - saveFolder.mkdirs(); - } - Path sourcePath = new File(modalFilePath).toPath(); - Path destinationPath = new File(resultFilePath).toPath(); - Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING); - String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath); - File file = new File(docFilePath); - if (file.exists()) { - InputStream in = new FileInputStream(file); - XWPFDocument xwpfDocument = new XWPFDocument(in); - WordUtil.changeText(xwpfDocument); - } - String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8); - CaseAttach caseAttach = CaseAttach.builder() - .caseAppliId(id) - .annexName(saveName) - .annexPath(savePath) - .annexType(3) - .build(); - //保存到附件表里,先判断之前有没有,有的话更新,没有的话新增 - CaseAttach caseAttach1 = new CaseAttach(); - caseAttach1.setAnnexType(3); - caseAttach1.setCaseAppliId(id); - List caseAttachList = caseAttachMapper.getCaseAttachByCaseIdAndType(caseAttach1); - if (caseAttachList != null && caseAttachList.size() > 0) { - //之前已经生成过了,更新 - caseAttachMapper.updateCaseAttachBycaseid(caseAttach); - } else { - //之前没生成过,新增 - int i = caseAttachMapper.save(caseAttach); - if (i > 0) { - if (arbitrateRecord1 != null) { - Integer annexId = caseAttach.getAnnexId(); - //将附件id保存到仲裁记录表里面 - arbitrateRecord1.setAnnexId(annexId); - arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord1); - } - } - } - return Boolean.TRUE; - } catch (IOException e) { - return Boolean.FALSE; - } - } public String getNewEquipmentNo() { Object awardNum = redisCache.getCacheObject("awardNum"); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java index 5899238..9626ee9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java @@ -2,27 +2,25 @@ package com.ruoyi.wisdomarbitrate.service.impl; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; import com.ruoyi.common.config.RuoYiConfig; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.domain.entity.SysRole; import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.common.core.domain.model.LoginUser; -import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.common.utils.SmsUtils; +import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper; +import com.ruoyi.wisdomarbitrate.utils.SmsUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.spring.SpringUtils; import com.ruoyi.system.mapper.SysUserMapper; import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceDirectoryVO; +import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; import com.ruoyi.common.utils.file.FileUploadUtils; import com.ruoyi.wisdomarbitrate.domain.*; import com.ruoyi.wisdomarbitrate.domain.dto.CaseEvidenceDTO; -import com.ruoyi.wisdomarbitrate.domain.vo.CaseDetailVO; -import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO; import com.ruoyi.wisdomarbitrate.mapper.*; import com.ruoyi.wisdomarbitrate.service.ICaseEvidenceService; -import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -32,6 +30,7 @@ import java.io.IOException; import java.util.*; import java.util.stream.Collectors; +import static com.google.common.io.Files.getFileExtension; import static com.ruoyi.common.utils.SecurityUtils.getUsername; @Service @@ -48,60 +47,82 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { private CaseEvidenceDirectoryMapper caseEvidenceDirectoryMapper; @Autowired private SysUserMapper sysUserMapper; +// @Autowired +// private SmsRecordMapper smsRecordMapper; @Autowired - private SmsRecordMapper smsRecordMapper; + private ICaseApplicationService caseApplicationService; - @Override - @Transactional - public AjaxResult getCaseDetailsById(Long id, String userName) { - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(id); - CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); - if (caseApplication1 != null) { - CaseDetailVO caseDetailVO = new CaseDetailVO(); - BeanUtils.copyProperties(caseApplication1, caseDetailVO); - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(id); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - for (CaseAffiliate affiliate : caseAffiliates) { - if (affiliate.getName() != null) { - String name = affiliate.getName(); - //判断当前登录人和案件关联人姓名是否一致 - if (name.equals(userName)) { //一致,将案件关联人的身份类型赋给当前登录人 - caseDetailVO.setIdentityType(affiliate.getIdentityType()); - } - } - if (affiliate.getIdentityType() == 1) { //申请人 - caseDetailVO.setApplicantName(affiliate.getName()); - } else { - caseDetailVO.setRespondentName(affiliate.getName()); - } - //根据案件id查询案件证据材料 - List evidenceMaterialList = caseAttachMapper.queryAnnexPathByCaseId(id); - if (evidenceMaterialList != null && evidenceMaterialList.size() > 0) { - for (CaseAttach caseAttach : evidenceMaterialList) { - //根据附件类型决定返回的路径 - Integer annexType = caseAttach.getAnnexType(); - if (annexType != 1){ - String path = caseAttach.getAnnexName(); - String prefix = "/profile"; - int startIndex = path.indexOf(prefix); - startIndex += prefix.length(); - String extractedPath = "/uploadPath" + path.substring(startIndex); - caseAttach.setAnnexPath(extractedPath); - }else { - String annexPath = caseAttach.getAnnexPath(); - String result = annexPath.replace("/home/ruoyi", ""); - caseAttach.setAnnexPath(result); - } - } - } - caseDetailVO.setEvidenceMaterialList(evidenceMaterialList); - } - return AjaxResult.success(caseDetailVO); - } - return null; - } +// @Override +// @Transactional +// public AjaxResult getCaseDetailsById(Long id, String userName) { +// CaseApplication caseApplication = new CaseApplication(); +// caseApplication.setId(id); +// CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); +// if (caseApplication1 != null) { +// CaseDetailVO caseDetailVO = new CaseDetailVO(); +// BeanUtils.copyProperties(caseApplication1, caseDetailVO); +// CaseAffiliate caseAffiliate = new CaseAffiliate(); +// caseAffiliate.setCaseAppliId(id); +// List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); +// for (CaseAffiliate affiliate : caseAffiliates) { +// if (affiliate.getName() != null) { +// String name = affiliate.getName(); +// //判断当前登录人和案件关联人姓名是否一致 +// if (name.equals(userName)) { //一致,将案件关联人的身份类型赋给当前登录人 +// caseDetailVO.setIdentityType(affiliate.getIdentityType()); +// } +// } +// if (affiliate.getIdentityType() == 1) { //申请人 +// caseDetailVO.setApplicantName(affiliate.getName()); +// } else { +// caseDetailVO.setRespondentName(affiliate.getName()); +// } +// //根据案件id查询案件证据材料 +// List evidenceMaterialList = caseAttachMapper.queryAnnexPathByCaseId(id); +// if (evidenceMaterialList != null && evidenceMaterialList.size() > 0) { +//// for (CaseAttach caseAttach : evidenceMaterialList) { +//// //根据附件类型决定返回的路径 +//// Integer annexType = caseAttach.getAnnexType(); +//// if (annexType != 1){ +//// String path = caseAttach.getAnnexName(); +//// String prefix = "/profile"; +//// int startIndex = path.indexOf(prefix); +//// startIndex += prefix.length(); +//// String extractedPath = "/uploadPath" + path.substring(startIndex); +//// caseAttach.setAnnexPath(extractedPath); +//// }else { +//// String annexPath = caseAttach.getAnnexPath(); +//// String result = annexPath.replace("/home/ruoyi", ""); +//// caseAttach.setAnnexPath(result); +//// } +//// } +// +// for (CaseAttach caseAttach : evidenceMaterialList) { +// String annexName = caseAttach.getAnnexName(); +// String prefix = "/profile"; +// int startIndex = annexName.indexOf(prefix); +// if(startIndex!=-1) { +// startIndex += prefix.length(); +// +// String annexPath = "/uploadPath" + annexName.substring(startIndex); +// caseAttach.setAnnexPath(annexPath); +// } +// int startIndexnew = annexName.lastIndexOf("/"); +// if (startIndexnew != -1) { +// String annexNamenew = annexName.substring(startIndexnew + 1); +// caseAttach.setAnnexName(annexNamenew); +// } +// +// +// } +// +// } +// caseDetailVO.setEvidenceMaterialList(evidenceMaterialList); +// } +// return AjaxResult.success(caseDetailVO); +// } +// return null; +// } @Override @Transactional @@ -110,19 +131,62 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { if (file.isEmpty()) { return AjaxResult.error("请选择要上传的文件"); } + AjaxResult success = AjaxResult.success(); try { String filePath = RuoYiConfig.getUploadPath(); // 上传 String fileName = FileUploadUtils.upload(filePath, file); - CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id) - .annexName(fileName) - .annexPath(filePath) - .annexType(annexType) - .userId(userId) - .userName(userName) - .build(); - int count = caseAttachMapper.save(caseAttach); - if (count > 0 && annexType != null && annexType != 8) { + String name = file.getOriginalFilename(); + String suffix = getFileExtension(fileName); + if(StrUtil.isNotEmpty(suffix)&& suffix.contains("doc")){ + // 上传到onlyoffice + JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(fileName,id); + if(jsonArray!=null && jsonArray.size() > 0) { + for (Object obj : jsonArray) { + JSONObject jsonObject = (JSONObject) obj; + String path = jsonObject.get("filePath")!=null?jsonObject.getString("filePath"):""; + path=path.replace("/home/ruoyi/uploadPath/","/profile/"); + name = jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):""; + CaseAttach caseAttach = CaseAttach.builder() + .caseAppliId(id) + .annexType(annexType) + .annexName(name) + .onlyOfficeFileId(jsonObject.getString("fileId")) + .annexPath(path) + .build(); +// if(jsonObject.get("filePath")!=null){ +// String officePath = jsonObject.getString("filePath"); +// String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/"); +// caseAttach.setAnnexPath(replace); +// +// } + if(annexType!=null && annexType.equals(8)){ + // 缴费单,先删除 + caseAttachMapper.deleteCaseAttachByCasedIdAndType(id,annexType); + } + caseAttachMapper.save(caseAttach); + success.put("annexId", caseAttach.getAnnexId()); + success.put("annexType", caseAttach.getAnnexType()); + } + } + }else { + filePath=fileName.replace("/home/ruoyi/uploadPath/","/profile/"); + if(annexType!=null && annexType.equals(8)){ + // 缴费单,先删除 + caseAttachMapper.deleteCaseAttachByCasedIdAndType(id,annexType); + } + CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id) + .annexName(name) + .annexPath(filePath) + .annexType(annexType) + .userId(userId) + .userName(userName) + .build(); + int count = caseAttachMapper.save(caseAttach); + success.put("annexId", caseAttach.getAnnexId()); + success.put("annexType", caseAttach.getAnnexType()); + } + if ( annexType != null && annexType != 8) { if (id != null) { //修改案件状态 CaseApplication caseApplication = new CaseApplication(); @@ -131,18 +195,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { caseApplicationMapper.submitCaseApplication(caseApplication); } } - CaseAttach caseAttachselect = new CaseAttach(); - caseAttachselect.setAnnexId(caseAttach.getAnnexId()); - String annexName = caseAttach.getAnnexName(); - if(StrUtil.isNotEmpty(annexName)) { - int startIndexnew = annexName.lastIndexOf("/"); - if (startIndexnew != -1) { - String annexNamenew = annexName.substring(startIndexnew + 1); - caseAttach.setAnnexName(annexNamenew); - } - } - caseAttachselect.setAnnexType(caseAttach.getAnnexType()); - return AjaxResult.success("上传成功", caseAttachselect); + return success; } catch (IOException e) { e.printStackTrace(); } @@ -154,47 +207,49 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { @Autowired IdentityAuthenticationMapper identityAuthenticationMapper; - @Override - public List getCaseListAll(Integer caseStatus) { - // 是否为超级管理员 - int adMinFlag=0; - String identityNum = ""; - IdentityAuthentication authentication = new IdentityAuthentication(); - LoginUser loginUser = SecurityUtils.getLoginUser(); - // 查询该用户的角色 - // 查询登录人身份证号 - SysUser sysUser = sysUserMapper.selectUserById(loginUser.getUserId()); - String username = sysUser.getUserName(); - List roles = sysUser.getRoles(); - if(CollectionUtil.isNotEmpty(roles)){ - for (SysRole role : roles) { - if(role.getRoleName().equals("超级管理员") - ){ - // 超级管理员可查看所有待案件质证的案件 - adMinFlag=1; - break; - } - } - } - if(adMinFlag!=1) { - authentication.setUserName(username); - IdentityAuthentication authentication1 = identityAuthenticationMapper.selectIdentityAuthentication(authentication); - if (authentication1 != null) { - identityNum = authentication1.getIdentityNo(); - } - } - - List caseStatusList = Arrays.asList(caseStatus); - return getCaseEvidenceVOList(identityNum, caseStatusList, 2); - } +// @Override +// public List getCaseListAll(Integer caseStatus) { +// // 是否为超级管理员 +// int adMinFlag=0; +// String identityNum = ""; +// IdentityAuthentication authentication = new IdentityAuthentication(); +// LoginUser loginUser = SecurityUtils.getLoginUser(); +// // 查询该用户的角色 +// // 查询登录人手机号 +// SysUser sysUser = sysUserMapper.selectUserById(loginUser.getUserId()); +// String username = sysUser.getUserName(); +// List roles = sysUser.getRoles(); +// if(CollectionUtil.isNotEmpty(roles)){ +// for (SysRole role : roles) { +// if(role.getRoleName().equals("超级管理员") +// ){ +// // 超级管理员可查看所有待案件质证的案件 +// adMinFlag=1; +// break; +// } +// } +// } +//// if(adMinFlag!=1) { +//// authentication.setUserName(username); +//// IdentityAuthentication authentication1 = identityAuthenticationMapper.selectIdentityAuthentication(authentication); +//// if (authentication1 != null) { +//// identityNum = authentication1.getIdentityNo(); +//// } +//// } +// String phone=sysUser.getPhonenumber(); +// List caseStatusList = Arrays.asList(caseStatus); +//// return getCaseEvidenceVOList(identityNum, caseStatusList, 2); +// return getCaseEvidenceVOListByPhone(phone, caseStatusList, 2); +// } @Override public AjaxResult evidenceConfirmation(CaseApplication caseApplication) { + // Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_TRIAL); int i = caseApplicationMapper.submitCaseApplication(caseApplication); if (i > 0) { // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_TRIAL, ""); +// CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants., ""); return AjaxResult.success("证据确认成功"); } @@ -215,6 +270,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { caseApplication1.setPendingAppointArbotrar(caseEvidenceDTO.getPendingAppointArbotrar()); caseApplication1.setAdjudicaCounter(caseEvidenceDTO.getAdjudicaCounter()); caseApplication1.setObjectiJuris(caseEvidenceDTO.getObjectiJuris()); + caseApplication1.setRespondentIsWrittenHear(caseEvidenceDTO.getRespondentIsWrittenHear()); List arbitrators = caseEvidenceDTO.getArbitrators(); if (arbitrators != null && arbitrators.size() > 0) { List ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList()); @@ -227,18 +283,11 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { //修改案件状态 caseApplication1.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL_SUBMMIT); - Integer respondentIsWrittenHear = caseEvidenceDTO.getRespondentIsWrittenHear(); - if(respondentIsWrittenHear.intValue()==1){ - //书面审理 - caseApplication1.setArbitratMethod(2); - }else { - //开庭审理 - caseApplication1.setArbitratMethod(1); - } + int i = caseApplicationMapper.submitCaseApplication(caseApplication1); if (i > 0) { // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL_SUBMMIT, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_CROSSEXAMI, ""); return AjaxResult.success("提交成功"); } @@ -249,27 +298,44 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { @Transactional @Override public AjaxResult batchUpload(MultipartFile[] files, Integer annexType, Long id, String userName, Long userId) { - List successList = new ArrayList<>(); try { String filePath = RuoYiConfig.getUploadPath(); for (MultipartFile file : files) { // 上传 String fileName = FileUploadUtils.upload(filePath, file); - CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id) - .annexName(fileName) - .annexPath(filePath) - .annexType(annexType) - .userId(userId) - .userName(userName) - .isBatchUpload(1) - .build(); - int count = caseAttachMapper.save(caseAttach); - if (count > 0 && annexType != null && annexType != 8) { - CaseAttach caseAttachselect = new CaseAttach(); - caseAttachselect.setAnnexId(caseAttach.getAnnexId()); - caseAttachselect.setAnnexName(caseAttach.getAnnexName()); - caseAttachselect.setAnnexType(caseAttach.getAnnexType()); - successList.add(caseAttachselect); + String name=file.getOriginalFilename(); + String suffix = getFileExtension(fileName); + if (StrUtil.isNotEmpty(suffix) && suffix.contains("doc")) { + // 上传onlyoffice + JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(fileName,id); + if(jsonArray!=null && jsonArray.size() > 0) { + for (Object obj : jsonArray) { + JSONObject jsonObject = (JSONObject) obj; + String path = jsonObject.get("filePath")!=null?jsonObject.getString("filePath"):""; + // name = jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):""; + path=path.replace("/home/ruoyi/uploadPath/","/profile/"); + + CaseAttach caseAttach = CaseAttach.builder() + .caseAppliId(id) + .annexType(annexType) + .annexName(name) + .annexPath(path) + .onlyOfficeFileId(jsonObject.getString("fileId")) + .build(); + caseAttachMapper.save(caseAttach); + } + } + }else { + filePath=fileName.replace("/home/ruoyi/uploadPath/","/profile/"); + CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id) + .annexName(name) + .annexPath(filePath) + .annexType(annexType) + .userId(userId) + .userName(userName) + .isBatchUpload(1) + .build(); + int count = caseAttachMapper.save(caseAttach); } } @@ -280,44 +346,23 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { } // 给秘书发送短信 // 根据caseid查询该案件的法律顾问,根据案件id查申请表,查到申请机构id,然后拿申请机构id查询在哪个人下并且角色要是法律顾问 - CaseAffiliate caseAffiliate = caseAffiliateMapper.selectCaseAffiliateByIdentityType(id, 1); - if(caseAffiliate!= null && StrUtil.isNotEmpty(caseAffiliate.getApplicationOrganId())){ - List userList= sysUserMapper.selectByDeptIdAndRole(caseAffiliate.getApplicationOrganId(),"法律顾问"); - if(CollectionUtil.isNotEmpty(userList)){ +// CaseAffiliate caseAffiliate = caseAffiliateMapper.selectCaseAffiliateByIdentityType(id, 1); +// if(caseAffiliate!= null && StrUtil.isNotEmpty(caseAffiliate.getApplicationOrganId())){ +// List userList= sysUserMapper.selectByDeptIdAndRole(caseAffiliate.getApplicationOrganId(),"法律顾问"); + SysUser user= sysUserMapper.selectUserByRole("法律顾问"); + if(user!=null){ // 新增短信记录 - SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - // 1992106 普通短信 修改证据资料通知 尊敬的{1}用户,您的{2}仲裁案件,有新的证据上传,请知晓,如非本人操作,请忽略本短信。 - request.setTemplateId("1992106"); + CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(id); caseApplication = caseApplicationMapper.selectCaseApplication(caseApplication); - for (SysUser user : userList) { - request.setPhone(user.getPhonenumber()); - request.setTemplateParamSet(new String[]{user.getNickName(),caseApplication.getCaseNum()}); - Boolean aBoolean = SmsUtils.sendSms(request); - //保存短信发送记录 - SmsSendRecord smsSendRecord = new SmsSendRecord(); - smsSendRecord.setCaseId(caseAffiliate.getCaseAppliId()); - - smsSendRecord.setCaseNum(caseApplication.getCaseNum()); - smsSendRecord.setPhone(request.getPhone()); - smsSendRecord.setSendTime(new Date()); - String content = "尊敬的" + user.getNickName() + ",您的"+caseApplication.getCaseNum()+"仲裁案件,有新的证据上传,请知晓,如非本人操作,请忽略本短信。"; - smsSendRecord.setSendContent(content); - smsSendRecord.setCreateBy(getUsername()); - if (aBoolean) { - smsSendRecord.setSendStatus(1); - } else { - smsSendRecord.setSendStatus(0); - } - smsRecordMapper.saveSmsSendRecord(smsSendRecord); - } + SmsUtils.sendSms(caseApplication, "1992106", user.getPhonenumber(), new String[]{user.getNickName(),caseApplication.getCaseNum()}); } - } - return AjaxResult.success("上传成功", successList); + + return AjaxResult.success("上传成功"); } @@ -329,17 +374,13 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { List caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication); if (CollectionUtil.isNotEmpty(caseAttachList)) { for (CaseAttach caseAttach : caseAttachList) { - String annexName = caseAttach.getAnnexName(); - String prefix = "/profile"; - int startIndex = annexName.indexOf(prefix); - startIndex += prefix.length(); - String annexPath = "/uploadPath" + annexName.substring(startIndex); - caseAttach.setAnnexPath(annexPath); - int startIndexnew = annexName.lastIndexOf("/"); - if (startIndexnew != -1) { - String annexNamenew = annexName.substring(startIndexnew + 1); - caseAttach.setAnnexName(annexNamenew); + String annexPath = caseAttach.getAnnexPath(); + if(StrUtil.isEmpty(annexPath)){ + continue; } + caseAttach.setAnnexPath(annexPath); + caseAttach.setAnnexName(caseAttach.getAnnexName()); + } return AjaxResult.success(caseAttachList); } @@ -347,7 +388,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { } @Override - public int deleteFile(List fileIds) { + public int deleteFile(List fileIds) { return caseAttachMapper.deleteByFileIds(fileIds); } @@ -409,25 +450,16 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { String filePath = RuoYiConfig.getUploadPath(); // 上传 String fileName = FileUploadUtils.upload(filePath, file); + fileName=fileName.replace("/home/ruoyi/uploadPath/","/profile/"); CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id) - .annexName(fileName) - .annexPath(filePath) + .annexName(file.getOriginalFilename()) + .annexPath(fileName) .annexType(annexType) .userId(userId) .userName(username) .build(); - - CaseApplication caseApplicationsel = new CaseApplication(); - caseApplicationsel.setId(id); - caseApplicationsel.setAnnexType(7); - List caseAttachs = caseAttachMapper.queryCaseAttachList(caseApplicationsel); - if(caseAttachs!=null&&caseAttachs.size()>0){ - caseAttachMapper.deleteCaseAttachByCasedIdAndType(id,7); - int count = caseAttachMapper.save(caseAttach); - }else { - int count = caseAttachMapper.save(caseAttach); - } - + caseAttachMapper.deleteCaseAttachByCasedIdAndType(id,annexType); + int count = caseAttachMapper.save(caseAttach); return AjaxResult.success("上传成功"); } catch (IOException e) { e.printStackTrace(); @@ -473,25 +505,44 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { return getChildList(list, t).size() > 0; } - private List getCaseEvidenceVOList(String identityNum, List caseStatusList, Integer identityType) { - List caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatusList, identityType); - // todo 返回房间号和开庭时间 - if (caseListByRespondent != null && caseListByRespondent.size() > 0) { - for (CaseEvidenceVO caseEvidenceVO : caseListByRespondent) { - //根据案件id查询姓名 - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(caseEvidenceVO.getId()); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - for (CaseAffiliate affiliate : caseAffiliates) { - if (affiliate.getIdentityType() == 1) { //申请人 - caseEvidenceVO.setApplicantName(affiliate.getName()); - } else { - caseEvidenceVO.setRespondentName(affiliate.getName()); - } - } - } - return caseListByRespondent; - } - return null; - } +// private List getCaseEvidenceVOList(String identityNum, List caseStatusList, Integer identityType) { +// List caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatusList, identityType,null,SecurityUtils.getUsername()); +// if (caseListByRespondent != null && caseListByRespondent.size() > 0) { +// for (CaseEvidenceVO caseEvidenceVO : caseListByRespondent) { +// //根据案件id查询姓名 +// CaseAffiliate caseAffiliate = new CaseAffiliate(); +// caseAffiliate.setCaseAppliId(caseEvidenceVO.getId()); +// List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); +// for (CaseAffiliate affiliate : caseAffiliates) { +// if (affiliate.getIdentityType() == 1) { //申请人 +// caseEvidenceVO.setApplicantName(affiliate.getName()); +// } else { +// caseEvidenceVO.setRespondentName(affiliate.getName()); +// } +// } +// } +// return caseListByRespondent; +// } +// return null; +// } +// private List getCaseEvidenceVOListByPhone(String phone, List caseStatusList, Integer identityType) { +// List caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(null, caseStatusList, identityType,phone,SecurityUtils.getUsername()); +// if (caseListByRespondent != null && caseListByRespondent.size() > 0) { +// for (CaseEvidenceVO caseEvidenceVO : caseListByRespondent) { +// //根据案件id查询姓名 +// CaseAffiliate caseAffiliate = new CaseAffiliate(); +// caseAffiliate.setCaseAppliId(caseEvidenceVO.getId()); +// List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); +// for (CaseAffiliate affiliate : caseAffiliates) { +// if (affiliate.getIdentityType() == 1) { //申请人 +// caseEvidenceVO.setApplicantName(affiliate.getName()); +// } else { +// caseEvidenceVO.setRespondentName(affiliate.getName()); +// } +// } +// } +// return caseListByRespondent; +// } +// return null; +// } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java index 78ff7f5..2c09206 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java @@ -4,12 +4,15 @@ import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.StrUtil; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord; +import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper; import com.ruoyi.wisdomarbitrate.mapper.CaseLogRecordMapper; import com.ruoyi.wisdomarbitrate.service.ICaseLogRecordService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; import java.util.Optional; @@ -17,10 +20,13 @@ import java.util.Optional; public class CaseLogRecordServiceImpl implements ICaseLogRecordService { @Autowired private CaseLogRecordMapper caseLogRecordMapper; - + @Autowired + private CaseApplicationMapper applicationMapper; @Override public List selectCaseLogRecordList(CaseLogRecord caseLogRecord) { + CaseApplication caseApplicationReq = new CaseApplication(); + caseApplicationReq.setId(caseLogRecord.getCaseAppliId()); List records = caseLogRecordMapper.selectCaseLogRecordList(caseLogRecord); if(CollectionUtil.isNotEmpty(records)){ records.forEach(record->{ @@ -30,7 +36,11 @@ public class CaseLogRecordServiceImpl implements ICaseLogRecordService { caseNodeTime= DateUtil.format(record.getCaseNodeTime(), DatePattern.NORM_DATETIME_FORMATTER); } - contentBuilder.append(Optional.ofNullable(record.getCreateNickName()).orElse("")).append("(").append(record.getCreateBy()).append(")").append("于").append(caseNodeTime); + contentBuilder.append(Optional.ofNullable(record.getCreateNickName()).orElse("")); + if(StrUtil.isNotEmpty(record.getCreateBy())) { + contentBuilder.append("(").append(record.getCreateBy()).append(")"); + } + contentBuilder.append("于").append(caseNodeTime); if(StrUtil.isNotEmpty(record.getContent())){ contentBuilder.append(record.getContent()); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseNumRuleServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseNumRuleServiceImpl.java index cf3c669..754e6dd 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseNumRuleServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseNumRuleServiceImpl.java @@ -1,6 +1,7 @@ package com.ruoyi.wisdomarbitrate.service.impl; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.StringUtils; import com.ruoyi.wisdomarbitrate.domain.CaseNumRule; import com.ruoyi.wisdomarbitrate.mapper.CaseNumRuleMapper; import com.ruoyi.wisdomarbitrate.service.ICaseNumRuleService; @@ -19,6 +20,10 @@ public class CaseNumRuleServiceImpl implements ICaseNumRuleService { @Override @Transactional public AjaxResult insertCaseNumRule(CaseNumRule caseNumRule) { + int countCaseNumRule = caseNumRuleMapper.countCaseNumRule(caseNumRule); + if (countCaseNumRule>0){ + return AjaxResult.error("不能新增相同案件编号规则"); + } int i = caseNumRuleMapper.insertCaseNumRule(caseNumRule); if (i>0){ return AjaxResult.success("新增成功"); @@ -30,11 +35,15 @@ public class CaseNumRuleServiceImpl implements ICaseNumRuleService { @Override @Transactional public AjaxResult updateCaseNumRule(CaseNumRule caseNumRule) { + int countCaseNumRule = caseNumRuleMapper.countCaseNumRule(caseNumRule); + if (countCaseNumRule>0){ + return AjaxResult.error("不能修改相同案件编号规则"); + } int i = caseNumRuleMapper.updateCaseNumRule(caseNumRule); if (i > 0) { return AjaxResult.success("修改成功"); } - return AjaxResult.error(); + return AjaxResult.error("新增失败"); } @@ -58,4 +67,6 @@ public class CaseNumRuleServiceImpl implements ICaseNumRuleService { } + + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java index 7e84baa..c941744 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java @@ -2,20 +2,21 @@ package com.ruoyi.wisdomarbitrate.service.impl; import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; import com.ruoyi.ElegentPay; import com.ruoyi.common.constant.CaseApplicationConstants; -import com.ruoyi.common.constant.HttpStatus; import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.exception.ServiceException; -import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; import com.ruoyi.wisdomarbitrate.domain.*; import com.ruoyi.wisdomarbitrate.domain.dto.CaseConfirmPayDTO; +import com.ruoyi.wisdomarbitrate.domain.entity.CaseAffiliateEntity; import com.ruoyi.wisdomarbitrate.domain.vo.CasePayListVO; import com.ruoyi.wisdomarbitrate.mapper.*; +import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper; import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; -import com.ruoyi.common.utils.SmsUtils; +import com.ruoyi.wisdomarbitrate.utils.SmsUtils; import com.ruoyi.dto.PayRequest; import com.ruoyi.dto.PayResponse; import com.ruoyi.wisdomarbitrate.domain.dto.CasePayDTO; @@ -28,6 +29,8 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; import static com.ruoyi.common.utils.SecurityUtils.getUsername; @@ -41,6 +44,9 @@ public class CasePaymentServiceImpl implements ICasePaymentService { private CaseAttachMapper caseAttachMapper; @Autowired private SmsRecordMapper smsRecordMapper; + @Autowired + private ArbitrateRecordMapper arbitrateRecordMapper; + private ICasePaymentService casePaymentService; @Autowired public CasePaymentServiceImpl(ElegentPay elegentPay @@ -90,89 +96,93 @@ public class CasePaymentServiceImpl implements ICasePaymentService { @Transactional public AjaxResult callback(String orderNumber) { //查询记录 - CasePaymentRecord casePaymentRecord = casePaymentRecordMapper.queryRecord(orderNumber); - if (casePaymentRecord == null) { + List casePaymentRecords = casePaymentRecordMapper.queryRecord(orderNumber); + if(casePaymentRecords!=null&&casePaymentRecords.size()>0){ + for (CasePaymentRecord casePaymentRecord:casePaymentRecords){ + Long caseId = casePaymentRecord.getCaseId(); + //更改记录表里的支付状态和支付时间 + casePaymentRecord.setPaymentStatus(1); + casePaymentRecord.setPaymentTime(new Date()); + casePaymentRecord.setUpdateTime(new Date()); + casePaymentRecordMapper.update(casePaymentRecord); + } + }else { return AjaxResult.error("未查询到相关记录"); } - Long caseId = casePaymentRecord.getCaseId(); - //更改记录表里的支付状态和支付时间 - casePaymentRecord.setPaymentStatus(1); - casePaymentRecord.setPaymentTime(new Date()); - casePaymentRecord.setUpdateTime(new Date()); - casePaymentRecordMapper.update(casePaymentRecord); - return AjaxResult.success("支付成功"); } @Override @Transactional - public AjaxResult confirmPayment(CaseApplication caseApplication) { - caseApplication.setCaseStatus(CaseApplicationConstants.CASE_CROSSEXAMI); - int i = caseApplicationMapper.submitCaseApplication(caseApplication); - if (i > 0) { - //发送短信通知 - SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(caseApplication.getId()); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); //获取案件关联人信息 + public AjaxResult confirmPayment( BatchCaseApplication batchCaseApplication) { + for (Long id : batchCaseApplication.getIds()) { + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setId(id); + //查询案件详细信息 + CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); + if (caseApplication1 == null) { + continue; + } + + // 查询当前案件节点 + // Integer currentStatus= caseApplicationMapper.selectCaseApplicationCaseStatus(id); + if(batchCaseApplication.getAgreeOrNotCheck().equals(1)){ + // 同意,更新案件状态为案件质证 + caseApplication.setCaseStatus(CaseApplicationConstants.CASE_CROSSEXAMI); + }else { + if(StrUtil.isEmpty(batchCaseApplication.getCaseCheckReject())){ + return AjaxResult.error("请填写拒绝理由"); + } + // 拒绝,更新案件状态为待缴费 + caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT); + ArbitrateRecord arbitrateRecordsel = new ArbitrateRecord(); + arbitrateRecordsel.setCaseAppliId(id); + ArbitrateRecord arbitrateRecordnew = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecordsel); + if(arbitrateRecordnew!=null){ + arbitrateRecordnew.setPayRejectReason(batchCaseApplication.getCaseCheckReject()); + arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecordnew); + }else { + + arbitrateRecordsel.setPayRejectReason(batchCaseApplication.getCaseCheckReject()); + arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordsel); + } + + } + + caseApplicationMapper.submitCaseApplication(caseApplication); + List caseAffiliates = caseApplicationService.selectAfflicatesByCaseId(caseApplication.getId()); if (caseAffiliates != null && caseAffiliates.size() > 0) { - for (CaseAffiliate affiliate : caseAffiliates) { - //获取身份类型 - int identityType = affiliate.getIdentityType(); - //查询案件详细信息 - CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); - if (caseApplication1 == null) { - return AjaxResult.error(); - } + // 申请操作人 + Optional applicantAffiliateOpt = caseAffiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))).findFirst(); + // 被申请操作人 + Optional resAffiliateOpt = caseAffiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4))).findFirst(); + if (!applicantAffiliateOpt.isPresent() || !resAffiliateOpt.isPresent()) { + throw new ServiceException("未找到案件操作人员"); + } + String caseName = "仲裁"; //这里案件名称表里未定义,暂时写死 String caseNum = caseApplication1.getCaseNum(); - if (identityType == 1) { //申请人 - request.setPhone(affiliate.getContactTelphone()); - request.setTemplateId("1928003"); //传入申请人模板id - // 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置 - // 模板id:1928003 普通短信 案件受理通知 - String name = affiliate.getName(); - request.setTemplateParamSet(new String[]{name, caseName, caseNum}); - Boolean aBoolean = SmsUtils.sendSms(request); - //保存短信发送记录 - SmsSendRecord smsSendRecord = new SmsSendRecord(); - smsSendRecord.setCaseId(caseApplication.getId()); - smsSendRecord.setCaseNum(caseNum); - smsSendRecord.setPhone(request.getPhone()); - smsSendRecord.setSendTime(new Date()); - String content = "尊敬的" + name + "用户,您的" + caseName + "案件" + caseNum + "已成功受理。"; - smsSendRecord.setSendContent(content); - smsSendRecord.setCreateBy(getUsername()); - if (aBoolean) { - smsSendRecord.setSendStatus(1); - } else { - smsSendRecord.setSendStatus(0); + CaseAffiliateEntity app = applicantAffiliateOpt.get(); + CaseAffiliateEntity res = resAffiliateOpt.get(); + //申请人 + if(batchCaseApplication.getAgreeOrNotCheck().equals(1)){ + SmsUtils.sendSms(caseApplication1, "1928003", app.getPhone(), new String[]{app.getName(),caseName,caseApplication1.getCaseNum()}); + }else { + SmsUtils.sendSms(caseApplication1, "2074402", app.getPhone(), new String[]{app.getName(),caseApplication1.getCaseNum(),batchCaseApplication.getCaseCheckReject()}); + } - smsRecordMapper.saveSmsSendRecord(smsSendRecord); - } else { //被申请人 - Boolean aBoolean = SmsUtils.sendSms(request); - request.setPhone(affiliate.getContactTelphone()); - request.setTemplateId("1952840"); - // 1952840 尊敬的{1}用户,您的{2}案件{3}已成功受理,请点击链接:https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 选择是否应诉。如非本人操作,请忽略本短信 - String name = affiliate.getName(); - request.setTemplateParamSet(new String[]{name, caseName, caseNum}); - //保存短信发送记录 - SmsSendRecord smsSendRecord = new SmsSendRecord(); - smsSendRecord.setCaseId(caseApplication.getId()); - smsSendRecord.setCaseNum(caseNum); - smsSendRecord.setPhone(request.getPhone()); - smsSendRecord.setSendTime(new Date()); - String content = "尊敬的" + name + "用户,您的" + caseName + "案件" + caseNum + "已成功受理,请点击链接:https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 选择是否应诉。如非本人操作,请忽略本短信"; - smsSendRecord.setSendContent(content); - smsSendRecord.setCreateBy(getUsername()); - if (aBoolean) { - smsSendRecord.setSendStatus(1); - } else { - smsSendRecord.setSendStatus(0); + + + + + //被申请人 + if(batchCaseApplication.getAgreeOrNotCheck().equals(1)) { + + SmsUtils.sendSms(caseApplication1, "1952840", res.getPhone(), new String[]{res.getName(),caseName,caseApplication1.getCaseNum()}); + } - smsRecordMapper.saveSmsSendRecord(smsSendRecord); - } - } + + //更改记录表里的支付状态和支付时间 CasePaymentRecord casePaymentRecord = new CasePaymentRecord(); casePaymentRecord.setPaymentStatus(1); @@ -180,12 +190,15 @@ public class CasePaymentServiceImpl implements ICasePaymentService { casePaymentRecord.setUpdateTime(new Date()); casePaymentRecordMapper.update(casePaymentRecord); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_CROSSEXAMI, ""); - - return AjaxResult.success(); + if(batchCaseApplication.getAgreeOrNotCheck().equals(1)) { + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT_CONFIRM, ""); + }else { + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT_CONFIRM, "拒绝原因:"+batchCaseApplication.getCaseCheckReject()); + } } } - return AjaxResult.error("暂无需要确认的缴费清单"); + + return AjaxResult.success(); } @Transactional @@ -203,6 +216,8 @@ public class CasePaymentServiceImpl implements ICasePaymentService { if (CollectionUtil.isNotEmpty(payDTO.getPayOrderList())) { for (CaseAttach caseAttach : payDTO.getPayOrderList()) { caseAttach.setCaseAppliId(caseId); + // 先删除该案件缴费凭证,类型为8,在新增 + caseAttachMapper.deleteCaseAttach(caseId,8,caseAttach.getAnnexId()); caseAttachMapper.updateCaseAttach(caseAttach); } } @@ -211,6 +226,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService { CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(caseId); CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); + Integer currentStatus=caseApplication1.getCaseStatus(); caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); //修改案件状态 int i = caseApplicationMapper.submitCaseApplication(caseApplication1); @@ -222,7 +238,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService { paymentRecord.setPaymentStatus(1); casePaymentRecordMapper.saveRecord(paymentRecord); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT_CONFIRM, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT ,""); } } @@ -248,9 +264,8 @@ public class CasePaymentServiceImpl implements ICasePaymentService { caseApplication.setId(caseId); CaseApplication caseApplication1 = caseApplicationService.selectCaseApplication(caseApplication); BigDecimal feePayable = caseApplication1.getFeePayable(); - feePayable = feePayable.multiply(new BigDecimal(100)); sum = sum.add(feePayable); - listVO.setTotalFee(sum.intValue()); + listVO.setTotalFee(sum); caseApplicationPay.setCaseAppName(caseApplication1.getApplicantName()); caseApplicationPay.setCaseResName(caseApplication1.getRespondentName()); caseApplicationPay.setCaseNum(caseApplication1.getCaseNum()); @@ -267,5 +282,142 @@ public class CasePaymentServiceImpl implements ICasePaymentService { return AjaxResult.success(listVO); } + @Override + @Transactional + public AjaxResult confirmPayBatch(CasePayDTO payDTO) { + + String batchNumber = payDTO.getBatchNumber(); + CaseApplication caseApplicationsel = new CaseApplication(); + caseApplicationsel.setBatchNumber(Integer.parseInt(batchNumber)); + caseApplicationsel.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT); + List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); + + if(CollectionUtil.isNotEmpty(caseApplications)){ + List caseIds = caseApplications.stream().map(CaseApplication::getId).collect(Collectors.toList()); + +// if (payDTO.getPayType() != null) { +// payDTO.setCaseIds(caseIds); +// // 修改支付方式 +// CaseConfirmPayDTO caseConfirmPayDTO = new CaseConfirmPayDTO(); +// BeanUtils.copyProperties(payDTO, caseConfirmPayDTO); +// caseApplicationMapper.updatePayType(caseConfirmPayDTO); +// } +// for (Long caseId : caseIds) { +// if (CollectionUtil.isNotEmpty(payDTO.getPayOrderList())) { +// for (CaseAttach caseAttach : payDTO.getPayOrderList()) { +// caseAttach.setCaseAppliId(caseId); +// caseAttachMapper.updateCaseAttach(caseAttach); +// } +// } +// +// // 修改节点状态 +// //根据案件id查询案件信息 +// CaseApplication caseApplication = new CaseApplication(); +// caseApplication.setId(caseId); +// CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); +// caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); +// //修改案件状态 +// int i = caseApplicationMapper.submitCaseApplication(caseApplication1); +// if (i > 0) { +// // 修改支付状态 +// CasePaymentRecord paymentRecord = new CasePaymentRecord(); +// paymentRecord.setPayType(payDTO.getPayType()); +// paymentRecord.setCaseId(caseId); +// paymentRecord.setPaymentStatus(1); +// casePaymentRecordMapper.saveRecord(paymentRecord); +// // 新增日志 +// CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT_CONFIRM, ""); +// } +// +// } + + }else{ + throw new ServiceException("这个批号没有批量缴费的案件"); + } + + return AjaxResult.success("确认缴费成功"); + } + + @Override + public AjaxResult casePayListBatch(CasePayDTO casePayDTO) { + String batchNumber = casePayDTO.getBatchNumber(); + CaseApplication caseApplicationsel = new CaseApplication(); + caseApplicationsel.setBatchNumber(Integer.parseInt(batchNumber)); +// caseApplicationsel.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT); + List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); + CasePayListVO listVO = new CasePayListVO(); + BigDecimal sum = new BigDecimal(0); + if(caseApplications!=null&&caseApplications.size()>0){ + for(CaseApplication caseApplication:caseApplications){ + BigDecimal feePayable = caseApplication.getFeePayable(); + sum = sum.add(feePayable); + } + listVO.setTotalFee(sum); + } + if (sum.compareTo(BigDecimal.ZERO) == 0) { + return AjaxResult.error("没有可支付的费用"); + } + return AjaxResult.success(listVO); + } + + @Override + @Transactional + public AjaxResult confirmPaymentBatch(String batchNumber) { + CaseApplication caseApplicationsel = new CaseApplication(); + caseApplicationsel.setBatchNumber(Integer.parseInt(batchNumber)); + caseApplicationsel.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); + List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); + + if (caseApplications != null && caseApplications.size() > 0) { + List caseIds = caseApplications.stream().map(CaseApplication::getId).collect(Collectors.toList()); + BatchCaseApplication batchCaseApplication = new BatchCaseApplication(); + batchCaseApplication.setIds(caseIds); + casePaymentService.confirmPayment(batchCaseApplication); + + }else{ + throw new ServiceException("这个批号没有批量缴费确认的案件"); + } + return AjaxResult.success(); + } + + @Override + @Transactional + public AjaxResult casePayBatch(CasePayDTO casePayDTO) { + PayRequest payRequest = new PayRequest(); + payRequest.setBody("案件缴费"); + payRequest.setOrderSn(System.currentTimeMillis() + ""); + payRequest.setTotalFee(casePayDTO.getTotalFee()); + PayResponse response = elegentPay.requestPay(payRequest, casePayDTO.getTradeType(), casePayDTO.getPlatform()); + if (response.getCode_url() == null) { + return AjaxResult.error(); + } + String batchNumber = casePayDTO.getBatchNumber(); + if(StringUtils.isEmpty(batchNumber) ){ + return AjaxResult.error("请检查参数是否有误"); + } + CaseApplication caseApplicationsel = new CaseApplication(); + caseApplicationsel.setBatchNumber(Integer.parseInt(batchNumber)); + caseApplicationsel.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT); + List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); + if(caseApplications!=null&&caseApplications.size()>0){ + List caseIds = caseApplications.stream().map(CaseApplication::getId).collect(Collectors.toList()); + for (Long caseId : caseIds) { + //缴费记录表里新增数据 + CasePaymentRecord casePaymentRecord = new CasePaymentRecord(); + casePaymentRecord.setCaseId(caseId); + casePaymentRecord.setOrderNumber(payRequest.getOrderSn()); + casePaymentRecord.setPaymentStatus(0); + casePaymentRecord.setCreateTime(new Date()); + int count = casePaymentRecordMapper.saveRecord(casePaymentRecord); + if (count < 1) { + return AjaxResult.error(); + } + } + + } + + return AjaxResult.success(response); + } + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java index 0b19366..313dfff 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java @@ -4,6 +4,8 @@ import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.constant.Constants; import com.ruoyi.common.core.domain.entity.SysDept; @@ -23,25 +25,37 @@ import com.ruoyi.common.utils.thread.ThreadPoolUtil; import com.ruoyi.system.domain.SysUserRole; import com.ruoyi.system.mapper.*; import com.ruoyi.wisdomarbitrate.domain.*; +import com.ruoyi.wisdomarbitrate.domain.dto.CaseApplicationDTO; +import com.ruoyi.wisdomarbitrate.domain.entity.CaseAffiliateEntity; +import com.ruoyi.wisdomarbitrate.domain.vo.CaseAffiliateBase; +import com.ruoyi.wisdomarbitrate.domain.vo.CaseAffiliateVO; import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue; import com.ruoyi.wisdomarbitrate.mapper.*; +import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper; +import com.ruoyi.wisdomarbitrate.task.CaseZipImportTask; import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; import com.ruoyi.wisdomarbitrate.utils.OCRUtils; import com.ruoyi.wisdomarbitrate.utils.UnZipFileUtils; import org.apache.pdfbox.pdmodel.PDDocument; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; import java.io.*; import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.*; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Future; +import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; +import static com.google.common.io.Files.getFileExtension; +import static com.ruoyi.common.constant.FileTransformation.getFileName; import static com.ruoyi.common.core.domain.AjaxResult.error; import static com.ruoyi.common.core.domain.AjaxResult.success; import static com.ruoyi.common.utils.SecurityUtils.getUsername; @@ -70,8 +84,6 @@ public class CaseZipImportImpl { @Autowired private SysUserRoleMapper userRoleMapper; @Autowired - private CaseApplicationLogMapper caseApplicationLogMapper; - @Autowired private CaseAffiliateLogMapper caseAffiliateLogMapper; @Autowired private CaseAttachLogMapper caseAttachLogMapper; @@ -85,24 +97,34 @@ public class CaseZipImportImpl { private ColumnValueLogMapper columnValueLogMapper; @Autowired private CaseAffiliateMapper caseAffiliateMapper; + @Autowired + private CaseApplicationLogMapper caseApplicationLogMapper; // 申请人角色id private long roleId; private Integer maxCaseNum; - private Integer maxBatchNumber; + @Autowired + private CaseZipImportImpl caseZipImportImpl; - public AjaxResult zipImport(MultipartFile file, Long templateId) { + /** + * * @param applicantType 申请人类型,自然人-1,机构-2 + * * @param resType 被申请人类型,自然人-1,机构-2 + * @param file + * @param templateId + * @param applicantType + * @param resType + * @return + */ + @Transactional + public AjaxResult zipImport(MultipartFile file, Long templateId,Integer applicantType,Integer resType) { UUID uuid = UUID.randomUUID(); - // todo + String targetPath = "/home/ruoyi/uploadPath/upload/unzipFile/" + uuid + "/"; -// String targetPath = "D:/home/ruoyi/uploadPath/upload/unzipFile/"+uuid+ "/"; File zipFile = null; InputStream ins = null; try { ins = file.getInputStream(); //上传的压缩包保存的路径 - // todo String savePath = "/home/ruoyi/uploadPath/upload/zipFile/"; -// String savePath = "D:/home/ruoyi/uploadPath/upload/zipFile/"; String saveName = uuid + "_" + file.getOriginalFilename(); zipFile = new File(savePath + saveName); inputChangeToFile(ins, zipFile); @@ -113,274 +135,306 @@ public class CaseZipImportImpl { boolean unzipSuccess = UnZipFileUtils.unZipFile(zipFile, targetPath); if (!unzipSuccess) { // 解压失败 - return AjaxResult.error("解压失败"); + throw new ServiceException("解压失败"); } // 查询抓取规则 - // todo 批次需要再上传压缩包时用户填写 List fatchRuleList = fatchRuleMapper.listByTemplateId(templateId); if (CollectionUtil.isEmpty(fatchRuleList)) { - return error("未设置抓取规则"); + throw new ServiceException("未设置抓取规则"); } - File directory = new File(targetPath); - // fileMap> - Map> fileMap = findAndConvertPDF(directory); - if (fileMap == null || fileMap.size() <= 0) { - // 解压失败 - return AjaxResult.error("未获取到文件"); - } - Map fatchMap = new HashMap<>(); - if (CollectionUtil.isNotEmpty(fatchRuleList)) { - - Map> fatchRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getFileName)); - // 根据抓取规则循环抓取 - fileMap.forEach((key, fileList) -> { - if (CollectionUtil.isNotEmpty(fileList)) { - for (File caseFile : fileList) { - if (fatchRuleMap.containsKey(caseFile.getName())) { - // 抓取内容 - List fatchRules = fatchRuleMap.get(caseFile.getName()); - getFatchContentList(caseFile, fatchMap, fatchRules, key); - } - } - } - }); - - } - if (fatchMap.size() <= 0) { - return error("从压缩包中未抓取到内容,请检查抓取字段配置"); - } - // 尊敬的{1},您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信 - SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - request.setTemplateId("1956159"); - - // 新增的案件 - List caseApplications = new ArrayList<>(); - // 从抓取规则表取字段和字典表取基本字段,字典表的字段名塞到基本表,is_default=1自定义字段塞到columnValue - // 抓取规则,0-内置字段,1-自定义字段 - Map> fatchRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getIsDefault)); // 在系统表中查询案件内置字段 SysDictData sysDictData = new SysDictData(); sysDictData.setDictType("case_built_type"); List dictDataList = dictDataMapper.selectDictDataList(sysDictData); - // 查询所有的组织机构,组装成map - List deptList = sysDeptMapper.selectDeptList(new SysDept()); - // 所有部门 - Map deptMap = new HashMap<>(); - if (CollectionUtil.isNotEmpty(deptList)) { - deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV)); - } - // 角色用户 - List userRoleList = new ArrayList<>(); // 查询申请人角色id roleId = roleMapper.selectRoleIdByName("申请人"); - - // 案件基本信息 - caseApplications = new ArrayList<>(); - // 自定义字段,组装columnValue表 - List columnValueList = new ArrayList<>(); - // 案件人员 - List caseAffiliates = new ArrayList<>(); - // 组装机构 - List sysDepts = new ArrayList<>(); - // 案件附件 - List caseAttachs = new ArrayList<>(); - //发送短信列表 - List smsSendRecordList = new ArrayList<>(); - // 短信记录 - List smsRequestList = new ArrayList<>(); - /** - * 用户表已存在的用户 - */ - List existUsers = userMapper.selectUserList(new SysUser()); - Map userMap = new HashMap<>(); - if (CollectionUtil.isNotEmpty(existUsers)) { - userMap = existUsers.stream().collect(Collectors.toMap(SysUser::getPhonenumber, Function.identity(), (n1, n2) -> n2)); - } //查询出当天的案件编号的最大值 String currentDay = DateUtils.dateTime(); String caseNum = "zc" + currentDay; maxCaseNum = caseApplicationMapper.selectCaseNumLike(caseNum, caseNum.length()); - // 需要新增的用户 - List addUsers = new ArrayList<>(); - for (Long caseId : fileMap.keySet()) { - if (CollectionUtil.isEmpty(fileMap.get(caseId))) { - continue; - } - CaseApplication caseApplication = new CaseApplication(); - caseApplications.add(caseApplication); - caseApplication.setId(caseId); - caseApplication.setTemplateId(templateId); + // 抓取内容 - caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); - caseApplication.setCaseLogId(IdWorkerUtil.getId()); - caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode()); - caseApplication.setCaseAppliId(caseApplication.getId()); + // 从抓取规则表取字段和字典表取基本字段,字典表的字段名塞到基本表,is_default=1自定义字段塞到columnValue + // 抓取规则,0-内置字段,1-自定义字段 + Map> fatchRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getFileName)); + File directory = new File(targetPath); + if (!directory.exists()) { + throw new ServiceException("文件不存在"); + } + // 找出案件文件夹 + if (!directory.isDirectory() || directory.listFiles() == null) { + throw new ServiceException("未找到文件夹"); + } - // 设置批号 - if (StrUtil.isEmpty(caseApplication.getBatchNumber())) { - maxBatchNumber = caseApplicationMapper.selectBatchNumberLike(); - if (maxBatchNumber == null) { - maxBatchNumber = 1; - caseApplication.setBatchNumber(maxBatchNumber.toString()); - } else { - maxBatchNumber = maxBatchNumber + 1; - caseApplication.setBatchNumber(maxBatchNumber.toString()); + File[] files = directory.listFiles(); + // todo + List caseApplications = new ArrayList<>(); + for (File file1 : files) { + if (file1.isDirectory() && file1.listFiles() != null) { + + for (File file2 : file1.listFiles()) { + + CaseApplicationDTO caseApplication = caseZipImportImpl.buildCaseInfo(file2, templateId, fatchRuleList, fatchRuleMap, dictDataList, applicantType,resType); + if (caseApplication != null) { + caseApplications.add(caseApplication); } } - // 设置编号 - String maxCaseNumStr = generateCaseNum(); - caseApplication.setCaseNum(maxCaseNumStr); - caseApplication.setCreateBy(getUsername()); - caseApplication.setVersion(1); - // 组装案件内置字段主表内容 + } + } + if (CollectionUtil.isEmpty(caseApplications)) { + return error("导入失败"); + } +// CaseZipImportTask caseZipImportTask = null; +// try { +// caseZipImportTask = new CaseZipImportTask(this, templateId, fatchRuleList, fatchRuleMap, userMap, dictDataList, files , deptMap, SecurityUtils.getLoginUser()); +// } catch (Exception e) { +// return error("导入失败"); +// } +// Future> future = ThreadPoolUtil.submit(caseZipImportTask); +// try { +// if(future.get()!=null){ +// return success("导入成功"); +// } +// } catch (InterruptedException | ExecutionException e) { +// e.printStackTrace(); +// return error(e.getMessage()); +// } + return success("导入成功"); - if (fatchRuleMap.size() > 0 && fatchRuleMap.containsKey(1)) { - List columnRules = fatchRuleMap.get(1); - columnRules.forEach(columnRule -> { - ColumnValue columnValue = new ColumnValue(); - columnValue.setColumn(columnRule.getColumn()); - columnValue.setName(columnRule.getColumnName()); - columnValue.setName(columnRule.getColumnName()); - columnValue.setValue(fatchMap.get(columnRule.getColumnName() + Constants.PDFSTR + caseId)); - columnValue.setIsDefault(1); - columnValue.setCaseId(caseId); - columnValue.setCaseAppliLogId(caseApplication.getCaseLogId()); - columnValueList.add(columnValue); - }); + + } + + /** + * 组装案件内置字段 + * @param file + * @param templateId + * @param fatchRuleList + * @param fatchRuleMap + * @param dictDataList + * @param applicantType 申请人类型,自然人-1,机构-2 + * @param resType 被申请人类型,自然人-1,机构-2 + * @return + */ + @Transactional + public CaseApplicationDTO buildCaseInfo(File file, Long templateId, List fatchRuleList, Map> fatchRuleMap, + List dictDataList, + Integer applicantType,Integer resType) { + // fileMap> + Map fatchMap = new HashMap<>(); + Map fileMap = findFile(file, fatchRuleList); + if (fileMap != null && fileMap.size()> 0) { + // 根据抓取规则循环抓取 + for (Map.Entry> entry : fatchRuleMap.entrySet()) { + System.out.println("根据抓取规则循环抓取======"+entry.getKey()); + getFatchContent(fileMap, entry.getKey(), fatchMap, entry.getValue()); } - caseApplication.setColumnValues(columnValueList); - // 组装内置字段 - buildDefaultColumn(caseApplication, dictDataList, fatchMap, caseAffiliates, deptMap, sysDepts, userMap, addUsers, userRoleList, smsSendRecordList, smsRequestList); - for (File caseFile : fileMap.get(caseId)) { - String fileUrl = caseFile.getAbsolutePath(); - if (StrUtil.isEmpty(fileUrl)) { + + if (fatchMap.size() > 0) { + // 新增的案件 + // 组装案件内置字段主表内容 + CaseApplicationDTO caseApplication = new CaseApplicationDTO(); + caseApplication.setTemplateId(templateId); + Map> defaultRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getIsDefault)); + // 自定义字段,组装columnValue表 + List columnValueList = new ArrayList<>(); + if (defaultRuleMap.size() > 0 && defaultRuleMap.containsKey(1)) { + List columnRules = defaultRuleMap.get(1); + columnRules.forEach(columnRule -> { + ColumnValue columnValue = new ColumnValue(); + columnValue.setColumn(columnRule.getColumn()); + columnValue.setName(columnRule.getColumnName()); + columnValue.setValue(fatchMap.get(columnRule.getColumnName())); + columnValue.setIsDefault(1); + columnValue.setCaseId(caseApplication.getId()); + columnValueList.add(columnValue); + }); + caseApplication.setColumnValueList(columnValueList); + } + // 案件附件 + List caseAttachs = new ArrayList<>(); + // 组装案件内置字段主表内容 + // 组装内置字段 + buildDefaultColumn(caseApplication, dictDataList, fatchMap, applicantType,resType); + // 组装附件 + for (Map.Entry entry : fileMap.entrySet()) { + String fileUrl = entry.getValue(); + if (StrUtil.isEmpty(fileUrl)) { + continue; + } + // 根据路径获取文件名 + String name = getFileName(fileUrl); + String suffix = getFileExtension(fileUrl); + if (StrUtil.isNotEmpty(suffix) && suffix.contains("doc")) { + // 上传onlyoffice + JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(fileUrl,caseApplication.getId()); + if(jsonArray!=null && jsonArray.size() > 0) { + for (Object obj : jsonArray) { + JSONObject jsonObject = (JSONObject) obj; + String path = jsonObject.get("filePath")!=null?jsonObject.getString("filePath"):""; + path=path.replace("/home/ruoyi/uploadPath/","/profile/"); + // String name = jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):""; + CaseAttach caseAttach = CaseAttach.builder() + .caseAppliId(caseApplication.getId()) + .annexName(name) + .annexPath(path) + .onlyOfficeFileId(jsonObject.getString("fileId")) + .build(); +// if(jsonObject.get("filePath")!=null){ +// String officePath = jsonObject.getString("filePath"); +// String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/"); +// caseAttach.setAnnexPath(replace); +// +// } + if(fileUrl.contains("申请书")){ + CaseAttach applyFile = new CaseAttach(); + BeanUtil.copyProperties(caseAttach, applyFile); + applyFile.setAnnexType(1); + caseAttachs.add(applyFile); + } + caseAttach.setAnnexType(2); + caseAttachs.add(caseAttach); + + } + } + } else { + // 上传 + String filePath = RuoYiConfig.getUploadPath(); + + CaseAttach caseAttach = new CaseAttach(); + caseAttach.setCaseAppliId(caseApplication.getId()); + filePath=fileUrl.replace("home/ruoyi/uploadPath/","profile/"); + caseAttach.setAnnexPath(filePath); + + caseAttach.setAnnexName(name); + + // 申请人提供的证据材料 + caseAttach.setAnnexType(2); + caseAttachs.add(caseAttach); + if (fileUrl.contains("申请书")) { + CaseAttach applyFile = new CaseAttach(); + BeanUtil.copyProperties(caseAttach, applyFile); + applyFile.setAnnexType(1); + caseAttachs.add(applyFile); + } + + } + } + caseApplication.setCaseAttachList(caseAttachs); + + // 案件压缩包导入 + caseApplication.setImportFlag(2); + + // 新增 + caseApplicationService.insertOrUpdate(caseApplication); + return caseApplication; + } + } + return null; + } + + /** + * 获取抓取内容 + * + * @param andConvertPDF 文件路径map + * @param mapKey 文件名 + * @param map 抓取内容map + * @param fatchRules 抓取规则 + */ + private void getFatchContent(Map andConvertPDF, String mapKey, Map map, List fatchRules) { + String fileURL =null; + for (Map.Entry entry : andConvertPDF.entrySet()) { + if(entry.getKey().contains(mapKey)){ + fileURL=entry.getValue(); + break; + } + } + if (StrUtil.isEmpty(fileURL)) { + return; + } + if (fileURL.endsWith("txt")) { + String readerFile = ReadFileUtils.readerTxtFile(fileURL); + OCRUtils.fatchRuleGetContent(readerFile, fatchRules, map); + } else if (fileURL.endsWith("doc") || fileURL.endsWith("docx")) { + // doc,docx,text识别内容 + String readerFile = null; + try { + readerFile = ReadFileUtils.readWord(fileURL); + } catch (Exception e) { + e.printStackTrace(); + } + OCRUtils.fatchRuleGetContent(readerFile, fatchRules, map); + + } else if (fileURL.endsWith("pdf")) { + //获取文件的页数 + int fileNumPage = getFileNumPage(fileURL); + //文件转成base64 + String base64 = OCRUtils.pdfConvertBase64(fileURL); + if (base64 == null) { + throw new ServiceException("pdf转base64失败"); + // return false; + } + StringBuilder ocrText = new StringBuilder(); // 创建一个StringBuilder对象 + for (int i = 1; i <= fileNumPage; i++) { + //对接腾讯云接口.识别里面的数据 + String text = OCRUtils.pdfIdentifyText(base64, i, fatchRules); + ocrText.append(text); // 拼接当前的字符串 + + + } + // 根据抓取规则截取内容 + OCRUtils.fatchRuleGetContent(ocrText.toString(), fatchRules, map); + } + + + } + + /** + * 查找文件 + * + * @param directory + * @param fatchRuleList + * @return + */ + private Map findFile(File directory, List fatchRuleList) { + Map filePathMap = new HashMap<>(); + if (directory.isFile()) { + String path = ""; + // 如果传入的参数是一个文件 + path = directory.getAbsolutePath(); + filePathMap.put(directory.getName(), path); + + } else if (directory.isDirectory()) { + searchAndConvertPDF(directory, filePathMap); + } else { + return null; + } + return filePathMap; + } + + /** + * 递归查找文件夹 + * + * @param directory + * @param filePathMap + */ + public static void searchAndConvertPDF(File directory, Map filePathMap) { + File[] files = directory.listFiles(); + + if (files != null) { + for (File file : files) { + if (file.getName().contains("zip") || file.getName().contains("rar")) { continue; } - // 上传 - String filePath = RuoYiConfig.getUploadPath(); + if (file.isFile()) { - CaseAttach caseAttach = new CaseAttach(); - caseAttach.setCaseAppliId(caseApplication.getId()); - caseAttach.setCaseAppliLogId(caseApplication.getCaseLogId()); - caseAttach.setAnnexPath(filePath); - if (StrUtil.isNotEmpty(fileUrl)) { - String fileName = fileUrl.replace(filePath, "/profile/upload"); - caseAttach.setAnnexName(fileName); - } - // 申请人提供的证据材料 - caseAttach.setAnnexType(2); - caseAttachs.add(caseAttach); - if (fileUrl.contains("仲裁申请书")) { - CaseAttach applyFile = new CaseAttach(); - BeanUtil.copyProperties(caseAttach, applyFile); - applyFile.setAnnexType(1); - caseAttachs.add(applyFile); + filePathMap.put(file.getName(), file.getAbsolutePath()); + } else if (file.isDirectory()) { + // 如果是目录,递归查找 + searchAndConvertPDF(file, filePathMap); } } - // 案件压缩包导入 - caseApplication.setImportFlag(2); - // 组装短信 - } - // 多线程执行 - List execList = new ArrayList<>(); - if (CollectionUtil.isNotEmpty(addUsers)) { - Function, Integer> function = userMapper::batchSave; - execList.add(new MultipleThreadListParam(function, addUsers)); - } - if (CollectionUtil.isNotEmpty(userRoleList)) { - Function, Integer> function = userRoleMapper::batchUserRole; - execList.add(new MultipleThreadListParam(function, userRoleList)); - - } - if (CollectionUtil.isNotEmpty(sysDepts)) { - Function, Integer> function = sysDeptMapper::batchSave; - execList.add(new MultipleThreadListParam(function, sysDepts)); - - } - if (CollectionUtil.isNotEmpty(caseApplications)) { - Function, Integer> function = caseApplicationMapper::batchSave; - execList.add(new MultipleThreadListParam(function, caseApplications)); - Function, Integer> functionLog = caseApplicationLogMapper::batchSave; - execList.add(new MultipleThreadListParam(functionLog, caseApplications)); - - } - if (CollectionUtil.isNotEmpty(caseAffiliates)) { - Function, Integer> function = caseAffiliateMapper::batchCaseAffiliate; - execList.add(new MultipleThreadListParam(function, caseAffiliates)); - Function, Integer> functionLog = caseAffiliateLogMapper::batchCaseAffiliate; - execList.add(new MultipleThreadListParam(functionLog, caseAffiliates)); - } - if (CollectionUtil.isNotEmpty(caseAttachs)) { - Function, Integer> function = caseAttachMapper::batchSave; - execList.add(new MultipleThreadListParam(function, caseAttachs)); - Function, Integer> functionLog = caseAttachLogMapper::batchSave; - execList.add(new MultipleThreadListParam(functionLog, caseAttachs)); - } - if (CollectionUtil.isNotEmpty(columnValueList)) { - Function, Integer> function = columnValueMapper::batchSave; - execList.add(new MultipleThreadListParam(function, columnValueList)); - Function, Integer> functionLog = columnValueLogMapper::batchSave; - execList.add(new MultipleThreadListParam(functionLog, columnValueList)); - } - if (CollectionUtil.isNotEmpty(execList)) { - MultipleThreadWorkUtil.execListFun(execList.toArray(new MultipleThreadListParam[execList.size()])); - } - if (CollectionUtil.isNotEmpty(caseApplications)) { - LoginUser loginUser = SecurityUtils.getLoginUser(); - List logRecords = new ArrayList<>(); - - caseApplications.forEach(caseApplication -> { - CaseLogRecord operLog = new CaseLogRecord(); - // 获取当前的用户 - - if (loginUser != null) { - SysUser user = loginUser.getUser(); - operLog.setCreateBy(user.getUserName()); - operLog.setCreateNickName(user.getNickName()); - operLog.setUpdateBy(user.getUserName()); - } else { - operLog.setCreateBy("admin"); - operLog.setCreateNickName("管理员"); - operLog.setUpdateBy("admin"); - } - operLog.setCaseAppliId(caseApplication.getId()); - operLog.setCaseNode(CaseApplicationConstants.CASE_APPLICATION); - logRecords.add(operLog); - } - ); - // todo 发送短信 - ThreadPoolUtil.execute(() -> { - CaseLogUtils.batchInsertCaseLog(logRecords); - // 发送短信 - if (CollectionUtil.isNotEmpty(smsRequestList)) { - Map 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); - } - - - } - - } - - ); - } - // 案件日志 - return success("导入成功"); - } /** @@ -582,66 +636,100 @@ public class CaseZipImportImpl { * @param caseApplication 案件信息 * @param dictDataList 内置字段 * @param fatchMap 抓取字段内容 + * @param applicantType 申请人类型,自然人-1,机构-2 + * @param resType 被申请人类型,自然人-1,机构-2 */ - private void buildDefaultColumn(CaseApplication caseApplication, List dictDataList, Map fatchMap, - List caseAffiliates, Map deptMap, List sysDepts, - Map userMap, List addUsers, List userRoleList, - List smsSendRecords, List smsRequestList) { + private void buildDefaultColumn(CaseApplicationDTO caseApplication, List dictDataList, Map fatchMap, + Integer applicantType,Integer resType) { // 组装内置字段 if (CollectionUtil.isEmpty(dictDataList)) { return; } - // 被申请人 - CaseAffiliate debtorAffiliate = new CaseAffiliate(); - debtorAffiliate.setCaseAppliId(caseApplication.getId()); - debtorAffiliate.setCaseAppliLogId(caseApplication.getCaseLogId()); - // 申请人 - CaseAffiliate affiliate = new CaseAffiliate(); - affiliate.setCaseAppliLogId(caseApplication.getCaseLogId()); - affiliate.setCaseAppliId(caseApplication.getId()); + CaseAffiliateVO affiliateVO = new CaseAffiliateVO(); + List applicantList = new ArrayList<>(); + List resList = new ArrayList<>(); + affiliateVO.setApplicant(applicantList); + affiliateVO.setRes(resList); + CaseAffiliateBase affiliateBase = new CaseAffiliateBase(); + + CaseAffiliateBase resBase = new CaseAffiliateBase(); + CaseAffiliateEntity applicant = new CaseAffiliateEntity(); + applicant.setRoleType(1); + if(applicantType.equals(1)){ + // 自然人 + applicant.setOrganizeFlag(0); + applicant.setOperatorFlag(1); + }else { + // 机构 + applicant.setOrganizeFlag(1); + } + CaseAffiliateEntity applicantAgent = new CaseAffiliateEntity(); + applicantAgent.setRoleType(2); + applicantAgent.setOrganizeFlag(0); + applicantAgent.setOperatorFlag(1); + CaseAffiliateEntity res = new CaseAffiliateEntity(); + res.setRoleType(3); + if(resType.equals(1)){ + // 自然人 + res.setOrganizeFlag(0); + res.setOperatorFlag(1); + }else { + // 机构 + res.setOrganizeFlag(1); + } + CaseAffiliateEntity resAgent = new CaseAffiliateEntity(); + resAgent.setRoleType(4); + resAgent.setOrganizeFlag(0); + resAgent.setOperatorFlag(1); + affiliateBase.setApplicant(applicant); + affiliateBase.setApplicantAgent(applicantAgent); + resBase.setRes(res); + resBase.setResAgent(resAgent); + applicantList.add(affiliateBase); + resList.add(resBase); + affiliateVO.setApplicant(applicantList); + affiliateVO.setRes(resList); for (SysDictData dictData : dictDataList) { if (StrUtil.isNotEmpty(dictData.getDictLabel())) { if (dictData.getDictLabel().contains("被申请人")) { // 组装被申请人内置自段 - buildDebtorColumn(dictData, fatchMap, debtorAffiliate, caseApplication.getId()); + buildDebtorColumn(dictData, fatchMap, res,resAgent); } else if (dictData.getDictLabel().contains("申请人") || dictData.getDictLabel().contains("统一社会信用代码") || dictData.getDictLabel().contains("法定代表人") || dictData.getDictLabel().contains("委托代理人")) { // 组装申请人内置自段 - buildAffilcateColumn(dictData, fatchMap, affiliate, deptMap, sysDepts, userMap, addUsers, userRoleList, caseApplication, smsSendRecords, smsRequestList); + buildAffilcateColumn(dictData, fatchMap, caseApplication,applicant,applicantAgent); } else if (dictData.getDictLabel().contains("合同编号")) { // 合同编号 - String contractNumber = fatchMap.get("合同编号" + Constants.PDFSTR + caseApplication.getId()); + String contractNumber = fatchMap.get("合同编号" ); if (StrUtil.isNotEmpty(contractNumber)) { // 提取字母和数字 String regx = "[^a-zA-Z0-9]"; String replaceAll = contractNumber.replaceAll(regx, ""); caseApplication.setContractNumber(replaceAll.toUpperCase()); } - }else if(dictData.getDictLabel().contains("案件标的")){ - // todo 案件标的名字要改,字典配置中也要改 - if(null!=caseApplication.getCaseSubjectAmount()) { - //todo 暂时设置计费比率为0.01 - BigDecimal feeRate = new BigDecimal(0.01); - BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP); - caseApplication.setFeePayable(feePayable); + } else if (dictData.getDictLabel().contains("案件标的")) { + String caseSubjectAmount = fatchMap.get(dictData.getDictLabel()); + if(StrUtil.isNotEmpty(caseSubjectAmount)) { + try { + BigDecimal bigDecimal = new BigDecimal(caseSubjectAmount); + caseApplication.setCaseSubjectAmount(bigDecimal); + } catch (Exception e) { + } + }else { + caseApplication.setCaseSubjectAmount(BigDecimal.ZERO); } + } else { - ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())); + ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() )); } } else { - ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())); + ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() )); } } - if (ObjectUtil.isNotEmpty(affiliate)) { - caseAffiliates.add(affiliate); - } - if (ObjectUtil.isNotEmpty(debtorAffiliate)) { - caseAffiliates.add(debtorAffiliate); - } - + caseApplication.setAffiliate(affiliateVO); } @@ -650,137 +738,46 @@ public class CaseZipImportImpl { * * @param dictData 内置字段 * @param fatchMap 抓取内容 - * @param affiliate 案件人员 + * @param applicant 申请人 + * @param applicantAgent 申请代理人 */ - private void buildAffilcateColumn(SysDictData dictData, Map fatchMap, CaseAffiliate affiliate, - Map deptMap, List sysDepts, - Map userMap, List addUsers, List userRoleList, CaseApplication caseApplication, - List smsSendRecords, List smsRequestList) { - - affiliate.setIdentityType(1); - + private void buildAffilcateColumn(SysDictData dictData, Map fatchMap, + CaseApplicationDTO caseApplication,CaseAffiliateEntity applicant, + CaseAffiliateEntity applicantAgent) { // 申请人 switch (dictData.getDictLabel()) { case "申请人姓名": - affiliate.setName((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()))); - if (StrUtil.isNotEmpty(affiliate.getName())) { - // 组装申请机构 - // 将组织机构id设为申请人名称 - if (deptMap.containsKey(affiliate.getName())) { - affiliate.setApplicationOrganId(String.valueOf(deptMap.get(affiliate.getName()))); - affiliate.setApplicationOrganName(affiliate.getName()); - } else { - // 如果不存在则新增 - SysDept dept = new SysDept(); - dept.setParentId(0L); - dept.setDeptName(affiliate.getName()); - dept.setAncestors("0"); - dept.setOrderNum(1); - dept.setStatus("0"); - dept.setDelFlag("0"); - dept.setCreateBy(getUsername()); - dept.setUpdateBy(getUsername()); - dept.setDeptId(Long.valueOf(IdWorkerUtil.getId())); - sysDepts.add(dept); - deptMap.put(dept.getDeptName(), dept.getDeptId()); - affiliate.setApplicationOrganId(String.valueOf(dept.getDeptId())); - affiliate.setApplicationOrganName(affiliate.getName()); - - } - } + applicant.setName((fatchMap.get(dictData.getDictLabel()))); break; case "统一社会信用代码": - affiliate.setIdentityNum((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()))); + applicant.setCode((fatchMap.get(dictData.getDictLabel()))); + break; + case "身份证号": + applicant.setIdCard((fatchMap.get(dictData.getDictLabel()))); break; case "法定代表人": - affiliate.setCompLegalPerson(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())); + applicant.setCompLegalPerson(fatchMap.get(dictData.getDictLabel())); break; case "法定代表人职位": - affiliate.setCompLegalperPost((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()))); + applicant.setPosition((fatchMap.get(dictData.getDictLabel()))); break; case "申请人住所": - affiliate.setResidenAffili((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()))); + applicant.setHome((fatchMap.get(dictData.getDictLabel()))); break; case "申请人联系地址": - affiliate.setContactAddress(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())); + applicant.setAddress(fatchMap.get(dictData.getDictLabel())); break; case "委托代理人姓名": - affiliate.setNameAgent(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())); + applicantAgent.setName(fatchMap.get(dictData.getDictLabel())); break; case "委托代理人联系电话": - affiliate.setContactTelphoneAgent(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())); - if (StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent())) { - SysUser agentUser = null; - // 用户已存在 - if (userMap.containsKey(affiliate.getContactTelphoneAgent())) { - agentUser = userMap.get(affiliate.getContactTelphoneAgent()); - if (null != agentUser.getDeptId() && String.valueOf(agentUser.getDeptId()).equals(affiliate.getApplicationOrganId())) { - // 同步用户表和案件关联人表的手机号和名称 - affiliate.setContactTelphoneAgent(agentUser.getPhonenumber()); - affiliate.setNameAgent(agentUser.getNickName()); - affiliate.setApplicantAgentUserId(String.valueOf(agentUser.getUserId())); - if (StrUtil.isNotEmpty(agentUser.getIdCard())) { - affiliate.setIdentityNumAgent(agentUser.getIdCard()); - } else { - affiliate.setIdentityNumAgent(affiliate.getIdentityNumAgent()); - } - List longList = new ArrayList<>(); - // 新增角色为申请人 - if (CollectionUtil.isNotEmpty(agentUser.getRoles())) { - longList = agentUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList()); - if (!longList.contains(roleId)) { - insertAgentUserRole(agentUser, roleId, userRoleList); - } - } else { - - insertAgentUserRole(agentUser, roleId, userRoleList); - } - - } - } else { - // 用户不存在,新增 - agentUser = new SysUser(); - agentUser.setUserId(Long.valueOf(IdWorkerUtil.getId())); - agentUser.setIdCard(affiliate.getIdentityNumAgent()); - agentUser.setNickName(affiliate.getNameAgent()); - agentUser.setUserName(affiliate.getContactTelphoneAgent()); - agentUser.setPhonenumber(affiliate.getContactTelphoneAgent()); - agentUser.setPassword(SecurityUtils.encryptPassword("abc123456")); - agentUser.setDeptId(Long.valueOf(affiliate.getApplicationOrganId())); - addUsers.add(agentUser); - userMap.put(agentUser.getPhonenumber(), agentUser); - insertAgentUserRole(agentUser, roleId, userRoleList); - - } - if (addUsers != null) { - SysUser finalAgentUser = agentUser; - if(CollectionUtil.isNotEmpty(smsRequestList)&& smsRequestList.stream().noneMatch(smsSendRecord -> smsSendRecord.getPhone().equals(finalAgentUser.getPhonenumber()))){ - SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - request.setTemplateId("1956159"); - request.setPhone(agentUser.getPhonenumber()); - request.setTemplateParamSet(new String[]{agentUser.getNickName()}); - smsRequestList.add(request); - SmsSendRecord smsSendRecord = new SmsSendRecord(); - smsSendRecord.setCaseId(caseApplication.getId()); - smsSendRecord.setCaseNum(caseApplication.getCaseNum()); - smsSendRecord.setPhone(request.getPhone()); - smsSendRecord.setSendTime(new Date()); - String content = "尊敬的" + agentUser.getNickName() + ",您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信"; - smsSendRecord.setSendContent(content); - smsSendRecord.setCreateBy(getUsername()); - smsSendRecords.add(smsSendRecord); - } - - - } - - } + applicantAgent.setPhone(fatchMap.get(dictData.getDictLabel())); break; case "委托代理人电子邮件": - affiliate.setAgentEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())) ? fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()).replace("\n", "").replaceAll("\\s", "") : null); - + applicantAgent.setEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel())) ? fatchMap.get(dictData.getDictLabel()).replace("\n", "").replaceAll("\\s", "") : null); break; default: + ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() )); break; } } @@ -805,19 +802,22 @@ public class CaseZipImportImpl { * * @param dictData 内置字段 * @param fatchMap 抓取内容 - * @param debtorAffiliate 被申请人 + * @param res 被申请人 + * @param resAgent 被申请人代理 */ - private void buildDebtorColumn(SysDictData dictData, Map fatchMap, CaseAffiliate debtorAffiliate, Long caseId) { + private void buildDebtorColumn(SysDictData dictData, Map fatchMap,CaseAffiliateEntity res,CaseAffiliateEntity resAgent) { - debtorAffiliate.setIdentityType(2); - // 被申请人 + // 被申请人在。 switch (dictData.getDictLabel()) { case "被申请人姓名": - debtorAffiliate.setName(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)); + res.setName(fatchMap.get(dictData.getDictLabel() )); + break; + case "被申请人": + res.setName(fatchMap.get(dictData.getDictLabel() )); break; case "被申请人身份证号": - String identityNum = fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId); - debtorAffiliate.setIdentityNum(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)); + String identityNum = fatchMap.get(dictData.getDictLabel() ); + res.setIdCard(fatchMap.get(dictData.getDictLabel() )); // 出生年月日,从身份证抓取 if (StrUtil.isNotEmpty(identityNum)) { identityNum = identityNum.replace("\n", ""); @@ -831,21 +831,21 @@ public class CaseZipImportImpl { } catch (Exception e) { e.printStackTrace(); } - debtorAffiliate.setResponBirth(birthdayDate); + res.setBirth(birthdayDate); } //从身份证抓取性别 - debtorAffiliate.setResponSex(identityNumMap.get("sexCode")); + res.setSex(identityNumMap.get("sexCode")); } break; case "被申请人住所": - debtorAffiliate.setResidenAffili(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)); + res.setHome(fatchMap.get(dictData.getDictLabel() )); break; case "被申请人联系电话": - debtorAffiliate.setContactTelphone(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)); + res.setPhone(fatchMap.get(dictData.getDictLabel() )); break; case "被申请人电子邮件": - debtorAffiliate.setEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)) ? fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId).replace("\n", "").replaceAll("\\s", "") : null); + res.setEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel() )) ? fatchMap.get(dictData.getDictLabel() ).replace("\n", "").replaceAll("\\s", "") : null); break; default: diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DeptIdentifyServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DeptIdentifyServiceImpl.java index 93b0698..043d0e5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DeptIdentifyServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DeptIdentifyServiceImpl.java @@ -248,12 +248,12 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService { if (downLoadFile) { CaseAttach caseAttach = new CaseAttach(); caseAttach.setAnnexType(10); //10代表印章图片 - caseAttach.setAnnexPath(savePath); - caseAttach.setAnnexName(saveName); + caseAttach.setAnnexPath(saveName); + caseAttach.setAnnexName(fileName); int i1 = caseAttachMapper.save(caseAttach); if (i1 > 0) { //将附件id保存到公章管理表里 - Integer annexId1 = caseAttach.getAnnexId(); + Long annexId1 = caseAttach.getAnnexId(); SealManage sealManage = new SealManage(); sealManage.setSealId(sealId); List selectSealList = sealManageMapper.selectSealList(sealManage); @@ -287,16 +287,18 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService { List selectSealList = sealManageMapper.selectSealList(sealManage); if (selectSealList != null && selectSealList.size() > 0) { for (SealManage sealManage1 : selectSealList) { - Integer annexId = sealManage1.getAnnexId(); + Long annexId = sealManage1.getAnnexId(); if (annexId != null) { //根据附件id查询路径 CaseAttach caseAttach = caseAttachMapper.queryAnnexById(annexId); - String annexName = caseAttach.getAnnexName(); - String prefix = "/profile"; - int startIndex = annexName.indexOf(prefix); - startIndex += prefix.length(); - String annexPath = "/uploadPath" + annexName.substring(startIndex); - sealManage1.setAnnexPath(annexPath); + if(caseAttach!=null){ + String annexName = caseAttach.getAnnexName(); + String prefix = "/profile"; + int startIndex = annexName.indexOf(prefix); + startIndex += prefix.length(); + String annexPath = "/uploadPath" + annexName.substring(startIndex); + sealManage1.setAnnexPath(annexPath); + } } else { sealManage1.setAnnexPath(null); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DownFileService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DownFileService.java new file mode 100644 index 0000000..ba78329 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DownFileService.java @@ -0,0 +1,76 @@ +package com.ruoyi.wisdomarbitrate.service.impl; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import com.ruoyi.common.constant.FileTransformation; +import com.ruoyi.common.core.domain.entity.EsignHttpResponse; +import com.ruoyi.common.exception.EsignDemoException; +import com.ruoyi.common.utils.file.SaaSAPIFileUtils; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.CaseAttach; +import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.io.File; +import java.io.IOException; +import java.time.LocalDate; +import java.util.UUID; + +/** + * 下载文件 + */ +@Service +public class DownFileService { + @Autowired + CaseAttachMapper caseAttachMapper; + + /** + * 从E签宝下载签署完成后的PDF文件 + */ + public void downPdfFileFormEsign(String signFlowId, Long caseAppliId) throws EsignDemoException, IOException { + Gson gson = new Gson(); + EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId); + JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class); + JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data"); + JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray(); + if (filesArray != null && filesArray.size() > 0) { + JsonObject fileObject = (JsonObject) filesArray.get(0); + String fileDownloadUrl = fileObject.get("downloadUrl").toString(); + LocalDate now = LocalDate.now(); + String year = Integer.toString(now.getYear()); + String month = String.format("%02d", now.getMonthValue()); + String day = String.format("%02d", now.getDayOfMonth()); + String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; + String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf"; + String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; + String savePath = "/home/ruoyi/uploadPath/upload/"; + // 创建日期目录 + File saveFolder = new File(saveFolderPath); + if (!saveFolder.exists()) { + saveFolder.mkdirs(); + } + String resultFilePath = saveFolderPath + "/" + fileName; + File resultFilePathFile = new File(resultFilePath); + if (!resultFilePathFile.exists()) { + resultFilePathFile.createNewFile(); + } + String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1); + boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath); + if (downLoadFile) { + //立案申请书(1)、申请人证据材料(2)、裁决书(3)、案件视频(4)、身份证件(5)、 + // 被申请人证据材料 (6)、庭审笔录(7)、缴费凭证(8)、视频录制(9)、公章图片(10)、语音转录文件(11) + caseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, 3); + CaseAttach caseAttach = new CaseAttach(); + caseAttach.setCaseAppliId(caseAppliId); + caseAttach.setAnnexType(3); + caseAttach.setAnnexPath(saveName); + caseAttach.setAnnexName("裁决书.pdf"); + caseAttachMapper.save(caseAttach); + } + + } + } + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/MsSignSealServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/MsSignSealServiceImpl.java new file mode 100644 index 0000000..dbeb153 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/MsSignSealServiceImpl.java @@ -0,0 +1,271 @@ +package com.ruoyi.wisdomarbitrate.service.impl; + + +import com.alibaba.fastjson.JSONObject; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import com.ruoyi.common.constant.FileTransformation; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.EsignHttpResponse; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.exception.EsignDemoException; +import com.ruoyi.common.utils.EmailOutUtil; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.file.SaaSAPIFileUtils; +import com.ruoyi.system.mapper.SysUserMapper; +import com.ruoyi.wisdomarbitrate.domain.*; +import com.ruoyi.wisdomarbitrate.mapper.*; +import com.ruoyi.wisdomarbitrate.service.MsSignSealService; +import com.ruoyi.wisdomarbitrate.utils.SignAward; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import java.io.File; +import java.io.IOException; +import java.time.LocalDate; +import java.util.*; +import static com.ruoyi.common.core.domain.AjaxResult.error; + + +@Slf4j +@Service +public class MsSignSealServiceImpl implements MsSignSealService { + + + @Autowired + private CaseApplicationMapper caseApplicationMapper; + @Autowired + private SealSignRecordMapper sealSignRecordMapper; + @Autowired + private CaseAttachMapper caseAttachMapper; + @Autowired + private DeptIdentifyMapper deptIdentifyMapper; + @Autowired + private SealManageMapper sealManageMapper; + @Autowired + private CaseLogRecordMapper caseLogRecordMapper; + @Autowired + private SysUserMapper sysUserMapper; + + /** + * 签署流程回调,即签名用印回调 + * + * @param reqbodystr + * @return + * @throws EsignDemoException + * @throws IOException + */ + @Override + @Transactional(rollbackFor = Exception.class) + public AjaxResult signSeaalCaseApplicaCallback(String reqbodystr) throws EsignDemoException, IOException { + JSONObject jsonObjectCallback = JSONObject.parseObject(reqbodystr); + Gson gson = new Gson(); + if (jsonObjectCallback != null) { + log.info("签名回调======" + jsonObjectCallback); + int signResult = jsonObjectCallback.getIntValue("signResult"); + String action = jsonObjectCallback.getString("action"); + String signFlowId = jsonObjectCallback.getString("signFlowId"); + Long operateTime = jsonObjectCallback.getLongValue("operateTime"); + JSONObject operator = jsonObjectCallback.getJSONObject("operator"); + JSONObject psnAccount = operator.getJSONObject("psnAccount"); + String accountMobile = psnAccount.getString("accountMobile"); + + SealSignRecord sealSignRecordsel = sealSignRecordMapper.selectSealByFlowId(signFlowId); + if (sealSignRecordsel == null) { + return error("未找到签署流程"); + } + + String pensonAccount = sealSignRecordsel.getPensonAccount(); + String orgnNamePsnAcc = sealSignRecordsel.getOrgnizeNamePsnAccount(); + String pensonName = sealSignRecordsel.getPensonName(); + String orgnNamePsnName = sealSignRecordsel.getOrgnizeNamepsnName(); + Date dateOperate = new Date(operateTime); + Long caseAppliId = sealSignRecordsel.getCaseAppliId(); + CaseApplication req = new CaseApplication(); + req.setId(caseAppliId); + // 根据电话查询用户名 + SysUser sysUser = sysUserMapper.selectUserByPhone(accountMobile); + if ("SIGN_MISSON_COMPLETE".equals(action) && signResult == 2) { + if (StringUtils.isNotEmpty(accountMobile) && accountMobile.equals(pensonAccount)) { + //调解员签名 + sealSignRecordsel.setSignStatusArbitor(1); + sealSignRecordMapper.updataSealSignRecord(sealSignRecordsel); + CaseLogRecord operLog = new CaseLogRecord(); + operLog.setCreateNickName(pensonName); + operLog.setCaseAppliId(caseAppliId); + operLog.setCaseNode(13); + operLog.setCreateTime(dateOperate); + if(sysUser!=null){ + operLog.setCreateBy(sysUser.getUserName()); + } + caseLogRecordMapper.insertCaseLogRecord(operLog); + + CaseApplication application = new CaseApplication(); + application.setId(caseAppliId); + // 修改状态为待用印 + application.setCaseStatus(14); + caseApplicationMapper.updataCaseApplication(application); + + + } else if (StringUtils.isNotEmpty(accountMobile) && accountMobile.equals(orgnNamePsnAcc)) { + // 用印 + sealSignRecordMapper.updataSealSignRecord(sealSignRecordsel); + CaseApplication application = new CaseApplication(); + application.setId(caseAppliId); + // 案件状态为待送达 + application.setCaseStatus(15); + caseApplicationMapper.updataCaseApplication(application); + //下载审核完成的裁决书, + EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId); + JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class); + JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data"); + JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray(); + if (filesArray != null && filesArray.size() > 0) { + JsonObject fileObject = (JsonObject) filesArray.get(0); + String fileDownloadUrl = fileObject.get("downloadUrl").toString(); + ///修改"签署用印记录表"的状态为完成 + sealSignRecordsel.setSignFlowStatus(3); + sealSignRecordsel.setSealStatus(1); + sealSignRecordsel.setFileDownloadUrl(fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1)); + sealSignRecordMapper.updataSealSignRecord(sealSignRecordsel); + String filearbitraUrl = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1); + application.setFilearbitraUrl(filearbitraUrl); + caseApplicationMapper.submitCaseApplication(application); + + LocalDate now = LocalDate.now(); + String year = Integer.toString(now.getYear()); + String month = String.format("%02d", now.getMonthValue()); + String day = String.format("%02d", now.getDayOfMonth()); + String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; + String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf"; + String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; + + // 创建日期目录 + File saveFolder = new File(saveFolderPath); + if (!saveFolder.exists()) { + saveFolder.mkdirs(); + } + String resultFilePath = saveFolderPath + "/" + fileName; + File resultFilePathFile = new File(resultFilePath); + if (!resultFilePathFile.exists()) { + resultFilePathFile.createNewFile(); + } + + String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1); + boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath); + if (downLoadFile) { + CaseAttach caseAttach = new CaseAttach(); + caseAttach.setCaseAppliId(caseAppliId); + caseAttach.setAnnexType(3); + caseAttach.setAnnexPath(saveName); + caseAttach.setAnnexName("裁决书.pdf"); + //caseAttach.setUserName(SecurityUtils.getUsername()); + //caseAttach.setUserId(SecurityUtils.getUserId()); + // 删除已存在的 + caseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, 3); + caseAttachMapper.save(caseAttach); + } + + } + + + } + + } + + } else { + return AjaxResult.error("error"); + } + return AjaxResult.success("success"); + } + + + + + @Override + @Transactional(rollbackFor = Exception.class) + public AjaxResult sealCheckCallback(String reqbodystr) throws EsignDemoException, IOException { + JSONObject jsonObjectCallback = JSONObject.parseObject(reqbodystr); + Gson gson = new Gson(); + if (jsonObjectCallback != null) { + int auditStatus = jsonObjectCallback.getIntValue("auditStatus"); + String action = jsonObjectCallback.getString("action"); + String orgId = jsonObjectCallback.getString("orgId"); + String sealId = jsonObjectCallback.getString("sealId"); + + SealManage sealManage = new SealManage(); + DeptIdentify deptIdentify1 = new DeptIdentify(); + deptIdentify1.setOrgId(orgId); + List deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify1); + if (deptIdentifies != null && deptIdentifies.size() > 0) { + Long iddeptIdent = deptIdentifies.get(0).getId(); + SealManage sealManageSel = new SealManage(); + sealManageSel.setIdentifyId(iddeptIdent); + sealManageSel.setSealId(sealId); + List sealIdList = new ArrayList<>(); + List selectSealList = sealManageMapper.selectSealList(sealManageSel); + if (selectSealList != null && selectSealList.size() > 0) { + sealManage = selectSealList.get(0); + } + } + + if ("SEAL_AUDIT".equals(action) && auditStatus == 1) { + EsignHttpResponse response = SignAward.getOrgSeal(orgId, sealId); + JSONObject jsonObject = JSONObject.parseObject(response.getBody()); + int code = jsonObject.getIntValue("code"); + if (code == 0) { + JSONObject data = jsonObject.getJSONObject("data"); + int sealStatus = data.getIntValue("sealStatus"); + if (sealStatus == 1) {//印章状态 1已启用,2待审核,3审核不通过,4 挂起 + //已启用证明审核通过,下载到数据库 + String sealImageDownloadUrl = data.getString("sealImageDownloadUrl"); + LocalDate now = LocalDate.now(); + String year = Integer.toString(now.getYear()); + String month = String.format("%02d", now.getMonthValue()); + String day = String.format("%02d", now.getDayOfMonth()); + String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; + String fileName = UUID.randomUUID().toString().replace("-", "") + ".jpg"; + String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; + String savePath = "/home/ruoyi/uploadPath/upload/"; + // 创建日期目录 + File saveFolder = new File(saveFolderPath); + if (!saveFolder.exists()) { + saveFolder.mkdirs(); + } + String resultFilePath = saveFolderPath + "/" + fileName; + File resultFilePathFile = new File(resultFilePath); + if (!resultFilePathFile.exists()) { + resultFilePathFile.createNewFile(); + } + boolean downLoadFile = FileTransformation.downLoadFileByUrl(sealImageDownloadUrl, resultFilePath); + if (downLoadFile) { + CaseAttach caseAttach = new CaseAttach(); + caseAttach.setAnnexType(10); //10代表印章图片 + caseAttach.setAnnexPath(saveName); + caseAttach.setAnnexName(fileName); + int i1 = caseAttachMapper.save(caseAttach); + if (i1 > 0) { + //将附件id保存到公章管理表里 + Long annexId1 = caseAttach.getAnnexId(); + sealManage.setAnnexId(annexId1); + sealManage.setSealStatus(1); + sealManage.setIsUse(0); + sealManageMapper.updateSealManage(sealManage); + } + } + } + } + } + } else { + return AjaxResult.error("error"); + } + return AjaxResult.success("success"); + } + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/SendMailRecordServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/SendMailRecordServiceImpl.java deleted file mode 100644 index 25d9bed..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/SendMailRecordServiceImpl.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.ruoyi.wisdomarbitrate.service.impl; - -import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord; -import com.ruoyi.wisdomarbitrate.domain.SendMailRecord; -import com.ruoyi.wisdomarbitrate.mapper.SendMailRecordMapper; -import com.ruoyi.wisdomarbitrate.service.ISendMailRecordService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; - -@Service -public class SendMailRecordServiceImpl implements ISendMailRecordService { - @Autowired - private SendMailRecordMapper sendMailRecordMapper; - - - @Override - public List selectSendMailRecordList(SendMailRecord sendMailRecord) { - List records = sendMailRecordMapper.selectSendMailRecord(sendMailRecord); - return records; - } - - - -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java index 0aa35dc..0d8c8a7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java @@ -3,36 +3,25 @@ package com.ruoyi.wisdomarbitrate.service.impl; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpUtil; +import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.ruoyi.common.config.RuoYiConfig; -import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.entity.SysRole; import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.common.core.domain.model.LoginUser; -import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.utils.PdfUtils; import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.common.utils.SmsUtils; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.common.utils.file.FileUploadUtils; -import com.ruoyi.common.utils.spring.SpringUtils; import com.ruoyi.system.mapper.SysRoleMapper; import com.ruoyi.system.mapper.SysUserMapper; -import com.ruoyi.system.mapper.SysUserRoleMapper; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseAttach; -import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication; +import com.ruoyi.wisdomarbitrate.domain.entity.CaseAffiliateEntity; import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO; -import com.ruoyi.wisdomarbitrate.domain.vo.WeChatUserVO; -import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper; -import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper; -import com.ruoyi.wisdomarbitrate.mapper.IdentityAuthenticationMapper; -import com.ruoyi.wisdomarbitrate.mapper.WeChatUserMapper; +import com.ruoyi.wisdomarbitrate.mapper.*; +import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; import com.ruoyi.wisdomarbitrate.service.VideoService; -import com.ruoyi.wisdomarbitrate.service.WeChatUserService; import com.tencentcloudapi.common.Credential; import com.tencentcloudapi.common.exception.TencentCloudSDKException; import com.tencentcloudapi.common.profile.ClientProfile; @@ -48,20 +37,15 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.ResourceUtils; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; import javax.servlet.http.HttpServletRequest; -import java.io.File; import java.io.IOException; import java.nio.file.Paths; -import java.text.SimpleDateFormat; import java.util.*; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; +import static com.ruoyi.common.core.domain.AjaxResult.error; import static com.ruoyi.common.core.domain.AjaxResult.success; import static com.ruoyi.common.utils.file.FileUploadUtils.getAbsoluteFile; import static com.ruoyi.common.utils.file.FileUploadUtils.getPathFileName; @@ -89,10 +73,15 @@ public class VideoServiceImpl implements VideoService { @Autowired private CaseApplicationMapper caseApplicationMapper; @Autowired + private CaseAffiliateMapper affiliateMapper; + @Autowired private CaseAttachMapper caseAttachMapper; @Autowired private SysRoleMapper roleMapper; - + @Autowired + private SysUserMapper userMapper; + @Autowired + private ICaseApplicationService caseApplicationService; /** * 功能:第三方回调sign校验 * 参数: @@ -118,8 +107,8 @@ public class VideoServiceImpl implements VideoService { Integer eventType = jsonObject.getInteger("EventType"); // 事件类型 String eventInfo = jsonObject.getString("EventInfo"); // 事件信息 JSONObject jsonObject1 = (JSONObject) JSON.parse(eventInfo); - String roomId = jsonObject1.getString("RoomId"); - String taskId = jsonObject1.getString("TaskId"); // 任务ID + String roomId = jsonObject1.getString("RoomId"); + String taskId = jsonObject1.getString("TaskId"); // 任务ID String payload = jsonObject1.getString("Payload"); // 根据不同事件类型定义不同 JSONObject jsonObject2 = (JSONObject) JSON.parse(payload); String tencentVod = jsonObject2.getString("TencentVod"); // 点播平台信息 @@ -134,10 +123,27 @@ public class VideoServiceImpl implements VideoService { String mediaId = jsonObject3.getString("MediaId"); // 建立相关的数据库用来存储音视频录制地址并和相关的业务ID绑定,用于后续下载 try { - downloadImage(fileId,videoUrl,roomId); + // 调解系统roomId>4294967294L/2 + if(StrUtil.isNotEmpty(roomId)) { + log.debug("roomId:" + roomId); + if (Long.valueOf(roomId) > 4294967294L / 2) { + log.debug("调用调解系统:" ); + log.debug("回调jsonObject:"+jsonObject ); + // 调用调解系统 + cn.hutool.json.JSONObject params = JSONUtil.createObj(); + params.set("roomId",roomId); + params.set("fileId",fileId); + params.set("videoUrl",videoUrl); + String post = HttpUtil.post("http://121.40.189.20:7001/video/videoRollBack", params.toJSONString(2)); + throw new RuntimeException(post); + + } else { + downloadImage(fileId, videoUrl, roomId); + } + } } catch (IOException e) { - throw new RuntimeException(e); + throw new RuntimeException("roomId:"+roomId); } } @@ -159,21 +165,17 @@ public class VideoServiceImpl implements VideoService { return success(); } for (CaseAttach caseAttach : caseAttachList) { - String annexName = caseAttach.getAnnexName(); - String prefix = "/profile"; - int startIndex = annexName.indexOf(prefix); - startIndex += prefix.length(); - String annexPath = "/uploadPath" + annexName.substring(startIndex); - caseAttach.setAnnexPath(annexPath); - int startIndexnew = annexName.lastIndexOf("/"); - if (startIndexnew != -1) { - String annexNamenew = annexName.substring(startIndexnew + 1); - caseAttach.setAnnexName(annexNamenew); - } + + caseAttach.setAnnexPath(caseAttach.getAnnexPath()); + + caseAttach.setAnnexName(caseAttach.getAnnexName()); + } return success(caseAttachList); } + + /** * 开启腾讯云录制 * @param roomId @@ -299,11 +301,28 @@ public class VideoServiceImpl implements VideoService { } @Override - public AjaxResult secretaryRoleByUserId(Long userId) { + public AjaxResult secretaryRoleByUserId(Long userId,Long caseId) { + CaseApplication application = new CaseApplication(); + application.setId(caseId); + // 根据案件id查询案件 + CaseApplication caseApplication = caseApplicationMapper.selectCaseApplication(application); + if(caseApplication==null){ + return AjaxResult.error("案件不存在"); + } List roles = roleMapper.selectRolePermissionByUserId(userId); JSONObject jsonObject = new JSONObject(); boolean isSecretaryRole=false; - if(CollectionUtil.isNotEmpty(roles)){ + if(caseApplication.getArbitratorId()!=null&& Objects.equals(userId, caseApplication.getArbitratorId())){ + // 是调解员 + if(CollectionUtil.isNotEmpty(roles)){ + for (SysRole role : roles) { + if("仲裁员".equals(role.getRoleName())){ + isSecretaryRole=true; + break; + } + } + } + }else if(CollectionUtil.isNotEmpty(roles)){ for (SysRole role : roles) { if("法律顾问".equals(role.getRoleName()) || "秘书".equals(role.getRoleName())){ isSecretaryRole=true; @@ -335,9 +354,10 @@ public class VideoServiceImpl implements VideoService { // 绑定案件 if(convertFlag){ +// String path=fileName.replace("") CaseAttach caseAttach = CaseAttach.builder().caseAppliId(reservedConferenceVO.getCaseId()) - .annexName(fileName) - .annexPath(RuoYiConfig.getHtml2PDFPath()) + .annexName(currentFileName) + .annexPath(fileName) .annexType(7) .build(); caseAttachMapper.save(caseAttach); @@ -361,16 +381,10 @@ public class VideoServiceImpl implements VideoService { if (caseAttachList != null && caseAttachList.size() > 0) { for (CaseAttach caseAttach : caseAttachList) { String annexName = caseAttach.getAnnexName(); - String prefix = "/profile"; - int startIndex = annexName.indexOf(prefix); - startIndex += prefix.length(); - String annexPath = "/uploadPath" + annexName.substring(startIndex); - caseAttach.setAnnexPath(annexPath); - int startIndexnew = annexName.lastIndexOf("/"); - if (startIndexnew != -1) { - String annexNamenew = annexName.substring(startIndexnew + 1); - caseAttach.setAnnexName(annexNamenew); - } + + caseAttach.setAnnexPath(caseAttach.getAnnexPath()); + caseAttach.setAnnexName(annexName); + } @@ -458,8 +472,8 @@ public class VideoServiceImpl implements VideoService { String annexName = getPathFileName(RuoYiConfig.getVideoUploadPath(), fileName); // 存入数据库 CaseAttach caseAttach = CaseAttach.builder().caseAppliId(caseId) - .annexName(annexName) - .annexPath(RuoYiConfig.getVideoUploadPath()) + .annexName(fileName) + .annexPath(annexName) .annexType(9) .build(); caseAttachMapper.save(caseAttach); @@ -469,6 +483,41 @@ public class VideoServiceImpl implements VideoService { return ""; } + + /** + * 根据案件查找是否申请人和被申请人 + * @param caseId + * @return + */ + @Override + public AjaxResult selectRoleMenuByCaseId(Long caseId) { + AjaxResult result = success(); + List msCaseAffiliates = caseApplicationService.selectAfflicatesByCaseId(caseId); + if (CollectionUtil.isEmpty(msCaseAffiliates)) { + return error("未找到案件相关人员"); + } + Long userId = SecurityUtils.getUserId(); + if (userId == null) { + return error("未找到当前登录用户"); + } + SysUser sysUser = userMapper.selectUserById(userId); + if (sysUser == null) { + return error("未找到当前登录用户"); + } + for (CaseAffiliateEntity affiliate : msCaseAffiliates) { + if(affiliate.getOperatorFlag()!=null && affiliate.getOperatorFlag()==1 && affiliate.getUserId()!=null&&affiliate.getUserId().equals(userId)&&affiliate.getRoleType()!=null){ + if(affiliate.getRoleType().equals(1)||affiliate.getRoleType().equals(2)){ + // 申请人操作人 + result.put("appFlag","1"); + } + if(affiliate.getRoleType().equals(3)||affiliate.getRoleType().equals(4)){ + // 被申请人操作人 + result.put("resFlag","1"); + } + } + } + return result; + } /** * @param key 回调秘钥 * @param body 入参 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/WeChatUserServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/WeChatUserServiceImpl.java index 1256c3c..6970345 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/WeChatUserServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/WeChatUserServiceImpl.java @@ -1,12 +1,14 @@ package com.ruoyi.wisdomarbitrate.service.impl; import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONObject; import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.enums.SMSStatusEnum; import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.common.utils.SmsUtils; +import com.ruoyi.wisdomarbitrate.utils.SmsUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.spring.SpringUtils; import com.ruoyi.system.mapper.SysUserMapper; @@ -48,9 +50,9 @@ public class WeChatUserServiceImpl implements WeChatUserService { // 1954926 普通短信 短信验证码 验证码:,为了保证您的账户安全,请勿想他人泄露验证码信息。如非本人操作,请忽略本短信。 request.setPhone(userVO.getPhone()); request.setTemplateParamSet(new String[]{ code}); - Boolean flag = SmsUtils.sendSms(request); - if(flag){ - setCodeCache(userVO.getPhone(),code); + JSONObject resultObj = SmsUtils.sendSms(request); + if(resultObj.get("status")!=null && !resultObj.get("status").equals(SMSStatusEnum.FAIL.getCode())){ + setCodeCache(CacheConstants.WE_CHAT_SMS_VERIFY_CODE_KEY + userVO.getPhone(),code); return AjaxResult.success("短信发送成功"); }else { return AjaxResult.warn("短信发送失败"); @@ -90,7 +92,7 @@ public class WeChatUserServiceImpl implements WeChatUserService { @Transactional @Override public AjaxResult registerUser(IdentityAuthentication ientityAuthentication) { - String codeCache = getCodeCache(ientityAuthentication.getPhone()); + String codeCache = getVerifyCodeCacheKey(ientityAuthentication.getPhone()); // 校验短信验证码 if(StrUtil.isEmpty(codeCache)){ return AjaxResult.warn("验证码校验失败"); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/sendrecord/ISendMailRecordService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/sendrecord/ISendMailRecordService.java new file mode 100644 index 0000000..f5a237e --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/sendrecord/ISendMailRecordService.java @@ -0,0 +1,32 @@ +package com.ruoyi.wisdomarbitrate.service.sendrecord; + +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SendMailRecord; + +import java.util.List; + +public interface ISendMailRecordService { + /** + * 查询邮件发送记录 + * + * @param sendMailRecord + * @return + */ + + List selectSendMailRecordList(SendMailRecord sendMailRecord); + + /** + * 编辑邮件记录 + * + * @param sendMailRecord + */ + AjaxResult updateSendMailRecord(SendMailRecord sendMailRecord); + + /** + * 重新发送邮件 + * + * @param sendMailRecord + * @return + */ + Boolean reSendMailRecord(SendMailRecord sendMailRecord); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/sendrecord/impl/SendMailRecordServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/sendrecord/impl/SendMailRecordServiceImpl.java new file mode 100644 index 0000000..cb3a700 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/sendrecord/impl/SendMailRecordServiceImpl.java @@ -0,0 +1,146 @@ +package com.ruoyi.wisdomarbitrate.service.sendrecord.impl; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.EmailOutUtil; +import com.ruoyi.wisdomarbitrate.domain.CaseAttach; +import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SendMailRecord; + +import com.ruoyi.wisdomarbitrate.domain.shortmessage.MsSendMailHistoryRecord; +import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper; +import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SendMailRecordMapper; +import com.ruoyi.wisdomarbitrate.mapper.shortmessage.MsSendMailHistoryRecordMapper; +import com.ruoyi.wisdomarbitrate.service.sendrecord.ISendMailRecordService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.io.File; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +@Service +public class SendMailRecordServiceImpl implements ISendMailRecordService { + @Autowired + private SendMailRecordMapper sendMailRecordMapper; + + + @Override + public List selectSendMailRecordList(SendMailRecord sendMailRecord) { + List records = sendMailRecordMapper.selectSendMailRecord(sendMailRecord); + if(CollectionUtil.isNotEmpty(records)){ + Map recordmap = records.stream().filter(record -> StrUtil.isNotEmpty(record.getFileIds())).collect(Collectors.toMap(SendMailRecord::getId, SendMailRecord::getFileIds, (k1, k2) -> k2)); + List fileIds = new ArrayList<>(recordmap.values()); + if(CollectionUtil.isNotEmpty(fileIds)){ + List caseAttaches= msCaseAttachMapper.selectByIds(fileIds); + if(CollectionUtil.isNotEmpty(caseAttaches)){ + Map attachMap = caseAttaches.stream().collect(Collectors.toMap(CaseAttach::getAnnexId, Function.identity(), (k1, k2) -> k2)); + for (SendMailRecord record : records) { + List msCaseAttaches = new ArrayList<>(); + if(recordmap.containsKey(record.getId())){ + String fileIdStr = recordmap.get(record.getId()); + if(ObjectUtil.isNotNull(fileIdStr) ) { + String[] splitFileId = fileIdStr.split(","); + for (String fileId : splitFileId) { + if (ObjectUtil.isNotNull(fileId) && attachMap.containsKey(Long.parseLong(fileId))) { + msCaseAttaches.add(attachMap.get(Long.parseLong(fileId))); + } + } + record.setCaseAttachList(msCaseAttaches); + } + } + } + } + } + } + return records; + } + + @Autowired + MsSendMailHistoryRecordMapper msSendMailHistoryRecordMapper; + + /** + * 编辑邮件记录 + * + * @param sendMailRecord + */ + @Override + public AjaxResult updateSendMailRecord(SendMailRecord sendMailRecord) { + try { + if (sendMailRecord != null && sendMailRecord.getId() != null) { + SendMailRecord old = sendMailRecordMapper.querySendMailRecordById(sendMailRecord.getId()); + MsSendMailHistoryRecord msSendMailHistoryRecord = new MsSendMailHistoryRecord(); + BeanUtils.copyProperties(old, msSendMailHistoryRecord); + msSendMailHistoryRecord.setParentId(old.getId()); + msSendMailHistoryRecord.setId(null); + msSendMailHistoryRecordMapper.insertSelective(msSendMailHistoryRecord); + sendMailRecord.setUpdateTime(new Date()); + if(CollectionUtil.isNotEmpty(sendMailRecord.getCaseAttachList())){ + List fileIdList = sendMailRecord.getCaseAttachList().stream().map(CaseAttach::getAnnexId).collect(Collectors.toList()); + if(CollectionUtil.isNotEmpty(fileIdList)){ + String fileIdStr = StrUtil.join(",", fileIdList); + sendMailRecord.setFileIds(fileIdStr); + } + } + sendMailRecordMapper.updateSendMailRecord(sendMailRecord); + return AjaxResult.success("编辑成功"); + } else { + return AjaxResult.error("编辑失败"); + } + } catch (Exception e) { + e.printStackTrace(); + return AjaxResult.error("编辑失败"); + } + } + + @Autowired + private EmailOutUtil emailOutUtil; + @Autowired + CaseAttachMapper msCaseAttachMapper; + + /** + * 重新发送邮件 + * + * @param sendMailRecord + * @return + */ + @Override + public Boolean reSendMailRecord(SendMailRecord sendMailRecord) { + List fileList = null; + // 附件名称map,路径-附件名称 + Map fileNameMap=new HashMap<>(); + if (sendMailRecord.getFileIds() != null && sendMailRecord.getFileIds() != "") { + String[] fileIds = sendMailRecord.getFileIds().split(","); + for (int i = 0; i < fileIds.length; i++) { + String fileId = fileIds[i]; + try { + Long id = Long.parseLong(fileId); + CaseAttach CaseAttach = msCaseAttachMapper.queryAnnexById(id); + String annexPath = CaseAttach.getAnnexPath(); + if (annexPath != null && annexPath != "") { + String prefix = "/profile"; + int startIndex = prefix.length(); + String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex + 1); + File file = new File(path); + fileList.add(file); + fileNameMap.put(file.getPath(), CaseAttach.getAnnexName()); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + Boolean flag = emailOutUtil.sendEmil(sendMailRecord.getMailAddress(), sendMailRecord.getMailContent(), sendMailRecord.getMailSubject(), fileList, null,fileNameMap); + //发送成功后更细邮件记录的发送时间和发送状态 + if (flag) { + sendMailRecord.setSendStatus(1); + sendMailRecord.setSendTime(new Date()); + sendMailRecord.setUpdateTime(new Date()); + sendMailRecordMapper.updateSendMailRecord(sendMailRecord); + } + return flag; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/shortmessage/ShortMessageService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/shortmessage/ShortMessageService.java new file mode 100644 index 0000000..c639564 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/shortmessage/ShortMessageService.java @@ -0,0 +1,41 @@ +package com.ruoyi.wisdomarbitrate.service.shortmessage; + +import com.ruoyi.common.core.domain.AjaxResult; + +import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord; +import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsSendRecordParam; +import com.ruoyi.wisdomarbitrate.domain.vo.shortmessage.MeetingInfoVO; +import com.ruoyi.wisdomarbitrate.domain.vo.shortmessage.ReSendMessageVO; + +import java.util.List; + +public interface ShortMessageService { + public List smsSendRecordList(SmsSendRecord smsSendRecord); + + /** + * 新增发送历史记录 + */ + void insertShortMessageHistoryRecord(SmsSendRecord smsSendRecord,List recordParams); + + /** + * 重新发送短信 + * + * @param reSendMessageVO + */ + AjaxResult reSendShortMessage(ReSendMessageVO reSendMessageVO); + + /** + * 根据信息生成加密信息记录 + * + * @param meetingInfoVO + * @return + */ + String buildMeetingInfoRecord(MeetingInfoVO meetingInfoVO); + + /** + * 通过UID查询加密信息并解密成明文对象 + */ + Object getMeetingInfo(String uid); + + AjaxResult smsCallBack(String body); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/shortmessage/impl/ShortMessageServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/shortmessage/impl/ShortMessageServiceImpl.java new file mode 100644 index 0000000..01ad44b --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/shortmessage/impl/ShortMessageServiceImpl.java @@ -0,0 +1,301 @@ +package com.ruoyi.wisdomarbitrate.service.shortmessage.impl; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.http.HttpRequest; +import cn.hutool.http.HttpResponse; +import cn.hutool.json.JSONObject; +import cn.hutool.json.JSONUtil; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.SMSStatusEnum; + +import com.ruoyi.wisdomarbitrate.utils.SmsUtils; +import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord; +import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsSendHistoryRecordParam; +import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsSendRecordParam; +import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsTemplate; +import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsTemplateParam; +import com.ruoyi.wisdomarbitrate.domain.shortmessage.MeetingInfo; +import com.ruoyi.wisdomarbitrate.domain.shortmessage.MsSmsSendHistoryRecord; + +import com.ruoyi.wisdomarbitrate.domain.vo.shortmessage.MeetingInfoVO; +import com.ruoyi.wisdomarbitrate.domain.vo.shortmessage.ReSendMessageVO; +import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper; +import com.ruoyi.wisdomarbitrate.mapper.shortmessage.MeetingInfoMapper; +import com.ruoyi.wisdomarbitrate.mapper.shortmessage.MsSmsSendHistoryRecordMapper; +import com.ruoyi.wisdomarbitrate.mapper.sms.MsSmsSendHistoryRecordParamMapper; +import com.ruoyi.wisdomarbitrate.mapper.sms.MsSmsSendRecordParamMapper; +import com.ruoyi.wisdomarbitrate.mapper.sms.MsSmsTemplateMapper; +import com.ruoyi.wisdomarbitrate.mapper.sms.MsSmsTemplateParamMapper; +import com.ruoyi.wisdomarbitrate.service.shortmessage.ShortMessageService; + +import io.jsonwebtoken.Jwts; +import io.jsonwebtoken.SignatureAlgorithm; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import tk.mybatis.mapper.entity.Example; + +import java.text.MessageFormat; +import java.util.*; +import java.util.stream.Collectors; + +@Service +public class ShortMessageServiceImpl implements ShortMessageService { + @Autowired + MsSmsSendHistoryRecordMapper msSmsSendHistoryRecordMapper; + @Autowired + MeetingInfoMapper meetingInfoMapper; + @Autowired + SmsRecordMapper smsRecordMapper; + @Autowired + MsSmsTemplateMapper templateMapper; + @Autowired + MsSmsTemplateParamMapper templateParamMapper; + @Autowired + MsSmsSendRecordParamMapper recordParamMapper; + @Autowired + MsSmsSendHistoryRecordParamMapper historyRecordParamMapper; + + @Override + public List smsSendRecordList(SmsSendRecord smsSendRecord) { + List records = smsRecordMapper.getSmsSendRecord(smsSendRecord); + if (CollectionUtil.isEmpty(records)) { + return records; + } + List templateIds = records.stream().map(SmsSendRecord::getMsSmsTemplateId).collect(Collectors.toList()); + if (CollectionUtil.isEmpty(templateIds)) { + return records; + } + List ids = records.stream().map(SmsSendRecord::getId).collect(Collectors.toList()); + // 查询记录表参数值 + Example recordParamExam = new Example(MsSmsSendRecordParam.class); + recordParamExam.createCriteria().andIn("smsRecordId", ids); + List recordParams = recordParamMapper.selectByExample(recordParamExam); + if (CollectionUtil.isEmpty(recordParams)) { + return records; + } + // 根据模板id查询模板参数 + Example templateParamExam = new Example(MsSmsTemplateParam.class); + templateParamExam.createCriteria().andIn("smsTemplateId", templateIds); + List templateParams = templateParamMapper.selectByExample(templateParamExam); + if (CollectionUtil.isEmpty(templateParams)) { + return records; + } + // 根据模板id对模板参数分组 + Map> templateParamMap = templateParams.stream().collect(Collectors.groupingBy(MsSmsTemplateParam::getSmsTemplateId)); + + // 根据记录id分组 + Map> recordParamContentMap = new HashMap<>(); + for (MsSmsSendRecordParam recordParam : recordParams) { + List list = recordParamContentMap.get(recordParam.getSmsRecordId()); + if (CollectionUtil.isEmpty(list)) { + list = new ArrayList<>(); + } + list.add(recordParam.getParamValue()); + recordParamContentMap.put(recordParam.getSmsRecordId(), list); + } + // 根据模板id查询模板 + Example templateExam = new Example(MsSmsTemplate.class); + templateExam.createCriteria().andIn("id", templateIds); + List templates = templateMapper.selectByExample(templateExam); + if (CollectionUtil.isEmpty(templates)) { + return records; + } + // 根据主键id获取模板内容 + Map templateMap = templates.stream().collect(Collectors.toMap(MsSmsTemplate::getId, MsSmsTemplate::getContent, (k1, k2) -> k2)); + Map templateIdMap = templates.stream().collect(Collectors.toMap(MsSmsTemplate::getId, MsSmsTemplate::getTemplateId, (k1, k2) -> k2)); + // 组装模板内容 + for (SmsSendRecord record : records) { + if (record.getMsSmsTemplateId() == null) { + continue; + } + if (!templateMap.containsKey(record.getMsSmsTemplateId())) { + continue; + } + + if (!recordParamContentMap.containsKey(record.getId())) { + continue; + } + if (templateIdMap.containsKey(record.getMsSmsTemplateId())) { + record.setTemplateId(templateIdMap.get(record.getMsSmsTemplateId())); + } + String templateContent = templateMap.get(record.getMsSmsTemplateId()); + record.setTemplateContent(templateContent); + List recordParamList = recordParamContentMap.get(record.getId()); + if (recordParamContentMap.containsKey(record.getId()) && templateParamMap.containsKey(record.getMsSmsTemplateId())) { + List templateParamList = templateParamMap.get(record.getMsSmsTemplateId()); + ArrayList copyParamList = new ArrayList<>(); + for (int i = 0; i < templateParamList.size(); i++) { + MsSmsTemplateParam templateParam = templateParamList.get(i); + MsSmsTemplateParam msSmsTemplateParam = new MsSmsTemplateParam(); + msSmsTemplateParam.setParam(templateParam.getParam()); + msSmsTemplateParam.setSmsTemplateId(templateParam.getSmsTemplateId()); + msSmsTemplateParam.setParamName(templateParam.getParamName()); + msSmsTemplateParam.setId(templateParam.getId()); + msSmsTemplateParam.setParamValue(recordParamContentMap.get(record.getId()).get(i)); + copyParamList.add(msSmsTemplateParam); + } + record.setTemplateParams(copyParamList); + + } + // 按顺序替换占位符 + if (CollectionUtil.isNotEmpty(recordParamList)) { + recordParamList.add(0, "0"); + + // 将List转换为String[]数组 + String[] paramArray = recordParamList.toArray(new String[recordParamList.size()]); + String formattedMessage = MessageFormat.format(templateContent, paramArray); + record.setSendContent(formattedMessage); + } + + + } + + return records; + } + + /** + * 新增发送历史记录 + * + * @param smsSendRecord + */ + @Transactional + @Override + public void insertShortMessageHistoryRecord(SmsSendRecord smsSendRecord, List recordParams) { + if (smsSendRecord != null) { + MsSmsSendHistoryRecord historyRecord = new MsSmsSendHistoryRecord(); + BeanUtils.copyProperties(smsSendRecord, historyRecord); + historyRecord.setId(null); + historyRecord.setParentId(smsSendRecord.getId()); + int i = msSmsSendHistoryRecordMapper.insert(historyRecord); + if (i > 0 && CollectionUtil.isNotEmpty(recordParams)) { + // 新增参数表 + List historyRecordParams = new ArrayList<>(); + for (MsSmsSendRecordParam templateParam : recordParams) { + MsSmsSendHistoryRecordParam recordParam = new MsSmsSendHistoryRecordParam(); + BeanUtils.copyProperties(templateParam, recordParam); + recordParam.setId(null); + recordParam.setSmsRecordHistoryId(historyRecord.getId()); + historyRecordParams.add(recordParam); + } + historyRecordParamMapper.batchInsert(historyRecordParams); + } + } + } + + /** + * 重新发送短信 + * + * @param reSendMessageVO + */ + @Override + public AjaxResult reSendShortMessage(ReSendMessageVO reSendMessageVO) { + if (reSendMessageVO != null && reSendMessageVO.getTemplateId() != null && reSendMessageVO.getPhone() != null && reSendMessageVO.getTemplateParams() != null && reSendMessageVO.getTemplateParams().size() > 0 && reSendMessageVO.getId() != null) { + // 根据id查询短信记录 + SmsSendRecord smsSendRecord = smsRecordMapper.selectById(reSendMessageVO.getId()); + if (smsSendRecord == null) { + return AjaxResult.warn("短信记录不存在"); + } + + SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); + request.setTemplateId(reSendMessageVO.getTemplateId()); + request.setPhone(reSendMessageVO.getPhone()); + List paramsList = reSendMessageVO.getTemplateParams().stream().map(MsSmsTemplateParam::getParamValue).collect(Collectors.toList()); + String[] messageContent = paramsList.toArray(new String[0]); + request.setTemplateParamSet(messageContent); + JSONObject resultObj = SmsUtils.sendSms(request); + smsSendRecord.setSendTime(new Date()); + // 修改sid和状态 + if (resultObj.get("status") != null && !resultObj.get("status").equals(SMSStatusEnum.FAIL.getCode())) { + smsSendRecord.setSendStatus(SMSStatusEnum.SENDING.getCode()); + smsSendRecord.setSid(resultObj.get("sid") == null ? null : resultObj.get("sid").toString()); + smsSendRecord.setReason(null); + // 修改 + smsRecordMapper.update(smsSendRecord); + + return AjaxResult.success("重新发送成功"); + } else { + smsSendRecord.setSid(resultObj.get("sid") == null ? null : resultObj.get("sid").toString()); + smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode()); + smsSendRecord.setSid(resultObj.get("reason") == null ? null : resultObj.get("reason").toString()); + // 修改 + smsRecordMapper.update(smsSendRecord); + return AjaxResult.warn("重新发送失败"); + } + } else { + return AjaxResult.warn("参数缺失"); + } + } + + /** + * 根据信息生成加密信息记录 + * + * @param meetingInfoVO + * @return + */ + @Override + public String buildMeetingInfoRecord(MeetingInfoVO meetingInfoVO) { + String uid = UUID.randomUUID().toString().replace("-", ""); + MeetingInfo meetingInfo = MeetingInfo.builder().userId(meetingInfoVO.getUserId()).userName(meetingInfoVO.getUserName()).caseId(meetingInfoVO.getCaseId()).roomId(meetingInfoVO.getRoomId()).systemType(meetingInfoVO.getSystemType()).createTime(new Date()).uid(uid).build(); + meetingInfo.setUid(uid); + meetingInfoMapper.insertSelective(meetingInfo); + return uid; + } + + /** + * 通过UID查询加密信息并解密成明文对象 + * + * @param uid + */ + @Override + public Object getMeetingInfo(String uid) { + MeetingInfoVO result = new MeetingInfoVO(); + MeetingInfo meetingInfo = meetingInfoMapper.selectByPrimaryKey(uid); + if (meetingInfo != null) { + BeanUtils.copyProperties(meetingInfo, result); + if (result != null) { + Map claims = new HashMap<>(); + claims.put("userName", meetingInfo.getUserName()); + claims.put("userId", meetingInfo.getUserId()); + claims.put(Constants.MEETING_KEY, uid); + String createToken = createToken(claims); + result.setToken(createToken); + } + return result; + } + return null; + } + + @Override + public AjaxResult smsCallBack(String body) { + cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(body); + if (jsonObject.get("sid") != null) { + Object description = jsonObject.get("description"); + System.out.println(description); + // 查询sid对应的短信,更新短信状态 + SmsSendRecord smsSendRecord = smsRecordMapper.selectBySId(jsonObject.getStr("sid")); + if (smsSendRecord != null) { + if (jsonObject.get("report_status") != null && jsonObject.getStr("report_status").equals("SUCCESS")) { + smsSendRecord.setSendStatus(SMSStatusEnum.SUCCESS.getCode()); + } else { + smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode()); + smsSendRecord.setReason(description != null ? description.toString() : null); + } + smsRecordMapper.updateStatus(smsSendRecord); + } + } + return AjaxResult.success(); + } + + // 令牌秘钥 + @Value("${token.secret}") + private String secret; + + private String createToken(Map claims) { + String token = Jwts.builder().setClaims(claims).signWith(SignatureAlgorithm.HS512, secret).compact(); + return token; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/sms/SMSTemplateService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/sms/SMSTemplateService.java new file mode 100644 index 0000000..2729176 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/sms/SMSTemplateService.java @@ -0,0 +1,22 @@ +package com.ruoyi.wisdomarbitrate.service.sms; + +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsTemplate; + + +import java.util.List; + +/** + * @Classname SMSTemplateService + * @Description + * @Version 1.0.0 + * @Date 2024/4/16 11:39 + * @Created wangqiong + */ +public interface SMSTemplateService { + List page(); + + AjaxResult insert(MsSmsTemplate template); + + AjaxResult delete(Long id); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/sms/impl/SMSTemplateServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/sms/impl/SMSTemplateServiceImpl.java new file mode 100644 index 0000000..1215061 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/sms/impl/SMSTemplateServiceImpl.java @@ -0,0 +1,96 @@ +package com.ruoyi.wisdomarbitrate.service.sms.impl; + +import cn.hutool.core.collection.CollectionUtil; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsTemplate; +import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsTemplateParam; +import com.ruoyi.wisdomarbitrate.mapper.sms.MsSmsTemplateMapper; +import com.ruoyi.wisdomarbitrate.mapper.sms.MsSmsTemplateParamMapper; +import com.ruoyi.wisdomarbitrate.service.sms.SMSTemplateService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import tk.mybatis.mapper.entity.Example; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @Classname SMSTemplateServiceImpl + * @Description + * @Version 1.0.0 + * @Date 2024/4/16 11:40 + * @Created wangqiong + */ +@Service +public class SMSTemplateServiceImpl implements SMSTemplateService { + @Autowired + private MsSmsTemplateMapper templateMapper; + @Autowired + private MsSmsTemplateParamMapper templateParamMapper; + + @Override + public List page() { + // 分页查询模板 + Example templateExam = new Example(MsSmsTemplate.class); + List templates = templateMapper.selectByExample(templateExam); + if(CollectionUtil.isEmpty(templates)){ + return null; + } + + List templateIds = templates.stream().map(MsSmsTemplate::getId).collect(Collectors.toList()); + // 查询参数 + Example templateParamExam = new Example(MsSmsTemplateParam.class); + templateParamExam.createCriteria().andIn("smsTemplateId", templateIds); + List templateParams = templateParamMapper.selectByExample(templateParamExam); + // 根据模板id对模板参数分组 + Map> templateParamMap = templateParams.stream().collect(Collectors.groupingBy(MsSmsTemplateParam::getSmsTemplateId)); + for (MsSmsTemplate template : templates) { + if(templateParamMap.containsKey(template.getId())){ + template.setTemplateParams(templateParamMap.get(template.getId())); + } + } + return templates; + } + + /** + * 新增或者修改 + * @param template + * @return + */ + @Override + public AjaxResult insert(MsSmsTemplate template) { + if(template.getId() == null){ + templateMapper.insert(template); + + }else{ + templateMapper.updateByPrimaryKey(template); + for (MsSmsTemplateParam templateParam : template.getTemplateParams()) { + templateParam.setSmsTemplateId(template.getId()); + } + // 先删除 + Example paramExam = new Example(MsSmsTemplateParam.class); + paramExam.createCriteria().andEqualTo("smsTemplateId", template.getId()); + templateParamMapper.deleteByExample(paramExam); + } + // 新增参数表 + if(CollectionUtil.isNotEmpty(template.getTemplateParams())){ + for (MsSmsTemplateParam templateParam : template.getTemplateParams()) { + templateParam.setSmsTemplateId(template.getId()); + } + templateParamMapper.batchInsert(template.getTemplateParams()); + } + return AjaxResult.success(); + } + + @Override + public AjaxResult delete(Long id) { + // 删除 + templateMapper.deleteByPrimaryKey(id); + // 删除参数表 + Example paramExam = new Example(MsSmsTemplateParam.class); + paramExam.createCriteria().andEqualTo("smsTemplateId", id); + templateParamMapper.deleteByExample(paramExam); + return AjaxResult.success(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/task/CaseZipImportTask.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/task/CaseZipImportTask.java new file mode 100644 index 0000000..9461f67 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/task/CaseZipImportTask.java @@ -0,0 +1,70 @@ +package com.ruoyi.wisdomarbitrate.task; + + +import com.ruoyi.common.core.domain.entity.SysDictData; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.FatchRule; +import com.ruoyi.wisdomarbitrate.service.impl.CaseZipImportImpl; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.Callable; + +/** + * @description rbd调用xfta计算任务类 + * @Author mingYang + * @Date 2021/11/12 15:35 + * @Version V1.0 + **/ + +public class CaseZipImportTask implements Callable> { + private CaseZipImportImpl caseZipImportImpl; + private Long templateId; + private List fatchRuleList; + private Map> fatchRuleMap; + private Map userMap; + private List dictDataList; + private File[] files; + private Map deptMap; + private LoginUser loginUser; + + + public CaseZipImportTask(CaseZipImportImpl caseZipImportImpl, Long templateId, List fatchRuleList, Map> fatchRuleMap, Map userMap, List dictDataList, File[] files, Map deptMap, LoginUser loginUser) { + this.caseZipImportImpl = caseZipImportImpl; + this.templateId = templateId; + this.fatchRuleList = fatchRuleList; + this.fatchRuleMap = fatchRuleMap; + this.userMap = userMap; + this.dictDataList = dictDataList; + this.files = files; + this.deptMap = deptMap; + this.loginUser = loginUser; + + } + + @Override + public List call() { + List caseApplications = new ArrayList<>(); + try { + for (File file1 : files) { + if (file1.isDirectory() && file1.listFiles() != null) { + + for (File file2 : file1.listFiles()) { + // CaseApplication caseApplication = caseZipImportImpl.buildCaseInfo(file2, templateId, fatchRuleList, fatchRuleMap, userMap, dictDataList, deptMap, loginUser); +// if (caseApplication != null) { +// caseApplications.add(caseApplication); +// } + } + } + } + } catch (Exception e) { + throw new RuntimeException("导入失败"); + } + + return caseApplications; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/CaseLogUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/CaseLogUtils.java index bcc6bff..64475ac 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/CaseLogUtils.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/CaseLogUtils.java @@ -47,6 +47,30 @@ public class CaseLogUtils operLog.setNotes(notes); caseLogRecordMapper.insertCaseLogRecord(operLog); } + /** + * 新增案件日志 + * @param caseAppliId 案件id,不能为空 + * @param caseNode 案件节点,不能为空 + * @param notes 备注 + */ + public static void insertCaseLog(@NotNull Long caseAppliId, @NotEmpty Integer caseNode, String notes ,LoginUser loginUser ){ + CaseLogRecord operLog = new CaseLogRecord(); + // 获取当前的用户 + if(loginUser!=null) { + SysUser sysUser = userMapper.selectUserById(loginUser.getUserId()); + operLog.setCreateBy(sysUser.getUserName()); + operLog.setCreateNickName(sysUser.getNickName()); + operLog.setUpdateBy(sysUser.getUserName()); + }else { + operLog.setCreateBy("admin"); + operLog.setCreateNickName("管理员"); + operLog.setUpdateBy("admin"); + } + operLog.setCaseAppliId(caseAppliId); + operLog.setCaseNode(caseNode); + operLog.setNotes(notes); + caseLogRecordMapper.insertCaseLogRecord(operLog); + } /** * 批量新增案件日志 * @param list diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/DigesdateUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/DigesdateUtils.java new file mode 100644 index 0000000..f3f87d0 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/DigesdateUtils.java @@ -0,0 +1,46 @@ +package com.ruoyi.wisdomarbitrate.utils; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import java.io.UnsupportedEncodingException; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; + +public class DigesdateUtils { + + public static String getSignStr(String paramsStr, String accessSec ) { + Mac macDiges = null; + try { + macDiges = Mac.getInstance("HmacSHA256"); + SecretKeySpec accessSecKey = new SecretKeySpec(accessSec.getBytes("UTF-8"), "HmacSHA256"); + macDiges.init(accessSecKey); + macDiges.update(paramsStr.getBytes("UTF-8")); + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + return null; + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + return null; + } catch (InvalidKeyException e) { + e.printStackTrace(); + return null; + } + return byteTrasferhex(macDiges.doFinal()); + } + + public static String byteTrasferhex(byte[] byteArrayData) { + StringBuilder hashBuilder = new StringBuilder(); + String stmpHex; + for (int n = 0; byteArrayData != null && n < byteArrayData.length; n++) { + stmpHex = Integer.toHexString(byteArrayData[n] & 0XFF); + if (stmpHex.length() == 1) + hashBuilder.append('0'); + hashBuilder.append(stmpHex); + } + return hashBuilder.toString(); + } + + + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java index c37bcef..191e879 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java @@ -43,7 +43,7 @@ public class FixSelectFlowDetailUtils { /* 定时查询签署流程详情 */ - @Scheduled(cron = "0/10 * * * * ?") +// @Scheduled(cron = "0/10 * * * * ?") @Transactional public void fixExecuteSelectFlowDetailUtils() { Gson gson = new Gson(); @@ -236,14 +236,14 @@ public class FixSelectFlowDetailUtils { if (downLoadFile) { CaseAttach caseAttach = new CaseAttach(); caseAttach.setAnnexType(10); //10代表印章图片 - caseAttach.setAnnexPath(savePath); - caseAttach.setAnnexName(saveName); + caseAttach.setAnnexPath(saveName); + caseAttach.setAnnexName(fileName); int i1 = caseAttachMapper.save(caseAttach); if (i1 > 0) { //将印章信息保存到公章管理表里 String sealName1 = sealName.substring(1, sealName.length() - 1); String sealId1 = sealId.substring(1, sealId.length() - 1); - Integer annexId1 = caseAttach.getAnnexId(); + Long annexId1 = caseAttach.getAnnexId(); sealManage.setAnnexId(annexId1); sealManage.setSealId(sealId1); sealManage.setSealName(sealName1); @@ -277,7 +277,7 @@ public class FixSelectFlowDetailUtils { /** * 定时查询印章审核状态 */ - @Scheduled(cron = "0/30 * * * * ?") +// @Scheduled(cron = "0/30 * * * * ?") @Transactional public void searchForInstitutionalSeal() { try { @@ -287,7 +287,7 @@ public class FixSelectFlowDetailUtils { if (sealManageList != null && sealManageList.size() > 0) { for (SealManage sealManage1 : sealManageList) { //查询企业内部印章 - Integer annexId = sealManage1.getAnnexId(); + Long annexId = sealManage1.getAnnexId(); String sealId = sealManage1.getSealId(); DeptIdentify deptIdentify = new DeptIdentify(); deptIdentify.setId(sealManage1.getIdentifyId()); @@ -336,7 +336,7 @@ public class FixSelectFlowDetailUtils { int i1 = caseAttachMapper.save(caseAttach); if (i1 > 0) { //将附件id保存到公章管理表里 - Integer annexId1 = caseAttach.getAnnexId(); + Long annexId1 = caseAttach.getAnnexId(); sealManage1.setAnnexId(annexId1); sealManage1.setSealStatus(1); sealManage1.setIsUse(0); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/OCRUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/OCRUtils.java index cfb8539..1135903 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/OCRUtils.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/OCRUtils.java @@ -115,13 +115,24 @@ public class OCRUtils { if (StrUtil.isEmpty(ocrText) || CollectionUtil.isEmpty(fatchRules)) { return; } + // 将识别后的字符串英文标点符号全部转为中文标点符号 + String ocrTextReplace = ocrText.replace(",", ",") +// .replace(".", "。") + .replace(":", ":").replace(";", ";").replace("?", "?").replace("!", "!").replace("(", "(") + .replace(")", ")").replace("[", "【").replace("]", "】").replace("{", "{").replace("}", "}") + .replace("<", "《").replace(">", "》").replace("|", "|").replace("\\", "\").replace("_", "_") + .replace("-", "-").replace("+", "+").replace("=", "=").replace("~", "~").replace("`", "`") + .replace("^", "^").replace("$", "¥").replace("@", "@").replace("#", "#").replace("%", "%") + .replace("&", "&").replace("*", "*").replace("(", "(").replace(")", ")").replace("{", "{") + .replace("}", "}").replace("[", "【").replace("]", "】").replace("<", "《").replace(">", "》") + .replace("|", "|").replace("\\", "\").replace("_", "_"); for (FatchRule fatchRule : fatchRules) { // 从后往前抓取 if (fatchRule.getFatchOrder() != null && fatchRule.getFatchOrder() == 1) { - reverseSubstringText(ocrText, fatchRule, fatchMap,null); + reverseSubstringText(ocrTextReplace, fatchRule, fatchMap,null); } else { // 从前往后抓取 - substringText(ocrText, fatchRule, fatchMap,null); + substringText(ocrTextReplace, fatchRule, fatchMap,null); } } @@ -167,22 +178,23 @@ public class OCRUtils { String endContent = fatchRule.getEndContent(); // 开始为空结束为空 if (StrUtil.isEmpty(startContent) && StrUtil.isEmpty(endContent)) { - fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(text)); + fatchMap.put(fatchRule.getColumnName(), trimStr(text)); } else if (StrUtil.isNotEmpty(startContent) && StrUtil.isEmpty(endContent)) { // 开始不为空结束为空 int startContIndex = StrUtil.ordinalIndexOf(text, startContent, fatchRule.getStartContentRepeatOrder()); if (startContIndex != -1 && text.length() >= (startContIndex + startContent.length())) { String substring = text.substring(startContIndex + startContent.length()); // 去除\n - fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(substring)); + fatchMap.put(fatchRule.getColumnName(), trimStr(substring)); } } else if (StrUtil.isEmpty(startContent) && StrUtil.isNotEmpty(endContent)) { // 开始为空结束不为空 int endContIndex = StrUtil.ordinalIndexOf(text, endContent, fatchRule.getEndContentRepeatOrder()); if (endContIndex != -1) { + // todo String substring = text.substring(0, endContIndex); - fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(substring)); + fatchMap.put(fatchRule.getColumnName(), trimStr(substring)); } } else if (StrUtil.isNotEmpty(startContent) && StrUtil.isNotEmpty(endContent)) { // 开始结束不为空 @@ -191,7 +203,7 @@ public class OCRUtils { if (startIndexOf != -1 && endIndexOf != -1 && endIndexOf >= (startIndexOf + startContent.length()) && text.length() >= endIndexOf) { String substring = text.substring(startIndexOf + startContent.length(), endIndexOf); - fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(substring)); + fatchMap.put(fatchRule.getColumnName(), trimStr(substring)); } } @@ -221,7 +233,7 @@ public class OCRUtils { } // 开始和结束截取都为空 if (StrUtil.isEmpty(reverseStartContent) && StrUtil.isEmpty(reverseEndContent)) { - fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(text)); + fatchMap.put(fatchRule.getColumnName(), trimStr(text)); } else if (StrUtil.isEmpty(reverseStartContent) && StrUtil.isNotEmpty(reverseEndContent)) { // 开始为空,结束不为空 // 根据截取的序号查找出位置 @@ -229,7 +241,7 @@ public class OCRUtils { if (indexOf != -1) { String substring = reverseText.substring(0, indexOf); if (StrUtil.isNotEmpty(substring)) { - fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(StrUtil.reverse(substring))); + fatchMap.put(fatchRule.getColumnName(), trimStr(StrUtil.reverse(substring))); } } } else if (StrUtil.isNotEmpty(reverseStartContent) && StrUtil.isEmpty(reverseEndContent)) { @@ -238,7 +250,7 @@ public class OCRUtils { if (indexOf != -1 && (indexOf + reverseStartContent.length() <= text.length())) { String substring = reverseText.substring(indexOf + reverseStartContent.length()); if (StrUtil.isNotEmpty(substring)) { - fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(StrUtil.reverse(substring))); + fatchMap.put(fatchRule.getColumnName(), trimStr(StrUtil.reverse(substring))); } } @@ -249,7 +261,7 @@ public class OCRUtils { if (startIndexOf != -1 && endIndexOf != -1 && endIndexOf >= (startIndexOf + reverseStartContent.length()) && text.length() >= endIndexOf) { String substring = reverseText.substring(startIndexOf + reverseStartContent.length(), endIndexOf); if (StrUtil.isNotEmpty(substring)) { - fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(StrUtil.reverse(substring))); + fatchMap.put(fatchRule.getColumnName(), trimStr(StrUtil.reverse(substring))); } } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java index 991f94c..5fc8e05 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java @@ -1,5 +1,7 @@ package com.ruoyi.wisdomarbitrate.utils; +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.google.gson.Gson; import com.google.gson.JsonArray; @@ -11,6 +13,7 @@ import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.EsignApplicaConfig; import com.ruoyi.common.utils.EsignHttpHelper; import com.ruoyi.common.utils.SealUtil; +import com.ruoyi.wisdomarbitrate.StringIdsReq; import com.ruoyi.wisdomarbitrate.domain.DeptIdentify; import com.ruoyi.wisdomarbitrate.domain.SealSignRecord; @@ -252,7 +255,7 @@ public class SignAward { /* " \"availableSealIds\": [\n" + " \"" + availableSealId + "\"\n" + " ],\n" +*/ - " \"availableSealIds\": " + new Gson().toJson(sealIdList) + ",\n" + + // " \"availableSealIds\": " + new Gson().toJson(sealIdList) + ",\n" + " \"signFieldPosition\": {\n" + " \"positionPage\": \"" + positionPageorg + "\",\n" + @@ -305,6 +308,50 @@ public class SignAward { //发起接口请求 return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false); } + /** + * 获取批量签页面链接 + * + * @return + * @throws EsignDemoException + */ + public static EsignHttpResponse batchSignUrl(StringIdsReq idsReq) throws EsignDemoException { + + List signFlowIds = idsReq.getIds(); + String psnAccount = idsReq.getPsnAccount(); + String apiaddr = "/v3/sign-flow/batch-sign-url"; + JSONObject paramObj = new JSONObject(); + paramObj.put("operatorId",idsReq.getPsnId()); + paramObj.put("signFlowIds",signFlowIds); + paramObj.put("clientType","PC"); + String jsonParm = JSON.toJSONString(paramObj); + //请求方法 + EsignRequestType requestType = EsignRequestType.POST; + //生成请求签名鉴权方式的Header + Map header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false); + //发起接口请求 + return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false); + } + /** + * 根据手机号获取账户id + * + * @return + * @throws EsignDemoException + */ + public static EsignHttpResponse identityInfo(StringIdsReq idsReq) throws EsignDemoException { + + List signFlowIds = idsReq.getIds(); + String psnAccount = idsReq.getPsnAccount(); + String apiaddr = "/v3/persons/identity-info?psnAccount=" +psnAccount; + + String jsonParm = "{}"; + //请求方法 + EsignRequestType requestType = EsignRequestType.GET; + //生成请求签名鉴权方式的Header + Map header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false); + //发起接口请求 + return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false); + } + /** * 获取合同文件用印链接 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignVerifyUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignVerifyUtils.java new file mode 100644 index 0000000..b344dad --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignVerifyUtils.java @@ -0,0 +1,96 @@ +package com.ruoyi.wisdomarbitrate.utils; + +import com.ruoyi.common.utils.EsignApplicaConfig; +import com.ruoyi.common.utils.StringUtils; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Enumeration; +import java.util.List; + +public class SignVerifyUtils { + private static String eSignAppSecret = EsignApplicaConfig.EsignAppSecret; + + + + public static boolean checkSignuter() throws Exception { + HttpServletRequest httprequest = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest(); + String orialsignature = httprequest.getHeader("X-Tsign-Open-SIGNATURE"); + String timestampreq = httprequest.getHeader("X-Tsign-Open-TIMESTAMP"); + String reqQuerystr =getHttpreqQuery(); + //获取请求参数 + String reqbodystr =getRequestBody(); + String signOriaData = timestampreq + reqQuerystr + reqbodystr; + String newDisgSignuter= DigesdateUtils.getSignStr(signOriaData, eSignAppSecret); + + + if (StringUtils.equals(orialsignature, newDisgSignuter)) { + return true; + }else { + return false; + } + } + + + + public static String getHttpreqQuery() { + HttpServletRequest httprequest = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest(); + List reqNames= new ArrayList(); + Enumeration httpreqEle =httprequest.getParameterNames(); + while (httpreqEle.hasMoreElements()){ + reqNames.add(httpreqEle.nextElement()); + } + Collections.sort(reqNames); + String httpreqQuery = ""; + for (String reqName : reqNames) { + String reqvalue = httprequest.getParameter(reqName); + httpreqQuery += reqvalue == null ? "" : reqvalue; + } + return httpreqQuery; + } + + public static String getRequestBody() { + HttpServletRequest httprequest = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest(); + String requestBody = ""; + int reqContentLen = httprequest.getContentLength(); + if (reqContentLen < 0) { + return null; + } + byte bufByteArray[] = new byte[reqContentLen]; + try { + for (int i = 0; i < reqContentLen;) { + int lengthReadInputStream = httprequest.getInputStream().read(bufByteArray, i, reqContentLen - i); + if (lengthReadInputStream == -1) { + break; + } + i += lengthReadInputStream; + } + } catch (IOException e) { + e.printStackTrace(); + } + try { + requestBody = new String(bufByteArray, "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + return requestBody; + } + + + + + + + + + + + + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SmsUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SmsUtils.java new file mode 100644 index 0000000..1a8ec4e --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SmsUtils.java @@ -0,0 +1,198 @@ +package com.ruoyi.wisdomarbitrate.utils; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.extra.spring.SpringUtil; +import cn.hutool.json.JSONObject; +import com.ruoyi.common.enums.SMSStatusEnum; +import com.ruoyi.common.utils.ThreadUtil; +import com.ruoyi.system.mapper.SysRoleMapper; +import com.ruoyi.system.mapper.SysUserMapper; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord; +import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsSendRecordParam; +import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsTemplate; +import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper; +import com.ruoyi.wisdomarbitrate.mapper.sms.MsSmsSendRecordParamMapper; +import com.ruoyi.wisdomarbitrate.mapper.sms.MsSmsTemplateMapper; +import com.ruoyi.wisdomarbitrate.service.shortmessage.ShortMessageService; +import com.tencentcloudapi.common.Credential; +import com.tencentcloudapi.common.exception.TencentCloudSDKException; +import com.tencentcloudapi.common.profile.ClientProfile; +import com.tencentcloudapi.common.profile.HttpProfile; +import com.tencentcloudapi.cvm.v20170312.CvmClient; +import com.tencentcloudapi.cvm.v20170312.models.DescribeRegionsRequest; +import com.tencentcloudapi.cvm.v20170312.models.DescribeRegionsResponse; +import com.tencentcloudapi.sms.v20210111.SmsClient; +import com.tencentcloudapi.sms.v20210111.models.SendSmsResponse; +import com.tencentcloudapi.sms.v20210111.models.SendStatus; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import lombok.var; +import tk.mybatis.mapper.entity.Example; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Objects; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutorService; + +@Slf4j +public class SmsUtils { + //应用id + private static final String SDK_APP_ID = "1400854852"; + //API的SecretId + private static final String SECRET_ID = "AKIDeEf2A8uX1HSainvvnXAc3X9ZlhtyvkMp"; + //API的SecretKey + private static final String SECRET_KEY = "QjphKo8zkHZigT8j9PVtFPJyfIvO3d6V"; + //签名内容 + private static final String SIGN_NAME = "乙巢智慧仲裁网"; + private static SmsRecordMapper recordMapper = SpringUtil.getBean(SmsRecordMapper.class); + private static MsSmsSendRecordParamMapper recordParamMapper = SpringUtil.getBean(MsSmsSendRecordParamMapper.class); + private static MsSmsTemplateMapper templateMapper = SpringUtil.getBean(MsSmsTemplateMapper.class); + private static SysUserMapper sysUserMapper = SpringUtil.getBean(SysUserMapper.class); + private static SysRoleMapper roleMapper = SpringUtil.getBean(SysRoleMapper.class); + private static ShortMessageService shortMessageService = SpringUtil.getBean(ShortMessageService.class); + + public static JSONObject sendSms(SendSmsRequest request) { + JSONObject jsonObject = new JSONObject(); + Credential cred = new Credential(SECRET_ID, SECRET_KEY); + + SmsClient client = new SmsClient(cred, "ap-guangzhou"); + + final var req = new com.tencentcloudapi.sms.v20210111.models.SendSmsRequest(); + req.setPhoneNumberSet(new String[]{"+86" + request.getPhone()}); + req.setSmsSdkAppId(SDK_APP_ID); + req.setSignName(SIGN_NAME); + req.setTemplateId(request.getTemplateId()); + req.setTemplateParamSet(request.getTemplateParamSet()); + SendSmsResponse res = null; + try { + res = client.SendSms(req); + } catch (TencentCloudSDKException e) { + log.error("发送短信出错:", e); + jsonObject.set("status", SMSStatusEnum.FAIL.getCode()); + jsonObject.set("reason",e.getMessage()); + return jsonObject; + } + SendStatus sendStatus = res.getSendStatusSet()[0]; + log.info("发送短信结果:Code={}, Message={}", sendStatus.getCode(), sendStatus.getMessage()); + + if (Objects.nonNull(res.getSendStatusSet()) && res.getSendStatusSet().length > 0 && "Ok".equals(res.getSendStatusSet()[0].getCode())) { + jsonObject.set("status", SMSStatusEnum.SENDING.getCode()); + } else { + jsonObject.set("status", SMSStatusEnum.FAIL.getCode()); + } + jsonObject.set("sid", sendStatus.getSerialNo()); + return jsonObject; + } + + public static void sendSms(CaseApplication application, String templateId, String phone, String[] templateParamSet) { + if(application==null||StrUtil.isEmpty(templateId)||StrUtil.isEmpty(phone)||templateParamSet==null||templateParamSet.length==0){ + return; + } + Example templateExam = new Example(MsSmsTemplate.class); + templateExam.createCriteria().andEqualTo("templateId", templateId); + List templates = templateMapper.selectByExample(templateExam); + if (CollectionUtil.isEmpty(templates)) { + return ; + } + MsSmsTemplate template = templates.get(0); + SendSmsRequest request = new SendSmsRequest(phone, templateId, templateParamSet, application.getId()); + Credential cred = new Credential(SECRET_ID, SECRET_KEY); + + SmsClient client = new SmsClient(cred, "ap-guangzhou"); + + final var req = new com.tencentcloudapi.sms.v20210111.models.SendSmsRequest(); + req.setPhoneNumberSet(new String[]{"+86" + request.getPhone()}); + req.setSmsSdkAppId(SDK_APP_ID); + req.setSignName(SIGN_NAME); + req.setTemplateId(request.getTemplateId()); + req.setTemplateParamSet(request.getTemplateParamSet()); + sendSms(client,template,application,phone, templateParamSet,req); + } + + + private static void sendSms(SmsClient client,MsSmsTemplate template, CaseApplication application, String phone, String[] templateParamSet, com.tencentcloudapi.sms.v20210111.models.SendSmsRequest req) { + SmsSendRecord smsSendRecord=new SmsSendRecord(); + smsSendRecord.setMsSmsTemplateId(template.getId()); + smsSendRecord.setCaseId(application.getId()); + smsSendRecord.setCaseNum(application.getCaseNum()); + smsSendRecord.setSendTime(new Date()); + smsSendRecord.setPhone(phone); + smsSendRecord.setCreateTime(new Date()); +// smsSendRecord.setCreateBy(SecurityUtils.getUsername()); + // SendSmsRequest request = new SendSmsRequest(phone, template.getTemplateId(), templateParamSet, application.getId()); + req.setPhoneNumberSet(new String[]{"+86" + phone}); + req.setTemplateId(template.getTemplateId()); + req.setTemplateParamSet(templateParamSet); + try { + SendSmsResponse res=client.SendSms(req); + SendStatus sendStatus = res.getSendStatusSet()[0]; + if (Objects.nonNull(res.getSendStatusSet()) && res.getSendStatusSet().length > 0 && "Ok".equals(res.getSendStatusSet()[0].getCode())) { + smsSendRecord.setSendStatus( SMSStatusEnum.SENDING.getCode()); + } else { + smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode()); + smsSendRecord.setReason(sendStatus.getMessage()); + } + smsSendRecord.setSid(sendStatus.getSerialNo()); + } catch (TencentCloudSDKException e) { + smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode()); + smsSendRecord.setReason(e.getMessage()); + } + int i = recordMapper.saveSmsSendRecord(smsSendRecord); + if(i>0){ + List recordParams=new ArrayList<>(); + for (String paramValue : templateParamSet) { + // 新增参数 + MsSmsSendRecordParam recordParam = new MsSmsSendRecordParam(); + recordParam.setSmsRecordId(smsSendRecord.getId()); + recordParam.setParamValue(paramValue); + recordParams.add(recordParam); + } +// recordParamMapper.batchInsert(recordParams); +// shortMessageService.insertShortMessageHistoryRecord(smsSendRecord,recordParams); + ExecutorService executor = ThreadUtil.createThreadPool(); + CompletableFuture.runAsync(() -> { + recordParamMapper.batchInsert(recordParams); + + }, executor); + // 新增历史记录表 + CompletableFuture.runAsync(() -> { + shortMessageService.insertShortMessageHistoryRecord(smsSendRecord,recordParams); + + }, executor); + + } + } + + /** + * 参数对象 + */ + @Data + @NoArgsConstructor + @AllArgsConstructor + public static class SendSmsRequest { + /** + * 电话 + */ + private String phone; + + /** + * 模板 ID: 必须填写已审核通过的模板 ID + */ + private String templateId; + + /** + * 模板参数: 模板参数的个数需要与 TemplateId 对应模板的变量个数保持一致,若无模板参数,则设置为空 + */ + private String[] templateParamSet; + private Long caseId; + + } + + +} diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml index 588b191..eed8294 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -105,6 +105,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" email, status, create_by, + code, + comp_legal_person, + home, + address, + nationality, create_time )values( #{deptId}, @@ -118,6 +123,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{email}, #{status}, #{createBy}, + #{code}, + #{compLegalPerson}, + #{home}, + #{address}, + #{nationality}, sysdate() ); @@ -168,6 +178,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" email = #{email}, status = #{status}, update_by = #{updateBy}, + code = #{code}, + comp_legal_person = #{compLegalPerson}, + home = #{home}, + address = #{address}, + nationality = #{nationality}, update_time = sysdate() where dept_id = #{deptId} @@ -196,5 +211,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update sys_dept set del_flag = '2' where dept_id = #{deptId} - + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml index 6762007..fcd6d98 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml @@ -108,7 +108,7 @@ left join sys_role_menu rm on m.menu_id = rm.menu_id left join sys_user_role ur on rm.role_id = ur.role_id left join sys_role r on r.role_id = ur.role_id - where m.status = '0' and r.status = '0' and ur.user_id = #{userId} + where m.status = '0' and r.status = '0' and ur.user_id = #{userId} and m.perms is not null and m.perms!='' - + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml index dd72689..1dc018e 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml @@ -16,8 +16,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - + + + delete from sys_user_role where user_id in #{userId} @@ -41,4 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{userId} + + insert into sys_user_role(user_id, role_id) values(#{userId}, #{roleId}) + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml index 7947701..2a6f912 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml @@ -18,6 +18,10 @@ + + + + @@ -34,6 +38,7 @@ check_opinion, case_check_reject, arbitrate_reject, + pay_reject_reason, create_by, case_focus, case_facts, @@ -51,6 +56,7 @@ #{checkOpinion}, #{caseCheckReject}, #{arbitrateReject}, + #{payRejectReason}, #{createBy}, #{caseFocus}, #{caseFacts}, @@ -79,8 +85,9 @@ respondent_opinion = #{respondentOpinion}, applicant_opinion = #{applicantOpinion}, case_check_reject = #{caseCheckReject}, - arbitrate_reject = #{arbitrateReject}, - deptor_reject = #{deptorReject}, + arbitrate_reject = #{arbitrateReject}, + deptor_reject = #{deptorReject}, + pay_reject_reason = #{payRejectReason}, update_time = sysdate() where id = #{id} @@ -88,15 +95,14 @@ diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateLogMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateLogMapper.xml index 6c8dab1..8405582 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateLogMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateLogMapper.xml @@ -63,22 +63,11 @@ - insert into case_affiliate_log(case_appli_log_id, identity_type,application_organ_id,application_organ_name,name,identity_num,contact_telphone, - contact_address,work_address,work_telphone ,name_agent,identity_num_agent,contact_telphone_agent, - comp_legal_person,comp_legalper_post,respon_sex ,respon_birth, - residen_affili,appli_agent_title, - contact_address_agent,email , send_email,track_num,applicant_agent_user_id,agent_email) values + + insert into case_affiliate_log(case_appli_log_id, user_id,applicant_dept_id,role_type,group_order,operator_flag,organize_flag) values - (#{item.caseAppliLogId},#{item.identityType},#{item.applicationOrganId},#{item.applicationOrganName},#{item.name},#{item.identityNum},#{item.contactTelphone}, - #{item.contactAddress},#{item.workAddress},#{item.workTelphone}, #{item.nameAgent},#{item.identityNumAgent},#{item.contactTelphoneAgent}, - #{item.compLegalPerson},#{item.compLegalperPost},#{item.responSex}, #{item.responBirth}, - #{item.residenAffili},#{item.appliAgentTitle}, - #{item.contactAddressAgent}, - #{item.email}, - #{item.sendEmail}, - #{item.trackNum}, - #{item.applicantAgentUserId}, - #{item.agentEmail} + (#{item.caseAppliLogId},#{item.userId},#{item.applicantDeptId},#{item.roleType},#{item.groupOrder},#{item.operatorFlag},#{item.organizeFlag} + ) ; diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml index d4334ba..90d791a 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml @@ -3,179 +3,152 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - + select c.id caseAppliId,a.id,a.role_type roleType,a.group_order groupOrder,a.operator_flag operatorFlag,d.code,d.comp_legal_person compLegalPerson,u.id_card idCard,u.phonenumber phone, + u.email, + (case when a.user_id is null then d.dept_name else u.nick_name end) name, + (case when a.user_id is null then d.home else u.home end) home, + (case when a.user_id is null then d.address else u.address end) address, + (case when a.user_id is null then d.nationality else u.nationality end) nationality, + u.sex,u.id_type idType,u.birth,r.role_name roleName,d.dept_name applicantOrgName,a.user_id userId,a.applicant_dept_id applicantDeptId,a.organize_flag organizeFlag + FROM + case_application c + JOIN case_affiliate a ON c.id = a.case_appli_id + LEFT JOIN sys_user u ON u.user_id = a.user_id + LEFT JOIN sys_user_role ur ON u.user_id = ur.user_id + LEFT JOIN sys_role r ON r.role_id = ur.role_id + LEFT JOIN sys_dept d ON d.dept_id = a.applicant_dept_id - - AND c.case_appli_id = #{caseAppliId} + + c.id=#{ caseAppliId} + GROUP BY a.id,r.role_id order by a.id asc + + + + - + + + select c.id caseAppliId,a.id,a.role_type roleType,a.group_order groupOrder,a.operator_flag operatorFlag,d.code,d.comp_legal_person compLegalPerson,u.id_card idCard,u.phonenumber phone, + u.email, + (case when a.user_id is null then d.dept_name else u.nick_name end) name, + (case when a.user_id is null then d.home else u.home end) home, + (case when a.user_id is null then d.address else u.address end) address, + (case when a.user_id is null then d.nationality else u.nationality end) nationality, + u.sex,u.id_type idType,u.birth,r.role_name roleName,d.dept_name applicantOrgName,a.user_id userId,a.applicant_dept_id applicantDeptId,a.organize_flag organizeFlag + FROM + case_application c + JOIN case_affiliate a ON c.id = a.case_appli_id + LEFT JOIN sys_user u ON u.user_id = a.user_id + LEFT JOIN sys_user_role ur ON u.user_id = ur.user_id + LEFT JOIN sys_role r ON r.role_id = ur.role_id + LEFT JOIN sys_dept d ON d.dept_id = a.applicant_dept_id - - case_appli_id in - - #{item} + + and a.case_appli_id in + + #{caseId} - + select a.*,u.email + from case_affiliate a + left join sys_user u on u.user_id=a.user_id - - - - insert into case_affiliate(case_appli_id, identity_type,application_organ_id,application_organ_name,name,identity_num,contact_telphone, - contact_address,work_address,work_telphone ,name_agent,identity_num_agent,contact_telphone_agent, - comp_legal_person,comp_legalper_post,respon_sex ,respon_birth, - residen_affili,appli_agent_title, - contact_address_agent,email, send_email,track_num,applicant_agent_user_id,agent_email) values + insert into case_affiliate(case_appli_id, user_id,applicant_dept_id,role_type,group_order,operator_flag,organize_flag) values - (#{item.caseAppliId},#{item.identityType},#{item.applicationOrganId},#{item.applicationOrganName},#{item.name},#{item.identityNum},#{item.contactTelphone}, - #{item.contactAddress},#{item.workAddress},#{item.workTelphone}, #{item.nameAgent},#{item.identityNumAgent},#{item.contactTelphoneAgent}, - #{item.compLegalPerson},#{item.compLegalperPost},#{item.responSex}, #{item.responBirth}, - #{item.residenAffili},#{item.appliAgentTitle}, - #{item.contactAddressAgent}, - #{item.email}, - #{item.sendEmail}, - #{item.trackNum}, - #{item.applicantAgentUserId}, - #{item.agentEmail} + (#{item.caseAppliId},#{item.userId},#{item.applicantDeptId},#{item.roleType},#{item.groupOrder},#{item.operatorFlag},#{item.organizeFlag} + ) + + INSERT INTO case_affiliate + + + case_appli_id, + + + user_id, + + + applicant_dept_id, + + + role_type, + + + group_order, + + + operator_flag, + + + organize_flag + + + + + #{caseAppliId}, + + + #{userId}, + + + #{applicantDeptId}, + + + #{roleType}, + + + #{groupOrder}, + + + #{operatorFlag}, + + + #{organizeFlag} + + + - - - update case_affiliate - set - case_appli_id=#{caseAppliId}, - identity_type= #{identityType}, - application_organ_id= #{applicationOrganId}, - application_organ_name= #{applicationOrganName}, - name = #{name}, - identity_num = #{identityNum}, - contact_telphone = #{contactTelphone}, - contact_address = #{contactAddress}, - work_address = #{workAddress}, - work_telphone = #{workTelphone}, - name_agent = #{nameAgent}, - identity_num_agent = #{identityNumAgent}, - contact_telphone_agent = #{contactTelphoneAgent}, - contact_address_agent = #{contactAddressAgent}, - send_email = #{sendEmail}, - residen_affili = #{residenAffili}, - email= #{email}, - track_num = #{trackNum}, - comp_legal_person=#{compLegalPerson}, - comp_legalper_post=#{compLegalperPost}, - applicant_agent_user_id=#{applicantAgentUserId}, - respon_sex=#{responSex}, - respon_birth=#{responBirth}, - residen_affili=#{residenAffili}, - appli_agent_title=#{appliAgentTitle} - - - ,agent_email=#{agentEmail} - - where id = #{id} - - - - - - update case_affiliate - - - application_organ_id= #{item.applicationOrganId}, - application_organ_name= #{item.applicationOrganName}, - name = #{item.name}, - identity_num = #{item.identityNum}, - contact_telphone = #{item.contactTelphone}, - contact_address = #{item.contactAddress}, - work_address = #{item.workAddress}, - work_telphone = #{item.workTelphone}, - - name_agent = #{item.nameAgent}, - identity_num_agent = #{item.identityNumAgent}, - contact_telphone_agent = #{item.contactTelphoneAgent}, - contact_address_agent = #{item.contactAddressAgent}, - send_email = #{item.sendEmail}, - residen_affili = #{item.residenAffili}, - email= #{item.email}, - track_num = #{item.trackNum}, - comp_legal_person=#{item.compLegalPerson}, - comp_legalper_post=#{item.compLegalperPost}, - applicant_agent_user_id=#{item.applicantAgentUserId}, - respon_sex=#{item.responSex}, - respon_birth=#{item.responBirth}, - residen_affili=#{item.residenAffili}, - appli_agent_title=#{item.appliAgentTitle} - - - ,agent_email=#{agentEmail} - - - where case_appli_id = #{caseAppliId} and identity_type= #{item.identityType}; - - - delete from case_affiliate where case_appli_id = #{id} diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml index d3a0308..78966d3 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml @@ -90,7 +90,7 @@ mediation_agreement, create_time )values( - #{id} , + #{caseLogId} , #{caseAppliId}, #{caseName}, #{caseNum}, @@ -202,25 +202,27 @@ WHERE id = #{id} - delete a from case_affiliate_log a - join case_application_log l on l.id=a.case_appli_log_id - where l.id in ( - - #{id} + + delete from case_application_log l where l.id in + + #{item} - ); - delete a from case_attach_log a - join case_application_log l on l.id=a.case_appli_log_id - where l.id in ( - - #{id} + ; + delete from case_affiliate_log l where l.case_appli_log_id in + + #{item} - ); - delete from case_application_log l where l.id in ( - - #{id} + ; + delete from case_attach_log l where l.case_appli_log_id in + + #{item} - ); + ; + delete from column_value_log l where l.case_appli_log_id in + + #{item} + + ; @@ -278,6 +280,12 @@ FROM case_application_log WHERE case_appli_id = #{caseId} and version < #{version} and update_submit_status not in ( 4, 5 ) order by version desc limit 1 + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index 76ab5d9..8480962 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -4,619 +4,226 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + - - + + - - - - + + + + - - - - - + + + + + - - - - - + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + from case_application c + JOIN case_affiliate a ON c.id = a.case_appli_id + LEFT JOIN sys_user u ON u.user_id = a.user_id + LEFT JOIN sys_user u1 ON u1.user_id = c.arbitrator_id + LEFT JOIN sys_user u2 ON u2.user_name = c.create_by + LEFT JOIN sys_user_role ur ON u.user_id = ur.user_id OR u1.user_id = ur.user_id or u2.user_id = ur.user_id + LEFT JOIN sys_role r ON r.role_id = ur.role_id + LEFT JOIN sys_dept d ON d.dept_id = a.applicant_dept_id - - - - - - - + SELECT DISTINCT c.batch_number ,c.arbitrat_method , + c.arbitrator_id ,a.identity_type ,a.name ,a.application_organ_id as applicationOrganId, + a.application_organ_name as applicantName, 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.lock_status, - c.update_by ,c.update_time , c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName,c.filearbitra_url,(select version from - case_application_log where case_appli_id=c.id order by version desc limit 1) as version,(select - update_submit_status from case_application_log where case_appli_id=c.id order by version desc limit 1) - as updateSubmitStatus,c.batch_number - 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 c.id = l.case_appli_id and c.version=l.version - - - - AND c.case_status = #{caseStatus} - - - AND c.lock_status = #{lockStatus} - - - AND c.case_num = #{caseNum} - - - AND ca.application_organ_id=#{nameId} AND ca.identity_type=1 - - - and c.case_status in - - #{caseStatus} - - - - order by c.case_num desc - - - - + select count(1) from case_application c AND c.case_num = #{caseNum} - + insert into case_application( - id , + id , case_name , case_num, case_subject_amount, @@ -921,8 +287,6 @@ claim_interest_owed, claim_liquid_damag, fee_payable, - begin_video_date, - online_video_person, contract_number, @@ -938,7 +302,7 @@ batch_number, create_time )values( - #{id} , + #{id} , #{caseName}, #{caseNum}, #{caseSubjectAmount}, @@ -955,8 +319,7 @@ #{claimInterestOwed}, #{claimLiquidDamag}, #{feePayable}, - #{beginVideoDate}, - #{onlineVideoPerson}, + #{contractNumber}, @@ -979,7 +342,7 @@ id, case_name , case_num, - case_subject_amount, + case_subject_amount, register_date, arbitrat_method, case_status, @@ -993,8 +356,6 @@ claim_interest_owed, claim_liquid_damag, fee_payable, - begin_video_date, - online_video_person, contract_number, @@ -1004,53 +365,346 @@ create_by, import_flag, version, - template_id, + template_id, facts, mediation_agreement, batch_number, create_time )values - ( - #{item.id}, - #{item.caseName}, - #{item.caseNum}, - #{item.caseSubjectAmount}, - sysdate(), - #{item.arbitratMethod}, - #{item.caseStatus}, - #{item.hearDate}, - #{item.arbitratClaims}, - #{item.requestRule}, - #{item.loanStartDate}, - #{item.loanEndDate}, - #{item.claimPrinciOwed}, + ( + #{item.id}, + #{item.caseName}, + #{item.caseNum}, + #{item.caseSubjectAmount}, + sysdate(), + #{item.arbitratMethod}, + #{item.caseStatus}, + #{item.hearDate}, + #{item.arbitratClaims}, + #{item.requestRule}, + #{item.loanStartDate}, + #{item.loanEndDate}, + #{item.claimPrinciOwed}, - #{item.claimInterestOwed}, - #{item.claimLiquidDamag}, - #{item.feePayable}, - #{item.beginVideoDate}, - #{item.onlineVideoPerson}, + #{item.claimInterestOwed}, + #{item.claimLiquidDamag}, + #{item.feePayable}, - #{item.contractNumber}, - #{item.adjudicaCounter}, - #{item.properPreser}, - #{item.createBy}, - #{item.importFlag}, - #{item.version}, - #{item.templateId}, + #{item.contractNumber}, - #{item.facts}, - #{item.mediationAgreement}, - #{item.batchNumber}, - sysdate() - ) + #{item.adjudicaCounter}, + #{item.properPreser}, + + #{item.createBy}, + #{item.importFlag}, + #{item.version}, + #{item.templateId}, + + #{item.facts}, + #{item.mediationAgreement}, + #{item.batchNumber}, + sysdate() + ) ; + + INSERT INTO case_application + + + case_num, + + + id , + + + case_subject_amount, + + + register_date, + + + arbitrat_method, + + + case_status, + + + hear_date, + + + arbitrat_claims, + + + loan_start_date, + + + loan_end_date, + + + claim_princi_owed, + + + claim_interest_owed, + + + claim_liquid_damag, + + + fee_payable, + - + + contract_number, + + + create_time, + + + update_by, + + + update_time, + + + create_by, + + + arbitrator_id, + + + case_name, + + + case_result, + + + is_agree_pend_tral, + + + objection_add_eviden, + + + + paid_expenses, + + + filearbitra_url, + + + pay_type, + + + request_rule, + + + adjudica_counter, + + + adjudica_counter_reason, + + + proper_preser, + + + objecti_juris, + + + is_absence, + + + respon_cross_opin, + + + applica_cross_opin, + + + respon_defen_opini, + + + appli_is_absen, + + + lock_status, + + + room_id, + + + import_flag, + + + version, + + + facts, + + + batch_number, + + + template_id, + + + mediation_agreement, + + + appli_iswrit_hear, + + + respon_isWrit_hear + + + + + #{caseNum}, + + + #{id}, + + + #{caseSubjectAmount}, + + + #{registerDate}, + + + #{arbitratMethod}, + + + #{caseStatus}, + + + #{hearDate}, + + + #{arbitratClaims}, + + + #{loanStartDate}, + + + #{loanEndDate}, + + + #{claimPrinciOwed}, + + + #{claimInterestOwed}, + + + #{claimLiquidDamag}, + + + #{feePayable}, + + + + #{contractNumber}, + + + #{createTime}, + + + #{updateBy}, + + + #{updateTime}, + + + #{createBy}, + + + #{arbitratorId}, + + + #{caseName}, + + + #{caseResult}, + + + #{isAgreePendTral}, + + + #{objectionAddEviden}, + + + + #{paidExpenses}, + + + #{filearbitraUrl}, + + + #{payType}, + + + #{requestRule}, + + + #{adjudicaCounter}, + + + #{adjudicaCounterReason}, + + + #{properPreser}, + + + #{objectiJuris}, + + + #{isAbsence}, + + + #{responCrossOpin}, + + + #{applicaCrossOpin}, + + + #{responDefenOpini}, + + + #{appliIsAbsen}, + + + #{lockStatus}, + + + #{roomId}, + + + #{importFlag}, + + + #{version}, + + + #{facts}, + + + #{batchNumber}, + + + #{templateId}, + + + #{mediationAgreement}, + + + #{appliIswritHear}, + + + #{responIsWritHear} + + + + + update case_application case_subject_amount = #{caseSubjectAmount}, @@ -1065,8 +719,7 @@ claim_interest_owed = #{claimInterestOwed}, claim_liquid_damag = #{claimLiquidDamag}, fee_payable = #{feePayable}, - begin_video_date = #{beginVideoDate}, - online_video_person = #{onlineVideoPerson}, + contract_number = #{contractNumber}, @@ -1075,27 +728,24 @@ case_result = #{caseResult}, case_status = #{caseStatus}, proper_preser = #{properPreser}, - appli_iswrit_hear = #{applicantIsWrittenHear}, respon_isWrit_hear = #{respondentIsWrittenHear}, - update_by = #{updateBy}, case_num = #{caseNum}, version = #{version}, - facts = #{facts}, - mediation_agreement = #{mediationAgreement}, + facts = #{facts}, + mediation_agreement = #{mediationAgreement} update_time = sysdate() where id = #{id} - + update case_application case_status = #{caseStatus}, arbitrator_id = #{arbitratorId}, - arbitrator_name = #{arbitratorName}, - pending_appoint_arbotrar = #{pendingAppointArbotrar}, + arbitrat_method = #{arbitratMethod}, case_name = #{caseName}, case_describe = #{caseDescribe}, @@ -1105,15 +755,21 @@ objecti_juris = #{objectiJuris}, is_absence = #{isAbsence}, + lock_status = #{lockStatus}, appli_is_absen = #{appliIsAbsen}, respon_cross_opin = #{responCrossOpin}, - applica_cross_opin = #{applicaCrossOpin}, - respon_defen_opini = #{responDefenOpini}, + applica_cross_opin = #{applicaCrossOpin}, + + respon_defen_opini = #{responDefenOpini}, + objection_add_eviden = #{objectionAddEviden}, - open_court_hear = #{openCourtHear}, + + respon_isWrit_hear = #{respondentIsWrittenHear}, hear_date = #{hearDate}, filearbitra_url = #{filearbitraUrl}, - adjudica_counter_reason = #{adjudicaCounterReason}, + adjudica_counter_reason = + #{adjudicaCounterReason}, + where id = #{id} @@ -1134,8 +790,62 @@ update case_application set version = #{version} where id = #{id} + + UPDATE case_application + + case_num = #{caseNum}, + case_subject_amount = #{caseSubjectAmount}, + register_date = #{registerDate}, + arbitrat_method = #{arbitratMethod}, + case_status = #{caseStatus}, + hear_date = #{hearDate}, + arbitrat_claims = #{arbitratClaims}, + loan_start_date = #{loanStartDate}, + loan_end_date = #{loanEndDate}, + claim_princi_owed = #{claimPrinciOwed}, + claim_interest_owed = #{claimInterestOwed}, + claim_liquid_damag = #{claimLiquidDamag}, + fee_payable = #{feePayable}, - + contract_number = #{contractNumber}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + create_by = #{createBy}, + arbitrator_id = #{arbitratorId}, + case_name = #{caseName}, + case_result = #{caseResult}, + is_agree_pend_tral = #{isAgreePendTral}, + objection_add_eviden = #{objectionAddEviden}, + + paid_expenses = #{paidExpenses}, + filearbitra_url = #{filearbitraUrl}, + pay_type = #{payType}, + request_rule = #{requestRule}, + adjudica_counter = #{adjudicaCounter}, + adjudica_counter_reason = #{adjudicaCounterReason}, + proper_preser = #{properPreser}, + objecti_juris = #{objectiJuris}, + is_absence = #{isAbsence}, + respon_cross_opin = #{responCrossOpin}, + applica_cross_opin = #{applicaCrossOpin}, + respon_defen_opini = #{responDefenOpini}, + appli_is_absen = #{appliIsAbsen}, + lock_status = #{lockStatus}, + room_id = #{roomId}, + import_flag = #{importFlag}, + version = #{version}, + facts = #{facts}, + batch_number = #{batchNumber}, + template_id = #{templateId}, + mediation_agreement = #{mediationAgreement}, + appli_iswrit_hear = #{appliIswritHear}, + respon_isWrit_hear = #{responIsWritHear} + + WHERE id = #{id} + + + delete from case_application where id = #{id} @@ -1143,71 +853,93 @@ where id in #{item} - + ; + delete from case_affiliate + where case_appli_id in + + #{item} + ; + delete from case_attach + where case_appli_id in + + #{item} + ; + delete from column_value + where case_id in + + #{item} + ; - + select c.id ,c.room_id,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method , CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理' - ELSE '无审理方式' + ELSE '' END arbitratMethodName, c.case_name, c.case_status , - CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费' + 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 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.request_rule,c.adjudica_counter,c.proper_preser, + c.hear_date ,c.arbitrat_claims ,c.create_time, + c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag + ,c.fee_payable , + c.contract_number , + c.request_rule,c.adjudica_counter,c.proper_preser, c.is_absence ,c.respon_cross_opin ,c.applica_cross_opin ,c.respon_defen_opini , - c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName, + c.update_by ,c.update_time,c.arbitrator_id,u.nick_name arbitrator_name, c.batch_number, c.facts, c.appli_iswrit_hear,c.respon_isWrit_hear, - c.mediation_agreement,c.template_id templateId + c.mediation_agreement,c.template_id templateId,c.appli_iswrit_hear,c.respon_isWrit_hear from case_application c - LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1 - + left join sys_user u on u.user_id = c.arbitrator_id AND c.id = #{id} + + AND c.case_num = #{caseNum} + order by c.create_time desc limit 1 - + select c.* + from case_application c + + WHERE c.lock_status = 0 + + AND c.batch_number = #{batchNumber} + + - select max(batch_number) as maxBatchNumber from case_application ; + + + diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml index af5aa3a..0b63341 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -13,18 +13,19 @@ + - INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,is_batch_upload) - VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName},#{sealStatus},#{isBatchUpload}) + INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,is_batch_upload,only_office_file_id) + VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName},#{sealStatus},#{isBatchUpload},#{onlyOfficeFileId}) - INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,is_batch_upload) + INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,is_batch_upload,only_office_file_id) VALUES - (#{item.caseAppliId}, #{item.annexName}, #{item.annexPath},#{item.annexType},#{item.note},#{item.userId},#{item.userName},#{item.sealStatus},#{item.isBatchUpload}) + (#{item.caseAppliId}, #{item.annexName}, #{item.annexPath},#{item.annexType},#{item.note},#{item.userId},#{item.userName},#{item.sealStatus},#{item.isBatchUpload},#{item.onlyOfficeFileId}) @@ -44,13 +45,13 @@ - select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account + select * from case_attach @@ -96,18 +97,19 @@ - + update case_attach set case_appli_id= #{caseAppliId} where annex_id = #{annexId} - + update case_attach annex_name = #{annexName}, - annex_path = #{annexPath} + annex_path = #{annexPath}, + only_office_file_id = #{onlyOfficeFileId} @@ -116,9 +118,21 @@ AND annex_type = #{annexType} + - - + + delete from case_attach + where case_appli_id = #{caseId} + and annex_type = #{type} and annex_id!=#{annexId} + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml index 445d757..5dc547d 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml @@ -7,25 +7,9 @@ + - + - + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml index 817be20..25ebe69 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml @@ -31,24 +31,26 @@ - SELECT id, rule_type ,prefixstr , date_format,dept_name,dept_name_firchar + SELECT id, rule_type ,prefixstr , date_format,dept_name,dept_name_firchar,current_num FROM case_num_rule AND dept_name_firchar = #{deptNameFirchar} + order by create_time desc + + + + + + + diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CasePaymentRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CasePaymentRecordMapper.xml index 1ecd5c6..b7ca892 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CasePaymentRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CasePaymentRecordMapper.xml @@ -27,13 +27,20 @@ update_time = #{updateTime}, pay_type = #{payType}, - where id = #{id} + + + AND case_id = #{caseId} + + + AND id = #{id} + + - SELECT s.id ,s.case_appli_id ,s.file_id ,s.sign_flow_id,s.penson_account ,s.orgnize_name ,s.orgn_name_psn_acc + SELECT s.* from seal_sign_record s @@ -42,19 +55,77 @@ + + + + update seal_sign_record sign_flow_status = #{signFlowStatus}, - file_download_url = #{fileDownloadUrl} + file_download_url = #{fileDownloadUrl}, + sign_status_arbitor = #{signStatusArbitor}, + seal_status = #{sealStatus}, where id = #{id} + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SendMailRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SendMailRecordMapper.xml deleted file mode 100644 index b93e36d..0000000 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SendMailRecordMapper.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - insert into send_mail_record( - mail_name, - mail_content, - mail_address, - send_time, - case_id, - send_status, - create_by, - create_time - )values( - #{mailName}, - #{mailContent}, - #{mailAddress}, - #{sendTime}, - #{caseId}, - #{sendStatus}, - #{createBy}, - sysdate() - ) - - - - - - - - - - \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SmsRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SmsRecordMapper.xml deleted file mode 100644 index d2035ce..0000000 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SmsRecordMapper.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - insert into sms_send_record( - case_appli_id, - case_num, - phone, - send_time, - send_content, - create_by, - send_status, - create_time - )values( - #{caseId}, - #{caseNum}, - #{phone}, - #{sendTime}, - #{sendContent}, - #{createBy}, - #{sendStatus}, - sysdate() - ) - - - - insert into sms_send_record( - case_appli_id, - case_num, - phone, - send_time, - send_content, - create_by, - send_status, - create_time - )values - - ( - #{item.caseId}, - #{item.caseNum}, - #{item.phone}, - #{item.sendTime}, - #{item.sendContent}, - #{item.createBy}, - #{item.sendStatus}, - sysdate() - ) - - - - - - diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/TemplateManageMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/TemplateManageMapper.xml index e235015..33af308 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/TemplateManageMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/TemplateManageMapper.xml @@ -79,6 +79,7 @@ AND del_flag =0 + ORDER BY create_time DESC \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/sendrecord/SendMailRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/sendrecord/SendMailRecordMapper.xml new file mode 100644 index 0000000..e0cc93f --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/sendrecord/SendMailRecordMapper.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + insert into send_mail_record( + mail_name, + mail_content, + mail_address, + send_time, + case_id, + send_status, + create_by, + file_ids, + mail_subject, + mail_from_address, + case_num, + create_time + )values( + #{mailName}, + #{mailContent}, + #{mailAddress}, + #{sendTime}, + #{caseId}, + #{sendStatus}, + #{createBy}, + #{fileIds}, + #{mailSubject}, + #{mailFromAddress}, + #{caseNum}, + sysdate() + ) + + + update send_mail_record + set + mail_content= #{mailContent} + ,update_time=#{updateTime} + ,send_time=#{sendTime} + ,send_status=#{sendStatus} + ,file_ids=#{fileIds} + where id = #{id} + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/sendrecord/SmsRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/sendrecord/SmsRecordMapper.xml new file mode 100644 index 0000000..fff38dd --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/sendrecord/SmsRecordMapper.xml @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + insert into sms_send_record( + case_appli_id, + case_num, + phone, + send_time, + ms_sms_template_id, + create_by, + send_status, + sid, + reason, + create_time + )values( + #{caseId}, + #{caseNum}, + #{phone}, + #{sendTime}, + #{msSmsTemplateId}, + #{createBy}, + #{sendStatus}, + #{sid}, + #{reason}, + sysdate() + ) + + + + insert into sms_send_record( + case_appli_id, + case_num, + phone, + send_time, + sms_template_id, + create_by, + send_status, + create_time, + sid,reason + )values + + ( + #{item.caseId}, + #{item.caseNum}, + #{item.phone}, + #{item.sendTime}, + #{item.msSmsTemplateId}, + #{item.createBy}, + #{item.sendStatus}, + sysdate(),#{sid},#{reason} + ) + + + + + + + + + update sms_send_record + set send_status= #{sendStatus}, + reason=#{reason} + where sid = #{sid} + + + update sms_send_record + + case_appli_id = #{caseId}, + case_num = #{caseNum}, + phone = #{phone}, + + send_time = #{sendTime}, + ms_sms_template_id = #{msSmsTemplateId}, + + send_status = #{sendStatus}, + sid = #{sid}, + reason = #{reason} + + where id = #{id} + + + + + diff --git a/tkgenerator/.gitignore b/tkgenerator/.gitignore new file mode 100644 index 0000000..549e00a --- /dev/null +++ b/tkgenerator/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/tkgenerator/.mvn/wrapper/maven-wrapper.jar b/tkgenerator/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 0000000..e69de29 diff --git a/tkgenerator/.mvn/wrapper/maven-wrapper.properties b/tkgenerator/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 0000000..5f0536e --- /dev/null +++ b/tkgenerator/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,2 @@ +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar diff --git a/tkgenerator/mvnw b/tkgenerator/mvnw new file mode 100644 index 0000000..66df285 --- /dev/null +++ b/tkgenerator/mvnw @@ -0,0 +1,308 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Apache Maven Wrapper startup batch script, version 3.2.0 +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /usr/local/etc/mavenrc ] ; then + . /usr/local/etc/mavenrc + fi + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "$(uname)" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + JAVA_HOME="$(/usr/libexec/java_home)"; export JAVA_HOME + else + JAVA_HOME="/Library/Java/Home"; export JAVA_HOME + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=$(java-config --jre-home) + fi +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$JAVA_HOME" ] && + JAVA_HOME=$(cygpath --unix "$JAVA_HOME") + [ -n "$CLASSPATH" ] && + CLASSPATH=$(cygpath --path --unix "$CLASSPATH") +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] && + JAVA_HOME="$(cd "$JAVA_HOME" || (echo "cannot cd into $JAVA_HOME."; exit 1); pwd)" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="$(which javac)" + if [ -n "$javaExecutable" ] && ! [ "$(expr "\"$javaExecutable\"" : '\([^ ]*\)')" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=$(which readlink) + if [ ! "$(expr "$readLink" : '\([^ ]*\)')" = "no" ]; then + if $darwin ; then + javaHome="$(dirname "\"$javaExecutable\"")" + javaExecutable="$(cd "\"$javaHome\"" && pwd -P)/javac" + else + javaExecutable="$(readlink -f "\"$javaExecutable\"")" + fi + javaHome="$(dirname "\"$javaExecutable\"")" + javaHome=$(expr "$javaHome" : '\(.*\)/bin') + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="$(\unset -f command 2>/dev/null; \command -v java)" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=$(cd "$wdir/.." || exit 1; pwd) + fi + # end of workaround + done + printf '%s' "$(cd "$basedir" || exit 1; pwd)" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + # Remove \r in case we run on Windows within Git Bash + # and check out the repository with auto CRLF management + # enabled. Otherwise, we may read lines that are delimited with + # \r\n and produce $'-Xarg\r' rather than -Xarg due to word + # splitting rules. + tr -s '\r\n' ' ' < "$1" + fi +} + +log() { + if [ "$MVNW_VERBOSE" = true ]; then + printf '%s\n' "$1" + fi +} + +BASE_DIR=$(find_maven_basedir "$(dirname "$0")") +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR +log "$MAVEN_PROJECTBASEDIR" + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" +if [ -r "$wrapperJarPath" ]; then + log "Found $wrapperJarPath" +else + log "Couldn't find $wrapperJarPath, downloading it ..." + + if [ -n "$MVNW_REPOURL" ]; then + wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" + else + wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" + fi + while IFS="=" read -r key value; do + # Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' ) + safeValue=$(echo "$value" | tr -d '\r') + case "$key" in (wrapperUrl) wrapperUrl="$safeValue"; break ;; + esac + done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" + log "Downloading from: $wrapperUrl" + + if $cygwin; then + wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath") + fi + + if command -v wget > /dev/null; then + log "Found wget ... using wget" + [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet" + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + else + wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + log "Found curl ... using curl" + [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent" + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" + else + curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" + fi + else + log "Falling back to using Java to download" + javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java" + javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaSource=$(cygpath --path --windows "$javaSource") + javaClass=$(cygpath --path --windows "$javaClass") + fi + if [ -e "$javaSource" ]; then + if [ ! -e "$javaClass" ]; then + log " - Compiling MavenWrapperDownloader.java ..." + ("$JAVA_HOME/bin/javac" "$javaSource") + fi + if [ -e "$javaClass" ]; then + log " - Running MavenWrapperDownloader.java ..." + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath" + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +# If specified, validate the SHA-256 sum of the Maven wrapper jar file +wrapperSha256Sum="" +while IFS="=" read -r key value; do + case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;; + esac +done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" +if [ -n "$wrapperSha256Sum" ]; then + wrapperSha256Result=false + if command -v sha256sum > /dev/null; then + if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c > /dev/null 2>&1; then + wrapperSha256Result=true + fi + elif command -v shasum > /dev/null; then + if echo "$wrapperSha256Sum $wrapperJarPath" | shasum -a 256 -c > /dev/null 2>&1; then + wrapperSha256Result=true + fi + else + echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." + echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties." + exit 1 + fi + if [ $wrapperSha256Result = false ]; then + echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2 + echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2 + echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2 + exit 1 + fi +fi + +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$JAVA_HOME" ] && + JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME") + [ -n "$CLASSPATH" ] && + CLASSPATH=$(cygpath --path --windows "$CLASSPATH") + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR") +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +# shellcheck disable=SC2086 # safe args +exec "$JAVACMD" \ + $MAVEN_OPTS \ + $MAVEN_DEBUG_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/tkgenerator/mvnw.cmd b/tkgenerator/mvnw.cmd new file mode 100644 index 0000000..95ba6f5 --- /dev/null +++ b/tkgenerator/mvnw.cmd @@ -0,0 +1,205 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Apache Maven Wrapper startup batch script, version 3.2.0 +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* +if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" + +FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %WRAPPER_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM If specified, validate the SHA-256 sum of the Maven wrapper jar file +SET WRAPPER_SHA_256_SUM="" +FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B +) +IF NOT %WRAPPER_SHA_256_SUM%=="" ( + powershell -Command "&{"^ + "$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^ + "If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^ + " Write-Output 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^ + " Write-Output 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^ + " Write-Output 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^ + " exit 1;"^ + "}"^ + "}" + if ERRORLEVEL 1 goto error +) + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% ^ + %JVM_CONFIG_MAVEN_PROPS% ^ + %MAVEN_OPTS% ^ + %MAVEN_DEBUG_OPTS% ^ + -classpath %WRAPPER_JAR% ^ + "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ + %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" +if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%"=="on" pause + +if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% + +cmd /C exit /B %ERROR_CODE% diff --git a/tkgenerator/pom.xml b/tkgenerator/pom.xml new file mode 100644 index 0000000..ceb1fdb --- /dev/null +++ b/tkgenerator/pom.xml @@ -0,0 +1,97 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.5.15 + + + com.ruoyi + tkgenerator + 0.0.1-SNAPSHOT + tkgenerator + tkmappergenerator + + 1.8 + + + + org.springframework.boot + spring-boot-starter + + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-test + test + + + + mysql + mysql-connector-java + runtime + + + + tk.mybatis + mapper-spring-boot-starter + 2.1.5 + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + org.projectlombok + lombok + + + + + + + org.mybatis.generator + mybatis-generator-maven-plugin + 1.3.6 + + + ${basedir}/src/main/resources/generator/generatorConfig.xml + + true + true + + + + mysql + mysql-connector-java + 8.0.26 + + + tk.mybatis + mapper + 4.1.5 + + + org.projectlombok + lombok + 1.18.20 + compile + + + + + + + diff --git a/tkgenerator/src/main/java/com/ruoyi/tkgenerator/TkgeneratorApplication.java b/tkgenerator/src/main/java/com/ruoyi/tkgenerator/TkgeneratorApplication.java new file mode 100644 index 0000000..5cc900b --- /dev/null +++ b/tkgenerator/src/main/java/com/ruoyi/tkgenerator/TkgeneratorApplication.java @@ -0,0 +1,13 @@ +package com.ruoyi.tkgenerator; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class TkgeneratorApplication { + + public static void main(String[] args) { + SpringApplication.run(TkgeneratorApplication.class, args); + } + +} diff --git a/tkgenerator/src/main/resources/generator/config.properties b/tkgenerator/src/main/resources/generator/config.properties new file mode 100644 index 0000000..2d91392 --- /dev/null +++ b/tkgenerator/src/main/resources/generator/config.properties @@ -0,0 +1,12 @@ +jdbc.driverClass=com.mysql.cj.jdbc.Driver +jdbc.url=jdbc:mysql://121.40.189.20:3306/test_smart_arbitration?serverTimezone=Asia/Shanghai&useSSL=false&zeroDateTimeBehavior=CONVERT_TO_NULL&nullCatalogMeansCurrent=true +jdbc.user=root +jdbc.password=YMzc157# +#目标模块项目路径 +targetprojectpath=D:/WorkCode/zhongcai/Arbitrate-Backend/ruoyi-system +#模块名称 +moduleName=attach +#表名 +tableName=case_attach +#主键 +premaryId=annex_id diff --git a/tkgenerator/src/main/resources/generator/generatorConfig.xml b/tkgenerator/src/main/resources/generator/generatorConfig.xml new file mode 100644 index 0000000..12413a1 --- /dev/null +++ b/tkgenerator/src/main/resources/generator/generatorConfig.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
\ No newline at end of file