Bläddra i källkod

发票超期收款通知

sangwenwei 11 månader sedan
förälder
incheckning
522047edfe
15 ändrade filer med 932 tillägg och 0 borttagningar
  1. 5 0
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/factory/AssessApiFallbackFactory.java
  2. 5 0
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/factory/FinanceApiFallbackFactory.java
  3. 6 0
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/feign/IAssessApi.java
  4. 6 0
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/feign/IFinanceApi.java
  5. 12 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/controller/FinanceInvoiceController.java
  6. 4 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/mapper/FinanceInvoiceMapper.java
  7. 25 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/mapper/xml/FinanceInvoiceMapper.xml
  8. 10 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/service/FinanceInvoiceService.java
  9. 11 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/controller/CwFinanceInvoiceController.java
  10. 2 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/CwFinanceInvoiceMapper.java
  11. 25 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/xml/CwFinanceInvoiceMapper.xml
  12. 12 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/CwFinanceInvoiceService.java
  13. 327 0
      jeeplus-modules/jeeplus-xxl-job-executor-sample/src/main/java/com/jeeplus/domain/CwFinanceInvoiceList.java
  14. 325 0
      jeeplus-modules/jeeplus-xxl-job-executor-sample/src/main/java/com/jeeplus/domain/FinanceInvoiceList.java
  15. 157 0
      jeeplus-modules/jeeplus-xxl-job-executor-sample/src/main/java/com/xxl/job/executor/service/jobhandler/SampleXxlJob.java

+ 5 - 0
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/factory/AssessApiFallbackFactory.java

@@ -44,6 +44,11 @@ public class AssessApiFallbackFactory implements FallbackFactory<IAssessApi> {
                 return null;
             }
 
+            @Override
+            public String getExceedFinance() {
+                return null;
+            }
+
 
         };
     }

+ 5 - 0
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/factory/FinanceApiFallbackFactory.java

@@ -47,6 +47,11 @@ public class FinanceApiFallbackFactory implements FallbackFactory<IFinanceApi> {
                 return null;
             }
 
+            @Override
+            public String getExceedCwFinance() {
+                return null;
+            }
+
         };
     }
 }

+ 6 - 0
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/feign/IAssessApi.java

@@ -49,4 +49,10 @@ public interface IAssessApi {
     @GetMapping(value = "/program/projectList/getCancelledProject")
     String getCancelledProject();
 
+    /**
+     * 查询开票时间距今超过1个月的开票数据
+     */
+    @GetMapping(value = "/finance/invoice/getExceedFinance")
+    String getExceedFinance();
+
 }

+ 6 - 0
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/feign/IFinanceApi.java

@@ -36,4 +36,10 @@ public interface IFinanceApi {
     @GetMapping(value = "/cwProjectRecords/getCompleteCollection")
     String getCompleteCollection();
 
+    /**
+     * 查询开票时间距今超过1个月的开票数据
+     */
+    @GetMapping(value = "/cw_finance/invoice/getExceedCwFinance")
+    String getExceedCwFinance();
+
 }

+ 12 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/controller/FinanceInvoiceController.java

@@ -1,6 +1,7 @@
 package com.jeeplus.assess.invoice.controller;
 
 import cn.hutool.log.Log;
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.aop.demo.annotation.DemoMode;
@@ -329,4 +330,15 @@ public class FinanceInvoiceController {
         EasyPoiUtil.exportExcel ( result, sheetName,  sheetName, FinanceInvoiceDTO.class, fileName, response );
 
     }
+
+
+    /**
+     * 查询开票时间距今超过1个月的开票数据
+     */
+    @ApiLog("查询开票时间距今超过1个月的开票数据")
+    @GetMapping("getExceedFinance")
+    public String getExceedFinance(){
+        List<FinanceInvoiceDTO> invoiceList = financeInvoiceService.getExceedFinance();
+        return JSON.toJSONString(invoiceList);
+    }
 }

+ 4 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/mapper/FinanceInvoiceMapper.java

@@ -13,6 +13,8 @@ import com.jeeplus.assess.program.configuration.fileDict.service.dto.ProgramFile
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 /**
  * @Entity com.jeeplus.test.finance.invoice.domain.FinanceInvoice
  */
@@ -29,6 +31,8 @@ public interface FinanceInvoiceMapper extends BaseMapper<FinanceInvoice> {
      * @param id
      */
     void setReceivablesDateNull(@Param("id") String id);
+
+    List<FinanceInvoiceDTO> getExceedFinance();
 }
 
 

+ 25 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/mapper/xml/FinanceInvoiceMapper.xml

@@ -238,4 +238,29 @@
     <update id="setReceivablesDateNull" parameterType="string">
         update finance_invoice set receivables_date = null where id = #{id}
     </update>
+
+    <select id="getExceedFinance" resultType="com.jeeplus.assess.invoice.service.dto.FinanceInvoiceDTO">
+        SELECT
+        DISTINCT
+        <include refid="Base_Column_List"></include>,
+        (select
+        CASE
+        WHEN RIGHT( GROUP_CONCAT(case when program_id is null then 2 else 1 end),1) =2 THEN GROUP_CONCAT(concat('其他:',wipr1.program_name))
+        WHEN RIGHT( GROUP_CONCAT(case when program_id is null then 2 else 1 end),1) =1 THEN GROUP_CONCAT(rpr1.name)
+        ELSE '' END
+        FROM finance_invoice_base wipr1
+        LEFT JOIN program_project_list_info rpr1 ON wipr1.program_id = rpr1.id
+        WHERE wipr1.invoice_id = fi.id) as programName,
+        fi.create_by_id as 'createBy.id'
+        FROM
+        finance_invoice_base a
+        left join finance_invoice fi on a.invoice_id = fi.id
+        LEFT JOIN program_project_list_info pr on a.program_id=pr.id
+        WHERE
+        ( fi.receivables_date IS NULL OR fi.receivables_status = '0' )
+        AND DATE( fi.billing_date ) &lt;= DATE(
+        DATE_SUB( CURDATE(), INTERVAL 1 MONTH ))
+        ORDER BY
+        fi.billing_date DESC
+    </select>
 </mapper>

+ 10 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/service/FinanceInvoiceService.java

@@ -675,4 +675,14 @@ public class FinanceInvoiceService extends ServiceImpl<FinanceInvoiceMapper, Fin
         }
         return null;
     }
+
+    /**
+     * 查询开票时间距今超过1个月的开票数据
+     * @return
+     */
+    public List<FinanceInvoiceDTO> getExceedFinance() {
+        //查询开票时间为空的,或者是否开票为否的  开票时间距今超过1个月的开票数据
+        List<FinanceInvoiceDTO> list=financeInvoiceMapper.getExceedFinance();
+        return list;
+    }
 }

+ 11 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/controller/CwFinanceInvoiceController.java

@@ -541,6 +541,17 @@ public class CwFinanceInvoiceController {
     }
 
 
+    /**
+     * 查询开票时间距今超过1个月的开票数据
+     */
+    @ApiLog("查询开票时间距今超过1个月的开票数据")
+    @GetMapping("getExceedCwFinance")
+    public String getExceedCwFinance(){
+        List<CwFinanceInvoiceDTO> invoiceList = cwFinanceInvoiceService.getExceedCwFinance();
+        return JSON.toJSONString(invoiceList);
+    }
+
+
 
 
 

+ 2 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/CwFinanceInvoiceMapper.java

@@ -57,6 +57,8 @@ public interface CwFinanceInvoiceMapper extends BaseMapper<CwFinanceInvoice> {
     CwFinanceInvoiceBase getByNo(String invoiceNumber);
 
     Integer getCountByNo(@Param("no") String no);
+
+    List<CwFinanceInvoiceDTO> getExceedCwFinance();
 }
 
 

+ 25 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/xml/CwFinanceInvoiceMapper.xml

@@ -595,4 +595,29 @@
         WHERE fi.no = #{no} AND cpr.is_pre_invoice = '1';
     </select>
 
+    <select id="getExceedCwFinance" resultType="com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceDTO">
+        SELECT
+        DISTINCT
+        <include refid="Base_Column_List"></include>,
+        (
+        case
+        when a.type = '0' then (concat('其他:',a.program_name))
+        when a.type = '1' then (select rpr.project_name from cw_project_records rpr where id = a.program_id)
+        when a.type = '2' then (select rpr.project_name from cw_project_records rpr where id = (select project_id from cw_project_report where id = a.program_id))
+        when a.type = '4' then (select rpr.project_name from cw_project_records rpr where id = a.program_id)
+        else '' end
+        ) as programName,
+        fi.create_by_id as 'createBy.id'
+        FROM
+        cw_finance_invoice_base a
+        left join cw_finance_invoice fi on a.invoice_id = fi.id
+        LEFT JOIN cw_project_records pr on a.program_id=pr.id
+        WHERE
+        ( fi.receivables_date IS NULL OR fi.receivables_status = '0' )
+        AND DATE( fi.billing_date ) &lt;= DATE(
+        DATE_SUB( CURDATE(), INTERVAL 1 MONTH ))
+        ORDER BY
+        fi.billing_date DESC
+    </select>
+
 </mapper>

+ 12 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/CwFinanceInvoiceService.java

@@ -49,6 +49,8 @@ import javax.annotation.Resource;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.text.SimpleDateFormat;
+import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.stream.Collectors;
@@ -910,4 +912,14 @@ public class CwFinanceInvoiceService extends ServiceImpl<CwFinanceInvoiceMapper,
         }
         return false;
     }
+
+    /*
+    查询开票时间距今超过1个月的开票数据
+     */
+    public List<CwFinanceInvoiceDTO> getExceedCwFinance() {
+
+        //查询开票时间为空的,或者是否开票为否的  开票时间距今超过1个月的开票数据
+        List<CwFinanceInvoiceDTO> list=cwFinanceInvoiceMapper.getExceedCwFinance();
+        return list;
+    }
 }

+ 327 - 0
jeeplus-modules/jeeplus-xxl-job-executor-sample/src/main/java/com/jeeplus/domain/CwFinanceInvoiceList.java

@@ -0,0 +1,327 @@
+package com.jeeplus.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.core.service.dto.BaseDTO;
+import com.jeeplus.sys.service.dto.UserDTO;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 财务管理-发票
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class CwFinanceInvoiceList {
+
+    public static final String BIZ_CODE = "4";
+
+    private UserDTO createBy;
+    private String id;
+    /**
+     * 发票申请编号
+     */
+    private String no;
+
+    /**
+     * 项目名称
+     */
+    private String programName;
+
+    private String reportNos;
+
+    /**
+     * 实际开票单位
+     */
+    private String billingWorkplaceReal;
+
+    /**
+     * 经办人
+     */
+    private String operator;
+
+    /**
+     * 经办人部门
+     */
+    private String operatorOffice;
+
+    /**
+     * 发票号
+     */
+    private String number;
+
+    /**
+     * 开票金额(元)
+     */
+    private String account;
+
+    private String baseAccount;
+
+    /**
+     * 发票金额(元)
+     */
+    private String accountDetail;
+
+    private String reportType;
+
+    private String projectClassification;
+
+    /**
+     * 开票内容
+     */
+    private String billingContent;
+
+    /**
+     * 发票类型
+     */
+    private String type;
+
+    /**
+     * 开票时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date billingDate;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 收款日期
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date receivablesDate;
+
+    /**
+     * 是否确认收款
+     */
+    private String receivablesStatus;
+
+    /**
+     * 备注信息
+     */
+    private String remarks;
+
+    /**
+     * 开票类型
+     */
+    private String billingType;
+
+
+    /**
+     * 纳税人识别号
+     */
+    private String taxpayerIdentificationNo;
+
+    /**
+     * 地址
+     */
+    private String address;
+
+    /**
+     * 电话
+     */
+    private String telPhone;
+
+    /**
+     * 开户银行
+     */
+    private String openBank;
+
+    /**
+     * 银行账号
+     */
+    private String bankAccount;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 收款类型
+     */
+    private String receivablesType;
+
+    /**
+     * 开票内容要求
+     */
+    private String billingContentTerms;
+
+    /**
+     * 开票人
+     */
+    private String billingPeople;
+
+
+    /**
+     * 领票时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date collectDate;
+
+    /**
+     * 实际开票人
+     */
+    private String billingPeopleReal;
+    /**
+     * 实际开票人姓名
+     */
+    private String billingPeopleRealName;
+
+    /**
+     * 对账人id
+     */
+    private String reconciliationPeople;
+
+    /**
+     * 对账人姓名
+     */
+    private String reconciliationPeopleName;
+
+    /**
+     * 对账地区
+     */
+    private String reconciliationArea;
+
+    /**
+     * 实际开票单位id
+     */
+    private String billingWorkplaceRealId;
+
+    /**
+     * 开票人id
+     */
+    private String billingPeopleId;
+
+    /**
+     * 流程id
+     */
+    private String procInsId;
+
+    /**
+     * 流程信息
+     */
+    private String processDefinitionId;
+
+    /**
+     * 是否作废
+     */
+    private String invalidStatus;
+
+    /**
+     * 开票总金额 Begin
+     */
+    private String accountBegin;
+
+    /**
+     * 开票总金额 End
+     */
+    private String accountEnd;
+
+    /**
+     * 开票日期 Begin
+     */
+    private String billingDateBegin;
+
+    /**
+     * 开票日期 End
+     */
+    private String billingDateEnd;
+
+    /**
+     * 收款日期Begin
+     */
+    private String remittanceDateBegin;
+
+    /**
+     * 收款日期End
+     */
+    private String remittanceDateEnd;
+
+    /**
+     * 项目id
+     */
+    private String programId;
+
+    /**
+     * 数据审核人  发票申请
+     */
+    private List<String> auditUserIds;
+
+    /**
+     * 发票作废  taskId
+     */
+    private String invalidTaskId;
+
+    private String taskId;
+
+    /**
+     * 数据审核人  发票作废
+     */
+    private List<String> auditUserIdsInvalid;
+
+    /**
+     * 是否为收款页面   0否  1是
+     */
+    private String isReceivables;
+
+    /**
+     * 是否多张开票  1是  0否
+     */
+    private String isMultiple;
+
+    /**
+     * 实际开票单位的开票信息id
+     */
+    private String billingId;
+
+
+    /**
+     * 基本信息表id
+     */
+    private String baseId;
+
+    /**
+     * 基本信息中的类型(项目:1;报告:2;其他:0)
+     */
+    private String recordType;
+
+    /**
+     * 报告文号
+     */
+    private String reportNo;
+
+    /**
+     * 邮箱账号
+     */
+    private String actualDrawerEmailAddress;
+
+    /**
+     * 单选类型确认
+     */
+    private String checkType;
+    /**
+     * 是否预开票
+     */
+    private String isPreInvoice;
+
+    private String createName;
+
+    /*8
+    预开票已关联
+     */
+    private String isCompleteInvoice;
+
+
+
+    private static final long serialVersionUID = 1L;
+}

+ 325 - 0
jeeplus-modules/jeeplus-xxl-job-executor-sample/src/main/java/com/jeeplus/domain/FinanceInvoiceList.java

@@ -0,0 +1,325 @@
+package com.jeeplus.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.sys.service.dto.UserDTO;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 评估-财务管理-发票
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class FinanceInvoiceList {
+
+    public static final String BIZ_CODE = "4";
+
+    private UserDTO createBy;
+    private String id;
+    /**
+     * 发票申请编号
+     */
+    private String no;
+
+    /**
+     * 项目名称
+     */
+    private String programName;
+
+    private String reportNos;
+
+    /**
+     * 实际开票单位
+     */
+    private String billingWorkplaceReal;
+
+    /**
+     * 经办人
+     */
+    private String operator;
+
+    /**
+     * 经办人部门
+     */
+    private String operatorOffice;
+
+    /**
+     * 发票号
+     */
+    private String number;
+
+    /**
+     * 开票金额(元)
+     */
+    private String account;
+
+    private String baseAccount;
+
+    /**
+     * 发票金额(元)
+     */
+    private String accountDetail;
+
+    private String reportType;
+
+    private String projectClassification;
+
+    /**
+     * 开票内容
+     */
+    private String billingContent;
+
+    /**
+     * 发票类型
+     */
+    private String type;
+
+    /**
+     * 开票时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date billingDate;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 收款日期
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date receivablesDate;
+
+    /**
+     * 是否确认收款
+     */
+    private String receivablesStatus;
+
+    /**
+     * 备注信息
+     */
+    private String remarks;
+
+    /**
+     * 开票类型
+     */
+    private String billingType;
+
+
+    /**
+     * 纳税人识别号
+     */
+    private String taxpayerIdentificationNo;
+
+    /**
+     * 地址
+     */
+    private String address;
+
+    /**
+     * 电话
+     */
+    private String telPhone;
+
+    /**
+     * 开户银行
+     */
+    private String openBank;
+
+    /**
+     * 银行账号
+     */
+    private String bankAccount;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 收款类型
+     */
+    private String receivablesType;
+
+    /**
+     * 开票内容要求
+     */
+    private String billingContentTerms;
+
+    /**
+     * 开票人
+     */
+    private String billingPeople;
+
+
+    /**
+     * 领票时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date collectDate;
+
+    /**
+     * 实际开票人
+     */
+    private String billingPeopleReal;
+    /**
+     * 实际开票人姓名
+     */
+    private String billingPeopleRealName;
+
+    /**
+     * 对账人id
+     */
+    private String reconciliationPeople;
+
+    /**
+     * 对账人姓名
+     */
+    private String reconciliationPeopleName;
+
+    /**
+     * 对账地区
+     */
+    private String reconciliationArea;
+
+    /**
+     * 实际开票单位id
+     */
+    private String billingWorkplaceRealId;
+
+    /**
+     * 开票人id
+     */
+    private String billingPeopleId;
+
+    /**
+     * 流程id
+     */
+    private String procInsId;
+
+    /**
+     * 流程信息
+     */
+    private String processDefinitionId;
+
+    /**
+     * 是否作废
+     */
+    private String invalidStatus;
+
+    /**
+     * 开票总金额 Begin
+     */
+    private String accountBegin;
+
+    /**
+     * 开票总金额 End
+     */
+    private String accountEnd;
+
+    /**
+     * 开票日期 Begin
+     */
+    private String billingDateBegin;
+
+    /**
+     * 开票日期 End
+     */
+    private String billingDateEnd;
+
+    /**
+     * 收款日期Begin
+     */
+    private String remittanceDateBegin;
+
+    /**
+     * 收款日期End
+     */
+    private String remittanceDateEnd;
+
+    /**
+     * 项目id
+     */
+    private String programId;
+
+    /**
+     * 数据审核人  发票申请
+     */
+    private List<String> auditUserIds;
+
+    /**
+     * 发票作废  taskId
+     */
+    private String invalidTaskId;
+
+    private String taskId;
+
+    /**
+     * 数据审核人  发票作废
+     */
+    private List<String> auditUserIdsInvalid;
+
+    /**
+     * 是否为收款页面   0否  1是
+     */
+    private String isReceivables;
+
+    /**
+     * 是否多张开票  1是  0否
+     */
+    private String isMultiple;
+
+    /**
+     * 实际开票单位的开票信息id
+     */
+    private String billingId;
+
+
+    /**
+     * 基本信息表id
+     */
+    private String baseId;
+
+    /**
+     * 基本信息中的类型(项目:1;报告:2;其他:0)
+     */
+    private String recordType;
+
+    /**
+     * 报告文号
+     */
+    private String reportNo;
+
+    /**
+     * 邮箱账号
+     */
+    private String actualDrawerEmailAddress;
+
+    /**
+     * 单选类型确认
+     */
+    private String checkType;
+    /**
+     * 是否预开票
+     */
+    private String isPreInvoice;
+
+    private String createName;
+
+    /*8
+    预开票已关联
+     */
+    private String isCompleteInvoice;
+
+
+
+    private static final long serialVersionUID = 1L;
+}

+ 157 - 0
jeeplus-modules/jeeplus-xxl-job-executor-sample/src/main/java/com/xxl/job/executor/service/jobhandler/SampleXxlJob.java

@@ -730,4 +730,161 @@ public class SampleXxlJob {
         map.put("recordType", recordType);
         return map;
     }
+
+
+    /**
+     * 会计-超期收款发票通知
+     */
+    @XxlJob("exceedCwFinance")
+    public void exceedCwFinance(){
+        String exceedCwFinance = SpringUtil.getBean(FinanceFeignApi.class).getExceedCwFinance();
+        List<CwFinanceInvoiceList> invoiceList = JSON.parseObject(exceedCwFinance, new TypeReference<List<CwFinanceInvoiceList>>() {});
+        for (CwFinanceInvoiceList invoice : invoiceList) {
+            //对数据进行发送通知
+            String taskName = null;
+            String titleStr = null;
+
+            int interval = Integer.parseInt(this.getInterval(invoice.getBillingDate(), new Date()));
+
+            taskName = "超期收款发票";
+            titleStr = "发票编号为"+ invoice.getNo()+"的项目["+invoice.getProgramName()+"],已超期"+interval+"天,请尽快收款";
+
+            Set<String> noticeUserSet = new HashSet<String>();
+
+            //获取人员信息
+            String byIdForXXL = SpringUtil.getBean(IUserApi.class).getByIdForXXL(invoice.getCreateBy().getId());
+            UserDTO createUser = JSON.parseObject(byIdForXXL, new TypeReference<UserDTO>() {});
+
+            if(null != createUser && StringUtils.isNotBlank(createUser.getId())){
+                noticeUserSet.add(createUser.getId());
+            }
+            List<String> noticeUserList = new ArrayList<String>(noticeUserSet);
+            if(noticeUserList.size()>0){
+                MyNoticeList myNotice = new MyNoticeList();
+                myNotice.setCreateById("1");
+                myNotice.setCreateTime(new Date());
+                myNotice.setUpdateById("1");
+                myNotice.setUpdateTime(new Date());
+                myNotice.setDelFlag(0);
+                //根据procInsId获取taskId
+//                String currentTask = SpringUtil.getBean(IFlowableApi.class).getTaskIdByprocInstId(info.getProcInsId());
+                myNotice.setTaskId("");
+                myNotice.setDefId(invoice.getId());
+                myNotice.setTitle(titleStr);
+                myNotice.setTaskName(taskName);
+                myNotice.setLink("结束");
+                myNotice.setType("0");
+                myNotice.setCreateUser("管理员");
+                myNotice.setCreateTime(new Date());
+
+                for (String noticeUserId : noticeUserList) {
+                    myNotice.setNoticeId(noticeUserId);
+                    myNotice.setNoticeName(createUser.getName());
+                    //根据taskName和通知人 查询重复数量
+                    String myNoticeInfo = JSON.toJSONString(myNotice);
+                    Map<String,String> map = new HashMap();
+                    map.put("myNoticeInfo", myNoticeInfo);
+                    String jsonInfo = SpringUtil.getBean(IFlowableApi.class).getRepetitionCountBymyNoticeTitle(map);
+                    MyNoticeList repetitionCountBymyNotice = JSON.parseObject(jsonInfo, new TypeReference<MyNoticeList>() {});
+
+                    if(null == repetitionCountBymyNotice){
+                        // 生成id
+                        String id = UUID.randomUUID().toString().replace("-", "");
+                        myNotice.setId(id);
+                        myNotice.setRepetitionCount(0);
+
+                        myNoticeInfo = JSON.toJSONString(myNotice);
+                        map.put("myNoticeInfo", myNoticeInfo);
+                        SpringUtil.getBean ( IFlowableApi.class ).insertMyNotice(map);
+                    }else{
+                        myNotice.setId(repetitionCountBymyNotice.getId());
+                        myNotice.setRepetitionCount(repetitionCountBymyNotice.getRepetitionCount()+1);
+
+                        myNoticeInfo = JSON.toJSONString(myNotice);
+                        map.put("myNoticeInfo", myNoticeInfo);
+                        SpringUtil.getBean ( IFlowableApi.class ).updateMyNotice(map);
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * 评估-超期收款发票通知
+     */
+    @XxlJob("exceedFinance")
+    public void exceedFinance(){
+        String exceedFinance = SpringUtil.getBean(AssessFeignApi.class).getExceedFinance();
+        List<FinanceInvoiceList> invoiceList = JSON.parseObject(exceedFinance, new TypeReference<List<FinanceInvoiceList>>() {});
+        for (FinanceInvoiceList invoice : invoiceList) {
+            //对数据进行发送通知
+            String taskName = null;
+            String titleStr = null;
+
+            int interval = Integer.parseInt(this.getInterval(invoice.getBillingDate(), new Date()));
+
+            taskName = "评估发票超期收款";
+            titleStr = "发票编号为"+ invoice.getNo()+"的项目["+invoice.getProgramName()+"],已超期"+interval+"天,请尽快收款";
+
+            Set<String> noticeUserSet = new HashSet<String>();
+
+            //获取人员信息
+            String byIdForXXL = SpringUtil.getBean(IUserApi.class).getByIdForXXL(invoice.getCreateBy().getId());
+            UserDTO createUser = JSON.parseObject(byIdForXXL, new TypeReference<UserDTO>() {});
+
+            if(null != createUser && StringUtils.isNotBlank(createUser.getId())){
+                noticeUserSet.add(createUser.getId());
+            }
+            List<String> noticeUserList = new ArrayList<String>(noticeUserSet);
+            if(noticeUserList.size()>0){
+                MyNoticeList myNotice = new MyNoticeList();
+                myNotice.setCreateById("1");
+                myNotice.setCreateTime(new Date());
+                myNotice.setUpdateById("1");
+                myNotice.setUpdateTime(new Date());
+                myNotice.setDelFlag(0);
+                //根据procInsId获取taskId
+//                String currentTask = SpringUtil.getBean(IFlowableApi.class).getTaskIdByprocInstId(info.getProcInsId());
+                myNotice.setTaskId("");
+                myNotice.setDefId(invoice.getId());
+                myNotice.setTitle(titleStr);
+                myNotice.setTaskName(taskName);
+                myNotice.setLink("结束");
+                myNotice.setType("0");
+                myNotice.setCreateUser("管理员");
+                myNotice.setCreateTime(new Date());
+
+                for (String noticeUserId : noticeUserList) {
+                    myNotice.setNoticeId(noticeUserId);
+                    myNotice.setNoticeName(createUser.getName());
+                    //根据taskName和通知人 查询重复数量
+                    String myNoticeInfo = JSON.toJSONString(myNotice);
+                    Map<String,String> map = new HashMap();
+                    map.put("myNoticeInfo", myNoticeInfo);
+                    String jsonInfo = SpringUtil.getBean(IFlowableApi.class).getRepetitionCountBymyNoticeTitle(map);
+                    MyNoticeList repetitionCountBymyNotice = JSON.parseObject(jsonInfo, new TypeReference<MyNoticeList>() {});
+
+                    if(null == repetitionCountBymyNotice){
+                        // 生成id
+                        String id = UUID.randomUUID().toString().replace("-", "");
+                        myNotice.setId(id);
+                        myNotice.setRepetitionCount(0);
+
+                        myNoticeInfo = JSON.toJSONString(myNotice);
+                        map.put("myNoticeInfo", myNoticeInfo);
+                        SpringUtil.getBean ( IFlowableApi.class ).insertMyNotice(map);
+                    }else{
+                        myNotice.setId(repetitionCountBymyNotice.getId());
+                        myNotice.setRepetitionCount(repetitionCountBymyNotice.getRepetitionCount()+1);
+
+                        myNoticeInfo = JSON.toJSONString(myNotice);
+                        map.put("myNoticeInfo", myNoticeInfo);
+                        SpringUtil.getBean ( IFlowableApi.class ).updateMyNotice(map);
+                    }
+                }
+            }
+        }
+    }
+
+
 }