| 
					
				 | 
			
			
				@@ -0,0 +1,161 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+package com.huaxu.controller; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.baomidou.mybatisplus.core.metadata.IPage; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.huaxu.entity.GisSetting; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.huaxu.entity.SystemSetting; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.huaxu.model.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.huaxu.service.GisSettingService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.huaxu.service.SystemSettingService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.huaxu.util.UserUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import io.swagger.annotations.Api; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import io.swagger.annotations.ApiOperation; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import io.swagger.annotations.ApiParam; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.springframework.beans.factory.annotation.Autowired; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.springframework.web.bind.annotation.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.util.List; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+/** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ * 系统设置控制层 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ * @author yjy 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ * @since 2020-11-16 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+@RestController 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+@RequestMapping("/systemSetting") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+@Api(tags = "系统设置") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+public class SystemSettingController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 服务对象 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private SystemSettingService systemSettingService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private GisSettingService gisSettingService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 根据机构查询系统设置数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param companyOrgId 所属公司 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param deptOrgId 所属部门 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @return 单条数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @RequestMapping(value = "selectSystem", method = RequestMethod.GET) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @ApiOperation(value = "根据机构查询单条系统配置数据") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public AjaxMessage<SystemSetting> selectSystem( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            @ApiParam(value = "所属公司", required = false) @RequestParam(required = false) Integer companyOrgId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            @ApiParam(value = "所属部门", required = false) @RequestParam(required = false) Integer deptOrgId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+       if(companyOrgId==null&&deptOrgId==null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+           return new AjaxMessage<>(ResultStatus.PARAM_ERROR); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SystemSetting result = systemSettingService.selectSystem(companyOrgId,deptOrgId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return new AjaxMessage<>(ResultStatus.OK, result); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 保存系统配置数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param systemSetting 系统设置信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @RequestMapping(value = "saveSystem", method = RequestMethod.POST) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @ApiOperation(value = "保存单条系统配置数据") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public AjaxMessage<Boolean> saveSystem( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            @ApiParam(value = "系统设置信息", required = true) @RequestBody SystemSetting systemSetting) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        LoginUser currentUser = UserUtil.getCurrentUser(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if(systemSetting.getId()==null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            systemSetting.setCreateBy(currentUser.getUsername()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            systemSetting.setUpdateBy(currentUser.getUsername()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        systemSetting.setTenantId(currentUser.getTenantId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        systemSetting.setStatus(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        boolean result = systemSettingService.saveSystem(systemSetting); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return new AjaxMessage<>(ResultStatus.OK, result); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 根据机构查询Gis设置数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param companyOrgId 所属公司 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param deptOrgId 所属部门 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @RequestMapping(value = "selectGis", method = RequestMethod.GET) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @ApiOperation(value = "根据机构查询Gis配置数据") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public AjaxMessage<List<GisSetting>> selectGis( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            @ApiParam(value = "所属公司", required = false) @RequestParam(required = false) Integer companyOrgId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            @ApiParam(value = "所属部门", required = false) @RequestParam(required = false) Integer deptOrgId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            @ApiParam(value = "服务类型", required = false) @RequestParam(required = false) String serviceType) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if(companyOrgId==null&&deptOrgId==null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return new AjaxMessage<>(ResultStatus.PARAM_ERROR); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<GisSetting> result = gisSettingService.selectGis(companyOrgId,deptOrgId,serviceType); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return new AjaxMessage<>(ResultStatus.OK, result); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 根据机构分页查询Gis设置数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param companyOrgId 所属公司 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param deptOrgId 所属部门 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @RequestMapping(value = "selectPageGis", method = RequestMethod.GET) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @ApiOperation(value = "根据机构查询Gis配置数据") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public AjaxMessage<Pagination<GisSetting>> selectPageGis( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            @ApiParam(value = "页数", required = true)@RequestParam Integer pageNum, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            @ApiParam(value = "条数", required = true)@RequestParam Integer pageSize, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            @ApiParam(value = "所属公司", required = false) @RequestParam(required = false) Integer companyOrgId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            @ApiParam(value = "所属部门", required = false) @RequestParam(required = false) Integer deptOrgId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            @ApiParam(value = "服务类型", required = false) @RequestParam(required = false) String serviceType) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if(companyOrgId==null&&deptOrgId==null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return new AjaxMessage<>(ResultStatus.PARAM_ERROR); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        IPage<GisSetting> iPage = new Page<>(pageNum, pageSize); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        iPage = gisSettingService.selectPageGis(iPage, companyOrgId,deptOrgId,serviceType); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        Pagination<GisSetting> pages = new Pagination<>(iPage); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return new AjaxMessage<>(ResultStatus.OK, pages); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 新增系统配置数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param listGisSetting Gis设置信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @RequestMapping(value = "saveGis", method = RequestMethod.POST) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @ApiOperation(value = "保存多条GIS配置数据") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public AjaxMessage<Boolean> saveGis(@ApiParam(value = "系统设置信息", required = true) @RequestBody List<GisSetting> listGisSetting) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        LoginUser currentUser = UserUtil.getCurrentUser(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        for (GisSetting gis:listGisSetting) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Integer id = gis.getId() != null?gis.getId():gisSettingService.getId(gis.getCompanyOrgId(),gis.getDeptOrgId(),gis.getServiceType()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            //没有查询到数据则新增 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if(id==null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                gis.setCreateBy(currentUser.getUsername()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }else{//修改 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                gis.setId(id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                gis.setUpdateBy(currentUser.getUsername()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            gis.setTenantId(currentUser.getTenantId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            gis.setStatus(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        boolean result = gisSettingService.saveGis(listGisSetting); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return new AjaxMessage<>(ResultStatus.OK, result); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 删除一条数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param ids 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @return Response对象 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @RequestMapping(value = "deleteByGisIds", method = RequestMethod.POST) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @ApiOperation(value = "删除Gis配置信息") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public AjaxMessage<Boolean> deleteByGisIds(@ApiParam(value = "gis配置ids", required = true) @RequestBody Long[] ids) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        boolean result = gisSettingService.deleteByGisIds(ids); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return new AjaxMessage<>(ResultStatus.OK, result); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 |