优化
This commit is contained in:
parent
6e5435d2e7
commit
9ea76b7165
10
pom.xml
10
pom.xml
@ -252,16 +252,16 @@
|
||||
</dependency>
|
||||
|
||||
<!--mysql-->
|
||||
<dependency>
|
||||
<!-- <dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>5.1.48</version>
|
||||
</dependency>
|
||||
<!--<dependency>
|
||||
</dependency>-->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>8.0.11</version>
|
||||
</dependency>-->
|
||||
<version>8.0.33</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger API文档 -->
|
||||
<dependency>
|
||||
|
||||
@ -14,6 +14,7 @@ import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IGovernmentService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
|
||||
import com.zhgd.xmgl.modules.basicdata.vo.GovernmentVo;
|
||||
import com.zhgd.xmgl.util.CommonUtil;
|
||||
import com.zhgd.xmgl.valid.AddGroup;
|
||||
import com.zhgd.xmgl.valid.EditGroup;
|
||||
import io.swagger.annotations.Api;
|
||||
@ -85,6 +86,7 @@ public class GovernmentController {
|
||||
public Result<List<Government>> queryList(@RequestBody Government government) {
|
||||
Result<List<Government>> result = new Result<List<Government>>();
|
||||
QueryWrapper<Government> queryWrapper = QueryGenerator.initQueryWrapper(government);
|
||||
queryWrapper.lambda().ne(Government::getParentId, 0);
|
||||
List<Government> list = governmentService.list(queryWrapper);
|
||||
result.setSuccess(true);
|
||||
result.setResult(list);
|
||||
@ -126,6 +128,10 @@ public class GovernmentController {
|
||||
public Result<Government> add(@RequestBody @Validated(AddGroup.class) GovernmentVo governmentVo) {
|
||||
Result<Government> result = new Result<Government>();
|
||||
try {
|
||||
if (!CommonUtil.checkStrongPwd(governmentVo.getPassword())) {
|
||||
result.error500("密码必须包含数字、大小写字母、特殊符号且大于8位");
|
||||
return result;
|
||||
}
|
||||
// 检验政务账号是否已存在
|
||||
SystemUser systemUser = systemUserService.getOne(Wrappers.<SystemUser>lambdaQuery().eq(SystemUser::getAccount, governmentVo.getAccount()));
|
||||
if (systemUser != null) {
|
||||
@ -156,6 +162,10 @@ public class GovernmentController {
|
||||
if(governmentEntity==null) {
|
||||
result.error500("未找到对应实体");
|
||||
}else {
|
||||
if (!CommonUtil.checkStrongPwd(governmentVo.getPassword())) {
|
||||
result.error500("密码必须包含数字、大小写字母、特殊符号且大于8位");
|
||||
return result;
|
||||
}
|
||||
// 检验政务账号是否已存在
|
||||
SystemUser systemUser = systemUserService.getOne(Wrappers.<SystemUser>lambdaQuery().eq(SystemUser::getAccount, governmentVo.getAccount())
|
||||
.ne(SystemUser::getSn, governmentEntity.getGovernmentSn()));
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package com.zhgd.xmgl.modules.basicdata.controller.admin;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
@ -12,12 +10,12 @@ import com.zhgd.xmgl.modules.basicdata.entity.Government;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.ModuleTemplate;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IGovernmentService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IModuleTemplateService;
|
||||
import com.zhgd.xmgl.modules.basicdata.vo.ModuleTemplateVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@ -27,7 +25,6 @@ import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@ -63,23 +60,17 @@ public class ModuleTemplateController {
|
||||
@ApiImplicitParam(name = "moduleTemplates", value = "政务模块模板信息", paramType = "body", required = true, defaultValue = "10", dataType = "Integer")
|
||||
})
|
||||
@PostMapping(value = "/saveOrUpdate")
|
||||
public Result<ModuleTemplate> saveOrUpdate(@ApiIgnore @RequestBody Map<String, Object> map) {
|
||||
public Result<ModuleTemplate> saveOrUpdate(@ApiIgnore @RequestBody ModuleTemplateVo moduleTemplateVo) {
|
||||
Result<ModuleTemplate> result = new Result<ModuleTemplate>();
|
||||
Object templates = MapUtils.getObject(map, "moduleTemplates");
|
||||
List<ModuleTemplate> moduleTemplates = JSONArray.parseArray(JSON.toJSONString(templates), ModuleTemplate.class);
|
||||
String governmentSn = MapUtils.getString(map, "governmentSn");
|
||||
Integer moduleType = MapUtils.getInteger(map, "moduleType");
|
||||
Integer enterpriseType = MapUtils.getInteger(map, "enterpriseType");
|
||||
Integer moduleStyle = MapUtils.getInteger(map, "moduleStyle");
|
||||
if (moduleTemplates == null || moduleTemplates.size() == 0) {
|
||||
if (moduleTemplateVo.getModuleTemplates() == null || moduleTemplateVo.getModuleTemplates().size() == 0) {
|
||||
moduleTemplateService.remove(Wrappers.<ModuleTemplate>lambdaQuery()
|
||||
.eq(ModuleTemplate::getGovernmentSn, governmentSn));
|
||||
.eq(ModuleTemplate::getGovernmentSn, moduleTemplateVo.getGovernmentSn()));
|
||||
} else {
|
||||
List<Long> newIds = moduleTemplates.stream().map(m -> m.getAuthorityId()).collect(Collectors.toList());
|
||||
List<Long> newIds = moduleTemplateVo.getModuleTemplates().stream().map(m -> m.getAuthorityId()).collect(Collectors.toList());
|
||||
List<Long> oldIds = moduleTemplateService.list(Wrappers.<ModuleTemplate>lambdaQuery()
|
||||
.eq(ModuleTemplate::getGovernmentSn, governmentSn)
|
||||
.eq(ModuleTemplate::getModuleType, moduleType)
|
||||
.eq(enterpriseType != null, ModuleTemplate::getEnterpriseType, enterpriseType))
|
||||
.eq(ModuleTemplate::getGovernmentSn, moduleTemplateVo.getGovernmentSn())
|
||||
.eq(ModuleTemplate::getModuleType, moduleTemplateVo.getModuleType())
|
||||
.eq(moduleTemplateVo.getEnterpriseType() != null, ModuleTemplate::getEnterpriseType, moduleTemplateVo.getEnterpriseType()))
|
||||
.stream().map(m -> m.getAuthorityId()).collect(Collectors.toList());
|
||||
List<Long> addIds = new ArrayList<>();
|
||||
List<Long> delIds = new ArrayList<>();
|
||||
@ -95,18 +86,18 @@ public class ModuleTemplateController {
|
||||
}
|
||||
if (delIds.size() > 0) {
|
||||
moduleTemplateService.remove(Wrappers.<ModuleTemplate>lambdaQuery()
|
||||
.eq(ModuleTemplate::getGovernmentSn, governmentSn)
|
||||
.eq(ModuleTemplate::getModuleType, moduleType)
|
||||
.eq(enterpriseType != null, ModuleTemplate::getEnterpriseType, enterpriseType)
|
||||
.eq(ModuleTemplate::getGovernmentSn, moduleTemplateVo.getGovernmentSn())
|
||||
.eq(ModuleTemplate::getModuleType, moduleTemplateVo.getModuleType())
|
||||
.eq(moduleTemplateVo.getEnterpriseType() != null, ModuleTemplate::getEnterpriseType, moduleTemplateVo.getEnterpriseType())
|
||||
.in(ModuleTemplate::getAuthorityId, delIds));
|
||||
}
|
||||
if (addIds.size() > 0) {
|
||||
moduleTemplateService.saveBatch(moduleTemplates.stream().filter(m -> addIds.contains(m.getAuthorityId())).collect(Collectors.toList()));
|
||||
moduleTemplateService.saveBatch(moduleTemplateVo.getModuleTemplates().stream().filter(m -> addIds.contains(m.getAuthorityId())).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
LambdaUpdateWrapper<Government> wrapper = Wrappers.<Government>lambdaUpdate();
|
||||
wrapper.set(Government::getModuleStyle, moduleStyle);
|
||||
wrapper.eq(Government::getGovernmentSn, governmentSn);
|
||||
wrapper.set(Government::getModuleStyle, moduleTemplateVo.getModuleStyle());
|
||||
wrapper.eq(Government::getGovernmentSn, moduleTemplateVo.getGovernmentSn());
|
||||
governmentService.update(wrapper);
|
||||
result.success("操作成功!");
|
||||
return result;
|
||||
|
||||
@ -29,7 +29,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
@ -59,9 +58,6 @@ public class SystemUserAuthController {
|
||||
@Autowired
|
||||
private JwtTokenProvider jwtTokenProvider;
|
||||
|
||||
@Autowired
|
||||
private RedisTemplate redisTemplate;
|
||||
|
||||
@Autowired
|
||||
private ISystemRoleService systemRoleService;
|
||||
|
||||
|
||||
@ -75,6 +75,7 @@ public class SystemUserDataScopeController {
|
||||
if(!user.isManager()) {
|
||||
List<String> engineeringSns = systemUserDataScopeService.list(Wrappers.<SystemUserDataScope>lambdaQuery()
|
||||
.eq(SystemUserDataScope::getUserId, SecurityUtil.getUser().getUserId())).stream().map(s -> s.getRelevanceId()).collect(Collectors.toList());
|
||||
engineeringSns.add("0");
|
||||
wrapper.in(Engineering::getEngineeringSn, engineeringSns);
|
||||
} else if (user.getAccountType() == 4) {
|
||||
|
||||
|
||||
@ -8,6 +8,7 @@ import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IEnterpriseService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
|
||||
import com.zhgd.xmgl.modules.basicdata.vo.EnterpriseVo;
|
||||
import com.zhgd.xmgl.util.CommonUtil;
|
||||
import com.zhgd.xmgl.valid.AddGroup;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@ -51,6 +52,10 @@ public class EntEnterpriseController {
|
||||
@PostMapping(value = "/add")
|
||||
public Result<Enterprise> add(@RequestBody @Validated(AddGroup.class) EnterpriseVo enterpriseVo) {
|
||||
Result<Enterprise> result = new Result<Enterprise>();
|
||||
if (!CommonUtil.checkStrongPwd(enterpriseVo.getPassword())) {
|
||||
result.error500("密码必须包含数字、大小写字母、特殊符号且大于8位");
|
||||
return result;
|
||||
}
|
||||
// 检验企业账号是否已存在
|
||||
SystemUser systemUser = systemUserService.getOne(Wrappers.<SystemUser>lambdaQuery().eq(SystemUser::getAccount, enterpriseVo.getAccount()));
|
||||
if (systemUser != null) {
|
||||
|
||||
@ -13,6 +13,7 @@ import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
|
||||
import com.zhgd.xmgl.modules.basicdata.vo.ProjectVo;
|
||||
import com.zhgd.xmgl.security.SecurityUser;
|
||||
import com.zhgd.xmgl.security.SecurityUtil;
|
||||
import com.zhgd.xmgl.util.CommonUtil;
|
||||
import com.zhgd.xmgl.valid.AddGroup;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@ -60,6 +61,10 @@ public class ProjectController {
|
||||
@PostMapping(value = "/add")
|
||||
public Result<Project> add(@RequestBody @Validated(AddGroup.class) ProjectVo projectVo) {
|
||||
Result<Project> result = new Result<Project>();
|
||||
if (!CommonUtil.checkStrongPwd(projectVo.getShowPassword())) {
|
||||
result.error500("密码必须包含数字、大小写字母、特殊符号且大于8位");
|
||||
return result;
|
||||
}
|
||||
// 检验该政务项目数是否已满
|
||||
int install = projectService.count(Wrappers.<Project>lambdaQuery().eq(Project::getGovernmentSn, projectVo.getGovernmentSn())
|
||||
.eq(Project::getState, 1));
|
||||
|
||||
@ -314,6 +314,7 @@ public class BaseMenuServiceImpl extends ServiceImpl<BaseMenuMapper, BaseMenu> i
|
||||
@Override
|
||||
public boolean delInfo(Long menuId) {
|
||||
baseActionMapper.delete(Wrappers.<BaseAction>lambdaQuery().eq(BaseAction::getMenuId, menuId));
|
||||
this.remove(Wrappers.<BaseMenu>lambdaQuery().eq(BaseMenu::getParentId, menuId));
|
||||
return this.removeById(menuId);
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,28 @@
|
||||
package com.zhgd.xmgl.modules.basicdata.vo;
|
||||
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.ModuleTemplate;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "权限配置(VO)", description = "ModuleTemplateVo")
|
||||
public class ModuleTemplateVo {
|
||||
|
||||
@ApiModelProperty(value="政务SN")
|
||||
private String governmentSn;
|
||||
|
||||
@ApiModelProperty(value="2政务模块; 3企业模块,4项目模块")
|
||||
private String moduleType;
|
||||
|
||||
@ApiModelProperty(value="企业主体类型")
|
||||
private String enterpriseType;
|
||||
|
||||
@ApiModelProperty(value="系统版本(对应的模块风格1:标准版; 2:星璇版本; 3:衢州版本)")
|
||||
private String moduleStyle;
|
||||
|
||||
@ApiModelProperty(value="政务模块模板信息")
|
||||
private List<ModuleTemplate> moduleTemplates;
|
||||
}
|
||||
@ -3,7 +3,7 @@ http.port=6023
|
||||
server.port=6688
|
||||
# 数据库配置
|
||||
#182.90.224.147
|
||||
spring.datasource.url=jdbc:mysql://localhost:3306/wisdomsitezw?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&useSSL=false
|
||||
spring.datasource.url=jdbc:mysql://localhost:3306/wisdomsitezw?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8
|
||||
# 数据库加密配置
|
||||
#spring.datasource.username=ENC(XR4C/hvTYCUqudS49Wh/jA==)
|
||||
#spring.datasource.password=ENC(hHkiHEc6vSWjqfOtg2/2Uiihs0vX3l7V)
|
||||
@ -29,9 +29,9 @@ spring.file-storage.minio[0].platform=minio-1
|
||||
spring.file-storage.minio[0].enable-storage=true
|
||||
spring.file-storage.minio[0].access-key=minioadmin
|
||||
spring.file-storage.minio[0].secret-key=minioadmin
|
||||
spring.file-storage.minio[0].end-point=http://182.90.224.147:9000
|
||||
spring.file-storage.minio[0].end-point=http://jxjzw.zhgdyun.com:9001
|
||||
spring.file-storage.minio[0].bucket-name=wisdomisitezw
|
||||
spring.file-storage.minio[0].domain=http://182.90.224.147:9000/wisdomisitezw/
|
||||
spring.file-storage.minio[0].domain=http://jxjzw.zhgdyun.com:9001/wisdomsitezw/
|
||||
spring.file-storage.minio[0].base-path=
|
||||
#spring.file-storage.default-platform=local
|
||||
#spring.file-storage.thumbnail-suffix=.jpg
|
||||
@ -50,14 +50,6 @@ license.publicKeysStorePath=D:/license_demo/client/publicCerts.keystore
|
||||
spring.boot.admin.client.instance.service-url=http://localhost:6023
|
||||
spring.boot.admin.client.instance.name=dev
|
||||
|
||||
#视频监控API
|
||||
#artemisConfig.host=182.101.141.23:18443
|
||||
#artemisConfig.appKey=24017757
|
||||
#artemisConfig.appSecret=VJz0FbzmE6drPQ7egsBi
|
||||
artemisConfig.host=120.236.122.37:81
|
||||
artemisConfig.appKey=27543152
|
||||
artemisConfig.appSecret=Xyi1y9udD7dGFGsS9d9w
|
||||
|
||||
#opencv截取视频画面文件地址
|
||||
opencv.filePath=D://opencv//
|
||||
|
||||
|
||||
@ -11,14 +11,14 @@ spring.datasource.password=JXJ@admin
|
||||
# 文件存储路径
|
||||
basePath=D:/itbgpImage/
|
||||
# 文件访问路径
|
||||
imagePath=http://192.168.34.155:6688/image/
|
||||
imagePath=http://jxjzw.zhgdyun.com:6688/image/
|
||||
|
||||
swagger.enable=true
|
||||
# mqtt主题
|
||||
mqtt-scope=devTopic
|
||||
# redis 配置
|
||||
spring.redis.database=1
|
||||
spring.redis.host=182.90.224.147
|
||||
spring.redis.host=139.9.66.234
|
||||
spring.redis.password=JXJ@admin
|
||||
spring.redis.port=6379
|
||||
#文件存储配置
|
||||
@ -28,9 +28,9 @@ spring.file-storage.minio[0].platform=minio-1
|
||||
spring.file-storage.minio[0].enable-storage=true
|
||||
spring.file-storage.minio[0].access-key=minioadmin
|
||||
spring.file-storage.minio[0].secret-key=minioadmin
|
||||
spring.file-storage.minio[0].end-point=http://182.90.224.147:9000
|
||||
spring.file-storage.minio[0].end-point=http://jxjzw.zhgdyun.com:9001
|
||||
spring.file-storage.minio[0].bucket-name=wisdomisitezw
|
||||
spring.file-storage.minio[0].domain=http://182.90.224.147:9000/wisdomisitezw/
|
||||
spring.file-storage.minio[0].domain=http://jxjzw.zhgdyun.com:9001/wisdomisitezw/
|
||||
spring.file-storage.minio[0].base-path=
|
||||
#spring.file-storage.default-platform=local
|
||||
#spring.file-storage.thumbnail-suffix=.jpg
|
||||
@ -49,11 +49,6 @@ license.publicKeysStorePath=D:/license_demo/client/publicCerts.keystore
|
||||
spring.boot.admin.client.instance.service-url=http://localhost:6023
|
||||
spring.boot.admin.client.instance.name=dev
|
||||
|
||||
#视频监控API
|
||||
artemisConfig.host=182.101.141.23:18443
|
||||
artemisConfig.appKey=24017757
|
||||
artemisConfig.appSecret=VJz0FbzmE6drPQ7egsBi
|
||||
|
||||
#opencv截取视频画面文件地址
|
||||
opencv.filePath=D://opencv//
|
||||
|
||||
@ -71,7 +66,3 @@ magic-api.security.username=admin
|
||||
magic-api.security.password=JXJ@admin
|
||||
|
||||
ufop.localStoragePath=D://zhgd3//qiwenfile
|
||||
|
||||
spring.kafka.bootstrap-servers=106.38.108.76:29092
|
||||
#https://kafka.apache.org/documentation/#consumerconfigs
|
||||
spring.kafka.consumer.group-id=xmgl-group
|
||||
@ -44,8 +44,8 @@ spring.servlet.multipart.max-file-size=1024MB
|
||||
spring.servlet.multipart.max-request-size=1024MB
|
||||
spring.servlet.multipart.resolve-lazily=false
|
||||
# mqtt服务器配置
|
||||
mqtt.host=tcp://182.90.224.147:1883
|
||||
mqtt.clientId=mqttx_babdgaoqu
|
||||
mqtt.host=tcp://jxjzw.zhgdyun.com:1883
|
||||
mqtt.clientId=mqttx_babd9e97
|
||||
mqtt.username=admin
|
||||
mqtt.password=JXJ@admin
|
||||
mqtt.topic=test-topic/#
|
||||
@ -92,7 +92,7 @@ is-license=false
|
||||
security.enable=true
|
||||
|
||||
ufop.storage-type=3
|
||||
ufop.minio.endpoint=http://182.90.224.147:9000
|
||||
ufop.minio.endpoint=http://jxjzw.zhgdyun.com:9001
|
||||
ufop.minio.accessKey=minioadmin
|
||||
ufop.minio.secretKey=minioadmin
|
||||
ufop.minio.bucketName=qiwen
|
||||
@ -107,8 +107,5 @@ magic-api.response-code.exception=500
|
||||
#mac用户请改为可读写的目录
|
||||
#如果不想存到文件中,可以参考配置将接口信息存到数据库、Redis中(或自定义)
|
||||
|
||||
spring.kafka.bootstrap-servers=106.38.108.76:29092
|
||||
spring.kafka.consumer.group-id=xmgl-group
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user