diff --git a/ruoyi-admin/pom.xml b/ruoyi-admin/pom.xml index 9813b9f..8679bb4 100644 --- a/ruoyi-admin/pom.xml +++ b/ruoyi-admin/pom.xml @@ -54,17 +54,7 @@ com.ruoyi ruoyi-quartz - - - tk.mybatis - mapper-spring-boot-starter - 2.1.5 - - - - com.ruoyi - ruoyi-generator - + com.ruoyi pay @@ -98,37 +88,7 @@ ${project.artifactId} - - - 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 - - - + org.apache.maven.plugins diff --git a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java index 775f772..63ee852 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java @@ -4,6 +4,7 @@ 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 springfox.documentation.swagger2.annotations.EnableSwagger2; /** * 启动程序 @@ -12,6 +13,7 @@ import org.springframework.scheduling.annotation.EnableScheduling; */ @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) @EnableScheduling +@EnableSwagger2 public class RuoYiApplication { public static void main(String[] args) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java index e68e0f0..f937871 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java @@ -6,6 +6,8 @@ import javax.servlet.http.HttpServletResponse; import cn.hutool.core.util.StrUtil; import com.ruoyi.common.annotation.Anonymous; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.ArrayUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; @@ -33,6 +35,7 @@ import com.ruoyi.system.service.ISysUserService; * * @author ruoyi */ +@Api("用户信息管理") @RestController @RequestMapping("/system/user") public class SysUserController extends BaseController @@ -52,6 +55,7 @@ public class SysUserController extends BaseController /** * 获取用户列表 */ + @ApiOperation(value = "获取用户列表",notes = "分页获取用户列表") @PreAuthorize("@ss.hasPermi('system:user:list')") @GetMapping("/list") public TableDataInfo list(SysUser user) 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 deleted file mode 100644 index 6d2513f..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java +++ /dev/null @@ -1,191 +0,0 @@ -package com.ruoyi.web.controller.wisdomarbitrate; - -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.util.StrUtil; -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.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; -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 java.util.List; - -@RestController -@RequestMapping("/adjudication") -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); - } - - /** - * 根据签署流程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); - } - - - /** - * 生成裁决书 - * @param caseApplication - * @return - */ - @PostMapping("/document") - public AjaxResult createDocument(@Validated @RequestBody CaseApplication caseApplication){ - if (caseApplication.getId() == null) { - return AjaxResult.error("案件id不能为空"); - } - return adjudicationService.createDocument(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()); - } - - /** - * 重新生成裁决书 - * @param caseApplication - * @return - */ - @PostMapping("/regenerationDocument") - public AjaxResult regenerationDocument(@Validated @RequestBody CaseApplication caseApplication){ - return adjudicationService.regenerationDocument(caseApplication); - } - - /** - * 裁决书送达(电子邮件) - * @param bookSendVO - * @return - */ - @PostMapping("/delivery") - public AjaxResult sendDocumentByEmail(@RequestBody BookSendVO bookSendVO){ - return adjudicationService.sendDocumentByEmail(bookSendVO.getId(),bookSendVO.getAppEmail(),bookSendVO.getResEmail(),bookSendVO.getApptrackingNum(),bookSendVO.getRestrackingNum()); - } - - /** - * 根据快递单号查询物流信息 - * @param caseApplication - * @return - */ - @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); - } - - - /** - * 归档(暂时只改案件状态) - * @param batchCaseApplication - * @return - */ - @PostMapping("/caseFile") -// @PreAuthorize("@ss.hasPermi('awardManagement:list:file')") - public AjaxResult caseFile(@RequestBody BatchCaseApplication batchCaseApplication){ - if(CollectionUtil.isEmpty(batchCaseApplication.getIds())){ - return error("参数校验失败"); - } - return adjudicationService.caseFile(batchCaseApplication.getIds()); - } - - /** - * 送达(不包含发送电子邮件) - * @param bookSendVO - * @return - */ - @PostMapping("/service") -// @PreAuthorize("@ss.hasPermi('awardManagement:list:sendaward')") - 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); - } - - /** - * 档案详情查询 - * @param id 案件id - * @return - */ - @GetMapping("/archives") - public AjaxResult getArchivesDetail(Long id){ - - return adjudicationService.getArchivesDetail(id); - } - /** - * 根据案件id获取邮箱 - * @param id 案件id - * @return - */ - @GetMapping("/emailByCaseId") - public AjaxResult emailByCaseId(@RequestParam("id") Long id){ - - return adjudicationService.emailByCaseId(id); - } - -} 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 deleted file mode 100644 index b4af1e4..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/ArbitratorController.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.ruoyi.web.controller.wisdomarbitrate; - -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.system.mapper.SysUserMapper; -import com.ruoyi.system.service.ISysUserService; -import com.ruoyi.wisdomarbitrate.domain.Arbitrator; -import com.ruoyi.wisdomarbitrate.service.IArbitratorService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; -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("/arbitrator") -public class ArbitratorController extends BaseController { - @Autowired - private ISysUserService sysUserService; - - /** - * 查询仲裁员信息 - */ -// @PreAuthorize("@ss.hasPermi('arbitrator:list')") - @GetMapping("/list") - public TableDataInfo list(Arbitrator arbitrator) - { - startPage(); - List list = sysUserService.selectUserListByAdRole(arbitrator); - return getDataTable(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 deleted file mode 100644 index 4ab8ac6..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ /dev/null @@ -1,588 +0,0 @@ -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.StringIdsReq; -import com.ruoyi.wisdomarbitrate.domain.*; -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.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.*; -import java.net.URL; -import java.net.URLEncoder; -import java.util.List; - - -@RestController -@RequestMapping("/caseApplication") -public class CaseApplicationController extends BaseController { - @Autowired - private ICaseApplicationService caseApplicationService; - @Autowired - private IAdjudicationService adjudicationService; - - - /** - * 查询立案数据 - */ -// @PreAuthorize("@ss.hasPermi('caseManagement:list')") - @GetMapping("/list") - public TableDataInfo list(CaseApplication caseApplication) { - if(StrUtil.isEmpty(caseApplication.getSelectCaseStatus())){ - caseApplication.setSelectCaseStatus("0"); - } - startPage(); - List list = caseApplicationService.selectCaseApplicationListByRole(caseApplication); - return getDataTable(list); - } - - /** - * 查询批量管理案件列表 - */ - @GetMapping("/listBatch") - public TableDataInfo listBatch(CaseApplication caseApplication) { - startPage(); - List list = caseApplicationService.selectCaseApplicationListBatchByRole(caseApplication); - return getDataTable(list); - } - - /** - * 根据角色查询待办数量 - * @return - */ - - @GetMapping("/toDoCount") - public AjaxResult toDoCount() { - ToDoCount toDoCount = caseApplicationService.selectToDoCount(); -// List list = caseApplicationService.selectCaseApplicationList(caseApplication); - return success(toDoCount); - } - - /** - * 新增立案数据 - */ -// @PreAuthorize("@ss.hasPermi('caseManagement:list:add')") - @Log(title = "新增立案数据", businessType = BusinessType.INSERT) - @PostMapping("/addCaseApplication") - public AjaxResult addCaseApplication(@Validated @RequestBody CaseApplication caseApplication) - { - - caseApplication.setCreateBy(getUsername()); - return toAjax(caseApplicationService.insertcaseApplication(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); - } - - /** - * 修改立案数据自定义字段 - */ -// @PreAuthorize("@ss.hasPermi('caseManagement:list:update')") - @Log(title = "修改立案数据自定义字段", businessType = BusinessType.UPDATE) - @PostMapping("/editCaseApplicationDefineval") - public AjaxResult editCaseApplicationDefineval(@Validated @RequestBody CaseApplication caseApplication) { - return caseApplicationService.editCaseApplicationDefineval(caseApplication); - } - - /** - * 提交立案申请 - */ -// @PreAuthorize("@ss.hasPermi('caseManagement:list:submit')") - @Log(title = "提交立案申请", businessType = BusinessType.UPDATE) - @PostMapping("/submitCaseApplication") - public AjaxResult submitCaseApplication(@RequestBody BatchCaseApplication batchCaseApplication) { - if(CollectionUtil.isEmpty(batchCaseApplication.getIds())){ - return error("参数校验失败"); - } - 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 toAjax(caseApplicationService.submitCaseApplicationBatch(batchCaseApplication.getBatchNumber())); - } - - - - - /** - * 删除立案数据 - */ -// @PreAuthorize("@ss.hasPermi('caseManagement:list:delete')") - @Log(title = "删除立案数据", businessType = BusinessType.DELETE) - @PostMapping("/removeCaseApplication") - public AjaxResult removeCaseApplication(@RequestBody BatchCaseApplication batchCaseApplication) { - if(CollectionUtil.isEmpty(batchCaseApplication.getIds())){ - return error("参数校验失败"); - } - return success(caseApplicationService.deletecaseApplicationByIds(batchCaseApplication.getIds())); - } - - /** - * 查询立案信息 - */ -// @PreAuthorize("@ss.hasPermi('caseManagement:list:detail')") - @PostMapping("/selectCaseApplication") - public AjaxResult selectCaseApplication(@Validated @RequestBody CaseApplication caseApplication) { - - CaseApplication caseApplicationselect = caseApplicationService.selectCaseApplication(caseApplication); - return success(caseApplicationselect); - } - - /** - * 查询已签署裁决书URL - */ - @PostMapping("/selectSignSealUrl") - public AjaxResult selectSignSealUrl(@Validated @RequestBody CaseApplication caseApplication) throws EsignDemoException { - CaseApplication caseApplicationselect = caseApplicationService.selectSignSealUrl(caseApplication); - return success(caseApplicationselect); - } - - /** - * 查询案件进度 - */ - @PostMapping("/selectCaseProgress") - public AjaxResult selectCaseProgress(@Validated @RequestBody CaseApplication caseApplication) { - AjaxResult caseApplicationselect = caseApplicationService.selectCaseProgress(caseApplication); - return success(caseApplicationselect); - } - - - /** - * 查询签名链接 - */ -// @PreAuthorize("@ss.hasPermi('caseManagement:list:selectSignUrl')") - @PostMapping("/selectSignUrl") - public AjaxResult selectSignUrl(@Validated @RequestBody CaseApplication caseApplication) throws EsignDemoException { - SealSignRecord sealSignRecordselect = caseApplicationService.selectSignUrl(caseApplication); - return success(sealSignRecordselect); - } - - - /** - * 查询用印链接 - */ -// @PreAuthorize("@ss.hasPermi('caseManagement:list:selectSealUrl')") - @PostMapping("/selectSealUrl") - public AjaxResult selectSealUrl(@Validated @RequestBody CaseApplication caseApplication) throws EsignDemoException { - SealSignRecord sealUrlRecordselect = caseApplicationService.selectSealUrl(caseApplication); - return success(sealUrlRecordselect); - } - - - /** - * 案件证据材料压缩包上传 - * - * @param file 附件 - * @param id 案件申请id - * @return - */ - @PostMapping("/uploadZipFile") - public AjaxResult uploadZipFile(@RequestParam("file") MultipartFile file, Long id) { - String username = this.getUsername(); - Long userId = this.getUserId(); - return caseApplicationService.uploadZipFile(file, id, username, userId); - } - - /** - * 立案申请导入模板下载 - */ - @PostMapping("/importTemplate") - public void importTemplate(HttpServletResponse response) { - // 读取文件 - try { - InputStream fileInputStream = new URL("http://121.40.189.20:8000/API/uploadPath/template/案件导入模板.xlsx").openStream(); - response.setHeader("content-type", "application/octet-stream"); - response.setContentType("application/octet-stream"); - response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("案件导入模板.xlsx","UTF-8")); - byte[] buffer = new byte[1024]; - int length; - while ((length = fileInputStream.read(buffer)) > 0) { - response.getOutputStream().write(buffer, 0, length); - } - - } catch (IOException e) { - throw new RuntimeException(e); - } - - } - - @Log(title = "立案信息导入", businessType = BusinessType.IMPORT) -// @PreAuthorize("@ss.hasPermi('caseManagement:list:import')") - @PostMapping("/importData") - public AjaxResult importData(MultipartFile file) throws Exception { - if(file==null){ - return warn("请上传文件"); - } - ExcelUtil util = new ExcelUtil(CaseApplication.class); - List caseApplicationList = util.importExcel(file.getInputStream()); - String operName = getUsername(); - String message = caseApplicationService.importCaseApplication(caseApplicationList, operName); - return success(message); - } - - /** - * 组庭 - */ -// @PreAuthorize("@ss.hasPermi('caseApplication:pendTral')") - @Log(title = "组庭", businessType = BusinessType.UPDATE) - @PostMapping("/pendTral") - public AjaxResult pendTral(@Validated @RequestBody CaseApplication caseApplication) { - return toAjax(caseApplicationService.pendTral(caseApplication)); - } - - /** - * 组庭审核 - */ -// @PreAuthorize("@ss.hasPermi('caseManagement:list:checkgroup')") - @Log(title = "组庭审核", businessType = BusinessType.UPDATE) - @PostMapping("/pendTralCheck") - public AjaxResult pendTralCheck(@Validated @RequestBody CaseApplication caseApplication) { - return toAjax(caseApplicationService.pendTralCheck(caseApplication)); - } - - /** - * 组庭确认 - */ -// @PreAuthorize("@ss.hasPermi('caseManagement:list:confirmgroup')") - @Log(title = "组庭确认", businessType = BusinessType.UPDATE) - @PostMapping("/pendTralSure") - public AjaxResult pendTralSure(@Validated @RequestBody CaseApplication caseApplication) { - 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)); - } - - /** - * 修改开庭时间 - */ - @Log(title = "修改开庭时间", businessType = BusinessType.UPDATE) - @PostMapping("/updateHeardate") - public AjaxResult updateHeardate(@Validated @RequestBody CaseApplication caseApplication) { - return toAjax(caseApplicationService.updateHeardate(caseApplication)); - } - - /** - * 核验裁决书 - */ -// @PreAuthorize("@ss.hasPermi('caseApplication:verificationArbitrateRecord')") - @Log(title = "核验裁决书", businessType = BusinessType.UPDATE) - @PostMapping("/verificationArbitrateRecord") - public AjaxResult verificationArbitrateRecord(@Validated @RequestBody CaseApplication caseApplication) { - return toAjax(caseApplicationService.verificationArbitrateRecord(caseApplication)); - } - - /** - * 部门长审核裁决书 - */ -// @PreAuthorize("@ss.hasPermi('caseApplication:checkArbitrateRecord')") - @Log(title = "部门长审核裁决书", businessType = BusinessType.UPDATE) - @PostMapping("/checkArbitrateRecord") - public AjaxResult checkArbitrateRecord(@Validated @RequestBody CaseApplication caseApplication) { - - return caseApplicationService.checkArbitrateRecord(caseApplication); - } - /** - * 仲裁员审核裁决书 - */ -// @PreAuthorize("@ss.hasPermi('caseApplication:checkArbitrateRecord')") - @Log(title = "仲裁员审核裁决书", businessType = BusinessType.UPDATE) - @PostMapping("/arbitrator/checkArbitrateRecord") - public AjaxResult arbitratorCheckArbitrateRecord(@Validated @RequestBody CaseApplication caseApplication) { - - 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)); - } - - - /** - * 是否指派仲裁员 - */ -// @PreAuthorize("@ss.hasPermi('caseApplication:pendingAppointArbotrar')") - @Log(title = "是否指派仲裁员", businessType = BusinessType.UPDATE) - @PostMapping("/pendingAppointArbotrar") - public AjaxResult pendingAppointArbotrar(@Validated @RequestBody CaseApplication caseApplication) { - return toAjax(caseApplicationService.pendingAppointArbotrar(caseApplication)); - } - - /** - * 提交立案审查 - */ -// @PreAuthorize("@ss.hasPermi('caseManagement:list:check')") - @Log(title = "提交立案审查", businessType = BusinessType.UPDATE) - @PostMapping("/submitCaseApplicationCheck") - public AjaxResult submitCaseApplicationCheck(@RequestBody BatchCaseApplication batchCaseApplication) { - if(CollectionUtil.isEmpty(batchCaseApplication.getIds())|| batchCaseApplication.getAgreeOrNotCheck()==null){ - return error("参数校验失败"); - } - 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); - } - - /** - * 批量提交立案审查 - */ - @Log(title = "批量提交立案审查", businessType = BusinessType.UPDATE) - @PostMapping("/submitCaseApplicationCheckBatch") - public AjaxResult submitCaseApplicationCheckBatch(@RequestBody BatchCaseApplication batchCaseApplication) { - if(StringUtils.isEmpty(batchCaseApplication.getBatchNumber()) || batchCaseApplication.getAgreeOrNotCheck()==null){ - return error("参数校验失败"); - } - return success(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); - } - - - - - - /** - * 发送房间号短信 - */ - @Anonymous - @PostMapping("/sendRoomNoMessage") - public AjaxResult sendRoomNoMessage(@Validated @RequestBody SendRoomNoMessageVO messageVO) { - String result = caseApplicationService.sendRoomNoMessage(messageVO); - return success(result); - } - /** - * 获取UrlScheme - */ - @Anonymous - @GetMapping("/getUrlScheme") - public AjaxResult getUrlScheme() { - String schemeUrl = WxAppletNotifyUtils.jumpAppletSchemeUrl(); - 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") -// @PreAuthorize("@ss.hasPermi('caseManagement:list:creatTrialRecord')") - public AjaxResult creatTrialRecordnew(@Validated @RequestBody ArbitrateRecord arbitrateRecord){ - return caseApplicationService.creatTrialRecordnew(arbitrateRecord); - } - - /** - * 案件锁定或者解锁 - * @param caseApplication - * @return - */ - @PostMapping("/updateCaseLockStatus") -// @PreAuthorize("@ss.hasPermi('caseManagement:list:creatTrialRecord')") - public AjaxResult updateCaseLockStatus(@Validated @RequestBody CaseApplication caseApplication){ - if(caseApplication.getId()==null || caseApplication.getLockStatus()==null){ - return error("参数校验失败"); - } - 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 - * @return - */ - @Anonymous - @GetMapping("/generateUserSign") - public AjaxResult generateUserSign(@RequestParam(required = true) String userId){ - if(StrUtil.isEmpty(userId)){ - error("参数校验失败"); - } - return AjaxResult.success(caseApplicationService.generateUserSign(userId)); - } - /** - * 预约会议 - * @param reservedConferenceVO - * @return - */ - @PostMapping("/reservedConference") - public AjaxResult reservedConference(@Validated @RequestBody ReservedConferenceVO reservedConferenceVO) throws Exception { - - return caseApplicationService.reservedConference(reservedConferenceVO); - } - - /** - * 生成房间号 - * @return - */ - @Anonymous - @GetMapping("/createRoomId") - public AjaxResult createRoomId(@RequestParam("caseId") Long caseId) { - - return success(caseApplicationService.createRoomId(caseId)); - } - /** - * 删除房间号 - * @return - */ - @Anonymous - @PostMapping("/deleteRoom") - public AjaxResult deleteRoom(@RequestParam("roomId") String roomId) { - - return caseApplicationService.deleteRoom(roomId); - } - /** - * 根据案件id查询已预约的会议 - * @param caseId - * @return - */ - @Anonymous - @GetMapping("/reserveConferenceList") - public AjaxResult reserveConferenceList( @RequestParam("caseId") Long caseId) { - - return success(caseApplicationService.reserveConferenceList(caseId)); - } - - /** - * 案件压缩包导入 - * @param file - * @return - * @throws IOException - */ - @PostMapping("/uploadCaseZipFile") - public AjaxResult uploadCaseZipFile(@RequestParam("file") MultipartFile file,@RequestParam("templateId") Long templateId) throws IOException { - return caseApplicationService.uploadCaseZipFile(file,templateId); - } - - /** - * 根据附件id修改案件id - * @param caseAttach - * @return - */ - @PostMapping("/updateCaseIdByAnnexId") - public AjaxResult updateCaseIdByAnnexId(@RequestBody CaseAttach caseAttach) { - if(caseAttach.getAnnexId()==null || caseAttach.getCaseAppliId()==null){ - return error("参数校验失败"); - } - return caseApplicationService.updateCaseIdByAnnexId(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 deleted file mode 100644 index e980e1c..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationLogController.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.ruoyi.web.controller.wisdomarbitrate; - -import com.ruoyi.common.annotation.Anonymous; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.wisdomarbitrate.domain.CaseApplication; -import com.ruoyi.wisdomarbitrate.domain.vo.UpdateSubmitVO; -import com.ruoyi.wisdomarbitrate.service.CaseApplicationLogService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.bind.annotation.PostMapping; - -import static com.ruoyi.common.core.domain.AjaxResult.success; - -/** - * @author wangqiong - * @description 案件日志 - * @date 2023-11-17 13:58 - */ -@RestController -@RequestMapping (value = "/caseApplicationLog") -public class CaseApplicationLogController { - - @Autowired - private CaseApplicationLogService caseApplicationLogService; - - /** - * 新增 - * @author wangqiong - * @date 2023/11/17 - **/ - @PostMapping("/insert") - public AjaxResult insert(@RequestBody CaseApplication caseApplicationLog){ - return success(caseApplicationLogService.insert(caseApplicationLog)); - } - - /** - * 刪除 - * @author wangqiong - * @date 2023/11/17 - **/ - @PostMapping("/delete") - public AjaxResult delete(Long id){ - return success(caseApplicationLogService.delete(id)); - } - /** - * 修改的案件提交到秘书 - * @author wangqiong - * @date 2023/11/17 - **/ - @PostMapping("/submit") - public AjaxResult submit(@RequestBody UpdateSubmitVO vo){ - if(vo.getCaseId()==null || vo.getVersion()==null){ - return AjaxResult.error("参数校验错误"); - } - return caseApplicationLogService.submit(vo); - } - - /** - * 修改撤销申请 - * @author wangqiong - * @date 2023/11/17 - **/ - @PostMapping("/revoke") - public AjaxResult revoke(@RequestBody UpdateSubmitVO vo){ - if(vo.getCaseId()==null || vo.getVersion()==null){ - return AjaxResult.error("参数校验错误"); - } - // todo 需确定 - return caseApplicationLogService.revoke(vo); - } - - /** - * 查询 根据主键 id 查询 - * @author wangqiong - * @date 2023/11/17 - **/ - @GetMapping("/selectByCaseIdAndVersion") - public AjaxResult selectByCaseIdAndVersion(@RequestParam(value = "caseId") Long caseId,@RequestParam(value = "version")Integer version ){ - return success(caseApplicationLogService.selectByCaseIdAndVersion(caseId,version)); - } - /** - * 秘书审核修改的案件 - * @author wangqiong - * @date 2023/11/17 - **/ - @PostMapping("/updateAudit") - public AjaxResult updateAudit(@RequestBody UpdateSubmitVO vo){ - if(vo.getCaseId()==null || vo.getVersion()==null || vo.getIsAgree()==null || vo.getUpdateSubmitStatus()==null){ - return AjaxResult.error("参数校验错误"); - } - return caseApplicationLogService.updateAudit(vo); - } - /** - * 查询该版本及之前版本案件进行对比 - * @author wangqiong - * @date 2023/11/17 - **/ - @Anonymous - @PostMapping("/selectCompareCase") - public AjaxResult selectCompareCase(@RequestBody UpdateSubmitVO vo){ - if(vo.getCaseId()==null || vo.getVersion()==null ){ - return AjaxResult.error("参数校验错误"); - } - return caseApplicationLogService.selectCompareCase(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 deleted file mode 100644 index 198ccd8..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.ruoyi.web.controller.wisdomarbitrate; - -import cn.hutool.core.collection.CollectionUtil; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord; -import com.ruoyi.wisdomarbitrate.domain.BatchCaseApplication; -import com.ruoyi.wisdomarbitrate.domain.CaseApplication; -import com.ruoyi.wisdomarbitrate.domain.CaseIds; -import com.ruoyi.wisdomarbitrate.service.ICaseArbitrateService; -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 java.util.List; - -@RestController -@RequestMapping("/arbitrate") -public class CaseArbitrateController extends BaseController { - @Autowired - private ICaseArbitrateService caseArbitrateService; - - /** - * 审核仲裁方式 - * @param caseApplication - * @param opinion 1同意,0拒绝 - * @return - */ - @PutMapping("/method") -// @PreAuthorize("@ss.hasPermi('caseManagement:list:checkarbitrationway')") - public AjaxResult examineArbitrateMethod(@Validated @RequestBody CaseApplication caseApplication - , Integer opinion, Integer arbitratMethod){ - return caseArbitrateService.examineArbitrateMethod(caseApplication,opinion,arbitratMethod); - } - - /** - * 书面审理 - * @param - * @return - */ - @PostMapping("/writtenHear") - public AjaxResult writtenHear(@RequestBody CaseIds caseIds){ - return caseArbitrateService.writtenHear(caseIds); - - } -} 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 deleted file mode 100644 index 152aacb..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java +++ /dev/null @@ -1,160 +0,0 @@ -package com.ruoyi.web.controller.wisdomarbitrate; - -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.util.StrUtil; -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.CaseEvidenceDirectory; -import com.ruoyi.wisdomarbitrate.domain.dto.CaseEvidenceDTO; -import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO; -import com.ruoyi.wisdomarbitrate.service.ICaseEvidenceService; -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 org.springframework.web.multipart.MultipartFile; - -import java.util.ArrayList; -import java.util.List; - -/** - * 案件证据 - */ -@RestController -@RequestMapping("/evidence") -public class CaseEvidenceController extends BaseController { - private final ICaseEvidenceService caseEvidenceService; - - @Autowired - public CaseEvidenceController(ICaseEvidenceService caseEvidenceService) { - this.caseEvidenceService = caseEvidenceService; - } - - /** - * 根据案件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 id 案件申请id - * @return - */ - @PostMapping("/upload") - public AjaxResult uploadEvidence(@RequestParam("file") MultipartFile file, Integer annexType, Long id) { - String username = this.getUsername(); - Long userId = this.getUserId(); - return caseEvidenceService.uploadEvidence(file, annexType, id, username, userId); - } - - /** - * 上传庭审笔录 - * - * @param file 附件 - * @param annexType 附件类型,庭审笔录(7) - * @param id 案件申请id - * @return - */ - @PostMapping("/uploadRecord") - public AjaxResult uploadRecord(@RequestParam("file") MultipartFile file, Integer annexType, Long id) { - String username = this.getUsername(); - Long userId = this.getUserId(); - return caseEvidenceService.uploadRecord(file, annexType, id, username, userId); - } - - @PostMapping("/batchUpload") - public AjaxResult batchUpload(@RequestParam("file") MultipartFile[] file, Integer annexType, Long id) { - if(file==null){ - return error("请选择要上传的文件"); - } - String username = this.getUsername(); - Long userId = this.getUserId(); - return caseEvidenceService.batchUpload(file, annexType, id, username, userId); - } - - /** - * 获取附件 - * @param caseAppliId - * @param annexTypeList - * @param - * @return - */ - @GetMapping("/fileList") - public AjaxResult fileList(Long caseAppliId, @RequestParam("annexTypeList") List annexTypeList){ - if(caseAppliId==null){ - return error("案件id不能为空"); - } - return caseEvidenceService.fileList(caseAppliId, annexTypeList); - } - - /** - * 删除附件 - * @param fileIds - * @return - */ - @PostMapping("/deleteFile") - public AjaxResult deleteFile( @RequestParam("fileIds") List fileIds){ - - if(CollectionUtil.isEmpty(fileIds)){ - return error("附件id不能为空"); - } - return toAjax(caseEvidenceService.deleteFile( fileIds)); - } - - - /** - * 查询当前用户案件列表 - * - * @param caseStatus - * @return - */ - @GetMapping("/all") - public AjaxResult getCaseListAll(@RequestParam("caseStatus") Integer caseStatus) { - - return success(caseEvidenceService.getCaseListAll(caseStatus)); - - } - - /** - * 证据确认 - * - * @param caseApplication 案件对象 - * @return 统一返回结果 - */ - @PutMapping("/confirm") - public AjaxResult evidenceConfirmation(@Validated @RequestBody CaseApplication caseApplication) { - return caseEvidenceService.evidenceConfirmation(caseApplication); - } - - /** - * 案件质证 - * - * @param caseEvidenceDTO - * @return - */ - @PostMapping("/crossexami") - public AjaxResult caseCrossexamination(@Validated @RequestBody CaseEvidenceDTO caseEvidenceDTO) { - return caseEvidenceService.caseCrossexamination(caseEvidenceDTO); - } - /** - * 获取证据目录树列表 - */ - @GetMapping("/evidenceTree") - public AjaxResult evidenceTree(CaseEvidenceDirectory caseEvidenceDirectory) - { - return success(caseEvidenceService.selectEvidenceTreeList(caseEvidenceDirectory)) ; - } - -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseLogRecordController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseLogRecordController.java index e67a1b3..9f936c4 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseLogRecordController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseLogRecordController.java @@ -2,8 +2,6 @@ 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.page.TableDataInfo; -import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord; import com.ruoyi.wisdomarbitrate.service.ICaseLogRecordService; import org.springframework.beans.factory.annotation.Autowired; @@ -23,7 +21,7 @@ public class CaseLogRecordController extends BaseController { /** * 查询案件日志列表 */ -// @PreAuthorize("@ss.hasPermi('caseLog:list')") + @PreAuthorize("@ss.hasPermi('caseLog:list')") @GetMapping("/list") public AjaxResult list(CaseLogRecord caseLogRecord) { 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 deleted file mode 100644 index 15a0cd2..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java +++ /dev/null @@ -1,110 +0,0 @@ -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; -import com.ruoyi.wisdomarbitrate.domain.dto.CasePayDTO; -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; - -/** - * 缴费支付 - */ -@RestController -@RequestMapping("/pay") -public class CasePaymentController { - private final ICasePaymentService paymentService; - @Autowired - public CasePaymentController(ICasePaymentService paymentService){ - this.paymentService=paymentService; - } - /** - * 案件缴费 - * @param casePayDTO 缴费传入参数 - * @return 统一响应结果 - */ -// @PreAuthorize("@ss.hasPermi('caseManagement:list:pay')") - @PostMapping("/casePay") - public AjaxResult casePay(@Validated @RequestBody CasePayDTO casePayDTO) { - return paymentService.casePay(casePayDTO); - } - /** - * 确认缴费 - * @param payDTO 缴费传入参数 - * @return 统一响应结果 - */ -// @PreAuthorize("@ss.hasPermi('caseManagement:list:pay')") - @PostMapping("/confirmPay") - public AjaxResult confirmPay(@Validated @RequestBody CaseConfirmPayDTO payDTO) { - 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 batchCaseApplication - * @return - */ -// @PreAuthorize("@ss.hasPermi('paymentManagement:list:payconfirm')") - @PutMapping("/confirm") - public AjaxResult confirmPayment(@Validated @RequestBody BatchCaseApplication batchCaseApplication) { - if(CollectionUtil.isEmpty(batchCaseApplication.getIds())){ - return AjaxResult.error("参数校验失败"); - } - return paymentService.confirmPayment(batchCaseApplication.getIds()); - } - /** - * 缴费列表查询 - * @param casePayDTO - * @return - */ - @GetMapping("/list") - 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/SendMailRecordController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/SendMailRecordController.java index cc9ac35..30abad2 100644 --- 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 @@ -30,19 +30,5 @@ public class SendMailRecordController extends BaseController { } -// /** -// * 新增立案数据 -// */ -// @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 deleted file mode 100644 index db1f865..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/VideoController.java +++ /dev/null @@ -1,149 +0,0 @@ -package com.ruoyi.web.controller.wisdomarbitrate; - -import cn.hutool.core.util.StrUtil; -import com.alibaba.fastjson.JSON; -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.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.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; -import com.tencentcloudapi.common.profile.HttpProfile; -import com.tencentcloudapi.trtc.v20190722.TrtcClient; -import com.tencentcloudapi.trtc.v20190722.models.*; -import com.tencentyun.TLSSigAPIv2; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import java.io.IOException; - -/** - * @author wangqiong - * @description trtc实时音视频 - * @date 2023-10-26 11:25 - */ -@RestController -@RequestMapping("/video") -public class VideoController extends BaseController { - @Autowired - private VideoService videoService; - - /** - * 从腾讯云下载文件到本地 - * @param - * @return - */ - @Anonymous - @PostMapping("/videoRollBack") - public AjaxResult videoRollBack( @RequestBody String body, HttpServletRequest request) { - videoService.videoRollBack(body,request); - return success(); - } - /** - * 根据房间号绑定案件ID - * @param - * @return - */ - @Anonymous - @PostMapping("/bindCaseId") - public AjaxResult bindCaseId(@Valid @RequestBody SendRoomNoMessageVO vo) { - - return videoService.bindCaseId(vo.getId(),vo.getRoomNo()); - } - /** - * 根据案件ID查询视频 - * @param caseId 案件id - * @return - */ - @GetMapping("/videoList") - public AjaxResult videoList( @RequestParam Long caseId) { - - return videoService.videoList(caseId); - } - /** - * 开启腾讯云录制 - * @param vo - * @return - * @throws Exception - */ - @Anonymous - @PostMapping("/openCloudRecording") - private AjaxResult openCloudRecording( @RequestBody ReservedConferenceVO vo) { - if(vo.getCaseId()==null || vo.getRoomId()==null){ - return AjaxResult.error("参数错误"); - } - return videoService.openCloudRecording(vo.getCaseId(),vo.getRoomId()); - } - /** - * 关闭腾讯云录制 - * @param taskId 任务ID - * @return - */ - @Anonymous - @PostMapping("/closeDeleteCloudRecording") - public AjaxResult closeDeleteCloudRecording(@RequestParam("taskId") String taskId){ - return videoService.closeDeleteCloudRecording(taskId); - } - /** - * 解散房间 - * @param reservedConferenceVO - * @return - */ - @Anonymous - @PostMapping("/dissolveRoom") - public AjaxResult dissolveRoom( @RequestBody ReservedConferenceVO reservedConferenceVO) { - if( reservedConferenceVO.getRoomId()==null){ - return error("参数校验失败"); - } - - return videoService.dissolveRoom(reservedConferenceVO.getRoomId()); - } - /** - * 根据userId查询该用户是否是秘书 - * @param userId - * @return - */ - @Anonymous - @GetMapping("secretaryRoleByUserId") - public AjaxResult secretaryRoleByUserId( @RequestParam(value = "userId",required = true) Long userId) { - - return videoService.secretaryRoleByUserId(userId); - } - /** - * 根据html字符串转pdf并和案件关联 - * @param reservedConferenceVO - * @return - */ - @Anonymous - @PostMapping("htmlToPDF") - public AjaxResult secretaryRoleByUserId( @RequestBody ReservedConferenceVO reservedConferenceVO) { - if( reservedConferenceVO.getCaseId()==null || StrUtil.isEmpty(reservedConferenceVO.getHtmlContent())){ - return success(); - } - - return videoService.htmlToPDF(reservedConferenceVO); - } - /** - * 根据案件id和类型查询附件 - * @param caseAppliId - * @param annexType - * @return - */ - - @GetMapping("attachListByCaseId") - public AjaxResult attachListByCaseId( @RequestParam("caseAppliId") Long caseAppliId,@RequestParam("annexType") Integer annexType) { - - return videoService.attachListByCaseId(caseAppliId,annexType); - } - - -} diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index fb697f9..77d08a9 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -6,7 +6,7 @@ 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/mediation_system?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&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..96fca58 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -143,7 +143,7 @@ swagger: # 是否开启swagger enabled: true # 请求前缀 - pathMapping: /dev-api + pathMapping: # 防止XSS攻击 xss: diff --git a/ruoyi-admin/src/main/resources/generator/config.properties b/ruoyi-admin/src/main/resources/generator/config.properties index 63f0610..18487e5 100644 --- a/ruoyi-admin/src/main/resources/generator/config.properties +++ b/ruoyi-admin/src/main/resources/generator/config.properties @@ -1,7 +1,7 @@ jdbc.driverClass=com.mysql.cj.jdbc.Driver -jdbc.url=jdbc:mysql://158.58.50.21:3306/knslm?serverTimezone=Asia/Shanghai&useSSL=false&zeroDateTimeBehavior=CONVERT_TO_NULL&nullCatalogMeansCurrent=true -jdbc.user=knslm -jdbc.password=knslm2022 +jdbc.url=jdbc:mysql://158.58.50.21:3306/mediation_system?serverTimezone=Asia/Shanghai&useSSL=false&zeroDateTimeBehavior=CONVERT_TO_NULL&nullCatalogMeansCurrent=true +jdbc.user=root +jdbc.password=YMzc157# #模块名称 moduleName=diagnosis diff --git a/ruoyi-admin/src/main/resources/generator/generatorConfig.xml b/ruoyi-admin/src/main/resources/generator/generatorConfig.xml index 2743fc9..2af0e43 100644 --- a/ruoyi-admin/src/main/resources/generator/generatorConfig.xml +++ b/ruoyi-admin/src/main/resources/generator/generatorConfig.xml @@ -21,13 +21,13 @@ password="${jdbc.password}"> - - - 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 3fef049..9806eb9 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 @@ -3,6 +3,7 @@ package com.ruoyi.common.utils; import com.ruoyi.common.utils.uuid.UUID; +import com.sun.net.ssl.internal.ssl.Provider; import lombok.Data; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; @@ -102,7 +103,7 @@ public class EmailOutUtil { MimeBodyPart messageBodyPart = new MimeBodyPart(); messageBodyPart.setContent(messageContent, "text/html;charset=utf-8"); messageBodyPart.setContentID(UUID.randomUUID().toString()); - Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); + Security.addProvider(new Provider()); final String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory"; //设置邮件会话参数 Properties props = new Properties(); 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..2ec4d23 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.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-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml b/ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml index 66109de..95fa61f 100644 --- a/ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml +++ b/ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml @@ -30,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select column_id, table_id, column_name, column_comment, column_type, java_type, java_field, is_pk, is_increment, is_required, is_insert, is_edit, is_list, is_query, query_type, html_type, dict_type, sort, create_by, create_time, update_by, update_time from gen_table_column + select column_id, table_id, column_name, column_comment, column_type, java_type, java_field, is_pk, is_increment, is_required, is_insert, is_edit, is_list, is_query, query_type, html_type, dict_type, sort, create_by, create_time, update_by, update_time from ms_gen_table_column - insert into gen_table_column ( + insert into ms_gen_table_column ( table_id, column_name, column_comment, @@ -90,7 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - update gen_table_column + update ms_gen_table_column column_comment = #{columnComment}, java_type = #{javaType}, @@ -111,14 +111,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from gen_table_column where table_id in + delete from ms_gen_table_column where table_id in #{tableId} - delete from gen_table_column where column_id in + delete from ms_gen_table_column where column_id in #{item.columnId} diff --git a/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml b/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml index b605e90..619a3e8 100644 --- a/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml +++ b/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml @@ -54,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select table_id, table_name, table_comment, sub_table_name, sub_table_fk_name, class_name, tpl_category, package_name, module_name, business_name, function_name, function_author, gen_type, gen_path, options, create_by, create_time, update_by, update_time, remark from gen_table + select table_id, table_name, table_comment, sub_table_name, sub_table_fk_name, class_name, tpl_category, package_name, module_name, business_name, function_name, function_author, gen_type, gen_path, options, create_by, create_time, update_by, update_time, remark from ms_gen_table SELECT t.table_id, t.table_name, t.table_comment, t.sub_table_name, t.sub_table_fk_name, t.class_name, t.tpl_category, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.gen_type, t.gen_path, t.options, t.remark, c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort - FROM gen_table t - LEFT JOIN gen_table_column c ON t.table_id = c.table_id + FROM ms_gen_table t + LEFT JOIN ms_gen_table_column c ON t.table_id = c.table_id where t.table_id = #{tableId} order by c.sort - insert into gen_table ( + insert into ms_gen_table ( table_name, table_comment, class_name, @@ -169,7 +169,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - update gen_table + update ms_gen_table table_name = #{tableName}, table_comment = #{tableComment}, @@ -193,7 +193,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from gen_table where table_id in + delete from ms_gen_table where table_id in #{tableId} diff --git a/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml b/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml index e608e42..3665e83 100644 --- a/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml +++ b/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml @@ -17,7 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select job_log_id, job_name, job_group, invoke_target, job_message, status, exception_info, create_time - from sys_job_log + from ms_sys_job_log - delete from sys_job_log where job_log_id = #{jobLogId} + delete from ms_sys_job_log where job_log_id = #{jobLogId} - delete from sys_job_log where job_log_id in + delete from ms_sys_job_log where job_log_id in #{jobLogId} - truncate table sys_job_log + truncate table ms_sys_job_log - insert into sys_job_log( + insert into ms_sys_job_log( job_log_id, job_name, job_group, diff --git a/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml b/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml index 5605c44..c8ed10e 100644 --- a/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml +++ b/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml @@ -22,7 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select job_id, job_name, job_group, invoke_target, cron_expression, misfire_policy, concurrent, status, create_by, create_time, remark - from sys_job + from ms_sys_job - delete from sys_job where job_id = #{jobId} + delete from ms_sys_job where job_id = #{jobId} - delete from sys_job where job_id in + delete from ms_sys_job where job_id in #{jobId} - update sys_job + update ms_sys_job job_name = #{jobName}, job_group = #{jobGroup}, @@ -81,7 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - insert into sys_job( + insert into ms_sys_job( job_id, job_name, job_group, diff --git a/ruoyi-system/pom.xml b/ruoyi-system/pom.xml index 971c071..040c822 100644 --- a/ruoyi-system/pom.xml +++ b/ruoyi-system/pom.xml @@ -33,7 +33,56 @@ tls-sig-api-v2 1.2 - + + javax.persistence + persistence-api + 1.0 + + + + tk.mybatis + mapper-spring-boot-starter + 2.1.5 + + + + com.ruoyi + ruoyi-generator + - + + + + + 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 + + + + + \ No newline at end of file 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..5e17118 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,7 +20,6 @@ public interface ISysUserService * @return 用户信息集合信息 */ public List selectUserList(SysUser user); - public List selectUserListByAdRole(Arbitrator arbitrator); /** * 根据条件分页查询已分配用户角色列表 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 dcc8cdf..9542c7f 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 @@ -9,8 +9,6 @@ import javax.validation.Validator; 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.mapper.CaseApplicationMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -62,8 +60,6 @@ public class SysUserServiceImpl implements ISysUserService { @Autowired private ISysConfigService configService; - @Autowired - private CaseApplicationMapper caseApplicationMapper; @Autowired protected Validator validator; @@ -80,23 +76,6 @@ public class SysUserServiceImpl implements ISysUserService { return userMapper.selectUserList(user); } - @Override - public List selectUserListByAdRole(Arbitrator arbitrator) { - List sysUsers = userMapper.selectUserListByAdRole(arbitrator); - if(sysUsers!=null&&sysUsers.size()>0){ - for(SysUser sysUser: sysUsers){ - Long userId = sysUser.getUserId(); - int casenum = caseApplicationMapper.selectCasenum(userId.toString()); - String nickName = sysUser.getNickName(); - String nickNamenew = nickName + "(待办案件数量" + casenum + "个)"; - sysUser.setNickNameAndNum(nickNamenew); - } - - } - - return sysUsers; - } - /** * 根据条件分页查询已分配用户角色列表 * diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/MsCaseLogRecordDTO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/MsCaseLogRecordDTO.java new file mode 100644 index 0000000..856b657 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/MsCaseLogRecordDTO.java @@ -0,0 +1,76 @@ +package com.ruoyi.wisdomarbitrate.domain.dto; + +import lombok.Data; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +@Entity +@Data +@Table(name="ms_case_log_record") +public class MsCaseLogRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Column(name = "Id") + @GeneratedValue(generator = "JDBC") + private Long id; + + /** + * 案件申请id + */ + @Column(name="case_appli_id") + private Long caseAppliId; + + /** + * 案件节点 + */ + @Column(name="case_node") + private Integer caseNode; + + /** + * 案件节点时间 + */ + @Column(name="case_node_time") + private Date caseNodeTime; + + /** + * 备注 + */ + @Column(name="notes") + private String notes; + + /** + * 操作人用户名 + */ + @Column(name="create_by") + private String createBy; + + /** + * 操作人用户昵称 + */ + @Column(name="create_nick_name") + private String createNickName; + + /** + * 创建时间 + */ + @Column(name="create_time") + private Date createTime; + + /** + * 更新者 + */ + @Column(name="update_by") + private String updateBy; + + /** + * 更新时间 + */ + @Column(name="update_time") + private Date updateTime; + + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/StringIdsReq.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/StringIdsReq.java similarity index 88% rename from ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/StringIdsReq.java rename to ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/StringIdsReq.java index 7e561dd..fd651c2 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/StringIdsReq.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/StringIdsReq.java @@ -1,4 +1,4 @@ -package com.ruoyi.wisdomarbitrate; +package com.ruoyi.wisdomarbitrate.domain.vo; import lombok.Data; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ArbitrateRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ArbitrateRecordMapper.java deleted file mode 100644 index c4aaa18..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ArbitrateRecordMapper.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.ruoyi.wisdomarbitrate.mapper; - -import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord; -import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; -import com.ruoyi.wisdomarbitrate.domain.CaseApplication; - -import java.util.List; - -public interface ArbitrateRecordMapper { - int insertArbitrateRecord(ArbitrateRecord arbitrateRecord); - - int updataArbitrateRecord(ArbitrateRecord arbitrateRecord); - - ArbitrateRecord selectArbitrateRecord(ArbitrateRecord arbitrateRecord); - - -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ArbitratorMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ArbitratorMapper.java deleted file mode 100644 index 3cfece2..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ArbitratorMapper.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.ruoyi.wisdomarbitrate.mapper; - -import com.ruoyi.wisdomarbitrate.domain.Arbitrator; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -public interface ArbitratorMapper { - List selectArbitratorList(Arbitrator arbitrator); - - -} 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 deleted file mode 100644 index 7e5affd..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateLogMapper.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.ruoyi.wisdomarbitrate.mapper; - -import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; -import com.ruoyi.wisdomarbitrate.domain.CaseApplication; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; -@Repository -public interface CaseAffiliateLogMapper { - - - int batchCaseAffiliate(List caseAffiliates); - - - void deletecaseAffiliate(CaseApplication caseApplication); - void batchDeletecaseAffiliate(@Param("ids") List ids); - - - List selectCaseAffiliate(@Param("caseAppliLogId") Long caseAppliLogId); - CaseAffiliate selectCaseAffiliateByIdentityType(@Param("caseAppliLogId") Long caseAppliLogId, @Param("identityType")int identityType); - - int updataCaseAffiliate(CaseAffiliate caseAffiliate); - -} 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 deleted file mode 100644 index 97eca71..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java +++ /dev/null @@ -1,45 +0,0 @@ -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.vo.BookSendVO; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -public interface CaseAffiliateMapper { - - - int batchCaseAffiliate(List caseAffiliates); - - - void deletecaseAffiliate(CaseApplication caseApplication); - 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); - - /** - * 根据案件id删除 - * @param caseId - */ - void deleteByCaseId(@Param("caseAppliId") Long caseId); -} 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 deleted file mode 100644 index ca49a36..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationLogMapper.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.ruoyi.wisdomarbitrate.mapper; - -import com.ruoyi.wisdomarbitrate.domain.CaseApplication; -import com.ruoyi.wisdomarbitrate.domain.vo.UpdateSubmitVO; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * @author wangqiong - * @description 案件日志 - * @date 2023-11-17 14:05 - */ -@Repository -public interface CaseApplicationLogMapper { - int insert(CaseApplication caseApplicationLog); - - int deleteById(Long id); - - - - CaseApplication selectByCaseIdAndVersion(@Param("caseAppliId")long caseAppliId,@Param("version") int version); - - Integer selectMaxVersionByCaseId(@Param("caseAppliId")long caseAppliId); - - /** - * 修改日志表状态 - * @param vo - */ - void updateStatus(UpdateSubmitVO vo); - - /** - * 根据案件id查询秘书角色最新版本号 - * @param id - * @return - */ - Integer selectMaxVersionBySecret(@Param("caseAppliId")Long id); - - /** - * 删除日志 - * @param ids - */ - void batchDeleteLog(@Param("ids") List ids); - - 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 deleted file mode 100644 index 3145ff4..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.ruoyi.wisdomarbitrate.mapper; - -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.CaseConfirmPayDTO; -import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount; -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); - - - int updataCaseApplication(CaseApplication caseApplication); - - int submitCaseApplication(CaseApplication caseApplication); - - int deletecaseApplication(CaseApplication caseApplication); - - CaseApplication selectCaseApplication(CaseApplication caseApplication); - - /** - * 根据案件id查询案件信息 - * @param ids - * @return - */ - List listCaseApplicationByIds(@Param("ids")List ids); - - CaseApplication selectCaseApplicationConfirm(CaseApplication caseApplication); - - /** - * 查询最大编号 - * @param caseNum - * @param length - * @return - */ - Integer selectCaseNumLike(@Param("caseNum") String caseNum, @Param("length") int length); - - /** - * 查询仲裁员根据案件id - * @param id - * @return - */ - String selectArbitratorList(@Param("id") String id); - - /** - * 修改支付方式 - * @param payDTO - */ - void updatePayType(CaseConfirmPayDTO payDTO); - - - ToDoCount selectAdminCaseToDoCount(); - - - ToDoCount selectTodoCountByRole(CaseApplication caseApplication); - - /** - * 修改案件锁定状态 - * @param id - * @param lockStatus - * @return - */ - int updateCaseLockStatus(@Param("id")Long id,@Param("lockStatus") Integer lockStatus); - - /** - * 批量删除案件 - * @param ids - * @return - */ - int batchDeletecaseApplication(@Param("ids") List ids); - - /** - * 绑定房间号 - * @param caseId - * @param roomId - */ - void bindCaseId(@Param("caseId")Long caseId,@Param("roomId") String roomId); - - /** - * 根据房间号查询案件id - * @param roomId - * @return - */ - Long selectCaseIdByRoomId(@Param("roomId")String roomId); - - /** - * 查询已办案件 - * @param caseApplication - * @return - */ - List selectHandledCase(CaseApplication caseApplication); - /** - * 查询最大房间号 - * @return - */ - Long selectMaxRoomId(); - - /** - * 修改案件版本号 - * @param id - * @param version - */ - void updateVersionById(@Param("id")Long id, @Param("version")Integer version); - - - /** - * 查询最大批号 - * @return - */ - Integer selectBatchNumberLike(); - - /** - * 批量新增案件 - * @param caseApplications - * @return - */ - int batchSave(@Param("list")List caseApplications); - - int selectCasenum(@Param("userId") String userId); - - List selectAdminCaseApplicationListBatch(CaseApplication caseApplication); - - List listCaseApplicationByBatchNumber(CaseApplication caseApplication); -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseEvidenceDirectoryMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseEvidenceDirectoryMapper.java deleted file mode 100644 index e0528ba..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseEvidenceDirectoryMapper.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.ruoyi.wisdomarbitrate.mapper; - - -import com.ruoyi.common.core.domain.entity.SysDept; -import com.ruoyi.wisdomarbitrate.domain.CaseEvidenceDirectory; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -@Mapper -public interface CaseEvidenceDirectoryMapper { - - int save(CaseEvidenceDirectory caseEvidenceDirectory); - /** - * 查询证据目录信息 - * - * @param caseEvidenceDirectory 目录信息 - * @return 目录信息集合 - */ - List selectList(CaseEvidenceDirectory caseEvidenceDirectory); - - /** - * 根据证据名称查询证据目录树信息 - * @param evidenceName 证据名称 - * @param deptCheckStrictly 目录树选择项是否关联显示 - */ - List selectDeptListByEvidenceName(@Param("evidenceName") String evidenceName, @Param("deptCheckStrictly") boolean deptCheckStrictly); -} 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 deleted file mode 100644 index 5f0a4a2..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseEvidenceMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.ruoyi.wisdomarbitrate.mapper; - -import com.ruoyi.wisdomarbitrate.domain.CaseApplication; -import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -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/CaseLogRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseLogRecordMapper.java index af2d85a..45bb433 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseLogRecordMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseLogRecordMapper.java @@ -1,14 +1,13 @@ package com.ruoyi.wisdomarbitrate.mapper; -import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord; -import org.apache.ibatis.annotations.Mapper; +import com.ruoyi.wisdomarbitrate.domain.dto.MsCaseLogRecordDTO; import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; +import tk.mybatis.mapper.common.Mapper; import java.util.List; -@Mapper -public interface CaseLogRecordMapper { + +public interface CaseLogRecordMapper extends Mapper { List selectCaseLogRecordList(CaseLogRecord caseLogRecord); 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 deleted file mode 100644 index fd5549c..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CasePaymentRecordMapper.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.ruoyi.wisdomarbitrate.mapper; - -import com.ruoyi.wisdomarbitrate.domain.CasePaymentRecord; - -import java.util.List; - -public interface CasePaymentRecordMapper { - int saveRecord(CasePaymentRecord casePaymentRecord); - - List queryRecord(String orderNumber); - - void update(CasePaymentRecord casePaymentRecord); - - CasePaymentRecord selectRecordByCaseId(Long id); -} 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 deleted file mode 100644 index 13d2cba..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java +++ /dev/null @@ -1,32 +0,0 @@ -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); -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/TemplateManualMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/TemplateManualMapper.java deleted file mode 100644 index 6927105..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/TemplateManualMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.ruoyi.wisdomarbitrate.mapper; - -import com.ruoyi.wisdomarbitrate.domain.TemplateManual; -import org.apache.ibatis.annotations.Mapper; - -import java.util.List; - -@Mapper -public interface TemplateManualMapper { - - int insertTemplateManual(TemplateManual templateManual); - - int updateTemplateManual(TemplateManual templateManual); - - List selectTemplateManual(TemplateManual templateManual); -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/CaseApplicationLogService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/CaseApplicationLogService.java deleted file mode 100644 index 246bcd2..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/CaseApplicationLogService.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.ruoyi.wisdomarbitrate.service; - -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.wisdomarbitrate.domain.CaseApplication; -import com.ruoyi.wisdomarbitrate.domain.vo.UpdateSubmitVO; - -/** - * @author wangqiong - * @description 案件日志 - * @date 2023-11-17 13:58 - */ -public interface CaseApplicationLogService { - /** - * 新增案件日志 - * @param caseApplicationLog - * @return - */ - int insert(CaseApplication caseApplicationLog); - - /** - * 根据案件日志id删除案件日志 - * @param id - * @return - */ - int delete(Long id); - - /** - * 根据案件id和版本号查询案件日志 - * @param id - * @param version - * @return - */ - CaseApplication selectByCaseIdAndVersion(Long id, int version); - - /** - * 修改的案件提交到秘书 - * @param vo - * @return - */ - AjaxResult submit(UpdateSubmitVO vo); - - /** - * 修改撤销申请 - * @param vo - * @return - */ - AjaxResult revoke(UpdateSubmitVO vo); - - /** - * 秘书审核修改的案件 - * @param vo - * @return - */ - AjaxResult updateAudit(UpdateSubmitVO vo); - - - AjaxResult selectCompareCase(UpdateSubmitVO vo); -} 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 deleted file mode 100644 index 5fa26f4..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.ruoyi.wisdomarbitrate.service; - -import com.ruoyi.common.core.domain.AjaxResult; -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.util.List; - -public interface IAdjudicationService { - AjaxResult createDocument(CaseApplication caseApplication); - - AjaxResult sendDocumentByEmail(Long id,String appEmail,String resEmail ,String apptrackingNum,String restrackingNum); - - 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查询邮箱 - * @param id - * @return - */ - AjaxResult emailByCaseId(Long id); - - /** - * 批量生成裁决书 - * @param ids - * @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); -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IArbitratorService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IArbitratorService.java deleted file mode 100644 index ee7a8ab..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IArbitratorService.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.ruoyi.wisdomarbitrate.service; - -import com.ruoyi.wisdomarbitrate.domain.Arbitrator; - -import java.util.List; - -public interface IArbitratorService { - List selectArbitratorList(Arbitrator arbitrator); - - - -} 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 deleted file mode 100644 index 03c5eec..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java +++ /dev/null @@ -1,154 +0,0 @@ -package com.ruoyi.wisdomarbitrate.service; - -import com.ruoyi.common.core.domain.AjaxResult; -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 org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; -import java.util.Map; - -public interface ICaseApplicationService { - List selectCaseApplicationList(CaseApplication caseApplication); - List selectCaseApplicationListByRole(CaseApplication caseApplication); - - - int insertcaseApplication(CaseApplication caseApplication); - - int selectCaseApplicationCount(CaseApplication caseApplication); - - AjaxResult editCaseApplication(CaseApplication caseApplication); - - int submitCaseApplication( List ids); - - int deletecaseApplicationByIds(List ids); - - CaseApplication selectCaseApplication(CaseApplication caseApplication); - - String importCaseApplication(List caseApplicationList, String operName); - - int pendTral(CaseApplication caseApplication); - - int pendingAppointArbotrar(CaseApplication caseApplication); - - int pendTralCheck(CaseApplication caseApplication); - - int pendTralSure(CaseApplication caseApplication); - - int verificationArbitrateRecord(CaseApplication caseApplication); - - AjaxResult checkArbitrateRecord(CaseApplication caseApplication); - - 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; - - /** - * 查询待办数量 - * @return - */ - ToDoCount selectToDoCount(); - - AjaxResult selectCaseProgress(CaseApplication caseApplication); - - int updateHeardate(CaseApplication caseApplication); - - /** - * 修改案件锁定状态 - * @param caseApplication - * @return - */ - int updateCaseLockStatus(CaseApplication caseApplication); - - AjaxResult uploadZipFile(MultipartFile file, Long id, String username, Long userId); - /** - * 查询短信发送记录 - * @param smsSendRecord - * @return - */ - List getSmsSendRecord(SmsSendRecord smsSendRecord); - - /** - * 获取userSign - * @param userId - * @return - */ - String generateUserSign(String userId); - - /** - * 预约会议 - * @param reservedConferenceVO - * @return - * @throws Exception - */ - AjaxResult reservedConference(ReservedConferenceVO reservedConferenceVO) throws Exception; - - /** - * 腾讯云销毁房间回调 - * @return - */ - long createRoomId(Long caseId); - - /** - * 根据案件id查询已预约的会议 - * @param caseId - * @return - */ - List reserveConferenceList(Long caseId); - - AjaxResult deleteRoom( String roomId); - - AjaxResult uploadCaseZipFile(MultipartFile file,Long templateId); - - /** - * 根据附件id修改案件id - * @param caseAttach - * @return - */ - AjaxResult updateCaseIdByAnnexId(CaseAttach caseAttach); - - /** - * 仲裁员审核裁决书 - * @param caseApplication - * @return - */ - AjaxResult arbitratorCheckArbitrateRecord(CaseApplication caseApplication); - - AjaxResult creatTrialRecordnew(ArbitrateRecord arbitrateRecord); - - AjaxResult editCaseApplicationDefineval(CaseApplication caseApplication); - - CaseAttach downloadCaseZipFile(CaseApplication caseApplication); - - List selectCaseApplicationListBatchByRole(CaseApplication caseApplication); - - int submitCaseApplicationBatch(String batchNumber); - - int 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); -} 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 deleted file mode 100644 index 98bafbb..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseArbitrateService.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.ruoyi.wisdomarbitrate.service; - -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord; -import com.ruoyi.wisdomarbitrate.domain.BatchCaseApplication; -import com.ruoyi.wisdomarbitrate.domain.CaseApplication; -import com.ruoyi.wisdomarbitrate.domain.CaseIds; - -import java.util.List; - -public interface ICaseArbitrateService { - - - AjaxResult writtenHear(CaseIds caseIds); - - AjaxResult examineArbitrateMethod(CaseApplication caseApplication, Integer opinion, Integer arbitratMethod); -} 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 deleted file mode 100644 index 1e8d4d1..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.ruoyi.wisdomarbitrate.service; - - -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.wisdomarbitrate.domain.CaseApplication; -import com.ruoyi.wisdomarbitrate.domain.CaseEvidenceDirectory; -import com.ruoyi.wisdomarbitrate.domain.dto.CaseEvidenceDTO; -import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceDirectoryVO; -import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO; -import org.springframework.web.multipart.MultipartFile; - -import java.util.List; - -public interface ICaseEvidenceService { - - AjaxResult getCaseDetailsById(Long id,String userName); - - AjaxResult uploadEvidence(MultipartFile file, Integer annexType, Long id,String userName,Long userId); - - List getCaseListAll(Integer caseStatus); - - AjaxResult evidenceConfirmation(CaseApplication caseApplication); - - AjaxResult caseCrossexamination(CaseEvidenceDTO caseEvidenceDTO); - - /** - * 批量上传文件 - * @param file - * @param annexType - * @param id - * @param username - * @param userId - * @return - */ - AjaxResult batchUpload(MultipartFile[] file, Integer annexType, Long id, String username, Long userId); - - AjaxResult fileList(Long caseAppliId, List annexTypeList); - - int deleteFile( List fileIds); - - List selectEvidenceTreeList(CaseEvidenceDirectory caseEvidenceDirectory); - - - /** - * 查询证据目录数据 - * - * @param caseEvidenceDirectory 证据目录信息 - * @return 证据目录信息集合 - */ - List selectCaseEvidenceList(CaseEvidenceDirectory caseEvidenceDirectory); - - - /** - * 构建前端所需要树结构 - * - * @param caseEvidenceDirectorys 证据列表 - * @return 树结构列表 - */ - List buildCaseEvidenceTree(List caseEvidenceDirectorys); - - /** - * 构建前端所需要下拉树结构 - * - * @param caseEvidenceDirectorys 证据目录列表 - * @return 下拉树结构列表 - */ - List buildCaseEvidenceTreeSelect(List caseEvidenceDirectorys); - - AjaxResult uploadRecord(MultipartFile file, Integer annexType, Long id, String username, Long userId); -} 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 deleted file mode 100644 index 9b4e911..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICasePaymentService.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.ruoyi.wisdomarbitrate.service; - -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.dto.PayRequest; -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( List ids); - - /** - * 确认缴费 - * @param payDTO - * @return - */ - AjaxResult confirmPay(CaseConfirmPayDTO payDTO); - - - 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/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java deleted file mode 100644 index af495a9..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ /dev/null @@ -1,1513 +0,0 @@ -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.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.controller.BaseController; -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.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.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.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.factory.annotation.Autowired; -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.PageUtils.startPage; -import static com.ruoyi.common.utils.SecurityUtils.getUsername; - -@Service -@Slf4j -public class AdjudicationServiceImpl implements IAdjudicationService { - private final String apiUrl = "http://api.cainiaoapi.com/api/exp/v1/index"; - - @Autowired - private CaseApplicationMapper caseApplicationMapper; - @Autowired - private CaseAffiliateMapper caseAffiliateMapper; - @Autowired - private ArbitrateRecordMapper arbitrateRecordMapper; - @Autowired - private CaseAttachMapper caseAttachMapper; - @Autowired - private EmailOutUtil emailOutUtil; - @Autowired - private ICaseApplicationService caseApplicationService; - @Autowired - private ICaseLogRecordService caseLogRecordService; - @Autowired - private RedisCache redisCache; - @Autowired - private SendMailRecordMapper sendMailRecordMapper; - @Autowired - private SmsRecordMapper smsRecordMapper; - @Autowired - private TemplateManageMapper templateManageMapper; - @Autowired - private ColumnValueMapper columnValueMapper; - @Autowired - private FatchRuleMapper fatchRuleMapper; - @Autowired - private SysDictDataMapper dictDataMapper; - @Autowired - private SealManageMapper sealManageMapper; - @Autowired - private SealSignRecordMapper sealSignRecordMapper; - - - // 仲裁反请求模板内容 - private final String counterclaim = "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" + - "《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" + - "仲裁反请求案件受理后,秘书处向被申请人发送了仲裁反请求通知书及附件,向申请人发送了仲裁反请求通知书及附件、仲裁反请求申请书及附件。"; - // 财产保全内容 - String preservation = "本案受理后,申请人向仲裁委提交了财产保全申请,仲裁委根据《中华人民共和国仲裁法》" + - "第二十八条之规定,将该申请提交至法院。"; - // 管辖权异议 - String jurisdictionalObjection = "本案受理后,被申请人向仲裁委提交了《管辖异议申请书》,认为" + - ",仲裁委经审理,当庭驳回了被申请人的管辖异议申请,并告知被申请人具体的事实和理由将在裁决书中一并列明。"; - // 线上开庭时+线上仲裁 - String onLineDate = "{{onLineDate}}"; - String onLine = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于" + onLineDate + "通过仲裁委智慧仲裁平台开庭审理了本案。"; - // 开庭+线下仲裁 - String offLineDate = "{{offLineDate}}"; - String offLine = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于 " + offLineDate + "在仲裁委所在地开庭审理了本案。"; - //书面仲裁时 - String writtenDate = "{{writtenDate}}"; - String written = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于" + writtenDate + "在仲裁委所在地开庭审理了本案。仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,根据《2022年版仲裁规则》第五十八条的规定对本案进行了书面审理。 "; - //开庭+缺席审理 - String absent = "申请人的特别授权委托代理人{{agentName}}" + "出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" + - "《2022年版仲裁规则》第四十条第(二)项的规定,对本案进行了缺席审理。庭审中,申请人陈述了仲裁请求事项及事实与理由,出示了证据材料并进行了说明,\" +\n" + - " \"发表了意见,回答了仲裁庭的提问,并作了最后陈述。因被申请人缺席庭审,故仲裁庭无法组织调解。" + "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + - "第四十条第(二)项、第五十一条的规定,缺席裁决如下:"; - // 开庭+出席 - String attend = "申请人的特别授权委托代理人{{agentName}}和被申请人本人出席了庭审。 "; - // 开庭+出席+被申提供证据 - String onLineAttendFile = "庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;双方当事人均出示了证据材料并对对方的证据材料进行了质证;双方当事人均回答了仲裁庭的提问,进行了辩论,并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。 "; - // 开庭+出席+被申未提供证据 - String onLineAttend = "庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;申请人出示了证据材料,被申请人对对方的证据材料进行了质证; 双方当事人均回答了仲裁庭的提问,进行了辩论,并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。 "; - // 被申请人出席答辩意见 - String resAttendOpinion = "\n(二)被申请人的答辩意见 \n(三)当事人提供的证据材料及对方的质证意见\n" + - "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:\n{{applicantFile}}\n被申请人对上述材料的质证意见为:{{respondentOpinion}}\n"; - // 被申请人出席+被申请人提供了资料 - String resFile = "被申请人向仲裁庭提交了如下证据材料:\n{{resFile}}" + - "申请人对上述材料的质证意见为:{{applicantOpinion}}"; - // 被申请人缺席 - String resAbsent = "(二)当事人提供的证据材料\n" + - "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:\n{{applicantFile}}"; - // 日期格式化年月日 - SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日"); - - @Override - @Transactional - public AjaxResult createDocument(CaseApplication caseApplicationReq) { - String templatePath = ""; - String templateName = ""; - String agentName = ""; - String resName = ""; - try { - Map datas = new HashMap<>(); - Long id = caseApplicationReq.getId(); - //获取案件详细信息 - CaseApplication caseApplicationById = caseApplicationService.selectCaseApplication(caseApplicationReq); - 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("请先指定裁决书模板"); - } - templatePath = templateManages.get(0).getTemOrigPath(); - if (StrUtil.isEmpty(templatePath)) { - return AjaxResult.error("未找到该模板"); - } - - // todo 部署放开 - if (templatePath != null) { - templatePath = "/home/ruoyi/" + templatePath; - } - try { - File file = new File(templatePath); - } catch (Exception e) { - return AjaxResult.error("未找到该模板"); - } - templateName = templateManages.get(0).getFileName(); - // 查询案件相关表信息 - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(id); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - //获取仲裁记录表里的相关信息 - ArbitrateRecord arbitrateRecord = new ArbitrateRecord(); - arbitrateRecord.setCaseAppliId(id); - ArbitrateRecord arbitrateRecordSelect = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord); - // 在系统表中查询案件内置字段 - 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(caseApplicationReq.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("请检查模板是否配置正确,未获取到占位符"); - } - // 遍历书签,给书签赋值 - replaceBookmark(bookmarkList, datas, valueMap); - // 根据条件替换书签 - conditionReplaceBookmark(caseApplicationById, datas, agentName, resName, 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 = wordChangeText(templatePath, datas, saveFolderPath, fileName); - - String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8); - // 保存裁决书附件 - saveArbitorFile(id, saveName, savePath, caseApplicationById, arbitrateRecordSelect); - - return AjaxResult.success("裁决书已生成"); - } catch (IOException e) { - return AjaxResult.error(e + "请检查文件路径是否有误"); - } - } - - /** - * 将word中的标签替换掉,生成新的word - * - * @param modalFilePath 裁决书模板路径 - * @param datas 替换标签的内容 - * @param saveFolderPath 保存路径 - * @param fileName 保存文件名 - * @return - * @throws IOException - */ - private String wordChangeText(String modalFilePath, Map datas, String saveFolderPath, String fileName) throws IOException { - 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); - } - return docFilePath; - } - - /** - * 根据条件判断裁决书中是否需要该内容 - * - * @param caseApplicationById 案件信息 - * @param datas 替换标签值 - * @param agentName 代理人名称 - * @param resName 被申请人名称 - * @param arbitrateRecordSelect 仲裁记录 - */ - private void conditionReplaceBookmark(CaseApplication caseApplicationById, Map datas, String agentName, String resName, ArbitrateRecord arbitrateRecordSelect) { - // 如果有仲裁反请求,该字段设置值 - Integer adjudicaCounter = caseApplicationById.getAdjudicaCounter(); - if (adjudicaCounter != null && adjudicaCounter == 1) { - datas.put("仲裁反请求", counterclaim); - } - //财产保全 - Integer properPreser = caseApplicationById.getProperPreser(); - if (properPreser != null && properPreser == 1) { - datas.put("财产保全", preservation); - } - //管辖权异议 - Integer objectiJuris = caseApplicationById.getObjectiJuris(); - if (objectiJuris != null && objectiJuris == 1) { - datas.put("管辖权异议", jurisdictionalObjection); - } - - // 出席庭审人员角色名称 - String attendName = "秘书、"; - boolean isAbsenceFlag = caseApplicationById.getIsAbsence() != null && caseApplicationById.getIsAbsence().equals(0); - boolean appIsAbsenceFlag = caseApplicationById.getAppliIsAbsen() != null && caseApplicationById.getAppliIsAbsen().equals(0); - if (isAbsenceFlag || appIsAbsenceFlag) { - if (isAbsenceFlag) { - attendName += "申请代理人" + agentName + "、"; - } - if (appIsAbsenceFlag) { - attendName += "被申请人" + resName; - } - if (attendName.endsWith("、")) { - attendName = attendName.replace("、", ""); - } - datas.put("出席庭审人员", attendName); - } - - // 仲裁员名称 - datas.put("仲裁员姓名", caseApplicationById.getArbitratorName()); - // 审理方式 - Integer arbitratMethod = caseApplicationById.getArbitratMethod(); - Date hearDate = caseApplicationById.getHearDate(); - String hearDateStr = ""; - if (hearDate != null) { - // 审理日期 - hearDateStr = sdf.format(hearDate); - datas.put("审理日期", hearDateStr); - } - // todo 线上仲裁/线下仲裁方式未选择 - //线上开庭时+线上仲裁 - if (arbitratMethod != null && arbitratMethod == 1) { - String replace = onLine.replace(onLineDate, Optional.of(hearDateStr).orElse("")); - datas.put("线上开庭并线上仲裁", replace); - // 所有附件 - List caseAttachList = caseApplicationById.getCaseAttachList(); - Map> caseAttachMap = new HashMap<>(); - if (caseAttachList != null && caseAttachList.size() > 0) { - caseAttachMap = caseAttachList.stream().collect(Collectors.groupingBy(CaseAttach::getAnnexType)); - } - // 被申请人是否缺席 - Integer isAbsence = caseApplicationById.getIsAbsence(); - if (isAbsence != null && isAbsence == 1) { - // 被申请人缺席,开庭+缺席审理 - String absentReplace = absent.replace("{{agentName}}", Optional.of(agentName).orElse("")); - - // 被申请人缺席 - String resAbsentReplace = resAbsent; - if (caseAttachMap != null && CollectionUtil.isNotEmpty(caseAttachMap.get(2))) { - List caseAttaches = caseAttachMap.get(2); - StringBuilder stringBuilder = new StringBuilder(); - for (CaseAttach caseAttach : caseAttaches) { - stringBuilder.append(caseAttach.getAnnexName()).append("\n"); - } - resAbsentReplace = resAttendOpinion.replace("{{applicantFile}}", stringBuilder.toString()); - } - datas.put("开庭并缺席", absentReplace + resAbsentReplace); - } else { - // 被申出席 - String attendReplace = attend.replace("{{agentName}}", Optional.ofNullable(agentName).orElse("")); - datas.put("开庭并出席", attendReplace); - // 被申请人证据 - if (caseAttachMap != null && CollectionUtil.isNotEmpty(caseAttachMap.get(6))) { - // 开庭+出席+被申提供证据 - - // 开庭+出席+被申提供证据 - String resFileReplace = resFile; - if (CollectionUtil.isNotEmpty(caseAttachMap.get(6))) { - List caseAttaches = caseAttachMap.get(6); - StringBuilder stringBuilder = new StringBuilder(); - for (CaseAttach caseAttach : caseAttaches) { - stringBuilder.append(caseAttach.getAnnexName()).append("\n"); - } - resFileReplace = resFile.replace("{{resFile}}", stringBuilder.toString()).replace("{{applicantOpinion}}", (arbitrateRecordSelect == null || arbitrateRecordSelect.getApplicantOpinion() == null ? "" : arbitrateRecordSelect.getApplicantOpinion())); - } - datas.put("开庭并出席并被申提供证据", onLineAttendFile + resFileReplace); - } else { - // 开庭+出席+被申未提供证据 - datas.put("开庭并出席并被申未提供证据", onLineAttend); - } - // 被申请人出席答辩意见 - String resAttendOpinionReplace = resAttendOpinion; - if (caseAttachMap != null && CollectionUtil.isNotEmpty(caseAttachMap.get(2))) { - List caseAttaches = caseAttachMap.get(2); - StringBuilder stringBuilder = new StringBuilder(); - for (CaseAttach caseAttach : caseAttaches) { - stringBuilder.append(caseAttach.getAnnexName()).append("\n"); - } - resAttendOpinionReplace = resAttendOpinion.replace("{{applicantFile}}", stringBuilder.toString()).replace("{{respondentOpinion}}", (arbitrateRecordSelect == null || arbitrateRecordSelect.getRespondentOpinion() == null) ? "" : arbitrateRecordSelect.getRespondentOpinion()); - } - - datas.put("被申请人出席答辩意见", resAttendOpinionReplace); - } - - } else { - //书面仲裁时 - String replace = written.replace(writtenDate, Optional.of(hearDateStr).orElse("")); - datas.put("书面仲裁", replace); - - } - - } - - /** - * 给模板中的占位符赋值 - * - * @param bookmarkList 书签 - * @param datas 书签赋值 - * @param valueMap 案件内容 - */ - private void replaceBookmark(List bookmarkList, Map datas, Map valueMap) { - for (String bookmark : bookmarkList) { - if (valueMap.containsKey(bookmark)) { - if (bookmark.equals("仲裁请求")) { - // 请求仲裁庭裁决 - String arbitratClaims = valueMap.get(bookmark); - if (StrUtil.isNotEmpty(arbitratClaims)) { - String replace = arbitratClaims.replace("甲方", "被申请人").replace("乙方", "申请人"); - datas.put(bookmark, replace); - - } else { - datas.put(bookmark, ""); - } - } else if (bookmark.equals("本案事实")) { - // 查询本案事实如下 - String mediationAgreement = valueMap.get(bookmark); - if (StrUtil.isNotEmpty(mediationAgreement)) { - String replace = mediationAgreement.replace("甲方", "被申请人").replace("乙方", "申请人"); - datas.put(bookmark, replace); - - } else { - datas.put(bookmark, ""); - } - } else { - datas.put(bookmark, valueMap.get(bookmark)); - } - } - } - } - - /** - * 组装案件内置字段值,即主表和相关人员表信息 - * - * @param dictDataList 内置字段 - * @param caseAffiliates 关联人员 - * @param valueMap 组装的值 - */ - 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)); - for (SysDictData dictData : dictDataList) { - if (StrUtil.isNotEmpty(dictData.getDictLabel())) { - if (dictData.getDictLabel().contains("被申请人")) { - CaseAffiliate affiliate = affiliateMap.get(2); - if (affiliate == null) { - continue; - } - // 被申请人 - switch (dictData.getDictLabel()) { - case "被申请人姓名": - valueMap.put(dictData.getDictLabel(), affiliate.getName()); - break; - case "被申请人身份证号": - valueMap.put(dictData.getDictLabel(), affiliate.getIdentityNum()); - break; - case "被申请人住所": - valueMap.put(dictData.getDictLabel(), affiliate.getResidenAffili()); - break; - case "被申请人联系地址": - valueMap.put(dictData.getDictLabel(), affiliate.getContactAddress()); - break; - case "被申请人联系电话": - valueMap.put(dictData.getDictLabel(), affiliate.getContactTelphone()); - break; - case "被申请人电子邮件": - valueMap.put(dictData.getDictLabel(), affiliate.getEmail()); - break; - case "被申请人性别": - String responSex = affiliate.getResponSex(); - if (responSex.equals("0")) { - valueMap.put(dictData.getDictLabel(), "男"); - } else { - valueMap.put(dictData.getDictLabel(), "女"); - } - break; - case "被申请人出生年月日": - Date responBirth = affiliate.getResponBirth(); - if (responBirth != null) { - valueMap.put(dictData.getDictLabel(), sdf.format(responBirth)); - } else { - valueMap.put(dictData.getDictLabel(), ""); - } - break; - 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; - } - // 申请人 - switch (dictData.getDictLabel()) { - case "申请人姓名": - valueMap.put(dictData.getDictLabel(), affiliate.getName()); - break; - case "统一社会信用代码": - valueMap.put(dictData.getDictLabel(), affiliate.getIdentityNum()); - break; - case "法定代表人": - valueMap.put(dictData.getDictLabel(), affiliate.getCompLegalPerson()); - break; - case "法定代表人职位": - valueMap.put(dictData.getDictLabel(), affiliate.getCompLegalperPost()); - break; - case "申请人住所": - valueMap.put(dictData.getDictLabel(), affiliate.getResidenAffili()); - break; - case "申请人联系地址": - valueMap.put(dictData.getDictLabel(), affiliate.getContactAddress()); - break; - case "委托代理人姓名": - valueMap.put(dictData.getDictLabel(), affiliate.getNameAgent()); - break; - case "委托代理人联系电话": - valueMap.put(dictData.getDictLabel(), affiliate.getContactTelphoneAgent()); - break; - case "委托代理人电子邮件": - valueMap.put(dictData.getDictLabel(), affiliate.getAgentEmail()); - break; - default: - break; - } - } else { - valueMap.put(dictData.getDictLabel(), ObjectFieldUtils.getValue(caseApplication, dictData.getDictValue())); - } - } else { - valueMap.put(dictData.getDictLabel(), ObjectFieldUtils.getValue(caseApplication, dictData.getDictValue())); - } - - } - } - } - - /** - * 保存裁决书附件 - * - * @param id 案件id - * @param saveName 保存的文件名 - * @param savePath 保存路径 - * @param caseApplicationById 案件基本信息 - * @param arbitrateRecordSelect 出裁决书生成记录 - */ - 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(); - //保存到附件表里,先判断之前有没有,有的话更新,没有的话新增 - List caseAttachList = caseAttachMapper.getCaseAttachByCaseIdAndType(caseAttach); - if (caseAttachList != null && caseAttachList.size() > 0) { - //之前已经生成过了,更新 - int i = caseAttachMapper.updateCaseAttachBycaseid(caseAttach); - } else { - //之前没生成过,新增 - int i = caseAttachMapper.save(caseAttach); - if (i > 0) { - if (arbitrateRecordSelect != null) { - Integer annexId = caseAttach.getAnnexId(); - //将附件id保存到仲裁记录表里面 - arbitrateRecordSelect.setAnnexId(annexId); - arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecordSelect); - } - } - } - //修改案件状态 - caseApplicationById.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION); - caseApplicationMapper.submitCaseApplication(caseApplicationById); - } - - @Override - @Transactional - public AjaxResult sendDocumentByEmail(Long id, String appEmail, String resEmail, String apptrackingNum, String restrackingNum) { - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(id); - CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); - if (caseApplication1 == null) { - return AjaxResult.error("未查询到相关案件"); - } - - //根据案件id查询裁决书 - try { - List fileList = new ArrayList<>(); - CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplication); - List caseAttachList = caseApplication2.getCaseAttachList(); - if (caseAttachList != null && caseAttachList.size() > 0) { - for (CaseAttach caseAttach : caseAttachList) { - if (caseAttach.getAnnexType() == 3) { - String annexPath = caseAttach.getAnnexPath(); - //File file = new File("/home/ruoyi/" + annexPath); - String path = "/home/ruoyi" + annexPath; - System.out.println("原文件路径是:" + path); - String newpath = path.replace("/", "\\"); - System.out.println("新文件路径是:" + newpath); - File file = new File(newpath); - System.out.println("新文件是:" + file); - fileList.add(file); - } - } - } - if (fileList.size() < 1) { - return AjaxResult.error("未查询到裁决书"); - } - File file = fileList.get(0); - //电子邮件送达 - JavaMailSender javaMailSender = emailOutUtil.rebuildMailSender(); - if (appEmail != null) { - emailOutUtil.sendMessageCarryFile(appEmail, "案件裁决书", "您的裁决书已送达,详情请查阅附件", file - , "hjbjava@163.com", javaMailSender); - } - if (resEmail != null) { - 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); - } - } - } - - 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 AjaxResult signature(CaseApplication caseApplication) { - //更改案件状态(暂时) - caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL); - caseApplicationMapper.submitCaseApplication(caseApplication); - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.ARBITRATED_SEAL, ""); - - return AjaxResult.success("签名成功,案件状态已改为待仲裁文书用印"); - } - - @Override - public AjaxResult caseFile(List ids) { - try { - for (Long id : ids) { - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(id); - //更改案件状态(暂时) - caseApplication.setCaseStatus(CaseApplicationConstants.CASE_ARCHIVED); - caseApplicationMapper.submitCaseApplication(caseApplication); - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_ARCHIVED, ""); - } - } catch (Exception e) { - return AjaxResult.error(e.getMessage()); - } - - return AjaxResult.success("归档成功,案件状态已改为已归档"); - } - - @Override - @Transactional - public AjaxResult service(Long id, String appEmail, String resEmail, String apptrackingNum, String restrackingNum) { - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(id); - CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); - if (caseApplication1 == null) { - return AjaxResult.error("未查询到相关案件"); - } - List caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication1); - 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); - // todo 部署放开 - if (!file.exists()) { - 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); - SendMailRecord sendMailRecord = new SendMailRecord(); - sendMailRecord.setCaseId(id); - sendMailRecord.setMailAddress(appEmail); - sendMailRecord.setMailContent("您好,审核后的裁决书在附件中请查阅"); -// sendMailRecord.setMailContent("您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅"); - sendMailRecord.setMailName("签署后的裁决书"); - sendMailRecord.setSendTime(new Date()); - sendMailRecord.setCreateBy(getUsername()); - if (appEmailFlag) { - sendMailRecord.setSendStatus(1); - } else { - sendMailRecord.setSendStatus(0); - } - sendMailRecordMapper.saveSendMailRecord(sendMailRecord); - // 被申请人发送邮件 - boolean resEmailFlag = sendCaseEmail(caseApplication1, resEmail, caseAttachList); - - SendMailRecord sendMailRecord1 = new SendMailRecord(); - sendMailRecord1.setCaseId(id); - sendMailRecord1.setMailAddress(resEmail); -// sendMailRecord.setMailContent("您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅"); - sendMailRecord1.setMailContent("您好,审核后的裁决书在附件中请查阅"); - sendMailRecord1.setMailName("签署后的裁决书"); - sendMailRecord1.setSendTime(new Date()); - sendMailRecord1.setCreateBy(getUsername()); - if (resEmailFlag) { - sendMailRecord1.setSendStatus(1); - }else { - sendMailRecord1.setSendStatus(0); - } - sendMailRecordMapper.saveSendMailRecord(sendMailRecord1); - if(!appEmailFlag&&!resEmailFlag){ - throw new ServiceException("裁决书发送失败"); - } - if(!appEmailFlag){ - throw new ServiceException("申请人裁决书发送失败"); - } - if(!resEmailFlag){ - throw new ServiceException("被申请人裁决书发送失败"); - } - // 发送短信 - if (appEmailFlag||resEmailFlag) { - - if (CollectionUtil.isNotEmpty(caseAffiliates)) { - SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - request.setTemplateId("1990362"); - for (CaseAffiliate affiliate : caseAffiliates) { - String telphone=null; - if(appEmailFlag&&affiliate.getIdentityType()==1){ - telphone = affiliate.getContactTelphone(); - }else if(resEmailFlag&&affiliate.getIdentityType()==2){ - telphone = affiliate.getContactTelphone(); - } - if(StrUtil.isEmpty(telphone)){ - continue; - } - - request.setPhone(telphone); -// 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[]{affiliate.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("尊敬的" + affiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达,请知晓,如非本人操作,请忽略本短信。"); - - - smsSendRecord.setCreateBy(getUsername()); - if (aBoolean) { - smsSendRecord.setSendStatus(1); - } else { - smsSendRecord.setSendStatus(0); - } - smsRecordMapper.saveSmsSendRecord(smsSendRecord); - - - } - - } - - } - - - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_FILING, ""); - - return AjaxResult.success("仲裁文书送达成功"); - } - - /** - * 通过邮件发送裁决书文件 - * - * @param caseApplication1 - */ - private boolean sendCaseEmail(CaseApplication caseApplication1, String email, List caseAttachList) { - List fileList = new ArrayList<>(); - File file = 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); - // todo 部署放开 - file = new File(path); -// file = new File("D:\\home\\ruoyi\\uploadPath\\upload\\2023\\09\\b10b20d66cfa44df8995c3999e3b6266.pdf"); - fileList.add(file); - System.out.println("文件长度==================:" + file.length()); - } - } - } - - if (file != null && file.exists()) { - try { - Boolean aBoolean = emailOutUtil.sendEmil(email, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null); - -// String appUid = UUID.randomUUID().toString(); -// Boolean aBoolean = emailOutUtil.sendEmil(email, "您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅", appUid +"裁决书", fileList, null); -// // Thread.sleep(20); - // 收到退信的所有id,即发送失败的uuid - // emailOutUtil.receiverMail(); - // Thread.sleep(3); - // List messageIds = emailOutUtil.receiverMail(); -// if (aBoolean&&(CollectionUtil.isEmpty(messageIds)||!messageIds.contains(appUid))) { -// return Boolean.TRUE; -// } - if (aBoolean) { - return Boolean.TRUE; - } - } catch (Exception e) { - System.out.println("邮件发送失败++++++++++++++++++++++++++++++++"); - System.out.println(e.toString()); - 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); - 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()); - } - } - } - 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)); - } - - } - - @Transactional - @Override - public AjaxResult batchDocument(List ids) { - // todo 多线程生成裁决书 -// List execList=new ArrayList<>(); -// if(CollectionUtil.isNotEmpty(columnValueList)) { -// setExecList(execList, columnValueList); -// } -// -// if(CollectionUtil.isNotEmpty(execList)){ -// MultipleThreadWorkUtil.execListFun(execList.toArray(new MultipleThreadListParam[execList.size()])); -// } - for (Long id : ids) { - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(id); - createDocument(caseApplication); - } - - 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; - } - - /** - * 根据仲裁员手机号分页查询等待签署,签署中的裁决书 - * - * @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) { - redisCache.setCacheObject("awardNum", "00001"); - String s = redisCache.getCacheObject("awardNum").toString(); - // 字符串数字解析为整数 - int no = Integer.parseInt(s); - // 最新设备编号自增1 - int newEquipment = ++no; - // 将整数格式化为5位数字 - s = String.format("%05d", newEquipment); - redisCache.setCacheObject("awardNum", s); - return s; - } else { - String s = awardNum.toString(); - // 字符串数字解析为整数 - int no = Integer.parseInt(s); - // 最新设备编号自增1 - int newEquipment = ++no; - // 将整数格式化为5位数字 - s = String.format("%05d", newEquipment); - redisCache.setCacheObject("awardNum", s); - return s; - } - } - - /** - * 根据裁决书模板获取所有的占位符,占位符必须是{{name}}格式 - * - * @param path - * @return - */ - public List getBookmarkByDocx(String path) { - XWPFDocument xwpfDocument = null; - try { - log.error("path====" + path); - FileInputStream fileInputStream = new FileInputStream(path); - log.error("fileInputStream===="); - xwpfDocument = new XWPFDocument(fileInputStream); - log.error("xwpfDocument====" + xwpfDocument); - } catch (IOException e) { - e.printStackTrace(); - } - if (xwpfDocument == null) { - return new ArrayList<>(); - } - List paragraphs = xwpfDocument.getParagraphs(); - if (CollectionUtil.isEmpty(xwpfDocument.getParagraphs())) { - return new ArrayList<>(); - } - String regex = "\\{\\{.*?\\}\\}"; // 定义占位符的正则表达式 - Pattern pattern = Pattern.compile(regex); - List bookmarkList = new ArrayList<>(); - for (XWPFParagraph paragraph : paragraphs) { - String text = paragraph.getText(); - if (StrUtil.isNotEmpty(text)) { - Matcher matcher = pattern.matcher(text); - - while (matcher.find()) { - String placeholder = matcher.group(); - String keyword = placeholder.substring(2, placeholder.length() - 2); - bookmarkList.add(keyword); - } - } - } - return bookmarkList; - } - - -} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/ArbitratorServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/ArbitratorServiceImpl.java deleted file mode 100644 index 78f9e4b..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/ArbitratorServiceImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.ruoyi.wisdomarbitrate.service.impl; - -import com.ruoyi.wisdomarbitrate.domain.Arbitrator; -import com.ruoyi.wisdomarbitrate.mapper.ArbitratorMapper; -import com.ruoyi.wisdomarbitrate.service.IArbitratorService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; - -@Service -public class ArbitratorServiceImpl implements IArbitratorService { - @Autowired - private ArbitratorMapper arbitratorMapper; - - - @Override - public List selectArbitratorList(Arbitrator arbitrator) { - return arbitratorMapper.selectArbitratorList(arbitrator); - - } - - - - - - -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CallBackHandleServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CallBackHandleServiceImpl.java index dfa8aca..ad0635f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CallBackHandleServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CallBackHandleServiceImpl.java @@ -11,12 +11,13 @@ import org.springframework.stereotype.Component; @Component @Slf4j public class CallBackHandleServiceImpl implements CallBackService { - @Autowired - private CasePaymentServiceImpl casePaymentService; - + // todo +// @Autowired +// private CasePaymentServiceImpl casePaymentService; + @Override public void successPay(String orderSn) { - casePaymentService.callback(orderSn); + // casePaymentService.callback(orderSn); } @Override 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 deleted file mode 100644 index d879caf..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java +++ /dev/null @@ -1,512 +0,0 @@ -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.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; -import com.ruoyi.wisdomarbitrate.mapper.*; -import com.ruoyi.wisdomarbitrate.service.CaseApplicationLogService; -import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.*; -import java.util.function.Function; -import java.util.stream.Collectors; - -import static com.ruoyi.common.utils.SecurityUtils.getUsername; - -/** - * @author wangqiong - * @description 案件日志 - * @date 2023-11-17 14:05 - */ -@Service -public class CaseApplicationLogServiceImpl implements CaseApplicationLogService { - @Autowired - private CaseApplicationLogMapper caseApplicationLogMapper; - @Autowired - private CaseApplicationMapper caseApplicationMapper; - @Autowired - private CaseAffiliateLogMapper caseAffiliateLogMapper; - @Autowired - private CaseAffiliateMapper caseAffiliateMapper; - @Autowired - private CaseAttachMapper caseAttachMapper; - @Autowired - private CaseAttachLogMapper caseAttachLogMapper; - @Autowired - private SmsRecordMapper smsRecordMapper; - @Autowired - private ICaseApplicationService caseApplicationService; - @Autowired - private ColumnValueLogMapper columnValueLogMapper; - // 对比两个版本修改的字段,基本字段对比 - private static final String[] columns = {"caseName","caseSubjectAmount","loanStartDate", "loanEndDate","contractNumber","claimInterestOwed","claimLiquidDamag", - "claimPrinciOwed","arbitratClaims","properPreser","requestRule","facts"}; - // 人员字段对比 - private static final String[] affiliateColumns = {"name", "identityNum","contactTelphone","contactAddress","workTelphone","workAddress","email", - "nameAgent", "identityNumAgent","contactTelphoneAgent","contactAddressAgent","residenAffili","compLegalPerson", - "compLegalperPost","responSex","responBirth"}; - @Override - public int insert(CaseApplication caseApplicationLog) { - return caseApplicationLogMapper.insert(caseApplicationLog); - } - - @Override - public int delete(Long id) { - return caseApplicationLogMapper.deleteById(id); - } - - - - @Override - public CaseApplication selectByCaseIdAndVersion(Long id, int version) { - return caseApplicationLogMapper.selectByCaseIdAndVersion(id,version); - } - /** - * 修改的案件提交到秘书 - * @param vo - * @return - */ - @Override - public AjaxResult submit(UpdateSubmitVO vo) { - vo.setUpdateSubmitStatus(UpdateSubmitStatus.COMMITTED.getCode()); - // 修改日志表提交状态 - caseApplicationLogMapper.updateStatus(vo); - return AjaxResult.success(); - } - @Transactional - @Override - public AjaxResult revoke(UpdateSubmitVO vo) { - // 根据案件id和版本号查询改案件 - CaseApplication caseApplication = caseApplicationLogMapper.selectByCaseIdAndVersion(vo.getCaseId(), vo.getVersion()); - if(caseApplication == null){ - return AjaxResult.error("案件不存在"); - } - // 如果秘书没有审核,将撤销状态改为同意撤销,否则改为撤销 - if(caseApplication.getUpdateSubmitStatus()!=null && !caseApplication.getUpdateSubmitStatus().equals(UpdateSubmitStatus.AGREE.getCode())){ - agreeRevoke(vo); - - }else { - vo.setUpdateSubmitStatus(UpdateSubmitStatus.REVOKE.getCode()); - // 修改日志表提交状态 - caseApplicationLogMapper.updateStatus(vo); - } - - return AjaxResult.success(); - } - - /** - * 秘书审核修改的案件 - * @param vo - * @return - */ - @Transactional - @Override - public AjaxResult updateAudit(UpdateSubmitVO vo) { - if (Objects.equals(vo.getUpdateSubmitStatus(), UpdateSubmitStatus.COMMITTED.getCode())) { - // 审核修改提交状态 - if (Objects.equals(vo.getIsAgree(), YesOrNoEnum.YES.getCode())) { - // 如果版本号为1,则直接返回 - if(vo.getVersion() <= 1){ - vo.setUpdateSubmitStatus(UpdateSubmitStatus.AGREE.getCode()); - caseApplicationLogMapper.updateStatus(vo); - return AjaxResult.success(); - } - // 同意,查询日志记录表本版本数据,将数据更新到主表,并将日志表改版本的状态改为同意 - // 查询日志记录表本版本数据 - CaseApplication caseApplicationLog = caseApplicationLogMapper.selectByCaseIdAndVersion(vo.getCaseId(), vo.getVersion()); - if (caseApplicationLog == null) { - return AjaxResult.error("未找到该案件"); - } - // 将日志表改版本的状态改为同意 - vo.setUpdateSubmitStatus(UpdateSubmitStatus.AGREE.getCode()); - caseApplicationLogMapper.updateStatus(vo); - // 根据caseLogId查询相关人员表 - List affiliateLogList = caseAffiliateLogMapper.selectCaseAffiliate(caseApplicationLog.getCaseLogId()); - // 更新案件主表 - caseApplicationMapper.updataCaseApplication(caseApplicationLog); - - // 更新相关人员主表 - if(CollectionUtil.isNotEmpty(affiliateLogList)){ - caseAffiliateMapper.deleteByCaseId(vo.getCaseId()); - for (CaseAffiliate caseAffiliate : affiliateLogList) { - caseAffiliate.setCaseAppliId(vo.getCaseId()); - - } - caseAffiliateMapper.batchCaseAffiliate(affiliateLogList); - } - // // 根据caseLogId查询案件记录附件表 - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setCaseLogId(caseApplicationLog.getCaseLogId()); - caseApplication.setAnnexType(2); - List attachLogList = caseAttachLogMapper.queryCaseAttachList(caseApplication); - // 更新记录附件表 - if(CollectionUtil.isNotEmpty(attachLogList)){ - for (CaseAttach caseAttach : attachLogList) { - caseAttach.setCaseAppliId(vo.getCaseId()); - caseAttachMapper.updateCaseAttach(caseAttach); - } - } - // 更新自定义字段表 - // 根据caseLogId查询自定义字段表 - List columnValueList = columnValueLogMapper.listBycaseAppliLogId(caseApplicationLog.getCaseLogId()); - if(CollectionUtil.isNotEmpty(columnValueList)){ - for (ColumnValue columnValue : columnValueList) { - columnValue.setCaseAppliLogId(vo.getCaseId()); - - } - columnValueLogMapper.batchUpdate(columnValueList); - } - } else { - // 拒绝,将日志表改版本的状态改为拒绝 - vo.setUpdateSubmitStatus(UpdateSubmitStatus.REFUSE.getCode()); - caseApplicationLogMapper.updateStatus(vo); - return sendAuditMessage(vo); - } - return AjaxResult.success(); - } else if (Objects.equals(vo.getUpdateSubmitStatus(), UpdateSubmitStatus.REVOKE.getCode())) { - // 审核修改撤销状态 - if (Objects.equals(vo.getIsAgree(), YesOrNoEnum.YES.getCode())) { - // 同意撤销 - agreeRevoke(vo); - } else { - // 拒绝撤销,将日志表改版本的状态改为拒绝撤销 - vo.setUpdateSubmitStatus(UpdateSubmitStatus.REFUSE_REVOKE.getCode()); - caseApplicationLogMapper.updateStatus(vo); - return sendAuditMessage(vo); - } - return AjaxResult.success(); - } - return AjaxResult.success(); - } - - /** - * 给申请人发送短信 - * @param vo - * @return - */ - private AjaxResult sendAuditMessage(UpdateSubmitVO vo) { - // 查询申请人 - CaseApplication logCase = caseApplicationLogMapper.selectByCaseIdAndVersion(vo.getCaseId(), vo.getVersion()); - if(logCase == null){ - return AjaxResult.success(); - } - CaseAffiliate caseAffiliate = caseAffiliateLogMapper.selectCaseAffiliateByIdentityType(logCase.getCaseLogId(), 1); - if(caseAffiliate == null){ - 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); - return AjaxResult.success(); - } - - @Override - public AjaxResult selectCompareCase(UpdateSubmitVO vo) { - // 查询当前版本号和主表的案件 - CaseApplication afterCase = caseApplicationLogMapper.selectByCaseIdAndVersion(vo.getCaseId(), vo.getVersion()); - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setCaseAppliId(vo.getCaseId()); - caseApplication.setId(vo.getCaseId()); - CaseApplication beforeCase = caseApplicationService.selectCaseApplication(caseApplication); - - // 查询案件关联人员 - afterCase.setCaseAffiliates(caseAffiliateLogMapper.selectCaseAffiliate(afterCase.getCaseLogId())); - // 查询自定义字段表 - afterCase.setColumnValues(columnValueLogMapper.listBycaseAppliLogId(afterCase.getCaseLogId())); - // 查询附件 - CaseAttach caseAttach = new CaseAttach(); - caseAttach.setCaseAppliLogId(beforeCase.getCaseLogId()); - caseAttach.setAnnexType(2); - caseAttachLogMapper.getCaseAttachByCaseIdAndType(caseAttach); - caseAttach.setCaseAppliLogId(afterCase.getCaseLogId()); - 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); - } - } - afterCase.setCaseAttachList(afterAttachList); - } - afterCase.setCaseAttachList(afterAttachList); - CompareCaseVO compareCaseVO = new CompareCaseVO(); - compareCaseVO.setBeforeCase(beforeCase); - compareCaseVO.setAfterCase(afterCase); - - StringBuilder changeColumn = new StringBuilder(); - // 对比基本字段 - for (String column : columns) { - String beforeValue = ObjectFieldUtils.getValue(beforeCase, column); - String afterValue = ObjectFieldUtils.getValue(afterCase, column); - if (StrUtil.isEmpty(beforeValue) && StrUtil.isNotEmpty(afterValue)) { - changeColumn.append(column).append(","); - continue; - } - if (StrUtil.isNotEmpty(beforeValue) && StrUtil.isEmpty(afterValue)) { - changeColumn.append(column).append(","); - continue; - } - if (StrUtil.isNotEmpty(beforeValue) && StrUtil.isNotEmpty(afterValue) && !Objects.equals(beforeValue, afterValue)) { - changeColumn.append(column).append(","); - continue; - - } - - } - // 对比案件人员字段 - compareAffilate(beforeCase, afterCase); - // 对比申请人证据资料 - compareCaseVO.setChangeColumn(compareApplicantFile(beforeCase, afterCase, changeColumn).toString()); - // 对比自定义字段 - // - List beforeColumnValues = beforeCase.getColumnValues(); - List afterColumnValues = afterCase.getColumnValues(); - StringBuilder columnValueChange = new StringBuilder(); - - if (CollectionUtil.isNotEmpty(beforeColumnValues) && CollectionUtil.isNotEmpty(afterColumnValues)) { - Map beforeColumnValueMap = beforeColumnValues.stream().collect(Collectors.toMap(ColumnValue::getColumn, ColumnValue::getValue, (n1, n2) -> n2)); - for (ColumnValue afterColumnValue : afterColumnValues) { - // 改变前字段不包含改变后字段 - if (!beforeColumnValueMap.containsKey(afterColumnValue.getColumn())) { - columnValueChange.append(afterColumnValue.getColumn()).append(","); - } else { - // 都有这个字段,比较内容是否相同 - // 修改后为空,修改前不为空 - if (StrUtil.isEmpty(afterColumnValue.getValue()) && StrUtil.isNotEmpty(beforeColumnValueMap.get(afterColumnValue.getColumn()))) { - columnValueChange.append(afterColumnValue.getColumn()).append(","); - } else if (StrUtil.isNotEmpty(afterColumnValue.getValue()) && StrUtil.isEmpty(beforeColumnValueMap.get(afterColumnValue.getColumn()))) { - // 修改前为空,修改后不为空 - columnValueChange.append(afterColumnValue.getColumn()).append(","); - } else if (StrUtil.isNotEmpty(afterColumnValue.getValue()) && StrUtil.isNotEmpty(beforeColumnValueMap.get(afterColumnValue.getColumn())) - && !afterColumnValue.getValue().equals(beforeColumnValueMap.get(afterColumnValue.getColumn()))) { - // 修改前不为空,修改后不为空,内容不同 - columnValueChange.append(afterColumnValue.getColumn()).append(","); - } - } - } - - } else if (CollectionUtil.isEmpty(beforeColumnValues) && CollectionUtil.isNotEmpty(afterColumnValues)) { - for (ColumnValue afterColumnValue : afterColumnValues) { - columnValueChange.append(afterColumnValue.getColumn()).append(","); - } - - } else if (CollectionUtil.isNotEmpty(beforeColumnValues) && CollectionUtil.isEmpty(afterColumnValues)) { - for (ColumnValue beforeColumn : beforeColumnValues) { - columnValueChange.append(beforeColumn.getColumn()).append(","); - } - - } - compareCaseVO.setColumnValueChangeColumn(columnValueChange.toString()); - - return AjaxResult.success(compareCaseVO); - } - - /** - * 对比申请人证据资料 - * @param beforeCase - * @param afterCase - * @param changeColumn - * @return - */ - private StringBuilder compareApplicantFile(CaseApplication beforeCase, CaseApplication afterCase, StringBuilder changeColumn) { - List beforeAttachFilter =new ArrayList<>(); - List afterAttachFilter =new ArrayList<>(); - if(CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList())){ - beforeAttachFilter = beforeCase.getCaseAttachList().stream().filter(n -> n.getAnnexType() == 2).collect(Collectors.toList()); - } - if(CollectionUtil.isNotEmpty(afterCase.getCaseAttachList())){ - afterAttachFilter = afterCase.getCaseAttachList().stream().filter(n -> n.getAnnexType() == 2).collect(Collectors.toList()); - } - if(CollectionUtil.isNotEmpty(beforeAttachFilter)&& CollectionUtil.isNotEmpty(afterAttachFilter)){ - if(beforeAttachFilter.size()!=afterAttachFilter.size()){ - changeColumn.append("fileColumn"); - }else { - Map afterAttachMap = afterAttachFilter.stream().collect(Collectors.toMap(CaseAttach::getAnnexPath, Function.identity(), (n1, n2) -> n2)); - for (CaseAttach beforeCaseAttach : beforeAttachFilter) { - if(!afterAttachMap.containsKey(beforeCaseAttach.getAnnexPath())) { - changeColumn.append("fileColumn"); - break; - } - } - } - } - - - return changeColumn; - } - - /** - * 对比案件人员字段 - * @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()); - - } - - - } - } - - /** - * 同意撤销 - * @param vo - */ - private void agreeRevoke(UpdateSubmitVO vo) { - CaseApplication caseApplicationLog; - // 查询日志记录表上个版本未被拒绝数据 - if(vo.getVersion()<=1){ - caseApplicationLog = caseApplicationLogMapper.selectByCaseIdAndVersion(vo.getCaseId(), vo.getVersion() ); - - }else { - caseApplicationLog = caseApplicationLogMapper.selectBeforeCase(vo.getCaseId(), vo.getVersion() ); - } - if (caseApplicationLog == null) { - return; - } - // 将日志表改版本的状态改为拒绝 - vo.setUpdateSubmitStatus(UpdateSubmitStatus.AGREE_REVOKE.getCode()); - caseApplicationLogMapper.updateStatus(vo); - // 根据caseLogId查询相关人员表 - List affiliateLogList = caseAffiliateLogMapper.selectCaseAffiliate(caseApplicationLog.getCaseLogId()); - - - // 更新案件主表 - caseApplicationMapper.updataCaseApplication(caseApplicationLog); - - // 更新相关人员主表 - if(CollectionUtil.isNotEmpty(affiliateLogList)){ - caseAffiliateMapper.deleteByCaseId(vo.getCaseId()); - for (CaseAffiliate caseAffiliate : affiliateLogList) { - caseAffiliate.setCaseAppliId(vo.getCaseId()); - - } - caseAffiliateMapper.batchCaseAffiliate(affiliateLogList); - } - // // 根据caseLogId查询案件记录附件表 - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setCaseLogId(caseApplicationLog.getCaseLogId()); - caseApplication.setAnnexType(2); - List attachLogList = caseAttachLogMapper.queryCaseAttachList(caseApplication); - // 更新记录附件表 - if(CollectionUtil.isNotEmpty(attachLogList)){ - for (CaseAttach caseAttach : attachLogList) { - caseAttach.setCaseAppliId(vo.getCaseId()); - caseAttachMapper.updateCaseAttach(caseAttach); - } - } - // 根据caseLogId查询自定义字段表 - List columnValueList = columnValueLogMapper.listBycaseAppliLogId(caseApplicationLog.getCaseLogId()); - - // 更新相关人员主表 - if(CollectionUtil.isNotEmpty(columnValueList)){ - for (ColumnValue columnValue : columnValueList) { - columnValue.setCaseAppliLogId(vo.getCaseId()); - - } - columnValueLogMapper.batchUpdate(columnValueList); - } - } -} 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 deleted file mode 100644 index 7005ca1..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ /dev/null @@ -1,3703 +0,0 @@ -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.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; - -import com.ruoyi.common.annotation.DataScope; -import com.ruoyi.common.constant.CaseApplicationConstants; -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.enums.UpdateSubmitStatus; -import com.ruoyi.common.exception.EsignDemoException; -import com.ruoyi.common.exception.ServiceException; -import com.ruoyi.common.utils.*; -import com.ruoyi.common.utils.file.SaaSAPIFileUtils; -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.*; -import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO; -import com.ruoyi.wisdomarbitrate.mapper.*; -import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; -import com.ruoyi.wisdomarbitrate.utils.SignAward; -import com.ruoyi.wisdomarbitrate.utils.UnZipFileUtils; -import com.ruoyi.wisdomarbitrate.utils.ZipFileUtils; -import com.tencentyun.TLSSigAPIv2; - -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.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.function.Function; -import java.util.regex.Pattern; -import java.util.stream.Collectors; -import java.util.zip.ZipOutputStream; - -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; -import static com.ruoyi.common.utils.SecurityUtils.getLoginUser; -import static com.ruoyi.common.utils.SecurityUtils.getUsername; -import static com.ruoyi.wisdomarbitrate.utils.CaseLogUtils.insertCaseLog; - - -@Service -public class CaseApplicationServiceImpl implements ICaseApplicationService { - // 腾讯云即时通信sdkAppId - @Value("${imConfig.sdkAppId}") - private long sdkAppId; - // 腾讯云即时通信密钥 - @Value("${imConfig.sdkSecretKey}") - private String sdkSecretKey; - @Autowired - private CaseApplicationMapper caseApplicationMapper; - - @Autowired - private CaseAffiliateMapper caseAffiliateMapper; - - @Autowired - private ArbitrateRecordMapper arbitrateRecordMapper; - @Autowired - private ICaseApplicationService caseApplicationService; - @Autowired - private CaseAttachMapper caseAttachMapper; - @Autowired - private SysDeptMapper sysDeptMapper; - @Autowired - private SysUserMapper sysUserMapper; - @Autowired - private SysUserRoleMapper userRoleMapper; - @Autowired - private SysRoleMapper roleMapper; - @Autowired - private SealSignRecordMapper sealSignRecordMapper; - @Autowired - private CaseLogRecordMapper caseLogRecordMapper; - @Autowired - private CaseEvidenceDirectoryMapper caseEvidenceDirectoryMapper; - @Autowired - private SmsRecordMapper smsRecordMapper; - @Autowired - private DeptIdentifyMapper deptIdentifyMapper; - @Autowired - private ReservedConferenceMapper reservedConferenceMapper; - - @Autowired - private SealManageMapper sealManageMapper; - @Autowired - private CaseApplicationLogMapper caseApplicationLogMapper; - @Autowired - private CaseAffiliateLogMapper caseAffiliateLogMapper; - @Autowired - private CaseAttachLogMapper caseAttachLogMapper; - - @Autowired - private ColumnValueMapper columnValueMapper; - @Autowired - private ColumnValueLogMapper columnValueLogMapper; - - @Autowired - private CaseZipImportImpl caseZipImportImpl; - // 手机号正则 - 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[] 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[] dectborAffiliateColumns = {"name", "identityNum","contactTelphone","contactAddress","workTelphone","workAddress", - "residenAffili","responSex","responBirth","email","nameAgent", "identityNumAgent","contactTelphoneAgent","contactAddressAgent"}; - - /** - * 数据权限:1.每个人不同的角色,而每个角色可以操作不同的案件状态 - * 2.申请人:金融机构下,可以看到改机构的所有的案件 - * 3.被申请人:可以看到自己相关的案件(案件有被申请人相关的信息) - * 4.仲裁员:案件选定了某个仲裁员后,该仲裁员就可以查看该案件 - * 5.仲裁委(部门长):可以查看所有的案件 - * 6.法律顾问秘书:可以属于多个机构,可以查看相关机构的所有案件 - * 7.超级管理员:可以查看所有的信息和数据 - * - * @param caseApplication - * @return - */ - @Override - public List selectCaseApplicationListByRole(CaseApplication caseApplication) { - // 获取登录用户 - LoginUser loginUser = getLoginUser(); - SysUser user = loginUser.getUser(); - Long userId = user.getUserId(); - // 查询登录人身份证号 - SysUser sysUser = sysUserMapper.selectUserById(userId); - startPage(); - caseApplication.setLoginUserName(sysUser.getUserName()); - 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.selectAdminCaseApplicationList(caseApplication); - if(caseApplicationlist!=null&&caseApplicationlist.size()>0){ - for(CaseApplication caseApplicationsel : caseApplicationlist){ - Integer caseStatus = caseApplicationsel.getCaseStatus(); - if(caseStatus.intValue() == CaseApplicationConstants.CHECK_ARBITRATION_METHOD){ - Integer applicantIsWrittenHear = caseApplicationsel.getApplicantIsWrittenHear(); - Integer respondentIsWrittenHear = caseApplicationsel.getRespondentIsWrittenHear(); - if(applicantIsWrittenHear!=null&&respondentIsWrittenHear!=null){ - if(applicantIsWrittenHear.intValue()==respondentIsWrittenHear.intValue()){ - caseApplicationsel.setArbitraMethodIssame(1); - if(applicantIsWrittenHear.intValue()==1&&respondentIsWrittenHear.intValue()==1){ - caseApplicationsel.setArbitratMethod(2); - }else { - caseApplicationsel.setArbitratMethod(1); - } - }else { - caseApplicationsel.setArbitraMethodIssame(2); - String applicantarbitratMethod = ""; - String respondentbitratMethod = ""; - if(applicantIsWrittenHear.intValue()==1){ - applicantarbitratMethod = "书面审理"; - }else { - applicantarbitratMethod = "开庭审理"; - } - if(respondentIsWrittenHear.intValue()==1){ - respondentbitratMethod = "书面审理"; - }else { - respondentbitratMethod = "开庭审理"; - } - String arbitratMethodIllustrate = "当前案件开庭方式:申请人选择开庭方式为"+applicantarbitratMethod+ - "被申请人选择开庭方式为"+respondentbitratMethod+",请确定开庭方式。"; - caseApplicationsel.setArbitratMethodIllustrate(arbitratMethodIllustrate); - } - } - - } - } - } - 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); - } - } - - - // 根据条件查询申请人,被申请人,仲裁员,法律顾问案件 -// return caseApplicationMapper.selectCaseApplicationList(caseApplication); - List caseApplications = caseApplicationMapper.selectCaseApplicationList1(caseApplication); - if(caseApplications!=null&&caseApplications.size()>0){ - for(CaseApplication caseApplicationsel : caseApplications){ - Integer caseStatus = caseApplicationsel.getCaseStatus(); - if(caseStatus.intValue() == CaseApplicationConstants.CHECK_ARBITRATION_METHOD){ - Integer applicantIsWrittenHear = caseApplicationsel.getApplicantIsWrittenHear(); - Integer respondentIsWrittenHear = caseApplicationsel.getRespondentIsWrittenHear(); - if(applicantIsWrittenHear!=null&&respondentIsWrittenHear!=null){ - if(applicantIsWrittenHear.intValue()==respondentIsWrittenHear.intValue()){ - caseApplicationsel.setArbitraMethodIssame(1); - if(applicantIsWrittenHear.intValue()==1&&respondentIsWrittenHear.intValue()==1){ - caseApplicationsel.setArbitratMethod(2); - }else { - caseApplicationsel.setArbitratMethod(1); - } - }else { - caseApplicationsel.setArbitraMethodIssame(2); - String applicantarbitratMethod = ""; - String respondentbitratMethod = ""; - if(applicantIsWrittenHear.intValue()==1){ - applicantarbitratMethod = "书面审理"; - }else { - applicantarbitratMethod = "开庭审理"; - } - if(respondentIsWrittenHear.intValue()==1){ - respondentbitratMethod = "书面审理"; - }else { - respondentbitratMethod = "开庭审理"; - } - String arbitratMethodIllustrate = "当前案件开庭方式:申请人选择开庭方式为"+applicantarbitratMethod+ - "被申请人选择开庭方式为"+respondentbitratMethod+",请确定开庭方式。"; - caseApplicationsel.setArbitratMethodIllustrate(arbitratMethodIllustrate); - } - } - - } - } - } - return caseApplications; - - } - - - @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; - } - // 超级管理员和仲裁委(部门长)案件,可查看所有案件 √ - 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; - } - - @Override - 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 recordsnofinish = getNofinishCasenode(caseStatus); - records.addAll(recordsnofinish); - datas.put("allCasenode", records); - datas.put("caseStatus", caseStatus); - return success(datas); - - } - - @Override - @Transactional - public int updateHeardate(CaseApplication caseApplication) { -// caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR); - caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR); - int rows = caseApplicationMapper.submitCaseApplication(caseApplication); - //1975139 修改开庭时间通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已改为{3},请知晓,如非本人操作,请忽略本短信 - //发送短信通知 - SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - request.setTemplateId("1975139"); - - // 发送开庭日期通知短信 - sendHearDateMessage(caseApplication, request, "1975139"); - // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_OPENCOURT_HEAR, ""); - return rows; - } - - @Override - public int updateCaseLockStatus(CaseApplication caseApplication) { - return caseApplicationMapper.updateCaseLockStatus(caseApplication.getId(), caseApplication.getLockStatus()); - } - - - - @Override - @Transactional - public AjaxResult uploadZipFile(MultipartFile file, Long id, String username, Long userId) { - if (file.isEmpty()) { - return AjaxResult.error("请选择要上传的文件"); - } - - String targetPath = "/home/ruoyi/uploadPath/upload/unzipFile"; - File zipFile = null; - InputStream ins = null; - try { - ins = file.getInputStream(); - zipFile = new File(file.getOriginalFilename()); - caseZipImportImpl.inputChangeToFile(ins, zipFile); - } catch (IOException e) { - e.printStackTrace(); - } - //解压缩上传的压缩包 - UnZipFileUtils.unZipFile(zipFile, targetPath); - - //得到解压缩的所有文件 - String zipName = file.getOriginalFilename(); - String subzipName = zipName.substring(0, zipName.indexOf(".zip")); - // todo - String zipPath = "/home/ruoyi/uploadPath/upload/unzipFile/" + subzipName; -// String zipPath = "D:/home/ruoyi/uploadPath/upload/unzipFile/" + subzipName; - - File dirUnzipPath = new File(zipPath); - List allFiles = new ArrayList<>(); - List allFilestr = new ArrayList<>(); - UnZipFileUtils.getFiles(dirUnzipPath, allFiles); - if (allFiles != null && allFiles.size() > 0) { - for (File fileIter : allFiles) { - System.out.println(fileIter.getAbsolutePath()); - allFilestr.add(fileIter.getAbsolutePath()); - } - } - - //保存目录和文件 - 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); - } - - if (allindex != null && allindex.size() > 0) { - String substrOne = filestr.substring(allindex.get(6) + 1, allindex.get(7)); - Integer series = null; - for (int i = 0; i < allindex.size() - 7; i++) { - String substr = filestr.substring(allindex.get(i + 5) + 1, allindex.get(i + 6)); - series = i + 1; - if (series == 1) { - //查询这个级数的目录是否存在,若不存在,则新建这个目录 - CaseEvidenceDirectory caseEvidenceDirectoryselect = new CaseEvidenceDirectory(); - caseEvidenceDirectoryselect.setCaseId(id); - caseEvidenceDirectoryselect.setEvidenceName(filestr.substring(allindex.get(i + 5) + 1, allindex.get(i + 6))); - caseEvidenceDirectoryselect.setSeries(series); - List caseEvidenceDirectorys = caseEvidenceDirectoryMapper.selectList(caseEvidenceDirectoryselect); - if (caseEvidenceDirectorys != null && caseEvidenceDirectorys.size() > 0) { - continue; - } else { - CaseEvidenceDirectory caseEvidenceDirectory = new CaseEvidenceDirectory(); - caseEvidenceDirectory.setEvidenceName(substr); - caseEvidenceDirectory.setSeries(series); - caseEvidenceDirectory.setCaseId(id); - caseEvidenceDirectory.setCreateBy(username); - caseEvidenceDirectory.setCreateTime(new Date()); - caseEvidenceDirectoryMapper.save(caseEvidenceDirectory); - } - } else { - //查询这个级数的目录是否存在,若不存在,则新建这个目录 - CaseEvidenceDirectory directoryselect = new CaseEvidenceDirectory(); - directoryselect.setCaseId(id); - directoryselect.setEvidenceName(filestr.substring(allindex.get(i + 5) + 1, allindex.get(i + 6))); - directoryselect.setSeries(series); - List evidenceDirectorys = caseEvidenceDirectoryMapper.selectList(directoryselect); - if (evidenceDirectorys != null && evidenceDirectorys.size() > 0) { - continue; - } else { - Long parentId = null; - CaseEvidenceDirectory caseEvidenceDirectoryselect = new CaseEvidenceDirectory(); - caseEvidenceDirectoryselect.setCaseId(id); - caseEvidenceDirectoryselect.setEvidenceName(filestr.substring(allindex.get(i + 4) + 1, allindex.get(i + 5))); - caseEvidenceDirectoryselect.setSeries(series - 1); - List caseEvidenceDirectorys = caseEvidenceDirectoryMapper.selectList(caseEvidenceDirectoryselect); - if (caseEvidenceDirectorys != null && caseEvidenceDirectorys.size() > 0) { - parentId = caseEvidenceDirectorys.get(0).getId(); - } - - CaseEvidenceDirectory caseEvidenceDirectory = new CaseEvidenceDirectory(); - caseEvidenceDirectory.setEvidenceName(substr); - caseEvidenceDirectory.setSeries(series); - caseEvidenceDirectory.setCreateBy(username); - caseEvidenceDirectory.setCreateTime(new Date()); - caseEvidenceDirectory.setCaseId(id); - caseEvidenceDirectory.setParentId(parentId); - caseEvidenceDirectoryMapper.save(caseEvidenceDirectory); - } - - } - } - - //得到最后1级的目录,即文件 - int lastIndex = allindex.get(7); - String substrfile = filestr.substring(lastIndex + 1); - //保存到附件表 - LocalDate now = LocalDate.now(); - String year = Integer.toString(now.getYear()); - 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("-", "") + "_" + substrfile; - String resultFilePath = saveFolderPath + "/" + fileName; - try { - File resultFilePathFile = new File(resultFilePath); - File parentFilePathFile = resultFilePathFile.getParentFile(); - if (!parentFilePathFile.exists()) { - parentFilePathFile.mkdirs(); - } - if (!resultFilePathFile.exists()) { - resultFilePathFile.createNewFile(); - } - - FileInputStream fis = new FileInputStream(new File(filestr)); - FileOutputStream fos = new FileOutputStream(resultFilePathFile); - byte[] btyeBuf = new byte[1024]; - int len = 0; - while ((len = fis.read(btyeBuf)) != -1) { - fos.write(btyeBuf, 0, len); - } - fis.close(); - fos.close(); - - } catch (IOException e) { - AjaxResult.error("文件解压异常", e); - } - - String substrTwo = filestr.substring(allindex.get(6) + 1, allindex.get(7)); - Integer annexType = null; - if ("申请书".equals(substrTwo)) { - annexType = 1; - } 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) - .annexType(annexType) - .build(); - int i = caseAttachMapper.save(caseAttach); - Integer annexId = caseAttach.getAnnexId(); - - //保存到目录表 - Long parentId = null; - CaseEvidenceDirectory caseEvidenceDirectoryselect = new CaseEvidenceDirectory(); - caseEvidenceDirectoryselect.setCaseId(id); - caseEvidenceDirectoryselect.setEvidenceName(filestr.substring(allindex.get(6) + 1, allindex.get(7))); - caseEvidenceDirectoryselect.setSeries(series); - List caseEvidenceDirectorys = caseEvidenceDirectoryMapper.selectList(caseEvidenceDirectoryselect); - if (caseEvidenceDirectorys != null && caseEvidenceDirectorys.size() > 0) { - parentId = caseEvidenceDirectorys.get(0).getId(); - } - - CaseEvidenceDirectory caseEvidenceDirectory = new CaseEvidenceDirectory(); - caseEvidenceDirectory.setEvidenceName(substrfile); - caseEvidenceDirectory.setSeries(series + 1); - caseEvidenceDirectory.setCreateBy(username); - caseEvidenceDirectory.setCreateTime(new Date()); - caseEvidenceDirectory.setAnnexId(annexId); - caseEvidenceDirectory.setCaseId(id); - caseEvidenceDirectory.setParentId(parentId); - - caseEvidenceDirectoryMapper.save(caseEvidenceDirectory); - } - } - } - return success(); - - } - - @Override - public List getSmsSendRecord(SmsSendRecord smsSendRecord) { - return smsRecordMapper.getSmsSendRecord(smsSendRecord); - } - - 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); - - } - - /** - * 新增案件 - * - * @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); - // 设置批号 - - 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; - } - - /** - * 获取自动编码 - * - * @return - */ - - public String generateCaseNum() { - // 自动编码格式 zc+yyyyMMdd+001 - String currentDay = DateUtils.dateTime(); - String caseNum = "zc" + currentDay; - //查询出当天的案件编号的最大值 - Integer maxCaseNum = caseApplicationMapper.selectCaseNumLike(caseNum, caseNum.length()); - if (null == maxCaseNum) { - caseNum = caseNum + "001"; - } else { - maxCaseNum=maxCaseNum+1; - caseNum = caseNum + String.format("%03d", maxCaseNum); - } - return caseNum; - - } - - @Override - public int selectCaseApplicationCount(CaseApplication caseApplication) { - 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()); - // 立案申请状态直接修改主表信息 - 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); - // 异步新增案件日志 - 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(); - } - - - /** - * 组装申请代理人信息 - * - * @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; - } - - /** - * 新增角色为申请人 - * - * @param agentUser - * @param roleId - */ - private void insertAgentUserRole(SysUser agentUser, Long roleId) { - 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); - } - } - - @Override - @Transactional - public int submitCaseApplication(List ids) { - int rows = 0; - // 查询案件信息,做必填校验,校验不通过,提示,不能提交 - StringBuilder errorMsg = new StringBuilder(); - List caseApplications = caseApplicationMapper.listCaseApplicationByIds(ids); - if(CollectionUtil.isNotEmpty(caseApplications)) { - - Map applicationMap = caseApplications.stream().collect(Collectors.toMap(CaseApplication::getId, Function.identity(), (n1, n2) -> n2)); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliateByCaseIds(ids); - // 转换为Map>形式 - Map> caseAffiliateMap = caseAffiliates.stream().collect(Collectors.groupingBy(CaseAffiliate::getCaseAppliId)); - for (Long id : ids) { - // 必填校验 - 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("必填字段未填写,请完善案件信息!"); - } - } - } - } - } - } - } - - CaseApplication application = new CaseApplication(); - application.setId(id); - //提交立案申请 - application.setCaseStatus(CaseApplicationConstants.CASE_CHECK); - rows += caseApplicationMapper.submitCaseApplication(application); - // 新增日志 - insertCaseLog(application.getId(), CaseApplicationConstants.CASE_CHECK, ""); - } - } - return rows; - } - - @Override - @Transactional - public int deletecaseApplicationByIds(List ids) { - // 查出所有的日志id - List logIds= caseApplicationLogMapper.selectLogsByCaseIds(ids); - int rows = caseApplicationMapper.batchDeletecaseApplication(ids); - // 删除日志 - if(CollectionUtil.isNotEmpty(logIds)) { - caseApplicationLogMapper.batchDeleteLog(logIds); - } - return rows; - } - - @Override - public CaseApplication selectCaseApplication(CaseApplication caseApplication) { - CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); - if(caseApplicationselect==null){ - throw new ServiceException("案件不存在"); - } - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(caseApplication.getId()); - - ArbitrateRecord arbitrateRecord = new ArbitrateRecord(); - arbitrateRecord.setCaseAppliId(caseApplication.getId()); - ArbitrateRecord arbitrateRecordselect = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord); - ColumnValue columnValue = new ColumnValue(); - columnValue.setIsDefault(1); - columnValue.setCaseId(caseApplication.getId()); - List columnValueList = columnValueMapper.queryColumnValueList(columnValue); - caseApplicationselect.setColumnValues(columnValueList); - 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); - } - int startIndexnew = annexName.lastIndexOf("/"); - if (startIndexnew != -1) { - String annexNamenew = annexName.substring(startIndexnew + 1); - caseAttach.setAnnexName(annexNamenew); - } - - - } - } - 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()); - } - } - StringBuffer applicantName = new StringBuffer(); - StringBuffer respondentName = new StringBuffer(); - for (int i = 0; i < caseAffiliatListeselect.size(); i++) { - CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i); - int identityType = caseAffiliateselect.getIdentityType(); - if (identityType == 1) { - if (StrUtil.isNotEmpty(caseAffiliateselect.getName()) && deptMap.containsKey(caseAffiliateselect.getName())) { - caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName())); - } - applicantName.append(caseAffiliateselect.getName()).append(","); - ; - } else if (identityType == 2) { - respondentName.append(caseAffiliateselect.getName()).append(","); - } - } - caseApplicationselect.setApplicantName(applicantName.toString()); - caseApplicationselect.setRespondentName(respondentName.toString()); - caseApplicationselect.setCaseAffiliates(caseAffiliatListeselect); - caseApplicationselect.setArbitrateRecord(arbitrateRecordselect); - - } - return caseApplicationselect; - } - - @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(); - - } - - - - - @Override - @Transactional - public int pendTral(CaseApplication caseApplication) { - List arbitrators = caseApplication.getArbitrators(); - int rows = 0; - 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); - caseApplication.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); - rows = caseApplicationMapper.submitCaseApplication(caseApplication); - } - - - return rows; - } - - @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) { - CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); - if(caseApplicationselect==null){ - throw new ServiceException("案件不存在"); - } - String arbitratorId = caseApplicationselect.getArbitratorId(); - String arbitratorName = caseApplicationselect.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(",")); - caseApplication.setArbitratorId(idstr); - caseApplication.setArbitratorName(arbitratorNamestr); - 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); - } - } - // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL, ""); - return rows; - } - - @Override - @Transactional - public int verificationArbitrateRecord(CaseApplication caseApplication) { - // 秘书核验裁决书,流转到待仲裁员审核仲裁文书 - caseApplication.setCaseStatus(CaseApplicationConstants.HEAD_CHECK_ARBITRATION); - int rows = caseApplicationMapper.submitCaseApplication(caseApplication); - ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); - arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); - // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.HEAD_CHECK_ARBITRATION, ""); - return rows; - - } - - /** - * 部门长审核裁决书 - * @param caseApplication - * @return - */ - @Override - @Transactional - public AjaxResult checkArbitrateRecord(CaseApplication caseApplication) { - int rows = 0; - ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); - arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); - Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck(); - if (agreeOrNotCheck!=null&&agreeOrNotCheck.intValue() == 1) {//同意审核 - try { - //获取当前案件的裁决书 - CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplication); - 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 (arbitratorId != null) { - 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(caseApplication.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(); - } - caseApplication.setCaseStatus(CaseApplicationConstants.SIGN_ARBITRATION); - // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.SIGN_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(); - } - // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.HEAD_CHECK_ARBITRATION, notes); - - rows = caseApplicationMapper.submitCaseApplication(caseApplication); - } - - return success(); - } - - /** - * 仲裁员审核裁决书 - * @param caseApplication - * @return - */ - @Override - @Transactional - public AjaxResult arbitratorCheckArbitrateRecord(CaseApplication caseApplication) { - // 同意后状态改为待部门长审核仲裁文书(CHECK_ARBITRATION = 12),拒绝改为待秘书核验仲裁文书(VERPRIF_ARBITRATION = 11) - int rows = 0; - Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck(); - if (agreeOrNotCheck.intValue() == 1) { - caseApplication.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION); - - rows = caseApplicationMapper.submitCaseApplication(caseApplication); - // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION, ""); - } else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核 - ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); - if(arbitrateRecord.getId()!=null){ - arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); - }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(); - } - // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, notes); - } - return success(); - } - - - - @Override - @Transactional - public int submitCaseApplicationCheck(List ids, Integer agreeOrNotCheck,String caseCheckReject) { - //提交立案审查 - int rows = 0; - for (Long id : ids) { - String notes=""; - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(id); - caseApplication.setAgreeOrNotCheck(agreeOrNotCheck); - if (agreeOrNotCheck == 1) {//同意审核 - caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT); - rows += caseApplicationMapper.submitCaseApplication(caseApplication); - // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT, notes); - } else if (agreeOrNotCheck == 2) {//拒绝审核 - notes="驳回立案申请,驳回原因:"+caseCheckReject; - caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); - rows += caseApplicationMapper.submitCaseApplication(caseApplication); - // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, notes); - ArbitrateRecord arbitrateRecordsel = new ArbitrateRecord(); - arbitrateRecordsel.setCaseAppliId(id); - ArbitrateRecord arbitrateRecordnew = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecordsel); - if(arbitrateRecordnew!=null){ - arbitrateRecordnew.setCaseCheckReject(caseCheckReject); - arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecordnew); - }else { - arbitrateRecordsel.setCaseCheckReject(caseCheckReject); - arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordsel); - } - //发短信给申请人 - 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); - 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); - - } - - } - } - } - - } - 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; - } - - /** - * 给被申请人发送房间号短信 - * - * @param messageVO - * @return - */ - @Override - public String sendRoomNoMessage(SendRoomNoMessageVO messageVO) { - CaseAffiliate caseAffiliateSelect = new CaseAffiliate(); - caseAffiliateSelect.setCaseAppliId(messageVO.getId()); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliateSelect); - if (CollectionUtil.isEmpty(caseAffiliates)) { - return "申请人、被申请人不存在"; - } - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(messageVO.getId()); - CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); - 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); - } - 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; - } - - @Override - public SealSignRecord selectSignUrl(CaseApplication caseApplication) throws EsignDemoException { - SealSignRecord sealSignRecord = new SealSignRecord(); - sealSignRecord.setCaseAppliId(caseApplication.getId()); - Gson gson = new Gson(); - List sealSignRecords = sealSignRecordMapper.selectSealSignRecord(sealSignRecord); - SealSignRecord sealSignRecordReslt = new SealSignRecord(); - if (sealSignRecords != null && sealSignRecords.size() > 0) { - SealSignRecord sealSignRecordselect = sealSignRecords.get(0); - EsignHttpResponse signUrl = SignAward.signUrl(sealSignRecordselect); - JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class); - JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data"); - String url = signUrlData.get("url").getAsString(); - sealSignRecordReslt.setSignUrl(url); - } - - return sealSignRecordReslt; - } - - @Override - public SealSignRecord selectSealUrl(CaseApplication caseApplication) throws EsignDemoException { - SealSignRecord sealSignRecord = new SealSignRecord(); - sealSignRecord.setCaseAppliId(caseApplication.getId()); - Gson gson = new Gson(); - List sealSignRecords = sealSignRecordMapper.selectSealSignRecord(sealSignRecord); - SealSignRecord sealSignRecordReslt = new SealSignRecord(); - if (sealSignRecords != null && sealSignRecords.size() > 0) { - SealSignRecord sealSignRecordselect = sealSignRecords.get(0); - EsignHttpResponse signUrl = SignAward.usesealUrl(sealSignRecordselect); - JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class); - JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data"); - String url = signUrlData.get("url").getAsString(); - sealSignRecordReslt.setSealUrl(url); - } - 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 - public AjaxResult creatTrialRecordnew(ArbitrateRecord arbitrateRecordselect) { - //生成仲裁结果 - CaseApplication caseApplicationupdate = new CaseApplication(); - caseApplicationupdate.setId(arbitrateRecordselect.getCaseAppliId()); - caseApplicationupdate.setIsAbsence(arbitrateRecordselect.getIsAbsence()); - caseApplicationupdate.setAppliIsAbsen(arbitrateRecordselect.getAppliIsAbsen()); - caseApplicationMapper.submitCaseApplication(caseApplicationupdate); - - //先判断案件是否已经提交过仲裁结果 - ArbitrateRecord arbitrateRecordsele = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecordselect); - if (arbitrateRecordsele != null) { - arbitrateRecordselect.setId(arbitrateRecordsele.getId()); - int i = arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecordselect); - } else { - //提交仲裁结果 - int i = arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordselect); - } - return success(); - - } - - @Override - @Transactional - public AjaxResult editCaseApplicationDefineval(CaseApplication caseApplication) { - if(CollectionUtil.isNotEmpty(caseApplication.getColumnValues())) { - for (ColumnValue columnValue : caseApplication.getColumnValues()) { - columnValueMapper.updateColumnValue(columnValue); - } - } - return success(); - } - - @Override - @Transactional - 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); - - 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); - } - - }else { - CaseApplication caseApplicationsel = new CaseApplication(); - caseApplicationsel.setId(caseApplication.getId()); - List annexTypeList = new ArrayList<>(); - annexTypeList.add(1); - annexTypeList.add(2); - annexTypeList.add(3); - annexTypeList.add(6); - annexTypeList.add(7); - annexTypeList.add(9); - annexTypeList.add(11); - caseApplicationsel.setAnnexTypeList(annexTypeList); - 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) { - startIndex += prefix.length(); - - String annexPath = "/uploadPath" + annexName.substring(startIndex); - String path = "/home/ruoyi" + annexPath; - pathList.add(path); - }else if(annexPathsel.contains(annexName)){ - pathList.add(annexPathsel); - } - } - //将案件相关附件压缩zip文件 - if(pathList!=null&&pathList.size()>0){ - 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 saveFolderPath = "D:/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; - String fileName = UUID.randomUUID().toString().replace("-", "") + ".zip"; - File saveFolder = new File(saveFolderPath); - if (!saveFolder.exists()) { - saveFolder.mkdirs(); - } - String zipFileOutPath = saveFolderPath + "/" + fileName; - try { - - 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(); - } - - //保存压缩文件附件 - 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() - .caseAppliId(caseApplication.getId()) - .annexName(saveName) - .annexPath(savePath) - .annexType(12) - .build(); - int i = caseAttachMapper.save(caseAttach); - - 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); - } - - return caseAttach; - - } - } - } - return caseAttach; - } - - @Override - public List selectCaseApplicationListBatchByRole(CaseApplication caseApplication) { - 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()); - 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(",")); - caseApplicationselect.setCaseStatusName(caseStatusName); - } - } - } - - return caseApplicationlist; - } - - @Override - @Transactional - public int submitCaseApplicationBatch(String batchNumber) { - int rows = 0; - CaseApplication caseApplicationsel = new CaseApplication(); - caseApplicationsel.setBatchNumber(Integer.parseInt(batchNumber)); - caseApplicationsel.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); - List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); - List ids = caseApplications.stream().map(CaseApplication::getId).collect(Collectors.toList()); - if(caseApplications!=null&&caseApplications.size()>0){ - Map applicationMap = caseApplications.stream().collect(Collectors.toMap(CaseApplication::getId, Function.identity(), (n1, n2) -> n2)); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliateByCaseIds(ids); - // 转换为Map>形式 - Map> caseAffiliateMap = caseAffiliates.stream().collect(Collectors.groupingBy(CaseAffiliate::getCaseAppliId)); - for (Long id : ids) { - // 查询案件信息,做必填校验,校验不通过,提示,不能提交 - StringBuilder errorMsg = new StringBuilder(); - // 必填校验 - CaseApplication caseApplication = applicationMap.get(id); - String caseNum = caseApplication.getCaseNum(); - // 基本字段校验 - if(caseApplication!=null) { - for (String baseColumn : baseColumns) { - if(StrUtil.isEmpty( ObjectFieldUtils.getValue(caseApplication, baseColumn))){ - errorMsg.append(getColumnstr(baseColumn)).append("不能为空,"); -// 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(getColumnstr(applicAffiliateColumn)).append("不能为空,"); -// throw new ServiceException("必填字段未填写,请完善案件信息!"); - } - } - }else { - // 校验被申请人 - for (String applicAffiliateColumn : dectborAffiliateColumns) { - if(StrUtil.isEmpty( ObjectFieldUtils.getValue(caseAffiliate, applicAffiliateColumn))){ - errorMsg.append(getColumnstr(applicAffiliateColumn)).append("不能为空,"); -// throw new ServiceException("必填字段未填写,请完善案件信息!"); - } - } - } - } - } - } - } - if(StringUtils.isNotEmpty(errorMsg.toString())){ - throw new ServiceException("案件编号" + caseNum + errorMsg.toString()+"请完善案件信息!"); - } - - CaseApplication application = new CaseApplication(); - application.setId(id); - //提交立案申请 - application.setCaseStatus(CaseApplicationConstants.CASE_CHECK); - rows += caseApplicationMapper.submitCaseApplication(application); - // 新增日志 - insertCaseLog(application.getId(), CaseApplicationConstants.CASE_CHECK, ""); - } - - }else{ - throw new ServiceException("这个批号没有批量提交的案件"); - } - - return rows; - } - - @Override - @Transactional - public int 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()); - if(caseApplications!=null&&caseApplications.size()>0){ - for (Long id : ids) { - String notes=""; - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(id); - caseApplication.setAgreeOrNotCheck(agreeOrNotCheck); - if (agreeOrNotCheck == 1) { - //同意审核 - caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT); - rows += caseApplicationMapper.submitCaseApplication(caseApplication); - // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT, notes); - } else if (agreeOrNotCheck == 2) { - //拒绝审核 - notes="驳回立案申请,驳回原因:"+caseCheckReject; - caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); - rows += caseApplicationMapper.submitCaseApplication(caseApplication); - // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, notes); - ArbitrateRecord arbitrateRecordsel = new ArbitrateRecord(); - arbitrateRecordsel.setCaseAppliId(id); - ArbitrateRecord arbitrateRecordnew = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecordsel); - if(arbitrateRecordnew!=null){ - arbitrateRecordnew.setCaseCheckReject(caseCheckReject); - arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecordnew); - }else { - arbitrateRecordsel.setCaseCheckReject(caseCheckReject); - arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordsel); - } - //发短信给申请人 - 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); - 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); - - } - - } - } - } - } - }else{ - throw new ServiceException("这个批号没有批量审查的案件"); - } - return rows; - } - - @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){ - //同意组庭 - 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, ""); - - } - }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){ - caseApplicationse.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION_METHOD); - caseApplicationse.setIsAgreePendTral(isAgreePendTral); - if (isAgreePendTral != null && isAgreePendTral == 1) { - 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); - rows += caseApplicationMapper.submitCaseApplication(caseApplicationse); - } - } - - SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - request.setTemplateId("2033619"); - sendHearDateMessage(caseApplicationse, request, "2033619"); - // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION_METHOD, ""); - - } - }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){ - // 秘书核验裁决书,流转到待仲裁员审核仲裁文书 - caseApplicationse.setCaseStatus(CaseApplicationConstants.HEAD_CHECK_ARBITRATION); - rows += caseApplicationMapper.submitCaseApplication(caseApplicationse); -// ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); -// arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); - // 新增日志 - insertCaseLog(caseApplicationse.getId(), CaseApplicationConstants.HEAD_CHECK_ARBITRATION, ""); - } - }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(CaseApplicationConstants.HEAD_CHECK_ARBITRATION); - List caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); - if (caseApplications1 != null && caseApplications1.size() > 0) { - for(CaseApplication caseApplicationse:caseApplications1){ - if (agreeOrNotCheck.intValue() == 1) { - caseApplicationse.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION); - - rows += caseApplicationMapper.submitCaseApplication(caseApplicationse); - // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION, ""); - } else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核 - ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); - ArbitrateRecord arbitrateRecordnew = caseApplicationse.getArbitrateRecord(); - if(arbitrateRecordnew!=null){ - arbitrateRecordnew.setCheckOpinion(arbitrateRecord.getCheckOpinion()); - arbitrateRecordnew.setArbitrateReject(arbitrateRecord.getArbitrateReject()); - arbitrateRecordnew.setCaseAppliId(caseApplicationse.getId()); - arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecordnew); - }else { - ArbitrateRecord arbitrateRecordnew1 = new ArbitrateRecord(); - arbitrateRecordnew1.setCheckOpinion(arbitrateRecord.getCheckOpinion()); - arbitrateRecordnew1.setArbitrateReject(arbitrateRecord.getArbitrateReject()); - arbitrateRecordnew1.setCaseAppliId(caseApplicationse.getId()); - arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordnew1); - } - caseApplicationse.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION); - - rows += caseApplicationMapper.submitCaseApplication(caseApplicationse); - String notes=""; - if(caseApplication.getArbitrateRecord()!=null&&StrUtil.isNotEmpty(caseApplication.getArbitrateRecord().getArbitrateReject())){ - notes="仲裁员驳回仲裁文书,驳回原因:"+caseApplication.getArbitrateRecord().getArbitrateReject(); - } - // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, notes); - } - } - - }else{ - throw new ServiceException("这个批号没有批量仲裁员审核裁决书的案件"); - } - - return success(rows); - } - - @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){ - 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 (arbitratorId != null) { - 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.SIGN_ARBITRATION, ""); - rows += caseApplicationMapper.submitCaseApplication(caseApplicationse); - } else if (agreeOrNotCheck.intValue() == 2) { - caseApplicationse.setCaseStatus(CaseApplicationConstants.HEAD_CHECK_ARBITRATION); - String notes=""; - if(caseApplication.getArbitrateRecord()!=null&&StrUtil.isNotEmpty(caseApplication.getArbitrateRecord().getDeptorReject())){ - notes="部门长驳回仲裁文书,驳回原因:"+caseApplication.getArbitrateRecord().getDeptorReject(); - } - // 新增日志 - insertCaseLog(caseApplicationse.getId(), CaseApplicationConstants.HEAD_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 - public CaseApplication selectSignSealUrl(CaseApplication caseApplication) throws EsignDemoException { - Gson gson = new Gson(); - SealSignRecord sealSignRecord = new SealSignRecord(); - sealSignRecord.setCaseAppliId(caseApplication.getId()); - List sealSignRecords = sealSignRecordMapper.selectSealSignRecord(sealSignRecord); - if (sealSignRecords != null && sealSignRecords.size() > 0) { - String signFlowid = sealSignRecords.get(0).getSignFlowid(); - 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(); - String filearbitraUrl = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1); - caseApplication.setFilearbitraUrl(filearbitraUrl); - } - } - - return caseApplication; - } - - - @Override - @Transactional - public int pendTralSure(CaseApplication caseApplication) { -// caseApplication.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION_METHOD); - - caseApplication.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION_METHOD); - Integer isAgreePendTral = caseApplication.getIsAgreePendTral(); - 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); - } - } - - //发送短信通知 1947342 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 - SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - request.setTemplateId("2033619"); - // 发送开庭日期通知短信 - sendHearDateMessage(caseApplication, request, "2033619"); - // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, ""); - - return rows; - - } - - /** - * 发送开庭日期通知短信 - * - * @param caseApplication - * @param request - */ - private void sendHearDateMessage(CaseApplication caseApplication, SmsUtils.SendSmsRequest request, String templateId) { - CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); - - String caseNum = caseApplicationselect.getCaseNum(); - Date hearDate = caseApplicationselect.getHearDate(); - String hearDatestr = ""; - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - if(hearDate!=null) { - hearDatestr = dateFormat.format(hearDate); - } - String arbitratorId = caseApplicationselect.getArbitratorId(); -// List arbitratorList = new ArrayList<>(); - if (StringUtils.isNotEmpty(arbitratorId)) { - String[] idStrList = arbitratorId.split(","); - List idList = new ArrayList<>(); - for (int i = 0; i < idStrList.length; i++) { - idList.add(Long.parseLong(idStrList[i])); - } - // 查询仲裁员电话号 - 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(); - if (templateId.equals("2033619")) { - request.setTemplateParamSet(new String[]{name, caseNum}); - } - if (templateId.equals("1975139")) { - 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("2033619")) { - content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,已组庭,请知晓,如非本人操作,请忽略本短信。"; - } - if (templateId.equals("1975139")) { - content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,开庭日期已改为" + 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()); - // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 - String name = caseAffiliateselect.getName(); - if (templateId.equals("2033619")) { - request.setTemplateParamSet(new String[]{name, caseNum}); - } - if (templateId.equals("1975139")) { - 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 = ""; - if (templateId.equals("2033619")) { - content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,已组庭,请知晓,如非本人操作,请忽略本短信。"; - } - if (templateId.equals("1975139")) { - content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,开庭日期已改为" + hearDatestr + ",请知晓,如非本人操作,请忽略本短信。"; - } - smsSendRecord.setSendContent(content); - smsSendRecord.setCreateBy(getUsername()); - if (aBoolean) { - smsSendRecord.setSendStatus(1); - } else { - smsSendRecord.setSendStatus(0); - } - smsRecordMapper.saveSmsSendRecord(smsSendRecord); - } - } - } - - - @Override - @Transactional - public int pendingAppointArbotrar(CaseApplication caseApplication) { - int pendingAppointArbotrar = caseApplication.getPendingAppointArbotrar(); - List arbitrators = caseApplication.getArbitrators(); - int rows = 0; - if (pendingAppointArbotrar == 1) { - 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); - caseApplication.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); - caseApplication.setPendingAppointArbotrar(1); - rows = caseApplicationMapper.submitCaseApplication(caseApplication); - } - - } else { - caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_TRIAL); - caseApplication.setPendingAppointArbotrar(2); - rows = caseApplicationMapper.submitCaseApplication(caseApplication); - - } - - return rows; - - } - - - 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(); - caseAffiliate.setCaseAppliId(caseApplication.getId()); - caseAffiliate.setIdentityType(1); - caseAffiliate.setName(caseApplication.getName()); - caseAffiliate.setIdentityNum(caseApplication.getIdentityNum()); - caseAffiliate.setContactTelphone(caseApplication.getContactTelphone()); - caseAffiliate.setContactAddress(caseApplication.getContactAddress()); - caseAffiliate.setWorkTelphone(caseApplication.getWorkTelphone()); - caseAffiliate.setWorkAddress(caseApplication.getWorkAddress()); - caseAffiliate.setNameAgent(caseApplication.getNameAgent()); - caseAffiliate.setIdentityNumAgent(caseApplication.getIdentityNumAgent()); - caseAffiliate.setContactTelphoneAgent(caseApplication.getContactTelphoneAgent()); - caseAffiliate.setContactAddressAgent(caseApplication.getContactAddressAgent()); - caseAffiliate.setCompLegalperPost(caseApplication.getCompLegalperPost()); - caseAffiliate.setCompLegalPerson(caseApplication.getCompLegalPerson()); - - caseAffiliate.setResidenAffili(caseApplication.getResidenAffiliAppli()); - caseAffiliate.setAppliAgentTitle(caseApplication.getAppliAgentTitle()); - caseAffiliate.setEmail(caseApplication.getEmail()); - return caseAffiliate; - - - } - - /** - * 设置申请人的组织机构 - * - * @param caseAffiliate - * @param caseApplication - */ - @DataScope(deptAlias = "d") - private void setApplicantOrganization(CaseAffiliate caseAffiliate, CaseApplication caseApplication, Map deptMap) { - - - // 将组织机构id设为申请人名称 - if (deptMap.containsKey(caseApplication.getName())) { - caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseApplication.getName()))); - caseAffiliate.setApplicationOrganName(caseApplication.getName()); - } else { - // 如果不存在则新增 - SysDept dept = new SysDept(); - dept.setParentId(0L); - dept.setDeptName(caseApplication.getName()); - dept.setAncestors("0"); - dept.setOrderNum(1); - dept.setStatus("0"); - dept.setDelFlag("0"); - dept.setCreateBy(getUsername()); - dept.setUpdateBy(getUsername()); - sysDeptMapper.insertDept(dept); - deptMap.put(dept.getDeptName(), dept.getDeptId()); - caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId())); - caseAffiliate.setApplicationOrganName(caseApplication.getName()); - - } - - } - - /** - * 组装被申请人信息 - * - * @param caseApplication - * @return - */ - - private CaseAffiliate buildDebtorInfo(CaseApplication caseApplication) { - // 被申请人信息 - CaseAffiliate debtorCaseAffiliate = new CaseAffiliate(); - debtorCaseAffiliate.setCaseAppliId(caseApplication.getId()); - debtorCaseAffiliate.setIdentityType(2); - debtorCaseAffiliate.setName(caseApplication.getDebtorName()); - debtorCaseAffiliate.setIdentityNum(caseApplication.getDebtorIdentityNum()); - debtorCaseAffiliate.setContactTelphone(caseApplication.getDebtorContactTelphone()); - debtorCaseAffiliate.setContactAddress(caseApplication.getDebtorContactAddress()); - debtorCaseAffiliate.setWorkTelphone(caseApplication.getDebtorWorkTelphone()); - debtorCaseAffiliate.setWorkAddress(caseApplication.getDebtorWorkAddress()); - debtorCaseAffiliate.setNameAgent(caseApplication.getDebtorNameAgent()); - debtorCaseAffiliate.setIdentityNumAgent(caseApplication.getDebtorIdentityNumAgent()); - debtorCaseAffiliate.setContactTelphoneAgent(caseApplication.getDebtorContactTelphoneAgent()); - debtorCaseAffiliate.setContactAddressAgent(caseApplication.getDebtorContactAddressAgent()); - debtorCaseAffiliate.setResponSex(caseApplication.getResponSex()); - debtorCaseAffiliate.setResponBirth(caseApplication.getResponBirth()); - debtorCaseAffiliate.setResidenAffili(caseApplication.getResidenAffiliRespon()); - debtorCaseAffiliate.setEmail(caseApplication.getDebtorEmail()); - - return debtorCaseAffiliate; - } - - private void copyCaseApplication(CaseApplication caseApplicationinsertDiffer, CaseApplication caseApplicationNew) { - caseApplicationNew.setArbitratClaims(caseApplicationinsertDiffer.getArbitratClaims()); - caseApplicationNew.setCaseNum(caseApplicationinsertDiffer.getCaseNum()); - caseApplicationNew.setCaseName(caseApplicationinsertDiffer.getCaseName()); - caseApplicationNew.setCaseSubjectAmount(caseApplicationinsertDiffer.getCaseSubjectAmount()); - caseApplicationNew.setLoanStartDate(caseApplicationinsertDiffer.getLoanStartDate()); - caseApplicationNew.setLoanEndDate(caseApplicationinsertDiffer.getLoanEndDate()); - caseApplicationNew.setContractNumber(caseApplicationinsertDiffer.getContractNumber()); - caseApplicationNew.setClaimInterestOwed(caseApplicationinsertDiffer.getClaimInterestOwed()); - caseApplicationNew.setClaimPrinciOwed(caseApplicationinsertDiffer.getClaimPrinciOwed()); - caseApplicationNew.setClaimLiquidDamag(caseApplicationinsertDiffer.getClaimLiquidDamag()); - caseApplicationNew.setFeePayable(caseApplicationinsertDiffer.getFeePayable()); - caseApplicationNew.setRequestRule(caseApplicationinsertDiffer.getRequestRule()); - caseApplicationNew.setProperPreser(caseApplicationinsertDiffer.getProperPreser()); - } - - - /** - * 获取userSign,默认过期时间10小时 - * - * @param userId - * @return - */ - @Override - public String generateUserSign(String userId) { - TLSSigAPIv2 tlsSigAPIv2 = new TLSSigAPIv2(sdkAppId, sdkSecretKey); - return tlsSigAPIv2.genUserSig(userId, 60 * 60 * 10); - } - - - /** - * 预约会议 - * - * @param reservedConferenceVO - * @return - * @throws Exception - */ - @Transactional - @Override - public AjaxResult reservedConference(ReservedConferenceVO reservedConferenceVO) { - - // 新增预约会议表 - ReservedConference conference = new ReservedConference(reservedConferenceVO.getCaseId(), SecurityUtils.getUserId(), reservedConferenceVO.getRoomId(), - reservedConferenceVO.getScheduleStartTime(), reservedConferenceVO.getScheduleEndTime()); - - reservedConferenceMapper.insert(conference); - return success("预约会议成功"); - } - - - /** - * 生成房间号 - */ - @Transactional - @Override - public long createRoomId(Long caseId) { - long roomId = generateRoomId(); - // 绑定案件与房间号 - caseApplicationMapper.bindCaseId(caseId, String.valueOf(roomId)); - return roomId; - } - - /** - * 获取房间号 - * - * @return - */ - public Long generateRoomId() { - // 查询最大房间号 - Long maxRoomId = caseApplicationMapper.selectMaxRoomId(); - - if (null == maxRoomId || maxRoomId > 4294967294L) { - return 1L; - } else { - return maxRoomId + 1; - } - - } - - /** - * 根据案件id查询已预约的会议 - * - * @param caseId - * @return - */ - @Override - @Transactional - public List reserveConferenceList(Long caseId) { - List reservedConferences = reservedConferenceMapper.selectListByCaseId(caseId); - if (CollectionUtil.isEmpty(reservedConferences)) { - return reservedConferences; - } - Map userIdMap = null; - List userIds = reservedConferences.stream().map(ReservedConference::getUserId).collect(Collectors.toList()); - if (CollectionUtil.isNotEmpty(userIds)) { - // 根据userids查询用户名 - List userList = sysUserMapper.selectUserListByIds(userIds); - if (CollectionUtil.isNotEmpty(userList)) { - userIdMap = userList.stream().collect(Collectors.toMap(SysUser::getUserId, SysUser::getUserName)); - } - } - for (ReservedConference reservedConference : reservedConferences) { - if (null != reservedConference.getUserId() && null != userIdMap) { - reservedConference.setUserName(userIdMap.get(reservedConference.getUserId())); - } - Date startTime = reservedConference.getScheduleStartTime(); - if (null == startTime) { - continue; - } - long beforeMinutes = startTime.getTime() - 1000 * 60 * 5; - if (System.currentTimeMillis() < beforeMinutes) { - reservedConference.setIsBeforeFiveMinutes(true); - } else { - reservedConference.setIsBeforeFiveMinutes(false); - } - } - - - return reservedConferences; - } - - /** - * 删除房间号 - * - * @param roomId - * @return - */ - @Override - public AjaxResult deleteRoom(String roomId) { - - return success(reservedConferenceMapper.deleteByRoomId(roomId)); - } - @Transactional - @Override - public AjaxResult uploadCaseZipFile(MultipartFile file, Long templateId) { - return caseZipImportImpl.zipImport( file, templateId); - } - - - - /** - * 根据附件id修改案件id - * @param caseAttach - * @return - */ - @Override - public AjaxResult updateCaseIdByAnnexId(CaseAttach caseAttach) { - caseAttachMapper.updateCaseAttach(caseAttach); - return success(); - } - - -} - - - 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 deleted file mode 100644 index 0aa082a..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java +++ /dev/null @@ -1,533 +0,0 @@ -package com.ruoyi.wisdomarbitrate.service.impl; - -import cn.hutool.core.collection.CollectionUtil; -import com.deepoove.poi.data.PictureRenderData; -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.wisdomarbitrate.domain.*; -import com.ruoyi.wisdomarbitrate.mapper.*; -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.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; - -@Service -public class CaseArbitrateServiceImpl implements ICaseArbitrateService { - @Autowired - private CaseApplicationMapper caseApplicationMapper; - @Autowired - private CaseAffiliateMapper caseAffiliateMapper; - @Autowired - private CaseLogRecordMapper caseLogRecordMapper; - @Autowired - private ArbitrateRecordMapper arbitrateRecordMapper; - @Autowired - private CaseAttachMapper caseAttachMapper; - @Autowired - private SmsRecordMapper smsRecordMapper; - @Autowired - private IAdjudicationService adjudicationService; - @Autowired - private RedisCache redisCache; - @Autowired - private ICaseApplicationService caseApplicationService; - - @Override - @Transactional - public AjaxResult examineArbitrateMethod(CaseApplication caseApplication, Integer opinion, Integer arbitratMethodNow) { - //查询案件详细信息 - CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); - if (caseApplication1 == null) { - return AjaxResult.success(); - } - Integer arbitratMethodOriral = caseApplication.getArbitratMethod(); - - String caseNum = caseApplication1.getCaseNum(); - if (opinion == 0) { //拒绝 - 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 (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); - //修改案件状态为待修改开庭时间 -// caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE); - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, ""); - - } - }else if (opinion == 2) { - if (arbitratMethodNow == 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); - //修改案件状态为待修改开庭时间 -// caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE); - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, ""); - - } - } - 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); //获取案件关联人信息 - 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); - } - } - - return AjaxResult.success("审核成功"); - } - return AjaxResult.success(); - } - - @Override - @Transactional - public AjaxResult writtenHear(CaseIds caseIds) { - if (caseIds!=null){ - List ids = caseIds.getIds(); - for (Long caseId : ids) { - //查询案件详情 - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(caseId); - CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); - //先判断案件是否已经提交过仲裁结果 - ArbitrateRecord arbitrateRecord = new ArbitrateRecord(); - arbitrateRecord.setCaseAppliId(caseId); - 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); - - } - 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"); - if (awardNum == null) { - redisCache.setCacheObject("awardNum", "00001"); - String s = redisCache.getCacheObject("awardNum").toString(); - // 字符串数字解析为整数 - int no = Integer.parseInt(s); - // 最新设备编号自增1 - int newEquipment = ++no; - // 将整数格式化为5位数字 - s = String.format("%05d", newEquipment); - redisCache.setCacheObject("awardNum", s); - return s; - } else { - String s = awardNum.toString(); - // 字符串数字解析为整数 - int no = Integer.parseInt(s); - // 最新设备编号自增1 - int newEquipment = ++no; - // 将整数格式化为5位数字 - s = String.format("%05d", newEquipment); - redisCache.setCacheObject("awardNum", s); - return s; - } - } -} \ No newline at end of file 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 deleted file mode 100644 index b1694c6..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java +++ /dev/null @@ -1,511 +0,0 @@ -package com.ruoyi.wisdomarbitrate.service.impl; - -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.util.StrUtil; -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.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.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; -import org.springframework.web.multipart.MultipartFile; - -import java.io.IOException; -import java.util.*; -import java.util.stream.Collectors; - -import static com.ruoyi.common.utils.SecurityUtils.getUsername; - -@Service -public class CaseEvidenceServiceImpl implements ICaseEvidenceService { - @Autowired - private CaseEvidenceMapper caseEvidenceMapper; - @Autowired - private CaseAffiliateMapper caseAffiliateMapper; - @Autowired - private CaseApplicationMapper caseApplicationMapper; - @Autowired - private CaseAttachMapper caseAttachMapper; - @Autowired - private CaseEvidenceDirectoryMapper caseEvidenceDirectoryMapper; - @Autowired - private SysUserMapper sysUserMapper; - @Autowired - private SmsRecordMapper smsRecordMapper; - - @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 - public AjaxResult uploadEvidence(MultipartFile file, Integer annexType, Long id, String userName, Long userId) { - - if (file.isEmpty()) { - return AjaxResult.error("请选择要上传的文件"); - } - 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) { - if (id != null) { - //修改案件状态 - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(id); - caseApplication.setCaseStatus(4); - 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); - } catch (IOException e) { - e.printStackTrace(); - } - - return AjaxResult.error("上传失败"); - } - - - @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 AjaxResult evidenceConfirmation(CaseApplication caseApplication) { - caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_TRIAL); - int i = caseApplicationMapper.submitCaseApplication(caseApplication); - if (i > 0) { - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_TRIAL, ""); - - return AjaxResult.success("证据确认成功"); - } - return AjaxResult.error("暂无需要确认的证据"); - } - - @Override - @Transactional - public AjaxResult caseCrossexamination(CaseEvidenceDTO caseEvidenceDTO) { - //查询案件详细信息 - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(caseEvidenceDTO.getCaseId()); - CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); - if (caseApplication1 != null) { - caseApplication1.setAdjudicaCounterReason(caseEvidenceDTO.getAdjudicaCounterReason()); - int caseStatus = caseApplication1.getCaseStatus(); - caseApplication1.setObjectionAddEviden(caseEvidenceDTO.getObjectionAddEviden()); - 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()); - 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(",")); - caseApplication1.setArbitratorId(idstr); - caseApplication1.setArbitratorName(arbitratorNamestr); - } - //修改案件状态 - caseApplication1.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL_SUBMMIT); - - - int i = caseApplicationMapper.submitCaseApplication(caseApplication1); - if (i > 0) { - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL_SUBMMIT, ""); - - return AjaxResult.success("提交成功"); - } - } - return null; - } - - @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); - } - } - - - } catch (IOException e) { - e.printStackTrace(); - return AjaxResult.error("上传失败"); - } - // 给秘书发送短信 - // 根据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)){ - // 新增短信记录 - 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); - } - - } - } - - - return AjaxResult.success("上传成功", successList); - - } - - @Override - public AjaxResult fileList(Long caseAppliId, List annexTypeList) { - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(caseAppliId); - caseApplication.setAnnexTypeList(annexTypeList); - 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); - } - } - return AjaxResult.success(caseAttachList); - } - return null; - } - - @Override - public int deleteFile(List fileIds) { - return caseAttachMapper.deleteByFileIds(fileIds); - } - - @Override - public List selectEvidenceTreeList(CaseEvidenceDirectory caseEvidenceDirectory) { - List caseEvidenceDirectorys = SpringUtils.getAopProxy(this).selectCaseEvidenceList(caseEvidenceDirectory); - return buildCaseEvidenceTreeSelect(caseEvidenceDirectorys); - } - - @Override - public List selectCaseEvidenceList(CaseEvidenceDirectory caseEvidenceDirectory) { - return caseEvidenceDirectoryMapper.selectList(caseEvidenceDirectory); - } - - @Override - public List buildCaseEvidenceTree(List caseEvidenceDirectorys) { - List returnList = new ArrayList<>(); - List tempList = caseEvidenceDirectorys.stream().map(CaseEvidenceDirectory::getId).collect(Collectors.toList()); - for (CaseEvidenceDirectory caseEvidenceDirectory : caseEvidenceDirectorys) { - String annexName = caseEvidenceDirectory.getAnnexName(); - if (annexName!=null){ - String prefix = "/profile"; - int startIndex = annexName.indexOf(prefix); - startIndex += prefix.length(); - String annexPath = "/uploadPath" + annexName.substring(startIndex); - caseEvidenceDirectory.setAnnexPath(annexPath); - int startIndexnew = annexName.lastIndexOf("/"); - if(startIndexnew!=-1){ - String annexNamenew = annexName.substring(startIndexnew+1); - caseEvidenceDirectory.setAnnexName(annexNamenew); - } - } - // 如果是顶级节点, 遍历该父节点的所有子节点 - if (!tempList.contains(caseEvidenceDirectory.getParentId())) { - recursionFn(caseEvidenceDirectorys, caseEvidenceDirectory); - returnList.add(caseEvidenceDirectory); - } - } - if (returnList.isEmpty()) - { - returnList = caseEvidenceDirectorys; - } - return returnList; - } - - @Override - public List buildCaseEvidenceTreeSelect(List caseEvidenceDirectorys) { - List caseEvidenceDirectories = buildCaseEvidenceTree(caseEvidenceDirectorys); - return caseEvidenceDirectories.stream().map(CaseEvidenceDirectoryVO::new).collect(Collectors.toList()); - } - - @Override - @Transactional - public AjaxResult uploadRecord(MultipartFile file, Integer annexType, Long id, String username, Long userId) { - if (file.isEmpty()) { - return AjaxResult.error("请选择要上传的文件"); - } - 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(); - - 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); - } - - return AjaxResult.success("上传成功"); - } catch (IOException e) { - e.printStackTrace(); - } - - return AjaxResult.error("上传失败"); - - } - - /** - * 递归列表 - */ - private void recursionFn(List list, CaseEvidenceDirectory t) { - // 得到子节点列表 - List childList = getChildList(list, t); - t.setChildren(childList); - for (CaseEvidenceDirectory tChild : childList) { - if (hasChild(list, tChild)) { - recursionFn(list, tChild); - } - } - } - - /** - * 得到子节点列表 - */ - private List getChildList(List list, CaseEvidenceDirectory t) { - List tlist = new ArrayList<>(); - Iterator it = list.iterator(); - while (it.hasNext()) { - CaseEvidenceDirectory n = it.next(); - if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getId().longValue()) { - tlist.add(n); - } - } - return tlist; - } - - /** - * 判断是否有子节点 - */ - private boolean hasChild(List list, CaseEvidenceDirectory t) { - 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; - } -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseImportValid.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseImportValid.java deleted file mode 100644 index cff4ad5..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseImportValid.java +++ /dev/null @@ -1,328 +0,0 @@ -package com.ruoyi.wisdomarbitrate.service.impl; - -import cn.hutool.core.util.IdcardUtil; -import cn.hutool.core.util.StrUtil; -import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.common.utils.SpringUtil; -import com.ruoyi.system.mapper.SysUserMapper; -import com.ruoyi.wisdomarbitrate.domain.CaseApplication; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.math.BigDecimal; -import java.util.Date; -import java.util.Map; -import java.util.regex.Pattern; - -/** - * @author wangqiong - * @description excel导入校验 - * @date 2023-12-11 11:45 - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -public class CaseImportValid { - private CaseApplication caseApplication; - private Map deptMap; - // 手机号正则 - 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 SysUserMapper sysUserMapper= SpringUtil.getBean(SysUserMapper.class); - - /** - * 导入校验 - * - * @param caseApplication - * @param - */ - public void importValid(CaseApplication caseApplication, Map deptMap) { - StringBuilder failureMsg = new StringBuilder(); - caseApplication.setErrorMsg(failureMsg); - // 校验基本字段 - validBaseColumn(caseApplication, failureMsg); - // 校验申请人信息 - validApplicationColumn(caseApplication, failureMsg); - // 校验申请人代理信息 - validApplicationAgentColumn(caseApplication, failureMsg, deptMap); - // 校验被申请人信息 - validDebtorApplicationColumn(caseApplication, failureMsg); - // 校验被申请人代理信息 - validDebtorApplicationAgentColumn(caseApplication, failureMsg); - } - - /** - * 校验被申请人代理信息 - * - * @param caseApplication - * @param failureMsg - */ - private void validDebtorApplicationAgentColumn(CaseApplication caseApplication, StringBuilder failureMsg) { - if (StrUtil.isEmpty(caseApplication.getDebtorNameAgent())) { - failureMsg.append("【被申请人主体信息-代理人姓名】字段不能为空;"); - } else if (caseApplication.getDebtorNameAgent().length() > 50) { - failureMsg.append("【被申请人主体信息-代理人姓名】字段超出指定长度,最大长度为50;"); - } - if (StrUtil.isEmpty(caseApplication.getDebtorIdentityNumAgent())) { - failureMsg.append("【被申请人主体信息-代理人身份证号】字段不能为空;"); - } else if (!IdcardUtil.isValidCard((caseApplication.getDebtorIdentityNumAgent()))) { - failureMsg.append("【被申请人主体信息-代理人身份证号】不合法;"); - } - String debtorContactTelphoneAgent = caseApplication.getDebtorContactTelphoneAgent(); - if (StrUtil.isEmpty(debtorContactTelphoneAgent)) { - failureMsg.append("【被申请人主体信息-代理人联系电话】字段不能为空;"); - } else if (!TELEPHONE_REGX.matcher(debtorContactTelphoneAgent).matches()) { - failureMsg.append("【被申请人主体信息-代理人联系电话】字段不合法;"); - } - if (StrUtil.isEmpty(caseApplication.getDebtorContactAddressAgent())) { - failureMsg.append("【被申请人主体信息-代理人联系地址】字段不能为空;"); - } else if (caseApplication.getDebtorContactAddressAgent().length() > 50) { - failureMsg.append("【被申请人主体信息-代理人联系地址】字段超出指定长度,最大长度为50;"); - } - } - - /** - * 校验被申请人信息 - * - * @param caseApplication - * @param failureMsg - */ - private void validDebtorApplicationColumn(CaseApplication caseApplication, StringBuilder failureMsg) { - if (StrUtil.isEmpty(caseApplication.getDebtorName())) { - failureMsg.append("【被申请人主体信息-申请人姓名】字段不能为空;"); - } else if (caseApplication.getDebtorName().length() > 50) { - failureMsg.append("【被申请人主体信息-申请人姓名】字段超出指定长度,最大长度为50;"); - } - if (StrUtil.isEmpty(caseApplication.getDebtorIdentityNum())) { - failureMsg.append("【被申请人主体信息-身份证号】字段不能为空;"); - } else if (!IdcardUtil.isValidCard(caseApplication.getDebtorIdentityNum())) { - failureMsg.append("【被申请人主体信息-身份证号】不合法;"); - } - String debtorContactTelphone = caseApplication.getDebtorContactTelphone(); - if (StrUtil.isEmpty(debtorContactTelphone)) { - failureMsg.append("【被申请人主体信息-联系电话】字段不能为空;"); - } else if (!TELEPHONE_REGX.matcher(debtorContactTelphone).matches()) { - failureMsg.append("【被申请人主体信息-联系电话】字段不合法;"); - } - if (StrUtil.isEmpty(caseApplication.getDebtorContactAddress())) { - failureMsg.append("【被申请人主体信息-联系地址】字段不能为空;"); - } else if (caseApplication.getDebtorContactAddress().length() > 50) { - failureMsg.append("【被申请人主体信息-联系地址】字段超出指定长度,最大长度为50;"); - } - String debtorWorkTelphone = caseApplication.getDebtorWorkTelphone(); - if (StrUtil.isEmpty(debtorWorkTelphone)) { - failureMsg.append("【被申请人主体信息-单位电话】字段不能为空;"); - } else if (!TELEPHONE_REGX.matcher(debtorWorkTelphone).matches()) { - failureMsg.append("【被申请人主体信息-单位电话】字段不合法;"); - } - if (StrUtil.isEmpty(caseApplication.getDebtorWorkAddress())) { - failureMsg.append("【被申请人主体信息-单位地址】字段不能为空;"); - } else if (caseApplication.getDebtorWorkAddress().length() > 50) { - failureMsg.append("【被申请人主体信息-单位地址】字段超出指定长度,最大长度为50;"); - } - if (StrUtil.isEmpty(caseApplication.getResponSex())) { - failureMsg.append("【被申请人主体信息-性别】字段不能为空;"); - } else if (caseApplication.getResponSex().length() > 1) { - failureMsg.append("【被申请人主体信息-性别】字段超出指定长度,最大长度为1;"); - } - if (caseApplication.getResponBirth() == null) { - failureMsg.append("【被申请人主体信息-出生年月日】字段不合法;"); - } else if (caseApplication.getResponBirth().after(new Date())) { - failureMsg.append("【被申请人主体信息-出生年月日】字段不合法,不能超过当前日期;"); - } - if (StrUtil.isEmpty(caseApplication.getDebtorEmail())) { - failureMsg.append("【被申请人主体信息-邮箱】字段不能为空;"); - } else if (!EMAIL_PATTERN.matcher(caseApplication.getDebtorEmail()).matches()) { - - failureMsg.append("【被申请人主体信息-邮箱】字段不合法;"); - } - } - - /** - * 校验申请人代理信息 - * - * @param caseApplication - * @param failureMsg - */ - private void validApplicationAgentColumn(CaseApplication caseApplication, StringBuilder failureMsg, Map deptMap) { - if (StrUtil.isEmpty(caseApplication.getNameAgent())) { - failureMsg.append("【申请人主体信息-代理人姓名】字段不能为空;"); - } else if (caseApplication.getNameAgent().length() > 50) { - failureMsg.append("【申请人主体信息-代理人姓名】字段超出指定长度,最大长度为50;"); - } - if (StrUtil.isEmpty(caseApplication.getIdentityNumAgent())) { - failureMsg.append("【申请人主体信息-代理人身份证号】字段不能为空;"); - } else if (!IdcardUtil.isValidCard(caseApplication.getIdentityNumAgent())) { - failureMsg.append("【申请人主体信息-代理人身份证号】不合法;"); - } - validAgentInfo(caseApplication, failureMsg, deptMap); - String contactTelphoneAgent = caseApplication.getContactTelphoneAgent(); - if (StrUtil.isEmpty(contactTelphoneAgent)) { - failureMsg.append("【申请人主体信息-代理人联系电话】字段不能为空;"); - } else if (!TELEPHONE_REGX.matcher(contactTelphoneAgent).matches()) { - failureMsg.append("【申请人主体信息-代理人联系电话】字段不合法;"); - } - if (StrUtil.isEmpty(caseApplication.getContactAddressAgent())) { - failureMsg.append("【申请人主体信息-代理人联系地址】字段不能为空;"); - } else if (caseApplication.getContactAddressAgent().length() > 50) { - failureMsg.append("【申请人主体信息-代理人联系地址】字段超出指定长度,最大长度为50;"); - } - } - - /** - * 校验代理人与组织机构关系 - * - * @param caseApplication - * @param failureMsg - * @return - */ - private void validAgentInfo(CaseApplication caseApplication, StringBuilder failureMsg, Map deptMap) { - // 申请机构与代理人都不为空,校验代理人与组织机构关系(代理人必须在该部门下) - if (StrUtil.isNotEmpty(caseApplication.getName()) && StrUtil.isNotEmpty(caseApplication.getNameAgent())) { - String applicationOrganId = ""; - // 申请机构已经存在 - if (deptMap.containsKey(caseApplication.getName())) { - applicationOrganId = String.valueOf(deptMap.get(caseApplication.getName())); - } - // 根据代理人身份证去用户表查询 - SysUser agentUser = sysUserMapper.selectUserByIdCard(caseApplication.getIdentityNumAgent()); - // 代理人的部门和申请机构不匹配 - if (null != agentUser && null != agentUser.getDeptId() && !String.valueOf(agentUser.getDeptId()).equals(applicationOrganId)) { -// return "该申请代理人已在"+agentUser.getDeptName()+"申请机构下存在,请检查填写信息是否正确"; - if (null != agentUser.getDept() && StrUtil.isNotEmpty(agentUser.getDept().getDeptName())) { - failureMsg.append("该申请代理人已在【").append(agentUser.getDept().getDeptName()).append("】申请机构下存在,请检查填写信息是否正确"); - } else { - failureMsg.append("该申请代理人已存在,与申请机构不匹配,请检查填写信息是否正确"); - } - } - - } - } - - /** - * 校验申请人主题信息 - * - * @param caseApplication - * @param failureMsg - */ - private void validApplicationColumn(CaseApplication caseApplication, StringBuilder failureMsg) { - if (StrUtil.isEmpty(caseApplication.getName())) { - failureMsg.append("【申请人主体信息-申请人(机构)】字段不能为空;"); - } else if (caseApplication.getName().length() > 20) { - failureMsg.append("【申请人主体信息-申请人(机构)】字段超出指定长度,最大长度为20;"); - } - if (StrUtil.isNotEmpty(caseApplication.getIdentityNum()) && caseApplication.getIdentityNum().length() > 50) { - failureMsg.append("【申请人主体信息-代码】字段超出指定长度,最大长度为50;"); - } - String contactTelphone = caseApplication.getContactTelphone(); - if (StrUtil.isEmpty(contactTelphone)) { - failureMsg.append("【申请人主体信息-联系电话】字段不能为空;"); - } else if (!TELEPHONE_REGX.matcher(contactTelphone).matches()) { - failureMsg.append("【申请人主体信息-联系电话】字段不合法;"); - } - if (StrUtil.isEmpty(caseApplication.getContactAddress())) { - failureMsg.append("【申请人主体信息-联系地址】字段不能为空;"); - } else if (caseApplication.getName().length() > 50) { - failureMsg.append("【申请人主体信息-联系地址】字段超出指定长度,最大长度为50;"); - } - String workTelphone = caseApplication.getWorkTelphone(); - if (StrUtil.isEmpty(workTelphone)) { - failureMsg.append("【申请人主体信息-单位电话】字段不能为空;"); - } else if (!TELEPHONE_REGX.matcher(workTelphone).matches()) { - failureMsg.append("【申请人主体信息-单位电话】字段不合法;"); - } - if (StrUtil.isEmpty(caseApplication.getWorkAddress())) { - failureMsg.append("【申请人主体信息-单位地址】字段不能为空;"); - } else if (caseApplication.getWorkAddress().length() > 50) { - failureMsg.append("【申请人主体信息-单位地址】字段超出指定长度,最大长度为50;"); - } - if (StrUtil.isEmpty(caseApplication.getEmail())) { - failureMsg.append("【申请人主体信息-邮箱】字段不能为空;"); - } else if (!EMAIL_PATTERN.matcher(caseApplication.getEmail()).matches()) { - - failureMsg.append("【申请人主体信息-邮箱】字段不合法;"); - } - } - - /** - * 校验基本字段 - * - * @param caseApplication - * @param failureMsg - */ - private void validBaseColumn(CaseApplication caseApplication, StringBuilder failureMsg) { - if (StrUtil.isEmpty(caseApplication.getCaseName())) { - failureMsg.append("【案件名称】字段不能为空;"); - } else if (caseApplication.getCaseName().length() > 50) { - failureMsg.append("【案件名称】字段超出指定长度,最大长度为50;"); - } - BigDecimal caseSubjectAmount = caseApplication.getCaseSubjectAmount(); - if (null == caseSubjectAmount) { - failureMsg.append("【案件标的】字段不合法;"); - } else { - if (caseSubjectAmount.compareTo(new BigDecimal("0")) < 0 || caseSubjectAmount.compareTo(new BigDecimal("99999999.99")) > 0) { - failureMsg.append("【案件标的】字段超出范围,范围为[0,100000000);"); - } - if (caseSubjectAmount.scale() > 2) { - failureMsg.append("【案件标的】字段超出指定精度(10^-2);"); - } - } - if (caseApplication.getLoanStartDate() == null) { - failureMsg.append("【借款开始日期】字段不合法;"); - } - if (caseApplication.getLoanEndDate() == null) { - failureMsg.append("【借款结束日期】字段不合法;"); - } - if (caseApplication.getLoanStartDate() != null && caseApplication.getLoanEndDate() != null && caseApplication.getLoanStartDate().after(caseApplication.getLoanEndDate())) { - failureMsg.append("【借款结束日期】不能早于【借款开始日期】;"); - } - if (StrUtil.isEmpty(caseApplication.getContractNumber())) { - failureMsg.append("【合同编号】字段不能为空;"); - } else if (caseApplication.getContractNumber().length() > 50) { - failureMsg.append("【合同编号】字段超出指定长度,最大长度为50;"); - } - BigDecimal claimPrinciOwed = caseApplication.getClaimPrinciOwed(); - if (null == claimPrinciOwed) { - failureMsg.append("【申请人主张欠本金】字段不合法;"); - } else { - if (claimPrinciOwed.compareTo(new BigDecimal("0")) < 0 || claimPrinciOwed.compareTo(new BigDecimal("99999999.99")) > 0) { - failureMsg.append("【申请人主张欠本金】字段超出范围,范围为[0,100000000);"); - } - if (claimPrinciOwed.scale() > 2) { - failureMsg.append("【申请人主张欠本金】字段超出指定精度(10^-2);"); - } - } - BigDecimal claimInterestOwed = caseApplication.getClaimInterestOwed(); - if (null == claimInterestOwed) { - failureMsg.append("【申请人主张欠利息】字段不合法;"); - } else { - if (claimInterestOwed.compareTo(new BigDecimal("0")) < 0 || claimInterestOwed.compareTo(new BigDecimal("99999999.99")) > 0) { - failureMsg.append("【申请人主张欠利息】字段超出范围,范围为[0,100000000);"); - } - if (claimInterestOwed.scale() > 2) { - failureMsg.append("【申请人主张欠利息】字段超出指定精度(10^-2);"); - } - } - BigDecimal claimLiquidDamag = caseApplication.getClaimLiquidDamag(); - if (null == claimLiquidDamag) { - failureMsg.append("【申请人主张违约金】字段不合法;"); - } else { - if (claimLiquidDamag.compareTo(new BigDecimal("0")) < 0 || claimLiquidDamag.compareTo(new BigDecimal("99999999.99")) > 0) { - failureMsg.append("【申请人主张违约金】字段超出范围,范围为[0,100000000);"); - } - if (claimLiquidDamag.scale() > 2) { - failureMsg.append("【申请人主张违约金】字段超出指定精度(10^-2);"); - } - } - if (StrUtil.isEmpty(caseApplication.getArbitratClaims())) { - failureMsg.append("【申请人仲裁请求及事实和理由】字段不能为空;"); - } else if (caseApplication.getArbitratClaims().length() > 10000) { - failureMsg.append("【申请人仲裁请求及事实和理由】字段超出指定长度,最大长度为10000;"); - } - if (StrUtil.isNotEmpty(caseApplication.getArbitratClaims()) && caseApplication.getArbitratClaims().length() > 10000) { - failureMsg.append("【申请人请求仲裁庭裁决】字段超出指定长度,最大长度为10000;"); - } - } -} 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 deleted file mode 100644 index 968ef42..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java +++ /dev/null @@ -1,491 +0,0 @@ -package com.ruoyi.wisdomarbitrate.service.impl; - - -import cn.hutool.core.collection.CollectionUtil; -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.vo.CasePayListVO; -import com.ruoyi.wisdomarbitrate.mapper.*; -import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; -import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; -import com.ruoyi.common.utils.SmsUtils; -import com.ruoyi.dto.PayRequest; -import com.ruoyi.dto.PayResponse; -import com.ruoyi.wisdomarbitrate.domain.dto.CasePayDTO; -import com.ruoyi.wisdomarbitrate.service.ICasePaymentService; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.stream.Collectors; - -import static com.ruoyi.common.utils.SecurityUtils.getUsername; - -@Service -public class CasePaymentServiceImpl implements ICasePaymentService { - private final ElegentPay elegentPay; - private final CaseApplicationMapper caseApplicationMapper; - private final CasePaymentRecordMapper casePaymentRecordMapper; - private final CaseAffiliateMapper caseAffiliateMapper; - @Autowired - private CaseAttachMapper caseAttachMapper; - @Autowired - private SmsRecordMapper smsRecordMapper; - - @Autowired - public CasePaymentServiceImpl(ElegentPay elegentPay - , CaseApplicationMapper caseApplicationMapper - , CasePaymentRecordMapper casePaymentRecordMapper - , CaseAffiliateMapper caseAffiliateMapper - ) { - this.elegentPay = elegentPay; - this.caseApplicationMapper = caseApplicationMapper; - this.casePaymentRecordMapper = casePaymentRecordMapper; - this.caseAffiliateMapper = caseAffiliateMapper; - } - - @Autowired - private ICaseApplicationService caseApplicationService; - - @Override - @Transactional - public AjaxResult casePay(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(); - } - List caseIds = casePayDTO.getCaseIds(); - if (CollectionUtil.isEmpty(caseIds)) { - return AjaxResult.error("请检查参数是否有误"); - } - 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); - } - - @Transactional - public AjaxResult callback(String orderNumber) { - //查询记录 - 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("未查询到相关记录"); - } - return AjaxResult.success("支付成功"); - } - - @Override - @Transactional - public AjaxResult confirmPayment( List ids) { - for (Long id : ids) { - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(id); - caseApplication.setCaseStatus(CaseApplicationConstants.CASE_CROSSEXAMI); - caseApplicationMapper.submitCaseApplication(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); - if (caseApplication1 == null) { - continue; - } - 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); - } - smsRecordMapper.saveSmsSendRecord(smsSendRecord); - } else { //被申请人 - - 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}); - 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 + "已成功受理,请点击链接: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); - } - } - //更改记录表里的支付状态和支付时间 - CasePaymentRecord casePaymentRecord = new CasePaymentRecord(); - casePaymentRecord.setPaymentStatus(1); - casePaymentRecord.setPaymentTime(new Date()); - casePaymentRecord.setUpdateTime(new Date()); - casePaymentRecordMapper.update(casePaymentRecord); - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_CROSSEXAMI, ""); - } - } - - return AjaxResult.success(); - } - - @Transactional - @Override - public AjaxResult confirmPay(CaseConfirmPayDTO payDTO) { - List caseIds = payDTO.getCaseIds(); - if (caseIds == null || caseIds.size() == 0) { - return AjaxResult.error("案件id参数有误"); - } - if (payDTO.getPayType() != null) { - // 修改支付方式 - caseApplicationMapper.updatePayType(payDTO); - } - 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, ""); - } - } - - return AjaxResult.success("确认缴费成功"); - - } - - @Override - public AjaxResult casePayList(CasePayDTO casePayDTO) { - //参数校验 - List caseIds = casePayDTO.getCaseIds(); - if (caseIds == null || caseIds.size() == 0) { - return null; - } - BigDecimal totalCost = new BigDecimal(0); - BigDecimal sum = totalCost; - CasePayListVO listVO = new CasePayListVO(); - listVO.setCaseTotal(caseIds.size()); - List caseApplicationList = new ArrayList<>(); - for (Long caseId : caseIds) { - CaseApplication caseApplication = new CaseApplication(); - CaseApplicationPay caseApplicationPay = new CaseApplicationPay(); - caseApplication.setId(caseId); - CaseApplication caseApplication1 = caseApplicationService.selectCaseApplication(caseApplication); - BigDecimal feePayable = caseApplication1.getFeePayable(); - sum = sum.add(feePayable); - listVO.setTotalFee(sum); - caseApplicationPay.setCaseAppName(caseApplication1.getApplicantName()); - caseApplicationPay.setCaseResName(caseApplication1.getRespondentName()); - caseApplicationPay.setCaseNum(caseApplication1.getCaseNum()); - caseApplicationPay.setCaseStatus(caseApplication1.getCaseStatus()); - caseApplicationPay.setCaseSubjectAmount(caseApplication1.getCaseSubjectAmount()); - caseApplicationPay.setFeePayable(caseApplication1.getFeePayable()); - caseApplicationList.add(caseApplicationPay); - listVO.setCaseApplicationList(caseApplicationList); - } - - if (sum.compareTo(BigDecimal.ZERO) == 0) { - return AjaxResult.error("没有可支付的费用"); - } - 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); - List caseIds = caseApplications.stream().map(CaseApplication::getId).collect(Collectors.toList()); - if(caseApplications!=null&&caseApplications.size()>0){ - 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()); - for (Long caseId : caseIds) { - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(caseId); - caseApplication.setCaseStatus(CaseApplicationConstants.CASE_CROSSEXAMI); - caseApplicationMapper.submitCaseApplication(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); - if (caseApplication1 == null) { - continue; - } - 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); - } - smsRecordMapper.saveSmsSendRecord(smsSendRecord); - } else { //被申请人 - - 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}); - 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 + "已成功受理,请点击链接: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); - } - } - //更改记录表里的支付状态和支付时间 - CasePaymentRecord casePaymentRecord = new CasePaymentRecord(); - casePaymentRecord.setPaymentStatus(1); - casePaymentRecord.setCaseId(caseId); - casePaymentRecord.setPaymentTime(new Date()); - casePaymentRecord.setUpdateTime(new Date()); - casePaymentRecordMapper.update(casePaymentRecord); - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_CROSSEXAMI, ""); - - - } - - } - }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 deleted file mode 100644 index b67e8c4..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java +++ /dev/null @@ -1,1035 +0,0 @@ -package com.ruoyi.wisdomarbitrate.service.impl; - -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.ruoyi.common.constant.CaseApplicationConstants; -import com.ruoyi.common.constant.Constants; -import com.ruoyi.common.core.domain.entity.SysDept; -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.enums.UpdateSubmitStatus; -import com.ruoyi.common.utils.*; -import com.ruoyi.common.config.RuoYiConfig; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.domain.entity.SysDictData; -import com.ruoyi.common.exception.ServiceException; -import com.ruoyi.common.utils.file.FileUtils; -import com.ruoyi.common.utils.thread.MultipleThreadListParam; -import com.ruoyi.common.utils.thread.MultipleThreadWorkUtil; -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.vo.ColumnValue; -import com.ruoyi.wisdomarbitrate.mapper.*; -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.function.Function; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - -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; - -/** - * @author wangqiong - * @description 案件压缩包导入 - * @date 2023-12-11 11:45 - */ -@Service -public class CaseZipImportImpl { - @Autowired - private CaseApplicationServiceImpl caseApplicationService; - @Autowired - private FatchRuleMapper fatchRuleMapper; - @Autowired - private SysDictDataMapper dictDataMapper; - @Autowired - private CaseApplicationMapper caseApplicationMapper; - @Autowired - private SysDeptMapper sysDeptMapper; - @Autowired - private SysRoleMapper roleMapper; - @Autowired - private SysUserMapper userMapper; - @Autowired - private SysUserRoleMapper userRoleMapper; - @Autowired - private CaseAffiliateLogMapper caseAffiliateLogMapper; - @Autowired - private CaseAttachLogMapper caseAttachLogMapper; - @Autowired - private SmsRecordMapper smsRecordMapper; - @Autowired - private CaseAttachMapper caseAttachMapper; - @Autowired - private ColumnValueMapper columnValueMapper; - @Autowired - private ColumnValueLogMapper columnValueLogMapper; - @Autowired - private CaseAffiliateMapper caseAffiliateMapper; - @Autowired - private CaseApplicationLogMapper caseApplicationLogMapper; - // 申请人角色id - private long roleId; - private Integer maxCaseNum; - - -@Transactional - public AjaxResult zipImport(MultipartFile file, Long templateId) { - 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); - } catch (IOException e) { - e.printStackTrace(); - } - //解压缩上传的压缩包 - boolean unzipSuccess = UnZipFileUtils.unZipFile(zipFile, targetPath); - if (!unzipSuccess) { - // 解压失败 - throw new ServiceException("解压失败"); - } - // 查询抓取规则 - // todo 批次需要再上传压缩包时用户填写 - List fatchRuleList = fatchRuleMapper.listByTemplateId(templateId); - if (CollectionUtil.isEmpty(fatchRuleList)) { - throw new ServiceException("未设置抓取规则"); - } - // 在系统表中查询案件内置字段 - 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)); - - } - // 查询申请人角色id - roleId = roleMapper.selectRoleIdByName("申请人"); - /** - * 用户表已存在的用户 - */ - 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()); - // 抓取内容 - Map fatchMap = new HashMap<>(); - // 从抓取规则表取字段和字典表取基本字段,字典表的字段名塞到基本表,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("未找到文件夹"); - } - Integer maxBatchNumber = caseApplicationMapper.selectBatchNumberLike(); - if (maxBatchNumber == null) { - maxBatchNumber = 1; - - } else { - maxBatchNumber = maxBatchNumber + 1; - - } - File[] files = directory.listFiles(); - CaseZipImportTask caseZipImportTask = null; - try { - caseZipImportTask = new CaseZipImportTask(this, templateId, fatchRuleList, fatchMap, fatchRuleMap, userMap, dictDataList, files , deptMap, SecurityUtils.getLoginUser(),maxBatchNumber); - } catch (Exception e) { - return error("导入失败"); - } - Future> future = ThreadPoolUtil.submit(caseZipImportTask); - try { - if(future.get()!=null){ - return success("导入成功"); - } - } catch (InterruptedException e) { - e.printStackTrace(); - return success("导入失败"); - } catch (ExecutionException e) { - - e.printStackTrace(); - return success("导入失败"); - } - return error("导入失败"); - - - } - @Transactional - public CaseApplication buildCaseInfo(File file, Long templateId, List fatchRuleList, Map> fatchRuleMap, Map fatchMap, Map userMap, List dictDataList, Map deptMap,LoginUser loginUser, Integer maxBatchNumber) { - // fileMap> - Map fileMap = findFile(file, fatchRuleList); - if (fileMap != null && fileMap.size()> 0) { - // 根据抓取规则循环抓取 - for (Map.Entry> entry : fatchRuleMap.entrySet()) { - getFatchContent(fileMap, entry.getKey(), fatchMap, entry.getValue()); - } - - if (fatchMap.size() > 0) { - - // 尊敬的{1},您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信 - SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - request.setTemplateId("1956159"); - - // 新增的案件 - // 组装案件内置字段主表内容 - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(IdWorkerUtil.getId()); - 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.setColumnValues(columnValueList); - } - - // 角色用户 - List userRoleList = new ArrayList<>(); - - // 组装机构 - List sysDepts = new ArrayList<>(); - // 案件附件 - List caseAttachs = new ArrayList<>(); - //发送短信列表 - List smsSendRecordList = new ArrayList<>(); - // 短信记录 - List smsRequestList = new ArrayList<>(); - - // 需要新增的用户 - List addUsers = new ArrayList<>(); - caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); - caseApplication.setCaseLogId(IdWorkerUtil.getId()); - caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode()); - caseApplication.setCaseAppliId(caseApplication.getId()); - - // 设置批号 - caseApplication.setBatchNumber(maxBatchNumber); - // 设置编号 - String maxCaseNumStr = generateCaseNum(); - caseApplication.setCaseNum(maxCaseNumStr); - caseApplication.setCreateBy(loginUser!=null?loginUser.getUsername():"admin"); - caseApplication.setVersion(1); - // 组装案件内置字段主表内容 - - // 组装内置字段 - buildDefaultColumn(caseApplication, dictDataList, fatchMap, deptMap, sysDepts, userMap, addUsers, userRoleList, smsSendRecordList, smsRequestList); - // 组装附件 - for (Map.Entry entry : fileMap.entrySet()) { - String fileUrl = entry.getValue(); - if (StrUtil.isEmpty(fileUrl)) { - continue; - } - // 上传 - String filePath = RuoYiConfig.getUploadPath(); - - CaseAttach caseAttach = new CaseAttach(); - caseAttach.setCaseAppliId(caseApplication.getId()); - 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); - } - - } - caseApplication.setCaseAttachList(caseAttachs); - // 案件压缩包导入 - 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()])); -// } - // 多线程执行 - ThreadPoolUtil.execute(() -> { - try { - caseApplicationMapper.insertCaseApplication(caseApplication); - caseApplicationLogMapper.insert(caseApplication); - // 多线程执行 - if (CollectionUtil.isNotEmpty(addUsers)) { - userMapper.batchSave(addUsers); - - } - if (CollectionUtil.isNotEmpty(userRoleList)) { - userRoleMapper.batchUserRole(userRoleList); - - } - if (CollectionUtil.isNotEmpty(sysDepts)) { - sysDeptMapper.batchSave(sysDepts); - - } - if (CollectionUtil.isNotEmpty(caseApplication.getCaseAffiliates())) { - caseAffiliateMapper.batchCaseAffiliate(caseApplication.getCaseAffiliates()); - caseAffiliateLogMapper.batchCaseAffiliate(caseApplication.getCaseAffiliates()); - } - if (CollectionUtil.isNotEmpty(caseAttachs)) { - caseAttachMapper.batchSave(caseAttachs); - caseAttachLogMapper.batchSave(caseAttachs); - - } - if (CollectionUtil.isNotEmpty(columnValueList)) { - columnValueMapper.batchSave(columnValueList); - columnValueLogMapper.batchSave(columnValueList); - } - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, "",loginUser); - // 发送短信 - 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); - } - - - } - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException("导入失败,请检查抓取规则是否正确"); - } - - }); - 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(); - } - } - 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; - } - if (file.isFile()) { - - filePathMap.put(file.getName(), file.getAbsolutePath()); - } else if (file.isDirectory()) { - // 如果是目录,递归查找 - searchAndConvertPDF(file, filePathMap); - } - } - } - } - - /** - * 获取自动编码 - * - * @return - */ - - public String generateCaseNum() { - // 自动编码格式 zc+yyyyMMdd+001 - String currentDay = DateUtils.dateTime(); - String caseNum = "zc" + currentDay; - - - if (null == maxCaseNum) { - maxCaseNum = 1; - caseNum = caseNum + "001"; - } else { - maxCaseNum = maxCaseNum + 1; - caseNum = caseNum + String.format("%03d", maxCaseNum); - } - return caseNum; - - } - - public void inputChangeToFile(InputStream instream, File file) { - try { - OutputStream outStr = new FileOutputStream(file); - int bytesRead = 0; - byte[] buffer = new byte[8192]; - while ((bytesRead = instream.read(buffer, 0, 1024)) != -1) { - outStr.write(buffer, 0, bytesRead); - } - outStr.flush(); - outStr.close(); - instream.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - /** - * 查找文件 - * - * @param directory - * @param - * @return - */ - public static Map> findAndConvertPDF(File directory) { - // caseMap> - Map> caseMap = new HashMap<>(); - if (directory.isFile()) { - String path = ""; - // 如果传入的参数是一个文件 - path = directory.getAbsolutePath(); - List fileList = new ArrayList<>(); - fileList.add(directory); - caseMap.put(IdWorkerUtil.getId(), fileList); - - } else if (directory.isDirectory()) { - searchAndConvertPDF(directory, caseMap, 1, new HashMap<>()); - } else { - return null; - } - return caseMap; - } - - public static boolean isPDF(File file) { - String extension = FileUtils.getFileExtension(file); - return extension.equalsIgnoreCase("pdf"); - } - - - /** - * 递归查找文件夹 - * - * @param directory - * @param caseMap> - * @param i 第几层文件夹 - * @param fileMap> - */ - public static void searchAndConvertPDF(File directory, Map> caseMap, int i, Map fileMap) { - File[] files = directory.listFiles(); - // 约定压缩包第二层一个文件夹为一个案件 - if (files != null) { - if (i == 2) { - for (File file : files) { - fileMap.put(file.getAbsolutePath(), IdWorkerUtil.getId()); - } - } - i++; - for (File file : files) { - - if (file.getName().contains("zip") || file.getName().contains("rar")) { - continue; - } - if (file.isFile()) { - for (Map.Entry entry : fileMap.entrySet()) { - // 为同一个案件 - if (!file.getAbsolutePath().contains(entry.getKey())) { - continue; - } - List fileList; - if (caseMap.containsKey(entry.getValue())) { - fileList = caseMap.get(entry.getValue()); - } else { - fileList = new ArrayList<>(); - } - fileList.add(file); - caseMap.put(entry.getValue(), fileList); - - } - - } else if (file.isDirectory()) { - // 如果是目录,递归查找 - searchAndConvertPDF(file, caseMap, i, fileMap); - } - } - } - } - - - private static int getFileNumPage(String pdfUrl) { - File pdfFile = new File(pdfUrl); - int pageCount = 0; - try (PDDocument document = PDDocument.load(pdfFile)) { - pageCount = document.getNumberOfPages(); - } catch (IOException e) { - e.printStackTrace(); - } - return pageCount; - } - - /** - * 获取模板和正文中替换符的内容 - * - * @param a - * @param b - * @return - */ - public static List getReplaceList(String a, String b) { - String aTmpe = filterString(a); - String bTmpe = filterString(b); - String regex = "(\\{[^}}]*})"; - String[] ptTemplate = aTmpe.replaceAll(regex, "@=").split("@="); - String replace = ""; - for (int i = 0; i < ptTemplate.length; i++) { - if (ptTemplate[i] == null || ptTemplate[i].equals(" ")) continue; - if (replace.equals("")) { - replace = bTmpe.replace(ptTemplate[i], "@="); - } else { - replace = replace.replace(ptTemplate[i], "@="); - } - } - List aList = new ArrayList<>(); - String[] split = replace.split("@="); - for (int i = 0; i < split.length; i++) { - if (split[i] == "" || split[i].equals("")) continue; - aList.add(split[i]); - } - return aList; - } - - // 去掉内容中的换行符 - public static String filterString(String str) { - if (str == null || str.equals("")) { - return null; - } - String regEx = "[\\r\\n]"; - Pattern p = Pattern.compile(regEx); - Matcher m = p.matcher(str); - return m.replaceAll(" ").trim(); - } - - // 检索时,转换特殊字符 - public static String escapeQueryChars(String s) { - if (StringUtils.isBlank(s)) { - return s; - } - StringBuilder sb = new StringBuilder(); - for (int i = 0; i < s.length(); i++) { - char c = s.charAt(i); - // These characters are part of the query syntax and must be escaped - if (c == '\\' || c == '+' || c == '-' || c == '!' || c == '(' || c == ')' - || c == ':' || c == '^' || c == '[' || c == ']' || c == '\"' - || c == '{' || c == '}' || c == '~' || c == '*' || c == '?' - || c == '|' || c == '&' || c == ';' || c == '/' || c == '.' - || c == '$' || Character.isWhitespace(c)) { - sb.append('\\'); - } - sb.append(c); - } - return sb.toString(); - } - - /** - * 组装内置字段 - * - * @param caseApplication 案件信息 - * @param dictDataList 内置字段 - * @param fatchMap 抓取字段内容 - */ - private void buildDefaultColumn(CaseApplication caseApplication, List dictDataList, Map fatchMap, - Map deptMap, List sysDepts, - Map userMap, List addUsers, List userRoleList, - List smsSendRecords, List smsRequestList) { - // 组装内置字段 - if (CollectionUtil.isEmpty(dictDataList)) { - return; - } - List caseAffiliates = new ArrayList<>(); - // 被申请人 - CaseAffiliate debtorAffiliate = new CaseAffiliate(); - debtorAffiliate.setCaseAppliId(caseApplication.getId()); - debtorAffiliate.setCaseAppliLogId(caseApplication.getCaseLogId()); - // 申请人 - CaseAffiliate affiliate = new CaseAffiliate(); - affiliate.setCaseAppliLogId(caseApplication.getCaseLogId()); - affiliate.setCaseAppliId(caseApplication.getId()); - for (SysDictData dictData : dictDataList) { - if (StrUtil.isNotEmpty(dictData.getDictLabel())) { - if (dictData.getDictLabel().contains("被申请人")) { - // 组装被申请人内置自段 - buildDebtorColumn(dictData, fatchMap, debtorAffiliate, caseApplication.getId()); - } 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); - } else if (dictData.getDictLabel().contains("合同编号")) { - // 合同编号 - 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("案件标的")) { - String caseSubjectAmount = fatchMap.get(dictData.getDictLabel()); - if(StrUtil.isNotEmpty(caseSubjectAmount)) { - try { - BigDecimal bigDecimal = new BigDecimal(caseSubjectAmount); - caseApplication.setCaseSubjectAmount(bigDecimal); - // todo 案件标的名字要改,字典配置中也要改 - //todo 暂时设置计费比率为0.01 - BigDecimal feeRate = new BigDecimal(0.01); - BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP); - caseApplication.setFeePayable(feePayable); - - } catch (Exception e) { - } - } - - } else { - ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() )); - } - - } else { - ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() )); - - } - - } - if (ObjectUtil.isNotEmpty(affiliate)) { - caseAffiliates.add(affiliate); - } - if (ObjectUtil.isNotEmpty(debtorAffiliate)) { - caseAffiliates.add(debtorAffiliate); - } - caseApplication.setCaseAffiliates(caseAffiliates); - - } - - /** - * 组装申请人内置字段 - * - * @param dictData 内置字段 - * @param fatchMap 抓取内容 - * @param affiliate 案件人员 - */ - 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); - - // 申请人 - switch (dictData.getDictLabel()) { - case "申请人姓名": - affiliate.setName((fatchMap.get(dictData.getDictLabel()))); - 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()); - - } - } - break; - case "统一社会信用代码": - affiliate.setIdentityNum((fatchMap.get(dictData.getDictLabel()))); - break; - case "法定代表人": - affiliate.setCompLegalPerson(fatchMap.get(dictData.getDictLabel())); - break; - case "法定代表人职位": - affiliate.setCompLegalperPost((fatchMap.get(dictData.getDictLabel()))); - break; - case "申请人住所": - affiliate.setResidenAffili((fatchMap.get(dictData.getDictLabel()))); - break; - case "申请人联系地址": - affiliate.setContactAddress(fatchMap.get(dictData.getDictLabel())); - break; - case "委托代理人姓名": - affiliate.setNameAgent(fatchMap.get(dictData.getDictLabel())); - break; - case "委托代理人联系电话": - affiliate.setContactTelphoneAgent(fatchMap.get(dictData.getDictLabel())); - 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); - } - - - } - - } - break; - case "委托代理人电子邮件": - affiliate.setAgentEmail(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; - } - } - - /** - * 新增角色为申请人 - * - * @param agentUser - * @param roleId - */ - private void insertAgentUserRole(SysUser agentUser, Long roleId, List userRoleList) { - - SysUserRole sysUserRole = new SysUserRole(); - sysUserRole.setUserId(agentUser.getUserId()); - sysUserRole.setRoleId(roleId); - userRoleList.add(sysUserRole); - - } - - /** - * 组装被申请人内置字段 - * - * @param dictData 内置字段 - * @param fatchMap 抓取内容 - * @param debtorAffiliate 被申请人 - */ - private void buildDebtorColumn(SysDictData dictData, Map fatchMap, CaseAffiliate debtorAffiliate, Long caseId) { - - debtorAffiliate.setIdentityType(2); - // 被申请人 - switch (dictData.getDictLabel()) { - case "被申请人姓名": - debtorAffiliate.setName(fatchMap.get(dictData.getDictLabel() )); - break; - case "被申请人身份证号": - String identityNum = fatchMap.get(dictData.getDictLabel() ); - debtorAffiliate.setIdentityNum(fatchMap.get(dictData.getDictLabel() )); - // 出生年月日,从身份证抓取 - if (StrUtil.isNotEmpty(identityNum)) { - identityNum = identityNum.replace("\n", ""); - Map identityNumMap = IdCardUtils.getBirAgeSex(identityNum); - String birthday = identityNumMap.get("birthday"); - if (StrUtil.isNotEmpty(birthday)) { - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); - Date birthdayDate = null; - try { - birthdayDate = simpleDateFormat.parse(birthday); - } catch (Exception e) { - e.printStackTrace(); - } - debtorAffiliate.setResponBirth(birthdayDate); - } - //从身份证抓取性别 - debtorAffiliate.setResponSex(identityNumMap.get("sexCode")); - } - - break; - case "被申请人住所": - debtorAffiliate.setResidenAffili(fatchMap.get(dictData.getDictLabel() )); - break; - case "被申请人联系电话": - debtorAffiliate.setContactTelphone(fatchMap.get(dictData.getDictLabel() )); - break; - case "被申请人电子邮件": - debtorAffiliate.setEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel() )) ? fatchMap.get(dictData.getDictLabel() ).replace("\n", "").replaceAll("\\s", "") : null); - - break; - default: - break; - } - - } - - /** - * 获取抓取内容 - * - * @param fatchRules 抓取规则 - */ - private void getFatchContentList(File caseFile, Map fatchMap, List fatchRules, Long caseId) { - String fileURL = caseFile.getAbsolutePath(); - if (fileURL.endsWith("txt")) { - String readerFile = ReadFileUtils.readerTxtFile(fileURL); - OCRUtils.fatchRuleGetContent(readerFile, fatchRules, fatchMap, caseId); - } 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, fatchMap, caseId); - - } 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, fatchMap, caseId); - - } - } - - - } - - -} 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 deleted file mode 100644 index 0aa35dc..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java +++ /dev/null @@ -1,485 +0,0 @@ -package com.ruoyi.wisdomarbitrate.service.impl; - -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.util.StrUtil; -import cn.hutool.http.HttpUtil; -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.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.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; -import com.tencentcloudapi.common.profile.HttpProfile; -import com.tencentcloudapi.trtc.v20190722.TrtcClient; -import com.tencentcloudapi.trtc.v20190722.models.*; -import com.tencentcloudapi.vod.v20180717.VodClient; -import com.tencentcloudapi.vod.v20180717.models.DescribeMediaInfosRequest; -import com.tencentcloudapi.vod.v20180717.models.DescribeMediaInfosResponse; -import com.tencentyun.TLSSigAPIv2; -import lombok.extern.slf4j.Slf4j; -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.success; -import static com.ruoyi.common.utils.file.FileUploadUtils.getAbsoluteFile; -import static com.ruoyi.common.utils.file.FileUploadUtils.getPathFileName; - -/** - * @author wangqiong - * @description 视频录制 - * @date 2023-10-26 11:45 - */ -@Service -@Slf4j -public class VideoServiceImpl implements VideoService { - // 腾讯云即时通信sdkAppId - @Value("${imConfig.sdkAppId}") - private long sdkAppId; - // 腾讯云即时通信密钥 - @Value("${imConfig.sdkSecretKey}") - private String sdkSecretKey; - // 腾讯云个人账户secretId - @Value("${imConfig.secretId}") - private String secretId; - // 腾讯云个人账户密钥 - @Value("${imConfig.secretKey}") - private String secretKey; - @Autowired - private CaseApplicationMapper caseApplicationMapper; - @Autowired - private CaseAttachMapper caseAttachMapper; - @Autowired - private SysRoleMapper roleMapper; - - /** - * 功能:第三方回调sign校验 - * 参数: - * key:控制台配置的密钥key - * body:腾讯云回调返回的body体 - * sign:腾讯云回调返回的签名值sign - * 返回值: - * Status:OK 表示校验通过,FAIL 表示校验失败,具体原因参考Info - * Info:成功/失败信息 - * @param body - * @param request - * @throws Exception - */ - @Override - public void videoRollBack(String body, HttpServletRequest request) { - String key = "key"; - String sdkAppId = request.getHeader("SdkAppId"); - String sign = request.getHeader("Sign"); - // String resultSign = getResultSign(key,body); - // log.info("resultSign:"+resultSign); - // if (resultSign.equals(sign)) { - JSONObject jsonObject = (JSONObject) JSON.parse(body); - 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 payload = jsonObject1.getString("Payload"); // 根据不同事件类型定义不同 - JSONObject jsonObject2 = (JSONObject) JSON.parse(payload); - String tencentVod = jsonObject2.getString("TencentVod"); // 点播平台信息 - JSONObject jsonObject3 = (JSONObject) JSON.parse(tencentVod); - // 录制视频上传成功 - if (eventType == 311) { - // 点播平台的唯一 ID - String fileId = jsonObject3.getString("FileId"); - // 点播平台的播放地址 - String videoUrl = jsonObject3.getString("VideoUrl"); - // 主辅流标识,main 代表主流(摄像头),aux 代表辅流(屏幕分享),mix 代表混流录制 - String mediaId = jsonObject3.getString("MediaId"); - // 建立相关的数据库用来存储音视频录制地址并和相关的业务ID绑定,用于后续下载 - try { - downloadImage(fileId,videoUrl,roomId); - - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - } - - @Override - public AjaxResult bindCaseId(Long caseId, String roomId) { - caseApplicationMapper .bindCaseId(caseId,roomId); - return success(); - } - - @Override - public AjaxResult videoList(Long caseId) { - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(caseId); - caseApplication.setAnnexType(9); - List caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication); - if(CollectionUtil.isEmpty(caseAttachList)){ - 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); - } - } - return success(caseAttachList); - } - - /** - * 开启腾讯云录制 - * @param roomId - * @return - */ - @Override - public AjaxResult openCloudRecording(long caseId,long roomId) { - try { - String userId="recorder_"+roomId; - - Credential cred = new Credential(secretId, secretKey); - - // 实例化一个http选项,可选的,没有特殊需求可以跳过 - HttpProfile httpProfile = new HttpProfile(); - httpProfile.setEndpoint("trtc.tencentcloudapi.com"); - // 实例化一个client选项,可选的,没有特殊需求可以跳过 - ClientProfile clientProfile = new ClientProfile(); - clientProfile.setHttpProfile(httpProfile); - // 实例化要请求产品的client对象,clientProfile是可选的 - TrtcClient client = new TrtcClient(cred, "ap-beijing", clientProfile); - - // 实例化一个请求对象,每个接口都会对应一个request对象 - CreateCloudRecordingRequest req = new CreateCloudRecordingRequest(); - req.setSdkAppId(sdkAppId); // SdkAppId – TRTC的[SdkAppId](https://cloud.tencent.com/document/product/647/46351#sdkappid),和录制的房间所对应的SdkAppId相同 - req.setRoomId(String.valueOf(roomId)); // RoomId – TRTC的[RoomId](https://cloud.tencent.com/document/product/647/46351#roomid),录制的TRTC房间所对应的RoomId - req.setRoomIdType(1L); - /** - * 录制机器人用于进入TRTC房间拉流的[UserId](https://cloud.tencent.com/document/product/647/46351#userid), - * 注意这个UserId不能与其他TRTC房间内的主播或者其他录制任务等已经使用的UserId重复,建议可以把房间ID作为userId的标识的一部分, - * 即录制机器人进入房间的userid应保证独立且唯一 - */ - req.setUserId(userId); - - TLSSigAPIv2 api = new TLSSigAPIv2(sdkAppId, sdkSecretKey); - String userSign = api.genUserSig(userId, 60 * 60 * 10); - req.setUserSig(userSign); // 录制机器人用于进入TRTC房间拉流的用户签名,当前 UserId 对应的验证签名,相当于登录密码 - RecordParams recordParams = new RecordParams(); - // 混流录制 - recordParams.setMaxIdleTime(60L*5); // 5分钟内房间里面没有主播,自动停止录制 - recordParams.setStreamType(0L); // 0:录制音频+视频流(默认); 1:仅录制音频流; 2:仅录制视频流 - recordParams.setRecordMode(2L); // 1:单流录制,分别录制房间的订阅UserId的音频和视频,将录制文件上传至云存储; 2:混流录制,将房间内订阅UserId的音视频混录成一个音视频文件,将录制文件上传至云存储; - recordParams.setOutputFormat(0L); // 0:(默认)输出文件为hls格式。1:输出文件格式为hls+mp4。2:输出文件格式为hls+aac - MixLayoutParams mixLayoutParams = new MixLayoutParams(); - // 布局模式: 1:悬浮布局;2:屏幕分享布局;3:九宫格布局(默认);4:自定义布局; - mixLayoutParams.setMixLayoutMode(3L); - req.setMixLayoutParams(mixLayoutParams); - - StorageParams storageParams1 = new StorageParams(); - CloudVod cloudVod = new CloudVod(); - TencentVod tencentVod = new TencentVod(); - tencentVod.setSubAppId(1304001529L); - // 录制的文件永久保存 - tencentVod.setExpireTime(0L); - // 录制文件名拼接前缀 - tencentVod.setUserDefineRecordId(caseId+""); - cloudVod.setTencentVod(tencentVod); // 腾讯云点播相关参数。 - storageParams1.setCloudVod(cloudVod); // 必填】腾讯云云点播的账号信息,目前仅支持存储至腾讯云点播VOD。 - req.setRecordParams(recordParams); // 云端录制控制参数 - req.setStorageParams(storageParams1); // 云端录制文件上传到云存储的参数(目前只支持使用腾讯云点播作为存储) - // 返回的resp是一个CreateCloudRecordingResponse的实例,与请求对象对应 - CreateCloudRecordingResponse resp = client.CreateCloudRecording(req); - - return success((JSONObject) JSON.toJSON(resp)); - } catch (TencentCloudSDKException e) { - return AjaxResult.error(e.toString()); - } - } - - @Override - public AjaxResult closeDeleteCloudRecording(String taskId) { - - try { - if (taskId != null) { - taskId = taskId.replaceAll(" ", "+"); - } - // 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey,此处还需注意密钥对的保密 - // 代码泄露可能会导致 SecretId 和 SecretKey 泄露,并威胁账号下所有资源的安全性。以下代码示例仅供参考,建议采用更安全的方式来使用密钥,请参见:https://cloud.tencent.com/document/product/1278/85305 - // 密钥可前往官网控制台 https://console.cloud.tencent.com/cam/capi 进行获取 - Credential cred = new Credential(secretId, secretKey); - // 实例化一个http选项,可选的,没有特殊需求可以跳过 - HttpProfile httpProfile = new HttpProfile(); - httpProfile.setEndpoint("trtc.tencentcloudapi.com"); - // 实例化一个client选项,可选的,没有特殊需求可以跳过 - ClientProfile clientProfile = new ClientProfile(); - clientProfile.setHttpProfile(httpProfile); - // 实例化要请求产品的client对象,clientProfile是可选的 - TrtcClient client = new TrtcClient(cred, "ap-beijing", clientProfile); - // 实例化一个请求对象,每个接口都会对应一个request对象 - DeleteCloudRecordingRequest req = new DeleteCloudRecordingRequest(); - req.setSdkAppId(sdkAppId); // SdkAppId – TRTC的SDKAppId,和录制的房间所对应的SDKAppId相同 - req.setTaskId(taskId); // TaskId – 录制任务的唯一Id,在启动录制成功后会返回 - // 返回的resp是一个DeleteCloudRecordingResponse的实例,与请求对象对应 - DeleteCloudRecordingResponse resp = client.DeleteCloudRecording(req); - // 输出json格式的字符串回包 - return success((JSONObject) JSON.toJSON(resp)); - } catch (TencentCloudSDKException e) { - return AjaxResult.error(e.toString()); - } - - } - - @Override - public AjaxResult dissolveRoom( Long roomId) { - Credential cred = new Credential(secretId, secretKey); - // 实例化一个http选项,可选的,没有特殊需求可以跳过 - HttpProfile httpProfile = new HttpProfile(); - httpProfile.setEndpoint("trtc.tencentcloudapi.com"); - // 实例化一个client选项,可选的,没有特殊需求可以跳过 - ClientProfile clientProfile = new ClientProfile(); - clientProfile.setHttpProfile(httpProfile); - // 实例化要请求产品的client对象,clientProfile是可选的 - TrtcClient client = new TrtcClient(cred, "ap-beijing", clientProfile); - DismissRoomRequest req = new DismissRoomRequest(); - req.setSdkAppId(sdkAppId); - req.setRoomId(roomId); - try { - DismissRoomResponse resp = client.DismissRoom(req); - return success((JSONObject) JSON.toJSON(resp)); - } catch (TencentCloudSDKException e) { - return AjaxResult.error("解散房间失败"); - } - - } - - @Override - public AjaxResult secretaryRoleByUserId(Long userId) { - List roles = roleMapper.selectRolePermissionByUserId(userId); - JSONObject jsonObject = new JSONObject(); - boolean isSecretaryRole=false; - if(CollectionUtil.isNotEmpty(roles)){ - for (SysRole role : roles) { - if("法律顾问".equals(role.getRoleName()) || "秘书".equals(role.getRoleName())){ - isSecretaryRole=true; - break; - } - } - } - jsonObject.put("isSecretaryRole",isSecretaryRole); - return success(jsonObject); - } - - /** - * 根据html字符串转pdf并和案件关联 - * @param reservedConferenceVO - * @return - */ - @Override - public AjaxResult htmlToPDF(ReservedConferenceVO reservedConferenceVO) { - String currentFileName = System.currentTimeMillis() + ".pdf"; - String fileName = null; - try { - fileName = getPathFileName(RuoYiConfig.getHtml2PDFPath(), currentFileName); - } catch (IOException e) { - throw new RuntimeException(e); - } - String htmlContent = " 庭审笔录

庭审笔录

" +reservedConferenceVO.getHtmlContent()+""; - // html转pdf并上传到服务器 - boolean convertFlag = PdfUtils.htmlStringConvertToPDF(RuoYiConfig.getHtml2PDFPath() +"/"+ currentFileName, htmlContent); - - // 绑定案件 - if(convertFlag){ - CaseAttach caseAttach = CaseAttach.builder().caseAppliId(reservedConferenceVO.getCaseId()) - .annexName(fileName) - .annexPath(RuoYiConfig.getHtml2PDFPath()) - .annexType(7) - .build(); - caseAttachMapper.save(caseAttach); - return AjaxResult.success(); - }else { - return AjaxResult.error("pdf转换失败"); - } - } - - @Override - public AjaxResult attachListByCaseId(Long caseAppliId, Integer annexType) { - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(caseAppliId); - caseApplication.setAnnexType(annexType); - List caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication); - if(CollectionUtil.isEmpty(caseAttachList)){ - return success(caseAttachList); - } - - // 附件转换 - 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); - } - - - } - } - return success(caseAttachList); - } - - - /** - * 查询出音视频集合,并下载,在将云点播上面的音视频删除 - * @param fileIds 点播平台唯一ID集合 - * @throws Exception - */ - private void downloadVideo(String [] fileIds) throws Exception { - try{ - //创建文件对象 - Properties properties = new Properties(); - //加载文件获取数据 文件带后缀 - properties.load(Thread.currentThread().getContextClassLoader().getResourceAsStream - ("application.properties")); - //根据key来获取value - String secretId = properties.getProperty("secretid"); - String secretKey = properties.getProperty("secretkey"); - // 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey,此处还需注意密钥对的保密 - // 代码泄露可能会导致 SecretId 和 SecretKey 泄露,并威胁账号下所有资源的安全性。以下代码示例仅供参考,建议采用更安全的方式来使用密钥,请参见:https://cloud.tencent.com/document/product/1278/85305 - // 密钥可前往官网控制台 https://console.cloud.tencent.com/cam/capi 进行获取 - Credential cred = new Credential(secretId, secretKey); - // 实例化一个http选项,可选的,没有特殊需求可以跳过 - HttpProfile httpProfile = new HttpProfile(); - httpProfile.setEndpoint("vod.tencentcloudapi.com"); - // 实例化一个client选项,可选的,没有特殊需求可以跳过 - ClientProfile clientProfile = new ClientProfile(); - clientProfile.setHttpProfile(httpProfile); - // 实例化要请求产品的client对象,clientProfile是可选的 - VodClient client = new VodClient(cred, "ap-beijing", clientProfile); - // 实例化一个请求对象,每个接口都会对应一个request对象 - DescribeMediaInfosRequest req = new DescribeMediaInfosRequest(); - req.setFileIds(fileIds); - String[] basicInfos = {"basicInfo"}; - req.setFilters(basicInfos); - // 返回的resp是一个DescribeMediaInfosResponse的实例,与请求对象对应 - DescribeMediaInfosResponse resp = client.DescribeMediaInfos(req); - // 输出json格式的字符串回包 - log.info(DescribeMediaInfosResponse.toJsonString(resp)); - String json = DescribeMediaInfosResponse.toJsonString(resp); - JSONObject jsonObject = (JSONObject) JSON.parse(json); - JSONArray jsonArray = jsonObject.getJSONArray("MediaInfoSet"); // 媒体文件信息列表。 - for (int i = 0; i < jsonArray.size(); i++) { - JSONObject jsonObject1 = jsonArray.getJSONObject(i); - String fileId = jsonObject1.getString("FileId"); // 点播平台的唯一 ID - String basicInfo = jsonObject1.getString("BasicInfo"); // 基础信息 - JSONObject jsonObject2 = (JSONObject) JSON.parse(basicInfo); - String mediaUrl = jsonObject2.getString("MediaUrl"); // 文件地址 - String downPath = downloadImage(null,null,mediaUrl); // 下载音视频(返回本地下载地址) - // 将未下载的音视频列表查询出来,进行下载到服务器上面,并更新数据库数据 - log.info(downPath); // 本地地址 - } - log.info("下载音视频成功"); - } catch (TencentCloudSDKException e) { - log.info(e.toString()); - } catch (IOException e) { - e.printStackTrace(); - } - log.info("腾讯云测试成功"); - } - - /** - * 将视频下载到本地 - * @param fileUrl 视频路径 - * @return - */ - @Transactional - public String downloadImage(String fileId,String fileUrl,String roomId) throws IOException { - String staticAndMksDir = null; - if (fileUrl != null) { - //下载时文件名称 - String fileName = fileUrl.substring(fileUrl.lastIndexOf("/")); - fileName = fileName.replace("/", ""); - fileName=fileId+fileName; - String absPath = getAbsoluteFile(RuoYiConfig.getVideoUploadPath(), fileName).getAbsolutePath(); - staticAndMksDir = Paths.get(absPath).toFile().toString(); - long downloadFile = HttpUtil.downloadFile(fileUrl, staticAndMksDir); - if(downloadFile>0) { - Long caseId = caseApplicationMapper.selectCaseIdByRoomId(roomId); - String annexName = getPathFileName(RuoYiConfig.getVideoUploadPath(), fileName); - // 存入数据库 - CaseAttach caseAttach = CaseAttach.builder().caseAppliId(caseId) - .annexName(annexName) - .annexPath(RuoYiConfig.getVideoUploadPath()) - .annexType(9) - .build(); - caseAttachMapper.save(caseAttach); - return annexName; - } - } - return ""; - - } - /** - * @param key 回调秘钥 - * @param body 入参 - * @return 签名 Sign 计算公式中 key 为计算签名 Sign 用的加密密钥。 - * @throws Exception - */ - private static String getResultSign(String key, String body) throws Exception { - Mac hmacSha256 = Mac.getInstance("HmacSHA256"); - SecretKeySpec secret_key = new SecretKeySpec(key.getBytes(), "HmacSHA256"); - hmacSha256.init(secret_key); - return Base64.getEncoder().encodeToString(hmacSha256.doFinal(body.getBytes())); - } - -} 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 deleted file mode 100644 index 74409fb..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/task/CaseZipImportTask.java +++ /dev/null @@ -1,72 +0,0 @@ -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 fatchMap; - private Map> fatchRuleMap; - private Map userMap; - private List dictDataList; - private File[] files; - private Map deptMap; - private LoginUser loginUser; - private Integer maxBatchNumber; - - public CaseZipImportTask(CaseZipImportImpl caseZipImportImpl, Long templateId, List fatchRuleList, Map fatchMap, Map> fatchRuleMap, Map userMap, List dictDataList, File[] files, Map deptMap, LoginUser loginUser,Integer maxBatchNumber) { - this.caseZipImportImpl = caseZipImportImpl; - this.templateId = templateId; - this.fatchRuleList = fatchRuleList; - this.fatchMap = fatchMap; - this.fatchRuleMap = fatchRuleMap; - this.userMap = userMap; - this.dictDataList = dictDataList; - this.files = files; - this.deptMap = deptMap; - this.loginUser = loginUser; - this.maxBatchNumber = maxBatchNumber; - } - - @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, fatchMap, userMap, dictDataList, deptMap, loginUser,maxBatchNumber); - 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/FixSelectFlowDetailUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java deleted file mode 100644 index c37bcef..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java +++ /dev/null @@ -1,362 +0,0 @@ -package com.ruoyi.wisdomarbitrate.utils; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.ruoyi.common.constant.CaseApplicationConstants; -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.SealUtil; -import com.ruoyi.common.utils.file.SaaSAPIFileUtils; -import com.ruoyi.wisdomarbitrate.domain.*; -import com.ruoyi.wisdomarbitrate.mapper.*; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Transactional; - -import java.io.File; -import java.io.IOException; -import java.time.LocalDate; -import java.util.Date; -import java.util.List; -import java.util.UUID; - -@Component -public class FixSelectFlowDetailUtils { - - @Autowired - private CaseApplicationMapper caseApplicationMapper; - @Autowired - private SealSignRecordMapper sealSignRecordMapper; - @Autowired - private CaseAttachMapper caseAttachMapper; - @Autowired - private DeptIdentifyMapper deptIdentifyMapper; - @Autowired - private SealManageMapper sealManageMapper; - - /* - 定时查询签署流程详情 - */ - @Scheduled(cron = "0/10 * * * * ?") - @Transactional - public void fixExecuteSelectFlowDetailUtils() { - Gson gson = new Gson(); - - SealSignRecord sealSignRecordselect = new SealSignRecord(); - // sealSignRecordselect.setSignFlowStatus(1); - List sealSignRecords = sealSignRecordMapper.selectSealSignRecordbyStat(sealSignRecordselect); - - try { - if (sealSignRecords != null && sealSignRecords.size() > 0) { - for (int i = 0; i < sealSignRecords.size(); i++) { - SealSignRecord sealSignRecord = sealSignRecords.get(i); - EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord); - JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(), JsonObject.class); - JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data"); - JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray(); - Integer psnsignStatus = null; - Integer orgsignStatus = null; - for (int j = 0; j < signersArray.size(); j++) { - JsonObject signerObject = (JsonObject) signersArray.get(j); - - if (!(signerObject.get("psnSigner").toString()).equals("null")) { - JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner"); - if (psnSignerData != null) { - psnsignStatus = signerObject.get("signStatus").getAsInt(); - } - } - if (!(signerObject.get("orgSigner").toString()).equals("null")) { - JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner"); - if (orgSignerData != null) { - orgsignStatus = signerObject.get("signStatus").getAsInt(); - } - } - - } - if ((psnsignStatus.intValue() == 2) && (orgsignStatus.intValue() == 1)) { - //更新立案申请状态为待用印 - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(sealSignRecord.getCaseAppliId()); - - CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); - if (caseApplicationselect != null) { - if ((caseApplicationselect.getCaseStatus() != null) && (caseApplicationselect.getCaseStatus().intValue() == CaseApplicationConstants.SIGN_ARBITRATION)) { - caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL); - caseApplicationMapper.submitCaseApplication(caseApplication); - - //修改"签署用印记录表"的状态为待用印 - sealSignRecord.setSignFlowStatus(2); - sealSignRecordMapper.updataSealSignRecord(sealSignRecord); - } - } - - } - if ((psnsignStatus.intValue() == 2) && (orgsignStatus.intValue() == 2)) { - //更新立案申请状态为待送达 - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(sealSignRecord.getCaseAppliId()); - - CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); - if (caseApplicationselect != null) { - if ((caseApplicationselect.getCaseStatus() != null) && (caseApplicationselect.getCaseStatus().intValue() == CaseApplicationConstants.ARBITRATED_SEAL)) { - caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY); - //下载审核完成的裁决书, - String signFlowId = sealSignRecord.getSignFlowid(); - 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(); - //修改"签署用印记录表"的状态为签署完成 - sealSignRecord.setSignFlowStatus(3); - sealSignRecord.setFileDownloadUrl(fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1)); - sealSignRecordMapper.updataSealSignRecord(sealSignRecord); - - String filearbitraUrl = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1); - caseApplication.setFilearbitraUrl(filearbitraUrl); - caseApplicationMapper.submitCaseApplication(caseApplication); - - 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) { - Long caseAppliId = sealSignRecord.getCaseAppliId(); - CaseAttach caseAttach = new CaseAttach(); - caseAttach.setCaseAppliId(caseAppliId); - caseAttach.setAnnexType(3); - caseAttach.setAnnexPath(savePath); - caseAttach.setAnnexName(saveName); - caseAttachMapper.updateCaseAttachBycaseid(caseAttach); - } - - } - } - } - - } - } - - } - } catch (EsignDemoException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - - } - - /** - * 定时查询企业认证状态 - * - * @throws Exception - */ - @Scheduled(cron = "*/30 * * * * *") - @Transactional - public void fixExecuteSelectDeptIndentifyUtils() throws Exception { - Gson gson = new Gson(); - DeptIdentify deptIdentify = new DeptIdentify(); - List deptIdentifysnew = deptIdentifyMapper.selectDeptIdentify(deptIdentify); - if (deptIdentifysnew != null && deptIdentifysnew.size() > 0) { - for (int i = 0; i < deptIdentifysnew.size(); i++) { - DeptIdentify deptIdentify1 = deptIdentifysnew.get(i); - Integer identifyStatus = deptIdentify1.getIdentifyStatus(); - if (identifyStatus!=1){ - String authFlowId = deptIdentify1.getAuthFlowId(); - if (authFlowId != null) { - EsignHttpResponse identifyInfo = SignAward.getDeptIdentifyInfo(deptIdentify1); - JsonObject identifyInfoJsonObject = gson.fromJson(identifyInfo.getBody(), JsonObject.class); - int code = identifyInfoJsonObject.get("code").getAsInt(); - if (code == 0) { - JsonObject identifyInfoData = identifyInfoJsonObject.getAsJsonObject("data"); - int realnameStatus = identifyInfoData.get("realnameStatus").getAsInt(); - if (realnameStatus == 1) { - String orgId = identifyInfoData.get("orgId").getAsString(); - //查询企业内部印章 - EsignHttpResponse response = SignAward.deptIdentifySealList(orgId); - JsonObject jsonObject = gson.fromJson(response.getBody(), JsonObject.class); - int code1 = jsonObject.get("code").getAsInt(); - if (code1 == 0) { - JsonObject data = jsonObject.getAsJsonObject("data"); - JsonArray seals = data.get("seals").getAsJsonArray(); - if (seals.size() > 0) { - for (int j = 0; j < seals.size(); j++) { - //保存印章信息到数据库 - JsonObject asJsonObject = seals.get(j).getAsJsonObject(); - SealManage sealManage = new SealManage(); - String sealName = asJsonObject.get("sealName").toString(); - String sealId = asJsonObject.get("sealId").toString(); - String url = asJsonObject.get("sealImageDownloadUrl").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("-", "") + ".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(); - } - String fileDownloadUrlnew = url.substring(1, url.length() - 1); - boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath); - if (downLoadFile) { - CaseAttach caseAttach = new CaseAttach(); - caseAttach.setAnnexType(10); //10代表印章图片 - caseAttach.setAnnexPath(savePath); - caseAttach.setAnnexName(saveName); - 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(); - sealManage.setAnnexId(annexId1); - sealManage.setSealId(sealId1); - sealManage.setSealName(sealName1); - sealManage.setIdentifyId(deptIdentify1.getId()); - sealManage.setSealStatus(1); - sealManage.setIsUse(1); - sealManageMapper.insertSealManage(sealManage); - } - } - } - } - - } - //将orgId保存到数据库里 - deptIdentify1.setOrgId(orgId); - deptIdentify1.setIdentifyStatus(1); - deptIdentify1.setIsUse(0); //默认机构为未启用 - int row = deptIdentifyMapper.updateDeptIdentify(deptIdentify1); - } - }else { - deptIdentify1.setIdentifyStatus(2); - deptIdentifyMapper.updateDeptIdentify(deptIdentify1); - } - } - } - } - } - } - - - /** - * 定时查询印章审核状态 - */ - @Scheduled(cron = "0/30 * * * * ?") - @Transactional - public void searchForInstitutionalSeal() { - try { - SealManage sealManage = new SealManage(); - sealManage.setSealStatus(0); - List sealManageList = sealManageMapper.selectSealList(sealManage); - if (sealManageList != null && sealManageList.size() > 0) { - for (SealManage sealManage1 : sealManageList) { - //查询企业内部印章 - Integer annexId = sealManage1.getAnnexId(); - String sealId = sealManage1.getSealId(); - DeptIdentify deptIdentify = new DeptIdentify(); - deptIdentify.setId(sealManage1.getIdentifyId()); - List deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify); - if (deptIdentifies != null && deptIdentifies.size() > 0) { - DeptIdentify deptIdentify1 = deptIdentifies.get(0); - String orgId = deptIdentify1.getOrgId(); - if (orgId == null) { - continue; - } - if (annexId == null) { - //说明之前没有下载过 - 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(savePath); - caseAttach.setAnnexName(saveName); - int i1 = caseAttachMapper.save(caseAttach); - if (i1 > 0) { - //将附件id保存到公章管理表里 - Integer annexId1 = caseAttach.getAnnexId(); - sealManage1.setAnnexId(annexId1); - sealManage1.setSealStatus(1); - sealManage1.setIsUse(0); - sealManageMapper.updateSealManage(sealManage1); - } - } - } - } - } - } - - } - } - } catch (EsignDemoException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - } - -} - - diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/ImageToBase64Converter.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/ImageToBase64Converter.java index 752b36b..337099c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/ImageToBase64Converter.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/ImageToBase64Converter.java @@ -17,14 +17,4 @@ public class ImageToBase64Converter { String base64Image = Base64.getEncoder().encodeToString(imageBytes); return base64Image; } - - public static void main(String[] args) { - String imagePath = "D:\\develop\\2.jpg"; - try { - String base64Image = imageToBase64(imagePath); - System.out.println(base64Image); - } catch (Exception e) { - e.printStackTrace(); - } - } } \ No newline at end of file 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 5fc8e05..d667398 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,27 +1,20 @@ 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; -import com.google.gson.JsonObject; import com.ruoyi.common.core.domain.entity.EsignHttpResponse; import com.ruoyi.common.enums.EsignRequestType; import com.ruoyi.common.exception.EsignDemoException; -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.vo.StringIdsReq; import com.ruoyi.wisdomarbitrate.domain.DeptIdentify; import com.ruoyi.wisdomarbitrate.domain.SealSignRecord; -import java.io.File; -import java.util.Date; import java.util.List; import java.util.Map; -import java.util.UUID; public class SignAward { diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/UnZipFileUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/UnZipFileUtils.java index 3a6877d..bda8d05 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/UnZipFileUtils.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/UnZipFileUtils.java @@ -16,12 +16,6 @@ import java.util.zip.ZipFile; @Slf4j public class UnZipFileUtils { - public static void main(String[] args) { - File file = new File("D:\\home\\ruoyi\\仲裁委项目-测试单.zip"); - String targetPath = "D:\\home\\unzip\\"; - unZipFile(file,targetPath); - } - public static boolean unZipFile(File aboriginalFile, String targetPath) { if (!aboriginalFile.exists()) { log.error("此文件不存在:", aboriginalFile.getPath()); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/ZipFileUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/ZipFileUtils.java index 18e8d69..95c7ecb 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/ZipFileUtils.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/ZipFileUtils.java @@ -10,27 +10,6 @@ import java.util.zip.ZipOutputStream; public class ZipFileUtils { - public static void main(String[] args) { - String file1 = "F:\\testZip\\123.pdf"; - String file2 = "F:\\testZip\\456.png"; - String zipFileOutPath = "F:\\testZip\\outputfile123.zip"; - - try { - FileOutputStream zfous = new FileOutputStream(zipFileOutPath); - ZipOutputStream zipFileOutstream = new ZipOutputStream(zfous); - FileInputStream fis1 = new FileInputStream(file1); - FileInputStream fis2 = new FileInputStream(file2); - zipFile(file1, fis1, zipFileOutstream); - zipFile(file2, fis2, zipFileOutstream); - - zipFileOutstream.close(); - zfous.close(); - System.out.println("文件成功打包成ZIP文件!"); - } catch (IOException e) { - e.printStackTrace(); - } - } - public static void zipFile(String zipfilePath, FileInputStream zipFileinsteam, ZipOutputStream zipfileOut) throws IOException { ZipEntry zipfileEntry = new ZipEntry(new File(zipfilePath).getName()); diff --git a/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml index ca39f47..19bb650 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml @@ -18,7 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark - from sys_config + from ms_sys_config @@ -70,7 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - insert into sys_config ( + insert into ms_sys_config ( config_name, config_key, config_value, @@ -90,7 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - update sys_config + update ms_sys_config config_name = #{configName}, config_key = #{configKey}, @@ -104,11 +104,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from sys_config where config_id = #{configId} + delete from ms_sys_config where config_id = #{configId} - delete from sys_config where config_id in + delete from ms_sys_config where config_id in #{configId} diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml index 588b191..dd920cb 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -25,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.dept_type,d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time - from sys_dept d + from ms_sys_dept d select d.dept_id - from sys_dept d - left join sys_role_dept rd on d.dept_id = rd.dept_id + from ms_sys_dept d + left join ms_sys_role_dept rd on d.dept_id = rd.dept_id where rd.role_id = #{roleId} - and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId}) + and d.dept_id not in (select d.parent_id from ms_sys_dept d inner join ms_sys_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId}) order by d.parent_id, d.order_num - insert into sys_dept( + insert into ms_sys_dept( dept_id, parent_id, dept_name, @@ -122,7 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ); - insert into sys_dept( + insert into ms_sys_dept( dept_id, parent_id, dept_name, @@ -156,7 +156,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - update sys_dept + update ms_sys_dept parent_id = #{parentId}, dept_name = #{deptName}, @@ -174,7 +174,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - update sys_dept set ancestors = + update ms_sys_dept set ancestors = when #{item.deptId} then #{item.ancestors} @@ -187,14 +187,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - update sys_dept set status = '0' where dept_id in + update ms_sys_dept set status = '0' where dept_id in #{deptId} - update sys_dept set del_flag = '2' where dept_id = #{deptId} + update ms_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/SysDictDataMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml index 8da9030..10cab80 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml @@ -22,7 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark - from sys_dict_data + from ms_sys_dict_data @@ -57,22 +57,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from sys_dict_data where dict_code = #{dictCode} + delete from ms_sys_dict_data where dict_code = #{dictCode} - delete from sys_dict_data where dict_code in + delete from ms_sys_dict_data where dict_code in #{dictCode} - update sys_dict_data + update ms_sys_dict_data dict_sort = #{dictSort}, dict_label = #{dictLabel}, @@ -90,11 +90,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType} + update ms_sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType} - insert into sys_dict_data( + insert into ms_sys_dict_data( dict_sort, dict_label, dict_value, diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml index 55b4075..4bdf4c1 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml @@ -17,7 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select dict_id, dict_name, dict_type, status, create_by, create_time, remark - from sys_dict_type + from ms_sys_dict_type - delete from sys_dict_type where dict_id = #{dictId} + delete from ms_sys_dict_type where dict_id = #{dictId} - delete from sys_dict_type where dict_id in + delete from ms_sys_dict_type where dict_id in #{dictId} - update sys_dict_type + update ms_sys_dict_type dict_name = #{dictName}, dict_type = #{dictType}, @@ -85,7 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - insert into sys_dict_type( + insert into ms_sys_dict_type( dict_name, dict_type, status, diff --git a/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml index 822d665..37179ab 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml @@ -17,12 +17,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time) + insert into ms_sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time) values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate()) - delete from sys_logininfor where info_id in + delete from ms_sys_logininfor where info_id in #{infoId} - truncate table sys_logininfor + truncate table ms_sys_logininfor \ 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..0452bc1 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml @@ -29,7 +29,7 @@ select menu_id, menu_name, parent_id, order_num, path, component, `query`, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time - from sys_menu + from ms_sys_menu select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time - from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0 + from ms_sys_menu m where m.menu_type in ('M', 'C') and m.status = 0 order by m.parent_id, m.order_num select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time - from sys_menu m - 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 ro on ur.role_id = ro.role_id - left join sys_user u on ur.user_id = u.user_id + from ms_sys_menu m + left join ms_ms_sys_role_menu rm on m.menu_id = rm.menu_id + left join ms_ms_sys_user_role ur on rm.role_id = ur.role_id + left join ms_sys_role ro on ur.role_id = ro.role_id + left join ms_sys_user u on ur.user_id = u.user_id where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0 AND ro.status = 0 order by m.parent_id, m.order_num @@ -124,7 +124,7 @@ - update sys_menu + update ms_sys_menu menu_name = #{menuName}, parent_id = #{parentId}, @@ -156,7 +156,7 @@ - insert into sys_menu( + insert into ms_sys_menu( menu_id, parent_id, menu_name, @@ -196,7 +196,7 @@ - delete from sys_menu where menu_id = #{menuId} + delete from ms_sys_menu where menu_id = #{menuId} \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml index 65d3079..938fbbb 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml @@ -19,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select notice_id, notice_title, notice_type, cast(notice_content as char) as notice_content, status, create_by, create_time, update_by, update_time, remark - from sys_notice + from ms_sys_notice - insert into sys_notice ( + insert into ms_sys_notice ( notice_title, notice_type, notice_content, @@ -63,7 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - update sys_notice + update ms_sys_notice notice_title = #{noticeTitle}, notice_type = #{noticeType}, @@ -76,11 +76,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from sys_notice where notice_id = #{noticeId} + delete from ms_sys_notice where notice_id = #{noticeId} - delete from sys_notice where notice_id in + delete from ms_sys_notice where notice_id in #{noticeId} diff --git a/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml index 96bc621..ecc009b 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml @@ -26,11 +26,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time, cost_time - from sys_oper_log + from ms_sys_oper_log - insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, cost_time, oper_time) + insert into ms_sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, cost_time, oper_time) values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, #{costTime}, sysdate()) @@ -66,7 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from sys_oper_log where oper_id in + delete from ms_sys_oper_log where oper_id in #{operId} @@ -78,7 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - truncate table sys_oper_log + truncate table ms_sys_oper_log \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml index 99f37ce..960fa87 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml @@ -19,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark - from sys_post + from ms_sys_post select p.post_id - from sys_post p - left join sys_user_post up on up.post_id = p.post_id - left join sys_user u on u.user_id = up.user_id + from ms_sys_post p + left join ms_ms_sys_user_post up on up.post_id = p.post_id + left join ms_sys_user u on u.user_id = up.user_id where u.user_id = #{userId} @@ -78,7 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - update sys_post + update ms_sys_post post_code = #{postCode}, post_name = #{postName}, @@ -92,7 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - insert into sys_post( + insert into ms_sys_post( post_id, post_code, post_name, @@ -114,11 +114,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from sys_post where post_id = #{postId} + delete from ms_sys_post where post_id = #{postId} - delete from sys_post where post_id in + delete from ms_sys_post where post_id in #{postId} diff --git a/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml index 7c4139b..0b46a7b 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml @@ -10,22 +10,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from sys_role_dept where role_id=#{roleId} + delete from ms_sys_role_dept where role_id=#{roleId} - delete from sys_role_dept where role_id in + delete from ms_sys_role_dept where role_id in #{roleId} - insert into sys_role_dept(role_id, dept_id) values + insert into ms_sys_role_dept(role_id, dept_id) values (#{item.roleId},#{item.deptId}) diff --git a/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml index 783f153..d196e06 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml @@ -24,10 +24,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly, r.status, r.del_flag, r.create_time, r.remark - from sys_role r - left join sys_user_role ur on ur.role_id = r.role_id - left join sys_user u on u.user_id = ur.user_id - left join sys_dept d on u.dept_id = d.dept_id + from ms_sys_role r + left join ms_ms_sys_user_role ur on ur.role_id = r.role_id + left join ms_sys_user u on u.user_id = ur.user_id + left join ms_sys_dept d on u.dept_id = d.dept_id select r.role_id - from sys_role r - left join sys_user_role ur on ur.role_id = r.role_id - left join sys_user u on u.user_id = ur.user_id + from ms_sys_role r + left join ms_ms_sys_user_role ur on ur.role_id = r.role_id + left join ms_sys_user u on u.user_id = ur.user_id where u.user_id = #{userId} @@ -93,11 +93,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where r.role_key=#{roleKey} and r.del_flag = '0' limit 1 - insert into sys_role( + insert into ms_sys_role( role_id, role_name, role_key, @@ -125,7 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - update sys_role + update ms_sys_role role_name = #{roleName}, role_key = #{roleKey}, @@ -142,11 +142,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - update sys_role set del_flag = '2' where role_id = #{roleId} + update ms_sys_role set del_flag = '2' where role_id = #{roleId} - update sys_role set del_flag = '2' where role_id in + update ms_sys_role set del_flag = '2' where role_id in #{roleId} diff --git a/ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml index cb60a85..ee52afa 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml @@ -10,22 +10,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from sys_role_menu where role_id=#{roleId} + delete from ms_sys_role_menu where role_id=#{roleId} - delete from sys_role_menu where role_id in + delete from ms_sys_role_menu where role_id in #{roleId} - insert into sys_role_menu(role_id, menu_id) values + insert into ms_sys_role_menu(role_id, menu_id) values (#{item.roleId},#{item.menuId}) diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml index 20cdafe..6a946d5 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -52,19 +52,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,u.id_card - from sys_user u - left join sys_dept d on u.dept_id = d.dept_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 + from ms_sys_user u + left join ms_sys_dept d on u.dept_id = d.dept_id + left join ms_sys_user_role ur on u.user_id = ur.user_id + left join ms_sys_role r on r.role_id = ur.role_id select distinct u.user_id, u.dept_id, u.user_name, u.nick_name,u.id_card, u.email, u.phonenumber, u.status, u.create_time - from sys_user u - left join sys_dept d on u.dept_id = d.dept_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 + from ms_sys_user u + left join ms_sys_dept d on u.dept_id = d.dept_id + left join ms_sys_user_role ur on u.user_id = ur.user_id + left join ms_sys_role r on r.role_id = ur.role_id where u.del_flag = '0' and r.role_id = #{roleId} AND u.user_name like concat('%', #{userName}, '%') @@ -110,12 +110,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT ud.user_id , ud.nick_name ,ud.phonenumber ,ud.dept_id ,d.dept_name FROM (SELECT u.user_id , u.nick_name ,u.phonenumber ,u.dept_id - FROM sys_user_post up left join sys_user u on u.user_id = up.user_id - left join sys_post sp on up.post_id = sp.post_id - where sp.post_code = 'jbr') ud left join sys_dept d on ud.dept_id = d.dept_id + FROM ms_sys_user_post up left join ms_sys_user u on u.user_id = up.user_id + left join ms_sys_post sp on up.post_id = sp.post_id + where sp.post_code = 'jbr') ud left join ms_sys_dept d on ud.dept_id = d.dept_id where d.dept_id = #{deptId} select u.*,d.dept_name,ur.role_id - from sys_user u - left join sys_dept d on u.dept_id = d.dept_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 + from ms_sys_user u + left join ms_sys_dept d on u.dept_id = d.dept_id + left join ms_sys_user_role ur on u.user_id = ur.user_id + left join ms_sys_role r on r.role_id = ur.role_id where u.id_card = #{idCard} and u.del_flag = '0' and u.status='0' order by u.create_time limit 1 - insert into sys_user( + insert into ms_sys_user( user_id, dept_id, user_name, @@ -249,7 +249,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ) - insert into sys_user( + insert into ms_sys_user( user_id, dept_id, user_name, @@ -286,7 +286,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - update sys_user + update ms_sys_user dept_id = #{deptId}, user_name = #{userName}, @@ -308,31 +308,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - update sys_user set status = #{status} where user_id = #{userId} + update ms_sys_user set status = #{status} where user_id = #{userId} - update sys_user set avatar = #{avatar} where user_name = #{userName} + update ms_sys_user set avatar = #{avatar} where user_name = #{userName} - update sys_user set password = #{password} where user_name = #{userName} + update ms_sys_user set password = #{password} where user_name = #{userName} - update sys_user set del_flag = '2' where user_id = #{userId} + update ms_sys_user set del_flag = '2' where user_id = #{userId} - update sys_user set del_flag = '2' where user_id in + update ms_sys_user set del_flag = '2' where user_id in #{userId} diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml index 2b90bc4..0573881 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml @@ -10,22 +10,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from sys_user_post where user_id=#{userId} + delete from ms_sys_user_post where user_id=#{userId} - delete from sys_user_post where user_id in + delete from ms_sys_user_post where user_id in #{userId} - insert into sys_user_post(user_id, post_id) values + insert into ms_sys_user_post(user_id, post_id) values (#{item.userId},#{item.postId}) diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml index dd72689..f0a1fef 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml @@ -10,33 +10,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from sys_user_role where user_id=#{userId} + delete from ms_sys_user_role where user_id=#{userId} - delete from sys_user_role where user_id in + delete from ms_sys_user_role where user_id in #{userId} - insert into sys_user_role(user_id, role_id) values + insert into ms_sys_user_role(user_id, role_id) values (#{item.userId},#{item.roleId}) - delete from sys_user_role where user_id=#{userId} and role_id=#{roleId} + delete from ms_sys_user_role where user_id=#{userId} and role_id=#{roleId} - delete from sys_user_role where role_id=#{roleId} and user_id in + delete from ms_sys_user_role where role_id=#{roleId} and user_id in #{userId} diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml deleted file mode 100644 index 7947701..0000000 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - insert into arbitrate_record( - case_appli_id, - eviden_determi, - fact_determi, - case_sketch, - ruling_follows, - verifica_opinion, - arbitrate_think, - - check_opinion, - case_check_reject, - arbitrate_reject, - create_by, - case_focus, - case_facts, - respondent_opinion, - applicant_opinion, - create_time - )values( - #{caseAppliId}, - #{evidenDetermi}, - #{factDetermi}, - #{caseSketch}, - #{rulingFollows}, - #{verificaOpinion}, - #{arbitrateThink}, - #{checkOpinion}, - #{caseCheckReject}, - #{arbitrateReject}, - #{createBy}, - #{caseFocus}, - #{caseFacts}, - #{respondentOpinion}, - #{applicantOpinion}, - sysdate() - ) - - - - - update arbitrate_record - - eviden_determi = #{evidenDetermi}, - fact_determi = #{factDetermi}, - case_sketch = #{caseSketch}, - arbitrate_think = #{arbitrateThink}, - ruling_follows = #{rulingFollows}, - verifica_opinion = #{verificaOpinion}, - check_opinion = #{checkOpinion}, - arbitra_check_opinion = #{arbitraCheckOpinion}, - annex_id = #{annexId}, - update_by = #{updateBy}, - case_focus = #{caseFocus}, - case_facts = #{caseFacts}, - respondent_opinion = #{respondentOpinion}, - applicant_opinion = #{applicantOpinion}, - case_check_reject = #{caseCheckReject}, - arbitrate_reject = #{arbitrateReject}, - deptor_reject = #{deptorReject}, - update_time = sysdate() - - where id = #{id} - - - - - - - - - - - - - \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitratorMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitratorMapper.xml deleted file mode 100644 index e394d00..0000000 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitratorMapper.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateLogMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateLogMapper.xml deleted file mode 100644 index 6c8dab1..0000000 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateLogMapper.xml +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - (#{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} - ) - ; - - - - - - update case_affiliate_log - set - case_appli_log_id=#{caseAppliLogId}, - 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} - - - - - delete from case_affiliate_log where case_appli_log_id = #{caseAppliLogId} - - - - delete from case_affiliate_log where case_appli_log_id in - - #{item} - - - - - \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml deleted file mode 100644 index 1a29b3f..0000000 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml +++ /dev/null @@ -1,204 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - (#{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} - ) - - - - - - - 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} - - - - delete from case_affiliate where case_appli_id in - - #{item} - - - - delete from case_affiliate where case_appli_id = #{caseAppliId} - - - - \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml deleted file mode 100644 index 5aca5c5..0000000 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml +++ /dev/null @@ -1,291 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - insert into case_application_log( - id , - case_appli_id , - case_name , - case_num, - case_subject_amount, - - arbitrat_claims, - request_rule, - loan_start_date, - loan_end_date, - claim_princi_owed, - - claim_interest_owed, - claim_liquid_damag, - fee_payable, - contract_number, - create_by, - version, - update_submit_status, - proper_preser, - interest_rate, - outstanding_money, - facts, - party_a, - disputes, - loan_type, - loan_term, - mediation_agreement, - create_time - )values( - #{id} , - #{caseAppliId}, - #{caseName}, - #{caseNum}, - #{caseSubjectAmount}, - - #{arbitratClaims}, - #{requestRule}, - #{loanStartDate}, - #{loanEndDate}, - #{claimPrinciOwed}, - - #{claimInterestOwed}, - #{claimLiquidDamag}, - #{feePayable}, - #{contractNumber}, - #{createBy}, - #{version}, - #{updateSubmitStatus}, - #{properPreser}, - #{interestRate}, - #{outstandingMoney}, - #{facts}, - #{partyA}, - #{disputes}, - #{loanType}, - #{loanTerm}, - #{mediationAgreement}, - sysdate() - ) - - - insert into case_application_log( - id, - case_appli_id , - case_name , - case_num, - case_subject_amount, - arbitrat_claims, - request_rule, - loan_start_date, - loan_end_date, - claim_princi_owed, - claim_interest_owed, - claim_liquid_damag, - fee_payable, - contract_number, - create_by, - version, - update_submit_status, - proper_preser, - interest_rate, - outstanding_money, - facts, - party_a, - disputes, - loan_type, - loan_term, - mediation_agreement, - create_time - )values - - ( - id=#{item.id}, - #{item.caseAppliId}, - #{item.caseName}, - #{item.caseNum}, - #{item.caseSubjectAmount}, - #{item.arbitratClaims}, - #{item.requestRule}, - #{item.loanStartDate}, - #{item.loanEndDate}, - #{item.claimPrinciOwed}, - #{item.claimInterestOwed}, - #{item.claimLiquidDamag}, - #{item.feePayable}, - #{item.contractNumber}, - #{item.createBy}, - #{item.version}, - #{item.updateSubmitStatus}, - #{item.properPreser}, - #{item.interestRate}, - #{item.outstandingMoney}, - #{item.facts}, - #{item.partyA}, - #{item.disputes}, - #{item.loanType}, - #{item.loanTerm}, - #{item.mediationAgreement}, - sysdate() - ) - - - - update case_application_log - - - update_submit_status=#{updateSubmitStatus}, - - - - AND case_appli_id=#{caseId} - AND version=#{version} - - - - - - DELETE FROM case_application_log - WHERE id = #{id} - - - - delete from case_application_log l where l.id in - - #{item} - - ; - delete from case_affiliate_log l where l.case_appli_log_id in - - #{item} - - ; - 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} - - ; - - - - - - - - - - - - - \ 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 deleted file mode 100644 index 71c28e9..0000000 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ /dev/null @@ -1,1377 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - insert into case_application( - id , - case_name , - case_num, - case_subject_amount, - register_date, - arbitrat_method, - case_status, - hear_date, - arbitrat_claims, - request_rule, - loan_start_date, - loan_end_date, - claim_princi_owed, - - claim_interest_owed, - claim_liquid_damag, - fee_payable, - begin_video_date, - online_video_person, - - contract_number, - - adjudica_counter, - proper_preser, - - create_by, - import_flag, - version, - template_id, - facts, - mediation_agreement, - batch_number, - create_time - )values( - #{id} , - #{caseName}, - #{caseNum}, - #{caseSubjectAmount}, - sysdate(), - #{arbitratMethod}, - #{caseStatus}, - #{hearDate}, - #{arbitratClaims}, - #{requestRule}, - #{loanStartDate}, - #{loanEndDate}, - #{claimPrinciOwed}, - - #{claimInterestOwed}, - #{claimLiquidDamag}, - #{feePayable}, - #{beginVideoDate}, - #{onlineVideoPerson}, - - #{contractNumber}, - - #{adjudicaCounter}, - #{properPreser}, - - #{createBy}, - #{importFlag}, - #{version}, - #{templateId}, - - #{facts}, - #{mediationAgreement}, - #{batchNumber}, - sysdate() - ) - - - insert into case_application( - id, - case_name , - case_num, - case_subject_amount, - register_date, - arbitrat_method, - case_status, - hear_date, - arbitrat_claims, - request_rule, - loan_start_date, - loan_end_date, - claim_princi_owed, - - claim_interest_owed, - claim_liquid_damag, - fee_payable, - begin_video_date, - online_video_person, - - contract_number, - - adjudica_counter, - proper_preser, - - create_by, - import_flag, - version, - 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.claimInterestOwed}, - #{item.claimLiquidDamag}, - #{item.feePayable}, - #{item.beginVideoDate}, - #{item.onlineVideoPerson}, - - #{item.contractNumber}, - - #{item.adjudicaCounter}, - #{item.properPreser}, - - #{item.createBy}, - #{item.importFlag}, - #{item.version}, - #{item.templateId}, - - #{item.facts}, - #{item.mediationAgreement}, - #{item.batchNumber}, - sysdate() - ) - ; - - - - update case_application - - case_subject_amount = #{caseSubjectAmount}, - register_date = #{registerDate}, - arbitrat_method = #{arbitratMethod}, - hear_date = #{hearDate}, - arbitrat_claims = #{arbitratClaims}, - request_rule = #{requestRule}, - loan_start_date = #{loanStartDate}, - loan_end_date = #{loanEndDate}, - claim_princi_owed = #{claimPrinciOwed}, - claim_interest_owed = #{claimInterestOwed}, - claim_liquid_damag = #{claimLiquidDamag}, - fee_payable = #{feePayable}, - begin_video_date = #{beginVideoDate}, - online_video_person = - #{onlineVideoPerson}, - - - contract_number = #{contractNumber}, - - case_name = #{caseName}, - case_describe = #{caseDescribe}, - 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}, - - 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}, - case_result = #{caseResult}, - is_agree_pend_tral = #{isAgreePendTral}, - adjudica_counter = #{adjudicaCounter}, - objecti_juris = #{objectiJuris}, - - is_absence = #{isAbsence}, - appli_is_absen = #{appliIsAbsen}, - respon_cross_opin = #{responCrossOpin}, - 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}, - - - where id = #{id} - - - update case_application set pay_type=#{payType} where id in - - #{caseId} - - - - update case_application set lock_status=#{lockStatus} where id = #{id} - - - update case_application set room_id=#{roomId} where id = #{caseId} - - - - - update case_application set version = #{version} where id = #{id} - - - - delete from case_application where id = #{id} - - - delete from case_application - 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} - ; - - - - - - - - - - - - - - - - - - - - diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachLogMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachLogMapper.xml index fc95fc3..65673ac 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachLogMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachLogMapper.xml @@ -16,18 +16,18 @@ - INSERT INTO case_attach_log (case_appli_log_id, annex_id,annex_name, annex_path , annex_type,note,use_id,use_account,seal_status) + INSERT INTO ms_case_attach_log (case_appli_log_id, annex_id,annex_name, annex_path , annex_type,note,use_id,use_account,seal_status) VALUES (#{caseAppliLogId},#{annexId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName},#{sealStatus}) - INSERT INTO case_attach_log (case_appli_log_id, annex_id,annex_name, annex_path , annex_type,note,use_id,use_account,seal_status) + INSERT INTO ms_case_attach_log (case_appli_log_id, annex_id,annex_name, annex_path , annex_type,note,use_id,use_account,seal_status) VALUES (#{item.caseAppliLogId},#{item.annexId}, #{item.annexName}, #{item.annexPath},#{item.annexType},#{item.note},#{item.userId},#{item.userName},#{item.sealStatus}) - delete from case_attach_log + delete from ms_case_attach_log where annex_id in #{id} @@ -36,13 +36,13 @@ select * - from case_attach_log + from ms_case_attach_log AND case_appli_log_id = #{caseLogId} @@ -73,7 +73,7 @@ - update case_attach_log + update ms_case_attach_log set case_appli_log_id= #{caseAppliLogId} where annex_id = #{annexId} - update case_attach_log + update ms_case_attach_log annex_name = #{annexName}, annex_path = #{annexPath} diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml index af5aa3a..7abee19 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml @@ -15,11 +15,11 @@ - 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 ms_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) + INSERT INTO ms_case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,is_batch_upload) VALUES @@ -28,14 +28,14 @@ - delete from case_attach + delete from ms_case_attach where annex_id in #{id} - delete from case_attach + delete from ms_case_attach where case_appli_id = #{caseAppliId} and annex_type = #{annexType} @@ -45,13 +45,13 @@ - delete from case_attach + delete from ms_case_attach where case_appli_id = #{caseAppliId} and annex_type = #{annexType} - update case_attach + update ms_case_attach set case_appli_id= #{caseAppliId} where annex_id = #{annexId} - update case_attach + update ms_case_attach annex_name = #{annexName}, annex_path = #{annexPath} diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceDirectoryMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceDirectoryMapper.xml deleted file mode 100644 index 7f01efb..0000000 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceDirectoryMapper.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - insert into case_evidence_directory( - parent_id, - evidence_name, - annex_id, - series, - case_appli_id, - create_by, - create_time - )values( - #{parentId}, - #{evidenceName}, - #{annexId}, - #{series}, - #{caseId}, - #{createBy}, - sysdate() - ) - - - - - - \ 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 deleted file mode 100644 index 445d757..0000000 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - \ 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..3af330f 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml @@ -16,12 +16,12 @@ - insert into case_log_record(case_appli_id, case_node,case_node_time,notes,create_by,create_nick_name,create_time,update_by,update_time ) values( + insert into ms_case_log_record(case_appli_id, case_node,case_node_time,notes,create_by,create_nick_name,create_time,update_by,update_time ) values( #{caseAppliId},#{caseNode},sysdate(),#{notes},#{createBy},#{createNickName},sysdate(),#{updateBy},sysdate() ) - insert into case_log_record(case_appli_id, case_node,case_node_time,notes,create_by,create_nick_name,create_time,update_by,update_time ) values + insert into ms_case_log_record(case_appli_id, case_node,case_node_time,notes,create_by,create_nick_name,create_time,update_by,update_time ) values ( #{item.caseAppliId},#{item.caseNode},sysdate(),#{item.notes},#{item.createBy},#{item.createNickName},sysdate(),#{item.updateBy},sysdate() @@ -50,7 +50,7 @@ when 15 then '法律顾问' when 16 then '法律顾问' ELSE '无角色' END roleName - from case_log_record cl + from ms_case_log_record cl diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseNumRuleMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseNumRuleMapper.xml index ff63487..887f0f3 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseNumRuleMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseNumRuleMapper.xml @@ -14,7 +14,7 @@ - insert into case_num_rule( + insert into ms_case_num_rule( rule_type, prefixstr, date_format, @@ -36,7 +36,7 @@ - update case_num_rule + update ms_case_num_rule rule_type = #{ruleType}, prefixstr = #{prefixstr}, @@ -52,12 +52,12 @@ - delete from case_num_rule where id = #{id} + delete from ms_case_num_rule where id = #{id} - select count(1) from case_num_rule c + select count(1) from ms_case_num_rule c AND c.prefixstr = #{prefixstr} @@ -92,7 +92,7 @@ - select c.id ,c.case_id ,c.order_number ,c.payment_time ,c.create_time ,c.update_time ,c.payment_status - from case_payment_record c - - - AND c.order_number = #{orderNumber} - - - - - \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ColumnValueLogMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ColumnValueLogMapper.xml index 661195d..3aa67ea 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ColumnValueLogMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ColumnValueLogMapper.xml @@ -11,7 +11,7 @@ - INSERT INTO column_value_log ( `COLUMN`, `NAME`, `VALUE`, case_appli_log_id,is_default ) + INSERT INTO ms_column_value_log ( `COLUMN`, `NAME`, `VALUE`, case_appli_log_id,is_default ) values @@ -19,11 +19,11 @@ - update column_value_log + update ms_column_value_log `VALUE` = #{item.value}, @@ -34,7 +34,7 @@ - select * from column_value where case_id=#{caseId} + select * from ms_column_value where case_id=#{caseId} select f.id ,f.file_name ,f.start_content ,f.end_content , f.`column` , ifnull(f.is_default,0) is_default ,f.`column_name`,ifnull(f.start_content_repeat_order,1) start_content_repeat_order,ifnull(f.end_content_repeat_order,1) end_content_repeat_order,ifnull(f.fatch_order,0) fatch_order - from fatch_rule f join template_fatch_rule tfr on f.id=tfr.fatch_rule_id + from ms_fatch_rule f join ms_template_fatch_rule tfr on f.id=tfr.ms_fatch_rule_id where tfr.template_id=#{templateId} SELECT f.id ,f.file_name ,f.start_content ,f.end_content , f.`column` ,f.is_default ,f.`column_name` - FROM fatch_rule f + FROM ms_fatch_rule f AND f.is_default = #{isDefault} @@ -81,14 +81,14 @@ - delete from fatch_rule where id in + delete from ms_fatch_rule where id in #{item} - insert into fatch_rule( + insert into ms_fatch_rule( file_name, start_content, end_content, diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml index 6a6d971..b230753 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml @@ -16,7 +16,7 @@ - insert into identi_authenti( + insert into ms_identi_authenti( user_id, id_address, name, @@ -39,7 +39,7 @@ ) - update identi_authenti + update ms_identi_authenti user_id = #{userId}, user_name = #{userName}, @@ -52,7 +52,7 @@ select id, case_id caseId,room_id roomId,schedule_start_time scheduleStartTime,schedule_end_time scheduleEndTime,user_id userId - from reserved_conference where case_id=#{caseId} + from ms_reserved_conference where case_id=#{caseId} diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealManageMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealManageMapper.xml index a801287..417865b 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealManageMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealManageMapper.xml @@ -15,7 +15,7 @@ - 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 - from seal_sign_record s - - - AND s.sign_flow_status = #{signFlowStatus} - - - AND s.case_appli_id = #{caseAppliId} - - - - - - - - - - update seal_sign_record - - sign_flow_status = #{signFlowStatus}, - file_download_url = #{fileDownloadUrl} - - 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 index b93e36d..7e9439a 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SendMailRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SendMailRecordMapper.xml @@ -19,7 +19,7 @@ - select count(1) from template_fatch_rule t + select count(1) from ms_template_fatch_rule t AND t.template_id = #{templateId} @@ -21,7 +21,7 @@ - delete from template_fatch_rule where template_id=#{id} + delete from ms_template_fatch_rule where template_id=#{id} - insert into template_fatch_rule( + insert into ms_template_fatch_rule( template_id, fatch_rule_id )values( diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/TemplateManageMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/TemplateManageMapper.xml index 33af308..fd5adb6 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/TemplateManageMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/TemplateManageMapper.xml @@ -16,7 +16,7 @@ - insert into template_manage( + insert into ms_template_manage( identify_id, tem_name, tem_type, @@ -40,7 +40,7 @@ - update template_manage + update ms_template_manage identify_id = #{identifyId}, tem_name = #{temName}, @@ -63,7 +63,7 @@ - SELECT id, name ,content , type - FROM template_manual - - - AND id = #{id} - - - AND name = #{name} - - - AND content = #{content} - - - AND type = #{type} - - AND del_flag =0 - - - - \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/WeChatUserMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/WeChatUserMapper.xml index d15e498..edf0f07 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/WeChatUserMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/WeChatUserMapper.xml @@ -15,7 +15,7 @@ - insert into identi_authenti( + insert into ms_ms_identi_authenti( name, identity_no, certification_time, @@ -39,7 +39,7 @@ ) - update identi_authenti + update ms_ms_identi_authenti phone = #{phone}, email = #{email}, @@ -50,11 +50,11 @@