Эх сурвалжийг харах

计量- 修改审计单已累计审批进度款计算方式,开放截至本期已累计审核进度款手动填写

qianxb 2 сар өмнө
parent
commit
fcfda7a3f4

+ 4 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -77,6 +77,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.annotation.Resource;
 import javax.imageio.ImageIO;
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
@@ -92,7 +93,10 @@ import java.nio.file.StandardCopyOption;
 import java.text.SimpleDateFormat;
 import java.util.List;
 import java.util.*;
+import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;

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

@@ -1424,7 +1424,13 @@ public class TaskController extends BladeController {
                                     //获取本期之前所有计量期金额
                                     if (task.getMeterTaskType() == 1) {
                                         //中间计量
-                                        beforeMoney = contractMeterPeriodMapper.getBeforeMoney(periodVO);
+                                        //是第一期。则获取开工计量已审批的金额
+                                        if (periodVO.getId().equals(contractMeterPeriodMapper.getFirst(periodVO.getContractId()))){
+                                            periodVO.setType(3);
+                                            beforeMoney = meterPeriodMapper.getBeforeMoney(periodVO);
+                                        }else {
+                                            beforeMoney = contractMeterPeriodMapper.getBeforeMoney(periodVO);
+                                        }
                                     } else if (task.getMeterTaskType() == 2 || task.getMeterTaskType() == 3) {
                                         //材料计量,开工计量
                                         beforeMoney = meterPeriodMapper.getBeforeMoney(periodVO);
@@ -4384,7 +4390,7 @@ public class TaskController extends BladeController {
 //        strings.add("意见发出日期:");
 //        strings.add("申请进度款摘录_摘录人_时间");
         strings.add("造价机构现场咨询意见_截止上期已累计审批进度款(元)");
-        strings.add("造价机构现场咨询意见_截止上期已累计审批进度款(元)_截止本期已累计审核进度款(元)");
+//        strings.add("造价机构现场咨询意见_截止上期已累计审批进度款(元)_截止本期已累计审核进度款(元)");
         strings.add("造价机构现场咨询意见_现场造价人员");
         strings.add("造价机构现场咨询意见_现场造价人员_负责人");
         strings.add("建设单位签收");

+ 3 - 0
blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/ContractMeterPeriodMapper.java

@@ -48,4 +48,7 @@ public interface ContractMeterPeriodMapper extends BaseMapper<ContractMeterPerio
     String getContractNumber(@Param("contractId") Long contractId);
 
     PeriodVO getById(@Param("id") String formDataId);
+
+    //获取第一期合同计量期
+    Long getFirst(@Param("contractId") Long contractId);
 }

+ 7 - 0
blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/ContractMeterPeriodMapper.xml

@@ -58,6 +58,13 @@
     <select id="getById" resultType="org.springblade.meter.vo.PeriodVO">
         select id ,project_id,contract_id,sort from s_contract_meter_period where id = #{id}
     </select>
+    <select id="getFirst" resultType="java.lang.Long">
+        select id
+        from s_contract_meter_period
+        WHERE contract_id = #{contractId} and is_deleted = 0
+        ORDER BY start_date
+        limit 1
+    </select>
 
 
 </mapper>

+ 7 - 0
blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/MeterPeriodMapper.xml

@@ -103,6 +103,13 @@
             where  project_id = #{period.projectId} and contract_id = #{period.contractId}
             and type = #{period.type} and approve_status = 2 and sort &lt; #{period.sort})
         </if>
+        <if test="period.type == 3">
+            select sum(meter_money) from s_start_pay_meter_form
+            where is_deleted = 0  and meter_period_id in
+            (select id from s_meter_period
+            where  project_id = #{period.projectId} and contract_id = #{period.contractId}
+            and type = 2 and approve_status = 2)
+        </if>
     </select>