Merge branch 'qtz5' of SH-Arbitrate/Arbitrate-Backend into dev

This commit was merged in pull request #328.
This commit is contained in:
qtz
2024-01-05 14:49:01 +08:00
committed by Gitea
10 changed files with 202 additions and 1 deletions
@@ -39,6 +39,18 @@ public class AdjudicationController extends BaseController {
return success(sealSignRecordselect); return success(sealSignRecordselect);
} }
/**
* 根据批号查询批量签名链接
*/
@PostMapping("/selectBatchSignUrl")
public AjaxResult getSignUrlBatch(@RequestBody StringIdsReq idsReq) {
if(StrUtil.isEmpty(idsReq.getBatchNumber().toString())|| StrUtil.isEmpty(idsReq.getPsnAccount())){
return error("参数校验失败");
}
SealSignRecord sealSignRecordselect = adjudicationService.getSignUrlBatch(idsReq);
return success(sealSignRecordselect);
}
/** /**
* 根据签署流程id查询批量用印链接 * 根据签署流程id查询批量用印链接
*/ */
@@ -62,6 +74,18 @@ public class AdjudicationController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
/**
* 根据批号查询批量用印链接
*/
@PostMapping("/getSealUrlBatch")
public AjaxResult getSealUrlBatch(@RequestBody StringIdsReq idsReq) {
if(StrUtil.isEmpty(idsReq.getBatchNumber().toString())|| StrUtil.isEmpty(idsReq.getPsnAccount())){
return error("参数校验失败");
}
SealSignRecord sealSignRecordselect = adjudicationService.getSealUrlBatch(idsReq);
return success(sealSignRecordselect);
}
/** /**
* 生成裁决书 * 生成裁决书
@@ -54,4 +54,14 @@ public class CaseArbitrateController extends BaseController {
return caseArbitrateService.writtenHear(caseIds); return caseArbitrateService.writtenHear(caseIds);
} }
/**
* 批量书面审理
* @param
* @return
*/
@PostMapping("/writtenHearBatch")
public AjaxResult writtenHearBatch(@Validated @RequestBody CaseApplication caseApplication){
return caseArbitrateService.writtenHearBatch(caseApplication);
}
} }
@@ -19,4 +19,8 @@ public class StringIdsReq {
* 机构账户 * 机构账户
*/ */
private String orgId ; private String orgId ;
/**
* 批号
*/
private Integer batchNumber;
} }
@@ -417,5 +417,5 @@ public class CaseApplication extends BaseEntity {
*/ */
private Integer pendingStatus; private Integer pendingStatus;
/** e签宝流程id */ /** e签宝流程id */
private String signFlowId;; private String signFlowId;
} }
@@ -29,4 +29,6 @@ public interface SealSignRecordMapper {
void insertSealSignRecord(SealSignRecord sealSignRecord); void insertSealSignRecord(SealSignRecord sealSignRecord);
List<CaseApplication> selectsignFlow(@Param("batchNumber") Integer batchNumber,@Param("caseStatus") Integer caseStatus);
} }
@@ -57,4 +57,8 @@ public interface IAdjudicationService {
List<CaseApplication> selectSealSigning(String personAccount,Integer caseStatus); List<CaseApplication> selectSealSigning(String personAccount,Integer caseStatus);
SealSignRecord selectBatchSealUrl(StringIdsReq idsReq); SealSignRecord selectBatchSealUrl(StringIdsReq idsReq);
SealSignRecord getSignUrlBatch(StringIdsReq idsReq);
SealSignRecord getSealUrlBatch(StringIdsReq idsReq);
} }
@@ -16,4 +16,6 @@ public interface ICaseArbitrateService {
AjaxResult examineArbitrateMethod(CaseApplication caseApplication, Integer opinion, Integer arbitratMethod); AjaxResult examineArbitrateMethod(CaseApplication caseApplication, Integer opinion, Integer arbitratMethod);
AjaxResult examineArbitrateMethodBatch(CaseApplication caseApplication); AjaxResult examineArbitrateMethodBatch(CaseApplication caseApplication);
AjaxResult writtenHearBatch(CaseApplication caseApplication);
} }
@@ -1429,6 +1429,106 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
return signRecord; return signRecord;
} }
@Override
public SealSignRecord getSignUrlBatch(StringIdsReq idsReq) {
SealSignRecord signRecord = new SealSignRecord();
try {
EsignHttpResponse identityInfo = SignAward.identityInfo(idsReq);
Gson gson = new Gson();
if (StrUtil.isNotEmpty(identityInfo.getBody())) {
JsonObject identityInfoJsonObject = gson.fromJson(identityInfo.getBody(), JsonObject.class);
if (identityInfoJsonObject != null && !identityInfoJsonObject.get("data").isJsonNull()) {
JsonObject identityInfoData = identityInfoJsonObject.getAsJsonObject("data");
if (identityInfoData != null && !identityInfoData.get("psnId").isJsonNull()) {
idsReq.setPsnId(identityInfoData.get("psnId").getAsString());
}
}
}
if (StrUtil.isEmpty(idsReq.getPsnId())) {
throw new ServiceException("该用户未认证");
}
Integer batchNumber = idsReq.getBatchNumber();
Integer caseStatus = CaseApplicationConstants.SIGN_ARBITRATION;
List<CaseApplication> caseApplications = sealSignRecordMapper.selectsignFlow(batchNumber,caseStatus);
if (caseApplications != null && caseApplications.size() > 0) {
List<String> signFlowIds = caseApplications.stream().map(CaseApplication::getSignFlowId).collect(Collectors.toList());
idsReq.setIds(signFlowIds);
EsignHttpResponse batchSignUrl = SignAward.batchSignUrl(idsReq);
if (StrUtil.isNotEmpty(batchSignUrl.getBody())) {
JsonObject signUrlJsonObject = gson.fromJson(batchSignUrl.getBody(), JsonObject.class);
if (signUrlJsonObject != null && !signUrlJsonObject.get("data").isJsonNull()) {
JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
if (signUrlData != null && !signUrlData.get("batchSignUrlWithoutLogin").isJsonNull()) {
// 免登录批量签链接(链接有效期2小时)
String url = signUrlData.get("batchSignUrlWithoutLogin").getAsString();
// batchSignUrl 需登录批量签链接(链接有效期2小时),batchSignShortUrl需登录批量签短链接(链接有效期2小时),batchSignShortUrlWithoutLogin免登录批量签短链接(链接有效期2小时)
signRecord.setSignUrl(url);
}
}
}
}else{
throw new ServiceException("这个批号没有批量签名的案件");
}
} catch (EsignDemoException e) {
e.printStackTrace();
}
return signRecord;
}
@Override
public SealSignRecord getSealUrlBatch(StringIdsReq idsReq) {
SealSignRecord signRecord = new SealSignRecord();
try {
EsignHttpResponse identityInfo = SignAward.identityInfo(idsReq);
Gson gson = new Gson();
if (StrUtil.isNotEmpty(identityInfo.getBody())) {
JsonObject identityInfoJsonObject = gson.fromJson(identityInfo.getBody(), JsonObject.class);
if(identityInfoJsonObject!=null&&!identityInfoJsonObject.get("data").isJsonNull()) {
JsonObject identityInfoData = identityInfoJsonObject.getAsJsonObject("data");
if (identityInfoData != null && !identityInfoData.get("psnId") .isJsonNull()) {
idsReq.setPsnId(identityInfoData.get("psnId").getAsString());
}
}
}
if (StrUtil.isEmpty(idsReq.getPsnId())) {
throw new ServiceException("该用户未认证");
}
Integer batchNumber = idsReq.getBatchNumber();
Integer caseStatus = CaseApplicationConstants.ARBITRATED_SEAL;
List<CaseApplication> caseApplications = sealSignRecordMapper.selectsignFlow(batchNumber,caseStatus);
if (caseApplications != null && caseApplications.size() > 0) {
List<String> signFlowIds = caseApplications.stream().map(CaseApplication::getSignFlowId).collect(Collectors.toList());
idsReq.setIds(signFlowIds);
EsignHttpResponse batchSignUrl = SignAward.batchSignUrl(idsReq);
if (StrUtil.isNotEmpty(batchSignUrl.getBody())) {
JsonObject signUrlJsonObject = gson.fromJson(batchSignUrl.getBody(), JsonObject.class);
if (signUrlJsonObject != null && !signUrlJsonObject.get("data").isJsonNull()) {
JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
if (signUrlData != null&& !signUrlData.get("batchSignUrlWithoutLogin").isJsonNull()) {
// 免登录批量签链接(链接有效期2小时)
String url = signUrlData.get("batchSignUrlWithoutLogin").getAsString();
// batchSignUrl 需登录批量签链接(链接有效期2小时),batchSignShortUrl需登录批量签短链接(链接有效期2小时),batchSignShortUrlWithoutLogin免登录批量签短链接(链接有效期2小时)
signRecord.setSignUrl(url);
}
}
}
}else{
throw new ServiceException("这个批号没有批量用印的案件");
}
} catch (EsignDemoException e) {
e.printStackTrace();
}
return signRecord;
}
/** /**
* 根据仲裁员手机号分页查询等待签署,签署中的裁决书 * 根据仲裁员手机号分页查询等待签署,签署中的裁决书
* *
@@ -239,6 +239,46 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
return AjaxResult.success(); return AjaxResult.success();
} }
@Override
@Transactional
public AjaxResult writtenHearBatch(CaseApplication caseApplicationparam) {
CaseApplication caseApplicationsel = new CaseApplication();
caseApplicationsel.setBatchNumber(caseApplicationparam.getBatchNumber());
caseApplicationsel.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR);
List<CaseApplication> caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel);
if (caseApplications1 != null && caseApplications1.size() > 0) {
List<Long> ids = caseApplications1.stream().map(CaseApplication::getId).collect(Collectors.toList());
for (Long caseId : ids) {
//查询案件详情
CaseApplication caseApplication = new CaseApplication();
caseApplication.setId(caseId);
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
//案件日志表里添加数据
CaseLogRecord caseLogRecord = new CaseLogRecord();
caseLogRecord.setCaseAppliId(caseApplication1.getId());
caseLogRecord.setCaseNode(caseApplication1.getCaseStatus());
caseLogRecord.setCreateBy(getUsername());
caseLogRecordMapper.insertCaseLogRecord(caseLogRecord);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, "");
// 生成裁决书
CaseApplication application = new CaseApplication();
application.setId(caseId);
adjudicationService.createDocument(application);
//修改案件状态
caseApplication1.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
int i = caseApplicationMapper.submitCaseApplication(caseApplication1);
}
}else{
throw new ServiceException("这个批号没有批量书面审理的案件");
}
return AjaxResult.success();
}
@Override @Override
@Transactional @Transactional
public AjaxResult writtenHear(CaseIds caseIds) { public AjaxResult writtenHear(CaseIds caseIds) {
@@ -81,6 +81,21 @@
order by c.case_num desc order by c.case_num desc
</select> </select>
<select id="selectsignFlow" resultType="com.ruoyi.wisdomarbitrate.domain.CaseApplication">
SELECT s.sign_flow_id signFlowId,c.id id,c.case_status caseStatus,
c.arbitrator_id arbitratorId,
c.arbitrator_name arbitratorName
from seal_sign_record s
join case_application c on s.case_appli_id=c.id
WHERE c.lock_status = 0
<if test="batchNumber != null">
AND c.batch_number = #{batchNumber}
</if>
<if test="caseStatus != null">
AND c.case_status = #{caseStatus}
</if>
</select>
<update id="updataSealSignRecord" parameterType="SealSignRecord"> <update id="updataSealSignRecord" parameterType="SealSignRecord">
update seal_sign_record update seal_sign_record