Browse Source

Merge remote-tracking branch 'origin/master'

hym 4 years ago
parent
commit
75673cd06b

+ 161 - 0
sms_water/src/main/java/com/huaxu/controller/SystemSettingController.java

@@ -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);
+    }
+
+}

+ 18 - 0
sms_water/src/main/java/com/huaxu/dao/GisSettingMapper.java

@@ -0,0 +1,18 @@
+package com.huaxu.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.huaxu.entity.GisSetting;
+import org.apache.ibatis.annotations.Mapper;
+
+
+/**
+ *
+ * Gis设置Dao接口
+ *
+ * @author yjy
+ * @since 2020-11-16
+ */
+@Mapper
+public interface GisSettingMapper extends BaseMapper<GisSetting> {
+
+}

+ 18 - 0
sms_water/src/main/java/com/huaxu/dao/SystemSettingMapper.java

@@ -0,0 +1,18 @@
+package com.huaxu.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.huaxu.entity.SystemSetting;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ *
+ * 系统设置Dao接口
+ *
+ * @author yjy
+ * @since 2020-11-16
+ */
+@Mapper
+public interface SystemSettingMapper extends BaseMapper<SystemSetting> {
+
+
+}

+ 90 - 0
sms_water/src/main/java/com/huaxu/entity/GisSetting.java

@@ -0,0 +1,90 @@
+package com.huaxu.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * Gis设置(sms_gis_setting)实体类
+ *
+ * @author yjy
+ * @since 2020-11-16
+ */
+@Data
+@ApiModel
+@TableName("sms_gis_setting")
+public class GisSetting implements Serializable {
+    private static final long serialVersionUID = 269554608076349144L;
+    /**
+     * 主键
+     */
+    @ApiModelProperty(value = "主键")
+    @TableId(value = "id", type= IdType.AUTO)
+    private Integer id;
+    /**
+     * 租户标识
+     */
+    @ApiModelProperty(value = "租户标识")
+    private String tenantId;
+    /**
+     * 所属公司
+     */
+    @ApiModelProperty(value = "所属公司")
+    private Integer companyOrgId;
+    /**
+     * 所属部门
+     */
+    @ApiModelProperty(value = "所属部门")
+    private Integer deptOrgId;
+    /**
+     * 外网设置
+     */
+    @ApiModelProperty(value = "外网设置")
+    private String extranetSetting;
+    /**
+     * 内网设置
+     */
+    @ApiModelProperty(value = "内网设置")
+    private String intranetSetting;
+    /**
+     * 服务类型
+     */
+    @ApiModelProperty(value = "服务类型")
+    private String serviceType;
+    /**
+     * 数据删除标识
+     */
+    @ApiModelProperty(value = "数据删除标识")
+    @TableLogic
+    private Integer status;
+    /**
+     * 创建人
+     */
+    @ApiModelProperty(value = "创建人")
+    private String createBy;
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
+    @ApiModelProperty(value = "创建时间")
+    private Date dateCreate;
+    /**
+     * 更新人
+     */
+    @ApiModelProperty(value = "更新人")
+    private String updateBy;
+    /**
+     * 更新时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
+    @ApiModelProperty(value = "更新时间")
+    private Date dateUpdate;
+}

+ 95 - 0
sms_water/src/main/java/com/huaxu/entity/SystemSetting.java

@@ -0,0 +1,95 @@
+package com.huaxu.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 系统设置(sms_system_setting)实体类
+ *
+ * @author yjy
+ * @since 2020-11-16
+ */
+@Data
+@ApiModel
+@TableName("sms_system_setting")
+public class SystemSetting implements Serializable {
+    private static final long serialVersionUID = 269554608076349144L;
+    /**
+     * 主键
+     */
+    @ApiModelProperty(value = "主键")
+    @TableId(value = "id", type= IdType.AUTO)
+    private Integer id;
+    /**
+     * 租户标识
+     */
+    @ApiModelProperty(value = "租户标识")
+    private String tenantId;
+    /**
+     * 所属公司
+     */
+    @ApiModelProperty(value = "所属公司")
+    private Integer companyOrgId;
+    /**
+     * 所属部门
+     */
+    @ApiModelProperty(value = "所属部门")
+    private Integer deptOrgId;
+    /**
+     * 地图数据刷新频率
+     */
+    @ApiModelProperty(value = "地图数据刷新频率")
+    private Integer mapDataRefresh;
+    /**
+     * 概览页数据刷新频率
+     */
+    @ApiModelProperty(value = "概览页数据刷新频率")
+    private Integer firstPageRefresh;
+    /**
+     * 工艺图数据刷新频率
+     */
+    @ApiModelProperty(value = "工艺图数据刷新频率")
+    private Integer processDrawingRefresh;
+    /**
+     * 地图悬浮参数是否显示
+     */
+    @ApiModelProperty(value = "地图悬浮参数是否显示")
+    private Integer mapSuspensionDisplay;
+    /**
+     * 数据删除标识
+     */
+    @ApiModelProperty(value = "数据删除标识")
+    @TableLogic
+    private Integer status;
+    /**
+     * 创建人
+     */
+    @ApiModelProperty(value = "创建人")
+    private String createBy;
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
+    @ApiModelProperty(value = "创建时间")
+    private Date dateCreate;
+    /**
+     * 更新人
+     */
+    @ApiModelProperty(value = "更新人")
+    private String updateBy;
+    /**
+     * 更新时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
+    @ApiModelProperty(value = "更新时间")
+    private Date dateUpdate;
+}

+ 118 - 0
sms_water/src/main/java/com/huaxu/service/GisSettingService.java

@@ -0,0 +1,118 @@
+package com.huaxu.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.huaxu.dao.GisSettingMapper;
+import com.huaxu.entity.GisSetting;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Gis设置服务接口
+ *
+ * @author yjy
+ * @since 2020-11-16
+ */
+@Service
+public class GisSettingService extends ServiceImpl<GisSettingMapper, GisSetting> {
+
+    /**
+     * 根据机构查询Gis设置数据
+     *
+     * @param companyOrgId 所属公司
+     * @param deptOrgId 所属部门
+     * @param serviceType 服务类型
+     * @return 单条数据
+     */
+    public List<GisSetting> selectGis(Integer companyOrgId,Integer deptOrgId,String serviceType){
+        List<GisSetting> res=new ArrayList<GisSetting>();
+        if(deptOrgId != null) {
+            if(serviceType == null){
+                res = this.list(new QueryWrapper<GisSetting>().eq("DEPT_ORG_ID",deptOrgId));
+            }else{
+                res = this.list(new QueryWrapper<GisSetting>().eq("DEPT_ORG_ID",deptOrgId).eq("SERVICE_TYPE",serviceType));
+            }
+        } else if(companyOrgId != null){
+            if(serviceType == null){
+                res = this.list(new QueryWrapper<GisSetting>().eq("COMPANY_ORG_ID",companyOrgId));
+            }else {
+                res = this.list(new QueryWrapper<GisSetting>().eq("COMPANY_ORG_ID",companyOrgId).eq("SERVICE_TYPE",serviceType));
+            }
+
+        }
+        return res;
+    }
+    /**
+     * 根据机构查询Gis设置数据
+     *
+     * @param page 分页信息
+     * @param companyOrgId 所属公司
+     * @param deptOrgId 所属部门
+     * @param serviceType 服务类型
+     * @return 单条数据
+     */
+    public IPage<GisSetting> selectPageGis(IPage<GisSetting> page,Integer companyOrgId,Integer deptOrgId,String serviceType){
+        IPage<GisSetting> res=new Page<GisSetting>();
+        if(deptOrgId != null) {
+            if(serviceType == null){
+                res = this.page(page,new QueryWrapper<GisSetting>().eq("DEPT_ORG_ID",deptOrgId));
+            }else{
+                res = this.page(page,new QueryWrapper<GisSetting>().eq("DEPT_ORG_ID",deptOrgId).eq("SERVICE_TYPE",serviceType));
+            }
+        } else if(companyOrgId != null){
+            if(serviceType == null){
+                res = this.page(page,new QueryWrapper<GisSetting>().eq("COMPANY_ORG_ID",companyOrgId));
+            }else {
+                res = this.page(page,new QueryWrapper<GisSetting>().eq("COMPANY_ORG_ID",companyOrgId).eq("SERVICE_TYPE",serviceType));
+            }
+
+        }
+        return res;
+    }
+    /**
+     * 保存数据
+     *
+     * @param listGisSetting
+     * @return
+     */
+    public boolean saveGis(List<GisSetting> listGisSetting) {
+        return this.saveOrUpdateBatch(listGisSetting);
+    }
+    /**
+     * 根据条件获取id
+     *
+     * @param companyOrgId 所属公司
+     * @param deptOrgId 所属部门
+     * @param serviceType 服务类型
+     * @return
+     */
+    public Integer getId(Integer companyOrgId,Integer deptOrgId,String serviceType) {
+        Integer id = null;
+        GisSetting res=new GisSetting();
+        if(deptOrgId != null) {
+            res= this.getOne(new QueryWrapper<GisSetting>().eq("DEPT_ORG_ID",deptOrgId).eq("SERVICE_TYPE",serviceType));
+        }else if(companyOrgId != null){
+            res= this.getOne(new QueryWrapper<GisSetting>().eq("COMPANY_ORG_ID",companyOrgId).eq("SERVICE_TYPE",serviceType));
+        }
+        if(res != null) {
+            id=res.getId();
+        }
+        return id;
+    }
+    /**
+     * 删除数据
+     *
+     * @param ids
+     * @return
+     */
+    public boolean deleteByGisIds(Long[] ids) {
+        return this.removeByIds(Arrays.asList(ids));
+    }
+
+}

+ 47 - 0
sms_water/src/main/java/com/huaxu/service/SystemSettingService.java

@@ -0,0 +1,47 @@
+package com.huaxu.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.huaxu.dao.SystemSettingMapper;
+import com.huaxu.entity.SystemSetting;
+import org.springframework.stereotype.Service;
+
+/**
+ * 系统设置服务接口
+ *
+ * @author yjy
+ * @since 2020-11-16
+ */
+@Service
+public class SystemSettingService  extends ServiceImpl<SystemSettingMapper,SystemSetting> {
+
+    /**
+     * 根据机构查询单条数据
+     *
+     * @param companyOrgId 所属公司
+     * @param deptOrgId 所属部门
+     * @return 单条数据
+     */
+    public SystemSetting selectSystem(Integer companyOrgId,Integer deptOrgId){
+        SystemSetting res=new SystemSetting();
+        if(deptOrgId!=null) {
+            res = this.getOne(new QueryWrapper<SystemSetting>().eq("DEPT_ORG_ID", deptOrgId));
+        } else if(companyOrgId!=null){
+            res = this.getOne(new QueryWrapper<SystemSetting>().eq("COMPANY_ORG_ID", companyOrgId));
+        }
+        return res;
+    }
+    /**
+     * 保存数据
+     *
+     * @param systemSetting 系统设置信息
+     * @return
+     */
+    public boolean saveSystem(SystemSetting systemSetting) {
+        return this.saveOrUpdate(systemSetting);
+    }
+
+
+
+}