Browse Source

BUG修复

huangjn 3 năm trước cách đây
mục cha
commit
837b9e25c3

+ 3 - 2
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/MaterialProgressVO.java

@@ -200,8 +200,9 @@ public class MaterialProgressVO {
             this.title = title;
             this.amount = amount;
             this.successAmount = successAmount;
-            if(successAmount != 0L && amount > 0){
-                this.ratio = new BigDecimal(successAmount.toString()).divide(new BigDecimal(amount.toString()), 0, BigDecimal.ROUND_HALF_UP);
+            if(amount > 0){
+                this.ratio = new BigDecimal(successAmount.toString()).divide(new BigDecimal(amount.toString()), 4, BigDecimal.ROUND_HALF_UP);
+                this.ratio = this.ratio.multiply(new BigDecimal("100")).setScale(2, BigDecimal.ROUND_HALF_UP);
             } else {
                 this.ratio = new BigDecimal("0");
             }

+ 3 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/NeiWaiYeProgressVO.java

@@ -49,6 +49,9 @@ public class NeiWaiYeProgressVO {
 
             double result2 = Double.parseDouble(String.valueOf(new BigDecimal(waiYeSuccessAmount.toString()).divide(new BigDecimal(amount.toString()), 2, BigDecimal.ROUND_HALF_UP)));
             this.waiYeRatio = result2 > -1 ? result2 * 100 : 0;
+        } else {
+            this.neiYeRatio = 0.00;
+            this.waiYeRatio = 0.00;
         }
     }
 

+ 9 - 2
blade-service/blade-business/src/main/java/org/springblade/business/controller/ConstructionLedgerController.java

@@ -1,8 +1,6 @@
 package org.springblade.business.controller;
 
 import cn.hutool.core.date.DateUtil;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
 import io.swagger.annotations.*;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import lombok.AllArgsConstructor;
@@ -164,6 +162,15 @@ public class ConstructionLedgerController extends BladeController {
 			vos.setDetectionTimeStr(DateUtil.format(vos.getSiteEndTime(), "yyyy-MM-dd"));
 			vos.setDetectionStartTimeValue(DateUtil.format(vos.getDetectionStartTime(), "yyyy-MM-dd"));
 			vos.setDetectionEndTimeValue(DateUtil.format(vos.getDetectionEndTime(), "yyyy-MM-dd"));
+
+			if(StringUtils.isNotEmpty(vos.getSiteTimeStr()) &&
+					StringUtils.isNotEmpty(vos.getDetectionTimeStr()) &&
+					StringUtils.isNotEmpty(vos.getDetectionStartTimeValue()) &&
+					StringUtils.isNotEmpty(vos.getDetectionEndTimeValue())){
+
+				vos.setSiteTimeStr(vos.getSiteTimeStr() + "~" + vos.getDetectionTimeStr());
+				vos.setDetectionTimeStr(vos.getDetectionStartTimeValue() + "~" + vos.getDetectionEndTimeValue());
+			}
 		});
 
 		return R.data(voiPage);

+ 7 - 9
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -1099,10 +1099,13 @@ public class InformationWriteQueryController extends BladeController {
 		String nodeName = StringUtils.isNotEmpty(removeNode.getFullName()) ? removeNode.getFullName() : removeNode.getDeptName() + "," + removeNodeList.stream().map(wbs -> StringUtils.isNotEmpty(wbs.getFullName()) ? wbs.getFullName() : wbs.getDeptName()).collect(Collectors.joining());
 
 		//获取当前节点下所有填报节点
-		List<QueryProcessDataVO> queryProcess = this.informationQueryService.queryProcessDataByParentIdAndContractId(removeNode.getId().toString(), 1, removeNode.getContractId());
-		if(queryProcess == null || queryProcess.size() == 0){
-			//填报节点
-			queryProcess = this.informationQueryService.queryProcessDataByPrimaryKeyIdAndClassify(removeNode.getPKeyId().toString(), 1);
+		List<QueryProcessDataVO> queryProcess = new ArrayList<>();
+		if(!Arrays.asList("1,2,3,4".split(",")).contains(removeNode.getMajorDataType().toString())){
+			queryProcess = this.informationQueryService.queryProcessDataByParentIdAndContractId(removeNode.getId().toString(), 1, removeNode.getContractId());
+			if(queryProcess == null || queryProcess.size() == 0){
+				//填报节点
+				queryProcess = this.informationQueryService.queryProcessDataByPrimaryKeyIdAndClassify(removeNode.getPKeyId().toString(), 1);
+			}
 		}
 
 		if(queryProcess != null && queryProcess.size() > 0){
@@ -1346,11 +1349,6 @@ public class InformationWriteQueryController extends BladeController {
 				//还有子级,继续向下
 				this.foreachQueryChild(childs, childList);
 			}
-			//查询这个节点下是否存在表格数据
-			List<WbsTreePrivate> exlTables = this.wbsTreePrivateClient.queryExcelTableByParentId(parent);
-			if(exlTables != null && exlTables.size() > 0){
-				childList.addAll(exlTables);
-			}
 		});
 	}
 

+ 33 - 40
blade-service/blade-business/src/main/java/org/springblade/business/controller/MaterialProgressController.java

@@ -101,7 +101,7 @@ public class MaterialProgressController extends BladeController {
 
             }
         }
-        return R.data(300, null, "未找到数据");
+        return R.data(200, null, "未找到数据");
     }
 
     private void countAmount(List<WbsTreeContractTreeVOS> nodeResult, List<QueryProcessDataVO> queryDataResult, String contractId, MaterialProgressVO reVO){
@@ -210,48 +210,38 @@ public class MaterialProgressController extends BladeController {
                     }
                 }
                 if(countTypeList.size() > 0){
-                    //判断数量
-                    AtomicInteger imageAmount = new AtomicInteger();
-                    AtomicInteger videoAmount = new AtomicInteger();
-                    countTypeList.forEach(type -> {
-                        switch (type) {
-                            case 1:
-                                videoAmount.getAndIncrement();
-                                break;
-                            case 2:
-                                imageAmount.getAndIncrement();
-                                break;
-                        }
-                    });
-                    reVO.setContractImageClassificationList(countTypeList.size(), imageAmount.get(), videoAmount.get());
-
+                    this.setContractImageClassificationList(countTypeList, reVO);
                     return R.data(reVO);
                 }
             }
         } else {
             List<Integer> fileTypes = this.imageClassificationFileService.queryCurrentContractImageFileType(contractId);
             if(fileTypes != null && fileTypes.size() > 0){
-                //判断数量
-                AtomicInteger imageAmount = new AtomicInteger();
-                AtomicInteger videoAmount = new AtomicInteger();
-                fileTypes.forEach(type -> {
-                    switch (type) {
-                        case 1:
-                            videoAmount.getAndIncrement();
-                            break;
-                        case 2:
-                            imageAmount.getAndIncrement();
-                            break;
-                    }
-                });
-                reVO.setContractImageClassificationList(fileTypes.size(), imageAmount.get(), videoAmount.get());
-
+                //设置数据
+                this.setContractImageClassificationList(fileTypes, reVO);
                 return R.data(reVO);
             }
         }
 
 
-        return R.data(300, null, "未找到数据");
+        return R.data(200, null, "未找到数据");
+    }
+
+    private void setContractImageClassificationList(List<Integer> fileTypes, MaterialProgressVO reVO){
+        //判断数量
+        AtomicInteger imageAmount = new AtomicInteger();
+        AtomicInteger videoAmount = new AtomicInteger();
+        fileTypes.forEach(type -> {
+            switch (type) {
+                case 1:
+                    videoAmount.getAndIncrement();
+                    break;
+                case 2:
+                    imageAmount.getAndIncrement();
+                    break;
+            }
+        });
+        reVO.setContractImageClassificationList(fileTypes.size(), imageAmount.get(), videoAmount.get());
     }
 
     /**
@@ -294,7 +284,7 @@ public class MaterialProgressController extends BladeController {
             }
         }
 
-        return R.data(300, null, "未找到数据");
+        return R.data(200, null, "未找到数据");
     }
 
     private void setTaskParameter(MaterialProgressVO reVO, List<WbsTreeContract> submitNodeList){
@@ -326,25 +316,28 @@ public class MaterialProgressController extends BladeController {
 
         //处理工序资料
         if(processSubmitList != null && processSubmitList.size() > 0){
-            this.setParameter(reVO, processSubmitList);
+            this.setParameter("工序资料", reVO, processSubmitList);
         } else {
             reVO.setProcessMaterialStatusList("工序资料", 0, 0 ,0);
         }
+
         //处理开工报告
         if(workStartReportsSubmitList != null && workStartReportsSubmitList.size() > 0){
-            this.setParameter(reVO, workStartReportsSubmitList);
+            this.setParameter("开工报告", reVO, workStartReportsSubmitList);
         } else {
             reVO.setProcessMaterialStatusList("开工报告", 0, 0 ,0);
         }
+
         //处理评定资料
         if(evaluationSubmitList != null && evaluationSubmitList.size() > 0){
-            this.setParameter(reVO, evaluationSubmitList);
+            this.setParameter("评定资料", reVO, evaluationSubmitList);
         } else {
             reVO.setProcessMaterialStatusList("评定资料", 0, 0 ,0);
         }
+
         //处理中间交工
         if(completionSubmitList != null && completionSubmitList.size() > 0){
-            this.setParameter(reVO, completionSubmitList);
+            this.setParameter("中间交工", reVO, completionSubmitList);
         } else {
             reVO.setProcessMaterialStatusList("中间交工", 0, 0 ,0);
         }
@@ -392,7 +385,7 @@ public class MaterialProgressController extends BladeController {
             }
         }
 
-        return R.data(300, null, "未找到数据");
+        return R.data(200, null, "未找到数据");
     }
 
     /**
@@ -435,7 +428,7 @@ public class MaterialProgressController extends BladeController {
     /**
      * 设置参数
      */
-    private void setParameter(MaterialProgressVO reVO, List<InformationQuery> list){
+    private void setParameter(String title, MaterialProgressVO reVO, List<InformationQuery> list){
         //待审批
         AtomicInteger await = new AtomicInteger();
         //已审批
@@ -451,7 +444,7 @@ public class MaterialProgressController extends BladeController {
 
             }
         });
-        reVO.setProcessMaterialStatusList("工序资料", list.size(), await.get(), approval.get());
+        reVO.setProcessMaterialStatusList(title, list.size(), await.get(), approval.get());
     }
 
     /**

+ 11 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/NeiWaiYeProgressController.java

@@ -1,10 +1,13 @@
 package org.springblade.business.controller;
 
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import org.apache.commons.lang.StringUtils;
+import org.springblade.business.entity.ConstructionLedger;
+import org.springblade.business.service.IConstructionLedgerService;
 import org.springblade.business.service.IContractLogWbsService;
 import org.springblade.business.service.IInformationQueryService;
 import org.springblade.business.vo.NeiWaiYeProgressVO;
@@ -35,6 +38,8 @@ public class NeiWaiYeProgressController {
 
     private final IContractLogWbsService contractLogWbsService;
 
+    private final IConstructionLedgerService constructionLedgerService;
+
     /**
      * 内外业进度
      */
@@ -89,6 +94,12 @@ public class NeiWaiYeProgressController {
                             Integer logCount = this.contractLogWbsService.countContractLogBySelectPrimaryKeyIdsAndClassify(Func.toStrList(vo.getPrimaryKeyId()), 7);
                             if(logCount != null && logCount > 0){
                                 waiYeSuccessAmount ++;
+                            } else {
+                                //检查是否填有对应的施工台账(以施工台账是否填写开工时间为准)
+                                ConstructionLedger ledger = this.constructionLedgerService.getOne(Wrappers.<ConstructionLedger>lambdaQuery().eq(ConstructionLedger::getWbsId, vo.getPrimaryKeyId()));
+                                if(ledger != null && ledger.getSiteStartTime() != null){
+                                    waiYeSuccessAmount ++;
+                                }
                             }
                             //统计总数
                             amount ++;