|  |  | 
 |  |  | import com.ruoyi.common.core.domain.AjaxResult; | 
 |  |  | import com.ruoyi.common.core.page.TableDataInfo; | 
 |  |  | import com.ruoyi.common.enums.BusinessType; | 
 |  |  | import com.ruoyi.common.utils.StringUtils; | 
 |  |  | import com.ruoyi.common.utils.poi.ExcelUtil; | 
 |  |  | import com.ruoyi.project.domain.BaseOrganization; | 
 |  |  | import com.ruoyi.project.service.IBaseOrganizationService; | 
 |  |  | 
 |  |  |      * 查询机构管理列表 | 
 |  |  |      */ | 
 |  |  |     @ApiOperation("获取机构列表") | 
 |  |  |     //@PreAuthorize("@ss.hasPermi('project:organization:list')") | 
 |  |  |     //// @PreAuthorize("@ss.hasPermi('project:organization:list')") | 
 |  |  |     @GetMapping("/list") | 
 |  |  |     public TableDataInfo list(BaseOrganization baseOrganization) { | 
 |  |  |         log.info("获取机构列表{}:", baseOrganization); | 
 |  |  | 
 |  |  |      * 导出机构管理列表 | 
 |  |  |      */ | 
 |  |  |     @ApiOperation("导出机构信息") | 
 |  |  |     //@PreAuthorize("@ss.hasPermi('project:organization:export')") | 
 |  |  |     //// @PreAuthorize("@ss.hasPermi('project:organization:export')") | 
 |  |  |     @Log(title = "机构管理", businessType = BusinessType.EXPORT) | 
 |  |  |     @GetMapping("/export") | 
 |  |  |     public AjaxResult export(BaseOrganization baseOrganization) { | 
 |  |  | 
 |  |  |      * 获取机构管理详细信息 | 
 |  |  |      */ | 
 |  |  |     @ApiOperation("通过机构id获取机构信息") | 
 |  |  |     //@PreAuthorize("@ss.hasPermi('project:organization:query')") | 
 |  |  |     //// @PreAuthorize("@ss.hasPermi('project:organization:query')") | 
 |  |  |     @GetMapping(value = "/{id}") | 
 |  |  |     public AjaxResult getInfo(@PathVariable("id") Long id) { | 
 |  |  |         log.info("获取机构管理详细信息{}:", id); | 
 |  |  | 
 |  |  |      * 新增机构管理 | 
 |  |  |      */ | 
 |  |  |     @ApiOperation("新增机构信息") | 
 |  |  |     //@PreAuthorize("@ss.hasPermi('project:organization:add')") | 
 |  |  |     //// @PreAuthorize("@ss.hasPermi('project:organization:add')") | 
 |  |  |     @Log(title = "机构管理", businessType = BusinessType.INSERT) | 
 |  |  |     @PostMapping("/add") | 
 |  |  |     @RepeatSubmit | 
 |  |  |     public AjaxResult add(@RequestBody BaseOrganization baseOrganization) { | 
 |  |  |         log.info("新增机构信息{}:", baseOrganization); | 
 |  |  |         String organization = onlyValueCommon.addOnlyValue("organization"); | 
 |  |  |         //"0"+地市编码+医院类型+序号 | 
 |  |  |         baseOrganization.setOrganizationid("0" + baseOrganization.getRegionallevel() + baseOrganization.getHospitalnature() + organization); | 
 |  |  |  | 
 |  |  |         //"0"+地市编码+医院类型 | 
 |  |  |         String str = "0" + baseOrganization.getRegionallevel() + baseOrganization.getHospitalnature(); | 
 |  |  |         String maxOrganizationID = baseOrganizationService.getMaxOrganizationID(str + "__"); | 
 |  |  |         if (StringUtils.isNotBlank(maxOrganizationID)) { | 
 |  |  |             String result = maxOrganizationID.substring(str.length()); | 
 |  |  |             //获取序号,+1,生成新的序号 | 
 |  |  |             int xh = Integer.valueOf(result) + 1; | 
 |  |  |             if (String.valueOf(xh).length() > 1) { | 
 |  |  |                 baseOrganization.setOrganizationid(str + xh); | 
 |  |  |             } else { | 
 |  |  |                 baseOrganization.setOrganizationid(str + "0" + xh); | 
 |  |  |             } | 
 |  |  |         } else { | 
 |  |  |             baseOrganization.setOrganizationid(str + str + "01"); | 
 |  |  |         } | 
 |  |  |         boolean save = baseOrganizationService.save(baseOrganization); | 
 |  |  |         log.info("新增机构信息baseOrganization的ID{}:", baseOrganization.getId()); | 
 |  |  |         return AjaxResult.success(baseOrganization); | 
 |  |  | 
 |  |  |      * 修改机构管理 | 
 |  |  |      */ | 
 |  |  |     @ApiOperation("修改机构信息") | 
 |  |  |     //@PreAuthorize("@ss.hasPermi('project:organization:edit')") | 
 |  |  |     //// @PreAuthorize("@ss.hasPermi('project:organization:edit')") | 
 |  |  |     @Log(title = "机构管理", businessType = BusinessType.UPDATE) | 
 |  |  |     @PostMapping("/edit") | 
 |  |  |     @RepeatSubmit | 
 |  |  | 
 |  |  |      * 删除机构管理 | 
 |  |  |      */ | 
 |  |  |     @ApiOperation("删除机构信息") | 
 |  |  |     //@PreAuthorize("@ss.hasPermi('project:organization:remove')") | 
 |  |  |     //// @PreAuthorize("@ss.hasPermi('project:organization:remove')") | 
 |  |  |     @Log(title = "机构管理", businessType = BusinessType.DELETE) | 
 |  |  |     @GetMapping("/remove/{ids}") | 
 |  |  |     public AjaxResult remove(@PathVariable Long[] ids) { |