1.1.0版本发布 #130

Merged
wangqiong123 merged 6 commits from dev into prod 2024-03-20 06:01:09 +00:00
6 changed files with 109 additions and 3 deletions
@@ -77,6 +77,22 @@ public class MsSignSealController extends BaseController {
}
/**
* 印章审核回调
*/
@Anonymous
@PostMapping("/sealCheckCallback")
public AjaxResult sealCheckCallback() throws Exception {
boolean checkResult= SignVerifyUtils.checkSignuter();
if(checkResult){
String reqbodystr =SignVerifyUtils.getRequestBody();
return msSignSealService.sealCheckCallback(reqbodystr);
}else {
return AjaxResult.error("error");
}
}
/**
* 查询案件进度
*/
@@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.mapper.dept;
import com.ruoyi.wisdomarbitrate.domain.dto.dept.DeptIdentify;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.entity.Example;
import java.util.List;
@@ -24,4 +25,5 @@ public interface DeptIdentifyMapper {
* @return
*/
String selectById(@Param("id") Long identifyId);
}
@@ -37,4 +37,6 @@ public interface MsSignSealService {
AjaxResult msCaseSignUrlResAPP(MsSignSealDTO dto) throws EsignDemoException;
AjaxResult signSeaalCaseApplicaCallback(String reqbodystr) throws EsignDemoException, IOException;
AjaxResult sealCheckCallback(String reqbodystr) throws EsignDemoException, IOException;
}
@@ -235,7 +235,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
if (CollectionUtil.isNotEmpty(list)) {
// 判断调解员签名按钮权限,0-显示,1-不显示
for (MsCaseApplicationVO vo : list) {
if (isMediatorRole && vo.getMediaResult()!=null && vo.getMediaResult()==5) {
// 如果是调解员并且是和解协议并且是代签名状态,不显示
if (isMediatorRole && vo.getMediaResult()!=null && vo.getMediaResult()==5 && vo.getCaseStatusName().equals("待签名")) {
// 是调解员并且是和解协议,不显示
vo.setSignButtonFlag(1);
@@ -2965,6 +2966,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
* @param req
* @return
*/
@Transactional
@Override
public AjaxResult confirmMeetingResult(MsCaseApplicationReq req) {
// 查询案件是否存在
@@ -2989,6 +2991,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
}
AjaxResult result = caseApplicationService.generateApplication(req);
// 修改案件结果
application.setMediaResult(req.getMediaResult());
msCaseApplicationMapper.updateByPrimaryKeySelective(application);
return AjaxResult.success();
}
@@ -1056,8 +1056,6 @@ public class MsSignSealServiceImpl implements MsSignSealService {
MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(caseApplicationselect.getCaseFlowId());
Integer caseNode = currentFlow.getNodeId();
String caseStatusName = currentFlow.getCaseStatusName();
if("SIGN_MISSON_COMPLETE".equals(action) && signResult==2){
if(mediaResult.intValue()==1){
//调解
@@ -1344,6 +1342,86 @@ public class MsSignSealServiceImpl implements MsSignSealService {
return AjaxResult.success("success");
}
@Override
@Transactional(rollbackFor = Exception.class)
public AjaxResult sealCheckCallback(String reqbodystr) throws EsignDemoException, IOException {
JSONObject jsonObjectCallback = JSONObject.parseObject(reqbodystr);
Gson gson = new Gson();
if (jsonObjectCallback != null) {
int auditStatus = jsonObjectCallback.getIntValue("auditStatus");
String action = jsonObjectCallback.getString("action");
String orgId = jsonObjectCallback.getString("orgId");
String sealId = jsonObjectCallback.getString("sealId");
SealManage sealManage = new SealManage();
DeptIdentify deptIdentify1 = new DeptIdentify();
deptIdentify1.setOrgId(orgId);
List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify1);
if (deptIdentifies != null && deptIdentifies.size() > 0) {
Long iddeptIdent = deptIdentifies.get(0).getId();
SealManage sealManageSel = new SealManage();
sealManageSel.setIdentifyId(iddeptIdent);
sealManageSel.setSealId(sealId);
List<String> sealIdList = new ArrayList<>();
List<SealManage> selectSealList = sealManageMapper.selectSealList(sealManageSel);
if (selectSealList != null && selectSealList.size() > 0) {
sealManage = selectSealList.get(0);
}
}
if("SEAL_AUDIT".equals(action) && auditStatus==1){
EsignHttpResponse response = SignAward.getOrgSeal(orgId, sealId);
JSONObject jsonObject = JSONObject.parseObject(response.getBody());
int code = jsonObject.getIntValue("code");
if (code == 0) {
JSONObject data = jsonObject.getJSONObject("data");
int sealStatus = data.getIntValue("sealStatus");
if (sealStatus == 1) {//印章状态 1已启用,2待审核,3审核不通过,4 挂起
//已启用证明审核通过,下载到数据库
String sealImageDownloadUrl = data.getString("sealImageDownloadUrl");
LocalDate now = LocalDate.now();
String year = Integer.toString(now.getYear());
String month = String.format("%02d", now.getMonthValue());
String day = String.format("%02d", now.getDayOfMonth());
String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
String fileName = UUID.randomUUID().toString().replace("-", "") + ".jpg";
String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
String savePath = "/home/ruoyi/uploadPath/upload/";
// 创建日期目录
File saveFolder = new File(saveFolderPath);
if (!saveFolder.exists()) {
saveFolder.mkdirs();
}
String resultFilePath = saveFolderPath + "/" + fileName;
File resultFilePathFile = new File(resultFilePath);
if (!resultFilePathFile.exists()) {
resultFilePathFile.createNewFile();
}
boolean downLoadFile = FileTransformation.downLoadFileByUrl(sealImageDownloadUrl, resultFilePath);
if (downLoadFile) {
MsCaseAttach caseAttach = new MsCaseAttach();
caseAttach.setAnnexType(AnnexTypeEnum.SEAL_PICTURE.getCode()); //10代表印章图片
caseAttach.setAnnexPath(savePath);
caseAttach.setAnnexName(saveName);
int i1 = caseAttachMapper.save(caseAttach);
if (i1 > 0) {
//将附件id保存到公章管理表里
Long annexId1 = caseAttach.getAnnexId();
sealManage.setAnnexId(annexId1);
sealManage.setSealStatus(1);
sealManage.setIsUse(0);
sealManageMapper.updateSealManage(sealManage);
}
}
}
}
}
}else{
return AjaxResult.error("error");
}
return AjaxResult.success("success");
}
/**
* 通过邮件发送裁决书文件
*
@@ -23,6 +23,9 @@
<if test="sealStatus != null">
AND seal_status = #{sealStatus}
</if>
<if test="sealId != null and sealId != ''">
AND seal_id = #{sealId}
</if>
</where>
</select>