From 52d7020ff8a374aabe6286b12b1c28afe620d300 Mon Sep 17 00:00:00 2001 From: zhangzq Date: Tue, 18 Jun 2024 20:33:25 +0800 Subject: [PATCH] =?UTF-8?q?add:=E6=8B=A3=E9=80=89=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/nl/common/enums/StatusEnum.java | 10 +--- .../form_struc/service/dao/BmFormStruc.java | 6 ++- .../service/dto/BmFormStrucDto.java | 8 ++++ .../behavior/impl/FormActivityBehavior.java | 4 +- .../impl/ServerTaskActivityBehavior.java | 4 +- .../impl/StartEventActivityBehavior.java | 48 +++++++++++-------- .../impl/StrucFormActivityBehavior.java | 4 +- .../nodeType/excess/impl/DecisionHandler.java | 4 ++ .../listener/FlowEndEventListener.java | 13 ++++- .../wms/config_manage/formStruc/index.vue | 28 ++++++----- .../wms/early_manage/early_data/index.vue | 2 +- .../wms/early_manage/early_inv/index.vue | 2 +- .../PropertySetting/ServerTaskProperties.vue | 5 +- .../group_dick/group_config/index.vue | 2 +- .../views/wms/pm_manage/form_data/index.vue | 2 +- .../wms/stor_manage/warehouse/pick/index.vue | 2 +- 16 files changed, 89 insertions(+), 55 deletions(-) diff --git a/wms_pro/hd/nladmin-system/src/main/java/org/nl/common/enums/StatusEnum.java b/wms_pro/hd/nladmin-system/src/main/java/org/nl/common/enums/StatusEnum.java index 71bc01cf..9209e345 100644 --- a/wms_pro/hd/nladmin-system/src/main/java/org/nl/common/enums/StatusEnum.java +++ b/wms_pro/hd/nladmin-system/src/main/java/org/nl/common/enums/StatusEnum.java @@ -32,7 +32,7 @@ public enum StatusEnum { * 出入库单据类型 */ IOBILL_TYPE_IN(ForkMap.of("生产入库", "10","inStorageTask", "调拨入库", "11","inStorageTask", "退货入库", "12","inStorageTask","拣选回库", "13","inStorageTask")), - IOBILL_TYPE_OUT(ForkMap.of("销售出库", "20","outStorageTask","生产出库", "21","outStorageTask", "调拨出库", "22","outStorageTask", "拣选出库", "23","outStorageTask")), + IOBILL_TYPE_OUT(ForkMap.of("销售出库", "20","outStorageTask","生产出库", "21","outStorageTask", "调拨出库", "22","outStorageTask", "拣选出库", "23","conveyorOutStorageTask")), /** * 任务类型 @@ -81,12 +81,6 @@ public enum StatusEnum { public Boolean check(String code) { ForkMap map = this.getCode(); - for (String key : map.getKeySet()) { - if (code.equals(map.getM(key))){ - return true; - } - } - return false; - + return map.getKeySet().contains(code); } } diff --git a/wms_pro/hd/nladmin-system/src/main/java/org/nl/wms/config_manage/form_struc/service/dao/BmFormStruc.java b/wms_pro/hd/nladmin-system/src/main/java/org/nl/wms/config_manage/form_struc/service/dao/BmFormStruc.java index 4f159331..522f21b9 100644 --- a/wms_pro/hd/nladmin-system/src/main/java/org/nl/wms/config_manage/form_struc/service/dao/BmFormStruc.java +++ b/wms_pro/hd/nladmin-system/src/main/java/org/nl/wms/config_manage/form_struc/service/dao/BmFormStruc.java @@ -124,9 +124,13 @@ public class BmFormStruc implements Serializable { */ private String parent_id; /** - * 关联上级表单id + * 表单自动映射 */ private Boolean auto_mapping; + /** + * 是否属于基础表单 + */ + private Boolean is_base; } diff --git a/wms_pro/hd/nladmin-system/src/main/java/org/nl/wms/config_manage/form_struc/service/dto/BmFormStrucDto.java b/wms_pro/hd/nladmin-system/src/main/java/org/nl/wms/config_manage/form_struc/service/dto/BmFormStrucDto.java index c38e5fdf..56db6007 100644 --- a/wms_pro/hd/nladmin-system/src/main/java/org/nl/wms/config_manage/form_struc/service/dto/BmFormStrucDto.java +++ b/wms_pro/hd/nladmin-system/src/main/java/org/nl/wms/config_manage/form_struc/service/dto/BmFormStrucDto.java @@ -117,6 +117,14 @@ public class BmFormStrucDto implements Serializable { * 是否含有明细表单 */ private Boolean has_child; + /** + * 是否为基础表 + */ + private Boolean is_base; + /** + * 表单自动映射 + */ + private Boolean auto_mapping; /** * 关联上级表单id diff --git a/wms_pro/hd/nladmin-system/src/main/java/org/nl/wms/flow_manage/flow/framework/engine/behavior/impl/FormActivityBehavior.java b/wms_pro/hd/nladmin-system/src/main/java/org/nl/wms/flow_manage/flow/framework/engine/behavior/impl/FormActivityBehavior.java index 2590e9f6..9e89e3bc 100644 --- a/wms_pro/hd/nladmin-system/src/main/java/org/nl/wms/flow_manage/flow/framework/engine/behavior/impl/FormActivityBehavior.java +++ b/wms_pro/hd/nladmin-system/src/main/java/org/nl/wms/flow_manage/flow/framework/engine/behavior/impl/FormActivityBehavior.java @@ -115,8 +115,8 @@ public class FormActivityBehavior extends FlowNodeActivityBehavior { } iostorinvService.save(mst); entity.setT(handler); - entity.setForm_id(handler.getString("form_type")); - entity.setForm_type(handler.getString("form_id")); + entity.setForm_id(handler.getString("form_id")); + entity.setForm_type(handler.getString("form_type")); } } } diff --git a/wms_pro/hd/nladmin-system/src/main/java/org/nl/wms/flow_manage/flow/framework/engine/behavior/impl/ServerTaskActivityBehavior.java b/wms_pro/hd/nladmin-system/src/main/java/org/nl/wms/flow_manage/flow/framework/engine/behavior/impl/ServerTaskActivityBehavior.java index 82b2b633..6e5854fb 100644 --- a/wms_pro/hd/nladmin-system/src/main/java/org/nl/wms/flow_manage/flow/framework/engine/behavior/impl/ServerTaskActivityBehavior.java +++ b/wms_pro/hd/nladmin-system/src/main/java/org/nl/wms/flow_manage/flow/framework/engine/behavior/impl/ServerTaskActivityBehavior.java @@ -37,8 +37,8 @@ public class ServerTaskActivityBehavior extends FlowNodeActivityBehavior().eq("form_type", form_type)); + StringBuffer sql = new StringBuffer(); + sql.append("update ") + .append(bmFormStruc.getIs_base()?form_type:"pm_form_data") + .append(" set status = ") + .append("'"+StatusEnum.FORM_STATUS.code("执行中")+"'") + .append(" where id = ") + .append("'"+entity.getForm_id()+"'"); + iPmFormDataService.dynamicSql(sql.toString()); + Consumer callback = entity.getCallback(); + if (callback!=null){ + callback.accept(proc_inst_id); + } ActRuExecution execution = new ActRuExecution(); - execution.setProc_inst_id(IdUtil.getStringId()); + execution.setProc_inst_id(proc_inst_id); execution.setDeployment_id(deployment.getDeployment_id()); execution.setForm_type(entity.getForm_type()); execution.setParent_id(entity.getParent_id()); @@ -60,22 +85,7 @@ public class StartEventActivityBehavior extends FlowNodeActivityBehavior { execution.setCreate_time(DateUtil.now()); execution.setStatus(StatusEnum.FLOW_STATUS.code("启动")); iActRuExecutionService.save(execution); - StartEvent currentFlowElement = (StartEvent)entity.getCurrentFlowElement(); - String form_type = currentFlowElement.getForm_type(); - if (StringUtils.isNotEmpty(form_type)){ - StringBuffer sql = new StringBuffer(); - sql.append("update ") - .append(entity.getForm_type()) - .append(" set status = ") - .append("'"+StatusEnum.FORM_STATUS.code("执行中")+"'") - .append(" where id = ") - .append("'"+entity.getForm_id()+"'"); - iPmFormDataService.dynamicSql(sql.toString()); - } - Consumer callback = entity.getCallback(); - if (callback!=null){ - callback.accept(execution.getProc_inst_id()); - } + entity.setProc_inst_id(execution.getProc_inst_id()); } diff --git a/wms_pro/hd/nladmin-system/src/main/java/org/nl/wms/flow_manage/flow/framework/engine/behavior/impl/StrucFormActivityBehavior.java b/wms_pro/hd/nladmin-system/src/main/java/org/nl/wms/flow_manage/flow/framework/engine/behavior/impl/StrucFormActivityBehavior.java index 59de6d94..9faa4296 100644 --- a/wms_pro/hd/nladmin-system/src/main/java/org/nl/wms/flow_manage/flow/framework/engine/behavior/impl/StrucFormActivityBehavior.java +++ b/wms_pro/hd/nladmin-system/src/main/java/org/nl/wms/flow_manage/flow/framework/engine/behavior/impl/StrucFormActivityBehavior.java @@ -109,8 +109,8 @@ public class StrucFormActivityBehavior extends FlowNodeActivityBehavior map = SpringContextHolder.getBean(DecisionHandler.class).dispense(params, item_json); //更新仓位,更新数据 System.out.println(flow.getForm_type()+"更新明细id"+item_json.getString("id")); diff --git a/wms_pro/hd/nladmin-system/src/main/java/org/nl/wms/stor_manage/monitor/listener/FlowEndEventListener.java b/wms_pro/hd/nladmin-system/src/main/java/org/nl/wms/stor_manage/monitor/listener/FlowEndEventListener.java index 2aea9a53..368f0454 100644 --- a/wms_pro/hd/nladmin-system/src/main/java/org/nl/wms/stor_manage/monitor/listener/FlowEndEventListener.java +++ b/wms_pro/hd/nladmin-system/src/main/java/org/nl/wms/stor_manage/monitor/listener/FlowEndEventListener.java @@ -6,6 +6,8 @@ import org.apache.commons.lang3.StringUtils; import org.nl.common.domain.exception.BadRequestException; import org.nl.common.enums.StatusEnum; import org.nl.common.publish.AbstraceListener; +import org.nl.wms.config_manage.form_struc.service.IBmFormStrucService; +import org.nl.wms.config_manage.form_struc.service.dao.BmFormStruc; import org.nl.wms.flow_manage.flow.service.history.IActHiExecutionService; import org.nl.wms.flow_manage.flow.service.history.dao.ActHiExecution; import org.nl.wms.flow_manage.monitor.event.FlowEndEvent; @@ -15,6 +17,8 @@ import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; /* * @author ZZQ @@ -30,6 +34,10 @@ public class FlowEndEventListener extends AbstraceListener { @Autowired private IPmFormDataService iPmFormDataService; + + @Autowired + private IBmFormStrucService iBmFormStrucService; + @Override protected String doEvent(FlowEndEvent event) { //更新所有流程过程中的单据为完成 @@ -44,10 +52,13 @@ public class FlowEndEventListener extends AbstraceListener { .eq("proc_inst_id", proc_inst_id) .in("form_type",finish) .select("activity_id","update_time","form_type","form_id")); + Set tmpFormTypes = historys.stream().map(ActHiExecution::getForm_type).collect(Collectors.toSet()); + List tmpFormTypeCollect = iBmFormStrucService.list(new QueryWrapper().in("form_type", tmpFormTypes)); + Set baseFromCollect = tmpFormTypeCollect.stream().filter(BmFormStruc::getIs_base).map(BmFormStruc::getForm_type).collect(Collectors.toSet()); for (ActHiExecution history : historys) { StringBuffer sql = new StringBuffer(); sql.append("update ") - .append(history.getForm_type()) + .append(baseFromCollect.contains(history.getForm_type())?history.getForm_type():"pm_form_data") .append(" set status = ") .append("'"+StatusEnum.FORM_STATUS.code("完成")+"'") .append(" where id = ") diff --git a/wms_pro/qd/src/views/wms/config_manage/formStruc/index.vue b/wms_pro/qd/src/views/wms/config_manage/formStruc/index.vue index c31e634e..826916e3 100644 --- a/wms_pro/qd/src/views/wms/config_manage/formStruc/index.vue +++ b/wms_pro/qd/src/views/wms/config_manage/formStruc/index.vue @@ -97,30 +97,38 @@ + + + + + + + + + + - - + + - - @@ -177,6 +185,7 @@ + @@ -241,6 +250,7 @@ const defaultForm = { pcsn: null, form_param: null, has_child: false, + is_base: false, parent_id: null, convert_json: null, bus_data: null @@ -252,7 +262,7 @@ export default { mixins: [ presenter(), header(), form(defaultForm), crud() ], cruds() { return CRUD({ - title: '基础类别', + title: '自定义表单', url: 'api/bmFormStruc', idField: 'id', sort: 'id,desc', @@ -300,12 +310,8 @@ export default { resolve(tree.children) }, 100) }, - booleanFormat(row, index) { - if (row.has_child) { - return '是' - } else { - return '否' - } + booleanFormat(row, column, cellValue) { + return cellValue ? '是' : '否'; }, jsonFormat(row, index) { if (row.form_param != null) { diff --git a/wms_pro/qd/src/views/wms/early_manage/early_data/index.vue b/wms_pro/qd/src/views/wms/early_manage/early_data/index.vue index 883f4b15..ca057403 100644 --- a/wms_pro/qd/src/views/wms/early_manage/early_data/index.vue +++ b/wms_pro/qd/src/views/wms/early_manage/early_data/index.vue @@ -240,7 +240,7 @@ export default { mixins: [presenter(), header(), form(defaultForm), crud()], cruds() { return CRUD({ - title: '基础类别', + title: '安全超期预警', url: 'api/almEarlyMsg', idField: 'id', sort: 'id,desc', diff --git a/wms_pro/qd/src/views/wms/early_manage/early_inv/index.vue b/wms_pro/qd/src/views/wms/early_manage/early_inv/index.vue index 2168f30c..73d70c46 100644 --- a/wms_pro/qd/src/views/wms/early_manage/early_inv/index.vue +++ b/wms_pro/qd/src/views/wms/early_manage/early_inv/index.vue @@ -230,7 +230,7 @@ export default { mixins: [presenter(), header(), form(defaultForm), crud()], cruds() { return CRUD({ - title: '基础类别', + title: '安全库存预警', url: '/api/almEarlyInv', idField: 'id', sort: 'id,desc', diff --git a/wms_pro/qd/src/views/wms/flow_manage/logicflow/PropertySetting/ServerTaskProperties.vue b/wms_pro/qd/src/views/wms/flow_manage/logicflow/PropertySetting/ServerTaskProperties.vue index 52a13284..8894a75c 100644 --- a/wms_pro/qd/src/views/wms/flow_manage/logicflow/PropertySetting/ServerTaskProperties.vue +++ b/wms_pro/qd/src/views/wms/flow_manage/logicflow/PropertySetting/ServerTaskProperties.vue @@ -46,7 +46,7 @@ - + @@ -114,9 +114,6 @@ export default { passNode: [ {required: true, message: '自动执行不能为空', trigger: 'blur'} ], - auxParam: [ - {required: true, message: 'auxParam不能为空', trigger: 'blur'} - ] } } }, diff --git a/wms_pro/qd/src/views/wms/md_manage/group_dick/group_config/index.vue b/wms_pro/qd/src/views/wms/md_manage/group_dick/group_config/index.vue index 7f1c5565..8e06e242 100644 --- a/wms_pro/qd/src/views/wms/md_manage/group_dick/group_config/index.vue +++ b/wms_pro/qd/src/views/wms/md_manage/group_dick/group_config/index.vue @@ -69,7 +69,7 @@ export default { mixins: [ presenter(), header(), form(defaultForm), crud() ], cruds() { return CRUD({ - title: '基础类别', + title: '组盘配置', url: 'api/bmFormStruc', idField: 'id', sort: 'id,desc', diff --git a/wms_pro/qd/src/views/wms/pm_manage/form_data/index.vue b/wms_pro/qd/src/views/wms/pm_manage/form_data/index.vue index 4a784c7b..d2be4e3d 100644 --- a/wms_pro/qd/src/views/wms/pm_manage/form_data/index.vue +++ b/wms_pro/qd/src/views/wms/pm_manage/form_data/index.vue @@ -183,7 +183,7 @@ export default { mixins: [presenter(), header(), form(defaultForm), crud()], cruds() { return CRUD({ - title: '基础类别', + title: '表单数据', url: 'api/pmFormData', idField: 'id', sort: 'id,desc', diff --git a/wms_pro/qd/src/views/wms/stor_manage/warehouse/pick/index.vue b/wms_pro/qd/src/views/wms/stor_manage/warehouse/pick/index.vue index 769b1469..73d3bcfc 100644 --- a/wms_pro/qd/src/views/wms/stor_manage/warehouse/pick/index.vue +++ b/wms_pro/qd/src/views/wms/stor_manage/warehouse/pick/index.vue @@ -202,7 +202,7 @@ export default { mixins: [presenter(), header(), form(defaultForm), crud()], cruds() { return CRUD({ - title: '基础类别', + title: '拣选', url: 'api/pmFormData', idField: 'id', sort: 'id,desc',