| | |
| | | private ISysDictService sysDictService; |
| | | @Resource |
| | | private ISysUserService sysUserService; |
| | | @Resource |
| | | private IEamBaseHFCodeService eamBaseHFCodeService; |
| | | |
| | | @Override |
| | | public IPage<EamInspectionOrder> queryPageList(Page<EamInspectionOrder> page, EamInspectionOrderQuery query) { |
| | |
| | | //修改状态 |
| | | eamInspectionOrder.setInspectionStatus(InspectionStatus.WAIT_INSPECTION.name()); |
| | | eamInspectionOrder.setDelFlag(CommonConstant.DEL_FLAG_0); |
| | | //HF码处理 |
| | | EamBaseHFCode eamBaseHFCode = eamBaseHFCodeService.selectByCategory(HfTemplateCategoryEnum.INSPECTION.name()); |
| | | if (eamBaseHFCode == null) { |
| | | return Result.error("添加失败,未配置点检HF编码!"); |
| | | } |
| | | eamInspectionOrder.setHfCode(eamBaseHFCode.getHfCode()); |
| | | save(eamInspectionOrder); |
| | | //处理日点检明细数据 |
| | | if (StrUtil.isNotBlank(eamInspectionOrderRequest.getStandardId())) { |
| | |
| | | throw new JeecgBootException("设备不存在,请检查!"); |
| | | } |
| | | |
| | | // 检查周保过期时间 |
| | | if (eamInspectionOrderRequest.getTableWeekDetailList() == null || eamInspectionOrderRequest.getTableWeekDetailList().isEmpty()) { |
| | | List<EamWeekInspectionDetail> weekInspectionDetailList = eamWeekInspectionDetailService.list(new LambdaQueryWrapper<EamWeekInspectionDetail>().eq(EamWeekInspectionDetail::getStandardId, eamInspectionOrderRequest.getStandardId()).between(EamWeekInspectionDetail::getPlanInspectionDate, DateUtils.getFirstDayOfWeek(eamInspectionOrderRequest.getInspectionDate()), DateUtils.getLastDayOfWeek(eamInspectionOrderRequest.getInspectionDate()))); |
| | | if (weekInspectionDetailList != null && !weekInspectionDetailList.isEmpty()) { |
| | | if (StrUtil.isEmpty(eamInspectionOrderRequest.getOperator())) { |
| | | Date lastDate = DateUtils.getLastDayOfWeek(eamInspectionOrderRequest.getInspectionDate()); |
| | | if (DateUtils.isSameDay(lastDate, new Date())) { |
| | | throw new JeecgBootException("本周点检未完成,请进行填报!"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 设置流程变量 |
| | | setupProcessVariables(eamInspectionOrderRequest, eamInspectionOrder, user, equipment); |
| | | |
| | |
| | | values.put("organization", "点检人点检结束"); |
| | | values.put("comment", "点检人点检结束"); |
| | | // 获取下一步执行人 |
| | | List<UserSelector> userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), null, BusinessCodeConst.PCR0002); |
| | | List<UserSelector> userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getFactoryOrgCode(), BusinessCodeConst.PCR0002); |
| | | if (CollectionUtil.isEmpty(userSelectors)) { |
| | | throw new JeecgBootException("设备未分配给维修工,无法进入下级审批!"); |
| | | } |
| | | List<String> userApprovalList = userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList()); |
| | | values.put("NextAssignee", userApprovalList); |
| | | request.setComment("点检人点检结束"); |