Browse Source

计量-中间计量申请上报总金额

qianxb 2 tháng trước cách đây
mục cha
commit
f81d6148e4

+ 1 - 1
blade-service/blade-meter/src/main/java/org/springblade/meter/controller/TaskController.java

@@ -1350,7 +1350,7 @@ public class TaskController extends BladeController {
                 //实时查询上报总金额
                 if (task.getMeterTaskType() == 1) {
                     //中间计量
-                    reportAllMoney = middleMeterApplyTaskMapper.selectAllMoney(task.getId());
+                    reportAllMoney = middleMeterApplyTaskMapper.selectAllMoney(Long.valueOf(task.getContractId()),Long.valueOf(task.getFormDataId()));
                 } else if (task.getMeterTaskType() == 2) {
                     //材料计量
                     reportAllMoney = materialMeterFormTaskMapper.selectAllMoney(task.getId());

+ 7 - 6
blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/MiddleMeterApplyMapper.xml

@@ -222,12 +222,12 @@
 <!--    </select>-->
 
     <select id="getCurrentMeterMoney" resultType="java.math.BigDecimal">
-        select ifnull(sum(current_period_pay),0)
-        from s_interim_pay_certificate_item where  chapter_seq='小计' and is_deleted = 0
-                and certificate_id =
-                (select id from s_interim_pay_certificate
-                    WHERE contract_id = #{contractId} and contract_period_id = #{contractPeriodId} and is_deleted = 0
-                )
+        select current_period_pay
+        from s_interim_pay_certificate_item where  chapter_seq='实际支付' and is_deleted = 0
+                                              and certificate_id =
+                                                  (select id from s_interim_pay_certificate
+                                                   WHERE contract_id = #{contractId} and contract_period_id = #{contractPeriodId} and is_deleted = 0
+                                                  )
     </select>
 
 
@@ -462,4 +462,5 @@
     </select>
 
 
+
 </mapper>

+ 1 - 1
blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/MiddleMeterApplyTaskMapper.java

@@ -8,5 +8,5 @@ import java.math.BigDecimal;
 
 public interface MiddleMeterApplyTaskMapper extends BaseMapper<MiddleMeterApplyTask> {
 
-    BigDecimal selectAllMoney(@Param("taskId") Long id);
+    BigDecimal selectAllMoney(@Param("contractId") Long contractId,@Param("contractPeriodId") Long contractPeriodId);
 }

+ 10 - 1
blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/MiddleMeterApplyTaskMapper.xml

@@ -2,7 +2,16 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.springblade.meter.mapper.MiddleMeterApplyTaskMapper">
 
+<!--    <select id="selectAllMoney" resultType="java.math.BigDecimal">-->
+<!--        select sum(meter_money) from s_middle_meter_apply_task where is_deleted = 0 and task_id = #{taskId}-->
+<!--    </select>-->
+
     <select id="selectAllMoney" resultType="java.math.BigDecimal">
-        select sum(meter_money) from s_middle_meter_apply_task where is_deleted = 0 and task_id = #{taskId}
+        select current_period_pay
+        from s_interim_pay_certificate_item where  chapter_seq='实际支付' and is_deleted = 0
+                                              and certificate_id =
+                                                  (select id from s_interim_pay_certificate
+                                                   WHERE contract_id = #{contractId} and contract_period_id = #{contractPeriodId} and is_deleted = 0
+                                                  )
     </select>
 </mapper>