Просмотр исходного кода

提交读取pdf相关文件以及定时任务

hxl13994548489 1 год назад
Родитель
Сommit
3afdbc7021

+ 5 - 5
src/main/java/com/ydtech/modules/order/controller/InsAreaCompanyController.java

@@ -37,7 +37,7 @@ public class InsAreaCompanyController {
 
     private final InsOrderPdfUrlService  insOrderPdfUrlService;
 
-    private  InsOrderPayDateRecordService  insOrderPayDateRecordService;
+    private final InsOrderPayDateRecordService  insOrderPayDateRecordService;
 
     @GetMapping("/statusInquiry/{subOrderNo}")
     @ApiOperation("状态查询")
@@ -146,10 +146,10 @@ public class InsAreaCompanyController {
      *  @Date: 2024/10/21 14:54
      *  @Description: 更新保单的签单日期和缴费时间
      */
-    @GetMapping("/udapteOrderDate")
+    @GetMapping("/updateOrderDate")
     @ApiOperation("更新保单的签单日期和缴费时间")
     public HttpResult udapteOrderDate(String subOrderId) {
-        insOrderPayDateRecordService.udapteOrderDate(subOrderId);
+        insOrderPayDateRecordService.updateOrderDate(subOrderId);
         return HttpResult.ok("更新成功");
     }
 
@@ -159,10 +159,10 @@ public class InsAreaCompanyController {
      *  @Date: 2024/10/21 14:54
      *  @Description: 更新保单的签单日期和缴费时间
      */
-    @GetMapping("/udapteOrderDateRecord")
+    @GetMapping("/updateOrderDateRecord")
     @ApiOperation("更新保单的签单日期和缴费时间列表")
     public HttpResult<List<InsOrderPayDateRecord>> udapteOrderDateRecord(String subOrderId) {
-        List<InsOrderPayDateRecord> list=insOrderPayDateRecordService.udapteOrderDateRecord(subOrderId);
+        List<InsOrderPayDateRecord> list=insOrderPayDateRecordService.updateOrderDateRecord(subOrderId);
         return HttpResult.ok(list);
     }
 }

+ 5 - 0
src/main/java/com/ydtech/modules/order/controller/InsOrderReadPdfController.java

@@ -23,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
+import java.io.IOException;
 import java.util.List;
 
 /**
@@ -133,4 +134,8 @@ public class InsOrderReadPdfController extends BaseController {
         BasePageResult<InsOrders> quoteResult = insOrdersService.queryPageOrderCB(orderQueryVo);
         return HttpResult.ok("success", quoteResult);
     }
+
+
+
+
 }

+ 12 - 0
src/main/java/com/ydtech/modules/order/entity/InsOrdersTrack.java

@@ -141,4 +141,16 @@ public class InsOrdersTrack implements Serializable {
         this.createTime = LocalDateTime.now();
         this.remark = remark;
     }
+    public InsOrdersTrack(String suborder, String companyId, String insCompany, String orderNo, String orderStatus, String operatorId, String operator, String remark,LocalDateTime createTime) {
+        this.suborder = suborder;
+        this.companyId = companyId;
+        this.insCompany = insCompany;
+        this.orderNo = orderNo;
+        this.orderStatus = orderStatus;
+        this.operatorId = operatorId;
+        this.operator = operator;
+        this.createTime = createTime;
+        this.remark = remark;
+    }
+
 }

+ 73 - 7
src/main/java/com/ydtech/modules/order/entity/api/pingan/utils/PDFUtil.java

@@ -13,11 +13,12 @@ import java.net.MalformedURLException;
 import java.net.URI;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
-import java.util.HashMap;
-import java.util.UUID;
+import java.util.*;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import static com.ydtech.modules.order.utils.InsuranceLog.logger;
+
 /**
  *  @version
  *  @author: hxl
@@ -172,6 +173,7 @@ public class PDFUtil {
             pdfStripper.setShouldSeparateByBeads(true);
             text= pdfStripper.getText(document);
             text = text.replaceAll("\\s+", " ");
+            logger.info(text);
             document.close();
         } catch (IOException e) {
             throw new RuntimeException(e);
@@ -180,6 +182,9 @@ public class PDFUtil {
     }
 
     public static String getPdfContentStr(String pdfText, String beginStr,String endStr,String dateType) {
+        if("end".equals(endStr)){
+            return getEndString(pdfText, beginStr);
+        }
         String contentStr = getContentStr(pdfText, beginStr, endStr);
         if(StringUtils.isNotBlank(contentStr)){
             contentStr=contentStr.replaceAll(" ", "");
@@ -189,11 +194,27 @@ public class PDFUtil {
             contentStr = contentStr.replaceAll("\\s+", "");
             contentStr = contentStr.replaceAll("[^\u4E00-\u9FA50-9年月日:-]+", "");
             contentStr = contentStr.replaceAll("时", "");
+            String longestRepeat = getRepeatedData(contentStr);
+            if(StringUtils.isNotBlank(longestRepeat)){
+                contentStr = longestRepeat;
+            }
         }
         return contentStr;
     }
 
     public static LocalDateTime getPdfContentDate(String pdfText, String beginStr,String endStr,String dateType) {
+        if("end".equals(endStr)){
+            String substring = getEndString(pdfText, beginStr);
+            String patten ="";
+            if("1".equals(dateType)){
+                patten ="yyyy-MM-dd HH:mm:ss";
+            }else if("2".equals(dateType)){
+                patten = "yyyy/MM/dd HH:mm:ss";
+            }else if("3".equals(dateType)){
+                patten = "yyyy年MM月dd日 HH:mm:ss";
+            }
+            return LocalDateTime.parse(substring, DateTimeFormatter.ofPattern(patten));
+        }
         String payDate = getContentStr(pdfText, beginStr, endStr);
         LocalDateTime payDateTime = null;
         if("1".equals(dateType)){
@@ -205,6 +226,31 @@ public class PDFUtil {
         }
         return payDateTime;
     }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/10/23 9:26
+     *  @Description: 截取开始到字符串结尾的字符
+     */
+    private static String getEndString(String pdfText, String beginStr) {
+        String substring = pdfText.substring(pdfText.indexOf(beginStr), pdfText.length());
+        substring=substring.replaceAll(beginStr, "");
+        substring=substring.replaceAll(beginStr, "");
+        substring = substring.replaceAll(" ", "");
+        substring = substring.replaceAll("\\n+", "");
+        substring = substring.replaceAll("\\t+", "");
+        substring = substring.replaceAll("\\r+", "");
+        substring = substring.replaceAll("\\s+", "");
+        if(substring.length() == 18){
+            substring = substring.substring(0,10)+" "+ substring.substring(10,18);
+        }else if(substring.length() == 15){
+            substring = substring.substring(0,10)+" "+ substring.substring(10,15)+":00";
+        }else if(substring.length() == 10){
+            substring = substring+" 00:00:00";
+        }
+        return substring;
+    }
+
     public static HashMap<String,LocalDateTime> getPdfContent(String pdfPath, String companyId){
         HashMap<String,LocalDateTime>  map =new  HashMap<String,LocalDateTime>();
         String pdfText = getPdfText(pdfPath);
@@ -421,6 +467,10 @@ public class PDFUtil {
             payDate = payDate.replaceAll("\\s+", "");
             payDate = payDate.replaceAll("[^\u4E00-\u9FA50-9年月日:]+", "");
             payDate = payDate.replaceAll("时", "");
+            String longestRepeat = getRepeatedData(payDate);
+            if(StringUtils.isNotBlank(longestRepeat)){
+                payDate = longestRepeat;
+            }
             int count = 0;
             int index = 0;
             while ((index = payDate.indexOf(":", index)) != -1) {
@@ -469,7 +519,21 @@ public class PDFUtil {
             return null;
         }
     }
-
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/10/22 15:08
+     *  @Description: 找出字符串中的重复值
+     */
+    private static String getRepeatedData(String input) {
+        String repeatedData = "";
+        Pattern pattern = Pattern.compile("(\\d{4}年\\d{1,2}月\\d{1,2}日)\\s*\\1");
+        Matcher matcher = pattern.matcher(input);
+        if (matcher.find()) {
+            repeatedData= matcher.group(1);
+        }
+        return repeatedData;
+    }
     public static String trafferHttpToLocalPath(String path) {
         if (path.contains("http") || path.contains("https")) {
             //转成本地路径
@@ -508,8 +572,8 @@ public class PDFUtil {
        // String pdfFilePath = "D:\\nasData\\carInsPolicy\\1823634528262541312\\晋JH6836-交强险保单.pdf"; // PDF文件路径
         //  HashMap<String, LocalDateTime> zmbx = getPdfContent(pdfFilePath, "TPBX");
         //恒邦
-        String pdfFilePath = "D:\\nasData\\carInsPolicy\\晋KLY103\\晋KLY103-交强险保单.pdf"; // PDF文件路径
-        HashMap<String, LocalDateTime> zmbx = getPdfContent(pdfFilePath, "HBIC");
+       // String pdfFilePath = "D:\\nasData\\carInsPolicy\\晋KLY103\\晋KLY103-交强险保单.pdf"; // PDF文件路径
+       // HashMap<String, LocalDateTime> zmbx = getPdfContent(pdfFilePath, "HBIC");
         //国任
         // String pdfFilePath = "D:\\nasData\\carInsPolicy\\晋A139LV\\晋A139LV-交强险保单.pdf"; // PDF文件路径
         //  HashMap<String, LocalDateTime> zmbx = getPdfContent(pdfFilePath, "XDCX");
@@ -602,11 +666,13 @@ public class PDFUtil {
         // String pdfFilePath = "D:\\bx\\ancheng\\f0b6430219fe3f32b2d63ab41dba95c4.pdf"; // PDF文件路径
         // HashMap<String, LocalDateTime> zmbx = getPdfContent(pdfFilePath, "ACIC");
         // 永安
-        // String pdfFilePath = "D:\\bx\\yongan\\交强.pdf"; // PDF文件路径
-        //   HashMap<String, LocalDateTime> zmbx = getPdfContent(pdfFilePath, "YAIC");
+        String pdfFilePath = "D:\\bx\\yongan\\交强.pdf"; // PDF文件路径
+           HashMap<String, LocalDateTime> zmbx = getPdfContent(pdfFilePath, "YAIC");
 
         System.out.println(zmbx.toString());
 
     }
 
+
+
 }

+ 6 - 0
src/main/java/com/ydtech/modules/order/entity/po/InsOrderPayDateRecord.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -31,6 +32,7 @@ public class InsOrderPayDateRecord implements Serializable {
     /**
      * 创建时间
      */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date createTime;
 
     /**
@@ -41,21 +43,25 @@ public class InsOrderPayDateRecord implements Serializable {
     /**
      * 旧支付时间
      */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDateTime oldPayDate;
 
     /**
      * 旧签单时间
      */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDateTime oldSignTime;
 
     /**
      * 新支付时间
      */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDateTime newPayDate;
 
     /**
      * 新签单时间
      */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDateTime newSignTime;
 
     /**

+ 7 - 0
src/main/java/com/ydtech/modules/order/entity/vo/InsOrderReadPdfContentVo.java

@@ -24,4 +24,11 @@ public class InsOrderReadPdfContentVo implements Serializable {
     @NotBlank(message = "保单路径不能为空")
     @ApiModelProperty("保单路径")
     private String url;
+
+    /**
+     * 保单类型
+     */
+    @NotBlank(message = "保单类型不能为空")
+    @ApiModelProperty("保单类型  1. 交强 2 商业")
+    private String type;
 }

+ 7 - 0
src/main/java/com/ydtech/modules/order/entity/vo/InsOrderReadPdfVo.java

@@ -69,4 +69,11 @@ public class InsOrderReadPdfVo implements Serializable {
     @ApiModelProperty(value = "页数")
     @Min(value = 1, message = "页数最小为1")
     private int pageNum;
+
+    /**
+     * 类型
+     */
+    @ApiModelProperty("类型 1.交强 2.商业")
+    private String type;
+
 }

+ 11 - 2
src/main/java/com/ydtech/modules/order/service/InsOrderPayDateRecordService.java

@@ -17,12 +17,21 @@ public interface InsOrderPayDateRecordService extends IService<InsOrderPayDateRe
      *  @Date: 2024/10/21 14:59
      *  @Description: 更新签单时间和签单日期
      */
-    void udapteOrderDate(String subOrderId);
+    void updateOrderDate(String subOrderId);
     /**
      *  @version
      *  @author: hxl
      *  @Date: 2024/10/21 17:01
      *  @Description:  查看更新时间记录
      */
-    List<InsOrderPayDateRecord> udapteOrderDateRecord(String subOrderId);
+    List<InsOrderPayDateRecord> updateOrderDateRecord(String subOrderId);
+
+
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/10/22 11:07
+     *  @Description: 定时更新订单的时间
+     */
+     void batchOrderDate();
 }

+ 66 - 19
src/main/java/com/ydtech/modules/order/service/impl/InsOrderPayDateRecordServiceImpl.java

@@ -7,23 +7,25 @@ import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.esm.model.EsmInsCompany;
 import com.ydtech.modules.order.dao.InsOrderPayDateRecordMapper;
 import com.ydtech.modules.order.entity.InsAreaCompany;
+import com.ydtech.modules.order.entity.InsOrdersTrack;
 import com.ydtech.modules.order.entity.api.pingan.utils.PDFUtil;
+import com.ydtech.modules.order.entity.dto.ReadPdfUrlDto;
 import com.ydtech.modules.order.entity.dto.ReadPdfUrlListDto;
 import com.ydtech.modules.order.entity.po.InsOrderPayDateRecord;
 import com.ydtech.modules.order.entity.po.InsOrderReadPdf;
-import com.ydtech.modules.order.service.InsAreaCompanyService;
-import com.ydtech.modules.order.service.InsOrderPayDateRecordService;
-import com.ydtech.modules.order.service.InsOrderPdfUrlService;
-import com.ydtech.modules.order.service.InsOrderReadPdfService;
+import com.ydtech.modules.order.service.*;
+import com.ydtech.utils.DateUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
+import java.io.File;
 import java.time.LocalDateTime;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * @author Administrator
@@ -52,6 +54,9 @@ public class InsOrderPayDateRecordServiceImpl extends ServiceImpl<InsOrderPayDat
     @Autowired
     private InsOrderReadPdfService  insOrderReadPdfService;
 
+    @Autowired
+    private InsOrdersTrackService insOrdersTrackService;
+
     /**
      *  @version
      *  @author: hxl
@@ -59,7 +64,7 @@ public class InsOrderPayDateRecordServiceImpl extends ServiceImpl<InsOrderPayDat
      *  @Description: 更新签单日期和缴费时间
      */
     @Override
-    public void udapteOrderDate(String subOrderId) {
+    public void updateOrderDate(String subOrderId) {
         ReadPdfUrlListDto readPdfUrlListDto =null;
         try{
              readPdfUrlListDto = insOrderPdfUrlService.readPdfUrlList(subOrderId, false);
@@ -70,49 +75,68 @@ public class InsOrderPayDateRecordServiceImpl extends ServiceImpl<InsOrderPayDat
         InsAreaCompany subOrder = insAreaCompanyService.getById(subOrderId);
         if(readPdfUrlListDto!=null){
             String code ="";
-            String fileurl ="";
+            String jqFileurl ="";
+            String sqFileurl ="";
             //判断订单交强路径是否为空
             if(readPdfUrlListDto.getOldfileList()!=null && !readPdfUrlListDto.getOldfileList().isEmpty()){
-                code="jq";
+                code="1";
                 //交强
-                fileurl = readPdfUrlListDto.getOldfileList().get(0).getFileurl();
-            }else if(readPdfUrlListDto.getBusinessList()!=null && !readPdfUrlListDto.getBusinessList().isEmpty()){
-                code="sy";
+                ReadPdfUrlDto jq= readPdfUrlListDto.getOldfileList().stream().filter(s->s.getFileTitle().equals("交强电子保单")).collect(Collectors.toList()).get(0);
+                if(jq!=null){
+                    jqFileurl = jq.getFileurl();
+                }
+            }
+            if(readPdfUrlListDto.getBusinessList()!=null && !readPdfUrlListDto.getBusinessList().isEmpty()){
                 //商业
-                fileurl = readPdfUrlListDto.getBusinessList().get(0).getFileurl();
-            }else{
-                throw   new SystemException("保单路径错误");
+                ReadPdfUrlDto sy= readPdfUrlListDto.getBusinessList().stream().filter(s->s.getFileTitle().equals("商业电子保单")).collect(Collectors.toList()).get(0);
+                if(sy!=null){
+                    sqFileurl = sy.getFileurl();
+                }
+            }
+            if(StringUtils.isBlank(jqFileurl)){
+                jqFileurl=sqFileurl;
+                code="2";
             }
-            if(StringUtils.isNotBlank(fileurl)){
-                fileurl = fileurl.replaceAll(apiUrl+showFileUrl, "");
-                fileurl = uploadFilePath+fileurl;
+            String localUrl ="";
+            if(StringUtils.isNotBlank(jqFileurl)){
+                localUrl = PDFUtil.trafferHttpToLocalPath(jqFileurl);
             }
             //通过保险公司配置读取截取的前缀和后缀
             LambdaQueryWrapper<InsOrderReadPdf> qws = new LambdaQueryWrapper<>();
             qws.eq(InsOrderReadPdf::getCompanyId,subOrder.getCompanyId());
+            qws.eq(InsOrderReadPdf::getType,code);
             List<InsOrderReadPdf> list = insOrderReadPdfService.list(qws);
             HashMap<String,LocalDateTime> map=new HashMap<>();
             HashMap<String,LocalDateTime> oldMap=new HashMap<>();
             oldMap.put("payDate",subOrder.getPayDate());
             oldMap.put("signingTime",subOrder.getPayDate());
-            String pdfText = PDFUtil.getPdfText(fileurl);
+            String pdfText = PDFUtil.getPdfText(localUrl);
             if(StringUtils.isNotBlank(pdfText)){
                 if(list!=null  && list.size()>0){
                     for(InsOrderReadPdf insOrderReadPdf:list){
                        LocalDateTime pdfContentDate = PDFUtil.getPdfContentDate(pdfText, insOrderReadPdf.getReadBegin(), insOrderReadPdf.getReadEnd(), insOrderReadPdf.getReadType());
-                       map.put(insOrderReadPdf.getReadName(),pdfContentDate);
+                       map.put(insOrderReadPdf.getOrderMsg(),pdfContentDate);
                     }
                 }
             }
+            //刪除临时文件
+            if (jqFileurl.contains("http") || jqFileurl.contains("https")) {
+                File file =new File(localUrl);
+                file.delete();
+            }
             //插入數據
             InsOrderPayDateRecord  dto=new InsOrderPayDateRecord(null, subOrderId, new Date(), new BaseController().getUserId(), subOrder.getPayDate(), subOrder.getSigningTime(), map.get("payDate"), map.get("signingTime"), oldMap.toString(), map.toString());
             this.save(dto);
             if(map.get("payDate")!=null){
                 subOrder.setPayDate(map.get("payDate"));
+                //插入轨迹表
+               // InsOrdersTrack insOrdersTrack = new InsOrdersTrack(subOrder.getId(), subOrder.getCompanyId(), subOrder.getInscompany(), subOrder.getOrderno(), "缴费时间", new BaseController().getUser().getId(), new BaseController().getUser().getName(),"缴费时间",map.get("payDate"));
+               // insOrdersTrackService.save(insOrdersTrack);
             }
             if(map.get("signingTime")!=null){
                 subOrder.setSigningTime(map.get("signingTime"));
             }
+            //更新时间表
            // insAreaCompanyService.save(subOrder);
 
         }else{
@@ -126,11 +150,34 @@ public class InsOrderPayDateRecordServiceImpl extends ServiceImpl<InsOrderPayDat
      *  @Description:  查看保单修改记录
      */
     @Override
-    public List<InsOrderPayDateRecord> udapteOrderDateRecord(String subOrderId) {
+    public List<InsOrderPayDateRecord> updateOrderDateRecord(String subOrderId) {
         LambdaQueryWrapper<InsOrderPayDateRecord> lqw = new LambdaQueryWrapper<>();
         lqw.eq(InsOrderPayDateRecord::getSubOrderNo, subOrderId);
         return this.list(lqw);
     }
+
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/10/22 10:51
+     *  @Description: 定时更新订单的缴费时间和签单日期
+     */
+    public void batchOrderDate() {
+       //查询当前时间0点 到当前时间范围内的已承保的订单  并更新时间 HH:mm:ss
+       String benginDate = DateUtil.getDateFormat(new Date(), "yyyy-MM-dd")+" 00:00:00";
+       String endDate = DateUtil.getDateFormat(new Date(), "yyyy-MM-dd HH:mm:ss");
+       List<InsAreaCompany> list = insAreaCompanyService.findListByDate(benginDate,endDate);
+       if(list!=null && list.size()>0){
+           for(InsAreaCompany  insAreaCompany : list){
+               try{
+                   //更新時間
+                   updateOrderDate(insAreaCompany.getId());
+               }catch(Exception e){
+
+               }
+           }
+       }
+    }
 }
 
 

+ 0 - 3
src/main/java/com/ydtech/modules/order/service/impl/InsOrderPdfUrlServiceImpl.java

@@ -143,9 +143,6 @@ public class InsOrderPdfUrlServiceImpl extends ServiceImpl<InsOrderPdfUrlMapper,
         }
         subOrder.setJyPolicyNo(jyPolicyNo);
         if(insOrders.getIsExternal()!=null && insOrders.getIsExternal() ==1){
-            if(flag ){
-                throw  new SystemException("外部订单不允许重新生成");
-            }
             //外部订单
             return insAreaCompanyExternalPolicyService.getPolicyByCompanyIdPdfList(subOrder,insOrders);
         }

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

@@ -69,6 +69,7 @@ public class InsOrderReadPdfServiceImpl extends ServiceImpl<InsOrderReadPdfMappe
     public InsOrderReadPdfContentDto readPdfContent(InsOrderReadPdfContentVo insOrderReadPdfContentVo) {
         LambdaQueryWrapper<InsOrderReadPdf> qw = new LambdaQueryWrapper<>();
         qw.eq(InsOrderReadPdf::getCompanyId,insOrderReadPdfContentVo.getCompanyId());
+        qw.eq(InsOrderReadPdf::getType,insOrderReadPdfContentVo.getType());
         List<InsOrderReadPdf> list = this.list(qw);
         String url = insOrderReadPdfContentVo.getUrl();
         String laoclUrl = PDFUtil.trafferHttpToLocalPath(url);

+ 59 - 0
src/main/java/com/ydtech/modules/order/timer/UpdateOrderTimer.java

@@ -0,0 +1,59 @@
+package com.ydtech.modules.order.timer;
+
+import com.ydtech.modules.order.service.InsOrderPayDateRecordService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+
+
+/**
+ *  @version
+ *  @author: hxl
+ *  @Date: 2024/10/22 10:45
+ *  @Description:  定时订单的缴费时间和签单时间
+ */
+@Slf4j
+@Component
+public class UpdateOrderTimer {
+
+    @Autowired
+    private InsOrderPayDateRecordService insOrderPayDateRecordService;
+
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/10/22 10:47
+     *  @Description:
+     * 中午一点
+     * 凌晨一点
+     */
+    @Scheduled(cron = "0 0 13 * * ?")
+    private void updateOrderDateNoon() {
+        log.info("定时更新订单的签单时间和缴费日期,启动时间:{}", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
+
+        try {
+            insOrderPayDateRecordService.batchOrderDate();
+            log.info("定时更新订单的签单时间和缴费日期成功");
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error("定时更新订单的签单时间和缴费日期失败:{}", e.getMessage());
+        }
+    }
+
+
+    @Scheduled(cron = "0 0 1 * * ?")
+    private void updateOrderDateBeforeDawn() {
+        log.info("定时更新订单的签单时间和缴费日期,启动时间:{}", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
+
+        try {
+            insOrderPayDateRecordService.batchOrderDate();
+            log.info("定时更新订单的签单时间和缴费日期成功");
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error("定时更新订单的签单时间和缴费日期失败:{}", e.getMessage());
+        }
+    }
+}

+ 4 - 2
src/main/resources/mapper/modules/order/InsOrderReadPdfMapper.xml

@@ -15,13 +15,14 @@
             <result property="readEnd" column="read_end" jdbcType="VARCHAR"/>
             <result property="readType" column="read_type" jdbcType="VARCHAR"/>
             <result property="orderMsg" column="order_msg" jdbcType="VARCHAR"/>
+            <result property="type" column="type" jdbcType="VARCHAR"/>
     </resultMap>
 
     <sql id="Base_Column_List">
         id,company_id,company_name,
         create_time,create_user,read_name,
         read_begin,read_end,read_type,
-        order_msg
+        order_msg,type
     </sql>
     <select id="queryPage" resultType="com.ydtech.modules.order.entity.po.InsOrderReadPdf">
        select
@@ -31,7 +32,8 @@
             iorp.read_name,
             iorp.read_begin,
             iorp.read_end,read_type,
-            iorp.order_msg
+            iorp.order_msg,
+            iorp.type
        from
            ins_order_read_pdf iorp
         <where>