| | |
| | | package com.by4cloud.platformx.business.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.by4cloud.platformx.business.api.feign.RemoteFlowProcessService; |
| | | import com.by4cloud.platformx.business.constant.FlowNameEnum; |
| | | import com.by4cloud.platformx.business.entity.Contract; |
| | | import com.by4cloud.platformx.business.entity.ProductionPlan; |
| | | import com.by4cloud.platformx.business.mapper.ProductionPlanMapper; |
| | | import com.by4cloud.platformx.business.service.ProductionPlanService; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | import com.by4cloud.platformx.flow.task.dto.ProcessInstanceParamDto; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 排产计划 |
| | | * |
| | |
| | | * @date 2026-05-07 10:27:42 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class ProductionPlanServiceImpl extends ServiceImpl<ProductionPlanMapper, ProductionPlan> implements ProductionPlanService { |
| | | |
| | | private final RemoteFlowProcessService remoteFlowProcessService; |
| | | |
| | | @Override |
| | | public R startApproval(Long id) { |
| | | ProductionPlan plan = baseMapper.selectById(id); |
| | | //启动流程 |
| | | ProcessInstanceParamDto dto = new ProcessInstanceParamDto(); |
| | | Map<String, Object> map = BeanUtil.beanToMap(plan); |
| | | dto.setParamMap(map); |
| | | dto.setFlowName(FlowNameEnum.排产计划审批.name()); |
| | | |
| | | R r1 = remoteFlowProcessService.startProcessInstance(dto); |
| | | if (r1.getCode() == 1) { |
| | | return R.failed("流程启动失败"); |
| | | } |
| | | plan.setStatus(1); |
| | | baseMapper.updateById(plan); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |