Forráskód Böngészése

1. 注释未使用的定时任务。

ligang134 3 éve
szülő
commit
f6c38381a5

+ 86 - 86
src/main/java/com/ydtech/modules/ins/scheduler/InsOrderScheduler.java

@@ -65,90 +65,90 @@ public class InsOrderScheduler {
     }
 
 
-    /**
-     * 每天23点触发定时任务
-     * 自动关闭当日订单
-     */
-    @Scheduled(cron = "0 0 23 * * ?")
-    public void orderTask() {
-        logger.info("定时任务执行开始时间:" + dateFormat.format(new Date()) + "");
-
-        int num = autoCloseOrder();
-
-        logger.info("定时任务执行结束时间:" + dateFormat.format(new Date()) + "  更新订单合计 " + num);
-    }
-
-    public int autoCloseOrder() {
-        //1、查询订单列表
-        StringBuffer whereStr = new StringBuffer(" where 1=1");
-        ArrayList array = new ArrayList();
-        whereStr.append(" and orderstatus in ('0','1','2','3','4','5')");
-
-        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
-        String date = format.format(new Date());
-//        String date = "2021-04-13";
-        whereStr.append(" and DATE_FORMAT(createtime, '%Y-%m-%d') between date'" + date + "' and date'" + date + "'");
-
-        //0报价中 1待核保 2已核保 3核保退回 4核保不通过 5已核保待缴费 6已缴费 7已承保 99已关闭
-        List<InsOrder> orderList = insOrderService.selectList(whereStr.toString(), array.toArray());
-
-        huanongService.login();
-        huanongService.querySales();
-
-        hengbangService.login();
-        hengbangService.querySales();
-
-        for (InsOrder order : orderList) {
-            String licenseno = order.getLicenseNo();
-            String carowner = order.getInsuredname();
-            String orderno = order.getOrderno();
-            String jqapplyno = order.getJqapplyno();
-            String syapplyno = order.getSyapplyno();
-            HttpResult httpResult = null;
-
-            if ("5".equals(order.getOrderstatus()) && "华农财险".equals(order.getInscompany())) {
-                httpResult = huanongService.queryPayStatus(licenseno, date, jqapplyno, syapplyno);
-            } else if ("5".equals(order.getOrderstatus()) && "恒邦财险".equals(order.getInscompany())) {
-                httpResult = hengbangService.queryPayStatus(licenseno, carowner, date, jqapplyno, syapplyno);
-            }
-
-            if (httpResult != null && httpResult.getCode() == 200) {
-                //更新订单状态
-                order.setOrderstatus("6");
-                String auditname = order.getAuditname();
-                String auditid = order.getAuditid();
-                //匹配任务接收人
-                String license = order.getLicenseNo().substring(0, 2);
-                List<InsOrderTask> taskList = insOrderTaskService.selectList(" where t.status='1' and t.insname=? and t.licenseno=? and t.orderstatus=?", new Object[]{order.getInscompany(), license, "7"});
-                if (taskList.size() > 0) {
-                    order.setAuditid(taskList.get(0).getAuditid());
-                    order.setAuditname(taskList.get(0).getAuditname());
-                } else {
-                    order.setAuditid("");
-                    order.setAuditname("");
-                }
-                insOrderService.update(order);
-
-                //插入轨迹表
-                InsTaskHistory history = new InsTaskHistory();
-                history.setId(String.valueOf(new Date().getTime()));
-                history.setCompany(order.getInscompany());
-                history.setTaskid(order.getOrderno());
-                history.setOperatorid(auditid);
-                history.setOperator(auditname);
-                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-                history.setCreatetime(sdf.format(new Date()));
-                history.setStatus("6");
-                history.setRemark("缴费确认");
-                insTaskHistoryService.insert(history);
-
-            } else {
-                //关闭订单
-                insOrderService.closeOrder(orderno, "99");
-            }
-
-        }
-
-        return orderList.size();
-    }
+//    /**
+//     * 每天23点触发定时任务
+//     * 自动关闭当日订单
+//     */
+//    @Scheduled(cron = "0 0 23 * * ?")
+//    public void orderTask() {
+//        logger.info("定时任务执行开始时间:" + dateFormat.format(new Date()) + "");
+//
+//        int num = autoCloseOrder();
+//
+//        logger.info("定时任务执行结束时间:" + dateFormat.format(new Date()) + "  更新订单合计 " + num);
+//    }
+//
+//    public int autoCloseOrder() {
+//        //1、查询订单列表
+//        StringBuffer whereStr = new StringBuffer(" where 1=1");
+//        ArrayList array = new ArrayList();
+//        whereStr.append(" and orderstatus in ('0','1','2','3','4','5')");
+//
+//        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+//        String date = format.format(new Date());
+////        String date = "2021-04-13";
+//        whereStr.append(" and DATE_FORMAT(createtime, '%Y-%m-%d') between date'" + date + "' and date'" + date + "'");
+//
+//        //0报价中 1待核保 2已核保 3核保退回 4核保不通过 5已核保待缴费 6已缴费 7已承保 99已关闭
+//        List<InsOrder> orderList = insOrderService.selectList(whereStr.toString(), array.toArray());
+//
+//        huanongService.login();
+//        huanongService.querySales();
+//
+//        hengbangService.login();
+//        hengbangService.querySales();
+//
+//        for (InsOrder order : orderList) {
+//            String licenseno = order.getLicenseNo();
+//            String carowner = order.getInsuredname();
+//            String orderno = order.getOrderno();
+//            String jqapplyno = order.getJqapplyno();
+//            String syapplyno = order.getSyapplyno();
+//            HttpResult httpResult = null;
+//
+//            if ("5".equals(order.getOrderstatus()) && "华农财险".equals(order.getInscompany())) {
+//                httpResult = huanongService.queryPayStatus(licenseno, date, jqapplyno, syapplyno);
+//            } else if ("5".equals(order.getOrderstatus()) && "恒邦财险".equals(order.getInscompany())) {
+//                httpResult = hengbangService.queryPayStatus(licenseno, carowner, date, jqapplyno, syapplyno);
+//            }
+//
+//            if (httpResult != null && httpResult.getCode() == 200) {
+//                //更新订单状态
+//                order.setOrderstatus("6");
+//                String auditname = order.getAuditname();
+//                String auditid = order.getAuditid();
+//                //匹配任务接收人
+//                String license = order.getLicenseNo().substring(0, 2);
+//                List<InsOrderTask> taskList = insOrderTaskService.selectList(" where t.status='1' and t.insname=? and t.licenseno=? and t.orderstatus=?", new Object[]{order.getInscompany(), license, "7"});
+//                if (taskList.size() > 0) {
+//                    order.setAuditid(taskList.get(0).getAuditid());
+//                    order.setAuditname(taskList.get(0).getAuditname());
+//                } else {
+//                    order.setAuditid("");
+//                    order.setAuditname("");
+//                }
+//                insOrderService.update(order);
+//
+//                //插入轨迹表
+//                InsTaskHistory history = new InsTaskHistory();
+//                history.setId(String.valueOf(new Date().getTime()));
+//                history.setCompany(order.getInscompany());
+//                history.setTaskid(order.getOrderno());
+//                history.setOperatorid(auditid);
+//                history.setOperator(auditname);
+//                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+//                history.setCreatetime(sdf.format(new Date()));
+//                history.setStatus("6");
+//                history.setRemark("缴费确认");
+//                insTaskHistoryService.insert(history);
+//
+//            } else {
+//                //关闭订单
+//                insOrderService.closeOrder(orderno, "99");
+//            }
+//
+//        }
+//
+//        return orderList.size();
+//    }
 }

+ 2 - 0
src/main/java/com/ydtech/modules/ins/service/impl/InsAlltrustApiServiceImpl.java

@@ -443,6 +443,8 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
             String ciMsg = tfiWarnData.getWarnMessage();
             requestInfoList.add(ciMsg);
 
+            if(ciMsg.contains("终保日期: 以上为所有结果信息"))return true;
+
 
             //终保日期
             String coverageEndDate = ciMsg.substring(ciMsg.indexOf("终保日期") + 5, ciMsg.indexOf("终保日期") + 5 + 12);