【更新】代码修改
This commit is contained in:
parent
86b39ad494
commit
f4db2442b3
|
|
@ -1,4 +1,4 @@
|
||||||
package com.bonus.zlpt.company.api.domain;
|
package com.bonus.zlpt.system.api.domain;
|
||||||
|
|
||||||
import com.bonus.zlpt.common.core.annotation.Excel;
|
import com.bonus.zlpt.common.core.annotation.Excel;
|
||||||
import com.bonus.zlpt.common.core.web.domain.BaseEntity;
|
import com.bonus.zlpt.common.core.web.domain.BaseEntity;
|
||||||
|
|
@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.bonus.zlpt.common.core.annotation.Excel;
|
import com.bonus.zlpt.common.core.annotation.Excel;
|
||||||
import com.bonus.zlpt.common.core.annotation.Excel.ColumnType;
|
import com.bonus.zlpt.common.core.annotation.Excel.ColumnType;
|
||||||
import com.bonus.zlpt.common.core.web.domain.BaseEntity;
|
import com.bonus.zlpt.common.core.web.domain.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统访问记录表 sys_logininfor
|
* 系统访问记录表 sys_logininfor
|
||||||
|
|
@ -16,6 +17,7 @@ public class SysLogininfor extends BaseEntity
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** ID */
|
/** ID */
|
||||||
|
|
||||||
@Excel(name = "序号", cellType = ColumnType.NUMERIC)
|
@Excel(name = "序号", cellType = ColumnType.NUMERIC)
|
||||||
private Long infoId;
|
private Long infoId;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,10 @@ package com.bonus.zlpt.auth.controller;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import com.bonus.zlpt.auth.form.RegisterBody;
|
import com.bonus.zlpt.auth.form.RegisterBody;
|
||||||
|
import com.bonus.zlpt.common.core.enums.UserStatus;
|
||||||
|
import com.bonus.zlpt.system.api.domain.SysUser;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.bonus.zlpt.auth.form.LoginBody;
|
import com.bonus.zlpt.auth.form.LoginBody;
|
||||||
import com.bonus.zlpt.auth.service.SysLoginService;
|
import com.bonus.zlpt.auth.service.SysLoginService;
|
||||||
import com.bonus.zlpt.common.core.domain.R;
|
import com.bonus.zlpt.common.core.domain.R;
|
||||||
|
|
@ -18,6 +17,8 @@ import com.bonus.zlpt.common.security.service.TokenService;
|
||||||
import com.bonus.zlpt.common.security.utils.SecurityUtils;
|
import com.bonus.zlpt.common.security.utils.SecurityUtils;
|
||||||
import com.bonus.zlpt.system.api.model.LoginUser;
|
import com.bonus.zlpt.system.api.model.LoginUser;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* token 控制
|
* token 控制
|
||||||
*
|
*
|
||||||
|
|
@ -76,4 +77,36 @@ public class TokenController
|
||||||
sysLoginService.register(registerBody.getUsername(), registerBody.getPassword());
|
sysLoginService.register(registerBody.getUsername(), registerBody.getPassword());
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户注销
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping ("logOff")
|
||||||
|
public R<?> logOff(@RequestBody SysUser user)
|
||||||
|
{
|
||||||
|
|
||||||
|
user.setLoginDate(new Date());
|
||||||
|
user.setDelFlag(UserStatus.DELETED.getCode());
|
||||||
|
sysLoginService.logOff(user);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户注销
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping ("revokeLogOff")
|
||||||
|
public R<?> revokeLogOff(@RequestBody SysUser user)
|
||||||
|
{
|
||||||
|
|
||||||
|
user.setLoginDate(new Date());
|
||||||
|
user.setDelFlag(UserStatus.OK.getCode());
|
||||||
|
sysLoginService.logOff(user);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
package com.bonus.zlpt.auth.service;
|
package com.bonus.zlpt.auth.service;
|
||||||
|
|
||||||
|
import com.bonus.zlpt.common.core.utils.DateUtils;
|
||||||
|
import io.micrometer.core.instrument.util.TimeUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import com.bonus.zlpt.common.core.constant.CacheConstants;
|
import com.bonus.zlpt.common.core.constant.CacheConstants;
|
||||||
|
|
@ -18,6 +20,9 @@ import com.bonus.zlpt.system.api.RemoteUserService;
|
||||||
import com.bonus.zlpt.system.api.domain.SysUser;
|
import com.bonus.zlpt.system.api.domain.SysUser;
|
||||||
import com.bonus.zlpt.system.api.model.LoginUser;
|
import com.bonus.zlpt.system.api.model.LoginUser;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录校验方法
|
* 登录校验方法
|
||||||
*
|
*
|
||||||
|
|
@ -86,8 +91,13 @@ public class SysLoginService
|
||||||
|
|
||||||
LoginUser userInfo = userResult.getData();
|
LoginUser userInfo = userResult.getData();
|
||||||
SysUser user = userResult.getData().getSysUser();
|
SysUser user = userResult.getData().getSysUser();
|
||||||
if (UserStatus.DELETED.getCode().equals(user.getDelFlag()))
|
//新增逻辑 如果用户点击账户注销 那么修改用户账号状态为已删除,并设置最后的登录时间 一周之内可以登录并且可以撤销注销状态,如果一周之内没有撤销,那么将该账号数据物理删除
|
||||||
|
Date loginDate = DateUtils.addDays(user.getLoginDate(), 7);
|
||||||
|
//如果是删除状态,并且超出一周
|
||||||
|
if (UserStatus.DELETED.getCode().equals(user.getDelFlag()) && loginDate.after(new Date()))
|
||||||
{
|
{
|
||||||
|
//删除用户
|
||||||
|
removeUser(user.getUserId());
|
||||||
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "对不起,您的账号已被删除");
|
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "对不起,您的账号已被删除");
|
||||||
throw new ServiceException("对不起,您的账号:" + username + " 已被删除");
|
throw new ServiceException("对不起,您的账号:" + username + " 已被删除");
|
||||||
}
|
}
|
||||||
|
|
@ -140,4 +150,26 @@ public class SysLoginService
|
||||||
}
|
}
|
||||||
recordLogService.recordLogininfor(username, Constants.REGISTER, "注册成功");
|
recordLogService.recordLogininfor(username, Constants.REGISTER, "注册成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户id删除用户
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
public void removeUser(Long id){
|
||||||
|
|
||||||
|
remoteUserService.remove(new Long[]{id});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户注销或者撤销注销
|
||||||
|
* @param user
|
||||||
|
*/
|
||||||
|
public void logOff(SysUser user) {
|
||||||
|
|
||||||
|
remoteUserService.edit(user);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,5 +30,10 @@
|
||||||
<version>${swagger.fox.version}</version>
|
<version>${swagger.fox.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.bonus.zlpt</groupId>
|
||||||
|
<artifactId>zlpt-common-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,103 @@
|
||||||
|
package com.bonus.zlpt.common.swagger;
|
||||||
|
|
||||||
|
import com.bonus.zlpt.common.core.annotation.Excel;
|
||||||
|
import com.fasterxml.classmate.ResolvedType;
|
||||||
|
import com.fasterxml.classmate.TypeResolver;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.core.annotation.AnnotationUtils;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
import springfox.documentation.service.AllowableListValues;
|
||||||
|
import springfox.documentation.service.AllowableRangeValues;
|
||||||
|
import springfox.documentation.service.AllowableValues;
|
||||||
|
import springfox.documentation.spring.web.DescriptionResolver;
|
||||||
|
|
||||||
|
import java.lang.reflect.AnnotatedElement;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
public class ApiModelPropertiesExtend {
|
||||||
|
|
||||||
|
private static final Logger LOGGER = LoggerFactory.getLogger(ApiModelPropertiesExtend.class);
|
||||||
|
private static final Pattern RANGE_PATTERN = Pattern.compile("range([\\[(])(.*),(.*)([])])$");
|
||||||
|
|
||||||
|
private ApiModelPropertiesExtend() {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
static Function<Excel, AllowableValues> toAllowableValues() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static AllowableValues allowableValueFromString(String allowableValueString) {
|
||||||
|
AllowableValues allowableValues = new AllowableListValues(new ArrayList(), "LIST");
|
||||||
|
String trimmed = allowableValueString.trim();
|
||||||
|
Matcher matcher = RANGE_PATTERN.matcher(trimmed.replaceAll(" ", ""));
|
||||||
|
if (matcher.matches()) {
|
||||||
|
if (matcher.groupCount() != 4) {
|
||||||
|
LOGGER.warn("Unable to parse range specified {} correctly", trimmed);
|
||||||
|
} else {
|
||||||
|
allowableValues = new AllowableRangeValues(matcher.group(2).contains("infinity") ? null : matcher.group(2), matcher.group(1).equals("("), matcher.group(3).contains("infinity") ? null : matcher.group(3), matcher.group(4).equals(")"));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
List singleVal;
|
||||||
|
if (trimmed.contains(",")) {
|
||||||
|
singleVal = (List) Stream.of(trimmed.split(",")).map(String::trim).filter((item) -> {
|
||||||
|
return !item.isEmpty();
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
allowableValues = new AllowableListValues(singleVal, "LIST");
|
||||||
|
} else if (StringUtils.hasText(trimmed)) {
|
||||||
|
singleVal = Collections.singletonList(trimmed);
|
||||||
|
allowableValues = new AllowableListValues(singleVal, "LIST");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (AllowableValues)allowableValues;
|
||||||
|
}
|
||||||
|
|
||||||
|
static Function<Excel, String> toDescription(final DescriptionResolver descriptions) {
|
||||||
|
return (annotation) -> {
|
||||||
|
String description = "";
|
||||||
|
if (!StringUtils.isEmpty(annotation.name())) {
|
||||||
|
description = annotation.name();
|
||||||
|
}
|
||||||
|
|
||||||
|
return descriptions.resolve(description);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static Function<Excel, ResolvedType> toType(final TypeResolver resolver) {
|
||||||
|
return (annotation) -> {
|
||||||
|
|
||||||
|
return resolver.resolve(Object.class, new Type[0]);
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Optional<Excel> findApiModePropertyAnnotation(AnnotatedElement annotated) {
|
||||||
|
Optional<Excel> annotation = Optional.empty();
|
||||||
|
if (annotated instanceof Method) {
|
||||||
|
annotation = Optional.ofNullable((Excel) AnnotationUtils.findAnnotation((Method)annotated, Excel.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
return (Optional)annotation.map(Optional::of).orElse(Optional.ofNullable((Excel) AnnotationUtils.getAnnotation(annotated, Excel.class)));
|
||||||
|
}
|
||||||
|
|
||||||
|
static Function<Excel, String> toExample() {
|
||||||
|
return (annotation) -> {
|
||||||
|
String example = "";
|
||||||
|
return example;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,59 @@
|
||||||
|
package com.bonus.zlpt.common.swagger;
|
||||||
|
|
||||||
|
import com.bonus.zlpt.common.core.annotation.Excel;
|
||||||
|
import com.fasterxml.classmate.ResolvedType;
|
||||||
|
import com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition;
|
||||||
|
import org.springframework.core.annotation.Order;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import springfox.documentation.schema.Annotations;
|
||||||
|
import springfox.documentation.schema.ModelSpecification;
|
||||||
|
import springfox.documentation.schema.property.ModelSpecificationFactory;
|
||||||
|
import springfox.documentation.service.AllowableValues;
|
||||||
|
import springfox.documentation.spi.schema.contexts.ModelPropertyContext;
|
||||||
|
import springfox.documentation.spring.web.DescriptionResolver;
|
||||||
|
import springfox.documentation.swagger.schema.ApiModelPropertyPropertyBuilder;
|
||||||
|
|
||||||
|
import java.lang.reflect.AnnotatedElement;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* swagger扩展
|
||||||
|
*/
|
||||||
|
//@Component
|
||||||
|
//@Order(-2147482649)
|
||||||
|
public class ApiModelPropertyPropertyBuilderExtend extends ApiModelPropertyPropertyBuilder {
|
||||||
|
|
||||||
|
private final DescriptionResolver descriptions;
|
||||||
|
private final ModelSpecificationFactory modelSpecifications;
|
||||||
|
|
||||||
|
public ApiModelPropertyPropertyBuilderExtend(DescriptionResolver descriptions, ModelSpecificationFactory modelSpecifications, DescriptionResolver descriptions1, ModelSpecificationFactory modelSpecifications1) {
|
||||||
|
super(descriptions, modelSpecifications);
|
||||||
|
this.descriptions = descriptions1;
|
||||||
|
this.modelSpecifications = modelSpecifications1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void apply(ModelPropertyContext context) {
|
||||||
|
System.err.println("开始加载");
|
||||||
|
Optional<Excel> annotation = Optional.empty();
|
||||||
|
if (context.getAnnotatedElement().isPresent()) {
|
||||||
|
System.err.println("1");
|
||||||
|
annotation = (Optional)annotation.map(Optional::of).orElse(ApiModelPropertiesExtend.findApiModePropertyAnnotation((AnnotatedElement)context.getAnnotatedElement().get()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (context.getBeanPropertyDefinition().isPresent()) {
|
||||||
|
System.err.println("2");
|
||||||
|
annotation = (Optional)annotation.map(Optional::of).orElse(Annotations.findPropertyAnnotation((BeanPropertyDefinition)context.getBeanPropertyDefinition().get(), Excel.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (annotation.isPresent()) {
|
||||||
|
ModelSpecification modelSpecification = (ModelSpecification)annotation.map((a) -> {
|
||||||
|
return !a.defaultValue().isEmpty() ? this.modelSpecifications.create(context.getOwner(), (ResolvedType)ApiModelPropertiesExtend.toType(context.getResolver()).apply(a)) : null;
|
||||||
|
}).orElse(null);
|
||||||
|
context.getSpecificationBuilder().description((String)annotation.map(ApiModelPropertiesExtend.toDescription(this.descriptions)).orElse(null));
|
||||||
|
|
||||||
|
context.getBuilder().allowableValues((AllowableValues)annotation.map(ApiModelPropertiesExtend.toAllowableValues()).orElse(null));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
# config.com.bonus.zlpt.common.swagger.SwaggerAutoConfiguration
|
# config.com.bonus.zlpt.common.swagger.SwaggerAutoConfiguration
|
||||||
# config.com.bonus.zlpt.common.swagger.SwaggerWebConfiguration
|
# config.com.bonus.zlpt.common.swagger.SwaggerWebConfiguration
|
||||||
# config.com.bonus.zlpt.common.swagger.SwaggerBeanPostProcessor
|
# config.com.bonus.zlpt.common.swagger.SwaggerBeanPostProcessor
|
||||||
|
# com.bonus.zlpt.common.swagger.ApiModelPropertyPropertyBuilderExtend
|
||||||
|
|
|
||||||
|
|
@ -14,12 +14,14 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 192.168.0.14:8848
|
# server-addr: 192.168.0.14:8848
|
||||||
namespace: zlpt_cloud_dev
|
server-addr: 10.40.92.74:8848
|
||||||
|
# namespace: zlpt_cloud_dev
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 192.168.0.14:8848
|
# server-addr: 192.168.0.14:8848
|
||||||
namespace: zlpt_cloud_dev
|
server-addr: 10.40.92.74:8848
|
||||||
|
# namespace: zlpt_cloud_dev
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
@ -35,7 +37,8 @@ spring:
|
||||||
datasource:
|
datasource:
|
||||||
ds1:
|
ds1:
|
||||||
nacos:
|
nacos:
|
||||||
server-addr: 192.168.0.14:8848
|
# server-addr: 192.168.0.14:8848
|
||||||
|
server-addr: 10.40.92.74:8848
|
||||||
dataId: sentinel-zlpt-gateway
|
dataId: sentinel-zlpt-gateway
|
||||||
groupId: DEFAULT_GROUP
|
groupId: DEFAULT_GROUP
|
||||||
data-type: json
|
data-type: json
|
||||||
|
|
|
||||||
|
|
@ -10,16 +10,19 @@ spring:
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: zlpt_cloud_dev
|
active: zlpt_cloud_dev
|
||||||
|
# active: default
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 192.168.0.14:8848
|
# server-addr: 192.168.0.14:8848
|
||||||
namespace: zlpt_cloud_dev
|
server-addr: 10.40.92.74:8848
|
||||||
|
# namespace: zlpt_cloud_dev
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 192.168.0.14:8848
|
# server-addr: 192.168.0.14:8848
|
||||||
namespace: zlpt_cloud_dev
|
server-addr: 10.40.92.74:8848
|
||||||
|
# namespace: zlpt_cloud_dev
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||||
update bm_company_info set status = '2'
|
update bm_company_info set status = '4'
|
||||||
where company_id = #{companyId,jdbcType=INTEGER}
|
where company_id = #{companyId,jdbcType=INTEGER}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,8 @@ import com.bonus.zlpt.common.core.web.page.TableDataInfo;
|
||||||
import com.bonus.zlpt.common.log.annotation.Log;
|
import com.bonus.zlpt.common.log.annotation.Log;
|
||||||
import com.bonus.zlpt.common.log.enums.BusinessType;
|
import com.bonus.zlpt.common.log.enums.BusinessType;
|
||||||
import com.bonus.zlpt.common.security.annotation.RequiresPermissions;
|
import com.bonus.zlpt.common.security.annotation.RequiresPermissions;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import com.bonus.zlpt.equip.service.IDevInfoService;
|
import com.bonus.zlpt.equip.service.IDevInfoService;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
@ -26,6 +28,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/dev")
|
@RequestMapping("/dev")
|
||||||
|
@Api(value = "设备信息",tags = "设备管理")
|
||||||
public class DevInfoController extends BaseController
|
public class DevInfoController extends BaseController
|
||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
|
||||||
|
|
@ -14,12 +14,12 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 192.168.0.14:8848
|
server-addr: 10.40.92.74:8848
|
||||||
namespace: zlpt_cloud_dev
|
# namespace: zlpt_cloud_dev
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 192.168.0.14:8848
|
server-addr: 10.40.92.74:8848
|
||||||
namespace: zlpt_cloud_dev
|
# namespace: zlpt_cloud_dev
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
package com.bonus.zlpt.company.controller;
|
package com.bonus.zlpt.system.controller;
|
||||||
|
|
||||||
import com.bonus.zlpt.common.core.web.controller.BaseController;
|
import com.bonus.zlpt.common.core.web.controller.BaseController;
|
||||||
import com.bonus.zlpt.common.core.web.domain.AjaxResult;
|
import com.bonus.zlpt.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.zlpt.company.api.domain.BaseAddress;
|
import com.bonus.zlpt.system.api.domain.BaseAddress;
|
||||||
import com.bonus.zlpt.company.service.BaseAddressService;
|
import com.bonus.zlpt.system.service.BaseAddressService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package com.bonus.zlpt.company.mapper;
|
package com.bonus.zlpt.system.mapper;
|
||||||
|
|
||||||
import com.bonus.zlpt.company.api.domain.BaseAddress;
|
import com.bonus.zlpt.system.api.domain.BaseAddress;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
package com.bonus.zlpt.company.service;
|
package com.bonus.zlpt.system.service;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import com.bonus.zlpt.company.api.domain.BaseAddress;
|
import com.bonus.zlpt.system.api.domain.BaseAddress;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
package com.bonus.zlpt.company.service.impl;
|
package com.bonus.zlpt.system.service.impl;
|
||||||
|
|
||||||
import com.bonus.zlpt.company.api.domain.BaseAddress;
|
import com.bonus.zlpt.system.api.domain.BaseAddress;
|
||||||
import com.bonus.zlpt.company.mapper.BaseAddressMapper;
|
|
||||||
import com.bonus.zlpt.company.service.BaseAddressService;
|
import com.bonus.zlpt.system.mapper.BaseAddressMapper;
|
||||||
|
import com.bonus.zlpt.system.service.BaseAddressService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.bonus.zlpt.company.mapper.BaseAddressMapper">
|
<mapper namespace="com.bonus.zlpt.system.mapper.BaseAddressMapper">
|
||||||
|
|
||||||
|
|
||||||
<select id="selectEconomizeAddress" resultType="com.bonus.zlpt.company.api.domain.BaseAddress">
|
<select id="selectEconomizeAddress" resultType="com.bonus.zlpt.system.api.domain.BaseAddress">
|
||||||
select * from base_address where level = 1
|
select * from base_address where level = 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectAddress" resultType="com.bonus.zlpt.company.api.domain.BaseAddress">
|
<select id="selectAddress" resultType="com.bonus.zlpt.system.api.domain.BaseAddress">
|
||||||
select * from base_address where parent_code = #{code}
|
select * from base_address where parent_code = #{code}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
@ -193,7 +193,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="password != null and password != ''">password = #{password},</if>
|
<if test="password != null and password != ''">password = #{password},</if>
|
||||||
<if test="status != null and status != ''">status = #{status},</if>
|
<if test="status != null and status != ''">status = #{status},</if>
|
||||||
<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if>
|
<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if>
|
||||||
<if test="loginDate != null">login_date = #{loginDate},</if>
|
<!-- <if test="loginDate != null">login_date = #{loginDate},</if>-->
|
||||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||||
<if test="remark != null">remark = #{remark},</if>
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
update_time = sysdate()
|
update_time = sysdate()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue