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

修改合作商户开票总额

LiFei 5 лет назад
Родитель
Сommit
dda33b8b81

+ 8 - 4
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwpayment/controller/HlwPaymentController.java

@@ -122,19 +122,22 @@ public class HlwPaymentController extends JeecgController<HlwPayment, IHlwPaymen
         Double sumTaxPayment = 0.00;
         Double personalTaxPayment = 0.00;
         int paymentNumber = 0;
+        for (int i = 0; i < pageList.getRecords().size(); i++) {
+            pageList.getRecords().get(i).setPersonalNetPayment(businessAccountUtils.add( pageList.getRecords().get(i).getAmount(), pageList.getRecords().get(i).getServiceFeeFlow()));
+        }
         if (list.size() > 0) {
             for (int i = 0; i < list.size(); i++) {
                 paymentNumber = paymentNumber + list.get(i).getPaymentNumber();
-                sumNetPayment = businessAccountUtils.add(sumNetPayment, list.get(i).getPersonalNetPayment());
-                personalTaxPayment = businessAccountUtils.add(personalTaxPayment, businessAccountUtils.round(businessAccountUtils.mul(businessAccountUtils.div(list.get(i).getPersonalNetPayment(), 1.06), 0.06), 2));
-                sumTaxPayment = businessAccountUtils.add(sumTaxPayment, businessAccountUtils.round(businessAccountUtils.mul(businessAccountUtils.div(list.get(i).getPersonalNetPayment(), 1.06), 0.06), 2));
+                sumNetPayment = businessAccountUtils.add(sumNetPayment, businessAccountUtils.add(list.get(i).getAmount(),list.get(i).getServiceFeeFlow()));
+                personalTaxPayment = businessAccountUtils.add(personalTaxPayment, businessAccountUtils.round(businessAccountUtils.mul(businessAccountUtils.div(businessAccountUtils.add(list.get(i).getAmount(),list.get(i).getServiceFeeFlow()), 1.06), 0.06), 2));
+                sumTaxPayment = businessAccountUtils.add(sumTaxPayment, businessAccountUtils.round(businessAccountUtils.mul(businessAccountUtils.div(businessAccountUtils.add(list.get(i).getAmount(),list.get(i).getServiceFeeFlow()), 1.06), 0.06), 2));
             }
             pageList.getRecords().get(0).setSumNetPayment(sumNetPayment);
             pageList.getRecords().get(0).setSumTaxPayment(sumTaxPayment);
             pageList.getRecords().get(0).setSumCompanyNumber(list.size());
             pageList.getRecords().get(0).setSumPaymentNumber(paymentNumber);
             for (int i = 0; i < pageList.getRecords().size(); i++) {
-                pageList.getRecords().get(i).setPersonalTaxPayment(businessAccountUtils.round(businessAccountUtils.mul(businessAccountUtils.div(pageList.getRecords().get(i).getPersonalNetPayment(), 1.06), 0.06), 2));
+                pageList.getRecords().get(i).setPersonalTaxPayment(businessAccountUtils.round(businessAccountUtils.mul(businessAccountUtils.div(businessAccountUtils.add( pageList.getRecords().get(i).getAmount(), pageList.getRecords().get(i).getServiceFeeFlow()), 1.06), 0.06), 2));
             }
         }
         return Result.ok(pageList);
@@ -554,6 +557,7 @@ public class HlwPaymentController extends JeecgController<HlwPayment, IHlwPaymen
         int paymentNumber = 0;
         if (hwPaymentList.size() > 0) {
             for (int i = 0; i < hwPaymentList.size(); i++) {
+                hwPaymentList.get(i).setPersonalNetPayment(businessAccountUtils.add(hwPaymentList.get(i).getAmount(),hwPaymentList.get(i).getServiceFeeFlow()));
                 personalTaxPayment = businessAccountUtils.add(personalTaxPayment, businessAccountUtils.round(businessAccountUtils.mul(businessAccountUtils.div(hwPaymentList.get(i).getPersonalNetPayment(), 1.06), 0.06), 2));
                 hwPaymentList.get(i).setPersonalTaxPayment(personalTaxPayment);
             }

+ 5 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwpayment/entity/HlwPayment.java

@@ -355,4 +355,9 @@ public class HlwPayment implements Serializable {
     @ApiModelProperty(value = "需求时间")
     private java.util.Date requirementTime;
 
+    @TableField(exist = false)
+    private Double amount;
+
+    @TableField(exist = false)
+    private Double serviceFeeFlow;
 }

+ 14 - 6
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwpayment/mapper/xml/HlwPaymentMapper.xml

@@ -153,14 +153,16 @@
 		hc.duty_paragraph AS "dutyParagraph",
 		hc.province_city_country as "provinceCityCountry",
 		count(a.id) as "paymentNumber",
-		sum(a.total_payment) as "personalNetPayment"
+		sum(haf.amount) as "amount",
+		sum(haf.service_fee) as "serviceFeeFlow"
 		FROM hlw_payment a
 		left join hlw_company hc on hc.id=a.company_id
+		inner join hlw_subcontractor_account_flow haf on haf.payment_id=a.id and haf.type=0
 		inner join hlw_cp_setting hce
 		<where>
 			${ew.sqlSegment}
 			and (a.status = 2 or a.status = 3)
-			and is_through_platform=0
+			and a.is_through_platform=0
 			<if test="hlwPayment.subcontractorId != null and hlwPayment.subcontractorId !=''">
 				and a.subcontractor_id = #{hlwPayment.subcontractorId}
 			</if>
@@ -185,8 +187,10 @@
 		hce.duty_paragraph AS "dutyParagraph",
 		hce.province_city_country as "provinceCityCountry",
 		count(a.id) as "paymentNumber",
-		sum(a.total_payment) as "personalNetPayment"
+		sum(haf.amount) as "amount",
+		sum(haf.service_fee) as "serviceFeeFlow"
 		FROM hlw_payment a
+		inner join hlw_subcontractor_account_flow haf on haf.payment_id=a.id and haf.type=0
 		inner join hlw_cp_setting hce
 		<where>
 			${ew.sqlSegment}
@@ -234,14 +238,16 @@
 		hc.duty_paragraph AS "dutyParagraph",
 		hc.province_city_country as "provinceCityCountry",
 		count(a.id) as "paymentNumber",
-		sum(a.total_payment) as "personalNetPayment"
+		sum(haf.amount) as "amount",
+		sum(haf.service_fee) as "serviceFeeFlow"
 		FROM hlw_payment a
 		left join hlw_company hc on hc.id=a.company_id
+		inner join hlw_subcontractor_account_flow haf on haf.payment_id=a.id and haf.type=0
 		inner join hlw_cp_setting hce
 		<where>
 			${ew.sqlSegment}
 			and (a.status = 2 or a.status = 3)
-			and is_through_platform=0
+			and a.is_through_platform=0
 			<if test="hlwPayment.subcontractorId != null and hlwPayment.subcontractorId !=''">
 				and a.subcontractor_id = #{hlwPayment.subcontractorId}
 			</if>
@@ -266,8 +272,10 @@
 		hce.duty_paragraph AS "dutyParagraph",
 		hce.province_city_country as "provinceCityCountry",
 		count(a.id) as "paymentNumber",
-		sum(a.total_payment) as "personalNetPayment"
+		sum(haf.amount) as "amount",
+		sum(haf.service_fee) as "serviceFeeFlow"
 		FROM hlw_payment a
+		inner join hlw_subcontractor_account_flow haf on haf.payment_id=a.id and haf.type=0
 		inner join hlw_cp_setting hce
 		<where>
 			${ew.sqlSegment}