|
|
@@ -12,7 +12,6 @@ import me.zhengjie.base.util.BeanCopyUtils;
|
|
|
import me.zhengjie.base.util.DateFormatUtils;
|
|
|
import me.zhengjie.base.util.FileUploadUtil;
|
|
|
import me.zhengjie.base.util.TencentServiceUtil;
|
|
|
-import me.zhengjie.base.util.StatusEnum.NotaryStatusEnum;
|
|
|
import me.zhengjie.dao.mybatis.*;
|
|
|
import me.zhengjie.dao.mybatis.entity.*;
|
|
|
import me.zhengjie.dao.mybatis.mapper.BankMapper;
|
|
|
@@ -25,8 +24,6 @@ import me.zhengjie.domain.order.OrderConstant;
|
|
|
import me.zhengjie.domain.order.parser.OrderOCRParser;
|
|
|
import me.zhengjie.domain.order.parser.OrderOCRParserFactory;
|
|
|
import me.zhengjie.security.service.dto.OnlineUserDto;
|
|
|
-import me.zhengjie.utils.SecurityUtils;
|
|
|
-
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.security.core.Authentication;
|
|
|
@@ -64,6 +61,7 @@ public class BankOrderServiceImpl implements BankOrderService {
|
|
|
private final OrderFileRepository orderFileRepository;
|
|
|
private final SmsTemplateService smsTemplateService;
|
|
|
private final ModelSynthesizerDomain modelSynthesizerDomain;
|
|
|
+
|
|
|
@Override
|
|
|
public void saveContractOrder(BankOrderVO vo, SysUserEntity userEntity) {
|
|
|
BankEntity bank = bankMapper.selectById(userEntity.getOrgId().split("_")[1]);
|
|
|
@@ -101,6 +99,21 @@ public class BankOrderServiceImpl implements BankOrderService {
|
|
|
saveOrder.setId(curOrder.getId());
|
|
|
contractOrderRepository.updateWithId(saveOrder);
|
|
|
}
|
|
|
+ if (OrderConstant.PROD_ID_XED.equals(vo.getProdId()) && OrderConstant.CONTRACT_TYPE_MORTGAGE.equals(vo.getContractType())) {
|
|
|
+ CollateralMortgageEntity curCollateralMortgage = contractOrderRepository.getCollateralMortgageWithBizNo(vo.getBusinessNo());
|
|
|
+ CollateralMortgageEntity saveCollateralMortgage = new CollateralMortgageEntity();
|
|
|
+ saveCollateralMortgage.setHouseLocation(vo.getHouseLocation());
|
|
|
+ saveCollateralMortgage.setHousePropertyNo(vo.getHousePropertyNo());
|
|
|
+ if (curCollateralMortgage == null) {
|
|
|
+ saveCollateralMortgage.setBusinessNo(vo.getBusinessNo());
|
|
|
+ saveCollateralMortgage.setCreateTime(new Date());
|
|
|
+ contractOrderRepository.insertCollateral(saveCollateralMortgage);
|
|
|
+ } else {
|
|
|
+ saveCollateralMortgage.setId(curCollateralMortgage.getId());
|
|
|
+ saveCollateralMortgage.setUpdateTime(new Date());
|
|
|
+ contractOrderRepository.updateCollateralById(saveCollateralMortgage);
|
|
|
+ }
|
|
|
+ }
|
|
|
if (OrderConstant.PROD_ID_CD.equals(vo.getProdId()) && !isCollateralInfoEmpty(vo)) {
|
|
|
CollateralInfoEntity curCollateralInfo = contractOrderRepository.getCollateralWithBizNo(vo.getBusinessNo());
|
|
|
CollateralInfoEntity saveCollateralInfo = new CollateralInfoEntity();
|
|
|
@@ -182,6 +195,13 @@ public class BankOrderServiceImpl implements BankOrderService {
|
|
|
orderVo.setBuyingPrice(collateralInfo.getBuyingPrice());
|
|
|
}
|
|
|
}
|
|
|
+ if (OrderConstant.PROD_ID_XED.equals(orderVo.getProdId()) && OrderConstant.CONTRACT_TYPE_MORTGAGE.equals(orderVo.getContractType())) {
|
|
|
+ CollateralMortgageEntity collateralMortgageWithBizNo = contractOrderRepository.getCollateralMortgageWithBizNo(businessNo);
|
|
|
+ if (null != collateralMortgageWithBizNo) {
|
|
|
+ orderVo.setHouseLocation(collateralMortgageWithBizNo.getHouseLocation());
|
|
|
+ orderVo.setHousePropertyNo(collateralMortgageWithBizNo.getHousePropertyNo());
|
|
|
+ }
|
|
|
+ }
|
|
|
return orderVo;
|
|
|
}
|
|
|
|
|
|
@@ -200,24 +220,24 @@ public class BankOrderServiceImpl implements BankOrderService {
|
|
|
modelSynthesizerDomain.generateCommonDoc(String.valueOf(currentUser.getUserId()), businessNo);
|
|
|
//发送短信
|
|
|
smsTemplateService.submitSuccess(businessNo);
|
|
|
-
|
|
|
+
|
|
|
//订单提交成功
|
|
|
return ResponseDTO.success();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void updateStatus(String businessNo, String status, String message) {
|
|
|
-
|
|
|
+
|
|
|
ContractOrderEntity order = new ContractOrderEntity();
|
|
|
order.setBusinessNo(businessNo);
|
|
|
- order.setStatus(status);
|
|
|
+ order.setStatus(status);
|
|
|
order.setUpdateTime(new Date());
|
|
|
if (OrderConstant.ORDER_STATUS_UNSUBMIT.equals(status)) {
|
|
|
order.setReturnReason(message);
|
|
|
//增加公证用户
|
|
|
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
|
|
- Object securityContextUser = authentication.getPrincipal();
|
|
|
- OnlineUserDto userDto = (OnlineUserDto) securityContextUser;
|
|
|
+ Object securityContextUser = authentication.getPrincipal();
|
|
|
+ OnlineUserDto userDto = (OnlineUserDto) securityContextUser;
|
|
|
order.setNotaryUserId(userDto.getUserId().toString());
|
|
|
} else if (OrderConstant.ORDER_STATUS_REJECTED.equals(status)) {
|
|
|
order.setRejectReason(message);
|