fengzhenzhong 1 月之前
父節點
當前提交
1de60851ee

+ 2 - 0
assistMg/src/main/java/com/hotent/baseInfo/manager/CostDocumentTemplateFileManager.java

@@ -31,4 +31,6 @@ public interface CostDocumentTemplateFileManager extends BaseManager<CostDocumen
 	public List<CostDocumentTemplateFile> queryByDocumentId(String documentId,String whereValue);
 
 	List<CostDocumentTemplateFile> getDocumentFileList(String documentId);
+
+	String getColValue(String tableName,String colName,String whereName,String whereValue);
 }

+ 4 - 1
assistMg/src/main/java/com/hotent/baseInfo/manager/impl/CostDocumentTemplateFileManagerImpl.java

@@ -88,5 +88,8 @@ public class CostDocumentTemplateFileManagerImpl extends BaseManagerImpl<CostDoc
         return list;
     }
 
-
+    @Override
+    public String getColValue(String tableName, String colName, String whereName, String whereValue) {
+        return baseMapper.getColValue(tableName, colName, whereName, whereValue);
+    }
 }

+ 16 - 15
assistMg/src/main/java/com/hotent/project/manager/impl/CostProjectDocumentManagerImpl.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.hotent.base.util.StringUtil;
 import com.hotent.base.util.UniqueIdUtil;
 import com.hotent.baseInfo.manager.AuditedUnitManager;
 import com.hotent.baseInfo.manager.CostDocumentTemplateFileManager;
@@ -79,6 +80,9 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
     @Autowired
     private UserManager userService;
 
+    @Autowired
+    private CostDocumentTemplateFileManager costTemplateFileManager;
+
     @Override
     public CostProjectDocument getDetail(String id) {
         CostProjectDocument costProjectDocument = this.get(id);
@@ -262,24 +266,21 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
                 costProjectDocumentFile.setProjectId(costProjectApproval.getProjectId());
                 costProjectDocumentFile.setProjectId(costProjectDocument.getProjectId());
                 switch (f.getPinyin()) {
-                    case "JiaGeZhuGuanBuMenHuoChengBenDiaoChaJiGou":
-                        costProjectDocumentFile.setDataValue(costProjectApproval.getOrgName());
-                        break;
-                    case "SongDaWenShuMingCheng":
-                        costProjectDocumentFile.setDataValue(costDocument.getWhName());
-                        break;
                     case "SongDaWenShuWenHao":
                         costProjectDocumentFile.setDataValue(projectDocument.getDocumentNumber());
                         break;
-                    case "ShouSongDaRen":
-                        costProjectDocumentFile.setDataValue(auditedUnit.getContactName());
-                        break;
-                    case "BeiJianShenDanWeiBanGongDiDian":
-                        costProjectDocumentFile.setDataValue(auditedUnit.getAddress());
-                        break;
-                    default:
-                        costProjectDocumentFile.setDataValue("");
-                        break;
+                }
+                if (StringUtils.isNotBlank(f.getTableName())){
+                    if(StringUtil.isEmpty(costProjectDocumentFile.getWhereValue())){
+                        costProjectDocumentFile.setWhereValue(costProjectApproval.getProjectId());
+                    }else {
+                        String whereValue1 = costProjectDocumentFile.getWhereValue();
+                        String replace = whereValue1.replace("?", "'" + costProjectApproval.getProjectId() + "'");
+                        costProjectDocumentFile.setWhereValue(replace);
+                    }
+                    String colValue = costTemplateFileManager.getColValue(costProjectDocumentFile.getTableName(), costProjectDocumentFile.getColName(), costProjectDocumentFile.getWhereName(), costProjectDocumentFile.getWhereValue());
+                    //获取whereValue字段值
+                    costProjectDocumentFile.setDataValue(colValue);
                 }
                 arrayList.add(costProjectDocumentFile);
             });