From 96118de3ac74f5468cf5d4ac73d6ea3bec1da010 Mon Sep 17 00:00:00 2001
From: shiyunteng <shiyunteng@example.com>
Date: 星期五, 20 十一月 2026 14:36:25 +0800
Subject: [PATCH] feat:新增销售指标 产品板块 重点工作 专项业务 产品收入和合同统计修改功能 feat:承兑新增承兑编号字段 feat:客商主数据更新名称 专项业务去年同月字段 机动车销售发票地址字段及判断 feat:银行流水更新客户id feat:机动车销售发票新增税务及代码字段 feat:流水更新按钮参数 feat:检索新增标的物运维按钮
---
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/BusinessCustomerController.java | 61
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/BankStatementServiceImpl.java | 50
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ZbStatisticXszbServiceImpl.java | 795 +++++
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/PaymentCreditMapper.java | 17
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ContractSubjectMatterMapper.java | 1
platformx-business-finance-biz/src/main/resources/mapper/PaymentCreditMapper.xml | 25
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ZBJTStatisticController.java | 50
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ContractSubjectMatterService.java | 2
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ZbStatisticXszbMapper.java | 11
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/StatisticController.java | 2
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ZbStatisticZxywServiceImpl.java | 1177 +++++++
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ZbStatisticCpXssrMapper.java | 11
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/PaymentSlipServiceImpl.java | 38
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/JznbyszkVo.java | 24
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ContractInvoiceController.java | 11
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ContractInvoice.java | 2
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ZbStatisticCpbkService.java | 12
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractSubjectMatterServiceImpl.java | 10
platformx-business-finance-biz/src/main/resources/mapper/ZbStatisticCpXzhtMapper.xml | 20
platformx-business-finance-biz/src/main/resources/mapper/HistoryOverdueMapper.xml | 93
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ContractMapper.java | 14
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/PaymentConfirmAddDTO.java | 2
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/ReceiveItemVo.java | 2
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/OutBoundServiceImpl.java | 6
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/PaymentOffsetServiceImpl.java | 3
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ZbStatisticCpXzhtController.java | 130
platformx-business-finance-biz/src/main/resources/mapper/PaymentReceiveMapper.xml | 1189 +++++++
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ZbStatisticCpbkServiceImpl.java | 364 ++
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractInvoiceServiceImpl.java | 86
platformx-business-finance-biz/src/main/resources/mapper/ContractSubjectMatterMapper.xml | 5
platformx-business-finance-biz/src/main/resources/mapper/ZbStatisticZxywMapper.xml | 22
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ZbStatisticCpXzht.java | 79
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ZbStatisticCpbkMapper.java | 11
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/ReceiveBipVo.java | 1
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ZbStatisticXszbService.java | 12
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ContractService.java | 4
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ZbStatisticZdgzController.java | 130
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ZbStatisticCpXzhtServiceImpl.java | 177 +
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ZbStatisticXszb.java | 88
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/BankStatementService.java | 2
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ZbStatisticZxyw.java | 86
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ContractInvoiceService.java | 2
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ProductServiceImpl.java | 26
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/StatisticServiceImpl.java | 63
platformx-business-finance-biz/src/main/resources/mapper/ContractMapper.xml | 100
platformx-business-finance-biz/src/main/resources/mapper/ZbStatisticXszbMapper.xml | 23
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ZBJTStatisticServiceImpl.java | 1911 ++++++-----
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ZbStatisticZxywMapper.java | 11
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/UpdBwParamDTO.java | 12
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ZbStatisticZdgzService.java | 12
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractPaymentScheduleProcessServiceImpl.java | 3
platformx-business-finance-biz/src/main/resources/mapper/PaymentSlipMapper.xml | 27
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/ContracQueryDTO.java | 3
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ZbStatisticCpXzhtMapper.java | 11
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/BusinessCustomerServiceImpl.java | 55
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ContractController.java | 17
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/PjdxcksxywwcqkVo.java | 2
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ZbStatisticCpXssrService.java | 12
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ZbStatisticZxywController.java | 129
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/GenInvoiceInfoDTO.java | 2
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ContractSubjectMatterController.java | 13
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/PaymentSlipController.java | 9
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/PaymentReceiveMapper.java | 7
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractServiceImpl.java | 979 +++--
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/PaymentConfirmServiceImpl.java | 42
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ContractInvoiceMapper.java | 2
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ZbStatisticZxywService.java | 12
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ZbStatisticCpXssrServiceImpl.java | 172 +
platformx-business-finance-biz/src/main/resources/mapper/ZbStatisticCpXssrMapper.xml | 20
platformx-business-finance-biz/src/main/resources/mapper/ZbStatisticZdgzMapper.xml | 21
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ZbStatisticCpXzhtService.java | 12
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ZbStatisticZdgzServiceImpl.java | 178 +
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/BankStatementController.java | 13
platformx-business-finance-biz/src/main/resources/mapper/ContractInvoiceMapper.xml | 59
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ZbStatisticZdgzMapper.java | 11
platformx-business-finance-biz/src/main/resources/mapper/ZbStatisticCpbkMapper.xml | 20
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ZbStatisticCpbk.java | 74
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ZbStatisticZdgz.java | 83
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ZbStatisticXszbController.java | 130
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/PaymentSlipMapper.java | 2
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/BusinessCustomerService.java | 2
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/PaymentSlipService.java | 2
platformx-business-finance-biz/src/main/resources/mapper/ContractOutBoundMapper.xml | 6
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ZbStatisticCpXssr.java | 78
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/GenInvoiceInfoVo.java | 6
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ZbStatisticCpXssrController.java | 131
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ZbStatisticCpbkController.java | 131
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ZBJTStatisticService.java | 10
88 files changed, 7,989 insertions(+), 1,482 deletions(-)
diff --git a/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/ContracQueryDTO.java b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/ContracQueryDTO.java
index 61dba64..fb57b2e 100644
--- a/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/ContracQueryDTO.java
+++ b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/ContracQueryDTO.java
@@ -21,4 +21,7 @@
@Schema(description = "鐘舵��")
private String contractStatus;
+ @Schema(description = "鍚堝悓閲戦")
+ private String amount;
+
}
diff --git a/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/GenInvoiceInfoDTO.java b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/GenInvoiceInfoDTO.java
index 9ff2679..cf7b270 100644
--- a/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/GenInvoiceInfoDTO.java
+++ b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/GenInvoiceInfoDTO.java
@@ -34,4 +34,6 @@
private String partyA;
private String partyAOrgCode;
+
+ private String swjg;
}
diff --git a/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/PaymentConfirmAddDTO.java b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/PaymentConfirmAddDTO.java
index d10f9fb..dd3aeb1 100644
--- a/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/PaymentConfirmAddDTO.java
+++ b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/PaymentConfirmAddDTO.java
@@ -29,4 +29,6 @@
private String bankSeqNo;
+ private String paymentCode;
+
}
diff --git a/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/UpdBwParamDTO.java b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/UpdBwParamDTO.java
new file mode 100644
index 0000000..a3ad073
--- /dev/null
+++ b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/UpdBwParamDTO.java
@@ -0,0 +1,12 @@
+package com.by4cloud.platformx.business.dto;
+
+import lombok.Data;
+
+@Data
+public class UpdBwParamDTO {
+
+ private Long id;
+
+ private String bwRequestParam;
+
+}
diff --git a/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ContractInvoice.java b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ContractInvoice.java
index a5dea23..bf738fa 100644
--- a/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ContractInvoice.java
+++ b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ContractInvoice.java
@@ -67,7 +67,7 @@
private String redReversal;
@Schema(description = "鍙戠エ鍙风爜")
- @Column(columnDefinition="varchar(64) comment '寮�绁ㄦ祦姘村彿'")
+ @Column(columnDefinition="varchar(64) comment '鍙戠エ鍙风爜'")
private String invoiceNo;
@Schema(description = "寮�绁ㄦ祦姘村彿")
diff --git a/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ZbStatisticCpXssr.java b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ZbStatisticCpXssr.java
new file mode 100644
index 0000000..22e8f22
--- /dev/null
+++ b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ZbStatisticCpXssr.java
@@ -0,0 +1,78 @@
+package com.by4cloud.platformx.business.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Id;
+import lombok.Data;
+import org.hibernate.annotations.Table;
+
+import java.math.BigDecimal;
+
+/**
+ * 2026骞�10鏈�9鏃� 10:13:52
+ * syt
+ */
+@Data
+@Entity//鍔犱簡鎵嶈兘鑷姩鐢熸垚琛�
+@Table(appliesTo="zb_statistic_cp_xssr",comment = "浜у搧閿�鍞敹鍏ュ畬鎴愭儏鍐�")//缁欒〃鍔犳敞閲�
+@jakarta.persistence.Table(name = "zb_statistic_cp_xssr")//鏁版嵁搴撳垱寤虹殑琛ㄦ槑
+public class ZbStatisticCpXssr {
+
+ @Id
+ @TableId(
+ value = "id",
+ type = IdType.ASSIGN_ID
+ )
+ private Long id;
+
+ @Schema(description = "鍗曚綅ID")
+ @Column(columnDefinition="varchar(32) comment '鍗曚綅ID'")
+ private Long compId;
+
+ @Schema(description = "缁熻骞存湀")
+ @Column(columnDefinition="varchar(32) comment '缁熻骞存湀'")
+ private String statYm;
+
+ @Schema(description = "浜у搧鍚嶇О")
+ @Column(columnDefinition="varchar(64) comment '浜у搧鍚嶇О'")
+ private String xm;
+
+ @Schema(description = "褰撴湀閿�鍞噺")
+ @Column(columnDefinition="decimal(20,2) comment '褰撴湀閿�鍞噺'")
+ private BigDecimal dyxsl;
+
+ @Schema(description = "褰撴湀閿�鍞敹鍏�")
+ @Column(columnDefinition="decimal(20,2) comment '褰撴湀閿�鍞敹鍏�'")
+ private BigDecimal dyxssr;
+
+ @Schema(description = "绱閿�鍞噺")
+ @Column(columnDefinition="decimal(20,2) comment '褰撴湀閿�鍞噺'")
+ private BigDecimal ljxsl;
+
+ @Schema(description = "绱閿�鍞敹鍏�")
+ @Column(columnDefinition="decimal(20,2) comment '绱閿�鍞敹鍏�'")
+ private BigDecimal ljxssr;
+
+ @Schema(description = "鍘诲勾鍚屾湡閿�鍞噺")
+ @Column(columnDefinition="decimal(20,2) comment '鍘诲勾鍚屾湡閿�鍞噺'")
+ private BigDecimal qnljxsl;
+
+ @Schema(description = "鍘诲勾鍚屾湡閿�鍞敹鍏�")
+ @Column(columnDefinition="decimal(20,2) comment '鍘诲勾鍚屾湡閿�鍞敹鍏�'")
+ private BigDecimal qnljxssr;
+
+ @Schema(description = "鍚屾湡姣旈攢鍞噺")
+ @Column(columnDefinition="decimal(20,2) comment '褰撴湀閿�鍞噺'")
+ private BigDecimal tqbxsl;
+
+ @Schema(description = "鍚屾湡姣旈攢鍞敹鍏�")
+ @Column(columnDefinition="decimal(20,2) comment '鍚屾湡姣旈攢鍞敹鍏�'")
+ private BigDecimal tqbxssr;
+
+ @Schema(description = "鎺掑簭")
+ @Column(columnDefinition="int comment '鎺掑簭'")
+ private Integer sort;
+}
diff --git a/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ZbStatisticCpXzht.java b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ZbStatisticCpXzht.java
new file mode 100644
index 0000000..508d4b4
--- /dev/null
+++ b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ZbStatisticCpXzht.java
@@ -0,0 +1,79 @@
+package com.by4cloud.platformx.business.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Id;
+import lombok.Data;
+import org.hibernate.annotations.Table;
+
+import java.math.BigDecimal;
+
+/**
+ * 2026骞�10鏈�9鏃� 10:13:52
+ * syt
+ */
+@Data
+@Entity//鍔犱簡鎵嶈兘鑷姩鐢熸垚琛�
+@Table(appliesTo="zb_statistic_cp_xzht",comment = "浜у搧鏂板鍚堝悓瀹屾垚鎯呭喌")//缁欒〃鍔犳敞閲�
+@jakarta.persistence.Table(name = "zb_statistic_cp_xzht")//鏁版嵁搴撳垱寤虹殑琛ㄦ槑
+public class ZbStatisticCpXzht {
+
+ @Id
+ @TableId(
+ value = "id",
+ type = IdType.ASSIGN_ID
+ )
+ private Long id;
+
+ @Schema(description = "鍗曚綅ID")
+ @Column(columnDefinition="varchar(32) comment '鍗曚綅ID'")
+ private Long compId;
+
+ @Schema(description = "缁熻骞存湀")
+ @Column(columnDefinition="varchar(32) comment '缁熻骞存湀'")
+ private String statYm;
+
+ @Schema(description = "浜у搧鍚嶇О")
+ @Column(columnDefinition="varchar(64) comment '浜у搧鍚嶇О'")
+ private String xm;
+
+ @Schema(description = "褰撴湀閿�鍞噺")
+ @Column(columnDefinition="decimal(20,2) comment '褰撴湀閿�鍞噺'")
+ private BigDecimal dyxsl;
+
+ @Schema(description = "褰撴湀閿�鍞敹鍏�")
+ @Column(columnDefinition="decimal(20,2) comment '褰撴湀閿�鍞敹鍏�'")
+ private BigDecimal dyxssr;
+
+ @Schema(description = "绱閿�鍞噺")
+ @Column(columnDefinition="decimal(20,2) comment '褰撴湀閿�鍞噺'")
+ private BigDecimal ljxsl;
+
+ @Schema(description = "绱閿�鍞敹鍏�")
+ @Column(columnDefinition="decimal(20,2) comment '绱閿�鍞敹鍏�'")
+ private BigDecimal ljxssr;
+
+ @Schema(description = "鍘诲勾鍚屾湡閿�鍞噺")
+ @Column(columnDefinition="decimal(20,2) comment '鍘诲勾鍚屾湡閿�鍞噺'")
+ private BigDecimal qnljxsl;
+
+ @Schema(description = "鍘诲勾鍚屾湡閿�鍞敹鍏�")
+ @Column(columnDefinition="decimal(20,2) comment '鍘诲勾鍚屾湡閿�鍞敹鍏�'")
+ private BigDecimal qnljxssr;
+
+ @Schema(description = "鍚屾湡姣旈攢鍞噺")
+ @Column(columnDefinition="decimal(20,2) comment '褰撴湀閿�鍞噺'")
+ private BigDecimal tqbxsl;
+
+ @Schema(description = "鍚屾湡姣旈攢鍞敹鍏�")
+ @Column(columnDefinition="decimal(20,2) comment '鍚屾湡姣旈攢鍞敹鍏�'")
+ private BigDecimal tqbxssr;
+
+ @Schema(description = "鎺掑簭")
+ @Column(columnDefinition="int comment '鎺掑簭'")
+ private Integer sort;
+
+}
diff --git a/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ZbStatisticCpbk.java b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ZbStatisticCpbk.java
new file mode 100644
index 0000000..d8c98b3
--- /dev/null
+++ b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ZbStatisticCpbk.java
@@ -0,0 +1,74 @@
+package com.by4cloud.platformx.business.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Id;
+import lombok.Data;
+import org.hibernate.annotations.Table;
+
+import java.math.BigDecimal;
+
+/**
+ * 2026骞�10鏈�9鏃� 10:13:52
+ * syt
+ */
+@Data
+@Entity//鍔犱簡鎵嶈兘鑷姩鐢熸垚琛�
+@Table(appliesTo="zb_statistic_cpbk",comment = "浜у搧鏉垮潡瀹屾垚鎯呭喌")//缁欒〃鍔犳敞閲�
+@jakarta.persistence.Table(name = "zb_statistic_cpbk")//鏁版嵁搴撳垱寤虹殑琛ㄦ槑
+public class ZbStatisticCpbk {
+
+ @Id
+ @TableId(
+ value = "id",
+ type = IdType.ASSIGN_ID
+ )
+ private Long id;
+
+ @Schema(description = "鍗曚綅ID")
+ @Column(columnDefinition="varchar(32) comment '鍗曚綅ID'")
+ private Long compId;
+
+ @Schema(description = "缁熻骞存湀")
+ @Column(columnDefinition="varchar(32) comment '缁熻骞存湀'")
+ private String statYm;
+
+ @Schema(description = "椤圭洰")
+ @Column(columnDefinition="varchar(64) comment '椤圭洰'")
+ private String xm;
+
+ @Schema(description = "浜у搧鏉垮潡")
+ @Column(columnDefinition="varchar(64) comment '浜у搧鏉垮潡'")
+ private String bkmc;
+
+ @Schema(description = "褰撴湀瀹屾垚")
+ @Column(columnDefinition="decimal(20,2) comment '褰撴湀瀹屾垚'")
+ private BigDecimal dywc;
+
+ @Schema(description = "褰撴湀鍚屾湡姣�")
+ @Column(columnDefinition="varchar(32) comment '褰撴湀鍚屾湡姣�'")
+ private String ytqb;
+
+ @Schema(description = "绱瀹屾垚")
+ @Column(columnDefinition="decimal(20,2) comment '绱瀹屾垚'")
+ private BigDecimal ljwc;
+
+ @Schema(description = "绱鍚屾湡姣�")
+ @Column(columnDefinition="varchar(32) comment '绱鍚屾湡姣�'")
+ private String ntqb;
+
+ @Schema(description = "浜у搧鏉垮潡鏈勾鍗犳瘮")
+ @Column(columnDefinition="varchar(32) comment '浜у搧鏉垮潡鏈勾鍗犳瘮'")
+ private String bnzb;
+
+ @Schema(description = "浜у搧鏉垮潡鍚屾湡姣�")
+ @Column(columnDefinition="varchar(32) comment '浜у搧鏉垮潡鍚屾湡姣�'")
+ private String ztqb;
+
+ @Schema(description = "鎺掑簭")
+ @Column(columnDefinition="int comment '鎺掑簭'")
+ private Integer sort;
+}
diff --git a/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ZbStatisticXszb.java b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ZbStatisticXszb.java
new file mode 100644
index 0000000..e7e6261
--- /dev/null
+++ b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ZbStatisticXszb.java
@@ -0,0 +1,88 @@
+package com.by4cloud.platformx.business.entity;
+
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.by4cloud.platformx.common.data.mybatis.BaseModel;
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Id;
+import lombok.Data;
+import org.hibernate.annotations.Table;
+
+import java.math.BigDecimal;
+
+/**
+ * 2026骞�10鏈�9鏃� 10:13:52
+ * syt
+ */
+@Data
+@Entity//鍔犱簡鎵嶈兘鑷姩鐢熸垚琛�
+@Table(appliesTo="zb_statistic_xszb",comment = "涓昏閿�鍞寚鏍囧畬鎴愭儏鍐�")//缁欒〃鍔犳敞閲�
+@jakarta.persistence.Table(name = "zb_statistic_xszb")//鏁版嵁搴撳垱寤虹殑琛ㄦ槑
+public class ZbStatisticXszb {
+
+ @Id
+ @TableId(
+ value = "id",
+ type = IdType.ASSIGN_ID
+ )
+ private Long id;
+
+ @Schema(description = "鍗曚綅ID")
+ @Column(columnDefinition="varchar(32) comment '鍗曚綅ID'")
+ private Long compId;
+
+ @Schema(description = "椤圭洰")
+ @Column(columnDefinition="varchar(32) comment '椤圭洰'")
+ private String xm;
+
+ @Schema(description = "鍗曚綅")
+ @Column(columnDefinition="varchar(32) comment '鍗曚綅'")
+ private String dw;
+
+ @Schema(description = "缁熻骞存湀")
+ @Column(columnDefinition="varchar(32) comment '缁熻骞存湀'")
+ private String statYm;
+
+ @Schema(description = "褰撴湀璁″垝")
+ @Column(columnDefinition="decimal(20,2) comment '褰撴湀璁″垝'")
+ private BigDecimal dyjh;
+
+ @Schema(description = "褰撴湀瀹屾垚")
+ @Column(columnDefinition="decimal(20,2) comment '褰撴湀瀹屾垚'")
+ private BigDecimal dywc;
+
+ @Schema(description = "褰撴湀璁″垝瀹屾垚鐜�")
+ @Column(columnDefinition="varchar(32) comment '褰撴湀璁″垝瀹屾垚鐜�'")
+ private String yjhwc;
+
+ @Schema(description = "褰撴湀鍚屾湡姣�")
+ @Column(columnDefinition="varchar(32) comment '褰撴湀鍚屾湡姣�'")
+ private String ytqb;
+
+ @Schema(description = "骞村害璁″垝")
+ @Column(columnDefinition="decimal(20,2) comment '骞村害璁″垝'")
+ private BigDecimal ndjh;
+
+ @Schema(description = "绱璁″垝")
+ @Column(columnDefinition="decimal(20,2) comment '绱璁″垝'")
+ private BigDecimal ljjh;
+
+ @Schema(description = "绱瀹屾垚")
+ @Column(columnDefinition="decimal(20,2) comment '绱瀹屾垚'")
+ private BigDecimal ljwc;
+
+ @Schema(description = "绱璁″垝瀹屾垚鐜�")
+ @Column(columnDefinition="varchar(32) comment '绱璁″垝瀹屾垚鐜�'")
+ private String njhwc;
+
+ @Schema(description = "绱鍚屾湡姣�")
+ @Column(columnDefinition="varchar(32) comment '绱鍚屾湡姣�'")
+ private String ntqb;
+
+ @Schema(description = "鎺掑簭")
+ @Column(columnDefinition="int comment '鎺掑簭'")
+ private Integer sort;
+}
diff --git a/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ZbStatisticZdgz.java b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ZbStatisticZdgz.java
new file mode 100644
index 0000000..85c9795
--- /dev/null
+++ b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ZbStatisticZdgz.java
@@ -0,0 +1,83 @@
+package com.by4cloud.platformx.business.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Id;
+import lombok.Data;
+import org.hibernate.annotations.Table;
+
+import java.math.BigDecimal;
+
+/**
+ * 2026骞�10鏈�9鏃� 10:13:52
+ * syt
+ */
+@Data
+@Entity//鍔犱簡鎵嶈兘鑷姩鐢熸垚琛�
+@Table(appliesTo="zb_statistic_zdgz",comment = "閲嶇偣宸ヤ綔瀹屾垚鎯呭喌")//缁欒〃鍔犳敞閲�
+@jakarta.persistence.Table(name = "zb_statistic_zdgz")//鏁版嵁搴撳垱寤虹殑琛ㄦ槑
+public class ZbStatisticZdgz {
+
+ @Id
+ @TableId(
+ value = "id",
+ type = IdType.ASSIGN_ID
+ )
+ private Long id;
+
+ @Schema(description = "鍗曚綅ID")
+ @Column(columnDefinition="varchar(32) comment '鍗曚綅ID'")
+ private Long compId;
+
+ @Schema(description = "缁熻骞存湀")
+ @Column(columnDefinition="varchar(32) comment '缁熻骞存湀'")
+ private String statYm;
+
+ @Schema(description = "鍗曚綅")
+ @Column(columnDefinition="varchar(32) comment '鍗曚綅'")
+ private String dw;
+
+ @Schema(description = "椤圭洰")
+ @Column(columnDefinition="varchar(64) comment '椤圭洰'")
+ private String xm;
+
+ @Schema(description = "褰撴湀璁″垝")
+ @Column(columnDefinition="decimal(20,2) comment '褰撴湀璁″垝'")
+ private BigDecimal dyjh;
+
+ @Schema(description = "褰撴湀瀹屾垚")
+ @Column(columnDefinition="decimal(20,2) comment '褰撴湀瀹屾垚'")
+ private BigDecimal dywc;
+
+ @Schema(description = "褰撴湀瀹屾垚鐜�")
+ @Column(columnDefinition="varchar(32) comment '褰撴湀瀹屾垚鐜�'")
+ private String ywcl;
+
+ @Schema(description = "骞村害璁″垝")
+ @Column(columnDefinition="decimal(20,2) comment '骞村害璁″垝'")
+ private BigDecimal ndjh;
+
+ @Schema(description = "绱璁″垝")
+ @Column(columnDefinition="decimal(20,2) comment '绱璁″垝'")
+ private BigDecimal ljjh;
+
+ @Schema(description = "绱瀹屾垚")
+ @Column(columnDefinition="decimal(20,2) comment '绱瀹屾垚'")
+ private BigDecimal ljwc;
+
+ @Schema(description = "绱瀹屾垚鐜�")
+ @Column(columnDefinition="varchar(32) comment '绱瀹屾垚鐜�'")
+ private String ljwcl;
+
+ @Schema(description = "绱鍚屾湡姣�")
+ @Column(columnDefinition="varchar(32) comment '绱鍚屾湡姣�'")
+ private String ljtb;
+
+ @Schema(description = "鎺掑簭")
+ @Column(columnDefinition="int comment '鎺掑簭'")
+ private Integer sort;
+
+}
diff --git a/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ZbStatisticZxyw.java b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ZbStatisticZxyw.java
new file mode 100644
index 0000000..b497a17
--- /dev/null
+++ b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ZbStatisticZxyw.java
@@ -0,0 +1,86 @@
+package com.by4cloud.platformx.business.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Id;
+import lombok.Data;
+import org.hibernate.annotations.Table;
+
+import java.math.BigDecimal;
+
+/**
+ * 2026骞�10鏈�9鏃� 10:13:52
+ * syt
+ */
+@Data
+@Entity//鍔犱簡鎵嶈兘鑷姩鐢熸垚琛�
+@Table(appliesTo="zb_statistic_zxyw",comment = "涓撻」涓氬姟瀹屾垚鎯呭喌")//缁欒〃鍔犳敞閲�
+@jakarta.persistence.Table(name = "zb_statistic_zxyw")//鏁版嵁搴撳垱寤虹殑琛ㄦ槑
+public class ZbStatisticZxyw {
+
+ @Id
+ @TableId(
+ value = "id",
+ type = IdType.ASSIGN_ID
+ )
+ private Long id;
+
+ @Schema(description = "鍗曚綅ID")
+ @Column(columnDefinition="varchar(32) comment '鍗曚綅ID'")
+ private Long compId;
+
+ @Schema(description = "缁熻骞存湀")
+ @Column(columnDefinition="varchar(32) comment '缁熻骞存湀'")
+ private String statYm;
+
+ @Schema(description = "涓氬姟")
+ @Column(columnDefinition="varchar(32) comment '涓氬姟'")
+ private String yw;
+
+ @Schema(description = "绫诲埆")
+ @Column(columnDefinition="varchar(32) comment '绫诲埆'")
+ private String lb;
+
+ @Schema(description = "鍗曚綅")
+ @Column(columnDefinition="varchar(32) comment '鍗曚綅'")
+ private String dw;
+
+ @Schema(description = "褰撴湀瀹屾垚")
+ @Column(columnDefinition="decimal(20,2) comment '褰撴湀瀹屾垚'")
+ private BigDecimal dywc;
+
+ @Schema(description = "鍘诲勾鍚屾湀")
+ @Column(columnDefinition="decimal(20,2) comment '鍘诲勾鍚屾湀'")
+ private BigDecimal qnty;
+
+ @Schema(description = "褰撴湀鍚屾湡姣�")
+ @Column(columnDefinition="varchar(32) comment '褰撴湀鍚屾湡姣�'")
+ private String ytqb;
+
+ @Schema(description = "褰撴湀鍚屾瘮")
+ @Column(columnDefinition="decimal(20,2) comment '褰撴湀鍚屾瘮'")
+ private BigDecimal ytb;
+
+ @Schema(description = "鍘诲勾鍚屾湡")
+ @Column(columnDefinition="decimal(20,2) comment '鍘诲勾鍚屾湡'")
+ private BigDecimal qntq;
+
+ @Schema(description = "绱瀹屾垚")
+ @Column(columnDefinition="decimal(20,2) comment '绱瀹屾垚'")
+ private BigDecimal ljwc;
+
+ @Schema(description = "绱鍚屾湡姣�")
+ @Column(columnDefinition="varchar(32) comment '绱鍚屾湡姣�'")
+ private String ljtqb;
+
+ @Schema(description = "绱鍚屾瘮")
+ @Column(columnDefinition="decimal(20,2) comment '绱鍚屾瘮'")
+ private BigDecimal ljtb;
+
+ @Schema(description = "鎺掑簭")
+ @Column(columnDefinition="int comment '鎺掑簭'")
+ private Integer sort;
+}
diff --git a/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/GenInvoiceInfoVo.java b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/GenInvoiceInfoVo.java
index 88c0b66..d5e43e2 100644
--- a/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/GenInvoiceInfoVo.java
+++ b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/GenInvoiceInfoVo.java
@@ -73,6 +73,12 @@
private String remarks;
+ private String contact;
+
+ private String address;
+
+ private String swjg;
+
private List<ContractOutBoundInvoiceVo> outBoundInvoiceList;
private ContractInvoiceBipVo bipVo;
diff --git a/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/JznbyszkVo.java b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/JznbyszkVo.java
new file mode 100644
index 0000000..547843e
--- /dev/null
+++ b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/JznbyszkVo.java
@@ -0,0 +1,24 @@
+package com.by4cloud.platformx.business.vo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class JznbyszkVo {
+
+ private String zgs;
+
+ private BigDecimal wfyssx;
+
+ private BigDecimal dfgz;
+
+ private BigDecimal sx;
+
+ private BigDecimal hxhtze;
+
+ private BigDecimal lynjhht;
+
+ private BigDecimal lywjhht;
+
+}
diff --git a/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/PjdxcksxywwcqkVo.java b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/PjdxcksxywwcqkVo.java
index e92c7fd..f7370ba 100644
--- a/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/PjdxcksxywwcqkVo.java
+++ b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/PjdxcksxywwcqkVo.java
@@ -13,7 +13,7 @@
private String lb;
- private BigDecimal qnwc;
+ private BigDecimal qnty;
private BigDecimal dywc;
diff --git a/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/ReceiveBipVo.java b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/ReceiveBipVo.java
index dea13e7..8bfc439 100644
--- a/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/ReceiveBipVo.java
+++ b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/ReceiveBipVo.java
@@ -37,6 +37,7 @@
private String zy;
+ private String jsfs;
private List<ReceiveItemVo> itemList;
}
diff --git a/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/ReceiveItemVo.java b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/ReceiveItemVo.java
index f21ca27..d7e5f74 100644
--- a/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/ReceiveItemVo.java
+++ b/platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/ReceiveItemVo.java
@@ -30,4 +30,6 @@
private String zyys;
private String bkfl;
+
+ private String xzjysxma;
}
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/BankStatementController.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/BankStatementController.java
index 95fc84d..f4213f4 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/BankStatementController.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/BankStatementController.java
@@ -97,6 +97,19 @@
return R.ok(bankStatementService.getById(id));
}
+ /**
+ * 閫氳繃id鏌ヨ閾惰娴佹按
+ * @param id id
+ * @return R
+ */
+ @Operation(summary = "閫氳繃id鏇存柊瀹㈡埛ID" , description = "閫氳繃id鏇存柊瀹㈡埛ID" )
+ @GetMapping("/updById/{id}" )
+ public R updById(@PathVariable("id" ) Long id) {
+ return bankStatementService.updById(id);
+ }
+
+ /**
+
/**
* 鏂板閾惰娴佹按
* @param bankStatement 閾惰娴佹按
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/BusinessCustomerController.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/BusinessCustomerController.java
index 6a81f37..8a4444e 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/BusinessCustomerController.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/BusinessCustomerController.java
@@ -3,6 +3,7 @@
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -73,17 +74,15 @@
@PreAuthorize("@pms.hasPermission('business_businessCustomer_view')" )
public R getBusinessCustomerPage(@ParameterObject Page page, @ParameterObject BusinessCustomer businessCustomer) {
- if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) ||
- StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)||
- StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) {
+ if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) {
LambdaQueryWrapper<BusinessCustomer> wrapper = Wrappers.lambdaQuery();
wrapper.eq(StrUtil.isNotEmpty(businessCustomer.getProvince()),BusinessCustomer::getProvince,businessCustomer.getProvince());
wrapper.eq(StrUtil.isNotEmpty(businessCustomer.getIndustryId()),BusinessCustomer::getIndustryId,businessCustomer.getIndustryId());
wrapper.like(StrUtil.isNotEmpty(businessCustomer.getCompanyName()),BusinessCustomer::getCompanyName,businessCustomer.getCompanyName());
List<String> smjList = new ArrayList<>();
smjList.add(smj);
- smjList.add(smjsc);
- smjList.add(smjzt);
+// smjList.add(smjsc);
+// smjList.add(smjzt);
smjList.add(smjhw);
wrapper.in(BusinessCustomer::getCompId, smjList);
wrapper.orderByDesc(BusinessCustomer::getCreateTime);
@@ -107,16 +106,13 @@
@PreAuthorize("@pms.hasPermission('business_businessCustomer_view')" )
public R getBusinessCustomerList(@ParameterObject BusinessCustomer businessCustomer) {
- if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) ||
- StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)||
- StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) {
+ if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) {
LambdaQueryWrapper<BusinessCustomer> wrapper = Wrappers.lambdaQuery();
wrapper.like(StrUtil.isNotEmpty(businessCustomer.getCompanyName()),BusinessCustomer::getCompanyName,businessCustomer.getCompanyName());
-
List<String> smjList = new ArrayList<>();
smjList.add(smj);
- smjList.add(smjsc);
- smjList.add(smjzt);
+// smjList.add(smjsc);
+// smjList.add(smjzt);
smjList.add(smjhw);
wrapper.in(BusinessCustomer::getCompId, smjList);
List<BusinessCustomer> businessCustomerList = businessCustomerService.list(wrapper);
@@ -165,6 +161,34 @@
@PostMapping
@PreAuthorize("@pms.hasPermission('business_businessCustomer_add')" )
public R save(@RequestBody BusinessCustomer businessCustomer) {
+ if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) ||
+ StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)||
+ StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) {
+ if (StrUtil.isBlank(businessCustomer.getErpCompanyCode())) {
+ return R.failed("erp瀹㈡埛缂栫爜涓嶈兘涓虹┖");
+ }
+ }
+ if (StrUtil.isNotBlank(businessCustomer.getCreditCode())){
+ businessCustomer.setBipCode(businessCustomer.getCreditCode());
+ }
+ BusinessCustomer customer = null;
+ if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) {
+ List<String> smjList = new ArrayList<>();
+ smjList.add(smj);
+ smjList.add(smjhw);
+ customer = businessCustomerService.getOne(Wrappers.<BusinessCustomer>lambdaQuery()
+ .eq(BusinessCustomer::getCreditCode, businessCustomer.getCreditCode())
+ .in(BusinessCustomer::getCompId, smjList)
+ .last("limit 1"));
+ }else {
+ customer = businessCustomerService.getOne(Wrappers.<BusinessCustomer>lambdaQuery()
+ .eq(BusinessCustomer::getCreditCode, businessCustomer.getCreditCode())
+ .eq(BusinessCustomer::getCompId,SecurityUtils.getUser().getCompId())
+ .last("limit 1"));
+ }
+ if (ObjUtil.isNotNull(customer)){
+ return R.failed("瀹㈡埛宸插瓨鍦�");
+ }
return R.ok(businessCustomerService.save(businessCustomer));
}
@@ -185,6 +209,9 @@
@PutMapping
@PreAuthorize("@pms.hasPermission('business_businessCustomer_edit')" )
public R updateById(@RequestBody BusinessCustomer businessCustomer) {
+ if (StrUtil.isNotBlank(businessCustomer.getCreditCode())){
+ businessCustomer.setBipCode(businessCustomer.getCreditCode());
+ }
return R.ok(businessCustomerService.updateById(businessCustomer));
}
@@ -226,6 +253,18 @@
}
/**
+ * 閫氳繃id鏌ヨ瀹㈠晢淇℃伅
+ * @param id id
+ * @return R
+ */
+ @Operation(summary = "閫氳繃id鏇存柊瀹㈡埛鍚嶇О" , description = "閫氳繃id鏇存柊瀹㈡埛鍚嶇О" )
+ @GetMapping("/syncCustomer/{id}" )
+ public R syncCustomer(@PathVariable("id" ) Long id) {
+ return businessCustomerService.syncCustomer(id);
+ }
+
+
+ /**
* 鍚屾涓绘暟鎹� 浼佷笟鍚嶇О 娉曚汉 涓夊悎涓�鐮� 閾惰淇℃伅
* @return R
*/
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ContractController.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ContractController.java
index b068372..bd26709 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ContractController.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ContractController.java
@@ -142,6 +142,17 @@
return R.ok(contractService.removeBatchByIds(CollUtil.toList(ids)));
}
+ /**
+ * 閫氳繃id鍒犻櫎鍚堝悓绠$悊
+ * @return R
+ */
+ @Operation(summary = "閫氳繃id鍒犻櫎鍚堝悓绠$悊" , description = "閫氳繃id鍒犻櫎鍚堝悓绠$悊" )
+ @SysLog("閫氳繃id鍒犻櫎鍚堝悓绠$悊" )
+ @GetMapping("/delById/{id}")
+ public R delById(@PathVariable("id") Long id) {
+ return contractService.delById(id);
+ }
+
/**
* 瀵煎嚭excel 琛ㄦ牸
@@ -477,6 +488,12 @@
return contractService.erpPush(id);
}
+ @Inner(value = false)
+ @GetMapping("/erpPushBatch")
+ public R erpPushBatch() {
+ return contractService.erpPushBatch();
+ }
+
@GetMapping("/getInvoiceObj/{id}")
public R getInvoiceObj(@PathVariable("id") Long id) {
return contractService.getInvoiceObj(id);
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ContractInvoiceController.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ContractInvoiceController.java
index 794db86..6dd90f6 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ContractInvoiceController.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ContractInvoiceController.java
@@ -1,5 +1,6 @@
package com.by4cloud.platformx.business.controller;
+import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -245,6 +246,16 @@
return R.ok(contractInvoiceService.getById(id));
}
+ /**
+ * 閫氳繃id鏌ヨ
+ * @return R
+ */
+ @PostMapping("/updBwParamById" )
+ public R updBwParamById(@RequestBody UpdBwParamDTO dto) {
+
+ return contractInvoiceService.updBwParamById(dto);
+ }
+
/**
* 閫氳繃key鏌ヨbip瀛楀吀
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ContractSubjectMatterController.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ContractSubjectMatterController.java
index 3ffa3ea..0d45b8b 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ContractSubjectMatterController.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ContractSubjectMatterController.java
@@ -172,4 +172,17 @@
return contractSubjectMatterService.annotate(annotateDTOList);
}
+
+ /**
+ * 鍚堝悓鏍囩殑鐗╀慨鏀�
+ * @param list 鍚堝悓鏍囩殑鐗╀慨鏀�
+ * @return R
+ */
+ @Operation(summary = "鍚堝悓鏍囩殑鐗╀慨鏀�" , description = "鍚堝悓鏍囩殑鐗╀慨鏀�" )
+ @SysLog("鍚堝悓鏍囩殑鐗╀慨鏀�" )
+ @PostMapping("/batchUpd")
+ public R batchUpd(@RequestBody List<ContractSubjectMatter> list) {
+ return contractSubjectMatterService.batchUpd(list);
+ }
+
}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/PaymentSlipController.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/PaymentSlipController.java
index a497175..3472662 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/PaymentSlipController.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/PaymentSlipController.java
@@ -78,4 +78,13 @@
public R genReceivePayment(SyncPaymentRecepitDTO dto){
return paymentSlipService.genReceivePayment(dto);
}
+
+ /**
+ * 鐢熸垚璧婇攢鏁版嵁鏁版嵁
+ */
+ @Inner(value = false)
+ @GetMapping("genCreditPayment")
+ public R genCreditPayment(SyncPaymentRecepitDTO dto){
+ return paymentSlipService.genCreditPayment(dto);
+ }
}
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/StatisticController.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/StatisticController.java
index 3dfdbb3..b5eca2b 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/StatisticController.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/StatisticController.java
@@ -279,7 +279,7 @@
}
/**
- * 闆嗗洟缁熻椤� 鏈棩 鏈湀 瀹屾垚鐜� 鏈勾 瀹屾垚鐜�
+ * 闆嗗洟/瀛愬叕鍙� 缁熻椤� 鏈棩 鏈湀 瀹屾垚鐜� 鏈勾 瀹屾垚鐜�
* @return R
*/
@PostMapping("/zbjtStatistic")
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ZBJTStatisticController.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ZBJTStatisticController.java
index 5ffb226..2dcf318 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ZBJTStatisticController.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ZBJTStatisticController.java
@@ -110,4 +110,54 @@
public R cpxssrwcqk(@RequestBody ZBJTStatisticDTO queryDTO){
return zbjtStatisticService.cpxssrwcqk(queryDTO);
}
+
+ /**
+ * zbjtjznbyszk
+ * @param queryDTO
+ * @return
+ */
+ @PostMapping("/zbjtjznbyszk")
+ public R zbjtjznbyszk(@RequestBody ZBJTStatisticDTO queryDTO){
+ return zbjtStatisticService.zbjtjznbyszk(queryDTO);
+ }
+
+ /**
+ * smjjznbyszk
+ * @param queryDTO
+ * @return
+ */
+ @PostMapping("/smjjznbyszk")
+ public R smjjznbyszk(@RequestBody ZBJTStatisticDTO queryDTO){
+ return zbjtStatisticService.smjjznbyszk(queryDTO);
+ }
+
+ /**
+ * sgbjznbyszk
+ * @param queryDTO
+ * @return
+ */
+ @PostMapping("/sgbjznbyszk")
+ public R sgbjznbyszk(@RequestBody ZBJTStatisticDTO queryDTO){
+ return zbjtStatisticService.sgbjznbyszk(queryDTO);
+ }
+
+ /**
+ * jxcjznbyszk
+ * @param queryDTO
+ * @return
+ */
+ @PostMapping("/jxcjznbyszk")
+ public R jxcjznbyszk(@RequestBody ZBJTStatisticDTO queryDTO){
+ return zbjtStatisticService.jxcjznbyszk(queryDTO);
+ }
+
+ /**
+ * tfgsjznbyszk
+ * @param queryDTO
+ * @return
+ */
+ @PostMapping("/tfgsjznbyszk")
+ public R tfgsjznbyszk(@RequestBody ZBJTStatisticDTO queryDTO){
+ return zbjtStatisticService.tfgsjznbyszk(queryDTO);
+ }
}
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ZbStatisticCpXssrController.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ZbStatisticCpXssrController.java
new file mode 100644
index 0000000..de83c38
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ZbStatisticCpXssrController.java
@@ -0,0 +1,131 @@
+package com.by4cloud.platformx.business.controller;
+
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.core.util.ArrayUtil;
+import cn.hutool.core.collection.CollUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.by4cloud.platformx.business.dto.ZBJTStatisticDTO;
+import com.by4cloud.platformx.business.entity.ZbStatisticCpbk;
+import com.by4cloud.platformx.common.core.util.R;
+import com.by4cloud.platformx.common.log.annotation.SysLog;
+import com.by4cloud.platformx.business.entity.ZbStatisticCpXssr;
+import com.by4cloud.platformx.business.service.ZbStatisticCpXssrService;
+import com.by4cloud.platformx.common.security.annotation.Inner;
+import org.springframework.security.access.prepost.PreAuthorize;
+import com.by4cloud.platformx.common.excel.annotation.ResponseExcel;
+import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import org.springdoc.core.annotations.ParameterObject;
+import org.springframework.http.HttpHeaders;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * 浜у搧閿�鍞敹鍏�
+ *
+ * @author syt
+ * @date 2026-11-12 10:31:01
+ */
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/zbStatisticCpXssr" )
+@Tag(description = "zbStatisticCpXssr" , name = "浜у搧閿�鍞敹鍏ョ鐞�" )
+@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
+public class ZbStatisticCpXssrController {
+
+ private final ZbStatisticCpXssrService zbStatisticCpXssrService;
+
+ /**
+ * 鍒嗛〉鏌ヨ
+ * @param page 鍒嗛〉瀵硅薄
+ * @param zbStatisticCpXssr 浜у搧閿�鍞敹鍏�
+ * @return
+ */
+ @Operation(summary = "鍒嗛〉鏌ヨ" , description = "鍒嗛〉鏌ヨ" )
+ @GetMapping("/page" )
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticCpXssr_view')" )
+ public R getZbStatisticCpXssrPage(@ParameterObject Page page, @ParameterObject ZbStatisticCpXssr zbStatisticCpXssr) {
+ LambdaQueryWrapper<ZbStatisticCpXssr> wrapper = Wrappers.lambdaQuery();
+ wrapper.eq(StrUtil.isNotBlank(zbStatisticCpXssr.getStatYm()),ZbStatisticCpXssr::getStatYm,zbStatisticCpXssr.getStatYm());
+// wrapper.orderByAsc(ZbStatisticCpXssr::getSort);
+ return R.ok(zbStatisticCpXssrService.pageByScope(page, wrapper));
+ }
+
+
+ /**
+ * 閫氳繃id鏌ヨ浜у搧閿�鍞敹鍏�
+ * @param id id
+ * @return R
+ */
+ @Operation(summary = "閫氳繃id鏌ヨ" , description = "閫氳繃id鏌ヨ" )
+ @GetMapping("/{id}" )
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticCpXssr_view')" )
+ public R getById(@PathVariable("id" ) Long id) {
+ return R.ok(zbStatisticCpXssrService.getById(id));
+ }
+
+ /**
+ * 鏂板浜у搧閿�鍞敹鍏�
+ * @param zbStatisticCpXssr 浜у搧閿�鍞敹鍏�
+ * @return R
+ */
+ @Operation(summary = "鏂板浜у搧閿�鍞敹鍏�" , description = "鏂板浜у搧閿�鍞敹鍏�" )
+ @SysLog("鏂板浜у搧閿�鍞敹鍏�" )
+ @PostMapping
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticCpXssr_add')" )
+ public R save(@RequestBody ZbStatisticCpXssr zbStatisticCpXssr) {
+ return R.ok(zbStatisticCpXssrService.save(zbStatisticCpXssr));
+ }
+
+ /**
+ * 淇敼浜у搧閿�鍞敹鍏�
+ * @param zbStatisticCpXssr 浜у搧閿�鍞敹鍏�
+ * @return R
+ */
+ @Operation(summary = "淇敼浜у搧閿�鍞敹鍏�" , description = "淇敼浜у搧閿�鍞敹鍏�" )
+ @SysLog("淇敼浜у搧閿�鍞敹鍏�" )
+ @PutMapping
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticCpXssr_edit')" )
+ public R updateById(@RequestBody ZbStatisticCpXssr zbStatisticCpXssr) {
+ return R.ok(zbStatisticCpXssrService.updateById(zbStatisticCpXssr));
+ }
+
+ /**
+ * 閫氳繃id鍒犻櫎浜у搧閿�鍞敹鍏�
+ * @param ids id鍒楄〃
+ * @return R
+ */
+ @Operation(summary = "閫氳繃id鍒犻櫎浜у搧閿�鍞敹鍏�" , description = "閫氳繃id鍒犻櫎浜у搧閿�鍞敹鍏�" )
+ @SysLog("閫氳繃id鍒犻櫎浜у搧閿�鍞敹鍏�" )
+ @DeleteMapping
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticCpXssr_del')" )
+ public R removeById(@RequestBody Long[] ids) {
+ return R.ok(zbStatisticCpXssrService.removeBatchByIds(CollUtil.toList(ids)));
+ }
+
+
+ /**
+ * 瀵煎嚭excel 琛ㄦ牸
+ * @param zbStatisticCpXssr 鏌ヨ鏉′欢
+ * @param ids 瀵煎嚭鎸囧畾ID
+ * @return excel 鏂囦欢娴�
+ */
+ @ResponseExcel
+ @GetMapping("/export")
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticCpXssr_export')" )
+ public List<ZbStatisticCpXssr> export(ZbStatisticCpXssr zbStatisticCpXssr,Long[] ids) {
+ return zbStatisticCpXssrService.list(Wrappers.lambdaQuery(zbStatisticCpXssr).in(ArrayUtil.isNotEmpty(ids), ZbStatisticCpXssr::getId, ids));
+ }
+
+ @Inner(value = false)
+ @GetMapping("/genCpxssrwcqk")
+ public R genCpxssrwcqk(@ParameterObject ZBJTStatisticDTO queryDTO){
+ return zbStatisticCpXssrService.genCpxssrwcqk(queryDTO);
+ }
+}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ZbStatisticCpXzhtController.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ZbStatisticCpXzhtController.java
new file mode 100644
index 0000000..3853050
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ZbStatisticCpXzhtController.java
@@ -0,0 +1,130 @@
+package com.by4cloud.platformx.business.controller;
+
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.core.util.ArrayUtil;
+import cn.hutool.core.collection.CollUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.by4cloud.platformx.business.dto.ZBJTStatisticDTO;
+import com.by4cloud.platformx.common.core.util.R;
+import com.by4cloud.platformx.common.log.annotation.SysLog;
+import com.by4cloud.platformx.business.entity.ZbStatisticCpXzht;
+import com.by4cloud.platformx.business.service.ZbStatisticCpXzhtService;
+import com.by4cloud.platformx.common.security.annotation.Inner;
+import org.springframework.security.access.prepost.PreAuthorize;
+import com.by4cloud.platformx.common.excel.annotation.ResponseExcel;
+import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import org.springdoc.core.annotations.ParameterObject;
+import org.springframework.http.HttpHeaders;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * 浜у搧鏂板鍚堝悓瀹屾垚鎯呭喌
+ *
+ * @author syt
+ * @date 2026-11-12 10:30:21
+ */
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/zbStatisticCpXzht" )
+@Tag(description = "zbStatisticCpXzht" , name = "浜у搧鏂板鍚堝悓瀹屾垚鎯呭喌绠$悊" )
+@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
+public class ZbStatisticCpXzhtController {
+
+ private final ZbStatisticCpXzhtService zbStatisticCpXzhtService;
+
+ /**
+ * 鍒嗛〉鏌ヨ
+ * @param page 鍒嗛〉瀵硅薄
+ * @param zbStatisticCpXzht 浜у搧鏂板鍚堝悓瀹屾垚鎯呭喌
+ * @return
+ */
+ @Operation(summary = "鍒嗛〉鏌ヨ" , description = "鍒嗛〉鏌ヨ" )
+ @GetMapping("/page" )
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticCpXzht_view')" )
+ public R getZbStatisticCpXzhtPage(@ParameterObject Page page, @ParameterObject ZbStatisticCpXzht zbStatisticCpXzht) {
+ LambdaQueryWrapper<ZbStatisticCpXzht> wrapper = Wrappers.lambdaQuery();
+ wrapper.eq(StrUtil.isNotBlank(zbStatisticCpXzht.getStatYm()),ZbStatisticCpXzht::getStatYm,zbStatisticCpXzht.getStatYm());
+// wrapper.orderByAsc(ZbStatisticCpXzht::getSort);
+ return R.ok(zbStatisticCpXzhtService.pageByScope(page, wrapper));
+ }
+
+
+ /**
+ * 閫氳繃id鏌ヨ浜у搧鏂板鍚堝悓瀹屾垚鎯呭喌
+ * @param id id
+ * @return R
+ */
+ @Operation(summary = "閫氳繃id鏌ヨ" , description = "閫氳繃id鏌ヨ" )
+ @GetMapping("/{id}" )
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticCpXzht_view')" )
+ public R getById(@PathVariable("id" ) Long id) {
+ return R.ok(zbStatisticCpXzhtService.getById(id));
+ }
+
+ /**
+ * 鏂板浜у搧鏂板鍚堝悓瀹屾垚鎯呭喌
+ * @param zbStatisticCpXzht 浜у搧鏂板鍚堝悓瀹屾垚鎯呭喌
+ * @return R
+ */
+ @Operation(summary = "鏂板浜у搧鏂板鍚堝悓瀹屾垚鎯呭喌" , description = "鏂板浜у搧鏂板鍚堝悓瀹屾垚鎯呭喌" )
+ @SysLog("鏂板浜у搧鏂板鍚堝悓瀹屾垚鎯呭喌" )
+ @PostMapping
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticCpXzht_add')" )
+ public R save(@RequestBody ZbStatisticCpXzht zbStatisticCpXzht) {
+ return R.ok(zbStatisticCpXzhtService.save(zbStatisticCpXzht));
+ }
+
+ /**
+ * 淇敼浜у搧鏂板鍚堝悓瀹屾垚鎯呭喌
+ * @param zbStatisticCpXzht 浜у搧鏂板鍚堝悓瀹屾垚鎯呭喌
+ * @return R
+ */
+ @Operation(summary = "淇敼浜у搧鏂板鍚堝悓瀹屾垚鎯呭喌" , description = "淇敼浜у搧鏂板鍚堝悓瀹屾垚鎯呭喌" )
+ @SysLog("淇敼浜у搧鏂板鍚堝悓瀹屾垚鎯呭喌" )
+ @PutMapping
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticCpXzht_edit')" )
+ public R updateById(@RequestBody ZbStatisticCpXzht zbStatisticCpXzht) {
+ return R.ok(zbStatisticCpXzhtService.updateById(zbStatisticCpXzht));
+ }
+
+ /**
+ * 閫氳繃id鍒犻櫎浜у搧鏂板鍚堝悓瀹屾垚鎯呭喌
+ * @param ids id鍒楄〃
+ * @return R
+ */
+ @Operation(summary = "閫氳繃id鍒犻櫎浜у搧鏂板鍚堝悓瀹屾垚鎯呭喌" , description = "閫氳繃id鍒犻櫎浜у搧鏂板鍚堝悓瀹屾垚鎯呭喌" )
+ @SysLog("閫氳繃id鍒犻櫎浜у搧鏂板鍚堝悓瀹屾垚鎯呭喌" )
+ @DeleteMapping
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticCpXzht_del')" )
+ public R removeById(@RequestBody Long[] ids) {
+ return R.ok(zbStatisticCpXzhtService.removeBatchByIds(CollUtil.toList(ids)));
+ }
+
+
+ /**
+ * 瀵煎嚭excel 琛ㄦ牸
+ * @param zbStatisticCpXzht 鏌ヨ鏉′欢
+ * @param ids 瀵煎嚭鎸囧畾ID
+ * @return excel 鏂囦欢娴�
+ */
+ @ResponseExcel
+ @GetMapping("/export")
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticCpXzht_export')" )
+ public List<ZbStatisticCpXzht> export(ZbStatisticCpXzht zbStatisticCpXzht,Long[] ids) {
+ return zbStatisticCpXzhtService.list(Wrappers.lambdaQuery(zbStatisticCpXzht).in(ArrayUtil.isNotEmpty(ids), ZbStatisticCpXzht::getId, ids));
+ }
+
+ @Inner(value = false)
+ @GetMapping("/genCpxzhtwcqk")
+ public R genCpxzhtwcqk(@ParameterObject ZBJTStatisticDTO queryDTO){
+ return zbStatisticCpXzhtService.genCpxzhtwcqk(queryDTO);
+ }
+}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ZbStatisticCpbkController.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ZbStatisticCpbkController.java
new file mode 100644
index 0000000..4920f1f
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ZbStatisticCpbkController.java
@@ -0,0 +1,131 @@
+package com.by4cloud.platformx.business.controller;
+
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.core.util.ArrayUtil;
+import cn.hutool.core.collection.CollUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.by4cloud.platformx.business.dto.ZBJTStatisticDTO;
+import com.by4cloud.platformx.common.core.util.R;
+import com.by4cloud.platformx.common.log.annotation.SysLog;
+import com.by4cloud.platformx.business.entity.ZbStatisticCpbk;
+import com.by4cloud.platformx.business.service.ZbStatisticCpbkService;
+import com.by4cloud.platformx.common.security.annotation.Inner;
+import org.springframework.security.access.prepost.PreAuthorize;
+import com.by4cloud.platformx.common.excel.annotation.ResponseExcel;
+import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import org.springdoc.core.annotations.ParameterObject;
+import org.springframework.http.HttpHeaders;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * 浜у搧鏉垮潡
+ *
+ * @author syt
+ * @date 2026-11-12 10:27:07
+ */
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/zbStatisticCpbk" )
+@Tag(description = "zbStatisticCpbk" , name = "浜у搧鏉垮潡绠$悊" )
+@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
+public class ZbStatisticCpbkController {
+
+ private final ZbStatisticCpbkService zbStatisticCpbkService;
+
+ /**
+ * 鍒嗛〉鏌ヨ
+ * @param page 鍒嗛〉瀵硅薄
+ * @param zbStatisticCpbk 浜у搧鏉垮潡
+ * @return
+ */
+ @Operation(summary = "鍒嗛〉鏌ヨ" , description = "鍒嗛〉鏌ヨ" )
+ @GetMapping("/page" )
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticCpbk_view')" )
+ public R getZbStatisticCpbkPage(@ParameterObject Page page, @ParameterObject ZbStatisticCpbk zbStatisticCpbk) {
+ LambdaQueryWrapper<ZbStatisticCpbk> wrapper = Wrappers.lambdaQuery();
+ wrapper.eq(StrUtil.isNotBlank(zbStatisticCpbk.getStatYm()),ZbStatisticCpbk::getStatYm,zbStatisticCpbk.getStatYm());
+// wrapper.orderByAsc(ZbStatisticCpbk::getSort);
+ return R.ok(zbStatisticCpbkService.pageByScope(page, wrapper));
+ }
+
+
+ /**
+ * 閫氳繃id鏌ヨ浜у搧鏉垮潡
+ * @param id id
+ * @return R
+ */
+ @Operation(summary = "閫氳繃id鏌ヨ" , description = "閫氳繃id鏌ヨ" )
+ @GetMapping("/{id}" )
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticCpbk_view')" )
+ public R getById(@PathVariable("id" ) Long id) {
+ return R.ok(zbStatisticCpbkService.getById(id));
+ }
+
+ /**
+ * 鏂板浜у搧鏉垮潡
+ * @param zbStatisticCpbk 浜у搧鏉垮潡
+ * @return R
+ */
+ @Operation(summary = "鏂板浜у搧鏉垮潡" , description = "鏂板浜у搧鏉垮潡" )
+ @SysLog("鏂板浜у搧鏉垮潡" )
+ @PostMapping
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticCpbk_add')" )
+ public R save(@RequestBody ZbStatisticCpbk zbStatisticCpbk) {
+ return R.ok(zbStatisticCpbkService.save(zbStatisticCpbk));
+ }
+
+ /**
+ * 淇敼浜у搧鏉垮潡
+ * @param zbStatisticCpbk 浜у搧鏉垮潡
+ * @return R
+ */
+ @Operation(summary = "淇敼浜у搧鏉垮潡" , description = "淇敼浜у搧鏉垮潡" )
+ @SysLog("淇敼浜у搧鏉垮潡" )
+ @PutMapping
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticCpbk_edit')" )
+ public R updateById(@RequestBody ZbStatisticCpbk zbStatisticCpbk) {
+ return R.ok(zbStatisticCpbkService.updateById(zbStatisticCpbk));
+ }
+
+ /**
+ * 閫氳繃id鍒犻櫎浜у搧鏉垮潡
+ * @param ids id鍒楄〃
+ * @return R
+ */
+ @Operation(summary = "閫氳繃id鍒犻櫎浜у搧鏉垮潡" , description = "閫氳繃id鍒犻櫎浜у搧鏉垮潡" )
+ @SysLog("閫氳繃id鍒犻櫎浜у搧鏉垮潡" )
+ @DeleteMapping
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticCpbk_del')" )
+ public R removeById(@RequestBody Long[] ids) {
+ return R.ok(zbStatisticCpbkService.removeBatchByIds(CollUtil.toList(ids)));
+ }
+
+
+ /**
+ * 瀵煎嚭excel 琛ㄦ牸
+ * @param zbStatisticCpbk 鏌ヨ鏉′欢
+ * @param ids 瀵煎嚭鎸囧畾ID
+ * @return excel 鏂囦欢娴�
+ */
+ @ResponseExcel
+ @GetMapping("/export")
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticCpbk_export')" )
+ public List<ZbStatisticCpbk> export(ZbStatisticCpbk zbStatisticCpbk,Long[] ids) {
+ return zbStatisticCpbkService.list(Wrappers.lambdaQuery(zbStatisticCpbk).in(ArrayUtil.isNotEmpty(ids), ZbStatisticCpbk::getId, ids));
+ }
+
+
+ @Inner(value = false)
+ @GetMapping("/genCpbkwcqk")
+ public R genCpbkwcqk(@ParameterObject ZBJTStatisticDTO queryDTO){
+ return zbStatisticCpbkService.genCpbkwcqk(queryDTO);
+ }
+}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ZbStatisticXszbController.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ZbStatisticXszbController.java
new file mode 100644
index 0000000..52564bb
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ZbStatisticXszbController.java
@@ -0,0 +1,130 @@
+package com.by4cloud.platformx.business.controller;
+
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.core.util.ArrayUtil;
+import cn.hutool.core.collection.CollUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.by4cloud.platformx.business.dto.ZBJTStatisticDTO;
+import com.by4cloud.platformx.common.core.util.R;
+import com.by4cloud.platformx.common.log.annotation.SysLog;
+import com.by4cloud.platformx.business.entity.ZbStatisticXszb;
+import com.by4cloud.platformx.business.service.ZbStatisticXszbService;
+import com.by4cloud.platformx.common.security.annotation.Inner;
+import org.springframework.security.access.prepost.PreAuthorize;
+import com.by4cloud.platformx.common.excel.annotation.ResponseExcel;
+import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import org.springdoc.core.annotations.ParameterObject;
+import org.springframework.http.HttpHeaders;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * 閿�鍞寚鏍�
+ *
+ * @author syt
+ * @date 2026-11-12 10:26:32
+ */
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/zbStatisticXszb" )
+@Tag(description = "zbStatisticXszb" , name = "閿�鍞寚鏍囩鐞�" )
+@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
+public class ZbStatisticXszbController {
+
+ private final ZbStatisticXszbService zbStatisticXszbService;
+
+ /**
+ * 鍒嗛〉鏌ヨ
+ * @param page 鍒嗛〉瀵硅薄
+ * @param zbStatisticXszb 閿�鍞寚鏍�
+ * @return
+ */
+ @Operation(summary = "鍒嗛〉鏌ヨ" , description = "鍒嗛〉鏌ヨ" )
+ @GetMapping("/page" )
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticXszb_view')" )
+ public R getZbStatisticXszbPage(@ParameterObject Page page, @ParameterObject ZbStatisticXszb zbStatisticXszb) {
+ LambdaQueryWrapper<ZbStatisticXszb> wrapper = Wrappers.lambdaQuery();
+ wrapper.eq(StrUtil.isNotBlank(zbStatisticXszb.getStatYm()),ZbStatisticXszb::getStatYm,zbStatisticXszb.getStatYm());
+// wrapper.orderByAsc(ZbStatisticXszb::getSort);
+ return R.ok(zbStatisticXszbService.pageByScope(page, wrapper));
+ }
+
+
+ /**
+ * 閫氳繃id鏌ヨ閿�鍞寚鏍�
+ * @param id id
+ * @return R
+ */
+ @Operation(summary = "閫氳繃id鏌ヨ" , description = "閫氳繃id鏌ヨ" )
+ @GetMapping("/{id}" )
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticXszb_view')" )
+ public R getById(@PathVariable("id" ) Long id) {
+ return R.ok(zbStatisticXszbService.getById(id));
+ }
+
+ /**
+ * 鏂板閿�鍞寚鏍�
+ * @param zbStatisticXszb 閿�鍞寚鏍�
+ * @return R
+ */
+ @Operation(summary = "鏂板閿�鍞寚鏍�" , description = "鏂板閿�鍞寚鏍�" )
+ @SysLog("鏂板閿�鍞寚鏍�" )
+ @PostMapping
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticXszb_add')" )
+ public R save(@RequestBody ZbStatisticXszb zbStatisticXszb) {
+ return R.ok(zbStatisticXszbService.save(zbStatisticXszb));
+ }
+
+ /**
+ * 淇敼閿�鍞寚鏍�
+ * @param zbStatisticXszb 閿�鍞寚鏍�
+ * @return R
+ */
+ @Operation(summary = "淇敼閿�鍞寚鏍�" , description = "淇敼閿�鍞寚鏍�" )
+ @SysLog("淇敼閿�鍞寚鏍�" )
+ @PutMapping
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticXszb_edit')" )
+ public R updateById(@RequestBody ZbStatisticXszb zbStatisticXszb) {
+ return R.ok(zbStatisticXszbService.updateById(zbStatisticXszb));
+ }
+
+ /**
+ * 閫氳繃id鍒犻櫎閿�鍞寚鏍�
+ * @param ids id鍒楄〃
+ * @return R
+ */
+ @Operation(summary = "閫氳繃id鍒犻櫎閿�鍞寚鏍�" , description = "閫氳繃id鍒犻櫎閿�鍞寚鏍�" )
+ @SysLog("閫氳繃id鍒犻櫎閿�鍞寚鏍�" )
+ @DeleteMapping
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticXszb_del')" )
+ public R removeById(@RequestBody Long[] ids) {
+ return R.ok(zbStatisticXszbService.removeBatchByIds(CollUtil.toList(ids)));
+ }
+
+
+ /**
+ * 瀵煎嚭excel 琛ㄦ牸
+ * @param zbStatisticXszb 鏌ヨ鏉′欢
+ * @param ids 瀵煎嚭鎸囧畾ID
+ * @return excel 鏂囦欢娴�
+ */
+ @ResponseExcel
+ @GetMapping("/export")
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticXszb_export')" )
+ public List<ZbStatisticXszb> export(ZbStatisticXszb zbStatisticXszb,Long[] ids) {
+ return zbStatisticXszbService.list(Wrappers.lambdaQuery(zbStatisticXszb).in(ArrayUtil.isNotEmpty(ids), ZbStatisticXszb::getId, ids));
+ }
+
+ @Inner(value = false)
+ @GetMapping("/genZyxszbwcqk")
+ public R zyxszbwcqk(@ParameterObject ZBJTStatisticDTO queryDTO){
+ return zbStatisticXszbService.genZyxszbwcqk(queryDTO);
+ }
+}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ZbStatisticZdgzController.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ZbStatisticZdgzController.java
new file mode 100644
index 0000000..11a214e
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ZbStatisticZdgzController.java
@@ -0,0 +1,130 @@
+package com.by4cloud.platformx.business.controller;
+
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.core.util.ArrayUtil;
+import cn.hutool.core.collection.CollUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.by4cloud.platformx.business.dto.ZBJTStatisticDTO;
+import com.by4cloud.platformx.common.core.util.R;
+import com.by4cloud.platformx.common.log.annotation.SysLog;
+import com.by4cloud.platformx.business.entity.ZbStatisticZdgz;
+import com.by4cloud.platformx.business.service.ZbStatisticZdgzService;
+import com.by4cloud.platformx.common.security.annotation.Inner;
+import org.springframework.security.access.prepost.PreAuthorize;
+import com.by4cloud.platformx.common.excel.annotation.ResponseExcel;
+import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import org.springdoc.core.annotations.ParameterObject;
+import org.springframework.http.HttpHeaders;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * 閲嶇偣宸ヤ綔
+ *
+ * @author syt
+ * @date 2026-11-12 10:28:35
+ */
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/zbStatisticZdgz" )
+@Tag(description = "zbStatisticZdgz" , name = "閲嶇偣宸ヤ綔绠$悊" )
+@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
+public class ZbStatisticZdgzController {
+
+ private final ZbStatisticZdgzService zbStatisticZdgzService;
+
+ /**
+ * 鍒嗛〉鏌ヨ
+ * @param page 鍒嗛〉瀵硅薄
+ * @param zbStatisticZdgz 閲嶇偣宸ヤ綔
+ * @return
+ */
+ @Operation(summary = "鍒嗛〉鏌ヨ" , description = "鍒嗛〉鏌ヨ" )
+ @GetMapping("/page" )
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticZdgz_view')" )
+ public R getZbStatisticZdgzPage(@ParameterObject Page page, @ParameterObject ZbStatisticZdgz zbStatisticZdgz) {
+ LambdaQueryWrapper<ZbStatisticZdgz> wrapper = Wrappers.lambdaQuery();
+ wrapper.eq(StrUtil.isNotBlank(zbStatisticZdgz.getStatYm()),ZbStatisticZdgz::getStatYm,zbStatisticZdgz.getStatYm());
+// wrapper.orderByAsc(ZbStatisticZdgz::getSort);
+ return R.ok(zbStatisticZdgzService.pageByScope(page, wrapper));
+ }
+
+
+ /**
+ * 閫氳繃id鏌ヨ閲嶇偣宸ヤ綔
+ * @param id id
+ * @return R
+ */
+ @Operation(summary = "閫氳繃id鏌ヨ" , description = "閫氳繃id鏌ヨ" )
+ @GetMapping("/{id}" )
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticZdgz_view')" )
+ public R getById(@PathVariable("id" ) Long id) {
+ return R.ok(zbStatisticZdgzService.getById(id));
+ }
+
+ /**
+ * 鏂板閲嶇偣宸ヤ綔
+ * @param zbStatisticZdgz 閲嶇偣宸ヤ綔
+ * @return R
+ */
+ @Operation(summary = "鏂板閲嶇偣宸ヤ綔" , description = "鏂板閲嶇偣宸ヤ綔" )
+ @SysLog("鏂板閲嶇偣宸ヤ綔" )
+ @PostMapping
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticZdgz_add')" )
+ public R save(@RequestBody ZbStatisticZdgz zbStatisticZdgz) {
+ return R.ok(zbStatisticZdgzService.save(zbStatisticZdgz));
+ }
+
+ /**
+ * 淇敼閲嶇偣宸ヤ綔
+ * @param zbStatisticZdgz 閲嶇偣宸ヤ綔
+ * @return R
+ */
+ @Operation(summary = "淇敼閲嶇偣宸ヤ綔" , description = "淇敼閲嶇偣宸ヤ綔" )
+ @SysLog("淇敼閲嶇偣宸ヤ綔" )
+ @PutMapping
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticZdgz_edit')" )
+ public R updateById(@RequestBody ZbStatisticZdgz zbStatisticZdgz) {
+ return R.ok(zbStatisticZdgzService.updateById(zbStatisticZdgz));
+ }
+
+ /**
+ * 閫氳繃id鍒犻櫎閲嶇偣宸ヤ綔
+ * @param ids id鍒楄〃
+ * @return R
+ */
+ @Operation(summary = "閫氳繃id鍒犻櫎閲嶇偣宸ヤ綔" , description = "閫氳繃id鍒犻櫎閲嶇偣宸ヤ綔" )
+ @SysLog("閫氳繃id鍒犻櫎閲嶇偣宸ヤ綔" )
+ @DeleteMapping
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticZdgz_del')" )
+ public R removeById(@RequestBody Long[] ids) {
+ return R.ok(zbStatisticZdgzService.removeBatchByIds(CollUtil.toList(ids)));
+ }
+
+
+ /**
+ * 瀵煎嚭excel 琛ㄦ牸
+ * @param zbStatisticZdgz 鏌ヨ鏉′欢
+ * @param ids 瀵煎嚭鎸囧畾ID
+ * @return excel 鏂囦欢娴�
+ */
+ @ResponseExcel
+ @GetMapping("/export")
+ @PreAuthorize("@pms.hasPermission('business_zbStatisticZdgz_export')" )
+ public List<ZbStatisticZdgz> export(ZbStatisticZdgz zbStatisticZdgz,Long[] ids) {
+ return zbStatisticZdgzService.list(Wrappers.lambdaQuery(zbStatisticZdgz).in(ArrayUtil.isNotEmpty(ids), ZbStatisticZdgz::getId, ids));
+ }
+
+ @Inner(value = false)
+ @GetMapping("/genZdgzwcqk")
+ public R genZdgzwcqk(@ParameterObject ZBJTStatisticDTO queryDTO){
+ return zbStatisticZdgzService.genZdgzwcqk(queryDTO);
+ }
+}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ZbStatisticZxywController.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ZbStatisticZxywController.java
new file mode 100644
index 0000000..98eb983
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ZbStatisticZxywController.java
@@ -0,0 +1,129 @@
+package com.by4cloud.platformx.business.controller;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.ArrayUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.by4cloud.platformx.business.dto.ZBJTStatisticDTO;
+import com.by4cloud.platformx.business.entity.ZbStatisticZxyw;
+import com.by4cloud.platformx.business.service.ZbStatisticZxywService;
+import com.by4cloud.platformx.common.core.util.R;
+import com.by4cloud.platformx.common.excel.annotation.ResponseExcel;
+import com.by4cloud.platformx.common.log.annotation.SysLog;
+import com.by4cloud.platformx.common.security.annotation.Inner;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import lombok.RequiredArgsConstructor;
+import org.springdoc.core.annotations.ParameterObject;
+import org.springframework.http.HttpHeaders;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 涓撻」涓氬姟
+ *
+ * @author syt
+ * @date 2026-11-12 10:29:31
+ */
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/zbStatisticZxyw" )
+@Tag(description = "zbStatisticZxyw" , name = "涓撻」涓氬姟绠$悊" )
+@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
+public class ZbStatisticZxywController {
+
+ private final ZbStatisticZxywService zbStatisticZxywService;
+
+ /**
+ * 鍒嗛〉鏌ヨ
+ * @param page 鍒嗛〉瀵硅薄
+ * @param zbStatisticZxyw 涓撻」涓氬姟
+ * @return
+ */
+ @Operation(summary = "鍒嗛〉鏌ヨ" , description = "鍒嗛〉鏌ヨ" )
+ @GetMapping("/page" )
+ @PreAuthorize("@pms.hasPermission('bueiness_zbStatisticZxyw_view')" )
+ public R getZbStatisticZxywPage(@ParameterObject Page page, @ParameterObject ZbStatisticZxyw zbStatisticZxyw) {
+ LambdaQueryWrapper<ZbStatisticZxyw> wrapper = Wrappers.lambdaQuery();
+ wrapper.eq(StrUtil.isNotBlank(zbStatisticZxyw.getStatYm()), ZbStatisticZxyw::getStatYm,zbStatisticZxyw.getStatYm());
+// wrapper.orderByAsc(ZbStatisticZxyw::getSort);
+ return R.ok(zbStatisticZxywService.pageByScope(page, wrapper));
+ }
+
+
+ /**
+ * 閫氳繃id鏌ヨ涓撻」涓氬姟
+ * @param id id
+ * @return R
+ */
+ @Operation(summary = "閫氳繃id鏌ヨ" , description = "閫氳繃id鏌ヨ" )
+ @GetMapping("/{id}" )
+ @PreAuthorize("@pms.hasPermission('bueiness_zbStatisticZxyw_view')" )
+ public R getById(@PathVariable("id" ) Long id) {
+ return R.ok(zbStatisticZxywService.getById(id));
+ }
+
+ /**
+ * 鏂板涓撻」涓氬姟
+ * @param zbStatisticZxyw 涓撻」涓氬姟
+ * @return R
+ */
+ @Operation(summary = "鏂板涓撻」涓氬姟" , description = "鏂板涓撻」涓氬姟" )
+ @SysLog("鏂板涓撻」涓氬姟" )
+ @PostMapping
+ @PreAuthorize("@pms.hasPermission('bueiness_zbStatisticZxyw_add')" )
+ public R save(@RequestBody ZbStatisticZxyw zbStatisticZxyw) {
+ return R.ok(zbStatisticZxywService.save(zbStatisticZxyw));
+ }
+
+ /**
+ * 淇敼涓撻」涓氬姟
+ * @param zbStatisticZxyw 涓撻」涓氬姟
+ * @return R
+ */
+ @Operation(summary = "淇敼涓撻」涓氬姟" , description = "淇敼涓撻」涓氬姟" )
+ @SysLog("淇敼涓撻」涓氬姟" )
+ @PutMapping
+ @PreAuthorize("@pms.hasPermission('bueiness_zbStatisticZxyw_edit')" )
+ public R updateById(@RequestBody ZbStatisticZxyw zbStatisticZxyw) {
+ return R.ok(zbStatisticZxywService.updateById(zbStatisticZxyw));
+ }
+
+ /**
+ * 閫氳繃id鍒犻櫎涓撻」涓氬姟
+ * @param ids id鍒楄〃
+ * @return R
+ */
+ @Operation(summary = "閫氳繃id鍒犻櫎涓撻」涓氬姟" , description = "閫氳繃id鍒犻櫎涓撻」涓氬姟" )
+ @SysLog("閫氳繃id鍒犻櫎涓撻」涓氬姟" )
+ @DeleteMapping
+ @PreAuthorize("@pms.hasPermission('bueiness_zbStatisticZxyw_del')" )
+ public R removeById(@RequestBody Long[] ids) {
+ return R.ok(zbStatisticZxywService.removeBatchByIds(CollUtil.toList(ids)));
+ }
+
+
+ /**
+ * 瀵煎嚭excel 琛ㄦ牸
+ * @param zbStatisticZxyw 鏌ヨ鏉′欢
+ * @param ids 瀵煎嚭鎸囧畾ID
+ * @return excel 鏂囦欢娴�
+ */
+ @ResponseExcel
+ @GetMapping("/export")
+ @PreAuthorize("@pms.hasPermission('bueiness_zbStatisticZxyw_export')" )
+ public List<ZbStatisticZxyw> export(ZbStatisticZxyw zbStatisticZxyw, Long[] ids) {
+ return zbStatisticZxywService.list(Wrappers.lambdaQuery(zbStatisticZxyw).in(ArrayUtil.isNotEmpty(ids), ZbStatisticZxyw::getId, ids));
+ }
+
+ @Inner(value = false)
+ @GetMapping("/genZxywwcqk")
+ public R genZxywwcqk(@ParameterObject ZBJTStatisticDTO queryDTO){
+ return zbStatisticZxywService.genZxywwcqk(queryDTO);
+ }
+}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ContractInvoiceMapper.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ContractInvoiceMapper.java
index 3a7d4d4..2de2e4f 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ContractInvoiceMapper.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ContractInvoiceMapper.java
@@ -27,7 +27,7 @@
HomeZgsData homeZgsData(@Param("compId") Long compId,@Param("province") String province);
- ZbjtStatisticVo zbjtStatisticByInvoice();
+ ZbjtStatisticVo zbjtStatisticByInvoice(@Param("compId") Long compId,@Param("compIds") List<Long> compIds);
List<ZbjtIndicatorTrendVo> zbjtIndicatorTrend(@Param("startMon") String startMon,@Param("endMon") String endMon);
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ContractMapper.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ContractMapper.java
index f44f9a3..9d97573 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ContractMapper.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ContractMapper.java
@@ -75,19 +75,9 @@
Page<FourAssociationPageVo> fourAssociation(Page page,@Param("queryDTO") ContractQueryDTO queryDTO, DataScope comp_id);
- @Select("SELECT\n" +
- "\tbc.province \n" +
- "FROM\n" +
- "\tcontract c\n" +
- "\tLEFT JOIN business_customer bc ON bc.id = c.party_a_id \n" +
- "WHERE\n" +
- "\tbc.province IS NOT NULL \n" +
- "and c.party_b_id = #{compId}" +
- "GROUP BY\n" +
- "\tbc.province;")
- List<String> homeZgsColum(@Param("compId") Long compId);
+ List<String> homeZgsColum(@Param("compId") Long compId,@Param("compIds") List<Long> compIds);
- ZbjtStatisticVo zbjtStatisticByContract();
+ ZbjtStatisticVo zbjtStatisticByContract(@Param("compId") Long compId,@Param("compIds") List<Long> compIds);
ZbjtStatisticByContractAmountVo zbjtStatisticByContractAmount();
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ContractSubjectMatterMapper.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ContractSubjectMatterMapper.java
index 42ea5eb..56ff204 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ContractSubjectMatterMapper.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ContractSubjectMatterMapper.java
@@ -20,6 +20,5 @@
List<GcpbkwcqkItemVo> sckfzdgzwcqk(@Param("monstart") Date monstart,@Param("monend") Date monend);
-
List<CpxssrwcqkItemVo> cpxzhtwcqk(@Param("monstart") Date monstart,@Param("monend") Date monend);
}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/PaymentCreditMapper.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/PaymentCreditMapper.java
new file mode 100644
index 0000000..462ce03
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/PaymentCreditMapper.java
@@ -0,0 +1,17 @@
+package com.by4cloud.platformx.business.mapper;
+
+import com.by4cloud.platformx.business.entity.PaymentCreditSale;
+
+import com.by4cloud.platformx.common.data.datascope.PlatformxBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.math.BigDecimal;
+
+@Mapper
+public interface PaymentCreditMapper extends PlatformxBaseMapper<PaymentCreditSale> {
+
+ BigDecimal genReceivePayment(@Param("compId") Long compId);
+
+ BigDecimal genReceivePaymentSmj();
+}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/PaymentReceiveMapper.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/PaymentReceiveMapper.java
index 8f0b7cc..d07bef3 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/PaymentReceiveMapper.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/PaymentReceiveMapper.java
@@ -1,6 +1,7 @@
package com.by4cloud.platformx.business.mapper;
import com.by4cloud.platformx.business.entity.PaymentReceive;
+import com.by4cloud.platformx.business.vo.JznbyszkVo;
import com.by4cloud.platformx.business.vo.YszkwcqkVo;
import com.by4cloud.platformx.business.vo.ZbjtIndicatorTrendVo;
import com.by4cloud.platformx.common.data.datascope.PlatformxBaseMapper;
@@ -26,4 +27,10 @@
List<YszkwcqkVo> yszkwcqk(@Param("monstart") Date monstart,@Param("monend") Date monend,@Param("yearstart") Date yearstart,
@Param("yearend") Date yearend,@Param("monstartLastMon") Date monstartLastMon,
@Param("monendLastMon") Date monendLastMon);
+
+ List<JznbyszkVo> zbjtjznbyszk(@Param("compId") Long compId,@Param("monstart") Date monstart,
+ @Param("monend") Date monend,@Param("mon2after") Date mon2after);
+
+ List<JznbyszkVo> zbjtjznbyszkSMJ(@Param("compId") Long compId,@Param("monstart") Date monstart,
+ @Param("monend") Date monend,@Param("mon2after") Date mon2after);
}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/PaymentSlipMapper.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/PaymentSlipMapper.java
index 7d9fb27..dff428a 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/PaymentSlipMapper.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/PaymentSlipMapper.java
@@ -23,7 +23,7 @@
Page<HomePaymentSlipVo> pageScope(Page page, @Param("queryDTO") PaymentSlipQueryDTO queryDTO, DataScope comp_id);
- ZbjtStatisticVo zbjtStatisticByPayment();
+ ZbjtStatisticVo zbjtStatisticByPayment(@Param("compId") Long compId,@Param("compIds") List<Long> compIds);
List<ZbjtIndicatorTrendVo> zbjtIndicatorTrend(@Param("startMon") String startMon,@Param("endMon") String endMon);
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ZbStatisticCpXssrMapper.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ZbStatisticCpXssrMapper.java
new file mode 100644
index 0000000..68ddde3
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ZbStatisticCpXssrMapper.java
@@ -0,0 +1,11 @@
+package com.by4cloud.platformx.business.mapper;
+
+import com.by4cloud.platformx.common.data.datascope.PlatformxBaseMapper;
+import com.by4cloud.platformx.business.entity.ZbStatisticCpXssr;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface ZbStatisticCpXssrMapper extends PlatformxBaseMapper<ZbStatisticCpXssr> {
+
+
+}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ZbStatisticCpXzhtMapper.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ZbStatisticCpXzhtMapper.java
new file mode 100644
index 0000000..8d593dc
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ZbStatisticCpXzhtMapper.java
@@ -0,0 +1,11 @@
+package com.by4cloud.platformx.business.mapper;
+
+import com.by4cloud.platformx.common.data.datascope.PlatformxBaseMapper;
+import com.by4cloud.platformx.business.entity.ZbStatisticCpXzht;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface ZbStatisticCpXzhtMapper extends PlatformxBaseMapper<ZbStatisticCpXzht> {
+
+
+}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ZbStatisticCpbkMapper.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ZbStatisticCpbkMapper.java
new file mode 100644
index 0000000..c0edc0b
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ZbStatisticCpbkMapper.java
@@ -0,0 +1,11 @@
+package com.by4cloud.platformx.business.mapper;
+
+import com.by4cloud.platformx.common.data.datascope.PlatformxBaseMapper;
+import com.by4cloud.platformx.business.entity.ZbStatisticCpbk;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface ZbStatisticCpbkMapper extends PlatformxBaseMapper<ZbStatisticCpbk> {
+
+
+}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ZbStatisticXszbMapper.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ZbStatisticXszbMapper.java
new file mode 100644
index 0000000..3964e4a
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ZbStatisticXszbMapper.java
@@ -0,0 +1,11 @@
+package com.by4cloud.platformx.business.mapper;
+
+import com.by4cloud.platformx.common.data.datascope.PlatformxBaseMapper;
+import com.by4cloud.platformx.business.entity.ZbStatisticXszb;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface ZbStatisticXszbMapper extends PlatformxBaseMapper<ZbStatisticXszb> {
+
+
+}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ZbStatisticZdgzMapper.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ZbStatisticZdgzMapper.java
new file mode 100644
index 0000000..043436b
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ZbStatisticZdgzMapper.java
@@ -0,0 +1,11 @@
+package com.by4cloud.platformx.business.mapper;
+
+import com.by4cloud.platformx.common.data.datascope.PlatformxBaseMapper;
+import com.by4cloud.platformx.business.entity.ZbStatisticZdgz;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface ZbStatisticZdgzMapper extends PlatformxBaseMapper<ZbStatisticZdgz> {
+
+
+}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ZbStatisticZxywMapper.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ZbStatisticZxywMapper.java
new file mode 100644
index 0000000..8ee609e
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ZbStatisticZxywMapper.java
@@ -0,0 +1,11 @@
+package com.by4cloud.platformx.business.mapper;
+
+import com.by4cloud.platformx.business.entity.ZbStatisticZxyw;
+import com.by4cloud.platformx.common.data.datascope.PlatformxBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface ZbStatisticZxywMapper extends PlatformxBaseMapper<ZbStatisticZxyw> {
+
+
+}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/BankStatementService.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/BankStatementService.java
index 5b4cc57..dac2b79 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/BankStatementService.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/BankStatementService.java
@@ -27,4 +27,6 @@
R saveAndPush(BankStatementUpdateDTO updateDTO);
R pullBankData(SyncPaymentRecepitDTO queryDTO);
+
+ R updById(Long id);
}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/BusinessCustomerService.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/BusinessCustomerService.java
index 97833f1..a70020d 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/BusinessCustomerService.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/BusinessCustomerService.java
@@ -19,4 +19,6 @@
R saveCustomerSgb(BusinessCustomerAddDTO addDTO);
R importBusinessCustomer(List<BusinessCustomerImportVo> excelVOList, BindingResult bindingResult);
+
+ R syncCustomer(Long id);
}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ContractInvoiceService.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ContractInvoiceService.java
index 093380c..4c72d7c 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ContractInvoiceService.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ContractInvoiceService.java
@@ -55,4 +55,6 @@
R toMergeInvoice(ToMergeInvoiceDTO toMergeInvoiceDTO);
R selectZbByKey(String dictKey);
+
+ R updBwParamById(UpdBwParamDTO dto);
}
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ContractService.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ContractService.java
index 46359c1..fbe9a61 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ContractService.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ContractService.java
@@ -106,4 +106,8 @@
R addContractNoSgb(ContractAddDTO addDTO);
R addContractOrder(ContractOrderAddDTO addDTO);
+
+ R erpPushBatch();
+
+ R delById(Long id);
}
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ContractSubjectMatterService.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ContractSubjectMatterService.java
index 6868db2..3114474 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ContractSubjectMatterService.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ContractSubjectMatterService.java
@@ -23,4 +23,6 @@
JSONObject syncProductBySMJ(String tenant1, String materialCode);
R annotate(List<ContractSubjectMatterAnnotateDTO> annotateDTOList);
+
+ R batchUpd(List<ContractSubjectMatter> list);
}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/PaymentSlipService.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/PaymentSlipService.java
index 5426aae..68d0de2 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/PaymentSlipService.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/PaymentSlipService.java
@@ -12,4 +12,6 @@
Page pageScope(Page page, PaymentSlipQueryDTO queryDTO);
R genReceivePayment(SyncPaymentRecepitDTO dto);
+
+ R genCreditPayment(SyncPaymentRecepitDTO dto);
}
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ZBJTStatisticService.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ZBJTStatisticService.java
index b4113ee..51b25dd 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ZBJTStatisticService.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ZBJTStatisticService.java
@@ -20,4 +20,14 @@
R snqqwcqk(ZBJTStatisticDTO queryDTO);
R cpxssrwcqk(ZBJTStatisticDTO queryDTO);
+
+ R zbjtjznbyszk(ZBJTStatisticDTO queryDTO);
+
+ R smjjznbyszk(ZBJTStatisticDTO queryDTO);
+
+ R sgbjznbyszk(ZBJTStatisticDTO queryDTO);
+
+ R jxcjznbyszk(ZBJTStatisticDTO queryDTO);
+
+ R tfgsjznbyszk(ZBJTStatisticDTO queryDTO);
}
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ZbStatisticCpXssrService.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ZbStatisticCpXssrService.java
new file mode 100644
index 0000000..19476bd
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ZbStatisticCpXssrService.java
@@ -0,0 +1,12 @@
+package com.by4cloud.platformx.business.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.by4cloud.platformx.business.dto.ZBJTStatisticDTO;
+import com.by4cloud.platformx.business.entity.ZbStatisticCpXssr;
+import com.by4cloud.platformx.common.core.util.R;
+import com.by4cloud.platformx.common.data.mybatis.IIService;
+
+public interface ZbStatisticCpXssrService extends IIService<ZbStatisticCpXssr> {
+
+ R genCpxssrwcqk(ZBJTStatisticDTO queryDTO);
+}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ZbStatisticCpXzhtService.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ZbStatisticCpXzhtService.java
new file mode 100644
index 0000000..319c18a
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ZbStatisticCpXzhtService.java
@@ -0,0 +1,12 @@
+package com.by4cloud.platformx.business.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.by4cloud.platformx.business.dto.ZBJTStatisticDTO;
+import com.by4cloud.platformx.business.entity.ZbStatisticCpXzht;
+import com.by4cloud.platformx.common.core.util.R;
+import com.by4cloud.platformx.common.data.mybatis.IIService;
+
+public interface ZbStatisticCpXzhtService extends IIService<ZbStatisticCpXzht> {
+
+ R genCpxzhtwcqk(ZBJTStatisticDTO queryDTO);
+}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ZbStatisticCpbkService.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ZbStatisticCpbkService.java
new file mode 100644
index 0000000..342998c
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ZbStatisticCpbkService.java
@@ -0,0 +1,12 @@
+package com.by4cloud.platformx.business.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.by4cloud.platformx.business.dto.ZBJTStatisticDTO;
+import com.by4cloud.platformx.business.entity.ZbStatisticCpbk;
+import com.by4cloud.platformx.common.core.util.R;
+import com.by4cloud.platformx.common.data.mybatis.IIService;
+
+public interface ZbStatisticCpbkService extends IIService<ZbStatisticCpbk> {
+
+ R genCpbkwcqk(ZBJTStatisticDTO queryDTO);
+}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ZbStatisticXszbService.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ZbStatisticXszbService.java
new file mode 100644
index 0000000..f15d5cb
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ZbStatisticXszbService.java
@@ -0,0 +1,12 @@
+package com.by4cloud.platformx.business.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.by4cloud.platformx.business.dto.ZBJTStatisticDTO;
+import com.by4cloud.platformx.business.entity.ZbStatisticXszb;
+import com.by4cloud.platformx.common.core.util.R;
+import com.by4cloud.platformx.common.data.mybatis.IIService;
+
+public interface ZbStatisticXszbService extends IIService<ZbStatisticXszb> {
+
+ R genZyxszbwcqk(ZBJTStatisticDTO queryDTO);
+}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ZbStatisticZdgzService.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ZbStatisticZdgzService.java
new file mode 100644
index 0000000..bf550bc
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ZbStatisticZdgzService.java
@@ -0,0 +1,12 @@
+package com.by4cloud.platformx.business.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.by4cloud.platformx.business.dto.ZBJTStatisticDTO;
+import com.by4cloud.platformx.business.entity.ZbStatisticZdgz;
+import com.by4cloud.platformx.common.core.util.R;
+import com.by4cloud.platformx.common.data.mybatis.IIService;
+
+public interface ZbStatisticZdgzService extends IIService<ZbStatisticZdgz> {
+
+ R genZdgzwcqk(ZBJTStatisticDTO queryDTO);
+}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ZbStatisticZxywService.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ZbStatisticZxywService.java
new file mode 100644
index 0000000..dc352c4
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ZbStatisticZxywService.java
@@ -0,0 +1,12 @@
+package com.by4cloud.platformx.business.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.by4cloud.platformx.business.dto.ZBJTStatisticDTO;
+import com.by4cloud.platformx.business.entity.ZbStatisticZxyw;
+import com.by4cloud.platformx.common.core.util.R;
+import com.by4cloud.platformx.common.data.mybatis.IIService;
+
+public interface ZbStatisticZxywService extends IIService<ZbStatisticZxyw> {
+
+ R genZxywwcqk(ZBJTStatisticDTO queryDTO);
+}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/BankStatementServiceImpl.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/BankStatementServiceImpl.java
index 0221b3f..d04cef0 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/BankStatementServiceImpl.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/BankStatementServiceImpl.java
@@ -131,7 +131,7 @@
addDTO.setBusGuestId(statement.getBusGuestId() + "");
addDTO.setConfirmTime(statement.getTranDate());
addDTO.setContractNo(contract.getContractNo());
- addDTO.setInOrOut(statement.getDcFlag());
+ addDTO.setInOrOut("1");
addDTO.setTransationAmount(statementContractDTO.getToPaidAmount());
addDTO.setBankSeqNo(statement.getBankSeqNo());
paymentConfirmService.add(addDTO);
@@ -292,11 +292,13 @@
data.put("exchangeRate", "1");//姹囩巼
data.put("exchangeRateDate", DateUtil.now());//姹囩巼鏃堕棿
data.put("objectType", "1");
- data.put("customerCode", customer.getBipCode());//瀹㈡埛缂栫爜
+ data.put("customerCode", bipVo.getKh());//瀹㈡埛缂栫爜
data.put("financeOrgCode", dept.getBipCode());//寮�绁ㄧ粍缁囩紪鐮�
data.put("orgCode", dept.getBipCode());//涓氬姟缁勭粐缂栫爜
- data.put("bustypeCode", "ar_colsale");// TODO 浜ゆ槗绫诲瀷缂栫爜 鏆備及榛樿ZGYSFP锛岃澶囬粯璁BYXGLXT鏆傛椂涓嶈兘鐢�
+ data.put("bustypeCode", bipVo.getJylx());// TODO 浜ゆ槗绫诲瀷缂栫爜 YS-YSKD//棰勬敹娆惧崟 ZJSKD 鐩存帴鏀舵鍗� 鏀舵鍗� ar_coloth 鍏朵粬鏀舵 鏀舵鍗� ar_colsale 鍏朵粬鏀舵 鏀舵鍗�
data.put("oriCurrencyCode", "CNY");//甯佺
+ data.put("settleModeCode",bipVo.getJsfs());//缁撶畻鏂瑰紡
+ data.put("staffCode",bipVo.getYwy());//涓氬姟鍛�
data.put("srcBillType", "38");
data.put("srcBillNo", statement.getBankSeqNo());
data.put("_status", "Insert");
@@ -312,7 +314,7 @@
item.put("remarks", bipVo.getItemList().get(0).getZy());//鎽樿
JSONObject freeChId = new JSONObject();
- freeChId.put("YSYF14", "1");//娆鹃」绫诲瀷 1 棰勬敹娆� 2 搴旀敹娆�
+ freeChId.put("YSYF14", bipVo.getItemList().get(0).getKxlx());//娆鹃」绫诲瀷 1 棰勬敹娆� 2 搴旀敹娆�
freeChId.put("YSYF33", bipVo.getItemList().get(0).getFphm());//鍙戠エ鍙风爜
freeChId.put("GX08", bipVo.getItemList().get(0).getHsdy());//鏍哥畻鍗曞厓
freeChId.put("JT04", bipVo.getItemList().get(0).getHsjylx());//鏍哥畻浜ゆ槗绫诲瀷 0101 闆嗗洟澶栭儴 01020301 涓夌骇鍒嗗瓙鍏徃闂� 01020302 涓夌骇鍒嗗叕鍙镐笌瀛愬瓙鍏徃涔嬮棿
@@ -320,6 +322,8 @@
freeChId.put("JT12", bipVo.getItemList().get(0).getCpwlfl());//浜у搧鐗╂枡鍒嗙被
freeChId.put("JT32", bipVo.getItemList().get(0).getZyys());//浣滀笟瑕佺礌
freeChId.put("zzbkfl", bipVo.getItemList().get(0).getBkfl());//鏉垮潡鍒嗙被
+ freeChId.put("YSZJX01A",bipVo.getItemList().get(0).getXzjysxma());//鏂拌祫閲戦绠楅」鐩瓵
+ freeChId.put("YSZJX11","鏄�");//鏄惁璧勯噾棰勭畻鎺у埗
item.put("freeChId", freeChId);
@@ -650,7 +654,7 @@
}
bipVo.setYwy(SecurityUtils.getUser().getNickname());
bipVo.setPzzdr(SecurityUtils.getUser().getNickname());
- bipVo.setJylx("ZBYXGLXT");
+ bipVo.setJylx("YS-YSKD");
bipVo.setWldxlx("1");
bipVo.setKh(customer.getCreditCode());
bipVo.setBz("CNY");
@@ -719,4 +723,40 @@
}
return paymentConfirmService.syncPaymentRecepit(queryDTO);
}
+
+ @Override
+ public R updById(Long id) {
+ BankStatement statement = baseMapper.selectById(id);
+ if (ObjUtil.isNull(statement)){
+ return R.failed("娴佹按鏁版嵁寮傚父");
+ }
+
+
+
+ if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) {
+ List<String> smjList = new ArrayList<>();
+ smjList.add(smj);
+ smjList.add(smjhw);
+ BusinessCustomer customer = businessCustomerMapper.selectOne(Wrappers.<BusinessCustomer>lambdaQuery()
+ .eq(BusinessCustomer::getCompanyName,statement.getPayBankAccName())
+ .in(BusinessCustomer::getCompId,smjList)
+ .last("limit 1"));
+ if (ObjUtil.isNull(customer)){
+ return R.failed("瀹㈡埛淇℃伅鏌ヨ澶辫触");
+ }
+ statement.setBusGuestId(customer.getId());
+ baseMapper.updateById(statement);
+ return R.ok();
+ }
+ BusinessCustomer customer = businessCustomerMapper.selectOne(Wrappers.<BusinessCustomer>lambdaQuery()
+ .eq(BusinessCustomer::getCompanyName,statement.getPayBankAccName())
+ .eq(BusinessCustomer::getCompId,SecurityUtils.getUser().getCompId())
+ .last("limit 1"));
+ if (ObjUtil.isNull(customer)){
+ return R.failed("瀹㈡埛淇℃伅鏌ヨ澶辫触");
+ }
+ statement.setBusGuestId(customer.getId());
+ baseMapper.updateById(statement);
+ return R.ok();
+ }
}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/BusinessCustomerServiceImpl.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/BusinessCustomerServiceImpl.java
index 39da843..8844e4b 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/BusinessCustomerServiceImpl.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/BusinessCustomerServiceImpl.java
@@ -9,9 +9,11 @@
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.by4cloud.platformx.business.dto.BusinessCustomerAddDTO;
import com.by4cloud.platformx.business.entity.BusinessCustomer;
+import com.by4cloud.platformx.business.entity.Contract;
import com.by4cloud.platformx.business.mapper.BipBanklViewMapper;
import com.by4cloud.platformx.business.mapper.BipViewMapper;
import com.by4cloud.platformx.business.mapper.BusinessCustomerMapper;
+import com.by4cloud.platformx.business.mapper.ContractMapper;
import com.by4cloud.platformx.business.service.BusinessCustomerService;
import com.by4cloud.platformx.business.vo.*;
import com.by4cloud.platformx.common.core.util.R;
@@ -19,9 +21,11 @@
import com.by4cloud.platformx.common.security.util.SecurityUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.validation.BindingResult;
+import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -37,8 +41,15 @@
@Service
public class BusinessCustomerServiceImpl extends ServiceImpl<BusinessCustomerMapper, BusinessCustomer> implements BusinessCustomerService {
+ @Value("${dept.smj}")
+ private String smj;
+
+ @Value("${dept.smjhw}")
+ private String smjhw;
+
private final BipViewMapper bipViewMapper;
private final BipBanklViewMapper bipBanklViewMapper;
+ private final ContractMapper contractMapper;
@Override
public R syncMainBusCus(String compId) {
@@ -124,7 +135,7 @@
if (StrUtil.isBlank(addDTO.getCompanyName())||StrUtil.isBlank(addDTO.getCreditCode())){
return R.failed("瀹㈠晢鍚嶇О鎴栫ぞ浼氫俊鐢ㄤ唬鐮佷笉鑳戒负绌�");
}
- BusinessCustomer bc = baseMapper.selectOne(Wrappers.<BusinessCustomer>lambdaQuery().eq(BusinessCustomer::getCompanyName,addDTO.getCompanyName())
+ BusinessCustomer bc = baseMapper.selectOne(Wrappers.<BusinessCustomer>lambdaQuery()
.eq(BusinessCustomer::getCreditCode,addDTO.getCreditCode())
.eq(BusinessCustomer::getCompId, SecurityUtils.getUser().getCompId())
.last("limit 1"));
@@ -167,6 +178,7 @@
}
}
customer.setRegisterName(custInfo.getCustName());
+ customer.setBipCode(custInfo.getCertificateId());
baseMapper.insert(customer);
return R.ok();
}
@@ -186,9 +198,20 @@
errorMessageList.add(new ErrorMessage(line++, errorMsg));
continue;
}
- BusinessCustomer customer = baseMapper.selectOne(Wrappers.<BusinessCustomer>lambdaQuery()
- .eq(BusinessCustomer::getCreditCode, excelVO.getCreditCode())
- .last("limit 1"));
+ BusinessCustomer customer = null;
+ if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) {
+ List<String> smjList = new ArrayList<>();
+ smjList.add(smj);
+ smjList.add(smjhw);
+ customer = baseMapper.selectOne(Wrappers.<BusinessCustomer>lambdaQuery()
+ .eq(BusinessCustomer::getCreditCode, excelVO.getCreditCode())
+ .in(BusinessCustomer::getCompId, smjList)
+ .last("limit 1"));
+ }else {
+ customer = baseMapper.selectOne(Wrappers.<BusinessCustomer>lambdaQuery()
+ .eq(BusinessCustomer::getCreditCode, excelVO.getCreditCode())
+ .last("limit 1"));
+ }
if (ObjUtil.isNull(customer)) {
customer = BeanUtil.copyProperties(excelVO, BusinessCustomer.class);
CustInfoVo custInfo = bipViewMapper.selectBaseInfoByCertId(excelVO.getCreditCode());
@@ -218,4 +241,28 @@
}
return R.ok();
}
+
+ @Override
+ public R syncCustomer(Long id) {
+ BusinessCustomer customer = baseMapper.selectById(id);
+ if (ObjUtil.isNull(customer)||StrUtil.isBlank(customer.getCreditCode())){
+ return R.failed("瀹㈡埛淇℃伅寮傚父");
+ }
+ CustInfoVo custInfo = bipViewMapper.selectBaseInfoByCertId(customer.getCreditCode());
+ if (ObjUtil.isNull(custInfo)) {
+ return R.failed("涓绘暟鎹棤璇ュ鎴蜂俊鎭紝鏃犳硶鏇存柊");
+ }
+ customer.setCreditCode(custInfo.getCertificateId());
+ baseMapper.updateById(customer);
+ List<Contract> contractList = contractMapper.selectList(Wrappers.<Contract>lambdaQuery()
+ .eq(Contract::getPartyAId,id)
+ .eq(Contract::getContractStatus,2));
+ if (CollUtil.isNotEmpty(contractList)){
+ contractList.stream().forEach(contract -> {
+ contract.setPartyA(customer.getCompanyName());
+ contractMapper.updateById(contract);
+ });
+ }
+ return R.ok();
+ }
}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractInvoiceServiceImpl.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractInvoiceServiceImpl.java
index 306072c..6cc29b4 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractInvoiceServiceImpl.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractInvoiceServiceImpl.java
@@ -239,13 +239,13 @@
Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, subjectMatter.getMaterialCode())
.in(Product::getCompId, smjList).last("limit 1"));
if (ObjUtil.isNull(product) || StrUtil.isBlank(product.getTaxClass()) || StrUtil.isBlank(product.getTaxCode())) {
- return R.failed("璇峰湪浜у搧淇℃伅涓ˉ鍏呯◣鏀跺垎绫讳俊鎭�");
+ return R.failed("璇锋鏌ヤ骇鍝佺紪鐮佹槸鍚﹀瓨鍦ㄦ垨璇峰湪浜у搧淇℃伅涓ˉ鍏呯◣鏀跺垎绫讳俊鎭�");
}
} else {
Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, subjectMatter.getMaterialCode())
.eq(Product::getCompId, SecurityUtils.getUser().getCompId()).last("limit 1"));
if (ObjUtil.isNull(product) || StrUtil.isBlank(product.getTaxClass()) || StrUtil.isBlank(product.getTaxCode())) {
- return R.failed("璇峰湪浜у搧淇℃伅涓ˉ鍏呯◣鏀跺垎绫讳俊鎭�");
+ return R.failed("璇锋鏌ヤ骇鍝佺紪鐮佹槸鍚﹀瓨鍦ㄦ垨璇峰湪浜у搧淇℃伅涓ˉ鍏呯◣鏀跺垎绫讳俊鎭�");
}
}
}
@@ -289,13 +289,13 @@
Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, contractOutBound.getSubjectMatterCode())
.in(Product::getCompId, smjList).last("limit 1"));
if (ObjUtil.isNull(product) || StrUtil.isBlank(product.getTaxClass()) || StrUtil.isBlank(product.getTaxCode())) {
- return R.failed("璇峰湪浜у搧淇℃伅涓ˉ鍏呯◣鏀跺垎绫讳俊鎭�");
+ return R.failed("璇锋鏌ヤ骇鍝佺紪鐮佹槸鍚﹀瓨鍦ㄦ垨璇峰湪浜у搧淇℃伅涓ˉ鍏呯◣鏀跺垎绫讳俊鎭�");
}
} else {
Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, contractOutBound.getSubjectMatterCode())
.eq(Product::getCompId, SecurityUtils.getUser().getCompId()).last("limit 1"));
if (ObjUtil.isNull(product) || StrUtil.isBlank(product.getTaxClass()) || StrUtil.isBlank(product.getTaxCode())) {
- return R.failed("璇峰湪浜у搧淇℃伅涓ˉ鍏呯◣鏀跺垎绫讳俊鎭�");
+ return R.failed("璇锋鏌ヤ骇鍝佺紪鐮佹槸鍚﹀瓨鍦ㄦ垨璇峰湪浜у搧淇℃伅涓ˉ鍏呯◣鏀跺垎绫讳俊鎭�");
}
}
@@ -303,11 +303,11 @@
//鏈哄姩杞﹀紑绁�
if (StrUtil.equals(genInvoiceInfoDTO.getInvoiceType(), "4")) {
if (StrUtil.isBlank(genInvoiceInfoDTO.getVehicleNo())) {
- return R.failed("鏈哄姩杞﹀紑绁ㄨ杈撳叆杞︽灦鍙�");
+ return R.failed("鏈哄姩杞﹂攢鍞彂绁ㄨ杈撳叆杞︽灦鍙�");
}
BigDecimal invoiceNumSum = genInvoiceInfoDTO.getOutBoundInvoiceList().stream().map(item -> item.getInvoiceNum()).reduce(BigDecimal.ZERO, BigDecimal::add);
if (invoiceNumSum.compareTo(new BigDecimal("1")) > 0) {
- return R.failed("鏈哄姩杞﹀紑绁ㄥ彧鑳�1娆″紑1杈�");
+ return R.failed("鏈哄姩杞﹂攢鍞彂绁ㄥ彧鑳�1娆″紑1杈�");
}
JSONObject request = genQueryVinParam(genInvoiceInfoDTO.getVehicleNo(), b);
R r1 = requestQueryVehicleNo(request);
@@ -348,13 +348,13 @@
Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, contractOutBound.getSubjectMatterCode())
.in(Product::getCompId, smjList).last("limit 1"));
if (ObjUtil.isNull(product) || StrUtil.isBlank(product.getTaxClass()) || StrUtil.isBlank(product.getTaxCode())) {
- return R.failed("璇峰湪浜у搧淇℃伅涓ˉ鍏呯◣鏀跺垎绫讳俊鎭�");
+ return R.failed("璇锋鏌ヤ骇鍝佺紪鐮佹槸鍚﹀瓨鍦ㄦ垨璇峰湪浜у搧淇℃伅涓ˉ鍏呯◣鏀跺垎绫讳俊鎭�");
}
} else {
Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, contractOutBound.getSubjectMatterCode())
.eq(Product::getCompId, SecurityUtils.getUser().getCompId()).last("limit 1"));
if (ObjUtil.isNull(product) || StrUtil.isBlank(product.getTaxClass()) || StrUtil.isBlank(product.getTaxCode())) {
- return R.failed("璇峰湪浜у搧淇℃伅涓ˉ鍏呯◣鏀跺垎绫讳俊鎭�");
+ return R.failed("璇锋鏌ヤ骇鍝佺紪鐮佹槸鍚﹀瓨鍦ㄦ垨璇峰湪浜у搧淇℃伅涓ˉ鍏呯◣鏀跺垎绫讳俊鎭�");
}
}
@@ -492,6 +492,7 @@
log.info("鏈哄姩杞﹀悎鏍艰瘉鏌ヨ鎺ュ彛鍏ュ弬锛歿},", request.toJSONString());
String result = HttpUtil.post(bwUrl + "method=baiwang.output.invoice.queryVinDetail&version=1.0&request_id=" + requestId, request.toJSONString());
+// String result = "{\"success\":true,\"requestId\":\"5c2bc8a3-1399-4ff0-a039-92688c6740e0\",\"model\":[{\"engineNo\":\"5210F866\",\"vehicleName\":\"杞胯溅\",\"vehicleSourceCode\":\"\",\"passengersLimited\":\"\",\"originPlace\":\"\",\"vehicleManufactureDate\":\"\",\"vehicleIdForAccountingUuid\":\"\",\"brandModel\":\"鍖椾含鐗�/BJJBJJ7201TN\",\"certificateInvoiceFlag\":\"\\\"certificateInvoiceFlag\\\": \\\"Y\\\"\",\"importCertificateNo\":\"HWJC22411181133\",\"certificateNo\":\"WZHGZBH22411181133\",\"paymentVoucherNo\":\"\",\"certificateStatusCode\":\"\\\"certificateStatusCode\\\": \\\"0\\\"\",\"vehicleNo\":\"CLSBDH22406190234\",\"invoiceUnavailableReasonCode\":\"\",\"manufacturingEnterprise\":\"浣涘北绠�鎹烽櫠鐡锋潗鏂欑鎶�鏈夐檺鍏徃\",\"invoiceUnavailableReasonDesc\":\"\",\"tonnage\":0,\"inspectionListNo\":\"\",\"vehicleType\":\"\"}]}";
log.info("鏈哄姩杞﹀悎鏍艰瘉鏌ヨ鎺ュ彛鍥炲弬锛歿},", result);
saveBwRequestRecord("baiwang.output.invoice.queryVinDetail", requestId, request.toJSONString(), result);
JSONObject resultObj = JSONObject.parseObject(result);
@@ -529,9 +530,9 @@
private R requestQueryVehicleNo(JSONObject request) {
String requestId = IdUtil.fastUUID();
-
log.info("鏌ヨ绋庡眬杞︽灦鍙风爜鍏ュ弬锛歿},", request.toJSONString());
String result = HttpUtil.post(bwUrl + "method=baiwang.output.einvoice.queryvinlist&version=1.0&request_id=" + requestId, request.toJSONString());
+// String result = "{\"success\":true,\"requestId\":\"5c2bc8a3-1399-4ff0-a039-92688c6740e0\",\"model\":[{\"vehicleNo\":\"\",\"isNotOpenInvReason\":\"\",\"isOpenInvoice\":true}]}";
log.info("鏌ヨ绋庡眬杞︽灦鍙风爜鍥炲弬锛歿},", result);
saveBwRequestRecord("baiwang.output.einvoice.queryvinlist", requestId, request.toJSONString(), result);
JSONObject resultObj = JSONObject.parseObject(result);
@@ -572,6 +573,12 @@
vo.setPartyBBankAccount(b.getOrgBankAccount());
vo.setInvoiceType(a.getInvoiceType());
vo.setRemarks(genInvoiceInfoDTO.getRemarks());
+ if (StrUtil.isNotBlank(b.getOrgContact())) {
+ vo.setContact(b.getOrgContact());
+ }
+ if (StrUtil.isNotBlank(b.getOrgAddress())) {
+ vo.setAddress(b.getOrgAddress());
+ }
vo.setOutBoundInvoiceList(genInvoiceInfoDTO.getOutBoundInvoiceList());
if (StrUtil.isNotBlank(genInvoiceInfoDTO.getInvoiceType())) {
vo.setInvoiceVehicleType(genInvoiceInfoDTO.getInvoiceType());
@@ -584,6 +591,9 @@
}
if (StrUtil.isNotBlank(genInvoiceInfoDTO.getVehicleData())) {
vo.setVehicleData(genInvoiceInfoDTO.getVehicleData());
+ }
+ if (StrUtil.isNotBlank(genInvoiceInfoDTO.getSwjg())) {
+ vo.setSwjg(genInvoiceInfoDTO.getSwjg());
}
List<InvoiceItemVo> invoiceItemVoList = new ArrayList<>();
List<String> erpCode = new ArrayList<>();
@@ -1399,7 +1409,7 @@
}
BusinessCustomer customer = businessCustomerMapper.selectById(contract.getPartyAId());
if (ObjUtil.isNull(customer) || StrUtil.isEmpty(customer.getBipCode())) {
- log.error("鏌ヨ鍚堝悓淇℃伅寮傚父");
+ log.error("鏌ヨ瀹㈡埛淇℃伅寮傚父");
return;
}
R<SysDept> r = remoteDeptService.getById(contract.getPartyBId());
@@ -1408,16 +1418,16 @@
return;
}
SysDept comp = r.getData();
- R<SysDept> rDept = remoteDeptService.getById(SecurityUtils.getUser().getDeptId());
- if (!r.isOk()) {
- log.error("鏌ヨ鍗曚綅淇℃伅寮傚父");
- return;
- }
- SysDept dept = rDept.getData();
+// R<SysDept> rDept = remoteDeptService.getById(SecurityUtils.getUser().getDeptId());
+// if (!r.isOk()) {
+// log.error("鏌ヨ鍗曚綅淇℃伅寮傚父");
+// return;
+// }
+// SysDept dept = rDept.getData();
//钃濈エ
if (StrUtil.equals(contractInvoice.getInvoiceCategory(), "1")) {
- JSONObject params = genBlueReceiveParams(contractInvoice, contract, customer, comp, dept);
+ JSONObject params = genBlueReceiveParams(contractInvoice, contract, customer, comp);
String finalAccessToken = accessToken;
log.info("搴旀敹鍙戠エ闆嗘垚鍏ュ弬:{}", params.toJSONString());
@@ -1463,7 +1473,8 @@
}
private JSONObject genBlueReceiveParams(ContractInvoice contractInvoice, Contract contract, BusinessCustomer customer
- , SysDept comp, SysDept dept) {
+ , SysDept comp) {
+ GenInvoiceInfoVo vo = BeanUtil.copyProperties(JSONObject.parseObject(contractInvoice.getInvoicePreview()), GenInvoiceInfoVo.class);
JSONObject jsonObject = new JSONObject();
JSONObject data = new JSONObject();
if (contractInvoice.getInvoiceCategory().equals("1")) {
@@ -1475,17 +1486,17 @@
data.put("exchangeRate", "1");//姹囩巼
data.put("exchangeRateDate", DateUtil.now());//姹囩巼鏃堕棿
data.put("objectType", "1");//寰�鏉ュ璞$被鍨�(鏋氫妇鍊� 1:瀹㈡埛; 2:鍛樺伐;3:璧勯噾涓氬姟瀵硅薄)
- data.put("deptCode", dept.getOrgCode());//閮ㄩ棬缂栫爜 SS2
- data.put("staffCode", SecurityUtils.getUser().getNickname());//涓氬姟鍛樼紪鐮�
+ data.put("deptCode", vo.getBipVo().getBm());//閮ㄩ棬缂栫爜 SS2
+ data.put("staffCode", vo.getBipVo().getYwy());//涓氬姟鍛樼紪鐮�
data.put("customerCode", customer.getBipCode());//瀹㈡埛缂栫爜
data.put("financeOrgCode", comp.getBipCode());//寮�绁ㄧ粍缁囩紪鐮�
data.put("orgCode", comp.getBipCode());//涓氬姟缁勭粐缂栫爜
- data.put("bustypeCode", "ZBYXGLXT");//浜ゆ槗绫诲瀷缂栫爜 鏆備及榛樿ZGYSFP锛岄攢鍞粯璁BYXGLXT
+ data.put("bustypeCode", "ZBYXGLXT");//浜ゆ槗绫诲瀷缂栫爜 鏆備及榛樿ZGYSFP锛岄攢鍞粯璁BYXGLXT ar_invoice 搴旀敹鍙戠エ
data.put("contractNo", contract.getContractNo());
data.put("oriCurrencyCode", "CNY");//甯佺
data.put("_status", "Insert");
- GenInvoiceInfoVo vo = BeanUtil.copyProperties(JSONObject.parseObject(contractInvoice.getInvoicePreview()), GenInvoiceInfoVo.class);
+
JSONArray bodyItem = new JSONArray();
for (InvoiceItemVo invoiceItemVo : vo.getBipVo().getItemList()) {
JSONObject item = new JSONObject();
@@ -1718,7 +1729,8 @@
contract.setBillingStatus("3");
}
if (contract.getPaidAmount().compareTo(contract.getAmount().subtract(contract.getDropAmount())) >= 0 &&
- contract.getBillingAmout().compareTo(contract.getAmount()) == 0) {
+ contract.getBillingAmout().compareTo(contract.getAmount()) == 0&&
+ StrUtil.isBlank(contract.getNextScheduleName())) {
contract.setContractStatus(3);
}
if (contract.getBillingAmout().compareTo(contract.getAmount()) < 0) {
@@ -1755,7 +1767,8 @@
contract.setBillingStatus("3");
}
if (contract.getBillingAmout().compareTo(contract.getAmount()) == 0 &&
- contract.getPaidAmount().compareTo(contract.getAmount().subtract(contract.getDropAmount())) >= 0) {
+ contract.getPaidAmount().compareTo(contract.getAmount().subtract(contract.getDropAmount())) >= 0&&
+ StrUtil.isBlank(contract.getNextScheduleName())) {
contract.setBillingStatus("3");
contract.setContractStatus(3);
}
@@ -2209,16 +2222,16 @@
}
SysDept comp = r.getData();
- R<SysDept> rDept = remoteDeptService.getById(SecurityUtils.getUser().getDeptId());
- if (!r.isOk()) {
- log.error("鏌ヨ閮ㄩ棬淇℃伅寮傚父");
- return R.failed("鏌ヨ閮ㄩ棬淇℃伅寮傚父");
- }
- SysDept dept = rDept.getData();
+// R<SysDept> rDept = remoteDeptService.getById(SecurityUtils.getUser().getDeptId());
+// if (!r.isOk()) {
+// log.error("鏌ヨ閮ㄩ棬淇℃伅寮傚父");
+// return R.failed("鏌ヨ閮ㄩ棬淇℃伅寮傚父");
+// }
+// SysDept dept = rDept.getData();
//钃濈エ
if (StrUtil.equals(contractInvoice.getInvoiceCategory(), "1")) {
- JSONObject params = genBlueReceiveParams(contractInvoice, contract, customer, comp, dept);
+ JSONObject params = genBlueReceiveParams(contractInvoice, contract, customer, comp);
String finalAccessToken = accessToken;
log.info("搴旀敹鍙戠エ闆嗘垚鍏ュ弬:{}", params.toJSONString());
@@ -2408,6 +2421,17 @@
return bipPushPdf(invoice.getId());
}
+ @Override
+ public R updBwParamById(UpdBwParamDTO dto) {
+ ContractInvoice invoice = baseMapper.selectById(dto.getId());
+ if (ObjUtil.isNull(invoice)){
+ return R.failed("鍙戠エ淇℃伅寮傚父");
+ }
+ invoice.setBwRequestParam(dto.getBwRequestParam());
+ baseMapper.updateById(invoice);
+ return R.ok();
+ }
+
public static void main(String[] args) {
File file = new File("d://tmp//" + IdUtil.fastUUID() + ".pdf");
HttpUtil.downloadFile("http://fp.baiwang.com/format/d?d=BB99645F8ED2AE7D2055E7D29330D366B7CAE92C278C6BB84D222610CEC2118D", file);
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractPaymentScheduleProcessServiceImpl.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractPaymentScheduleProcessServiceImpl.java
index fd9c413..dbb4551 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractPaymentScheduleProcessServiceImpl.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractPaymentScheduleProcessServiceImpl.java
@@ -207,6 +207,9 @@
}
if (ObjUtil.isNull(afterOneSchedule)) {
contract.setNextScheduleName("");
+ if (contract.getPaidAmount().compareTo(contract.getAmount()) == 0 && contract.getBillingAmout().compareTo(contract.getAmount()) == 0) {
+ contract.setContractStatus(3);
+ }
}
contractMapper.updateById(contract);
//鏇存柊灞ョ害闃舵鏃堕棿
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractServiceImpl.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractServiceImpl.java
index 39a96c3..a77069b 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractServiceImpl.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractServiceImpl.java
@@ -97,6 +97,9 @@
private final ContractApprovalMapper contractApprovalMapper;
private final TaxCodeMapper taxCodeMapper;
private final ContractSubjectMatterService contractSubjectMatterService;
+ private final HistoryOverdueMapper historyOverdueMapper;
+ private final DropLossMapper dropLossMapper;
+ private final PaymentOffsetMapper paymentOffsetMapper;
@Value("${erp.ymj}")
private String ymjErp;
@@ -161,7 +164,7 @@
@Override
public R add(ContractAddDTO addDTO) {
Contract contract = BeanUtil.copyProperties(addDTO, Contract.class);
- if (!StrUtil.equals(smjsc,SecurityUtils.getUser().getCompId()+"")&&!StrUtil.equals(smjzt,SecurityUtils.getUser().getCompId()+"")) {
+ if (!StrUtil.equals(smjsc, SecurityUtils.getUser().getCompId() + "") && !StrUtil.equals(smjzt, SecurityUtils.getUser().getCompId() + "")) {
contract.setPartyBId(SecurityUtils.getUser().getCompId());
contract.setPartyB(SecurityUtils.getUser().getCompName());
}
@@ -210,7 +213,7 @@
}
if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) ||
- StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)||
+ StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt) ||
StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) {
contract.setContractNo(generateSMJContractNo());
}
@@ -314,6 +317,13 @@
@Override
public R edit(ContractUpdateDTO updateDTO) {
Contract entity = baseMapper.selectById(updateDTO.getId());
+
+ if (StrUtil.equals(updateDTO.getContractCategory(),"paid-edit")){
+ entity.setPaidAmount(updateDTO.getPaidAmount());
+ entity.setBillingAmout(updateDTO.getBillingAmout());
+ baseMapper.updateById(entity);
+ return R.ok();
+ }
if (!StrUtil.equals(entity.getContractStatus() + "", "0")) {
return R.failed("褰撳墠鐘舵�佹棤娉曚慨鏀瑰悎鍚�");
}
@@ -334,23 +344,23 @@
contract.setPaidAmount(new BigDecimal("0"));
contract.setBillingAmout(new BigDecimal("0"));
contract.setNickName(SecurityUtils.getUser().getNickname());
- if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) ||
- StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)||
- StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) {
- contract.setContractNo(generateSMJContractNo());
- }
- if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", sgb)) {
- contract.setContractNo(generateGYBContractNo());
- }
- if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", ymj)) {
- contract.setContractNo(generateYMJContractNo());
- }
- if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", tfgs)) {
- contract.setContractNo(generateTFContractNo());
- }
- if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", jxc)) {
- contract.setContractNo(generateJXCContractNo());
- }
+// if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) ||
+// StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt) ||
+// StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) {
+// contract.setContractNo(generateSMJContractNo());
+// }
+// if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", sgb)) {
+// contract.setContractNo(generateGYBContractNo());
+// }
+// if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", ymj)) {
+// contract.setContractNo(generateYMJContractNo());
+// }
+// if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", tfgs)) {
+// contract.setContractNo(generateTFContractNo());
+// }
+// if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", jxc)) {
+// contract.setContractNo(generateJXCContractNo());
+// }
if (ObjUtil.isNotNull(updateDTO.getDeliveryCycle())) {
contract.setExpirationDate(DateUtil.offsetDay(updateDTO.getSignDate(), updateDTO.getDeliveryCycle()));
}
@@ -506,12 +516,12 @@
Contract contract = baseMapper.selectById(id);
BusinessCustomer customer = businessCustomerMapper.selectById(contract.getPartyAId());
- if (ObjUtil.isNull(customer)){
+ if (ObjUtil.isNull(customer)) {
return R.failed("瀹㈡埛鏌ヨ寮傚父");
}
R<SysDept> r = remoteDeptService.getById(SecurityUtils.getUser().getCompId());
- if (!r.isOk()){
+ if (!r.isOk()) {
return R.failed("淇℃伅鏌ヨ寮傚父");
}
SysDept comp = r.getData();
@@ -520,7 +530,7 @@
return R.failed("璇疯ˉ鍏呮爣鐨勭墿鍜屾敹娆鹃樁娈靛悗鍐嶈繘琛屾搷浣滐紒");
}
List<ContractSubjectMatter> subjectMatterList = contractSubjectMatterMapper.selectList(Wrappers.<ContractSubjectMatter>lambdaQuery().
- eq(ContractSubjectMatter::getContractId,contract.getId()));
+ eq(ContractSubjectMatter::getContractId, contract.getId()));
//鍚堝悓涓績瀹℃牳
JSONObject requestApply = new JSONObject();
requestApply.put("fd_selectionmethod", contract.getSelectionMethod());
@@ -536,21 +546,37 @@
requestApply.put("fd_docNumber", contract.getContractNo());
// requestApply.put("fd_templateId", "19e39bb6c1edadbdb162c434274a8a18");
if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) ||
- StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)||
+ StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt) ||
StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) {
- requestApply.put("fd_templateId", tempSMJ);
+ if (contract.getContractCategory().equals("his_no_center")){
+ requestApply.put("fd_templateId", "1a03828a8ff2b476af7805f45a88a2ed");
+ }else {
+ requestApply.put("fd_templateId", tempSMJ);
+ }
}
if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", sgb)) {
- requestApply.put("fd_templateId", tempSGB);
+ requestApply.put("fd_templateId", "1a038430e7f207101ebd992454b8fec5");
}
if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", ymj)) {
- requestApply.put("fd_templateId", tempYMJ);
+ if (contract.getContractCategory().equals("his_no_center")){
+ requestApply.put("fd_templateId", "1a038467e32f6274f051de14080b5cde");
+ }else {
+ requestApply.put("fd_templateId", tempYMJ);
+ }
}
if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", tfgs)) {
- requestApply.put("fd_templateId", tempTFGS);
+ if (contract.getContractCategory().equals("his_no_center")){
+ requestApply.put("fd_templateId", "1a03845b5e642092d9272d64dacba76c");
+ }else {
+ requestApply.put("fd_templateId", tempTFGS);
+ }
}
if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", jxc)) {
- requestApply.put("fd_templateId", tempJXC);
+ if (contract.getContractCategory().equals("his_no_center")){
+ requestApply.put("fd_templateId", "1a038450e9ab5d940be954144b2b62b1");
+ }else {
+ requestApply.put("fd_templateId", tempJXC);
+ }
}
requestApply.put("fd_name", contract.getContractName());
requestApply.put("fd_signDate", DateUtil.formatDate(contract.getSignDate()));
@@ -565,26 +591,29 @@
requestApply.put("fd_customerName", contract.getPartyA());
requestApply.put("fd_systemSource", "闈炵叅閿�鍞郴缁�");
requestApply.put("fd_type", "00");
- String bzr = comp.getBaozhangren();
+ if (contract.getAmount().compareTo(new BigDecimal("0"))==0){
+ requestApply.put("fd_agr_property","1");
+ }
+ String bzr = comp.getBaozhangren();
String syr = baseMapper.selectYZSH();
- if (!StrUtil.equals(contract.getCompId()+"",contract.getPartyBId()+"")&& (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) ||
- StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)||
- StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw))&&StrUtil.isNotBlank(syr)) {
+ if (!StrUtil.equals(contract.getCompId() + "", contract.getPartyBId() + "") && (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) ||
+ StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt) ||
+ StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) && StrUtil.isNotBlank(syr) && StrUtil.isNotBlank(bzr)) {
log.info("鐭崇叅鏈哄瓙鍏徃鐢ㄦ�诲叕鍙稿嵃绔�");
- bzr =bzr.concat(syr);
+ bzr = bzr.concat(syr);
}
requestApply.put("fd_baozhangren", bzr);
- requestApply.put("fd_summary",contract.getSummary());
+ requestApply.put("fd_summary", contract.getSummary());
JSONArray signList = new JSONArray();
JSONObject j = new JSONObject();
- j.put("fd_standing","鐢�");
- j.put("fd_Iden",customer.getCreditCode());
- j.put("fd_signMain","2");
+ j.put("fd_standing", "鐢�");
+ j.put("fd_Iden", customer.getCreditCode());
+ j.put("fd_signMain", "2");
signList.add(j);
JSONObject y = new JSONObject();
- y.put("fd_standing","涔�");
- y.put("fd_Iden",comp.getOrgCode());
- y.put("fd_signMain","1");
+ y.put("fd_standing", "涔�");
+ y.put("fd_Iden", comp.getOrgCode());
+ y.put("fd_signMain", "1");
signList.add(y);
requestApply.put("fd_signList", signList);
if (StrUtil.isNotBlank(contract.getAttachmentUrl())) {
@@ -592,32 +621,32 @@
JSONObject att = new JSONObject();
att.put("fd_attNum", "1");
att.put("fd_attName", contract.getAttachmentName());
- att.put("fd_attType", contract.getAttachmentName().substring(contract.getAttachmentName().lastIndexOf('.')+1));
+ att.put("fd_attType", contract.getAttachmentName().substring(contract.getAttachmentName().lastIndexOf('.') + 1));
att.put("fd_attQuality", "00");
att.put("fd_attcontent", NetworkFileToBase64.convertNetworkFileToBase64("https://zbjt.res.jzeg.cn/api" + contract.getAttachmentUrl()));
attList.add(att);
requestApply.put("attList", attList);
}
- if (CollUtil.isNotEmpty(subjectMatterList)){
+ if (CollUtil.isNotEmpty(subjectMatterList)) {
JSONArray materialList = new JSONArray();
- subjectMatterList.stream().forEach(subjectMatter->{
+ subjectMatterList.stream().forEach(subjectMatter -> {
JSONObject material = new JSONObject();
material.put("fd_materiaCode", subjectMatter.getMaterialCode());
material.put("fd_materiaName", subjectMatter.getMaterialInternalName());
- material.put("fd_specification", StrUtil.isNotBlank(subjectMatter.getSpecification())?subjectMatter.getSpecification():"");
+ material.put("fd_specification", StrUtil.isNotBlank(subjectMatter.getSpecification()) ? subjectMatter.getSpecification() : "");
material.put("fd_figureNumber", "");
material.put("fd_measureUnit", subjectMatter.getUnit());
material.put("fd_number", subjectMatter.getQuantity());
material.put("fd_price", subjectMatter.getUnitPrice());
- Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode,subjectMatter.getMaterialCode()).last("limit 1"));
- if (ObjUtil.isNotNull(product)){
+ Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, subjectMatter.getMaterialCode()).last("limit 1"));
+ if (ObjUtil.isNotNull(product)) {
material.put("fd_rate", product.getTaxRate().toString());
}
material.put("fd_amount", subjectMatter.getUnitPrice().multiply(subjectMatter.getQuantity()));
material.put("fd_requirements", "");
material.put("fd_standard", "");
material.put("fd_factory", "");
- material.put("fd_Deadlines", ObjUtil.isNotNull(subjectMatter.getPlannedDeliveryDate())?subjectMatter.getPlannedDeliveryDate():"");
+ material.put("fd_Deadlines", ObjUtil.isNotNull(subjectMatter.getPlannedDeliveryDate()) ? subjectMatter.getPlannedDeliveryDate() : "");
material.put("fd_delivery", "");
material.put("fd_des", "");
materialList.add(material);
@@ -628,8 +657,8 @@
String respApply = HttpUtil.post("https://oa.res.jzeg.cn/ekp/api/km-agreement/kmAgreementWebService/addSupplyContractApply", requestApply.toJSONString());
log.info("鍚堝悓涓績鍚堝悓璧疯崏鎺ュ彛鍥炲弬锛歿}", respApply);
JSONObject applyResp = JSONObject.parseObject(respApply);
- if (!applyResp.getString("code").equals("00")){
- return R.failed("鍚堝悓涓績鎺ㄩ�佸鏍稿け璐ワ紝鍘熷洜涓�:{}",applyResp.getString("msg"));
+ if (!applyResp.getString("code").equals("00")) {
+ return R.failed("鍚堝悓涓績鎺ㄩ�佸鏍稿け璐ワ紝鍘熷洜涓�:{}", applyResp.getString("msg"));
}
//鍚姩娴佺▼-绯荤粺鑷甫瀹℃壒娴�
// ProcessInstanceParamDto dto = new ProcessInstanceParamDto();
@@ -661,23 +690,25 @@
List<ContractSubjectMatter> subjectMatterList = contractSubjectMatterMapper.selectList(Wrappers.<ContractSubjectMatter>lambdaQuery()
.eq(ContractSubjectMatter::getContractId, id));
if (StrUtil.isNotEmpty(contract.getContractCategory()) && StrUtil.equals(contract.getContractCategory(), "water_house")) {
- handleWaterHouseCycle(contract,subjectMatterList);
+ handleWaterHouseCycle(contract, subjectMatterList);
return;
}
//璧勯噾鏄庣粏
savePaymentConfirm(contract);
+ contract.setNextScheduleName("鍙戣揣鍓�");
+ baseMapper.updateById(contract);
+
//鍚堝悓鎺ㄩ�佸瓙鍏徃
- pushSubCompany(contract,subjectMatterList);
+ pushSubCompany(contract, subjectMatterList);
//鍚堝悓涓績鎺ㄩ��
// pusnContractCenter(contract,subjectMatterList);
- contract.setNextScheduleName("鍙戣揣鍓�");
- baseMapper.updateById(contract);
+
}
- private void pusnContractCenter(Contract contract,List<ContractSubjectMatter> subjectMatterList) {
+ private void pusnContractCenter(Contract contract, List<ContractSubjectMatter> subjectMatterList) {
new Thread(() -> {
try {
JSONObject requestApply = new JSONObject();
@@ -740,261 +771,268 @@
}).start();
}
- private void pushSubCompany(Contract contract,List<ContractSubjectMatter> subjectMatterList) {
+ private R pushSubCompany(Contract contract, List<ContractSubjectMatter> subjectMatterList) {
//erp鎺ㄩ��
- new Thread(() -> {
- try {
- Thread.sleep(500);
- JSONObject request = new JSONObject();
- BusinessCustomer customer = businessCustomerMapper.selectById(contract.getPartyAId());
- request.put("contractNo", contract.getContractNo());
- request.put("partyA", contract.getPartyA());
- request.put("partyACode", customer.getErpCompanyCode());
- if (StrUtil.equals(contract.getPartyBId() + "", ymj) && StrUtil.isNotEmpty(ymjErp)) {
- request.put("customerCode", customer.getErpCompanyCode());
- request.put("currencyId", "RMB");
- request.put("signDate", DateUtil.format(contract.getSignDate(), DatePattern.NORM_DATETIME_PATTERN));
- request.put("dateDeliver", DateUtil.format(contract.getExpirationDate(), DatePattern.NORM_DATETIME_PATTERN));
- request.put("moneySum", contract.getAmount());
- request.put("signManner", "闈㈢");
- request.put("salesman", "");
- if (CollUtil.isNotEmpty(subjectMatterList)) {
- JSONArray subjectMatter = new JSONArray();
- subjectMatterList.stream().forEach(contractSubjectMatter -> {
- JSONObject subjectMatterItem = new JSONObject();
- subjectMatterItem.put("itemNo", contractSubjectMatter.getMaterialCode());
- subjectMatterItem.put("salePrice", contractSubjectMatter.getUnitPrice());
- subjectMatterItem.put("qtyRequired", contractSubjectMatter.getQuantity());
- subjectMatterItem.put("money", contractSubjectMatter.getQuantity().multiply(contractSubjectMatter.getUnitPrice()));
- Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getCompId, contract.getCompId())
- .eq(Product::getErpCode, contractSubjectMatter.getMaterialCode()));
- if (ObjUtil.isNotNull(product)) {
- subjectMatterItem.put("taxRate", new BigDecimal(product.getTaxRate()).divide(new BigDecimal("100")));
- }
- subjectMatterItem.put("dateDeliver", ObjUtil.isNotNull(contractSubjectMatter.getPlannedDeliveryDate()) ?
- DateUtil.format(contractSubjectMatter.getPlannedDeliveryDate(), DatePattern.NORM_DATETIME_PATTERN) :
- DateUtil.format(contract.getExpirationDate(), DatePattern.NORM_DATETIME_PATTERN));
- subjectMatter.add(subjectMatterItem);
- });
- request.put("details", subjectMatter);
- }
- String token = "";
- if (redisTemplate.hasKey("YMJ_ERP_TOKEN")) {
- token = (String) redisTemplate.opsForValue().get("YMJ_ERP_TOKEN");
- } else {
- token = getYmjErpToken();
- }
- if (StrUtil.isEmpty(token)){
- log.error("涓�鐓ゆ満鐧诲綍鑾峰彇token澶辫触");
- return;
- }
- log.info("涓�鐓ゆ満鍚堝悓鎺ㄩ�乪rp鍏ュ弬锛歿}", request.toJSONString());
- HttpResponse response = HttpRequest.post(ymjErp + "/api/contract-staging/v1/receive")
- .header("token", token) // 娣诲姞璁よ瘉澶�
- .header("Content-Type", "application/json") // 璁剧疆鍐呭绫诲瀷
- .body(request.toJSONString()) // 璁剧疆璇锋眰浣�
- .execute(); // 鎵ц璇锋眰.post(ymjErp,request.toJSONString());
- log.info("涓�鐓ゆ満鍚堝悓鎺ㄩ�乪rp鍥炲弬锛歿}", response.body());
- //淇濆瓨璇锋眰璁板綍
- saveErpRequestRecord("ymj", request.toJSONString(), response.body());
- //鏇存柊鍚堝悓erp鎺ㄩ�佹爣璇�
- contract.setErpPushFlag("1");
- baseMapper.updateById(contract);
- }
- if ((StrUtil.equals(contract.getPartyBId() + "", smj) ||StrUtil.equals(contract.getPartyBId() + "", smjsc) ||
- StrUtil.equals(contract.getPartyBId() + "", smjzt) ||
- StrUtil.equals(contract.getPartyBId() + "", smjhw)) && StrUtil.isNotEmpty(smjErp)) {
- request.put("customerCode", customer.getErpCompanyCode());
- request.put("currencyId", "RMB");
- request.put("signDate", DateUtil.format(contract.getSignDate(), DatePattern.NORM_DATETIME_PATTERN));
- request.put("dateDeliver", DateUtil.format(contract.getExpirationDate(), DatePattern.NORM_DATETIME_PATTERN));
- request.put("moneySum", contract.getAmount());
- request.put("signManner", "闈㈢");
- request.put("salesman", "");
- request.put("tenantId", "tenant1");
- if (CollUtil.isNotEmpty(subjectMatterList)) {
- JSONArray subjectMatter = new JSONArray();
- subjectMatterList.stream().forEach(contractSubjectMatter -> {
- JSONObject subjectMatterItem = new JSONObject();
- subjectMatterItem.put("itemNo", contractSubjectMatter.getMaterialCode());
- subjectMatterItem.put("salePrice", contractSubjectMatter.getUnitPrice());
- subjectMatterItem.put("qtyRequired", contractSubjectMatter.getQuantity());
- subjectMatterItem.put("money", contractSubjectMatter.getQuantity().multiply(contractSubjectMatter.getUnitPrice()));
- Product product = null;
- List<String> smjList = new ArrayList<>();
- smjList.add(smj);
- smjList.add(smjhw);
- if (("" + SecurityUtils.getUser().getCompId()).equals(smj)||("" + SecurityUtils.getUser().getCompId()).equals(smjhw)) {
- product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, contractSubjectMatter.getMaterialCode())
- .in(Product::getCompId, smjList).last("limit 1"));
- } else {
- product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, contractSubjectMatter.getMaterialCode())
- .eq(Product::getCompId, SecurityUtils.getUser().getCompId()).last("limit 1"));
- }
- if (ObjUtil.isNotNull(product)) {
- subjectMatterItem.put("taxRate", new BigDecimal(product.getTaxRate()).divide(new BigDecimal("100")));
- }
- subjectMatterItem.put("dateDeliver", ObjUtil.isNotNull(contractSubjectMatter.getPlannedDeliveryDate()) ?
- DateUtil.format(contractSubjectMatter.getPlannedDeliveryDate(), DatePattern.NORM_DATETIME_PATTERN) :
- DateUtil.format(contract.getExpirationDate(), DatePattern.NORM_DATETIME_PATTERN));
- subjectMatter.add(subjectMatterItem);
- });
- request.put("details", subjectMatter);
+ JSONObject request = new JSONObject();
+ BusinessCustomer customer = businessCustomerMapper.selectById(contract.getPartyAId());
+ request.put("contractNo", contract.getContractNo());
+ request.put("partyA", contract.getPartyA());
+ request.put("partyACode", customer.getErpCompanyCode());
+ if (StrUtil.equals(contract.getPartyBId() + "", ymj) && StrUtil.isNotEmpty(ymjErp)) {
+ request.put("customerCode", customer.getErpCompanyCode());
+ request.put("currencyId", "RMB");
+ request.put("signDate", DateUtil.format(contract.getSignDate(), DatePattern.NORM_DATETIME_PATTERN));
+ request.put("dateDeliver", DateUtil.format(contract.getExpirationDate(), DatePattern.NORM_DATETIME_PATTERN));
+ request.put("moneySum", contract.getAmount());
+ request.put("signManner", "闈㈢");
+ request.put("salesman", "");
+ if (CollUtil.isNotEmpty(subjectMatterList)) {
+ JSONArray subjectMatter = new JSONArray();
+ subjectMatterList.stream().forEach(contractSubjectMatter -> {
+ JSONObject subjectMatterItem = new JSONObject();
+ subjectMatterItem.put("itemNo", contractSubjectMatter.getMaterialCode());
+ subjectMatterItem.put("salePrice", contractSubjectMatter.getUnitPrice());
+ subjectMatterItem.put("qtyRequired", contractSubjectMatter.getQuantity());
+ subjectMatterItem.put("money", contractSubjectMatter.getQuantity().multiply(contractSubjectMatter.getUnitPrice()));
+ Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getCompId, contract.getCompId())
+ .eq(Product::getErpCode, contractSubjectMatter.getMaterialCode()));
+ if (ObjUtil.isNotNull(product)) {
+ subjectMatterItem.put("taxRate", new BigDecimal(product.getTaxRate()).divide(new BigDecimal("100")));
}
-
-
- String token = "";
- if (redisTemplate.hasKey("SMJ_ERP_TOKEN")) {
- token = (String) redisTemplate.opsForValue().get("SMJ_ERP_TOKEN");
- } else {
- token = getErpToken();
- }
- if (StrUtil.isEmpty(token)){
- log.error("鐭崇叅鏈虹櫥褰曡幏鍙杢oken澶辫触");
- return;
- }
-
- log.info("鐭崇叅鏈哄悎鍚屾帹閫乪rp鍏ュ弬锛歿}", request.toJSONString());
- HttpResponse response = HttpRequest.post(smjErp + "/api/contract/v1/createWithDetails?tenantId=tenant1")
- .header("token", token) // 娣诲姞璁よ瘉澶�
- .header("Content-Type", "application/json") // 璁剧疆鍐呭绫诲瀷
- .body(request.toJSONString()) // 璁剧疆璇锋眰浣�
- .execute(); // 鎵ц璇锋眰.post(ymjErp,request.toJSONString());
- log.info("鐭崇叅鏈哄悎鍚屾帹閫乪rp鍥炲弬锛歿}", response.body());
- //淇濆瓨璇锋眰璁板綍
- saveErpRequestRecord("smj", request.toJSONString(), response.body());
- //鏇存柊鍚堝悓erp鎺ㄩ�佹爣璇�
- contract.setErpPushFlag("1");
- baseMapper.updateById(contract);
- }
- if (StrUtil.equals(contract.getPartyBId() + "", smjsc) && StrUtil.isNotEmpty(smjscErp)) {
- request.put("customerCode", customer.getErpCompanyCode());
- request.put("currencyId", "RMB");
- request.put("signDate", DateUtil.format(contract.getSignDate(), DatePattern.NORM_DATETIME_PATTERN));
- request.put("dateDeliver", DateUtil.format(contract.getExpirationDate(), DatePattern.NORM_DATETIME_PATTERN));
- request.put("moneySum", contract.getAmount());
- request.put("signManner", "闈㈢");
- request.put("salesman", "");
- request.put("tenantId", "tenant2");
- if (CollUtil.isNotEmpty(subjectMatterList)) {
- JSONArray subjectMatter = new JSONArray();
- subjectMatterList.stream().forEach(contractSubjectMatter -> {
- JSONObject subjectMatterItem = new JSONObject();
- subjectMatterItem.put("itemNo", contractSubjectMatter.getMaterialCode());
- subjectMatterItem.put("salePrice", contractSubjectMatter.getUnitPrice());
- subjectMatterItem.put("qtyRequired", contractSubjectMatter.getQuantity());
- subjectMatterItem.put("money", contractSubjectMatter.getQuantity().multiply(contractSubjectMatter.getUnitPrice()));
- Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getCompId, contract.getCompId())
- .eq(Product::getErpCode, contractSubjectMatter.getMaterialCode()));
- if (ObjUtil.isNotNull(product)) {
- subjectMatterItem.put("taxRate", new BigDecimal(product.getTaxRate()).divide(new BigDecimal("100")));
- }
- subjectMatterItem.put("dateDeliver", ObjUtil.isNotNull(contractSubjectMatter.getPlannedDeliveryDate()) ?
- DateUtil.format(contractSubjectMatter.getPlannedDeliveryDate(), DatePattern.NORM_DATETIME_PATTERN) :
- DateUtil.format(contract.getExpirationDate(), DatePattern.NORM_DATETIME_PATTERN));
- subjectMatter.add(subjectMatterItem);
- });
- request.put("details", subjectMatter);
- }
-
- String token = "";
- if (redisTemplate.hasKey("SMJ_ERP_TOKEN")) {
- token = (String) redisTemplate.opsForValue().get("SMJ_ERP_TOKEN");
- } else {
- token = getErpToken();
- }
- if (StrUtil.isEmpty(token)){
- log.error("鐭崇叅鏈虹櫥褰曡幏鍙杢oken澶辫触");
- return;
- }
-
- log.info("鐭崇叅鏈洪殢杞﹀垎鍏徃鍚堝悓鎺ㄩ�乪rp鍏ュ弬锛歿}", request.toJSONString());
- HttpResponse response = HttpRequest.post(smjErp + "/api/contract/v1/createWithDetails?tenantId=tenant2")
- .header("token", token) // 娣诲姞璁よ瘉澶�
- .header("Content-Type", "application/json") // 璁剧疆鍐呭绫诲瀷
- .body(request.toJSONString()) // 璁剧疆璇锋眰浣�
- .execute(); // 鎵ц璇锋眰.post(ymjErp,request.toJSONString());
- log.info("鐭崇叅鏈洪殢杞﹀垎鍏徃鍚堝悓鎺ㄩ�乪rp鍥炲弬锛歿}", response.body());
- //淇濆瓨璇锋眰璁板綍
- saveErpRequestRecord("smj", request.toJSONString(), response.body());
- //鏇存柊鍚堝悓erp鎺ㄩ�佹爣璇�
- contract.setErpPushFlag("1");
- baseMapper.updateById(contract);
- }
- if (StrUtil.equals(contract.getPartyBId() + "", smjzt) && StrUtil.isNotEmpty(smjztErp)) {
- request.put("customerCode", customer.getErpCompanyCode());
- request.put("currencyId", "RMB");
- request.put("signDate", DateUtil.format(contract.getSignDate(), DatePattern.NORM_DATETIME_PATTERN));
- request.put("dateDeliver", DateUtil.format(contract.getExpirationDate(), DatePattern.NORM_DATETIME_PATTERN));
- request.put("moneySum", contract.getAmount());
- request.put("signManner", "闈㈢");
- request.put("salesman", "");
- request.put("tenantId", "tenant3");
- if (CollUtil.isNotEmpty(subjectMatterList)) {
- JSONArray subjectMatter = new JSONArray();
- subjectMatterList.stream().forEach(contractSubjectMatter -> {
- JSONObject subjectMatterItem = new JSONObject();
- subjectMatterItem.put("itemNo", contractSubjectMatter.getMaterialCode());
- subjectMatterItem.put("salePrice", contractSubjectMatter.getUnitPrice());
- subjectMatterItem.put("qtyRequired", contractSubjectMatter.getQuantity());
- subjectMatterItem.put("money", contractSubjectMatter.getQuantity().multiply(contractSubjectMatter.getUnitPrice()));
- Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getCompId, contract.getCompId())
- .eq(Product::getErpCode, contractSubjectMatter.getMaterialCode()));
- if (ObjUtil.isNotNull(product)) {
- subjectMatterItem.put("taxRate", new BigDecimal(product.getTaxRate()).divide(new BigDecimal("100")));
- }
- subjectMatterItem.put("dateDeliver", ObjUtil.isNotNull(contractSubjectMatter.getPlannedDeliveryDate()) ?
- DateUtil.format(contractSubjectMatter.getPlannedDeliveryDate(), DatePattern.NORM_DATETIME_PATTERN) :
- DateUtil.format(contract.getExpirationDate(), DatePattern.NORM_DATETIME_PATTERN));
- subjectMatter.add(subjectMatterItem);
- });
- request.put("details", subjectMatter);
- }
-
- String token = "";
- if (redisTemplate.hasKey("SMJ_ERP_TOKEN")) {
- token = (String) redisTemplate.opsForValue().get("SMJ_ERP_TOKEN");
- } else {
- token = getErpToken();
- }
- if (StrUtil.isEmpty(token)){
- log.error("鐭崇叅鏈虹櫥褰曡幏鍙杢oken澶辫触");
- return;
- }
-
- log.info("鐭崇叅鏈洪捇鎺㈠垎鍏徃鍚堝悓鎺ㄩ�乪rp鍏ュ弬锛歿}", request.toJSONString());
- HttpResponse response = HttpRequest.post(smjztErp + "/api/contract/v1/createWithDetails?tenantId=tenant3")
- .header("token", token) // 娣诲姞璁よ瘉澶�
- .header("Content-Type", "application/json") // 璁剧疆鍐呭绫诲瀷
- .body(request.toJSONString()) // 璁剧疆璇锋眰浣�
- .execute(); // 鎵ц璇锋眰.post(ymjErp,request.toJSONString());
- log.info("鐭崇叅鏈洪捇鎺㈠垎鍏徃鍚堝悓鎺ㄩ�乪rp鍥炲弬锛歿}", response.body());
- //淇濆瓨璇锋眰璁板綍
- saveErpRequestRecord("smj", request.toJSONString(), response.body());
- //鏇存柊鍚堝悓erp鎺ㄩ�佹爣璇�
- contract.setErpPushFlag("1");
- baseMapper.updateById(contract);
- }
- if (StrUtil.equals(contract.getPartyBId() + "", jxc) && StrUtil.isNotEmpty(jxcErp)) {
- log.info("鏈烘鍘傚悎鍚屾帹閫乪rp鍏ュ弬锛歿}", request.toJSONString());
- String result = HttpUtil.post(jxcErp, request.toJSONString());
- log.info("鏈烘鍘傚悎鍚屾帹閫乪rp鍥炲弬锛歿}", result);
- //淇濆瓨璇锋眰璁板綍
- saveErpRequestRecord("jxc", request.toJSONString(), result);
- //鏇存柊鍚堝悓erp鎺ㄩ�佹爣璇�
- contract.setErpPushFlag("1");
- baseMapper.updateById(contract);
- }
- if (StrUtil.equals(contract.getPartyBId() + "", tfgs) && StrUtil.isNotEmpty(tfgsErp)) {
- //閫氭柟鍏徃閫氳繃绯荤粺褰曞叆
- }
-
- } catch (Exception e) {
- e.printStackTrace();
+ subjectMatterItem.put("dateDeliver", ObjUtil.isNotNull(contractSubjectMatter.getPlannedDeliveryDate()) ?
+ DateUtil.format(contractSubjectMatter.getPlannedDeliveryDate(), DatePattern.NORM_DATETIME_PATTERN) :
+ DateUtil.format(contract.getExpirationDate(), DatePattern.NORM_DATETIME_PATTERN));
+ subjectMatter.add(subjectMatterItem);
+ });
+ request.put("details", subjectMatter);
}
- }).start();
+ String token = "";
+ if (redisTemplate.hasKey("YMJ_ERP_TOKEN")) {
+ token = (String) redisTemplate.opsForValue().get("YMJ_ERP_TOKEN");
+ } else {
+ token = getYmjErpToken();
+ }
+ if (StrUtil.isEmpty(token)) {
+ log.error("涓�鐓ゆ満鐧诲綍鑾峰彇token澶辫触");
+ return R.failed("涓�鐓ゆ満鐧诲綍鑾峰彇token澶辫触");
+ }
+ log.info("涓�鐓ゆ満鍚堝悓鎺ㄩ�乪rp鍏ュ弬锛歿}", request.toJSONString());
+ HttpResponse response = HttpRequest.post(ymjErp + "/api/contract-staging/v1/receive")
+ .header("token", token) // 娣诲姞璁よ瘉澶�
+ .header("Content-Type", "application/json") // 璁剧疆鍐呭绫诲瀷
+ .body(request.toJSONString()) // 璁剧疆璇锋眰浣�
+ .execute(); // 鎵ц璇锋眰.post(ymjErp,request.toJSONString());
+ log.info("涓�鐓ゆ満鍚堝悓鎺ㄩ�乪rp鍥炲弬锛歿}", response.body());
+ JSONObject res = JSONObject.parseObject(response.body());
+ if (res.getInteger("code")!=0){
+ return R.failed(res.getString("msg"));
+ }
+ //淇濆瓨璇锋眰璁板綍
+ saveErpRequestRecord("ymj", request.toJSONString(), response.body());
+ //鏇存柊鍚堝悓erp鎺ㄩ�佹爣璇�
+ contract.setErpPushFlag("1");
+ baseMapper.updateById(contract);
+ }
+ if ((StrUtil.equals(contract.getPartyBId() + "", smj) || StrUtil.equals(contract.getPartyBId() + "", smjhw)) && StrUtil.isNotEmpty(smjErp)) {
+ request.put("customerCode", customer.getErpCompanyCode());
+ request.put("currencyId", "RMB");
+ request.put("signDate", DateUtil.format(contract.getSignDate(), DatePattern.NORM_DATETIME_PATTERN));
+ request.put("dateDeliver", DateUtil.format(contract.getExpirationDate(), DatePattern.NORM_DATETIME_PATTERN));
+ request.put("moneySum", contract.getAmount());
+ request.put("signManner", "闈㈢");
+ request.put("salesman", "");
+ request.put("tenantId", "tenant1");
+ if (CollUtil.isNotEmpty(subjectMatterList)) {
+ JSONArray subjectMatter = new JSONArray();
+ subjectMatterList.stream().forEach(contractSubjectMatter -> {
+ JSONObject subjectMatterItem = new JSONObject();
+ subjectMatterItem.put("itemNo", contractSubjectMatter.getMaterialCode());
+ subjectMatterItem.put("salePrice", contractSubjectMatter.getUnitPrice());
+ subjectMatterItem.put("qtyRequired", contractSubjectMatter.getQuantity());
+ subjectMatterItem.put("money", contractSubjectMatter.getQuantity().multiply(contractSubjectMatter.getUnitPrice()));
+ Product product = null;
+ List<String> smjList = new ArrayList<>();
+ smjList.add(smj);
+ smjList.add(smjhw);
+ if (("" + SecurityUtils.getUser().getCompId()).equals(smj) || ("" + SecurityUtils.getUser().getCompId()).equals(smjhw)) {
+ product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, contractSubjectMatter.getMaterialCode())
+ .in(Product::getCompId, smjList).last("limit 1"));
+ } else {
+ product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, contractSubjectMatter.getMaterialCode())
+ .eq(Product::getCompId, SecurityUtils.getUser().getCompId()).last("limit 1"));
+ }
+ if (ObjUtil.isNotNull(product)) {
+ subjectMatterItem.put("taxRate", new BigDecimal(product.getTaxRate()).divide(new BigDecimal("100")));
+ }
+ subjectMatterItem.put("dateDeliver", ObjUtil.isNotNull(contractSubjectMatter.getPlannedDeliveryDate()) ?
+ DateUtil.format(contractSubjectMatter.getPlannedDeliveryDate(), DatePattern.NORM_DATETIME_PATTERN) :
+ DateUtil.format(contract.getExpirationDate(), DatePattern.NORM_DATETIME_PATTERN));
+ subjectMatter.add(subjectMatterItem);
+ });
+ request.put("details", subjectMatter);
+ }
+
+
+ String token = "";
+ if (redisTemplate.hasKey("SMJ_ERP_TOKEN")) {
+ token = (String) redisTemplate.opsForValue().get("SMJ_ERP_TOKEN");
+ } else {
+ token = getErpToken();
+ }
+ if (StrUtil.isEmpty(token)) {
+ log.error("鐭崇叅鏈虹櫥褰曡幏鍙杢oken澶辫触");
+ return R.failed("鐭崇叅鏈虹櫥褰曡幏鍙杢oken澶辫触");
+ }
+
+ log.info("鐭崇叅鏈哄悎鍚屾帹閫乪rp鍏ュ弬锛歿}", request.toJSONString());
+ HttpResponse response = HttpRequest.post(smjErp + "/api/contract/v1/createWithDetails?tenantId=tenant1")
+ .header("token", token) // 娣诲姞璁よ瘉澶�
+ .header("Content-Type", "application/json") // 璁剧疆鍐呭绫诲瀷
+ .body(request.toJSONString()) // 璁剧疆璇锋眰浣�
+ .execute(); // 鎵ц璇锋眰.post(ymjErp,request.toJSONString());
+ log.info("鐭崇叅鏈哄悎鍚屾帹閫乪rp鍥炲弬锛歿}", response.body());
+ JSONObject res = JSONObject.parseObject(response.body());
+ if (res.getInteger("code")!=0){
+ return R.failed(res.getString("msg"));
+ }
+ //淇濆瓨璇锋眰璁板綍
+ saveErpRequestRecord("smj", request.toJSONString(), response.body());
+ //鏇存柊鍚堝悓erp鎺ㄩ�佹爣璇�
+ contract.setErpPushFlag("1");
+ baseMapper.updateById(contract);
+ }
+ if (StrUtil.equals(contract.getPartyBId() + "", smjsc) && StrUtil.isNotEmpty(smjscErp)) {
+ request.put("customerCode", customer.getErpCompanyCode());
+ request.put("currencyId", "RMB");
+ request.put("signDate", DateUtil.format(contract.getSignDate(), DatePattern.NORM_DATETIME_PATTERN));
+ request.put("dateDeliver", DateUtil.format(contract.getExpirationDate(), DatePattern.NORM_DATETIME_PATTERN));
+ request.put("moneySum", contract.getAmount());
+ request.put("signManner", "闈㈢");
+ request.put("salesman", "");
+ request.put("tenantId", "tenant2");
+ if (CollUtil.isNotEmpty(subjectMatterList)) {
+ JSONArray subjectMatter = new JSONArray();
+ subjectMatterList.stream().forEach(contractSubjectMatter -> {
+ JSONObject subjectMatterItem = new JSONObject();
+ subjectMatterItem.put("itemNo", contractSubjectMatter.getMaterialCode());
+ subjectMatterItem.put("salePrice", contractSubjectMatter.getUnitPrice());
+ subjectMatterItem.put("qtyRequired", contractSubjectMatter.getQuantity());
+ subjectMatterItem.put("money", contractSubjectMatter.getQuantity().multiply(contractSubjectMatter.getUnitPrice()));
+ Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getCompId, contract.getCompId())
+ .eq(Product::getErpCode, contractSubjectMatter.getMaterialCode()));
+ if (ObjUtil.isNotNull(product)) {
+ subjectMatterItem.put("taxRate", new BigDecimal(product.getTaxRate()).divide(new BigDecimal("100")));
+ }
+ subjectMatterItem.put("dateDeliver", ObjUtil.isNotNull(contractSubjectMatter.getPlannedDeliveryDate()) ?
+ DateUtil.format(contractSubjectMatter.getPlannedDeliveryDate(), DatePattern.NORM_DATETIME_PATTERN) :
+ DateUtil.format(contract.getExpirationDate(), DatePattern.NORM_DATETIME_PATTERN));
+ subjectMatter.add(subjectMatterItem);
+ });
+ request.put("details", subjectMatter);
+ }
+
+ String token = "";
+ if (redisTemplate.hasKey("SMJ_ERP_TOKEN")) {
+ token = (String) redisTemplate.opsForValue().get("SMJ_ERP_TOKEN");
+ } else {
+ token = getErpToken();
+ }
+ if (StrUtil.isEmpty(token)) {
+ log.error("鐭崇叅鏈虹櫥褰曡幏鍙杢oken澶辫触");
+ return R.failed("鐭崇叅鏈虹櫥褰曡幏鍙杢oken澶辫触");
+ }
+
+ log.info("鐭崇叅鏈洪殢杞﹀垎鍏徃鍚堝悓鎺ㄩ�乪rp鍏ュ弬锛歿}", request.toJSONString());
+ HttpResponse response = HttpRequest.post(smjErp + "/api/contract/v1/createWithDetails?tenantId=tenant2")
+ .header("token", token) // 娣诲姞璁よ瘉澶�
+ .header("Content-Type", "application/json") // 璁剧疆鍐呭绫诲瀷
+ .body(request.toJSONString()) // 璁剧疆璇锋眰浣�
+ .execute(); // 鎵ц璇锋眰.post(ymjErp,request.toJSONString());
+ log.info("鐭崇叅鏈洪殢杞﹀垎鍏徃鍚堝悓鎺ㄩ�乪rp鍥炲弬锛歿}", response.body());
+ JSONObject res = JSONObject.parseObject(response.body());
+ if (res.getInteger("code")!=0){
+ return R.failed(res.getString("msg"));
+ }
+ //淇濆瓨璇锋眰璁板綍
+ saveErpRequestRecord("smj", request.toJSONString(), response.body());
+ //鏇存柊鍚堝悓erp鎺ㄩ�佹爣璇�
+ contract.setErpPushFlag("1");
+ baseMapper.updateById(contract);
+ }
+ if (StrUtil.equals(contract.getPartyBId() + "", smjzt) && StrUtil.isNotEmpty(smjztErp)) {
+ request.put("customerCode", customer.getErpCompanyCode());
+ request.put("currencyId", "RMB");
+ request.put("signDate", DateUtil.format(contract.getSignDate(), DatePattern.NORM_DATETIME_PATTERN));
+ request.put("dateDeliver", DateUtil.format(contract.getExpirationDate(), DatePattern.NORM_DATETIME_PATTERN));
+ request.put("moneySum", contract.getAmount());
+ request.put("signManner", "闈㈢");
+ request.put("salesman", "");
+ request.put("tenantId", "tenant3");
+ if (CollUtil.isNotEmpty(subjectMatterList)) {
+ JSONArray subjectMatter = new JSONArray();
+ subjectMatterList.stream().forEach(contractSubjectMatter -> {
+ JSONObject subjectMatterItem = new JSONObject();
+ subjectMatterItem.put("itemNo", contractSubjectMatter.getMaterialCode());
+ subjectMatterItem.put("salePrice", contractSubjectMatter.getUnitPrice());
+ subjectMatterItem.put("qtyRequired", contractSubjectMatter.getQuantity());
+ subjectMatterItem.put("money", contractSubjectMatter.getQuantity().multiply(contractSubjectMatter.getUnitPrice()));
+ Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getCompId, contract.getCompId())
+ .eq(Product::getErpCode, contractSubjectMatter.getMaterialCode()));
+ if (ObjUtil.isNotNull(product)) {
+ subjectMatterItem.put("taxRate", new BigDecimal(product.getTaxRate()).divide(new BigDecimal("100")));
+ }
+ subjectMatterItem.put("dateDeliver", ObjUtil.isNotNull(contractSubjectMatter.getPlannedDeliveryDate()) ?
+ DateUtil.format(contractSubjectMatter.getPlannedDeliveryDate(), DatePattern.NORM_DATETIME_PATTERN) :
+ DateUtil.format(contract.getExpirationDate(), DatePattern.NORM_DATETIME_PATTERN));
+ subjectMatter.add(subjectMatterItem);
+ });
+ request.put("details", subjectMatter);
+ }
+
+ String token = "";
+ if (redisTemplate.hasKey("SMJ_ERP_TOKEN")) {
+ token = (String) redisTemplate.opsForValue().get("SMJ_ERP_TOKEN");
+ } else {
+ token = getErpToken();
+ }
+ if (StrUtil.isEmpty(token)) {
+ log.error("鐭崇叅鏈虹櫥褰曡幏鍙杢oken澶辫触");
+ return R.failed("鐭崇叅鏈虹櫥褰曡幏鍙杢oken澶辫触");
+ }
+
+ log.info("鐭崇叅鏈洪捇鎺㈠垎鍏徃鍚堝悓鎺ㄩ�乪rp鍏ュ弬锛歿}", request.toJSONString());
+ HttpResponse response = HttpRequest.post(smjztErp + "/api/contract/v1/createWithDetails?tenantId=tenant3")
+ .header("token", token) // 娣诲姞璁よ瘉澶�
+ .header("Content-Type", "application/json") // 璁剧疆鍐呭绫诲瀷
+ .body(request.toJSONString()) // 璁剧疆璇锋眰浣�
+ .execute(); // 鎵ц璇锋眰.post(ymjErp,request.toJSONString());
+ log.info("鐭崇叅鏈洪捇鎺㈠垎鍏徃鍚堝悓鎺ㄩ�乪rp鍥炲弬锛歿}", response.body());
+ JSONObject res = JSONObject.parseObject(response.body());
+ if (res.getInteger("code")!=0){
+ return R.failed(res.getString("msg"));
+ }
+ //淇濆瓨璇锋眰璁板綍
+ saveErpRequestRecord("smj", request.toJSONString(), response.body());
+ //鏇存柊鍚堝悓erp鎺ㄩ�佹爣璇�
+ contract.setErpPushFlag("1");
+ baseMapper.updateById(contract);
+ }
+ if (StrUtil.equals(contract.getPartyBId() + "", jxc) && StrUtil.isNotEmpty(jxcErp)) {
+ log.info("鏈烘鍘傚悎鍚屾帹閫乪rp鍏ュ弬锛歿}", request.toJSONString());
+ String result = HttpUtil.post(jxcErp, request.toJSONString());
+ log.info("鏈烘鍘傚悎鍚屾帹閫乪rp鍥炲弬锛歿}", result);
+ //淇濆瓨璇锋眰璁板綍
+ saveErpRequestRecord("jxc", request.toJSONString(), result);
+ //鏇存柊鍚堝悓erp鎺ㄩ�佹爣璇�
+ contract.setErpPushFlag("1");
+ baseMapper.updateById(contract);
+ }
+ if (StrUtil.equals(contract.getPartyBId() + "", tfgs) && StrUtil.isNotEmpty(tfgsErp)) {
+ //閫氭柟鍏徃閫氳繃绯荤粺褰曞叆
+ }
+ return R.ok();
}
private String getErpToken() {
@@ -1007,14 +1045,14 @@
JSONObject respJson = JSONObject.parseObject(loginResp);
if (respJson.getInteger("code") == 0) {
JSONObject dataJson = JSONObject.parseObject(respJson.getString("data"));
- redisTemplate.opsForValue().set("SMJ_ERP_TOKEN",dataJson.getString("token"));
- log.info("鐭崇叅鏈篹rp token涓猴細{}",dataJson.getString("token"));
+ redisTemplate.opsForValue().set("SMJ_ERP_TOKEN", dataJson.getString("token"));
+ log.info("鐭崇叅鏈篹rp token涓猴細{}", dataJson.getString("token"));
return dataJson.getString("token");
}
return "";
}
- private String getYmjErpToken(){
+ private String getYmjErpToken() {
JSONObject loginJson = new JSONObject();
loginJson.put("username", "admin");
loginJson.put("password", "admin123");
@@ -1024,14 +1062,14 @@
JSONObject respJson = JSONObject.parseObject(loginResp);
if (respJson.getInteger("code") == 0) {
JSONObject dataJson = JSONObject.parseObject(respJson.getString("data"));
- redisTemplate.opsForValue().set("YMJ_ERP_TOKEN",dataJson.getString("token"));
- log.info("涓�鐓ゆ満erp token涓猴細{}",dataJson.getString("token"));
+ redisTemplate.opsForValue().set("YMJ_ERP_TOKEN", dataJson.getString("token"));
+ log.info("涓�鐓ゆ満erp token涓猴細{}", dataJson.getString("token"));
return dataJson.getString("token");
}
return "";
}
- private void saveScheduleProcess(Contract contract,ContractPaymentSchedule schedule) {
+ private void saveScheduleProcess(Contract contract, ContractPaymentSchedule schedule) {
//鏂板鍚堝悓灞ョ害璁板綍
ContractPaymentScheduleProcess process = new ContractPaymentScheduleProcess();
process.setContractId(contract.getId());
@@ -1167,14 +1205,14 @@
private void savePaymentConfirm(Contract contract) {
ContractPaymentSchedule fitstSchedule = contractPaymentScheduleMapper.selectOne(Wrappers.<ContractPaymentSchedule>lambdaQuery()
.eq(ContractPaymentSchedule::getContractId, contract.getId())
- .eq(ContractPaymentSchedule::getStageName,"鍚堝悓绛捐")
+ .eq(ContractPaymentSchedule::getStageName, "鍚堝悓绛捐")
.last("limit 1"));
- fitstSchedule.setEffectiveEndDate(DateUtil.offsetDay(contract.getSignDate(),fitstSchedule.getAgreedDays()));
+ fitstSchedule.setEffectiveEndDate(DateUtil.offsetDay(contract.getSignDate(), fitstSchedule.getAgreedDays()));
contractPaymentScheduleMapper.updateById(fitstSchedule);
//鎶ラ敊灞ョ害璁板綍
- saveScheduleProcess(contract,fitstSchedule);
+ saveScheduleProcess(contract, fitstSchedule);
//淇濆瓨璧勯噾鏄庣粏
- if (fitstSchedule.getPaymentRatio().compareTo(new BigDecimal("0"))>0) {
+ if (fitstSchedule.getPaymentRatio().compareTo(new BigDecimal("0")) > 0) {
//鏂板搴旀敹
PaymentConfirm currentConfim = new PaymentConfirm();
currentConfim.setBusinessType(fitstSchedule.getStageName() + "搴旀敹");
@@ -1200,7 +1238,7 @@
currentConfim.setTotalAmount(currentConfim.getTransationAmount().multiply(new BigDecimal("-1")));
currentConfim.setCompId(contract.getCompId());
paymentConfirmMapper.insert(currentConfim);
- processService.handleBeforeRemain(currentConfim,contract);
+ processService.handleBeforeRemain(currentConfim, contract);
}
}
@@ -1291,7 +1329,7 @@
newContract.setContractStatus(0);
newContract.setBillingAmout(new BigDecimal("0"));
if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) ||
- StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)||
+ StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt) ||
StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) {
newContract.setContractNo(generateSMJContractNo());
}
@@ -1939,8 +1977,8 @@
if (CollUtil.isEmpty(addDTO.getContractSubjectMatter())) {
return R.failed("璇锋坊鍔犳爣鐨勭墿");
}
- if (addDTO.getContractSubjectMatter().stream().anyMatch(contractSubjectMatterAddDTO -> StrUtil.isBlank(contractSubjectMatterAddDTO.getDataId())&&
- StrUtil.isBlank(contractSubjectMatterAddDTO.getMaterialCode()))){
+ if (addDTO.getContractSubjectMatter().stream().anyMatch(contractSubjectMatterAddDTO -> StrUtil.isBlank(contractSubjectMatterAddDTO.getDataId()) &&
+ StrUtil.isBlank(contractSubjectMatterAddDTO.getMaterialCode()))) {
return R.failed("鏍囩殑鐗╃殑dataId鍜宮aterialCode涓嶈兘鍚屾椂涓虹┖");
}
if (CollUtil.isEmpty(addDTO.getContractPaymentSchedule())) {
@@ -1958,11 +1996,11 @@
contract.setPartyBId(SecurityUtils.getUser().getCompId());
contract.setPartyB(SecurityUtils.getUser().getCompName());
contract.setContractStatus(2);
- contract.setPaidAmount(new BigDecimal("0"));
+ contract.setPaidAmount(ObjUtil.isNotNull(addDTO.getPaidAmount())?addDTO.getPaidAmount():new BigDecimal("0"));
contract.setBillingStatus("1");
contract.setErpPushFlag("1");
contract.setCenterPushFlag("0");
- contract.setBillingAmout(new BigDecimal("0"));
+ contract.setBillingAmout(ObjUtil.isNotNull(addDTO.getBillingAmout())?addDTO.getBillingAmout():new BigDecimal("0"));
BusinessCustomer bc = businessCustomerMapper.selectOne(Wrappers.<BusinessCustomer>lambdaQuery().eq(BusinessCustomer::getErpCompanyCode,
addDTO.getPartyACode()).last("limit 1"));
@@ -1997,21 +2035,30 @@
addDTO.getContractSubjectMatter().stream().forEach(contractSubjectMatterAddDTO -> {
ContractSubjectMatter subjectMatter = BeanUtil.copyProperties(contractSubjectMatterAddDTO, ContractSubjectMatter.class);
subjectMatter.setContractId(contract.getId());
- Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode,subjectMatter.getMaterialCode())
- .last("limit 1"));
- if (ObjUtil.isNull(product)){
- product = new Product();
- product.setParentId(2101559148831944705L);
- product.setProductName(subjectMatter.getMaterialInternalName());
- product.setErpCode(subjectMatter.getMaterialCode());
- product.setProductType(subjectMatter.getSpecification());
- product.setTaxCode("1090117040000000000");
- product.setTaxClass("娉�");
- productMapper.insert(product);
- subjectMatter.setMaterialInternalName(product.getId()+"");
- }
+// Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, subjectMatter.getMaterialCode())
+// .last("limit 1"));
+// if (ObjUtil.isNull(product)) {
+// product = new Product();
+// product.setParentId(2101559148831944705L);
+// product.setProductName(subjectMatter.getMaterialInternalName());
+// product.setErpCode(subjectMatter.getMaterialCode());
+// product.setProductType(subjectMatter.getSpecification());
+// product.setTaxCode("1090117040000000000");
+// product.setTaxClass("娉�");
+// productMapper.insert(product);
+// subjectMatter.setMaterialInternalName(product.getId() + "");
+// }
subjectMatter.setDeliveredQuantity(new BigDecimal("0"));
subjectMatter.setDeliveryStatus(0);
+ if(ObjUtil.isNotNull(subjectMatter.getDeliveredQuantity())&&subjectMatter.getDeliveredQuantity().compareTo(new BigDecimal("0"))>0){
+ subjectMatter.setRemainingQuantity(subjectMatter.getQuantity().subtract(subjectMatter.getDeliveredQuantity()));
+ if (subjectMatter.getRemainingQuantity().compareTo(new BigDecimal("0"))==0){
+ subjectMatter.setDeliveryStatus(2);
+ }
+ if (subjectMatter.getRemainingQuantity().compareTo(new BigDecimal("0"))>0){
+ subjectMatter.setDeliveryStatus(1);
+ }
+ }
subjectMatter.setTotalAmount(contractSubjectMatterAddDTO.getQuantity().multiply(contractSubjectMatterAddDTO.getUnitPrice()));
contractSubjectMatterMapper.insert(subjectMatter);
//姘寸數绫诲繀椤绘湁鍒濇琛ㄥ彿
@@ -2083,8 +2130,8 @@
if (CollUtil.isEmpty(updateDTO.getContractSubjectMatter())) {
return R.failed("璇锋坊鍔犳爣鐨勭墿");
}
- if (updateDTO.getContractSubjectMatter().stream().anyMatch(contractSubjectMatterAddDTO -> StrUtil.isBlank(contractSubjectMatterAddDTO.getDataId())&&
- StrUtil.isBlank(contractSubjectMatterAddDTO.getMaterialCode()))){
+ if (updateDTO.getContractSubjectMatter().stream().anyMatch(contractSubjectMatterAddDTO -> StrUtil.isBlank(contractSubjectMatterAddDTO.getDataId()) &&
+ StrUtil.isBlank(contractSubjectMatterAddDTO.getMaterialCode()))) {
return R.failed("鏍囩殑鐗╃殑dataId鍜宮aterialCode涓嶈兘鍚屾椂涓虹┖");
}
if (CollUtil.isEmpty(updateDTO.getContractPaymentSchedule())) {
@@ -2130,6 +2177,15 @@
subjectMatter.setDeliveredQuantity(new BigDecimal("0"));
subjectMatter.setDeliveryStatus(0);
+ if(ObjUtil.isNotNull(subjectMatter.getDeliveredQuantity())&&subjectMatter.getDeliveredQuantity().compareTo(new BigDecimal("0"))>0){
+ subjectMatter.setRemainingQuantity(subjectMatter.getQuantity().subtract(subjectMatter.getDeliveredQuantity()));
+ if (subjectMatter.getRemainingQuantity().compareTo(new BigDecimal("0"))==0){
+ subjectMatter.setDeliveryStatus(2);
+ }
+ if (subjectMatter.getRemainingQuantity().compareTo(new BigDecimal("0"))>0){
+ subjectMatter.setDeliveryStatus(1);
+ }
+ }
contractSubjectMatterMapper.insert(subjectMatter);
//姘寸數绫诲繀椤绘湁鍒濇琛ㄥ彿
if (StrUtil.isNotEmpty(contractSubjectMatterAddDTO.getMeterReadCode()) &&
@@ -2318,7 +2374,7 @@
// 4. 鏍煎紡鍖栧簭鍒楀彿锛屼笉瓒�6浣嶅墠琛�0
String seqStr = String.format("%04d", sequence);
// 5. 鎷兼帴杩斿洖
- return mainNo +"-"+ seqStr;
+ return mainNo + "-" + seqStr;
}
@Override
@@ -2601,7 +2657,7 @@
contract.setNickName(SecurityUtils.getUser().getNickname());
if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) ||
- StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)||
+ StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt) ||
StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) {
contract.setContractNo(generateSMJContractNo());
}
@@ -2628,19 +2684,19 @@
contract.setSelectionMethod(dto.getSelectionMethod());
contract.setIsRelated(dto.getIsRelated());
contract.setContractCreater(dto.getContractCreater());
- if(StrUtil.isNotBlank(dto.getAttachmentUrl())) {
+ if (StrUtil.isNotBlank(dto.getAttachmentUrl())) {
contract.setAttachmentName(dto.getAttachmentName());
contract.setAttachmentUrl(dto.getAttachmentUrl());
}
baseMapper.updateById(contract);
BusinessCustomer customer = businessCustomerMapper.selectById(contract.getPartyAId());
- if (ObjUtil.isNull(customer)){
+ if (ObjUtil.isNull(customer)) {
return R.failed("瀹㈡埛鏌ヨ寮傚父");
}
R<SysDept> r = remoteDeptService.getById(SecurityUtils.getUser().getCompId());
- if (!r.isOk()){
+ if (!r.isOk()) {
return R.failed("淇℃伅鏌ヨ寮傚父");
}
SysDept comp = r.getData();
@@ -2655,13 +2711,20 @@
requestApply.put("fd_MainContent", "");
requestApply.put("fd_settlementType", "00");
requestApply.put("fd_applyType", "澶栭攢");
+ if (contract.getAmount().compareTo(new BigDecimal("0"))==0){
+ requestApply.put("fd_agr_property","1");
+ }
requestApply.put("fd_contractSubject ", subjectMatterList.stream().map(item -> item.getMaterialName()).collect(Collectors.joining(",")));
requestApply.put("fd_docNumber", contract.getContractNo());
if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) ||
- StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)||
+ StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt) ||
StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) {
- requestApply.put("fd_templateId", tempSMJ);
+ if (contract.getContractCategory().equals("his_no_center")){
+ requestApply.put("fd_templateId", "1a03828a8ff2b476af7805f45a88a2ed");
+ }else {
+ requestApply.put("fd_templateId", tempSMJ);
+ }
}
if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", sgb)) {
requestApply.put("fd_templateId", tempSGB);
@@ -2678,7 +2741,7 @@
requestApply.put("fd_name", contract.getContractName());
requestApply.put("fd_signDate", DateUtil.formatDate(contract.getSignDate()));
requestApply.put("fd_endDate", DateUtil.formatDate(contract.getExpirationDate()));
- requestApply.put("fd_contractCreater", StrUtil.isNotEmpty(dto.getContractCreater())?dto.getContractCreater():SecurityUtils.getUser().getNickname());
+ requestApply.put("fd_contractCreater", StrUtil.isNotEmpty(dto.getContractCreater()) ? dto.getContractCreater() : SecurityUtils.getUser().getNickname());
requestApply.put("fd_currency", "浜烘皯甯�");
requestApply.put("fd_ContractAmount", contract.getAmount());
requestApply.put("fd_finAmount", contract.getAmount().divide(new BigDecimal("113"), 2, RoundingMode.HALF_UP)
@@ -2689,49 +2752,49 @@
requestApply.put("fd_systemSource", "闈炵叅閿�鍞郴缁�");
requestApply.put("fd_type", "00");
requestApply.put("fd_baozhangren", comp.getBaozhangren());
- requestApply.put("fd_summary",contract.getSummary());
+ requestApply.put("fd_summary", contract.getSummary());
JSONArray signList = new JSONArray();
JSONObject j = new JSONObject();
- j.put("fd_standing","鐢�");
- j.put("fd_Iden",customer.getCreditCode());
- j.put("fd_signMain","2");
+ j.put("fd_standing", "鐢�");
+ j.put("fd_Iden", customer.getCreditCode());
+ j.put("fd_signMain", "2");
signList.add(j);
JSONObject y = new JSONObject();
- y.put("fd_standing","涔�");
- y.put("fd_Iden",comp.getOrgCode());
- y.put("fd_signMain","1");
+ y.put("fd_standing", "涔�");
+ y.put("fd_Iden", comp.getOrgCode());
+ y.put("fd_signMain", "1");
signList.add(y);
requestApply.put("fd_signList", signList);
- if(StrUtil.isNotBlank(contract.getAttachmentUrl())){
+ if (StrUtil.isNotBlank(contract.getAttachmentUrl())) {
JSONArray attList = new JSONArray();
JSONObject att = new JSONObject();
- att.put("fd_attNum","1");
- att.put("fd_attName",contract.getAttachmentName());
- att.put("fd_attQuality","00");
- att.put("fd_attcontent",NetworkFileToBase64.convertNetworkFileToBase64("https://zbjt.res.jzeg.cn/api" + contract.getAttachmentUrl()));
+ att.put("fd_attNum", "1");
+ att.put("fd_attName", contract.getAttachmentName());
+ att.put("fd_attQuality", "00");
+ att.put("fd_attcontent", NetworkFileToBase64.convertNetworkFileToBase64("https://zbjt.res.jzeg.cn/api" + contract.getAttachmentUrl()));
attList.add(att);
requestApply.put("attList", att);
}
- if (CollUtil.isNotEmpty(subjectMatterList)){
+ if (CollUtil.isNotEmpty(subjectMatterList)) {
JSONArray materialList = new JSONArray();
- subjectMatterList.stream().forEach(subjectMatter->{
+ subjectMatterList.stream().forEach(subjectMatter -> {
JSONObject material = new JSONObject();
material.put("fd_materiaCode", subjectMatter.getMaterialCode());
material.put("fd_materiaName", subjectMatter.getMaterialInternalName());
- material.put("fd_specification", StrUtil.isNotBlank(subjectMatter.getSpecification())?subjectMatter.getSpecification():"");
+ material.put("fd_specification", StrUtil.isNotBlank(subjectMatter.getSpecification()) ? subjectMatter.getSpecification() : "");
material.put("fd_figureNumber", "");
material.put("fd_measureUnit", subjectMatter.getUnit());
material.put("fd_number", subjectMatter.getQuantity());
material.put("fd_price", subjectMatter.getUnitPrice());
- Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode,subjectMatter.getMaterialCode()).last("limit 1"));
- if (ObjUtil.isNotNull(product)){
+ Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, subjectMatter.getMaterialCode()).last("limit 1"));
+ if (ObjUtil.isNotNull(product)) {
material.put("fd_rate", product.getTaxRate().toString());
}
material.put("fd_amount", subjectMatter.getUnitPrice().multiply(subjectMatter.getQuantity()));
material.put("fd_requirements", "");
material.put("fd_standard", "");
material.put("fd_factory", "");
- material.put("fd_Deadlines", ObjUtil.isNotNull(subjectMatter.getPlannedDeliveryDate())?subjectMatter.getPlannedDeliveryDate():"");
+ material.put("fd_Deadlines", ObjUtil.isNotNull(subjectMatter.getPlannedDeliveryDate()) ? subjectMatter.getPlannedDeliveryDate() : "");
material.put("fd_delivery", "");
material.put("fd_des", "");
materialList.add(material);
@@ -2749,8 +2812,8 @@
takeEffect(contract.getId());
return R.ok();
}
- log.error("宸ヤ笟娉垫帹閫佲�斺�旀帹閫佸悎鍚屼腑蹇冨鏍稿け璐ワ紝鍘熷洜涓猴細{}",applyResp.getString("msg"));
- return R.failed("宸ヤ笟娉垫帹閫佲�斺�旀帹閫佸悎鍚屼腑蹇冨鏍稿け璐ワ紝鍘熷洜涓猴細{}",applyResp.getString("msg"));
+ log.error("宸ヤ笟娉垫帹閫佲�斺�旀帹閫佸悎鍚屼腑蹇冨鏍稿け璐ワ紝鍘熷洜涓猴細{}", applyResp.getString("msg"));
+ return R.failed("宸ヤ笟娉垫帹閫佲�斺�旀帹閫佸悎鍚屼腑蹇冨鏍稿け璐ワ紝鍘熷洜涓猴細{}", applyResp.getString("msg"));
}
@Override
@@ -2815,21 +2878,20 @@
continue;
}
BusinessCustomer bc = null;
- if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc)
- || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)|| StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)){
+ if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) {
List<String> smjList = new ArrayList<>();
smjList.add(smj);
- smjList.add(smjsc);
- smjList.add(smjzt);
+// smjList.add(smjsc);
+// smjList.add(smjzt);
smjList.add(smjhw);
bc = businessCustomerMapper.selectOne(Wrappers.<BusinessCustomer>lambdaQuery()
.eq(BusinessCustomer::getCompanyName, contractExceVO.getBcErpCode())
.in(BusinessCustomer::getCompId, smjList)
.last("limit 1"));
- }else {
+ } else {
bc = businessCustomerMapper.selectOne(Wrappers.<BusinessCustomer>lambdaQuery()
.eq(BusinessCustomer::getCompanyName, contractExceVO.getBcErpCode())
- .eq(BusinessCustomer::getCompId,SecurityUtils.getUser().getCompId())
+ .eq(BusinessCustomer::getCompId, SecurityUtils.getUser().getCompId())
.last("limit 1"));
}
@@ -2909,20 +2971,20 @@
contract.setBillingAmout(ObjUtil.isNotNull(contract.getBillingAmout()) ?
contract.getBillingAmout() : new BigDecimal("0"));
- if (contract.getPaidAmount().compareTo(contract.getAmount())==0&&contract.getBillingAmout().compareTo(contract.getAmount())==0){
+ if (contract.getPaidAmount().compareTo(contract.getAmount()) == 0 && contract.getBillingAmout().compareTo(contract.getAmount()) == 0) {
contract.setContractStatus(3);
}
contract.setBillingStatus("1");
baseMapper.insert(contract);
BigDecimal remainAmount = ObjUtil.isNotNull(contract.getPaidAmount()) ? contract.getPaidAmount() : new BigDecimal("0");
List<ContractSubjectMatterExceVO> resultMatter = matterList.stream().filter(item ->
- StrUtil.equals(item.getContractNo(), contract.getContractNo())).collect(Collectors.toList());
+ StrUtil.equals(item.getContractNo(), contract.getContractNo())).collect(Collectors.toList());
if (CollUtil.isNotEmpty(resultMatter)) {
- log.info("鍚堝悓缂栧彿锛歿},鏍囩殑鐗╀釜鏁�:{}",contract.getContractNo(),resultMatter.size());
+ log.info("鍚堝悓缂栧彿锛歿},鏍囩殑鐗╀釜鏁�:{}", contract.getContractNo(), resultMatter.size());
for (ContractSubjectMatterExceVO subMatEx : resultMatter
) {
- if (StrUtil.isBlank(subMatEx.getDataId())&&StrUtil.isBlank(subMatEx.getMaterialCode())){
- log.error("鍚堝悓缂栧彿锛歿},鏍囩殑鐗�:{}鏍囩殑鐗ヾataId鍜宮aterialCode鍚屾椂涓虹┖",contract.getContractNo(),subMatEx.getMaterialName());
+ if (StrUtil.isBlank(subMatEx.getDataId()) && StrUtil.isBlank(subMatEx.getMaterialCode())) {
+ log.error("鍚堝悓缂栧彿锛歿},鏍囩殑鐗�:{}鏍囩殑鐗ヾataId鍜宮aterialCode鍚屾椂涓虹┖", contract.getContractNo(), subMatEx.getMaterialName());
continue;
}
ContractSubjectMatter subjectMatter = BeanUtil.copyProperties(subMatEx, ContractSubjectMatter.class);
@@ -2935,7 +2997,7 @@
subjectMatter.setLineNo(ItemGeneratorUtil.nextId());
contractSubjectMatterMapper.insert(subjectMatter);
if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) ||
- StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)||
+ StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt) ||
StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) {
if (StrUtil.isBlank(subMatEx.getMaterialCode())) {
handleProduct(subMatEx.getMaterialCode());
@@ -2971,7 +3033,12 @@
schedule.setActualAmount(schedule.getPlannedAmount().add(remainAmount));
}
}
- contractPaymentScheduleMapper.insert(schedule);
+ ContractPaymentSchedule paymentSchedule = contractPaymentScheduleMapper.selectOne(Wrappers.<ContractPaymentSchedule>lambdaQuery()
+ .eq(ContractPaymentSchedule::getContractId,contract.getId())
+ .eq(ContractPaymentSchedule::getStageName,schedule.getStageName()).last("limit 1"));
+ if (ObjUtil.isNull(paymentSchedule)) {
+ contractPaymentScheduleMapper.insert(schedule);
+ }
// if (schedule.getStageName().equals("璐ㄤ繚閲�") && contract.getAmount().subtract(ObjUtil.isNotNull(contract.getPaidAmount()) ?
// contract.getPaidAmount() : new BigDecimal("0")).compareTo(new BigDecimal("0")) > 0) {
// PaymentConfirm confirm = new PaymentConfirm();
@@ -3155,29 +3222,29 @@
@Override
public R subjectChange(ContractSubjectChangeDTO changeDTO) {
Contract contract = baseMapper.selectById(changeDTO.getId());
- if (ObjUtil.isNull(contract)){
+ if (ObjUtil.isNull(contract)) {
return R.failed("鍚堝悓鐘舵�佸紓甯�");
}
- if (contract.getBillingAmout().compareTo(new BigDecimal("0"))>0){
+ if (contract.getBillingAmout().compareTo(new BigDecimal("0")) > 0) {
return R.failed("鍚堝悓宸插紑绁紝涓嶈兘杩涜鍙樻洿");
}
- if (ObjUtil.isNotNull(contract.getOutBoundAmout())&&contract.getOutBoundAmout().compareTo(new BigDecimal("0"))>0){
+ if (ObjUtil.isNotNull(contract.getOutBoundAmout()) && contract.getOutBoundAmout().compareTo(new BigDecimal("0")) > 0) {
return R.failed("鍚堝悓鏍囩殑鐗╁凡鍑哄簱锛屼笉鑳借繘琛屽彉鏇�");
}
- if (CollUtil.isEmpty(changeDTO.getContractSubjectMatter())){
+ if (CollUtil.isEmpty(changeDTO.getContractSubjectMatter())) {
return R.failed("鍚堝悓鍙樻洿鍚庢爣鐨勭墿涓嶈兘涓虹┖");
}
- BigDecimal changeAmount = changeDTO.getContractSubjectMatter().stream().map(subject->subject.getUnitPrice().multiply(subject.getQuantity())).reduce(BigDecimal.ZERO,BigDecimal::add);
- if (contract.getAmount().compareTo(changeAmount)!=0){
+ BigDecimal changeAmount = changeDTO.getContractSubjectMatter().stream().map(subject -> subject.getUnitPrice().multiply(subject.getQuantity())).reduce(BigDecimal.ZERO, BigDecimal::add);
+ if (contract.getAmount().compareTo(changeAmount) != 0) {
return R.failed("鍚堝悓鍙樻洿鍚庢爣鐨勭墿鎬讳环蹇呴』涓庡悎鍚屾�讳环涓�鑷�");
}
- List<ContractSubjectMatter> beforeList = contractSubjectMatterMapper.selectList(Wrappers.<ContractSubjectMatter>lambdaQuery().eq(ContractSubjectMatter::getContractId,changeDTO.getId()));
+ List<ContractSubjectMatter> beforeList = contractSubjectMatterMapper.selectList(Wrappers.<ContractSubjectMatter>lambdaQuery().eq(ContractSubjectMatter::getContractId, changeDTO.getId()));
ContractSubjectMatterChange change = new ContractSubjectMatterChange();
change.setContractId(contract.getId());
change.setBeforeChange(JSONObject.toJSONString(beforeList));
change.setAfterChange(JSONObject.toJSONString(changeDTO.getContractSubjectMatter()));
changeMapper.insert(change);
- contractSubjectMatterMapper.delete(Wrappers.<ContractSubjectMatter>lambdaQuery().eq(ContractSubjectMatter::getContractId,changeDTO.getId()));
+ contractSubjectMatterMapper.delete(Wrappers.<ContractSubjectMatter>lambdaQuery().eq(ContractSubjectMatter::getContractId, changeDTO.getId()));
changeDTO.getContractSubjectMatter().stream().forEach(contractSubjectMatterAddDTO -> {
ContractSubjectMatter subjectMatter = BeanUtil.copyProperties(contractSubjectMatterAddDTO, ContractSubjectMatter.class);
subjectMatter.setContractId(contract.getId());
@@ -3192,7 +3259,7 @@
@Override
public Page subjectChangePage(Page page, ContracQueryDTO queryDTO) {
- return changeMapper.subjectChangePage(page,queryDTO,DataScope.of("comp_id"));
+ return changeMapper.subjectChangePage(page, queryDTO, DataScope.of("comp_id"));
}
@Override
@@ -3206,17 +3273,17 @@
@Override
public R syncContractStatus(SyncContractStatusDTO dto) {
- if (StrUtil.isBlank(dto.getFd_bizId())){
+ if (StrUtil.isBlank(dto.getFd_bizId())) {
return R.failed("鏁版嵁ID涓嶈兘涓虹┖");
}
- log.info("鍚堝悓瀹℃壒缁撴灉鍚屾锛屽悎鍚屾暟鎹甀D:{}锛屽鎵圭粨鏋滐細{}",dto.getFd_bizId(),dto.getStatus());
- if (StrUtil.isBlank(dto.getStatus())){
+ log.info("鍚堝悓瀹℃壒缁撴灉鍚屾锛屽悎鍚屾暟鎹甀D:{}锛屽鎵圭粨鏋滐細{}", dto.getFd_bizId(), dto.getStatus());
+ if (StrUtil.isBlank(dto.getStatus())) {
return R.failed("瀹℃壒鐘舵�佷笉鑳戒负绌�");
}
- if (StrUtil.isBlank(dto.getReturnPerson())){
+ if (StrUtil.isBlank(dto.getReturnPerson())) {
return R.failed("瀹℃壒浜轰笉鑳戒负绌�");
}
- if (StrUtil.isBlank(dto.getReturnDate())){
+ if (StrUtil.isBlank(dto.getReturnDate())) {
return R.failed("瀹℃壒鏃堕棿涓嶈兘涓虹┖");
}
Contract contract = baseMapper.selectById(dto.getFd_bizId());
@@ -3227,27 +3294,27 @@
if (StrUtil.equals(dto.getStatus(), "1")) {
new Thread(() -> {
takeEffect(contract.getId());
- saveContractApproval(contract,dto);
+ saveContractApproval(contract, dto);
}).start();
}
if (StrUtil.equals(dto.getStatus(), "2")) {
new Thread(() -> {
refuseApproval(contract.getId());
- saveContractApproval(contract,dto);
+ saveContractApproval(contract, dto);
}).start();
}
if (StrUtil.equals(dto.getStatus(), "3") || StrUtil.equals(dto.getStatus(), "4")) {
new Thread(() -> {
- contract.setContractStatus(3);
+ contract.setContractStatus(4);
baseMapper.updateById(contract);
- saveContractApproval(contract,dto);
+ saveContractApproval(contract, dto);
}).start();
}
return R.ok();
}
private void saveContractApproval(Contract contract, SyncContractStatusDTO dto) {
- ContractApproval approval = BeanUtil.copyProperties(dto,ContractApproval.class);
+ ContractApproval approval = BeanUtil.copyProperties(dto, ContractApproval.class);
approval.setContractId(contract.getId());
approval.setReturnDateTime(DateUtil.parseDateTime(dto.getReturnDate()));
approval.setCompId(contract.getCompId());
@@ -3257,10 +3324,10 @@
@Override
public R finallyPdf(ContractFinallyDTO attDTO) {
Contract contract = baseMapper.selectById(attDTO.getId());
- if (ObjUtil.isNull(contract)){
+ if (ObjUtil.isNull(contract)) {
return R.failed("鍚堝悓寮傚父");
}
- if (!StrUtil.equals(contract.getContractStatus()+"","2")){
+ if (!StrUtil.equals(contract.getContractStatus() + "", "2")) {
return R.failed("鍚堝悓寮傚父鐘舵��");
}
contract.setSignDate(attDTO.getSignDate());
@@ -3271,24 +3338,24 @@
contract.setLinkPhone(attDTO.getLinkPhone());
contract.setLastAttachmentName(attDTO.getLastAttachmentName());
contract.setLastAttachmentUrl(attDTO.getLastAttachmentUrl());
- Long betweenDay = DateUtil.betweenDay(attDTO.getExpirationDate(),attDTO.getSignDate(),true);
+ Long betweenDay = DateUtil.betweenDay(attDTO.getExpirationDate(), attDTO.getSignDate(), true);
contract.setDeliveryCycle(betweenDay.intValue());
baseMapper.updateById(contract);
JSONObject request = new JSONObject();
request.put("fd_docNumber", contract.getContractNo());
- request.put("fd_singer", StrUtil.isNotEmpty(attDTO.getSinger())?attDTO.getSinger():SecurityUtils.getUser().getNickname());
+ request.put("fd_singer", StrUtil.isNotEmpty(attDTO.getSinger()) ? attDTO.getSinger() : SecurityUtils.getUser().getNickname());
request.put("fd_signTime", DateUtil.formatDate(contract.getSignDate()));
- request.put("fd_linkPerson", StrUtil.isNotEmpty(attDTO.getLinkPerson())?attDTO.getLinkPerson():"");
- request.put("fd_linkPhone", StrUtil.isNotEmpty(attDTO.getLinkPhone())?attDTO.getLinkPhone():"");
+ request.put("fd_linkPerson", StrUtil.isNotEmpty(attDTO.getLinkPerson()) ? attDTO.getLinkPerson() : "");
+ request.put("fd_linkPhone", StrUtil.isNotEmpty(attDTO.getLinkPhone()) ? attDTO.getLinkPhone() : "");
request.put("fd_address", contract.getSignPlace());
request.put("fd_receivedTime", DateUtil.format(contract.getCreateTime(), DatePattern.NORM_DATETIME_PATTERN));
request.put("fd_receivedNum", 1);
request.put("fd_effedate", DateUtil.formatDate(contract.getSignDate()));
request.put("fd_enddate", DateUtil.formatDate(contract.getExpirationDate()));
- request.put("fd_reviewerNo", StrUtil.isNotEmpty(attDTO.getReviewerNo())?attDTO.getReviewerNo():SecurityUtils.getUser().getNickname());
+ request.put("fd_reviewerNo", StrUtil.isNotEmpty(attDTO.getReviewerNo()) ? attDTO.getReviewerNo() : SecurityUtils.getUser().getNickname());
request.put("fd_docStatus", "20");
if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) ||
- StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)||
+ StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt) ||
StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) {
request.put("fd_templateId", tempSMJ);
}
@@ -3313,7 +3380,7 @@
if (respJson.getString("code").equals("00")) {
return R.ok();
}
- return R.failed("鍚堝悓涓績鏈�缁堢洊绔犵櫥璁癙DF涓婁紶澶辫触,鍘熷洜涓�:{}",respJson.getString("msg"));
+ return R.failed("鍚堝悓涓績鏈�缁堢洊绔犵櫥璁癙DF涓婁紶澶辫触,鍘熷洜涓�:{}", respJson.getString("msg"));
}
@@ -3446,9 +3513,9 @@
@Override
public R addContractHis(ContractAddDTO addDTO) {
- Contract contract1 = baseMapper.selectOne(Wrappers.<Contract>lambdaQuery().eq(Contract::getContractNo,addDTO.getContractNo())
+ Contract contract1 = baseMapper.selectOne(Wrappers.<Contract>lambdaQuery().eq(Contract::getContractNo, addDTO.getContractNo())
.last("limit 1"));
- if (ObjUtil.isNotNull(contract1)){
+ if (ObjUtil.isNotNull(contract1)) {
return R.failed("鍚堝悓缂栧彿宸插瓨鍦�");
}
Contract contract = BeanUtil.copyProperties(addDTO, Contract.class);
@@ -3494,8 +3561,8 @@
contractSubjectMatterMapper.insert(subjectMatter);
});
List<ContractSubjectMatter> subjectMatterList = contractSubjectMatterMapper.selectList(Wrappers.<ContractSubjectMatter>lambdaQuery()
- .eq(ContractSubjectMatter::getContractId,contract.getId()).ne(ContractSubjectMatter::getDeliveryStatus,2));
- if (CollUtil.isEmpty(subjectMatterList)){
+ .eq(ContractSubjectMatter::getContractId, contract.getId()).ne(ContractSubjectMatter::getDeliveryStatus, 2));
+ if (CollUtil.isEmpty(subjectMatterList)) {
contract.setNextScheduleName("璐у埌绛炬敹");
baseMapper.updateById(contract);
}
@@ -3540,7 +3607,7 @@
}
}
- if (contract.getPaidAmount().compareTo(contract.getAmount())==0&&contract.getBillingAmout().compareTo(contract.getAmount())==0){
+ if (contract.getPaidAmount().compareTo(contract.getAmount()) == 0 && contract.getBillingAmout().compareTo(contract.getAmount()) == 0) {
contract.setContractStatus(3);
baseMapper.updateById(contract);
}
@@ -3550,7 +3617,7 @@
@Override
public R getFinallyInfo(Long id) {
Contract contract = baseMapper.selectById(id);
- return R.ok(BeanUtil.copyProperties(contract,ContractFinallyVo.class));
+ return R.ok(BeanUtil.copyProperties(contract, ContractFinallyVo.class));
}
@Override
@@ -3558,8 +3625,7 @@
Contract contract = baseMapper.selectById(id);
List<ContractSubjectMatter> subjectMatterList = contractSubjectMatterMapper.selectList(Wrappers.<ContractSubjectMatter>lambdaQuery()
.eq(ContractSubjectMatter::getContractId, id));
- pushSubCompany(contract,subjectMatterList);
- return R.ok();
+ return pushSubCompany(contract, subjectMatterList);
}
@Override
@@ -3573,20 +3639,20 @@
@Override
public R getInvoiceObj(Long id) {
Contract contract = baseMapper.selectById(id);
- ContractInvoiceObjVo objVo = BeanUtil.copyProperties(contract,ContractInvoiceObjVo.class);
+ ContractInvoiceObjVo objVo = BeanUtil.copyProperties(contract, ContractInvoiceObjVo.class);
List<BusinessCustomerSelectVo> selectVoList = new ArrayList<>();
BusinessCustomer a = businessCustomerMapper.selectById(contract.getPartyAId());
- if (ObjUtil.isNotNull(a)){
+ if (ObjUtil.isNotNull(a)) {
objVo.setPartyA(a.getCompanyName());
objVo.setPartyAOrgCode(a.getCreditCode());
- objVo.setInvoiceType(StrUtil.isNotBlank(a.getInvoiceType())?a.getInvoiceType():"01");
- BusinessCustomerSelectVo selectVo = BeanUtil.copyProperties(a,BusinessCustomerSelectVo.class);
+ objVo.setInvoiceType(StrUtil.isNotBlank(a.getInvoiceType()) ? a.getInvoiceType() : "01");
+ BusinessCustomerSelectVo selectVo = BeanUtil.copyProperties(a, BusinessCustomerSelectVo.class);
selectVoList.add(selectVo);
}
- if (ObjUtil.isNotNull(contract.getPartyCId())){
+ if (ObjUtil.isNotNull(contract.getPartyCId())) {
BusinessCustomer c = businessCustomerMapper.selectById(contract.getPartyCId());
- if (ObjUtil.isNotNull(c)){
- BusinessCustomerSelectVo selectVo = BeanUtil.copyProperties(c,BusinessCustomerSelectVo.class);
+ if (ObjUtil.isNotNull(c)) {
+ BusinessCustomerSelectVo selectVo = BeanUtil.copyProperties(c, BusinessCustomerSelectVo.class);
selectVoList.add(selectVo);
}
}
@@ -3601,9 +3667,9 @@
@Override
public R addContractHisNoCenter(ContractAddDTO addDTO) {
- Contract contract1 = baseMapper.selectOne(Wrappers.<Contract>lambdaQuery().eq(Contract::getContractNo,addDTO.getContractNo())
+ Contract contract1 = baseMapper.selectOne(Wrappers.<Contract>lambdaQuery().eq(Contract::getContractNo, addDTO.getContractNo())
.last("limit 1"));
- if (ObjUtil.isNotNull(contract1)){
+ if (ObjUtil.isNotNull(contract1)) {
return R.failed("鍚堝悓缂栧彿宸插瓨鍦�");
}
Contract contract = BeanUtil.copyProperties(addDTO, Contract.class);
@@ -3649,8 +3715,8 @@
contractSubjectMatterMapper.insert(subjectMatter);
});
List<ContractSubjectMatter> subjectMatterList = contractSubjectMatterMapper.selectList(Wrappers.<ContractSubjectMatter>lambdaQuery()
- .eq(ContractSubjectMatter::getContractId,contract.getId()).ne(ContractSubjectMatter::getDeliveryStatus,2));
- if (CollUtil.isEmpty(subjectMatterList)){
+ .eq(ContractSubjectMatter::getContractId, contract.getId()).ne(ContractSubjectMatter::getDeliveryStatus, 2));
+ if (CollUtil.isEmpty(subjectMatterList)) {
contract.setNextScheduleName("璐у埌绛炬敹");
baseMapper.updateById(contract);
}
@@ -3695,7 +3761,7 @@
}
}
- if (contract.getPaidAmount().compareTo(contract.getAmount())==0&&contract.getBillingAmout().compareTo(contract.getAmount())==0){
+ if (contract.getPaidAmount().compareTo(contract.getAmount()) == 0 && contract.getBillingAmout().compareTo(contract.getAmount()) == 0) {
contract.setContractStatus(3);
baseMapper.updateById(contract);
}
@@ -3740,8 +3806,8 @@
contractSubjectMatterMapper.insert(subjectMatter);
});
List<ContractSubjectMatter> subjectMatterList = contractSubjectMatterMapper.selectList(Wrappers.<ContractSubjectMatter>lambdaQuery()
- .eq(ContractSubjectMatter::getContractId,contract.getId()).ne(ContractSubjectMatter::getDeliveryStatus,2));
- if (CollUtil.isEmpty(subjectMatterList)){
+ .eq(ContractSubjectMatter::getContractId, contract.getId()).ne(ContractSubjectMatter::getDeliveryStatus, 2));
+ if (CollUtil.isEmpty(subjectMatterList)) {
contract.setNextScheduleName("璐у埌绛炬敹");
baseMapper.updateById(contract);
}
@@ -3787,7 +3853,7 @@
}
}
- if (contract.getPaidAmount().compareTo(contract.getAmount())==0&&contract.getBillingAmout().compareTo(contract.getAmount())==0){
+ if (contract.getPaidAmount().compareTo(contract.getAmount()) == 0 && contract.getBillingAmout().compareTo(contract.getAmount()) == 0) {
contract.setContractStatus(3);
baseMapper.updateById(contract);
}
@@ -3803,8 +3869,8 @@
if (CollUtil.isEmpty(addDTO.getContractSubjectMatter())) {
return R.failed("璇锋坊鍔犳爣鐨勭墿");
}
- if (addDTO.getContractSubjectMatter().stream().anyMatch(contractSubjectMatterAddDTO -> StrUtil.isBlank(contractSubjectMatterAddDTO.getDataId())&&
- StrUtil.isBlank(contractSubjectMatterAddDTO.getMaterialCode()))){
+ if (addDTO.getContractSubjectMatter().stream().anyMatch(contractSubjectMatterAddDTO -> StrUtil.isBlank(contractSubjectMatterAddDTO.getDataId()) &&
+ StrUtil.isBlank(contractSubjectMatterAddDTO.getMaterialCode()))) {
return R.failed("鏍囩殑鐗╃殑dataId鍜宮aterialCode涓嶈兘鍚屾椂涓虹┖");
}
if (CollUtil.isEmpty(addDTO.getContractPaymentSchedule())) {
@@ -3860,12 +3926,12 @@
addDTO.getContractSubjectMatter().stream().forEach(contractSubjectMatterAddDTO -> {
ContractSubjectMatter subjectMatter = BeanUtil.copyProperties(contractSubjectMatterAddDTO, ContractSubjectMatter.class);
subjectMatter.setContractId(contract.getId());
- Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode,subjectMatter.getMaterialCode())
+ Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, subjectMatter.getMaterialCode())
.last("limit 1"));
- if (ObjUtil.isNotNull(product)){
- subjectMatter.setMaterialInternalName(product.getId()+"");
+ if (ObjUtil.isNotNull(product)) {
+ subjectMatter.setMaterialInternalName(product.getId() + "");
}
- if (ObjUtil.isNull(product)){
+ if (ObjUtil.isNull(product)) {
product = new Product();
product.setParentId(2101559148831944705L);
product.setProductName(subjectMatter.getMaterialInternalName());
@@ -3874,7 +3940,7 @@
product.setTaxCode("1090117040000000000");
product.setTaxClass("娉�");
productMapper.insert(product);
- subjectMatter.setMaterialInternalName(product.getId()+"");
+ subjectMatter.setMaterialInternalName(product.getId() + "");
}
subjectMatter.setDeliveredQuantity(new BigDecimal("0"));
subjectMatter.setDeliveryStatus(0);
@@ -3946,7 +4012,7 @@
@Override
public R addContractOrder(ContractOrderAddDTO addDTO) {
Contract main = baseMapper.selectById(addDTO.getParentId());
- Contract branch = BeanUtil.copyProperties(main,Contract.class,"id");
+ Contract branch = BeanUtil.copyProperties(main, Contract.class, "id");
branch.setPartyAId(addDTO.getPartyAId());
branch.setPartyA(addDTO.getPartyA());
branch.setAttachmentUrl(addDTO.getAttachmentUrl());
@@ -4017,4 +4083,47 @@
return R.ok();
}
+
+ @Override
+ public R erpPushBatch() {
+ List<Long> compIds = new ArrayList<>();
+ compIds.add(2089995177814495234L);
+ compIds.add(2089996921978040321L);
+ compIds.add(2089997578009128962L);
+ compIds.add(2101966257365045249L);
+ List<Contract> contractList = baseMapper.selectList(Wrappers.<Contract>lambdaQuery().in(Contract::getCompId,compIds)
+ .likeRight(Contract::getContractNo,"ZB-SMJ-").eq(Contract::getErpPushFlag,"0"));
+ if (CollUtil.isNotEmpty(contractList)){
+ for (Contract con:contractList
+ ) {
+ List<ContractSubjectMatter> subjectMatterList = contractSubjectMatterMapper.selectList(Wrappers.<ContractSubjectMatter>lambdaQuery().
+ eq(ContractSubjectMatter::getContractId, con.getId()));
+ R r = pushSubCompany(con,subjectMatterList);
+ if (!r.isOk()){
+ return r;
+ }
+ }
+ }
+ return R.failed("鏆傛棤闇�瑕佹帹閫佺殑鍚堝悓");
+ }
+
+ @Override
+ public R delById(Long id) {
+ paymentOffsetMapper.delete(Wrappers.<PaymentOffset>lambdaQuery().eq(PaymentOffset::getContractId,id));
+ contractApprovalMapper.delete(Wrappers.<ContractApproval>lambdaQuery().eq(ContractApproval::getContractId,id));
+ contractDelayOutMapper.delete(Wrappers.<ContractDelayOut>lambdaQuery().eq(ContractDelayOut::getContractId,id));
+ contractExecDateMapper.delete(Wrappers.<ContractExecDate>lambdaQuery().eq(ContractExecDate::getContractId,id));
+ dropLossMapper.delete(Wrappers.<DropLoss>lambdaQuery().eq(DropLoss::getContractId,id));
+ meterReadRecordMapper.delete(Wrappers.<MeterReadRecord>lambdaQuery().eq(MeterReadRecord::getContractId,id));
+ contractOutBoundMapper.delete(Wrappers.<ContractOutBound>lambdaQuery().eq(ContractOutBound::getContractId,id));
+ contractInvoiceMapper.delete(Wrappers.<ContractInvoice>lambdaQuery().eq(ContractInvoice::getContractId,id));
+ historyOverdueMapper.delete(Wrappers.<HistoryOverdue>lambdaQuery().eq(HistoryOverdue::getContractId,id));
+ currentOverdueMapper.delete(Wrappers.<CurrentOverdue>lambdaQuery().eq(CurrentOverdue::getContractId,id));
+ paymentConfirmMapper.delete(Wrappers.<PaymentConfirm>lambdaQuery().eq(PaymentConfirm::getContractId,id));
+ paymentSlipMapper.delete(Wrappers.<PaymentSlip>lambdaQuery().eq(PaymentSlip::getContractId,id));
+ contractPaymentScheduleMapper.delete(Wrappers.<ContractPaymentSchedule>lambdaQuery().eq(ContractPaymentSchedule::getContractId,id));
+ contractSubjectMatterMapper.delete(Wrappers.<ContractSubjectMatter>lambdaQuery().eq(ContractSubjectMatter::getContractId,id));
+ baseMapper.deleteById(id);
+ return R.ok();
+ }
}
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractSubjectMatterServiceImpl.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractSubjectMatterServiceImpl.java
index 0f6943e..ff47e1e 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractSubjectMatterServiceImpl.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractSubjectMatterServiceImpl.java
@@ -409,4 +409,14 @@
}
return R.ok();
}
+
+ @Override
+ public R batchUpd(List<ContractSubjectMatter> list) {
+ if(CollUtil.isNotEmpty(list)){
+ list.stream().forEach(contractSubjectMatter -> {
+ baseMapper.updateById(contractSubjectMatter);
+ });
+ }
+ return R.ok();
+ }
}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/OutBoundServiceImpl.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/OutBoundServiceImpl.java
index 7752fe4..0bad602 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/OutBoundServiceImpl.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/OutBoundServiceImpl.java
@@ -402,7 +402,8 @@
PaymentConfirm lastNewConfirm = paymentConfirmMapper.selectOne(Wrappers.<PaymentConfirm>lambdaQuery().eq(PaymentConfirm::getContractId, contract.getId())
.orderByDesc(PaymentConfirm::getCreateTime).last("limit 1"));
if (lastNewConfirm.getTotalAmount().compareTo(new BigDecimal("0")) >= 0
- && contract.getBillingAmout().compareTo(contract.getAmount()) == 0) {
+ && contract.getBillingAmout().compareTo(contract.getAmount()) == 0&&
+ StrUtil.isBlank(contract.getNextScheduleName())) {
//鏈夐浠樹笖瓒呰繃搴旀敹 鍏抽棴鍚堝悓鐘舵��
contract.setContractStatus(3);
contractMapper.updateById(contract);
@@ -578,6 +579,9 @@
if (subjectMatter.getRemainingQuantity().compareTo(new BigDecimal("0")) == 0) {
subjectMatter.setDeliveryStatus(2);
}
+ if (StrUtil.isBlank(subjectMatter.getMaterialCode())){
+ subjectMatter.setMaterialCode(outSubjectMatterAddDTO.getSubjectMatterCode());
+ }
subjectMatter.setActualDeliveryDate(addDTO.getOutBoundTime());
contractSubjectMatterMapper.updateById(subjectMatter);
//淇濆瓨erp鍑哄簱
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/PaymentConfirmServiceImpl.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/PaymentConfirmServiceImpl.java
index 2549e3e..d99ad09 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/PaymentConfirmServiceImpl.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/PaymentConfirmServiceImpl.java
@@ -56,6 +56,13 @@
@RequiredArgsConstructor
public class PaymentConfirmServiceImpl extends ServiceImpl<PaymentConfirmMapper, PaymentConfirm> implements PaymentConfirmService {
+
+ @Value("${dept.smj}")
+ private String smj;
+
+ @Value("${dept.smjhw}")
+ private String smjhw;
+
private final ContractService contractService;
private final BusinessCustomerService businessCustomerService;
private final ContractPaymentScheduleMapper contractPaymentScheduleMapper;
@@ -154,7 +161,8 @@
}
paid = paid.add(addDTO.getTransationAmount());
contract.setPaidAmount(paid);
- if (paid.compareTo(contract.getAmount().subtract(contract.getDropAmount())) >= 0&&contract.getBillingAmout().compareTo(contract.getAmount())==0) {
+ if (paid.compareTo(contract.getAmount().subtract(contract.getDropAmount())) >= 0&&contract.getBillingAmout().compareTo(contract.getAmount())==0&&
+ StrUtil.isBlank(contract.getNextScheduleName())) {
contract.setContractStatus(3);
contract.setPaidAmount(contract.getAmount().subtract(contract.getDropAmount()));
}
@@ -170,7 +178,8 @@
}
paid = paid.add(addDTO.getTransationAmount());
contract.setPaidAmount(paid);
- if (contract.getBillingAmout().compareTo(contract.getAmount())==0&&paid.compareTo(contract.getAmount().subtract(contract.getDropAmount())) >= 0) {
+ if (contract.getBillingAmout().compareTo(contract.getAmount())==0&&paid.compareTo(contract.getAmount().subtract(contract.getDropAmount())) >= 0&&
+ StrUtil.isBlank(contract.getNextScheduleName())) {
contract.setContractStatus(3);
contract.setPaidAmount(contract.getAmount());
}
@@ -283,6 +292,7 @@
slip.setPaymentAmount(addDTO.getTransationAmount());
slip.setPayType(addDTO.getPayType());
slip.setContractId(contract.getId());
+ slip.setPaymentNumber(addDTO.getPaymentCode());
paymentSlipMapper.insert(slip);
}
@@ -410,10 +420,30 @@
log.info("==================寮�濮嬪鐞嗛摱琛屾祦姘翠俊鎭�===================");
recordList.stream().forEach(obj -> {
JSONObject record = (JSONObject) obj;
- BusinessCustomer customer = businessCustomerService.getOne(Wrappers.<BusinessCustomer>lambdaQuery()
- .eq(BusinessCustomer::getCompanyName, record.getString("to_acct_name"))
- .eq(BusinessCustomer::getCompId,dept.getDeptId())
- );
+// Long compId = null;
+// if (StrUtil.contains(record.getString("to_acct_name"),"鐭冲搴勭叅鐭挎満姊版湁闄愯矗浠诲叕鍙�")){
+// compId = 2089995177814495234L;
+// }else {
+// compId = dept.getDeptId();
+// }
+// BusinessCustomer customer = businessCustomerService.getOne(Wrappers.<BusinessCustomer>lambdaQuery()
+// .eq(BusinessCustomer::getCompanyName, record.getString("to_acct_name"))
+// .eq(BusinessCustomer::getCompId,compId));
+ BusinessCustomer customer = null;
+ if (StrUtil.equals(record.getString("to_acct_name"),"鐭冲搴勭叅鐭挎満姊版湁闄愯矗浠诲叕鍙�")){
+ List<String> smjList = new ArrayList<>();
+ smjList.add(smj);
+ smjList.add(smjhw);
+ customer = businessCustomerService.getOne(Wrappers.<BusinessCustomer>lambdaQuery()
+ .eq(BusinessCustomer::getCompanyName, record.getString("to_acct_name"))
+ .in(BusinessCustomer::getCompId, smjList)
+ .last("limit 1"));
+ }else {
+ customer = businessCustomerService.getOne(Wrappers.<BusinessCustomer>lambdaQuery()
+ .eq(BusinessCustomer::getCompanyName, record.getString("to_acct_name"))
+ .eq(BusinessCustomer::getCompId,dept.getDeptId())
+ .last("limit 1"));
+ }
//淇濆瓨浠樻鍗�
Boolean codeFlag = saveBankStatement(customer, record,dept);
if (!codeFlag) {
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/PaymentOffsetServiceImpl.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/PaymentOffsetServiceImpl.java
index cd39c2c..d4df3f8 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/PaymentOffsetServiceImpl.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/PaymentOffsetServiceImpl.java
@@ -137,7 +137,8 @@
}
paid = paid.add(paymentOffset.getOffsetAmount());
contract.setPaidAmount(paid);
- if (paid.compareTo(contract.getAmount().subtract(contract.getDropAmount()))>=0&&contract.getBillingAmout().compareTo(contract.getAmount())==0){
+ if (paid.compareTo(contract.getAmount().subtract(contract.getDropAmount()))>=0&&contract.getBillingAmout().compareTo(contract.getAmount())==0&&
+ StrUtil.isBlank(contract.getNextScheduleName())){
// contract.setBillingStatus("2");
contract.setContractStatus(3);
}
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/PaymentSlipServiceImpl.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/PaymentSlipServiceImpl.java
index 274f111..357a9c3 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/PaymentSlipServiceImpl.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/PaymentSlipServiceImpl.java
@@ -6,8 +6,10 @@
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.by4cloud.platformx.business.dto.PaymentSlipQueryDTO;
import com.by4cloud.platformx.business.dto.SyncPaymentRecepitDTO;
+import com.by4cloud.platformx.business.entity.PaymentCreditSale;
import com.by4cloud.platformx.business.entity.PaymentReceive;
import com.by4cloud.platformx.business.entity.PaymentSlip;
+import com.by4cloud.platformx.business.mapper.PaymentCreditMapper;
import com.by4cloud.platformx.business.mapper.PaymentReceiveMapper;
import com.by4cloud.platformx.business.mapper.PaymentSlipMapper;
import com.by4cloud.platformx.business.service.PaymentSlipService;
@@ -26,6 +28,8 @@
public class PaymentSlipServiceImpl extends ServiceImpl<PaymentSlipMapper, PaymentSlip> implements PaymentSlipService {
private final PaymentReceiveMapper paymentReceiveMapper;
+
+ private final PaymentCreditMapper paymentCreditMapper;
@Override
public Page pageScope(Page page, PaymentSlipQueryDTO queryDTO) {
@@ -56,7 +60,39 @@
return R.ok();
}
- private void saveReceive(Date offsetDay, BigDecimal reveiceZb,Long compId) {
+ @Override
+ public R genCreditPayment(SyncPaymentRecepitDTO dto) {
+ //瑁呭
+ BigDecimal reveiceZb = paymentCreditMapper.genReceivePayment(null);
+ saveCredit(DateUtil.offsetDay(new Date(),-1),reveiceZb,null);
+ //鐭崇叅鏈�
+ BigDecimal reveiceSmj = paymentCreditMapper.genReceivePaymentSmj();
+ saveCredit(DateUtil.offsetDay(new Date(),-1),reveiceSmj,2089995177814495234L);
+ //鐭冲伐娉�
+ BigDecimal reveiceSgb = paymentCreditMapper.genReceivePayment(2056556196124250113L);
+ saveCredit(DateUtil.offsetDay(new Date(),-1),reveiceSgb,2056556196124250113L);
+ //閫氭柟鍏徃
+ BigDecimal reveiceTfgs = paymentCreditMapper.genReceivePayment(2056556421857497090L);
+ saveCredit(DateUtil.offsetDay(new Date(),-1),reveiceTfgs,2056556421857497090L);
+ //鏈烘鍘�
+ BigDecimal reveiceJxc = paymentCreditMapper.genReceivePayment(2056556317461270529L);
+ saveCredit(DateUtil.offsetDay(new Date(),-1),reveiceJxc,2056556317461270529L);
+ //涓�鐓ゆ満
+ BigDecimal reveiceYmj = paymentCreditMapper.genReceivePayment(2056556535640576002L);
+ saveCredit(DateUtil.offsetDay(new Date(),-1),reveiceYmj,2056556535640576002L);
+
+ return R.ok();
+ }
+
+ private void saveCredit(Date offsetDay, BigDecimal reveiceZb, Long compId) {
+ PaymentCreditSale receive = new PaymentCreditSale();
+ receive.setCreditDate(offsetDay);
+ receive.setCompId(compId);
+ receive.setCreditAmount(reveiceZb);
+ paymentCreditMapper.insert(receive);
+ }
+
+ private void saveReceive(Date offsetDay, BigDecimal reveiceZb, Long compId) {
PaymentReceive receive = new PaymentReceive();
receive.setReceiveDate(offsetDay);
receive.setCompId(compId);
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ProductServiceImpl.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ProductServiceImpl.java
index 1e73e39..7337a34 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ProductServiceImpl.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ProductServiceImpl.java
@@ -222,6 +222,10 @@
product.setTaxRate(Double.valueOf(taxCode.getSl().replace("%","")));
}
baseMapper.insert(product);
+ }else {
+ Product product = productList.get(0);
+ product.setProductType(addDTO.getErpName());
+ baseMapper.updateById(product);
}
}
return R.ok();
@@ -537,9 +541,27 @@
}
baseMapper.insert(productNew);
log.info("浜у搧锛歿}鏂板鎴愬姛",product.getString("itemNo"));
- return;
+ }else {
+ productNew.setProductType(product.getString("grade"));
+ productNew.setUnitName(product.getString("unitName"));
+ if(StrUtil.equals(finalTan,"tenant1")){
+ productNew.setCompId(2089995177814495234L);
+ }
+ if(StrUtil.equals(finalTan,"tenant2")){
+ productNew.setCompId(2089996921978040321L);
+ }
+ if(StrUtil.equals(finalTan,"tenant3")){
+ productNew.setCompId(2089997578009128962L);
+ }
+ productNew.setParentId(productClass.getId());
+ TaxCode taxCode = taxCodeMapper.selectOne(Wrappers.<TaxCode>lambdaQuery().eq(TaxCode::getBm,product.getString("tfTaxClass")).last("limit 1"));
+ if (ObjUtil.isNotNull(taxCode)){
+ productNew.setTaxClass(taxCode.getSphwjc());
+ productNew.setTaxRate(Double.valueOf(taxCode.getSl().replace("%","")));
+ }
+ baseMapper.updateById(productNew);
+ log.info("浜у搧锛歿}鏇存柊鎴愬姛",productNew.getErpCode());
}
- log.info("浜у搧锛歿}瀛樺湪",product.getString("itemNo"));
});
}
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/StatisticServiceImpl.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/StatisticServiceImpl.java
index 1d3d727..d7e1813 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/StatisticServiceImpl.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/StatisticServiceImpl.java
@@ -58,6 +58,16 @@
@Value("${dept.smj}")
private String smj;
+ @Value("${dept.smjsc}")
+ private String smjsc;
+
+ @Value("${dept.smjzt}")
+ private String smjzt;
+
+ @Value("${dept.smjhw}")
+ private String smjhw;
+
+
@Value("${dept.sgb}")
private String sgb;
@@ -1347,10 +1357,14 @@
compIds.add(Long.valueOf(tfgs));
compIds.add(Long.valueOf(ymj));
compIds.add(Long.valueOf(jxc));
+ compIds.add(Long.valueOf(smjhw));
+ compIds.add(Long.valueOf(smjsc));
+ compIds.add(Long.valueOf(smjzt));
+ compIds.add(2056555602756063234L);
+
if (compIds.contains(userId)) {
return R.ok(false);
}
- ;
return R.ok(true);
}
@@ -1604,8 +1618,27 @@
if (CollUtil.isEmpty(items)) {
return R.failed("瀹㈠晢鐪佷唤瀛楀吀鍒嗙被鑾峰彇寮傚父");
}
+ Long compId = null;
+ List<Long> compIds = null;
+ if (StrUtil.equals(smj,SecurityUtils.getUser().getCompId()+"")||StrUtil.equals(smjhw,SecurityUtils.getUser().getCompId()+"")){
+ compIds = new ArrayList<>();
+ compIds.add(Long.valueOf(smj));
+ compIds.add(Long.valueOf(smjhw));
+ }
+ if (StrUtil.equals(smjsc,SecurityUtils.getUser().getCompId()+"")||StrUtil.equals(smjzt,SecurityUtils.getUser().getCompId()+"")
+ ||StrUtil.equals(sgb,SecurityUtils.getUser().getCompId()+"")||StrUtil.equals(jxc,SecurityUtils.getUser().getCompId()+"")
+ ||StrUtil.equals(tfgs,SecurityUtils.getUser().getCompId()+"")||StrUtil.equals(ymj,SecurityUtils.getUser().getCompId()+"")){
+ compId = SecurityUtils.getUser().getCompId();
+ }
+ if (StrUtil.equals("2056555602756063234",SecurityUtils.getUser().getCompId()+"")){
+ compIds = new ArrayList<>();
+ compIds.add(Long.valueOf(smj));
+ compIds.add(Long.valueOf(smjsc));
+ compIds.add(Long.valueOf(smjzt));
+ compIds.add(Long.valueOf(smjhw));
+ }
List<HomeZgsData> list = new ArrayList<>();
- List<String> contractProvinces = contractMapper.homeZgsColum(SecurityUtils.getUser().getCompId());
+ List<String> contractProvinces = contractMapper.homeZgsColum(compId,compIds);
if (CollUtil.isNotEmpty(contractProvinces)) {
contractProvinces.stream().forEach(province -> {
HomeZgsData homeZgsData = contractInvoiceMapper.homeZgsData(SecurityUtils.getUser().getCompId(), province);
@@ -1629,11 +1662,31 @@
@Override
public R zbjtStatistic() {
+
List<ZbjtStatisticVo> statisticVoList = new ArrayList<>();
String curYear = DateUtil.year(new Date()) + "";
String curMonth = DateUtil.month(new Date()) + "";
+ Long compId = null;
+ List<Long> compIds = null;
+ if (StrUtil.equals(smj,SecurityUtils.getUser().getCompId()+"")||StrUtil.equals(smjhw,SecurityUtils.getUser().getCompId()+"")){
+ compIds = new ArrayList<>();
+ compIds.add(Long.valueOf(smj));
+ compIds.add(Long.valueOf(smjhw));
+ }
+ if (StrUtil.equals(smjsc,SecurityUtils.getUser().getCompId()+"")||StrUtil.equals(smjzt,SecurityUtils.getUser().getCompId()+"")
+ ||StrUtil.equals(sgb,SecurityUtils.getUser().getCompId()+"")||StrUtil.equals(jxc,SecurityUtils.getUser().getCompId()+"")
+ ||StrUtil.equals(tfgs,SecurityUtils.getUser().getCompId()+"")||StrUtil.equals(ymj,SecurityUtils.getUser().getCompId()+"")){
+ compId = SecurityUtils.getUser().getCompId();
+ }
+ if (StrUtil.equals("2056555602756063234",SecurityUtils.getUser().getCompId()+"")){
+ compIds = new ArrayList<>();
+ compIds.add(Long.valueOf(smj));
+ compIds.add(Long.valueOf(smjsc));
+ compIds.add(Long.valueOf(smjzt));
+ compIds.add(Long.valueOf(smjhw));
+ }
//鍚堝悓
- ZbjtStatisticVo htVo = contractMapper.zbjtStatisticByContract();
+ ZbjtStatisticVo htVo = contractMapper.zbjtStatisticByContract(compId,compIds);
AnnualPlanTotalVo planListHt = annualPlanMapper.selectPlanYear(curYear, "1");
if (ObjUtil.isNotNull(htVo) && ObjUtil.isNotNull(planListHt)) {
BigDecimal monAmount = planListHt.getMonthAmount(curMonth);
@@ -1647,7 +1700,7 @@
}
statisticVoList.add(htVo);
//寮�绁�
- ZbjtStatisticVo kpVo = contractInvoiceMapper.zbjtStatisticByInvoice();
+ ZbjtStatisticVo kpVo = contractInvoiceMapper.zbjtStatisticByInvoice(compId,compIds);
AnnualPlanTotalVo planListFP = annualPlanMapper.selectPlanYear(curYear, "2");
if (ObjUtil.isNotNull(kpVo) && ObjUtil.isNotNull(planListFP)) {
BigDecimal monAmount = planListFP.getMonthAmount(curMonth);
@@ -1661,7 +1714,7 @@
}
statisticVoList.add(kpVo);
//鍥炴
- ZbjtStatisticVo hkVo = paymentSlipMapper.zbjtStatisticByPayment();
+ ZbjtStatisticVo hkVo = paymentSlipMapper.zbjtStatisticByPayment(compId,compIds);
AnnualPlanTotalVo planListHK = annualPlanMapper.selectPlanYear(curYear, "2");
if (ObjUtil.isNotNull(hkVo) && ObjUtil.isNotNull(planListHK)) {
BigDecimal monAmount = planListHK.getMonthAmount(curMonth);
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ZBJTStatisticServiceImpl.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ZBJTStatisticServiceImpl.java
index 4fea444..7c5b2ab 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ZBJTStatisticServiceImpl.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ZBJTStatisticServiceImpl.java
@@ -7,10 +7,7 @@
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.by4cloud.platformx.business.dto.ZBJTStatisticDTO;
-import com.by4cloud.platformx.business.entity.AnnualPlan;
-import com.by4cloud.platformx.business.entity.AnnualPlanKey;
-import com.by4cloud.platformx.business.entity.AnnualTarget;
-import com.by4cloud.platformx.business.entity.BipDict;
+import com.by4cloud.platformx.business.entity.*;
import com.by4cloud.platformx.business.mapper.*;
import com.by4cloud.platformx.business.service.ZBJTStatisticService;
import com.by4cloud.platformx.business.vo.*;
@@ -42,33 +39,46 @@
private final BipDictMapper bipDictMapper;
private final PaymentReceiveMapper paymentReceiveMapper;
private final HistoryOverdueMapper historyOverdueMapper;
+ private final ZbStatisticXszbMapper zbStatisticXszbMapper;
+ private final ZbStatisticCpbkMapper zbStatisticCpbkMapper;
+ private final ZbStatisticZdgzMapper zbStatisticZdgzMapper;
+ private final ZbStatisticZxywMapper zbStatisticZxywMapper;
+ private final ZbStatisticCpXssrMapper zbStatisticCpXssrMapper;
+ private final ZbStatisticCpXzhtMapper zbStatisticCpXzhtMapper;
+
@Override
public R zyxszbwcqk(ZBJTStatisticDTO queryDTO) {
if (StrUtil.isBlank(queryDTO.getYearMonth())){
return R.failed("鏌ヨ骞存湀涓嶈兘涓虹┖");
}
+ List<ZbStatisticXszb> xszbList = zbStatisticXszbMapper.selectList(Wrappers.<ZbStatisticXszb>lambdaQuery()
+ .eq(ZbStatisticXszb::getStatYm,queryDTO.getYearMonth()));
+ if (CollUtil.isNotEmpty(xszbList)){
+ List<ZyxszbwcqkVo> list = BeanUtil.copyToList(xszbList,ZyxszbwcqkVo.class);
+ return R.ok(list);
+ }
List<ZyxszbwcqkVo> list = new ArrayList<>();
- Date monstart = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00");
- Date monend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
- Date monstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00"),-1);
- Date monendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),-1);
- Date yearstart = DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0,4)+"-01-01 00:00:00");
- Date yearend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
- Date yearstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0,4)+"-01-01 00:00:00"),-1);
- Date yearendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),-1);
-
- HomeZbjtVo hk = paymentSlipMapper.homeZbjtYearAndMon(monstart,monend,yearstart,yearend,
- monstartLastYear,monendLastYear,yearstartLastYear,yearendLastYear);
- list = handlezBJTVo("璐ф鍥炴敹",list,hk,queryDTO.getYearMonth().substring(0,4), queryDTO.getYearMonth().substring(5), "3");
-
- HomeZbjtVo kp = contractInvoiceMapper.homeZbjtYearAndMon(monstart,monend,yearstart,yearend);
-
- list = handlezBJTVo("閿�鍞敹鍏�",list,kp,queryDTO.getYearMonth().substring(0,4), queryDTO.getYearMonth().substring(5), "2");
-
- HomeZbjtVo htqd = contractMapper.homeZbjtYearAndMon(monstart,monend,yearstart,yearend);
-
- list = handlezBJTVo("鏂板鍚堝悓",list,htqd,queryDTO.getYearMonth().substring(0,4), queryDTO.getYearMonth().substring(5), "1");
+// Date monstart = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00");
+// Date monend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
+// Date monstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00"),-1);
+// Date monendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),-1);
+// Date yearstart = DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0,4)+"-01-01 00:00:00");
+// Date yearend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
+// Date yearstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0,4)+"-01-01 00:00:00"),-1);
+// Date yearendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),-1);
+//
+// HomeZbjtVo hk = paymentSlipMapper.homeZbjtYearAndMon(monstart,monend,yearstart,yearend,
+// monstartLastYear,monendLastYear,yearstartLastYear,yearendLastYear);
+// list = handlezBJTVo("璐ф鍥炴敹",list,hk,queryDTO.getYearMonth().substring(0,4), queryDTO.getYearMonth().substring(5), "3");
+//
+// HomeZbjtVo kp = contractInvoiceMapper.homeZbjtYearAndMon(monstart,monend,yearstart,yearend);
+//
+// list = handlezBJTVo("閿�鍞敹鍏�",list,kp,queryDTO.getYearMonth().substring(0,4), queryDTO.getYearMonth().substring(5), "2");
+//
+// HomeZbjtVo htqd = contractMapper.homeZbjtYearAndMon(monstart,monend,yearstart,yearend);
+//
+// list = handlezBJTVo("鏂板鍚堝悓",list,htqd,queryDTO.getYearMonth().substring(0,4), queryDTO.getYearMonth().substring(5), "1");
return R.ok(list);
}
@@ -359,7 +369,7 @@
if (StrUtil.isBlank(queryDTO.getYearMonth())){
return R.failed("鏌ヨ骞存湀涓嶈兘涓虹┖");
}
- List<GcpbkwcqkVo> list = new ArrayList<>();
+
Date monstart = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00");
Date monend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
Date monstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00"),-1);
@@ -368,169 +378,176 @@
Date yearend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
Date yearstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0,4)+"-01-01 00:00:00"),-1);
Date yearendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),-1);
- //鏂板鍚堝悓
- List<GcpbkwcqkItemVo> itemVoListMon = contractSubjectMatterMapper.gcpbkwcqk(monstart,monend);
- List<GcpbkwcqkItemVo> itemVoListMonLastYear = contractSubjectMatterMapper.gcpbkwcqk(monstartLastYear,monendLastYear);
- if (CollUtil.isNotEmpty(itemVoListMon)){
- itemVoListMon.stream().forEach(item->{
- GcpbkwcqkVo vo = new GcpbkwcqkVo();
- vo.setXm("鏂板鍚堝悓");
- vo.setBkmc(item.getBkmc());
- vo.setDywc(item.getWc());
- if (CollUtil.isNotEmpty(itemVoListMonLastYear)){
- itemVoListMonLastYear.stream().forEach(item1->{
- if (StrUtil.equals(vo.getBkmc(),item1.getBkmc())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
- BigDecimal percent = vo.getDywc().subtract(item1.getWc()).divide(item1.getWc(),10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
- vo.setYtqb(percent.setScale(2,RoundingMode.HALF_UP)+"%");
- }
- });
- }
- list.add(vo);
- });
+ List<ZbStatisticCpbk> xszbList = zbStatisticCpbkMapper.selectList(Wrappers.<ZbStatisticCpbk>lambdaQuery()
+ .eq(ZbStatisticCpbk::getStatYm,queryDTO.getYearMonth()));
+ if (CollUtil.isNotEmpty(xszbList)){
+ List<GcpbkwcqkVo> list = BeanUtil.copyToList(xszbList,GcpbkwcqkVo.class);
+ return R.ok(list);
}
- List<GcpbkwcqkItemVo> itemVoListYear = contractSubjectMatterMapper.gcpbkwcqk(yearstart,yearend);
- List<GcpbkwcqkItemVo> itemVoListYearLastYear = contractSubjectMatterMapper.gcpbkwcqk(yearstartLastYear,yearendLastYear);
- if (CollUtil.isNotEmpty(list)&&CollUtil.isNotEmpty(itemVoListYear)){
- BigDecimal ljzh = itemVoListYear.stream().map(item->item.getWc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add);
- for (GcpbkwcqkVo vo:list
- ) {
- for (GcpbkwcqkItemVo itemVo:itemVoListYear
- ) {
- if (StrUtil.equals(vo.getBkmc(),itemVo.getBkmc())&&StrUtil.equals(vo.getXm(),"鏂板鍚堝悓")){
- vo.setLjwc(itemVo.getWc());
- if (ljzh.compareTo(new BigDecimal("0"))>0){
- BigDecimal zb = vo.getLjwc().divide(ljzh,10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
- vo.setBnzb(zb.setScale(2,RoundingMode.HALF_UP)+"%");
- }
-
- }
- if (CollUtil.isNotEmpty(itemVoListYearLastYear)){
- BigDecimal qnljzh = itemVoListYearLastYear.stream().map(item->item.getWc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add);
-
- itemVoListYearLastYear.stream().forEach(item1->{
- if (StrUtil.equals(vo.getBkmc(),item1.getBkmc())&&StrUtil.equals(vo.getXm(),"鏂板鍚堝悓")&&
- item1.getWc().compareTo(new BigDecimal("0"))>0){
- BigDecimal percent = vo.getDywc().subtract(item1.getWc()).divide(item1.getWc(),10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
- vo.setNtqb(percent.setScale(2,RoundingMode.HALF_UP)+"%");
- }
- if (qnljzh.compareTo(new BigDecimal("0"))>0){
- BigDecimal qnzb = item1.getWc().divide(qnljzh,10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
- if (StrUtil.isNotBlank(vo.getBnzb())){
- BigDecimal bnzb = new BigDecimal(vo.getBnzb().substring(0,vo.getBnzb().length()-1));
- vo.setZtqb(bnzb.subtract(qnzb)+"%");
- }
- }
- });
- }
- }
- }
- }
- //閿�鍞敹鍏�
- List<GcpbkwcqkItemVo> itemVoSRListMon = contractOutBoundMapper.gcpbkwcqk(monstart,monend);
- List<GcpbkwcqkItemVo> itemVoListSRMonLastYear = contractOutBoundMapper.gcpbkwcqk(monstartLastYear,monendLastYear);
- if (CollUtil.isNotEmpty(itemVoSRListMon)){
- itemVoSRListMon.stream().forEach(item->{
- GcpbkwcqkVo vo = new GcpbkwcqkVo();
- vo.setXm("閿�鍞敹鍏�");
- vo.setBkmc(item.getBkmc());
- vo.setDywc(item.getWc());
- if (CollUtil.isNotEmpty(itemVoListSRMonLastYear)){
- itemVoListSRMonLastYear.stream().forEach(item1->{
- if (StrUtil.equals(vo.getBkmc(),item1.getBkmc())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
- BigDecimal percent = vo.getDywc().subtract(item1.getWc()).divide(item1.getWc(),10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
- vo.setYtqb(percent.setScale(2,RoundingMode.HALF_UP)+"%");
- }
- });
- }
- list.add(vo);
- });
- }
- List<GcpbkwcqkItemVo> itemVoListSRYear = contractOutBoundMapper.gcpbkwcqk(yearstart,yearend);
- List<GcpbkwcqkItemVo> itemVoListSRYearLastYear = contractOutBoundMapper.gcpbkwcqk(yearstartLastYear,yearendLastYear);
- if (CollUtil.isNotEmpty(list)&&CollUtil.isNotEmpty(itemVoListSRYear)){
- BigDecimal ljzh = itemVoListSRYear.stream().map(item->item.getWc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add);
- for (GcpbkwcqkVo vo:list
- ) {
- for (GcpbkwcqkItemVo itemVo:itemVoListSRYear
- ) {
- if (StrUtil.equals(vo.getBkmc(),itemVo.getBkmc())&&StrUtil.equals(vo.getXm(),"閿�鍞敹鍏�")){
- vo.setLjwc(itemVo.getWc());
- if (ljzh.compareTo(new BigDecimal("0"))>0){
- BigDecimal zb = vo.getLjwc().divide(ljzh,10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
- vo.setBnzb(zb.setScale(2,RoundingMode.HALF_UP)+"%");
- }
- }
- if (CollUtil.isNotEmpty(itemVoListSRYearLastYear)){
- BigDecimal qnljzh = itemVoListSRYearLastYear.stream().map(item->item.getWc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add);
-
- itemVoListSRYearLastYear.stream().forEach(item1->{
- if (StrUtil.equals(vo.getBkmc(),item1.getBkmc())&&StrUtil.equals(vo.getXm(),"閿�鍞敹鍏�")&&
- item1.getWc().compareTo(new BigDecimal("0"))>0){
- BigDecimal percent = vo.getDywc().subtract(item1.getWc()).divide(item1.getWc(),10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
- vo.setNtqb(percent.setScale(2,RoundingMode.HALF_UP)+"%");
- }
- if (qnljzh.compareTo(new BigDecimal("0"))>0){
- BigDecimal qnzb = item1.getWc().divide(qnljzh,10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
- if (StrUtil.isNotBlank(vo.getBnzb())){
- BigDecimal bnzb = new BigDecimal(vo.getBnzb().substring(0,vo.getBnzb().length()-1));
- vo.setZtqb(bnzb.subtract(qnzb)+"%");
- }
- }
- });
- }
- }
- }
- }
- //璐ф鍥炴敹
- List<GcpbkwcqkItemVo> itemVoListSKMon = contractSubjectMatterMapper.gcpbkwcqkBySK(monstart,monend);
- List<GcpbkwcqkItemVo> itemVoListSKMonLastYear = contractSubjectMatterMapper.gcpbkwcqkBySK(monstartLastYear,monendLastYear);
- if (CollUtil.isNotEmpty(itemVoListSKMon)){
- itemVoListSKMon.stream().forEach(item->{
- GcpbkwcqkVo vo = new GcpbkwcqkVo();
- vo.setXm("璐ф鍥炴敹");
- vo.setBkmc(item.getBkmc());
- vo.setDywc(item.getWc());
- if (CollUtil.isNotEmpty(itemVoListSKMonLastYear)){
- itemVoListSKMonLastYear.stream().forEach(item1->{
- if (StrUtil.equals(vo.getBkmc(),item1.getBkmc())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
- BigDecimal percent = vo.getDywc().subtract(item1.getWc()).divide(item1.getWc(),10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
- vo.setYtqb(percent.setScale(2,RoundingMode.HALF_UP)+"%");
- }
- });
- }
- list.add(vo);
- });
- }
- List<GcpbkwcqkItemVo> itemVoListSKYear = contractSubjectMatterMapper.gcpbkwcqkBySK(yearstart,yearend);
- List<GcpbkwcqkItemVo> itemVoListSKYearLastYear = contractSubjectMatterMapper.gcpbkwcqkBySK(yearstartLastYear,yearendLastYear);
- if (CollUtil.isNotEmpty(list)&&CollUtil.isNotEmpty(itemVoListSKYear)){
- for (GcpbkwcqkVo vo:list
- ) {
- for (GcpbkwcqkItemVo itemVo:itemVoListSKYear
- ) {
- if (StrUtil.equals(vo.getBkmc(),itemVo.getBkmc())&&StrUtil.equals(vo.getXm(),"璐ф鍥炴敹")){
- vo.setLjwc(itemVo.getWc());
- }
- if (CollUtil.isNotEmpty(itemVoListSKYearLastYear)){
- BigDecimal qnljzh = itemVoListSKYearLastYear.stream().map(item->item.getWc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add);
- itemVoListSKYearLastYear.stream().forEach(item1->{
- if (StrUtil.equals(vo.getBkmc(),item1.getBkmc())&&StrUtil.equals(vo.getXm(),"璐ф鍥炴敹")&&
- item1.getWc().compareTo(new BigDecimal("0"))>0){
- BigDecimal percent = vo.getDywc().subtract(item1.getWc()).divide(item1.getWc(),10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
- vo.setNtqb(percent.setScale(2,RoundingMode.HALF_UP)+"%");
- }
- if (qnljzh.compareTo(new BigDecimal("0"))>0){
- BigDecimal qnzb = item1.getWc().divide(qnljzh,10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
- if (StrUtil.isNotBlank(vo.getBnzb())){
- BigDecimal bnzb = new BigDecimal(vo.getBnzb().substring(0,vo.getBnzb().length()-1));
- vo.setZtqb(bnzb.subtract(qnzb)+"%");
- }
- }
- });
- }
- }
- }
- }
+ List<GcpbkwcqkVo> list = new ArrayList<>();
+// //鏂板鍚堝悓
+// List<GcpbkwcqkItemVo> itemVoListMon = contractSubjectMatterMapper.gcpbkwcqk(monstart,monend);
+// List<GcpbkwcqkItemVo> itemVoListMonLastYear = contractSubjectMatterMapper.gcpbkwcqk(monstartLastYear,monendLastYear);
+// if (CollUtil.isNotEmpty(itemVoListMon)){
+// itemVoListMon.stream().forEach(item->{
+// GcpbkwcqkVo vo = new GcpbkwcqkVo();
+// vo.setXm("鏂板鍚堝悓");
+// vo.setBkmc(item.getBkmc());
+// vo.setDywc(item.getWc());
+// if (CollUtil.isNotEmpty(itemVoListMonLastYear)){
+// itemVoListMonLastYear.stream().forEach(item1->{
+// if (StrUtil.equals(vo.getBkmc(),item1.getBkmc())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
+// BigDecimal percent = vo.getDywc().subtract(item1.getWc()).divide(item1.getWc(),10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// vo.setYtqb(percent.setScale(2,RoundingMode.HALF_UP)+"%");
+// }
+// });
+// }
+// list.add(vo);
+// });
+// }
+// List<GcpbkwcqkItemVo> itemVoListYear = contractSubjectMatterMapper.gcpbkwcqk(yearstart,yearend);
+// List<GcpbkwcqkItemVo> itemVoListYearLastYear = contractSubjectMatterMapper.gcpbkwcqk(yearstartLastYear,yearendLastYear);
+// if (CollUtil.isNotEmpty(list)&&CollUtil.isNotEmpty(itemVoListYear)){
+// BigDecimal ljzh = itemVoListYear.stream().map(item->item.getWc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add);
+// for (GcpbkwcqkVo vo:list
+// ) {
+// for (GcpbkwcqkItemVo itemVo:itemVoListYear
+// ) {
+// if (StrUtil.equals(vo.getBkmc(),itemVo.getBkmc())&&StrUtil.equals(vo.getXm(),"鏂板鍚堝悓")){
+// vo.setLjwc(itemVo.getWc());
+// if (ljzh.compareTo(new BigDecimal("0"))>0){
+// BigDecimal zb = vo.getLjwc().divide(ljzh,10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// vo.setBnzb(zb.setScale(2,RoundingMode.HALF_UP)+"%");
+// }
+//
+// }
+// if (CollUtil.isNotEmpty(itemVoListYearLastYear)){
+// BigDecimal qnljzh = itemVoListYearLastYear.stream().map(item->item.getWc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add);
+//
+// itemVoListYearLastYear.stream().forEach(item1->{
+// if (StrUtil.equals(vo.getBkmc(),item1.getBkmc())&&StrUtil.equals(vo.getXm(),"鏂板鍚堝悓")&&
+// item1.getWc().compareTo(new BigDecimal("0"))>0){
+// BigDecimal percent = vo.getDywc().subtract(item1.getWc()).divide(item1.getWc(),10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// vo.setNtqb(percent.setScale(2,RoundingMode.HALF_UP)+"%");
+// }
+// if (qnljzh.compareTo(new BigDecimal("0"))>0){
+// BigDecimal qnzb = item1.getWc().divide(qnljzh,10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// if (StrUtil.isNotBlank(vo.getBnzb())){
+// BigDecimal bnzb = new BigDecimal(vo.getBnzb().substring(0,vo.getBnzb().length()-1));
+// vo.setZtqb(bnzb.subtract(qnzb)+"%");
+// }
+// }
+// });
+// }
+// }
+// }
+// }
+// //閿�鍞敹鍏�
+// List<GcpbkwcqkItemVo> itemVoSRListMon = contractOutBoundMapper.gcpbkwcqk(monstart,monend);
+// List<GcpbkwcqkItemVo> itemVoListSRMonLastYear = contractOutBoundMapper.gcpbkwcqk(monstartLastYear,monendLastYear);
+// if (CollUtil.isNotEmpty(itemVoSRListMon)){
+// itemVoSRListMon.stream().forEach(item->{
+// GcpbkwcqkVo vo = new GcpbkwcqkVo();
+// vo.setXm("閿�鍞敹鍏�");
+// vo.setBkmc(item.getBkmc());
+// vo.setDywc(item.getWc());
+// if (CollUtil.isNotEmpty(itemVoListSRMonLastYear)){
+// itemVoListSRMonLastYear.stream().forEach(item1->{
+// if (StrUtil.equals(vo.getBkmc(),item1.getBkmc())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
+// BigDecimal percent = vo.getDywc().subtract(item1.getWc()).divide(item1.getWc(),10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// vo.setYtqb(percent.setScale(2,RoundingMode.HALF_UP)+"%");
+// }
+// });
+// }
+// list.add(vo);
+// });
+// }
+// List<GcpbkwcqkItemVo> itemVoListSRYear = contractOutBoundMapper.gcpbkwcqk(yearstart,yearend);
+// List<GcpbkwcqkItemVo> itemVoListSRYearLastYear = contractOutBoundMapper.gcpbkwcqk(yearstartLastYear,yearendLastYear);
+// if (CollUtil.isNotEmpty(list)&&CollUtil.isNotEmpty(itemVoListSRYear)){
+// BigDecimal ljzh = itemVoListSRYear.stream().map(item->item.getWc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add);
+// for (GcpbkwcqkVo vo:list
+// ) {
+// for (GcpbkwcqkItemVo itemVo:itemVoListSRYear
+// ) {
+// if (StrUtil.equals(vo.getBkmc(),itemVo.getBkmc())&&StrUtil.equals(vo.getXm(),"閿�鍞敹鍏�")){
+// vo.setLjwc(itemVo.getWc());
+// if (ljzh.compareTo(new BigDecimal("0"))>0){
+// BigDecimal zb = vo.getLjwc().divide(ljzh,10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// vo.setBnzb(zb.setScale(2,RoundingMode.HALF_UP)+"%");
+// }
+// }
+// if (CollUtil.isNotEmpty(itemVoListSRYearLastYear)){
+// BigDecimal qnljzh = itemVoListSRYearLastYear.stream().map(item->item.getWc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add);
+//
+// itemVoListSRYearLastYear.stream().forEach(item1->{
+// if (StrUtil.equals(vo.getBkmc(),item1.getBkmc())&&StrUtil.equals(vo.getXm(),"閿�鍞敹鍏�")&&
+// item1.getWc().compareTo(new BigDecimal("0"))>0){
+// BigDecimal percent = vo.getDywc().subtract(item1.getWc()).divide(item1.getWc(),10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// vo.setNtqb(percent.setScale(2,RoundingMode.HALF_UP)+"%");
+// }
+// if (qnljzh.compareTo(new BigDecimal("0"))>0){
+// BigDecimal qnzb = item1.getWc().divide(qnljzh,10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// if (StrUtil.isNotBlank(vo.getBnzb())){
+// BigDecimal bnzb = new BigDecimal(vo.getBnzb().substring(0,vo.getBnzb().length()-1));
+// vo.setZtqb(bnzb.subtract(qnzb)+"%");
+// }
+// }
+// });
+// }
+// }
+// }
+// }
+// //璐ф鍥炴敹
+// List<GcpbkwcqkItemVo> itemVoListSKMon = contractSubjectMatterMapper.gcpbkwcqkBySK(monstart,monend);
+// List<GcpbkwcqkItemVo> itemVoListSKMonLastYear = contractSubjectMatterMapper.gcpbkwcqkBySK(monstartLastYear,monendLastYear);
+// if (CollUtil.isNotEmpty(itemVoListSKMon)){
+// itemVoListSKMon.stream().forEach(item->{
+// GcpbkwcqkVo vo = new GcpbkwcqkVo();
+// vo.setXm("璐ф鍥炴敹");
+// vo.setBkmc(item.getBkmc());
+// vo.setDywc(item.getWc());
+// if (CollUtil.isNotEmpty(itemVoListSKMonLastYear)){
+// itemVoListSKMonLastYear.stream().forEach(item1->{
+// if (StrUtil.equals(vo.getBkmc(),item1.getBkmc())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
+// BigDecimal percent = vo.getDywc().subtract(item1.getWc()).divide(item1.getWc(),10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// vo.setYtqb(percent.setScale(2,RoundingMode.HALF_UP)+"%");
+// }
+// });
+// }
+// list.add(vo);
+// });
+// }
+// List<GcpbkwcqkItemVo> itemVoListSKYear = contractSubjectMatterMapper.gcpbkwcqkBySK(yearstart,yearend);
+// List<GcpbkwcqkItemVo> itemVoListSKYearLastYear = contractSubjectMatterMapper.gcpbkwcqkBySK(yearstartLastYear,yearendLastYear);
+// if (CollUtil.isNotEmpty(list)&&CollUtil.isNotEmpty(itemVoListSKYear)){
+// for (GcpbkwcqkVo vo:list
+// ) {
+// for (GcpbkwcqkItemVo itemVo:itemVoListSKYear
+// ) {
+// if (StrUtil.equals(vo.getBkmc(),itemVo.getBkmc())&&StrUtil.equals(vo.getXm(),"璐ф鍥炴敹")){
+// vo.setLjwc(itemVo.getWc());
+// }
+// if (CollUtil.isNotEmpty(itemVoListSKYearLastYear)){
+// BigDecimal qnljzh = itemVoListSKYearLastYear.stream().map(item->item.getWc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add);
+// itemVoListSKYearLastYear.stream().forEach(item1->{
+// if (StrUtil.equals(vo.getBkmc(),item1.getBkmc())&&StrUtil.equals(vo.getXm(),"璐ф鍥炴敹")&&
+// item1.getWc().compareTo(new BigDecimal("0"))>0){
+// BigDecimal percent = vo.getDywc().subtract(item1.getWc()).divide(item1.getWc(),10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// vo.setNtqb(percent.setScale(2,RoundingMode.HALF_UP)+"%");
+// }
+// if (qnljzh.compareTo(new BigDecimal("0"))>0){
+// BigDecimal qnzb = item1.getWc().divide(qnljzh,10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// if (StrUtil.isNotBlank(vo.getBnzb())){
+// BigDecimal bnzb = new BigDecimal(vo.getBnzb().substring(0,vo.getBnzb().length()-1));
+// vo.setZtqb(bnzb.subtract(qnzb)+"%");
+// }
+// }
+// });
+// }
+// }
+// }
+// }
return R.ok(list);
}
@@ -539,76 +556,82 @@
if (StrUtil.isBlank(queryDTO.getYearMonth())){
return R.failed("鏌ヨ骞存湀涓嶈兘涓虹┖");
}
+ List<ZbStatisticZdgz> xszbList = zbStatisticZdgzMapper.selectList(Wrappers.<ZbStatisticZdgz>lambdaQuery()
+ .eq(ZbStatisticZdgz::getStatYm,queryDTO.getYearMonth()));
+ if (CollUtil.isNotEmpty(xszbList)){
+ List<SckfzdgzwcqkVo> list = BeanUtil.copyToList(xszbList,SckfzdgzwcqkVo.class);
+ return R.ok(list);
+ }
List<SckfzdgzwcqkVo> list = new ArrayList<>();
- Date monstart = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00");
- Date monend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
- Date monstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00"),-1);
- Date monendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),-1);
- Date yearstart = DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0,4)+"-01-01 00:00:00");
- Date yearend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
- Date yearstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0,4)+"-01-01 00:00:00"),-1);
- Date yearendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),-1);
- //鏂板鍚堝悓
- List<GcpbkwcqkItemVo> itemVoListMon = contractSubjectMatterMapper.sckfzdgzwcqk(monstart,monend);
- if (CollUtil.isNotEmpty(itemVoListMon)){
- itemVoListMon.stream().forEach(item->{
- SckfzdgzwcqkVo vo = new SckfzdgzwcqkVo();
- vo.setDw(item.getDw());
- vo.setXm(item.getXm());
- vo.setDywc(item.getWc());
- Long compId = null;
- if (StrUtil.equals(item.getDw(),"鐭崇叅鏈�")){
- compId = 2089995177814495234L;
- }
- if (StrUtil.equals(item.getDw(),"鐭冲伐娉�")){
- compId = 2056556196124250113L;
- }
- if (StrUtil.equals(item.getDw(),"閫氭柟鍘�")){
- compId = 2056556317461270529L;
- }
- if (StrUtil.equals(item.getDw(),"閭㈠彴鍘�")){
- compId = 2056556421857497090L;
- }
- AnnualPlanKey plan = annualPlanKeyMapper.selectOne(Wrappers.<AnnualPlanKey>lambdaQuery()
- .eq(AnnualPlanKey::getPlanYear, queryDTO.getYearMonth().substring(0,4)).eq(AnnualPlanKey::getPlanType, item.getCode())
- .eq(AnnualPlanKey::getCompId, compId).last("limit 1"));
- if (ObjUtil.isNotNull(plan)){
- vo.setDyjh(plan.getMonthAmount(queryDTO.getYearMonth().substring(5)));
- vo.setLjjh(plan.getToMonTotalAmount(queryDTO.getYearMonth().substring(5)));
- if (vo.getDyjh().compareTo(new BigDecimal("0"))>0){
- vo.setYwcl(vo.getDywc().divide(vo.getDyjh(),10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
- .setScale(2,RoundingMode.HALF_UP)+"%");
- }
- }
- list.add(vo);
- });
- }
- List<GcpbkwcqkItemVo> itemVoListYear = contractSubjectMatterMapper.sckfzdgzwcqk(yearstart,yearend);
- List<GcpbkwcqkItemVo> itemVoListYearLastYear = contractSubjectMatterMapper.sckfzdgzwcqk(yearstartLastYear,yearendLastYear);
- if (CollUtil.isNotEmpty(list)&&CollUtil.isNotEmpty(itemVoListYear)){
- for (SckfzdgzwcqkVo vo:list
- ) {
- for (GcpbkwcqkItemVo itemVo:itemVoListYear
- ) {
- if (StrUtil.equals(vo.getDw(),itemVo.getDw())&&StrUtil.equals(vo.getXm(),itemVo.getXm())){
- vo.setLjwc(itemVo.getWc());
- if (ObjUtil.isNotNull(vo.getLjjh())&&vo.getLjjh().compareTo(new BigDecimal("0"))>0){
- vo.setLjwcl(vo.getLjwc().divide(vo.getLjjh(),10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
- .setScale(2,RoundingMode.HALF_UP)+"%");
- }
- }
- if (CollUtil.isNotEmpty(itemVoListYearLastYear)){
- itemVoListYearLastYear.stream().forEach(item1->{
- if (StrUtil.equals(vo.getDw(),item1.getDw())&&StrUtil.equals(vo.getXm(),itemVo.getXm())&&
- item1.getWc().compareTo(new BigDecimal("0"))>0){
- BigDecimal percent = vo.getLjwc().subtract(item1.getWc()).divide(item1.getWc(),10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
- vo.setLjtb(percent.setScale(2,RoundingMode.HALF_UP)+"%");
- }
- });
- }
- }
- }
- }
+// Date monstart = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00");
+// Date monend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
+// Date monstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00"),-1);
+// Date monendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),-1);
+// Date yearstart = DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0,4)+"-01-01 00:00:00");
+// Date yearend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
+// Date yearstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0,4)+"-01-01 00:00:00"),-1);
+// Date yearendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),-1);
+// //鏂板鍚堝悓
+// List<GcpbkwcqkItemVo> itemVoListMon = contractSubjectMatterMapper.sckfzdgzwcqk(monstart,monend);
+// if (CollUtil.isNotEmpty(itemVoListMon)){
+// itemVoListMon.stream().forEach(item->{
+// SckfzdgzwcqkVo vo = new SckfzdgzwcqkVo();
+// vo.setDw(item.getDw());
+// vo.setXm(item.getXm());
+// vo.setDywc(item.getWc());
+// Long compId = null;
+// if (StrUtil.equals(item.getDw(),"鐭崇叅鏈�")){
+// compId = 2089995177814495234L;
+// }
+// if (StrUtil.equals(item.getDw(),"鐭冲伐娉�")){
+// compId = 2056556196124250113L;
+// }
+// if (StrUtil.equals(item.getDw(),"閫氭柟鍘�")){
+// compId = 2056556317461270529L;
+// }
+// if (StrUtil.equals(item.getDw(),"閭㈠彴鍘�")){
+// compId = 2056556421857497090L;
+// }
+// AnnualPlanKey plan = annualPlanKeyMapper.selectOne(Wrappers.<AnnualPlanKey>lambdaQuery()
+// .eq(AnnualPlanKey::getPlanYear, queryDTO.getYearMonth().substring(0,4)).eq(AnnualPlanKey::getPlanType, item.getCode())
+// .eq(AnnualPlanKey::getCompId, compId).last("limit 1"));
+// if (ObjUtil.isNotNull(plan)){
+// vo.setDyjh(plan.getMonthAmount(queryDTO.getYearMonth().substring(5)));
+// vo.setLjjh(plan.getToMonTotalAmount(queryDTO.getYearMonth().substring(5)));
+// if (vo.getDyjh().compareTo(new BigDecimal("0"))>0){
+// vo.setYwcl(vo.getDywc().divide(vo.getDyjh(),10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2,RoundingMode.HALF_UP)+"%");
+// }
+// }
+// list.add(vo);
+// });
+// }
+// List<GcpbkwcqkItemVo> itemVoListYear = contractSubjectMatterMapper.sckfzdgzwcqk(yearstart,yearend);
+// List<GcpbkwcqkItemVo> itemVoListYearLastYear = contractSubjectMatterMapper.sckfzdgzwcqk(yearstartLastYear,yearendLastYear);
+// if (CollUtil.isNotEmpty(list)&&CollUtil.isNotEmpty(itemVoListYear)){
+// for (SckfzdgzwcqkVo vo:list
+// ) {
+// for (GcpbkwcqkItemVo itemVo:itemVoListYear
+// ) {
+// if (StrUtil.equals(vo.getDw(),itemVo.getDw())&&StrUtil.equals(vo.getXm(),itemVo.getXm())){
+// vo.setLjwc(itemVo.getWc());
+// if (ObjUtil.isNotNull(vo.getLjjh())&&vo.getLjjh().compareTo(new BigDecimal("0"))>0){
+// vo.setLjwcl(vo.getLjwc().divide(vo.getLjjh(),10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2,RoundingMode.HALF_UP)+"%");
+// }
+// }
+// if (CollUtil.isNotEmpty(itemVoListYearLastYear)){
+// itemVoListYearLastYear.stream().forEach(item1->{
+// if (StrUtil.equals(vo.getDw(),item1.getDw())&&StrUtil.equals(vo.getXm(),itemVo.getXm())&&
+// item1.getWc().compareTo(new BigDecimal("0"))>0){
+// BigDecimal percent = vo.getLjwc().subtract(item1.getWc()).divide(item1.getWc(),10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// vo.setLjtb(percent.setScale(2,RoundingMode.HALF_UP)+"%");
+// }
+// });
+// }
+// }
+// }
+// }
return R.ok(list);
}
@@ -617,512 +640,518 @@
if (StrUtil.isBlank(queryDTO.getYearMonth())){
return R.failed("鏌ヨ骞存湀涓嶈兘涓虹┖");
}
+ List<ZbStatisticZxyw> xszbList = zbStatisticZxywMapper.selectList(Wrappers.<ZbStatisticZxyw>lambdaQuery()
+ .eq(ZbStatisticZxyw::getStatYm,queryDTO.getYearMonth()));
+ if (CollUtil.isNotEmpty(xszbList)){
+ List<PjdxcksxywwcqkVo> list = BeanUtil.copyToList(xszbList,PjdxcksxywwcqkVo.class);
+ return R.ok(list);
+ }
List<PjdxcksxywwcqkVo> list = new ArrayList<>();
- Date monstart = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00");
- Date monend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
- Date monstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00"),-1);
- Date monendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),-1);
- Date yearstart = DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0,4)+"-01-01 00:00:00");
- Date yearend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
- Date yearstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0,4)+"-01-01 00:00:00"),-1);
- Date yearendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),-1);
-
- if (true){
- //閰嶄欢寮�绁�
- List<GcpbkwcqkItemVo> itemVoListMon = contractInvoiceMapper.pjsxywwcqk("1",monstart,monend);
- List<GcpbkwcqkItemVo> itemVoListMonrLastYear = contractInvoiceMapper.pjsxywwcqk("1",monstartLastYear,monstartLastYear);
- if (CollUtil.isNotEmpty(itemVoListMon)){
- itemVoListMon.stream().forEach(item->{
- PjdxcksxywwcqkVo vo = new PjdxcksxywwcqkVo();
- vo.setYw(item.getYw());
- vo.setLb(item.getLb());
- vo.setDw(item.getDw());
- vo.setDywc(item.getWc());
- if (CollUtil.isNotEmpty(itemVoListMonrLastYear)){
- itemVoListMon.stream().forEach(item1-> {
- if (StrUtil.equals(vo.getYw(),item1.getYw())&&StrUtil.equals(vo.getLb(),item1.getLb())&&
- StrUtil.equals(vo.getDw(),item1.getDw())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
- vo.setQnwc(item1.getWc());
- vo.setYtb(vo.getDywc().subtract(item1.getWc()));
- if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
- vo.setYtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
- }
- }
- });
- }
- list.add(vo);
- });
- PjdxcksxywwcqkVo vo = new PjdxcksxywwcqkVo();
- vo.setYw(itemVoListMon.get(0).getYw());
- vo.setLb(itemVoListMon.get(0).getLb());
- vo.setDw("闆嗗洟");
- vo.setDywc(itemVoListMon.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
- if (CollUtil.isNotEmpty(itemVoListMonrLastYear)){
- vo.setQnwc(itemVoListMonrLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
- vo.setYtb(vo.getDywc().subtract(vo.getQnwc()));
- if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
- vo.setYtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
- }
-
- }
- list.add(vo);
- }
- List<GcpbkwcqkItemVo> itemVoListYear = contractInvoiceMapper.pjsxywwcqk("1",yearstart,yearend);
- List<GcpbkwcqkItemVo> itemVoListYearLastYear = contractInvoiceMapper.pjsxywwcqk("1",yearstartLastYear,yearendLastYear);
- if (CollUtil.isNotEmpty(list)&&CollUtil.isNotEmpty(itemVoListYear)){
- for (PjdxcksxywwcqkVo vo:list
- ) {
- for (GcpbkwcqkItemVo itemVo:itemVoListYear
- ) {
- if (StrUtil.equals(vo.getYw(),itemVo.getYw())&&StrUtil.equals(vo.getLb(),itemVo.getLb())&&
- StrUtil.equals(vo.getDw(),itemVo.getDw())){
- vo.setLjwc(itemVo.getWc());
- }
- if (CollUtil.isNotEmpty(itemVoListYearLastYear)){
- itemVoListYearLastYear.stream().forEach(item1->{
- if (StrUtil.equals(vo.getYw(),itemVo.getYw())&&StrUtil.equals(vo.getLb(),itemVo.getLb())&&
- StrUtil.equals(vo.getDw(),itemVo.getDw())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
- vo.setQntq(item1.getWc());
- vo.setLjtb(vo.getLjwc().subtract(vo.getQntq()));
- if (vo.getQntq().compareTo(new BigDecimal("0"))>0) {
- vo.setLjtqb(vo.getLjtb().divide(vo.getQntq(), 2, RoundingMode.HALF_UP) + "%");
- }
- }
- });
- }
- }
- if (StrUtil.equals(vo.getYw(),"閰嶄欢")&&StrUtil.equals(vo.getLb(),"閿�鍞敹鍏�")&&
- StrUtil.equals(vo.getDw(),"闆嗗洟")){
- vo.setLjwc(itemVoListYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
- if (CollUtil.isNotEmpty(itemVoListYearLastYear)){
- vo.setQntq(itemVoListYearLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
- vo.setLjtb(vo.getLjwc().subtract(vo.getQntq()));
- if (vo.getQntq().compareTo(new BigDecimal("0"))>0) {
- vo.setLjtqb(vo.getLjtb().divide(vo.getQntq(), 2, RoundingMode.HALF_UP) + "%");
- }
-
- }
- }
- }
- }
- //閰嶄欢鍚堝悓
- List<GcpbkwcqkItemVo> itemVoListMonHT = contractMapper.pjsxywwcqkHT("1",monstart,monend);
- List<GcpbkwcqkItemVo> itemVoListMonrHTLastYear = contractMapper.pjsxywwcqkHT("1",monstartLastYear,monstartLastYear);
- if (CollUtil.isNotEmpty(itemVoListMonHT)){
- itemVoListMonHT.stream().forEach(item->{
- PjdxcksxywwcqkVo vo = new PjdxcksxywwcqkVo();
- vo.setYw(item.getYw());
- vo.setLb(item.getLb());
- vo.setDw(item.getDw());
- vo.setDywc(item.getWc());
- if (CollUtil.isNotEmpty(itemVoListMonrHTLastYear)){
- itemVoListMonrHTLastYear.stream().forEach(item1-> {
- if (StrUtil.equals(vo.getYw(),item1.getYw())&&StrUtil.equals(vo.getLb(),item1.getLb())&&
- StrUtil.equals(vo.getDw(),item1.getDw())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
- vo.setQnwc(item1.getWc());
- vo.setYtb(vo.getDywc().subtract(item1.getWc()));
- if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
- vo.setYtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
- }
- }
- });
- }
- list.add(vo);
- });
- PjdxcksxywwcqkVo vo = new PjdxcksxywwcqkVo();
- vo.setYw(itemVoListMon.get(0).getYw());
- vo.setLb(itemVoListMon.get(0).getLb());
- vo.setDw("闆嗗洟");
- vo.setDywc(itemVoListMon.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
- if (CollUtil.isNotEmpty(itemVoListMonrHTLastYear)){
- vo.setQnwc(itemVoListMonrHTLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
- vo.setYtb(vo.getDywc().subtract(vo.getQnwc()));
- if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
- vo.setYtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
- }
- }
- list.add(vo);
- }
- List<GcpbkwcqkItemVo> itemVoListYearHT = contractMapper.pjsxywwcqkHT("1",yearstart,yearend);
- List<GcpbkwcqkItemVo> itemVoListYearHTLastYear = contractMapper.pjsxywwcqkHT("1",yearstartLastYear,yearendLastYear);
- if (CollUtil.isNotEmpty(list)&&CollUtil.isNotEmpty(itemVoListYearHT)){
- for (PjdxcksxywwcqkVo vo:list
- ) {
- for (GcpbkwcqkItemVo itemVo:itemVoListYearHT
- ) {
- if (StrUtil.equals(vo.getYw(),itemVo.getYw())&&StrUtil.equals(vo.getLb(),itemVo.getLb())&&
- StrUtil.equals(vo.getDw(),itemVo.getDw())){
- vo.setLjwc(itemVo.getWc());
- }
- if (CollUtil.isNotEmpty(itemVoListYearHTLastYear)){
- itemVoListYearHTLastYear.stream().forEach(item1->{
- if (StrUtil.equals(vo.getYw(),itemVo.getYw())&&StrUtil.equals(vo.getLb(),itemVo.getLb())&&
- StrUtil.equals(vo.getDw(),itemVo.getDw())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
- vo.setQntq(item1.getWc());
- vo.setLjtb(vo.getLjwc().subtract(item1.getWc()));
- if (vo.getQntq().compareTo(new BigDecimal("0"))>0) {
- vo.setLjtqb(vo.getLjtb().divide(vo.getQntq(), 2, RoundingMode.HALF_UP) + "%");
- }
- }
- });
- }
- }
- if (StrUtil.equals(vo.getYw(),"閰嶄欢")&&StrUtil.equals(vo.getLb(),"鏂板鍚堝悓")&&
- StrUtil.equals(vo.getDw(),"闆嗗洟")){
- vo.setLjwc(itemVoListYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
- if (CollUtil.isNotEmpty(itemVoListYearHTLastYear)){
- vo.setQntq(itemVoListYearHTLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
- vo.setLjtb(vo.getLjwc().subtract(vo.getQntq()));
- if (vo.getQntq().compareTo(new BigDecimal("0"))>0) {
- vo.setLjtqb(vo.getLjtb().divide(vo.getQntq(), 2, RoundingMode.HALF_UP) + "%");
- }
-
- }
- }
- }
- }
- }
- if (true){
- //澶т慨寮�绁�
- List<GcpbkwcqkItemVo> itemVoListMon = contractInvoiceMapper.dxsxywwcqk("2",monstart,monend);
- List<GcpbkwcqkItemVo> itemVoListMonrLastYear = contractInvoiceMapper.dxsxywwcqk("2",monstartLastYear,monendLastYear);
- if (CollUtil.isNotEmpty(itemVoListMon)){
- itemVoListMon.stream().forEach(item->{
- PjdxcksxywwcqkVo vo = new PjdxcksxywwcqkVo();
- vo.setYw(item.getYw());
- vo.setLb(item.getLb());
- vo.setDw(item.getDw());
- vo.setDywc(item.getWc());
- if (CollUtil.isNotEmpty(itemVoListMonrLastYear)){
- itemVoListMon.stream().forEach(item1-> {
- if (StrUtil.equals(vo.getYw(),item1.getYw())&&StrUtil.equals(vo.getLb(),item1.getLb())&&
- StrUtil.equals(vo.getDw(),item1.getDw())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
- vo.setQnwc(item1.getWc());
- vo.setYtb(vo.getDywc().subtract(item1.getWc()));
- if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
- vo.setYtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
- }
- }
- });
- }
- list.add(vo);
- });
- PjdxcksxywwcqkVo vo = new PjdxcksxywwcqkVo();
- vo.setYw(itemVoListMon.get(0).getYw());
- vo.setLb(itemVoListMon.get(0).getLb());
- vo.setDw("闆嗗洟");
- vo.setDywc(itemVoListMon.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
- if (CollUtil.isNotEmpty(itemVoListMonrLastYear)){
- vo.setQnwc(itemVoListMonrLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
- vo.setYtb(vo.getDywc().subtract(vo.getQnwc()));
- if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
- vo.setYtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
- }
-
- }
- list.add(vo);
- }
- List<GcpbkwcqkItemVo> itemVoListYear = contractInvoiceMapper.dxsxywwcqk("2",yearstart,yearend);
- List<GcpbkwcqkItemVo> itemVoListYearLastYear = contractInvoiceMapper.dxsxywwcqk("2",yearstartLastYear,yearendLastYear);
- if (CollUtil.isNotEmpty(list)&&CollUtil.isNotEmpty(itemVoListYear)){
- for (PjdxcksxywwcqkVo vo:list
- ) {
- for (GcpbkwcqkItemVo itemVo:itemVoListYear
- ) {
- if (StrUtil.equals(vo.getYw(),itemVo.getYw())&&StrUtil.equals(vo.getLb(),itemVo.getLb())&&
- StrUtil.equals(vo.getDw(),itemVo.getDw())){
- vo.setLjwc(itemVo.getWc());
- }
- if (CollUtil.isNotEmpty(itemVoListYearLastYear)){
- itemVoListYearLastYear.stream().forEach(item1->{
- if (StrUtil.equals(vo.getYw(),itemVo.getYw())&&StrUtil.equals(vo.getLb(),itemVo.getLb())&&
- StrUtil.equals(vo.getDw(),itemVo.getDw())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
- vo.setQntq(item1.getWc());
- vo.setLjtb(vo.getLjwc().subtract(item1.getWc()));
- if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
- vo.setLjtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
- }
- }
- });
- }
- }
- if (StrUtil.equals(vo.getYw(),"澶т慨")&&StrUtil.equals(vo.getLb(),"閿�鍞敹鍏�")&&
- StrUtil.equals(vo.getDw(),"闆嗗洟")){
- vo.setLjwc(itemVoListYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
- if (CollUtil.isNotEmpty(itemVoListYearLastYear)){
- vo.setQntq(itemVoListYearLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
- vo.setLjtb(vo.getLjwc().subtract(vo.getQntq()));
- if (vo.getQntq().compareTo(new BigDecimal("0"))>0) {
- vo.setLjtqb(vo.getLjtb().divide(vo.getQntq(), 2, RoundingMode.HALF_UP) + "%");
- }
-
- }
- }
- }
- }
- //澶т慨鍚堝悓
- List<GcpbkwcqkItemVo> itemVoListMonHT = contractMapper.dxsxywwcqkHT("2",monstart,monend);
- List<GcpbkwcqkItemVo> itemVoListMonrHTLastYear = contractMapper.dxsxywwcqkHT("2",monstartLastYear,monendLastYear);
- if (CollUtil.isNotEmpty(itemVoListMonHT)){
- itemVoListMonHT.stream().forEach(item->{
- PjdxcksxywwcqkVo vo = new PjdxcksxywwcqkVo();
- vo.setYw(item.getYw());
- vo.setLb(item.getLb());
- vo.setDw(item.getDw());
- vo.setDywc(item.getWc());
- if (CollUtil.isNotEmpty(itemVoListMonrHTLastYear)){
- itemVoListMonrHTLastYear.stream().forEach(item1-> {
- if (StrUtil.equals(vo.getYw(),item1.getYw())&&StrUtil.equals(vo.getLb(),item1.getLb())&&
- StrUtil.equals(vo.getDw(),item1.getDw())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
- vo.setQnwc(item1.getWc());
- vo.setYtb(vo.getDywc().subtract(item1.getWc()));
- if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
- vo.setYtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
- }
- }
- });
- }
- list.add(vo);
- });
- PjdxcksxywwcqkVo vo = new PjdxcksxywwcqkVo();
- vo.setYw(itemVoListMon.get(0).getYw());
- vo.setLb(itemVoListMon.get(0).getLb());
- vo.setDw("闆嗗洟");
- vo.setDywc(itemVoListMon.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
- if (CollUtil.isNotEmpty(itemVoListMonrHTLastYear)){
- vo.setQnwc(itemVoListMonrHTLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
- vo.setYtb(vo.getDywc().subtract(vo.getQnwc()));
- if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
- vo.setYtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
- }
-
- }
- list.add(vo);
- }
- List<GcpbkwcqkItemVo> itemVoListYearHT = contractMapper.dxsxywwcqkHT("2",yearstart,yearend);
- List<GcpbkwcqkItemVo> itemVoListYearHTLastYear = contractMapper.dxsxywwcqkHT("2",yearstartLastYear,yearendLastYear);
- if (CollUtil.isNotEmpty(list)&&CollUtil.isNotEmpty(itemVoListYearHT)){
- for (PjdxcksxywwcqkVo vo:list
- ) {
- for (GcpbkwcqkItemVo itemVo:itemVoListYearHT
- ) {
- if (StrUtil.equals(vo.getYw(),itemVo.getYw())&&StrUtil.equals(vo.getLb(),itemVo.getLb())&&
- StrUtil.equals(vo.getDw(),itemVo.getDw())){
- vo.setLjwc(itemVo.getWc());
- }
- if (CollUtil.isNotEmpty(itemVoListYearHTLastYear)){
- itemVoListYearHTLastYear.stream().forEach(item1->{
- if (StrUtil.equals(vo.getYw(),itemVo.getYw())&&StrUtil.equals(vo.getLb(),itemVo.getLb())&&
- StrUtil.equals(vo.getDw(),itemVo.getDw())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
- vo.setQntq(item1.getWc());
- vo.setLjtb(vo.getLjwc().subtract(item1.getWc()));
- if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
- vo.setLjtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
- }
- }
- });
- }
- }
- if (StrUtil.equals(vo.getYw(),"澶т慨")&&StrUtil.equals(vo.getLb(),"鏂板鍚堝悓")&&
- StrUtil.equals(vo.getDw(),"闆嗗洟")){
- vo.setLjwc(itemVoListYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
- if (CollUtil.isNotEmpty(itemVoListYearHTLastYear)){
- vo.setQntq(itemVoListYearHTLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
- vo.setLjtb(vo.getLjwc().subtract(vo.getQntq()));
- if (vo.getQntq().compareTo(new BigDecimal("0"))>0) {
- vo.setLjtqb(vo.getLjtb().divide(vo.getQntq(), 2, RoundingMode.HALF_UP) + "%");
- }
-
- }
- }
- }
- }
- }
- if (true){
- //鍑哄彛寮�绁�
- List<GcpbkwcqkItemVo> itemVoListMon = contractInvoiceMapper.cksxywwcqk("1",monstart,monend);
- List<GcpbkwcqkItemVo> itemVoListMonrLastYear = contractInvoiceMapper.cksxywwcqk("1",monstartLastYear,monendLastYear);
- if (CollUtil.isNotEmpty(itemVoListMon)){
- itemVoListMon.stream().forEach(item->{
- PjdxcksxywwcqkVo vo = new PjdxcksxywwcqkVo();
- vo.setYw(item.getYw());
- vo.setLb(item.getLb());
- vo.setDw(item.getDw());
- vo.setDywc(item.getWc());
- if (CollUtil.isNotEmpty(itemVoListMonrLastYear)){
- itemVoListMon.stream().forEach(item1-> {
- if (StrUtil.equals(vo.getYw(),item1.getYw())&&StrUtil.equals(vo.getLb(),item1.getLb())&&
- StrUtil.equals(vo.getDw(),item1.getDw())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
- vo.setQnwc(item1.getWc());
- vo.setYtb(vo.getDywc().subtract(item1.getWc()));
- if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
- vo.setYtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
- }
- }
- });
- }
- list.add(vo);
- });
- PjdxcksxywwcqkVo vo = new PjdxcksxywwcqkVo();
- vo.setYw(itemVoListMon.get(0).getYw());
- vo.setLb(itemVoListMon.get(0).getLb());
- vo.setDw("闆嗗洟");
- vo.setDywc(itemVoListMon.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
- if (CollUtil.isNotEmpty(itemVoListMonrLastYear)){
- vo.setQnwc(itemVoListMonrLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
- vo.setYtb(vo.getDywc().subtract(vo.getQnwc()));
- if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
- vo.setYtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
- }
- }
- list.add(vo);
- }
- List<GcpbkwcqkItemVo> itemVoListYear = contractInvoiceMapper.cksxywwcqk("1",yearstart,yearend);
- List<GcpbkwcqkItemVo> itemVoListYearLastYear = contractInvoiceMapper.cksxywwcqk("1",yearstartLastYear,yearendLastYear);
- if (CollUtil.isNotEmpty(list)&&CollUtil.isNotEmpty(itemVoListYear)){
- for (PjdxcksxywwcqkVo vo:list
- ) {
- for (GcpbkwcqkItemVo itemVo:itemVoListYear
- ) {
- if (StrUtil.equals(vo.getYw(),itemVo.getYw())&&StrUtil.equals(vo.getLb(),itemVo.getLb())&&
- StrUtil.equals(vo.getDw(),itemVo.getDw())){
- vo.setLjwc(itemVo.getWc());
- }
- if (CollUtil.isNotEmpty(itemVoListYearLastYear)){
- itemVoListYearLastYear.stream().forEach(item1->{
- if (StrUtil.equals(vo.getYw(),itemVo.getYw())&&StrUtil.equals(vo.getLb(),itemVo.getLb())&&
- StrUtil.equals(vo.getDw(),itemVo.getDw())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
- vo.setQntq(item1.getWc());
- vo.setLjtb(vo.getLjwc().subtract(item1.getWc()));
- if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
- vo.setLjtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
- }
- }
- });
- }
- }
- if (StrUtil.equals(vo.getYw(),"鍑哄彛")&&StrUtil.equals(vo.getLb(),"閿�鍞敹鍏�")&&
- StrUtil.equals(vo.getDw(),"闆嗗洟")){
- vo.setLjwc(itemVoListYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
- if (CollUtil.isNotEmpty(itemVoListYearLastYear)){
- vo.setQntq(itemVoListYearLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
- vo.setLjtb(vo.getLjwc().subtract(vo.getQntq()));
- if (vo.getQntq().compareTo(new BigDecimal("0"))>0) {
- vo.setLjtqb(vo.getLjtb().divide(vo.getQntq(), 2, RoundingMode.HALF_UP) + "%");
- }
- }
- }
- }
- }
- //閰嶄欢鍚堝悓
- List<GcpbkwcqkItemVo> itemVoListMonHT = contractMapper.cksxywwcqkHT("1",monstart,monend);
- List<GcpbkwcqkItemVo> itemVoListMonrHTLastYear = contractMapper.cksxywwcqkHT("1",monstartLastYear,monendLastYear);
- if (CollUtil.isNotEmpty(itemVoListMonHT)){
- itemVoListMonHT.stream().forEach(item->{
- PjdxcksxywwcqkVo vo = new PjdxcksxywwcqkVo();
- vo.setYw(item.getYw());
- vo.setLb(item.getLb());
- vo.setDw(item.getDw());
- vo.setDywc(item.getWc());
- if (CollUtil.isNotEmpty(itemVoListMonrHTLastYear)){
- itemVoListMonrHTLastYear.stream().forEach(item1-> {
- if (StrUtil.equals(vo.getYw(),item1.getYw())&&StrUtil.equals(vo.getLb(),item1.getLb())&&
- StrUtil.equals(vo.getDw(),item1.getDw())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
- vo.setQnwc(item1.getWc());
- vo.setYtb(vo.getDywc().subtract(item1.getWc()));
- if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
- vo.setYtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
- }
- }
- });
- }
- list.add(vo);
- });
- PjdxcksxywwcqkVo vo = new PjdxcksxywwcqkVo();
- vo.setYw(itemVoListMon.get(0).getYw());
- vo.setLb(itemVoListMon.get(0).getLb());
- vo.setDw("闆嗗洟");
- vo.setDywc(itemVoListMon.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
- if (CollUtil.isNotEmpty(itemVoListMonrHTLastYear)){
- vo.setQnwc(itemVoListMonrHTLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
- vo.setYtb(vo.getDywc().subtract(vo.getQnwc()));
- if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
- vo.setYtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
- }
-
- }
- list.add(vo);
- }
- List<GcpbkwcqkItemVo> itemVoListYearHT = contractMapper.cksxywwcqkHT("1",yearstart,yearend);
- List<GcpbkwcqkItemVo> itemVoListYearHTLastYear = contractMapper.cksxywwcqkHT("1",yearstartLastYear,yearendLastYear);
- if (CollUtil.isNotEmpty(list)&&CollUtil.isNotEmpty(itemVoListYearHT)){
- for (PjdxcksxywwcqkVo vo:list
- ) {
- for (GcpbkwcqkItemVo itemVo:itemVoListYearHT
- ) {
- if (StrUtil.equals(vo.getYw(),itemVo.getYw())&&StrUtil.equals(vo.getLb(),itemVo.getLb())&&
- StrUtil.equals(vo.getDw(),itemVo.getDw())){
- vo.setLjwc(itemVo.getWc());
- }
- if (CollUtil.isNotEmpty(itemVoListYearHTLastYear)){
- itemVoListYearHTLastYear.stream().forEach(item1->{
- if (StrUtil.equals(vo.getYw(),itemVo.getYw())&&StrUtil.equals(vo.getLb(),itemVo.getLb())&&
- StrUtil.equals(vo.getDw(),itemVo.getDw())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
- vo.setQntq(item1.getWc());
- vo.setLjtb(vo.getLjwc().subtract(item1.getWc()));
- if (vo.getQntq().compareTo(new BigDecimal("0"))>0) {
- vo.setLjtqb(vo.getLjtb().divide(vo.getQntq(), 2, RoundingMode.HALF_UP) + "%");
- }
- }
- });
- }
- }
- if (StrUtil.equals(vo.getYw(),"鍑哄彛")&&StrUtil.equals(vo.getLb(),"鏂板鍚堝悓")&&
- StrUtil.equals(vo.getDw(),"闆嗗洟")){
- vo.setLjwc(itemVoListYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
- if (CollUtil.isNotEmpty(itemVoListYearHTLastYear)){
- vo.setQntq(itemVoListYearHTLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
- vo.setLjtb(vo.getLjwc().subtract(vo.getQntq()));
- if (vo.getQntq().compareTo(new BigDecimal("0"))>0) {
- vo.setLjtqb(vo.getLjtb().divide(vo.getQntq(), 2, RoundingMode.HALF_UP) + "%");
- }
-
- }
- }
- }
- }
- }
- if (CollUtil.isNotEmpty(list)){
- String[] arrLb = {"閿�鍞敹鍏�", "鏂板鍚堝悓"};
- String[] arrDw = {"鐭崇叅鏈�", "鐭冲伐娉�", "閭㈠彴鍘�", "閫氭柟鍘�","闆嗗洟"};
- for (int i = 0; i < arrLb.length; i++) {
- for (int j = 0; j < arrDw.length; j++) {
- PjdxcksxywwcqkVo vosmj = new PjdxcksxywwcqkVo();
- vosmj.setYw("浠ヤ笂涓夐」鍚堣");
- String lb = arrLb[i];
- String dw = arrDw[j];
- vosmj.setLb(lb);
- vosmj.setDw(dw);
- vosmj.setDywc(list.stream().filter(item->item.getLb().equals(lb)&&item.getDw().equals(dw)).collect(Collectors.toList())
- .stream().map(item->item.getDywc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
- vosmj.setQnwc(list.stream().filter(item->item.getLb().equals(lb)&&item.getDw().equals(dw)).collect(Collectors.toList())
- .stream().map(item->item.getQnwc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
- vosmj.setYtb(vosmj.getDywc().subtract(vosmj.getQnwc()));
- if (vosmj.getQnwc().compareTo(new BigDecimal("0"))>0){
- vosmj.setYtqb(vosmj.getYtb().divide(vosmj.getQnwc(),2,RoundingMode.HALF_UP)+"%");
- }
- vosmj.setLjwc(list.stream().filter(item->item.getLb().equals(lb)&&item.getDw().equals(dw)).collect(Collectors.toList())
- .stream().map(item->item.getLjwc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
- vosmj.setQntq(list.stream().filter(item->item.getLb().equals(lb)&&item.getDw().equals(dw)).collect(Collectors.toList())
- .stream().map(item->item.getQntq()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
- vosmj.setLjtb(vosmj.getLjwc().subtract(vosmj.getQntq()));
- if (vosmj.getQntq().compareTo(new BigDecimal("0"))>0){
- vosmj.setLjtqb(vosmj.getLjtb().divide(vosmj.getQntq(),2,RoundingMode.HALF_UP)+"%");
- }
- list.add(vosmj);
- }
- }
- }
+// Date monstart = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00");
+// Date monend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
+// Date monstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00"),-1);
+// Date monendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),-1);
+// Date yearstart = DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0,4)+"-01-01 00:00:00");
+// Date yearend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
+// Date yearstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0,4)+"-01-01 00:00:00"),-1);
+// Date yearendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),-1);
+//
+// if (true){
+// //閰嶄欢寮�绁�
+// List<GcpbkwcqkItemVo> itemVoListMon = contractInvoiceMapper.pjsxywwcqk("1",monstart,monend);
+// List<GcpbkwcqkItemVo> itemVoListMonrLastYear = contractInvoiceMapper.pjsxywwcqk("1",monstartLastYear,monstartLastYear);
+// if (CollUtil.isNotEmpty(itemVoListMon)){
+// itemVoListMon.stream().forEach(item->{
+// PjdxcksxywwcqkVo vo = new PjdxcksxywwcqkVo();
+// vo.setYw(item.getYw());
+// vo.setLb(item.getLb());
+// vo.setDw(item.getDw());
+// vo.setDywc(item.getWc());
+// if (CollUtil.isNotEmpty(itemVoListMonrLastYear)){
+// itemVoListMon.stream().forEach(item1-> {
+// if (StrUtil.equals(vo.getYw(),item1.getYw())&&StrUtil.equals(vo.getLb(),item1.getLb())&&
+// StrUtil.equals(vo.getDw(),item1.getDw())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
+// vo.setQnwc(item1.getWc());
+// vo.setYtb(vo.getDywc().subtract(item1.getWc()));
+// if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
+// vo.setYtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// });
+// }
+// list.add(vo);
+// });
+// PjdxcksxywwcqkVo vo = new PjdxcksxywwcqkVo();
+// vo.setYw(itemVoListMon.get(0).getYw());
+// vo.setLb(itemVoListMon.get(0).getLb());
+// vo.setDw("闆嗗洟");
+// vo.setDywc(itemVoListMon.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// if (CollUtil.isNotEmpty(itemVoListMonrLastYear)){
+// vo.setQnwc(itemVoListMonrLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// vo.setYtb(vo.getDywc().subtract(vo.getQnwc()));
+// if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
+// vo.setYtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
+// }
+//
+// }
+// list.add(vo);
+// }
+// List<GcpbkwcqkItemVo> itemVoListYear = contractInvoiceMapper.pjsxywwcqk("1",yearstart,yearend);
+// List<GcpbkwcqkItemVo> itemVoListYearLastYear = contractInvoiceMapper.pjsxywwcqk("1",yearstartLastYear,yearendLastYear);
+// if (CollUtil.isNotEmpty(list)&&CollUtil.isNotEmpty(itemVoListYear)){
+// for (PjdxcksxywwcqkVo vo:list
+// ) {
+// for (GcpbkwcqkItemVo itemVo:itemVoListYear
+// ) {
+// if (StrUtil.equals(vo.getYw(),itemVo.getYw())&&StrUtil.equals(vo.getLb(),itemVo.getLb())&&
+// StrUtil.equals(vo.getDw(),itemVo.getDw())){
+// vo.setLjwc(itemVo.getWc());
+// }
+// if (CollUtil.isNotEmpty(itemVoListYearLastYear)){
+// itemVoListYearLastYear.stream().forEach(item1->{
+// if (StrUtil.equals(vo.getYw(),itemVo.getYw())&&StrUtil.equals(vo.getLb(),itemVo.getLb())&&
+// StrUtil.equals(vo.getDw(),itemVo.getDw())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
+// vo.setQntq(item1.getWc());
+// vo.setLjtb(vo.getLjwc().subtract(vo.getQntq()));
+// if (vo.getQntq().compareTo(new BigDecimal("0"))>0) {
+// vo.setLjtqb(vo.getLjtb().divide(vo.getQntq(), 2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// });
+// }
+// }
+// if (StrUtil.equals(vo.getYw(),"閰嶄欢")&&StrUtil.equals(vo.getLb(),"閿�鍞敹鍏�")&&
+// StrUtil.equals(vo.getDw(),"闆嗗洟")){
+// vo.setLjwc(itemVoListYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// if (CollUtil.isNotEmpty(itemVoListYearLastYear)){
+// vo.setQntq(itemVoListYearLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// vo.setLjtb(vo.getLjwc().subtract(vo.getQntq()));
+// if (vo.getQntq().compareTo(new BigDecimal("0"))>0) {
+// vo.setLjtqb(vo.getLjtb().divide(vo.getQntq(), 2, RoundingMode.HALF_UP) + "%");
+// }
+//
+// }
+// }
+// }
+// }
+// //閰嶄欢鍚堝悓
+// List<GcpbkwcqkItemVo> itemVoListMonHT = contractMapper.pjsxywwcqkHT("1",monstart,monend);
+// List<GcpbkwcqkItemVo> itemVoListMonrHTLastYear = contractMapper.pjsxywwcqkHT("1",monstartLastYear,monstartLastYear);
+// if (CollUtil.isNotEmpty(itemVoListMonHT)){
+// itemVoListMonHT.stream().forEach(item->{
+// PjdxcksxywwcqkVo vo = new PjdxcksxywwcqkVo();
+// vo.setYw(item.getYw());
+// vo.setLb(item.getLb());
+// vo.setDw(item.getDw());
+// vo.setDywc(item.getWc());
+// if (CollUtil.isNotEmpty(itemVoListMonrHTLastYear)){
+// itemVoListMonrHTLastYear.stream().forEach(item1-> {
+// if (StrUtil.equals(vo.getYw(),item1.getYw())&&StrUtil.equals(vo.getLb(),item1.getLb())&&
+// StrUtil.equals(vo.getDw(),item1.getDw())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
+// vo.setQnwc(item1.getWc());
+// vo.setYtb(vo.getDywc().subtract(item1.getWc()));
+// if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
+// vo.setYtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// });
+// }
+// list.add(vo);
+// });
+// PjdxcksxywwcqkVo vo = new PjdxcksxywwcqkVo();
+// vo.setYw(itemVoListMon.get(0).getYw());
+// vo.setLb(itemVoListMon.get(0).getLb());
+// vo.setDw("闆嗗洟");
+// vo.setDywc(itemVoListMon.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// if (CollUtil.isNotEmpty(itemVoListMonrHTLastYear)){
+// vo.setQnwc(itemVoListMonrHTLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// vo.setYtb(vo.getDywc().subtract(vo.getQnwc()));
+// if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
+// vo.setYtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// list.add(vo);
+// }
+// List<GcpbkwcqkItemVo> itemVoListYearHT = contractMapper.pjsxywwcqkHT("1",yearstart,yearend);
+// List<GcpbkwcqkItemVo> itemVoListYearHTLastYear = contractMapper.pjsxywwcqkHT("1",yearstartLastYear,yearendLastYear);
+// if (CollUtil.isNotEmpty(list)&&CollUtil.isNotEmpty(itemVoListYearHT)){
+// for (PjdxcksxywwcqkVo vo:list
+// ) {
+// for (GcpbkwcqkItemVo itemVo:itemVoListYearHT
+// ) {
+// if (StrUtil.equals(vo.getYw(),itemVo.getYw())&&StrUtil.equals(vo.getLb(),itemVo.getLb())&&
+// StrUtil.equals(vo.getDw(),itemVo.getDw())){
+// vo.setLjwc(itemVo.getWc());
+// }
+// if (CollUtil.isNotEmpty(itemVoListYearHTLastYear)){
+// itemVoListYearHTLastYear.stream().forEach(item1->{
+// if (StrUtil.equals(vo.getYw(),itemVo.getYw())&&StrUtil.equals(vo.getLb(),itemVo.getLb())&&
+// StrUtil.equals(vo.getDw(),itemVo.getDw())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
+// vo.setQntq(item1.getWc());
+// vo.setLjtb(vo.getLjwc().subtract(item1.getWc()));
+// if (vo.getQntq().compareTo(new BigDecimal("0"))>0) {
+// vo.setLjtqb(vo.getLjtb().divide(vo.getQntq(), 2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// });
+// }
+// }
+// if (StrUtil.equals(vo.getYw(),"閰嶄欢")&&StrUtil.equals(vo.getLb(),"鏂板鍚堝悓")&&
+// StrUtil.equals(vo.getDw(),"闆嗗洟")){
+// vo.setLjwc(itemVoListYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// if (CollUtil.isNotEmpty(itemVoListYearHTLastYear)){
+// vo.setQntq(itemVoListYearHTLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// vo.setLjtb(vo.getLjwc().subtract(vo.getQntq()));
+// if (vo.getQntq().compareTo(new BigDecimal("0"))>0) {
+// vo.setLjtqb(vo.getLjtb().divide(vo.getQntq(), 2, RoundingMode.HALF_UP) + "%");
+// }
+//
+// }
+// }
+// }
+// }
+// }
+// if (true){
+// //澶т慨寮�绁�
+// List<GcpbkwcqkItemVo> itemVoListMon = contractInvoiceMapper.dxsxywwcqk("2",monstart,monend);
+// List<GcpbkwcqkItemVo> itemVoListMonrLastYear = contractInvoiceMapper.dxsxywwcqk("2",monstartLastYear,monendLastYear);
+// if (CollUtil.isNotEmpty(itemVoListMon)){
+// itemVoListMon.stream().forEach(item->{
+// PjdxcksxywwcqkVo vo = new PjdxcksxywwcqkVo();
+// vo.setYw(item.getYw());
+// vo.setLb(item.getLb());
+// vo.setDw(item.getDw());
+// vo.setDywc(item.getWc());
+// if (CollUtil.isNotEmpty(itemVoListMonrLastYear)){
+// itemVoListMon.stream().forEach(item1-> {
+// if (StrUtil.equals(vo.getYw(),item1.getYw())&&StrUtil.equals(vo.getLb(),item1.getLb())&&
+// StrUtil.equals(vo.getDw(),item1.getDw())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
+// vo.setQnwc(item1.getWc());
+// vo.setYtb(vo.getDywc().subtract(item1.getWc()));
+// if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
+// vo.setYtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// });
+// }
+// list.add(vo);
+// });
+// PjdxcksxywwcqkVo vo = new PjdxcksxywwcqkVo();
+// vo.setYw(itemVoListMon.get(0).getYw());
+// vo.setLb(itemVoListMon.get(0).getLb());
+// vo.setDw("闆嗗洟");
+// vo.setDywc(itemVoListMon.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// if (CollUtil.isNotEmpty(itemVoListMonrLastYear)){
+// vo.setQnwc(itemVoListMonrLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// vo.setYtb(vo.getDywc().subtract(vo.getQnwc()));
+// if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
+// vo.setYtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
+// }
+//
+// }
+// list.add(vo);
+// }
+// List<GcpbkwcqkItemVo> itemVoListYear = contractInvoiceMapper.dxsxywwcqk("2",yearstart,yearend);
+// List<GcpbkwcqkItemVo> itemVoListYearLastYear = contractInvoiceMapper.dxsxywwcqk("2",yearstartLastYear,yearendLastYear);
+// if (CollUtil.isNotEmpty(list)&&CollUtil.isNotEmpty(itemVoListYear)){
+// for (PjdxcksxywwcqkVo vo:list
+// ) {
+// for (GcpbkwcqkItemVo itemVo:itemVoListYear
+// ) {
+// if (StrUtil.equals(vo.getYw(),itemVo.getYw())&&StrUtil.equals(vo.getLb(),itemVo.getLb())&&
+// StrUtil.equals(vo.getDw(),itemVo.getDw())){
+// vo.setLjwc(itemVo.getWc());
+// }
+// if (CollUtil.isNotEmpty(itemVoListYearLastYear)){
+// itemVoListYearLastYear.stream().forEach(item1->{
+// if (StrUtil.equals(vo.getYw(),itemVo.getYw())&&StrUtil.equals(vo.getLb(),itemVo.getLb())&&
+// StrUtil.equals(vo.getDw(),itemVo.getDw())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
+// vo.setQntq(item1.getWc());
+// vo.setLjtb(vo.getLjwc().subtract(item1.getWc()));
+// if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
+// vo.setLjtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// });
+// }
+// }
+// if (StrUtil.equals(vo.getYw(),"澶т慨")&&StrUtil.equals(vo.getLb(),"閿�鍞敹鍏�")&&
+// StrUtil.equals(vo.getDw(),"闆嗗洟")){
+// vo.setLjwc(itemVoListYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// if (CollUtil.isNotEmpty(itemVoListYearLastYear)){
+// vo.setQntq(itemVoListYearLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// vo.setLjtb(vo.getLjwc().subtract(vo.getQntq()));
+// if (vo.getQntq().compareTo(new BigDecimal("0"))>0) {
+// vo.setLjtqb(vo.getLjtb().divide(vo.getQntq(), 2, RoundingMode.HALF_UP) + "%");
+// }
+//
+// }
+// }
+// }
+// }
+// //澶т慨鍚堝悓
+// List<GcpbkwcqkItemVo> itemVoListMonHT = contractMapper.dxsxywwcqkHT("2",monstart,monend);
+// List<GcpbkwcqkItemVo> itemVoListMonrHTLastYear = contractMapper.dxsxywwcqkHT("2",monstartLastYear,monendLastYear);
+// if (CollUtil.isNotEmpty(itemVoListMonHT)){
+// itemVoListMonHT.stream().forEach(item->{
+// PjdxcksxywwcqkVo vo = new PjdxcksxywwcqkVo();
+// vo.setYw(item.getYw());
+// vo.setLb(item.getLb());
+// vo.setDw(item.getDw());
+// vo.setDywc(item.getWc());
+// if (CollUtil.isNotEmpty(itemVoListMonrHTLastYear)){
+// itemVoListMonrHTLastYear.stream().forEach(item1-> {
+// if (StrUtil.equals(vo.getYw(),item1.getYw())&&StrUtil.equals(vo.getLb(),item1.getLb())&&
+// StrUtil.equals(vo.getDw(),item1.getDw())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
+// vo.setQnwc(item1.getWc());
+// vo.setYtb(vo.getDywc().subtract(item1.getWc()));
+// if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
+// vo.setYtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// });
+// }
+// list.add(vo);
+// });
+// PjdxcksxywwcqkVo vo = new PjdxcksxywwcqkVo();
+// vo.setYw(itemVoListMon.get(0).getYw());
+// vo.setLb(itemVoListMon.get(0).getLb());
+// vo.setDw("闆嗗洟");
+// vo.setDywc(itemVoListMon.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// if (CollUtil.isNotEmpty(itemVoListMonrHTLastYear)){
+// vo.setQnwc(itemVoListMonrHTLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// vo.setYtb(vo.getDywc().subtract(vo.getQnwc()));
+// if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
+// vo.setYtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
+// }
+//
+// }
+// list.add(vo);
+// }
+// List<GcpbkwcqkItemVo> itemVoListYearHT = contractMapper.dxsxywwcqkHT("2",yearstart,yearend);
+// List<GcpbkwcqkItemVo> itemVoListYearHTLastYear = contractMapper.dxsxywwcqkHT("2",yearstartLastYear,yearendLastYear);
+// if (CollUtil.isNotEmpty(list)&&CollUtil.isNotEmpty(itemVoListYearHT)){
+// for (PjdxcksxywwcqkVo vo:list
+// ) {
+// for (GcpbkwcqkItemVo itemVo:itemVoListYearHT
+// ) {
+// if (StrUtil.equals(vo.getYw(),itemVo.getYw())&&StrUtil.equals(vo.getLb(),itemVo.getLb())&&
+// StrUtil.equals(vo.getDw(),itemVo.getDw())){
+// vo.setLjwc(itemVo.getWc());
+// }
+// if (CollUtil.isNotEmpty(itemVoListYearHTLastYear)){
+// itemVoListYearHTLastYear.stream().forEach(item1->{
+// if (StrUtil.equals(vo.getYw(),itemVo.getYw())&&StrUtil.equals(vo.getLb(),itemVo.getLb())&&
+// StrUtil.equals(vo.getDw(),itemVo.getDw())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
+// vo.setQntq(item1.getWc());
+// vo.setLjtb(vo.getLjwc().subtract(item1.getWc()));
+// if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
+// vo.setLjtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// });
+// }
+// }
+// if (StrUtil.equals(vo.getYw(),"澶т慨")&&StrUtil.equals(vo.getLb(),"鏂板鍚堝悓")&&
+// StrUtil.equals(vo.getDw(),"闆嗗洟")){
+// vo.setLjwc(itemVoListYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// if (CollUtil.isNotEmpty(itemVoListYearHTLastYear)){
+// vo.setQntq(itemVoListYearHTLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// vo.setLjtb(vo.getLjwc().subtract(vo.getQntq()));
+// if (vo.getQntq().compareTo(new BigDecimal("0"))>0) {
+// vo.setLjtqb(vo.getLjtb().divide(vo.getQntq(), 2, RoundingMode.HALF_UP) + "%");
+// }
+//
+// }
+// }
+// }
+// }
+// }
+// if (true){
+// //鍑哄彛寮�绁�
+// List<GcpbkwcqkItemVo> itemVoListMon = contractInvoiceMapper.cksxywwcqk("1",monstart,monend);
+// List<GcpbkwcqkItemVo> itemVoListMonrLastYear = contractInvoiceMapper.cksxywwcqk("1",monstartLastYear,monendLastYear);
+// if (CollUtil.isNotEmpty(itemVoListMon)){
+// itemVoListMon.stream().forEach(item->{
+// PjdxcksxywwcqkVo vo = new PjdxcksxywwcqkVo();
+// vo.setYw(item.getYw());
+// vo.setLb(item.getLb());
+// vo.setDw(item.getDw());
+// vo.setDywc(item.getWc());
+// if (CollUtil.isNotEmpty(itemVoListMonrLastYear)){
+// itemVoListMon.stream().forEach(item1-> {
+// if (StrUtil.equals(vo.getYw(),item1.getYw())&&StrUtil.equals(vo.getLb(),item1.getLb())&&
+// StrUtil.equals(vo.getDw(),item1.getDw())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
+// vo.setQnwc(item1.getWc());
+// vo.setYtb(vo.getDywc().subtract(item1.getWc()));
+// if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
+// vo.setYtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// });
+// }
+// list.add(vo);
+// });
+// PjdxcksxywwcqkVo vo = new PjdxcksxywwcqkVo();
+// vo.setYw(itemVoListMon.get(0).getYw());
+// vo.setLb(itemVoListMon.get(0).getLb());
+// vo.setDw("闆嗗洟");
+// vo.setDywc(itemVoListMon.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// if (CollUtil.isNotEmpty(itemVoListMonrLastYear)){
+// vo.setQnwc(itemVoListMonrLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// vo.setYtb(vo.getDywc().subtract(vo.getQnwc()));
+// if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
+// vo.setYtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// list.add(vo);
+// }
+// List<GcpbkwcqkItemVo> itemVoListYear = contractInvoiceMapper.cksxywwcqk("1",yearstart,yearend);
+// List<GcpbkwcqkItemVo> itemVoListYearLastYear = contractInvoiceMapper.cksxywwcqk("1",yearstartLastYear,yearendLastYear);
+// if (CollUtil.isNotEmpty(list)&&CollUtil.isNotEmpty(itemVoListYear)){
+// for (PjdxcksxywwcqkVo vo:list
+// ) {
+// for (GcpbkwcqkItemVo itemVo:itemVoListYear
+// ) {
+// if (StrUtil.equals(vo.getYw(),itemVo.getYw())&&StrUtil.equals(vo.getLb(),itemVo.getLb())&&
+// StrUtil.equals(vo.getDw(),itemVo.getDw())){
+// vo.setLjwc(itemVo.getWc());
+// }
+// if (CollUtil.isNotEmpty(itemVoListYearLastYear)){
+// itemVoListYearLastYear.stream().forEach(item1->{
+// if (StrUtil.equals(vo.getYw(),itemVo.getYw())&&StrUtil.equals(vo.getLb(),itemVo.getLb())&&
+// StrUtil.equals(vo.getDw(),itemVo.getDw())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
+// vo.setQntq(item1.getWc());
+// vo.setLjtb(vo.getLjwc().subtract(item1.getWc()));
+// if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
+// vo.setLjtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// });
+// }
+// }
+// if (StrUtil.equals(vo.getYw(),"鍑哄彛")&&StrUtil.equals(vo.getLb(),"閿�鍞敹鍏�")&&
+// StrUtil.equals(vo.getDw(),"闆嗗洟")){
+// vo.setLjwc(itemVoListYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// if (CollUtil.isNotEmpty(itemVoListYearLastYear)){
+// vo.setQntq(itemVoListYearLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// vo.setLjtb(vo.getLjwc().subtract(vo.getQntq()));
+// if (vo.getQntq().compareTo(new BigDecimal("0"))>0) {
+// vo.setLjtqb(vo.getLjtb().divide(vo.getQntq(), 2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// }
+// }
+// }
+// //閰嶄欢鍚堝悓
+// List<GcpbkwcqkItemVo> itemVoListMonHT = contractMapper.cksxywwcqkHT("1",monstart,monend);
+// List<GcpbkwcqkItemVo> itemVoListMonrHTLastYear = contractMapper.cksxywwcqkHT("1",monstartLastYear,monendLastYear);
+// if (CollUtil.isNotEmpty(itemVoListMonHT)){
+// itemVoListMonHT.stream().forEach(item->{
+// PjdxcksxywwcqkVo vo = new PjdxcksxywwcqkVo();
+// vo.setYw(item.getYw());
+// vo.setLb(item.getLb());
+// vo.setDw(item.getDw());
+// vo.setDywc(item.getWc());
+// if (CollUtil.isNotEmpty(itemVoListMonrHTLastYear)){
+// itemVoListMonrHTLastYear.stream().forEach(item1-> {
+// if (StrUtil.equals(vo.getYw(),item1.getYw())&&StrUtil.equals(vo.getLb(),item1.getLb())&&
+// StrUtil.equals(vo.getDw(),item1.getDw())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
+// vo.setQnwc(item1.getWc());
+// vo.setYtb(vo.getDywc().subtract(item1.getWc()));
+// if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
+// vo.setYtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// });
+// }
+// list.add(vo);
+// });
+// PjdxcksxywwcqkVo vo = new PjdxcksxywwcqkVo();
+// vo.setYw(itemVoListMon.get(0).getYw());
+// vo.setLb(itemVoListMon.get(0).getLb());
+// vo.setDw("闆嗗洟");
+// vo.setDywc(itemVoListMon.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// if (CollUtil.isNotEmpty(itemVoListMonrHTLastYear)){
+// vo.setQnwc(itemVoListMonrHTLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// vo.setYtb(vo.getDywc().subtract(vo.getQnwc()));
+// if (vo.getQnwc().compareTo(new BigDecimal("0"))>0) {
+// vo.setYtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
+// }
+//
+// }
+// list.add(vo);
+// }
+// List<GcpbkwcqkItemVo> itemVoListYearHT = contractMapper.cksxywwcqkHT("1",yearstart,yearend);
+// List<GcpbkwcqkItemVo> itemVoListYearHTLastYear = contractMapper.cksxywwcqkHT("1",yearstartLastYear,yearendLastYear);
+// if (CollUtil.isNotEmpty(list)&&CollUtil.isNotEmpty(itemVoListYearHT)){
+// for (PjdxcksxywwcqkVo vo:list
+// ) {
+// for (GcpbkwcqkItemVo itemVo:itemVoListYearHT
+// ) {
+// if (StrUtil.equals(vo.getYw(),itemVo.getYw())&&StrUtil.equals(vo.getLb(),itemVo.getLb())&&
+// StrUtil.equals(vo.getDw(),itemVo.getDw())){
+// vo.setLjwc(itemVo.getWc());
+// }
+// if (CollUtil.isNotEmpty(itemVoListYearHTLastYear)){
+// itemVoListYearHTLastYear.stream().forEach(item1->{
+// if (StrUtil.equals(vo.getYw(),itemVo.getYw())&&StrUtil.equals(vo.getLb(),itemVo.getLb())&&
+// StrUtil.equals(vo.getDw(),itemVo.getDw())&&item1.getWc().compareTo(new BigDecimal("0"))>0){
+// vo.setQntq(item1.getWc());
+// vo.setLjtb(vo.getLjwc().subtract(item1.getWc()));
+// if (vo.getQntq().compareTo(new BigDecimal("0"))>0) {
+// vo.setLjtqb(vo.getLjtb().divide(vo.getQntq(), 2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// });
+// }
+// }
+// if (StrUtil.equals(vo.getYw(),"鍑哄彛")&&StrUtil.equals(vo.getLb(),"鏂板鍚堝悓")&&
+// StrUtil.equals(vo.getDw(),"闆嗗洟")){
+// vo.setLjwc(itemVoListYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// if (CollUtil.isNotEmpty(itemVoListYearHTLastYear)){
+// vo.setQntq(itemVoListYearHTLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// vo.setLjtb(vo.getLjwc().subtract(vo.getQntq()));
+// if (vo.getQntq().compareTo(new BigDecimal("0"))>0) {
+// vo.setLjtqb(vo.getLjtb().divide(vo.getQntq(), 2, RoundingMode.HALF_UP) + "%");
+// }
+//
+// }
+// }
+// }
+// }
+// }
+// if (CollUtil.isNotEmpty(list)){
+// String[] arrLb = {"閿�鍞敹鍏�", "鏂板鍚堝悓"};
+// String[] arrDw = {"鐭崇叅鏈�", "鐭冲伐娉�", "閭㈠彴鍘�", "閫氭柟鍘�","闆嗗洟"};
+// for (int i = 0; i < arrLb.length; i++) {
+// for (int j = 0; j < arrDw.length; j++) {
+// PjdxcksxywwcqkVo vosmj = new PjdxcksxywwcqkVo();
+// vosmj.setYw("浠ヤ笂涓夐」鍚堣");
+// String lb = arrLb[i];
+// String dw = arrDw[j];
+// vosmj.setLb(lb);
+// vosmj.setDw(dw);
+// vosmj.setDywc(list.stream().filter(item->item.getLb().equals(lb)&&item.getDw().equals(dw)).collect(Collectors.toList())
+// .stream().map(item->item.getDywc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// vosmj.setQnwc(list.stream().filter(item->item.getLb().equals(lb)&&item.getDw().equals(dw)).collect(Collectors.toList())
+// .stream().map(item->item.getQnwc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// vosmj.setYtb(vosmj.getDywc().subtract(vosmj.getQnwc()));
+// if (vosmj.getQnwc().compareTo(new BigDecimal("0"))>0){
+// vosmj.setYtqb(vosmj.getYtb().divide(vosmj.getQnwc(),2,RoundingMode.HALF_UP)+"%");
+// }
+// vosmj.setLjwc(list.stream().filter(item->item.getLb().equals(lb)&&item.getDw().equals(dw)).collect(Collectors.toList())
+// .stream().map(item->item.getLjwc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// vosmj.setQntq(list.stream().filter(item->item.getLb().equals(lb)&&item.getDw().equals(dw)).collect(Collectors.toList())
+// .stream().map(item->item.getQntq()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// vosmj.setLjtb(vosmj.getLjwc().subtract(vosmj.getQntq()));
+// if (vosmj.getQntq().compareTo(new BigDecimal("0"))>0){
+// vosmj.setLjtqb(vosmj.getLjtb().divide(vosmj.getQntq(),2,RoundingMode.HALF_UP)+"%");
+// }
+// list.add(vosmj);
+// }
+// }
+// }
return R.ok(list);
}
@@ -1131,66 +1160,72 @@
if (StrUtil.isBlank(queryDTO.getYearMonth())){
return R.failed("鏌ヨ骞存湀涓嶈兘涓虹┖");
}
- List<CpxssrwcqkVo> list = new ArrayList<>();
- Date monstart = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00");
- Date monend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
- Date monstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00"),-1);
- Date monendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),-1);
- Date yearstart = DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0,4)+"-01-01 00:00:00");
- Date yearend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
- Date yearstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0,4)+"-01-01 00:00:00"),-1);
- Date yearendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),-1);
-
- List<CpxssrwcqkItemVo> itemVoListDY = contractSubjectMatterMapper.cpxzhtwcqk(monstart,monend);
- List<CpxssrwcqkItemVo> itemVoListLJ = contractSubjectMatterMapper.cpxzhtwcqk(yearstart,yearend);
- List<CpxssrwcqkItemVo> itemVoListQN = contractSubjectMatterMapper.cpxzhtwcqk(yearstartLastYear,yearendLastYear);
- List<Integer> indexList = new ArrayList<>();
- if (CollUtil.isNotEmpty(itemVoListDY)){
- for (int i = 0; i < itemVoListDY.size(); i++) {
- CpxssrwcqkItemVo item = itemVoListDY.get(i);
- CpxssrwcqkVo vo = new CpxssrwcqkVo();
- vo.setXm(item.getXm());
- BipDict dict = bipDictMapper.selectOne(Wrappers.<BipDict>lambdaQuery().eq(BipDict::getDictKey,"zb-cpmc")
- .eq(BipDict::getParentId,0).eq(BipDict::getDictName,item.getXm()).last("limit 1"));
- if (ObjUtil.isNull(dict)) {
- vo.setDyxsl(item.getXsl());
- vo.setDyxssr(item.getXssr());
- if (CollUtil.isNotEmpty(itemVoListLJ)) {
- itemVoListLJ.stream().forEach(item1 -> {
- if (StrUtil.equals(vo.getXm(), item1.getXm())) {
- vo.setLjxsl(item1.getXsl());
- vo.setLjxssr(item1.getXssr());
- }
- });
- }
- if (CollUtil.isNotEmpty(itemVoListQN)) {
- itemVoListQN.stream().forEach(item1 -> {
- if (StrUtil.equals(vo.getXm(), item1.getXm())) {
- vo.setQnljxsl(item1.getXsl());
- vo.setQnljxssr(item1.getXssr());
- vo.setTqbxsl(vo.getLjxsl().subtract(vo.getQnljxsl()));
- vo.setTqbxssr(vo.getLjxssr().subtract(vo.getQnljxssr()));
- }
- });
- }
- }else {
- indexList.add(i);
- }
- list.add(vo);
- }
- indexList.add(itemVoListDY.size());
- for (int i = 0; i < indexList.size()-1; i++) {
- List<CpxssrwcqkVo> sublist = list.subList(i,i+1);
- list.get(i).setDyxsl(sublist.stream().map(item->item.getDyxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
- list.get(i).setDyxssr(sublist.stream().map(item->item.getDyxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
- list.get(i).setLjxsl(sublist.stream().map(item->item.getLjxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
- list.get(i).setLjxssr(sublist.stream().map(item->item.getLjxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
- list.get(i).setQnljxsl(sublist.stream().map(item->item.getQnljxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
- list.get(i).setQnljxssr(sublist.stream().map(item->item.getQnljxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
- list.get(i).setTqbxsl(list.get(i).getLjxsl().subtract(list.get(i).getQnljxsl()));
- list.get(i).setTqbxssr(list.get(i).getLjxssr().subtract(list.get(i).getQnljxssr()));
- }
+ List<ZbStatisticCpXzht> xszbList = zbStatisticCpXzhtMapper.selectList(Wrappers.<ZbStatisticCpXzht>lambdaQuery()
+ .eq(ZbStatisticCpXzht::getStatYm,queryDTO.getYearMonth()).orderByAsc(ZbStatisticCpXzht::getSort));
+ if (CollUtil.isNotEmpty(xszbList)){
+ List<CpxssrwcqkVo> list = BeanUtil.copyToList(xszbList,CpxssrwcqkVo.class);
+ return R.ok(list);
}
+ List<CpxssrwcqkVo> list = new ArrayList<>();
+// Date monstart = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00");
+// Date monend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
+// Date monstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00"),-1);
+// Date monendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),-1);
+// Date yearstart = DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0,4)+"-01-01 00:00:00");
+// Date yearend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
+// Date yearstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0,4)+"-01-01 00:00:00"),-1);
+// Date yearendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),-1);
+//
+// List<CpxssrwcqkItemVo> itemVoListDY = contractSubjectMatterMapper.cpxzhtwcqk(monstart,monend);
+// List<CpxssrwcqkItemVo> itemVoListLJ = contractSubjectMatterMapper.cpxzhtwcqk(yearstart,yearend);
+// List<CpxssrwcqkItemVo> itemVoListQN = contractSubjectMatterMapper.cpxzhtwcqk(yearstartLastYear,yearendLastYear);
+// List<Integer> indexList = new ArrayList<>();
+// if (CollUtil.isNotEmpty(itemVoListDY)){
+// for (int i = 0; i < itemVoListDY.size(); i++) {
+// CpxssrwcqkItemVo item = itemVoListDY.get(i);
+// CpxssrwcqkVo vo = new CpxssrwcqkVo();
+// vo.setXm(item.getXm());
+// BipDict dict = bipDictMapper.selectOne(Wrappers.<BipDict>lambdaQuery().eq(BipDict::getDictKey,"zb-cpmc")
+// .eq(BipDict::getParentId,0).eq(BipDict::getDictName,item.getXm()).last("limit 1"));
+// if (ObjUtil.isNull(dict)) {
+// vo.setDyxsl(item.getXsl());
+// vo.setDyxssr(item.getXssr());
+// if (CollUtil.isNotEmpty(itemVoListLJ)) {
+// itemVoListLJ.stream().forEach(item1 -> {
+// if (StrUtil.equals(vo.getXm(), item1.getXm())) {
+// vo.setLjxsl(item1.getXsl());
+// vo.setLjxssr(item1.getXssr());
+// }
+// });
+// }
+// if (CollUtil.isNotEmpty(itemVoListQN)) {
+// itemVoListQN.stream().forEach(item1 -> {
+// if (StrUtil.equals(vo.getXm(), item1.getXm())) {
+// vo.setQnljxsl(item1.getXsl());
+// vo.setQnljxssr(item1.getXssr());
+// vo.setTqbxsl(vo.getLjxsl().subtract(vo.getQnljxsl()));
+// vo.setTqbxssr(vo.getLjxssr().subtract(vo.getQnljxssr()));
+// }
+// });
+// }
+// }else {
+// indexList.add(i);
+// }
+// list.add(vo);
+// }
+// indexList.add(itemVoListDY.size());
+// for (int i = 0; i < indexList.size()-1; i++) {
+// List<CpxssrwcqkVo> sublist = list.subList(i,i+1);
+// list.get(i).setDyxsl(sublist.stream().map(item->item.getDyxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+// list.get(i).setDyxssr(sublist.stream().map(item->item.getDyxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+// list.get(i).setLjxsl(sublist.stream().map(item->item.getLjxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+// list.get(i).setLjxssr(sublist.stream().map(item->item.getLjxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+// list.get(i).setQnljxsl(sublist.stream().map(item->item.getQnljxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+// list.get(i).setQnljxssr(sublist.stream().map(item->item.getQnljxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+// list.get(i).setTqbxsl(list.get(i).getLjxsl().subtract(list.get(i).getQnljxsl()));
+// list.get(i).setTqbxssr(list.get(i).getLjxssr().subtract(list.get(i).getQnljxssr()));
+// }
+// }
return R.ok(list);
}
@@ -1303,65 +1338,191 @@
if (StrUtil.isBlank(queryDTO.getYearMonth())){
return R.failed("鏌ヨ骞存湀涓嶈兘涓虹┖");
}
+ List<ZbStatisticCpXssr> xszbList = zbStatisticCpXssrMapper.selectList(Wrappers.<ZbStatisticCpXssr>lambdaQuery()
+ .eq(ZbStatisticCpXssr::getStatYm,queryDTO.getYearMonth()).orderByAsc(ZbStatisticCpXssr::getSort));
+ if (CollUtil.isNotEmpty(xszbList)){
+ List<CpxssrwcqkVo> list = BeanUtil.copyToList(xszbList,CpxssrwcqkVo.class);
+ return R.ok(list);
+ }
List<CpxssrwcqkVo> list = new ArrayList<>();
+// Date monstart = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00");
+// Date monend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
+// Date monstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00"),-1);
+// Date monendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),-1);
+// Date yearstart = DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0,4)+"-01-01 00:00:00");
+// Date yearend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
+// Date yearstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0,4)+"-01-01 00:00:00"),-1);
+// Date yearendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),-1);
+//
+// List<CpxssrwcqkItemVo> itemVoListDY = contractOutBoundMapper.cpxssrwcqk(monstart,monend);
+// List<CpxssrwcqkItemVo> itemVoListLJ = contractOutBoundMapper.cpxssrwcqk(yearstart,yearend);
+// List<CpxssrwcqkItemVo> itemVoListQN = contractOutBoundMapper.cpxssrwcqk(yearstartLastYear,yearendLastYear);
+// List<Integer> indexList = new ArrayList<>();
+// if (CollUtil.isNotEmpty(itemVoListDY)){
+// for (int i = 0; i < itemVoListDY.size(); i++) {
+// CpxssrwcqkItemVo item = itemVoListDY.get(i);
+// CpxssrwcqkVo vo = new CpxssrwcqkVo();
+// vo.setXm(item.getXm());
+// BipDict dict = bipDictMapper.selectOne(Wrappers.<BipDict>lambdaQuery().eq(BipDict::getDictKey,"zb-cpmc")
+// .eq(BipDict::getParentId,0).eq(BipDict::getDictName,item.getXm()).last("limit 1"));
+// if (ObjUtil.isNull(dict)) {
+// vo.setDyxsl(item.getXsl());
+// vo.setDyxssr(item.getXssr());
+// if (CollUtil.isNotEmpty(itemVoListLJ)) {
+// itemVoListLJ.stream().forEach(item1 -> {
+// if (StrUtil.equals(vo.getXm(), item1.getXm())) {
+// vo.setLjxsl(item1.getXsl());
+// vo.setLjxssr(item1.getXssr());
+// }
+// });
+// }
+// if (CollUtil.isNotEmpty(itemVoListQN)) {
+// itemVoListQN.stream().forEach(item1 -> {
+// if (StrUtil.equals(vo.getXm(), item1.getXm())) {
+// vo.setQnljxsl(item1.getXsl());
+// vo.setQnljxssr(item1.getXssr());
+// vo.setTqbxsl(vo.getLjxsl().subtract(vo.getQnljxsl()));
+// vo.setTqbxssr(vo.getLjxssr().subtract(vo.getQnljxssr()));
+// }
+// });
+// }
+// }else {
+// indexList.add(i);
+// }
+// list.add(vo);
+// }
+// indexList.add(itemVoListDY.size());
+// for (int i = 0; i < indexList.size()-1; i++) {
+// List<CpxssrwcqkVo> sublist = list.subList(i,i+1);
+// list.get(i).setDyxsl(sublist.stream().map(item->item.getDyxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+// list.get(i).setDyxssr(sublist.stream().map(item->item.getDyxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+// list.get(i).setLjxsl(sublist.stream().map(item->item.getLjxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+// list.get(i).setLjxssr(sublist.stream().map(item->item.getLjxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+// list.get(i).setQnljxsl(sublist.stream().map(item->item.getQnljxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+// list.get(i).setQnljxssr(sublist.stream().map(item->item.getQnljxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+// list.get(i).setTqbxsl(list.get(i).getLjxsl().subtract(list.get(i).getQnljxsl()));
+// list.get(i).setTqbxssr(list.get(i).getLjxssr().subtract(list.get(i).getQnljxssr()));
+// }
+// }
+ return R.ok(list);
+ }
+
+ @Override
+ public R zbjtjznbyszk(ZBJTStatisticDTO queryDTO) {
+ if (StrUtil.isBlank(queryDTO.getYearMonth())){
+ return R.failed("鏌ヨ骞存湀涓嶈兘涓虹┖");
+ }
Date monstart = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00");
Date monend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
- Date monstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00"),-1);
- Date monendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),-1);
- Date yearstart = DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0,4)+"-01-01 00:00:00");
- Date yearend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
- Date yearstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0,4)+"-01-01 00:00:00"),-1);
- Date yearendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),-1);
+ Date mon2after = DateUtil.offsetMonth(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),2);
- List<CpxssrwcqkItemVo> itemVoListDY = contractOutBoundMapper.cpxssrwcqk(monstart,monend);
- List<CpxssrwcqkItemVo> itemVoListLJ = contractOutBoundMapper.cpxssrwcqk(yearstart,yearend);
- List<CpxssrwcqkItemVo> itemVoListQN = contractOutBoundMapper.cpxssrwcqk(yearstartLastYear,yearendLastYear);
- List<Integer> indexList = new ArrayList<>();
- if (CollUtil.isNotEmpty(itemVoListDY)){
- for (int i = 0; i < itemVoListDY.size(); i++) {
- CpxssrwcqkItemVo item = itemVoListDY.get(i);
- CpxssrwcqkVo vo = new CpxssrwcqkVo();
- vo.setXm(item.getXm());
- BipDict dict = bipDictMapper.selectOne(Wrappers.<BipDict>lambdaQuery().eq(BipDict::getDictKey,"zb-cpmc")
- .eq(BipDict::getParentId,0).eq(BipDict::getDictName,item.getXm()).last("limit 1"));
- if (ObjUtil.isNull(dict)) {
- vo.setDyxsl(item.getXsl());
- vo.setDyxssr(item.getXssr());
- if (CollUtil.isNotEmpty(itemVoListLJ)) {
- itemVoListLJ.stream().forEach(item1 -> {
- if (StrUtil.equals(vo.getXm(), item1.getXm())) {
- vo.setLjxsl(item1.getXsl());
- vo.setLjxssr(item1.getXssr());
- }
- });
- }
- if (CollUtil.isNotEmpty(itemVoListQN)) {
- itemVoListQN.stream().forEach(item1 -> {
- if (StrUtil.equals(vo.getXm(), item1.getXm())) {
- vo.setQnljxsl(item1.getXsl());
- vo.setQnljxssr(item1.getXssr());
- vo.setTqbxsl(vo.getLjxsl().subtract(vo.getQnljxsl()));
- vo.setTqbxssr(vo.getLjxssr().subtract(vo.getQnljxssr()));
- }
- });
- }
- }else {
- indexList.add(i);
- }
- list.add(vo);
- }
- indexList.add(itemVoListDY.size());
- for (int i = 0; i < indexList.size()-1; i++) {
- List<CpxssrwcqkVo> sublist = list.subList(i,i+1);
- list.get(i).setDyxsl(sublist.stream().map(item->item.getDyxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
- list.get(i).setDyxssr(sublist.stream().map(item->item.getDyxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
- list.get(i).setLjxsl(sublist.stream().map(item->item.getLjxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
- list.get(i).setLjxssr(sublist.stream().map(item->item.getLjxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
- list.get(i).setQnljxsl(sublist.stream().map(item->item.getQnljxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
- list.get(i).setQnljxssr(sublist.stream().map(item->item.getQnljxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
- list.get(i).setTqbxsl(list.get(i).getLjxsl().subtract(list.get(i).getQnljxsl()));
- list.get(i).setTqbxssr(list.get(i).getLjxssr().subtract(list.get(i).getQnljxssr()));
- }
+ List<JznbyszkVo> list = paymentReceiveMapper.zbjtjznbyszk(null,mon2after,monend,mon2after);
+ if (CollUtil.isNotEmpty(list)){
+ JznbyszkVo vo = new JznbyszkVo();
+ vo.setZgs("浠ヤ笂鍚堣");
+ vo.setWfyssx(list.stream().map(JznbyszkVo::getWfyssx).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setDfgz(list.stream().map(JznbyszkVo::getDfgz).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setSx(list.stream().map(JznbyszkVo::getSx).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setHxhtze(list.stream().map(JznbyszkVo::getHxhtze).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setLynjhht(list.stream().map(JznbyszkVo::getLynjhht).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setLywjhht(list.stream().map(JznbyszkVo::getLywjhht).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ list.add(vo);
+ }
+ return R.ok(list);
+ }
+
+ @Override
+ public R smjjznbyszk(ZBJTStatisticDTO queryDTO) {
+ if (StrUtil.isBlank(queryDTO.getYearMonth())){
+ return R.failed("鏌ヨ骞存湀涓嶈兘涓虹┖");
+ }
+ Date monstart = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00");
+ Date monend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
+ Date mon2after = DateUtil.offsetMonth(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),2);
+
+ List<JznbyszkVo> list = paymentReceiveMapper.zbjtjznbyszkSMJ(null,mon2after,monend,mon2after);
+ if (CollUtil.isNotEmpty(list)){
+ JznbyszkVo vo = new JznbyszkVo();
+ vo.setZgs("浠ヤ笂鍚堣");
+ vo.setWfyssx(list.stream().map(JznbyszkVo::getWfyssx).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setDfgz(list.stream().map(JznbyszkVo::getDfgz).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setSx(list.stream().map(JznbyszkVo::getSx).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setHxhtze(list.stream().map(JznbyszkVo::getHxhtze).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setLynjhht(list.stream().map(JznbyszkVo::getLynjhht).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setLywjhht(list.stream().map(JznbyszkVo::getLywjhht).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ list.add(vo);
+ }
+ return R.ok(list);
+ }
+
+ @Override
+ public R sgbjznbyszk(ZBJTStatisticDTO queryDTO) {
+ if (StrUtil.isBlank(queryDTO.getYearMonth())){
+ return R.failed("鏌ヨ骞存湀涓嶈兘涓虹┖");
+ }
+ Date monstart = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00");
+ Date monend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
+ Date mon2after = DateUtil.offsetMonth(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),2);
+
+ List<JznbyszkVo> list = paymentReceiveMapper.zbjtjznbyszk(2056556196124250113L,mon2after,monend,mon2after);
+ if (CollUtil.isNotEmpty(list)){
+ JznbyszkVo vo = new JznbyszkVo();
+ vo.setZgs("浠ヤ笂鍚堣");
+ vo.setWfyssx(list.stream().map(JznbyszkVo::getWfyssx).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setDfgz(list.stream().map(JznbyszkVo::getDfgz).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setSx(list.stream().map(JznbyszkVo::getSx).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setHxhtze(list.stream().map(JznbyszkVo::getHxhtze).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setLynjhht(list.stream().map(JznbyszkVo::getLynjhht).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setLywjhht(list.stream().map(JznbyszkVo::getLywjhht).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ list.add(vo);
+ }
+ return R.ok(list);
+ }
+
+ @Override
+ public R jxcjznbyszk(ZBJTStatisticDTO queryDTO) {
+ if (StrUtil.isBlank(queryDTO.getYearMonth())){
+ return R.failed("鏌ヨ骞存湀涓嶈兘涓虹┖");
+ }
+ Date monstart = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00");
+ Date monend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
+ Date mon2after = DateUtil.offsetMonth(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),2);
+
+ List<JznbyszkVo> list = paymentReceiveMapper.zbjtjznbyszk(2056556317461270529L,mon2after,monend,mon2after);
+ if (CollUtil.isNotEmpty(list)){
+ JznbyszkVo vo = new JznbyszkVo();
+ vo.setZgs("浠ヤ笂鍚堣");
+ vo.setWfyssx(list.stream().map(JznbyszkVo::getWfyssx).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setDfgz(list.stream().map(JznbyszkVo::getDfgz).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setSx(list.stream().map(JznbyszkVo::getSx).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setHxhtze(list.stream().map(JznbyszkVo::getHxhtze).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setLynjhht(list.stream().map(JznbyszkVo::getLynjhht).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setLywjhht(list.stream().map(JznbyszkVo::getLywjhht).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ list.add(vo);
+ }
+ return R.ok(list);
+ }
+
+ @Override
+ public R tfgsjznbyszk(ZBJTStatisticDTO queryDTO) {
+ if (StrUtil.isBlank(queryDTO.getYearMonth())){
+ return R.failed("鏌ヨ骞存湀涓嶈兘涓虹┖");
+ }
+ Date monstart = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00");
+ Date monend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
+ Date mon2after = DateUtil.offsetMonth(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),2);
+
+ List<JznbyszkVo> list = paymentReceiveMapper.zbjtjznbyszk(2056556421857497090L,mon2after,monend,mon2after);
+ if (CollUtil.isNotEmpty(list)){
+ JznbyszkVo vo = new JznbyszkVo();
+ vo.setZgs("浠ヤ笂鍚堣");
+ vo.setWfyssx(list.stream().map(JznbyszkVo::getWfyssx).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setDfgz(list.stream().map(JznbyszkVo::getDfgz).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setSx(list.stream().map(JznbyszkVo::getSx).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setHxhtze(list.stream().map(JznbyszkVo::getHxhtze).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setLynjhht(list.stream().map(JznbyszkVo::getLynjhht).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setLywjhht(list.stream().map(JznbyszkVo::getLywjhht).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ list.add(vo);
}
return R.ok(list);
}
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ZbStatisticCpXssrServiceImpl.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ZbStatisticCpXssrServiceImpl.java
new file mode 100644
index 0000000..c68bc33
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ZbStatisticCpXssrServiceImpl.java
@@ -0,0 +1,172 @@
+package com.by4cloud.platformx.business.service.impl;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.date.DatePattern;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.ObjUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.by4cloud.platformx.business.dto.ZBJTStatisticDTO;
+import com.by4cloud.platformx.business.entity.BipDict;
+import com.by4cloud.platformx.business.entity.ZbStatisticCpXssr;
+import com.by4cloud.platformx.business.entity.ZbStatisticCpXzht;
+import com.by4cloud.platformx.business.mapper.*;
+import com.by4cloud.platformx.business.service.ZbStatisticCpXssrService;
+import com.by4cloud.platformx.business.vo.CpxssrwcqkItemVo;
+import com.by4cloud.platformx.business.vo.CpxssrwcqkVo;
+import com.by4cloud.platformx.common.core.util.R;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * 浜у搧閿�鍞敹鍏�
+ *
+ * @author syt
+ * @date 2026-11-12 10:31:01
+ */
+@Service
+@RequiredArgsConstructor
+public class ZbStatisticCpXssrServiceImpl extends ServiceImpl<ZbStatisticCpXssrMapper, ZbStatisticCpXssr> implements ZbStatisticCpXssrService {
+
+ private final ContractMapper contractMapper;
+ private final ContractOutBoundMapper contractOutBoundMapper;
+ private final BipDictMapper bipDictMapper;
+
+ @Override
+ public R genCpxssrwcqk(ZBJTStatisticDTO queryDTO) {
+ if (StrUtil.isBlank(queryDTO.getYearMonth())) {
+ queryDTO.setYearMonth(DateUtil.format(new Date(), DatePattern.NORM_MONTH_PATTERN));
+ }
+ List<ZbStatisticCpXssr> list = new ArrayList<>();
+ Date monstart = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00");
+ Date monend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
+ Date monstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00"),-1);
+ Date monendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),-1);
+ Date yearstart = DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0,4)+"-01-01 00:00:00");
+ Date yearend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
+ Date yearstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0,4)+"-01-01 00:00:00"),-1);
+ Date yearendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),-1);
+
+ contractMapper.setSession();
+ List<CpxssrwcqkItemVo> itemVoListDY = contractOutBoundMapper.cpxssrwcqk(monstart,monend);
+ List<CpxssrwcqkItemVo> itemVoListLJ = contractOutBoundMapper.cpxssrwcqk(yearstart,yearend);
+ List<CpxssrwcqkItemVo> itemVoListQN = contractOutBoundMapper.cpxssrwcqk(yearstartLastYear,yearendLastYear);
+ List<Integer> indexList = new ArrayList<>();
+ if (CollUtil.isNotEmpty(itemVoListDY)){
+ for (int i = 0; i < itemVoListDY.size(); i++) {
+ CpxssrwcqkItemVo item = itemVoListDY.get(i);
+ ZbStatisticCpXssr vo = new ZbStatisticCpXssr();
+ vo.setXm(item.getXm());
+ vo.setStatYm(queryDTO.getYearMonth());
+ vo.setSort(i);
+ BipDict dict = bipDictMapper.selectOne(Wrappers.<BipDict>lambdaQuery().eq(BipDict::getDictKey,"zb-cpmc")
+ .eq(BipDict::getParentId,0).eq(BipDict::getDictName,item.getXm()).last("limit 1"));
+ ZbStatisticCpXssr vo1 = baseMapper.selectOne(Wrappers.<ZbStatisticCpXssr>lambdaQuery().eq(ZbStatisticCpXssr::getXm,vo.getXm())
+ .eq(ZbStatisticCpXssr::getStatYm,vo.getStatYm()).last("limit 1"));
+ if (ObjUtil.isNull(dict)) {
+ if (ObjUtil.isNotNull(vo1)) {
+ vo1.setDyxsl(item.getXsl());
+ vo1.setDyxssr(item.getXssr());
+ if (CollUtil.isNotEmpty(itemVoListLJ)) {
+ itemVoListLJ.stream().forEach(item1 -> {
+ if (StrUtil.equals(vo.getXm(), item1.getXm())) {
+ vo1.setLjxsl(item1.getXsl());
+ vo1.setLjxssr(item1.getXssr());
+ }
+ });
+ }
+ if (CollUtil.isNotEmpty(itemVoListQN)) {
+ itemVoListQN.stream().forEach(item1 -> {
+ if (StrUtil.equals(vo1.getXm(), item1.getXm())) {
+ vo1.setQnljxsl(item1.getXsl());
+ vo1.setQnljxssr(item1.getXssr());
+ vo1.setTqbxsl(vo1.getLjxsl().subtract(vo1.getQnljxsl()));
+ vo1.setTqbxssr(vo1.getLjxssr().subtract(vo1.getQnljxssr()));
+ }
+ });
+ }
+ baseMapper.updateById(vo1);
+ }else {
+ vo.setDyxsl(item.getXsl());
+ vo.setDyxssr(item.getXssr());
+ if (CollUtil.isNotEmpty(itemVoListLJ)) {
+ itemVoListLJ.stream().forEach(item1 -> {
+ if (StrUtil.equals(vo.getXm(), item1.getXm())) {
+ vo.setLjxsl(item1.getXsl());
+ vo.setLjxssr(item1.getXssr());
+ }
+ });
+ }
+ if (CollUtil.isNotEmpty(itemVoListQN)) {
+ itemVoListQN.stream().forEach(item1 -> {
+ if (StrUtil.equals(vo.getXm(), item1.getXm())) {
+ vo.setQnljxsl(item1.getXsl());
+ vo.setQnljxssr(item1.getXssr());
+ vo.setTqbxsl(vo.getLjxsl().subtract(vo.getQnljxsl()));
+ vo.setTqbxssr(vo.getLjxssr().subtract(vo.getQnljxssr()));
+ }
+ });
+ }
+ baseMapper.insert(vo);
+ }
+ }else {
+ indexList.add(i);
+ if (ObjUtil.isNull(vo1)) {
+ baseMapper.insert(vo);
+ }
+ }
+ list.add(vo);
+ }
+ indexList.add(list.size());
+ for (int i = 0; i < indexList.size()-1; i++) {
+ List<ZbStatisticCpXssr> sublist = list.subList(indexList.get(i),indexList.get(i+1));
+ ZbStatisticCpXssr vo = baseMapper.selectOne(Wrappers.<ZbStatisticCpXssr>lambdaQuery().eq(ZbStatisticCpXssr::getXm,list.get(indexList.get(i)).getXm())
+ .eq(ZbStatisticCpXssr::getStatYm,list.get(indexList.get(i)).getStatYm()).last("limit 1"));
+ vo.setDyxsl(sublist.stream().map(item->item.getDyxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setDyxssr(sublist.stream().map(item->item.getDyxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setLjxsl(sublist.stream().map(item->item.getLjxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setLjxssr(sublist.stream().map(item->item.getLjxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setQnljxsl(sublist.stream().map(item->item.getQnljxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setQnljxssr(sublist.stream().map(item->item.getQnljxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setTqbxsl(vo.getLjxsl().subtract(vo.getQnljxsl()));
+ vo.setTqbxssr(vo.getLjxssr().subtract(vo.getQnljxssr()));
+ baseMapper.updateById(vo);
+ }
+ }
+ ZbStatisticCpXssr vo = baseMapper.selectOne(Wrappers.<ZbStatisticCpXssr>lambdaQuery().eq(ZbStatisticCpXssr::getXm,"鍚堣")
+ .eq(ZbStatisticCpXssr::getStatYm,queryDTO.getYearMonth()).last("limit 1"));
+ if (ObjUtil.isNotNull(vo)) {
+ vo.setDyxsl(list.stream().map(item -> item.getDyxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ vo.setDyxssr(list.stream().map(item -> item.getDyxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ vo.setLjxsl(list.stream().map(item -> item.getLjxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ vo.setLjxssr(list.stream().map(item -> item.getLjxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ vo.setQnljxsl(list.stream().map(item -> item.getQnljxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ vo.setQnljxssr(list.stream().map(item -> item.getQnljxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ vo.setTqbxsl(vo.getLjxsl().subtract(vo.getQnljxsl()));
+ vo.setTqbxssr(vo.getLjxssr().subtract(vo.getQnljxssr()));
+ baseMapper.updateById(vo);
+ }else {
+ vo = new ZbStatisticCpXssr();
+ vo.setXm("鍚堣");
+ vo.setStatYm(queryDTO.getYearMonth());
+ vo.setDyxsl(list.stream().map(item -> item.getDyxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ vo.setDyxssr(list.stream().map(item -> item.getDyxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ vo.setLjxsl(list.stream().map(item -> item.getLjxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ vo.setLjxssr(list.stream().map(item -> item.getLjxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ vo.setQnljxsl(list.stream().map(item -> item.getQnljxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ vo.setQnljxssr(list.stream().map(item -> item.getQnljxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ vo.setTqbxsl(vo.getLjxsl().subtract(vo.getQnljxsl()));
+ vo.setTqbxssr(vo.getLjxssr().subtract(vo.getQnljxssr()));
+ vo.setSort(64);
+ baseMapper.insert(vo);
+ }
+ return R.ok();
+ }
+}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ZbStatisticCpXzhtServiceImpl.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ZbStatisticCpXzhtServiceImpl.java
new file mode 100644
index 0000000..d774a7a
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ZbStatisticCpXzhtServiceImpl.java
@@ -0,0 +1,177 @@
+package com.by4cloud.platformx.business.service.impl;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.date.DatePattern;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.ObjUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.by4cloud.platformx.business.dto.ZBJTStatisticDTO;
+import com.by4cloud.platformx.business.entity.BipDict;
+import com.by4cloud.platformx.business.entity.ZbStatisticCpXssr;
+import com.by4cloud.platformx.business.entity.ZbStatisticCpXzht;
+import com.by4cloud.platformx.business.mapper.BipDictMapper;
+import com.by4cloud.platformx.business.mapper.ContractMapper;
+import com.by4cloud.platformx.business.mapper.ContractSubjectMatterMapper;
+import com.by4cloud.platformx.business.mapper.ZbStatisticCpXzhtMapper;
+import com.by4cloud.platformx.business.service.ZbStatisticCpXzhtService;
+import com.by4cloud.platformx.business.vo.CpxssrwcqkItemVo;
+import com.by4cloud.platformx.business.vo.CpxssrwcqkVo;
+import com.by4cloud.platformx.common.core.util.R;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * 浜у搧鏂板鍚堝悓瀹屾垚鎯呭喌
+ *
+ * @author syt
+ * @date 2026-11-12 10:30:21
+ */
+@Service
+@RequiredArgsConstructor
+public class ZbStatisticCpXzhtServiceImpl extends ServiceImpl<ZbStatisticCpXzhtMapper, ZbStatisticCpXzht> implements ZbStatisticCpXzhtService {
+
+ private final ContractMapper contractMapper;
+ private final ContractSubjectMatterMapper contractSubjectMatterMapper;
+ private final BipDictMapper bipDictMapper;
+
+ @Override
+ public R genCpxzhtwcqk(ZBJTStatisticDTO queryDTO) {
+ if (StrUtil.isBlank(queryDTO.getYearMonth())) {
+ queryDTO.setYearMonth(DateUtil.format(new Date(), DatePattern.NORM_MONTH_PATTERN));
+ }
+ List<ZbStatisticCpXzht> list = new ArrayList<>();
+ Date monstart = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00");
+ Date monend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
+ Date monstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00"),-1);
+ Date monendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),-1);
+ Date yearstart = DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0,4)+"-01-01 00:00:00");
+ Date yearend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
+ Date yearstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0,4)+"-01-01 00:00:00"),-1);
+ Date yearendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),-1);
+
+ contractMapper.setSession();
+ List<CpxssrwcqkItemVo> itemVoListDY = contractSubjectMatterMapper.cpxzhtwcqk(monstart,monend);
+ List<CpxssrwcqkItemVo> itemVoListLJ = contractSubjectMatterMapper.cpxzhtwcqk(yearstart,yearend);
+ List<CpxssrwcqkItemVo> itemVoListQN = contractSubjectMatterMapper.cpxzhtwcqk(yearstartLastYear,yearendLastYear);
+ List<Integer> indexList = new ArrayList<>();
+ if (CollUtil.isNotEmpty(itemVoListDY)){
+ for (int i = 0; i < itemVoListDY.size(); i++) {
+ CpxssrwcqkItemVo item = itemVoListDY.get(i);
+ ZbStatisticCpXzht vo = new ZbStatisticCpXzht();
+ vo.setXm(item.getXm());
+ vo.setStatYm(queryDTO.getYearMonth());
+ vo.setSort(i);
+ BipDict dict = bipDictMapper.selectOne(Wrappers.<BipDict>lambdaQuery().eq(BipDict::getDictKey,"zb-cpmc")
+ .eq(BipDict::getParentId,0).eq(BipDict::getDictName,item.getXm()).last("limit 1"));
+ ZbStatisticCpXzht vo1 = baseMapper.selectOne(Wrappers.<ZbStatisticCpXzht>lambdaQuery().eq(ZbStatisticCpXzht::getXm,vo.getXm())
+ .eq(ZbStatisticCpXzht::getStatYm,vo.getStatYm()).last("limit 1"));
+ if (ObjUtil.isNull(dict)) {
+ vo.setDyxsl(item.getXsl());
+ vo.setDyxssr(item.getXssr());
+ if (ObjUtil.isNotNull(vo1)) {
+ vo1.setDyxsl(item.getXsl());
+ vo1.setDyxssr(item.getXssr());
+ if (CollUtil.isNotEmpty(itemVoListLJ)) {
+ itemVoListLJ.stream().forEach(item1 -> {
+ if (StrUtil.equals(vo.getXm(), item1.getXm())) {
+ vo1.setLjxsl(item1.getXsl());
+ vo1.setLjxssr(item1.getXssr());
+ }
+ });
+ }
+ if (CollUtil.isNotEmpty(itemVoListQN)) {
+ itemVoListQN.stream().forEach(item1 -> {
+ if (StrUtil.equals(vo1.getXm(), item1.getXm())) {
+ vo1.setQnljxsl(item1.getXsl());
+ vo1.setQnljxssr(item1.getXssr());
+ vo1.setTqbxsl(vo1.getLjxsl().subtract(vo1.getQnljxsl()));
+ vo1.setTqbxssr(vo1.getLjxssr().subtract(vo1.getQnljxssr()));
+ }
+ });
+ }
+ baseMapper.updateById(vo1);
+ }else {
+ vo.setDyxsl(item.getXsl());
+ vo.setDyxssr(item.getXssr());
+ if (CollUtil.isNotEmpty(itemVoListLJ)) {
+ itemVoListLJ.stream().forEach(item1 -> {
+ if (StrUtil.equals(vo.getXm(), item1.getXm())) {
+ vo.setLjxsl(item1.getXsl());
+ vo.setLjxssr(item1.getXssr());
+ }
+ });
+ }
+ if (CollUtil.isNotEmpty(itemVoListQN)) {
+ itemVoListQN.stream().forEach(item1 -> {
+ if (StrUtil.equals(vo.getXm(), item1.getXm())) {
+ vo.setQnljxsl(item1.getXsl());
+ vo.setQnljxssr(item1.getXssr());
+ vo.setTqbxsl(vo.getLjxsl().subtract(vo.getQnljxsl()));
+ vo.setTqbxssr(vo.getLjxssr().subtract(vo.getQnljxssr()));
+ }
+ });
+ }
+ baseMapper.insert(vo);
+ }
+ }else {
+ indexList.add(i);
+ if (ObjUtil.isNull(vo1)) {
+ baseMapper.insert(vo);
+ }
+ }
+ list.add(vo);
+ }
+ indexList.add(itemVoListDY.size());
+ for (int i = 0; i < indexList.size()-1; i++) {
+ List<ZbStatisticCpXzht> sublist = list.subList(indexList.get(i),indexList.get(i+1));
+ ZbStatisticCpXzht vo = baseMapper.selectOne(Wrappers.<ZbStatisticCpXzht>lambdaQuery().eq(ZbStatisticCpXzht::getXm,list.get(indexList.get(i)).getXm())
+ .eq(ZbStatisticCpXzht::getStatYm,list.get(indexList.get(i)).getStatYm()).last("limit 1"));
+ vo.setDyxsl(sublist.stream().map(item->item.getDyxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setDyxssr(sublist.stream().map(item->item.getDyxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setLjxsl(sublist.stream().map(item->item.getLjxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setLjxssr(sublist.stream().map(item->item.getLjxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setQnljxsl(sublist.stream().map(item->item.getQnljxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setQnljxssr(sublist.stream().map(item->item.getQnljxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+ vo.setTqbxsl(vo.getLjxsl().subtract(vo.getQnljxsl()));
+ vo.setTqbxssr(vo.getLjxssr().subtract(vo.getQnljxssr()));
+ baseMapper.updateById(vo);
+ }
+ ZbStatisticCpXzht vo = baseMapper.selectOne(Wrappers.<ZbStatisticCpXzht>lambdaQuery().eq(ZbStatisticCpXzht::getXm,"鍚堣")
+ .eq(ZbStatisticCpXzht::getStatYm,queryDTO.getYearMonth()).last("limit 1"));
+ if (ObjUtil.isNotNull(vo)) {
+ vo.setDyxsl(list.stream().map(item -> item.getDyxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ vo.setDyxssr(list.stream().map(item -> item.getDyxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ vo.setLjxsl(list.stream().map(item -> item.getLjxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ vo.setLjxssr(list.stream().map(item -> item.getLjxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ vo.setQnljxsl(list.stream().map(item -> item.getQnljxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ vo.setQnljxssr(list.stream().map(item -> item.getQnljxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ vo.setTqbxsl(vo.getLjxsl().subtract(vo.getQnljxsl()));
+ vo.setTqbxssr(vo.getLjxssr().subtract(vo.getQnljxssr()));
+ baseMapper.updateById(vo);
+ }else {
+ vo = new ZbStatisticCpXzht();
+ vo.setXm("鍚堣");
+ vo.setSort(64);
+ vo.setStatYm(queryDTO.getYearMonth());
+ vo.setDyxsl(list.stream().map(item -> item.getDyxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ vo.setDyxssr(list.stream().map(item -> item.getDyxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ vo.setLjxsl(list.stream().map(item -> item.getLjxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ vo.setLjxssr(list.stream().map(item -> item.getLjxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ vo.setQnljxsl(list.stream().map(item -> item.getQnljxsl()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ vo.setQnljxssr(list.stream().map(item -> item.getQnljxssr()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ vo.setTqbxsl(vo.getLjxsl().subtract(vo.getQnljxsl()));
+ vo.setTqbxssr(vo.getLjxssr().subtract(vo.getQnljxssr()));
+ baseMapper.insert(vo);
+ }
+ }
+ return R.ok();
+ }
+}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ZbStatisticCpbkServiceImpl.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ZbStatisticCpbkServiceImpl.java
new file mode 100644
index 0000000..f334a49
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ZbStatisticCpbkServiceImpl.java
@@ -0,0 +1,364 @@
+package com.by4cloud.platformx.business.service.impl;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.date.DatePattern;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.ObjUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.by4cloud.platformx.business.dto.ZBJTStatisticDTO;
+import com.by4cloud.platformx.business.entity.ZbStatisticCpbk;
+import com.by4cloud.platformx.business.entity.ZbStatisticXszb;
+import com.by4cloud.platformx.business.mapper.ContractOutBoundMapper;
+import com.by4cloud.platformx.business.mapper.ContractSubjectMatterMapper;
+import com.by4cloud.platformx.business.mapper.ZbStatisticCpbkMapper;
+import com.by4cloud.platformx.business.service.ZbStatisticCpbkService;
+import com.by4cloud.platformx.business.vo.GcpbkwcqkItemVo;
+import com.by4cloud.platformx.business.vo.GcpbkwcqkVo;
+import com.by4cloud.platformx.common.core.util.R;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.time.YearMonth;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * 浜у搧鏉垮潡
+ *
+ * @author syt
+ * @date 2026-11-12 10:27:07
+ */
+@Service
+@RequiredArgsConstructor
+public class ZbStatisticCpbkServiceImpl extends ServiceImpl<ZbStatisticCpbkMapper, ZbStatisticCpbk> implements ZbStatisticCpbkService {
+
+ private final ContractOutBoundMapper contractOutBoundMapper;
+ private final ContractSubjectMatterMapper contractSubjectMatterMapper;
+
+ @Override
+ public R genCpbkwcqk(ZBJTStatisticDTO queryDTO) {
+ if (StrUtil.isBlank(queryDTO.getYearMonth())) {
+ queryDTO.setYearMonth(DateUtil.format(new Date(), DatePattern.NORM_MONTH_PATTERN));
+ }
+ List<ZbStatisticCpbk> list = new ArrayList<>();
+ Date monstart = DateUtil.parseDateTime(queryDTO.getYearMonth() + "-01 00:00:00");
+ Date monend = DateUtil.parseDateTime(queryDTO.getYearMonth() + "-31 23:59:59");
+ Date monstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth() + "-01 00:00:00"), -1);
+ Date monendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth() + "-31 23:59:59"), -1);
+ Date yearstart = DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0, 4) + "-01-01 00:00:00");
+ Date yearend = DateUtil.parseDateTime(queryDTO.getYearMonth() + "-31 23:59:59");
+ Date yearstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0, 4) + "-01-01 00:00:00"), -1);
+ Date yearendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth() + "-31 23:59:59"), -1);
+ String curYear = queryDTO.getYearMonth().substring(0, 4);
+ String curMonth = queryDTO.getYearMonth().substring(5);
+ YearMonth qndy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusYears(1);
+ YearMonth sy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusMonths(1);
+ //鏂板鍚堝悓
+ List<GcpbkwcqkItemVo> itemVoListMon = contractSubjectMatterMapper.gcpbkwcqk(monstart, monend);
+// List<GcpbkwcqkItemVo> itemVoListMonLastYear = contractSubjectMatterMapper.gcpbkwcqk(monstartLastYear, monendLastYear);
+ if (CollUtil.isNotEmpty(itemVoListMon)) {
+ itemVoListMon.stream().forEach(item -> {
+ ZbStatisticCpbk vo = new ZbStatisticCpbk();
+ vo.setXm("鏂板鍚堝悓");
+ vo.setStatYm(queryDTO.getYearMonth());
+ vo.setBkmc(item.getBkmc());
+ vo.setDywc(item.getWc());
+ ZbStatisticCpbk vo1 = baseMapper.selectOne(Wrappers.<ZbStatisticCpbk>lambdaQuery().eq(ZbStatisticCpbk::getXm, vo.getXm())
+ .eq(ZbStatisticCpbk::getBkmc, vo.getBkmc()).eq(ZbStatisticCpbk::getStatYm, queryDTO.getYearMonth()).last("limit 1"));
+ ZbStatisticCpbk cpbkQndy = baseMapper.selectOne(Wrappers.<ZbStatisticCpbk>lambdaQuery().eq(ZbStatisticCpbk::getXm, vo.getXm())
+ .eq(ZbStatisticCpbk::getBkmc, vo.getBkmc()).eq(ZbStatisticCpbk::getStatYm, qndy).last("limit 1"));
+ ZbStatisticCpbk cpbkSy = baseMapper.selectOne(Wrappers.<ZbStatisticCpbk>lambdaQuery().eq(ZbStatisticCpbk::getXm, vo.getXm())
+ .eq(ZbStatisticCpbk::getBkmc, vo.getBkmc()).eq(ZbStatisticCpbk::getStatYm, sy).last("limit 1"));
+ if (ObjUtil.isNotNull(vo1)) {
+ if (ObjUtil.isNotNull(cpbkQndy)) {
+ BigDecimal percent = vo1.getDywc().subtract(cpbkQndy.getDywc()).divide(cpbkQndy.getDywc(), 10, RoundingMode.HALF_UP)
+ .multiply(new BigDecimal("100"));
+ vo1.setYtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ if (ObjUtil.isNotNull(cpbkSy)) {
+ vo1.setLjwc(cpbkSy.getLjwc().add(vo1.getDywc()));
+ if (ObjUtil.isNotNull(cpbkQndy) && cpbkQndy.getLjwc().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo1.getLjwc().subtract(cpbkQndy.getLjwc()).divide(cpbkQndy.getLjwc(), 10, RoundingMode.HALF_UP)
+ .multiply(new BigDecimal("100"));
+ vo1.setNtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ baseMapper.updateById(vo1);
+ list.add(vo1);
+ } else {
+ if (ObjUtil.isNotNull(cpbkQndy)) {
+ BigDecimal percent = vo.getDywc().subtract(cpbkQndy.getDywc()).divide(cpbkQndy.getDywc(), 10, RoundingMode.HALF_UP)
+ .multiply(new BigDecimal("100"));
+ vo.setYtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ if (ObjUtil.isNotNull(cpbkSy)) {
+ vo.setLjwc(cpbkSy.getLjwc().add(vo.getDywc()));
+ if (ObjUtil.isNotNull(cpbkQndy) && cpbkQndy.getLjwc().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo.getLjwc().subtract(cpbkQndy.getLjwc()).divide(cpbkQndy.getLjwc(), 10, RoundingMode.HALF_UP)
+ .multiply(new BigDecimal("100"));
+ vo.setNtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ baseMapper.insert(vo);
+ list.add(vo);
+ }
+ });
+ }
+// List<GcpbkwcqkItemVo> itemVoListYear = contractSubjectMatterMapper.gcpbkwcqk(yearstart,yearend);
+// List<GcpbkwcqkItemVo> itemVoListYearLastYear = contractSubjectMatterMapper.gcpbkwcqk(yearstartLastYear,yearendLastYear);
+// if (CollUtil.isNotEmpty(itemVoListYear)){
+// BigDecimal ljzh = itemVoListYear.stream().map(item->item.getWc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add);
+// for (GcpbkwcqkItemVo itemVo:itemVoListYear
+// ) {
+// ZbStatisticCpbk vo = baseMapper.selectOne(Wrappers.<ZbStatisticCpbk>lambdaQuery().eq(ZbStatisticCpbk::getXm,"鏂板鍚堝悓")
+// .eq(ZbStatisticCpbk::getBkmc,itemVo.getBkmc()).eq(ZbStatisticCpbk::getStatYm,queryDTO.getYearMonth()).last("limit 1"));
+// if (StrUtil.equals(vo.getBkmc(),itemVo.getBkmc())&&StrUtil.equals(vo.getXm(),"鏂板鍚堝悓")){
+// vo.setLjwc(itemVo.getWc());
+// if (ljzh.compareTo(new BigDecimal("0"))>0){
+// BigDecimal zb = vo.getLjwc().divide(ljzh,10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// vo.setBnzb(zb.setScale(2,RoundingMode.HALF_UP)+"%");
+// }
+//
+// }
+// if (CollUtil.isNotEmpty(itemVoListYearLastYear)){
+// BigDecimal qnljzh = itemVoListYearLastYear.stream().map(item->item.getWc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add);
+//
+// itemVoListYearLastYear.stream().forEach(item1->{
+// if (StrUtil.equals(vo.getBkmc(),item1.getBkmc())&&StrUtil.equals(vo.getXm(),"鏂板鍚堝悓")&&
+// item1.getWc().compareTo(new BigDecimal("0"))>0){
+// BigDecimal percent = vo.getDywc().subtract(item1.getWc()).divide(item1.getWc(),10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// vo.setNtqb(percent.setScale(2,RoundingMode.HALF_UP)+"%");
+// }
+// if (qnljzh.compareTo(new BigDecimal("0"))>0){
+// BigDecimal qnzb = item1.getWc().multiply(new BigDecimal("100")).divide(qnljzh,2,RoundingMode.HALF_UP).setScale(2, RoundingMode.HALF_UP);
+// if (StrUtil.isNotBlank(vo.getBnzb())){
+// BigDecimal bnzb = new BigDecimal(vo.getBnzb().substring(0,vo.getBnzb().length()-1));
+// vo.setZtqb(bnzb.subtract(qnzb)+"%");
+// }
+// }
+// });
+// }
+// baseMapper.updateById(vo);
+// }
+//
+// }
+ //閿�鍞敹鍏�
+ List<GcpbkwcqkItemVo> itemVoSRListMon = contractOutBoundMapper.gcpbkwcqk(monstart, monend);
+ List<GcpbkwcqkItemVo> itemVoListSRMonLastYear = contractOutBoundMapper.gcpbkwcqk(monstartLastYear, monendLastYear);
+ if (CollUtil.isNotEmpty(itemVoSRListMon)) {
+ itemVoSRListMon.stream().forEach(item -> {
+ ZbStatisticCpbk vo = new ZbStatisticCpbk();
+ vo.setXm("閿�鍞敹鍏�");
+ vo.setStatYm(queryDTO.getYearMonth());
+ vo.setBkmc(item.getBkmc());
+ vo.setDywc(item.getWc());
+ ZbStatisticCpbk vo1 = baseMapper.selectOne(Wrappers.<ZbStatisticCpbk>lambdaQuery().eq(ZbStatisticCpbk::getXm, vo.getXm())
+ .eq(ZbStatisticCpbk::getBkmc, vo.getBkmc()).eq(ZbStatisticCpbk::getStatYm, queryDTO.getYearMonth()).last("limit 1"));
+ ZbStatisticCpbk cpbkQndy = baseMapper.selectOne(Wrappers.<ZbStatisticCpbk>lambdaQuery().eq(ZbStatisticCpbk::getXm, vo.getXm())
+ .eq(ZbStatisticCpbk::getBkmc, vo.getBkmc()).eq(ZbStatisticCpbk::getStatYm, qndy).last("limit 1"));
+ ZbStatisticCpbk cpbkSy = baseMapper.selectOne(Wrappers.<ZbStatisticCpbk>lambdaQuery().eq(ZbStatisticCpbk::getXm, vo.getXm())
+ .eq(ZbStatisticCpbk::getBkmc, vo.getBkmc()).eq(ZbStatisticCpbk::getStatYm, sy).last("limit 1"));
+ if (ObjUtil.isNotNull(vo1)) {
+ if (ObjUtil.isNotNull(cpbkQndy)) {
+ BigDecimal percent = vo1.getDywc().subtract(cpbkQndy.getDywc()).divide(cpbkQndy.getDywc(), 10, RoundingMode.HALF_UP)
+ .multiply(new BigDecimal("100"));
+ vo1.setYtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ if (ObjUtil.isNotNull(cpbkSy)) {
+ vo1.setLjwc(cpbkSy.getLjwc().add(vo1.getDywc()));
+ if (ObjUtil.isNotNull(cpbkQndy) && cpbkQndy.getLjwc().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo1.getLjwc().subtract(cpbkQndy.getLjwc()).divide(cpbkQndy.getLjwc(), 10, RoundingMode.HALF_UP)
+ .multiply(new BigDecimal("100"));
+ vo1.setNtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ baseMapper.updateById(vo1);
+ list.add(vo1);
+ } else {
+ if (ObjUtil.isNotNull(cpbkQndy)) {
+ BigDecimal percent = vo.getDywc().subtract(cpbkQndy.getDywc()).divide(cpbkQndy.getDywc(), 10, RoundingMode.HALF_UP)
+ .multiply(new BigDecimal("100"));
+ vo.setYtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ if (ObjUtil.isNotNull(cpbkSy)) {
+ vo.setLjwc(cpbkSy.getLjwc().add(vo.getDywc()));
+ if (ObjUtil.isNotNull(cpbkQndy) && cpbkQndy.getLjwc().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo.getLjwc().subtract(cpbkQndy.getLjwc()).divide(cpbkQndy.getLjwc(), 10, RoundingMode.HALF_UP)
+ .multiply(new BigDecimal("100"));
+ vo.setNtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ baseMapper.insert(vo);
+ list.add(vo);
+ }
+ });
+ }
+// List<GcpbkwcqkItemVo> itemVoListSRYear = contractOutBoundMapper.gcpbkwcqk(yearstart, yearend);
+// List<GcpbkwcqkItemVo> itemVoListSRYearLastYear = contractOutBoundMapper.gcpbkwcqk(yearstartLastYear, yearendLastYear);
+// if (CollUtil.isNotEmpty(itemVoListSRYear)) {
+// BigDecimal ljzh = itemVoListSRYear.stream().map(item -> item.getWc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+// for (GcpbkwcqkItemVo itemVo : itemVoListSRYear
+// ) {
+// ZbStatisticCpbk vo = baseMapper.selectOne(Wrappers.<ZbStatisticCpbk>lambdaQuery().eq(ZbStatisticCpbk::getXm, "閿�鍞敹鍏�")
+// .eq(ZbStatisticCpbk::getBkmc, itemVo.getBkmc()).eq(ZbStatisticCpbk::getStatYm, queryDTO.getYearMonth()).last("limit 1"));
+// if (StrUtil.equals(vo.getBkmc(), itemVo.getBkmc()) && StrUtil.equals(vo.getXm(), "閿�鍞敹鍏�")) {
+// vo.setLjwc(itemVo.getWc());
+// if (ljzh.compareTo(new BigDecimal("0")) > 0) {
+// BigDecimal zb = vo.getLjwc().divide(ljzh, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// vo.setBnzb(zb.setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// if (CollUtil.isNotEmpty(itemVoListSRYearLastYear)) {
+// BigDecimal qnljzh = itemVoListSRYearLastYear.stream().map(item -> item.getWc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+//
+// itemVoListSRYearLastYear.stream().forEach(item1 -> {
+// if (StrUtil.equals(vo.getBkmc(), item1.getBkmc()) && StrUtil.equals(vo.getXm(), "閿�鍞敹鍏�") &&
+// item1.getWc().compareTo(new BigDecimal("0")) > 0) {
+// BigDecimal percent = vo.getDywc().subtract(item1.getWc()).divide(item1.getWc(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// vo.setNtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// if (qnljzh.compareTo(new BigDecimal("0")) > 0) {
+// BigDecimal qnzb = item1.getWc().multiply(new BigDecimal("100")).divide(qnljzh, 2, RoundingMode.HALF_UP).setScale(2, RoundingMode.HALF_UP);
+// if (StrUtil.isNotBlank(vo.getBnzb())) {
+// BigDecimal bnzb = new BigDecimal(vo.getBnzb().substring(0, vo.getBnzb().length() - 1));
+// vo.setZtqb(bnzb.subtract(qnzb) + "%");
+// }
+// }
+// });
+// }
+// baseMapper.updateById(vo);
+// }
+// }
+ //璐ф鍥炴敹
+ List<GcpbkwcqkItemVo> itemVoListSKMon = contractSubjectMatterMapper.gcpbkwcqkBySK(monstart, monend);
+ List<GcpbkwcqkItemVo> itemVoListSKMonLastYear = contractSubjectMatterMapper.gcpbkwcqkBySK(monstartLastYear, monendLastYear);
+ if (CollUtil.isNotEmpty(itemVoListSKMon)) {
+ itemVoListSKMon.stream().forEach(item -> {
+ ZbStatisticCpbk vo = new ZbStatisticCpbk();
+ vo.setXm("璐ф鍥炴敹");
+ vo.setStatYm(queryDTO.getYearMonth());
+ vo.setBkmc(item.getBkmc());
+ vo.setDywc(item.getWc());
+ ZbStatisticCpbk vo1 = baseMapper.selectOne(Wrappers.<ZbStatisticCpbk>lambdaQuery().eq(ZbStatisticCpbk::getXm, vo.getXm())
+ .eq(ZbStatisticCpbk::getBkmc, vo.getBkmc()).eq(ZbStatisticCpbk::getStatYm, queryDTO.getYearMonth()).last("limit 1"));
+ ZbStatisticCpbk cpbkQndy = baseMapper.selectOne(Wrappers.<ZbStatisticCpbk>lambdaQuery().eq(ZbStatisticCpbk::getXm, vo.getXm())
+ .eq(ZbStatisticCpbk::getBkmc, vo.getBkmc()).eq(ZbStatisticCpbk::getStatYm, qndy).last("limit 1"));
+ ZbStatisticCpbk cpbkSy = baseMapper.selectOne(Wrappers.<ZbStatisticCpbk>lambdaQuery().eq(ZbStatisticCpbk::getXm, vo.getXm())
+ .eq(ZbStatisticCpbk::getBkmc, vo.getBkmc()).eq(ZbStatisticCpbk::getStatYm, sy).last("limit 1"));
+ if (ObjUtil.isNotNull(vo1)) {
+ if (ObjUtil.isNotNull(cpbkQndy)) {
+ BigDecimal percent = vo1.getDywc().subtract(cpbkQndy.getDywc()).divide(cpbkQndy.getDywc(), 10, RoundingMode.HALF_UP)
+ .multiply(new BigDecimal("100"));
+ vo1.setYtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ if (ObjUtil.isNotNull(cpbkSy)) {
+ vo1.setLjwc(cpbkSy.getLjwc().add(vo1.getDywc()));
+ if (ObjUtil.isNotNull(cpbkQndy) && cpbkQndy.getLjwc().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo1.getLjwc().subtract(cpbkQndy.getLjwc()).divide(cpbkQndy.getLjwc(), 10, RoundingMode.HALF_UP)
+ .multiply(new BigDecimal("100"));
+ vo1.setNtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ baseMapper.updateById(vo1);
+ list.add(vo1);
+ } else {
+ if (ObjUtil.isNotNull(cpbkQndy)) {
+ BigDecimal percent = vo.getDywc().subtract(cpbkQndy.getDywc()).divide(cpbkQndy.getDywc(), 10, RoundingMode.HALF_UP)
+ .multiply(new BigDecimal("100"));
+ vo.setYtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ if (ObjUtil.isNotNull(cpbkSy)) {
+ vo.setLjwc(cpbkSy.getLjwc().add(vo.getDywc()));
+ if (ObjUtil.isNotNull(cpbkQndy) && cpbkQndy.getLjwc().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo.getLjwc().subtract(cpbkQndy.getLjwc()).divide(cpbkQndy.getLjwc(), 10, RoundingMode.HALF_UP)
+ .multiply(new BigDecimal("100"));
+ vo.setNtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ baseMapper.insert(vo);
+ list.add(vo);
+ }
+ });
+ }
+// List<GcpbkwcqkItemVo> itemVoListSKYear = contractSubjectMatterMapper.gcpbkwcqkBySK(yearstart, yearend);
+// List<GcpbkwcqkItemVo> itemVoListSKYearLastYear = contractSubjectMatterMapper.gcpbkwcqkBySK(yearstartLastYear, yearendLastYear);
+// if (CollUtil.isNotEmpty(itemVoListSKYear)) {
+// for (GcpbkwcqkItemVo itemVo : itemVoListSKYear
+// ) {
+// ZbStatisticCpbk vo = baseMapper.selectOne(Wrappers.<ZbStatisticCpbk>lambdaQuery().eq(ZbStatisticCpbk::getXm, "璐ф鍥炴敹")
+// .eq(ZbStatisticCpbk::getBkmc, itemVo.getBkmc()).eq(ZbStatisticCpbk::getStatYm, queryDTO.getYearMonth()).last("limit 1"));
+// if (StrUtil.equals(vo.getBkmc(), itemVo.getBkmc()) && StrUtil.equals(vo.getXm(), "璐ф鍥炴敹")) {
+// vo.setLjwc(itemVo.getWc());
+// }
+// if (CollUtil.isNotEmpty(itemVoListSKYearLastYear)) {
+// BigDecimal qnljzh = itemVoListSKYearLastYear.stream().map(item -> item.getWc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+// itemVoListSKYearLastYear.stream().forEach(item1 -> {
+// if (StrUtil.equals(vo.getBkmc(), item1.getBkmc()) && StrUtil.equals(vo.getXm(), "璐ф鍥炴敹") &&
+// item1.getWc().compareTo(new BigDecimal("0")) > 0) {
+// BigDecimal percent = vo.getDywc().subtract(item1.getWc()).divide(item1.getWc(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// vo.setNtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// if (qnljzh.compareTo(new BigDecimal("0")) > 0) {
+// BigDecimal qnzb = item1.getWc().multiply(new BigDecimal("100")).divide(qnljzh, 2, RoundingMode.HALF_UP).setScale(2, RoundingMode.HALF_UP);
+// if (StrUtil.isNotBlank(vo.getBnzb())) {
+// BigDecimal bnzb = new BigDecimal(vo.getBnzb().substring(0, vo.getBnzb().length() - 1));
+// vo.setZtqb(bnzb.subtract(qnzb) + "%");
+// }
+// }
+// });
+// }
+// baseMapper.updateById(vo);
+// }
+// }
+ BigDecimal htzh = list.stream().filter(item->StrUtil.equals(item.getXm(),"鏂板鍚堝悓")).map(item -> item.getDywc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+ BigDecimal srzh = list.stream().filter(item->StrUtil.equals(item.getXm(),"閿�鍞敹鍏�")).map(item -> item.getDywc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+ BigDecimal hkzh = list.stream().filter(item->StrUtil.equals(item.getXm(),"璐ф鍥炴敹")).map(item -> item.getDywc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+ if (CollUtil.isNotEmpty(list)){
+ list.stream().forEach(item->{
+ if (StrUtil.equals(item.getXm(),"鏂板鍚堝悓")&&htzh.compareTo(new BigDecimal("0"))>0){
+ BigDecimal percent = item.getDywc().divide(htzh, 10, RoundingMode.HALF_UP)
+ .multiply(new BigDecimal("100"));
+ item.setBnzb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ ZbStatisticCpbk cpbkQndy = baseMapper.selectOne(Wrappers.<ZbStatisticCpbk>lambdaQuery().eq(ZbStatisticCpbk::getXm, item.getXm())
+ .eq(ZbStatisticCpbk::getBkmc, item.getBkmc()).eq(ZbStatisticCpbk::getStatYm, qndy).last("limit 1"));
+ if (ObjUtil.isNotNull(cpbkQndy)&&ObjUtil.isNotNull(cpbkQndy.getBnzb())){
+ BigDecimal qnbnzb = new BigDecimal(cpbkQndy.getBnzb().substring(0, cpbkQndy.getBnzb().length() - 1));
+ item.setZtqb(percent.subtract(qnbnzb) + "%");
+ }
+ baseMapper.updateById(item);
+ }
+ if (StrUtil.equals(item.getXm(),"閿�鍞敹鍏�")&&srzh.compareTo(new BigDecimal("0"))>0){
+ BigDecimal percent = item.getDywc().divide(srzh, 10, RoundingMode.HALF_UP)
+ .multiply(new BigDecimal("100"));
+ item.setBnzb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ ZbStatisticCpbk cpbkQndy = baseMapper.selectOne(Wrappers.<ZbStatisticCpbk>lambdaQuery().eq(ZbStatisticCpbk::getXm, item.getXm())
+ .eq(ZbStatisticCpbk::getBkmc, item.getBkmc()).eq(ZbStatisticCpbk::getStatYm, qndy).last("limit 1"));
+ if (ObjUtil.isNotNull(cpbkQndy)&&ObjUtil.isNotNull(cpbkQndy.getBnzb())){
+ BigDecimal qnbnzb = new BigDecimal(cpbkQndy.getBnzb().substring(0, cpbkQndy.getBnzb().length() - 1));
+ item.setZtqb(percent.subtract(qnbnzb) + "%");
+ }
+ baseMapper.updateById(item);
+ }
+ if (StrUtil.equals(item.getXm(),"璐ф鍥炴敹")&&hkzh.compareTo(new BigDecimal("0"))>0){
+ BigDecimal percent = item.getDywc().divide(hkzh, 10, RoundingMode.HALF_UP)
+ .multiply(new BigDecimal("100"));
+ item.setBnzb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ ZbStatisticCpbk cpbkQndy = baseMapper.selectOne(Wrappers.<ZbStatisticCpbk>lambdaQuery().eq(ZbStatisticCpbk::getXm, item.getXm())
+ .eq(ZbStatisticCpbk::getBkmc, item.getBkmc()).eq(ZbStatisticCpbk::getStatYm, qndy).last("limit 1"));
+ if (ObjUtil.isNotNull(cpbkQndy)&&ObjUtil.isNotNull(cpbkQndy.getBnzb())){
+ BigDecimal qnbnzb = new BigDecimal(cpbkQndy.getBnzb().substring(0, cpbkQndy.getBnzb().length() - 1));
+ item.setZtqb(percent.subtract(qnbnzb) + "%");
+ }
+ baseMapper.updateById(item);
+ }
+ });
+ }
+ return R.ok();
+ }
+}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ZbStatisticXszbServiceImpl.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ZbStatisticXszbServiceImpl.java
new file mode 100644
index 0000000..ea7d893
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ZbStatisticXszbServiceImpl.java
@@ -0,0 +1,795 @@
+package com.by4cloud.platformx.business.service.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.date.DatePattern;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.ObjUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.by4cloud.platformx.business.dto.ZBJTStatisticDTO;
+import com.by4cloud.platformx.business.entity.AnnualPlan;
+import com.by4cloud.platformx.business.entity.ZbStatisticXszb;
+import com.by4cloud.platformx.business.mapper.*;
+import com.by4cloud.platformx.business.service.ZbStatisticXszbService;
+import com.by4cloud.platformx.business.vo.AnnualPlanTotalVo;
+import com.by4cloud.platformx.business.vo.HomeZbjtVo;
+import com.by4cloud.platformx.business.vo.ZyxszbwcqkVo;
+import com.by4cloud.platformx.common.core.util.R;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.time.YearMonth;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 閿�鍞寚鏍�
+ *
+ * @author syt
+ * @date 2026-11-12 10:26:32
+ */
+@Service
+@RequiredArgsConstructor
+public class ZbStatisticXszbServiceImpl extends ServiceImpl<ZbStatisticXszbMapper, ZbStatisticXszb> implements ZbStatisticXszbService {
+
+ private final PaymentSlipMapper paymentSlipMapper;
+ private final ContractInvoiceMapper contractInvoiceMapper;
+ private final ContractMapper contractMapper;
+ private final AnnualPlanMapper annualPlanMapper;
+
+ @Override
+ public R genZyxszbwcqk(ZBJTStatisticDTO queryDTO) {
+ if (StrUtil.isBlank(queryDTO.getYearMonth())){
+ queryDTO.setYearMonth(DateUtil.format(new Date(), DatePattern.NORM_MONTH_PATTERN));
+ }
+ List<ZyxszbwcqkVo> list = new ArrayList<>();
+ Date monstart = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00");
+ Date monend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
+ Date monstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-01 00:00:00"),-1);
+ Date monendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),-1);
+ Date yearstart = DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0,4)+"-01-01 00:00:00");
+ Date yearend = DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59");
+ Date yearstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0,4)+"-01-01 00:00:00"),-1);
+ Date yearendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth()+"-31 23:59:59"),-1);
+
+ HomeZbjtVo hk = paymentSlipMapper.homeZbjtYearAndMon(monstart,monend,yearstart,yearend,
+ monstartLastYear,monendLastYear,yearstartLastYear,yearendLastYear);
+ handlezBJTVo("璐ф鍥炴敹",hk,queryDTO.getYearMonth().substring(0,4), queryDTO.getYearMonth().substring(5), "3");
+
+ HomeZbjtVo kp = contractInvoiceMapper.homeZbjtYearAndMon(monstart,monend,yearstart,yearend);
+
+ handlezBJTVo("閿�鍞敹鍏�",kp,queryDTO.getYearMonth().substring(0,4), queryDTO.getYearMonth().substring(5), "2");
+
+ HomeZbjtVo htqd = contractMapper.homeZbjtYearAndMon(monstart,monend,yearstart,yearend);
+
+ handlezBJTVo("鏂板鍚堝悓",htqd,queryDTO.getYearMonth().substring(0,4), queryDTO.getYearMonth().substring(5), "1");
+ return R.ok();
+ }
+
+ private void handlezBJTVo(String xm, HomeZbjtVo kp,String curYear,String curMonth,String planType) {
+ List<Long> compIds = new ArrayList<>();
+ compIds.add(2089995177814495234L);
+ compIds.add(2089996921978040321L);
+ compIds.add(2089997578009128962L);
+ compIds.add(2101966257365045249L);
+ ZbStatisticXszb xszbSMJ = new ZbStatisticXszb();
+ xszbSMJ.setXm(xm);
+ xszbSMJ.setDw("鐭崇叅鏈�");
+ xszbSMJ.setStatYm(curYear+"-"+curMonth);
+ xszbSMJ.setCompId(2089995177814495234L);
+ ZbStatisticXszb xszbSmj = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"鐭崇叅鏈�").eq(ZbStatisticXszb::getStatYm,xszbSMJ.getStatYm()).last("limit 1"));
+ AnnualPlan planListSMJ = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+ .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, planType)
+ .in(AnnualPlan::getCompId, compIds).last("limit 1"));
+ if (ObjUtil.isNotNull(xszbSmj)){
+ if (ObjUtil.isNotNull(planListSMJ)) {
+ AnnualPlanTotalVo plansmj = BeanUtil.copyProperties(planListSMJ, AnnualPlanTotalVo.class);
+ BigDecimal curMonAmount = plansmj.getMonthAmount(curMonth);
+ xszbSmj.setDyjh(curMonAmount);//褰撴湀璁″垝
+ xszbSmj.setNdjh(plansmj.getTotalAmount());//骞村害璁″垝
+ xszbSmj.setLjjh(plansmj.getToMonTotalAmount(curMonth));//绱璁″垝
+ }
+ xszbSmj.setDywc(kp.getSmjby());//褰撴湀瀹屾垚
+ if (xszbSmj.getDyjh().compareTo(new BigDecimal("0")) > 0) {//褰撴湀璁″垝瀹屾垚鐜�
+ xszbSmj.setYjhwc(xszbSmj.getDywc().divide(xszbSmj.getDyjh(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ YearMonth qndy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusYears(1);
+ ZbStatisticXszb xszbSmjQNDY = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"鐭崇叅鏈�").eq(ZbStatisticXszb::getStatYm,qndy).last("limit 1"));
+ if (ObjUtil.isNotNull(xszbSmjQNDY)&&xszbSmjQNDY.getDywc().compareTo(new BigDecimal("0"))>0){
+ xszbSmj.setYtqb(xszbSmj.getDywc().subtract(xszbSmjQNDY.getDywc()).divide(xszbSmjQNDY.getDywc(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ YearMonth sy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusMonths(1);
+ ZbStatisticXszb xszbSmjSy = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"鐭崇叅鏈�").eq(ZbStatisticXszb::getStatYm,sy).last("limit 1"));
+ if (ObjUtil.isNotNull(xszbSmjSy)) {
+ xszbSmj.setLjwc(xszbSmjSy.getLjwc().add(xszbSmj.getDywc()));//绱瀹屾垚
+ if (xszbSmj.getLjjh().compareTo(new BigDecimal("0")) > 0) {//绱璁″垝瀹屾垚鐜�
+ xszbSmj.setNjhwc(xszbSmj.getLjwc().divide(xszbSmj.getLjjh(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ if (ObjUtil.isNotNull(xszbSmjQNDY) && xszbSmjQNDY.getLjwc().compareTo(new BigDecimal("0")) > 0) {
+ xszbSmj.setNtqb(xszbSmj.getLjwc().subtract(xszbSmjQNDY.getLjwc()).divide(xszbSmjQNDY.getLjwc(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ baseMapper.updateById(xszbSmj);
+ }else {
+ if (ObjUtil.isNotNull(planListSMJ)) {
+ AnnualPlanTotalVo plansmj = BeanUtil.copyProperties(planListSMJ, AnnualPlanTotalVo.class);
+ BigDecimal curMonAmount = plansmj.getMonthAmount(curMonth);
+ xszbSMJ.setDyjh(curMonAmount);//褰撴湀璁″垝
+ xszbSMJ.setNdjh(plansmj.getTotalAmount());//骞村害璁″垝
+ xszbSMJ.setLjjh(plansmj.getToMonTotalAmount(curMonth));//绱璁″垝
+ }
+ xszbSMJ.setDywc(kp.getSmjby());//褰撴湀瀹屾垚
+ if (xszbSMJ.getDyjh().compareTo(new BigDecimal("0")) > 0) {//褰撴湀璁″垝瀹屾垚鐜�
+ xszbSMJ.setYjhwc(xszbSMJ.getDywc().divide(xszbSMJ.getDyjh(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ YearMonth qndy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusYears(1);
+ ZbStatisticXszb xszbSmjQNDY = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"鐭崇叅鏈�").eq(ZbStatisticXszb::getStatYm,qndy).last("limit 1"));
+ if (ObjUtil.isNotNull(xszbSmjQNDY)&&xszbSmjQNDY.getDywc().compareTo(new BigDecimal("0"))>0){
+ xszbSMJ.setYtqb(xszbSMJ.getDywc().subtract(xszbSmjQNDY.getDywc()).divide(xszbSmjQNDY.getDywc(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ YearMonth sy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusMonths(1);
+ ZbStatisticXszb xszbSmjSy = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"鐭崇叅鏈�").eq(ZbStatisticXszb::getStatYm,sy).last("limit 1"));
+ if (ObjUtil.isNotNull(xszbSmjSy)) {
+ xszbSMJ.setLjwc(xszbSmjSy.getLjwc().add(xszbSMJ.getDywc()));//绱瀹屾垚
+ if (xszbSMJ.getLjjh().compareTo(new BigDecimal("0")) > 0) {//绱璁″垝瀹屾垚鐜�
+ xszbSMJ.setNjhwc(xszbSMJ.getLjwc().divide(xszbSMJ.getLjjh(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ if (ObjUtil.isNotNull(xszbSmjQNDY) && xszbSmjQNDY.getLjwc().compareTo(new BigDecimal("0")) > 0) {
+ xszbSMJ.setNtqb(xszbSMJ.getLjwc().subtract(xszbSmjQNDY.getLjwc()).divide(xszbSmjQNDY.getLjwc(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ baseMapper.insert(xszbSMJ);
+ }
+ ZbStatisticXszb xszbSGB = new ZbStatisticXszb();
+ xszbSGB.setXm(xm);
+ xszbSGB.setDw("鐭冲伐娉�");
+ xszbSGB.setStatYm(curYear+"-"+curMonth);
+ xszbSGB.setCompId(2056556196124250113L);
+ ZbStatisticXszb xszbSgb = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"鐭冲伐娉�").eq(ZbStatisticXszb::getStatYm,xszbSMJ.getStatYm()).last("limit 1"));
+ AnnualPlan planListSGB = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+ .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, planType)
+ .eq(AnnualPlan::getCompId, 2056556196124250113L).last("limit 1"));
+ if (ObjUtil.isNotNull(xszbSgb)){
+ if (ObjUtil.isNotNull(planListSGB)) {
+ AnnualPlanTotalVo plansmj = BeanUtil.copyProperties(planListSGB, AnnualPlanTotalVo.class);
+ BigDecimal curMonAmount = plansmj.getMonthAmount(curMonth);
+ xszbSgb.setDyjh(curMonAmount);//褰撴湀璁″垝
+ xszbSgb.setNdjh(plansmj.getTotalAmount());//骞村害璁″垝
+ xszbSgb.setLjjh(plansmj.getToMonTotalAmount(curMonth));//绱璁″垝
+ }
+ xszbSgb.setDywc(kp.getSmjby());//褰撴湀瀹屾垚
+ if (xszbSgb.getDyjh().compareTo(new BigDecimal("0")) > 0) {//褰撴湀璁″垝瀹屾垚鐜�
+ xszbSgb.setYjhwc(xszbSgb.getDywc().divide(xszbSgb.getDyjh(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ YearMonth qndy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusYears(1);
+ ZbStatisticXszb xszbSmjQNDY = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"鐭冲伐娉�").eq(ZbStatisticXszb::getStatYm,qndy).last("limit 1"));
+ if (ObjUtil.isNotNull(xszbSmjQNDY)&&xszbSmjQNDY.getDywc().compareTo(new BigDecimal("0"))>0){
+ xszbSgb.setYtqb(xszbSgb.getDywc().subtract(xszbSmjQNDY.getDywc()).divide(xszbSmjQNDY.getDywc(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ YearMonth sy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusMonths(1);
+ ZbStatisticXszb xszbSgbSy = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"鐭冲伐娉�").eq(ZbStatisticXszb::getStatYm,sy).last("limit 1"));
+ if (ObjUtil.isNotNull(xszbSgbSy)) {
+ xszbSgb.setLjwc(xszbSgbSy.getLjwc().add(xszbSgb.getDywc()));//绱瀹屾垚
+ if (xszbSgb.getLjjh().compareTo(new BigDecimal("0")) > 0) {//绱璁″垝瀹屾垚鐜�
+ xszbSgb.setNjhwc(xszbSgb.getLjwc().divide(xszbSgb.getLjjh(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ if (ObjUtil.isNotNull(xszbSmjQNDY) && xszbSmjQNDY.getLjwc().compareTo(new BigDecimal("0")) > 0) {
+ xszbSgb.setNtqb(xszbSgb.getLjwc().subtract(xszbSmjQNDY.getLjwc()).divide(xszbSmjQNDY.getLjwc(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ baseMapper.updateById(xszbSgb);
+ }else {
+ if (ObjUtil.isNotNull(planListSGB)) {
+ AnnualPlanTotalVo plansmj = BeanUtil.copyProperties(planListSGB, AnnualPlanTotalVo.class);
+ BigDecimal curMonAmount = plansmj.getMonthAmount(curMonth);
+ xszbSGB.setDyjh(curMonAmount);//褰撴湀璁″垝
+ xszbSGB.setNdjh(plansmj.getTotalAmount());//骞村害璁″垝
+ xszbSGB.setLjjh(plansmj.getToMonTotalAmount(curMonth));//绱璁″垝
+ }
+ xszbSGB.setDywc(kp.getSgbby());//褰撴湀瀹屾垚
+ if (xszbSGB.getDyjh().compareTo(new BigDecimal("0")) > 0) {//褰撴湀璁″垝瀹屾垚鐜�
+ xszbSGB.setYjhwc(xszbSGB.getDywc().divide(xszbSGB.getDyjh(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ YearMonth qndy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusYears(1);
+ ZbStatisticXszb xszbSmjQNDY = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"鐭冲伐娉�").eq(ZbStatisticXszb::getStatYm,qndy).last("limit 1"));
+ if (ObjUtil.isNotNull(xszbSmjQNDY)&&xszbSmjQNDY.getDywc().compareTo(new BigDecimal("0"))>0){
+ xszbSGB.setYtqb(xszbSGB.getDywc().subtract(xszbSmjQNDY.getDywc()).divide(xszbSmjQNDY.getDywc(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ YearMonth sy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusMonths(1);
+ ZbStatisticXszb xszbSgbSy = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"鐭冲伐娉�").eq(ZbStatisticXszb::getStatYm,sy).last("limit 1"));
+ if (ObjUtil.isNotNull(xszbSgbSy)) {
+ xszbSGB.setLjwc(xszbSgbSy.getLjwc().add(xszbSGB.getDywc()));//绱瀹屾垚
+ if (xszbSGB.getLjjh().compareTo(new BigDecimal("0")) > 0) {//绱璁″垝瀹屾垚鐜�
+ xszbSGB.setNjhwc(xszbSGB.getLjwc().divide(xszbSGB.getLjjh(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ if (ObjUtil.isNotNull(xszbSmjQNDY) && xszbSmjQNDY.getLjwc().compareTo(new BigDecimal("0")) > 0) {
+ xszbSGB.setNtqb(xszbSGB.getLjwc().subtract(xszbSmjQNDY.getLjwc()).divide(xszbSmjQNDY.getLjwc(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ baseMapper.insert(xszbSGB);
+ }
+ ZbStatisticXszb xszbXTC = new ZbStatisticXszb();
+ xszbXTC.setXm(xm);
+ xszbXTC.setDw("閭㈠彴鍘�");
+ xszbXTC.setStatYm(curYear+"-"+curMonth);
+ xszbXTC.setCompId(2056556317461270529L);
+ ZbStatisticXszb xszbXtc = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"閭㈠彴鍘�").eq(ZbStatisticXszb::getStatYm,xszbSMJ.getStatYm()).last("limit 1"));
+ AnnualPlan planListXTC = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+ .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, planType)
+ .eq(AnnualPlan::getCompId, 2056556317461270529L).last("limit 1"));
+ if (ObjUtil.isNotNull(xszbXtc)){
+ if (ObjUtil.isNotNull(planListXTC)) {
+ AnnualPlanTotalVo plansmj = BeanUtil.copyProperties(planListXTC, AnnualPlanTotalVo.class);
+ BigDecimal curMonAmount = plansmj.getMonthAmount(curMonth);
+ xszbXtc.setDyjh(curMonAmount);//褰撴湀璁″垝
+ xszbXtc.setNdjh(plansmj.getTotalAmount());//骞村害璁″垝
+ xszbXtc.setLjjh(plansmj.getToMonTotalAmount(curMonth));//绱璁″垝
+ }
+ xszbXtc.setDywc(kp.getJxcby());//褰撴湀瀹屾垚
+ if (xszbXtc.getDyjh().compareTo(new BigDecimal("0")) > 0) {//褰撴湀璁″垝瀹屾垚鐜�
+ xszbXtc.setYjhwc(xszbXtc.getDywc().divide(xszbXtc.getDyjh(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ YearMonth qndy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusYears(1);
+ ZbStatisticXszb xszbSmjQNDY = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"閭㈠彴鍘�").eq(ZbStatisticXszb::getStatYm,qndy).last("limit 1"));
+ if (ObjUtil.isNotNull(xszbSmjQNDY)&&xszbSmjQNDY.getDywc().compareTo(new BigDecimal("0"))>0){
+ xszbXtc.setYtqb(xszbXtc.getDywc().subtract(xszbSmjQNDY.getDywc()).divide(xszbSmjQNDY.getDywc(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+
+ YearMonth sy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusMonths(1);
+ ZbStatisticXszb xszbXtcSy = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"閭㈠彴鍘�").eq(ZbStatisticXszb::getStatYm,sy).last("limit 1"));
+ if (ObjUtil.isNotNull(xszbXtcSy)) {
+ xszbXtc.setLjwc(xszbXtcSy.getLjwc().add(xszbXtc.getDywc()));//绱瀹屾垚
+ if (xszbXtc.getLjjh().compareTo(new BigDecimal("0")) > 0) {//绱璁″垝瀹屾垚鐜�
+ xszbXtc.setNjhwc(xszbXtc.getLjwc().divide(xszbXtc.getLjjh(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ if (ObjUtil.isNotNull(xszbSmjQNDY) && xszbSmjQNDY.getLjwc().compareTo(new BigDecimal("0")) > 0) {
+ xszbXtc.setNtqb(xszbXtc.getLjwc().subtract(xszbSmjQNDY.getLjwc()).divide(xszbSmjQNDY.getLjwc(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ baseMapper.updateById(xszbXtc);
+ }else {
+ if (ObjUtil.isNotNull(planListXTC)) {
+ AnnualPlanTotalVo plansmj = BeanUtil.copyProperties(planListXTC, AnnualPlanTotalVo.class);
+ BigDecimal curMonAmount = plansmj.getMonthAmount(curMonth);
+ xszbXTC.setDyjh(curMonAmount);//褰撴湀璁″垝
+ xszbXTC.setNdjh(plansmj.getTotalAmount());//骞村害璁″垝
+ xszbXTC.setLjjh(plansmj.getToMonTotalAmount(curMonth));//绱璁″垝
+ }
+ xszbXTC.setDywc(kp.getJxcby());//绱瀹屾垚
+ if (xszbXTC.getDyjh().compareTo(new BigDecimal("0")) > 0) {//褰撴湀璁″垝瀹屾垚鐜�
+ xszbXTC.setYjhwc(xszbXTC.getDywc().divide(xszbXTC.getDyjh(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ YearMonth qndy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusYears(1);
+ ZbStatisticXszb xszbSmjQNDY = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"閭㈠彴鍘�").eq(ZbStatisticXszb::getStatYm,qndy).last("limit 1"));
+ if (ObjUtil.isNotNull(xszbSmjQNDY)&&xszbSmjQNDY.getDywc().compareTo(new BigDecimal("0"))>0){
+ xszbXTC.setYtqb(xszbXTC.getDywc().subtract(xszbSmjQNDY.getDywc()).divide(xszbSmjQNDY.getDywc(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ YearMonth sy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusMonths(1);
+ ZbStatisticXszb xszbXtcSy = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"閭㈠彴鍘�").eq(ZbStatisticXszb::getStatYm,sy).last("limit 1"));
+ if (ObjUtil.isNotNull(xszbXtcSy)) {
+ xszbXTC.setLjwc(xszbXtcSy.getLjwc().add(xszbXTC.getDywc()));//绱瀹屾垚
+ if (xszbXTC.getLjjh().compareTo(new BigDecimal("0")) > 0) {//绱璁″垝瀹屾垚鐜�
+ xszbXTC.setNjhwc(xszbXTC.getLjwc().divide(xszbXTC.getLjjh(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ if (ObjUtil.isNotNull(xszbSmjQNDY) && xszbSmjQNDY.getLjwc().compareTo(new BigDecimal("0")) > 0) {
+ xszbXTC.setNtqb(xszbXTC.getLjwc().subtract(xszbSmjQNDY.getLjwc()).divide(xszbSmjQNDY.getLjwc(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ baseMapper.insert(xszbXTC);
+ }
+ ZbStatisticXszb xszbTFC = new ZbStatisticXszb();
+ xszbTFC.setXm(xm);
+ xszbTFC.setDw("閫氭柟鍘�");
+ xszbTFC.setStatYm(curYear+"-"+curMonth);
+ xszbTFC.setCompId(2056556421857497090L);
+ ZbStatisticXszb xszbTfc = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"閫氭柟鍘�").eq(ZbStatisticXszb::getStatYm,xszbSMJ.getStatYm()).last("limit 1"));
+ AnnualPlan planListTFC = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+ .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, planType)
+ .eq(AnnualPlan::getCompId, 2056556421857497090L).last("limit 1"));
+ if (ObjUtil.isNotNull(xszbTfc)){
+ if (ObjUtil.isNotNull(planListTFC)) {
+ AnnualPlanTotalVo plansmj = BeanUtil.copyProperties(planListTFC, AnnualPlanTotalVo.class);
+ BigDecimal curMonAmount = plansmj.getMonthAmount(curMonth);
+ xszbTfc.setDyjh(curMonAmount);//褰撴湀璁″垝
+ xszbTfc.setNdjh(plansmj.getTotalAmount());//骞村害璁″垝
+ xszbTfc.setLjjh(plansmj.getToMonTotalAmount(curMonth));//绱璁″垝
+ }
+ xszbTfc.setDywc(kp.getTfby());//褰撴湀瀹屾垚
+ if (xszbTfc.getDyjh().compareTo(new BigDecimal("0")) > 0) {//褰撴湀璁″垝瀹屾垚鐜�
+ xszbTfc.setYjhwc(xszbTfc.getDywc().divide(xszbTfc.getDyjh(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ YearMonth qndy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusYears(1);
+ ZbStatisticXszb xszbSmjQNDY = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"閫氭柟鍘�").eq(ZbStatisticXszb::getStatYm,qndy).last("limit 1"));
+ if (ObjUtil.isNotNull(xszbSmjQNDY)&&xszbSmjQNDY.getDywc().compareTo(new BigDecimal("0"))>0){
+ xszbTfc.setYtqb(xszbTfc.getDywc().subtract(xszbSmjQNDY.getDywc()).divide(xszbSmjQNDY.getDywc(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ YearMonth sy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusMonths(1);
+ ZbStatisticXszb xszbTfcSy = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"閫氭柟鍘�").eq(ZbStatisticXszb::getStatYm,sy).last("limit 1"));
+ if (ObjUtil.isNotNull(xszbTfcSy)) {
+ xszbTfc.setLjwc(xszbTfcSy.getLjwc().add(xszbTfc.getDywc()));
+ if (xszbTfc.getLjjh().compareTo(new BigDecimal("0")) > 0) {//绱璁″垝瀹屾垚鐜�
+ xszbTfc.setNjhwc(xszbTfc.getLjwc().divide(xszbTfc.getLjjh(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ if (ObjUtil.isNotNull(xszbSmjQNDY) && xszbSmjQNDY.getLjwc().compareTo(new BigDecimal("0")) > 0) {
+ xszbTfc.setNtqb(xszbTfc.getLjwc().subtract(xszbSmjQNDY.getLjwc()).divide(xszbSmjQNDY.getLjwc(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ baseMapper.updateById(xszbTfc);
+ }else {
+ if (ObjUtil.isNotNull(planListTFC)) {
+ AnnualPlanTotalVo plansmj = BeanUtil.copyProperties(planListTFC, AnnualPlanTotalVo.class);
+ BigDecimal curMonAmount = plansmj.getMonthAmount(curMonth);
+ xszbTFC.setDyjh(curMonAmount);//褰撴湀璁″垝
+ xszbTFC.setNdjh(plansmj.getTotalAmount());//骞村害璁″垝
+ xszbTFC.setLjjh(plansmj.getToMonTotalAmount(curMonth));//绱璁″垝
+ }
+ xszbTFC.setDywc(kp.getTfby());//褰撴湀瀹屾垚
+ if (xszbTFC.getDyjh().compareTo(new BigDecimal("0")) > 0) {//褰撴湀璁″垝瀹屾垚鐜�
+ xszbTFC.setYjhwc(xszbTFC.getDywc().divide(xszbTFC.getDyjh(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ YearMonth qndy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusYears(1);
+ ZbStatisticXszb xszbSmjQNDY = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"閫氭柟鍘�").eq(ZbStatisticXszb::getStatYm,qndy).last("limit 1"));
+ if (ObjUtil.isNotNull(xszbSmjQNDY)&&xszbSmjQNDY.getDywc().compareTo(new BigDecimal("0"))>0){
+ xszbTFC.setYtqb(xszbTFC.getDywc().subtract(xszbSmjQNDY.getDywc()).divide(xszbSmjQNDY.getDywc(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ YearMonth sy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusMonths(1);
+ ZbStatisticXszb xszbTfcSy = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"閫氭柟鍘�").eq(ZbStatisticXszb::getStatYm,sy).last("limit 1"));
+ if (ObjUtil.isNotNull(xszbTfcSy)) {
+ xszbTFC.setLjwc(xszbTfcSy.getLjwc().add(xszbTFC.getDywc()));
+ if (xszbTFC.getLjjh().compareTo(new BigDecimal("0")) > 0) {//绱璁″垝瀹屾垚鐜�
+ xszbTFC.setNjhwc(xszbTFC.getLjwc().divide(xszbTFC.getLjjh(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ if (ObjUtil.isNotNull(xszbSmjQNDY) && xszbSmjQNDY.getLjwc().compareTo(new BigDecimal("0")) > 0) {
+ xszbTFC.setNtqb(xszbTFC.getLjwc().subtract(xszbSmjQNDY.getLjwc()).divide(xszbSmjQNDY.getLjwc(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ baseMapper.insert(xszbTFC);
+ }
+ ZbStatisticXszb xszbYMJ = new ZbStatisticXszb();
+ xszbYMJ.setXm(xm);
+ xszbYMJ.setDw("涓�鐓ゆ満");
+ xszbYMJ.setStatYm(curYear+"-"+curMonth);
+ xszbYMJ.setCompId(2056556535640576002L);
+ ZbStatisticXszb xszbYmj = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"涓�鐓ゆ満").eq(ZbStatisticXszb::getStatYm,xszbSMJ.getStatYm()).last("limit 1"));
+ AnnualPlan planListYMJ = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+ .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, planType)
+ .eq(AnnualPlan::getCompId, 2056556535640576002L).last("limit 1"));
+ if (ObjUtil.isNotNull(xszbYmj)){
+ if (ObjUtil.isNotNull(planListYMJ)) {
+ AnnualPlanTotalVo plansmj = BeanUtil.copyProperties(planListYMJ, AnnualPlanTotalVo.class);
+ BigDecimal curMonAmount = plansmj.getMonthAmount(curMonth);
+ xszbYmj.setDyjh(curMonAmount);//褰撴湀璁″垝
+ xszbYmj.setNdjh(plansmj.getTotalAmount());//骞村害璁″垝
+ xszbYmj.setLjjh(plansmj.getToMonTotalAmount(curMonth));//绱璁″垝
+ }
+ xszbYmj.setDywc(kp.getYmjby());//褰撴湀瀹屾垚
+ if (xszbYmj.getDyjh().compareTo(new BigDecimal("0")) > 0) {//褰撴湀璁″垝瀹屾垚鐜�
+ xszbYmj.setYjhwc(xszbYmj.getDywc().divide(xszbYmj.getDyjh(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ YearMonth qndy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusYears(1);
+ ZbStatisticXszb xszbSmjQNDY = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"涓�鐓ゆ満").eq(ZbStatisticXszb::getStatYm,qndy).last("limit 1"));
+ if (ObjUtil.isNotNull(xszbSmjQNDY)&&xszbSmjQNDY.getDywc().compareTo(new BigDecimal("0"))>0){
+ xszbYmj.setYtqb(xszbYmj.getDywc().subtract(xszbSmjQNDY.getDywc()).divide(xszbSmjQNDY.getDywc(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+
+ YearMonth sy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusMonths(1);
+ ZbStatisticXszb xszbYmjSy = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"涓�鐓ゆ満").eq(ZbStatisticXszb::getStatYm,sy).last("limit 1"));
+ if (ObjUtil.isNotNull(xszbYmjSy)) {
+ xszbYmj.setLjwc(xszbYmjSy.getLjwc().add(xszbYmj.getDywc()));
+ if (xszbYmj.getLjjh().compareTo(new BigDecimal("0")) > 0) {//绱璁″垝瀹屾垚鐜�
+ xszbYmj.setNjhwc(xszbYmj.getLjwc().divide(xszbYmj.getLjjh(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ if (ObjUtil.isNotNull(xszbSmjQNDY) && xszbSmjQNDY.getLjwc().compareTo(new BigDecimal("0")) > 0) {
+ xszbYmj.setNtqb(xszbYmj.getLjwc().subtract(xszbSmjQNDY.getLjwc()).divide(xszbSmjQNDY.getLjwc(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ baseMapper.updateById(xszbYmj);
+ }else {
+ if (ObjUtil.isNotNull(planListYMJ)) {
+ AnnualPlanTotalVo plansmj = BeanUtil.copyProperties(planListYMJ, AnnualPlanTotalVo.class);
+ BigDecimal curMonAmount = plansmj.getMonthAmount(curMonth);
+ xszbYMJ.setDyjh(curMonAmount);//褰撴湀璁″垝
+ xszbYMJ.setNdjh(plansmj.getTotalAmount());//骞村害璁″垝
+ xszbYMJ.setLjjh(plansmj.getToMonTotalAmount(curMonth));//绱璁″垝
+ }
+
+ xszbYMJ.setDywc(kp.getYmjby());//褰撴湀瀹屾垚
+ if (xszbYMJ.getDyjh().compareTo(new BigDecimal("0")) > 0) {//褰撴湀璁″垝瀹屾垚鐜�
+ xszbYMJ.setYjhwc(xszbYMJ.getDywc().divide(xszbYMJ.getDyjh(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ YearMonth qndy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusYears(1);
+ ZbStatisticXszb xszbSmjQNDY = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"涓�鐓ゆ満").eq(ZbStatisticXszb::getStatYm,qndy).last("limit 1"));
+ if (ObjUtil.isNotNull(xszbSmjQNDY)&&xszbSmjQNDY.getDywc().compareTo(new BigDecimal("0"))>0){
+ xszbYMJ.setYtqb(xszbYMJ.getDywc().subtract(xszbSmjQNDY.getDywc()).divide(xszbSmjQNDY.getDywc(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+
+ YearMonth sy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusMonths(1);
+ ZbStatisticXszb xszbYmjSy = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"涓�鐓ゆ満").eq(ZbStatisticXszb::getStatYm,sy).last("limit 1"));
+ if (ObjUtil.isNotNull(xszbYmjSy)) {
+ xszbYMJ.setLjwc(xszbYmjSy.getLjwc().add(xszbYMJ.getDywc()));
+ if (xszbYMJ.getLjjh().compareTo(new BigDecimal("0")) > 0) {//绱璁″垝瀹屾垚鐜�
+ xszbYMJ.setNjhwc(xszbYMJ.getLjwc().divide(xszbYMJ.getLjjh(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ if (ObjUtil.isNotNull(xszbSmjQNDY) && xszbSmjQNDY.getLjwc().compareTo(new BigDecimal("0")) > 0) {
+ xszbYMJ.setNtqb(xszbYMJ.getLjwc().subtract(xszbSmjQNDY.getLjwc()).divide(xszbSmjQNDY.getLjwc(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ baseMapper.insert(xszbYMJ);
+ }
+ ZbStatisticXszb xszbZBJT = new ZbStatisticXszb();
+ xszbZBJT.setXm(xm);
+ xszbZBJT.setDw("瑁呭闆嗗洟");
+ xszbZBJT.setStatYm(curYear+"-"+curMonth);
+ ZbStatisticXszb xszbZbjt = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"瑁呭闆嗗洟").eq(ZbStatisticXszb::getStatYm,xszbSMJ.getStatYm()).last("limit 1"));
+ AnnualPlanTotalVo planListZB = annualPlanMapper.selectPlanYear(curYear, planType);
+ if (ObjUtil.isNotNull(xszbZbjt)){
+ if (ObjUtil.isNotNull(planListZB)) {
+ AnnualPlanTotalVo plansmj = BeanUtil.copyProperties(planListZB, AnnualPlanTotalVo.class);
+ BigDecimal curMonAmount = plansmj.getMonthAmount(curMonth);
+ xszbZbjt.setDyjh(curMonAmount);//褰撴湀璁″垝
+ xszbZbjt.setNdjh(plansmj.getTotalAmount());//骞村害璁″垝
+ xszbZbjt.setLjjh(plansmj.getToMonTotalAmount(curMonth));//绱璁″垝
+ }
+ xszbZbjt.setDywc(kp.safeAddAll(kp.getSmjby(),kp.getSgbby(),kp.getJxcby(),kp.getTfby(),kp.getYmjby()));//褰撴湀瀹屾垚
+ if (ObjUtil.isNotNull(xszbZbjt.getDyjh())&&xszbZbjt.getDyjh().compareTo(new BigDecimal("0")) > 0) {//褰撴湀璁″垝瀹屾垚鐜�
+ xszbZbjt.setYjhwc(xszbZbjt.getDywc().divide(xszbZbjt.getDyjh(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ YearMonth qndy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusYears(1);
+ ZbStatisticXszb xszbSmjQNDY = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"瑁呭闆嗗洟").eq(ZbStatisticXszb::getStatYm,qndy).last("limit 1"));
+ if (ObjUtil.isNotNull(xszbSmjQNDY)&&xszbSmjQNDY.getDywc().compareTo(new BigDecimal("0"))>0){
+ xszbZbjt.setYtqb(xszbZbjt.getDywc().subtract(xszbSmjQNDY.getDywc()).divide(xszbSmjQNDY.getDywc(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ YearMonth sy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusMonths(1);
+ ZbStatisticXszb xszbZbjtSy = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"瑁呭闆嗗洟").eq(ZbStatisticXszb::getStatYm,sy).last("limit 1"));
+ if (ObjUtil.isNotNull(xszbZbjtSy)) {
+ xszbZbjt.setLjwc(xszbZbjtSy.getLjwc().add(xszbZbjt.getDywc()));
+ if (ObjUtil.isNotNull(xszbZbjt.getLjjh()) && xszbZbjt.getLjjh().compareTo(new BigDecimal("0")) > 0) {//绱璁″垝瀹屾垚鐜�
+ xszbZbjt.setNjhwc(xszbZbjt.getLjwc().divide(xszbZbjt.getLjjh(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ if (ObjUtil.isNotNull(xszbSmjQNDY) && xszbSmjQNDY.getLjwc().compareTo(new BigDecimal("0")) > 0) {
+ xszbZbjt.setNtqb(xszbZbjt.getLjwc().subtract(xszbSmjQNDY.getLjwc()).divide(xszbSmjQNDY.getLjwc(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ baseMapper.updateById(xszbZbjt);
+ }else {
+ if (ObjUtil.isNotNull(planListZB)) {
+ AnnualPlanTotalVo plansmj = BeanUtil.copyProperties(planListZB, AnnualPlanTotalVo.class);
+ BigDecimal curMonAmount = plansmj.getMonthAmount(curMonth);
+ xszbZBJT.setDyjh(curMonAmount);//褰撴湀璁″垝
+ xszbZBJT.setNdjh(plansmj.getTotalAmount());//骞村害璁″垝
+ xszbZBJT.setLjjh(plansmj.getToMonTotalAmount(curMonth));//绱璁″垝
+ }
+ xszbZBJT.setDywc(kp.safeAddAll(kp.getSmjby(),kp.getSgbby(),kp.getJxcby(),kp.getTfby(),kp.getYmjby()));//褰撴湀瀹屾垚
+ if (xszbZBJT.getDyjh().compareTo(new BigDecimal("0")) > 0) {//褰撴湀璁″垝瀹屾垚鐜�
+ xszbZBJT.setYjhwc(xszbZBJT.getDywc().divide(xszbZBJT.getDyjh(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ YearMonth qndy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusYears(1);
+ ZbStatisticXszb xszbSmjQNDY = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"瑁呭闆嗗洟").eq(ZbStatisticXszb::getStatYm,qndy).last("limit 1"));
+ if (ObjUtil.isNotNull(xszbSmjQNDY)&&xszbSmjQNDY.getDywc().compareTo(new BigDecimal("0"))>0){
+ xszbZBJT.setYtqb(xszbZBJT.getDywc().subtract(xszbSmjQNDY.getDywc()).divide(xszbSmjQNDY.getDywc(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ YearMonth sy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusMonths(1);
+ ZbStatisticXszb xszbZbjtSy = baseMapper.selectOne(Wrappers.<ZbStatisticXszb>lambdaQuery().eq(ZbStatisticXszb::getXm,xm)
+ .eq(ZbStatisticXszb::getDw,"瑁呭闆嗗洟").eq(ZbStatisticXszb::getStatYm,sy).last("limit 1"));
+ if (ObjUtil.isNotNull(xszbZbjtSy)) {
+ xszbZBJT.setLjwc(xszbZbjtSy.getLjwc().add(xszbZBJT.getDywc()));
+ if (xszbZBJT.getLjjh().compareTo(new BigDecimal("0")) > 0) {//绱璁″垝瀹屾垚鐜�
+ xszbZBJT.setNjhwc(xszbZBJT.getLjwc().divide(xszbZBJT.getLjjh(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ if (ObjUtil.isNotNull(xszbSmjQNDY) && xszbSmjQNDY.getLjwc().compareTo(new BigDecimal("0")) > 0) {
+ xszbZBJT.setNtqb(xszbZBJT.getLjwc().subtract(xszbSmjQNDY.getLjwc()).divide(xszbSmjQNDY.getLjwc(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ baseMapper.insert(xszbZBJT);
+ }
+// ZyxszbwcqkVo vosmj = new ZyxszbwcqkVo();
+// vosmj.setXm(xm);
+// vosmj.setDw("鐭崇叅鏈�");
+// ZyxszbwcqkVo vosgb = new ZyxszbwcqkVo();
+// vosgb.setXm(xm);
+// vosgb.setDw("鐭冲伐娉�");
+// ZyxszbwcqkVo vojxc = new ZyxszbwcqkVo();
+// vojxc.setXm(xm);
+// vojxc.setDw("閭㈠彴鍘�");
+// ZyxszbwcqkVo votf = new ZyxszbwcqkVo();
+// votf.setXm(xm);
+// votf.setDw("閫氭柟鍘�");
+// ZyxszbwcqkVo voymj = new ZyxszbwcqkVo();
+// voymj.setXm(xm);
+// voymj.setDw("涓�鐓ゆ満");
+// ZyxszbwcqkVo vozb = new ZyxszbwcqkVo();
+// vozb.setXm(xm);
+// vozb.setDw("瑁呭闆嗗洟");
+//
+// //瑁呭
+// vosmj.setDrwc(kp.safeAddAll(kp.getSmjbr(),kp.getSgbbr(),kp.getJxcbr(),kp.getTfbr(),null));
+// AnnualPlanTotalVo planListZB = annualPlanMapper.selectPlanYear(curYear, planType);
+// if (ObjUtil.isNotNull(planListZB)) {
+// AnnualPlanTotalVo planzb = BeanUtil.copyProperties(planListZB, AnnualPlanTotalVo.class);
+// BigDecimal curMonAmount = planzb.getMonthAmount(curMonth);
+// vozb.setDyjh(curMonAmount);
+// vozb.setDywc(kp.safeAddAll(kp.getSmjby(),kp.getSgbby(),kp.getJxcby(),kp.getTfby(),null));
+// if (vozb.getDyjh().compareTo(new BigDecimal("0")) > 0) {
+// vozb.setYjhwc(vozb.getDywc().divide(curMonAmount, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+//
+// BigDecimal qnby = kp.safeAddAll(kp.getSmjqnby(),kp.getSgbqnby(),kp.getJxcqnby(),kp.getTfqnby(),null);
+// BigDecimal qnbytb = vozb.getDywc().subtract(qnby);
+// if (qnby.compareTo(new BigDecimal("0"))>0){
+// BigDecimal qnbytqb = qnbytb.divide(qnby,10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// vozb.setYtqb(qnbytqb.setScale(2,RoundingMode.HALF_UP)+"%");
+// }
+//
+// vozb.setNdjh(planzb.getTotalAmount());
+// BigDecimal yearAmount = planzb.getTotalAmount();
+// vozb.setLjjh(planzb.getToMonTotalAmount(curMonth));
+// vozb.setLjwc(kp.safeAddAll(kp.getSmjbn(),kp.getSgbbn(),kp.getJxcbn(),kp.getTfbn(),null));
+// if (vozb.getLjjh().compareTo(new BigDecimal("0")) > 0) {
+// vozb.setNjhwc(vozb.getLjwc().divide(yearAmount, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// BigDecimal qnbn = kp.safeAddAll(kp.getSmjqnbn(),kp.getSgbqnbn(),kp.getJxcqnbn(),kp.getTfqnbn(),null);
+// BigDecimal qnbntb = vozb.getLjwc().subtract(qnby);
+// if (qnbn.compareTo(new BigDecimal("0"))>0){
+// BigDecimal qnbntqb = qnbntb.divide(qnbn,10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// vozb.setYtqb(qnbntqb.setScale(2,RoundingMode.HALF_UP)+"%");
+// }
+// }
+// //鐭崇叅鏈烘敹鍏�
+// AnnualPlan planListSMJ = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+// .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, planType)
+// .in(AnnualPlan::getCompId, compIds).last("limit 1"));
+// vosmj.setDrwc(kp.getSmjbr());
+// if (ObjUtil.isNotNull(planListSMJ)) {
+//
+// AnnualPlanTotalVo plansmj = BeanUtil.copyProperties(planListSMJ, AnnualPlanTotalVo.class);
+// BigDecimal curMonAmount = plansmj.getMonthAmount(curMonth);
+// vosmj.setDyjh(curMonAmount);
+// if (ObjUtil.isNotNull(kp.getSmjby()) && kp.getSmjby().compareTo(new BigDecimal("0")) > 0) {
+// vosmj.setDywc(kp.getSmjby());
+// vosmj.setYjhwc(kp.getSmjby().divide(curMonAmount, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// if (ObjUtil.isNotNull(kp.getSmjqnby())&& kp.getSmjqnby().compareTo(new BigDecimal("0")) > 0){
+// BigDecimal tb = vosmj.getDywc().subtract(kp.getSmjqnby());
+// BigDecimal tqb = tb.divide(kp.getSmjqnby(),10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// vosmj.setYtqb(tqb.setScale(2,RoundingMode.HALF_UP)+"%");
+// }
+// vosmj.setNdjh(plansmj.getTotalAmount());
+// BigDecimal yearAmount = plansmj.getTotalAmount();
+// vosmj.setLjjh(plansmj.getToMonTotalAmount(curMonth));
+// vosmj.setLjwc(kp.getSmjbn());
+// if (ObjUtil.isNotNull(kp.getSmjbn()) && kp.getSmjbn().compareTo(new BigDecimal("0")) > 0) {
+// vosmj.setNjhwc(kp.getSmjbn().divide(yearAmount, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// if (ObjUtil.isNotNull(kp.getSmjqnbn())&& kp.getSmjqnbn().compareTo(new BigDecimal("0")) > 0){
+// BigDecimal tb = vosmj.getLjwc().subtract(kp.getSmjqnbn());
+// BigDecimal tqb = tb.divide(kp.getSmjqnbn(),10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// vosmj.setNtqb(tqb.setScale(2,RoundingMode.HALF_UP)+"%");
+// }
+// }
+// //鐭冲伐娉垫敹鍏�
+// vosgb.setDrwc(kp.getSgbbr());
+// AnnualPlan planListSRSGB = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+// .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, planType)
+// .eq(AnnualPlan::getCompId, 2056556196124250113L).last("limit 1"));
+// if (ObjUtil.isNotNull(planListSRSGB)) {
+// AnnualPlanTotalVo plansgb = BeanUtil.copyProperties(planListSRSGB, AnnualPlanTotalVo.class);
+// BigDecimal curMonAmount = plansgb.getMonthAmount(curMonth);
+// vosgb.setDyjh(curMonAmount);
+// if (ObjUtil.isNotNull(kp.getSgbby()) && kp.getSgbby().compareTo(new BigDecimal("0")) > 0) {
+// vosgb.setDywc(kp.getSgbby());
+// vosgb.setYjhwc(kp.getSgbby().divide(curMonAmount, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// if (ObjUtil.isNotNull(kp.getSmjqnby())&& kp.getSmjqnby().compareTo(new BigDecimal("0")) > 0){
+// BigDecimal tb = vosgb.getDywc().subtract(kp.getSmjqnby());
+// BigDecimal tqb = tb.divide(kp.getSmjqnby(),10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// vosgb.setYtqb(tqb.setScale(2,RoundingMode.HALF_UP)+"%");
+// }
+// vosgb.setNdjh(plansgb.getTotalAmount());
+// BigDecimal yearAmount = plansgb.getTotalAmount();
+// vosgb.setLjjh(plansgb.getToMonTotalAmount(curMonth));
+// vosgb.setLjwc(kp.getSgbbn());
+// if (ObjUtil.isNotNull(kp.getSgbbn()) && kp.getSgbbn().compareTo(new BigDecimal("0")) > 0) {
+// vosgb.setNjhwc(kp.getSgbbn().divide(yearAmount, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// if (ObjUtil.isNotNull(kp.getSmjqnbn())&& kp.getSmjqnbn().compareTo(new BigDecimal("0")) > 0){
+// BigDecimal tb = vosgb.getLjwc().subtract(kp.getSmjqnbn());
+// BigDecimal tqb = tb.divide(kp.getSmjqnbn(),10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// vosgb.setNtqb(tqb.setScale(2,RoundingMode.HALF_UP)+"%");
+// }
+// }
+// //閫氭柟鍏徃鏀跺叆
+// votf.setDrwc(kp.getTfbr());
+// AnnualPlan planListSRTFGS = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+// .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, planType)
+// .eq(AnnualPlan::getCompId, 2056556421857497090L).last("limit 1"));
+// if (ObjUtil.isNotNull(planListSRTFGS)) {
+// AnnualPlanTotalVo plantf = BeanUtil.copyProperties(planListSRTFGS, AnnualPlanTotalVo.class);
+// BigDecimal curMonAmount = plantf.getMonthAmount(curMonth);
+// votf.setDyjh(curMonAmount);
+// if (ObjUtil.isNotNull(kp.getTfby()) && kp.getTfby().compareTo(new BigDecimal("0")) > 0) {
+// votf.setDywc(kp.getTfby());
+// votf.setYjhwc(kp.getTfby().divide(curMonAmount, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// if (ObjUtil.isNotNull(kp.getSmjqnby())&& kp.getSmjqnby().compareTo(new BigDecimal("0")) > 0){
+// BigDecimal tb = votf.getDywc().subtract(kp.getSmjqnby());
+// BigDecimal tqb = tb.divide(kp.getSmjqnby(),10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// votf.setYtqb(tqb.setScale(2,RoundingMode.HALF_UP)+"%");
+// }
+// votf.setNdjh(plantf.getTotalAmount());
+// BigDecimal yearAmount = plantf.getTotalAmount();
+// votf.setLjjh(plantf.getToMonTotalAmount(curMonth));
+// votf.setLjwc(kp.getTfbn());
+// if (ObjUtil.isNotNull(kp.getTfbn()) && kp.getTfbn().compareTo(new BigDecimal("0")) > 0) {
+// votf.setNjhwc(kp.getTfbn().divide(yearAmount, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// if (ObjUtil.isNotNull(kp.getSmjqnbn())&& kp.getSmjqnbn().compareTo(new BigDecimal("0")) > 0){
+// BigDecimal tb = votf.getLjwc().subtract(kp.getSmjqnbn());
+// BigDecimal tqb = tb.divide(kp.getSmjqnbn(),10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// votf.setNtqb(tqb.setScale(2,RoundingMode.HALF_UP)+"%");
+// }
+// }
+// //鏈烘鍘傛敹鍏�
+// vojxc.setDrwc(kp.getJxcbr());
+// AnnualPlan planListSRJXC = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+// .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, planType)
+// .eq(AnnualPlan::getCompId, 2056556317461270529L).last("limit 1"));
+// if (ObjUtil.isNotNull(planListSRJXC)) {
+// AnnualPlanTotalVo planjxc = BeanUtil.copyProperties(planListSRJXC, AnnualPlanTotalVo.class);
+// BigDecimal curMonAmount = planjxc.getMonthAmount(curMonth);
+// vojxc.setDyjh(curMonAmount);
+// if (ObjUtil.isNotNull(kp.getJxcby()) && kp.getJxcby().compareTo(new BigDecimal("0")) > 0) {
+// vojxc.setDywc(kp.getJxcby());
+// vojxc.setYjhwc(kp.getJxcby().divide(curMonAmount, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// if (ObjUtil.isNotNull(kp.getSmjqnby())&& kp.getSmjqnby().compareTo(new BigDecimal("0")) > 0){
+// BigDecimal tb = vojxc.getDywc().subtract(kp.getSmjqnby());
+// BigDecimal tqb = tb.divide(kp.getSmjqnby(),10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// vojxc.setYtqb(tqb.setScale(2,RoundingMode.HALF_UP)+"%");
+// }
+// vojxc.setNdjh(planjxc.getTotalAmount());
+// BigDecimal yearAmount = planjxc.getTotalAmount();
+// vojxc.setLjjh(planjxc.getToMonTotalAmount(curMonth));
+// vojxc.setLjwc(kp.getJxcbn());
+// if (ObjUtil.isNotNull(kp.getJxcbn()) && kp.getJxcbn().compareTo(new BigDecimal("0")) > 0) {
+// vojxc.setNjhwc(kp.getJxcbn().divide(yearAmount, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// if (ObjUtil.isNotNull(kp.getSmjqnbn())&& kp.getSmjqnbn().compareTo(new BigDecimal("0")) > 0){
+// BigDecimal tb = vojxc.getLjwc().subtract(kp.getSmjqnbn());
+// BigDecimal tqb = tb.divide(kp.getSmjqnbn(),10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// vojxc.setNtqb(tqb.setScale(2,RoundingMode.HALF_UP)+"%");
+// }
+// }
+// //涓�鐓ゆ満鏀跺叆
+// voymj.setDrwc(kp.getYmjbr());
+// AnnualPlan planListHYMJ = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+// .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, planType)
+// .eq(AnnualPlan::getCompId, 2056556535640576002L).last("limit 1"));
+// if (ObjUtil.isNotNull(planListHYMJ)) {
+// AnnualPlanTotalVo planymj = BeanUtil.copyProperties(planListHYMJ, AnnualPlanTotalVo.class);
+// BigDecimal curMonAmount = planymj.getMonthAmount(curMonth);
+// voymj.setDyjh(curMonAmount);
+// if (ObjUtil.isNotNull(kp.getYmjby()) && kp.getYmjby().compareTo(new BigDecimal("0")) > 0) {
+// voymj.setDywc(kp.getYmjby());
+// voymj.setYjhwc(kp.getYmjby().divide(curMonAmount, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// if (ObjUtil.isNotNull(kp.getSmjqnby())&& kp.getSmjqnby().compareTo(new BigDecimal("0")) > 0){
+// BigDecimal tb = voymj.getDywc().subtract(kp.getSmjqnby());
+// BigDecimal tqb = tb.divide(kp.getSmjqnby(),10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// voymj.setYtqb(tqb.setScale(2,RoundingMode.HALF_UP)+"%");
+// }
+// voymj.setNdjh(planymj.getTotalAmount());
+// BigDecimal yearAmount = planymj.getTotalAmount();
+// voymj.setLjjh(planymj.getToMonTotalAmount(curMonth));
+// voymj.setLjwc(kp.getYmjbn());
+// if (ObjUtil.isNotNull(kp.getYmjbn()) && kp.getYmjbn().compareTo(new BigDecimal("0")) > 0) {
+// voymj.setNjhwc(kp.getYmjbn().divide(yearAmount, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// if (ObjUtil.isNotNull(kp.getSmjqnbn())&& kp.getSmjqnbn().compareTo(new BigDecimal("0")) > 0){
+// BigDecimal tb = voymj.getLjwc().subtract(kp.getSmjqnbn());
+// BigDecimal tqb = tb.divide(kp.getSmjqnbn(),10,RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// voymj.setNtqb(tqb.setScale(2,RoundingMode.HALF_UP)+"%");
+// }
+// }
+// list.add(vosmj);
+// list.add(vosgb);
+// list.add(vojxc);
+// list.add(votf);
+// list.add(voymj);
+// list.add(vozb);
+// return list;
+ }
+
+}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ZbStatisticZdgzServiceImpl.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ZbStatisticZdgzServiceImpl.java
new file mode 100644
index 0000000..4fae476
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ZbStatisticZdgzServiceImpl.java
@@ -0,0 +1,178 @@
+package com.by4cloud.platformx.business.service.impl;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.date.DatePattern;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.ObjUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.by4cloud.platformx.business.dto.ZBJTStatisticDTO;
+import com.by4cloud.platformx.business.entity.AnnualPlanKey;
+import com.by4cloud.platformx.business.entity.ZbStatisticZdgz;
+import com.by4cloud.platformx.business.mapper.AnnualPlanKeyMapper;
+import com.by4cloud.platformx.business.mapper.ContractSubjectMatterMapper;
+import com.by4cloud.platformx.business.mapper.ZbStatisticZdgzMapper;
+import com.by4cloud.platformx.business.service.ZbStatisticZdgzService;
+import com.by4cloud.platformx.business.vo.GcpbkwcqkItemVo;
+import com.by4cloud.platformx.business.vo.SckfzdgzwcqkVo;
+import com.by4cloud.platformx.common.core.util.R;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.time.YearMonth;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 閲嶇偣宸ヤ綔
+ *
+ * @author syt
+ * @date 2026-11-12 10:28:35
+ */
+@Service
+@RequiredArgsConstructor
+public class ZbStatisticZdgzServiceImpl extends ServiceImpl<ZbStatisticZdgzMapper, ZbStatisticZdgz> implements ZbStatisticZdgzService {
+
+ private final ContractSubjectMatterMapper contractSubjectMatterMapper;
+ private final AnnualPlanKeyMapper annualPlanKeyMapper;
+
+
+ @Override
+ public R genZdgzwcqk(ZBJTStatisticDTO queryDTO) {
+ if (StrUtil.isBlank(queryDTO.getYearMonth())) {
+ queryDTO.setYearMonth(DateUtil.format(new Date(), DatePattern.NORM_MONTH_PATTERN));
+ }
+ List<SckfzdgzwcqkVo> list = new ArrayList<>();
+ Date monstart = DateUtil.parseDateTime(queryDTO.getYearMonth() + "-01 00:00:00");
+ Date monend = DateUtil.parseDateTime(queryDTO.getYearMonth() + "-31 23:59:59");
+ Date monstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth() + "-01 00:00:00"), -1);
+ Date monendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth() + "-31 23:59:59"), -1);
+ Date yearstart = DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0, 4) + "-01-01 00:00:00");
+ Date yearend = DateUtil.parseDateTime(queryDTO.getYearMonth() + "-31 23:59:59");
+ Date yearstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0, 4) + "-01-01 00:00:00"), -1);
+ Date yearendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth() + "-31 23:59:59"), -1);
+ String curYear = queryDTO.getYearMonth().substring(0, 4);
+ String curMonth = queryDTO.getYearMonth().substring(5);
+ YearMonth qndy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusYears(1);
+ YearMonth sy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusMonths(1);
+ //鏂板鍚堝悓
+ List<GcpbkwcqkItemVo> itemVoListMon = contractSubjectMatterMapper.sckfzdgzwcqk(monstart, monend);
+ if (CollUtil.isNotEmpty(itemVoListMon)) {
+ itemVoListMon.stream().forEach(item -> {
+ ZbStatisticZdgz vo = new ZbStatisticZdgz();
+ vo.setDw(item.getDw());
+ vo.setXm(item.getXm());
+ vo.setStatYm(queryDTO.getYearMonth());
+ Long compId = null;
+ if (StrUtil.equals(item.getDw(), "鐭崇叅鏈�")) {
+ compId = 2089995177814495234L;
+ vo.setCompId(2089995177814495234L);
+ }
+ if (StrUtil.equals(item.getDw(), "鐭冲伐娉�")) {
+ compId = 2056556196124250113L;
+ vo.setCompId(2056556196124250113L);
+ }
+ if (StrUtil.equals(item.getDw(), "閫氭柟鍘�")) {
+ compId = 2056556317461270529L;
+ vo.setCompId(2056556317461270529L);
+ }
+ if (StrUtil.equals(item.getDw(), "閭㈠彴鍘�")) {
+ compId = 2056556421857497090L;
+ vo.setCompId(2056556421857497090L);
+ }
+ AnnualPlanKey plan = annualPlanKeyMapper.selectOne(Wrappers.<AnnualPlanKey>lambdaQuery()
+ .eq(AnnualPlanKey::getPlanYear, queryDTO.getYearMonth().substring(0, 4)).eq(AnnualPlanKey::getPlanType, item.getCode())
+ .eq(AnnualPlanKey::getCompId, compId).last("limit 1"));
+ ZbStatisticZdgz vo1 = baseMapper.selectOne(Wrappers.<ZbStatisticZdgz>lambdaQuery().eq(ZbStatisticZdgz::getDw, vo.getDw())
+ .eq(ZbStatisticZdgz::getXm, vo.getXm()).eq(ZbStatisticZdgz::getStatYm, vo.getStatYm()).last("limit 1"));
+ if (ObjUtil.isNotNull(vo1)) {
+ if (ObjUtil.isNotNull(plan)) {
+ vo1.setDywc(item.getWc());
+ vo1.setDyjh(plan.getMonthAmount(queryDTO.getYearMonth().substring(5)));
+ vo1.setLjjh(plan.getToMonTotalAmount(queryDTO.getYearMonth().substring(5)));
+ vo1.setNdjh(plan.getTotalAmount());
+ if (vo1.getDyjh().compareTo(new BigDecimal("0")) > 0) {
+ vo1.setYwcl(vo1.getDywc().divide(vo1.getDyjh(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ ZbStatisticZdgz voQndy = baseMapper.selectOne(Wrappers.<ZbStatisticZdgz>lambdaQuery().eq(ZbStatisticZdgz::getDw, vo.getDw())
+ .eq(ZbStatisticZdgz::getXm, vo.getXm()).eq(ZbStatisticZdgz::getStatYm, qndy).last("limit 1"));
+ ZbStatisticZdgz voSy = baseMapper.selectOne(Wrappers.<ZbStatisticZdgz>lambdaQuery().eq(ZbStatisticZdgz::getDw, vo.getDw())
+ .eq(ZbStatisticZdgz::getXm, vo.getXm()).eq(ZbStatisticZdgz::getStatYm, sy).last("limit 1"));
+ if (ObjUtil.isNotNull(voSy)) {
+ vo1.setLjwc(voSy.getLjwc().add(vo1.getDywc()));
+ if (ObjUtil.isNotNull(vo1.getLjjh()) && vo1.getLjjh().compareTo(new BigDecimal("0")) > 0) {
+ vo1.setLjwcl(vo1.getLjwc().divide(vo1.getLjjh(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ if (ObjUtil.isNotNull(voQndy) && voQndy.getLjwc().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo1.getLjwc().subtract(voQndy.getLjwc()).divide(voQndy.getLjwc(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+ vo1.setLjtb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ baseMapper.updateById(vo1);
+ } else {
+ if (ObjUtil.isNotNull(plan)) {
+ vo.setDywc(item.getWc());
+ vo.setDyjh(plan.getMonthAmount(queryDTO.getYearMonth().substring(5)));
+ vo.setLjjh(plan.getToMonTotalAmount(queryDTO.getYearMonth().substring(5)));
+ vo.setNdjh(plan.getTotalAmount());
+ if (vo.getDyjh().compareTo(new BigDecimal("0")) > 0) {
+ vo.setYwcl(vo.getDywc().divide(vo.getDyjh(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ ZbStatisticZdgz voQndy = baseMapper.selectOne(Wrappers.<ZbStatisticZdgz>lambdaQuery().eq(ZbStatisticZdgz::getDw, vo.getDw())
+ .eq(ZbStatisticZdgz::getXm, vo.getXm()).eq(ZbStatisticZdgz::getStatYm, qndy).last("limit 1"));
+ ZbStatisticZdgz voSy = baseMapper.selectOne(Wrappers.<ZbStatisticZdgz>lambdaQuery().eq(ZbStatisticZdgz::getDw, vo.getDw())
+ .eq(ZbStatisticZdgz::getXm, vo.getXm()).eq(ZbStatisticZdgz::getStatYm, sy).last("limit 1"));
+ if (ObjUtil.isNotNull(voSy)) {
+ vo.setLjwc(voSy.getLjwc().add(vo.getDywc()== null ? BigDecimal.ZERO :vo.getDywc()));
+ if (ObjUtil.isNotNull(vo.getLjjh()) && vo.getLjjh().compareTo(new BigDecimal("0")) > 0) {
+ vo.setLjwcl(vo.getLjwc().divide(vo.getLjjh(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+ .setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ if (ObjUtil.isNotNull(voQndy) && voQndy.getLjwc().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo.getLjwc().subtract(voQndy.getLjwc()).divide(voQndy.getLjwc(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+ vo.setLjtb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ baseMapper.insert(vo);
+ }
+
+ });
+ }
+// List<GcpbkwcqkItemVo> itemVoListYear = contractSubjectMatterMapper.sckfzdgzwcqk(yearstart, yearend);
+// List<GcpbkwcqkItemVo> itemVoListYearLastYear = contractSubjectMatterMapper.sckfzdgzwcqk(yearstartLastYear, yearendLastYear);
+// if (CollUtil.isNotEmpty(list) && CollUtil.isNotEmpty(itemVoListYear)) {
+// for (GcpbkwcqkItemVo itemVo : itemVoListYear
+// ) {
+// ZbStatisticZdgz vo = baseMapper.selectOne(Wrappers.<ZbStatisticZdgz>lambdaQuery().eq(ZbStatisticZdgz::getDw, itemVo.getDw())
+// .eq(ZbStatisticZdgz::getXm, itemVo.getXm()).eq(ZbStatisticZdgz::getStatYm, queryDTO.getYearMonth()).last("limit 1"));
+// if (StrUtil.equals(vo.getDw(), itemVo.getDw()) && StrUtil.equals(vo.getXm(), itemVo.getXm())) {
+// vo.setLjwc(itemVo.getWc());
+// if (ObjUtil.isNotNull(vo.getLjjh()) && vo.getLjjh().compareTo(new BigDecimal("0")) > 0) {
+// vo.setLjwcl(vo.getLjwc().divide(vo.getLjjh(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// if (CollUtil.isNotEmpty(itemVoListYearLastYear)) {
+// itemVoListYearLastYear.stream().forEach(item1 -> {
+// if (StrUtil.equals(vo.getDw(), item1.getDw()) && StrUtil.equals(vo.getXm(), itemVo.getXm()) &&
+// item1.getWc().compareTo(new BigDecimal("0")) > 0) {
+// BigDecimal percent = vo.getLjwc().subtract(item1.getWc()).divide(item1.getWc(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+// vo.setLjtb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// });
+// }
+// baseMapper.updateById(vo);
+// }
+// }
+ return R.ok();
+ }
+}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ZbStatisticZxywServiceImpl.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ZbStatisticZxywServiceImpl.java
new file mode 100644
index 0000000..9b3fe65
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ZbStatisticZxywServiceImpl.java
@@ -0,0 +1,1177 @@
+package com.by4cloud.platformx.business.service.impl;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.date.DatePattern;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.ObjUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.by4cloud.platformx.business.dto.ZBJTStatisticDTO;
+import com.by4cloud.platformx.business.entity.ZbStatisticZdgz;
+import com.by4cloud.platformx.business.entity.ZbStatisticZxyw;
+import com.by4cloud.platformx.business.mapper.ContractInvoiceMapper;
+import com.by4cloud.platformx.business.mapper.ContractMapper;
+import com.by4cloud.platformx.business.mapper.ZbStatisticZxywMapper;
+import com.by4cloud.platformx.business.service.ZbStatisticZxywService;
+import com.by4cloud.platformx.business.vo.GcpbkwcqkItemVo;
+import com.by4cloud.platformx.business.vo.PjdxcksxywwcqkVo;
+import com.by4cloud.platformx.common.core.util.R;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.time.YearMonth;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+/**
+ * 涓撻」涓氬姟
+ *
+ * @author syt
+ * @date 2026-11-12 10:29:31
+ */
+@Service
+@RequiredArgsConstructor
+public class ZbStatisticZxywServiceImpl extends ServiceImpl<ZbStatisticZxywMapper, ZbStatisticZxyw> implements ZbStatisticZxywService {
+
+ private final ContractInvoiceMapper contractInvoiceMapper;
+ private final ContractMapper contractMapper;
+
+
+ @Override
+ public R genZxywwcqk(ZBJTStatisticDTO queryDTO) {
+ if (StrUtil.isBlank(queryDTO.getYearMonth())) {
+ queryDTO.setYearMonth(DateUtil.format(new Date(), DatePattern.NORM_MONTH_PATTERN));
+ }
+ List<PjdxcksxywwcqkVo> list = new ArrayList<>();
+ Date monstart = DateUtil.parseDateTime(queryDTO.getYearMonth() + "-01 00:00:00");
+ Date monend = DateUtil.parseDateTime(queryDTO.getYearMonth() + "-31 23:59:59");
+ Date monstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth() + "-01 00:00:00"), -1);
+ Date monendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth() + "-31 23:59:59"), -1);
+ Date yearstart = DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0, 4) + "-01-01 00:00:00");
+ Date yearend = DateUtil.parseDateTime(queryDTO.getYearMonth() + "-31 23:59:59");
+ Date yearstartLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth().substring(0, 4) + "-01-01 00:00:00"), -1);
+ Date yearendLastYear = DateUtil.offsetYear(DateUtil.parseDateTime(queryDTO.getYearMonth() + "-31 23:59:59"), -1);
+ String curYear = queryDTO.getYearMonth().substring(0, 4);
+ String curMonth = queryDTO.getYearMonth().substring(5);
+ YearMonth qndy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusYears(1);
+ YearMonth sy = YearMonth.of(Integer.valueOf(curYear), Integer.valueOf(curMonth)).minusMonths(1);
+ if (true) {
+ //閰嶄欢寮�绁�
+ List<GcpbkwcqkItemVo> itemVoListMon = contractInvoiceMapper.pjsxywwcqk("1", monstart, monend);
+ List<GcpbkwcqkItemVo> itemVoListMonrLastYear = contractInvoiceMapper.pjsxywwcqk("1", monstartLastYear, monstartLastYear);
+ if (CollUtil.isNotEmpty(itemVoListMon)) {
+ itemVoListMon.stream().forEach(item -> {
+ ZbStatisticZxyw vo = new ZbStatisticZxyw();
+ vo.setYw(item.getYw());
+ vo.setLb(item.getLb());
+ vo.setDw(item.getDw());
+ vo.setDywc(item.getWc());
+ if (StrUtil.equals(item.getDw(), "鐭崇叅鏈�")) {
+ vo.setCompId(2089995177814495234L);
+ }
+ if (StrUtil.equals(item.getDw(), "鐭冲伐娉�")) {
+ vo.setCompId(2056556196124250113L);
+ }
+ if (StrUtil.equals(item.getDw(), "閫氭柟鍘�")) {
+ vo.setCompId(2056556317461270529L);
+ }
+ if (StrUtil.equals(item.getDw(), "閭㈠彴鍘�")) {
+ vo.setCompId(2056556421857497090L);
+ }
+ vo.setStatYm(queryDTO.getYearMonth());
+ ZbStatisticZxyw vo1 = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, vo.getStatYm()).last("limit 1"));
+ ZbStatisticZxyw voQndy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, qndy).last("limit 1"));
+ ZbStatisticZxyw voSy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, sy).last("limit 1"));
+ if (ObjUtil.isNotNull(voQndy)) {
+ vo.setQnty(voQndy.getDywc());//鍘诲勾鍚屾湀
+ vo.setQntq(voQndy.getLjwc());//鍘诲勾鍚屾湡
+ vo.setYtb(vo.getDywc().subtract(vo.getQnty()));//褰撴湀鍚屾瘮
+ if (vo.getQnty().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo.getYtb().divide(vo.getQnty(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
+ vo.setYtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");//褰撴湀鍚屾湡姣�
+ }
+ }
+ if (ObjUtil.isNotNull(voSy)) {
+ vo.setLjwc(voSy.getLjwc().add(ObjUtil.isNull(vo.getDywc()) ? BigDecimal.ZERO : vo.getDywc()));//绱瀹屾垚
+ vo.setLjtb(vo.getLjwc().subtract(ObjUtil.isNull(vo.getQntq()) ? BigDecimal.ZERO : vo.getQntq()));//绱鍚屾瘮
+ if (ObjUtil.isNotNull(vo.getQntq()) && ObjUtil.isNotNull(vo.getQntq()) && vo.getQntq().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo.getLjtb().divide(vo.getQntq(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
+ vo.setLjtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");//绱鍚屾湡姣�
+ }
+ }
+ if (ObjUtil.isNotNull(vo1)) {
+ vo.setId(vo1.getId());
+ baseMapper.updateById(vo);
+ } else {
+ baseMapper.insert(vo);
+ }
+
+ });
+ ZbStatisticZxyw vo = new ZbStatisticZxyw();
+ vo.setYw(itemVoListMon.get(0).getYw());
+ vo.setLb(itemVoListMon.get(0).getLb());
+ vo.setDw("闆嗗洟");
+ vo.setStatYm(queryDTO.getYearMonth());
+ ZbStatisticZxyw vo1 = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, vo.getStatYm()).last("limit 1"));
+ vo.setDywc(itemVoListMon.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ ZbStatisticZxyw voQndy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, qndy).last("limit 1"));
+ ZbStatisticZxyw voSy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, sy).last("limit 1"));
+ if (ObjUtil.isNotNull(voQndy)) {
+ vo.setQnty(voQndy.getDywc());
+ vo.setQntq(voQndy.getLjwc());
+ vo.setYtb(vo.getDywc().subtract(vo.getQnty()));
+ if (vo.getQnty().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo.getYtb().divide(vo.getQnty(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
+ vo.setYtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ if (ObjUtil.isNotNull(voSy)) {
+ vo.setLjwc(voSy.getLjwc().add(ObjUtil.isNull(vo.getDywc()) ? BigDecimal.ZERO : vo.getDywc()));
+ vo.setLjtb(vo.getLjwc().subtract(ObjUtil.isNull(vo.getQntq()) ? BigDecimal.ZERO : vo.getQntq()));
+ if (ObjUtil.isNotNull(vo.getQntq()) && vo.getQntq().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo.getLjtb().divide(vo.getQntq(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
+ vo.setLjtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ if (ObjUtil.isNotNull(vo1)) {
+ vo.setId(vo1.getId());
+ baseMapper.updateById(vo);
+ } else {
+ baseMapper.insert(vo);
+ }
+ }
+// List<GcpbkwcqkItemVo> itemVoListYear = contractInvoiceMapper.pjsxywwcqk("1", yearstart, yearend);
+// List<GcpbkwcqkItemVo> itemVoListYearLastYear = contractInvoiceMapper.pjsxywwcqk("1", yearstartLastYear, yearendLastYear);
+// if (CollUtil.isNotEmpty(list) && CollUtil.isNotEmpty(itemVoListYear)) {
+// for (GcpbkwcqkItemVo itemVo : itemVoListYear
+// ) {
+// ZbStatisticZxyw vo = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, itemVo.getYw())
+// .eq(ZbStatisticZxyw::getLb, itemVo.getLb()).eq(ZbStatisticZxyw::getDw, itemVo.getDw())
+// .eq(ZbStatisticZxyw::getStatYm, queryDTO.getYearMonth()).last("limit 1"));
+// if (StrUtil.equals(vo.getYw(), itemVo.getYw()) && StrUtil.equals(vo.getLb(), itemVo.getLb()) &&
+// StrUtil.equals(vo.getDw(), itemVo.getDw())) {
+// vo.setLjwc(itemVo.getWc());
+// }
+// if (CollUtil.isNotEmpty(itemVoListYearLastYear)) {
+// itemVoListYearLastYear.stream().forEach(item1 -> {
+// if (StrUtil.equals(vo.getYw(), itemVo.getYw()) && StrUtil.equals(vo.getLb(), itemVo.getLb()) &&
+// StrUtil.equals(vo.getDw(), itemVo.getDw()) && item1.getWc().compareTo(new BigDecimal("0")) > 0) {
+// vo.setQntq(item1.getWc());
+// vo.setLjtb(vo.getLjwc().subtract(vo.getQntq()));
+// if (ObjUtil.isNotNull(vo.getQntq())&&vo.getQntq().compareTo(new BigDecimal("0")) > 0) {
+// vo.setLjtqb(vo.getLjtb().divide(vo.getQntq(), 2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// });
+// }
+// baseMapper.updateById(vo);
+// }
+// ZbStatisticZxyw vo = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, "閰嶄欢")
+// .eq(ZbStatisticZxyw::getLb, "閿�鍞敹鍏�").eq(ZbStatisticZxyw::getDw, "闆嗗洟")
+// .eq(ZbStatisticZxyw::getStatYm, queryDTO.getYearMonth()).last("limit 1"));
+// vo.setLjwc(itemVoListYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// if (CollUtil.isNotEmpty(itemVoListYearLastYear)) {
+// vo.setQntq(itemVoListYearLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// vo.setLjtb(vo.getLjwc().subtract(vo.getQntq()));
+// if (ObjUtil.isNotNull(vo.getQntq())&&vo.getQntq().compareTo(new BigDecimal("0")) > 0) {
+// vo.setLjtqb(vo.getLjtb().divide(vo.getQntq(), 2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// baseMapper.updateById(vo);
+// }
+ //閰嶄欢鍚堝悓
+ List<GcpbkwcqkItemVo> itemVoListMonHT = contractMapper.pjsxywwcqkHT("1", monstart, monend);
+ List<GcpbkwcqkItemVo> itemVoListMonrHTLastYear = contractMapper.pjsxywwcqkHT("1", monstartLastYear, monstartLastYear);
+ if (CollUtil.isNotEmpty(itemVoListMonHT)) {
+ itemVoListMonHT.stream().forEach(item -> {
+ ZbStatisticZxyw vo = new ZbStatisticZxyw();
+ vo.setYw(item.getYw());
+ vo.setLb(item.getLb());
+ vo.setDw(item.getDw());
+ vo.setDywc(item.getWc());
+ vo.setStatYm(queryDTO.getYearMonth());
+ Long compId = null;
+ if (StrUtil.equals(item.getDw(), "鐭崇叅鏈�")) {
+ compId = 2089995177814495234L;
+ vo.setCompId(2089995177814495234L);
+ }
+ if (StrUtil.equals(item.getDw(), "鐭冲伐娉�")) {
+ compId = 2056556196124250113L;
+ vo.setCompId(2056556196124250113L);
+ }
+ if (StrUtil.equals(item.getDw(), "閫氭柟鍘�")) {
+ compId = 2056556317461270529L;
+ vo.setCompId(2056556317461270529L);
+ }
+ if (StrUtil.equals(item.getDw(), "閭㈠彴鍘�")) {
+ compId = 2056556421857497090L;
+ vo.setCompId(2056556421857497090L);
+ }
+ ZbStatisticZxyw vo1 = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, vo.getStatYm()).last("limit 1"));
+ ZbStatisticZxyw voQndy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, qndy).last("limit 1"));
+ ZbStatisticZxyw voSy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, sy).last("limit 1"));
+ if (ObjUtil.isNotNull(voQndy)) {
+ vo.setQnty(voQndy.getDywc());
+ vo.setQntq(voQndy.getLjwc());
+ vo.setYtb(vo.getDywc().subtract(vo.getQnty()));
+ if (vo.getQnty().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo.getYtb().divide(vo.getQnty(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
+ vo.setYtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ if (ObjUtil.isNotNull(voSy)) {
+ vo.setLjwc(voSy.getLjwc().add(ObjUtil.isNull(vo.getDywc()) ? BigDecimal.ZERO : vo.getDywc()));
+ vo.setLjtb(vo.getLjwc().subtract(ObjUtil.isNull(vo.getQntq()) ? BigDecimal.ZERO : vo.getQntq()));
+ if (ObjUtil.isNotNull(vo.getQntq()) && vo.getQntq().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo.getLjtb().divide(vo.getQntq(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
+ vo.setLjtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ if (ObjUtil.isNotNull(vo1)) {
+ vo.setId(vo1.getId());
+ baseMapper.updateById(vo);
+ } else {
+ baseMapper.insert(vo);
+ }
+ });
+ ZbStatisticZxyw vo = new ZbStatisticZxyw();
+ vo.setYw(itemVoListMonHT.get(0).getYw());
+ vo.setLb(itemVoListMonHT.get(0).getLb());
+ vo.setDw("闆嗗洟");
+ vo.setStatYm(queryDTO.getYearMonth());
+ vo.setDywc(itemVoListMonHT.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ ZbStatisticZxyw vo1 = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, vo.getStatYm()).last("limit 1"));
+ ZbStatisticZxyw voQndy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, qndy).last("limit 1"));
+ ZbStatisticZxyw voSy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, sy).last("limit 1"));
+ if (ObjUtil.isNotNull(voQndy)) {
+ vo.setQnty(voQndy.getDywc());
+ vo.setQntq(voQndy.getLjwc());
+ vo.setYtb(vo.getDywc().subtract(vo.getQnty()));
+ if (vo.getQnty().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo.getYtb().divide(vo.getQnty(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
+ vo.setYtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ if (ObjUtil.isNotNull(voSy)) {
+ vo.setLjwc(voSy.getLjwc().add(ObjUtil.isNull(vo.getDywc()) ? BigDecimal.ZERO : vo.getDywc()));
+ vo.setLjtb(vo.getLjwc().subtract(ObjUtil.isNull(vo.getQntq()) ? BigDecimal.ZERO : vo.getQntq()));
+ if (ObjUtil.isNotNull(vo.getQntq()) && vo.getQntq().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo.getLjtb().divide(vo.getQntq(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
+ vo.setLjtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ if (ObjUtil.isNotNull(vo1)) {
+ vo.setId(vo1.getId());
+ baseMapper.updateById(vo);
+ } else {
+ baseMapper.insert(vo);
+ }
+ }
+// List<GcpbkwcqkItemVo> itemVoListYearHT = contractMapper.pjsxywwcqkHT("1", yearstart, yearend);
+// List<GcpbkwcqkItemVo> itemVoListYearHTLastYear = contractMapper.pjsxywwcqkHT("1", yearstartLastYear, yearendLastYear);
+// if (CollUtil.isNotEmpty(list) && CollUtil.isNotEmpty(itemVoListYearHT)) {
+//
+// for (GcpbkwcqkItemVo itemVo : itemVoListYearHT
+// ) {
+// ZbStatisticZxyw vo = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, itemVo.getYw())
+// .eq(ZbStatisticZxyw::getLb, itemVo.getLb()).eq(ZbStatisticZxyw::getDw, itemVo.getDw())
+// .eq(ZbStatisticZxyw::getStatYm, queryDTO.getYearMonth()).last("limit 1"));
+// if (StrUtil.equals(vo.getYw(), itemVo.getYw()) && StrUtil.equals(vo.getLb(), itemVo.getLb()) &&
+// StrUtil.equals(vo.getDw(), itemVo.getDw())) {
+// vo.setLjwc(itemVo.getWc());
+// }
+// if (CollUtil.isNotEmpty(itemVoListYearHTLastYear)) {
+// itemVoListYearHTLastYear.stream().forEach(item1 -> {
+// if (StrUtil.equals(vo.getYw(), itemVo.getYw()) && StrUtil.equals(vo.getLb(), itemVo.getLb()) &&
+// StrUtil.equals(vo.getDw(), itemVo.getDw()) && item1.getWc().compareTo(new BigDecimal("0")) > 0) {
+// vo.setQntq(item1.getWc());
+// vo.setLjtb(vo.getLjwc().subtract(item1.getWc()));
+// if (ObjUtil.isNotNull(vo.getQntq())&&vo.getQntq().compareTo(new BigDecimal("0")) > 0) {
+// vo.setLjtqb(vo.getLjtb().divide(vo.getQntq(), 2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// });
+// }
+//
+// baseMapper.updateById(vo);
+// }
+// ZbStatisticZxyw vo = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, "閰嶄欢")
+// .eq(ZbStatisticZxyw::getLb, "鏂板鍚堝悓").eq(ZbStatisticZxyw::getDw, "闆嗗洟")
+// .eq(ZbStatisticZxyw::getStatYm, queryDTO.getYearMonth()).last("limit 1"));
+// vo.setLjwc(itemVoListYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// if (CollUtil.isNotEmpty(itemVoListYearHTLastYear)) {
+// vo.setQntq(itemVoListYearHTLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// vo.setLjtb(vo.getLjwc().subtract(vo.getQntq()));
+// if (ObjUtil.isNotNull(vo.getQntq())&&vo.getQntq().compareTo(new BigDecimal("0")) > 0) {
+// vo.setLjtqb(vo.getLjtb().divide(vo.getQntq(), 2, RoundingMode.HALF_UP) + "%");
+// }
+//
+// }
+// baseMapper.updateById(vo);
+// }
+ }
+ if (true) {
+ //澶т慨寮�绁�
+ List<GcpbkwcqkItemVo> itemVoListMon = contractInvoiceMapper.dxsxywwcqk("2", monstart, monend);
+ List<GcpbkwcqkItemVo> itemVoListMonrLastYear = contractInvoiceMapper.dxsxywwcqk("2", monstartLastYear, monendLastYear);
+ if (CollUtil.isNotEmpty(itemVoListMon)) {
+ itemVoListMon.stream().forEach(item -> {
+ ZbStatisticZxyw vo = new ZbStatisticZxyw();
+ vo.setYw(item.getYw());
+ vo.setLb(item.getLb());
+ vo.setDw(item.getDw());
+ vo.setDywc(item.getWc());
+ vo.setStatYm(queryDTO.getYearMonth());
+ Long compId = null;
+ if (StrUtil.equals(item.getDw(), "鐭崇叅鏈�")) {
+ compId = 2089995177814495234L;
+ vo.setCompId(2089995177814495234L);
+ }
+ if (StrUtil.equals(item.getDw(), "鐭冲伐娉�")) {
+ compId = 2056556196124250113L;
+ vo.setCompId(2056556196124250113L);
+ }
+ if (StrUtil.equals(item.getDw(), "閫氭柟鍘�")) {
+ compId = 2056556317461270529L;
+ vo.setCompId(2056556317461270529L);
+ }
+ if (StrUtil.equals(item.getDw(), "閭㈠彴鍘�")) {
+ compId = 2056556421857497090L;
+ vo.setCompId(2056556421857497090L);
+ }
+ ZbStatisticZxyw vo1 = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, vo.getStatYm()).last("limit 1"));
+ ZbStatisticZxyw voQndy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, qndy).last("limit 1"));
+ ZbStatisticZxyw voSy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, sy).last("limit 1"));
+ if (ObjUtil.isNotNull(voQndy)) {
+ vo.setQnty(voQndy.getDywc());
+ vo.setQntq(voQndy.getLjwc());
+ vo.setYtb(vo.getDywc().subtract(vo.getQnty()));
+ if (vo.getQnty().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo.getYtb().divide(vo.getQnty(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
+ vo.setYtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ if (ObjUtil.isNotNull(voSy)) {
+ vo.setLjwc(voSy.getLjwc().add(ObjUtil.isNull(vo.getDywc()) ? BigDecimal.ZERO : vo.getDywc()));
+ vo.setLjtb(vo.getLjwc().subtract(ObjUtil.isNull(vo.getQntq()) ? BigDecimal.ZERO : vo.getQntq()));
+ if (ObjUtil.isNotNull(vo.getQntq()) && vo.getQntq().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo.getLjtb().divide(vo.getQntq(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
+ vo.setLjtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ if (ObjUtil.isNotNull(vo1)) {
+ vo.setId(vo1.getId());
+ baseMapper.updateById(vo);
+ } else {
+ baseMapper.insert(vo);
+ }
+ });
+ ZbStatisticZxyw vo = new ZbStatisticZxyw();
+ vo.setYw(itemVoListMon.get(0).getYw());
+ vo.setLb(itemVoListMon.get(0).getLb());
+ vo.setDw("闆嗗洟");
+ vo.setStatYm(queryDTO.getYearMonth());
+ vo.setDywc(itemVoListMon.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ ZbStatisticZxyw vo1 = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, vo.getStatYm()).last("limit 1"));
+ ZbStatisticZxyw voQndy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, qndy).last("limit 1"));
+ ZbStatisticZxyw voSy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, sy).last("limit 1"));
+ if (ObjUtil.isNotNull(voQndy)) {
+ vo.setQnty(voQndy.getDywc());
+ vo.setQntq(voQndy.getLjwc());
+ vo.setYtb(vo.getDywc().subtract(vo.getQnty()));
+ if (vo.getQnty().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo.getYtb().divide(vo.getQnty(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
+ vo.setYtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ if (ObjUtil.isNotNull(voSy)) {
+ vo.setLjwc(voSy.getLjwc().add(ObjUtil.isNull(vo.getDywc()) ? BigDecimal.ZERO : vo.getDywc()));
+ vo.setLjtb(vo.getLjwc().subtract(ObjUtil.isNull(vo.getQntq()) ? BigDecimal.ZERO : vo.getQntq()));
+ if (ObjUtil.isNotNull(vo.getQntq()) && vo.getQntq().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo.getLjtb().divide(vo.getQntq(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
+ vo.setLjtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ if (ObjUtil.isNotNull(vo1)) {
+ vo.setId(vo1.getId());
+ baseMapper.updateById(vo);
+ } else {
+ baseMapper.insert(vo);
+ }
+ }
+// List<GcpbkwcqkItemVo> itemVoListYear = contractInvoiceMapper.dxsxywwcqk("2", yearstart, yearend);
+// List<GcpbkwcqkItemVo> itemVoListYearLastYear = contractInvoiceMapper.dxsxywwcqk("2", yearstartLastYear, yearendLastYear);
+// if (CollUtil.isNotEmpty(list) && CollUtil.isNotEmpty(itemVoListYear)) {
+//
+// for (GcpbkwcqkItemVo itemVo : itemVoListYear
+// ) {
+// ZbStatisticZxyw vo = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, itemVo.getYw())
+// .eq(ZbStatisticZxyw::getLb, itemVo.getLb()).eq(ZbStatisticZxyw::getDw, itemVo.getDw())
+// .eq(ZbStatisticZxyw::getStatYm, queryDTO.getYearMonth()).last("limit 1"));
+// if (StrUtil.equals(vo.getYw(), itemVo.getYw()) && StrUtil.equals(vo.getLb(), itemVo.getLb()) &&
+// StrUtil.equals(vo.getDw(), itemVo.getDw())) {
+// vo.setLjwc(itemVo.getWc());
+// }
+// if (CollUtil.isNotEmpty(itemVoListYearLastYear)) {
+// itemVoListYearLastYear.stream().forEach(item1 -> {
+// if (StrUtil.equals(vo.getYw(), itemVo.getYw()) && StrUtil.equals(vo.getLb(), itemVo.getLb()) &&
+// StrUtil.equals(vo.getDw(), itemVo.getDw()) && item1.getWc().compareTo(new BigDecimal("0")) > 0) {
+// vo.setQntq(item1.getWc());
+// vo.setLjtb(vo.getLjwc().subtract(item1.getWc()));
+// if (vo.getQnwc().compareTo(new BigDecimal("0")) > 0) {
+// vo.setLjtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// });
+// }
+// baseMapper.updateById(vo);
+// }
+//
+// ZbStatisticZxyw vo = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, "澶т慨")
+// .eq(ZbStatisticZxyw::getLb, "閿�鍞敹鍏�").eq(ZbStatisticZxyw::getDw, "闆嗗洟")
+// .eq(ZbStatisticZxyw::getStatYm, queryDTO.getYearMonth()).last("limit 1"));
+// vo.setLjwc(itemVoListYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// if (CollUtil.isNotEmpty(itemVoListYearLastYear)) {
+// vo.setQntq(itemVoListYearLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// vo.setLjtb(vo.getLjwc().subtract(vo.getQntq()));
+// if (ObjUtil.isNotNull(vo.getQntq())&&vo.getQntq().compareTo(new BigDecimal("0")) > 0) {
+// vo.setLjtqb(vo.getLjtb().divide(vo.getQntq(), 2, RoundingMode.HALF_UP) + "%");
+// }
+//
+// }
+// baseMapper.updateById(vo);
+// }
+ //澶т慨鍚堝悓
+ List<GcpbkwcqkItemVo> itemVoListMonHT = contractMapper.dxsxywwcqkHT("2", monstart, monend);
+ List<GcpbkwcqkItemVo> itemVoListMonrHTLastYear = contractMapper.dxsxywwcqkHT("2", monstartLastYear, monendLastYear);
+ if (CollUtil.isNotEmpty(itemVoListMonHT)) {
+ itemVoListMonHT.stream().forEach(item -> {
+ ZbStatisticZxyw vo = new ZbStatisticZxyw();
+ vo.setYw(item.getYw());
+ vo.setLb(item.getLb());
+ vo.setDw(item.getDw());
+ vo.setDywc(item.getWc());
+ vo.setStatYm(queryDTO.getYearMonth());
+ Long compId = null;
+ if (StrUtil.equals(item.getDw(), "鐭崇叅鏈�")) {
+ compId = 2089995177814495234L;
+ vo.setCompId(2089995177814495234L);
+ }
+ if (StrUtil.equals(item.getDw(), "鐭冲伐娉�")) {
+ compId = 2056556196124250113L;
+ vo.setCompId(2056556196124250113L);
+ }
+ if (StrUtil.equals(item.getDw(), "閫氭柟鍘�")) {
+ compId = 2056556317461270529L;
+ vo.setCompId(2056556317461270529L);
+ }
+ if (StrUtil.equals(item.getDw(), "閭㈠彴鍘�")) {
+ compId = 2056556421857497090L;
+ vo.setCompId(2056556421857497090L);
+ }
+ ZbStatisticZxyw vo1 = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, vo.getStatYm()).last("limit 1"));
+ ZbStatisticZxyw voQndy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, qndy).last("limit 1"));
+ ZbStatisticZxyw voSy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, sy).last("limit 1"));
+ if (ObjUtil.isNotNull(voQndy)) {
+ vo.setQnty(voQndy.getDywc());
+ vo.setQntq(voQndy.getLjwc());
+ vo.setYtb(vo.getDywc().subtract(vo.getQnty()));
+ if (vo.getQnty().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo.getYtb().divide(vo.getQnty(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
+ vo.setYtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ if (ObjUtil.isNotNull(voSy)) {
+ vo.setLjwc(voSy.getLjwc().add(ObjUtil.isNull(vo.getDywc()) ? BigDecimal.ZERO : vo.getDywc()));
+ vo.setLjtb(vo.getLjwc().subtract(ObjUtil.isNull(vo.getQntq()) ? BigDecimal.ZERO : vo.getQntq()));
+ if (ObjUtil.isNotNull(vo.getQntq()) && vo.getQntq().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo.getLjtb().divide(vo.getQntq(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
+ vo.setLjtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ if (ObjUtil.isNotNull(vo1)) {
+ vo.setId(vo1.getId());
+ baseMapper.updateById(vo);
+ } else {
+ baseMapper.insert(vo);
+ }
+ });
+ ZbStatisticZxyw vo = new ZbStatisticZxyw();
+ vo.setYw(itemVoListMonHT.get(0).getYw());
+ vo.setLb(itemVoListMonHT.get(0).getLb());
+ vo.setDw("闆嗗洟");
+ vo.setStatYm(queryDTO.getYearMonth());
+ vo.setDywc(itemVoListMonHT.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ ZbStatisticZxyw vo1 = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, vo.getStatYm()).last("limit 1"));
+ ZbStatisticZxyw voQndy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, qndy).last("limit 1"));
+ ZbStatisticZxyw voSy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, sy).last("limit 1"));
+ if (ObjUtil.isNotNull(voQndy)) {
+ vo.setQnty(voQndy.getDywc());
+ vo.setQntq(voQndy.getLjwc());
+ vo.setYtb(vo.getDywc().subtract(vo.getQnty()));
+ if (vo.getQnty().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo.getYtb().divide(vo.getQnty(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
+ vo.setYtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ if (ObjUtil.isNotNull(voSy)) {
+ vo.setLjwc(voSy.getLjwc().add(ObjUtil.isNull(vo.getDywc()) ? BigDecimal.ZERO : vo.getDywc()));
+ vo.setLjtb(vo.getLjwc().subtract(ObjUtil.isNull(vo.getQntq()) ? BigDecimal.ZERO : vo.getQntq()));
+ if (ObjUtil.isNotNull(vo.getQntq()) && vo.getQntq().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo.getLjtb().divide(vo.getQntq(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
+ vo.setLjtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ if (ObjUtil.isNotNull(vo1)) {
+ vo.setId(vo1.getId());
+ baseMapper.updateById(vo);
+ } else {
+ baseMapper.insert(vo);
+ }
+
+ }
+// List<GcpbkwcqkItemVo> itemVoListYearHT = contractMapper.dxsxywwcqkHT("2", yearstart, yearend);
+// List<GcpbkwcqkItemVo> itemVoListYearHTLastYear = contractMapper.dxsxywwcqkHT("2", yearstartLastYear, yearendLastYear);
+// if (CollUtil.isNotEmpty(list) && CollUtil.isNotEmpty(itemVoListYearHT)) {
+//
+// for (GcpbkwcqkItemVo itemVo : itemVoListYearHT
+// ) {
+// ZbStatisticZxyw vo = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, itemVo.getYw())
+// .eq(ZbStatisticZxyw::getLb, itemVo.getLb()).eq(ZbStatisticZxyw::getDw, itemVo.getDw())
+// .eq(ZbStatisticZxyw::getStatYm, queryDTO.getYearMonth()).last("limit 1"));
+// if (StrUtil.equals(vo.getYw(), itemVo.getYw()) && StrUtil.equals(vo.getLb(), itemVo.getLb()) &&
+// StrUtil.equals(vo.getDw(), itemVo.getDw())) {
+// vo.setLjwc(itemVo.getWc());
+// }
+// if (CollUtil.isNotEmpty(itemVoListYearHTLastYear)) {
+// itemVoListYearHTLastYear.stream().forEach(item1 -> {
+// if (StrUtil.equals(vo.getYw(), itemVo.getYw()) && StrUtil.equals(vo.getLb(), itemVo.getLb()) &&
+// StrUtil.equals(vo.getDw(), itemVo.getDw()) && item1.getWc().compareTo(new BigDecimal("0")) > 0) {
+// vo.setQntq(item1.getWc());
+// vo.setLjtb(vo.getLjwc().subtract(item1.getWc()));
+// if (vo.getQnwc().compareTo(new BigDecimal("0")) > 0) {
+// vo.setLjtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// });
+// }
+// baseMapper.updateById(vo);
+// }
+//
+// ZbStatisticZxyw vo = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, "澶т慨")
+// .eq(ZbStatisticZxyw::getLb, "鏂板鍚堝悓").eq(ZbStatisticZxyw::getDw, "闆嗗洟")
+// .eq(ZbStatisticZxyw::getStatYm, queryDTO.getYearMonth()).last("limit 1"));
+// vo.setLjwc(itemVoListYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// if (CollUtil.isNotEmpty(itemVoListYearHTLastYear)) {
+// vo.setQntq(itemVoListYearHTLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// vo.setLjtb(vo.getLjwc().subtract(vo.getQntq()));
+// if (ObjUtil.isNotNull(vo.getQntq())&&vo.getQntq().compareTo(new BigDecimal("0")) > 0) {
+// vo.setLjtqb(vo.getLjtb().divide(vo.getQntq(), 2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// baseMapper.updateById(vo);
+// }
+ }
+ if (true) {
+ //鍑哄彛寮�绁�
+ List<GcpbkwcqkItemVo> itemVoListMon = contractInvoiceMapper.cksxywwcqk("1", monstart, monend);
+ List<GcpbkwcqkItemVo> itemVoListMonrLastYear = contractInvoiceMapper.cksxywwcqk("1", monstartLastYear, monendLastYear);
+ if (CollUtil.isNotEmpty(itemVoListMon)) {
+ itemVoListMon.stream().forEach(item -> {
+ ZbStatisticZxyw vo = new ZbStatisticZxyw();
+ vo.setYw(item.getYw());
+ vo.setLb(item.getLb());
+ vo.setDw(item.getDw());
+ vo.setDywc(item.getWc());
+ vo.setStatYm(queryDTO.getYearMonth());
+ Long compId = null;
+ if (StrUtil.equals(item.getDw(), "鐭崇叅鏈�")) {
+ compId = 2089995177814495234L;
+ vo.setCompId(2089995177814495234L);
+ }
+ if (StrUtil.equals(item.getDw(), "鐭冲伐娉�")) {
+ compId = 2056556196124250113L;
+ vo.setCompId(2056556196124250113L);
+ }
+ if (StrUtil.equals(item.getDw(), "閫氭柟鍘�")) {
+ compId = 2056556317461270529L;
+ vo.setCompId(2056556317461270529L);
+ }
+ if (StrUtil.equals(item.getDw(), "閭㈠彴鍘�")) {
+ compId = 2056556421857497090L;
+ vo.setCompId(2056556421857497090L);
+ }
+ ZbStatisticZxyw vo1 = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, vo.getStatYm()).last("limit 1"));
+ ZbStatisticZxyw voQndy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, qndy).last("limit 1"));
+ ZbStatisticZxyw voSy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, sy).last("limit 1"));
+ if (ObjUtil.isNotNull(voQndy)) {
+ vo.setQnty(voQndy.getDywc());
+ vo.setQntq(voQndy.getLjwc());
+ vo.setYtb(vo.getDywc().subtract(vo.getQnty()));
+ if (vo.getQnty().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo.getYtb().divide(vo.getQnty(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
+ vo.setYtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ if (ObjUtil.isNotNull(voSy)) {
+ vo.setLjwc(voSy.getLjwc().add(ObjUtil.isNull(vo.getDywc()) ? BigDecimal.ZERO : vo.getDywc()));
+ vo.setLjtb(vo.getLjwc().subtract(ObjUtil.isNull(vo.getQntq()) ? BigDecimal.ZERO : vo.getQntq()));
+ if (ObjUtil.isNotNull(vo.getQntq()) && vo.getQntq().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo.getLjtb().divide(vo.getQntq(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
+ vo.setLjtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ if (ObjUtil.isNotNull(vo1)) {
+ vo.setId(vo1.getId());
+ baseMapper.updateById(vo);
+ } else {
+ baseMapper.insert(vo);
+ }
+
+ });
+ ZbStatisticZxyw vo = new ZbStatisticZxyw();
+ vo.setYw(itemVoListMon.get(0).getYw());
+ vo.setLb(itemVoListMon.get(0).getLb());
+ vo.setDw("闆嗗洟");
+ vo.setStatYm(queryDTO.getYearMonth());
+ vo.setDywc(itemVoListMon.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ ZbStatisticZxyw vo1 = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, vo.getStatYm()).last("limit 1"));
+ ZbStatisticZxyw voQndy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, qndy).last("limit 1"));
+ ZbStatisticZxyw voSy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, sy).last("limit 1"));
+ if (ObjUtil.isNotNull(voQndy)) {
+ vo.setQnty(voQndy.getDywc());
+ vo.setQntq(voQndy.getLjwc());
+ vo.setYtb(vo.getDywc().subtract(vo.getQnty()));
+ if (vo.getQnty().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo.getYtb().divide(vo.getQnty(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
+ vo.setYtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ if (ObjUtil.isNotNull(voSy)) {
+ vo.setLjwc(voSy.getLjwc().add(ObjUtil.isNull(vo.getDywc()) ? BigDecimal.ZERO : vo.getDywc()));
+ vo.setLjtb(vo.getLjwc().subtract(ObjUtil.isNull(vo.getQntq()) ? BigDecimal.ZERO : vo.getQntq()));
+ if (ObjUtil.isNotNull(vo.getQntq()) && vo.getQntq().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo.getLjtb().divide(vo.getQntq(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
+ vo.setLjtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ if (ObjUtil.isNotNull(vo1)) {
+ vo.setId(vo1.getId());
+ baseMapper.updateById(vo);
+ } else {
+ baseMapper.insert(vo);
+ }
+ }
+// List<GcpbkwcqkItemVo> itemVoListYear = contractInvoiceMapper.cksxywwcqk("1", yearstart, yearend);
+// List<GcpbkwcqkItemVo> itemVoListYearLastYear = contractInvoiceMapper.cksxywwcqk("1", yearstartLastYear, yearendLastYear);
+// if (CollUtil.isNotEmpty(list) && CollUtil.isNotEmpty(itemVoListYear)) {
+//
+// for (GcpbkwcqkItemVo itemVo : itemVoListYear
+// ) {
+// ZbStatisticZxyw vo = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, itemVo.getYw())
+// .eq(ZbStatisticZxyw::getLb, itemVo.getLb()).eq(ZbStatisticZxyw::getDw, itemVo.getDw())
+// .eq(ZbStatisticZxyw::getStatYm, queryDTO.getYearMonth()).last("limit 1"));
+// if (StrUtil.equals(vo.getYw(), itemVo.getYw()) && StrUtil.equals(vo.getLb(), itemVo.getLb()) &&
+// StrUtil.equals(vo.getDw(), itemVo.getDw())) {
+// vo.setLjwc(itemVo.getWc());
+// }
+// if (CollUtil.isNotEmpty(itemVoListYearLastYear)) {
+// itemVoListYearLastYear.stream().forEach(item1 -> {
+// if (StrUtil.equals(vo.getYw(), itemVo.getYw()) && StrUtil.equals(vo.getLb(), itemVo.getLb()) &&
+// StrUtil.equals(vo.getDw(), itemVo.getDw()) && item1.getWc().compareTo(new BigDecimal("0")) > 0) {
+// vo.setQntq(item1.getWc());
+// vo.setLjtb(vo.getLjwc().subtract(item1.getWc()));
+// if (vo.getQnwc().compareTo(new BigDecimal("0")) > 0) {
+// vo.setLjtqb(vo.getYtb().divide(vo.getQnwc(), 2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// });
+// }
+// baseMapper.updateById(vo);
+// }
+//
+// ZbStatisticZxyw vo = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, "鍑哄彛")
+// .eq(ZbStatisticZxyw::getLb, "閿�鍞敹鍏�").eq(ZbStatisticZxyw::getDw, "闆嗗洟")
+// .eq(ZbStatisticZxyw::getStatYm, queryDTO.getYearMonth()).last("limit 1"));
+// vo.setLjwc(itemVoListYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// if (CollUtil.isNotEmpty(itemVoListYearLastYear)) {
+// vo.setQntq(itemVoListYearLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// vo.setLjtb(vo.getLjwc().subtract(vo.getQntq()));
+// if (ObjUtil.isNotNull(vo.getQntq())&&vo.getQntq().compareTo(new BigDecimal("0")) > 0) {
+// vo.setLjtqb(vo.getLjtb().divide(vo.getQntq(), 2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// baseMapper.updateById(vo);
+// }
+ //閰嶄欢鍚堝悓
+ List<GcpbkwcqkItemVo> itemVoListMonHT = contractMapper.cksxywwcqkHT("1", monstart, monend);
+ List<GcpbkwcqkItemVo> itemVoListMonrHTLastYear = contractMapper.cksxywwcqkHT("1", monstartLastYear, monendLastYear);
+ if (CollUtil.isNotEmpty(itemVoListMonHT)) {
+ itemVoListMonHT.stream().forEach(item -> {
+ ZbStatisticZxyw vo = new ZbStatisticZxyw();
+ vo.setYw(item.getYw());
+ vo.setLb(item.getLb());
+ vo.setDw(item.getDw());
+ vo.setDywc(item.getWc());
+ vo.setStatYm(queryDTO.getYearMonth());
+ Long compId = null;
+ if (StrUtil.equals(item.getDw(), "鐭崇叅鏈�")) {
+ compId = 2089995177814495234L;
+ vo.setCompId(2089995177814495234L);
+ }
+ if (StrUtil.equals(item.getDw(), "鐭冲伐娉�")) {
+ compId = 2056556196124250113L;
+ vo.setCompId(2056556196124250113L);
+ }
+ if (StrUtil.equals(item.getDw(), "閫氭柟鍘�")) {
+ compId = 2056556317461270529L;
+ vo.setCompId(2056556317461270529L);
+ }
+ if (StrUtil.equals(item.getDw(), "閭㈠彴鍘�")) {
+ compId = 2056556421857497090L;
+ vo.setCompId(2056556421857497090L);
+ }
+ ZbStatisticZxyw vo1 = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, vo.getStatYm()).last("limit 1"));
+ ZbStatisticZxyw voQndy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, qndy).last("limit 1"));
+ ZbStatisticZxyw voSy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, sy).last("limit 1"));
+ if (ObjUtil.isNotNull(voQndy)) {
+ vo.setQnty(voQndy.getDywc());
+ vo.setQntq(voQndy.getLjwc());
+ vo.setYtb(vo.getDywc().subtract(vo.getQnty()));
+ if (vo.getQnty().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo.getYtb().divide(vo.getQnty(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
+ vo.setYtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ if (ObjUtil.isNotNull(voSy)) {
+ vo.setLjwc(voSy.getLjwc().add(ObjUtil.isNull(vo.getDywc()) ? BigDecimal.ZERO : vo.getDywc()));
+ vo.setLjtb(vo.getLjwc().subtract(ObjUtil.isNull(vo.getQntq()) ? BigDecimal.ZERO : vo.getQntq()));
+ if (ObjUtil.isNotNull(vo.getQntq()) && vo.getQntq().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo.getLjtb().divide(vo.getQntq(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
+ vo.setLjtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ if (ObjUtil.isNotNull(vo1)) {
+ vo.setId(vo1.getId());
+ baseMapper.updateById(vo);
+ } else {
+ baseMapper.insert(vo);
+ }
+ });
+ ZbStatisticZxyw vo = new ZbStatisticZxyw();
+ vo.setYw(itemVoListMonHT.get(0).getYw());
+ vo.setLb(itemVoListMonHT.get(0).getLb());
+ vo.setDw("闆嗗洟");
+ vo.setStatYm(queryDTO.getYearMonth());
+ vo.setDywc(itemVoListMonHT.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ ZbStatisticZxyw vo1 = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, vo.getStatYm()).last("limit 1"));
+ ZbStatisticZxyw voQndy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, qndy).last("limit 1"));
+ ZbStatisticZxyw voSy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vo.getYw())
+ .eq(ZbStatisticZxyw::getLb, vo.getLb()).eq(ZbStatisticZxyw::getDw, vo.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, sy).last("limit 1"));
+ if (ObjUtil.isNotNull(voQndy)) {
+ vo.setQnty(voQndy.getDywc());
+ vo.setQntq(voQndy.getLjwc());
+ vo.setYtb(vo.getDywc().subtract(vo.getQnty()));
+ if (vo.getQnty().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo.getYtb().divide(vo.getQnty(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
+ vo.setYtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ if (ObjUtil.isNotNull(voSy)) {
+ vo.setLjwc(voSy.getLjwc().add(ObjUtil.isNull(vo.getDywc()) ? BigDecimal.ZERO : vo.getDywc()));
+ vo.setLjtb(vo.getLjwc().subtract(ObjUtil.isNull(vo.getQntq()) ? BigDecimal.ZERO : vo.getQntq()));
+ if (ObjUtil.isNotNull(vo.getQntq()) && vo.getQntq().compareTo(new BigDecimal("0")) > 0) {
+ BigDecimal percent = vo.getLjtb().divide(vo.getQntq(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
+ vo.setLjtqb(percent.setScale(2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ if (ObjUtil.isNotNull(vo1)) {
+ vo.setId(vo1.getId());
+ baseMapper.updateById(vo);
+ } else {
+ baseMapper.insert(vo);
+ }
+ }
+// List<GcpbkwcqkItemVo> itemVoListYearHT = contractMapper.cksxywwcqkHT("1", yearstart, yearend);
+// List<GcpbkwcqkItemVo> itemVoListYearHTLastYear = contractMapper.cksxywwcqkHT("1", yearstartLastYear, yearendLastYear);
+// if (CollUtil.isNotEmpty(list) && CollUtil.isNotEmpty(itemVoListYearHT)) {
+//
+// for (GcpbkwcqkItemVo itemVo : itemVoListYearHT
+// ) {
+// ZbStatisticZxyw vo = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, itemVo.getYw())
+// .eq(ZbStatisticZxyw::getLb, itemVo.getLb()).eq(ZbStatisticZxyw::getDw, itemVo.getDw())
+// .eq(ZbStatisticZxyw::getStatYm, queryDTO.getYearMonth()).last("limit 1"));
+// if (StrUtil.equals(vo.getYw(), itemVo.getYw()) && StrUtil.equals(vo.getLb(), itemVo.getLb()) &&
+// StrUtil.equals(vo.getDw(), itemVo.getDw())) {
+// vo.setLjwc(itemVo.getWc());
+// }
+// if (CollUtil.isNotEmpty(itemVoListYearHTLastYear)) {
+// itemVoListYearHTLastYear.stream().forEach(item1 -> {
+// if (StrUtil.equals(vo.getYw(), itemVo.getYw()) && StrUtil.equals(vo.getLb(), itemVo.getLb()) &&
+// StrUtil.equals(vo.getDw(), itemVo.getDw()) && item1.getWc().compareTo(new BigDecimal("0")) > 0) {
+// vo.setQntq(item1.getWc());
+// vo.setLjtb(vo.getLjwc().subtract(item1.getWc()));
+// if (ObjUtil.isNotNull(vo.getQntq())&&vo.getQntq().compareTo(new BigDecimal("0")) > 0) {
+// vo.setLjtqb(vo.getLjtb().divide(vo.getQntq(), 2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// });
+// }
+// baseMapper.updateById(vo);
+// }
+//
+// ZbStatisticZxyw vo = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, "鍑哄彛")
+// .eq(ZbStatisticZxyw::getLb, "鏂板鍚堝悓").eq(ZbStatisticZxyw::getDw, "闆嗗洟")
+// .eq(ZbStatisticZxyw::getStatYm, queryDTO.getYearMonth()).last("limit 1"));
+// vo.setLjwc(itemVoListYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// if (CollUtil.isNotEmpty(itemVoListYearHTLastYear)) {
+// vo.setQntq(itemVoListYearHTLastYear.stream().map(GcpbkwcqkItemVo::getWc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+// vo.setLjtb(vo.getLjwc().subtract(vo.getQntq()));
+// if (ObjUtil.isNotNull(vo.getQntq())&&vo.getQntq().compareTo(new BigDecimal("0")) > 0) {
+// vo.setLjtqb(vo.getLjtb().divide(vo.getQntq(), 2, RoundingMode.HALF_UP) + "%");
+// }
+//
+// }
+// baseMapper.updateById(vo);
+// }
+ }
+
+ String[] arrLb = {"閿�鍞敹鍏�", "鏂板鍚堝悓"};
+ String[] arrDw = {"鐭崇叅鏈�", "鐭冲伐娉�", "閭㈠彴鍘�", "閫氭柟鍘�"};
+ for (int i = 0; i < arrLb.length; i++) {
+ for (int j = 0; j < arrDw.length; j++) {
+ ZbStatisticZxyw vosmj = new ZbStatisticZxyw();
+ vosmj.setYw("浠ヤ笂涓夐」鍚堣");
+ String lb = arrLb[i];
+ String dw = arrDw[j];
+ vosmj.setLb(lb);
+ vosmj.setDw(dw);
+ vosmj.setStatYm(queryDTO.getYearMonth());
+ ZbStatisticZxyw vo1 = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vosmj.getYw())
+ .eq(ZbStatisticZxyw::getLb, vosmj.getLb()).eq(ZbStatisticZxyw::getDw, vosmj.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, vosmj.getStatYm()).last("limit 1"));
+ if (ObjUtil.isNotNull(vo1)) {
+ if (StrUtil.equals(vosmj.getLb(), "鏂板鍚堝悓")) {
+ List<ZbStatisticZxyw> htList = baseMapper.selectList(Wrappers.<ZbStatisticZxyw>lambdaQuery()
+ .eq(ZbStatisticZxyw::getLb, "鏂板鍚堝悓")
+ .eq(ZbStatisticZxyw::getStatYm, vosmj.getStatYm()));
+ List<ZbStatisticZxyw> htqndyList = baseMapper.selectList(Wrappers.<ZbStatisticZxyw>lambdaQuery()
+ .eq(ZbStatisticZxyw::getLb, "鏂板鍚堝悓")
+ .eq(ZbStatisticZxyw::getStatYm, qndy));
+
+
+ if (CollUtil.isNotEmpty(htList)) {
+ vo1.setDywc(htList.stream().map(item -> item.getDywc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ } else {
+ vo1.setDywc(BigDecimal.ZERO);
+ }
+ if (CollUtil.isNotEmpty(htqndyList)) {
+ vo1.setQnty(htqndyList.stream().map(item -> item.getQnty()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ } else {
+ vo1.setQnty(BigDecimal.ZERO);
+ }
+ }
+ if (StrUtil.equals(vosmj.getLb(), "閿�鍞敹鍏�")) {
+ List<ZbStatisticZxyw> srList = baseMapper.selectList(Wrappers.<ZbStatisticZxyw>lambdaQuery()
+ .eq(ZbStatisticZxyw::getLb, "閿�鍞敹鍏�")
+ .eq(ZbStatisticZxyw::getStatYm, vosmj.getStatYm()));
+ List<ZbStatisticZxyw> srqndyList = baseMapper.selectList(Wrappers.<ZbStatisticZxyw>lambdaQuery()
+ .eq(ZbStatisticZxyw::getLb, "閿�鍞敹鍏�")
+ .eq(ZbStatisticZxyw::getStatYm, qndy));
+ if (CollUtil.isNotEmpty(srList)) {
+ vo1.setDywc(srList.stream().map(item -> item.getDywc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ } else {
+ vo1.setDywc(BigDecimal.ZERO);
+ }
+ if (CollUtil.isNotEmpty(srqndyList)) {
+ vo1.setQnty(srqndyList.stream().map(item -> item.getQnty()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ } else {
+ vo1.setQnty(BigDecimal.ZERO);
+ }
+ }
+ ZbStatisticZxyw voSy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vosmj.getYw())
+ .eq(ZbStatisticZxyw::getLb, vosmj.getLb()).eq(ZbStatisticZxyw::getDw, vosmj.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, sy).last("limit 1"));
+ if (ObjUtil.isNotNull(voSy)) {
+ vo1.setLjwc(voSy.getLjwc().add(vo1.getDywc()));
+ } else {
+ vo1.setLjwc(vo1.getDywc());
+ }
+
+ ZbStatisticZxyw voQndy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vosmj.getYw())
+ .eq(ZbStatisticZxyw::getLb, vosmj.getLb()).eq(ZbStatisticZxyw::getDw, vosmj.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, qndy).last("limit 1"));
+ if (ObjUtil.isNotNull(voQndy)) {
+ vo1.setQntq(voQndy.getLjwc());
+ } else {
+ vo1.setQntq(BigDecimal.ZERO);
+ }
+ vo1.setYtb(vo1.getDywc().subtract(vo1.getQnty()));
+ if (vo1.getQnty().compareTo(new BigDecimal("0")) > 0) {
+ vo1.setYtqb(vo1.getYtb().divide(vo1.getQnty(), 2, RoundingMode.HALF_UP) + "%");
+ }
+
+ vo1.setLjtb(vo1.getLjwc().subtract(vo1.getQntq()));
+ if (vo1.getQntq().compareTo(new BigDecimal("0")) > 0) {
+ vo1.setLjtqb(vo1.getLjtb().divide(vo1.getQntq(), 2, RoundingMode.HALF_UP) + "%");
+ }
+ baseMapper.updateById(vo1);
+ } else {
+ if (StrUtil.equals(vosmj.getLb(), "鏂板鍚堝悓")) {
+ List<ZbStatisticZxyw> htList = baseMapper.selectList(Wrappers.<ZbStatisticZxyw>lambdaQuery()
+ .eq(ZbStatisticZxyw::getLb, "鏂板鍚堝悓")
+ .eq(ZbStatisticZxyw::getStatYm, vosmj.getStatYm()));
+ List<ZbStatisticZxyw> htqndyList = baseMapper.selectList(Wrappers.<ZbStatisticZxyw>lambdaQuery()
+ .eq(ZbStatisticZxyw::getLb, "鏂板鍚堝悓")
+ .eq(ZbStatisticZxyw::getStatYm, qndy));
+
+
+ if (CollUtil.isNotEmpty(htList)) {
+ vosmj.setDywc(htList.stream().map(item -> item.getDywc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ } else {
+ vosmj.setDywc(BigDecimal.ZERO);
+ }
+ if (CollUtil.isNotEmpty(htqndyList)) {
+ vosmj.setQnty(htqndyList.stream().map(item -> item.getQnty()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ } else {
+ vosmj.setQnty(BigDecimal.ZERO);
+ }
+ }
+ if (StrUtil.equals(vosmj.getLb(), "閿�鍞敹鍏�")) {
+ List<ZbStatisticZxyw> srList = baseMapper.selectList(Wrappers.<ZbStatisticZxyw>lambdaQuery()
+ .eq(ZbStatisticZxyw::getLb, "閿�鍞敹鍏�")
+ .eq(ZbStatisticZxyw::getStatYm, vosmj.getStatYm()));
+ List<ZbStatisticZxyw> srqndyList = baseMapper.selectList(Wrappers.<ZbStatisticZxyw>lambdaQuery()
+ .eq(ZbStatisticZxyw::getLb, "閿�鍞敹鍏�")
+ .eq(ZbStatisticZxyw::getStatYm, qndy));
+ if (CollUtil.isNotEmpty(srList)) {
+ vosmj.setDywc(srList.stream().map(item -> item.getDywc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ } else {
+ vosmj.setDywc(BigDecimal.ZERO);
+ }
+ if (CollUtil.isNotEmpty(srqndyList)) {
+ vosmj.setQnty(srqndyList.stream().map(item -> item.getQnty()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ } else {
+ vosmj.setQnty(BigDecimal.ZERO);
+ }
+ }
+ ZbStatisticZxyw voSy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vosmj.getYw())
+ .eq(ZbStatisticZxyw::getLb, vosmj.getLb()).eq(ZbStatisticZxyw::getDw, vosmj.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, sy).last("limit 1"));
+ if (ObjUtil.isNotNull(voSy)) {
+ vosmj.setLjwc(voSy.getLjwc().add(vosmj.getDywc()));
+ } else {
+ vosmj.setLjwc(vosmj.getDywc());
+ }
+
+ ZbStatisticZxyw voQndy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vosmj.getYw())
+ .eq(ZbStatisticZxyw::getLb, vosmj.getLb()).eq(ZbStatisticZxyw::getDw, vosmj.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, qndy).last("limit 1"));
+ if (ObjUtil.isNotNull(voQndy)) {
+ vosmj.setQntq(voQndy.getLjwc());
+ } else {
+ vosmj.setQntq(BigDecimal.ZERO);
+ }
+ vosmj.setYtb(vosmj.getDywc().subtract(vosmj.getQnty()));
+ if (vosmj.getQnty().compareTo(new BigDecimal("0")) > 0) {
+ vosmj.setYtqb(vosmj.getYtb().divide(vosmj.getQnty(), 2, RoundingMode.HALF_UP) + "%");
+ }
+
+ vosmj.setLjtb(vosmj.getLjwc().subtract(vosmj.getQntq()));
+ if (vosmj.getQntq().compareTo(new BigDecimal("0")) > 0) {
+ vosmj.setLjtqb(vosmj.getLjtb().divide(vosmj.getQntq(), 2, RoundingMode.HALF_UP) + "%");
+ }
+ baseMapper.insert(vosmj);
+ }
+ }
+ }
+ ZbStatisticZxyw vosxsr = new ZbStatisticZxyw();
+ vosxsr.setYw("浠ヤ笂涓夐」鍚堣");
+ vosxsr.setLb("閿�鍞敹鍏�");
+ vosxsr.setDw("瑁呭");
+ vosxsr.setStatYm(queryDTO.getYearMonth());
+ ZbStatisticZxyw vo1 = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vosxsr.getYw())
+ .eq(ZbStatisticZxyw::getLb, vosxsr.getLb()).eq(ZbStatisticZxyw::getDw, vosxsr.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, vosxsr.getStatYm()).last("limit 1"));
+ List<ZbStatisticZxyw> srList = baseMapper.selectList(Wrappers.<ZbStatisticZxyw>lambdaQuery()
+ .eq(ZbStatisticZxyw::getLb, "閿�鍞敹鍏�")
+ .eq(ZbStatisticZxyw::getStatYm, vosxsr.getStatYm()));
+ List<ZbStatisticZxyw> srqndyList = baseMapper.selectList(Wrappers.<ZbStatisticZxyw>lambdaQuery()
+ .eq(ZbStatisticZxyw::getLb, "閿�鍞敹鍏�")
+ .eq(ZbStatisticZxyw::getStatYm, qndy));
+ if (CollUtil.isNotEmpty(srList)) {
+ vosxsr.setDywc(srList.stream().map(item -> item.getDywc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ } else {
+ vosxsr.setDywc(BigDecimal.ZERO);
+ }
+ if (CollUtil.isNotEmpty(srqndyList)) {
+ vosxsr.setQnty(srqndyList.stream().map(item -> item.getQnty()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ } else {
+ vosxsr.setQnty(BigDecimal.ZERO);
+ }
+ ZbStatisticZxyw voSy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vosxsr.getYw())
+ .eq(ZbStatisticZxyw::getLb, vosxsr.getLb()).eq(ZbStatisticZxyw::getDw, vosxsr.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, sy).last("limit 1"));
+ if (ObjUtil.isNotNull(voSy)) {
+ vosxsr.setLjwc(voSy.getLjwc().add(vosxsr.getDywc()));
+ } else {
+ vosxsr.setLjwc(vosxsr.getDywc());
+ }
+ ZbStatisticZxyw voQndy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vosxsr.getYw())
+ .eq(ZbStatisticZxyw::getLb, vosxsr.getLb()).eq(ZbStatisticZxyw::getDw, vosxsr.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, qndy).last("limit 1"));
+ if (ObjUtil.isNotNull(voQndy)) {
+ vosxsr.setQntq(voQndy.getLjwc());
+ } else {
+ vosxsr.setQntq(BigDecimal.ZERO);
+ }
+ vosxsr.setYtb(vosxsr.getDywc().subtract(vosxsr.getQnty()));
+ if (vosxsr.getQnty().compareTo(new BigDecimal("0")) > 0) {
+ vosxsr.setYtqb(vosxsr.getYtb().divide(vosxsr.getQnty(), 2, RoundingMode.HALF_UP) + "%");
+ }
+
+ vosxsr.setLjtb(vosxsr.getLjwc().subtract(vosxsr.getQntq()));
+ if (vosxsr.getQntq().compareTo(new BigDecimal("0")) > 0) {
+ vosxsr.setLjtqb(vosxsr.getLjtb().divide(vosxsr.getQntq(), 2, RoundingMode.HALF_UP) + "%");
+ }
+ if (ObjUtil.isNotNull(vo1)) {
+ vosxsr.setId(vo1.getId());
+ baseMapper.updateById(vosxsr);
+ } else {
+ baseMapper.insert(vosxsr);
+ }
+ ZbStatisticZxyw vosxht = new ZbStatisticZxyw();
+ vosxht.setYw("浠ヤ笂涓夐」鍚堣");
+ vosxht.setLb("鏂板鍚堝悓");
+ vosxht.setDw("瑁呭");
+ vosxht.setStatYm(queryDTO.getYearMonth());
+ ZbStatisticZxyw voht = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vosxht.getYw())
+ .eq(ZbStatisticZxyw::getLb, vosxht.getLb()).eq(ZbStatisticZxyw::getDw, vosxht.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, vosxht.getStatYm()).last("limit 1"));
+ List<ZbStatisticZxyw> srhtList = baseMapper.selectList(Wrappers.<ZbStatisticZxyw>lambdaQuery()
+ .eq(ZbStatisticZxyw::getLb, "閿�鍞敹鍏�")
+ .eq(ZbStatisticZxyw::getStatYm, vosxht.getStatYm()));
+ List<ZbStatisticZxyw> srqndyhtList = baseMapper.selectList(Wrappers.<ZbStatisticZxyw>lambdaQuery()
+ .eq(ZbStatisticZxyw::getLb, "閿�鍞敹鍏�")
+ .eq(ZbStatisticZxyw::getStatYm, qndy));
+ if (CollUtil.isNotEmpty(srhtList)) {
+ vosxht.setDywc(srhtList.stream().map(item -> item.getDywc()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ } else {
+ vosxht.setDywc(BigDecimal.ZERO);
+ }
+ if (CollUtil.isNotEmpty(srqndyhtList)) {
+ vosxht.setQnty(srqndyhtList.stream().map(item -> item.getQnty()).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+ } else {
+ vosxht.setQnty(BigDecimal.ZERO);
+ }
+ ZbStatisticZxyw vohtSy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vosxht.getYw())
+ .eq(ZbStatisticZxyw::getLb, vosxht.getLb()).eq(ZbStatisticZxyw::getDw, vosxht.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, sy).last("limit 1"));
+ if (ObjUtil.isNotNull(vohtSy)) {
+ vosxht.setLjwc(vohtSy.getLjwc().add(vosxht.getDywc()));
+ } else {
+ vosxht.setLjwc(vosxht.getDywc());
+ }
+ ZbStatisticZxyw vohtQndy = baseMapper.selectOne(Wrappers.<ZbStatisticZxyw>lambdaQuery().eq(ZbStatisticZxyw::getYw, vosxht.getYw())
+ .eq(ZbStatisticZxyw::getLb, vosxht.getLb()).eq(ZbStatisticZxyw::getDw, vosxht.getDw())
+ .eq(ZbStatisticZxyw::getStatYm, qndy).last("limit 1"));
+ if (ObjUtil.isNotNull(vohtQndy)) {
+ vosxht.setQntq(vohtQndy.getLjwc());
+ } else {
+ vosxht.setQntq(BigDecimal.ZERO);
+ }
+ vosxht.setYtb(vosxht.getDywc().subtract(vosxht.getQnty()));
+ if (vosxht.getQnty().compareTo(new BigDecimal("0")) > 0) {
+ vosxht.setYtqb(vosxht.getYtb().divide(vosxht.getQnty(), 2, RoundingMode.HALF_UP) + "%");
+ }
+
+ vosxht.setLjtb(vosxht.getLjwc().subtract(vosxht.getQntq()));
+ if (vosxht.getQntq().compareTo(new BigDecimal("0")) > 0) {
+ vosxht.setLjtqb(vosxht.getLjtb().divide(vosxht.getQntq(), 2, RoundingMode.HALF_UP) + "%");
+ }
+ if (ObjUtil.isNotNull(voht)) {
+ vosxht.setId(voht.getId());
+ baseMapper.updateById(vosxht);
+ } else {
+ baseMapper.insert(vosxht);
+ }
+ return R.ok();
+ }
+}
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/resources/mapper/ContractInvoiceMapper.xml b/platformx-business-finance-biz/src/main/resources/mapper/ContractInvoiceMapper.xml
index 2bb5061..972ecef 100644
--- a/platformx-business-finance-biz/src/main/resources/mapper/ContractInvoiceMapper.xml
+++ b/platformx-business-finance-biz/src/main/resources/mapper/ContractInvoiceMapper.xml
@@ -714,6 +714,15 @@
WHERE ci.del_flag = '0'
AND ci.invoice_time >= CURDATE()
AND ci.invoice_time < DATE_ADD(CURDATE(), INTERVAL 1 DAY )
+ <if test="compIds != null and compIds.size() > 0">
+ AND ci.comp_id IN
+ <foreach collection="compIds" item="id" open="(" separator="," close=")">
+ #{id}
+ </foreach>
+ </if>
+ <if test="compId!=null">
+ AND ci.comp_id = #{compId}
+ </if>
) AS br,
(
SELECT IFNULL(sum(ci.invoice_total_price_tax), 0)
@@ -722,6 +731,15 @@
AND ci.invoice_time >= DATE_FORMAT(CURDATE(), '%Y-%m-01')
AND ci.invoice_time < DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01')
+ <if test="compIds != null and compIds.size() > 0">
+ AND ci.comp_id IN
+ <foreach collection="compIds" item="id" open="(" separator="," close=")">
+ #{id}
+ </foreach>
+ </if>
+ <if test="compId!=null">
+ AND ci.comp_id = #{compId}
+ </if>
) AS bm,
(
SELECT IFNULL(sum(ci.invoice_total_price_tax), 0)
@@ -730,6 +748,15 @@
AND ci.invoice_time >= DATE_FORMAT(CURDATE(), '%Y-01-01')
AND ci.invoice_time < DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01')
+ <if test="compIds != null and compIds.size() > 0">
+ AND ci.comp_id IN
+ <foreach collection="compIds" item="id" open="(" separator="," close=")">
+ #{id}
+ </foreach>
+ </if>
+ <if test="compId!=null">
+ AND ci.comp_id = #{compId}
+ </if>
) AS bn
</select>
<select id="zbjtIndicatorTrend" resultType="com.by4cloud.platformx.business.vo.ZbjtIndicatorTrendVo">
@@ -875,7 +902,7 @@
IFNULL(sum( invoice_total_price_tax ),0) wc
FROM
contract_invoice ci
- LEFT JOIN contract c ON c.id = ci.contract_id
+ JOIN contract c ON c.id = ci.contract_id
AND c.supply_attribute = #{type}
AND ( c.comp_id = 2089995177814495234 OR c.comp_id = 2089996921978040321 OR c.comp_id = 2089997578009128962 OR c.comp_id = 2101966257365045249 )
WHERE
@@ -890,7 +917,7 @@
IFNULL(sum( invoice_total_price_tax ),0) wc
FROM
contract_invoice ci
- LEFT JOIN contract c ON c.id = ci.contract_id
+ JOIN contract c ON c.id = ci.contract_id
AND c.supply_attribute = #{type}
AND c.comp_id = 2056556196124250113
@@ -906,7 +933,7 @@
IFNULL(sum( invoice_total_price_tax ),0) wc
FROM
contract_invoice ci
- LEFT JOIN contract c ON c.id = ci.contract_id
+ JOIN contract c ON c.id = ci.contract_id
AND c.supply_attribute = #{type}
AND c.comp_id = 2056556317461270529
@@ -922,7 +949,7 @@
IFNULL(sum( invoice_total_price_tax ),0) wc
FROM
contract_invoice ci
- LEFT JOIN contract c ON c.id = ci.contract_id
+ JOIN contract c ON c.id = ci.contract_id
AND c.supply_attribute = #{type}
AND c.comp_id = 2056556421857497090
WHERE
@@ -938,7 +965,7 @@
IFNULL(sum( invoice_total_price_tax ),0) wc
FROM
contract_invoice ci
- LEFT JOIN contract c ON c.id = ci.contract_id
+ JOIN contract c ON c.id = ci.contract_id
AND c.supply_attribute = #{type}
AND ( c.comp_id = 2089995177814495234 OR c.comp_id = 2089996921978040321 OR c.comp_id = 2089997578009128962 OR c.comp_id = 2101966257365045249 )
WHERE
@@ -953,7 +980,7 @@
IFNULL(sum( invoice_total_price_tax ),0) wc
FROM
contract_invoice ci
- LEFT JOIN contract c ON c.id = ci.contract_id
+ JOIN contract c ON c.id = ci.contract_id
AND c.supply_attribute = #{type}
AND c.comp_id = 2056556196124250113
@@ -969,7 +996,7 @@
IFNULL(sum( invoice_total_price_tax ),0) wc
FROM
contract_invoice ci
- LEFT JOIN contract c ON c.id = ci.contract_id
+ JOIN contract c ON c.id = ci.contract_id
AND c.supply_attribute = #{type}
AND c.comp_id = 2056556317461270529
@@ -985,7 +1012,7 @@
IFNULL(sum( invoice_total_price_tax ),0) wc
FROM
contract_invoice ci
- LEFT JOIN contract c ON c.id = ci.contract_id
+ JOIN contract c ON c.id = ci.contract_id
AND c.supply_attribute = #{type}
AND c.comp_id = 2056556421857497090
WHERE
@@ -1001,9 +1028,9 @@
IFNULL(sum( invoice_total_price_tax ),0) wc
FROM
contract_invoice ci
- INNER JOIN contract c ON c.id = ci.contract_id
+ JOIN contract c ON c.id = ci.contract_id
AND ( c.comp_id = 2089995177814495234 OR c.comp_id = 2089996921978040321 OR c.comp_id = 2089997578009128962 OR c.comp_id = 2101966257365045249 )
- INNER JOIN business_customer bc ON bc.id = c.party_a_id
+ JOIN business_customer bc ON bc.id = c.party_a_id
AND bc.export_service_attr = '2'
WHERE
ci.del_flag = '0' UNION ALL
@@ -1014,9 +1041,9 @@
IFNULL(sum( invoice_total_price_tax ),0) wc
FROM
contract_invoice ci
- INNER JOIN contract c ON c.id = ci.contract_id
+ JOIN contract c ON c.id = ci.contract_id
AND c.comp_id = 2056556196124250113
- INNER JOIN business_customer bc ON bc.id = c.party_a_id
+ JOIN business_customer bc ON bc.id = c.party_a_id
AND bc.export_service_attr = '2'
WHERE
ci.del_flag = '0' UNION ALL
@@ -1027,9 +1054,9 @@
IFNULL(sum( invoice_total_price_tax ),0) wc
FROM
contract_invoice ci
- INNER JOIN contract c ON c.id = ci.contract_id
+ JOIN contract c ON c.id = ci.contract_id
AND c.comp_id = 2056556317461270529
- INNER JOIN business_customer bc ON bc.id = c.party_a_id
+ JOIN business_customer bc ON bc.id = c.party_a_id
AND bc.export_service_attr = '2'
WHERE
ci.del_flag = '0' UNION ALL
@@ -1040,9 +1067,9 @@
IFNULL(sum( invoice_total_price_tax ),0) wc
FROM
contract_invoice ci
- INNER JOIN contract c ON c.id = ci.contract_id
+ JOIN contract c ON c.id = ci.contract_id
AND c.comp_id = 2056556421857497090
- INNER JOIN business_customer bc ON bc.id = c.party_a_id
+ JOIN business_customer bc ON bc.id = c.party_a_id
AND bc.export_service_attr = '2'
WHERE
ci.del_flag = '0'
diff --git a/platformx-business-finance-biz/src/main/resources/mapper/ContractMapper.xml b/platformx-business-finance-biz/src/main/resources/mapper/ContractMapper.xml
index 1061806..5205ff9 100644
--- a/platformx-business-finance-biz/src/main/resources/mapper/ContractMapper.xml
+++ b/platformx-business-finance-biz/src/main/resources/mapper/ContractMapper.xml
@@ -1121,6 +1121,7 @@
c.center_push_flag,
c.annotate_flag,
c.last_attachment_url,
+ c.erp_push_flag,
(select sum(delivered_quantity*unit_price) from contract_subject_matter csm where csm.contract_id = c.id) outAmount
FROM
contract c,
@@ -1149,6 +1150,9 @@
</if>
<if test="queryDTO.queryServiceAttr !=null and queryDTO.queryServiceAttr !=''">
AND bc.export_service_attr = #{queryDTO.queryServiceAttr}
+ </if>
+ <if test="queryDTO.amount !=null ">
+ AND c.amount = #{queryDTO.amount}
</if>
<if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='1'.toString()">
AND c.sign_date >= CURDATE()
@@ -1648,6 +1652,15 @@
c.del_flag = '0'
AND c.sign_date >= CURDATE()
AND c.sign_date < DATE_ADD( CURDATE(), INTERVAL 1 DAY )
+ <if test="compIds != null and compIds.size() > 0">
+ AND c.comp_id IN
+ <foreach collection="compIds" item="id" open="(" separator="," close=")">
+ #{id}
+ </foreach>
+ </if>
+ <if test="compId!=null">
+ AND c.comp_id = #{compId}
+ </if>
) AS br,
(
SELECT
@@ -1658,6 +1671,15 @@
c.del_flag = '0'
AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-%m-01' )
AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )
+ <if test="compIds != null and compIds.size() > 0">
+ AND c.comp_id IN
+ <foreach collection="compIds" item="id" open="(" separator="," close=")">
+ #{id}
+ </foreach>
+ </if>
+ <if test="compId!=null">
+ AND c.comp_id = #{compId}
+ </if>
) AS bm,
(
SELECT
@@ -1668,6 +1690,15 @@
c.del_flag = '0'
AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' )
AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )
+ <if test="compIds != null and compIds.size() > 0">
+ AND c.comp_id IN
+ <foreach collection="compIds" item="id" open="(" separator="," close=")">
+ #{id}
+ </foreach>
+ </if>
+ <if test="compId!=null">
+ AND c.comp_id = #{compId}
+ </if>
) AS bn
</select>
<select id="zbjtStatisticByContractAmount" resultType="com.by4cloud.platformx.business.vo.ZbjtStatisticByContractAmountVo">
@@ -2095,8 +2126,10 @@
WHERE
c.del_flag = '0'
AND comp_id = 2056556196124250113
- AND c.sign_date >= #{startMon}
- AND c.sign_date < #{endMon}) sgbby,
+ AND ((c.sign_date >= #{startMon}
+ AND c.sign_date < #{endMon})
+ or c.sign_date is null)
+ ) sgbby,
(
SELECT
IFNULL(sum( c.amount ),0)
@@ -2105,8 +2138,10 @@
WHERE
c.del_flag = '0'
AND comp_id = 2056556196124250113
- AND c.sign_date >= #{startYear}
- AND c.sign_date < #{endYear}) sgbbn,
+ AND (( c.sign_date >= #{startYear}
+ AND c.sign_date < #{endYear})
+ or c.sign_date is null)
+ ) sgbbn,
(
SELECT
IFNULL(sum( c.amount ),0)
@@ -2115,8 +2150,9 @@
WHERE
c.del_flag = '0'
AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
- AND c.sign_date >= #{startMon}
- AND c.sign_date < #{endMon}) smjby,
+ AND ((c.sign_date >= #{startMon}
+ AND c.sign_date < #{endMon})
+ or c.sign_date is null)) smjby,
(
SELECT
IFNULL(sum( c.amount ),0)
@@ -2125,8 +2161,9 @@
WHERE
c.del_flag = '0'
AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
- AND c.sign_date >= #{startYear}
- AND c.sign_date < #{endYear}) smjbn,
+ AND (( c.sign_date >= #{startYear}
+ AND c.sign_date < #{endYear})
+ or c.sign_date is null)) smjbn,
(
SELECT
IFNULL(sum( c.amount ),0)
@@ -2135,8 +2172,9 @@
WHERE
c.del_flag = '0'
AND comp_id = 2056556317461270529
- AND c.sign_date >= #{startMon}
- AND c.sign_date < #{endMon}) jxcby,
+ AND ((c.sign_date >= #{startMon}
+ AND c.sign_date < #{endMon})
+ or c.sign_date is null)) jxcby,
(
SELECT
IFNULL(sum( c.amount ),0)
@@ -2145,8 +2183,9 @@
WHERE
c.del_flag = '0'
AND comp_id = 2056556317461270529
- AND c.sign_date >= #{startYear}
- AND c.sign_date < #{endYear}) jxcbn,
+ AND (( c.sign_date >= #{startYear}
+ AND c.sign_date < #{endYear})
+ or c.sign_date is null)) jxcbn,
(
SELECT
IFNULL(sum( c.amount ),0)
@@ -2155,8 +2194,9 @@
WHERE
c.del_flag = '0'
AND comp_id = 2056556421857497090
- AND c.sign_date >= #{startMon}
- AND c.sign_date < #{endMon}) tfby,
+ AND ((c.sign_date >= #{startMon}
+ AND c.sign_date < #{endMon})
+ or c.sign_date is null)) tfby,
(
SELECT
IFNULL(sum( c.amount ),0)
@@ -2165,8 +2205,9 @@
WHERE
c.del_flag = '0'
AND comp_id = 2056556421857497090
- AND c.sign_date >= #{startYear}
- AND c.sign_date < #{endYear}) tfbn,
+ AND (( c.sign_date >= #{startYear}
+ AND c.sign_date < #{endYear})
+ or c.sign_date is null)) tfbn,
(
SELECT
IFNULL(sum( c.amount ),0)
@@ -2175,8 +2216,9 @@
WHERE
c.del_flag = '0'
AND comp_id = 2056556535640576002
- AND c.sign_date >= #{startMon}
- AND c.sign_date < #{endMon}) ymjby,
+ AND ((c.sign_date >= #{startMon}
+ AND c.sign_date < #{endMon})
+ or c.sign_date is null)) ymjby,
(
SELECT
IFNULL(sum( c.amount ),0)
@@ -2185,8 +2227,9 @@
WHERE
c.del_flag = '0'
AND comp_id = 2056556535640576002
- AND c.sign_date >= #{startYear}
- AND c.sign_date < #{endYear}) ymjbn
+ AND (( c.sign_date >= #{startYear}
+ AND c.sign_date < #{endYear})
+ or c.sign_date is null)) ymjbn
</select>
<select id="pjsxywwcqkHT" resultType="com.by4cloud.platformx.business.vo.GcpbkwcqkItemVo">
SELECT
@@ -2351,4 +2394,21 @@
AND c.sign_date <= #{monend}
AND c.comp_id = 2056556421857497090
</select>
+ <select id="homeZgsColum" resultType="java.lang.String">
+ SELECT bc.province
+ FROM contract c
+ LEFT JOIN business_customer bc ON bc.id = c.party_a_id
+ WHERE bc.province IS NOT NULL
+ <if test="compIds != null and compIds.size() > 0">
+ AND c.comp_id IN
+ <foreach collection="compIds" item="id" open="(" separator="," close=")">
+ #{id}
+ </foreach>
+ </if>
+ <if test="compId!=null">
+ AND c.comp_id = #{compId}
+ </if>
+ GROUP BY bc.province;
+
+ </select>
</mapper>
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/resources/mapper/ContractOutBoundMapper.xml b/platformx-business-finance-biz/src/main/resources/mapper/ContractOutBoundMapper.xml
index 0111ff9..1bda7cf 100644
--- a/platformx-business-finance-biz/src/main/resources/mapper/ContractOutBoundMapper.xml
+++ b/platformx-business-finance-biz/src/main/resources/mapper/ContractOutBoundMapper.xml
@@ -1470,8 +1470,10 @@
and c.out_bound_time >= #{monstart}
and c.out_bound_time <= #{monend}
WHERE
- d.dict_key = 'zb-cpbk'
+ d.dict_key = 'zb-cpmc'
+ and d.comp_id = 2054377628489244673
GROUP BY
- d.dict_name, d.dict_key;
+ d.dict_name, d.dict_key
+ order by d.id;
</select>
</mapper>
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/resources/mapper/ContractSubjectMatterMapper.xml b/platformx-business-finance-biz/src/main/resources/mapper/ContractSubjectMatterMapper.xml
index 4e3804a..f32d22d 100644
--- a/platformx-business-finance-biz/src/main/resources/mapper/ContractSubjectMatterMapper.xml
+++ b/platformx-business-finance-biz/src/main/resources/mapper/ContractSubjectMatterMapper.xml
@@ -222,10 +222,11 @@
and c1.sign_date <= #{monend}
WHERE
d.dict_key = 'zb-cpmc'
- and d.comp_id = 2089995177814495234
+ and d.comp_id = 2054377628489244673
GROUP BY
d.dict_name,
- d.dict_key;
+ d.dict_key
+ order by d.id;
</select>
</mapper>
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/resources/mapper/HistoryOverdueMapper.xml b/platformx-business-finance-biz/src/main/resources/mapper/HistoryOverdueMapper.xml
index f61836c..f36d2b2 100644
--- a/platformx-business-finance-biz/src/main/resources/mapper/HistoryOverdueMapper.xml
+++ b/platformx-business-finance-biz/src/main/resources/mapper/HistoryOverdueMapper.xml
@@ -468,7 +468,7 @@
AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
AND payment_time >= #{monstart}
AND payment_time <= #{monend}
- GROUP BY bus_guest_id),0) dywcqh,
+ ),0) dywcqh,
(SELECT IFNULL(sum(receivable_amount),0)
FROM history_overdue
WHERE del_flag = '0'
@@ -476,14 +476,13 @@
AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
AND payment_time >= #{yearstart}
AND payment_time <= #{yearend}) ljwcqq,
- IFNULL((SELECT COUNT(1)
+ IFNULL((SELECT COUNT(DISTINCT bus_guest_id)
FROM history_overdue
WHERE del_flag = '0'
AND overdue_duration <= 1095
AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
AND payment_time >= #{yearstart}
AND payment_time <= #{yearend}
- GROUP BY bus_guest_id
),0) ljwcqh
UNION ALL
SELECT '鐭崇叅鏈�' dw,
@@ -496,14 +495,14 @@
AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
AND payment_time >= #{monstart}
AND payment_time <= #{monend}) dywcqq,
- IFNULL((SELECT COUNT(1)
+ IFNULL((SELECT COUNT(DISTINCT bus_guest_id)
FROM history_overdue
WHERE del_flag = '0'
AND overdue_duration > 1095
AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
AND payment_time >= #{monstart}
AND payment_time <= #{monend}
- GROUP BY bus_guest_id
+
),0) dywcqh,
(SELECT IFNULL(sum(receivable_amount),0)
FROM history_overdue
@@ -512,13 +511,13 @@
AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
AND payment_time >= #{yearstart}
AND payment_time <= #{yearend}) dljwcqq,
- IFNULL((SELECT COUNT(1)
+ IFNULL((SELECT COUNT(DISTINCT bus_guest_id)
FROM history_overdue
WHERE del_flag = '0'
AND overdue_duration > 1095
AND payment_time >= #{yearstart}
AND payment_time <= #{yearend}
- GROUP BY bus_guest_id
+
),0) ljwcqh
UNION ALL
SELECT '鐭崇叅鏈�' dw,
@@ -530,13 +529,13 @@
AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
AND payment_time >= #{monstart}
AND payment_time <= #{monend}) dywcqq,
- IFNULL( (SELECT COUNT(1)
+ IFNULL( (SELECT COUNT(DISTINCT bus_guest_id)
FROM history_overdue
WHERE del_flag = '0'
AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
AND payment_time >= #{monstart}
AND payment_time <= #{monend}
- GROUP BY bus_guest_id
+
),0) dywcqh,
(SELECT IFNULL(sum(receivable_amount),0)
FROM history_overdue
@@ -544,13 +543,13 @@
AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
AND payment_time >= #{yearstart}
AND payment_time <= #{yearend}) dljwcqq,
- IFNULL((SELECT COUNT(1)
+ IFNULL((SELECT COUNT(DISTINCT bus_guest_id)
FROM history_overdue
WHERE del_flag = '0'
AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
AND payment_time >= #{yearstart}
AND payment_time <= #{yearend}
- GROUP BY bus_guest_id
+
),0) ljwcqh
UNION ALL
SELECT '鐭冲伐娉�' dw,
@@ -563,14 +562,14 @@
AND comp_id = 2056556196124250113
AND payment_time >= #{monstart}
AND payment_time <= #{monend}) dywcqq,
- IFNULL((SELECT COUNT(1)
+ IFNULL((SELECT COUNT(DISTINCT bus_guest_id)
FROM history_overdue
WHERE del_flag = '0'
AND overdue_duration <= 1095
AND comp_id = 2056556196124250113
AND payment_time >= #{monstart}
AND payment_time <= #{monend}
- GROUP BY bus_guest_id
+
) ,0) dywcqh,
(SELECT IFNULL(sum(receivable_amount),0)
FROM history_overdue
@@ -579,14 +578,14 @@
AND overdue_duration <= 1095
AND payment_time >= #{yearstart}
AND payment_time <= #{yearend}) dljwcqq,
- IFNULL((SELECT COUNT(1)
+ IFNULL((SELECT COUNT(DISTINCT bus_guest_id)
FROM history_overdue
WHERE del_flag = '0'
AND comp_id = 2056556196124250113
AND overdue_duration <= 1095
AND payment_time >= #{yearstart}
AND payment_time <= #{yearend}
- GROUP BY bus_guest_id
+
),0) ljwcqh
UNION ALL
SELECT '鐭冲伐娉�' dw,
@@ -599,14 +598,14 @@
AND comp_id = 2056556196124250113
AND payment_time >= #{monstart}
AND payment_time <= #{monend}) dywcqq,
- IFNULL((SELECT COUNT(1)
+ IFNULL((SELECT COUNT(DISTINCT bus_guest_id)
FROM history_overdue
WHERE del_flag = '0'
AND overdue_duration > 1095
AND comp_id = 2056556196124250113
AND payment_time >= #{monstart}
AND payment_time <= #{monend}
- GROUP BY bus_guest_id
+
),0) dywcqh,
(SELECT IFNULL(sum(receivable_amount),0)
FROM history_overdue
@@ -615,14 +614,14 @@
AND comp_id = 2056556196124250113
AND payment_time >= #{yearstart}
AND payment_time <= #{yearend}) dljwcqq,
- IFNULL( (SELECT COUNT(1)
+ IFNULL( (SELECT COUNT(DISTINCT bus_guest_id)
FROM history_overdue
WHERE del_flag = '0'
AND overdue_duration > 1095
AND comp_id = 2056556196124250113
AND payment_time >= #{yearstart}
AND payment_time <= #{yearend}
- GROUP BY bus_guest_id
+
),0) ljwcqh
UNION ALL
SELECT '鐭冲伐娉�' dw,
@@ -634,13 +633,13 @@
AND comp_id = 2056556196124250113
AND payment_time >= #{monstart}
AND payment_time <= #{monend}) dywcqq,
- IFNULL((SELECT COUNT(1)
+ IFNULL((SELECT COUNT(DISTINCT bus_guest_id)
FROM history_overdue
WHERE del_flag = '0'
AND comp_id = 2056556196124250113
AND payment_time >= #{monstart}
AND payment_time <= #{monend}
- GROUP BY bus_guest_id
+
),0) dywcqh,
(SELECT IFNULL(sum(receivable_amount),0)
FROM history_overdue
@@ -648,13 +647,13 @@
AND comp_id = 2056556196124250113
AND payment_time >= #{yearstart}
AND payment_time <= #{yearend}) dljwcqq,
- IFNULL((SELECT COUNT(1)
+ IFNULL((SELECT COUNT(DISTINCT bus_guest_id)
FROM history_overdue
WHERE del_flag = '0'
AND comp_id = 2056556196124250113
AND payment_time >= #{yearstart}
AND payment_time <= #{yearend}
- GROUP BY bus_guest_id
+
),0) ljwcqh
UNION ALL
SELECT '閭㈠彴鍘�' dw,
@@ -667,14 +666,14 @@
AND comp_id = 2056556317461270529
AND payment_time >= #{monstart}
AND payment_time <= #{monend}) dywcqq,
- IFNULL( (SELECT COUNT(1)
+ IFNULL( (SELECT COUNT(DISTINCT bus_guest_id)
FROM history_overdue
WHERE del_flag = '0'
AND overdue_duration <= 1095
AND comp_id = 2056556317461270529
AND payment_time >= #{monstart}
AND payment_time <= #{monend}
- GROUP BY bus_guest_id
+
),0) dywcqh,
(SELECT IFNULL(sum(receivable_amount),0)
FROM history_overdue
@@ -683,14 +682,14 @@
AND comp_id = 2056556317461270529
AND payment_time >= #{yearstart}
AND payment_time <= #{yearend}) dljwcqq,
- IFNULL( (SELECT COUNT(1)
+ IFNULL( (SELECT COUNT(DISTINCT bus_guest_id)
FROM history_overdue
WHERE del_flag = '0'
AND overdue_duration <= 1095
AND comp_id = 2056556317461270529
AND payment_time >= #{yearstart}
AND payment_time <= #{yearend}
- GROUP BY bus_guest_id
+
),0) ljwcqh
UNION ALL
SELECT '閭㈠彴鍘�' dw,
@@ -703,14 +702,14 @@
AND comp_id = 2056556317461270529
AND payment_time >= #{monstart}
AND payment_time <= #{monend}) dywcqq,
- IFNULL( (SELECT COUNT(1)
+ IFNULL( (SELECT COUNT(DISTINCT bus_guest_id)
FROM history_overdue
WHERE del_flag = '0'
AND overdue_duration > 1095
AND comp_id = 2056556317461270529
AND payment_time >= #{monstart}
AND payment_time <= #{monend}
- GROUP BY bus_guest_id
+
) ,0) dywcqh,
(SELECT IFNULL(sum(receivable_amount),0)
FROM history_overdue
@@ -719,14 +718,14 @@
AND comp_id = 2056556317461270529
AND payment_time >= #{yearstart}
AND payment_time <= #{yearend}) dljwcqq,
- IFNULL( (SELECT COUNT(1)
+ IFNULL( (SELECT COUNT(DISTINCT bus_guest_id)
FROM history_overdue
WHERE del_flag = '0'
AND overdue_duration > 1095
AND comp_id = 2056556317461270529
AND payment_time >= #{yearstart}
AND payment_time <= #{yearend}
- GROUP BY bus_guest_id
+
),0) ljwcqh
UNION ALL
SELECT '閭㈠彴鍘�' dw,
@@ -738,13 +737,13 @@
AND comp_id = 2056556317461270529
AND payment_time >= #{monstart}
AND payment_time <= #{monend}) dywcqq,
- IFNULL((SELECT COUNT(1)
+ IFNULL((SELECT COUNT(DISTINCT bus_guest_id)
FROM history_overdue
WHERE del_flag = '0'
AND comp_id = 2056556317461270529
AND payment_time >= #{monstart}
AND payment_time <= #{monend}
- GROUP BY bus_guest_id
+
),0) dywcqh,
(SELECT IFNULL(sum(receivable_amount),0)
FROM history_overdue
@@ -752,13 +751,13 @@
AND comp_id = 2056556317461270529
AND payment_time >= #{yearstart}
AND payment_time <= #{yearend}) lqwcqq,
- IFNULL((SELECT COUNT(1)
+ IFNULL((SELECT COUNT(DISTINCT bus_guest_id)
FROM history_overdue
WHERE del_flag = '0'
AND comp_id = 2056556317461270529
AND payment_time >= #{yearstart}
AND payment_time <= #{yearend}
- GROUP BY bus_guest_id
+
),0) ljwcqh
UNION ALL
SELECT '閫氭柟鍘�' dw,
@@ -771,14 +770,14 @@
AND comp_id = 2056556421857497090
AND payment_time >= #{monstart}
AND payment_time <= #{monend}) dywcqq,
- IFNULL( (SELECT COUNT(1)
+ IFNULL( (SELECT COUNT(DISTINCT bus_guest_id)
FROM history_overdue
WHERE del_flag = '0'
AND overdue_duration <= 1095
AND comp_id = 2056556421857497090
AND payment_time >= #{monstart}
AND payment_time <= #{monend}
- GROUP BY bus_guest_id
+
),0) dywcqh,
(SELECT IFNULL(sum(receivable_amount),0)
FROM history_overdue
@@ -786,14 +785,14 @@
AND comp_id = 2056556421857497090
AND payment_time >= #{yearstart}
AND payment_time <= #{yearend}) dljwcqq,
- IFNULL((SELECT COUNT(1)
+ IFNULL((SELECT COUNT(DISTINCT bus_guest_id)
FROM history_overdue
WHERE del_flag = '0'
AND overdue_duration <= 1095
AND comp_id = 2056556421857497090
AND payment_time >= #{yearstart}
AND payment_time <= #{yearend}
- GROUP BY bus_guest_id
+
),0) ljwcqh
UNION ALL
SELECT '閫氭柟鍘�' dw,
@@ -806,14 +805,14 @@
AND comp_id = 2056556421857497090
AND payment_time >= #{monstart}
AND payment_time <= #{monend}) dywcqq,
- IFNULL((SELECT COUNT(1)
+ IFNULL((SELECT COUNT(DISTINCT bus_guest_id)
FROM history_overdue
WHERE del_flag = '0'
AND overdue_duration > 1095
AND comp_id = 2056556421857497090
AND payment_time >= #{monstart}
AND payment_time <= #{monend}
- GROUP BY bus_guest_id
+
),0) dywcqh,
(SELECT IFNULL(sum(receivable_amount),0)
FROM history_overdue
@@ -822,14 +821,14 @@
AND comp_id = 2056556421857497090
AND payment_time >= #{yearstart}
AND payment_time <= #{yearend}) dljwcqq,
- IFNULL((SELECT COUNT(1)
+ IFNULL((SELECT COUNT(DISTINCT bus_guest_id)
FROM history_overdue
WHERE del_flag = '0'
AND overdue_duration > 1095
AND comp_id = 2056556421857497090
AND payment_time >= #{yearstart}
AND payment_time <= #{yearend}
- GROUP BY bus_guest_id
+
),0) ljwcqh
UNION ALL
SELECT '閫氭柟鍘�' dw,
@@ -841,13 +840,13 @@
AND comp_id = 2056556421857497090
AND payment_time >= #{monstart}
AND payment_time <= #{monend}) dywcqq,
- IFNULL((SELECT COUNT(1)
+ IFNULL((SELECT COUNT(DISTINCT bus_guest_id)
FROM history_overdue
WHERE del_flag = '0'
AND comp_id = 2056556421857497090
AND payment_time >= #{monstart}
AND payment_time <= #{monend}
- GROUP BY bus_guest_id
+
),0) dywcqh,
(SELECT IFNULL(sum(receivable_amount),0)
FROM history_overdue
@@ -855,13 +854,13 @@
AND comp_id = 2056556421857497090
AND payment_time >= #{yearstart}
AND payment_time <= #{yearend}) dljwcqq,
- IFNULL((SELECT COUNT(1)
+ IFNULL((SELECT COUNT(DISTINCT bus_guest_id)
FROM history_overdue
WHERE del_flag = '0'
AND comp_id = 2056556421857497090
AND payment_time >= #{yearstart}
AND payment_time <= #{yearend}
- GROUP BY bus_guest_id
+
),0) ljwcqh
</select>
</mapper>
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/resources/mapper/PaymentCreditMapper.xml b/platformx-business-finance-biz/src/main/resources/mapper/PaymentCreditMapper.xml
new file mode 100644
index 0000000..6b59be0
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/resources/mapper/PaymentCreditMapper.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.by4cloud.platformx.business.mapper.PaymentCreditMapper">
+
+ <resultMap id="paymentReceiveMap" type="com.by4cloud.platformx.business.entity.PaymentCreditSale">
+ <id property="id" column="id"/>
+ <result property="compId" column="comp_id"/>
+ <result property="creditAmount" column="receive_amount"/>
+ <result property="creditDate" column="receive_date"/>
+ </resultMap>
+ <select id="genReceivePayment" resultType="java.math.BigDecimal">
+ SELECT IFNULL(sum(unit_price*(out_bound_num-advance_num-invoice_num)),0) from contract_out_bound
+ where del_flag='0'
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ </select>
+ <select id="genReceivePaymentSmj" resultType="java.math.BigDecimal">
+ SELECT IFNULL(sum(unit_price*(out_bound_num-advance_num-invoice_num)),0) from contract_out_bound
+ where del_flag='0'
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or
+ comp_id = 2101966257365045249)
+ </select>
+</mapper>
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/resources/mapper/PaymentReceiveMapper.xml b/platformx-business-finance-biz/src/main/resources/mapper/PaymentReceiveMapper.xml
index b72ea5c..812f3cd 100644
--- a/platformx-business-finance-biz/src/main/resources/mapper/PaymentReceiveMapper.xml
+++ b/platformx-business-finance-biz/src/main/resources/mapper/PaymentReceiveMapper.xml
@@ -343,4 +343,1193 @@
and credit_date >= #{monstartLastMon}
and credit_date <= #{monendLastMon}) ) a
</select>
+ <select id="zbjtjznbyszk" resultType="com.by4cloud.platformx.business.vo.JznbyszkVo">
+ SELECT
+ zgs,
+ wfyssx,
+ ( wfyssx - sx ) dfgz,
+ sx,
+ hxhtze,
+ lynjhht,
+ lywjhht
+ FROM
+ (
+ SELECT
+ '鍐�涓偂浠�' zgs,
+ ((
+ SELECT
+ IFNULL(sum( billing_amout - paid_amount ), 0 )
+ FROM
+ contract
+ WHERE
+ del_flag = '0'
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ AND billing_amout >= paid_amount
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '鍐�涓偂浠�' and party_a = branch )
+ )+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM
+ contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '鍐�涓偂浠�' AND c.party_a = branch ))
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ )) wfyssx,
+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM
+ contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '鍐�涓偂浠�' AND c.party_a = branch ))
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>) sx,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{monend}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '鍐�涓偂浠�' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) hxhtze,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date <= #{mon2after}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '鍐�涓偂浠�' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) lynjhht,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{mon2after}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '鍐�涓偂浠�' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) lywjhht
+ union all
+ SELECT
+ '宄板嘲闆嗗洟' zgs,
+ ((
+ SELECT
+ IFNULL(sum( billing_amout - paid_amount ), 0 )
+ FROM
+ contract
+ WHERE
+ del_flag = '0'
+ AND billing_amout >= paid_amount
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '宄板嘲闆嗗洟' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ )+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM
+ contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '宄板嘲闆嗗洟' AND c.party_a = branch ))
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ )) wfyssx,
+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM
+ contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '宄板嘲闆嗗洟' AND c.party_a = branch ))
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>) sx,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{monend}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '宄板嘲闆嗗洟' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) hxhtze,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date <= #{mon2after}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '宄板嘲闆嗗洟' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) lynjhht,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{mon2after}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '宄板嘲闆嗗洟' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) lywjhht
+ union all
+ SELECT
+ '閭㈢熆闆嗗洟' zgs,
+ ((
+ SELECT
+ IFNULL(sum( billing_amout - paid_amount ), 0 )
+ FROM
+ contract
+ WHERE
+ del_flag = '0'
+ AND billing_amout >= paid_amount
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '閭㈢熆闆嗗洟' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ )+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM
+ contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '閭㈢熆闆嗗洟' AND c.party_a = branch ))
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ )) wfyssx,
+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM
+ contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '閭㈢熆闆嗗洟' AND c.party_a = branch ))
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>) sx,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{monend}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '閭㈢熆闆嗗洟' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) hxhtze,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date <= #{mon2after}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '閭㈢熆闆嗗洟' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) lynjhht,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{mon2after}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '閭㈢熆闆嗗洟' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) lywjhht
+ union all
+ SELECT
+ '閭熆闆嗗洟' zgs,
+ ((
+ SELECT
+ IFNULL(sum( billing_amout - paid_amount ), 0 )
+ FROM
+ contract
+ WHERE
+ del_flag = '0'
+ AND billing_amout >= paid_amount
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '閭熆闆嗗洟' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ )+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '閭熆闆嗗洟' AND c.party_a = branch ))
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ )) wfyssx,
+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '閭熆闆嗗洟' AND c.party_a = branch ))
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>) sx,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{monend}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '閭熆闆嗗洟' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) hxhtze,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date <= #{mon2after}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '閭熆闆嗗洟' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) lynjhht,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{mon2after}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '閭熆闆嗗洟' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) lywjhht
+ union all
+ SELECT
+ '灞辫タ鍐�涓�' zgs,
+ ((
+ SELECT
+ IFNULL(sum( billing_amout - paid_amount ), 0 )
+ FROM
+ contract
+ WHERE
+ del_flag = '0'
+ AND billing_amout >= paid_amount
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '灞辫タ鍐�涓�' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ )+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '灞辫タ鍐�涓�' AND c.party_a = branch ))
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ )) wfyssx,
+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '灞辫タ鍐�涓�' AND c.party_a = branch ))
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>) sx,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{monend}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '灞辫タ鍐�涓�' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) hxhtze,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date <= #{mon2after}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '灞辫タ鍐�涓�' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) lynjhht,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{mon2after}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '灞辫タ鍐�涓�' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) lywjhht
+ union all
+ SELECT
+ '浜曠熆闆嗗洟' zgs,
+ ((
+ SELECT
+ IFNULL(sum( billing_amout - paid_amount ), 0 )
+ FROM
+ contract
+ WHERE
+ del_flag = '0'
+ AND billing_amout >= paid_amount
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '浜曠熆闆嗗洟' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ )+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '浜曠熆闆嗗洟' AND c.party_a = branch ))
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ )) wfyssx,
+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '浜曠熆闆嗗洟' AND c.party_a = branch ))
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>) sx,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{monend}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '浜曠熆闆嗗洟' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) hxhtze,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date <= #{mon2after}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '浜曠熆闆嗗洟' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) lynjhht,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{mon2after}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '浜曠熆闆嗗洟' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) lywjhht
+ union all
+ SELECT
+ '寮犵熆闆嗗洟' zgs,
+ ((
+ SELECT
+ IFNULL(sum( billing_amout - paid_amount ), 0 )
+ FROM
+ contract
+ WHERE
+ del_flag = '0'
+ AND billing_amout >= paid_amount
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '寮犵熆闆嗗洟' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ )+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '寮犵熆闆嗗洟' AND c.party_a = branch ))
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ )) wfyssx,
+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '寮犵熆闆嗗洟' AND c.party_a = branch ))
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>) sx,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{monend}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '寮犵熆闆嗗洟' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) hxhtze,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date <= #{mon2after}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '寮犵熆闆嗗洟' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) lynjhht,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{mon2after}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '寮犵熆闆嗗洟' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) lywjhht
+ union all
+ SELECT
+ '鍐�涓兘婧�' zgs,
+ ((
+ SELECT
+ IFNULL(sum( billing_amout - paid_amount ), 0 )
+ FROM
+ contract
+ WHERE
+ del_flag = '0'
+ AND billing_amout >= paid_amount
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '鍐�涓兘婧�' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ )+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '鍐�涓兘婧�' AND c.party_a = branch ))
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ )) wfyssx,
+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '鍐�涓兘婧�' AND c.party_a = branch ))
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>) sx,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{monend}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '鍐�涓兘婧�' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) hxhtze,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date <= #{mon2after}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '鍐�涓兘婧�' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) lynjhht,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{mon2after}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '鍐�涓兘婧�' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) lywjhht
+ union all
+ SELECT
+ '璁惧绉熻祦' zgs,
+ ((
+ SELECT
+ IFNULL(sum( billing_amout - paid_amount ), 0 )
+ FROM
+ contract
+ WHERE
+ del_flag = '0'
+ AND billing_amout >= paid_amount
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '璁惧绉熻祦' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ )+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '璁惧绉熻祦' AND c.party_a = branch ))
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ )) wfyssx,
+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '璁惧绉熻祦' AND c.party_a = branch ))
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>) sx,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{monend}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '璁惧绉熻祦' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) hxhtze,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date <= #{mon2after}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '璁惧绉熻祦' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) lynjhht,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{mon2after}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '璁惧绉熻祦' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) lywjhht
+ union all
+ SELECT
+ '渚涘簲閾�' zgs,
+ ((
+ SELECT
+ IFNULL(sum( billing_amout - paid_amount ), 0 )
+ FROM
+ contract
+ WHERE
+ del_flag = '0'
+ AND billing_amout >= paid_amount
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '渚涘簲閾�' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ )+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '渚涘簲閾�' AND c.party_a = branch ))
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ )) wfyssx,
+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '渚涘簲閾�' AND c.party_a = branch ))
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>) sx,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{monend}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '渚涘簲閾�' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) hxhtze,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date <= #{mon2after}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '渚涘簲閾�' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) lynjhht,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{mon2after}
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '渚涘簲閾�' and party_a = branch )
+ <if test="compId!=null">
+ AND comp_id = #{compId}
+ </if>
+ ) lywjhht
+ ) a
+ </select>
+ <select id="zbjtjznbyszkSMJ" resultType="com.by4cloud.platformx.business.vo.JznbyszkVo">
+ SELECT
+ zgs,
+ wfyssx,
+ ( wfyssx - sx ) dfgz,
+ sx,
+ hxhtze,
+ lynjhht,
+ lywjhht
+ FROM
+ (
+ SELECT
+ '鍐�涓偂浠�' zgs,
+ ((
+ SELECT
+ IFNULL(sum( billing_amout - paid_amount ), 0 )
+ FROM
+ contract
+ WHERE
+ del_flag = '0'
+ AND billing_amout >= paid_amount
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '鍐�涓偂浠�' and party_a = branch )
+ )+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '鍐�涓偂浠�' AND c.party_a = branch ))
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ )) wfyssx,
+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '鍐�涓偂浠�' AND c.party_a = branch ))
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)) sx,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{monend}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '鍐�涓偂浠�' and party_a = branch )
+ ) hxhtze,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date <= #{mon2after}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '鍐�涓偂浠�' and party_a = branch )
+ ) lynjhht,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{mon2after}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '鍐�涓偂浠�' and party_a = branch )
+ ) lywjhht
+ union all
+ SELECT
+ '宄板嘲闆嗗洟' zgs,
+ ((
+ SELECT
+ IFNULL(sum( billing_amout - paid_amount ), 0 )
+ FROM
+ contract
+ WHERE
+ del_flag = '0'
+ AND billing_amout >= paid_amount
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '宄板嘲闆嗗洟' and party_a = branch )
+ )+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '宄板嘲闆嗗洟' AND c.party_a = branch ))
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ )) wfyssx,
+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '宄板嘲闆嗗洟' AND c.party_a = branch ))
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)) sx,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{monend}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '宄板嘲闆嗗洟' and party_a = branch )
+ ) hxhtze,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date <= #{mon2after}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '宄板嘲闆嗗洟' and party_a = branch )
+ ) lynjhht,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{mon2after}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '宄板嘲闆嗗洟' and party_a = branch )
+ ) lywjhht
+ union all
+ SELECT
+ '閭㈢熆闆嗗洟' zgs,
+ ((
+ SELECT
+ IFNULL( sum( billing_amout - paid_amount ), 0 )
+ FROM
+ contract
+ WHERE
+ del_flag = '0'
+ AND billing_amout >= paid_amount
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '閭㈢熆闆嗗洟' and party_a = branch )
+ )+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '閭㈢熆闆嗗洟' AND c.party_a = branch ))
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ )) wfyssx,
+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '閭㈢熆闆嗗洟' AND c.party_a = branch ))
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)) sx,
+ ( SELECT IFNULL( sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{monend}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '閭㈢熆闆嗗洟' and party_a = branch )
+ ) hxhtze,
+ ( SELECT IFNULL( sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date <= #{mon2after}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '閭㈢熆闆嗗洟' and party_a = branch )
+ ) lynjhht,
+ ( SELECT IFNULL( sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{mon2after}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '閭㈢熆闆嗗洟' and party_a = branch )
+ ) lywjhht
+ union all
+ SELECT
+ '閭熆闆嗗洟' zgs,
+ ((
+ SELECT
+ IFNULL( sum( billing_amout - paid_amount ), 0 )
+ FROM
+ contract
+ WHERE
+ del_flag = '0'
+ AND billing_amout >= paid_amount
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '閭熆闆嗗洟' and party_a = branch )
+ )+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '閭熆闆嗗洟' AND c.party_a = branch ))
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ )) wfyssx,
+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '閭熆闆嗗洟' AND c.party_a = branch ))
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)) sx,
+ ( SELECT IFNULL( sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{monend}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '閭熆闆嗗洟' and party_a = branch )
+ ) hxhtze,
+ ( SELECT IFNULL( sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date <= #{mon2after}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '閭熆闆嗗洟' and party_a = branch )
+ ) lynjhht,
+ ( SELECT IFNULL( sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{mon2after}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '閭熆闆嗗洟' and party_a = branch )
+ ) lywjhht
+ union all
+ SELECT
+ '灞辫タ鍐�涓�' zgs,
+ ((
+ SELECT
+ IFNULL(sum( billing_amout - paid_amount ), 0 )
+ FROM
+ contract
+ WHERE
+ del_flag = '0'
+ AND billing_amout >= paid_amount
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '灞辫タ鍐�涓�' and party_a = branch )
+ )+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '灞辫タ鍐�涓�' AND c.party_a = branch ))
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ )) wfyssx,
+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '灞辫タ鍐�涓�' AND c.party_a = branch ))
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)) sx,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{monend}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '灞辫タ鍐�涓�' and party_a = branch )
+ ) hxhtze,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date <= #{mon2after}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '灞辫タ鍐�涓�' and party_a = branch )
+ ) lynjhht,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{mon2after}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '灞辫タ鍐�涓�' and party_a = branch )
+ ) lywjhht
+ union all
+ SELECT
+ '浜曠熆闆嗗洟' zgs,
+ ((
+ SELECT
+ IFNULL(sum( billing_amout - paid_amount ), 0 )
+ FROM
+ contract
+ WHERE
+ del_flag = '0'
+ AND billing_amout >= paid_amount
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '浜曠熆闆嗗洟' and party_a = branch )
+ )+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '浜曠熆闆嗗洟' AND c.party_a = branch ))
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ )) wfyssx,
+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '浜曠熆闆嗗洟' AND c.party_a = branch ))
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)) sx,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{monend}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '浜曠熆闆嗗洟' and party_a = branch )
+ ) hxhtze,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date <= #{mon2after}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '浜曠熆闆嗗洟' and party_a = branch )
+ ) lynjhht,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{mon2after}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '浜曠熆闆嗗洟' and party_a = branch )
+ ) lywjhht
+ union all
+ SELECT
+ '寮犵熆闆嗗洟' zgs,
+ ((
+ SELECT
+ IFNULL(sum( billing_amout - paid_amount ), 0 )
+ FROM
+ contract
+ WHERE
+ del_flag = '0'
+ AND billing_amout >= paid_amount
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '寮犵熆闆嗗洟' and party_a = branch )
+ )+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '寮犵熆闆嗗洟' AND c.party_a = branch ))
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ )) wfyssx,
+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '寮犵熆闆嗗洟' AND c.party_a = branch ))
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)) sx,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{monend}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '寮犵熆闆嗗洟' and party_a = branch )
+ ) hxhtze,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date <= #{mon2after}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '寮犵熆闆嗗洟' and party_a = branch )
+ ) lynjhht,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{mon2after}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '寮犵熆闆嗗洟' and party_a = branch )
+ ) lywjhht
+ union all
+ SELECT
+ '鍐�涓兘婧�' zgs,
+ ((
+ SELECT
+ IFNULL(sum( billing_amout - paid_amount ), 0 )
+ FROM
+ contract
+ WHERE
+ del_flag = '0'
+ AND billing_amout >= paid_amount
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '鍐�涓兘婧�' and party_a = branch )
+ )+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '鍐�涓兘婧�' AND c.party_a = branch ))
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ )) wfyssx,
+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '鍐�涓兘婧�' AND c.party_a = branch ))
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)) sx,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{monend}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '鍐�涓兘婧�' and party_a = branch )
+ ) hxhtze,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date <= #{mon2after}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '鍐�涓兘婧�' and party_a = branch )
+ ) lynjhht,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{mon2after}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '鍐�涓兘婧�' and party_a = branch )
+ ) lywjhht
+ union all
+ SELECT
+ '璁惧绉熻祦' zgs,
+ ((
+ SELECT
+ IFNULL(sum( billing_amout - paid_amount ), 0 )
+ FROM
+ contract
+ WHERE
+ del_flag = '0'
+ AND billing_amout >= paid_amount
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '璁惧绉熻祦' and party_a = branch )
+ )+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '璁惧绉熻祦' AND c.party_a = branch ))
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ )) wfyssx,
+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '璁惧绉熻祦' AND c.party_a = branch ))
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)) sx,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{monend}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '璁惧绉熻祦' and party_a = branch )
+ ) hxhtze,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date <= #{mon2after}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '璁惧绉熻祦' and party_a = branch )
+ ) lynjhht,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{mon2after}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '璁惧绉熻祦' and party_a = branch )
+ ) lywjhht
+ union all
+ SELECT
+ '渚涘簲閾�' zgs,
+ ((
+ SELECT
+ IFNULL(sum( billing_amout - paid_amount ), 0 )
+ FROM
+ contract
+ WHERE
+ del_flag = '0'
+ AND billing_amout >= paid_amount
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '渚涘簲閾�' and party_a = branch )
+ )+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '渚涘簲閾�' AND c.party_a = branch ))
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ )) wfyssx,
+ ( SELECT IFNULL( sum( unit_price *( out_bound_num - advance_num - invoice_num )), 0 ) FROM contract_out_bound cob
+ WHERE
+ del_flag = '0'
+ AND EXISTS (
+ SELECT
+ *
+ FROM
+ contract c
+ WHERE
+ c.del_flag = '0'
+ AND c.id = cob.contract_id
+ AND EXISTS ( SELECT * FROM jz_group_branch WHERE `group` = '渚涘簲閾�' AND c.party_a = branch ))
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)) sx,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{monend}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '渚涘簲閾�' and party_a = branch )
+ ) hxhtze,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date <= #{mon2after}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '渚涘簲閾�' and party_a = branch )
+ ) lynjhht,
+ ( SELECT IFNULL(sum( amount ), 0 ) FROM contract WHERE del_flag = '0' AND contract_status = 2 AND expiration_date >= #{mon2after}
+ AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249)
+ AND EXISTS (SELECT * from jz_group_branch where `group` = '渚涘簲閾�' and party_a = branch )
+ ) lywjhht
+ ) a
+ </select>
</mapper>
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/resources/mapper/PaymentSlipMapper.xml b/platformx-business-finance-biz/src/main/resources/mapper/PaymentSlipMapper.xml
index 9da9f3a..aceedd0 100644
--- a/platformx-business-finance-biz/src/main/resources/mapper/PaymentSlipMapper.xml
+++ b/platformx-business-finance-biz/src/main/resources/mapper/PaymentSlipMapper.xml
@@ -532,6 +532,15 @@
ps.del_flag = '0'
AND ps.payment_time >= CURDATE()
AND ps.payment_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )
+ <if test="compIds != null and compIds.size() > 0">
+ AND ps.comp_id IN
+ <foreach collection="compIds" item="id" open="(" separator="," close=")">
+ #{id}
+ </foreach>
+ </if>
+ <if test="compId!=null">
+ AND ps.comp_id = #{compId}
+ </if>
) AS br,
(
SELECT
@@ -542,6 +551,15 @@
ps.del_flag = '0'
AND ps.payment_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' )
AND ps.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )
+ <if test="compIds != null and compIds.size() > 0">
+ AND ps.comp_id IN
+ <foreach collection="compIds" item="id" open="(" separator="," close=")">
+ #{id}
+ </foreach>
+ </if>
+ <if test="compId!=null">
+ AND ps.comp_id = #{compId}
+ </if>
) AS bm,
(
SELECT
@@ -552,6 +570,15 @@
ps.del_flag = '0'
AND ps.payment_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' )
AND ps.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )
+ <if test="compIds != null and compIds.size() > 0">
+ AND ps.comp_id IN
+ <foreach collection="compIds" item="id" open="(" separator="," close=")">
+ #{id}
+ </foreach>
+ </if>
+ <if test="compId!=null">
+ AND ps.comp_id = #{compId}
+ </if>
) AS bn
</select>
<select id="zbjtIndicatorTrend" resultType="com.by4cloud.platformx.business.vo.ZbjtIndicatorTrendVo">
diff --git a/platformx-business-finance-biz/src/main/resources/mapper/ZbStatisticCpXssrMapper.xml b/platformx-business-finance-biz/src/main/resources/mapper/ZbStatisticCpXssrMapper.xml
new file mode 100644
index 0000000..4df624f
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/resources/mapper/ZbStatisticCpXssrMapper.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.by4cloud.platformx.business.mapper.ZbStatisticCpXssrMapper">
+
+ <resultMap id="zbStatisticCpXssrMap" type="com.by4cloud.platformx.business.entity.ZbStatisticCpXssr">
+ <id property="id" column="id"/>
+ <result property="compId" column="comp_id"/>
+ <result property="cpmc" column="cpmc"/>
+ <result property="dyxsl" column="dyxsl"/>
+ <result property="dyxssr" column="dyxssr"/>
+ <result property="ljxsl" column="ljxsl"/>
+ <result property="ljxssr" column="ljxssr"/>
+ <result property="qnljxsl" column="qnljxsl"/>
+ <result property="qnljxssr" column="qnljxssr"/>
+ <result property="statYm" column="stat_ym"/>
+ <result property="tqbxsl" column="tqbxsl"/>
+ <result property="tqbxssr" column="tqbxssr"/>
+ </resultMap>
+</mapper>
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/resources/mapper/ZbStatisticCpXzhtMapper.xml b/platformx-business-finance-biz/src/main/resources/mapper/ZbStatisticCpXzhtMapper.xml
new file mode 100644
index 0000000..b05b9cf
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/resources/mapper/ZbStatisticCpXzhtMapper.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.by4cloud.platformx.business.mapper.ZbStatisticCpXzhtMapper">
+
+ <resultMap id="zbStatisticCpXzhtMap" type="com.by4cloud.platformx.business.entity.ZbStatisticCpXzht">
+ <id property="id" column="id"/>
+ <result property="compId" column="comp_id"/>
+ <result property="cpmc" column="cpmc"/>
+ <result property="dyxsl" column="dyxsl"/>
+ <result property="dyxssr" column="dyxssr"/>
+ <result property="ljxsl" column="ljxsl"/>
+ <result property="ljxssr" column="ljxssr"/>
+ <result property="qnljxsl" column="qnljxsl"/>
+ <result property="qnljxssr" column="qnljxssr"/>
+ <result property="statYm" column="stat_ym"/>
+ <result property="tqbxsl" column="tqbxsl"/>
+ <result property="tqbxssr" column="tqbxssr"/>
+ </resultMap>
+</mapper>
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/resources/mapper/ZbStatisticCpbkMapper.xml b/platformx-business-finance-biz/src/main/resources/mapper/ZbStatisticCpbkMapper.xml
new file mode 100644
index 0000000..d031b2e
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/resources/mapper/ZbStatisticCpbkMapper.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.by4cloud.platformx.business.mapper.ZbStatisticCpbkMapper">
+
+ <resultMap id="zbStatisticCpbkMap" type="com.by4cloud.platformx.business.entity.ZbStatisticCpbk">
+ <id property="id" column="id"/>
+ <result property="bkmc" column="bkmc"/>
+ <result property="bnzb" column="bnzb"/>
+ <result property="compId" column="comp_id"/>
+ <result property="dyjh" column="dyjh"/>
+ <result property="dywc" column="dywc"/>
+ <result property="ljwc" column="ljwc"/>
+ <result property="ntqb" column="ntqb"/>
+ <result property="statYm" column="stat_ym"/>
+ <result property="xm" column="xm"/>
+ <result property="ytqb" column="ytqb"/>
+ <result property="ztqb" column="ztqb"/>
+ </resultMap>
+</mapper>
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/resources/mapper/ZbStatisticXszbMapper.xml b/platformx-business-finance-biz/src/main/resources/mapper/ZbStatisticXszbMapper.xml
new file mode 100644
index 0000000..c594976
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/resources/mapper/ZbStatisticXszbMapper.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.by4cloud.platformx.business.mapper.ZbStatisticXszbMapper">
+
+ <resultMap id="zbStatisticXszbMap" type="com.by4cloud.platformx.business.entity.ZbStatisticXszb">
+ <id property="id" column="id"/>
+ <result property="compId" column="comp_id"/>
+ <result property="dw" column="dw"/>
+ <result property="dyjh" column="dyjh"/>
+ <result property="dywc" column="dywc"/>
+ <result property="ljjh" column="ljjh"/>
+ <result property="ljwc" column="ljwc"/>
+ <result property="ndjh" column="ndjh"/>
+ <result property="njhwc" column="njhwc"/>
+ <result property="ntqb" column="ntqb"/>
+ <result property="sort" column="sort"/>
+ <result property="statYm" column="stat_ym"/>
+ <result property="xm" column="xm"/>
+ <result property="yjhwc" column="yjhwc"/>
+ <result property="ytqb" column="ytqb"/>
+ </resultMap>
+</mapper>
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/resources/mapper/ZbStatisticZdgzMapper.xml b/platformx-business-finance-biz/src/main/resources/mapper/ZbStatisticZdgzMapper.xml
new file mode 100644
index 0000000..dfd28be
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/resources/mapper/ZbStatisticZdgzMapper.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.by4cloud.platformx.business.mapper.ZbStatisticZdgzMapper">
+
+ <resultMap id="zbStatisticZdgzMap" type="com.by4cloud.platformx.business.entity.ZbStatisticZdgz">
+ <id property="id" column="id"/>
+ <result property="compId" column="comp_id"/>
+ <result property="dw" column="dw"/>
+ <result property="dyjh" column="dyjh"/>
+ <result property="dywc" column="dywc"/>
+ <result property="ljjh" column="ljjh"/>
+ <result property="ljwc" column="ljwc"/>
+ <result property="ndjh" column="ndjh"/>
+ <result property="njhwc" column="njhwc"/>
+ <result property="ntqb" column="ntqb"/>
+ <result property="statYm" column="stat_ym"/>
+ <result property="xm" column="xm"/>
+ <result property="yjhwc" column="yjhwc"/>
+ </resultMap>
+</mapper>
\ No newline at end of file
diff --git a/platformx-business-finance-biz/src/main/resources/mapper/ZbStatisticZxywMapper.xml b/platformx-business-finance-biz/src/main/resources/mapper/ZbStatisticZxywMapper.xml
new file mode 100644
index 0000000..c7081d4
--- /dev/null
+++ b/platformx-business-finance-biz/src/main/resources/mapper/ZbStatisticZxywMapper.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.by4cloud.platformx.business.mapper.ZbStatisticZxywMapper">
+
+ <resultMap id="zbStatisticZxywMap" type="com.by4cloud.platformx.business.entity.ZbStatisticZxyw">
+ <id property="id" column="id"/>
+ <result property="compId" column="comp_id"/>
+ <result property="dw" column="dw"/>
+ <result property="dywc" column="dywc"/>
+ <result property="lb" column="lb"/>
+ <result property="ljtb" column="ljtb"/>
+ <result property="ljtqb" column="ljtqb"/>
+ <result property="ljwc" column="ljwc"/>
+ <result property="qntq" column="qntq"/>
+ <result property="qnwc" column="qnwc"/>
+ <result property="statYm" column="stat_ym"/>
+ <result property="ytb" column="ytb"/>
+ <result property="ytqb" column="ytqb"/>
+ <result property="yw" column="yw"/>
+ </resultMap>
+</mapper>
\ No newline at end of file
--
Gitblit v1.9.1