add:仓位查看载具修改
This commit is contained in:
@@ -2,6 +2,7 @@ package org.nl.wms.flow_manage.flow.framework.converter.node.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.wms.flow_manage.flow.framework.BpmnModel;
|
||||
import org.nl.wms.flow_manage.flow.framework.converter.node.BaseNodeConverter;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowNode;
|
||||
@@ -32,11 +33,9 @@ public class ExecuteFlowConverter extends BaseNodeConverter {
|
||||
executeFlow.setDocumentation(properties.getString("documentation"));
|
||||
//设置触发事件
|
||||
executeFlow.setExecutionListeners(null);
|
||||
JSONArray skipExpressions = properties.getJSONArray("skipExpression");
|
||||
if (skipExpressions!=null){
|
||||
for (int i = 0; i < skipExpressions.size(); i++) {
|
||||
executeFlow.getSkipExpression().add(skipExpressions.getString(i));
|
||||
}
|
||||
String skipExpression = properties.getString("skipExpression");
|
||||
if (StringUtils.isNotEmpty(skipExpression)){
|
||||
executeFlow.setSkipExpression(skipExpression);
|
||||
}
|
||||
if (pass!=null && pass){
|
||||
model.getPassNode().add(type);
|
||||
|
||||
@@ -1,22 +1,24 @@
|
||||
package org.nl.wms.flow_manage.flow.framework.engine.behavior.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.domain.exception.BadRequestException;
|
||||
import org.nl.common.utils.SpelUtil;
|
||||
import org.nl.common.utils.SpringContextHolder;
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.behavior.FlowNodeActivityBehavior;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.ExecutionEntity;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowElement;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.Sequence.SequenceFlow;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.gateway.GateWay;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.task.impl.ExecuteFlow;
|
||||
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.pm_manage.form_data.service.IPmFormDataService;
|
||||
import org.nl.wms.pm_manage.form_data.service.dao.PmFormData;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2024/3/18 13:17
|
||||
@@ -26,27 +28,50 @@ import org.springframework.stereotype.Service;
|
||||
public class ExecuteFlowActivityBehavior extends FlowNodeActivityBehavior<JSONObject> {
|
||||
|
||||
@Autowired
|
||||
private IActHiExecutionService actHiExecutionService;
|
||||
private IActHiExecutionService iActHiExecutionService;
|
||||
|
||||
@Autowired
|
||||
private IPmFormDataService iPmFormDataService;
|
||||
|
||||
@Override
|
||||
public void execute(ExecutionEntity<JSONObject> entity) {
|
||||
FlowElement element = entity.getCurrentFlowElement();
|
||||
ExecuteFlow executeFlow = (ExecuteFlow) element;
|
||||
String source_data = executeFlow.getSource_data();
|
||||
ActHiExecution one = actHiExecutionService.getOne(new QueryWrapper<ActHiExecution>()
|
||||
ActHiExecution one = iActHiExecutionService.getOne(new QueryWrapper<ActHiExecution>()
|
||||
.eq("activity_id", source_data)
|
||||
.eq("proc_inst_id", entity.getProc_inst_id()));
|
||||
executeFlow.getDataSource();
|
||||
JSONObject sourceData;
|
||||
ExecuteFlow.DataSourceEnum dataSource = executeFlow.getDataSource();
|
||||
switch (dataSource){
|
||||
case FLOWNODE:
|
||||
sourceData = one.getForm_data().getJSONObject("t");
|
||||
break;
|
||||
case DATASORUCE:
|
||||
PmFormData formData = iPmFormDataService.getOne(new QueryWrapper<PmFormData>()
|
||||
.eq("id", one.getForm_id()).eq("form_type", one.getForm_type()));
|
||||
sourceData = (JSONObject) JSON.toJSON(formData);
|
||||
break;
|
||||
default:
|
||||
throw new IllegalStateException("Unexpected value: " + dataSource);
|
||||
}
|
||||
String skipExpression = executeFlow.getSkipExpression();
|
||||
if (StringUtils.isNotEmpty(skipExpression)) {
|
||||
Boolean parse = SpelUtil.parse(sourceData, skipExpression, Boolean.class);
|
||||
if (!parse){
|
||||
throw new BadRequestException("当前中转节点数据校验不通过"+skipExpression+",无法跳转到下个节点");
|
||||
}
|
||||
}
|
||||
//处理流程线:将结果值封装
|
||||
super.execute(entity);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String data = "{\"stor_code\":\"FStockId\",\"vehicleMaterMap\":{\"D00001\":{\"stor_code\":\"FStockId\",\"create_time\":\"2024-06-11 15:39:47\",\"task_code\":\"28457\",\"form_data\":{\"FMoBillNo\":\"\",\"single_weight\":\"\"},\"group_id\":\"1800432729389666304\",\"qty\":333,\"proc_inst_id\":\"1800433990847565824\",\"is_lock\":true,\"pcsn\":\"11\",\"material_id\":\"FMaterialId\",\"id\":\"1800432729389666305\",\"has_child\":false,\"frozen_qty\":333,\"vehicle_code\":\"D00001\",\"source_form_id\":\"1798554623695523840\",\"source_form_type\":\"PRD_FeedMtrl\",\"create_name\":\"管理员\"},\"D00002\":{\"stor_code\":\"FStockId\",\"create_time\":\"2024-06-11 15:41:39\",\"task_code\":\"28458\",\"form_data\":{\"FMoBillNo\":\"\",\"single_weight\":\"\"},\"group_id\":\"1800433197683707904\",\"qty\":222,\"proc_inst_id\":\"1800435270215143424\",\"is_lock\":true,\"pcsn\":\"11\",\"material_id\":\"FMaterialId\",\"id\":\"1800433197683707905\",\"has_child\":false,\"frozen_qty\":67,\"vehicle_code\":\"D00002\",\"source_form_id\":\"1798554665118470144\",\"source_form_type\":\"PRD_FeedMtrl\",\"create_name\":\"管理员\"}},\"form_data\":{\"order\":\"\"},\"qty\":400,\"pcsn\":\"11\",\"material_id\":\"FMaterialId\",\"id\":\"1800435564550426624\",\"inv_id\":\"1800435564521066496\",\"vehicle_code\":\"D00002\",\"source_form_id\":\"1798554623695523840\",\"unit_id\":\"16\",\"source_form_type\":\"PRD_FeedMtrl\",\"status\":\"10\"}";
|
||||
String data = "{\"item\":null,\"t\":{\"source_form_date\":null,\"code\":null,\"assign_qty\":0,\"create_time\":\"2024-06-28 15:43:54\",\"remark\":null,\"form_type\":\"st_ivt_checkdtl\",\"update_name\":null,\"update_time\":null,\"form_data\":{\"stor_code\":\"FStockId\",\"check_qty\":\"\",\"profit_loss\":\"\",\"struct_code\":\"L07-15-01\"},\"parent_id\":\"1806594357017579520\",\"qty\":150,\"proc_inst_id\":null,\"pcsn\":\"11\",\"material_id\":\"1744270387455332362\",\"id\":\"1806594357176963072\",\"vehicle_code\":\"D00005\",\"source_form_id\":null,\"unit_id\":\"16\",\"source_form_type\":null,\"status\":\"10\",\"create_name\":\"管理员\"},\"form_id\":\"1806594357176963072\",\"form_type\":\"st_ivt_checkdtl\",\"source_form_id\":null,\"source_form_type\":null}\n";
|
||||
JSONObject jsonObject = JSONObject.parseObject(data);
|
||||
System.out.println(jsonObject.toJSONString());
|
||||
JSONObject dataj = jsonObject.getJSONObject("t");
|
||||
// "#M['vehicleMaterMap'][M['vehicle_code']]['qty']"
|
||||
Boolean parse = SpelUtil.parse(jsonObject, "#M['vehicleMaterMap'][#M['vehicle_code']]['frozen_qty'] < #M['vehicleMaterMap'][#M['vehicle_code']]['qty']", Boolean.class);
|
||||
String parse = SpelUtil.parse(dataj, "#M['form_data']['check_qty'] != ''", String.class);
|
||||
System.out.println(parse);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,13 +25,13 @@ public class ExecuteFlow extends ExecuteTask {
|
||||
/**
|
||||
* 跳过表达式:逐级
|
||||
*/
|
||||
private List<String> skipExpression = new ArrayList<>();
|
||||
private String skipExpression;
|
||||
|
||||
public void setDataSource(String dataSource) {
|
||||
this.dataSource = DataSourceEnum.getByCode(dataSource);
|
||||
}
|
||||
|
||||
enum DataSourceEnum{
|
||||
public enum DataSourceEnum{
|
||||
/**
|
||||
* 实时数据库
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.nl.wms.pda_manage.palletio;
|
||||
package org.nl.wms.pda_manage.palletio.controller;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
@@ -35,6 +35,9 @@
|
||||
<if test="query.has == true">
|
||||
and struct.vehicle_code is not null and struct.lock_type = '00'
|
||||
</if>
|
||||
<if test="query.has_vehicle == true">
|
||||
and struct.vehicle_code is not null
|
||||
</if>
|
||||
<if test="query.has == false">
|
||||
and struct.vehicle_code is null and struct.lock_type = '00'
|
||||
</if>
|
||||
|
||||
@@ -19,6 +19,7 @@ public class StructattrQuery extends BaseQuery<StIvtStructattr> {
|
||||
private String lock_type;
|
||||
private Boolean is_used;
|
||||
private String vehicle_code;
|
||||
private Boolean has_vehicle = Boolean.FALSE;
|
||||
private String material;
|
||||
private Boolean has;
|
||||
@Override
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.d_lock_type"
|
||||
v-for="item in statusEnum.LOCK"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
@@ -50,6 +50,16 @@
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否有货">
|
||||
<el-switch
|
||||
v-model="query.has_vehicle"
|
||||
:active-value=true
|
||||
:inactive-value=false
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
@change="hand"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用">
|
||||
<el-switch
|
||||
v-model="query.is_used"
|
||||
@@ -91,15 +101,9 @@
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="归属库区" prop="sect_id">
|
||||
<el-cascader
|
||||
v-model="form.cascader"
|
||||
style="width: 200px;"
|
||||
:options="sects"
|
||||
clearable
|
||||
@change="sectChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<<el-form-item label="归属库区" prop="sect_name">
|
||||
<el-input v-model="form.sect_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否临时" prop="is_tempstruct">
|
||||
@@ -123,7 +127,7 @@
|
||||
placeholder=""
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.d_lock_type"
|
||||
v-for="item in statusEnum.LOCK"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
@@ -215,7 +219,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="lock_type" label="锁定类型" min-width="120" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.d_lock_type[scope.row.lock_type] }}
|
||||
{{ statusEnum.label.LOCK[scope.row.lock_type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否启用" align="center" prop="is_used">
|
||||
@@ -317,6 +321,7 @@ const defaultForm = {
|
||||
export default {
|
||||
name: 'Structattr',
|
||||
dicts: ['ST_HEIGHT_TYPE', 'is_used', 'd_lock_type', 'SCH_TASK_TYPE_DTL', 'placement_type'],
|
||||
statusEnums: ['LOCK'],
|
||||
tableEnums: [ 'st_ivt_bsrealstorattr#stor_name#id' ],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
|
||||
Reference in New Issue
Block a user