| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.ibatis.type.JdbcType; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.flowable.engine.TaskService; |
| | | import org.flowable.task.api.Task; |
| | |
| | | import org.jeecg.modules.eam.service.IEamThirdMaintenanceOrderService; |
| | | import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness; |
| | | import org.jeecg.modules.flowable.apithird.business.service.IFlowMyBusinessService; |
| | | import org.jeecg.modules.flowable.apithird.service.FlowCallBackServiceI; |
| | | import org.jeecg.modules.flowable.apithird.service.FlowCommonService; |
| | | import org.jeecg.modules.flowable.service.IFlowDefinitionService; |
| | | import org.jeecg.modules.flowable.service.IFlowTaskService; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.sql.Timestamp; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | * @Date: 2025-07-11 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Service |
| | | public class EamThirdMaintenanceChangeServiceImpl extends ServiceImpl<EamThirdMaintenanceChangeMapper, EamThirdMaintenanceChange> implements IEamThirdMaintenanceChangeService { |
| | | @Service("IEamThirdMaintenanceChangeService") |
| | | public class EamThirdMaintenanceChangeServiceImpl extends ServiceImpl<EamThirdMaintenanceChangeMapper, EamThirdMaintenanceChange> implements IEamThirdMaintenanceChangeService, FlowCallBackServiceI { |
| | | |
| | | @Resource |
| | | private EamThirdMaintenanceChangeMapper eamThirdMaintenanceChangeMapper; |
| | |
| | | request.setApplicant(sysUser.getUsername()); |
| | | request.setApplyDate(new Date()); |
| | | request.setFactoryOrgCode(equipment.getFactoryOrgCode()); |
| | | request.setEquipmentId(equipment.getId()); |
| | | // 三保变更工单HF |
| | | EamBaseHFCode eamBaseHFCode = hfCodeService.selectByCategory(HfTemplateCategoryEnum.THIRD_MAINTENANCE_CHANGE.name()); |
| | | if (eamBaseHFCode == null) { |
| | |
| | | } |
| | | entity.setApplyReasonType(request.getApplyReasonType()); |
| | | entity.setApplyReason(request.getApplyReason()); |
| | | entity.setRemark(request.getRemark()); |
| | | entity.setApplyCategory(request.getApplyCategory()); |
| | | if ("SCRAPPED".equals(request.getApplyCategory())) { |
| | | // 直接设为 null |
| | | entity.setDeferredMaintenanceDate(null); |
| | | } else { |
| | | entity.setDeferredMaintenanceDate(request.getDeferredMaintenanceDate()); |
| | | } |
| | | this.getBaseMapper().updateById(entity); |
| | | return true; |
| | | } |
| | |
| | | if(BusinessCodeConst.APPROVED.equals(request.getProductionSupportSignatureResult())) { |
| | | //通过 |
| | | entity.setChangeStatus(ThirdMaintenanceChangeStatusEnum.COMPLETED.name()); |
| | | order.setMaintenanceStatus(ThirdMaintenanceStatusEnum.WAIT_MAINTENANCE.name()); |
| | | order.setMaintenanceDate(entity.getDeferredMaintenanceDate()); |
| | | if ("SCRAPPED".equals(request.getApplyCategory())) { |
| | | order.setMaintenanceDate(null); |
| | | order.setMaintenanceStatus(ThirdMaintenanceStatusEnum.ABOLISH.name()); |
| | | } else { |
| | | order.setMaintenanceDate(entity.getDeferredMaintenanceDate()); |
| | | order.setMaintenanceStatus(ThirdMaintenanceStatusEnum.WAIT_MAINTENANCE.name()); |
| | | } |
| | | thirdMaintenanceOrderService.updateById(order); |
| | | }else { |
| | | //驳回 |
| | |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public void afterFlowHandle(FlowMyBusiness business) { |
| | | business.getTaskNameId();//接下来审批的节点 |
| | | business.getValues();//前端传进来的参数 |
| | | business.getActStatus(); |
| | | } |
| | | |
| | | @Override |
| | | public Object getBusinessDataById(String dataId) { |
| | | return this.getById(dataId); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> flowValuesOfTask(String taskNameId, Map<String, Object> values) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public List<String> flowCandidateUsernamesOfTask(String taskNameId, Map<String, Object> values) { |
| | | //业务是否干预流程,业务干预,流程干预,指定人员进行处理 |
| | | //获取下一步处理人 |
| | | Object object = values.get("NextAssignee"); |
| | | return (List<String>) object; |
| | | } |
| | | } |