| | |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.flowable.engine.TaskService; |
| | | import org.flowable.task.api.Task; |
| | | import org.jeecg.common.api.vo.FileUploadResult; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.constant.DataBaseConstant; |
| | |
| | | import org.jeecg.modules.system.service.IBaseFactoryService; |
| | | import org.jeecg.modules.system.service.IBaseFactoryUserService; |
| | | import org.jeecg.modules.system.service.ISysUserService; |
| | | import org.jeecg.modules.system.vo.UserSelector; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | private IEamReportRepairService eamReportRepairService; |
| | | @Autowired |
| | | private IEamEquipmentExtendService eamEquipmentExtendService; |
| | | @Autowired |
| | | private IEamPrecisionCheckDetailService precisionCheckDetailService; |
| | | |
| | | @Resource |
| | | private IBaseFactoryUserService baseFactoryUserService; |
| | |
| | | //处理明细数据 |
| | | if (CollectionUtil.isNotEmpty(request.getTableDetailList())) { |
| | | request.getTableDetailList().forEach(tableDetail -> { |
| | | tableDetail.setId(null); |
| | | // tableDetail.setId(null); |
| | | tableDetail.setOrderId(order.getId()); |
| | | }); |
| | | thirdMaintenanceOrderDetailService.saveBatch(request.getTableDetailList()); |
| | | } |
| | | //处理精度参数 |
| | | if (CollectionUtil.isNotEmpty(request.getPrecisionDetailList())) { |
| | | request.getPrecisionDetailList().forEach(tableDetail -> { |
| | | tableDetail.setId(null); |
| | | tableDetail.setOrderId(order.getId()); |
| | | }); |
| | | precisionCheckDetailService.saveBatch(request.getPrecisionDetailList()); |
| | | } |
| | | |
| | | //判断是否存在保养人 如果存在则启动流程 |
| | | if (StringUtils.isNotBlank(order.getOperator())) { |
| | | //启动流程 |
| | | flowCommonService.initActBusiness("工单号:" + order.getOrderNum() + ";设备编号: " + equipment.getEquipmentCode() + ";安装位置" + equipment.getInstallationPosition(), |
| | | order.getId(), "IEamThirdMaintenanceOrderService", "third_maintenance_process", null); |
| | | Map<String, Object> variables = new HashMap<>(); |
| | | variables.put("dataId", order.getId()); |
| | | if (StrUtil.isEmpty(order.getRemark())) { |
| | | variables.put("organization", "新增三保工单默认启动流程"); |
| | | variables.put("comment", "新增三保工单默认启动流程"); |
| | | } else { |
| | | variables.put("organization", order.getRemark()); |
| | | variables.put("comment", order.getRemark()); |
| | | } |
| | | variables.put("proofreading", true); |
| | | //并行任务会签 |
| | | variables.put("maintenance_execution", Collections.singletonList(request.getOperator())); |
| | | // variables.put("precision_check", Collections.singletonList(equipment.getEquipmentManager())); |
| | | Result result = flowDefinitionService.startProcessInstanceByKey("third_maintenance_process", variables); |
| | | if (result != null) { |
| | | //更新设备保养状态 |
| | | eamEquipmentExtendService.updateEquipmentMaintenanceStatus(order.getEquipmentId(), EquipmentMaintenanceStatus.UNDER_THIRD_MAINTENANCE.name()); |
| | | return result.isSuccess(); |
| | | } |
| | | } |
| | | // if (StringUtils.isNotBlank(order.getOperator())) { |
| | | // //启动流程 |
| | | // flowCommonService.initActBusiness("工单号:" + order.getOrderNum() + ";设备编号: " + equipment.getEquipmentCode() + ";安装位置" + equipment.getInstallationPosition(), |
| | | // order.getId(), "IEamThirdMaintenanceOrderService", "third_maintenance_process", null); |
| | | // Map<String, Object> variables = new HashMap<>(); |
| | | // variables.put("dataId", order.getId()); |
| | | // if (StrUtil.isEmpty(order.getRemark())) { |
| | | // variables.put("organization", "新增三保工单默认启动流程"); |
| | | // variables.put("comment", "新增三保工单默认启动流程"); |
| | | // } else { |
| | | // variables.put("organization", order.getRemark()); |
| | | // variables.put("comment", order.getRemark()); |
| | | // } |
| | | // variables.put("proofreading", true); |
| | | // //并行任务会签 |
| | | // variables.put("maintenance_execution", Collections.singletonList(request.getOperator())); |
| | | //// variables.put("precision_check", Collections.singletonList(equipment.getEquipmentManager())); |
| | | // Result result = flowDefinitionService.startProcessInstanceByKey("third_maintenance_process", variables); |
| | | // if (result != null) { |
| | | // //更新设备保养状态 |
| | | // eamEquipmentExtendService.updateEquipmentMaintenanceStatus(order.getEquipmentId(), EquipmentMaintenanceStatus.UNDER_THIRD_MAINTENANCE.name()); |
| | | // return result.isSuccess(); |
| | | // } |
| | | // } |
| | | |
| | | return true; |
| | | } |
| | |
| | | flowCommonService.initActBusiness("工单号:" + entity.getOrderNum() + ";设备编号: " + equipment.getEquipmentCode() + ";安装位置" + equipment.getInstallationPosition(), |
| | | entity.getId(), "IEamThirdMaintenanceOrderService", "third_maintenance_process", null); |
| | | Map<String, Object> variables = new HashMap<>(); |
| | | boolean equipmentPrecisionFlag = precisionCheckDetailService.hasPrecisionCheckDetail(entity.getId()); |
| | | variables.put("equipmentPrecisionFlag", equipmentPrecisionFlag); |
| | | // boolean equipmentPrecisionFlag = precisionCheckDetailService.hasPrecisionCheckDetail(entity.getId()); |
| | | // variables.put("equipmentPrecisionFlag", equipmentPrecisionFlag); |
| | | variables.put("dataId", entity.getId()); |
| | | if (StrUtil.isEmpty(entity.getRemark())) { |
| | | variables.put("organization", "新增三保工单默认启动流程"); |