|
@@ -1,10 +1,9 @@
|
|
|
package me.zhengjie.application.admin.service.impl;
|
|
package me.zhengjie.application.admin.service.impl;
|
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
-
|
|
|
|
|
-import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
import me.zhengjie.application.admin.controller.vo.*;
|
|
import me.zhengjie.application.admin.controller.vo.*;
|
|
|
import me.zhengjie.application.bank.controller.vo.OrderDetailDto;
|
|
import me.zhengjie.application.bank.controller.vo.OrderDetailDto;
|
|
|
import me.zhengjie.dao.mybatis.ContractOrderRepository;
|
|
import me.zhengjie.dao.mybatis.ContractOrderRepository;
|
|
@@ -14,7 +13,6 @@ import me.zhengjie.base.AppResultData;
|
|
|
import me.zhengjie.dao.mybatis.mapper.*;
|
|
import me.zhengjie.dao.mybatis.mapper.*;
|
|
|
import me.zhengjie.application.bank.service.FileInfoService;
|
|
import me.zhengjie.application.bank.service.FileInfoService;
|
|
|
import me.zhengjie.application.bank.service.BankOrderService;
|
|
import me.zhengjie.application.bank.service.BankOrderService;
|
|
|
-import me.zhengjie.application.bank.service.impl.NotaryNoteServiceImpl;
|
|
|
|
|
import me.zhengjie.application.bank.controller.vo.BankCustomerVo;
|
|
import me.zhengjie.application.bank.controller.vo.BankCustomerVo;
|
|
|
import me.zhengjie.application.bank.controller.vo.FileVo;
|
|
import me.zhengjie.application.bank.controller.vo.FileVo;
|
|
|
import me.zhengjie.base.ResultCode;
|
|
import me.zhengjie.base.ResultCode;
|
|
@@ -126,7 +124,13 @@ public class AdminOrderServiceImpl implements AdminOrderService {
|
|
|
*/
|
|
*/
|
|
|
private QueryWrapper<ContractOrderEntity> getQueryWrapper(NotaryOrderQueryReq req) {
|
|
private QueryWrapper<ContractOrderEntity> getQueryWrapper(NotaryOrderQueryReq req) {
|
|
|
ContractOrderEntity order = BeanCopyUtils.convertObj(req, ContractOrderEntity.class);
|
|
ContractOrderEntity order = BeanCopyUtils.convertObj(req, ContractOrderEntity.class);
|
|
|
- QueryWrapper<ContractOrderEntity> qw = QueryWrapperUtil.convertQuery(order);
|
|
|
|
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
|
|
+ json.put("startDate", req.getStartDate());
|
|
|
|
|
+ json.put("endDate", req.getEndDate());
|
|
|
|
|
+ // 清楚
|
|
|
|
|
+ order.setStartDate("");
|
|
|
|
|
+ order.setEndDate("");
|
|
|
|
|
+ QueryWrapper<ContractOrderEntity> qw = QueryWrapperUtil.convertQuery(order, json);
|
|
|
SysUserEntity user = userDao.selectById(contextUtil.getCurrentUserId());
|
|
SysUserEntity user = userDao.selectById(contextUtil.getCurrentUserId());
|
|
|
String maxRole = userDomain.getUserMaxRole();
|
|
String maxRole = userDomain.getUserMaxRole();
|
|
|
if ("超级管理员".equals(maxRole)) {
|
|
if ("超级管理员".equals(maxRole)) {
|
|
@@ -142,40 +146,6 @@ public class AdminOrderServiceImpl implements AdminOrderService {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// if (!StringUtils.isEmpty(req.getStatus())) {
|
|
|
|
|
-// qw.eq("status", req.getStatus());
|
|
|
|
|
-// }
|
|
|
|
|
-// if (!StringUtils.isEmpty(req.getContractNo())) {
|
|
|
|
|
-// qw.like("contract_no", req.getContractNo());
|
|
|
|
|
-// }
|
|
|
|
|
-// if (!StringUtils.isEmpty(req.getLoanName())) {
|
|
|
|
|
-// qw.like("loan_name", req.getLoanName());
|
|
|
|
|
-// }
|
|
|
|
|
-// if (!StringUtils.isEmpty(req.getPhone())) {
|
|
|
|
|
-// qw.like("phone", req.getPhone());
|
|
|
|
|
-// }
|
|
|
|
|
-// if (!StringUtils.isEmpty(req.getIdCard())) {
|
|
|
|
|
-// qw.like("id_card", req.getIdCard());
|
|
|
|
|
-// }
|
|
|
|
|
-// if (!StringUtils.isEmpty(req.getLoanMoneyStart())) {
|
|
|
|
|
-// qw.ge("loan_money", req.getLoanMoneyStart());
|
|
|
|
|
-// }
|
|
|
|
|
-// if (!StringUtils.isEmpty(req.getLoanMoneyEnd())) {
|
|
|
|
|
-// qw.le("loan_money", req.getLoanMoneyEnd());
|
|
|
|
|
-// }
|
|
|
|
|
-// if (!StringUtils.isEmpty(req.getBankName())) {
|
|
|
|
|
-// qw.like("bank_name", req.getBankName());
|
|
|
|
|
-// }
|
|
|
|
|
-// if (!StringUtils.isEmpty(req.getCustomerName())) {
|
|
|
|
|
-// qw.like("customer_name", req.getCustomerName());
|
|
|
|
|
-// }
|
|
|
|
|
-// if (!StringUtils.isEmpty(req.getStartDate())) {
|
|
|
|
|
-// qw.ge("createTime", req.getStartDate());
|
|
|
|
|
-// }
|
|
|
|
|
-// if (!StringUtils.isEmpty(req.getEndDate())) {
|
|
|
|
|
-// qw.le("createTime", req.getEndDate());
|
|
|
|
|
-// }
|
|
|
|
|
- qw.orderByDesc("create_time");
|
|
|
|
|
return qw;
|
|
return qw;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -340,7 +310,8 @@ public class AdminOrderServiceImpl implements AdminOrderService {
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public AppBaseResponse partyPass(NotaryOrderQueryReq req) {
|
|
public AppBaseResponse partyPass(NotaryOrderQueryReq req) {
|
|
|
AppBaseResponse response = new AppBaseResponse();
|
|
AppBaseResponse response = new AppBaseResponse();
|
|
|
- ContractOrderEntity contractOrderEntity = contractOrderRepository.getContractOrderWithBizNo(req.getBusinessNo());
|
|
|
|
|
|
|
+ ContractOrderEntity contractOrderEntity = contractOrderRepository
|
|
|
|
|
+ .getContractOrderWithBizNo(req.getBusinessNo());
|
|
|
if (OrderConstant.NOTARIZATION_GENERATE_HAND.equals(contractOrderEntity.getAutoGenerate())) {
|
|
if (OrderConstant.NOTARIZATION_GENERATE_HAND.equals(contractOrderEntity.getAutoGenerate())) {
|
|
|
response.fail(OrderBizCodeMessage.NOTARIZATION_GENERATE_TYPE_ERROR);
|
|
response.fail(OrderBizCodeMessage.NOTARIZATION_GENERATE_TYPE_ERROR);
|
|
|
return response;
|
|
return response;
|
|
@@ -352,12 +323,14 @@ public class AdminOrderServiceImpl implements AdminOrderService {
|
|
|
return response;
|
|
return response;
|
|
|
}
|
|
}
|
|
|
// 检查公证书模板是否处于编辑状态
|
|
// 检查公证书模板是否处于编辑状态
|
|
|
- if (modelRepository.existModelInEditing(contractOrderEntity.getProdId(), contractOrderEntity.getContractType(), contractOrderEntity.getNotaryOfficeId(), ModelConstant.MODEL_TYPE_NOTARIZATION)) {
|
|
|
|
|
|
|
+ if (modelRepository.existModelInEditing(contractOrderEntity.getProdId(), contractOrderEntity.getContractType(),
|
|
|
|
|
+ contractOrderEntity.getNotaryOfficeId(), ModelConstant.MODEL_TYPE_NOTARIZATION)) {
|
|
|
response.fail(OrderBizCodeMessage.MODEL_IN_EDITING);
|
|
response.fail(OrderBizCodeMessage.MODEL_IN_EDITING);
|
|
|
return response;
|
|
return response;
|
|
|
}
|
|
}
|
|
|
// 检查是否具备可用的公证书编号
|
|
// 检查是否具备可用的公证书编号
|
|
|
- List<NotarizationNoEntity> notarizationNoList = modelRepository.getListWithOfficeId(contractOrderEntity.getNotaryOfficeId());
|
|
|
|
|
|
|
+ List<NotarizationNoEntity> notarizationNoList = modelRepository
|
|
|
|
|
+ .getListWithOfficeId(contractOrderEntity.getNotaryOfficeId());
|
|
|
if (notarizationNoList == null || notarizationNoList.size() == 0) {
|
|
if (notarizationNoList == null || notarizationNoList.size() == 0) {
|
|
|
response.fail(ResultCode.NO_NOTARIZARION_NO);
|
|
response.fail(ResultCode.NO_NOTARIZARION_NO);
|
|
|
return response;
|
|
return response;
|
|
@@ -366,7 +339,9 @@ public class AdminOrderServiceImpl implements AdminOrderService {
|
|
|
int currentNum = notarizationNoEntity.getCurrentNum() == 0 ? notarizationNoEntity.getBeginNum()
|
|
int currentNum = notarizationNoEntity.getCurrentNum() == 0 ? notarizationNoEntity.getBeginNum()
|
|
|
: notarizationNoEntity.getCurrentNum() + 1;
|
|
: notarizationNoEntity.getCurrentNum() + 1;
|
|
|
// 生成并保存未签名公证书
|
|
// 生成并保存未签名公证书
|
|
|
- ModelEntity modelEntity = modelRepository.getModelEntity(contractOrderEntity.getProdId(),contractOrderEntity.getContractType(), contractOrderEntity.getNotaryOfficeId(), ModelConstant.MODEL_TYPE_NOTARIZATION, "1");
|
|
|
|
|
|
|
+ ModelEntity modelEntity = modelRepository.getModelEntity(contractOrderEntity.getProdId(),
|
|
|
|
|
+ contractOrderEntity.getContractType(), contractOrderEntity.getNotaryOfficeId(),
|
|
|
|
|
+ ModelConstant.MODEL_TYPE_NOTARIZATION, "1");
|
|
|
String content = modelSynthesizerDomain.composeNotarizationTemplate(currentNum, req.getContent());
|
|
String content = modelSynthesizerDomain.composeNotarizationTemplate(currentNum, req.getContent());
|
|
|
String htmlPath = FileUploadUtil.saveHtml(content, contractOrderEntity.getBusinessNo());
|
|
String htmlPath = FileUploadUtil.saveHtml(content, contractOrderEntity.getBusinessNo());
|
|
|
String pdfPath = FileUploadUtil.savePdf(content, contractOrderEntity.getBusinessNo());
|
|
String pdfPath = FileUploadUtil.savePdf(content, contractOrderEntity.getBusinessNo());
|
|
@@ -423,7 +398,8 @@ public class AdminOrderServiceImpl implements AdminOrderService {
|
|
|
public AppBaseResponse<String> previewNotarization(NotaryOrderQueryReq req) {
|
|
public AppBaseResponse<String> previewNotarization(NotaryOrderQueryReq req) {
|
|
|
AppBaseResponse<String> response = new AppBaseResponse<>();
|
|
AppBaseResponse<String> response = new AppBaseResponse<>();
|
|
|
ContractOrderEntity order = contractOrderRepository.getContractOrderWithBizNo(req.getBusinessNo());
|
|
ContractOrderEntity order = contractOrderRepository.getContractOrderWithBizNo(req.getBusinessNo());
|
|
|
- ModelEntity model = modelRepository.getModelEntity(order.getProdId(), order.getContractType(), order.getNotaryOfficeId(), ModelConstant.MODEL_TYPE_NOTARIZATION, "1");
|
|
|
|
|
|
|
+ ModelEntity model = modelRepository.getModelEntity(order.getProdId(), order.getContractType(),
|
|
|
|
|
+ order.getNotaryOfficeId(), ModelConstant.MODEL_TYPE_NOTARIZATION, "1");
|
|
|
String previewContent = modelSynthesizerDomain.composeNotarizationPreview(order, model.getContent());
|
|
String previewContent = modelSynthesizerDomain.composeNotarizationPreview(order, model.getContent());
|
|
|
response.setData(new AppResultData<String>(previewContent));
|
|
response.setData(new AppResultData<String>(previewContent));
|
|
|
return response;
|
|
return response;
|
|
@@ -559,10 +535,8 @@ public class AdminOrderServiceImpl implements AdminOrderService {
|
|
|
// 取出所有的图片
|
|
// 取出所有的图片
|
|
|
List<FileInfoEntity> fileInfo = getFileInfo(orderDetail);
|
|
List<FileInfoEntity> fileInfo = getFileInfo(orderDetail);
|
|
|
Map<Integer, FileInfoEntity> map = new HashMap<>();
|
|
Map<Integer, FileInfoEntity> map = new HashMap<>();
|
|
|
- Map<String, String> returnMap = new HashMap<>();
|
|
|
|
|
for (FileInfoEntity file : fileInfo) {
|
|
for (FileInfoEntity file : fileInfo) {
|
|
|
map.put(file.getId(), file);
|
|
map.put(file.getId(), file);
|
|
|
- returnMap.put(String.valueOf(file.getId()), FileUploadUtil.getFileUrl(file.getPath()));
|
|
|
|
|
}
|
|
}
|
|
|
// 进行图片拼接,按上传顺序处理
|
|
// 进行图片拼接,按上传顺序处理
|
|
|
// 身份证正面
|
|
// 身份证正面
|
|
@@ -615,37 +589,14 @@ public class AdminOrderServiceImpl implements AdminOrderService {
|
|
|
public Map<String, FileInfoEntity> getUploadFile(String businessNo) {
|
|
public Map<String, FileInfoEntity> getUploadFile(String businessNo) {
|
|
|
Map<String, FileInfoEntity> fileInfo = new HashMap<String, FileInfoEntity>();
|
|
Map<String, FileInfoEntity> fileInfo = new HashMap<String, FileInfoEntity>();
|
|
|
// 借款人
|
|
// 借款人
|
|
|
- QueryWrapper<BorrowerEntity> borrowerQW = new QueryWrapper<>();
|
|
|
|
|
- borrowerQW.eq("business_no", businessNo);
|
|
|
|
|
- List<BorrowerEntity> borrows = borrowerMapper.selectList(borrowerQW);
|
|
|
|
|
- for (BorrowerEntity input : borrows) {
|
|
|
|
|
- OrderDetailDto orderDto = BeanCopyUtils.convertObj(input, OrderDetailDto.class);
|
|
|
|
|
- List<FileInfoEntity> list = getFileInfo(orderDto);
|
|
|
|
|
- for (FileInfoEntity f : list) {
|
|
|
|
|
- fileInfo.put(String.valueOf(f.getId()), f);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- // 抵押人
|
|
|
|
|
- QueryWrapper<MortgageEntity> mortgageQW = new QueryWrapper<>();
|
|
|
|
|
- mortgageQW.eq("business_no", businessNo);
|
|
|
|
|
- List<MortgageEntity> mortgage = mortgageMapper.selectList(mortgageQW);
|
|
|
|
|
- for (MortgageEntity input : mortgage) {
|
|
|
|
|
- OrderDetailDto orderDto = BeanCopyUtils.convertObj(input, OrderDetailDto.class);
|
|
|
|
|
- List<FileInfoEntity> list = getFileInfo(orderDto);
|
|
|
|
|
- for (FileInfoEntity f : list) {
|
|
|
|
|
- fileInfo.put(String.valueOf(f.getId()), f);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- // 担保人
|
|
|
|
|
- QueryWrapper<GuaranteeEntity> guaranteeQW = new QueryWrapper<>();
|
|
|
|
|
- guaranteeQW.eq("business_no", businessNo);
|
|
|
|
|
- List<GuaranteeEntity> guarantee = guaranteeMapper.selectList(guaranteeQW);
|
|
|
|
|
- for (GuaranteeEntity input : guarantee) {
|
|
|
|
|
- OrderDetailDto orderDto = BeanCopyUtils.convertObj(input, OrderDetailDto.class);
|
|
|
|
|
- List<FileInfoEntity> list = getFileInfo(orderDto);
|
|
|
|
|
- for (FileInfoEntity f : list) {
|
|
|
|
|
- fileInfo.put(String.valueOf(f.getId()), f);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ QueryWrapper<ContractOrderEntity> qw = new QueryWrapper<>();
|
|
|
|
|
+ qw.eq("business_no", businessNo);
|
|
|
|
|
+ ContractOrderEntity contractOrder = contractOrderMapper.selectOne(qw);
|
|
|
|
|
+
|
|
|
|
|
+ OrderDetailDto orderDto = BeanCopyUtils.convertObj(contractOrder, OrderDetailDto.class);
|
|
|
|
|
+ List<FileInfoEntity> list = getFileInfo(orderDto);
|
|
|
|
|
+ for (FileInfoEntity f : list) {
|
|
|
|
|
+ fileInfo.put(String.valueOf(f.getId()), f);
|
|
|
}
|
|
}
|
|
|
return fileInfo;
|
|
return fileInfo;
|
|
|
}
|
|
}
|
|
@@ -654,7 +605,6 @@ public class AdminOrderServiceImpl implements AdminOrderService {
|
|
|
// 将所有图片查询出来
|
|
// 将所有图片查询出来
|
|
|
// 1.身份证正面 2.身份证反面 3.结婚证 4.合同附件 5.房产证6.户口本 7.其他内容
|
|
// 1.身份证正面 2.身份证反面 3.结婚证 4.合同附件 5.房产证6.户口本 7.其他内容
|
|
|
List<Integer> list = new ArrayList<Integer>();
|
|
List<Integer> list = new ArrayList<Integer>();
|
|
|
-
|
|
|
|
|
// 身份证正面
|
|
// 身份证正面
|
|
|
list.add(Integer.parseInt(orderDetail.getIdcardFrontPic()));
|
|
list.add(Integer.parseInt(orderDetail.getIdcardFrontPic()));
|
|
|
// 身份证反面
|
|
// 身份证反面
|
|
@@ -673,10 +623,7 @@ public class AdminOrderServiceImpl implements AdminOrderService {
|
|
|
addImageId(list, orderDetail.getJointIdcardBackPic());
|
|
addImageId(list, orderDetail.getJointIdcardBackPic());
|
|
|
// 其他内容
|
|
// 其他内容
|
|
|
String otherUpload = orderDetail.getOtherUpload();
|
|
String otherUpload = orderDetail.getOtherUpload();
|
|
|
- if (org.apache.commons.lang3.StringUtils.isNotBlank(otherUpload)) {
|
|
|
|
|
- String[] otherArray = otherUpload.split(",");
|
|
|
|
|
- list.addAll(toIntList(otherArray));
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ addImageId(list, otherUpload);
|
|
|
// 取出所有的图片
|
|
// 取出所有的图片
|
|
|
List<FileInfoEntity> fileInfo = fileInfoService.listByIds(list);
|
|
List<FileInfoEntity> fileInfo = fileInfoService.listByIds(list);
|
|
|
return fileInfo;
|
|
return fileInfo;
|