BifronsV пре 3 година
родитељ
комит
6a34591032

+ 12 - 7
src/main/java/com/ydtech/modules/ins/service/impl/YongAnServiceImpl.java

@@ -7,6 +7,7 @@ import com.fasterxml.jackson.databind.MapperFeature;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.dataformat.xml.XmlMapper;
 import com.ydtech.components.OrderComponents;
+import com.ydtech.constants.enums.InsOrderStatus;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.exception.SystemException;
 import com.ydtech.modules.admin.model.SysDept;
@@ -25,6 +26,7 @@ import com.ydtech.modules.ins.service.*;
 import com.ydtech.modules.ins.vo.*;
 import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.modules.order.service.InsAreaCompanyService;
+import com.ydtech.modules.order.service.InsOrdersService;
 import com.ydtech.nai.httpvo.*;
 import com.ydtech.utils.HMAC256Uitil;
 import com.ydtech.utils.HttpXmlUtil;
@@ -724,6 +726,9 @@ public class YongAnServiceImpl implements YongAnService {
     @Autowired
     private InsAreaCompanyService insAreaCompanyService;
 
+    @Autowired
+    private InsOrdersService insOrdersService;
+
     /**
      * 5 保单信息同步
      */
@@ -741,23 +746,23 @@ public class YongAnServiceImpl implements YongAnService {
             log.error("orderNo/crstTxt 不能为空");
         }
         if (crstTxt.equals("0")) {//0:生成保单成功; 1:生成保单失败
-            InsAreaCompany order = insAreaCompanyService.getById(orderNo);
+            InsAreaCompany insAreaCompany = insAreaCompanyService.getById(orderNo);
 
 //            InsOrder order = insOrderService.selectByPk(orderNo);
-            if (order == null) {
+            if (insAreaCompany == null) {
                 log.error("订单不存在,orderNo:" + orderNo);
             }
             if (StringUtils.isEmpty(cplyNoBI) && StringUtils.isEmpty(cplyNoCI)) {
                 log.error("cplyNoBI/cplyNoCI 交强商业保单号同时为空");
             }
-            order.setJqpolicyno(StringUtils.isEmpty(cplyNoCI) ? "" : cplyNoCI);
-            order.setSypolicyno(StringUtils.isEmpty(cplyNoBI) ? "" : cplyNoBI);
-            order.setOrderstatus("7");//已承保
+            insAreaCompany.setJqpolicyno(StringUtils.isEmpty(cplyNoCI) ? "" : cplyNoCI);
+            insAreaCompany.setSypolicyno(StringUtils.isEmpty(cplyNoBI) ? "" : cplyNoBI);
+            insAreaCompany.setOrderstatus(InsOrderStatus.S_3.getCode());//已承保
 //            order.setPaytype(payAppNo);
 //            order.setPaytime(payTime);
 //            insOrderService.update(order);
-            insAreaCompanyService.updateById(order);
-
+            insAreaCompanyService.updateById(insAreaCompany);
+            insOrdersService.updateByOrderStatus(insAreaCompany.getOrderno(), insAreaCompany.getOrderstatus());
 
 //            //插入轨迹表
 //            InsTaskHistory history6 = new InsTaskHistory();

+ 1 - 1
src/main/java/com/ydtech/modules/order/service/impl/ZhongMeiOrderServiceImpl.java

@@ -100,13 +100,13 @@ public class ZhongMeiOrderServiceImpl implements ZhongMeiOrderService {
 
     @Override
     public HttpResult quote(BaseQuoteInfoVo quoteInfoVo, BaseQuoteVo<AccidentalDrivingVo> quoteVo) {
+        EsmInsCompany esmInsCompany = esmInsCompanyService.isOpen(quoteVo.getCompanyId());
         SysUser sysUser = sysUserService.selectByPk(quoteInfoVo.getUserId());
         // 保险公司是否授权
         EsmInsAttribution esmInsAttribution = esmInsAttributionService.gainAuthorizeAffiliation(sysUser, quoteVo.getCompanyId());
         if (ObjectUtils.isEmpty(esmInsAttribution)) {
             throw new SystemException("报价未授权,请联系团队长配置。");
         }
-        EsmInsCompany esmInsCompany = esmInsCompanyService.isOpen(quoteVo.getCompanyId());
         // 1. 请求中煤 Spider 接口
         Response<ZhongmeiQuoteResponse> body = zhongmeiRequestComponents.quote(new ZmQuoteSpiderVo(quoteInfoVo, quoteVo.getAccidentalDrivingVo(), esmInsAttribution.getUsername()), new ParameterizedTypeReference<Response<ZhongmeiQuoteResponse>>() {
         });