rev:异步触发流程

This commit is contained in:
zhangzq
2024-05-28 09:56:06 +08:00
parent 77b4e88f49
commit 67b8c5fe65
3 changed files with 5 additions and 4 deletions

View File

@@ -26,7 +26,6 @@ public class ServerTaskActivityBehavior extends FlowNodeActivityBehavior<JSONObj
@Override @Override
@Transactional
public void execute(ExecutionEntity<JSONObject> entity) { public void execute(ExecutionEntity<JSONObject> entity) {
FlowElement element = entity.getCurrentFlowElement(); FlowElement element = entity.getCurrentFlowElement();

View File

@@ -7,6 +7,7 @@ import org.nl.common.domain.exception.BadRequestException;
import org.nl.common.enums.StatusEnum; import org.nl.common.enums.StatusEnum;
import org.nl.common.utils.ListOf; import org.nl.common.utils.ListOf;
import org.nl.common.utils.RedissonUtils; import org.nl.common.utils.RedissonUtils;
import org.nl.common.utils.SpringContextHolder;
import org.nl.wms.stor_manage.struct.service.IStIvtStructattrService; import org.nl.wms.stor_manage.struct.service.IStIvtStructattrService;
import org.nl.wms.stor_manage.struct.service.dao.StIvtStructattr; import org.nl.wms.stor_manage.struct.service.dao.StIvtStructattr;
import org.nl.wms.config_manage.form_struc.service.dao.BmFormStruc; import org.nl.wms.config_manage.form_struc.service.dao.BmFormStruc;
@@ -57,9 +58,10 @@ public class DecisionHandler extends TypeHandler<JSONObject,ExecutionEntity<JSON
JSONObject t = entity.getT(); JSONObject t = entity.getT();
JSONObject item_json = t.getJSONObject("t"); JSONObject item_json = t.getJSONObject("t");
StIvtIostorinvdtl iostorinvdtl = item_json.toJavaObject(StIvtIostorinvdtl.class); StIvtIostorinvdtl iostorinvdtl = item_json.toJavaObject(StIvtIostorinvdtl.class);
List<StIvtStructattr> list = dispense(params, iostorinvdtl); List<StIvtStructattr> list = SpringContextHolder.getBean(DecisionHandler.class).dispense(params, iostorinvdtl);
//更新仓位,更新数据 //更新仓位,更新数据
String collect = list.stream().map(StIvtStructattr::getStruct_code).collect(Collectors.joining(",")); String collect = list.stream().map(StIvtStructattr::getStruct_code).collect(Collectors.joining(","));
System.out.println("更新明细id"+iostorinvdtl.getId());
stIvtIostorinvdtlInService.update(new UpdateWrapper<StIvtIostorinvdtl>() stIvtIostorinvdtlInService.update(new UpdateWrapper<StIvtIostorinvdtl>()
.set("struct_code",collect) .set("struct_code",collect)
.eq("id",iostorinvdtl.getId())); .eq("id",iostorinvdtl.getId()));
@@ -99,7 +101,7 @@ public class DecisionHandler extends TypeHandler<JSONObject,ExecutionEntity<JSON
list= ListOf.of(list.get(0)); list= ListOf.of(list.get(0));
} }
structCode.set(list); structCode.set(list);
System.out.println("分配的货位"+list.toString()); System.out.println("分配的货位"+list.stream().map(StIvtStructattr::getStruct_code).collect(Collectors.joining(",")));
iStIvtStructattrService.update(new UpdateWrapper<StIvtStructattr>() iStIvtStructattrService.update(new UpdateWrapper<StIvtStructattr>()
// .set("vehicle_code", iostorinvdtl.getVehicle_code()) // .set("vehicle_code", iostorinvdtl.getVehicle_code())
.set("lock_type", StatusEnum.LOCK.code(iostorinvdtl.getIn_storage()?"":"")) .set("lock_type", StatusEnum.LOCK.code(iostorinvdtl.getIn_storage()?"":""))

View File

@@ -112,7 +112,7 @@ public class MdGruopDickServiceImpl extends ServiceImpl<MdGruopDickMapper, MdGru
.set("proc_inst_id",proc_inst_id).eq("id",mdGroupMst.getId())); }) .set("proc_inst_id",proc_inst_id).eq("id",mdGroupMst.getId())); })
.build("md_group_dick",mdGroupMst.getId(),mdGroupMst.getSource_form_type(),mdGroupMst.getSource_form_id(),forms) .build("md_group_dick",mdGroupMst.getId(),mdGroupMst.getSource_form_type(),mdGroupMst.getSource_form_id(),forms)
.build("md_group_dtl",dtlJson) .build("md_group_dtl",dtlJson)
,true); ,false);
} }
@Override @Override