| | |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<Equipment> queryWrapper = QueryGenerator.initQueryWrapper(equipment, req.getParameterMap()); |
| | | queryWrapper.eq("status","1"); |
| | | queryWrapper.eq("del_flag",0); |
| | | Page<Equipment> page = new Page<Equipment>(pageNo, pageSize); |
| | | IPage<Equipment> pageList = equipmentService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | |
| | | //@RequiresPermissions("org.jeecg.modules.demo:mom_eam_equipment:exportXls") |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, Equipment equipment) { |
| | | return super.exportXls(request, equipment, Equipment.class, "mom_eam_equipment"); |
| | | return super.exportXls(request, equipment, Equipment.class, "设备台账导出"); |
| | | } |
| | | |
| | | // /** |
| | |
| | | for(int i = 0;i<list.size();i++){ |
| | | EquipmentImportVo equipmentImportVo = list.get(i); |
| | | EquipmentCategory equipmentCategory = equipmentCategoryService.getOne(new QueryWrapper<EquipmentCategory>().eq("name",equipmentImportVo.getEquipmentCategoryName()),false); |
| | | if( |
| | | StringUtils.isBlank(equipmentImportVo.getNum()) |
| | | || StringUtils.isBlank(equipmentImportVo.getName()) |
| | | || StringUtils.isBlank(equipmentImportVo.getUseId()) |
| | | || StringUtils.isBlank(equipmentImportVo.getEquipmentUda1()) |
| | | || StringUtils.isBlank(equipmentImportVo.getManageId()) |
| | | || StringUtils.isBlank(equipmentImportVo.getTeamId()) |
| | | || StringUtils.isBlank(equipmentImportVo.getEquipmentImportanceId()) |
| | | || StringUtils.isBlank(equipmentImportVo.getEquipmentCategoryName()) |
| | | || StringUtils.isBlank(equipmentImportVo.getEquipmentStatus()) |
| | | || StringUtils.isBlank(equipmentImportVo.getEquipmentUda3()) |
| | | || StringUtils.isBlank(equipmentImportVo.getEquipmentUda5()) |
| | | || StringUtils.isBlank(equipmentImportVo.getEquipmentUda2()) |
| | | || StringUtils.isBlank(equipmentImportVo.getLeaveFactoryDate()) |
| | | || StringUtils.isBlank(equipmentImportVo.getProjectApprovalNo()) |
| | | || StringUtils.isBlank(equipmentImportVo.getFundSource()) |
| | | || StringUtils.isBlank(equipmentImportVo.getAcceptanceCheckDate()) |
| | | || StringUtils.isBlank(equipmentImportVo.getLeaveFactoryDate()) |
| | | || StringUtils.isBlank(equipmentImportVo.getFactoryNo()) |
| | | || StringUtils.isBlank(equipmentImportVo.getConstructorId()) |
| | | || StringUtils.isBlank(equipmentImportVo.getSourceCountry()) |
| | | || StringUtils.isBlank(equipmentImportVo.getModel()) |
| | | || StringUtils.isBlank(equipmentImportVo.getSpecification()) |
| | | || StringUtils.isBlank(equipmentImportVo.getGpo()) |
| | | ){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:数据有未填项,请填写必填项后再导入;"; |
| | | if(StringUtils.isBlank(equipmentImportVo.getNum())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:统一编码缺失,请填写必填项后再导入;"; |
| | | exceptionNum++; |
| | | }else if(ObjectUtils.isNull(equipmentCategory)) |
| | | } |
| | | else if(StringUtils.isBlank(equipmentImportVo.getName())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:设备名称缺失,请填写必填项后再导入;"; |
| | | exceptionNum++; |
| | | } |
| | | else if(StringUtils.isBlank(equipmentImportVo.getUseId())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:使用部门缺失,请填写必填项后再导入;"; |
| | | exceptionNum++; |
| | | } |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getEquipmentUda1())){ |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:工区缺失,请填写必填项后再导入;"; |
| | | // exceptionNum++; |
| | | // } |
| | | else if(StringUtils.isBlank(equipmentImportVo.getManageId())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:维护部门缺失,请填写必填项后再导入;"; |
| | | exceptionNum++; |
| | | } |
| | | else if(StringUtils.isBlank(equipmentImportVo.getTeamId())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:维修班组缺失,请填写必填项后再导入;"; |
| | | exceptionNum++; |
| | | } |
| | | else if(StringUtils.isBlank(equipmentImportVo.getEquipmentImportanceId())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:ABC标识缺失,请填写必填项后再导入;"; |
| | | exceptionNum++; |
| | | } |
| | | else if(StringUtils.isBlank(equipmentImportVo.getEquipmentCategoryName())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:设备分类缺失,请填写必填项后再导入;"; |
| | | exceptionNum++; |
| | | } |
| | | else if(StringUtils.isBlank(equipmentImportVo.getEquipmentStatus())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:设备状态缺失,请填写必填项后再导入;"; |
| | | exceptionNum++; |
| | | } |
| | | //非必填项 |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getEquipmentUda5())){ |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:功能位置缺失,请填写必填项后再导入;"; |
| | | // exceptionNum++; |
| | | // } |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getLocation())){ |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:安装位置缺失,请填写必填项后再导入;"; |
| | | // exceptionNum++; |
| | | // } |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getLeaveFactoryDate())){ |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:出厂日期缺失,请填写必填项后再导入;"; |
| | | // exceptionNum++; |
| | | // } |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getProjectApprovalNo())){ |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:立项卡号缺失,请填写必填项后再导入;"; |
| | | // exceptionNum++; |
| | | // } |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getFundSource())){ |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:资金来源缺失,请填写必填项后再导入;"; |
| | | // exceptionNum++; |
| | | // } |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getAcceptanceCheckDate())){ |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:验收日期缺失,请填写必填项后再导入;"; |
| | | // exceptionNum++; |
| | | // } |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getLeaveFactoryDate())){ |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:出厂日期缺失,请填写必填项后再导入;"; |
| | | // exceptionNum++; |
| | | // } |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getFactoryNo())){ |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:出厂编号缺失,请填写必填项后再导入;"; |
| | | // exceptionNum++; |
| | | // } |
| | | // else if( StringUtils.isBlank(equipmentImportVo.getConstructorId())){ |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:资产制造商缺失,请填写必填项后再导入;"; |
| | | // exceptionNum++; |
| | | // } |
| | | else if(StringUtils.isBlank(equipmentImportVo.getModel())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:设备型号缺失,请填写必填项后再导入;"; |
| | | exceptionNum++; |
| | | } |
| | | else if(StringUtils.isBlank(equipmentImportVo.getSpecification())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:设备规格缺失,请填写必填项后再导入;"; |
| | | exceptionNum++; |
| | | } |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getGpo())){ |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:设备功率缺失,请填写必填项后再导入;"; |
| | | // exceptionNum++; |
| | | // } |
| | | else if(ObjectUtils.isNull(equipmentCategory)) |
| | | { |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:该设备所属类别不存在,请先维护设备类别;"; |
| | | exceptionNum++; |
| | |
| | | .setEquipmentUda3(equipmentImportVo.getEquipmentUda3()) |
| | | .setEquipmentUda4(equipmentImportVo.getEquipmentUda4()) |
| | | .setEquipmentUda5(equipmentImportVo.getEquipmentUda5()) |
| | | .setLocation(equipmentImportVo.getEquipmentUda2()) |
| | | .setLocation(equipmentImportVo.getLocation()) |
| | | .setLastVerificationDate(equipmentImportVo.getLeaveFactoryDate()) |
| | | .setProjectApprovalNo(equipmentImportVo.getProjectApprovalNo()) |
| | | .setFundSource(equipmentImportVo.getFundSource()) |
| | | .setAcceptanceCheckDate(equipmentImportVo.getAcceptanceCheckDate()) |
| | | .setFactoryNumber(equipmentImportVo.getFactoryNo()) |
| | | .setFactoryNumber(equipmentImportVo.getFactoryNumber()) |
| | | .setConstructorId(equipmentImportVo.getConstructorId()) |
| | | .setSourceCountry(equipmentImportVo.getSourceCountry()) |
| | | .setModel(equipmentImportVo.getModel()) |