|
|
@@ -1,34 +1,52 @@
|
|
|
package me.zhengjie.application.user.service.impl;
|
|
|
|
|
|
+import java.io.IOException;
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.data.redis.core.RedisTemplate;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
+
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import me.zhengjie.application.bank.controller.vo.*;
|
|
|
-import me.zhengjie.application.bank.service.*;
|
|
|
-import me.zhengjie.base.plus.QueryWrapperUtil;
|
|
|
+import me.zhengjie.application.bank.controller.vo.Account;
|
|
|
+import me.zhengjie.application.bank.controller.vo.FileInfoDto;
|
|
|
+import me.zhengjie.application.bank.controller.vo.Order;
|
|
|
+import me.zhengjie.application.bank.controller.vo.OrderDto;
|
|
|
+import me.zhengjie.application.bank.controller.vo.OrderVo;
|
|
|
+import me.zhengjie.application.bank.controller.vo.Sms;
|
|
|
+import me.zhengjie.application.bank.controller.vo.SmsVo;
|
|
|
+import me.zhengjie.application.bank.controller.vo.UserVo;
|
|
|
+import me.zhengjie.application.bank.service.ModelService;
|
|
|
+import me.zhengjie.application.bank.service.OrderRoomIdService;
|
|
|
+import me.zhengjie.application.bank.service.OrderService;
|
|
|
+import me.zhengjie.application.bank.service.OssService;
|
|
|
+import me.zhengjie.application.bank.service.PdfService;
|
|
|
+import me.zhengjie.application.bank.service.SmsService;
|
|
|
+import me.zhengjie.application.user.service.ApiService;
|
|
|
+import me.zhengjie.base.ResponseDTO;
|
|
|
+import me.zhengjie.base.ResultCode;
|
|
|
+import me.zhengjie.base.mq.RedisCacheConfig;
|
|
|
import me.zhengjie.base.util.FileUploadUtil;
|
|
|
import me.zhengjie.base.util.IpAddressUtil;
|
|
|
import me.zhengjie.base.util.StatusEnum;
|
|
|
-import me.zhengjie.base.ResponseDTO;
|
|
|
-import me.zhengjie.base.ResultCode;
|
|
|
+import me.zhengjie.dao.jdbc.AccountDao;
|
|
|
+import me.zhengjie.dao.jdbc.ConfinfoDao;
|
|
|
+import me.zhengjie.dao.jdbc.FileInfoDao;
|
|
|
+import me.zhengjie.dao.jdbc.ModelDao;
|
|
|
+import me.zhengjie.dao.jdbc.OrderDao;
|
|
|
import me.zhengjie.dao.mybatis.OrderFileRepository;
|
|
|
-import me.zhengjie.base.mq.RedisCacheConfig;
|
|
|
-import me.zhengjie.dao.jdbc.*;
|
|
|
-import me.zhengjie.dao.mybatis.entity.*;
|
|
|
-import me.zhengjie.modules.security.security.TokenProvider;
|
|
|
+import me.zhengjie.dao.mybatis.entity.OrderFileEntity;
|
|
|
+import me.zhengjie.dao.mybatis.entity.OrderRoomIdEntity;
|
|
|
import me.zhengjie.dao.mybatis.mapper.NotaryOrderMapper;
|
|
|
-import me.zhengjie.application.user.service.ApiService;
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.data.redis.core.RedisTemplate;
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.web.multipart.MultipartFile;
|
|
|
-
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
-import java.io.IOException;
|
|
|
-import java.time.LocalDateTime;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
+import me.zhengjie.modules.security.security.TokenProvider;
|
|
|
|
|
|
@Slf4j
|
|
|
@Service
|
|
|
@@ -54,12 +72,12 @@ public class ApiServiceImpl implements ApiService {
|
|
|
ConfinfoDao confinfoDao;
|
|
|
@Autowired
|
|
|
private TokenProvider tokenProvider;
|
|
|
- @Autowired
|
|
|
- private BorrowerService borrowerService;
|
|
|
- @Autowired
|
|
|
- private MortgageService mortgageService;
|
|
|
- @Autowired
|
|
|
- private GuaranteeService guaranteeService;
|
|
|
+// @Autowired
|
|
|
+// private BorrowerService borrowerService;
|
|
|
+// @Autowired
|
|
|
+// private MortgageService mortgageService;
|
|
|
+// @Autowired
|
|
|
+// private GuaranteeService guaranteeService;
|
|
|
@Autowired
|
|
|
ModelService modelService;
|
|
|
@Autowired
|
|
|
@@ -128,123 +146,8 @@ public class ApiServiceImpl implements ApiService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<OrderDto> getOrderByContion(OrderVo user) {
|
|
|
- AppBorrowerEntity borrower = new AppBorrowerEntity();
|
|
|
- borrower.setIdCard(user.getIdCode());
|
|
|
- borrower.setUsername(user.getUserName());
|
|
|
- borrower.setPhone(user.getPhone());
|
|
|
- borrower.setBusinessNo(user.getBusinessNo());
|
|
|
- borrower.setContractNo(user.getContractNo());
|
|
|
- borrower.setStatus(user.getStatus());
|
|
|
- QueryWrapper<AppBorrowerEntity> queryWrapper = QueryWrapperUtil.convertQuery(borrower);
|
|
|
- List<AppBorrowerEntity> borrowers = borrowerService.list(queryWrapper);
|
|
|
- if (user.getBusinessNo() == null && borrowers != null && borrowers.size() > 0) {
|
|
|
- user.setBusinessNo(borrowers.get(0).getBusinessNo());
|
|
|
- }
|
|
|
-
|
|
|
- AppMortgageEntity mortgage = new AppMortgageEntity();
|
|
|
- mortgage.setIdCard(user.getIdCode());
|
|
|
- mortgage.setUsername(user.getUserName());
|
|
|
- mortgage.setPhone(user.getPhone());
|
|
|
- mortgage.setStatus(user.getStatus());
|
|
|
- mortgage.setBusinessNo(user.getBusinessNo());
|
|
|
- mortgage.setContractNo(user.getContractNo());
|
|
|
- QueryWrapper<AppMortgageEntity> mortgageWrapper = QueryWrapperUtil.convertQuery(mortgage);
|
|
|
- List<AppMortgageEntity> mortgages = mortgageService.list(mortgageWrapper);
|
|
|
- if (user.getBusinessNo() == null && mortgages != null && mortgages.size() > 0) {
|
|
|
- user.setBusinessNo(mortgages.get(0).getBusinessNo());
|
|
|
- }
|
|
|
-
|
|
|
- AppGuaranteeEntity guarantee = new AppGuaranteeEntity();
|
|
|
- guarantee.setIdCard(user.getIdCode());
|
|
|
- guarantee.setUsername(user.getUserName());
|
|
|
- guarantee.setPhone(user.getPhone());
|
|
|
- guarantee.setStatus(user.getStatus());
|
|
|
- guarantee.setBusinessNo(user.getBusinessNo());
|
|
|
- guarantee.setContractNo(user.getContractNo());
|
|
|
- QueryWrapper<AppGuaranteeEntity> guaranteeWrapper = QueryWrapperUtil.convertQuery(guarantee);
|
|
|
- List<AppGuaranteeEntity> guarantees = guaranteeService.list(guaranteeWrapper);
|
|
|
- if (user.getBusinessNo() == null && guarantees != null && guarantees.size() > 0) {
|
|
|
- user.setBusinessNo(guarantees.get(0).getBusinessNo());
|
|
|
- }
|
|
|
-
|
|
|
- // 查询主订单,如果状态是驳回,查询驳回原因
|
|
|
- NotaryOrderEntity orderEntity = null;
|
|
|
- if (user.getStatus() != null && user.getStatus().equals(StatusEnum.NotaryStatusEnum.REJECT.getStatus().toString())) {
|
|
|
- QueryWrapper<NotaryOrderEntity> notaryOrder = new QueryWrapper<>();
|
|
|
- notaryOrder.eq("business_no", user.getBusinessNo());
|
|
|
- notaryOrder.eq("status", StatusEnum.NotaryStatusEnum.REJECT.getStatus());
|
|
|
- orderEntity = orderService.getOne(notaryOrder);
|
|
|
- }
|
|
|
-
|
|
|
- List<OrderDto> list = new ArrayList<OrderDto>();
|
|
|
- for (AppBorrowerEntity b : borrowers) {
|
|
|
- OrderDto dto = new OrderDto();
|
|
|
- dto.setUsername(b.getUsername());
|
|
|
- dto.setIdCard(b.getIdCard());
|
|
|
- dto.setSumMoney(b.getSumMoney());
|
|
|
- dto.setPhone(b.getPhone());
|
|
|
- dto.setOrderId(b.getId().toString());
|
|
|
- dto.setStartDate(b.getStartDate());
|
|
|
- dto.setEndDate(b.getEndDate());
|
|
|
- dto.setContractNo(b.getContractNo());
|
|
|
- dto.setSex(b.getSex());
|
|
|
- dto.setBusinessNo(user.getBusinessNo());
|
|
|
- dto.setBirth(b.getBirth());
|
|
|
- dto.setResidence(b.getResidence());
|
|
|
- dto.setRate(b.getRate());
|
|
|
- dto.setType("1");
|
|
|
- dto.setNotaryUserId(b.getNotaryUserId());
|
|
|
- if (orderEntity != null) {
|
|
|
- dto.setRejectReason(orderEntity.getRejectReason());
|
|
|
- }
|
|
|
- list.add(dto);
|
|
|
- }
|
|
|
-
|
|
|
- for (AppMortgageEntity b : mortgages) {
|
|
|
- OrderDto dto = new OrderDto();
|
|
|
- dto.setUsername(b.getUsername());
|
|
|
- dto.setIdCard(b.getIdCard());
|
|
|
- dto.setPhone(b.getPhone());
|
|
|
- dto.setOrderId(b.getId().toString());
|
|
|
- dto.setStartDate(b.getStartDate());
|
|
|
- dto.setEndDate(b.getEndDate());
|
|
|
- dto.setContractNo(b.getContractNo());
|
|
|
- dto.setSex(b.getSex());
|
|
|
- dto.setBusinessNo(user.getBusinessNo());
|
|
|
- dto.setBirth(b.getBirth());
|
|
|
- dto.setResidence(b.getResidence());
|
|
|
- dto.setHouseLocation(b.getHouseLocation());
|
|
|
- dto.setHousePropertyNo(b.getHousePropertyNo());
|
|
|
- dto.setType("2");
|
|
|
- dto.setNotaryUserId(b.getNotaryUserId());
|
|
|
- if (orderEntity != null) {
|
|
|
- dto.setRejectReason(orderEntity.getRejectReason());
|
|
|
- }
|
|
|
- list.add(dto);
|
|
|
- }
|
|
|
-
|
|
|
- for (AppGuaranteeEntity b : guarantees) {
|
|
|
- OrderDto dto = new OrderDto();
|
|
|
- dto.setUsername(b.getUsername());
|
|
|
- dto.setIdCard(b.getIdCard());
|
|
|
- dto.setPhone(b.getPhone());
|
|
|
- dto.setOrderId(b.getId().toString());
|
|
|
- dto.setStartDate(b.getStartDate());
|
|
|
- dto.setEndDate(b.getEndDate());
|
|
|
- dto.setContractNo(b.getContractNo());
|
|
|
- dto.setSex(b.getSex());
|
|
|
- dto.setBirth(b.getBirth());
|
|
|
- dto.setBusinessNo(user.getBusinessNo());
|
|
|
- dto.setResidence(b.getResidence());
|
|
|
- dto.setType("3");
|
|
|
- dto.setNotaryUserId(b.getNotaryUserId());
|
|
|
- if (orderEntity != null) {
|
|
|
- dto.setRejectReason(orderEntity.getRejectReason());
|
|
|
- }
|
|
|
- list.add(dto);
|
|
|
- }
|
|
|
- return list;
|
|
|
+ public List<OrderDto> getOrderByContion(OrderVo orderVo) {
|
|
|
+ return orderService.getOrderByContion(orderVo);
|
|
|
}
|
|
|
|
|
|
@Override
|