huangtf 7 달 전
부모
커밋
b6e10c36a2

+ 3 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/ChangeToken.java

@@ -49,4 +49,7 @@ public class ChangeToken {
     @ApiModelProperty(value = "变更令申请金额")
     private BigDecimal totalChangeMoney;
 
+    @ApiModelProperty(value = "章节号")
+    private String chapterNumber;
+
 }

+ 2 - 1
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/MeterInfo.java

@@ -31,5 +31,6 @@ public class MeterInfo {
     List<Material> materialsAll;
     /**合同段所有开工预付款信息*/
     List<StartPayForm> startPayFormAll;
-
+    /*变更令,按照计量清单*/
+    List<ChangeToken> changeTokenList;
 }

+ 20 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/formula/impl/ExecutorInit.java

@@ -90,8 +90,13 @@ public class ExecutorInit extends FormulaExecutor {
 
         //变更令部分
         List<ChangeToken> changeTokenList = changeTokenFc.apply(tec.getContractId());
+        tec.meterInfo.setChangeTokenList(changeTokenList) ;
+        if (changeTokenList.size() > 0) {
+            List<ChangeToken> changeTokenList0 = getFilteredChangeTokens(changeTokenList,tec.periodInfo,0);
+            List<ChangeToken> changeTokenList1 = getFilteredChangeTokens(changeTokenList,tec.periodInfo,1);
+            System.out.println();
+        }
 
-        //List<ChangeToken> changeTokenList1 = getFilteredChangeTokens(changeTokenList,tec.periodInfo,0);
 
         /*每页内容都一样*/
         tec.getRepeatKeys().addAll(periodMap.keySet());
@@ -116,6 +121,20 @@ public class ExecutorInit extends FormulaExecutor {
     }
 
 
+    /**
+     * type=0 返回本期
+     *  periodInfo.startDate   <  changeApprovalDate <= periodInfo.endDate  的changeTokenList
+     *
+     * type=1 返回上期末
+     *  changeApprovalDate < periodInfo.startDate 的changeTokenList
+     *
+     * type=2 返回本期末
+     * changeApprovalDate <= periodInfo.startDate  的changeTokenList
+     * @param changeTokenList
+     * @param periodInfo
+     * @param type
+     * @return
+     */
     public  List<ChangeToken> getFilteredChangeTokens(List<ChangeToken> changeTokenList, MeterPeriodInfo periodInfo, int type) {
         switch (type) {
             case 0:

+ 2 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/service/IFormulaDao.java

@@ -33,8 +33,8 @@ public interface IFormulaDao {
     Function<Long,List<MeterApply>>  getMeterApplyFc();
     /**获取清表映射地址*/
     Function<List<String>, List<Map<String,Object>>>  getTableExcelInfoFc();
-
+    /**获取变更令*/
     Function<Long, List<ChangeTokenForm>> getChangeTokenFormFc();
-
+    /**获取变更令,按照每条清单*/
     Function<Long, List<ChangeToken>> getChangeTokenFc();
 }

+ 3 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaDaoImpl.java

@@ -185,8 +185,9 @@ public class FormulaDaoImpl implements IFormulaDao {
     @Override
     public Function<Long, List<ChangeToken>> getChangeTokenFc() {
         return  contractId->{
-            String sql="SELECT sctf.change_number, sctf.business_date, sctf.change_money as total_change_money, sctf.change_approval_date, scti.id, scti.change_token_id, scti.form_number, scti.change_money FROM s_change_token_form sctf " +
-                    "INNER JOIN s_change_token_inventory scti ON sctf.id = scti.change_token_id WHERE sctf.is_deleted = 0 AND sctf.approve_status = 2 AND scti.is_deleted = 0 AND sctf.contract_id =  "+contractId + " order by scti.change_token_id";
+            String sql="SELECT sctf.change_number, sctf.business_date, sctf.change_money as total_change_money, sctf.change_approval_date, scti.id, scti.change_token_id, scti.form_number, scti.change_money ,scif.chapter_number FROM s_change_token_form sctf " +
+                    "INNER JOIN s_change_token_inventory scti ON sctf.id = scti.change_token_id " +
+                    "INNER JOIN s_contract_inventory_form scif ON scti.contract_form_id = scif.id WHERE sctf.is_deleted = 0 AND sctf.approve_status = 2 AND scti.is_deleted = 0 AND sctf.contract_id =  "+contractId + " order by scti.change_token_id";
             return getEntityList(sql,ChangeToken.class);
         };
     }