系统配置

This commit is contained in:
huangzj
2023-07-05 13:54:42 +08:00
parent 1b3013e87a
commit e2a1818dd3
24 changed files with 660 additions and 7 deletions

View File

@@ -0,0 +1,39 @@
package com.njcn.cssystem.pojo.param;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
*
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/4/3 19:17【需求编号】
*
* @author clam
* @version V1.0.0
*/
/**
* app基础信息表
*/
@Data
public class AppBaseInformationAddParm {
/**
* 内容
*/
@ApiModelProperty(value = "内容")
@NotBlank(message="内容不能为空!")
private String content;
/**
* 类型(字典数据)
*/
@ApiModelProperty(value = "类型")
@NotBlank(message="类型不能为空!")
private String type;
}

View File

@@ -0,0 +1,69 @@
package com.njcn.cssystem.pojo.param;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
*
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/4/3 19:17【需求编号】
*
* @author clam
* @version V1.0.0
*/
/**
* app个人中心-设置信息
*/
@Data
public class AppPersonSetAddParm {
/**
* 用户协议(基础信息id)
*/
@ApiModelProperty(value = "用户协议(基础信息id)")
@NotBlank(message="用户协议不能为空!")
private String userAgreement;
/**
* 系统介绍(基础信息id)
*/
@ApiModelProperty(value = "系统介绍(基础信息id)")
@NotBlank(message="系统介绍不能为空!")
private String systemIntroduction;
/**
* 使用手册(基础信息id)
*/
@ApiModelProperty(value = "使用手册(基础信息id)")
@NotBlank(message="使用手册不能为空!")
private String userManual;
/**
* 资料库(基础信息id)
*/
@ApiModelProperty(value = "资料库(基础信息id)")
@NotBlank(message="资料库不能为空!")
private String dataBase;
/**
* 公司介绍(基础信息id)
*/
@ApiModelProperty(value = "公司介绍(基础信息id)")
@NotBlank(message="公司介绍不能为空!")
private String companyProfile;
/**
* 关于我们(基础信息id)
*/
@ApiModelProperty(value = "关于我们(基础信息id)")
@NotBlank(message="关于我们id不能为空")
private String aboutUs;
}

View File

@@ -0,0 +1,45 @@
package com.njcn.cssystem.pojo.po;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.njcn.db.bo.BaseEntity;
import lombok.Data;
import org.influxdb.annotation.Column;
/**
*
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/4/3 19:17【需求编号】
*
* @author clam
* @version V1.0.0
*/
/**
* app基础信息表
*/
@Data
@TableName(value = "app_base_information")
public class AppBaseInformationPO extends BaseEntity {
/**
* id
*/
@TableId(value = "id", type = IdType.ASSIGN_UUID)
private String id;
/**
* 内容
*/
@TableField(value = "content")
private String content;
/**
* 类型(字典数据)
*/
@TableField(value = "type")
private String type;
}

View File

@@ -0,0 +1,72 @@
package com.njcn.cssystem.pojo.po;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.njcn.db.bo.BaseEntity;
import lombok.Data;
/**
*
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/4/3 19:17【需求编号】
*
* @author clam
* @version V1.0.0
*/
/**
* app个人中心-设置信息
*/
@Data
@TableName(value = "app_person_set")
public class AppPersonSetPO extends BaseEntity {
/**
* id
*/
@TableField(value = "id")
private String id;
/**
* 用户协议(基础信息id)
*/
@TableField(value = "user_agreement")
private String userAgreement;
/**
* 系统介绍(基础信息id)
*/
@TableField(value = "system_introduction")
private String systemIntroduction;
/**
* 使用手册(基础信息id)
*/
@TableField(value = "user_manual")
private String userManual;
/**
* 资料库(基础信息id)
*/
@TableField(value = "data_base")
private String dataBase;
/**
* 公司介绍(基础信息id)
*/
@TableField(value = "company_profile")
private String companyProfile;
/**
* 关于我们(基础信息id)
*/
@TableField(value = "about_us")
private String aboutUs;
/**
* 状态(0删除 1正常)
*/
@TableField(value = "status")
private String status;
}

View File

@@ -0,0 +1,41 @@
package com.njcn.cssystem.pojo.vo;
import com.njcn.db.bo.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/4/3 19:17【需求编号】
*
* @author clam
* @version V1.0.0
*/
/**
* app基础信息表
*/
@Data
public class AppBaseInformationVO extends BaseEntity {
/**
* id
*/
@ApiModelProperty(value = "id")
private String id;
/**
* 内容
*/
@ApiModelProperty(value = "内容")
private String content;
/**
* 类型(字典数据)
*/
@ApiModelProperty(value = "类型")
private String type;
}

View File

@@ -0,0 +1,86 @@
package com.njcn.cssystem.pojo.vo;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
*
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/3/27 10:24【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
public class AppProjectVO {
/**
* 项目Id
*/
private String id;
/**
* 项目名称
*/
private String name;
private String engineeringId;
private String engineeringName;
/**
* 用户名称
*/
private String userName;
/**
* 区域名称
*/
private String area;
/**
* 拓扑图路径
*/
private List<String> topologyDiagramPaths;
/**
* 中心点经度
*/
private BigDecimal lng;
/**
* 中心点纬度
*/
private BigDecimal lat;
/**
* 0删除 1正常
*/
private String status;
/**
* 创建用户
*/
private String createBy;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新用户
*/
private String updateBy;
/**
* 更新时间
*/
private Date updateTime;
private String description;
}

View File

@@ -55,6 +55,12 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
<version>3.5.1</version>
</dependency>
</dependencies>
<build>

View File

@@ -6,6 +6,7 @@ import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.DependsOn;
/**
@@ -17,7 +18,6 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@MapperScan("com.njcn.**.mapper")
@EnableFeignClients(basePackages = "com.njcn")
@SpringBootApplication(scanBasePackages = "com.njcn")
@EnableMPP
public class CsSystemBootApplication {
public static void main(String[] args) {

View File

@@ -0,0 +1,118 @@
package com.njcn.cssystem.controller.baseinfo;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.cssystem.pojo.param.AppBaseInformationAddParm;
import com.njcn.cssystem.pojo.param.AppPersonSetAddParm;
import com.njcn.cssystem.pojo.po.AppBaseInformationPO;
import com.njcn.cssystem.pojo.po.AppPersonSetPO;
import com.njcn.cssystem.pojo.vo.AppBaseInformationVO;
import com.njcn.cssystem.service.AppBaseInformationService;
import com.njcn.cssystem.service.AppPersonSetService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/4/4 9:02【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Slf4j
@RestController
@RequestMapping("/appinfo")
@Api(tags = "app信息")
@AllArgsConstructor
public class AppInfoController extends BaseController {
private final AppBaseInformationService appBaseInformationService;
private final AppPersonSetService appPersonSetService;
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/addAppInfo")
@ApiOperation("新增/更新app基础信息")
@ApiImplicitParam(name = "AppBaseInformationAddParm", value = "新增app基础信息参数", required = true)
public HttpResult<Boolean> addAppInfo(@RequestBody @Validated AppBaseInformationAddParm AppBaseInformationAddParm){
String methodDescribe = getMethodDescribe("addAppInfo");
AppBaseInformationPO appBaseInformationPO = new AppBaseInformationPO ();
BeanUtils.copyProperties (AppBaseInformationAddParm, appBaseInformationPO);
QueryWrapper<AppBaseInformationPO> query = new QueryWrapper();
query.eq("type",AppBaseInformationAddParm.getType());
boolean save =false;
List<AppBaseInformationPO> list = appBaseInformationService.list(query);
if (CollectionUtil.isNotEmpty(list)) {
appBaseInformationPO = list.get(0);
appBaseInformationPO.setContent(AppBaseInformationAddParm.getContent());
save = appBaseInformationService.updateById(appBaseInformationPO);
}else{
save = appBaseInformationService.save (appBaseInformationPO);
}
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, save, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/addPersonSet")
@ApiOperation("新增app个人中心信息")
@ApiImplicitParam(name = "appPersonSetAddParm", value = "新增apppp个人中心信参数", required = true)
public HttpResult<Boolean> addPersonSet(@RequestBody @Validated AppPersonSetAddParm appPersonSetAddParm){
String methodDescribe = getMethodDescribe("addPersonSet");
AppPersonSetPO appPersonSetPO = new AppPersonSetPO ();
BeanUtils.copyProperties (appPersonSetAddParm, appPersonSetPO);
appPersonSetPO.setStatus ("1");
boolean save = appPersonSetService.save (appPersonSetPO);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, save, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryPersonSet")
@ApiOperation("查询app个人中心信息")
public HttpResult<AppPersonSetPO> queryPersonSet(){
String methodDescribe = getMethodDescribe("queryPersonSet");
List<AppPersonSetPO> list = appPersonSetService.list ( );
AppPersonSetPO appPersonSetPO = list.stream ( ).filter (temp -> Objects.equals ("1", temp.getStatus ( ))).collect (Collectors.toList ( )).get (0);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, appPersonSetPO, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryAppInfo")
@ApiOperation("查询app个人中心信息详情")
public HttpResult<AppBaseInformationVO> queryPersonSet(@RequestParam("id")String id ){
String methodDescribe = getMethodDescribe("queryPersonSet");
AppBaseInformationVO appBaseInformationVO = new AppBaseInformationVO();
AppBaseInformationPO byId = appBaseInformationService.getById (id);
BeanUtils.copyProperties (byId,appBaseInformationVO);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, appBaseInformationVO, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryAppInfoByType")
@ApiOperation("查询app个人中心信息详情")
public HttpResult<AppBaseInformationVO> queryAppInfoByType(@RequestParam("type")String type ){
String methodDescribe = getMethodDescribe("queryAppInfoByType");
AppBaseInformationVO appBaseInformationVO = new AppBaseInformationVO();
AppBaseInformationPO byId = appBaseInformationService.getByType(type);
BeanUtils.copyProperties (byId,appBaseInformationVO);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, appBaseInformationVO, methodDescribe);
}
}

View File

@@ -0,0 +1,16 @@
package com.njcn.cssystem.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.cssystem.pojo.po.AppBaseInformationPO;
/**
*
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/4/3 19:17【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface AppBaseInformationMapper extends BaseMapper<AppBaseInformationPO> {
}

View File

@@ -0,0 +1,16 @@
package com.njcn.cssystem.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.cssystem.pojo.po.AppPersonSetPO;
/**
*
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/4/3 19:17【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface AppPersonSetMapper extends BaseMapper<AppPersonSetPO> {
}

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.cssystem.mapper.AppPersonSetMapper">
<resultMap id="BaseResultMap" type="com.njcn.cssystem.pojo.po.AppPersonSetPO">
<!--@mbg.generated-->
<!--@Table app_person_set-->
<result column="id" jdbcType="VARCHAR" property="id" />
<result column="user_agreement" jdbcType="TINYINT" property="userAgreement" />
<result column="system_introduction" jdbcType="TINYINT" property="systemIntroduction" />
<result column="user_manual" jdbcType="TINYINT" property="userManual" />
<result column="data_base" jdbcType="TINYINT" property="dataBase" />
<result column="company_profile" jdbcType="TINYINT" property="companyProfile" />
<result column="about_us" jdbcType="TINYINT" property="aboutUs" />
<result column="status" jdbcType="BOOLEAN" property="status" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, user_agreement, system_introduction, user_manual, data_base, company_profile,
about_us, `status`, create_by, create_time, update_by, update_time
</sql>
</mapper>

View File

@@ -0,0 +1,19 @@
package com.njcn.cssystem.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.cssystem.pojo.po.AppBaseInformationPO;
/**
*
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/4/3 19:17【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface AppBaseInformationService extends IService<AppBaseInformationPO>{
AppBaseInformationPO getByType(String type);
}

View File

@@ -0,0 +1,18 @@
package com.njcn.cssystem.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.cssystem.pojo.po.AppPersonSetPO;
/**
*
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/4/3 19:17【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface AppPersonSetService extends IService<AppPersonSetPO>{
}

View File

@@ -0,0 +1,28 @@
package com.njcn.cssystem.service.impl;
import com.njcn.cssystem.mapper.AppBaseInformationMapper;
import com.njcn.cssystem.pojo.po.AppBaseInformationPO;
import com.njcn.cssystem.service.AppBaseInformationService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
*
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/4/3 19:17【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Service
public class AppBaseInformationServiceImpl extends ServiceImpl<AppBaseInformationMapper, AppBaseInformationPO> implements AppBaseInformationService {
@Override
public AppBaseInformationPO getByType(String type) {
return this.lambdaQuery().eq(AppBaseInformationPO::getType,type).one();
}
}

View File

@@ -0,0 +1,23 @@
package com.njcn.cssystem.service.impl;
import com.njcn.cssystem.mapper.AppPersonSetMapper;
import com.njcn.cssystem.pojo.po.AppPersonSetPO;
import com.njcn.cssystem.service.AppPersonSetService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
*
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/4/3 19:17【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Service
public class AppPersonSetServiceImpl extends ServiceImpl<AppPersonSetMapper, AppPersonSetPO> implements AppPersonSetService {
}

View File

@@ -29,7 +29,7 @@ spring:
shared-configs:
- data-id: share-config.yaml
refresh: true
- data-Id: share-config-datasource-db.yaml
- data-Id: algorithm-config.yaml
refresh: true
main:
allow-bean-definition-overriding: true