Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

zzw 1 месяц назад
Родитель
Сommit
9ff54246c8

+ 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 - 3
assistMg/src/main/java/com/hotent/baseInfo/manager/impl/CostDocumentTemplateFileManagerImpl.java

@@ -64,10 +64,8 @@ public class CostDocumentTemplateFileManagerImpl extends BaseManagerImpl<CostDoc
                         costProjectDocumentFile.setWhereValue(replace);
                     }
                     String colValue = this.baseMapper.getColValue(costProjectDocumentFile.getTableName(), costProjectDocumentFile.getColName(), costProjectDocumentFile.getWhereName(), costProjectDocumentFile.getWhereValue());
-                    System.err.println("查询到的字段值"+costProjectDocumentFile.getOriginalText()+":"+colValue);
                     //获取whereValue字段值
                     costProjectDocumentFile.setDataValue(colValue);
-                    System.out.println("查询到的字段值"+costProjectDocumentFile.getOriginalText()+":"+costProjectDocumentFile.getDataValue());
                 }
             } catch (Exception e) {
                 throw new BaseException("获取字段失败:" + costProjectDocumentFile.getColName());
@@ -90,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);
             });

+ 1 - 1
assistMg/src/main/resources/mapper/CostDocumentTemplateFileMapper.xml

@@ -63,6 +63,6 @@
 		from
 			${tableName}
 		where
-			${whereName} = #{whereValue}
+			${whereName} = ${whereValue}
 	</select>
 </mapper>