ソースを参照

Merge remote-tracking branch 'origin/master'

zzw 1 ヶ月 前
コミット
07d9bf67ee

+ 1 - 1
assistMg/src/main/java/com/hotent/baseInfo/manager/CostDocumentWhManager.java

@@ -32,7 +32,7 @@ public interface CostDocumentWhManager extends BaseManager<CostDocumentWh> {
 	 * @param costDocumentWh
 	 * @return
 	 */
-	void createOrUpdate(CostDocumentWh costDocumentWh);
+	void createOrUpdate(CostDocumentWh costDocumentWh) throws Exception;
 
 
 

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

@@ -56,8 +56,17 @@ public class CostDocumentTemplateFileManagerImpl extends BaseManagerImpl<CostDoc
         for (CostDocumentTemplateFile costProjectDocumentFile : documentFileList) {
             try {
                 if (StringUtil.isNotEmpty(costProjectDocumentFile.getTableName())){
+                    if(StringUtil.isEmpty(costProjectDocumentFile.getWhereValue())){
+                        costProjectDocumentFile.setWhereValue(whereValue);
+                    }else {
+                        String whereValue1 = costProjectDocumentFile.getWhereValue();
+                        String replace = whereValue1.replace("?", "'" + whereValue + "'");
+                        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(this.baseMapper.getColValue(costProjectDocumentFile.getTableName(), costProjectDocumentFile.getColName(), costProjectDocumentFile.getWhereValue(),whereValue));
+                    costProjectDocumentFile.setDataValue(colValue);
                 }
             } catch (Exception e) {
                 throw new BaseException("获取字段失败:" + costProjectDocumentFile.getColName());

+ 11 - 2
assistMg/src/main/java/com/hotent/baseInfo/manager/impl/CostDocumentWhManagerImpl.java

@@ -31,6 +31,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 
 import java.io.Serializable;
 import java.time.LocalDate;
+import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.regex.Matcher;
@@ -80,7 +81,7 @@ public class CostDocumentWhManagerImpl extends BaseManagerImpl<CostDocumentWhDao
 
     @Override
     @Transactional
-    public void createOrUpdate(CostDocumentWh costDocumentWh) {
+    public void createOrUpdate(CostDocumentWh costDocumentWh) throws Exception {
         //TODO 生成规则 使用表达式
         /**
          * 分省、市、县三级分别对本单位的成本监审过程中相关文书的文号前缀统一管理,
@@ -96,7 +97,15 @@ public class CostDocumentWhManagerImpl extends BaseManagerImpl<CostDocumentWhDao
         if (!isValidRulePattern(costDocumentWh.getRulePattern())) {
             throw new BaseException("规则表达式错误 按要求填写:{prefixText}成审 {year} {currentValue}号");
         }
-
+        IUser iUser = ContextUtil.getCurrentUser();
+        User user = userService.getByAccount(iUser.getAccount());
+        if (StringUtil.isNotEmpty(costDocumentWh.getId())) {
+            costDocumentWh.setUpdateBy(user.getAccount());
+            costDocumentWh.setUpdateTime(LocalDateTime.now());
+        }else {
+            costDocumentWh.setCreateTime(LocalDateTime.now());
+            costDocumentWh.setCreateBy(user.getAccount());
+        }
 
         //新建或更新
         this.saveOrUpdate(costDocumentWh);