|
|
@@ -1,5 +1,6 @@
|
|
|
package com.ydtech.modules.xxl.handler;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.xxl.job.core.handler.annotation.XxlJob;
|
|
|
import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
|
|
|
import com.ydtech.modules.order.components.ConfigureParametersComponents;
|
|
|
@@ -10,6 +11,10 @@ import com.ydtech.modules.order.components.gouren.GuorenRequestApiComponent;
|
|
|
import com.ydtech.modules.order.components.huatai.HuaTaiRequestApiComponents;
|
|
|
import com.ydtech.modules.order.components.yongcheng.YongchengRequestApiComponents;
|
|
|
import com.ydtech.modules.order.components.zijin.ZijinRequestApiComponents;
|
|
|
+import com.ydtech.modules.order.dao.InsOrdersMapper;
|
|
|
+import com.ydtech.modules.order.entity.InsOrders;
|
|
|
+import com.ydtech.modules.order.entity.InsOrdersTrack;
|
|
|
+import com.ydtech.modules.order.service.InsOrdersTrackService;
|
|
|
import com.ydtech.modules.protocol.service.PtlAgreementAttributionService;
|
|
|
import com.ydtech.modules.protocol.service.PtlCrawlerApiService;
|
|
|
import com.ydtech.modules.xxl.mapper.XxlInsAreaCompanyMapper;
|
|
|
@@ -33,6 +38,9 @@ import java.util.Random;
|
|
|
@Component
|
|
|
public class QueryStatusHandler {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ InsOrdersMapper insOrdersMapper;
|
|
|
+
|
|
|
@Autowired
|
|
|
XxlInsAreaCompanyMapper insAreaCompanyMapper;
|
|
|
|
|
|
@@ -66,6 +74,8 @@ public class QueryStatusHandler {
|
|
|
@Autowired
|
|
|
PtlAgreementAttributionService ptlAgreementAttributionService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ InsOrdersTrackService insOrdersTrackService;
|
|
|
|
|
|
@XxlJob("queryStatusHandler")
|
|
|
public void queryStatus() {
|
|
|
@@ -87,7 +97,29 @@ public class QueryStatusHandler {
|
|
|
//更新 ins_area_company
|
|
|
insAreaCompany.setInsideOrderStatus(Integer.parseInt(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode()));
|
|
|
insAreaCompany.setInsidePayTime(queryStatusResult.getPayTime());
|
|
|
+ //设置支付时间
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
+ LocalDateTime dateTime = LocalDateTime.parse(queryStatusResult.getPayTime(), formatter);
|
|
|
+ insAreaCompany.setPayDate(dateTime);
|
|
|
+ //设置状态为已承保
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
|
insAreaCompanyMapper.updateInsideOrder(insAreaCompany);
|
|
|
+ InsOrders insOrders = insOrdersMapper.selectOne(new LambdaQueryWrapper<InsOrders>().eq(InsOrders::getOrderno, insAreaCompany.getOrderno()));
|
|
|
+ //设置主订单为已承保
|
|
|
+ insOrders.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
|
+ insOrdersMapper.updateById(insOrders);
|
|
|
+
|
|
|
+ //添加轨迹信息
|
|
|
+ InsOrdersTrack insOrdersTrack = new InsOrdersTrack();
|
|
|
+ insOrdersTrack.setOrderNo(insAreaCompany.getOrderno());
|
|
|
+ insOrdersTrack.setInsCompany(insAreaCompany.getInscompany());
|
|
|
+ insOrdersTrack.setCompanyId(insAreaCompany.getCompanyId());
|
|
|
+ insOrdersTrack.setSuborder(insAreaCompany.getId());
|
|
|
+ insOrdersTrack.setOrderStatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
|
+ insOrdersTrack.setOperatorId("admin");
|
|
|
+ insOrdersTrack.setOperator("自动操作");
|
|
|
+ insOrdersTrack.setCreateTime(LocalDateTime.now());
|
|
|
+ insOrdersTrackService.save(insOrdersTrack);
|
|
|
}
|
|
|
}
|
|
|
}catch(Exception e){
|