Browse Source

bug修复

dzx 1 year ago
parent
commit
744e6917cf

+ 7 - 5
src/main/java/com/xjrsoft/module/form/service/impl/FormExecuteServiceImpl.java

@@ -1295,13 +1295,15 @@ public class FormExecuteServiceImpl implements IFormExecuteService {
 
                 //主表如果有审计字段  默认填充值
                 putAuditEntityUpdateData(entity, columns);
-                Map<String, Object> objectMap = SqlRunnerAdapter.db().dynamicSelectOne(tableName, where);
+                Entity findwhere = Entity.create(tableName);
+                findwhere.putAll(where);
+                findwhere.putAll(entity);
+                Map<String, Object> objectMap = SqlRunnerAdapter.db().dynamicSelectOne(tableName, findwhere);
                 Boolean isUpdate = false;
-                for (String key : toSaveFormData.keySet()) {
-                    if(!Objects.equals(entity.get(key), objectMap.get(key))){
-                        isUpdate = true;
-                    };
+                if(objectMap == null){
+                    isUpdate = true;
                 }
+
                 Boolean result = null;
                 if(isUpdate){
                     result = SqlRunnerAdapter.db().dynamicUpdate(tableName, entity, where);