| | |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.eam.aspect.annotation.EquipmentHistoryLog; |
| | | import org.jeecg.modules.eam.constant.BusinessCodeConst; |
| | | import org.jeecg.modules.eam.constant.EquipmentMaintenanceStatus; |
| | | import org.jeecg.modules.eam.constant.EquipmentOperationTagEnum; |
| | | import org.jeecg.modules.eam.constant.InspectionStatus; |
| | | import org.jeecg.modules.eam.entity.EamEquipment; |
| | |
| | | import org.jeecg.modules.eam.mapper.EamInspectionOrderMapper; |
| | | import org.jeecg.modules.eam.request.EamInspectionOrderQuery; |
| | | import org.jeecg.modules.eam.request.EamInspectionOrderRequest; |
| | | import org.jeecg.modules.eam.service.IEamEquipmentService; |
| | | import org.jeecg.modules.eam.service.IEamInspectionOrderDetailService; |
| | | import org.jeecg.modules.eam.service.IEamInspectionOrderService; |
| | | import org.jeecg.modules.eam.service.IEamReportRepairService; |
| | | import org.jeecg.modules.eam.service.*; |
| | | import org.jeecg.modules.eam.vo.EquipmentInspectionStatistics; |
| | | import org.jeecg.modules.eam.vo.EquipmentRepairStatistics; |
| | | import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness; |
| | | import org.jeecg.modules.flowable.apithird.business.service.impl.FlowMyBusinessServiceImpl; |
| | | import org.jeecg.modules.flowable.apithird.service.FlowCallBackServiceI; |
| | |
| | | import org.jeecg.modules.flowable.service.IFlowDefinitionService; |
| | | import org.jeecg.modules.flowable.service.IFlowTaskService; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | import org.jeecg.modules.system.service.IMdcProductionService; |
| | | import org.jeecg.modules.system.service.IMdcUserProductionService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDate; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | private IMdcUserProductionService mdcUserProductionService; |
| | | @Autowired |
| | | private IEamReportRepairService eamReportRepairService; |
| | | @Autowired |
| | | private IEamEquipmentExtendService eamEquipmentExtendService; |
| | | @Autowired |
| | | private IMdcProductionService mdcProductionService; |
| | | |
| | | @Override |
| | | public IPage<EamInspectionOrder> queryPageList(Page<EamInspectionOrder> page, EamInspectionOrderQuery query) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<EquipmentInspectionStatistics> equipmentInspectionStatistics(String productionId, LocalDate firstOfMonth, LocalDate today) { |
| | | if (StringUtils.isNotBlank(productionId)) { |
| | | //车间编码不为空 |
| | | List<String> productIds = mdcProductionService.recursionChildren(productionId); |
| | | if (CollectionUtil.isEmpty(productIds)) { |
| | | return Collections.emptyList(); |
| | | } |
| | | List<EquipmentInspectionStatistics> list = this.baseMapper.equipmentInspectionStatistics(productIds, firstOfMonth.toString(), today.plusDays(1).toString()); |
| | | if (CollectionUtil.isEmpty(list)) { |
| | | return Collections.emptyList(); |
| | | } |
| | | return list; |
| | | } |
| | | List<EquipmentInspectionStatistics> list = this.baseMapper.equipmentInspectionStatistics(null, firstOfMonth.toString(), today.plusDays(1).toString()); |
| | | if (CollectionUtil.isEmpty(list)) { |
| | | return Collections.emptyList(); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean addInspectionOrder(EamInspectionOrderRequest eamInspectionOrderRequest) { |
| | | EamInspectionOrder eamInspectionOrder = new EamInspectionOrder(); |
| | |
| | | } |
| | | if (StrUtil.isNotBlank(eamInspectionOrderRequest.getOperator())) { |
| | | triggerProcess(eamInspectionOrder); |
| | | //更新设备保养状态 |
| | | eamEquipmentExtendService.updateEquipmentInspectionStatus(eamInspectionOrder.getEquipmentId(), EquipmentMaintenanceStatus.UNDER_INSPECTION.name()); |
| | | } |
| | | return true; |
| | | } |
| | |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public boolean editInspectionOrder(EamInspectionOrderRequest eamInspectionOrderRequest) { |
| | | EamInspectionOrder eamInspectionOrder = new EamInspectionOrder(); |
| | | BeanUtils.copyProperties(eamInspectionOrderRequest, eamInspectionOrder); |
| | | if (StrUtil.isNotEmpty(eamInspectionOrder.getOperator())) { |
| | | eamInspectionOrder.setInspectionStatus(InspectionStatus.UNDER_INSPECTION.name()); |
| | | triggerProcess(eamInspectionOrder); |
| | | //更新设备保养状态 |
| | | eamEquipmentExtendService.updateEquipmentInspectionStatus(eamInspectionOrder.getEquipmentId(), EquipmentMaintenanceStatus.UNDER_INSPECTION.name()); |
| | | } |
| | | super.updateById(eamInspectionOrder); |
| | | //处理明细数据 |
| | |
| | | eamInspectionOrder.setInspectionStatus(InspectionStatus.UNDER_INSPECTION.name()); |
| | | this.triggerProcess(eamInspectionOrder); |
| | | this.updateById(eamInspectionOrder); |
| | | //更新设备保养状态 |
| | | eamEquipmentExtendService.updateEquipmentInspectionStatus(eamInspectionOrder.getEquipmentId(), EquipmentMaintenanceStatus.UNDER_INSPECTION.name()); |
| | | return true; |
| | | } |
| | | } |
| | |
| | | } |
| | | eamInspectionOrderDetailService.remove(new QueryWrapper<EamInspectionOrderDetail>().eq("order_id", order.getId())); |
| | | eamInspectionOrderDetailService.saveBatch(request.getTableDetailList()); |
| | | //更新设备保养状态 |
| | | eamEquipmentExtendService.updateEquipmentInspectionStatus(order.getEquipmentId(), EquipmentMaintenanceStatus.INSPECTION_CONFIRM.name()); |
| | | } else if (InspectionStatus.WAIT_CONFIRM.name().equals(order.getInspectionStatus()) && StrUtil.isNotEmpty(request.getConfirmDealType())) { |
| | | // 班组长确认任务 |
| | | order.setInspectionStatus(InspectionStatus.COMPLETE.name()); |
| | |
| | | order.setConfirmComment(request.getConfirmComment()); |
| | | order.setConfirmDealType(request.getConfirmDealType()); |
| | | order.setConfirmTime(new Date()); |
| | | //更新设备保养状态 |
| | | eamEquipmentExtendService.updateEquipmentInspectionStatus(order.getEquipmentId(), EquipmentMaintenanceStatus.NORMAL.name()); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (InspectionStatus.UNDER_INSPECTION.name().equals(type)) { |
| | | eamInspectionOrder.setOperator(loginUser.getUsername()); |
| | | this.triggerProcess(eamInspectionOrder); |
| | | //更新设备保养状态 |
| | | eamEquipmentExtendService.updateEquipmentInspectionStatus(eamInspectionOrder.getEquipmentId(), EquipmentMaintenanceStatus.UNDER_INSPECTION.name()); |
| | | } else { |
| | | eamInspectionOrder.setOperator(null); |
| | | } |