| | |
| | | EquipmentImportVo equipmentImportVo = list.get(i); |
| | | String equipmentCategoryName = equipmentImportVo.getEquipmentCategoryName(); |
| | | String useId = equipmentImportVo.getUseId(); |
| | | String areaId = equipmentImportVo.getFactoryModelId(); |
| | | String workCenterId = equipmentImportVo.getWorkCenterId();//中心 |
| | | String areaId = equipmentImportVo.getFactoryModelId();//工区 |
| | | String productionId = equipmentImportVo.getAreaId();//工段 |
| | | String manageId = equipmentImportVo.getManageId(); |
| | | String constructorId = equipmentImportVo.getConstructorId(); |
| | | String teamId = equipmentImportVo.getTeamId(); |
| | |
| | | exceptionNum++; |
| | | continue; |
| | | } |
| | | else if(StringUtils.isBlank(equipmentImportVo.getModel())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:设备型号缺失,请填写必填项后再导入;"; |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getModel())){ |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:设备型号缺失,请填写必填项后再导入;"; |
| | | // exceptionNum++; |
| | | // continue; |
| | | // } |
| | | else if(StringUtils.isBlank(useId)){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:使用部门缺失,请填写必填项后再导入;"; |
| | | exceptionNum++; |
| | | continue; |
| | | } |
| | | else if(StringUtils.isBlank(useId)){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:使用部门缺失,请填写必填项后再导入;"; |
| | | else if(StringUtils.isBlank(workCenterId)){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:中心缺失,请填写必填项后再导入;"; |
| | | exceptionNum++; |
| | | continue; |
| | | } |
| | |
| | | exceptionNum++; |
| | | continue; |
| | | } |
| | | //中心 |
| | | Area workCenterArea = areaService.getOne(new QueryWrapper<Area>().eq("name",workCenterId.trim()).eq("del_flag",0)); |
| | | if(ObjectUtils.isNotNull(workCenterArea)){ |
| | | equipment.setWorkCenterId(workCenterArea.getId()); |
| | | // }else if(ObjectUtils.isNotNull(area1)) { |
| | | // equipment.setFactoryModelId(area1.getId()); |
| | | }else { |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:不存在该中心,请维护中心数据后再导入;"; |
| | | exceptionNum++; |
| | | continue; |
| | | } |
| | | //工区 |
| | | Area area = areaService.getOne(new QueryWrapper<Area>().eq("name",areaId.trim()).eq("del_flag",0)); |
| | | Area area1 = areaService.getOne(new QueryWrapper<Area>().eq("num",areaId.trim()).eq("del_flag",0)); |
| | | if(ObjectUtils.isNotNull(area)){ |
| | |
| | | exceptionNum++; |
| | | continue; |
| | | } |
| | | |
| | | //工段 |
| | | Area productionArea = areaService.getOne(new QueryWrapper<Area>().eq("name",productionId.trim()).eq("del_flag",0)); |
| | | if(ObjectUtils.isNotNull(productionArea)){ |
| | | equipment.setAreaId(productionArea.getId()); |
| | | } |
| | | |
| | | SysDepart manage = departService.getOne(new QueryWrapper<SysDepart>().eq("depart_name",manageId.trim()).eq("del_flag",0)); |
| | | if(ObjectUtils.isNotNull(manage)){ |
| | | equipment.setManageId(manage.getId()); |