diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/flow/ModelProcService.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/flow/ModelProcService.java index be6679a..42610c8 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/flow/ModelProcService.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/flow/ModelProcService.java @@ -52,31 +52,24 @@ public class ModelProcService extends AbstractCompService { } //加载工作流的列表字段 - public R loadProcInstFields(@SwBody SwMap params, UserSession us) { - ModelTable table = ModelTableCache.getInstance().getByName(ProcInst.ENTITY_NAME); - if (table == null) return R.error("没有找到表定义信息(table=" + ProcInst.ENTITY_NAME + ")!"); - + public R loadFlowListFields (@SwBody SwMap params, UserSession us) { List ret = new ArrayList<>(); - for (ModelField field : table.getFields()) { - SwMap col = new SwMap(2); - ModelFormHelper.buildFieldInfo(table, field, col); - ret.add(col); - } + ModelFormHelper.buildTableFields(ret, ProcInst.ENTITY_NAME); + return R.success(ret); + } + + public R loadFlowCardFields(@SwBody SwMap params, UserSession us) { + List ret = new ArrayList<>(); + ModelFormHelper.buildTableFields(ret, ProcInst.ENTITY_NAME); + ret.add(buildField("selTaskId", SwEnum.DataType.ID.value, "选中任务")); return R.success(ret); } //加载审批意见的列表字段 public R loadCommentFields(@SwBody SwMap params, UserSession us) { - ModelTable table = ModelTableCache.getInstance().getByName(Comment.ENTITY_NAME); - if (table == null) return R.error("没有找到表定义信息(table=" + Comment.ENTITY_NAME + ")!"); - List ret = new ArrayList<>(); - for (ModelField field : table.getFields()) { - SwMap col = new SwMap(2); - ModelFormHelper.buildFieldInfo(table, field, col); - ret.add(col); - } + ModelFormHelper.buildTableFields(ret, Comment.ENTITY_NAME); ret.add(buildField("cmt_act_code", SwEnum.DataType.CODE.value, "活动编号")); ret.add(buildField("cmt_act_text", SwEnum.DataType.NAME.value, "活动名称")); return R.success(ret); diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/ModelFormHelper.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/ModelFormHelper.java index 85c7cc2..880cb6b 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/ModelFormHelper.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/ModelFormHelper.java @@ -1,11 +1,13 @@ package cc.smtweb.system.bpm.web.design.form; +import cc.smtweb.framework.core.common.R; import cc.smtweb.framework.core.common.SwEnum; import cc.smtweb.framework.core.common.SwMap; import cc.smtweb.framework.core.db.cache.ModelTableCache; import cc.smtweb.framework.core.db.vo.ModelField; import cc.smtweb.framework.core.db.vo.ModelTable; import cc.smtweb.framework.core.exception.BizException; +import cc.smtweb.framework.core.exception.SwException; import cc.smtweb.framework.core.mvc.variable.SwVariableFactory; import cc.smtweb.framework.core.session.UserSession; import cc.smtweb.framework.core.util.JsonUtil; @@ -18,6 +20,7 @@ import cc.smtweb.system.bpm.util.IdeaUtil; import cc.smtweb.system.bpm.web.design.db.ModelCatalogCache; import cc.smtweb.system.bpm.web.design.db.ModelProjectCache; import cc.smtweb.system.bpm.web.design.form.define.*; +import cc.smtweb.system.bpm.web.engine.flow.entity.Comment; import com.fasterxml.jackson.core.JsonProcessingException; import org.apache.commons.lang3.StringUtils; @@ -513,6 +516,17 @@ public class ModelFormHelper { } } + public static void buildTableFields(List ret, String tableName) { + ModelTable table = ModelTableCache.getInstance().getByName(tableName); + if (table == null) throw new SwException("没有找到表定义信息(table=" + tableName + ")!"); + + for (ModelField field : table.getFields()) { + SwMap col = new SwMap(2); + ModelFormHelper.buildFieldInfo(table, field, col); + ret.add(col); + } + } + /** * 页面设计时,返回的字段信息,带控件 * diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/FlowInstance.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/FlowInstance.java index 13f83cd..0a4affb 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/FlowInstance.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/FlowInstance.java @@ -52,6 +52,9 @@ public class FlowInstance { private FlowListener listener; + //提交驳回等之后的,属于我的新任务 + private Task nextMyTask; + public static FlowInstance createById(UserSession us, FlowListener listener, long billId, long taskId) { FlowInstance flowInstance = new FlowInstance(listener, us); flowInstance.load(billId, taskId); @@ -261,9 +264,13 @@ public class FlowInstance { for (Task act : list) { //如果办理人是当前用户,则置此任务为当前任务 //我办理中的任务:非待办,且是我的任务 - if (act.getStatu() == FlowConst.ActivityStatu.WAIT.value && FlowHelper.isMyWaitedTask(act.getId(), us.getUserId())) { - //我的待办任务,设下值,为后面的按钮判断减轻负担 - act.setHandler(us.getUserId()); + if (act.getId() == actInst.getId()) { + act = actInst; + + if (act.getStatu() == FlowConst.ActivityStatu.WAIT.value && FlowHelper.isMyWaitedTask(act.getId(), us.getUserId())) { + //我的待办任务,设下值,为后面的按钮判断减轻负担 + act.setHandler(us.getUserId()); + } } //如果当前任务为待办理,那么要找其前置任务,作为活动任务,方便取回 if (act.getStatu() == FlowConst.ActivityStatu.WAIT.value && !act.isReject() && !act.isRetake()) { @@ -318,6 +325,7 @@ public class FlowInstance { * 返回页面前的设置 */ public void setPageRetExtra(SwMap ret) { + procInst.setSelTaskId(actInst.getId()); SwMap extra = ret.computeMapIfAbsent("extra", k -> new SwMap()); List listTask = adjustTasks(); @@ -527,13 +535,8 @@ public class FlowInstance { actInst.setStatu(FlowConst.ActivityStatu.SUBMIT.value); actInst.setRetake(false); - if (listInsertTask.size() > 0) { - procInst.setTaskId(listInsertTask.get(0).getEntityId()); - procInst.setActName(listInsertTask.get(0).getActName()); - } else { - procInst.setTaskId(actInst.getEntityId()); - procInst.setActName(actInst.getActName()); - } + procInst.setTaskId(listInsertTask.get(0).getEntityId()); + procInst.setActName(listInsertTask.get(0).getActName()); if (new_acts.size() == 1 && new_acts.get(0).getType() == FlowConst.ActivityType.END.value) { procInst.setStatu(FlowConst.InstanceStatu.FINISH.value); @@ -543,7 +546,6 @@ public class FlowInstance { } //保存入库 - if (!listInsertTask.isEmpty()) { getTaskDao().batchInsertEntity(listInsertTask); getCandidateDao().batchInsertEntity(listInsertCand); getTaskRelDao().batchInsertEntity(listTaskRel); @@ -551,13 +553,16 @@ public class FlowInstance { if (!listTaskComment.isEmpty()) { getCommentDao().batchInsertEntity(listTaskComment); } - } + getTaskDao().updateEntity(actInst); getProcInstDao().updateEntity(procInst); updateComment(comment, FlowConst.Button.SUBMIT.value); buildBillLog(FlowConst.Button.SUBMIT.value, comment, actInst, listInsertTask); listener.afterSubmit(actInst, listInsertTask); + + //设置当前步骤 + actInst = nextMyTask != null ? nextMyTask : listInsertTask.get(0); } /** @@ -645,6 +650,9 @@ public class FlowInstance { } for (Long user_id : listHander) { // if (act.getHandler().getIgnore() && user_id == submit_user) continue; + if (nextMyTask == null && user_id == us.getUserId()) { + nextMyTask = task; + } Candidate cand = new Candidate(); cand.init(); cand.setEntityId(DbEngine.getInstance().nextId()); @@ -678,34 +686,7 @@ public class FlowInstance { } Activity activityEntity = procDef.getProcInfo().findActivity(actInst.getActId()); EntityDao taskDao = getTaskDao(); - if (activityEntity.getType() == FlowConst.ActivityType.END.value) {//从结束取回 - List new_acts = provider.findBeforeTasks(actInst.getId()); - Task old_act = (Task) actInst.clone(); - old_act.setEntityId(actInst.getEntityId()); - - actInst = new_acts.get(0); - actInst.setHandler(user_id); - actInst.setStartTime(DateUtil.nowDateTimeLong()); - actInst.setStatu(FlowConst.ActivityStatu.HANDLE.value); - if (actInst.isMake()) { - actInst.setHandler(user_id); - } - - procInst.setTaskId(actInst.getEntityId()); - procInst.setActName(actInst.getActName()); - procInst.setStatu(actInst.isMake() ? FlowConst.InstanceStatu.BEGIN.value: FlowConst.InstanceStatu.RUNING.value); - taskDao.updateEntity(actInst); - taskDao.deleteEntity(old_act); - getTaskRelDao().deleteEntity("where trl_src_task_id=?", old_act.getId()); - getProcInstDao().updateEntity(procInst); - getCommentDao().deleteEntity("where cmt_tsk_id=?", old_act.getId()); - new_acts.clear(); - new_acts.add(old_act); - buildBillLog(FlowConst.Button.RETAKE.value, "TODO", actInst, new_acts); - listener.afterRetake(actInst, new_acts); -// comp.transCallback(FlowConst.Button.RETAKE.value, actInst, new_acts); - } else { List new_acts = provider.findAfterTasks(actInst.getId()); for (Task act : new_acts) { @@ -733,7 +714,6 @@ public class FlowInstance { updateComment(null, FlowConst.Button.RETAKE.value); buildBillLog(FlowConst.Button.RETAKE.value, "TODO", actInst, new_acts); listener.afterRetake(actInst, new_acts); - } } /** @@ -766,6 +746,7 @@ public class FlowInstance { //待新增任务候选人 List listInsertCand = new ArrayList<>(); + nextMyTask = null; //校验完毕,接下来干活。 //并发考虑:找到此任务的前置任务,创建对应的新任务,原流程其他未办理任务删除,办理中及已提交的,置为 for (String dstTaskId : dstTasks) { @@ -777,31 +758,30 @@ public class FlowInstance { buildRejectTask(toTask, listInsertTask, listInsertCand, listTaskRel, listTaskComment); } actInst.setStatu(FlowConst.ActivityStatu.REJECT.value); - if (listInsertTask.size() > 0) { - procInst.setTaskId(listInsertTask.get(0).getEntityId()); - procInst.setActName(listInsertTask.get(0).getActName()); - } else { - procInst.setTaskId(actInst.getEntityId()); - procInst.setActName(actInst.getActName()); - } + + procInst.setTaskId(listInsertTask.get(0).getEntityId()); + procInst.setActName(listInsertTask.get(0).getActName()); + //先停止其他待办或办理中的任务 FlowHelper.stopTask(procInst.getId(), actInst.getId()); //保存入库 - if (!listInsertTask.isEmpty()) { - getTaskDao().batchInsertEntity(listInsertTask); - getCandidateDao().batchInsertEntity(listInsertCand); - getTaskRelDao().batchInsertEntity(listTaskRel); - if (!listTaskComment.isEmpty()) { - getCommentDao().batchInsertEntity(listTaskComment); - } + getTaskDao().batchInsertEntity(listInsertTask); + getCandidateDao().batchInsertEntity(listInsertCand); + getTaskRelDao().batchInsertEntity(listTaskRel); + + if (!listTaskComment.isEmpty()) { + getCommentDao().batchInsertEntity(listTaskComment); } + getTaskDao().updateEntity(actInst); getProcInstDao().updateEntity(procInst); updateComment(comment, FlowConst.Button.REJECT.value); buildBillLog(FlowConst.Button.SUBMIT.value, comment, actInst, listInsertTask); listener.afterSubmit(actInst, listInsertTask); + + actInst = nextMyTask != null ? nextMyTask: listInsertTask.get(0); } private void buildRejectTask(Task oldTask, List listInsertTask, List listInsertCand, List listTaskRel, List listTaskComment) { @@ -826,7 +806,9 @@ public class FlowInstance { cand.setPriId(task.getPriId()); cand.setTskId(task.getId()); cand.setUserId(oldTask.getHandler()); - + if (nextMyTask == null && task.getHandler() == us.getUserId()) { + nextMyTask = task; + } listInsertCand.add(cand); //创建新的审批意见 diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/entity/ProcInst.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/entity/ProcInst.java index 9d9defc..c982958 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/entity/ProcInst.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/entity/ProcInst.java @@ -232,4 +232,11 @@ public class ProcInst extends DefaultEntity { public void setUrl(String pri_url) { put("pri_url", pri_url); } + + /** + * 当前选择的任务 + */ + public void setSelTaskId(long selTaskId) { + put("selTaskId", selTaskId); + } } diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowSingleLoadHandler.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowSingleLoadHandler.java index 6800305..e6d63d9 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowSingleLoadHandler.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowSingleLoadHandler.java @@ -28,9 +28,10 @@ public class FlowSingleLoadHandler extends LCSingleLoad bean.setEntityId(flowInstance.getProcInst().getId()); ret.put(cardDataset.name, DynRetBean.createBean(bean)); + + flowInstance.setPageRetExtra(ret); ret.put(FlowHelper.DATASET_NAME_FLOW, DynRetBean.createBean(flowInstance.getProcInst())); ret.put(FlowHelper.DATASET_NAME_COMMENT, DynRetBean.createList(SwListData.EMPTY)); - flowInstance.setPageRetExtra(ret); } @Override @@ -47,9 +48,9 @@ public class FlowSingleLoadHandler extends LCSingleLoad //加载流程信息 flowInstance = FlowInstance.createById(us, this, id, taskId); + flowInstance.setPageRetExtra(ret); ret.put(FlowHelper.DATASET_NAME_FLOW, DynRetBean.createBean(flowInstance.getProcInst())); ret.put(FlowHelper.DATASET_NAME_COMMENT, DynRetBean.createList(SwListData.create(flowInstance.loadComment(), 0))); - flowInstance.setPageRetExtra(ret); afterLoad(ret, bean); return R.success(ret); } diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowSingleSaveHandler.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowSingleSaveHandler.java index c4c968e..82c05af 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowSingleSaveHandler.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowSingleSaveHandler.java @@ -55,9 +55,9 @@ public class FlowSingleSaveHandler extends LCSingleSave @Override protected void afterSave(SwMap ret, T bean) { super.afterSave(ret, bean); + flowInstance.setPageRetExtra(ret); ret.put(FlowHelper.DATASET_NAME_FLOW, DynRetBean.createBean(flowInstance.getProcInst())); ret.put(FlowHelper.DATASET_NAME_COMMENT, DynRetBean.createList(SwListData.EMPTY)); - flowInstance.setPageRetExtra(ret); } //单据编号,新增保存时调用 diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowTransHandler.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowTransHandler.java index d9602e0..0616a41 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowTransHandler.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowTransHandler.java @@ -34,9 +34,10 @@ public class FlowTransHandler extends AbstractDynPageHa private SwMap buildRetData() { SwMap ret = new SwMap(); ret.put(LCSingleHelper.DATASET_NAME_CARD, DynRetBean.createBean(bean)); + + flowInstance.setPageRetExtra(ret); ret.put(FlowHelper.DATASET_NAME_FLOW, DynRetBean.createBean(flowInstance.getProcInst())); ret.put(FlowHelper.DATASET_NAME_COMMENT, DynRetBean.createList(SwListData.EMPTY)); - flowInstance.setPageRetExtra(ret); return ret; } diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/login/AuthService.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/login/AuthService.java index 5e6cb6e..f8cca82 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/login/AuthService.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/login/AuthService.java @@ -50,7 +50,7 @@ public class AuthService { UserSession userSession = null; try { if ("admin".equals(loginPO.getUsername())) { - userSession = new UserSession(1); + userSession = UserSession.createSys(); // user=new User(); // return new UserSession(1); } else { @@ -87,6 +87,8 @@ public class AuthService { loginAckVO.setDesc(user.getSign()); loginAckVO.setToken(sessionManager.login(userSession)); loginAckVO.setUserLevel(user.getLevel() + ""); + loginAckVO.setUserNicky(user.getNicky()); + loginAckVO.setUserTel(user.getTel()); data.put("user", loginAckVO); data.put("token", loginAckVO.getToken()); data.put("isOk", true); diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/login/LoginAckVO.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/login/LoginAckVO.java index bddd953..d2b87fc 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/login/LoginAckVO.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/login/LoginAckVO.java @@ -12,4 +12,6 @@ public class LoginAckVO { private String desc; private String token; private String userLevel; //102100内部用户/102101外部用户/102102公众用户 + private String userNicky; + private String userTel; } diff --git a/smtweb-framework/bpm/src/main/resources/static/template/default/model_card_flow.ftl b/smtweb-framework/bpm/src/main/resources/static/template/default/model_card_flow.ftl index 444d8f3..2b7efe8 100644 --- a/smtweb-framework/bpm/src/main/resources/static/template/default/model_card_flow.ftl +++ b/smtweb-framework/bpm/src/main/resources/static/template/default/model_card_flow.ftl @@ -106,7 +106,7 @@ "size": "default", "hideLabel": true, "dataset": "flow", - "field": "pri_task_id" + "field": "selTaskId" }, "events": { "on-change": "onTaskChange" diff --git a/smtweb-framework/bpm/src/main/resources/static/template/default/model_card_ms.ftl b/smtweb-framework/bpm/src/main/resources/static/template/default/model_card_ms.ftl index e8d834e..cb7867d 100644 --- a/smtweb-framework/bpm/src/main/resources/static/template/default/model_card_ms.ftl +++ b/smtweb-framework/bpm/src/main/resources/static/template/default/model_card_ms.ftl @@ -85,7 +85,66 @@ }, "events": {} } - <#if field_has_next>, + <#if field_has_next> + <#if (param.masterCol lte 1 )> + <#if (field.desc != "")> + ,{ + "id": "id${newId()}", + "type": "fx-label", + "props": { + "label": "${field.desc}", + "labelWidth": 0, + "affixError": true, + "labelAlign": "left" + } + } + ,{ + "id": "id${newId()}", + "type": "fx-placeholder", + "props": { + "label": "占位" + }, + "layout": { + "row": 1 + } + } + <#else> + ,{ + "id": "id${newId()}", + "type": "fx-placeholder", + "props": { + "label": "占位" + }, + "layout": { + "row": 1 + } + } + ,{ + "id": "id${newId()}", + "type": "fx-placeholder", + "props": { + "label": "占位" + }, + "layout": { + "row": 1 + } + } + + + <#if (param.masterCol = 2 && ((field_index+1) % 2 = 0 ) )> + ,{ + "id": "id${newId()}", + "type": "fx-placeholder", + "props": { + "label": "占位" + }, + "layout": { + "row": 1 + } + } + + , + ] }, diff --git a/smtweb-framework/core/src/main/java/cc/smtweb/framework/core/db/DbEngine.java b/smtweb-framework/core/src/main/java/cc/smtweb/framework/core/db/DbEngine.java index b474d0f..4e419f7 100644 --- a/smtweb-framework/core/src/main/java/cc/smtweb/framework/core/db/DbEngine.java +++ b/smtweb-framework/core/src/main/java/cc/smtweb/framework/core/db/DbEngine.java @@ -278,23 +278,6 @@ public class DbEngine extends JdbcEngine { if (entities == null || entities.isEmpty()) { return null; } - return findDao((Class) entities.get(0).getClass()).batchInsertEntity(entities, null); + return findDao((Class) entities.get(0).getClass()).batchInsertEntity(entities); } - - /** - * 批量插入单行数据 - * - * @param entities PO对象列表 - * @param fields 逗号分隔的字段列表 - * @param 实体类型 - * @return 更新数量 - */ - public int[] batchInsertEntity(List entities, String fields) { - if (entities == null || entities.isEmpty()) { - return null; - } - return findDao((Class) entities.get(0).getClass()).batchInsertEntity(entities, fields); - } - - } diff --git a/smtweb-framework/core/src/main/java/cc/smtweb/framework/core/db/EntityDao.java b/smtweb-framework/core/src/main/java/cc/smtweb/framework/core/db/EntityDao.java index 89c66c2..9124332 100644 --- a/smtweb-framework/core/src/main/java/cc/smtweb/framework/core/db/EntityDao.java +++ b/smtweb-framework/core/src/main/java/cc/smtweb/framework/core/db/EntityDao.java @@ -139,40 +139,18 @@ public class EntityDao extends AbstractEntityDao { * 批量插入单行数据 * * @param entities PO对象列表 - * @return 更新数量 - */ - public int[] batchInsertEntity(Collection entities) { - return batchInsertEntity(entities, null); - } - - - /** - * 批量插入单行数据 - * - * @param entities PO对象列表 * @param fields 逗号分隔的字段列表 * @return 更新数量 */ - public int[] batchInsertEntity(Collection entities, String fields) { + public int[] batchInsertEntity(Collection entities) { StringBuilder sql = new StringBuilder(); sql.append("insert into ").append(modelTable.getSchemaTableName()).append("("); - - List listFields = adjustFields(fields, SwEnum.FieldType.CREATE_TIME.value, SwEnum.FieldType.LAST_TIME.value); List insertColumns = new ArrayList<>(this.columns.size()); - if (listFields == null) { - for (EntityColumn column : this.columns.values()) { - sql.append(column.getField().getName()).append(","); - insertColumns.add(column); - } - } else { - - for (String name : listFields) { - EntityColumn column = this.columns.get(name.trim()); - sql.append(column.getField().getName()).append(","); - insertColumns.add(column); - } + for (EntityColumn column : this.columns.values()) { + sql.append(column.getField().getName()).append(","); + insertColumns.add(column); } sql.setCharAt(sql.length() - 1, ')');